@trycourier/react-designer 0.0.0-canary-20251205172857 → 0.0.0-canary-20251207160907
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 +55 -55
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/styles.css +4 -0
- package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBarItemDetails/SideBarItemDetails.d.ts +3 -1
- 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/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/esm/index.js +53 -53
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/styles.css +4 -0
- package/dist/styles.css +4 -0
- package/package.json +1 -1
- package/dist/components/ui/VariableInput/VariableInput.d.ts +0 -28
- package/dist/components/ui/VariableInput/index.d.ts +0 -2
- package/dist/components/ui/VariableTextarea/VariableTextarea.d.ts +0 -26
- package/dist/components/ui/VariableTextarea/index.d.ts +0 -2
package/dist/cjs/styles.css
CHANGED
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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
|
+
}
|