@trycourier/react-designer 0.0.0-canary-20251208142108 → 0.0.0-canary-20251209152659
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 +54 -54
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/styles.css +250 -80
- package/dist/components/BrandEditor/BrandEditor.d.ts +1 -0
- package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBarItemDetails/SideBarItemDetails.d.ts +3 -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/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/TemplateEditor.d.ts +1 -1
- package/dist/components/TemplateEditor/index.d.ts +2 -0
- package/dist/components/extensions/Button/ButtonForm.d.ts +3 -1
- package/dist/components/extensions/ImageBlock/components/ImageBlockForm.d.ts +3 -1
- package/dist/components/ui/MainLayout/MainLayout.d.ts +1 -1
- package/dist/components/ui/TextInput/TextInput.d.ts +2 -0
- package/dist/components/ui/VariableEditor/VariableInput.d.ts +11 -0
- package/dist/components/ui/VariableEditor/VariableTextarea.d.ts +9 -0
- package/dist/components/ui/VariableEditor/index.d.ts +6 -0
- package/dist/components/ui/VariableEditor/shared.d.ts +51 -0
- package/dist/components/ui-kit/Icon/PushIcon.d.ts +1 -1
- package/dist/components/ui-kit/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/esm/index.js +55 -55
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/styles.css +250 -80
- package/dist/styles.css +250 -80
- package/package.json +3 -2
|
@@ -2,5 +2,6 @@ import type { Theme } from "../ui-kit/ThemeProvider/ThemeProvider.types";
|
|
|
2
2
|
import { type EditorProps } from "./Editor";
|
|
3
3
|
export interface BrandEditorProps extends Omit<EditorProps, "disableVariableAutocomplete"> {
|
|
4
4
|
theme?: Theme | string;
|
|
5
|
+
colorScheme?: "light" | "dark";
|
|
5
6
|
}
|
|
6
7
|
export declare const BrandEditor: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<BrandEditorProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -19,7 +19,7 @@ interface BrandSettingsData {
|
|
|
19
19
|
mediumLink?: string;
|
|
20
20
|
xLink?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "brandEditor" | "channels" | "variables" | "theme" | "routing" | "value" | "
|
|
22
|
+
export interface EmailProps extends Pick<TemplateEditorProps, "hidePublish" | "brandEditor" | "channels" | "variables" | "theme" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
23
23
|
isLoading?: boolean;
|
|
24
24
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
25
25
|
hidePublish?: boolean;
|
|
@@ -6,4 +6,4 @@ export declare const EmailEditorMain: import("react").ForwardRefExoticComponent<
|
|
|
6
6
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export interface EmailLayoutProps extends EmailProps {
|
|
8
8
|
}
|
|
9
|
-
export declare const EmailLayout: ({ variables, theme, isLoading, hidePublish, channels, brandEditor, routing,
|
|
9
|
+
export declare const EmailLayout: ({ variables, theme, isLoading, hidePublish, channels, brandEditor, routing, colorScheme, ...rest }: EmailLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,7 @@ import type { Editor } from "@tiptap/react";
|
|
|
3
3
|
export interface SideBarItemDetailsProps {
|
|
4
4
|
element?: ProseMirrorNode;
|
|
5
5
|
editor: Editor | null;
|
|
6
|
+
/** Whether to disable variable autocomplete suggestions in sidebar inputs */
|
|
7
|
+
disableVariableAutocomplete?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare const SideBarItemDetails: ({ element, editor }: SideBarItemDetailsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const SideBarItemDetails: ({ element, editor, disableVariableAutocomplete, }: SideBarItemDetailsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -21,7 +21,7 @@ export interface InboxRenderProps {
|
|
|
21
21
|
editor: Editor;
|
|
22
22
|
}) => void;
|
|
23
23
|
}
|
|
24
|
-
export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
24
|
+
export interface InboxProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
25
25
|
readOnly?: boolean;
|
|
26
26
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
27
27
|
hidePublish?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InboxProps } from "./Inbox";
|
|
2
2
|
export interface InboxLayoutProps extends InboxProps {
|
|
3
3
|
}
|
|
4
|
-
export declare const InboxLayout: ({ hidePublish, theme, variables, channels, routing, ...rest }: InboxLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const InboxLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, ...rest }: InboxLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,7 @@ export interface MSTeamsRenderProps {
|
|
|
27
27
|
selectedNode: Node | null;
|
|
28
28
|
msteamsEditor: Editor | null;
|
|
29
29
|
}
|
|
30
|
-
export interface MSTeamsProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
30
|
+
export interface MSTeamsProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
31
31
|
readOnly?: boolean;
|
|
32
32
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
33
33
|
hidePublish?: boolean;
|
|
@@ -4,4 +4,4 @@ export interface MSTeamsLayoutProps extends MSTeamsProps {
|
|
|
4
4
|
}
|
|
5
5
|
export declare const MSTeamsEditorContainer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export declare const MSTeamsEditorMain: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export declare const MSTeamsLayout: ({ hidePublish, theme, variables, channels, routing, }: MSTeamsLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const MSTeamsLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, }: MSTeamsLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,7 @@ export interface PushRenderProps {
|
|
|
18
18
|
editor: Editor;
|
|
19
19
|
}) => void;
|
|
20
20
|
}
|
|
21
|
-
export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
21
|
+
export interface PushProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
22
22
|
readOnly?: boolean;
|
|
23
23
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
24
24
|
hidePublish?: boolean;
|
|
@@ -19,7 +19,7 @@ export interface SMSRenderProps {
|
|
|
19
19
|
editor: Editor;
|
|
20
20
|
}) => void;
|
|
21
21
|
}
|
|
22
|
-
export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "
|
|
22
|
+
export interface SMSProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
23
23
|
readOnly?: boolean;
|
|
24
24
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
25
25
|
hidePublish?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SMSProps } from "./SMS";
|
|
2
2
|
export interface SMSLayoutProps extends SMSProps {
|
|
3
3
|
}
|
|
4
|
-
export declare const SMSLayout: ({ hidePublish, theme, variables, channels, routing,
|
|
4
|
+
export declare const SMSLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, ...rest }: SMSLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,7 @@ export interface SlackRenderProps {
|
|
|
27
27
|
selectedNode: Node | null;
|
|
28
28
|
slackEditor: Editor | null;
|
|
29
29
|
}
|
|
30
|
-
export interface SlackProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
30
|
+
export interface SlackProps extends Pick<TemplateEditorProps, "hidePublish" | "theme" | "variables" | "channels" | "routing" | "value" | "colorScheme">, Omit<HTMLAttributes<HTMLDivElement>, "value" | "onChange"> {
|
|
31
31
|
readOnly?: boolean;
|
|
32
32
|
headerRenderer?: ({ hidePublish, channels, routing, }: {
|
|
33
33
|
hidePublish?: boolean;
|
|
@@ -4,4 +4,4 @@ export interface SlackLayoutProps extends SlackProps {
|
|
|
4
4
|
}
|
|
5
5
|
export declare const SlackEditorContainer: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export declare const SlackEditorMain: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export declare const SlackLayout: ({ hidePublish, theme, variables, channels, routing, }: SlackLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const SlackLayout: ({ hidePublish, theme, variables, channels, routing, colorScheme, }: SlackLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,6 +18,6 @@ export interface TemplateEditorProps extends Omit<HTMLAttributes<HTMLDivElement>
|
|
|
18
18
|
/** @deprecated Use routing.channels instead. Will be removed in a future version. */
|
|
19
19
|
channels?: ChannelType[];
|
|
20
20
|
routing?: MessageRouting;
|
|
21
|
-
|
|
21
|
+
colorScheme?: "light" | "dark";
|
|
22
22
|
}
|
|
23
23
|
export declare const TemplateEditor: import("react").NamedExoticComponent<TemplateEditorProps>;
|
|
@@ -2,6 +2,8 @@ export { BrandFooter } from "@/components/BrandEditor/Editor/BrandFooter";
|
|
|
2
2
|
export { PreviewPanel } from "@/components/ui/PreviewPanel";
|
|
3
3
|
export { TextMenu } from "@/components/ui/TextMenu";
|
|
4
4
|
export { cn, convertElementalToTiptap, convertTiptapToElemental } from "@/lib/utils";
|
|
5
|
+
export { VariableInput, VariableTextarea } from "@/components/ui/VariableEditor";
|
|
6
|
+
export { getFlattenedVariables } from "@/components/utils/getFlattenedVariables";
|
|
5
7
|
export { useChannels } from "./Channels";
|
|
6
8
|
export { default as EmailEditor } from "./Channels/Email/EmailEditor";
|
|
7
9
|
export * from "./TemplateEditor";
|
|
@@ -3,6 +3,8 @@ import type { Editor } from "@tiptap/react";
|
|
|
3
3
|
interface ButtonFormProps {
|
|
4
4
|
element?: ProseMirrorNode;
|
|
5
5
|
editor: Editor | null;
|
|
6
|
+
/** Whether to disable variable autocomplete suggestions */
|
|
7
|
+
disableVariableAutocomplete?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare const ButtonForm: ({ element, editor }: ButtonFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const ButtonForm: ({ element, editor, disableVariableAutocomplete, }: ButtonFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
10
|
export {};
|
|
@@ -3,5 +3,7 @@ import type { Editor } from "@tiptap/react";
|
|
|
3
3
|
export interface ImageBlockFormProps {
|
|
4
4
|
element?: ProseMirrorNode;
|
|
5
5
|
editor: Editor | null;
|
|
6
|
+
/** Whether to disable variable autocomplete suggestions */
|
|
7
|
+
disableVariableAutocomplete?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare const ImageBlockForm: ({ element, editor }: ImageBlockFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const ImageBlockForm: ({ element, editor, disableVariableAutocomplete, }: ImageBlockFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,6 +6,6 @@ export interface MainLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
isLoading?: boolean;
|
|
7
7
|
SideBar?: React.ReactNode;
|
|
8
8
|
Header?: React.ReactNode;
|
|
9
|
-
|
|
9
|
+
colorScheme?: "light" | "dark";
|
|
10
10
|
}
|
|
11
11
|
export declare const MainLayout: import("react").ForwardRefExoticComponent<MainLayoutProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -5,5 +5,7 @@ export interface TextInputProps extends Omit<React.ComponentProps<"input">, "as"
|
|
|
5
5
|
autoResize?: boolean;
|
|
6
6
|
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
7
7
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
8
|
+
/** Whether to disable variable autocomplete suggestions */
|
|
9
|
+
disableVariableAutocomplete?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare const TextInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariableEditorBaseProps } from "./shared";
|
|
3
|
+
export interface VariableInputProps extends VariableEditorBaseProps {
|
|
4
|
+
/** Whether the input is read-only */
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A single-line input that renders {{variable}} patterns as styled chips.
|
|
9
|
+
* Uses a minimal TipTap editor under the hood for rich content rendering.
|
|
10
|
+
*/
|
|
11
|
+
export declare const VariableInput: React.ForwardRefExoticComponent<VariableInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariableEditorBaseProps } from "./shared";
|
|
3
|
+
export interface VariableTextareaProps extends VariableEditorBaseProps {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A textarea-like input that renders {{variable}} patterns as styled chips.
|
|
7
|
+
* Uses a minimal TipTap editor under the hood for rich content rendering.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VariableTextarea: React.ForwardRefExoticComponent<VariableTextareaProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { VariableTextarea } from "./VariableTextarea";
|
|
2
|
+
export type { VariableTextareaProps } from "./VariableTextarea";
|
|
3
|
+
export { VariableInput } from "./VariableInput";
|
|
4
|
+
export type { VariableInputProps } from "./VariableInput";
|
|
5
|
+
export { parseStringToContent, contentToString, SimpleVariableNode, SimpleVariableView, VariableChipIcon, } from "./shared";
|
|
6
|
+
export type { VariableEditorBaseProps } from "./shared";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import type { Content, JSONContent } from "@tiptap/core";
|
|
3
|
+
import type { NodeViewProps } from "@tiptap/react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Simple variable icon for the chip
|
|
7
|
+
*/
|
|
8
|
+
export declare const VariableChipIcon: React.FC<{
|
|
9
|
+
color?: string;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Standalone variable view component
|
|
13
|
+
* Does not depend on external jotai stores
|
|
14
|
+
*/
|
|
15
|
+
export declare const SimpleVariableView: React.FC<NodeViewProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Custom VariableNode that uses SimpleVariableView
|
|
18
|
+
* Used in VariableInput and VariableTextarea components
|
|
19
|
+
*/
|
|
20
|
+
export declare const SimpleVariableNode: Node<any, any>;
|
|
21
|
+
/**
|
|
22
|
+
* Parses a string with {{variable}} syntax into TipTap JSON content
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseStringToContent(text: string): Content;
|
|
25
|
+
/**
|
|
26
|
+
* Converts TipTap JSON content back to string with {{variable}} syntax
|
|
27
|
+
*/
|
|
28
|
+
export declare function contentToString(doc: JSONContent): string;
|
|
29
|
+
/**
|
|
30
|
+
* Base props shared between VariableInput and VariableTextarea
|
|
31
|
+
*/
|
|
32
|
+
export interface VariableEditorBaseProps {
|
|
33
|
+
/** The current value with {{variable}} syntax */
|
|
34
|
+
value?: string;
|
|
35
|
+
/** Called when the value changes */
|
|
36
|
+
onChange?: (value: string) => void;
|
|
37
|
+
/** List of available variable names for autocomplete */
|
|
38
|
+
variables?: string[];
|
|
39
|
+
/** Placeholder text */
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
/** Additional CSS classes */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Whether the input is disabled */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Whether to disable variable autocomplete suggestions */
|
|
46
|
+
disableVariableAutocomplete?: boolean;
|
|
47
|
+
/** Called when the input gains focus */
|
|
48
|
+
onFocus?: () => void;
|
|
49
|
+
/** Called when the input loses focus */
|
|
50
|
+
onBlur?: () => void;
|
|
51
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IconProps } from "./Icon";
|
|
2
|
-
export declare const PushIcon: ({
|
|
2
|
+
export declare const PushIcon: ({ width, height, viewBox, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default PushIcon;
|
|
@@ -3,7 +3,7 @@ import type { Theme } from "./ThemeProvider.types";
|
|
|
3
3
|
interface ThemeProviderProps {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
theme?: Theme | string;
|
|
6
|
-
|
|
6
|
+
colorScheme?: "light" | "dark";
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
9
|
export declare const ThemeProvider: import("react").ForwardRefExoticComponent<ThemeProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|