payload-richtext-tiptap 0.0.28 → 0.0.30
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 +4 -3
- 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 +3 -2
- 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 +6 -5
- 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 +2 -1
- 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 +7 -6
- 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 +2 -1
- 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 +4 -3
- 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 +4 -3
- 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 +2 -1
- 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 +3 -2
- 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 +2 -1
- 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 +4 -3
- 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 +4 -3
- 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 +4 -3
- 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 +3 -2
- 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 +5 -4
- 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 +4 -3
- 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 +3 -2
- 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 +3 -2
- 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 +2 -1
- 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 +7 -6
- 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 +8 -7
- 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 +11 -10
- 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 +4 -3
- 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 +5 -4
- 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 +5 -4
- 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 +4 -3
- 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 +7 -6
- 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 +3 -2
- 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 +7 -6
- 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 +2 -1
- 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 +3 -2
- 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 +2 -1
- 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 +5 -4
- 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 +7 -6
- 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 +9 -7
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +5 -2
- 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 +5 -3
- 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 +8 -7
- 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 +5 -4
- 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 +5 -4
- package/dist/src/fields/TiptapEditor/features/ui/scroll-area.js.map +1 -1
- package/dist/src/styles.css +2126 -2648
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -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\";\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
|
|
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 +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":"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,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { twj } from "tw-to-css";
|
|
2
3
|
import { ContentRelationship } from "../../../extensions/InsideLinks/InsideLink.client.js";
|
|
3
4
|
import { Surface } from "../../ui/Surface.js";
|
|
4
5
|
export const InsideLinksEditorPanel = ({ onRelationshipSelect, onCancel })=>{
|
|
5
6
|
return /*#__PURE__*/ _jsx(Surface, {
|
|
6
|
-
|
|
7
|
+
style: twj("p-2"),
|
|
7
8
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
8
|
-
|
|
9
|
+
style: twj("flex flex-col items-center gap-2 p-1"),
|
|
9
10
|
children: [
|
|
10
11
|
/*#__PURE__*/ _jsx(ContentRelationship, {
|
|
11
12
|
setRelationship: ({ id, thumbnail, title, type, url })=>{
|
|
@@ -22,7 +23,7 @@ export const InsideLinksEditorPanel = ({ onRelationshipSelect, onCancel })=>{
|
|
|
22
23
|
}
|
|
23
24
|
}),
|
|
24
25
|
/*#__PURE__*/ _jsx("span", {
|
|
25
|
-
|
|
26
|
+
style: twj("mt-1 mb-0 text-sm"),
|
|
26
27
|
children: "Add Internal Link to Contents"
|
|
27
28
|
})
|
|
28
29
|
]
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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"}
|
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;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"}
|
|
@@ -5,6 +5,7 @@ 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";
|
|
8
9
|
export const useLinkEditorState = ({ initialUrl, initialOpenInNewTab, onSetLink })=>{
|
|
9
10
|
const [url, setUrl] = useState(initialUrl || "");
|
|
10
11
|
const [openInNewTab, setOpenInNewTab] = useState(initialOpenInNewTab || false);
|
|
@@ -42,12 +43,12 @@ export const LinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialUrl })=
|
|
|
42
43
|
initialUrl
|
|
43
44
|
});
|
|
44
45
|
return /*#__PURE__*/ _jsx(Surface, {
|
|
45
|
-
|
|
46
|
+
style: twj("p-2"),
|
|
46
47
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
47
|
-
|
|
48
|
+
style: twj("flex items-center gap-2"),
|
|
48
49
|
children: [
|
|
49
50
|
/*#__PURE__*/ _jsxs("label", {
|
|
50
|
-
|
|
51
|
+
style: twj("flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text"),
|
|
51
52
|
children: [
|
|
52
53
|
/*#__PURE__*/ _jsx(Icon, {
|
|
53
54
|
icon: Link,
|
|
@@ -55,7 +56,7 @@ export const LinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialUrl })=
|
|
|
55
56
|
}),
|
|
56
57
|
/*#__PURE__*/ _jsx("input", {
|
|
57
58
|
type: "url",
|
|
58
|
-
|
|
59
|
+
style: twj("flex-1 bg-transparent outline-none min-w-[12rem] text-black text-sm dark:text-white"),
|
|
59
60
|
placeholder: "Enter URL",
|
|
60
61
|
value: state.url,
|
|
61
62
|
onChange: state.onChange
|
|
@@ -73,9 +74,9 @@ export const LinkEditorPanel = ({ onSetLink, initialOpenInNewTab, initialUrl })=
|
|
|
73
74
|
children: "Set Link"
|
|
74
75
|
}),
|
|
75
76
|
/*#__PURE__*/ _jsx("div", {
|
|
76
|
-
|
|
77
|
+
style: twj("mt-3"),
|
|
77
78
|
children: /*#__PURE__*/ _jsxs("label", {
|
|
78
|
-
|
|
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"),
|
|
79
80
|
children: [
|
|
80
81
|
"Open in new tab",
|
|
81
82
|
/*#__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\";\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
|
|
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"}
|
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":"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"}
|
|
@@ -4,15 +4,16 @@ 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";
|
|
7
8
|
export const LinkPreviewPanel = ({ onClear, onEdit, url })=>{
|
|
8
9
|
return /*#__PURE__*/ _jsxs(Surface, {
|
|
9
|
-
|
|
10
|
+
style: twj("flex items-center gap-2 p-2"),
|
|
10
11
|
children: [
|
|
11
12
|
/*#__PURE__*/ _jsx("a", {
|
|
12
13
|
href: url,
|
|
13
14
|
target: "_blank",
|
|
14
15
|
rel: "noopener noreferrer",
|
|
15
|
-
|
|
16
|
+
style: twj("text-sm underline break-all"),
|
|
16
17
|
children: url
|
|
17
18
|
}),
|
|
18
19
|
/*#__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\";\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
|
|
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 +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;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"}
|
|
@@ -2,6 +2,7 @@ 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";
|
|
5
6
|
export const useLinkEditorState = ({ initialSrc, onSetLink })=>{
|
|
6
7
|
const [url, setUrl] = useState(initialSrc || "");
|
|
7
8
|
const onChange = useCallback((event)=>{
|
|
@@ -34,14 +35,14 @@ export const SocialMediaEditorPanel = ({ onSetLink, initialOpenInNewTab, initial
|
|
|
34
35
|
descriptionText
|
|
35
36
|
});
|
|
36
37
|
return /*#__PURE__*/ _jsx(Surface, {
|
|
37
|
-
|
|
38
|
+
style: twj("p-2"),
|
|
38
39
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
39
|
-
|
|
40
|
+
style: twj("flex flex-col items-center gap-2 p-1"),
|
|
40
41
|
children: [
|
|
41
42
|
/*#__PURE__*/ _jsx("label", {
|
|
42
|
-
|
|
43
|
+
style: twj("flex items-center gap-2 p-2 rounded-lg bg-neutral-100 dark:bg-neutral-900 cursor-text w-full"),
|
|
43
44
|
children: /*#__PURE__*/ _jsx("input", {
|
|
44
|
-
|
|
45
|
+
style: twj("flex-1 bg-transparent outline-none min-w-[276px] text-black text-sm dark:text-white"),
|
|
45
46
|
placeholder: placeholderText,
|
|
46
47
|
value: state.url,
|
|
47
48
|
onChange: state.onChange
|
|
@@ -50,7 +51,7 @@ export const SocialMediaEditorPanel = ({ onSetLink, initialOpenInNewTab, initial
|
|
|
50
51
|
/*#__PURE__*/ _jsx(Button, {
|
|
51
52
|
variant: "primary",
|
|
52
53
|
buttonSize: "medium",
|
|
53
|
-
|
|
54
|
+
style: twj("w-full m-2"),
|
|
54
55
|
type: "button",
|
|
55
56
|
onClick: (e)=>{
|
|
56
57
|
state.handleSubmit(e);
|
|
@@ -58,7 +59,7 @@ export const SocialMediaEditorPanel = ({ onSetLink, initialOpenInNewTab, initial
|
|
|
58
59
|
children: buttonText
|
|
59
60
|
}),
|
|
60
61
|
/*#__PURE__*/ _jsx("span", {
|
|
61
|
-
|
|
62
|
+
style: twj("mt-1 mb-0 text-sm"),
|
|
62
63
|
children: descriptionText
|
|
63
64
|
})
|
|
64
65
|
]
|
|
@@ -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\";\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
|
|
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 +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;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,13 +1,14 @@
|
|
|
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";
|
|
4
5
|
export const Button = /*#__PURE__*/ React.forwardRef(({ active, buttonSize = "medium", children, disabled, variant = "primary", className, activeClassname, ...rest }, ref)=>{
|
|
5
6
|
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);
|
|
6
7
|
return /*#__PURE__*/ _jsx("button", {
|
|
7
8
|
type: "button",
|
|
8
9
|
ref: ref,
|
|
9
10
|
disabled: disabled,
|
|
10
|
-
|
|
11
|
+
style: twj(buttonClassName),
|
|
11
12
|
...rest,
|
|
12
13
|
children: children
|
|
13
14
|
});
|
|
@@ -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\";\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
|
|
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 +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;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,9 +1,10 @@
|
|
|
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";
|
|
4
5
|
export const DropdownCategoryTitle = ({ children })=>{
|
|
5
6
|
return /*#__PURE__*/ _jsx("div", {
|
|
6
|
-
|
|
7
|
+
style: twj("text-[.65rem] font-semibold mb-1 uppercase text-neutral-500 dark:text-neutral-400 px-1.5"),
|
|
7
8
|
children: children
|
|
8
9
|
});
|
|
9
10
|
};
|
|
@@ -11,7 +12,7 @@ export const DropdownButton = ({ children, isActive, onClick, disabled, classNam
|
|
|
11
12
|
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);
|
|
12
13
|
return /*#__PURE__*/ _jsx("button", {
|
|
13
14
|
type: "button",
|
|
14
|
-
|
|
15
|
+
style: twj(buttonClass),
|
|
15
16
|
disabled: disabled,
|
|
16
17
|
onClick: onClick,
|
|
17
18
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\n\nexport const DropdownCategoryTitle = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n return (\n <div
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Dropdown/Dropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\nexport const DropdownCategoryTitle = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n return (\n <div\n style={twj(\n \"text-[.65rem] font-semibold mb-1 uppercase text-neutral-500 dark:text-neutral-400 px-1.5\"\n )}\n >\n {children}\n </div>\n );\n};\n\nexport const DropdownButton = ({\n children,\n isActive,\n onClick,\n disabled,\n className,\n}: {\n children: React.ReactNode;\n isActive?: boolean;\n onClick?: () => void;\n disabled?: boolean;\n className?: string;\n}) => {\n const buttonClass = cn(\n \"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\",\n !isActive && !disabled,\n \"hover:bg-neutral-100 hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200\",\n isActive &&\n !disabled &&\n \"bg-neutral-100 text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200\",\n disabled && \"text-neutral-400 cursor-not-allowed dark:text-neutral-600\",\n className\n );\n\n return (\n <button\n type=\"button\"\n style={twj(buttonClass)}\n disabled={disabled}\n onClick={onClick}\n >\n {children}\n </button>\n );\n};\n"],"names":["React","cn","twj","DropdownCategoryTitle","children","div","style","DropdownButton","isActive","onClick","disabled","className","buttonClass","button","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,EAAE,QAAQ,8BAA8B;AACjD,SAASC,GAAG,QAAQ,YAAY;AAEhC,OAAO,MAAMC,wBAAwB,CAAC,EACpCC,QAAQ,EAGT;IACC,qBACE,KAACC;QACCC,OAAOJ,IACL;kBAGDE;;AAGP,EAAE;AAEF,OAAO,MAAMG,iBAAiB,CAAC,EAC7BH,QAAQ,EACRI,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,SAAS,EAOV;IACC,MAAMC,cAAcX,GAClB,iJACA,CAACO,YAAY,CAACE,UACd,qGACAF,YACE,CAACE,YACD,6EACFA,YAAY,6DACZC;IAGF,qBACE,KAACE;QACCC,MAAK;QACLR,OAAOJ,IAAIU;QACXF,UAAUA;QACVD,SAASA;kBAERL;;AAGP,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/features/ui/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/features/ui/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,UAAU,CAAC;IAEjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,IAAI,yEAA2C,SAAS,iCAanE,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { cn } from "../../lib/utils/index.js";
|
|
4
|
+
import { twj } from "tw-to-css";
|
|
4
5
|
export const Icon = /*#__PURE__*/ memo(({ icon, className, strokeWidth })=>{
|
|
5
6
|
const IconComponent = icon;
|
|
6
7
|
if (!IconComponent) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
9
10
|
return /*#__PURE__*/ _jsx(IconComponent, {
|
|
10
|
-
|
|
11
|
+
style: twj(cn("w-4 h-4", className)),
|
|
11
12
|
strokeWidth: strokeWidth || 2.5
|
|
12
13
|
});
|
|
13
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/features/ui/Icon.tsx"],"sourcesContent":["import { LucideIcon } from \"lucide-react\";\nimport { memo } from \"react\";\nimport { cn } from \"../../lib/utils/index.js\";\n\nexport type IconProps = {\n icon: LucideIcon;\n // name: keyof typeof icons\n className?: string;\n strokeWidth?: number;\n};\n\nexport const Icon = memo(({ icon, className, strokeWidth }: IconProps) => {\n const IconComponent = icon;\n\n if (!IconComponent) {\n return null;\n }\n\n return (\n <IconComponent\n
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/features/ui/Icon.tsx"],"sourcesContent":["import { LucideIcon } from \"lucide-react\";\nimport { memo } from \"react\";\nimport { cn } from \"../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type IconProps = {\n icon: LucideIcon;\n // name: keyof typeof icons\n className?: string;\n strokeWidth?: number;\n};\n\nexport const Icon = memo(({ icon, className, strokeWidth }: IconProps) => {\n const IconComponent = icon;\n\n if (!IconComponent) {\n return null;\n }\n\n return (\n <IconComponent\n style={twj(cn(\"w-4 h-4\", className))}\n strokeWidth={strokeWidth || 2.5}\n />\n );\n});\n\nIcon.displayName = \"Icon\";\n"],"names":["memo","cn","twj","Icon","icon","className","strokeWidth","IconComponent","style","displayName"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";AACA,SAASA,IAAI,QAAQ,QAAQ;AAC7B,SAASC,EAAE,QAAQ,2BAA2B;AAC9C,SAASC,GAAG,QAAQ,YAAY;AAShC,OAAO,MAAMC,qBAAOH,KAAK,CAAC,EAAEI,IAAI,EAAEC,SAAS,EAAEC,WAAW,EAAa;IACnE,MAAMC,gBAAgBH;IAEtB,IAAI,CAACG,eAAe;QAClB,OAAO;IACT;IAEA,qBACE,KAACA;QACCC,OAAON,IAAID,GAAG,WAAWI;QACzBC,aAAaA,eAAe;;AAGlC,GAAG;AAEHH,KAAKM,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;AAmC9D,eAAO,MAAM,MAAM,0BAAkC,WAAW,sBAe/D,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
|
+
import { twj } from "tw-to-css";
|
|
4
5
|
const LoadingWrapper = ({ label })=>{
|
|
5
6
|
return /*#__PURE__*/ _jsxs("div", {
|
|
6
|
-
|
|
7
|
+
style: twj("flex flex-col items-center justify-center gap-2 p-4 text-white bg-black rounded-lg shadow-2xl dark:text-black dark:bg-white"),
|
|
7
8
|
children: [
|
|
8
9
|
/*#__PURE__*/ _jsx("svg", {
|
|
9
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13,13 +14,13 @@ const LoadingWrapper = ({ label })=>{
|
|
|
13
14
|
strokeWidth: "2",
|
|
14
15
|
strokeLinecap: "round",
|
|
15
16
|
strokeLinejoin: "round",
|
|
16
|
-
|
|
17
|
+
style: twj("w-8 h-8 animate-spin"),
|
|
17
18
|
children: /*#__PURE__*/ _jsx("path", {
|
|
18
19
|
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
19
20
|
})
|
|
20
21
|
}),
|
|
21
22
|
label && /*#__PURE__*/ _jsx("p", {
|
|
22
|
-
|
|
23
|
+
style: twj("text-sm font-semibold leading-tight text-white dark:text-black"),
|
|
23
24
|
children: label
|
|
24
25
|
})
|
|
25
26
|
]
|
|
@@ -27,7 +28,7 @@ const LoadingWrapper = ({ label })=>{
|
|
|
27
28
|
};
|
|
28
29
|
export const Loader = ({ hasOverlay = true, label })=>{
|
|
29
30
|
return hasOverlay ? /*#__PURE__*/ createPortal(/*#__PURE__*/ _jsx("div", {
|
|
30
|
-
|
|
31
|
+
style: twj("items-center justify-center bg-black/60 flex h-full w-full fixed top-0 left-0 select-none z-[9999]"),
|
|
31
32
|
children: /*#__PURE__*/ _jsx(LoadingWrapper, {
|
|
32
33
|
label: label
|
|
33
34
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Loader/Loader.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { LoaderProps, LoadingWrapperProps } from \"./types.js\";\n\nconst LoadingWrapper = ({ label }: LoadingWrapperProps) => {\n return (\n <div
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Loader/Loader.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { LoaderProps, LoadingWrapperProps } from \"./types.js\";\nimport { twj } from \"tw-to-css\";\n\nconst LoadingWrapper = ({ label }: LoadingWrapperProps) => {\n return (\n <div\n style={twj(\n \"flex flex-col items-center justify-center gap-2 p-4 text-white bg-black rounded-lg shadow-2xl dark:text-black dark:bg-white\"\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={twj(\"w-8 h-8 animate-spin\")}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n {label && (\n <p\n style={twj(\n \"text-sm font-semibold leading-tight text-white dark:text-black\"\n )}\n >\n {label}\n </p>\n )}\n </div>\n );\n};\n\nexport const Loader = ({ hasOverlay = true, label }: LoaderProps) => {\n return hasOverlay ? (\n createPortal(\n <div\n style={twj(\n \"items-center justify-center bg-black/60 flex h-full w-full fixed top-0 left-0 select-none z-[9999]\"\n )}\n >\n <LoadingWrapper label={label} />\n </div>,\n document.body\n )\n ) : (\n <LoadingWrapper label={label} />\n );\n};\n\nexport default Loader;\n"],"names":["React","createPortal","twj","LoadingWrapper","label","div","style","svg","xmlns","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","path","d","p","Loader","hasOverlay","document","body"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,YAAY,QAAQ,YAAY;AAGzC,SAASC,GAAG,QAAQ,YAAY;AAEhC,MAAMC,iBAAiB,CAAC,EAAEC,KAAK,EAAuB;IACpD,qBACE,MAACC;QACCC,OAAOJ,IACL;;0BAGF,KAACK;gBACCC,OAAM;gBACNC,SAAQ;gBACRC,MAAK;gBACLC,QAAO;gBACPC,aAAY;gBACZC,eAAc;gBACdC,gBAAe;gBACfR,OAAOJ,IAAI;0BAEX,cAAA,KAACa;oBAAKC,GAAE;;;YAETZ,uBACC,KAACa;gBACCX,OAAOJ,IACL;0BAGDE;;;;AAKX;AAEA,OAAO,MAAMc,SAAS,CAAC,EAAEC,aAAa,IAAI,EAAEf,KAAK,EAAe;IAC9D,OAAOe,2BACLlB,2BACE,KAACI;QACCC,OAAOJ,IACL;kBAGF,cAAA,KAACC;YAAeC,OAAOA;;QAEzBgB,SAASC,IAAI,kBAGf,KAAClB;QAAeC,OAAOA;;AAE3B,EAAE;AAEF,eAAec,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAEzC,eAAO,MAAM,KAAK;cALN,QAAQ,GAAG,OAAO;eACjB,OAAO;cACR,OAAO;+EAqBlB,CAAC;AAIF,eAAO,MAAM,YAAY;cAEX,OAAO;+EAWnB,CAAC;AAIH,eAAO,MAAM,WAAW;cAEV,OAAO;+EAcnB,CAAC;AAIH,eAAO,MAAM,YAAY;cAEX,OAAO;+EAWnB,CAAC;AAIH,eAAO,MAAM,aAAa;cAEZ,OAAO;+EAcnB,CAAC;AAIH,eAAO,MAAM,WAAW;cAEV,OAAO;+EAcnB,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { forwardRef } from "react";
|
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
5
|
import { Surface } from "../Surface.js";
|
|
6
6
|
import { cn } from "../../../lib/utils/index.js";
|
|
7
|
+
import { twj } from "tw-to-css";
|
|
7
8
|
export const Panel = /*#__PURE__*/ forwardRef(({ asChild, className, children, spacing, noShadow, ...rest }, ref)=>{
|
|
8
9
|
const panelClass = cn("p-2", spacing === "small" && "p-[0.2rem]", className);
|
|
9
10
|
const Comp = asChild ? Slot : "div";
|
|
@@ -11,7 +12,7 @@ export const Panel = /*#__PURE__*/ forwardRef(({ asChild, className, children, s
|
|
|
11
12
|
ref: ref,
|
|
12
13
|
...rest,
|
|
13
14
|
children: /*#__PURE__*/ _jsx(Surface, {
|
|
14
|
-
|
|
15
|
+
style: twj(panelClass),
|
|
15
16
|
withShadow: !noShadow,
|
|
16
17
|
children: children
|
|
17
18
|
})
|
|
@@ -22,7 +23,7 @@ export const PanelDivider = /*#__PURE__*/ forwardRef(({ asChild, className, chil
|
|
|
22
23
|
const dividerClass = cn("border-b border-b-black/10 mb-2 pb-2", className);
|
|
23
24
|
const Comp = asChild ? Slot : "div";
|
|
24
25
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
25
|
-
|
|
26
|
+
style: twj(dividerClass),
|
|
26
27
|
...rest,
|
|
27
28
|
ref: ref,
|
|
28
29
|
children: children
|
|
@@ -33,7 +34,7 @@ export const PanelHeader = /*#__PURE__*/ forwardRef(({ asChild, className, child
|
|
|
33
34
|
const headerClass = cn("border-b border-b-black/10 text-sm mb-2 pb-2", className);
|
|
34
35
|
const Comp = asChild ? Slot : "div";
|
|
35
36
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
36
|
-
|
|
37
|
+
style: twj(headerClass),
|
|
37
38
|
...rest,
|
|
38
39
|
ref: ref,
|
|
39
40
|
children: children
|
|
@@ -44,7 +45,7 @@ export const PanelSection = /*#__PURE__*/ forwardRef(({ asChild, className, chil
|
|
|
44
45
|
const sectionClass = cn("mt-4 first:mt-1", className);
|
|
45
46
|
const Comp = asChild ? Slot : "div";
|
|
46
47
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
47
|
-
|
|
48
|
+
style: twj(sectionClass),
|
|
48
49
|
...rest,
|
|
49
50
|
ref: ref,
|
|
50
51
|
children: children
|
|
@@ -55,7 +56,7 @@ export const PanelHeadline = /*#__PURE__*/ forwardRef(({ asChild, className, chi
|
|
|
55
56
|
const headlineClass = cn("text-black/80 dark:text-white/80 text-xs font-medium mb-2 ml-1.5", className);
|
|
56
57
|
const Comp = asChild ? Slot : "div";
|
|
57
58
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
58
|
-
|
|
59
|
+
style: twj(headlineClass),
|
|
59
60
|
...rest,
|
|
60
61
|
ref: ref,
|
|
61
62
|
children: children
|
|
@@ -66,7 +67,7 @@ export const PanelFooter = /*#__PURE__*/ forwardRef(({ asChild, className, child
|
|
|
66
67
|
const footerClass = cn("border-t border-black/10 text-sm mt-2 pt-2", className);
|
|
67
68
|
const Comp = asChild ? Slot : "div";
|
|
68
69
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
69
|
-
|
|
70
|
+
style: twj(footerClass),
|
|
70
71
|
...rest,
|
|
71
72
|
ref: ref,
|
|
72
73
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Panel/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Surface } from \"../Surface.js\";\nimport { cn } from \"../../../lib/utils/index.js\";\n\nexport type PanelProps = {\n spacing?: \"medium\" | \"small\";\n noShadow?: boolean;\n asChild?: boolean;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport const Panel = forwardRef<HTMLDivElement, PanelProps>(\n ({ asChild, className, children, spacing, noShadow, ...rest }, ref) => {\n const panelClass = cn(\n \"p-2\",\n spacing === \"small\" && \"p-[0.2rem]\",\n className\n );\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp ref={ref} {...rest}>\n <Surface
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/ui/Panel/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Surface } from \"../Surface.js\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport { twj } from \"tw-to-css\";\n\nexport type PanelProps = {\n spacing?: \"medium\" | \"small\";\n noShadow?: boolean;\n asChild?: boolean;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport const Panel = forwardRef<HTMLDivElement, PanelProps>(\n ({ asChild, className, children, spacing, noShadow, ...rest }, ref) => {\n const panelClass = cn(\n \"p-2\",\n spacing === \"small\" && \"p-[0.2rem]\",\n className\n );\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp ref={ref} {...rest}>\n <Surface style={twj(panelClass)} withShadow={!noShadow}>\n {children}\n </Surface>\n </Comp>\n );\n }\n);\n\nPanel.displayName = \"Panel\";\n\nexport const PanelDivider = forwardRef<\n HTMLDivElement,\n { asChild?: boolean } & React.HTMLAttributes<HTMLDivElement>\n>(({ asChild, className, children, ...rest }, ref) => {\n const dividerClass = cn(\"border-b border-b-black/10 mb-2 pb-2\", className);\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp style={twj(dividerClass)} {...rest} ref={ref}>\n {children}\n </Comp>\n );\n});\n\nPanelDivider.displayName = \"PanelDivider\";\n\nexport const PanelHeader = forwardRef<\n HTMLDivElement,\n { asChild?: boolean } & React.HTMLAttributes<HTMLDivElement>\n>(({ asChild, className, children, ...rest }, ref) => {\n const headerClass = cn(\n \"border-b border-b-black/10 text-sm mb-2 pb-2\",\n className\n );\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp style={twj(headerClass)} {...rest} ref={ref}>\n {children}\n </Comp>\n );\n});\n\nPanelHeader.displayName = \"PanelHeader\";\n\nexport const PanelSection = forwardRef<\n HTMLDivElement,\n { asChild?: boolean } & React.HTMLAttributes<HTMLDivElement>\n>(({ asChild, className, children, ...rest }, ref) => {\n const sectionClass = cn(\"mt-4 first:mt-1\", className);\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp style={twj(sectionClass)} {...rest} ref={ref}>\n {children}\n </Comp>\n );\n});\n\nPanelSection.displayName = \"PanelSection\";\n\nexport const PanelHeadline = forwardRef<\n HTMLDivElement,\n { asChild?: boolean } & React.HTMLAttributes<HTMLDivElement>\n>(({ asChild, className, children, ...rest }, ref) => {\n const headlineClass = cn(\n \"text-black/80 dark:text-white/80 text-xs font-medium mb-2 ml-1.5\",\n className\n );\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp style={twj(headlineClass)} {...rest} ref={ref}>\n {children}\n </Comp>\n );\n});\n\nPanelHeadline.displayName = \"PanelHeadline\";\n\nexport const PanelFooter = forwardRef<\n HTMLDivElement,\n { asChild?: boolean } & React.HTMLAttributes<HTMLDivElement>\n>(({ asChild, className, children, ...rest }, ref) => {\n const footerClass = cn(\n \"border-t border-black/10 text-sm mt-2 pt-2\",\n className\n );\n\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp style={twj(footerClass)} {...rest} ref={ref}>\n {children}\n </Comp>\n );\n});\n\nPanelFooter.displayName = \"PanelFooter\";\n"],"names":["React","forwardRef","Slot","Surface","cn","twj","Panel","asChild","className","children","spacing","noShadow","rest","ref","panelClass","Comp","style","withShadow","displayName","PanelDivider","dividerClass","PanelHeader","headerClass","PanelSection","sectionClass","PanelHeadline","headlineClass","PanelFooter","footerClass"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,UAAU,QAAQ,QAAQ;AACnC,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,EAAE,QAAQ,8BAA8B;AACjD,SAASC,GAAG,QAAQ,YAAY;AAQhC,OAAO,MAAMC,sBAAQL,WACnB,CAAC,EAAEM,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGC,MAAM,EAAEC;IAC7D,MAAMC,aAAaV,GACjB,OACAM,YAAY,WAAW,cACvBF;IAGF,MAAMO,OAAOR,UAAUL,OAAO;IAE9B,qBACE,KAACa;QAAKF,KAAKA;QAAM,GAAGD,IAAI;kBACtB,cAAA,KAACT;YAAQa,OAAOX,IAAIS;YAAaG,YAAY,CAACN;sBAC3CF;;;AAIT,GACA;AAEFH,MAAMY,WAAW,GAAG;AAEpB,OAAO,MAAMC,6BAAelB,WAG1B,CAAC,EAAEM,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGG,MAAM,EAAEC;IAC5C,MAAMO,eAAehB,GAAG,wCAAwCI;IAEhE,MAAMO,OAAOR,UAAUL,OAAO;IAE9B,qBACE,KAACa;QAAKC,OAAOX,IAAIe;QAAgB,GAAGR,IAAI;QAAEC,KAAKA;kBAC5CJ;;AAGP,GAAG;AAEHU,aAAaD,WAAW,GAAG;AAE3B,OAAO,MAAMG,4BAAcpB,WAGzB,CAAC,EAAEM,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGG,MAAM,EAAEC;IAC5C,MAAMS,cAAclB,GAClB,gDACAI;IAGF,MAAMO,OAAOR,UAAUL,OAAO;IAE9B,qBACE,KAACa;QAAKC,OAAOX,IAAIiB;QAAe,GAAGV,IAAI;QAAEC,KAAKA;kBAC3CJ;;AAGP,GAAG;AAEHY,YAAYH,WAAW,GAAG;AAE1B,OAAO,MAAMK,6BAAetB,WAG1B,CAAC,EAAEM,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGG,MAAM,EAAEC;IAC5C,MAAMW,eAAepB,GAAG,mBAAmBI;IAE3C,MAAMO,OAAOR,UAAUL,OAAO;IAE9B,qBACE,KAACa;QAAKC,OAAOX,IAAImB;QAAgB,GAAGZ,IAAI;QAAEC,KAAKA;kBAC5CJ;;AAGP,GAAG;AAEHc,aAAaL,WAAW,GAAG;AAE3B,OAAO,MAAMO,8BAAgBxB,WAG3B,CAAC,EAAEM,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGG,MAAM,EAAEC;IAC5C,MAAMa,gBAAgBtB,GACpB,oEACAI;IAGF,MAAMO,OAAOR,UAAUL,OAAO;IAE9B,qBACE,KAACa;QAAKC,OAAOX,IAAIqB;QAAiB,GAAGd,IAAI;QAAEC,KAAKA;kBAC7CJ;;AAGP,GAAG;AAEHgB,cAAcP,WAAW,GAAG;AAE5B,OAAO,MAAMS,4BAAc1B,WAGzB,CAAC,EAAEM,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGG,MAAM,EAAEC;IAC5C,MAAMe,cAAcxB,GAClB,8CACAI;IAGF,MAAMO,OAAOR,UAAUL,OAAO;IAE9B,qBACE,KAACa;QAAKC,OAAOX,IAAIuB;QAAe,GAAGhB,IAAI;QAAEC,KAAKA;kBAC3CJ;;AAGP,GAAG;AAEHkB,YAAYT,WAAW,GAAG"}
|