notra-editor 0.4.0 → 0.5.0
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/components/image-popover/image-popover.cjs +161 -0
- package/dist/components/image-popover/image-popover.cjs.map +1 -0
- package/dist/components/image-popover/image-popover.d.cts +9 -0
- package/dist/components/image-popover/image-popover.d.ts +9 -0
- package/dist/components/image-popover/image-popover.mjs +137 -0
- package/dist/components/image-popover/image-popover.mjs.map +1 -0
- package/dist/components/image-popover/use-image-popover.cjs +88 -0
- package/dist/components/image-popover/use-image-popover.cjs.map +1 -0
- package/dist/components/image-popover/use-image-popover.d.cts +19 -0
- package/dist/components/image-popover/use-image-popover.d.ts +19 -0
- package/dist/components/image-popover/use-image-popover.mjs +64 -0
- package/dist/components/image-popover/use-image-popover.mjs.map +1 -0
- package/dist/components/link-popover/link-popover.cjs +12 -3
- package/dist/components/link-popover/link-popover.cjs.map +1 -1
- package/dist/components/link-popover/link-popover.mjs +12 -3
- package/dist/components/link-popover/link-popover.mjs.map +1 -1
- package/dist/components/link-popover/use-link-popover.cjs +17 -2
- package/dist/components/link-popover/use-link-popover.cjs.map +1 -1
- package/dist/components/link-popover/use-link-popover.d.cts +1 -0
- package/dist/components/link-popover/use-link-popover.d.ts +1 -0
- package/dist/components/link-popover/use-link-popover.mjs +17 -2
- package/dist/components/link-popover/use-link-popover.mjs.map +1 -1
- package/dist/extensions/editor.cjs +2 -0
- package/dist/extensions/editor.cjs.map +1 -1
- package/dist/extensions/editor.d.cts +2 -1
- package/dist/extensions/editor.d.ts +2 -1
- package/dist/extensions/editor.mjs +2 -0
- package/dist/extensions/editor.mjs.map +1 -1
- package/dist/extensions/index.d.cts +1 -0
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/shared.cjs +3 -1
- package/dist/extensions/shared.cjs.map +1 -1
- package/dist/extensions/shared.d.cts +2 -1
- package/dist/extensions/shared.d.ts +2 -1
- package/dist/extensions/shared.mjs +3 -1
- package/dist/extensions/shared.mjs.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/notra-editor.cjs +3 -1
- package/dist/notra-editor.cjs.map +1 -1
- package/dist/notra-editor.mjs +3 -1
- package/dist/notra-editor.mjs.map +1 -1
- package/dist/styles/globals.css +3 -0
- package/dist/themes/default/shared.css +18 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/link-popover/link-popover.tsx"],"sourcesContent":["'use client';\n\nimport {\n\tCornerDownLeft,\n\tExternalLink,\n\tLink as LinkIcon,\n\tTrash2\n} from 'lucide-react';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { useLinkPopover } from './use-link-popover';\nimport { Button } from '../ui/button';\nimport { Input } from '../ui/input';\nimport { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';\nimport { Separator } from '../ui/separator';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface LinkPopoverProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nexport const LinkPopover = forwardRef<HTMLButtonElement, LinkPopoverProps>(\n\t({ editor, ...buttonProps }, ref) => {\n\t\tconst [isOpen, setIsOpen] = useState(false);\n\n\t\tconst {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/link-popover/link-popover.tsx"],"sourcesContent":["'use client';\n\nimport {\n\tCornerDownLeft,\n\tExternalLink,\n\tLink as LinkIcon,\n\tTrash2\n} from 'lucide-react';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { useLinkPopover } from './use-link-popover';\nimport { Button } from '../ui/button';\nimport { Input } from '../ui/input';\nimport { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';\nimport { Separator } from '../ui/separator';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface LinkPopoverProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nexport const LinkPopover = forwardRef<HTMLButtonElement, LinkPopoverProps>(\n\t({ editor, ...buttonProps }, ref) => {\n\t\tconst [isOpen, setIsOpen] = useState(false);\n\n\t\tconst {\n\t\t\turl,\n\t\t\tsetUrl,\n\t\t\tisActive,\n\t\t\tcanSet,\n\t\t\tsetLink,\n\t\t\tremoveLink,\n\t\t\topenLink,\n\t\t\twasSelectionMove\n\t\t} = useLinkPopover({ editor });\n\n\t\t// Auto-open popover when cursor moves onto an existing link (selection-only transaction)\n\t\tuseEffect(() => {\n\t\t\tif (isActive && wasSelectionMove) {\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t}, [isActive, wasSelectionMove]);\n\n\t\tconst handleSetLink = useCallback(() => {\n\t\t\tsetLink();\n\t\t\tsetIsOpen(false);\n\t\t}, [setLink]);\n\n\t\tconst handleRemoveLink = useCallback(() => {\n\t\t\tremoveLink();\n\t\t\tsetIsOpen(false);\n\t\t}, [removeLink]);\n\n\t\tconst handleKeyDown = useCallback(\n\t\t\t(event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleSetLink();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[handleSetLink]\n\t\t);\n\n\t\treturn (\n\t\t\t<Popover open={isOpen} onOpenChange={setIsOpen}>\n\t\t\t\t<PopoverTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\taria-label=\"Link\"\n\t\t\t\t\t\taria-pressed={isActive}\n\t\t\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\t\t\tdisabled={!canSet}\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t{...buttonProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkIcon\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tisActive ? 'nt:text-[var(--tt-brand-color-500)]' : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t</PopoverTrigger>\n\t\t\t\t<PopoverContent\n\t\t\t\t\talign=\"start\"\n\t\t\t\t\tclassName=\"nt:flex nt:w-auto nt:items-center nt:gap-1 nt:p-1\"\n\t\t\t\t>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\tclassName=\"nt:h-7 nt:min-w-48 nt:border-none nt:shadow-none nt:focus-visible:ring-0\"\n\t\t\t\t\t\tplaceholder=\"Paste a link...\"\n\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\tvalue={url}\n\t\t\t\t\t\tonChange={(e) => setUrl(e.target.value)}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Apply link\"\n\t\t\t\t\t\tdisabled={!url && !isActive}\n\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={handleSetLink}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CornerDownLeft />\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Separator className=\"nt:h-5\" orientation=\"vertical\" />\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Open link in new window\"\n\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={openLink}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ExternalLink />\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Remove link\"\n\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={handleRemoveLink}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Trash2 />\n\t\t\t\t\t</Button>\n\t\t\t\t</PopoverContent>\n\t\t\t</Popover>\n\t\t);\n\t}\n);\n\nLinkPopover.displayName = 'LinkPopover';\n"],"mappings":";AAkFM,cAOF,YAPE;AAhFN;AAAA,EACC;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,OACM;AACP,SAAS,YAAY,aAAa,WAAW,gBAAgB;AAE7D,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,iBAAiB;AAWnB,MAAM,cAAc;AAAA,EAC1B,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,QAAQ;AACpC,UAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,eAAe,EAAE,OAAO,CAAC;AAG7B,cAAU,MAAM;AACf,UAAI,YAAY,kBAAkB;AACjC,kBAAU,IAAI;AAAA,MACf;AAAA,IACD,GAAG,CAAC,UAAU,gBAAgB,CAAC;AAE/B,UAAM,gBAAgB,YAAY,MAAM;AACvC,cAAQ;AACR,gBAAU,KAAK;AAAA,IAChB,GAAG,CAAC,OAAO,CAAC;AAEZ,UAAM,mBAAmB,YAAY,MAAM;AAC1C,iBAAW;AACX,gBAAU,KAAK;AAAA,IAChB,GAAG,CAAC,UAAU,CAAC;AAEf,UAAM,gBAAgB;AAAA,MACrB,CAAC,UAAiD;AACjD,YAAI,MAAM,QAAQ,SAAS;AAC1B,gBAAM,eAAe;AACrB,wBAAc;AAAA,QACf;AAAA,MACD;AAAA,MACA,CAAC,aAAa;AAAA,IACf;AAEA,WACC,qBAAC,WAAQ,MAAM,QAAQ,cAAc,WACpC;AAAA,0BAAC,kBAAe,SAAO,MACtB;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA,cAAW;AAAA,UACX,gBAAc;AAAA,UACd,qBAAmB,WAAW,OAAO;AAAA,UACrC,UAAU,CAAC;AAAA,UACX,MAAK;AAAA,UACL,UAAU;AAAA,UACV,MAAK;AAAA,UACL,SAAQ;AAAA,UACP,GAAG;AAAA,UAEJ;AAAA,YAAC;AAAA;AAAA,cACA,WACC,WAAW,wCAAwC;AAAA;AAAA,UAErD;AAAA;AAAA,MACD,GACD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,OAAM;AAAA,UACN,WAAU;AAAA,UAEV;AAAA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAS;AAAA,gBACT,WAAU;AAAA,gBACV,aAAY;AAAA,gBACZ,MAAK;AAAA,gBACL,OAAO;AAAA,gBACP,UAAU,CAAC,MAAM,OAAO,EAAE,OAAO,KAAK;AAAA,gBACtC,WAAW;AAAA;AAAA,YACZ;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,cAAW;AAAA,gBACX,UAAU,CAAC,OAAO,CAAC;AAAA,gBACnB,MAAK;AAAA,gBACL,UAAU;AAAA,gBACV,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,SAAS;AAAA,gBAET,8BAAC,kBAAe;AAAA;AAAA,YACjB;AAAA,YACA,oBAAC,aAAU,WAAU,UAAS,aAAY,YAAW;AAAA,YACrD;AAAA,cAAC;AAAA;AAAA,gBACA,cAAW;AAAA,gBACX,MAAK;AAAA,gBACL,UAAU;AAAA,gBACV,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,SAAS;AAAA,gBAET,8BAAC,gBAAa;AAAA;AAAA,YACf;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,cAAW;AAAA,gBACX,MAAK;AAAA,gBACL,UAAU;AAAA,gBACV,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,SAAS;AAAA,gBAET,8BAAC,UAAO;AAAA;AAAA,YACT;AAAA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,EAEF;AACD;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -26,12 +26,18 @@ function useLinkPopover({ editor }) {
|
|
|
26
26
|
const [url, setUrl] = (0, import_react.useState)("");
|
|
27
27
|
const [isActive, setIsActive] = (0, import_react.useState)(false);
|
|
28
28
|
const [canSet, setCanSet] = (0, import_react.useState)(false);
|
|
29
|
+
const [wasSelectionMove, setWasSelectionMove] = (0, import_react.useState)(false);
|
|
29
30
|
(0, import_react.useEffect)(() => {
|
|
30
31
|
if (!editor) return;
|
|
31
|
-
const handleUpdate = (
|
|
32
|
+
const handleUpdate = ({
|
|
33
|
+
transaction
|
|
34
|
+
} = {}) => {
|
|
32
35
|
const active = editor.isActive("link");
|
|
33
36
|
setIsActive(active);
|
|
34
37
|
setCanSet(editor.isEditable);
|
|
38
|
+
if (transaction) {
|
|
39
|
+
setWasSelectionMove(!transaction.docChanged);
|
|
40
|
+
}
|
|
35
41
|
if (active) {
|
|
36
42
|
setUrl(editor.getAttributes("link").href ?? "");
|
|
37
43
|
}
|
|
@@ -62,7 +68,16 @@ function useLinkPopover({ editor }) {
|
|
|
62
68
|
const sanitized = /^https?:\/\//i.test(url) ? url : `https://${url}`;
|
|
63
69
|
window.open(sanitized, "_blank", "noopener,noreferrer");
|
|
64
70
|
}, [url]);
|
|
65
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
url,
|
|
73
|
+
setUrl,
|
|
74
|
+
isActive,
|
|
75
|
+
canSet,
|
|
76
|
+
setLink,
|
|
77
|
+
removeLink,
|
|
78
|
+
openLink,
|
|
79
|
+
wasSelectionMove
|
|
80
|
+
};
|
|
66
81
|
}
|
|
67
82
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
83
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/link-popover/use-link-popover.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface UseLinkPopoverConfig {\n\teditor: Editor | null;\n}\n\nexport function useLinkPopover({ editor }: UseLinkPopoverConfig) {\n\tconst [url, setUrl] = useState('');\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canSet, setCanSet] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst active = editor.isActive('link');\n\n\t\t\tsetIsActive(active);\n\t\t\tsetCanSet(editor.isEditable);\n\n\t\t\tif (active) {\n\t\t\t\tsetUrl(editor.getAttributes('link').href ?? '');\n\t\t\t}\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor]);\n\n\tconst setLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (!url) {\n\t\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\n\t\t\treturn;\n\t\t}\n\n\t\teditor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n\t}, [editor, url]);\n\n\tconst removeLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\tsetUrl('');\n\t}, [editor]);\n\n\tconst openLink = useCallback(() => {\n\t\tif (!url) return;\n\n\t\tconst sanitized = /^https?:\\/\\//i.test(url) ? url : `https://${url}`;\n\n\t\twindow.open(sanitized, '_blank', 'noopener,noreferrer');\n\t}, [url]);\n\n\treturn {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/link-popover/use-link-popover.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\nimport type { Transaction } from '@tiptap/pm/state';\n\nexport interface UseLinkPopoverConfig {\n\teditor: Editor | null;\n}\n\nexport function useLinkPopover({ editor }: UseLinkPopoverConfig) {\n\tconst [url, setUrl] = useState('');\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canSet, setCanSet] = useState(false);\n\tconst [wasSelectionMove, setWasSelectionMove] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = ({\n\t\t\ttransaction\n\t\t}: { transaction?: Transaction } = {}) => {\n\t\t\tconst active = editor.isActive('link');\n\n\t\t\tsetIsActive(active);\n\t\t\tsetCanSet(editor.isEditable);\n\n\t\t\tif (transaction) {\n\t\t\t\tsetWasSelectionMove(!transaction.docChanged);\n\t\t\t}\n\n\t\t\tif (active) {\n\t\t\t\tsetUrl(editor.getAttributes('link').href ?? '');\n\t\t\t}\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor]);\n\n\tconst setLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (!url) {\n\t\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\n\t\t\treturn;\n\t\t}\n\n\t\teditor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n\t}, [editor, url]);\n\n\tconst removeLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\tsetUrl('');\n\t}, [editor]);\n\n\tconst openLink = useCallback(() => {\n\t\tif (!url) return;\n\n\t\tconst sanitized = /^https?:\\/\\//i.test(url) ? url : `https://${url}`;\n\n\t\twindow.open(sanitized, '_blank', 'noopener,noreferrer');\n\t}, [url]);\n\n\treturn {\n\t\turl,\n\t\tsetUrl,\n\t\tisActive,\n\t\tcanSet,\n\t\tsetLink,\n\t\tremoveLink,\n\t\topenLink,\n\t\twasSelectionMove\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiD;AAS1C,SAAS,eAAe,EAAE,OAAO,GAAyB;AAChE,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAS,EAAE;AACjC,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAC1C,QAAM,CAAC,kBAAkB,mBAAmB,QAAI,uBAAS,KAAK;AAE9D,8BAAU,MAAM;AACf,QAAI,CAAC,OAAQ;AAEb,UAAM,eAAe,CAAC;AAAA,MACrB;AAAA,IACD,IAAmC,CAAC,MAAM;AACzC,YAAM,SAAS,OAAO,SAAS,MAAM;AAErC,kBAAY,MAAM;AAClB,gBAAU,OAAO,UAAU;AAE3B,UAAI,aAAa;AAChB,4BAAoB,CAAC,YAAY,UAAU;AAAA,MAC5C;AAEA,UAAI,QAAQ;AACX,eAAO,OAAO,cAAc,MAAM,EAAE,QAAQ,EAAE;AAAA,MAC/C;AAAA,IACD;AAEA,iBAAa;AAEb,WAAO,GAAG,mBAAmB,YAAY;AACzC,WAAO,GAAG,eAAe,YAAY;AAErC,WAAO,MAAM;AACZ,aAAO,IAAI,mBAAmB,YAAY;AAC1C,aAAO,IAAI,eAAe,YAAY;AAAA,IACvC;AAAA,EACD,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,cAAU,0BAAY,MAAM;AACjC,QAAI,CAAC,OAAQ;AAEb,QAAI,CAAC,KAAK;AACT,aAAO,MAAM,EAAE,MAAM,EAAE,gBAAgB,MAAM,EAAE,UAAU,EAAE,IAAI;AAE/D;AAAA,IACD;AAEA,WAAO,MAAM,EAAE,MAAM,EAAE,gBAAgB,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,IAAI;AAAA,EAC3E,GAAG,CAAC,QAAQ,GAAG,CAAC;AAEhB,QAAM,iBAAa,0BAAY,MAAM;AACpC,QAAI,CAAC,OAAQ;AAEb,WAAO,MAAM,EAAE,MAAM,EAAE,gBAAgB,MAAM,EAAE,UAAU,EAAE,IAAI;AAC/D,WAAO,EAAE;AAAA,EACV,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,eAAW,0BAAY,MAAM;AAClC,QAAI,CAAC,IAAK;AAEV,UAAM,YAAY,gBAAgB,KAAK,GAAG,IAAI,MAAM,WAAW,GAAG;AAElE,WAAO,KAAK,WAAW,UAAU,qBAAqB;AAAA,EACvD,GAAG,CAAC,GAAG,CAAC;AAER,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
@@ -3,12 +3,18 @@ function useLinkPopover({ editor }) {
|
|
|
3
3
|
const [url, setUrl] = useState("");
|
|
4
4
|
const [isActive, setIsActive] = useState(false);
|
|
5
5
|
const [canSet, setCanSet] = useState(false);
|
|
6
|
+
const [wasSelectionMove, setWasSelectionMove] = useState(false);
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
if (!editor) return;
|
|
8
|
-
const handleUpdate = (
|
|
9
|
+
const handleUpdate = ({
|
|
10
|
+
transaction
|
|
11
|
+
} = {}) => {
|
|
9
12
|
const active = editor.isActive("link");
|
|
10
13
|
setIsActive(active);
|
|
11
14
|
setCanSet(editor.isEditable);
|
|
15
|
+
if (transaction) {
|
|
16
|
+
setWasSelectionMove(!transaction.docChanged);
|
|
17
|
+
}
|
|
12
18
|
if (active) {
|
|
13
19
|
setUrl(editor.getAttributes("link").href ?? "");
|
|
14
20
|
}
|
|
@@ -39,7 +45,16 @@ function useLinkPopover({ editor }) {
|
|
|
39
45
|
const sanitized = /^https?:\/\//i.test(url) ? url : `https://${url}`;
|
|
40
46
|
window.open(sanitized, "_blank", "noopener,noreferrer");
|
|
41
47
|
}, [url]);
|
|
42
|
-
return {
|
|
48
|
+
return {
|
|
49
|
+
url,
|
|
50
|
+
setUrl,
|
|
51
|
+
isActive,
|
|
52
|
+
canSet,
|
|
53
|
+
setLink,
|
|
54
|
+
removeLink,
|
|
55
|
+
openLink,
|
|
56
|
+
wasSelectionMove
|
|
57
|
+
};
|
|
43
58
|
}
|
|
44
59
|
export {
|
|
45
60
|
useLinkPopover
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/link-popover/use-link-popover.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface UseLinkPopoverConfig {\n\teditor: Editor | null;\n}\n\nexport function useLinkPopover({ editor }: UseLinkPopoverConfig) {\n\tconst [url, setUrl] = useState('');\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canSet, setCanSet] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst active = editor.isActive('link');\n\n\t\t\tsetIsActive(active);\n\t\t\tsetCanSet(editor.isEditable);\n\n\t\t\tif (active) {\n\t\t\t\tsetUrl(editor.getAttributes('link').href ?? '');\n\t\t\t}\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor]);\n\n\tconst setLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (!url) {\n\t\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\n\t\t\treturn;\n\t\t}\n\n\t\teditor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n\t}, [editor, url]);\n\n\tconst removeLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\tsetUrl('');\n\t}, [editor]);\n\n\tconst openLink = useCallback(() => {\n\t\tif (!url) return;\n\n\t\tconst sanitized = /^https?:\\/\\//i.test(url) ? url : `https://${url}`;\n\n\t\twindow.open(sanitized, '_blank', 'noopener,noreferrer');\n\t}, [url]);\n\n\treturn {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/link-popover/use-link-popover.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\nimport type { Transaction } from '@tiptap/pm/state';\n\nexport interface UseLinkPopoverConfig {\n\teditor: Editor | null;\n}\n\nexport function useLinkPopover({ editor }: UseLinkPopoverConfig) {\n\tconst [url, setUrl] = useState('');\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canSet, setCanSet] = useState(false);\n\tconst [wasSelectionMove, setWasSelectionMove] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = ({\n\t\t\ttransaction\n\t\t}: { transaction?: Transaction } = {}) => {\n\t\t\tconst active = editor.isActive('link');\n\n\t\t\tsetIsActive(active);\n\t\t\tsetCanSet(editor.isEditable);\n\n\t\t\tif (transaction) {\n\t\t\t\tsetWasSelectionMove(!transaction.docChanged);\n\t\t\t}\n\n\t\t\tif (active) {\n\t\t\t\tsetUrl(editor.getAttributes('link').href ?? '');\n\t\t\t}\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor]);\n\n\tconst setLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (!url) {\n\t\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\n\t\t\treturn;\n\t\t}\n\n\t\teditor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n\t}, [editor, url]);\n\n\tconst removeLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\tsetUrl('');\n\t}, [editor]);\n\n\tconst openLink = useCallback(() => {\n\t\tif (!url) return;\n\n\t\tconst sanitized = /^https?:\\/\\//i.test(url) ? url : `https://${url}`;\n\n\t\twindow.open(sanitized, '_blank', 'noopener,noreferrer');\n\t}, [url]);\n\n\treturn {\n\t\turl,\n\t\tsetUrl,\n\t\tisActive,\n\t\tcanSet,\n\t\tsetLink,\n\t\tremoveLink,\n\t\topenLink,\n\t\twasSelectionMove\n\t};\n}\n"],"mappings":"AAAA,SAAS,aAAa,WAAW,gBAAgB;AAS1C,SAAS,eAAe,EAAE,OAAO,GAAyB;AAChE,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,EAAE;AACjC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,KAAK;AAE9D,YAAU,MAAM;AACf,QAAI,CAAC,OAAQ;AAEb,UAAM,eAAe,CAAC;AAAA,MACrB;AAAA,IACD,IAAmC,CAAC,MAAM;AACzC,YAAM,SAAS,OAAO,SAAS,MAAM;AAErC,kBAAY,MAAM;AAClB,gBAAU,OAAO,UAAU;AAE3B,UAAI,aAAa;AAChB,4BAAoB,CAAC,YAAY,UAAU;AAAA,MAC5C;AAEA,UAAI,QAAQ;AACX,eAAO,OAAO,cAAc,MAAM,EAAE,QAAQ,EAAE;AAAA,MAC/C;AAAA,IACD;AAEA,iBAAa;AAEb,WAAO,GAAG,mBAAmB,YAAY;AACzC,WAAO,GAAG,eAAe,YAAY;AAErC,WAAO,MAAM;AACZ,aAAO,IAAI,mBAAmB,YAAY;AAC1C,aAAO,IAAI,eAAe,YAAY;AAAA,IACvC;AAAA,EACD,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,UAAU,YAAY,MAAM;AACjC,QAAI,CAAC,OAAQ;AAEb,QAAI,CAAC,KAAK;AACT,aAAO,MAAM,EAAE,MAAM,EAAE,gBAAgB,MAAM,EAAE,UAAU,EAAE,IAAI;AAE/D;AAAA,IACD;AAEA,WAAO,MAAM,EAAE,MAAM,EAAE,gBAAgB,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,EAAE,IAAI;AAAA,EAC3E,GAAG,CAAC,QAAQ,GAAG,CAAC;AAEhB,QAAM,aAAa,YAAY,MAAM;AACpC,QAAI,CAAC,OAAQ;AAEb,WAAO,MAAM,EAAE,MAAM,EAAE,gBAAgB,MAAM,EAAE,UAAU,EAAE,IAAI;AAC/D,WAAO,EAAE;AAAA,EACV,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,WAAW,YAAY,MAAM;AAClC,QAAI,CAAC,IAAK;AAEV,UAAM,YAAY,gBAAgB,KAAK,GAAG,IAAI,MAAM,WAAW,GAAG;AAElE,WAAO,KAAK,WAAW,UAAU,qBAAqB;AAAA,EACvD,GAAG,CAAC,GAAG,CAAC;AAER,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
@@ -31,6 +31,7 @@ __export(editor_exports, {
|
|
|
31
31
|
editorExtensions: () => editorExtensions
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(editor_exports);
|
|
34
|
+
var import_extension_image = __toESM(require("@tiptap/extension-image"), 1);
|
|
34
35
|
var import_extension_list = require("@tiptap/extension-list");
|
|
35
36
|
var import_starter_kit = __toESM(require("@tiptap/starter-kit"), 1);
|
|
36
37
|
var import_tiptap_markdown = require("tiptap-markdown");
|
|
@@ -40,6 +41,7 @@ const editorExtensions = [
|
|
|
40
41
|
import_starter_kit.default.configure({ ...import_shared.starterKitBaseConfig, codeBlock: false }),
|
|
41
42
|
import_extension_list.ListKit,
|
|
42
43
|
import_code_block.CodeBlockExtension,
|
|
44
|
+
import_extension_image.default,
|
|
43
45
|
import_tiptap_markdown.Markdown.configure({
|
|
44
46
|
html: false,
|
|
45
47
|
transformPastedText: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/editor.ts"],"sourcesContent":["import { ListKit } from '@tiptap/extension-list';\nimport StarterKit from '@tiptap/starter-kit';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { CodeBlockExtension } from './code-block';\nimport { starterKitBaseConfig } from './shared';\n\n// Editor extensions = shared content model + interactive features + Markdown\n// codeBlock is disabled in StarterKit and replaced with the custom\n// CodeBlockExtension that mounts a NodeView (CodeBlockView).\nexport const editorExtensions = [\n\tStarterKit.configure({ ...starterKitBaseConfig, codeBlock: false }),\n\tListKit,\n\tCodeBlockExtension,\n\tMarkdown.configure({\n\t\thtml: false,\n\t\ttransformPastedText: true,\n\t\ttransformCopiedText: true\n\t})\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAwB;AACxB,yBAAuB;AACvB,6BAAyB;AAEzB,wBAAmC;AACnC,oBAAqC;AAK9B,MAAM,mBAAmB;AAAA,EAC/B,mBAAAA,QAAW,UAAU,EAAE,GAAG,oCAAsB,WAAW,MAAM,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA,gCAAS,UAAU;AAAA,IAClB,MAAM;AAAA,IACN,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,EACtB,CAAC;AACF;","names":["StarterKit"]}
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/editor.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit from '@tiptap/starter-kit';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { CodeBlockExtension } from './code-block';\nimport { starterKitBaseConfig } from './shared';\n\n// Editor extensions = shared content model + interactive features + Markdown\n// codeBlock is disabled in StarterKit and replaced with the custom\n// CodeBlockExtension that mounts a NodeView (CodeBlockView).\nexport const editorExtensions = [\n\tStarterKit.configure({ ...starterKitBaseConfig, codeBlock: false }),\n\tListKit,\n\tCodeBlockExtension,\n\tImage,\n\tMarkdown.configure({\n\t\thtml: false,\n\t\ttransformPastedText: true,\n\t\ttransformCopiedText: true\n\t})\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAkB;AAClB,4BAAwB;AACxB,yBAAuB;AACvB,6BAAyB;AAEzB,wBAAmC;AACnC,oBAAqC;AAK9B,MAAM,mBAAmB;AAAA,EAC/B,mBAAAA,QAAW,UAAU,EAAE,GAAG,oCAAsB,WAAW,MAAM,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA,uBAAAC;AAAA,EACA,gCAAS,UAAU;AAAA,IAClB,MAAM;AAAA,IACN,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,EACtB,CAAC;AACF;","names":["StarterKit","Image"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as tiptap_markdown from 'tiptap-markdown';
|
|
2
2
|
import * as _tiptap_extension_code_block from '@tiptap/extension-code-block';
|
|
3
|
+
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
3
4
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
4
5
|
import * as _tiptap_core from '@tiptap/core';
|
|
5
6
|
import * as _tiptap_starter_kit from '@tiptap/starter-kit';
|
|
6
7
|
|
|
7
|
-
declare const editorExtensions: (_tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_code_block.CodeBlockOptions, any> | _tiptap_core.Extension<tiptap_markdown.MarkdownOptions, tiptap_markdown.MarkdownStorage>)[];
|
|
8
|
+
declare const editorExtensions: (_tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any> | _tiptap_core.Node<_tiptap_extension_code_block.CodeBlockOptions, any> | _tiptap_core.Extension<tiptap_markdown.MarkdownOptions, tiptap_markdown.MarkdownStorage>)[];
|
|
8
9
|
|
|
9
10
|
export { editorExtensions };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as tiptap_markdown from 'tiptap-markdown';
|
|
2
2
|
import * as _tiptap_extension_code_block from '@tiptap/extension-code-block';
|
|
3
|
+
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
3
4
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
4
5
|
import * as _tiptap_core from '@tiptap/core';
|
|
5
6
|
import * as _tiptap_starter_kit from '@tiptap/starter-kit';
|
|
6
7
|
|
|
7
|
-
declare const editorExtensions: (_tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_code_block.CodeBlockOptions, any> | _tiptap_core.Extension<tiptap_markdown.MarkdownOptions, tiptap_markdown.MarkdownStorage>)[];
|
|
8
|
+
declare const editorExtensions: (_tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any> | _tiptap_core.Node<_tiptap_extension_code_block.CodeBlockOptions, any> | _tiptap_core.Extension<tiptap_markdown.MarkdownOptions, tiptap_markdown.MarkdownStorage>)[];
|
|
8
9
|
|
|
9
10
|
export { editorExtensions };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Image from "@tiptap/extension-image";
|
|
1
2
|
import { ListKit } from "@tiptap/extension-list";
|
|
2
3
|
import StarterKit from "@tiptap/starter-kit";
|
|
3
4
|
import { Markdown } from "tiptap-markdown";
|
|
@@ -7,6 +8,7 @@ const editorExtensions = [
|
|
|
7
8
|
StarterKit.configure({ ...starterKitBaseConfig, codeBlock: false }),
|
|
8
9
|
ListKit,
|
|
9
10
|
CodeBlockExtension,
|
|
11
|
+
Image,
|
|
10
12
|
Markdown.configure({
|
|
11
13
|
html: false,
|
|
12
14
|
transformPastedText: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/editor.ts"],"sourcesContent":["import { ListKit } from '@tiptap/extension-list';\nimport StarterKit from '@tiptap/starter-kit';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { CodeBlockExtension } from './code-block';\nimport { starterKitBaseConfig } from './shared';\n\n// Editor extensions = shared content model + interactive features + Markdown\n// codeBlock is disabled in StarterKit and replaced with the custom\n// CodeBlockExtension that mounts a NodeView (CodeBlockView).\nexport const editorExtensions = [\n\tStarterKit.configure({ ...starterKitBaseConfig, codeBlock: false }),\n\tListKit,\n\tCodeBlockExtension,\n\tMarkdown.configure({\n\t\thtml: false,\n\t\ttransformPastedText: true,\n\t\ttransformCopiedText: true\n\t})\n];\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAEzB,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AAK9B,MAAM,mBAAmB;AAAA,EAC/B,WAAW,UAAU,EAAE,GAAG,sBAAsB,WAAW,MAAM,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA,SAAS,UAAU;AAAA,IAClB,MAAM;AAAA,IACN,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,EACtB,CAAC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/editor.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit from '@tiptap/starter-kit';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { CodeBlockExtension } from './code-block';\nimport { starterKitBaseConfig } from './shared';\n\n// Editor extensions = shared content model + interactive features + Markdown\n// codeBlock is disabled in StarterKit and replaced with the custom\n// CodeBlockExtension that mounts a NodeView (CodeBlockView).\nexport const editorExtensions = [\n\tStarterKit.configure({ ...starterKitBaseConfig, codeBlock: false }),\n\tListKit,\n\tCodeBlockExtension,\n\tImage,\n\tMarkdown.configure({\n\t\thtml: false,\n\t\ttransformPastedText: true,\n\t\ttransformCopiedText: true\n\t})\n];\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAEzB,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AAK9B,MAAM,mBAAmB;AAAA,EAC/B,WAAW,UAAU,EAAE,GAAG,sBAAsB,WAAW,MAAM,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,UAAU;AAAA,IAClB,MAAM;AAAA,IACN,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,EACtB,CAAC;AACF;","names":[]}
|
|
@@ -32,6 +32,7 @@ __export(shared_exports, {
|
|
|
32
32
|
starterKitBaseConfig: () => starterKitBaseConfig
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(shared_exports);
|
|
35
|
+
var import_extension_image = __toESM(require("@tiptap/extension-image"), 1);
|
|
35
36
|
var import_extension_list = require("@tiptap/extension-list");
|
|
36
37
|
var import_starter_kit = __toESM(require("@tiptap/starter-kit"), 1);
|
|
37
38
|
const starterKitBaseConfig = {
|
|
@@ -54,7 +55,8 @@ const sharedExtensions = [
|
|
|
54
55
|
undoRedo: false,
|
|
55
56
|
trailingNode: false
|
|
56
57
|
}),
|
|
57
|
-
import_extension_list.ListKit
|
|
58
|
+
import_extension_list.ListKit,
|
|
59
|
+
import_extension_image.default
|
|
58
60
|
];
|
|
59
61
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
62
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAwB;AACxB,yBAAmD;AAG5C,MAAM,uBAAmD;AAAA,EAC/D,SAAS,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,EACtC,MAAM;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA;AAAA,EAEA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACb;AAIO,MAAM,mBAAmB;AAAA,EAC/B,mBAAAA,QAAW,UAAU;AAAA,IACpB,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,EACf,CAAC;AAAA,EACD;AACD;","names":["StarterKit"]}
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit,\n\tImage\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAkB;AAClB,4BAAwB;AACxB,yBAAmD;AAG5C,MAAM,uBAAmD;AAAA,EAC/D,SAAS,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,EACtC,MAAM;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA;AAAA,EAEA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACb;AAIO,MAAM,mBAAmB;AAAA,EAC/B,mBAAAA,QAAW,UAAU;AAAA,IACpB,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,EACf,CAAC;AAAA,EACD;AAAA,EACA,uBAAAC;AACD;","names":["StarterKit","Image"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
1
2
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
2
3
|
import * as _tiptap_core from '@tiptap/core';
|
|
3
4
|
import { StarterKitOptions } from '@tiptap/starter-kit';
|
|
4
5
|
|
|
5
6
|
declare const starterKitBaseConfig: Partial<StarterKitOptions>;
|
|
6
|
-
declare const sharedExtensions: (_tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any>)[];
|
|
7
|
+
declare const sharedExtensions: (_tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
|
|
7
8
|
|
|
8
9
|
export { sharedExtensions, starterKitBaseConfig };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
1
2
|
import * as _tiptap_extension_list from '@tiptap/extension-list';
|
|
2
3
|
import * as _tiptap_core from '@tiptap/core';
|
|
3
4
|
import { StarterKitOptions } from '@tiptap/starter-kit';
|
|
4
5
|
|
|
5
6
|
declare const starterKitBaseConfig: Partial<StarterKitOptions>;
|
|
6
|
-
declare const sharedExtensions: (_tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any>)[];
|
|
7
|
+
declare const sharedExtensions: (_tiptap_core.Extension<StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_list.ListKitOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
|
|
7
8
|
|
|
8
9
|
export { sharedExtensions, starterKitBaseConfig };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Image from "@tiptap/extension-image";
|
|
1
2
|
import { ListKit } from "@tiptap/extension-list";
|
|
2
3
|
import StarterKit from "@tiptap/starter-kit";
|
|
3
4
|
const starterKitBaseConfig = {
|
|
@@ -20,7 +21,8 @@ const sharedExtensions = [
|
|
|
20
21
|
undoRedo: false,
|
|
21
22
|
trailingNode: false
|
|
22
23
|
}),
|
|
23
|
-
ListKit
|
|
24
|
+
ListKit,
|
|
25
|
+
Image
|
|
24
26
|
];
|
|
25
27
|
export {
|
|
26
28
|
sharedExtensions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit\n];\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,OAAO,gBAA4C;AAG5C,MAAM,uBAAmD;AAAA,EAC/D,SAAS,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,EACtC,MAAM;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA;AAAA,EAEA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACb;AAIO,MAAM,mBAAmB;AAAA,EAC/B,WAAW,UAAU;AAAA,IACpB,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,EACf,CAAC;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/extensions/shared.ts"],"sourcesContent":["import Image from '@tiptap/extension-image';\nimport { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit,\n\tImage\n];\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,OAAO,gBAA4C;AAG5C,MAAM,uBAAmD;AAAA,EAC/D,SAAS,EAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,EACtC,MAAM;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA;AAAA,EAEA,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACb;AAIO,MAAM,mBAAmB;AAAA,EAC/B,WAAW,UAAU;AAAA,IACpB,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,EACf,CAAC;AAAA,EACD;AAAA,EACA;AACD;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ __export(index_exports, {
|
|
|
21
21
|
BlockquoteButton: () => import_blockquote_button.BlockquoteButton,
|
|
22
22
|
CodeBlockButton: () => import_code_block_button.CodeBlockButton,
|
|
23
23
|
HeadingDropdownMenu: () => import_heading_dropdown_menu.HeadingDropdownMenu,
|
|
24
|
+
ImagePopover: () => import_image_popover.ImagePopover,
|
|
24
25
|
LinkPopover: () => import_link_popover.LinkPopover,
|
|
25
26
|
ListDropdownMenu: () => import_list_dropdown_menu.ListDropdownMenu,
|
|
26
27
|
MarkButton: () => import_mark_button.MarkButton,
|
|
@@ -45,11 +46,13 @@ var import_list_dropdown_menu = require("./components/list-dropdown-menu/list-dr
|
|
|
45
46
|
var import_blockquote_button = require("./components/blockquote-button/blockquote-button");
|
|
46
47
|
var import_code_block_button = require("./components/code-block-button/code-block-button");
|
|
47
48
|
var import_link_popover = require("./components/link-popover/link-popover");
|
|
49
|
+
var import_image_popover = require("./components/image-popover/image-popover");
|
|
48
50
|
// Annotate the CommonJS export names for ESM import in node:
|
|
49
51
|
0 && (module.exports = {
|
|
50
52
|
BlockquoteButton,
|
|
51
53
|
CodeBlockButton,
|
|
52
54
|
HeadingDropdownMenu,
|
|
55
|
+
ImagePopover,
|
|
53
56
|
LinkPopover,
|
|
54
57
|
ListDropdownMenu,
|
|
55
58
|
MarkButton,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui/spacer';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAO;AAEP,0BAA4B;AAG5B,0BAA4B;AAG5B,qBAIO;AAMP,8BAA+B;AAG/B,oBAAuB;AAEvB,yBAA2B;AAI3B,mCAAoC;AAGpC,gCAAiC;AAGjC,+BAAiC;AAGjC,+BAAgC;AAGhC,0BAA4B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui/spacer';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n\nexport { ImagePopover } from './components/image-popover/image-popover';\nexport type { ImagePopoverProps } from './components/image-popover/image-popover';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAO;AAEP,0BAA4B;AAG5B,0BAA4B;AAG5B,qBAIO;AAMP,8BAA+B;AAG/B,oBAAuB;AAEvB,yBAA2B;AAI3B,mCAAoC;AAGpC,gCAAiC;AAGjC,+BAAiC;AAGjC,+BAAgC;AAGhC,0BAA4B;AAG5B,2BAA6B;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,7 @@ export { ListDropdownMenu, ListDropdownMenuProps } from './components/list-dropd
|
|
|
10
10
|
export { BlockquoteButton, BlockquoteButtonProps } from './components/blockquote-button/blockquote-button.cjs';
|
|
11
11
|
export { CodeBlockButton, CodeBlockButtonProps } from './components/code-block-button/code-block-button.cjs';
|
|
12
12
|
export { LinkPopover, LinkPopoverProps } from './components/link-popover/link-popover.cjs';
|
|
13
|
+
export { ImagePopover, ImagePopoverProps } from './components/image-popover/image-popover.cjs';
|
|
13
14
|
import 'react/jsx-runtime';
|
|
14
15
|
import 'react';
|
|
15
16
|
import './components/undo-redo-button/use-undo-redo.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { ListDropdownMenu, ListDropdownMenuProps } from './components/list-dropd
|
|
|
10
10
|
export { BlockquoteButton, BlockquoteButtonProps } from './components/blockquote-button/blockquote-button.js';
|
|
11
11
|
export { CodeBlockButton, CodeBlockButtonProps } from './components/code-block-button/code-block-button.js';
|
|
12
12
|
export { LinkPopover, LinkPopoverProps } from './components/link-popover/link-popover.js';
|
|
13
|
+
export { ImagePopover, ImagePopoverProps } from './components/image-popover/image-popover.js';
|
|
13
14
|
import 'react/jsx-runtime';
|
|
14
15
|
import 'react';
|
|
15
16
|
import './components/undo-redo-button/use-undo-redo.js';
|
package/dist/index.mjs
CHANGED
|
@@ -14,10 +14,12 @@ import { ListDropdownMenu } from "./components/list-dropdown-menu/list-dropdown-
|
|
|
14
14
|
import { BlockquoteButton } from "./components/blockquote-button/blockquote-button";
|
|
15
15
|
import { CodeBlockButton } from "./components/code-block-button/code-block-button";
|
|
16
16
|
import { LinkPopover } from "./components/link-popover/link-popover";
|
|
17
|
+
import { ImagePopover } from "./components/image-popover/image-popover";
|
|
17
18
|
export {
|
|
18
19
|
BlockquoteButton,
|
|
19
20
|
CodeBlockButton,
|
|
20
21
|
HeadingDropdownMenu,
|
|
22
|
+
ImagePopover,
|
|
21
23
|
LinkPopover,
|
|
22
24
|
ListDropdownMenu,
|
|
23
25
|
MarkButton,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui/spacer';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,mBAAmB;AAG5B,SAAS,mBAAmB;AAG5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAMP,SAAS,sBAAsB;AAG/B,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAI3B,SAAS,2BAA2B;AAGpC,SAAS,wBAAwB;AAGjC,SAAS,wBAAwB;AAGjC,SAAS,uBAAuB;AAGhC,SAAS,mBAAmB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui/spacer';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n\nexport { ImagePopover } from './components/image-popover/image-popover';\nexport type { ImagePopoverProps } from './components/image-popover/image-popover';\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,mBAAmB;AAG5B,SAAS,mBAAmB;AAG5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAMP,SAAS,sBAAsB;AAG/B,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAI3B,SAAS,2BAA2B;AAGpC,SAAS,wBAAwB;AAGjC,SAAS,wBAAwB;AAGjC,SAAS,uBAAuB;AAGhC,SAAS,mBAAmB;AAG5B,SAAS,oBAAoB;","names":[]}
|
package/dist/notra-editor.cjs
CHANGED
|
@@ -27,6 +27,7 @@ var import_react = require("@tiptap/react");
|
|
|
27
27
|
var import_blockquote_button = require("./components/blockquote-button/blockquote-button");
|
|
28
28
|
var import_code_block_button = require("./components/code-block-button/code-block-button");
|
|
29
29
|
var import_heading_dropdown_menu = require("./components/heading-dropdown-menu/heading-dropdown-menu");
|
|
30
|
+
var import_image_popover = require("./components/image-popover/image-popover");
|
|
30
31
|
var import_link_popover = require("./components/link-popover/link-popover");
|
|
31
32
|
var import_list_dropdown_menu = require("./components/list-dropdown-menu/list-dropdown-menu");
|
|
32
33
|
var import_mark_button = require("./components/mark-button/mark-button");
|
|
@@ -74,7 +75,8 @@ function NotraEditor({
|
|
|
74
75
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mark_button.MarkButton, { editor, type: "italic" }),
|
|
75
76
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mark_button.MarkButton, { editor, type: "strike" }),
|
|
76
77
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mark_button.MarkButton, { editor, type: "code" }),
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link_popover.LinkPopover, { editor })
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link_popover.LinkPopover, { editor }),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image_popover.ImagePopover, { editor })
|
|
78
80
|
] }),
|
|
79
81
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_spacer.Spacer, {})
|
|
80
82
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/notra-editor.tsx"],"sourcesContent":["'use client';\n\nimport { EditorContent } from '@tiptap/react';\n\nimport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nimport { CodeBlockButton } from './components/code-block-button/code-block-button';\nimport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nimport { LinkPopover } from './components/link-popover/link-popover';\nimport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nimport { MarkButton } from './components/mark-button/mark-button';\nimport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nimport { Spacer } from './components/ui/spacer';\nimport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nimport { useMarkdownEditor } from './hooks/use-markdown-editor';\n\nexport interface NotraEditorProps {\n\t/** Markdown content (source of truth) */\n\tvalue: string;\n\t/** Called when content changes, receives updated Markdown */\n\tonChange: (value: string) => void;\n\t/** Placeholder text shown when editor is empty */\n\tplaceholder?: string;\n\t/** Disable editing */\n\treadOnly?: boolean;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraEditor({\n\tvalue,\n\tonChange,\n\tplaceholder,\n\treadOnly = false,\n\tclassName\n}: NotraEditorProps) {\n\tconst { editor } = useMarkdownEditor({\n\t\tvalue,\n\t\tonChange,\n\t\tplaceholder,\n\t\teditable: !readOnly\n\t});\n\n\tconst classNames = ['notra', 'notra-editor', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames}>\n\t\t\t<Toolbar variant=\"fixed\">\n\t\t\t\t<Spacer />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<UndoRedoButton action=\"undo\" editor={editor} />\n\t\t\t\t\t<UndoRedoButton action=\"redo\" editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<HeadingDropdownMenu editor={editor} levels={[1, 2, 3, 4]} />\n\t\t\t\t\t<ListDropdownMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\ttypes={['bulletList', 'orderedList', 'taskList']}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockquoteButton editor={editor} />\n\t\t\t\t\t<CodeBlockButton editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<MarkButton editor={editor} type=\"bold\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"italic\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"strike\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"code\" />\n\t\t\t\t\t<LinkPopover editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<Spacer />\n\t\t\t</Toolbar>\n\t\t\t<EditorContent className=\"notra-editor-content\" editor={editor} />\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../src/notra-editor.tsx"],"sourcesContent":["'use client';\n\nimport { EditorContent } from '@tiptap/react';\n\nimport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nimport { CodeBlockButton } from './components/code-block-button/code-block-button';\nimport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nimport { ImagePopover } from './components/image-popover/image-popover';\nimport { LinkPopover } from './components/link-popover/link-popover';\nimport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nimport { MarkButton } from './components/mark-button/mark-button';\nimport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nimport { Spacer } from './components/ui/spacer';\nimport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nimport { useMarkdownEditor } from './hooks/use-markdown-editor';\n\nexport interface NotraEditorProps {\n\t/** Markdown content (source of truth) */\n\tvalue: string;\n\t/** Called when content changes, receives updated Markdown */\n\tonChange: (value: string) => void;\n\t/** Placeholder text shown when editor is empty */\n\tplaceholder?: string;\n\t/** Disable editing */\n\treadOnly?: boolean;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraEditor({\n\tvalue,\n\tonChange,\n\tplaceholder,\n\treadOnly = false,\n\tclassName\n}: NotraEditorProps) {\n\tconst { editor } = useMarkdownEditor({\n\t\tvalue,\n\t\tonChange,\n\t\tplaceholder,\n\t\teditable: !readOnly\n\t});\n\n\tconst classNames = ['notra', 'notra-editor', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames}>\n\t\t\t<Toolbar variant=\"fixed\">\n\t\t\t\t<Spacer />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<UndoRedoButton action=\"undo\" editor={editor} />\n\t\t\t\t\t<UndoRedoButton action=\"redo\" editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<HeadingDropdownMenu editor={editor} levels={[1, 2, 3, 4]} />\n\t\t\t\t\t<ListDropdownMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\ttypes={['bulletList', 'orderedList', 'taskList']}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockquoteButton editor={editor} />\n\t\t\t\t\t<CodeBlockButton editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<MarkButton editor={editor} type=\"bold\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"italic\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"strike\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"code\" />\n\t\t\t\t\t<LinkPopover editor={editor} />\n\t\t\t\t\t<ImagePopover editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<Spacer />\n\t\t\t</Toolbar>\n\t\t\t<EditorContent className=\"notra-editor-content\" editor={editor} />\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDI;AApDJ,mBAA8B;AAE9B,+BAAiC;AACjC,+BAAgC;AAChC,mCAAoC;AACpC,2BAA6B;AAC7B,0BAA4B;AAC5B,gCAAiC;AACjC,yBAA2B;AAC3B,qBAIO;AACP,oBAAuB;AACvB,8BAA+B;AAC/B,iCAAkC;AAe3B,SAAS,YAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACD,GAAqB;AACpB,QAAM,EAAE,OAAO,QAAI,8CAAkB;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAC;AAAA,EACZ,CAAC;AAED,QAAM,aAAa,CAAC,SAAS,gBAAgB,SAAS,EACpD,OAAO,OAAO,EACd,KAAK,GAAG;AAEV,SACC,6CAAC,SAAI,WAAW,YACf;AAAA,iDAAC,0BAAQ,SAAQ,SAChB;AAAA,kDAAC,wBAAO;AAAA,MACR,6CAAC,+BACA;AAAA,oDAAC,0CAAe,QAAO,QAAO,QAAgB;AAAA,QAC9C,4CAAC,0CAAe,QAAO,QAAO,QAAgB;AAAA,SAC/C;AAAA,MACA,4CAAC,mCAAiB;AAAA,MAClB,6CAAC,+BACA;AAAA,oDAAC,oDAAoB,QAAgB,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG;AAAA,QAC3D;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,OAAO,CAAC,cAAc,eAAe,UAAU;AAAA;AAAA,QAChD;AAAA,QACA,4CAAC,6CAAiB,QAAgB;AAAA,QAClC,4CAAC,4CAAgB,QAAgB;AAAA,SAClC;AAAA,MACA,4CAAC,mCAAiB;AAAA,MAClB,6CAAC,+BACA;AAAA,oDAAC,iCAAW,QAAgB,MAAK,QAAO;AAAA,QACxC,4CAAC,iCAAW,QAAgB,MAAK,UAAS;AAAA,QAC1C,4CAAC,iCAAW,QAAgB,MAAK,UAAS;AAAA,QAC1C,4CAAC,iCAAW,QAAgB,MAAK,QAAO;AAAA,QACxC,4CAAC,mCAAY,QAAgB;AAAA,QAC7B,4CAAC,qCAAa,QAAgB;AAAA,SAC/B;AAAA,MACA,4CAAC,wBAAO;AAAA,OACT;AAAA,IACA,4CAAC,8BAAc,WAAU,wBAAuB,QAAgB;AAAA,KACjE;AAEF;","names":[]}
|
package/dist/notra-editor.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { EditorContent } from "@tiptap/react";
|
|
|
4
4
|
import { BlockquoteButton } from "./components/blockquote-button/blockquote-button";
|
|
5
5
|
import { CodeBlockButton } from "./components/code-block-button/code-block-button";
|
|
6
6
|
import { HeadingDropdownMenu } from "./components/heading-dropdown-menu/heading-dropdown-menu";
|
|
7
|
+
import { ImagePopover } from "./components/image-popover/image-popover";
|
|
7
8
|
import { LinkPopover } from "./components/link-popover/link-popover";
|
|
8
9
|
import { ListDropdownMenu } from "./components/list-dropdown-menu/list-dropdown-menu";
|
|
9
10
|
import { MarkButton } from "./components/mark-button/mark-button";
|
|
@@ -55,7 +56,8 @@ function NotraEditor({
|
|
|
55
56
|
/* @__PURE__ */ jsx(MarkButton, { editor, type: "italic" }),
|
|
56
57
|
/* @__PURE__ */ jsx(MarkButton, { editor, type: "strike" }),
|
|
57
58
|
/* @__PURE__ */ jsx(MarkButton, { editor, type: "code" }),
|
|
58
|
-
/* @__PURE__ */ jsx(LinkPopover, { editor })
|
|
59
|
+
/* @__PURE__ */ jsx(LinkPopover, { editor }),
|
|
60
|
+
/* @__PURE__ */ jsx(ImagePopover, { editor })
|
|
59
61
|
] }),
|
|
60
62
|
/* @__PURE__ */ jsx(Spacer, {})
|
|
61
63
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/notra-editor.tsx"],"sourcesContent":["'use client';\n\nimport { EditorContent } from '@tiptap/react';\n\nimport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nimport { CodeBlockButton } from './components/code-block-button/code-block-button';\nimport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nimport { LinkPopover } from './components/link-popover/link-popover';\nimport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nimport { MarkButton } from './components/mark-button/mark-button';\nimport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nimport { Spacer } from './components/ui/spacer';\nimport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nimport { useMarkdownEditor } from './hooks/use-markdown-editor';\n\nexport interface NotraEditorProps {\n\t/** Markdown content (source of truth) */\n\tvalue: string;\n\t/** Called when content changes, receives updated Markdown */\n\tonChange: (value: string) => void;\n\t/** Placeholder text shown when editor is empty */\n\tplaceholder?: string;\n\t/** Disable editing */\n\treadOnly?: boolean;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraEditor({\n\tvalue,\n\tonChange,\n\tplaceholder,\n\treadOnly = false,\n\tclassName\n}: NotraEditorProps) {\n\tconst { editor } = useMarkdownEditor({\n\t\tvalue,\n\t\tonChange,\n\t\tplaceholder,\n\t\teditable: !readOnly\n\t});\n\n\tconst classNames = ['notra', 'notra-editor', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames}>\n\t\t\t<Toolbar variant=\"fixed\">\n\t\t\t\t<Spacer />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<UndoRedoButton action=\"undo\" editor={editor} />\n\t\t\t\t\t<UndoRedoButton action=\"redo\" editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<HeadingDropdownMenu editor={editor} levels={[1, 2, 3, 4]} />\n\t\t\t\t\t<ListDropdownMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\ttypes={['bulletList', 'orderedList', 'taskList']}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockquoteButton editor={editor} />\n\t\t\t\t\t<CodeBlockButton editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<MarkButton editor={editor} type=\"bold\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"italic\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"strike\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"code\" />\n\t\t\t\t\t<LinkPopover editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<Spacer />\n\t\t\t</Toolbar>\n\t\t\t<EditorContent className=\"notra-editor-content\" editor={editor} />\n\t\t</div>\n\t);\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/notra-editor.tsx"],"sourcesContent":["'use client';\n\nimport { EditorContent } from '@tiptap/react';\n\nimport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nimport { CodeBlockButton } from './components/code-block-button/code-block-button';\nimport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nimport { ImagePopover } from './components/image-popover/image-popover';\nimport { LinkPopover } from './components/link-popover/link-popover';\nimport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nimport { MarkButton } from './components/mark-button/mark-button';\nimport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nimport { Spacer } from './components/ui/spacer';\nimport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nimport { useMarkdownEditor } from './hooks/use-markdown-editor';\n\nexport interface NotraEditorProps {\n\t/** Markdown content (source of truth) */\n\tvalue: string;\n\t/** Called when content changes, receives updated Markdown */\n\tonChange: (value: string) => void;\n\t/** Placeholder text shown when editor is empty */\n\tplaceholder?: string;\n\t/** Disable editing */\n\treadOnly?: boolean;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraEditor({\n\tvalue,\n\tonChange,\n\tplaceholder,\n\treadOnly = false,\n\tclassName\n}: NotraEditorProps) {\n\tconst { editor } = useMarkdownEditor({\n\t\tvalue,\n\t\tonChange,\n\t\tplaceholder,\n\t\teditable: !readOnly\n\t});\n\n\tconst classNames = ['notra', 'notra-editor', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames}>\n\t\t\t<Toolbar variant=\"fixed\">\n\t\t\t\t<Spacer />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<UndoRedoButton action=\"undo\" editor={editor} />\n\t\t\t\t\t<UndoRedoButton action=\"redo\" editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<HeadingDropdownMenu editor={editor} levels={[1, 2, 3, 4]} />\n\t\t\t\t\t<ListDropdownMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\ttypes={['bulletList', 'orderedList', 'taskList']}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockquoteButton editor={editor} />\n\t\t\t\t\t<CodeBlockButton editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<MarkButton editor={editor} type=\"bold\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"italic\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"strike\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"code\" />\n\t\t\t\t\t<LinkPopover editor={editor} />\n\t\t\t\t\t<ImagePopover editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<Spacer />\n\t\t\t</Toolbar>\n\t\t\t<EditorContent className=\"notra-editor-content\" editor={editor} />\n\t\t</div>\n\t);\n}\n"],"mappings":";AAsDI,cACA,YADA;AApDJ,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAe3B,SAAS,YAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACD,GAAqB;AACpB,QAAM,EAAE,OAAO,IAAI,kBAAkB;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAC;AAAA,EACZ,CAAC;AAED,QAAM,aAAa,CAAC,SAAS,gBAAgB,SAAS,EACpD,OAAO,OAAO,EACd,KAAK,GAAG;AAEV,SACC,qBAAC,SAAI,WAAW,YACf;AAAA,yBAAC,WAAQ,SAAQ,SAChB;AAAA,0BAAC,UAAO;AAAA,MACR,qBAAC,gBACA;AAAA,4BAAC,kBAAe,QAAO,QAAO,QAAgB;AAAA,QAC9C,oBAAC,kBAAe,QAAO,QAAO,QAAgB;AAAA,SAC/C;AAAA,MACA,oBAAC,oBAAiB;AAAA,MAClB,qBAAC,gBACA;AAAA,4BAAC,uBAAoB,QAAgB,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG;AAAA,QAC3D;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,OAAO,CAAC,cAAc,eAAe,UAAU;AAAA;AAAA,QAChD;AAAA,QACA,oBAAC,oBAAiB,QAAgB;AAAA,QAClC,oBAAC,mBAAgB,QAAgB;AAAA,SAClC;AAAA,MACA,oBAAC,oBAAiB;AAAA,MAClB,qBAAC,gBACA;AAAA,4BAAC,cAAW,QAAgB,MAAK,QAAO;AAAA,QACxC,oBAAC,cAAW,QAAgB,MAAK,UAAS;AAAA,QAC1C,oBAAC,cAAW,QAAgB,MAAK,UAAS;AAAA,QAC1C,oBAAC,cAAW,QAAgB,MAAK,QAAO;AAAA,QACxC,oBAAC,eAAY,QAAgB;AAAA,QAC7B,oBAAC,gBAAa,QAAgB;AAAA,SAC/B;AAAA,MACA,oBAAC,UAAO;AAAA,OACT;AAAA,IACA,oBAAC,iBAAc,WAAU,wBAAuB,QAAgB;AAAA,KACjE;AAEF;","names":[]}
|
package/dist/styles/globals.css
CHANGED
|
@@ -417,6 +417,24 @@
|
|
|
417
417
|
text-decoration: underline;
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
/* =====================
|
|
421
|
+
Images
|
|
422
|
+
===================== */
|
|
423
|
+
.notra .tiptap img,
|
|
424
|
+
.notra-reader img {
|
|
425
|
+
max-width: 100%;
|
|
426
|
+
height: auto;
|
|
427
|
+
display: block;
|
|
428
|
+
margin: 1.5em 0;
|
|
429
|
+
border-radius: var(--notra-radius);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* Selected image (NodeSelection) — only relevant in the editor */
|
|
433
|
+
.notra .tiptap img.ProseMirror-selectednode {
|
|
434
|
+
outline: 2px solid var(--tt-brand-color-500);
|
|
435
|
+
outline-offset: 2px;
|
|
436
|
+
}
|
|
437
|
+
|
|
420
438
|
/* =====================
|
|
421
439
|
Inline Text Decoration
|
|
422
440
|
===================== */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notra-editor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"description": "A Markdown-first rich text editor for React",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@radix-ui/react-slot": "^1.2.4",
|
|
43
43
|
"@tiptap/core": "^3.22.4",
|
|
44
44
|
"@tiptap/extension-code-block": "^3.22.4",
|
|
45
|
+
"@tiptap/extension-image": "^3.22.4",
|
|
45
46
|
"@tiptap/extension-link": "^3.22.4",
|
|
46
47
|
"@tiptap/extension-list": "^3.22.4",
|
|
47
48
|
"@tiptap/pm": "^3.22.4",
|