@maily-to/core 2.0.0-beta.7 → 2.0.0-beta.9

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.
Files changed (48) hide show
  1. package/dist/blocks/index.cjs +8 -1
  2. package/dist/blocks/index.d.cts +1 -38
  3. package/dist/blocks/index.d.mts +14 -6
  4. package/dist/blocks/index.d.mts.map +1 -1
  5. package/dist/blocks/index.mjs +2 -2
  6. package/dist/extensions/index.cjs +266 -286
  7. package/dist/extensions/index.d.cts +1 -379
  8. package/dist/extensions/index.d.mts +127 -224
  9. package/dist/extensions/index.d.mts.map +1 -1
  10. package/dist/extensions/index.mjs +238 -271
  11. package/dist/index.cjs +8826 -11828
  12. package/dist/index.d.cts +1 -165
  13. package/dist/index.d.mts +701 -121
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +8460 -11567
  16. package/dist/{slash-command-BmWRVPbv.d.mts → slash-command-BrwA1bHs.d.mts} +10 -11
  17. package/dist/slash-command-BrwA1bHs.d.mts.map +1 -0
  18. package/dist/theme-D1CI7_8s.d.mts +70 -0
  19. package/dist/theme-D1CI7_8s.d.mts.map +1 -0
  20. package/dist/typography-BdOKvXfQ.mjs +911 -0
  21. package/dist/typography-D-VnwOSw.cjs +970 -0
  22. package/dist/typography-DW7VApAR.cjs +1072 -0
  23. package/dist/use-maily-editor-Atvy2kSO.cjs +3993 -0
  24. package/dist/use-maily-editor-CByaDhmT.cjs +4955 -0
  25. package/dist/use-maily-editor-idL0RNsG.mjs +4504 -0
  26. package/package.json +82 -74
  27. package/readme.md +169 -128
  28. package/src/styles/index.css +2537 -0
  29. package/dist/blocks/index.d.cts.map +0 -1
  30. package/dist/chunk-CfYAbeIz.mjs +0 -13
  31. package/dist/extensions/index.d.cts.map +0 -1
  32. package/dist/extensions/index.mjs.map +0 -1
  33. package/dist/index.css +0 -2312
  34. package/dist/index.d.cts.map +0 -1
  35. package/dist/index.mjs.map +0 -1
  36. package/dist/slash-command-BmWRVPbv.d.mts.map +0 -1
  37. package/dist/slash-command-CK0-1FwR.d.cts +0 -39
  38. package/dist/slash-command-CK0-1FwR.d.cts.map +0 -1
  39. package/dist/spacer-DBtsr3hu.cjs +0 -5768
  40. package/dist/spacer-DzZWX-wB.mjs +0 -5456
  41. package/dist/spacer-DzZWX-wB.mjs.map +0 -1
  42. package/dist/typography-CWL13acR.cjs +0 -400
  43. package/dist/typography-DhrUe809.mjs +0 -282
  44. package/dist/typography-DhrUe809.mjs.map +0 -1
  45. package/dist/variable-C9S9ZoHv.d.cts +0 -108
  46. package/dist/variable-C9S9ZoHv.d.cts.map +0 -1
  47. package/dist/variable-DVwGrg2a.d.mts +0 -108
  48. package/dist/variable-DVwGrg2a.d.mts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"typography-DhrUe809.mjs","names":["FontWeight","getNodeFontStyleDefaults","MAILY_NODE_TYPES","MousePointerIcon","SlashCommandItem","button","title","description","searchTerms","icon","command","editor","range","fontSize","lineHeight","fontWeight","BUTTON","chain","focus","deleteRange","setButton","run","ImageIcon","SlashCommandItem","image","title","description","searchTerms","icon","command","editor","range","chain","focus","deleteRange","setImage","src","run","SmilePlusIcon","SlashCommandItem","inlineImage","title","description","searchTerms","icon","command","editor","range","chain","focus","deleteRange","setInlineImage","src","run","from","state","selection","commands","setNodeSelection","CodeXmlIcon","ColumnsIcon","MinusIcon","MoveVerticalIcon","Repeat2Icon","SquareIcon","SlashCommandItem","spacer","title","description","searchTerms","icon","command","editor","range","chain","focus","deleteRange","setSpacer","run","divider","setHorizontalRule","section","setSection","columns","setColumns","repeat","setRepeat","htmlCodeBlock","setHtmlCodeBlock","language","MAILY_NODE_TYPES","SquareArrowOutUpRightIcon","SlashCommandItem","linkCard","title","description","searchTerms","icon","render","editor","hasExtension","extensionManager","extensions","some","ext","name","LINK_CARD","command","range","chain","focus","deleteRange","setLinkCard","run","ListIcon","ListOrderedIcon","SlashCommandItem","bulletList","title","description","searchTerms","icon","command","editor","range","chain","focus","deleteRange","toggleBulletList","run","orderedList","toggleOrderedList","getNodeFontStyleDefaults","MAILY_NODE_TYPES","DivideIcon","EraserIcon","FootprintsIcon","Heading1Icon","Heading2Icon","Heading3Icon","TextIcon","TextQuoteIcon","SlashCommandItem","text","title","description","searchTerms","icon","command","editor","range","chain","focus","deleteRange","toggleNode","PARAGRAPH","run","heading1","setNode","level","HEADING","heading2","heading3","hardBreak","setHardBreak","blockquote","toggleBlockquote","footer","setFooter","clearLine","_range","selectParentNode","deleteSelection"],"sources":["../src/blocks/button.tsx","../src/blocks/image.tsx","../src/blocks/inline-image.tsx","../src/blocks/layout.tsx","../src/blocks/link-card.tsx","../src/blocks/list.tsx","../src/blocks/typography.tsx"],"sourcesContent":["import type { FontWeight } from '@maily-to/shared';\nimport { getNodeFontStyleDefaults, MAILY_NODE_TYPES } from '@maily-to/shared';\nimport { MousePointerIcon } from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const button: SlashCommandItem = {\n title: 'Button',\n description: 'Add a call to action button to email.',\n searchTerms: ['link', 'button', 'cta'],\n icon: <MousePointerIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n const { fontSize, lineHeight, fontWeight } = getNodeFontStyleDefaults(\n MAILY_NODE_TYPES.BUTTON\n );\n return editor\n .chain()\n .focus()\n .deleteRange(range)\n .setButton({ fontSize, lineHeight, fontWeight: fontWeight as FontWeight })\n .run();\n },\n};\n","import { ImageIcon } from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const image: SlashCommandItem = {\n title: 'Image',\n description: 'Insert an image',\n searchTerms: ['image', 'picture', 'logo'],\n icon: <ImageIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor\n .chain()\n .focus()\n .deleteRange(range)\n .setImage({ src: '' })\n .run();\n },\n};\n","import { SmilePlusIcon } from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const inlineImage: SlashCommandItem = {\n title: 'Inline Image',\n description: 'Insert an icon, emoji, etc.',\n searchTerms: ['inline', 'icon', 'emoji', 'social', 'inline-image'],\n icon: <SmilePlusIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n editor.chain().focus().deleteRange(range).setInlineImage({ src: '' }).run();\n\n const { from } = editor.state.selection;\n editor.commands.setNodeSelection(from - 1);\n },\n};\n","import {\n CodeXmlIcon,\n ColumnsIcon,\n MinusIcon,\n MoveVerticalIcon,\n Repeat2Icon,\n SquareIcon,\n} from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const spacer: SlashCommandItem = {\n title: 'Spacer',\n description: 'Add space between blocks.',\n searchTerms: ['space', 'gap', 'divider'],\n icon: <MoveVerticalIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setSpacer().run();\n },\n};\n\nexport const divider: SlashCommandItem = {\n title: 'Divider',\n description: 'Add a horizontal divider.',\n searchTerms: ['divider', 'line'],\n icon: <MinusIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setHorizontalRule().run();\n },\n};\n\nexport const section: SlashCommandItem = {\n title: 'Section',\n description: 'Add a section container.',\n searchTerms: ['section', 'container', 'box', 'wrapper'],\n icon: <SquareIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setSection().run();\n },\n};\n\nexport const columns: SlashCommandItem = {\n title: 'Columns',\n description: 'Add a multi-column layout.',\n searchTerms: ['columns', 'layout', 'grid', 'two', 'split'],\n icon: <ColumnsIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setColumns(2).run();\n },\n};\n\nexport const repeat: SlashCommandItem = {\n title: 'Repeat',\n description: 'Repeat content for each item in a list.',\n searchTerms: ['repeat', 'loop', 'iterate', 'for', 'each', 'array'],\n icon: <Repeat2Icon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setRepeat().run();\n },\n};\n\nexport const htmlCodeBlock: SlashCommandItem = {\n title: 'Custom HTML',\n description: 'Insert a custom HTML block.',\n searchTerms: ['html', 'code', 'custom'],\n icon: <CodeXmlIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor\n .chain()\n .focus()\n .deleteRange(range)\n .setHtmlCodeBlock({ language: 'html' })\n .run();\n },\n};\n","import { MAILY_NODE_TYPES } from '@maily-to/shared';\nimport { SquareArrowOutUpRightIcon } from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const linkCard: SlashCommandItem = {\n title: 'Link Card',\n description: 'Add a rich preview card with link.',\n searchTerms: ['link', 'card', 'button', 'image'],\n icon: <SquareArrowOutUpRightIcon className=\"mly:h-4 mly:w-4\" />,\n render: (editor) => {\n const hasExtension = editor.extensionManager.extensions.some(\n (ext) => ext.name === MAILY_NODE_TYPES.LINK_CARD\n );\n return hasExtension ? true : null;\n },\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setLinkCard().run();\n },\n};\n","import { ListIcon, ListOrderedIcon } from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const bulletList: SlashCommandItem = {\n title: 'Bullet List',\n description: 'Create a simple bullet list.',\n searchTerms: ['unordered', 'point'],\n icon: <ListIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).toggleBulletList().run();\n },\n};\n\nexport const orderedList: SlashCommandItem = {\n title: 'Numbered List',\n description: 'Create a list with numbering.',\n searchTerms: ['ordered'],\n icon: <ListOrderedIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).toggleOrderedList().run();\n },\n};\n","import { getNodeFontStyleDefaults, MAILY_NODE_TYPES } from '@maily-to/shared';\nimport {\n DivideIcon,\n EraserIcon,\n FootprintsIcon,\n Heading1Icon,\n Heading2Icon,\n Heading3Icon,\n TextIcon,\n TextQuoteIcon,\n} from 'lucide-react';\n\nimport type { SlashCommandItem } from '~/utils/slash-command';\n\nexport const text: SlashCommandItem = {\n title: 'Text',\n description: 'Just start typing with plain text.',\n searchTerms: ['p', 'paragraph'],\n icon: <TextIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .toggleNode(\n 'paragraph',\n 'paragraph',\n getNodeFontStyleDefaults(MAILY_NODE_TYPES.PARAGRAPH)\n )\n .run();\n },\n};\n\nexport const heading1: SlashCommandItem = {\n title: 'Heading 1',\n description: 'Big heading.',\n searchTerms: ['h1', 'title', 'big', 'large'],\n icon: <Heading1Icon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', {\n level: 1,\n ...getNodeFontStyleDefaults(MAILY_NODE_TYPES.HEADING, 1),\n })\n .run();\n },\n};\n\nexport const heading2: SlashCommandItem = {\n title: 'Heading 2',\n description: 'Medium heading.',\n searchTerms: ['h2', 'subtitle', 'medium'],\n icon: <Heading2Icon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', {\n level: 2,\n ...getNodeFontStyleDefaults(MAILY_NODE_TYPES.HEADING, 2),\n })\n .run();\n },\n};\n\nexport const heading3: SlashCommandItem = {\n title: 'Heading 3',\n description: 'Small heading.',\n searchTerms: ['h3', 'subtitle', 'small'],\n icon: <Heading3Icon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', {\n level: 3,\n ...getNodeFontStyleDefaults(MAILY_NODE_TYPES.HEADING, 3),\n })\n .run();\n },\n};\n\nexport const hardBreak: SlashCommandItem = {\n title: 'Hard Break',\n description: 'Add a break between lines.',\n searchTerms: ['break', 'line'],\n icon: <DivideIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).setHardBreak().run();\n },\n};\n\nexport const blockquote: SlashCommandItem = {\n title: 'Blockquote',\n description: 'Add a blockquote.',\n searchTerms: ['quote', 'blockquote'],\n icon: <TextQuoteIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n return editor.chain().focus().deleteRange(range).toggleBlockquote().run();\n },\n};\n\nexport const footer: SlashCommandItem = {\n title: 'Footer',\n description: 'Add a footer text.',\n searchTerms: ['footer', 'muted', 'small', 'copyright'],\n icon: <FootprintsIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range }) => {\n editor.chain().focus().deleteRange(range).setFooter().run();\n },\n};\n\nexport const clearLine: SlashCommandItem = {\n title: 'Clear Line',\n description: 'Clear the current line.',\n searchTerms: ['clear', 'line'],\n icon: <EraserIcon className=\"mly:h-4 mly:w-4\" />,\n command: ({ editor, range: _range }) => {\n return editor.chain().focus().selectParentNode().deleteSelection().run();\n },\n};\n"],"mappings":";;;;AAMA,MAAaK,SAA2B;CACtCC,OAAO;CACPC,aAAa;CACbC,aAAa;EAAC;EAAQ;EAAU;EAAM;CACtCC,MAAM,oBAAC,kBAAD,EAAkB,WAAU,mBAAoB,CAAA;CACtDC,UAAU,EAAEC,QAAQC,YAAY;EAC9B,MAAM,EAAEC,UAAUC,YAAYC,eAAed,yBAC3CC,iBAAiBc,OAClB;AACD,SAAOL,OACJM,OAAO,CACPC,OAAO,CACPC,YAAYP,MAAM,CAClBQ,UAAU;GAAEP;GAAUC;GAAwBC;GAA0B,CAAC,CACzEM,KAAK;;CAEX;;;AClBD,MAAaG,QAA0B;CACrCC,OAAO;CACPC,aAAa;CACbC,aAAa;EAAC;EAAS;EAAW;EAAO;CACzCC,MAAM,oBAAC,WAAD,EAAW,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AA2B;CACtCvB,OAAO;CACPC,aAAa;CACbC,aAAa;EAAC;EAAU;EAAS;EAAS;EAAY;CACtDC,MAAM,oBAAC,gBAAD,EAAgB,WAAU,mBAAoB,CAAA;CACpDC,UAAU,EAAEC,QAAQC,YAAY;AAC9BD,SAAOE,OAAO,CAACC,OAAO,CAACC,YAAYH,MAAM,CAACkB,WAAW,CAACZ,KAAK;;CAE9D;AAED,MAAaa,YAA8B;CACzCzB,OAAO;CACPC,aAAa;CACbC,aAAa,CAAC,SAAS,OAAO;CAC9BC,MAAM,oBAAC,YAAD,EAAY,WAAU,mBAAoB,CAAA;CAChDC,UAAU,EAAEC,QAAQC,OAAOoB,aAAa;AACtC,SAAOrB,OAAOE,OAAO,CAACC,OAAO,CAACmB,kBAAkB,CAACC,iBAAiB,CAAChB,KAAK;;CAE3E"}
@@ -1,108 +0,0 @@
1
- import { Editor, Node } from "@tiptap/core";
2
- import { VariableAttributes } from "@maily-to/shared";
3
- import { SuggestionOptions } from "@tiptap/suggestion";
4
- import { DOMOutputSpec, Node as Node$1 } from "@tiptap/pm/model";
5
- import { Editor as Editor$1 } from "@tiptap/react";
6
-
7
- //#region ../extension-variable/dist/index.d.mts
8
- //#endregion
9
- //#region src/variable.d.ts
10
- /**
11
- * The attributes for a variable node. This is an alias for
12
- * `VariableAttributes` from `@maily-to/shared`.
13
- */
14
- type VariableNodeAttrs = VariableAttributes;
15
- type VariableOptions<SuggestionItem = any, Attrs extends Record<string, any> = VariableNodeAttrs> = {
16
- /**
17
- * The HTML attributes for a variable node.
18
- * @default {}
19
- * @example { class: 'foo' }
20
- */
21
- HTMLAttributes: Record<string, any>;
22
- /**
23
- * A function to render the label of a variable.
24
- * @deprecated use renderText and renderHTML instead
25
- * @param props The render props
26
- * @returns The label
27
- * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
28
- */
29
- renderLabel?: (props: {
30
- options: VariableOptions<SuggestionItem, Attrs>;
31
- node: Node$1;
32
- suggestion: SuggestionOptions | null;
33
- }) => string;
34
- /**
35
- * A function to render the text of a variable.
36
- * @param props The render props
37
- * @returns The text
38
- * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
39
- */
40
- renderText: (props: {
41
- options: VariableOptions<SuggestionItem, Attrs>;
42
- node: Node$1;
43
- suggestion: SuggestionOptions | null;
44
- }) => string;
45
- /**
46
- * A function to render the HTML of a variable.
47
- * @param props The render props
48
- * @returns The HTML as a ProseMirror DOM Output Spec
49
- * @example ({ options, node }) => ['span', { [DATA_NODE_TYPE_KEY]: 'variable' }, `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`]
50
- */
51
- renderHTML: (props: {
52
- options: VariableOptions<SuggestionItem, Attrs>;
53
- node: Node$1;
54
- suggestion: SuggestionOptions | null;
55
- }) => DOMOutputSpec;
56
- /**
57
- * Whether to delete the trigger character with backspace.
58
- * @default false
59
- */
60
- deleteTriggerWithBackspace: boolean;
61
- /**
62
- * The suggestion options, when you want to support multiple triggers.
63
- *
64
- * With this parameter, you can define multiple types of variable triggers. For example, you can use the `{{`
65
- * character to insert variables and the `#` character to insert tags.
66
- *
67
- * @default [{ char: '{{', pluginKey: VariablePluginKey }]
68
- * @example [{ char: '{{', pluginKey: VariablePluginKey }, { char: '#', pluginKey: new PluginKey('hashtag') }]
69
- */
70
- suggestions: Array<Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>>;
71
- /**
72
- * The suggestion options, when you want to support only one trigger. To support multiple triggers, use the
73
- * `suggestions` parameter instead.
74
- *
75
- * @default {}
76
- * @example { char: '@', pluginKey: VariablePluginKey, command: ({ editor, range, props }) => { ... } }
77
- */
78
- suggestion: Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>;
79
- shouldScrollIntoView: boolean;
80
- addSpaceSuffix: boolean;
81
- /**
82
- * Disable input is the boolean that will be used to disable the input of the variable
83
- * when the variable is selected.
84
- * @default false
85
- */
86
- disableInput: boolean;
87
- };
88
- //#endregion
89
- //#region src/utils/variable.d.ts
90
- /** A variable item passed to the editor's variable suggestion list. */
91
- type Variable = Omit<VariableNodeAttrs, 'variableSuggestionChar'> & {
92
- /** @deprecated Use `id` instead. Will be removed in a future version. */name?: string; /** Arbitrary metadata attached to this variable (e.g. category, type). */
93
- metadata?: Record<string, unknown>;
94
- };
95
- type VariableFunctionOptions = {
96
- query: string;
97
- editor: Editor$1;
98
- };
99
- type VariablesFunction = (opts: VariableFunctionOptions) => Array<Variable>;
100
- type Variables = Array<Variable> | VariablesFunction;
101
- /**
102
- * Filters the variable list by query prefix. If no exact match exists,
103
- * appends a dynamic entry so users can create variables on the fly.
104
- */
105
- declare function filterVariableSuggestions(variables: Variables | undefined, opts: VariableFunctionOptions): Array<Variable>;
106
- //#endregion
107
- export { filterVariableSuggestions as a, VariablesFunction as i, VariableFunctionOptions as n, VariableOptions as o, Variables as r, Variable as t };
108
- //# sourceMappingURL=variable-C9S9ZoHv.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variable-C9S9ZoHv.d.cts","names":["VariableAttributes","Editor","Node","SuggestionOptions","DOMOutputSpec","Node$1","GetSuggestionOptionsConfig","Omit","editor","overrideSuggestionOptions","extensionName","char","shouldScrollIntoView","addSpaceSuffix","getSuggestionOptions","options","VariableNodeAttrs","VariableOptions","SuggestionItem","Attrs","Record","Array","HTMLAttributes","renderLabel","node","suggestion","props","renderText","renderHTML","deleteTriggerWithBackspace","suggestions","disableInput","Variable"],"sources":["../../extension-variable/dist/index.d.mts","../src/utils/variable.ts"],"mappings":";;;;;;;;;;;;;KAsDKgB,iBAAAA,GAAoBhB,kBAAAA;AAAAA,KACpBiB,eAAAA,qCAAoDG,MAAAA,gBAAsBJ,iBAAAA;EAgB3EQ;;;;;EAVFF,cAAAA,EAAgBF,MAAAA;EAoBdL;;;;;;;EAZFQ,WAAAA,IAAeG,KAAAA;IACbX,OAAAA,EAASE,eAAAA,CAAgBC,cAAAA,EAAgBC,KAAAA;IACzCK,IAAAA,EAAMnB,MAAAA;IACNoB,UAAAA,EAAYtB,iBAAAA;EAAAA;EAoBae;;;;;;EAZ3BS,UAAAA,GAAaD,KAAAA;IACXX,OAAAA,EAASE,eAAAA,CAAgBC,cAAAA,EAAgBC,KAAAA;IACzCK,IAAAA,EAAMnB,MAAAA;IACNoB,UAAAA,EAAYtB,iBAAAA;EAAAA;EA2BKI;;;;;;EAnBnBqB,UAAAA,GAAaF,KAAAA;IACXX,OAAAA,EAASE,eAAAA,CAAgBC,cAAAA,EAAgBC,KAAAA;IACzCK,IAAAA,EAAMnB,MAAAA;IACNoB,UAAAA,EAAYtB,iBAAAA;EAAAA,MACRC,aAAAA;EA+BN2B;;;;EA1BAF,0BAAAA;;AChGF;;;;;;;;ED0GEC,WAAAA,EAAaT,KAAAA,CAAMd,IAAAA,CAAKJ,iBAAAA,CAAkBe,cAAAA,EAAgBC,KAAAA;EC1GhC;;;;;;AAO5B;ED2GEM,UAAAA,EAAYlB,IAAAA,CAAKJ,iBAAAA,CAAkBe,cAAAA,EAAgBC,KAAAA;EACnDP,oBAAAA;EACAC,cAAAA;EC5GA;;;;;EDkHAkB,YAAAA;AAAAA;;;;KC1HU,QAAA,GAAW,IAAA,CAAK,iBAAA;2EAE1B,IAAA;EAEA,QAAA,GAAW,MAAA;AAAA;AAAA,KAGD,uBAAA;EACV,KAAA;EACA,MAAA,EAAQ,QAAA;AAAA;AAAA,KAGE,iBAAA,IACV,IAAA,EAAM,uBAAA,KACH,KAAA,CAAM,QAAA;AAAA,KAEC,SAAA,GAAY,KAAA,CAAM,QAAA,IAAY,iBAAA;;;;;iBAY1B,yBAAA,CACd,SAAA,EAAW,SAAA,cACX,IAAA,EAAM,uBAAA,GACL,KAAA,CAAM,QAAA"}
@@ -1,108 +0,0 @@
1
- import { VariableAttributes } from "@maily-to/shared";
2
- import { Editor } from "@tiptap/react";
3
- import { Editor as Editor$1, Node } from "@tiptap/core";
4
- import { SuggestionOptions } from "@tiptap/suggestion";
5
- import { DOMOutputSpec, Node as Node$1 } from "@tiptap/pm/model";
6
-
7
- //#region ../extension-variable/dist/index.d.mts
8
- //#endregion
9
- //#region src/variable.d.ts
10
- /**
11
- * The attributes for a variable node. This is an alias for
12
- * `VariableAttributes` from `@maily-to/shared`.
13
- */
14
- type VariableNodeAttrs = VariableAttributes;
15
- type VariableOptions<SuggestionItem = any, Attrs extends Record<string, any> = VariableNodeAttrs> = {
16
- /**
17
- * The HTML attributes for a variable node.
18
- * @default {}
19
- * @example { class: 'foo' }
20
- */
21
- HTMLAttributes: Record<string, any>;
22
- /**
23
- * A function to render the label of a variable.
24
- * @deprecated use renderText and renderHTML instead
25
- * @param props The render props
26
- * @returns The label
27
- * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
28
- */
29
- renderLabel?: (props: {
30
- options: VariableOptions<SuggestionItem, Attrs>;
31
- node: Node$1;
32
- suggestion: SuggestionOptions | null;
33
- }) => string;
34
- /**
35
- * A function to render the text of a variable.
36
- * @param props The render props
37
- * @returns The text
38
- * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
39
- */
40
- renderText: (props: {
41
- options: VariableOptions<SuggestionItem, Attrs>;
42
- node: Node$1;
43
- suggestion: SuggestionOptions | null;
44
- }) => string;
45
- /**
46
- * A function to render the HTML of a variable.
47
- * @param props The render props
48
- * @returns The HTML as a ProseMirror DOM Output Spec
49
- * @example ({ options, node }) => ['span', { [DATA_NODE_TYPE_KEY]: 'variable' }, `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`]
50
- */
51
- renderHTML: (props: {
52
- options: VariableOptions<SuggestionItem, Attrs>;
53
- node: Node$1;
54
- suggestion: SuggestionOptions | null;
55
- }) => DOMOutputSpec;
56
- /**
57
- * Whether to delete the trigger character with backspace.
58
- * @default false
59
- */
60
- deleteTriggerWithBackspace: boolean;
61
- /**
62
- * The suggestion options, when you want to support multiple triggers.
63
- *
64
- * With this parameter, you can define multiple types of variable triggers. For example, you can use the `{{`
65
- * character to insert variables and the `#` character to insert tags.
66
- *
67
- * @default [{ char: '{{', pluginKey: VariablePluginKey }]
68
- * @example [{ char: '{{', pluginKey: VariablePluginKey }, { char: '#', pluginKey: new PluginKey('hashtag') }]
69
- */
70
- suggestions: Array<Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>>;
71
- /**
72
- * The suggestion options, when you want to support only one trigger. To support multiple triggers, use the
73
- * `suggestions` parameter instead.
74
- *
75
- * @default {}
76
- * @example { char: '@', pluginKey: VariablePluginKey, command: ({ editor, range, props }) => { ... } }
77
- */
78
- suggestion: Omit<SuggestionOptions<SuggestionItem, Attrs>, 'editor'>;
79
- shouldScrollIntoView: boolean;
80
- addSpaceSuffix: boolean;
81
- /**
82
- * Disable input is the boolean that will be used to disable the input of the variable
83
- * when the variable is selected.
84
- * @default false
85
- */
86
- disableInput: boolean;
87
- };
88
- //#endregion
89
- //#region src/utils/variable.d.ts
90
- /** A variable item passed to the editor's variable suggestion list. */
91
- type Variable = Omit<VariableNodeAttrs, 'variableSuggestionChar'> & {
92
- /** @deprecated Use `id` instead. Will be removed in a future version. */name?: string; /** Arbitrary metadata attached to this variable (e.g. category, type). */
93
- metadata?: Record<string, unknown>;
94
- };
95
- type VariableFunctionOptions = {
96
- query: string;
97
- editor: Editor;
98
- };
99
- type VariablesFunction = (opts: VariableFunctionOptions) => Array<Variable>;
100
- type Variables = Array<Variable> | VariablesFunction;
101
- /**
102
- * Filters the variable list by query prefix. If no exact match exists,
103
- * appends a dynamic entry so users can create variables on the fly.
104
- */
105
- declare function filterVariableSuggestions(variables: Variables | undefined, opts: VariableFunctionOptions): Array<Variable>;
106
- //#endregion
107
- export { filterVariableSuggestions as a, VariablesFunction as i, VariableFunctionOptions as n, VariableOptions as o, Variables as r, Variable as t };
108
- //# sourceMappingURL=variable-DVwGrg2a.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variable-DVwGrg2a.d.mts","names":["VariableAttributes","Editor","Node","SuggestionOptions","DOMOutputSpec","Node$1","GetSuggestionOptionsConfig","Omit","editor","overrideSuggestionOptions","extensionName","char","shouldScrollIntoView","addSpaceSuffix","getSuggestionOptions","options","VariableNodeAttrs","VariableOptions","SuggestionItem","Attrs","Record","Array","HTMLAttributes","renderLabel","node","suggestion","props","renderText","renderHTML","deleteTriggerWithBackspace","suggestions","disableInput","Variable"],"sources":["../../extension-variable/dist/index.d.mts","../src/utils/variable.ts"],"mappings":";;;;;;;;;;;;;KAsDKgB,iBAAAA,GAAoBhB,kBAAAA;AAAAA,KACpBiB,eAAAA,qCAAoDG,MAAAA,gBAAsBJ,iBAAAA;EAgB3EQ;;;;;EAVFF,cAAAA,EAAgBF,MAAAA;EAoBdL;;;;;;;EAZFQ,WAAAA,IAAeG,KAAAA;IACbX,OAAAA,EAASE,eAAAA,CAAgBC,cAAAA,EAAgBC,KAAAA;IACzCK,IAAAA,EAAMnB,MAAAA;IACNoB,UAAAA,EAAYtB,iBAAAA;EAAAA;EAoBae;;;;;;EAZ3BS,UAAAA,GAAaD,KAAAA;IACXX,OAAAA,EAASE,eAAAA,CAAgBC,cAAAA,EAAgBC,KAAAA;IACzCK,IAAAA,EAAMnB,MAAAA;IACNoB,UAAAA,EAAYtB,iBAAAA;EAAAA;EA2BKI;;;;;;EAnBnBqB,UAAAA,GAAaF,KAAAA;IACXX,OAAAA,EAASE,eAAAA,CAAgBC,cAAAA,EAAgBC,KAAAA;IACzCK,IAAAA,EAAMnB,MAAAA;IACNoB,UAAAA,EAAYtB,iBAAAA;EAAAA,MACRC,aAAAA;EA+BN2B;;;;EA1BAF,0BAAAA;;AChGF;;;;;;;;ED0GEC,WAAAA,EAAaT,KAAAA,CAAMd,IAAAA,CAAKJ,iBAAAA,CAAkBe,cAAAA,EAAgBC,KAAAA;EC1GhC;;;;;;AAO5B;ED2GEM,UAAAA,EAAYlB,IAAAA,CAAKJ,iBAAAA,CAAkBe,cAAAA,EAAgBC,KAAAA;EACnDP,oBAAAA;EACAC,cAAAA;E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