payload-richtext-tiptap 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.d.ts +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js +3 -4
- package/dist/src/fields/TiptapEditor/extensions/BlockquoteFigure/Design.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js +2 -3
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockView.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.d.ts +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js +5 -6
- package/dist/src/fields/TiptapEditor/extensions/ImageBlock/components/ImageBlockWidth.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js +1 -2
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUpload.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js +6 -7
- package/dist/src/fields/TiptapEditor/extensions/ImageUpload/view/ImageUploader.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js +1 -2
- package/dist/src/fields/TiptapEditor/extensions/InsideLinks/InsideLink.client.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js +3 -4
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/CommandButton.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js +3 -4
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/MenuList.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js +1 -2
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/Instagram/InstagramEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js +2 -3
- package/dist/src/fields/TiptapEditor/extensions/SocialMedia/SocialMediaEmbed.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js +1 -2
- package/dist/src/fields/TiptapEditor/extensions/TableOfContentsNode/TableOfContentsNode.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js +62 -55
- package/dist/src/fields/TiptapEditor/features/BlockEditor/BlockEditor.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js +3 -4
- package/dist/src/fields/TiptapEditor/features/BlockEditor/components/EditorHeader.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js +3 -4
- package/dist/src/fields/TiptapEditor/features/Sidebar/Sidebar.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js +2 -3
- package/dist/src/fields/TiptapEditor/features/menus/ContentItemMenu/ContentItemMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js +4 -5
- package/dist/src/fields/TiptapEditor/features/menus/LinkMenu/LinkMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js +3 -4
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js +2 -3
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ContentTypePicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js +2 -3
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontFamilyPicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js +1 -2
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/FontSizePicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js +6 -7
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-completion-command.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js +7 -8
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/components/ai-selector-commands.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js +10 -11
- package/dist/src/fields/TiptapEditor/features/panels/AIEditorPanel/AIEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js +3 -4
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/ColorButton.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js +4 -5
- package/dist/src/fields/TiptapEditor/features/panels/Colorpicker/Colorpicker.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js +4 -5
- package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js +3 -4
- package/dist/src/fields/TiptapEditor/features/panels/InsideLinksEditorPanel/InsideLinksEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js +6 -7
- package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js +2 -3
- package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js +6 -7
- package/dist/src/fields/TiptapEditor/features/panels/SocialMediaEditorPanel/SocialMediaEditorPanel.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Button/Button.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js +1 -2
- package/dist/src/fields/TiptapEditor/features/ui/Button/Button.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js +2 -3
- package/dist/src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Icon.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Icon.js +1 -2
- package/dist/src/fields/TiptapEditor/features/ui/Icon.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js +4 -5
- package/dist/src/fields/TiptapEditor/features/ui/Loader/Loader.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Panel/index.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js +6 -7
- package/dist/src/fields/TiptapEditor/features/ui/Panel/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js +7 -9
- package/dist/src/fields/TiptapEditor/features/ui/PopoverMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js +1 -2
- package/dist/src/fields/TiptapEditor/features/ui/Spinner/Spinner.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Surface.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Surface.js +1 -2
- package/dist/src/fields/TiptapEditor/features/ui/Surface.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js +1 -2
- package/dist/src/fields/TiptapEditor/features/ui/Textarea/Textarea.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js +2 -5
- package/dist/src/fields/TiptapEditor/features/ui/Toggle/Toggle.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toolbar.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js +3 -5
- package/dist/src/fields/TiptapEditor/features/ui/Toolbar.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js +7 -8
- package/dist/src/fields/TiptapEditor/features/ui/Tooltip/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js +4 -5
- package/dist/src/fields/TiptapEditor/features/ui/crazy-spinner.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/scroll-area.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js +4 -5
- package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- 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\";\
|
|
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":"AAAA;;AAEA,SAASA,SAAS,QAAQ,kCAAkC;AAE5D,SAASC,aAAa,QAAQ,WAAW;AACzC,SAASC,UAAU,EAAEC,QAAQ,QAAQ,eAAe;AACpD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAC9C,OAAOC,cAAc,iBAAiB;AACtC,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,KAAK,QAAQ,8BAA8B;AACpD,OAAOC,0BAA0B,2DAA2D;AAC5F,OAAOC,wBAAwB,0DAA0D;AACzF,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,OAAOC,kBAAkB,4BAA4B;AACrD,SAASC,UAAU,QAAQ,0BAA0B;AAMrD,OAAO,MAAMC,gBAAgB,CAAC,EAAEC,MAAM,EAAEC,YAAY,EAAsB;IACxE,MAAM,CAACC,YAAYC,cAAc,GAAGd,SAAS;IAC7C,MAAM,EAAEe,IAAI,EAAE,GAAGpB;IAEjB,uFAAuF;IACvF,oBAAoB;IACpB,2BAA2B;IAC3B,gCAAgC;IAChC,qCAAqC;IACrC,yEAAyE;IACzE,gBAAgB;IAChB,QAAQ;IACR,OAAO;IACP,sBAAsB;IACtB,8BAA8B;IAC9B,OAAO;IACP,MAAM;IAEN,MAAM,EAAEqB,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGtB,cAAc;QACxD,eAAe;QACfuB,KAAK;QACLC,YAAY,CAACC;YACX,IAAIA,SAASC,MAAM,KAAK,KAAK;gBAC3BC,QAAQC,GAAG,CAAC;gBAEZ;YACF;QACF;QACAC,SAAS,CAACC;YACRH,QAAQC,GAAG,CAAC,SAASE,EAAEC,OAAO;QAChC;IACF;IAEA,MAAMC,gBAAgBZ,WAAWa,MAAM,GAAG;IAC1C,MAAMC,cAAc/B,YAAY;QAC9B,IAAIiB,YACF,OAAOC,SAASD,YAAY;YAC1Be,MAAM;gBAAEC,QAAQ;gBAAOC,SAASpB;gBAAYqB,UAAUnB,QAAQ;YAAK;QACrE,GAAGoB,IAAI,CAAC,IAAMrB,cAAc;QAC9B,MAAMsB,OAAOlC,YAAYS,QAAQ;YAAE0B,OAAO;QAAK;QAE/CpB,SAASmB,MAAM;YACbL,MAAM;gBAAEC,QAAQ;gBAAOC,SAASpB;gBAAYqB,UAAUnB,QAAQ;YAAK;QACrE,GAAGoB,IAAI,CAAC,IAAMrB,cAAc;IAC9B,GAAG;QAACC;KAAK;IACT,qBACE,KAACT;QAAQgC,WAAU;kBACjB,cAAA;;gBACGV,+BACC,KAACW;oBAAID,WAAU;8BACb,cAAA,KAAC7B;kCACC,cAAA,KAAC8B;4BACCD,WAAU;4BACVE,KAAKrC,MAAMa,cAAc,QAAQ;sCAEjC,cAAA,KAACf;0CAAUe;;;;;gBAMlBE,2BACC,MAACqB;oBAAID,WAAU;;sCACb,KAACxC;4BAASwC,WAAU;;wBAA4B;sCAEhD,KAACC;4BAAID,WAAU;sCACb,cAAA,KAAC9B;;;;gBAKN,CAACU,2BACA;;sCACE,MAACqB;4BAAID,WAAU;;8CAab,KAACxC;oCAASwC,WAAU;;8CACpB,KAACG;oCACCH,WAAU;oCACVI,OAAO7B;oCACP8B,UAAU,CAACjB;wCACTZ,cAAcY,EAAEkB,MAAM,CAACF,KAAK;oCAC9B;oCACAG,aACEjB,gBACI,4BACA;oCAENkB,SAAS;oCACT,yCAAyC;oCAEzCC,WAAW,CAACrB;wCACV,IAAIA,EAAEsB,GAAG,KAAK,SAASlB;oCACzB;;8CAEF,KAACvB,QAAQ0C,MAAM;oCACb,cAAc;oCAEd,4GAA4G;oCAC5GC,SAASpB;8CAET,cAAA,KAACjC;;;;wBAGJ+B,8BACC,KAACxB;4BACCO,QAAQA;4BACRwC,WAAW;gCACTxC,OAAOyC,KAAK,GAAGC,cAAc,GAAGC,KAAK,GAAGC,GAAG;gCAC3C3C,aAAa;4BACf;4BACAI,YAAYA;2CAGd,KAACX;4BACCM,QAAQA;4BACR6C,UAAU,CAACd,OAAOe;gCAChBxC,SAASyB,OAAO;oCAAEX,MAAM0B;gCAAQ;4BAClC;;;;;;;AAQhB,EAAE"}
|
|
@@ -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;
|
|
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
|
-
|
|
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\";\
|
|
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;
|
|
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
|
-
|
|
30
|
+
className: "flex flex-col gap-2",
|
|
32
31
|
children: [
|
|
33
32
|
/*#__PURE__*/ _jsx(HexColorPicker, {
|
|
34
|
-
|
|
33
|
+
className: "w-full",
|
|
35
34
|
color: color || "",
|
|
36
35
|
onChange: onChange
|
|
37
36
|
}),
|
|
38
37
|
/*#__PURE__*/ _jsx("input", {
|
|
39
38
|
type: "text",
|
|
40
|
-
|
|
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
|
-
|
|
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\";\
|
|
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;
|
|
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"}
|
package/dist/src/fields/TiptapEditor/features/panels/IframeLinkEditorPanel/IframeLinkEditorPanel.js
CHANGED
|
@@ -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
|
-
|
|
36
|
+
className: "p-2",
|
|
38
37
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
39
|
-
|
|
38
|
+
className: "flex items-center gap-2",
|
|
40
39
|
children: [
|
|
41
40
|
/*#__PURE__*/ _jsxs("label", {
|
|
42
|
-
|
|
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
|
-
|
|
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\";\
|
|
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":"
|
|
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
|
-
|
|
6
|
+
className: "p-2",
|
|
8
7
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
9
|
-
|
|
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
|
-
|
|
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 {
|
|
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"}
|
package/dist/src/fields/TiptapEditor/features/panels/LinkEditorPanel/LinkEditorPanel.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
-
|
|
45
|
+
className: "p-2",
|
|
47
46
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
48
|
-
|
|
47
|
+
className: "flex items-center gap-2",
|
|
49
48
|
children: [
|
|
50
49
|
/*#__PURE__*/ _jsxs("label", {
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
|
|
76
|
+
className: "mt-3",
|
|
78
77
|
children: /*#__PURE__*/ _jsxs("label", {
|
|
79
|
-
|
|
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\";\
|
|
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"}
|
package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkPreviewPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.tsx"],"names":[],"mappings":"
|
|
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
|
-
|
|
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
|
-
|
|
15
|
+
className: "text-sm underline break-all",
|
|
17
16
|
children: url
|
|
18
17
|
}),
|
|
19
18
|
/*#__PURE__*/ _jsx(Toolbar.Divider, {}),
|
package/dist/src/fields/TiptapEditor/features/panels/LinkPreviewPanel/LinkPreviewPanel.js.map
CHANGED
|
@@ -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\";\
|
|
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;
|
|
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
|
-
|
|
37
|
+
className: "p-2",
|
|
39
38
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
40
|
-
|
|
39
|
+
className: "flex flex-col items-center gap-2 p-1",
|
|
41
40
|
children: [
|
|
42
41
|
/*#__PURE__*/ _jsx("label", {
|
|
43
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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\";\
|
|
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;
|
|
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
|
-
|
|
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\";\
|
|
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;
|
|
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
|
-
|
|
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
|
-
|
|
14
|
+
className: buttonClass,
|
|
16
15
|
disabled: disabled,
|
|
17
16
|
onClick: onClick,
|
|
18
17
|
children: children
|