@trycourier/react-designer 0.0.0-canary-20260102172800 → 0.0.0-canary-20260105180635
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/dist/cjs/index.js +60 -56
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/styles.css +335 -145
- package/dist/components/Providers/useTemplateActions.d.ts +2 -2
- package/dist/components/TemplateEditor/index.d.ts +1 -13
- package/dist/components/extensions/List/List.d.ts +15 -0
- package/dist/components/extensions/List/List.types.d.ts +9 -0
- package/dist/components/extensions/List/ListComponent.d.ts +12 -0
- package/dist/components/extensions/List/index.d.ts +2 -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/index.d.ts +2 -0
- 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/VariableChipBase.d.ts +2 -0
- package/dist/esm/index.js +60 -56
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/styles.css +335 -145
- package/dist/index.d.ts +13 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/styles.css +335 -145
- package/dist/types/elemental.types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -19,8 +19,8 @@ export declare function useTemplateActions(): {
|
|
|
19
19
|
setTemplateError: (error: string | TemplateError | null) => void;
|
|
20
20
|
templateData: import("./store").TenantData | null;
|
|
21
21
|
setTemplateData: (args_0: import("./store").TenantData | ((prev: import("./store").TenantData | null) => import("./store").TenantData | null) | null) => void;
|
|
22
|
-
templateEditorContent: import("
|
|
23
|
-
setTemplateEditorContent: (content: import("
|
|
22
|
+
templateEditorContent: import("../..").ElementalContent | null | undefined;
|
|
23
|
+
setTemplateEditorContent: (content: import("../..").ElementalContent | null | undefined) => void;
|
|
24
24
|
createCustomError: (message: string, toastProps?: import("sonner").ExternalToast) => TemplateError;
|
|
25
25
|
convertLegacyError: (error: string | TemplateError) => TemplateError;
|
|
26
26
|
/**
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export { BrandFooter } from "@/components/BrandEditor/Editor/BrandFooter";
|
|
2
|
-
export { PreviewPanel } from "@/components/ui/PreviewPanel";
|
|
3
|
-
export { TextMenu } from "@/components/ui/TextMenu";
|
|
4
|
-
export { cn, convertElementalToTiptap, convertTiptapToElemental } from "@/lib/utils";
|
|
5
|
-
export { VariableInput, VariableTextarea } from "@/components/ui/VariableEditor";
|
|
6
|
-
export { getFlattenedVariables } from "@/components/utils/getFlattenedVariables";
|
|
7
2
|
export { useChannels, getChannelDefaults } from "./Channels";
|
|
8
3
|
export { default as EmailEditor } from "./Channels/Email/EmailEditor";
|
|
9
4
|
export * from "./TemplateEditor";
|
|
@@ -11,20 +6,13 @@ export { SideBar as EmailSideBar, SideBarItemDetails as EmailSideBarItemDetails,
|
|
|
11
6
|
export { SideBar as InboxSideBar } from "./Channels/Inbox/SideBar";
|
|
12
7
|
export { MSTeamsSideBar } from "./Channels/MSTeams/SideBar";
|
|
13
8
|
export { SlackSideBar, SlackSideBarItemDetails } from "./Channels/Slack/SideBar";
|
|
9
|
+
export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type MSTeamsEditorProps, type PushEditorProps, type SlackEditorProps, type SMSEditorProps, } from "./Channels";
|
|
14
10
|
export declare const EmailChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").EmailProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
15
11
|
export declare const SMSChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SMSProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
16
12
|
export declare const PushChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").PushProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
17
13
|
export declare const InboxChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").InboxProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
18
14
|
export declare const MSTeamsChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").MSTeamsProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
19
15
|
export declare const SlackChannel: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Channels").SlackProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
20
|
-
export { EmailEditorContainer, EmailEditorMain, type EmailEditorProps, type InboxEditorProps, type MSTeamsEditorProps, type PushEditorProps, type SlackEditorProps, type SMSEditorProps, } from "./Channels";
|
|
21
|
-
export { CHANNELS } from "@/channels";
|
|
22
|
-
export type { ChannelType } from "@/store";
|
|
23
|
-
export type { ElementalContent } from "@/types";
|
|
24
16
|
export { ChannelRootContainer, EditorSidebar } from "./Layout";
|
|
25
17
|
export { InboxEditor, MSTeamsEditor, PushEditor, SlackEditor, SMSEditor } from "./Channels";
|
|
26
|
-
export { useAutoSave } from "@/hooks/useAutoSave";
|
|
27
18
|
export { useDebouncedFlush } from "./hooks/useDebouncedFlush";
|
|
28
|
-
export { Status as TemplateStatus } from "@/components/ui/Status";
|
|
29
|
-
export { MonacoCodeEditor } from "@/components/extensions/CustomCode/MonacoCodeEditor";
|
|
30
|
-
export { ToggleGroup } from "@/components/ui-kit";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import type { ListProps } from "./List.types";
|
|
3
|
+
declare module "@tiptap/core" {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
list: {
|
|
6
|
+
setList: (props?: Partial<ListProps>) => ReturnType;
|
|
7
|
+
toggleList: () => ReturnType;
|
|
8
|
+
toggleOrderedList: () => ReturnType;
|
|
9
|
+
toggleBulletList: () => ReturnType;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultListProps: ListProps;
|
|
14
|
+
export declare const List: Node<any, any>;
|
|
15
|
+
export default List;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ListProps {
|
|
2
|
+
/** Whether the list is ordered (numbered) or unordered (bulleted) */
|
|
3
|
+
listType: "ordered" | "unordered";
|
|
4
|
+
/** Unique identifier for the list node */
|
|
5
|
+
id?: string;
|
|
6
|
+
/** Locale-specific content overrides */
|
|
7
|
+
locales?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare const defaultListProps: ListProps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NodeViewProps } from "@tiptap/react";
|
|
2
|
+
/**
|
|
3
|
+
* List NodeView component that renders the list.
|
|
4
|
+
*
|
|
5
|
+
* Uses SortableItemWrapper for proper drag-and-drop reordering,
|
|
6
|
+
* selection styling, and action buttons (duplicate, delete).
|
|
7
|
+
*
|
|
8
|
+
* When nested inside a blockquote, uses a simpler wrapper without
|
|
9
|
+
* drag handles or selection behavior to let the blockquote handle those.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ListComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default ListComponentNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import type { ListItemProps } from "./ListItem.types";
|
|
3
|
+
declare module "@tiptap/core" {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
listItem: {
|
|
6
|
+
/** Split the list item at the current cursor position */
|
|
7
|
+
splitListItem: (typeOrName: string) => ReturnType;
|
|
8
|
+
/** Lift the list item out of the list (outdent) */
|
|
9
|
+
liftListItem: (typeOrName: string) => ReturnType;
|
|
10
|
+
/** Sink the list item into a nested list (indent) */
|
|
11
|
+
sinkListItem: (typeOrName: string) => ReturnType;
|
|
12
|
+
/** Wrap selection in a list */
|
|
13
|
+
wrapInList: (typeOrName: string, attrs?: Record<string, unknown>) => ReturnType;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare const defaultListItemProps: ListItemProps;
|
|
18
|
+
/**
|
|
19
|
+
* Custom ListItem extension with prosemirror-schema-list commands.
|
|
20
|
+
*
|
|
21
|
+
* Provides commands:
|
|
22
|
+
* - splitListItem: Split list item at cursor (creates new bullet)
|
|
23
|
+
* - liftListItem: Lift list item out of list (outdent)
|
|
24
|
+
* - sinkListItem: Sink list item into nested list (indent)
|
|
25
|
+
* - wrapInList: Wrap selection in a list
|
|
26
|
+
*
|
|
27
|
+
* Keyboard shortcuts:
|
|
28
|
+
* - Enter: Split list item (handled in List extension)
|
|
29
|
+
* - Tab: Sink list item (handled in List extension)
|
|
30
|
+
* - Shift-Tab: Lift list item (handled in List extension)
|
|
31
|
+
* - Shift-Enter: Add a hard break (new line within the paragraph)
|
|
32
|
+
*/
|
|
33
|
+
export declare const ListItem: Node<any, any>;
|
|
34
|
+
export default ListItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type NodeViewProps } from "@tiptap/react";
|
|
2
|
+
/**
|
|
3
|
+
* Simple ListItem NodeView that renders as a standard <li> element.
|
|
4
|
+
* Uses NodeViewContent to allow prosemirror to manage the content.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ListItemComponentNode: (props: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ListItemComponentNode;
|
|
@@ -23,6 +23,8 @@ export { FixedChannelSelection } from "./FixedChannelSelection";
|
|
|
23
23
|
export { Heading } from "./Heading";
|
|
24
24
|
export { ImageBlock } from "./ImageBlock";
|
|
25
25
|
export { Link } from "./Link";
|
|
26
|
+
export { List } from "./List";
|
|
27
|
+
export { ListItem } from "./ListItem";
|
|
26
28
|
export { Paragraph } from "./Paragraph";
|
|
27
29
|
export { Selection } from "./Selection";
|
|
28
30
|
export { SlashMenu } from "./SlashMenu";
|
|
@@ -28,6 +28,8 @@ export interface TextMenuConfig {
|
|
|
28
28
|
alignRight?: TextMenuItem;
|
|
29
29
|
alignJustify?: TextMenuItem;
|
|
30
30
|
quote?: TextMenuItem;
|
|
31
|
+
orderedList?: TextMenuItem;
|
|
32
|
+
bulletList?: TextMenuItem;
|
|
31
33
|
link?: TextMenuItem;
|
|
32
34
|
variable?: TextMenuItem;
|
|
33
35
|
conditionalRules?: ConditionalRule[];
|
|
@@ -6,6 +6,8 @@ interface TextMenuStates {
|
|
|
6
6
|
isUnderline: boolean;
|
|
7
7
|
isStrike: boolean;
|
|
8
8
|
isQuote: boolean;
|
|
9
|
+
isOrderedList: boolean;
|
|
10
|
+
isBulletList: boolean;
|
|
9
11
|
isAlignLeft: boolean;
|
|
10
12
|
isAlignCenter: boolean;
|
|
11
13
|
isAlignRight: boolean;
|
|
@@ -23,6 +25,8 @@ export declare const useTextmenuCommands: (editor: Editor, config?: TextMenuConf
|
|
|
23
25
|
onAlignJustify: () => boolean;
|
|
24
26
|
onLink: (url: string, inNewTab?: boolean) => boolean;
|
|
25
27
|
onQuote: () => void;
|
|
28
|
+
onOrderedList: () => void;
|
|
29
|
+
onBulletList: () => void;
|
|
26
30
|
resetButtonFormatting: () => boolean;
|
|
27
31
|
};
|
|
28
32
|
export {};
|
|
@@ -9,6 +9,8 @@ export declare const useTextmenuStates: (editor: Editor | null) => {
|
|
|
9
9
|
isAlignRight: boolean;
|
|
10
10
|
isAlignJustify: boolean;
|
|
11
11
|
isQuote: boolean;
|
|
12
|
+
isOrderedList: boolean;
|
|
13
|
+
isBulletList: boolean;
|
|
12
14
|
isLink: boolean;
|
|
13
15
|
shouldShow: ({ editor }: {
|
|
14
16
|
editor: Editor;
|
|
@@ -31,5 +31,7 @@ export interface VariableChipBaseProps {
|
|
|
31
31
|
textColorOverride?: string;
|
|
32
32
|
/** Custom color getter function (kept for API compatibility, colors handled by CSS) */
|
|
33
33
|
getColors?: (isInvalid: boolean, hasValue: boolean) => VariableColors;
|
|
34
|
+
/** Whether the chip is read-only (prevents editing) */
|
|
35
|
+
readOnly?: boolean;
|
|
34
36
|
}
|
|
35
37
|
export declare const VariableChipBase: React.FC<VariableChipBaseProps>;
|