@trycourier/react-designer 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -2
- package/dist/cjs/index.js +61 -57
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/styles.css +454 -145
- package/dist/components/BrandEditor/Editor/Editor.d.ts +16 -1
- package/dist/components/Providers/useTemplateActions.d.ts +2 -2
- package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Email/EmailEditor.d.ts +2 -1
- package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBarItemDetails/SideBarItemDetails.d.ts +2 -1
- package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Inbox/InboxLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/MSTeams/MSTeams.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/MSTeams/MSTeamsLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Push/PushLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/SMS/SMSLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Slack/Slack.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Slack/SlackLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/useChannels.d.ts +8 -0
- package/dist/components/TemplateEditor/TemplateEditor.d.ts +16 -1
- package/dist/components/TemplateEditor/index.d.ts +2 -14
- package/dist/components/TemplateEditor/store.d.ts +10 -0
- package/dist/components/extensions/Blockquote/BlockquoteForm.d.ts +2 -1
- package/dist/components/extensions/Button/ButtonForm.d.ts +2 -1
- package/dist/components/extensions/Column/ColumnForm.d.ts +2 -1
- package/dist/components/extensions/CustomCode/CustomCodeForm.d.ts +2 -1
- package/dist/components/extensions/Divider/DividerForm.d.ts +2 -1
- package/dist/components/extensions/ImageBlock/components/ImageBlockForm.d.ts +2 -1
- package/dist/components/extensions/List/List.d.ts +15 -0
- package/dist/components/extensions/List/List.types.d.ts +38 -0
- package/dist/components/extensions/List/ListComponent.d.ts +12 -0
- package/dist/components/extensions/List/ListForm.d.ts +9 -0
- package/dist/components/extensions/List/index.d.ts +4 -0
- package/dist/components/extensions/ListItem/ListItem.d.ts +34 -0
- package/dist/components/extensions/ListItem/ListItem.types.d.ts +7 -0
- package/dist/components/extensions/ListItem/ListItemComponent.d.ts +7 -0
- package/dist/components/extensions/ListItem/index.d.ts +2 -0
- package/dist/components/extensions/TextBlock/TextBlockForm.d.ts +2 -1
- package/dist/components/extensions/Variable/Variable.d.ts +8 -4
- package/dist/components/extensions/Variable/Variable.types.d.ts +3 -14
- package/dist/components/extensions/Variable/VariableSuggestions.d.ts +7 -0
- package/dist/components/extensions/Variable/index.d.ts +1 -0
- package/dist/components/extensions/Variable/suggestion.d.ts +2 -0
- package/dist/components/extensions/extension-kit.d.ts +7 -2
- package/dist/components/extensions/index.d.ts +2 -0
- package/dist/components/ui/Blocks/ListBlock/ListBlock.d.ts +2 -0
- package/dist/components/ui/Blocks/ListBlock/index.d.ts +1 -0
- package/dist/components/ui/Blocks/index.d.ts +1 -0
- package/dist/components/ui/FormHeader/FormHeader.d.ts +3 -2
- package/dist/components/ui/SortableItemWrapper/SortableItemWrapper.d.ts +3 -1
- package/dist/components/ui/TextMenu/config.d.ts +2 -0
- package/dist/components/ui/TextMenu/hooks/useTextmenuCommands.d.ts +4 -0
- package/dist/components/ui/TextMenu/hooks/useTextmenuStates.d.ts +2 -0
- package/dist/components/ui/VariableEditor/VariableAutocomplete.d.ts +16 -0
- package/dist/components/ui/VariableEditor/VariableChipBase.d.ts +2 -0
- package/dist/components/ui-kit/Icon/UnorderedListIcon.d.ts +3 -0
- package/dist/components/ui-kit/Icon/index.d.ts +1 -1
- package/dist/esm/index.js +61 -57
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/styles.css +454 -145
- package/dist/index.d.ts +14 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/styles.css +454 -145
- package/dist/types/elemental.types.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/validation.types.d.ts +53 -0
- package/package.json +1 -1
- package/dist/components/ui-kit/Icon/BulletListIcon.d.ts +0 -3
|
@@ -25,6 +25,12 @@ export interface ElementalListNode extends IsElementalNode {
|
|
|
25
25
|
/** Allows bullets to be rendered using an image */
|
|
26
26
|
imgSrc?: string;
|
|
27
27
|
imgHref?: string;
|
|
28
|
+
/** Border/marker color for list bullets or numbers */
|
|
29
|
+
border_color?: string;
|
|
30
|
+
/** Border width in pixels (e.g., "2px" or "2") */
|
|
31
|
+
border_size?: string;
|
|
32
|
+
/** Padding (e.g., "10px" or "10px 20px") */
|
|
33
|
+
padding?: string;
|
|
28
34
|
}
|
|
29
35
|
export interface ElementalListItemNode extends IsElementalNode {
|
|
30
36
|
type: "list-item";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for custom variable validation in the editor.
|
|
3
|
+
* Allows consumers to restrict which variable names are allowed and
|
|
4
|
+
* define the behavior when validation fails.
|
|
5
|
+
*/
|
|
6
|
+
export interface VariableValidationConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Custom validator function that runs AFTER built-in format validation passes
|
|
9
|
+
* (unless `overrideFormatValidation` is true).
|
|
10
|
+
*
|
|
11
|
+
* @param variableName - The variable name to validate (without curly braces)
|
|
12
|
+
* @returns true if the variable is allowed, false otherwise
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Only allow variables from a predefined list
|
|
17
|
+
* validate: (name) => ['user.name', 'user.email', 'order.total'].includes(name)
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
validate?: (variableName: string) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Behavior when validation fails.
|
|
23
|
+
* - 'mark': Keep the chip with invalid styling (default, shows red styling)
|
|
24
|
+
* - 'remove': Delete the chip entirely
|
|
25
|
+
*
|
|
26
|
+
* @default 'mark'
|
|
27
|
+
*/
|
|
28
|
+
onInvalid?: "mark" | "remove";
|
|
29
|
+
/**
|
|
30
|
+
* Message to show as a toast notification when validation fails.
|
|
31
|
+
* Can be a static string or a function that receives the variable name
|
|
32
|
+
* for dynamic messages.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Static message
|
|
37
|
+
* invalidMessage: "This variable is not available"
|
|
38
|
+
*
|
|
39
|
+
* // Dynamic message
|
|
40
|
+
* invalidMessage: (name) => `Variable "${name}" is not in the allowed list`
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
invalidMessage?: string | ((variableName: string) => string);
|
|
44
|
+
/**
|
|
45
|
+
* If true, bypasses the built-in format validation entirely.
|
|
46
|
+
* Only the custom `validate` function will be used for validation.
|
|
47
|
+
*
|
|
48
|
+
* Use with caution - invalid formats may cause issues with downstream processing.
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
overrideFormatValidation?: boolean;
|
|
53
|
+
}
|
package/package.json
CHANGED