payload-richtext-tiptap 0.0.31 → 0.0.33

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 (137) hide show
  1. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.d.ts +1 -1
  2. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.d.ts.map +1 -1
  3. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js +3 -4
  4. package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js.map +1 -1
  5. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.d.ts.map +1 -1
  6. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js +2 -3
  7. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js.map +1 -1
  8. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.d.ts +1 -1
  9. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.d.ts.map +1 -1
  10. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js +5 -6
  11. package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js.map +1 -1
  12. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.d.ts.map +1 -1
  13. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js +1 -2
  14. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js.map +1 -1
  15. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.d.ts.map +1 -1
  16. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js +6 -7
  17. package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js.map +1 -1
  18. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.d.ts.map +1 -1
  19. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js +1 -2
  20. package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js.map +1 -1
  21. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.d.ts.map +1 -1
  22. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js +3 -4
  23. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js.map +1 -1
  24. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.d.ts.map +1 -1
  25. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js +3 -4
  26. package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js.map +1 -1
  27. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.d.ts.map +1 -1
  28. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js +1 -2
  29. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js.map +1 -1
  30. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.d.ts.map +1 -1
  31. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js +2 -3
  32. package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js.map +1 -1
  33. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.d.ts.map +1 -1
  34. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js +1 -2
  35. package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js.map +1 -1
  36. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.d.ts.map +1 -1
  37. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js +62 -55
  38. package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js.map +1 -1
  39. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.d.ts.map +1 -1
  40. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js +3 -4
  41. package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js.map +1 -1
  42. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.d.ts.map +1 -1
  43. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js +3 -4
  44. package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js.map +1 -1
  45. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.d.ts.map +1 -1
  46. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js +2 -3
  47. package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js.map +1 -1
  48. package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.d.ts.map +1 -1
  49. package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js +4 -5
  50. package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js.map +1 -1
  51. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.d.ts.map +1 -1
  52. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js +3 -4
  53. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js.map +1 -1
  54. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.d.ts.map +1 -1
  55. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js +2 -3
  56. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js.map +1 -1
  57. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.d.ts.map +1 -1
  58. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js +2 -3
  59. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js.map +1 -1
  60. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.d.ts.map +1 -1
  61. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js +1 -2
  62. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js.map +1 -1
  63. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.d.ts.map +1 -1
  64. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js +6 -7
  65. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js.map +1 -1
  66. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.d.ts.map +1 -1
  67. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js +7 -8
  68. package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js.map +1 -1
  69. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.d.ts.map +1 -1
  70. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js +10 -11
  71. package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js.map +1 -1
  72. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.d.ts.map +1 -1
  73. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js +3 -4
  74. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js.map +1 -1
  75. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.d.ts.map +1 -1
  76. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js +4 -5
  77. package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js.map +1 -1
  78. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.d.ts.map +1 -1
  79. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js +4 -5
  80. package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js.map +1 -1
  81. package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.d.ts.map +1 -1
  82. package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js +3 -4
  83. package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js.map +1 -1
  84. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.d.ts.map +1 -1
  85. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js +6 -7
  86. package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js.map +1 -1
  87. package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.d.ts.map +1 -1
  88. package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js +2 -3
  89. package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js.map +1 -1
  90. package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.d.ts.map +1 -1
  91. package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js +6 -7
  92. package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js.map +1 -1
  93. package/dist/src/fields/TiptapEditor/features/ui/Button/Button.d.ts.map +1 -1
  94. package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js +1 -2
  95. package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js.map +1 -1
  96. package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.d.ts.map +1 -1
  97. package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js +2 -3
  98. package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js.map +1 -1
  99. package/dist/src/fields/TiptapEditor/features/ui/Icon.d.ts.map +1 -1
  100. package/dist/src/fields/TiptapEditor/features/ui/Icon.js +1 -2
  101. package/dist/src/fields/TiptapEditor/features/ui/Icon.js.map +1 -1
  102. package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.d.ts.map +1 -1
  103. package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js +4 -5
  104. package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js.map +1 -1
  105. package/dist/src/fields/TiptapEditor/features/ui/Panel/index.d.ts.map +1 -1
  106. package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js +6 -7
  107. package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js.map +1 -1
  108. package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.d.ts.map +1 -1
  109. package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js +7 -9
  110. package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js.map +1 -1
  111. package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.d.ts.map +1 -1
  112. package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js +1 -2
  113. package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js.map +1 -1
  114. package/dist/src/fields/TiptapEditor/features/ui/Surface.d.ts.map +1 -1
  115. package/dist/src/fields/TiptapEditor/features/ui/Surface.js +1 -2
  116. package/dist/src/fields/TiptapEditor/features/ui/Surface.js.map +1 -1
  117. package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.d.ts.map +1 -1
  118. package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js +1 -2
  119. package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js.map +1 -1
  120. package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.d.ts.map +1 -1
  121. package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js +2 -5
  122. package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js.map +1 -1
  123. package/dist/src/fields/TiptapEditor/features/ui/Toolbar.d.ts.map +1 -1
  124. package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js +3 -5
  125. package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js.map +1 -1
  126. package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.d.ts.map +1 -1
  127. package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js +7 -8
  128. package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js.map +1 -1
  129. package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.d.ts.map +1 -1
  130. package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js +4 -5
  131. package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js.map +1 -1
  132. package/dist/src/fields/TiptapEditor/features/ui/scroll-area.d.ts.map +1 -1
  133. package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js +4 -5
  134. package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js.map +1 -1
  135. package/dist/src/styles.css +2642 -2133
  136. package/dist/tsconfig.tsbuildinfo +1 -1
  137. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useLocale } from \"@payloadcms/ui/providers/Locale\";\nimport { Editor } from \"@tiptap/react\";\nimport { useCompletion } from \"ai/react\";\nimport { ArrowRight, Sparkles } from \"lucide-react\";\nimport { useCallback, useState } from \"react\";\nimport Markdown from \"react-markdown\";\nimport { getPrevText } from \"../../../lib/utils/index.js\";\nimport { isRTL } from \"../../../lib/utils/isRtl.js\";\nimport AICompletionCommands from \"../../menus/TextMenu/components/ai-completion-command.js\";\nimport AISelectorCommands from \"../../menus/TextMenu/components/ai-selector-commands.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport CrazySpinner from \"../../ui/crazy-spinner.js\";\nimport { ScrollArea } from \"../../ui/scroll-area.js\";\nimport { twj } from \"tw-to-css\";\nexport type AIEditorPanelProps = {\n editor: Editor;\n onOpenChange: (value: boolean) => void;\n};\n\nexport const AIEditorPanel = ({ editor, onOpenChange }: AIEditorPanelProps) => {\n const [inputValue, setInputValue] = useState(\"\");\n const { code } = useLocale();\n\n // const { status, messages, input, submitMessage, handleInputChange } = useAssistant({\n // // id: \"novel\",\n // api: \"/api/assistant\",\n // onResponse: (response) => {\n // if (response.status === 429) {\n // toast.error(\"You have reached your request limit for the day.\");\n // return;\n // }\n // },\n // onError: (e) => {\n // toast.error(e.message);\n // },\n // });\n\n const { completion, complete, isLoading } = useCompletion({\n // id: \"novel\",\n api: \"/api/generate\",\n onResponse: (response) => {\n if (response.status === 429) {\n console.log(\"You have reached your request limit for the day.\");\n\n return;\n }\n },\n onError: (e) => {\n console.log(\"ERROR\", e.message);\n },\n });\n\n const hasCompletion = completion.length > 0;\n const handleClick = useCallback(() => {\n if (completion)\n return complete(completion, {\n body: { option: \"zap\", command: inputValue, language: code ?? \"en\" },\n }).then(() => setInputValue(\"\"));\n const text = getPrevText(editor, { chars: 5000 });\n\n complete(text, {\n body: { option: \"zap\", command: inputValue, language: code ?? \"en\" },\n }).then(() => setInputValue(\"\"));\n }, [code]);\n return (\n <Surface style={twj(\"p-2 min-w-[20rem]\")}>\n <>\n {hasCompletion && (\n <div style={twj(\"flex max-h-[400px]\")}>\n <ScrollArea>\n <div\n style={twj(\"prose p-2 px-4 prose-sm\")}\n dir={isRTL(completion) ? \"rtl\" : \"ltr\"}\n >\n <Markdown>{completion}</Markdown>\n </div>\n </ScrollArea>\n </div>\n )}\n\n {isLoading && (\n <div\n style={twj(\n \"flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-blue-500\"\n )}\n >\n <Sparkles style={twj(\"mr-2 h-4 w-4 shrink-0 \")} />\n AI is thinking\n <div style={twj(\"ml-2 mt-1\")}>\n <CrazySpinner />\n </div>\n </div>\n )}\n\n {!isLoading && (\n <>\n <div style={twj(\"flex justify-between items-center\")}>\n {/* <CommandInput\n value={inputValue}\n onValueChange={setInputValue}\n autoFocus\n placeholder={\n hasCompletion ? 'Tell AI what to do next' : 'Ask AI to edit or generate...'\n }\n // onFocus={() => addAIHighlight(editor)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleClick()\n }}\n /> */}\n <Sparkles style={twj(\"mr-2 h-4 w-4 shrink-0 text-blue-500 \")} />\n <input\n style={twj(\n \"w-full p-2 text-black bg-white rounded dark:bg-black dark:text-white focus:outline-none\"\n )}\n value={inputValue}\n onChange={(e) => {\n setInputValue(e.target.value);\n }}\n placeholder={\n hasCompletion\n ? \"Tell AI what to do next\"\n : \"Ask AI to edit or generate...\"\n }\n autoFocus\n // onFocus={() => addAIHighlight(editor)}\n\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleClick();\n }}\n />\n <Toolbar.Button\n // size=\"icon\"\n\n // style={twj(\"absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-zinc-100 hover:bg-zinc-150\"\n onClick={handleClick}\n >\n <ArrowRight />\n </Toolbar.Button>\n </div>\n {hasCompletion ? (\n <AICompletionCommands\n editor={editor}\n onDiscard={() => {\n editor.chain().unsetHighlight().focus().run();\n onOpenChange(false);\n }}\n completion={completion}\n />\n ) : (\n <AISelectorCommands\n editor={editor}\n onSelect={(value, options) => {\n complete(value, { body: options });\n }}\n />\n )}\n </>\n )}\n </>\n </Surface>\n );\n};\n"],"names":["useLocale","useCompletion","ArrowRight","Sparkles","useCallback","useState","Markdown","getPrevText","isRTL","AICompletionCommands","AISelectorCommands","Surface","Toolbar","CrazySpinner","ScrollArea","twj","AIEditorPanel","editor","onOpenChange","inputValue","setInputValue","code","completion","complete","isLoading","api","onResponse","response","status","console","log","onError","e","message","hasCompletion","length","handleClick","body","option","command","language","then","text","chars","style","div","dir","input","value","onChange","target","placeholder","autoFocus","onKeyDown","key","Button","onClick","onDiscard","chain","unsetHighlight","focus","run","onSelect","options"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useLocale } from \"@payloadcms/ui/providers/Locale\";\nimport { Editor } from \"@tiptap/react\";\nimport { useCompletion } from \"ai/react\";\nimport { ArrowRight, Sparkles } from \"lucide-react\";\nimport { useCallback, useState } from \"react\";\nimport Markdown from \"react-markdown\";\nimport { getPrevText } from \"../../../lib/utils/index.js\";\nimport { isRTL } from \"../../../lib/utils/isRtl.js\";\nimport AICompletionCommands from \"../../menus/TextMenu/components/ai-completion-command.js\";\nimport AISelectorCommands from \"../../menus/TextMenu/components/ai-selector-commands.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport CrazySpinner from \"../../ui/crazy-spinner.js\";\nimport { ScrollArea } from \"../../ui/scroll-area.js\";\nexport type AIEditorPanelProps = {\n editor: Editor;\n onOpenChange: (value: boolean) => void;\n};\n\nexport const AIEditorPanel = ({ editor, onOpenChange }: AIEditorPanelProps) => {\n const [inputValue, setInputValue] = useState(\"\");\n const { code } = useLocale();\n\n // const { status, messages, input, submitMessage, handleInputChange } = useAssistant({\n // // id: \"novel\",\n // api: \"/api/assistant\",\n // onResponse: (response) => {\n // if (response.status === 429) {\n // toast.error(\"You have reached your request limit for the day.\");\n // return;\n // }\n // },\n // onError: (e) => {\n // toast.error(e.message);\n // },\n // });\n\n const { completion, complete, isLoading } = useCompletion({\n // id: \"novel\",\n api: \"/api/generate\",\n onResponse: (response) => {\n if (response.status === 429) {\n console.log(\"You have reached your request limit for the day.\");\n\n return;\n }\n },\n onError: (e) => {\n console.log(\"ERROR\", e.message);\n },\n });\n\n const hasCompletion = completion.length > 0;\n const handleClick = useCallback(() => {\n if (completion)\n return complete(completion, {\n body: { option: \"zap\", command: inputValue, language: code ?? \"en\" },\n }).then(() => setInputValue(\"\"));\n const text = getPrevText(editor, { chars: 5000 });\n\n complete(text, {\n body: { option: \"zap\", command: inputValue, language: code ?? \"en\" },\n }).then(() => setInputValue(\"\"));\n }, [code]);\n return (\n <Surface className=\"p-2 min-w-[20rem]\">\n <>\n {hasCompletion && (\n <div className=\"flex max-h-[400px]\">\n <ScrollArea>\n <div\n className=\"prose p-2 px-4 prose-sm\"\n dir={isRTL(completion) ? \"rtl\" : \"ltr\"}\n >\n <Markdown>{completion}</Markdown>\n </div>\n </ScrollArea>\n </div>\n )}\n\n {isLoading && (\n <div className=\"flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-blue-500\">\n <Sparkles className=\"mr-2 h-4 w-4 shrink-0 \" />\n AI is thinking\n <div className=\"ml-2 mt-1\">\n <CrazySpinner />\n </div>\n </div>\n )}\n\n {!isLoading && (\n <>\n <div className=\"flex justify-between items-center\">\n {/* <CommandInput\n value={inputValue}\n onValueChange={setInputValue}\n autoFocus\n placeholder={\n hasCompletion ? 'Tell AI what to do next' : 'Ask AI to edit or generate...'\n }\n // onFocus={() => addAIHighlight(editor)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleClick()\n }}\n /> */}\n <Sparkles className=\"mr-2 h-4 w-4 shrink-0 text-blue-500 \" />\n <input\n className=\"w-full p-2 text-black bg-white rounded dark:bg-black dark:text-white focus:outline-none\"\n value={inputValue}\n onChange={(e) => {\n setInputValue(e.target.value);\n }}\n placeholder={\n hasCompletion\n ? \"Tell AI what to do next\"\n : \"Ask AI to edit or generate...\"\n }\n autoFocus\n // onFocus={() => addAIHighlight(editor)}\n\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleClick();\n }}\n />\n <Toolbar.Button\n // size=\"icon\"\n\n // className=\"absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-zinc-100 hover:bg-zinc-150\"\n onClick={handleClick}\n >\n <ArrowRight />\n </Toolbar.Button>\n </div>\n {hasCompletion ? (\n <AICompletionCommands\n editor={editor}\n onDiscard={() => {\n editor.chain().unsetHighlight().focus().run();\n onOpenChange(false);\n }}\n completion={completion}\n />\n ) : (\n <AISelectorCommands\n editor={editor}\n onSelect={(value, options) => {\n complete(value, { body: options });\n }}\n />\n )}\n </>\n )}\n </>\n </Surface>\n );\n};\n"],"names":["useLocale","useCompletion","ArrowRight","Sparkles","useCallback","useState","Markdown","getPrevText","isRTL","AICompletionCommands","AISelectorCommands","Surface","Toolbar","CrazySpinner","ScrollArea","AIEditorPanel","editor","onOpenChange","inputValue","setInputValue","code","completion","complete","isLoading","api","onResponse","response","status","console","log","onError","e","message","hasCompletion","length","handleClick","body","option","command","language","then","text","chars","className","div","dir","input","value","onChange","target","placeholder","autoFocus","onKeyDown","key","Button","onClick","onDiscard","chain","unsetHighlight","focus","run","onSelect","options"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,WAAW,+DACa,gBAAgB,uBA8BpD,CAAC"}
1
+ {"version":3,"file":"ColorButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,WAAW,+DACa,gBAAgB,uBA2BpD,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React, { memo, useCallback } from "react";
3
3
  import { cn } from "../../../lib/utils/index.js";
4
- import { twj } from "tw-to-css";
5
4
  export const ColorButton = /*#__PURE__*/ memo(({ color, active, onColorChange })=>{
6
5
  const wrapperClassName = cn("flex items-center justify-center px-1.5 py-1.5 rounded group", !active && "hover:bg-neutral-100", active && "bg-neutral-100");
7
6
  const bubbleClassName = cn("w-4 h-4 rounded bg-slate-100 shadow-sm ring-offset-2 ring-current", !active && `hover:ring-1`, active && `ring-1`);
@@ -16,13 +15,13 @@ export const ColorButton = /*#__PURE__*/ memo(({ color, active, onColorChange })
16
15
  return /*#__PURE__*/ _jsx("button", {
17
16
  type: "button",
18
17
  onClick: handleClick,
19
- style: twj(wrapperClassName),
18
+ className: wrapperClassName,
20
19
  children: /*#__PURE__*/ _jsx("div", {
21
20
  style: {
22
- ...twj(bubbleClassName),
23
21
  backgroundColor: color,
24
22
  color: color
25
- }
23
+ },
24
+ className: bubbleClassName
26
25
  })
27
26
  });
28
27
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.tsx"],"sourcesContent":["import React, { memo, useCallback } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type ColorButtonProps = {\n color?: string;\n active?: boolean;\n onColorChange?: (color: string) => void; // eslint-disable-line no-unused-vars\n};\n\nexport const ColorButton = memo(\n ({ color, active, onColorChange }: ColorButtonProps) => {\n const wrapperClassName = cn(\n \"flex items-center justify-center px-1.5 py-1.5 rounded group\",\n !active && \"hover:bg-neutral-100\",\n active && \"bg-neutral-100\"\n );\n const bubbleClassName = cn(\n \"w-4 h-4 rounded bg-slate-100 shadow-sm ring-offset-2 ring-current\",\n !active && `hover:ring-1`,\n active && `ring-1`\n );\n\n const handleClick = useCallback(() => {\n if (onColorChange) {\n onColorChange(color || \"\");\n }\n }, [onColorChange, color]);\n\n return (\n <button type=\"button\" onClick={handleClick} style={twj(wrapperClassName)}>\n <div\n style={{\n ...twj(bubbleClassName),\n backgroundColor: color,\n color: color,\n }}\n ></div>\n </button>\n );\n }\n);\n\nColorButton.displayName = \"ColorButton\";\n"],"names":["React","memo","useCallback","cn","twj","ColorButton","color","active","onColorChange","wrapperClassName","bubbleClassName","handleClick","button","type","onClick","style","div","backgroundColor","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,IAAI,EAAEC,WAAW,QAAQ,QAAQ;AACjD,SAASC,EAAE,QAAQ,8BAA8B;AACjD,SAASC,GAAG,QAAQ,YAAY;AAQhC,OAAO,MAAMC,4BAAcJ,KACzB,CAAC,EAAEK,KAAK,EAAEC,MAAM,EAAEC,aAAa,EAAoB;IACjD,MAAMC,mBAAmBN,GACvB,gEACA,CAACI,UAAU,wBACXA,UAAU;IAEZ,MAAMG,kBAAkBP,GACtB,qEACA,CAACI,UAAU,CAAC,YAAY,CAAC,EACzBA,UAAU,CAAC,MAAM,CAAC;IAGpB,MAAMI,cAAcT,YAAY;QAC9B,IAAIM,eAAe;YACjBA,cAAcF,SAAS;QACzB;IACF,GAAG;QAACE;QAAeF;KAAM;IAEzB,qBACE,KAACM;QAAOC,MAAK;QAASC,SAASH;QAAaI,OAAOX,IAAIK;kBACrD,cAAA,KAACO;YACCD,OAAO;gBACL,GAAGX,IAAIM,gBAAgB;gBACvBO,iBAAiBX;gBACjBA,OAAOA;YACT;;;AAIR,GACA;AAEFD,YAAYa,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.tsx"],"sourcesContent":["import React, { memo, useCallback } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\n\nexport type ColorButtonProps = {\n color?: string;\n active?: boolean;\n onColorChange?: (color: string) => void; // eslint-disable-line no-unused-vars\n};\n\nexport const ColorButton = memo(\n ({ color, active, onColorChange }: ColorButtonProps) => {\n const wrapperClassName = cn(\n \"flex items-center justify-center px-1.5 py-1.5 rounded group\",\n !active && \"hover:bg-neutral-100\",\n active && \"bg-neutral-100\"\n );\n const bubbleClassName = cn(\n \"w-4 h-4 rounded bg-slate-100 shadow-sm ring-offset-2 ring-current\",\n !active && `hover:ring-1`,\n active && `ring-1`\n );\n\n const handleClick = useCallback(() => {\n if (onColorChange) {\n onColorChange(color || \"\");\n }\n }, [onColorChange, color]);\n\n return (\n <button type=\"button\" onClick={handleClick} className={wrapperClassName}>\n <div\n style={{ backgroundColor: color, color: color }}\n className={bubbleClassName}\n ></div>\n </button>\n );\n }\n);\n\nColorButton.displayName = \"ColorButton\";\n"],"names":["React","memo","useCallback","cn","ColorButton","color","active","onColorChange","wrapperClassName","bubbleClassName","handleClick","button","type","onClick","className","div","style","backgroundColor","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,IAAI,EAAEC,WAAW,QAAQ,QAAQ;AACjD,SAASC,EAAE,QAAQ,8BAA8B;AAQjD,OAAO,MAAMC,4BAAcH,KACzB,CAAC,EAAEI,KAAK,EAAEC,MAAM,EAAEC,aAAa,EAAoB;IACjD,MAAMC,mBAAmBL,GACvB,gEACA,CAACG,UAAU,wBACXA,UAAU;IAEZ,MAAMG,kBAAkBN,GACtB,qEACA,CAACG,UAAU,CAAC,YAAY,CAAC,EACzBA,UAAU,CAAC,MAAM,CAAC;IAGpB,MAAMI,cAAcR,YAAY;QAC9B,IAAIK,eAAe;YACjBA,cAAcF,SAAS;QACzB;IACF,GAAG;QAACE;QAAeF;KAAM;IAEzB,qBACE,KAACM;QAAOC,MAAK;QAASC,SAASH;QAAaI,WAAWN;kBACrD,cAAA,KAACO;YACCC,OAAO;gBAAEC,iBAAiBZ;gBAAOA,OAAOA;YAAM;YAC9CS,WAAWL;;;AAInB,GACA;AAEFL,YAAYc,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"Colorpicker.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAkC,gBAAgB,sBA0DzE,CAAC"}
1
+ {"version":3,"file":"Colorpicker.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAQrD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAkC,gBAAgB,sBAwDzE,CAAC"}
@@ -6,7 +6,6 @@ import { Toolbar } from "../../ui/Toolbar.js";
6
6
  import { Icon } from "../../ui/Icon.js";
7
7
  import { themeColors } from "../../../lib/constants.js";
8
8
  import { Undo } from "lucide-react";
9
- import { twj } from "tw-to-css";
10
9
  export const ColorPicker = ({ color, onChange, onClear })=>{
11
10
  const [colorInputValue, setColorInputValue] = useState(color || "");
12
11
  const handleColorUpdate = useCallback((event)=>{
@@ -28,23 +27,23 @@ export const ColorPicker = ({ color, onChange, onClear })=>{
28
27
  onChange
29
28
  ]);
30
29
  return /*#__PURE__*/ _jsxs("div", {
31
- style: twj("flex flex-col gap-2"),
30
+ className: "flex flex-col gap-2",
32
31
  children: [
33
32
  /*#__PURE__*/ _jsx(HexColorPicker, {
34
- style: twj("w-full"),
33
+ className: "w-full",
35
34
  color: color || "",
36
35
  onChange: onChange
37
36
  }),
38
37
  /*#__PURE__*/ _jsx("input", {
39
38
  type: "text",
40
- style: twj("w-full p-2 text-black bg-white border rounded dark:bg-black dark:text-white border-neutral-200 dark:border-neutral-800 focus:outline-1 focus:ring-0 focus:outline-neutral-300 dark:focus:outline-neutral-700"),
39
+ className: "w-full p-2 text-black bg-white border rounded dark:bg-black dark:text-white border-neutral-200 dark:border-neutral-800 focus:outline-1 focus:ring-0 focus:outline-neutral-300 dark:focus:outline-neutral-700",
41
40
  placeholder: "#000000",
42
41
  value: colorInputValue,
43
42
  onChange: handleColorUpdate,
44
43
  onBlur: handleColorChange
45
44
  }),
46
45
  /*#__PURE__*/ _jsxs("div", {
47
- style: twj("flex flex-wrap items-center gap-1 max-w-[15rem]"),
46
+ className: "flex flex-wrap items-center gap-1 max-w-[15rem]",
48
47
  children: [
49
48
  themeColors.map((currentColor)=>/*#__PURE__*/ _jsx(ColorButton, {
50
49
  active: currentColor === color,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { HexColorPicker } from \"react-colorful\";\nimport { ColorButton } from \"./ColorButton.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { themeColors } from \"../../../lib/constants.js\";\nimport { Undo } from \"lucide-react\";\nimport { twj } from \"tw-to-css\";\n\nexport type ColorPickerProps = {\n color?: string;\n onChange?: (color: string) => void;\n onClear?: () => void;\n};\n\nexport const ColorPicker = ({ color, onChange, onClear }: ColorPickerProps) => {\n const [colorInputValue, setColorInputValue] = useState(color || \"\");\n\n const handleColorUpdate = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setColorInputValue(event.target.value);\n },\n []\n );\n\n const handleColorChange = useCallback(() => {\n const isCorrectColor = /^#([0-9A-F]{3}){1,2}$/i.test(colorInputValue);\n\n if (!isCorrectColor) {\n if (onChange) {\n onChange(\"\");\n }\n\n return;\n }\n\n if (onChange) {\n onChange(colorInputValue);\n }\n }, [colorInputValue, onChange]);\n\n return (\n <div style={twj(\"flex flex-col gap-2\")}>\n <HexColorPicker\n style={twj(\"w-full\")}\n color={color || \"\"}\n onChange={onChange}\n />\n <input\n type=\"text\"\n style={twj(\n \"w-full p-2 text-black bg-white border rounded dark:bg-black dark:text-white border-neutral-200 dark:border-neutral-800 focus:outline-1 focus:ring-0 focus:outline-neutral-300 dark:focus:outline-neutral-700\"\n )}\n placeholder=\"#000000\"\n value={colorInputValue}\n onChange={handleColorUpdate}\n onBlur={handleColorChange}\n />\n <div style={twj(\"flex flex-wrap items-center gap-1 max-w-[15rem]\")}>\n {themeColors.map((currentColor) => (\n <ColorButton\n active={currentColor === color}\n color={currentColor}\n key={currentColor}\n onColorChange={onChange}\n />\n ))}\n <Toolbar.Button tooltip=\"Reset color to default\" onClick={onClear}>\n <Icon icon={Undo} />\n </Toolbar.Button>\n </div>\n </div>\n );\n};\n"],"names":["React","useCallback","useState","HexColorPicker","ColorButton","Toolbar","Icon","themeColors","Undo","twj","ColorPicker","color","onChange","onClear","colorInputValue","setColorInputValue","handleColorUpdate","event","target","value","handleColorChange","isCorrectColor","test","div","style","input","type","placeholder","onBlur","map","currentColor","active","onColorChange","Button","tooltip","onClick","icon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AACrD,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,GAAG,QAAQ,YAAY;AAQhC,OAAO,MAAMC,cAAc,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAoB;IACxE,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGb,SAASS,SAAS;IAEhE,MAAMK,oBAAoBf,YACxB,CAACgB;QACCF,mBAAmBE,MAAMC,MAAM,CAACC,KAAK;IACvC,GACA,EAAE;IAGJ,MAAMC,oBAAoBnB,YAAY;QACpC,MAAMoB,iBAAiB,yBAAyBC,IAAI,CAACR;QAErD,IAAI,CAACO,gBAAgB;YACnB,IAAIT,UAAU;gBACZA,SAAS;YACX;YAEA;QACF;QAEA,IAAIA,UAAU;YACZA,SAASE;QACX;IACF,GAAG;QAACA;QAAiBF;KAAS;IAE9B,qBACE,MAACW;QAAIC,OAAOf,IAAI;;0BACd,KAACN;gBACCqB,OAAOf,IAAI;gBACXE,OAAOA,SAAS;gBAChBC,UAAUA;;0BAEZ,KAACa;gBACCC,MAAK;gBACLF,OAAOf,IACL;gBAEFkB,aAAY;gBACZR,OAAOL;gBACPF,UAAUI;gBACVY,QAAQR;;0BAEV,MAACG;gBAAIC,OAAOf,IAAI;;oBACbF,YAAYsB,GAAG,CAAC,CAACC,6BAChB,KAAC1B;4BACC2B,QAAQD,iBAAiBnB;4BACzBA,OAAOmB;4BAEPE,eAAepB;2BADVkB;kCAIT,KAACzB,QAAQ4B,MAAM;wBAACC,SAAQ;wBAAyBC,SAAStB;kCACxD,cAAA,KAACP;4BAAK8B,MAAM5B;;;;;;;AAKtB,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { HexColorPicker } from \"react-colorful\";\nimport { ColorButton } from \"./ColorButton.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { themeColors } from \"../../../lib/constants.js\";\nimport { Undo } from \"lucide-react\";\n\nexport type ColorPickerProps = {\n color?: string;\n onChange?: (color: string) => void;\n onClear?: () => void;\n};\n\nexport const ColorPicker = ({ color, onChange, onClear }: ColorPickerProps) => {\n const [colorInputValue, setColorInputValue] = useState(color || \"\");\n\n const handleColorUpdate = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setColorInputValue(event.target.value);\n },\n []\n );\n\n const handleColorChange = useCallback(() => {\n const isCorrectColor = /^#([0-9A-F]{3}){1,2}$/i.test(colorInputValue);\n\n if (!isCorrectColor) {\n if (onChange) {\n onChange(\"\");\n }\n\n return;\n }\n\n if (onChange) {\n onChange(colorInputValue);\n }\n }, [colorInputValue, onChange]);\n\n return (\n <div className=\"flex flex-col gap-2\">\n <HexColorPicker\n className=\"w-full\"\n color={color || \"\"}\n onChange={onChange}\n />\n <input\n type=\"text\"\n className=\"w-full p-2 text-black bg-white border rounded dark:bg-black dark:text-white border-neutral-200 dark:border-neutral-800 focus:outline-1 focus:ring-0 focus:outline-neutral-300 dark:focus:outline-neutral-700\"\n placeholder=\"#000000\"\n value={colorInputValue}\n onChange={handleColorUpdate}\n onBlur={handleColorChange}\n />\n <div className=\"flex flex-wrap items-center gap-1 max-w-[15rem]\">\n {themeColors.map((currentColor) => (\n <ColorButton\n active={currentColor === color}\n color={currentColor}\n key={currentColor}\n onColorChange={onChange}\n />\n ))}\n <Toolbar.Button tooltip=\"Reset color to default\" onClick={onClear}>\n <Icon icon={Undo} />\n </Toolbar.Button>\n </div>\n </div>\n );\n};\n"],"names":["React","useCallback","useState","HexColorPicker","ColorButton","Toolbar","Icon","themeColors","Undo","ColorPicker","color","onChange","onClear","colorInputValue","setColorInputValue","handleColorUpdate","event","target","value","handleColorChange","isCorrectColor","test","div","className","input","type","placeholder","onBlur","map","currentColor","active","onColorChange","Button","tooltip","onClick","icon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AACrD,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,IAAI,QAAQ,eAAe;AAQpC,OAAO,MAAMC,cAAc,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAoB;IACxE,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGZ,SAASQ,SAAS;IAEhE,MAAMK,oBAAoBd,YACxB,CAACe;QACCF,mBAAmBE,MAAMC,MAAM,CAACC,KAAK;IACvC,GACA,EAAE;IAGJ,MAAMC,oBAAoBlB,YAAY;QACpC,MAAMmB,iBAAiB,yBAAyBC,IAAI,CAACR;QAErD,IAAI,CAACO,gBAAgB;YACnB,IAAIT,UAAU;gBACZA,SAAS;YACX;YAEA;QACF;QAEA,IAAIA,UAAU;YACZA,SAASE;QACX;IACF,GAAG;QAACA;QAAiBF;KAAS;IAE9B,qBACE,MAACW;QAAIC,WAAU;;0BACb,KAACpB;gBACCoB,WAAU;gBACVb,OAAOA,SAAS;gBAChBC,UAAUA;;0BAEZ,KAACa;gBACCC,MAAK;gBACLF,WAAU;gBACVG,aAAY;gBACZR,OAAOL;gBACPF,UAAUI;gBACVY,QAAQR;;0BAEV,MAACG;gBAAIC,WAAU;;oBACZhB,YAAYqB,GAAG,CAAC,CAACC,6BAChB,KAACzB;4BACC0B,QAAQD,iBAAiBnB;4BACzBA,OAAOmB;4BAEPE,eAAepB;2BADVkB;kCAIT,KAACxB,QAAQ2B,MAAM;wBAACC,SAAQ;wBAAyBC,SAAStB;kCACxD,cAAA,KAACN;4BAAK6B,MAAM3B;;;;;;;AAKtB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"IframeLinkEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAOrD,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,+BAG5B,0BAA0B;;;sBAIjB,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC;sBAS1C,KAAK,CAAC,SAAS;CAetB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oDAI/B,0BAA0B,sBAuC5B,CAAC"}
1
+ {"version":3,"file":"IframeLinkEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAMrD,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,+BAG5B,0BAA0B;;;sBAIjB,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC;sBAS1C,KAAK,CAAC,SAAS;CAetB,CAAC;AAEF,eAAO,MAAM,qBAAqB,oDAI/B,0BAA0B,sBAiC5B,CAAC"}
@@ -4,7 +4,6 @@ import { Link } from "lucide-react";
4
4
  import { Button } from "../../ui/Button/Button.js";
5
5
  import { Icon } from "../../ui/Icon.js";
6
6
  import { Surface } from "../../ui/Surface.js";
7
- import { twj } from "tw-to-css";
8
7
  export const useLinkEditorState = ({ initialSrc, onSetLink })=>{
9
8
  const [url, setUrl] = useState(initialSrc || "");
10
9
  const onChange = useCallback((event)=>{
@@ -34,19 +33,19 @@ export const IframeLinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialS
34
33
  initialSrc
35
34
  });
36
35
  return /*#__PURE__*/ _jsx(Surface, {
37
- style: twj("p-2"),
36
+ className: "p-2",
38
37
  children: /*#__PURE__*/ _jsxs("div", {
39
- style: twj("flex items-center gap-2"),
38
+ className: "flex items-center gap-2",
40
39
  children: [
41
40
  /*#__PURE__*/ _jsxs("label", {
42
- style: twj("flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text"),
41
+ className: "flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text",
43
42
  children: [
44
43
  /*#__PURE__*/ _jsx(Icon, {
45
44
  icon: Link,
46
45
  className: "flex-none text-black dark:text-white"
47
46
  }),
48
47
  /*#__PURE__*/ _jsx("textarea", {
49
- style: twj("flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white"),
48
+ className: "flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white",
50
49
  placeholder: "Enter Embed Code",
51
50
  value: state.url,
52
51
  onChange: state.onChange
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { Link } from \"lucide-react\";\nimport { Button } from \"../../ui/Button/Button.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type IframeLinkEditorPanelProps = {\n initialSrc?: string;\n initialOpenInNewTab?: boolean;\n onSetLink: (src: string) => void;\n};\n\nexport const useLinkEditorState = ({\n initialSrc,\n onSetLink,\n}: IframeLinkEditorPanelProps) => {\n const [url, setUrl] = useState(initialSrc || \"\");\n\n const onChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setUrl(event.target.value);\n },\n []\n );\n\n // const isValidUrl = useMemo(() => /^(\\S+):(\\/\\/)?\\S+$/.test(url), [url]);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n // if (isValidUrl) {\n onSetLink(url);\n // }\n },\n [url, onSetLink]\n );\n\n return {\n url,\n setUrl,\n onChange,\n handleSubmit,\n };\n};\n\nexport const IframeLinkEditorPanel = ({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n}: IframeLinkEditorPanelProps) => {\n const state = useLinkEditorState({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n });\n\n return (\n <Surface style={twj(\"p-2\")}>\n <div style={twj(\"flex items-center gap-2\")}>\n <label\n style={twj(\n \"flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text\"\n )}\n >\n <Icon icon={Link} className=\"flex-none text-black dark:text-white\" />\n <textarea\n style={twj(\n \"flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white\"\n )}\n placeholder=\"Enter Embed Code\"\n value={state.url}\n onChange={state.onChange}\n />\n </label>\n <Button\n variant=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n onClick={(e) => {\n state.handleSubmit(e);\n }}\n // disabled={!state.isValidUrl}\n >\n Set Link\n </Button>\n </div>\n </Surface>\n );\n};\n"],"names":["React","useCallback","useState","Link","Button","Icon","Surface","twj","useLinkEditorState","initialSrc","onSetLink","url","setUrl","onChange","event","target","value","handleSubmit","e","preventDefault","IframeLinkEditorPanel","initialOpenInNewTab","state","style","div","label","icon","className","textarea","placeholder","variant","buttonSize","type","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AACrD,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,GAAG,QAAQ,YAAY;AAQhC,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,UAAU,EACVC,SAAS,EACkB;IAC3B,MAAM,CAACC,KAAKC,OAAO,GAAGV,SAASO,cAAc;IAE7C,MAAMI,WAAWZ,YACf,CAACa;QACCF,OAAOE,MAAMC,MAAM,CAACC,KAAK;IAC3B,GACA,EAAE;IAGJ,2EAA2E;IAE3E,MAAMC,eAAehB,YACnB,CAACiB;QACCA,EAAEC,cAAc;QAChB,oBAAoB;QACpBT,UAAUC;IACV,IAAI;IACN,GACA;QAACA;QAAKD;KAAU;IAGlB,OAAO;QACLC;QACAC;QACAC;QACAI;IACF;AACF,EAAE;AAEF,OAAO,MAAMG,wBAAwB,CAAC,EACpCV,SAAS,EACTW,mBAAmB,EACnBZ,UAAU,EACiB;IAC3B,MAAMa,QAAQd,mBAAmB;QAC/BE;QACAW;QACAZ;IACF;IAEA,qBACE,KAACH;QAAQiB,OAAOhB,IAAI;kBAClB,cAAA,MAACiB;YAAID,OAAOhB,IAAI;;8BACd,MAACkB;oBACCF,OAAOhB,IACL;;sCAGF,KAACF;4BAAKqB,MAAMvB;4BAAMwB,WAAU;;sCAC5B,KAACC;4BACCL,OAAOhB,IACL;4BAEFsB,aAAY;4BACZb,OAAOM,MAAMX,GAAG;4BAChBE,UAAUS,MAAMT,QAAQ;;;;8BAG5B,KAACT;oBACC0B,SAAQ;oBACRC,YAAW;oBACXC,MAAK;oBACLC,SAAS,CAACf;wBACRI,MAAML,YAAY,CAACC;oBACrB;8BAED;;;;;AAMT,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { Link } from \"lucide-react\";\nimport { Button } from \"../../ui/Button/Button.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\n\nexport type IframeLinkEditorPanelProps = {\n initialSrc?: string;\n initialOpenInNewTab?: boolean;\n onSetLink: (src: string) => void;\n};\n\nexport const useLinkEditorState = ({\n initialSrc,\n onSetLink,\n}: IframeLinkEditorPanelProps) => {\n const [url, setUrl] = useState(initialSrc || \"\");\n\n const onChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setUrl(event.target.value);\n },\n []\n );\n\n // const isValidUrl = useMemo(() => /^(\\S+):(\\/\\/)?\\S+$/.test(url), [url]);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n // if (isValidUrl) {\n onSetLink(url);\n // }\n },\n [url, onSetLink]\n );\n\n return {\n url,\n setUrl,\n onChange,\n handleSubmit,\n };\n};\n\nexport const IframeLinkEditorPanel = ({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n}: IframeLinkEditorPanelProps) => {\n const state = useLinkEditorState({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n });\n\n return (\n <Surface className=\"p-2\">\n <div className=\"flex items-center gap-2\">\n <label className=\"flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text\">\n <Icon icon={Link} className=\"flex-none text-black dark:text-white\" />\n <textarea\n className=\"flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white\"\n placeholder=\"Enter Embed Code\"\n value={state.url}\n onChange={state.onChange}\n />\n </label>\n <Button\n variant=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n onClick={(e) => {\n state.handleSubmit(e);\n }}\n // disabled={!state.isValidUrl}\n >\n Set Link\n </Button>\n </div>\n </Surface>\n );\n};\n"],"names":["React","useCallback","useState","Link","Button","Icon","Surface","useLinkEditorState","initialSrc","onSetLink","url","setUrl","onChange","event","target","value","handleSubmit","e","preventDefault","IframeLinkEditorPanel","initialOpenInNewTab","state","className","div","label","icon","textarea","placeholder","variant","buttonSize","type","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AACrD,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAQ9C,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,UAAU,EACVC,SAAS,EACkB;IAC3B,MAAM,CAACC,KAAKC,OAAO,GAAGT,SAASM,cAAc;IAE7C,MAAMI,WAAWX,YACf,CAACY;QACCF,OAAOE,MAAMC,MAAM,CAACC,KAAK;IAC3B,GACA,EAAE;IAGJ,2EAA2E;IAE3E,MAAMC,eAAef,YACnB,CAACgB;QACCA,EAAEC,cAAc;QAChB,oBAAoB;QACpBT,UAAUC;IACV,IAAI;IACN,GACA;QAACA;QAAKD;KAAU;IAGlB,OAAO;QACLC;QACAC;QACAC;QACAI;IACF;AACF,EAAE;AAEF,OAAO,MAAMG,wBAAwB,CAAC,EACpCV,SAAS,EACTW,mBAAmB,EACnBZ,UAAU,EACiB;IAC3B,MAAMa,QAAQd,mBAAmB;QAC/BE;QACAW;QACAZ;IACF;IAEA,qBACE,KAACF;QAAQgB,WAAU;kBACjB,cAAA,MAACC;YAAID,WAAU;;8BACb,MAACE;oBAAMF,WAAU;;sCACf,KAACjB;4BAAKoB,MAAMtB;4BAAMmB,WAAU;;sCAC5B,KAACI;4BACCJ,WAAU;4BACVK,aAAY;4BACZZ,OAAOM,MAAMX,GAAG;4BAChBE,UAAUS,MAAMT,QAAQ;;;;8BAG5B,KAACR;oBACCwB,SAAQ;oBACRC,YAAW;oBACXC,MAAK;oBACLC,SAAS,CAACd;wBACRI,MAAML,YAAY,CAACC;oBACrB;8BAED;;;;;AAMT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"InsideLinksEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,2BAA2B,GAAG;IACxC,oBAAoB,EAAE,CAAC,EACrB,SAAS,EACT,KAAK,EACL,EAAE,EACF,IAAI,EACJ,GAAG,GACJ,EAAE;QACD,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,KAAK,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,wCAInC,2BAA2B,gCAkB1B,CAAC"}
1
+ {"version":3,"file":"InsideLinksEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,2BAA2B,GAAG;IACxC,oBAAoB,EAAE,CAAC,EACrB,SAAS,EACT,KAAK,EACL,EAAE,EACF,IAAI,EACJ,GAAG,GACJ,EAAE;QACD,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,KAAK,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,wCAInC,2BAA2B,gCAgB1B,CAAC"}
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { twj } from "tw-to-css";
3
2
  import { ContentRelationship } from "../../../extensions/InsideLinks/InsideLink.client.js";
4
3
  import { Surface } from "../../ui/Surface.js";
5
4
  export const InsideLinksEditorPanel = ({ onRelationshipSelect, onCancel })=>{
6
5
  return /*#__PURE__*/ _jsx(Surface, {
7
- style: twj("p-2"),
6
+ className: "p-2",
8
7
  children: /*#__PURE__*/ _jsxs("div", {
9
- style: twj("flex flex-col items-center gap-2 p-1"),
8
+ className: "flex flex-col items-center gap-2 p-1",
10
9
  children: [
11
10
  /*#__PURE__*/ _jsx(ContentRelationship, {
12
11
  setRelationship: ({ id, thumbnail, title, type, url })=>{
@@ -23,7 +22,7 @@ export const InsideLinksEditorPanel = ({ onRelationshipSelect, onCancel })=>{
23
22
  }
24
23
  }),
25
24
  /*#__PURE__*/ _jsx("span", {
26
- style: twj("mt-1 mb-0 text-sm"),
25
+ className: "mt-1 mb-0 text-sm",
27
26
  children: "Add Internal Link to Contents"
28
27
  })
29
28
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.tsx"],"sourcesContent":["import { twj } from \"tw-to-css\";\nimport { ContentRelationship } from \"../../../extensions/InsideLinks/InsideLink.client.js\";\nimport { Surface } from \"../../ui/Surface.js\";\n\nexport type InsideLinksEditorPanelProps = {\n onRelationshipSelect: ({\n thumbnail,\n title,\n id,\n type,\n url,\n }: {\n id: string;\n type: string;\n thumbnail: string;\n title: string;\n url: string;\n }) => void;\n onCancel: () => void;\n};\n\nexport const InsideLinksEditorPanel = ({\n onRelationshipSelect,\n onCancel,\n}: // initialOpenInNewTab,\nInsideLinksEditorPanelProps) => {\n return (\n <Surface style={twj(\"p-2\")}>\n <div style={twj(\"flex flex-col items-center gap-2 p-1\")}>\n <ContentRelationship\n setRelationship={({ id, thumbnail, title, type, url }) => {\n onRelationshipSelect({ id, thumbnail, title, type, url });\n }}\n cancelSelection={() => {\n onCancel();\n }}\n />\n <span style={twj(\"mt-1 mb-0 text-sm\")}>\n Add Internal Link to Contents\n </span>\n </div>\n </Surface>\n );\n};\n"],"names":["twj","ContentRelationship","Surface","InsideLinksEditorPanel","onRelationshipSelect","onCancel","style","div","setRelationship","id","thumbnail","title","type","url","cancelSelection","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,OAAO,QAAQ,sBAAsB;AAmB9C,OAAO,MAAMC,yBAAyB,CAAC,EACrCC,oBAAoB,EACpBC,QAAQ,EAEiB;IACzB,qBACE,KAACH;QAAQI,OAAON,IAAI;kBAClB,cAAA,MAACO;YAAID,OAAON,IAAI;;8BACd,KAACC;oBACCO,iBAAiB,CAAC,EAAEC,EAAE,EAAEC,SAAS,EAAEC,KAAK,EAAEC,IAAI,EAAEC,GAAG,EAAE;wBACnDT,qBAAqB;4BAAEK;4BAAIC;4BAAWC;4BAAOC;4BAAMC;wBAAI;oBACzD;oBACAC,iBAAiB;wBACfT;oBACF;;8BAEF,KAACU;oBAAKT,OAAON,IAAI;8BAAsB;;;;;AAM/C,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.tsx"],"sourcesContent":["import { ContentRelationship } from \"../../../extensions/InsideLinks/InsideLink.client.js\";\nimport { Surface } from \"../../ui/Surface.js\";\n\nexport type InsideLinksEditorPanelProps = {\n onRelationshipSelect: ({\n thumbnail,\n title,\n id,\n type,\n url,\n }: {\n id: string;\n type: string;\n thumbnail: string;\n title: string;\n url: string;\n }) => void;\n onCancel: () => void;\n};\n\nexport const InsideLinksEditorPanel = ({\n onRelationshipSelect,\n onCancel,\n}: // initialOpenInNewTab,\nInsideLinksEditorPanelProps) => {\n return (\n <Surface className=\"p-2\">\n <div className=\"flex flex-col items-center gap-2 p-1\">\n <ContentRelationship\n setRelationship={({ id, thumbnail, title, type, url }) => {\n onRelationshipSelect({ id, thumbnail, title, type, url });\n }}\n cancelSelection={() => {\n onCancel();\n }}\n />\n <span className=\"mt-1 mb-0 text-sm\">Add Internal Link to Contents</span>\n </div>\n </Surface>\n );\n};\n"],"names":["ContentRelationship","Surface","InsideLinksEditorPanel","onRelationshipSelect","onCancel","className","div","setRelationship","id","thumbnail","title","type","url","cancelSelection","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,OAAO,QAAQ,sBAAsB;AAmB9C,OAAO,MAAMC,yBAAyB,CAAC,EACrCC,oBAAoB,EACpBC,QAAQ,EAEiB;IACzB,qBACE,KAACH;QAAQI,WAAU;kBACjB,cAAA,MAACC;YAAID,WAAU;;8BACb,KAACL;oBACCO,iBAAiB,CAAC,EAAEC,EAAE,EAAEC,SAAS,EAAEC,KAAK,EAAEC,IAAI,EAAEC,GAAG,EAAE;wBACnDT,qBAAqB;4BAAEK;4BAAIC;4BAAWC;4BAAOC;4BAAMC;wBAAI;oBACzD;oBACAC,iBAAiB;wBACfT;oBACF;;8BAEF,KAACU;oBAAKT,WAAU;8BAAoB;;;;;AAI5C,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,oDAI5B,oBAAoB;;;;;sBAMgB,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;sBAOlE,KAAK,CAAC,SAAS;;CAkBtB,CAAC;AAEF,eAAO,MAAM,eAAe,oDAIzB,oBAAoB,sBAqDtB,CAAC"}
1
+ {"version":3,"file":"LinkEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAM9D,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,oDAI5B,oBAAoB;;;;;sBAMgB,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;sBAOlE,KAAK,CAAC,SAAS;;CAkBtB,CAAC;AAEF,eAAO,MAAM,eAAe,oDAIzB,oBAAoB,sBA2CtB,CAAC"}
@@ -5,7 +5,6 @@ import { Button } from "../../ui/Button/Button.js";
5
5
  import { Icon } from "../../ui/Icon.js";
6
6
  import { Surface } from "../../ui/Surface.js";
7
7
  import { Toggle } from "../../ui/Toggle/Toggle.js";
8
- import { twj } from "tw-to-css";
9
8
  export const useLinkEditorState = ({ initialUrl, initialOpenInNewTab, onSetLink })=>{
10
9
  const [url, setUrl] = useState(initialUrl || "");
11
10
  const [openInNewTab, setOpenInNewTab] = useState(initialOpenInNewTab || false);
@@ -43,12 +42,12 @@ export const LinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialUrl })=
43
42
  initialUrl
44
43
  });
45
44
  return /*#__PURE__*/ _jsx(Surface, {
46
- style: twj("p-2"),
45
+ className: "p-2",
47
46
  children: /*#__PURE__*/ _jsxs("div", {
48
- style: twj("flex items-center gap-2"),
47
+ className: "flex items-center gap-2",
49
48
  children: [
50
49
  /*#__PURE__*/ _jsxs("label", {
51
- style: twj("flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text"),
50
+ className: "flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text",
52
51
  children: [
53
52
  /*#__PURE__*/ _jsx(Icon, {
54
53
  icon: Link,
@@ -56,7 +55,7 @@ export const LinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialUrl })=
56
55
  }),
57
56
  /*#__PURE__*/ _jsx("input", {
58
57
  type: "url",
59
- style: twj("flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white"),
58
+ className: "flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white",
60
59
  placeholder: "Enter URL",
61
60
  value: state.url,
62
61
  onChange: state.onChange
@@ -74,9 +73,9 @@ export const LinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialUrl })=
74
73
  children: "Set Link"
75
74
  }),
76
75
  /*#__PURE__*/ _jsx("div", {
77
- style: twj("mt-3"),
76
+ className: "mt-3",
78
77
  children: /*#__PURE__*/ _jsxs("label", {
79
- style: twj("flex items-center justify-start gap-2 text-sm font-semibold cursor-pointer select-none text-neutral-500 dark:text-neutral-400"),
78
+ className: "flex items-center justify-start gap-2 text-sm font-semibold cursor-pointer select-none text-neutral-500 dark:text-neutral-400",
80
79
  children: [
81
80
  "Open in new tab",
82
81
  /*#__PURE__*/ _jsx(Toggle, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.tsx"],"sourcesContent":["import { Link } from \"lucide-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { Button } from \"../../ui/Button/Button.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toggle } from \"../../ui/Toggle/Toggle.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type LinkEditorPanelProps = {\n initialUrl?: string;\n initialOpenInNewTab?: boolean;\n onSetLink: (url: string, openInNewTab?: boolean) => void;\n};\n\nexport const useLinkEditorState = ({\n initialUrl,\n initialOpenInNewTab,\n onSetLink,\n}: LinkEditorPanelProps) => {\n const [url, setUrl] = useState(initialUrl || \"\");\n const [openInNewTab, setOpenInNewTab] = useState(\n initialOpenInNewTab || false\n );\n\n const onChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUrl(event.target.value);\n }, []);\n\n const isValidUrl = useMemo(() => /^(\\S+):(\\/\\/)?\\S+$/.test(url), [url]);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n if (isValidUrl) {\n onSetLink(url, openInNewTab);\n }\n },\n [url, isValidUrl, openInNewTab, onSetLink]\n );\n\n return {\n url,\n setUrl,\n openInNewTab,\n setOpenInNewTab,\n onChange,\n handleSubmit,\n isValidUrl,\n };\n};\n\nexport const LinkEditorPanel = ({\n onSetLink,\n initialOpenInNewTab,\n initialUrl,\n}: LinkEditorPanelProps) => {\n const state = useLinkEditorState({\n onSetLink,\n initialOpenInNewTab,\n initialUrl,\n });\n\n return (\n <Surface style={twj(\"p-2\")}>\n <div style={twj(\"flex items-center gap-2\")}>\n <label\n style={twj(\n \"flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text\"\n )}\n >\n <Icon icon={Link} className=\"flex-none text-black dark:text-white\" />\n <input\n type=\"url\"\n style={twj(\n \"flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white\"\n )}\n placeholder=\"Enter URL\"\n value={state.url}\n onChange={state.onChange}\n />\n </label>\n <Button\n variant=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n onClick={(e) => {\n state.handleSubmit(e);\n }}\n disabled={!state.isValidUrl}\n >\n Set Link\n </Button>\n <div style={twj(\"mt-3\")}>\n <label\n style={twj(\n \"flex items-center justify-start gap-2 text-sm font-semibold cursor-pointer select-none text-neutral-500 dark:text-neutral-400\"\n )}\n >\n Open in new tab\n <Toggle\n active={state.openInNewTab}\n onChange={state.setOpenInNewTab}\n />\n </label>\n </div>\n </div>\n </Surface>\n );\n};\n"],"names":["Link","React","useCallback","useMemo","useState","Button","Icon","Surface","Toggle","twj","useLinkEditorState","initialUrl","initialOpenInNewTab","onSetLink","url","setUrl","openInNewTab","setOpenInNewTab","onChange","event","target","value","isValidUrl","test","handleSubmit","e","preventDefault","LinkEditorPanel","state","style","div","label","icon","className","input","type","placeholder","variant","buttonSize","onClick","disabled","active"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,IAAI,QAAQ,eAAe;AACpC,OAAOC,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAC9D,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,GAAG,QAAQ,YAAY;AAQhC,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACY;IACrB,MAAM,CAACC,KAAKC,OAAO,GAAGX,SAASO,cAAc;IAC7C,MAAM,CAACK,cAAcC,gBAAgB,GAAGb,SACtCQ,uBAAuB;IAGzB,MAAMM,WAAWhB,YAAY,CAACiB;QAC5BJ,OAAOI,MAAMC,MAAM,CAACC,KAAK;IAC3B,GAAG,EAAE;IAEL,MAAMC,aAAanB,QAAQ,IAAM,qBAAqBoB,IAAI,CAACT,MAAM;QAACA;KAAI;IAEtE,MAAMU,eAAetB,YACnB,CAACuB;QACCA,EAAEC,cAAc;QAChB,IAAIJ,YAAY;YACdT,UAAUC,KAAKE;QACjB;IACF,GACA;QAACF;QAAKQ;QAAYN;QAAcH;KAAU;IAG5C,OAAO;QACLC;QACAC;QACAC;QACAC;QACAC;QACAM;QACAF;IACF;AACF,EAAE;AAEF,OAAO,MAAMK,kBAAkB,CAAC,EAC9Bd,SAAS,EACTD,mBAAmB,EACnBD,UAAU,EACW;IACrB,MAAMiB,QAAQlB,mBAAmB;QAC/BG;QACAD;QACAD;IACF;IAEA,qBACE,KAACJ;QAAQsB,OAAOpB,IAAI;kBAClB,cAAA,MAACqB;YAAID,OAAOpB,IAAI;;8BACd,MAACsB;oBACCF,OAAOpB,IACL;;sCAGF,KAACH;4BAAK0B,MAAMhC;4BAAMiC,WAAU;;sCAC5B,KAACC;4BACCC,MAAK;4BACLN,OAAOpB,IACL;4BAEF2B,aAAY;4BACZf,OAAOO,MAAMd,GAAG;4BAChBI,UAAUU,MAAMV,QAAQ;;;;8BAG5B,KAACb;oBACCgC,SAAQ;oBACRC,YAAW;oBACXH,MAAK;oBACLI,SAAS,CAACd;wBACRG,MAAMJ,YAAY,CAACC;oBACrB;oBACAe,UAAU,CAACZ,MAAMN,UAAU;8BAC5B;;8BAGD,KAACQ;oBAAID,OAAOpB,IAAI;8BACd,cAAA,MAACsB;wBACCF,OAAOpB,IACL;;4BAEH;0CAEC,KAACD;gCACCiC,QAAQb,MAAMZ,YAAY;gCAC1BE,UAAUU,MAAMX,eAAe;;;;;;;;AAO7C,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.tsx"],"sourcesContent":["import { Link } from \"lucide-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport { Button } from \"../../ui/Button/Button.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toggle } from \"../../ui/Toggle/Toggle.js\";\n\nexport type LinkEditorPanelProps = {\n initialUrl?: string;\n initialOpenInNewTab?: boolean;\n onSetLink: (url: string, openInNewTab?: boolean) => void;\n};\n\nexport const useLinkEditorState = ({\n initialUrl,\n initialOpenInNewTab,\n onSetLink,\n}: LinkEditorPanelProps) => {\n const [url, setUrl] = useState(initialUrl || \"\");\n const [openInNewTab, setOpenInNewTab] = useState(\n initialOpenInNewTab || false\n );\n\n const onChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUrl(event.target.value);\n }, []);\n\n const isValidUrl = useMemo(() => /^(\\S+):(\\/\\/)?\\S+$/.test(url), [url]);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n if (isValidUrl) {\n onSetLink(url, openInNewTab);\n }\n },\n [url, isValidUrl, openInNewTab, onSetLink]\n );\n\n return {\n url,\n setUrl,\n openInNewTab,\n setOpenInNewTab,\n onChange,\n handleSubmit,\n isValidUrl,\n };\n};\n\nexport const LinkEditorPanel = ({\n onSetLink,\n initialOpenInNewTab,\n initialUrl,\n}: LinkEditorPanelProps) => {\n const state = useLinkEditorState({\n onSetLink,\n initialOpenInNewTab,\n initialUrl,\n });\n\n return (\n <Surface className=\"p-2\">\n <div className=\"flex items-center gap-2\">\n <label className=\"flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text\">\n <Icon icon={Link} className=\"flex-none text-black dark:text-white\" />\n <input\n type=\"url\"\n className=\"flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white\"\n placeholder=\"Enter URL\"\n value={state.url}\n onChange={state.onChange}\n />\n </label>\n <Button\n variant=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n onClick={(e) => {\n state.handleSubmit(e);\n }}\n disabled={!state.isValidUrl}\n >\n Set Link\n </Button>\n <div className=\"mt-3\">\n <label className=\"flex items-center justify-start gap-2 text-sm font-semibold cursor-pointer select-none text-neutral-500 dark:text-neutral-400\">\n Open in new tab\n <Toggle\n active={state.openInNewTab}\n onChange={state.setOpenInNewTab}\n />\n </label>\n </div>\n </div>\n </Surface>\n );\n};\n"],"names":["Link","React","useCallback","useMemo","useState","Button","Icon","Surface","Toggle","useLinkEditorState","initialUrl","initialOpenInNewTab","onSetLink","url","setUrl","openInNewTab","setOpenInNewTab","onChange","event","target","value","isValidUrl","test","handleSubmit","e","preventDefault","LinkEditorPanel","state","className","div","label","icon","input","type","placeholder","variant","buttonSize","onClick","disabled","active"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,IAAI,QAAQ,eAAe;AACpC,OAAOC,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAC9D,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,MAAM,QAAQ,4BAA4B;AAQnD,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACY;IACrB,MAAM,CAACC,KAAKC,OAAO,GAAGV,SAASM,cAAc;IAC7C,MAAM,CAACK,cAAcC,gBAAgB,GAAGZ,SACtCO,uBAAuB;IAGzB,MAAMM,WAAWf,YAAY,CAACgB;QAC5BJ,OAAOI,MAAMC,MAAM,CAACC,KAAK;IAC3B,GAAG,EAAE;IAEL,MAAMC,aAAalB,QAAQ,IAAM,qBAAqBmB,IAAI,CAACT,MAAM;QAACA;KAAI;IAEtE,MAAMU,eAAerB,YACnB,CAACsB;QACCA,EAAEC,cAAc;QAChB,IAAIJ,YAAY;YACdT,UAAUC,KAAKE;QACjB;IACF,GACA;QAACF;QAAKQ;QAAYN;QAAcH;KAAU;IAG5C,OAAO;QACLC;QACAC;QACAC;QACAC;QACAC;QACAM;QACAF;IACF;AACF,EAAE;AAEF,OAAO,MAAMK,kBAAkB,CAAC,EAC9Bd,SAAS,EACTD,mBAAmB,EACnBD,UAAU,EACW;IACrB,MAAMiB,QAAQlB,mBAAmB;QAC/BG;QACAD;QACAD;IACF;IAEA,qBACE,KAACH;QAAQqB,WAAU;kBACjB,cAAA,MAACC;YAAID,WAAU;;8BACb,MAACE;oBAAMF,WAAU;;sCACf,KAACtB;4BAAKyB,MAAM/B;4BAAM4B,WAAU;;sCAC5B,KAACI;4BACCC,MAAK;4BACLL,WAAU;4BACVM,aAAY;4BACZd,OAAOO,MAAMd,GAAG;4BAChBI,UAAUU,MAAMV,QAAQ;;;;8BAG5B,KAACZ;oBACC8B,SAAQ;oBACRC,YAAW;oBACXH,MAAK;oBACLI,SAAS,CAACb;wBACRG,MAAMJ,YAAY,CAACC;oBACrB;oBACAc,UAAU,CAACX,MAAMN,UAAU;8BAC5B;;8BAGD,KAACQ;oBAAID,WAAU;8BACb,cAAA,MAACE;wBAAMF,WAAU;;4BAAgI;0CAE/I,KAACpB;gCACC+B,QAAQZ,MAAMZ,YAAY;gCAC1BE,UAAUU,MAAMX,eAAe;;;;;;;;AAO7C,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkPreviewPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,8BAI1B,qBAAqB,gCAwBvB,CAAC"}
1
+ {"version":3,"file":"LinkPreviewPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,8BAI1B,qBAAqB,gCAwBvB,CAAC"}
@@ -4,16 +4,15 @@ import { Icon } from "../../ui/Icon.js";
4
4
  import { Surface } from "../../ui/Surface.js";
5
5
  import { Toolbar } from "../../ui/Toolbar.js";
6
6
  import Tooltip from "../../ui/Tooltip/index.js";
7
- import { twj } from "tw-to-css";
8
7
  export const LinkPreviewPanel = ({ onClear, onEdit, url })=>{
9
8
  return /*#__PURE__*/ _jsxs(Surface, {
10
- style: twj("flex items-center gap-2 p-2"),
9
+ className: "flex items-center gap-2 p-2",
11
10
  children: [
12
11
  /*#__PURE__*/ _jsx("a", {
13
12
  href: url,
14
13
  target: "_blank",
15
14
  rel: "noopener noreferrer",
16
- style: twj("text-sm underline break-all"),
15
+ className: "text-sm underline break-all",
17
16
  children: url
18
17
  }),
19
18
  /*#__PURE__*/ _jsx(Toolbar.Divider, {}),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.tsx"],"sourcesContent":["import { Pen, Trash2 } from \"lucide-react\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport Tooltip from \"../../ui/Tooltip/index.js\";\nimport { twj } from \"tw-to-css\";\nexport type LinkPreviewPanelProps = {\n url: string;\n onEdit: () => void;\n onClear: () => void;\n};\n\nexport const LinkPreviewPanel = ({\n onClear,\n onEdit,\n url,\n}: LinkPreviewPanelProps) => {\n return (\n <Surface style={twj(\"flex items-center gap-2 p-2\")}>\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={twj(\"text-sm underline break-all\")}\n >\n {url}\n </a>\n <Toolbar.Divider />\n <Tooltip title=\"Edit link\">\n <Toolbar.Button type=\"button\" onClick={onEdit}>\n <Icon icon={Pen} />\n </Toolbar.Button>\n </Tooltip>\n <Tooltip title=\"Remove link\">\n <Toolbar.Button type=\"button\" onClick={onClear}>\n <Icon icon={Trash2} />\n </Toolbar.Button>\n </Tooltip>\n </Surface>\n );\n};\n"],"names":["Pen","Trash2","Icon","Surface","Toolbar","Tooltip","twj","LinkPreviewPanel","onClear","onEdit","url","style","a","href","target","rel","Divider","title","Button","type","onClick","icon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,EAAEC,MAAM,QAAQ,eAAe;AAC3C,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,OAAOC,aAAa,4BAA4B;AAChD,SAASC,GAAG,QAAQ,YAAY;AAOhC,OAAO,MAAMC,mBAAmB,CAAC,EAC/BC,OAAO,EACPC,MAAM,EACNC,GAAG,EACmB;IACtB,qBACE,MAACP;QAAQQ,OAAOL,IAAI;;0BAClB,KAACM;gBACCC,MAAMH;gBACNI,QAAO;gBACPC,KAAI;gBACJJ,OAAOL,IAAI;0BAEVI;;0BAEH,KAACN,QAAQY,OAAO;0BAChB,KAACX;gBAAQY,OAAM;0BACb,cAAA,KAACb,QAAQc,MAAM;oBAACC,MAAK;oBAASC,SAASX;8BACrC,cAAA,KAACP;wBAAKmB,MAAMrB;;;;0BAGhB,KAACK;gBAAQY,OAAM;0BACb,cAAA,KAACb,QAAQc,MAAM;oBAACC,MAAK;oBAASC,SAASZ;8BACrC,cAAA,KAACN;wBAAKmB,MAAMpB;;;;;;AAKtB,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.tsx"],"sourcesContent":["import { Pen, Trash2 } from \"lucide-react\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport Tooltip from \"../../ui/Tooltip/index.js\";\nexport type LinkPreviewPanelProps = {\n url: string;\n onEdit: () => void;\n onClear: () => void;\n};\n\nexport const LinkPreviewPanel = ({\n onClear,\n onEdit,\n url,\n}: LinkPreviewPanelProps) => {\n return (\n <Surface className=\"flex items-center gap-2 p-2\">\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm underline break-all\"\n >\n {url}\n </a>\n <Toolbar.Divider />\n <Tooltip title=\"Edit link\">\n <Toolbar.Button type=\"button\" onClick={onEdit}>\n <Icon icon={Pen} />\n </Toolbar.Button>\n </Tooltip>\n <Tooltip title=\"Remove link\">\n <Toolbar.Button type=\"button\" onClick={onClear}>\n <Icon icon={Trash2} />\n </Toolbar.Button>\n </Tooltip>\n </Surface>\n );\n};\n"],"names":["Pen","Trash2","Icon","Surface","Toolbar","Tooltip","LinkPreviewPanel","onClear","onEdit","url","className","a","href","target","rel","Divider","title","Button","type","onClick","icon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,EAAEC,MAAM,QAAQ,eAAe;AAC3C,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,OAAOC,aAAa,4BAA4B;AAOhD,OAAO,MAAMC,mBAAmB,CAAC,EAC/BC,OAAO,EACPC,MAAM,EACNC,GAAG,EACmB;IACtB,qBACE,MAACN;QAAQO,WAAU;;0BACjB,KAACC;gBACCC,MAAMH;gBACNI,QAAO;gBACPC,KAAI;gBACJJ,WAAU;0BAETD;;0BAEH,KAACL,QAAQW,OAAO;0BAChB,KAACV;gBAAQW,OAAM;0BACb,cAAA,KAACZ,QAAQa,MAAM;oBAACC,MAAK;oBAASC,SAASX;8BACrC,cAAA,KAACN;wBAAKkB,MAAMpB;;;;0BAGhB,KAACK;gBAAQW,OAAM;0BACb,cAAA,KAACZ,QAAQa,MAAM;oBAACC,MAAK;oBAASC,SAASZ;8BACrC,cAAA,KAACL;wBAAKkB,MAAMnB;;;;;;AAKtB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"SocialMediaEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAKrD,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,+BAG5B,2BAA2B;;;sBAGS,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;sBAOlE,KAAK,CAAC,SAAS;CAetB,CAAC;AAEF,eAAO,MAAM,sBAAsB,kGAOhC,2BAA2B,sBA4C7B,CAAC"}
1
+ {"version":3,"file":"SocialMediaEditorPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAIrD,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,+BAG5B,2BAA2B;;;sBAGS,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;sBAOlE,KAAK,CAAC,SAAS;CAetB,CAAC;AAEF,eAAO,MAAM,sBAAsB,kGAOhC,2BAA2B,sBAsC7B,CAAC"}
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useState } from "react";
3
3
  import { Button } from "../../ui/Button/Button.js";
4
4
  import { Surface } from "../../ui/Surface.js";
5
- import { twj } from "tw-to-css";
6
5
  export const useLinkEditorState = ({ initialSrc, onSetLink })=>{
7
6
  const [url, setUrl] = useState(initialSrc || "");
8
7
  const onChange = useCallback((event)=>{
@@ -35,14 +34,14 @@ export const SocialMediaEditorPanel = ({ onSetLink, initialOpenInNewTab, initial
35
34
  descriptionText
36
35
  });
37
36
  return /*#__PURE__*/ _jsx(Surface, {
38
- style: twj("p-2"),
37
+ className: "p-2",
39
38
  children: /*#__PURE__*/ _jsxs("div", {
40
- style: twj("flex flex-col items-center gap-2 p-1"),
39
+ className: "flex flex-col items-center gap-2 p-1",
41
40
  children: [
42
41
  /*#__PURE__*/ _jsx("label", {
43
- style: twj("flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text w-full"),
42
+ className: "flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text w-full",
44
43
  children: /*#__PURE__*/ _jsx("input", {
45
- style: twj("flex-1 bg-transparent outline-none min-w-[276px] text-black text-sm dark:text-white"),
44
+ className: "flex-1 bg-transparent outline-none min-w-[276px] text-black text-sm dark:text-white",
46
45
  placeholder: placeholderText,
47
46
  value: state.url,
48
47
  onChange: state.onChange
@@ -51,7 +50,7 @@ export const SocialMediaEditorPanel = ({ onSetLink, initialOpenInNewTab, initial
51
50
  /*#__PURE__*/ _jsx(Button, {
52
51
  variant: "primary",
53
52
  buttonSize: "medium",
54
- style: twj("w-full m-2"),
53
+ className: "w-full m-2",
55
54
  type: "button",
56
55
  onClick: (e)=>{
57
56
  state.handleSubmit(e);
@@ -59,7 +58,7 @@ export const SocialMediaEditorPanel = ({ onSetLink, initialOpenInNewTab, initial
59
58
  children: buttonText
60
59
  }),
61
60
  /*#__PURE__*/ _jsx("span", {
62
- style: twj("mt-1 mb-0 text-sm"),
61
+ className: "mt-1 mb-0 text-sm",
63
62
  children: descriptionText
64
63
  })
65
64
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { Button } from \"../../ui/Button/Button.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type SocialMediaEditorPanelProps = {\n initialSrc?: string;\n initialOpenInNewTab?: boolean;\n onSetLink: (src: string) => void;\n placeholderText: string;\n buttonText: string;\n descriptionText: string;\n};\n\nexport const useLinkEditorState = ({\n initialSrc,\n onSetLink,\n}: SocialMediaEditorPanelProps) => {\n const [url, setUrl] = useState(initialSrc || \"\");\n\n const onChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUrl(event.target.value);\n }, []);\n\n // const isValidUrl = useMemo(() => /^(\\S+):(\\/\\/)?\\S+$/.test(url), [url]);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n // if (isValidUrl) {\n onSetLink(url);\n // }\n },\n [url, onSetLink]\n );\n\n return {\n url,\n setUrl,\n onChange,\n handleSubmit,\n };\n};\n\nexport const SocialMediaEditorPanel = ({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n placeholderText,\n buttonText,\n descriptionText,\n}: SocialMediaEditorPanelProps) => {\n const state = useLinkEditorState({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n placeholderText,\n buttonText,\n descriptionText,\n });\n\n return (\n <Surface style={twj(\"p-2\")}>\n <div style={twj(\"flex flex-col items-center gap-2 p-1\")}>\n <label\n style={twj(\n \"flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text w-full\"\n )}\n >\n {/* <Icon icon={Link} style={twj(\"flex-none text-black dark:text-white\")} /> */}\n <input\n style={twj(\n \"flex-1 bg-transparent outline-none min-w-[276px] text-black text-sm dark:text-white\"\n )}\n placeholder={placeholderText}\n value={state.url}\n onChange={state.onChange}\n />\n </label>\n <Button\n variant=\"primary\"\n buttonSize=\"medium\"\n style={twj(\"w-full m-2\")}\n type=\"button\"\n onClick={(e) => {\n state.handleSubmit(e);\n }}\n // disabled={!state.isValidUrl}\n >\n {buttonText}\n </Button>\n <span style={twj(\"mt-1 mb-0 text-sm\")}>{descriptionText}</span>\n </div>\n </Surface>\n );\n};\n"],"names":["React","useCallback","useState","Button","Surface","twj","useLinkEditorState","initialSrc","onSetLink","url","setUrl","onChange","event","target","value","handleSubmit","e","preventDefault","SocialMediaEditorPanel","initialOpenInNewTab","placeholderText","buttonText","descriptionText","state","style","div","label","input","placeholder","variant","buttonSize","type","onClick","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AACrD,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,GAAG,QAAQ,YAAY;AAWhC,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,UAAU,EACVC,SAAS,EACmB;IAC5B,MAAM,CAACC,KAAKC,OAAO,GAAGR,SAASK,cAAc;IAE7C,MAAMI,WAAWV,YAAY,CAACW;QAC5BF,OAAOE,MAAMC,MAAM,CAACC,KAAK;IAC3B,GAAG,EAAE;IAEL,2EAA2E;IAE3E,MAAMC,eAAed,YACnB,CAACe;QACCA,EAAEC,cAAc;QAChB,oBAAoB;QACpBT,UAAUC;IACV,IAAI;IACN,GACA;QAACA;QAAKD;KAAU;IAGlB,OAAO;QACLC;QACAC;QACAC;QACAI;IACF;AACF,EAAE;AAEF,OAAO,MAAMG,yBAAyB,CAAC,EACrCV,SAAS,EACTW,mBAAmB,EACnBZ,UAAU,EACVa,eAAe,EACfC,UAAU,EACVC,eAAe,EACa;IAC5B,MAAMC,QAAQjB,mBAAmB;QAC/BE;QACAW;QACAZ;QACAa;QACAC;QACAC;IACF;IAEA,qBACE,KAAClB;QAAQoB,OAAOnB,IAAI;kBAClB,cAAA,MAACoB;YAAID,OAAOnB,IAAI;;8BACd,KAACqB;oBACCF,OAAOnB,IACL;8BAIF,cAAA,KAACsB;wBACCH,OAAOnB,IACL;wBAEFuB,aAAaR;wBACbN,OAAOS,MAAMd,GAAG;wBAChBE,UAAUY,MAAMZ,QAAQ;;;8BAG5B,KAACR;oBACC0B,SAAQ;oBACRC,YAAW;oBACXN,OAAOnB,IAAI;oBACX0B,MAAK;oBACLC,SAAS,CAAChB;wBACRO,MAAMR,YAAY,CAACC;oBACrB;8BAGCK;;8BAEH,KAACY;oBAAKT,OAAOnB,IAAI;8BAAuBiB;;;;;AAIhD,EAAE"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { Button } from \"../../ui/Button/Button.js\";\nimport { Surface } from \"../../ui/Surface.js\";\n\nexport type SocialMediaEditorPanelProps = {\n initialSrc?: string;\n initialOpenInNewTab?: boolean;\n onSetLink: (src: string) => void;\n placeholderText: string;\n buttonText: string;\n descriptionText: string;\n};\n\nexport const useLinkEditorState = ({\n initialSrc,\n onSetLink,\n}: SocialMediaEditorPanelProps) => {\n const [url, setUrl] = useState(initialSrc || \"\");\n\n const onChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUrl(event.target.value);\n }, []);\n\n // const isValidUrl = useMemo(() => /^(\\S+):(\\/\\/)?\\S+$/.test(url), [url]);\n\n const handleSubmit = useCallback(\n (e: React.FormEvent) => {\n e.preventDefault();\n // if (isValidUrl) {\n onSetLink(url);\n // }\n },\n [url, onSetLink]\n );\n\n return {\n url,\n setUrl,\n onChange,\n handleSubmit,\n };\n};\n\nexport const SocialMediaEditorPanel = ({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n placeholderText,\n buttonText,\n descriptionText,\n}: SocialMediaEditorPanelProps) => {\n const state = useLinkEditorState({\n onSetLink,\n initialOpenInNewTab,\n initialSrc,\n placeholderText,\n buttonText,\n descriptionText,\n });\n\n return (\n <Surface className=\"p-2\">\n <div className=\"flex flex-col items-center gap-2 p-1\">\n <label className=\"flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text w-full\">\n {/* <Icon icon={Link} className=\"flex-none text-black dark:text-white\" /> */}\n <input\n className=\"flex-1 bg-transparent outline-none min-w-[276px] text-black text-sm dark:text-white\"\n placeholder={placeholderText}\n value={state.url}\n onChange={state.onChange}\n />\n </label>\n <Button\n variant=\"primary\"\n buttonSize=\"medium\"\n className=\"w-full m-2\"\n type=\"button\"\n onClick={(e) => {\n state.handleSubmit(e);\n }}\n // disabled={!state.isValidUrl}\n >\n {buttonText}\n </Button>\n <span className=\"mt-1 mb-0 text-sm\">{descriptionText}</span>\n </div>\n </Surface>\n );\n};\n"],"names":["React","useCallback","useState","Button","Surface","useLinkEditorState","initialSrc","onSetLink","url","setUrl","onChange","event","target","value","handleSubmit","e","preventDefault","SocialMediaEditorPanel","initialOpenInNewTab","placeholderText","buttonText","descriptionText","state","className","div","label","input","placeholder","variant","buttonSize","type","onClick","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AACrD,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,OAAO,QAAQ,sBAAsB;AAW9C,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,UAAU,EACVC,SAAS,EACmB;IAC5B,MAAM,CAACC,KAAKC,OAAO,GAAGP,SAASI,cAAc;IAE7C,MAAMI,WAAWT,YAAY,CAACU;QAC5BF,OAAOE,MAAMC,MAAM,CAACC,KAAK;IAC3B,GAAG,EAAE;IAEL,2EAA2E;IAE3E,MAAMC,eAAeb,YACnB,CAACc;QACCA,EAAEC,cAAc;QAChB,oBAAoB;QACpBT,UAAUC;IACV,IAAI;IACN,GACA;QAACA;QAAKD;KAAU;IAGlB,OAAO;QACLC;QACAC;QACAC;QACAI;IACF;AACF,EAAE;AAEF,OAAO,MAAMG,yBAAyB,CAAC,EACrCV,SAAS,EACTW,mBAAmB,EACnBZ,UAAU,EACVa,eAAe,EACfC,UAAU,EACVC,eAAe,EACa;IAC5B,MAAMC,QAAQjB,mBAAmB;QAC/BE;QACAW;QACAZ;QACAa;QACAC;QACAC;IACF;IAEA,qBACE,KAACjB;QAAQmB,WAAU;kBACjB,cAAA,MAACC;YAAID,WAAU;;8BACb,KAACE;oBAAMF,WAAU;8BAEf,cAAA,KAACG;wBACCH,WAAU;wBACVI,aAAaR;wBACbN,OAAOS,MAAMd,GAAG;wBAChBE,UAAUY,MAAMZ,QAAQ;;;8BAG5B,KAACP;oBACCyB,SAAQ;oBACRC,YAAW;oBACXN,WAAU;oBACVO,MAAK;oBACLC,SAAS,CAAChB;wBACRO,MAAMR,YAAY,CAACC;oBACrB;8BAGCK;;8BAEH,KAACY;oBAAKT,WAAU;8BAAqBF;;;;;AAI7C,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,UAAU,GACV,YAAY,GACZ,OAAO,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAElD,eAAO,MAAM,MAAM;cANP,aAAa;aACd,OAAO;sBACE,MAAM;iBACX,UAAU;2FAgFxB,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,UAAU,GACV,YAAY,GACZ,OAAO,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAElD,eAAO,MAAM,MAAM;cANP,aAAa;aACd,OAAO;sBACE,MAAM;iBACX,UAAU;2FAgFxB,CAAC"}
@@ -1,14 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { cn } from "../../../lib/utils/index.js";
4
- import { twj } from "tw-to-css";
5
4
  export const Button = /*#__PURE__*/ React.forwardRef(({ active, buttonSize = "medium", children, disabled, variant = "primary", className, activeClassname, ...rest }, ref)=>{
6
5
  const buttonClassName = cn("flex group items-center justify-center border border-transparent gap-2 text-base font-semibold rounded-md disabled:opacity-50 whitespace-nowrap", variant === "primary" && cn("text-white bg-black border-black dark:text-black dark:bg-white dark:border-white", !disabled && !active && "hover:bg-neutral-800 active:bg-neutral-900 dark:hover:bg-neutral-200 dark:active:bg-neutral-300", active && cn("bg-neutral-900 dark:bg-neutral-300", activeClassname)), variant === "secondary" && cn("text-neutral-900 dark:text-white", !disabled && !active && "hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-900 dark:active:bg-neutral-800", active && "bg-neutral-200 dark:bg-neutral-800"), variant === "tertiary" && cn("bg-neutral-50 text-neutral-900 dark:bg-neutral-900 dark:text-white dark:border-neutral-900", !disabled && !active && "hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700", active && cn("bg-neutral-200 dark:bg-neutral-800", activeClassname)), variant === "ghost" && cn("bg-transparent border-transparent text-neutral-500 dark:text-neutral-400", !disabled && !active && "hover:bg-black/5 hover:text-neutral-700 active:bg-black/10 active:text-neutral-800 dark:hover:bg-white/10 dark:hover:text-neutral-300 dark:active:text-neutral-200", active && cn("bg-black/10 text-neutral-800 dark:bg-white/20 dark:text-neutral-200", activeClassname)), buttonSize === "medium" && "py-2 px-3", buttonSize === "small" && "py-1 px-2", buttonSize === "icon" && "w-8 h-8", buttonSize === "iconSmall" && "w-6 h-6", className);
7
6
  return /*#__PURE__*/ _jsx("button", {
8
7
  type: "button",
9
8
  ref: ref,
10
9
  disabled: disabled,
11
- style: twj(buttonClassName),
10
+ className: buttonClassName,
12
11
  ...rest,
13
12
  children: children
14
13
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Button/Button.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type ButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"quaternary\"\n | \"ghost\";\nexport type ButtonSize = \"medium\" | \"small\" | \"icon\" | \"iconSmall\";\n\nexport type ButtonProps = {\n variant?: ButtonVariant;\n active?: boolean;\n activeClassname?: string;\n buttonSize?: ButtonSize;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n active,\n buttonSize = \"medium\",\n children,\n disabled,\n variant = \"primary\",\n className,\n activeClassname,\n ...rest\n },\n ref\n ) => {\n const buttonClassName = cn(\n \"flex group items-center justify-center border border-transparent gap-2 text-base font-semibold rounded-md disabled:opacity-50 whitespace-nowrap\",\n\n variant === \"primary\" &&\n cn(\n \"text-white bg-black border-black dark:text-black dark:bg-white dark:border-white\",\n !disabled &&\n !active &&\n \"hover:bg-neutral-800 active:bg-neutral-900 dark:hover:bg-neutral-200 dark:active:bg-neutral-300\",\n active && cn(\"bg-neutral-900 dark:bg-neutral-300\", activeClassname)\n ),\n\n variant === \"secondary\" &&\n cn(\n \"text-neutral-900 dark:text-white\",\n !disabled &&\n !active &&\n \"hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-900 dark:active:bg-neutral-800\",\n active && \"bg-neutral-200 dark:bg-neutral-800\"\n ),\n\n variant === \"tertiary\" &&\n cn(\n \"bg-neutral-50 text-neutral-900 dark:bg-neutral-900 dark:text-white dark:border-neutral-900\",\n !disabled &&\n !active &&\n \"hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700\",\n active && cn(\"bg-neutral-200 dark:bg-neutral-800\", activeClassname)\n ),\n\n variant === \"ghost\" &&\n cn(\n \"bg-transparent border-transparent text-neutral-500 dark:text-neutral-400\",\n !disabled &&\n !active &&\n \"hover:bg-black/5 hover:text-neutral-700 active:bg-black/10 active:text-neutral-800 dark:hover:bg-white/10 dark:hover:text-neutral-300 dark:active:text-neutral-200\",\n active &&\n cn(\n \"bg-black/10 text-neutral-800 dark:bg-white/20 dark:text-neutral-200\",\n activeClassname\n )\n ),\n\n buttonSize === \"medium\" && \"py-2 px-3\",\n buttonSize === \"small\" && \"py-1 px-2\",\n buttonSize === \"icon\" && \"w-8 h-8\",\n buttonSize === \"iconSmall\" && \"w-6 h-6\",\n\n className\n );\n\n return (\n <button\n type=\"button\"\n ref={ref}\n disabled={disabled}\n style={twj(buttonClassName)}\n {...rest}\n >\n {children}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"names":["React","cn","twj","Button","forwardRef","active","buttonSize","children","disabled","variant","className","activeClassname","rest","ref","buttonClassName","button","type","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,EAAE,QAAQ,8BAA8B;AACjD,SAASC,GAAG,QAAQ,YAAY;AAiBhC,OAAO,MAAMC,uBAASH,MAAMI,UAAU,CACpC,CACE,EACEC,MAAM,EACNC,aAAa,QAAQ,EACrBC,QAAQ,EACRC,QAAQ,EACRC,UAAU,SAAS,EACnBC,SAAS,EACTC,eAAe,EACf,GAAGC,MACJ,EACDC;IAEA,MAAMC,kBAAkBb,GACtB,mJAEAQ,YAAY,aACVR,GACE,oFACA,CAACO,YACC,CAACH,UACD,mGACFA,UAAUJ,GAAG,sCAAsCU,mBAGvDF,YAAY,eACVR,GACE,oCACA,CAACO,YACC,CAACH,UACD,mGACFA,UAAU,uCAGdI,YAAY,cACVR,GACE,8FACA,CAACO,YACC,CAACH,UACD,mGACFA,UAAUJ,GAAG,sCAAsCU,mBAGvDF,YAAY,WACVR,GACE,4EACA,CAACO,YACC,CAACH,UACD,sKACFA,UACEJ,GACE,uEACAU,mBAIRL,eAAe,YAAY,aAC3BA,eAAe,WAAW,aAC1BA,eAAe,UAAU,WACzBA,eAAe,eAAe,WAE9BI;IAGF,qBACE,KAACK;QACCC,MAAK;QACLH,KAAKA;QACLL,UAAUA;QACVS,OAAOf,IAAIY;QACV,GAAGF,IAAI;kBAEPL;;AAGP,GACA;AAEFJ,OAAOe,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Button/Button.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\n\nexport type ButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"quaternary\"\n | \"ghost\";\nexport type ButtonSize = \"medium\" | \"small\" | \"icon\" | \"iconSmall\";\n\nexport type ButtonProps = {\n variant?: ButtonVariant;\n active?: boolean;\n activeClassname?: string;\n buttonSize?: ButtonSize;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n active,\n buttonSize = \"medium\",\n children,\n disabled,\n variant = \"primary\",\n className,\n activeClassname,\n ...rest\n },\n ref\n ) => {\n const buttonClassName = cn(\n \"flex group items-center justify-center border border-transparent gap-2 text-base font-semibold rounded-md disabled:opacity-50 whitespace-nowrap\",\n\n variant === \"primary\" &&\n cn(\n \"text-white bg-black border-black dark:text-black dark:bg-white dark:border-white\",\n !disabled &&\n !active &&\n \"hover:bg-neutral-800 active:bg-neutral-900 dark:hover:bg-neutral-200 dark:active:bg-neutral-300\",\n active && cn(\"bg-neutral-900 dark:bg-neutral-300\", activeClassname)\n ),\n\n variant === \"secondary\" &&\n cn(\n \"text-neutral-900 dark:text-white\",\n !disabled &&\n !active &&\n \"hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-900 dark:active:bg-neutral-800\",\n active && \"bg-neutral-200 dark:bg-neutral-800\"\n ),\n\n variant === \"tertiary\" &&\n cn(\n \"bg-neutral-50 text-neutral-900 dark:bg-neutral-900 dark:text-white dark:border-neutral-900\",\n !disabled &&\n !active &&\n \"hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700\",\n active && cn(\"bg-neutral-200 dark:bg-neutral-800\", activeClassname)\n ),\n\n variant === \"ghost\" &&\n cn(\n \"bg-transparent border-transparent text-neutral-500 dark:text-neutral-400\",\n !disabled &&\n !active &&\n \"hover:bg-black/5 hover:text-neutral-700 active:bg-black/10 active:text-neutral-800 dark:hover:bg-white/10 dark:hover:text-neutral-300 dark:active:text-neutral-200\",\n active &&\n cn(\n \"bg-black/10 text-neutral-800 dark:bg-white/20 dark:text-neutral-200\",\n activeClassname\n )\n ),\n\n buttonSize === \"medium\" && \"py-2 px-3\",\n buttonSize === \"small\" && \"py-1 px-2\",\n buttonSize === \"icon\" && \"w-8 h-8\",\n buttonSize === \"iconSmall\" && \"w-6 h-6\",\n\n className\n );\n\n return (\n <button\n type=\"button\"\n ref={ref}\n disabled={disabled}\n className={buttonClassName}\n {...rest}\n >\n {children}\n </button>\n );\n }\n);\n\nButton.displayName = \"Button\";\n"],"names":["React","cn","Button","forwardRef","active","buttonSize","children","disabled","variant","className","activeClassname","rest","ref","buttonClassName","button","type","displayName"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,EAAE,QAAQ,8BAA8B;AAiBjD,OAAO,MAAMC,uBAASF,MAAMG,UAAU,CACpC,CACE,EACEC,MAAM,EACNC,aAAa,QAAQ,EACrBC,QAAQ,EACRC,QAAQ,EACRC,UAAU,SAAS,EACnBC,SAAS,EACTC,eAAe,EACf,GAAGC,MACJ,EACDC;IAEA,MAAMC,kBAAkBZ,GACtB,mJAEAO,YAAY,aACVP,GACE,oFACA,CAACM,YACC,CAACH,UACD,mGACFA,UAAUH,GAAG,sCAAsCS,mBAGvDF,YAAY,eACVP,GACE,oCACA,CAACM,YACC,CAACH,UACD,mGACFA,UAAU,uCAGdI,YAAY,cACVP,GACE,8FACA,CAACM,YACC,CAACH,UACD,mGACFA,UAAUH,GAAG,sCAAsCS,mBAGvDF,YAAY,WACVP,GACE,4EACA,CAACM,YACC,CAACH,UACD,sKACFA,UACEH,GACE,uEACAS,mBAIRL,eAAe,YAAY,aAC3BA,eAAe,WAAW,aAC1BA,eAAe,UAAU,WACzBA,eAAe,eAAe,WAE9BI;IAGF,qBACE,KAACK;QACCC,MAAK;QACLH,KAAKA;QACLL,UAAUA;QACVE,WAAWI;QACV,GAAGF,IAAI;kBAEPL;;AAGP,GACA;AAEFJ,OAAOc,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,qBAAqB,kBAE/B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAUA,CAAC;AAEF,eAAO,MAAM,cAAc,0DAMxB;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAsBA,CAAC"}
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,qBAAqB,kBAE/B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAMA,CAAC;AAEF,eAAO,MAAM,cAAc,0DAMxB;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAsBA,CAAC"}
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { cn } from "../../../lib/utils/index.js";
4
- import { twj } from "tw-to-css";
5
4
  export const DropdownCategoryTitle = ({ children })=>{
6
5
  return /*#__PURE__*/ _jsx("div", {
7
- style: twj("text-[.65rem] font-semibold mb-1 uppercase text-neutral-500 dark:text-neutral-400 px-1.5"),
6
+ className: "text-[.65rem] font-semibold mb-1 uppercase text-neutral-500 dark:text-neutral-400 px-1.5",
8
7
  children: children
9
8
  });
10
9
  };
@@ -12,7 +11,7 @@ export const DropdownButton = ({ children, isActive, onClick, disabled, classNam
12
11
  const buttonClass = cn("flex items-center gap-2 p-1.5 text-sm font-medium text-neutral-500 dark:text-neutral-400 text-left bg-transparent w-full rounded outline-none", !isActive && !disabled, "hover:bg-neutral-100 hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200", isActive && !disabled && "bg-neutral-100 text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200", disabled && "text-neutral-400 cursor-not-allowed dark:text-neutral-600", className);
13
12
  return /*#__PURE__*/ _jsx("button", {
14
13
  type: "button",
15
- style: twj(buttonClass),
14
+ className: buttonClass,
16
15
  disabled: disabled,
17
16
  onClick: onClick,
18
17
  children: children