-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix inconsistent pb element save-behavior in editor
- Loading branch information
1 parent
a239a47
commit b28739a
Showing
11 changed files
with
57 additions
and
27 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/app-page-builder-elements/src/renderers/components/EmptyElement.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
import styled from "@emotion/styled"; | ||
|
||
const EmptyElementWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
min-height: 100px; | ||
${props => props.theme.styles.typography.paragraphs.stylesById("paragraph1")}; | ||
color: ${props => props.theme.styles.colors["color4"]}; | ||
`; | ||
|
||
type EmptyElementProps = { | ||
message: string; | ||
}; | ||
|
||
export const EmptyElement = ({ message }: EmptyElementProps) => { | ||
return <EmptyElementWrapper>{message}</EmptyElementWrapper>; | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/app-page-builder-elements/src/renderers/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./DefaultLinkComponent"; | ||
export * from "./EmptyElement"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/app-page-builder/src/editor/recoil/actions/createElement/action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { UpdateDocumentActionEvent } from "~/editor/recoil/actions/updateDocument"; | ||
import { CreateElementEventActionArgsType } from "./types"; | ||
import { EventActionCallable } from "~/types"; | ||
|
||
export const createElementAction: EventActionCallable<CreateElementEventActionArgsType> = () => { | ||
return { | ||
actions: [] | ||
actions: [new UpdateDocumentActionEvent()] | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters