@plexui/vue 0.40.0 → 0.41.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.
@@ -5,10 +5,12 @@ import { keepMovedFocus } from "../../lib/helpers.js";
5
5
  import { markdownEditorExtensions, markdownEditorSchema, rehypeEditorSchema, remarkLineBreaks, remarkWithoutHtml, } from "../../lib/markdownEditorSchema.js";
6
6
  import { Bold as BoldIcon, Italic as ItalicIcon, Link as LinkIcon, List as ListIcon, ListNumbers as ListNumbersIcon, } from "../Icon/index.js";
7
7
  import { Tooltip } from "../Tooltip/index.js";
8
- import { Button } from "../Button/index.js";
9
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogBody, DialogFooter } from "../Dialog/index.js";
8
+ import { Button, NavigationButton } from "../Button/index.js";
9
+ import { Dialog, DialogContent, DialogHeader, DialogHeaderAction, DialogTitle, DialogBody, DialogFooter } from "../Dialog/index.js";
10
10
  import { Field } from "../Field/index.js";
11
+ import { FieldGroup } from "../FieldGroup/index.js";
11
12
  import { Input } from "../Input/index.js";
13
+ import { usePhoneLayout } from "../PhoneLayout/index.js";
12
14
  import { flattenSlot } from "../Tooltip/slot.js";
13
15
  import { renderMarkdown } from "../Markdown/pipeline.js";
14
16
  import s from "@plexui/styles/components/MarkdownEditor/MarkdownEditor.module.css";
@@ -45,41 +47,72 @@ const LinkDialog = defineComponent({
45
47
  title.value = initialTitle;
46
48
  }
47
49
  });
50
+ // On a phone the dialog is a sheet of the kit's grouped form: Cancel is the sheet's close button, Save its confirm
51
+ // button in the bar, the fields rows of a card and Remove a destructive row of its own (owner 21.11)
52
+ const phone = usePhoneLayout();
53
+ const fields = ref(null);
54
+ const save = () => { if (!props.disabled)
55
+ props.onSave(url.value, title.value); };
56
+ const onKeydown = (event) => {
57
+ if (event.key === "Enter" && !event.isComposing && event.target instanceof HTMLInputElement) {
58
+ event.preventDefault();
59
+ save();
60
+ }
61
+ };
62
+ const urlInput = () => h(Input, {
63
+ type: "url", inputmode: "url", autocapitalize: "none", autocorrect: "off", spellcheck: false,
64
+ placeholder: phone.value ? "Required" : "Enter URL", value: url.value, disabled: props.disabled,
65
+ "onUpdate:value": (value) => { url.value = value; },
66
+ });
67
+ const titleInput = () => h(Input, {
68
+ placeholder: phone.value ? "Optional" : "Enter link title", value: title.value, disabled: props.disabled,
69
+ "onUpdate:value": (value) => { title.value = value; },
70
+ });
48
71
  return () => h(Dialog, {
49
72
  "open": props.open,
50
73
  "onUpdate:open": (next) => { if (!next)
51
74
  props.onCancel(); },
52
75
  }, { default: () => h(DialogContent, {
53
- width: 450, mobileVariant: "sheet", showClose: false,
76
+ width: 450, mobileVariant: "sheet", surface: "grouped", showClose: phone.value,
77
+ // On a phone the address is what the sheet asks for: it takes the focus, not the close button before it
78
+ onOpenAutoFocus: (event) => {
79
+ if (!phone.value)
80
+ return;
81
+ event.preventDefault();
82
+ fields.value?.querySelector('input[type="url"]')?.focus();
83
+ },
54
84
  onCloseAutoFocus: props.onRestoreFocus,
55
85
  }, { default: () => [
56
- h(DialogHeader, null, { default: () => h(DialogTitle, null, { default: () => "Link" }) }),
57
- h(DialogBody, null, { default: () => h("div", {
58
- class: s.LinkDialogFields,
59
- onKeydown: (event) => {
60
- if (event.key === "Enter" && !event.isComposing && event.target instanceof HTMLInputElement) {
61
- event.preventDefault();
62
- if (!props.disabled)
63
- props.onSave(url.value, title.value);
64
- }
65
- },
66
- }, [
67
- h(Field, { label: "URL" }, { default: () => h(Input, {
68
- type: "url", inputmode: "url", autocapitalize: "none", autocorrect: "off", spellcheck: false,
69
- placeholder: "Enter URL", value: url.value, disabled: props.disabled,
70
- "onUpdate:value": (value) => { url.value = value; },
71
- }) }),
72
- h(Field, { label: "Link title" }, { default: () => h(Input, {
73
- placeholder: "Enter link title", value: title.value, disabled: props.disabled,
74
- "onUpdate:value": (value) => { title.value = value; },
75
- }) }),
76
- ]) }),
77
- h(DialogFooter, null, { default: () => [
86
+ h(DialogHeader, null, { default: () => [
87
+ h(DialogTitle, null, { default: () => "Link" }),
88
+ phone.value
89
+ ? h(DialogHeaderAction, null, { default: () => h(NavigationButton, { action: "confirm", "aria-label": "Save", disabled: props.disabled, onClick: save }) })
90
+ : null,
91
+ ] }),
92
+ h(DialogBody, null, { default: () => phone.value
93
+ // The groups keep the spacing of a grouped form between them
94
+ ? h("div", { ref: fields, onKeydown }, [
95
+ // A long address needs the cell's width: the label stands over the value, as a Textarea's row
96
+ h(FieldGroup, null, { default: () => [
97
+ h(Field, { row: true, orientation: "vertical", label: "URL" }, { default: urlInput }),
98
+ h(Field, { row: true, orientation: "vertical", label: "Title" }, { default: titleInput }),
99
+ ] }),
100
+ props.isEditing
101
+ ? h(FieldGroup, null, { default: () => h("div", { "data-row": "" }, [
102
+ h(Button, { block: true, color: "danger", variant: "ghost", disabled: props.disabled, onClick: () => { if (!props.disabled)
103
+ props.onRemove(); } }, { default: () => "Remove Link" }),
104
+ ]) })
105
+ : null,
106
+ ])
107
+ : h("div", { ref: fields, class: s.LinkDialogFields, onKeydown }, [
108
+ h(Field, { label: "URL" }, { default: urlInput }),
109
+ h(Field, { label: "Link title" }, { default: titleInput }),
110
+ ]) }),
111
+ phone.value ? null : h(DialogFooter, null, { default: () => [
78
112
  props.isEditing ? h(Button, { color: "danger", variant: "soft", disabled: props.disabled, onClick: () => { if (!props.disabled)
79
113
  props.onRemove(); } }, { default: () => "Remove" }) : null,
80
114
  h(Button, { color: "secondary", variant: "soft", onClick: () => props.onCancel() }, { default: () => "Cancel" }),
81
- h(Button, { color: "primary", disabled: props.disabled, onClick: () => { if (!props.disabled)
82
- props.onSave(url.value, title.value); } }, { default: () => "Save" }),
115
+ h(Button, { color: "primary", disabled: props.disabled, onClick: save }, { default: () => "Save" }),
83
116
  ] }),
84
117
  ] }) });
85
118
  },
@@ -174,7 +207,6 @@ const MarkdownEditorComponent = defineComponent({
174
207
  orderedList: false,
175
208
  bulletList: false,
176
209
  });
177
- const linkCanEnable = ref(false);
178
210
  const isControlled = () => props.value !== undefined;
179
211
  let suppressChange = false;
180
212
  let linkSelection = null;
@@ -187,7 +219,6 @@ const MarkdownEditorComponent = defineComponent({
187
219
  orderedList: e.isActive("orderedList"),
188
220
  bulletList: e.isActive("bulletList"),
189
221
  });
190
- linkCanEnable.value = !e.state.selection.empty || e.isActive("link");
191
222
  };
192
223
  const editorAttributes = () => ({
193
224
  "class": s.EditorContent,
@@ -300,6 +331,9 @@ const MarkdownEditorComponent = defineComponent({
300
331
  const chain = instance.chain().setTextSelection({ from: range.from, to: range.to });
301
332
  if (!url)
302
333
  chain.unsetLink().run();
334
+ // With no text selected the link is new text at the caret: its title, or the address itself
335
+ else if (range.from === range.to)
336
+ chain.insertContent(linkText(title || url, url)).run();
303
337
  else if (title && title !== selectedText)
304
338
  chain.insertContent(linkText(title, url)).run();
305
339
  else
@@ -388,7 +422,7 @@ const MarkdownEditorComponent = defineComponent({
388
422
  offered.has("link") && h(ToolbarButton, {
389
423
  tooltip: "Link",
390
424
  active: activeMarks.link,
391
- disabled: disabled || !linkCanEnable.value,
425
+ disabled,
392
426
  icon: LinkIcon,
393
427
  onClick: openLinkDialog,
394
428
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownEditor.js","sourceRoot":"","sources":["../../../../src/components/MarkdownEditor/MarkdownEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,QAAQ,EACR,GAAG,EACH,KAAK,GAGN,MAAM,KAAK,CAAA;AACZ,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,YAAY,EAA6B,MAAM,cAAc,CAAA;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAGlB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EACL,IAAI,IAAI,QAAQ,EAChB,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CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3H,CAAC;KACH,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA","sourcesContent":["import {\n defineComponent,\n h,\n reactive,\n ref,\n watch,\n type Component,\n type PropType,\n} from \"vue\"\nimport { EditorContent, useEditor } from \"@tiptap/vue-3\"\nimport { getMarkRange, type Editor as CoreEditor } from \"@tiptap/core\"\nimport type { Variants } from \"@plexui/styles/types\"\nimport { keepMovedFocus } from \"../../lib/helpers.js\"\nimport {\n markdownEditorExtensions,\n markdownEditorSchema,\n rehypeEditorSchema,\n remarkLineBreaks,\n remarkWithoutHtml,\n type MarkdownEditorFormat,\n type MarkdownEditorSchema,\n} from \"../../lib/markdownEditorSchema.js\"\nimport {\n Bold as BoldIcon,\n Italic as ItalicIcon,\n Link as LinkIcon,\n List as ListIcon,\n ListNumbers as ListNumbersIcon,\n} from \"../Icon/index.js\"\nimport { Tooltip } from \"../Tooltip/index.js\"\nimport { Button } from \"../Button/index.js\"\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogBody, DialogFooter } from \"../Dialog/index.js\"\nimport { Field } from \"../Field/index.js\"\nimport { Input } from \"../Input/index.js\"\nimport { flattenSlot } from \"../Tooltip/slot.js\"\nimport { renderMarkdown } from \"../Markdown/pipeline.js\"\nimport s from \"@plexui/styles/components/MarkdownEditor/MarkdownEditor.module.css\"\n\n// Vue port of packages/ui/src/components/MarkdownEditor/MarkdownEditor.tsx on\n// @tiptap/vue-3 with the same extensions, configured the same way, so\n// ProseMirror renders the same DOM and tiptap-markdown emits the same markdown.\n//\n// - The editor is created on mount (@tiptap/vue-3's `useEditor`, like React's\n// `immediatelyRender: false`) and destroyed on unmount.\n// - Value: `value` + `update:value` (`v-model:value`) and `change` mirror\n// React's `value` + `onChange`; `default-value` is the uncontrolled start.\n// As in React, a controlled value is only pushed into the editor when it\n// changes and differs from the editor's markdown.\n// - As in React, `update:value` / `change` also fire once when the editor is\n// created and whenever `disabled` changes (`setEditable` emits an update).\n// - Options React reads only when it creates the editor (`placeholder`,\n// `formats`, `breaks`, the initial content) are read once here too; `id`, `aria-label`,\n// `aria-labelledby`, `aria-describedby` and `aria-invalid` follow the\n// props, as React re-applies them on render.\n// - `toolbarEnd` is the `#toolbarEnd` slot. Like React, only `class` is\n// applied (to the container); other attributes are not forwarded.\n// - The shared Dialog owns focus trapping and closing. Its portal is not part\n// of the editor's click area, so editing a link preserves its selection.\n\ntype EditorLike = Pick<CoreEditor, \"isActive\" | \"state\">\n\nconst getMarkdown = (editor: CoreEditor) =>\n (editor.storage as unknown as Record<string, { getMarkdown?: () => string }>).markdown?.getMarkdown?.() ?? \"\"\n\n// A link inserted as a text node, not as `<a>` HTML: the markdown parser runs\n// with `html: false`, so HTML would land in the text as written\nconst linkText = (text: string, href: string) => ({\n type: \"text\",\n text,\n marks: [{ type: \"link\", attrs: { href } }],\n})\n\nexport const markdownEditorStyles = {\n toolbarButton: s.ToolbarButton,\n}\n\nexport type { MarkdownEditorFormat }\n\ntype LinkSelection = { from: number; to: number; doc: CoreEditor[\"state\"][\"doc\"] }\n\nconst LinkDialog = defineComponent({\n name: \"MarkdownEditorLinkDialog\",\n props: {\n open: { type: Boolean, required: true },\n initialUrl: { type: String, required: true },\n initialTitle: { type: String, required: true },\n isEditing: { type: Boolean, required: true },\n disabled: { type: Boolean, required: true },\n onSave: { type: Function as PropType<(url: string, title: string) => void>, required: true },\n onRemove: { type: Function as PropType<() => void>, required: true },\n onCancel: { type: Function as PropType<() => void>, required: true },\n onRestoreFocus: { type: Function as PropType<(event: Event) => void>, required: true },\n },\n setup(props) {\n const url = ref(props.initialUrl)\n const title = ref(props.initialTitle)\n watch(() => [props.open, props.initialUrl, props.initialTitle] as const, ([open, initialUrl, initialTitle]) => {\n if (open) { url.value = initialUrl; title.value = initialTitle }\n })\n return () => h(Dialog, {\n \"open\": props.open,\n \"onUpdate:open\": (next: boolean) => { if (!next) props.onCancel() },\n }, { default: () => h(DialogContent, {\n width: 450, mobileVariant: \"sheet\", showClose: false,\n onCloseAutoFocus: props.onRestoreFocus,\n }, { default: () => [\n h(DialogHeader, null, { default: () => h(DialogTitle, null, { default: () => \"Link\" }) }),\n h(DialogBody, null, { default: () => h(\"div\", {\n class: s.LinkDialogFields,\n onKeydown: (event: KeyboardEvent) => {\n if (event.key === \"Enter\" && !event.isComposing && event.target instanceof HTMLInputElement) {\n event.preventDefault()\n if (!props.disabled) props.onSave(url.value, title.value)\n }\n },\n }, [\n h(Field, { label: \"URL\" }, { default: () => h(Input, {\n type: \"url\", inputmode: \"url\", autocapitalize: \"none\", autocorrect: \"off\", spellcheck: false,\n placeholder: \"Enter URL\", value: url.value, disabled: props.disabled,\n \"onUpdate:value\": (value: string) => { url.value = value },\n }) }),\n h(Field, { label: \"Link title\" }, { default: () => h(Input, {\n placeholder: \"Enter link title\", value: title.value, disabled: props.disabled,\n \"onUpdate:value\": (value: string) => { title.value = value },\n }) }),\n ]) }),\n h(DialogFooter, null, { default: () => [\n props.isEditing ? h(Button, { color: \"danger\", variant: \"soft\", disabled: props.disabled, onClick: () => { if (!props.disabled) props.onRemove() } }, { default: () => \"Remove\" }) : null,\n h(Button, { color: \"secondary\", variant: \"soft\", onClick: () => props.onCancel() }, { default: () => \"Cancel\" }),\n h(Button, { color: \"primary\", disabled: props.disabled, onClick: () => { if (!props.disabled) props.onSave(url.value, title.value) } }, { default: () => \"Save\" }),\n ] }),\n ] }) })\n },\n})\n\nconst ToolbarButton = defineComponent({\n name: \"MarkdownEditorToolbarButton\",\n props: {\n tooltip: { type: String, required: true },\n active: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n icon: { type: [Object, Function] as PropType<Component>, required: true },\n onClick: { type: Function as PropType<() => void>, required: true },\n },\n setup(props) {\n return () =>\n h(\n Tooltip,\n { content: props.tooltip, compact: true },\n {\n default: () =>\n h(\n Button,\n {\n \"color\": \"secondary\", \"variant\": \"ghost\", \"size\": \"2xs\", \"iconSize\": \"sm\", \"uniform\": true, \"mobileMaterial\": \"flat\",\n \"class\": s.ToolbarButton,\n \"data-active\": props.active || undefined,\n \"selected\": props.active,\n // Formatting buttons are toggles: announce their on/off state\n \"aria-pressed\": props.active,\n // React DOM never calls onClick on a disabled button, even\n // for a dispatched event; Vue's listener would run\n \"onClick\": () => {\n if (!props.disabled) props.onClick()\n },\n \"disabled\": props.disabled,\n \"aria-label\": props.tooltip,\n },\n { default: () => h(props.icon) },\n ),\n },\n )\n },\n})\n\nconst MarkdownEditorComponent = defineComponent({\n name: \"MarkdownEditor\",\n inheritAttrs: false,\n props: {\n /** Visual style of the editor. @default \"outline\" */\n variant: { type: String as PropType<Variants<\"outline\" | \"soft\">>, default: \"outline\" },\n /** Disables editing and the toolbar. @default false */\n disabled: { type: Boolean, default: false },\n /** Marks the editor as invalid. @default false */\n invalid: { type: Boolean, default: false },\n /** Placeholder text when empty (read when the editor is created) */\n placeholder: String,\n /** Controlled value as a markdown string (`v-model:value`) */\n value: { type: String, default: undefined },\n /** Default value as a markdown string for uncontrolled mode */\n defaultValue: { type: String, default: undefined },\n /**\n * The formats the editor offers, read when the editor is created. A format left out has no toolbar button,\n * shortcut or input rule; in pasted text its markers stay text, as typed, pasted HTML and incoming markdown keep\n * its text without it, and the markdown does not write it.\n * @default [\"bold\", \"italic\", \"orderedList\", \"bulletList\", \"link\"]\n */\n formats: { type: Array as PropType<MarkdownEditorFormat[]>, default: undefined },\n /**\n * A single newline is a line break, read and written as one \"\\n\", read when the editor is created. Without it a\n * line break is written as a backslash and a newline, and a single newline joins the lines. @default false\n */\n breaks: { type: Boolean, default: false },\n /** Minimum visible rows. @default 1 */\n rows: { type: Number, default: 1 },\n /** `id` of the editable element */\n id: String,\n /** Accessible name of the editable element; a `<label for>` cannot name a contenteditable region */\n ariaLabel: String,\n /** Id of the element that names the editor, such as a Field label */\n ariaLabelledby: String,\n /** `aria-describedby` of the editable element */\n ariaDescribedby: String,\n /** Sets `aria-invalid=\"true\"` on the editable element and the invalid style */\n ariaInvalid: { type: Boolean, default: undefined },\n },\n emits: {\n /** The editor's markdown after a change (`v-model:value`) */\n \"update:value\": (markdown: string) => typeof markdown === \"string\",\n /** Same as `update:value` (React's `onChange`) */\n \"change\": (markdown: string) => typeof markdown === \"string\",\n },\n setup(props, { slots, attrs, emit }) {\n // The schema is the editor's, made once with it, as the toolbar offers what the schema has\n const schema = markdownEditorSchema(props.formats, props.breaks)\n const focused = ref(false)\n const linkDialogOpen = ref(false)\n const linkDialogInitial = ref({ url: \"\", title: \"\" })\n const activeMarks = reactive({\n bold: false,\n italic: false,\n link: false,\n orderedList: false,\n bulletList: false,\n })\n const linkCanEnable = ref(false)\n const isControlled = () => props.value !== undefined\n let suppressChange = false\n let linkSelection: LinkSelection | null = null\n let restoreEditorFocus = false\n\n const syncToolbar = (e: EditorLike) => {\n Object.assign(activeMarks, {\n bold: e.isActive(\"bold\"),\n italic: e.isActive(\"italic\"),\n link: e.isActive(\"link\"),\n orderedList: e.isActive(\"orderedList\"),\n bulletList: e.isActive(\"bulletList\"),\n })\n linkCanEnable.value = !e.state.selection.empty || e.isActive(\"link\")\n }\n\n const editorAttributes = () => ({\n \"class\": s.EditorContent,\n \"role\": \"textbox\",\n \"aria-multiline\": \"true\",\n ...(props.id && { id: props.id }),\n ...(props.ariaLabel && { \"aria-label\": props.ariaLabel }),\n ...(props.ariaLabelledby && { \"aria-labelledby\": props.ariaLabelledby }),\n ...(props.ariaDescribedby && { \"aria-describedby\": props.ariaDescribedby }),\n ...(props.ariaInvalid && { \"aria-invalid\": \"true\" }),\n })\n\n const editor = useEditor({\n extensions: markdownEditorExtensions(schema, props.placeholder),\n content: props.value ?? props.defaultValue ?? \"\",\n editable: !props.disabled,\n editorProps: {\n attributes: editorAttributes(),\n },\n onFocus: () => {\n focused.value = true\n },\n onBlur: () => {\n focused.value = false\n },\n onUpdate: ({ editor: e }) => {\n if (suppressChange) return\n const md = getMarkdown(e)\n emit(\"update:value\", md)\n emit(\"change\", md)\n },\n onSelectionUpdate: ({ editor: e }) => syncToolbar(e),\n onTransaction: ({ editor: e }) => {\n syncToolbar(e)\n if (linkSelection && linkSelection.doc !== e.state.doc) {\n linkSelection = null\n restoreEditorFocus = false\n linkDialogOpen.value = false\n }\n },\n })\n\n // React re-applies the editor props on every render\n watch(editorAttributes, (attributes) => {\n editor.value?.setOptions({ editorProps: { attributes } })\n })\n\n watch(\n () => [editor.value, props.value, isControlled()] as const,\n ([instance, value, controlled]) => {\n if (!instance || !controlled) return\n const currentMd = getMarkdown(instance)\n if (value !== currentMd) {\n suppressChange = true\n instance.commands.setContent(value || \"\", { emitUpdate: false })\n suppressChange = false\n }\n },\n )\n\n watch(\n () => [editor.value, props.disabled] as const,\n ([instance, disabled]) => {\n if (instance) instance.setEditable(!disabled)\n if (disabled) {\n linkSelection = null\n restoreEditorFocus = false\n linkDialogOpen.value = false\n }\n },\n )\n\n const handleContainerMouseDown = (evt: MouseEvent) => {\n const instance = editor.value\n if (props.disabled || !instance) return\n const target = evt.target\n if (!(target instanceof Element) || !(evt.currentTarget instanceof Element) || !evt.currentTarget.contains(target)) return\n if (target.closest(\"button, [type='button'], [role='button'], a, input, label\")) return\n // A press in the text places the caret there itself\n if (instance.view.dom.contains(target)) return\n if (instance.isFocused) return\n evt.preventDefault()\n instance.commands.focus(\"end\")\n }\n\n const openLinkDialog = () => {\n const instance = editor.value\n if (!instance || props.disabled) return\n const url = instance.getAttributes(\"link\").href ?? \"\"\n const selection = instance.state.selection\n const range = selection.empty && instance.isActive(\"link\")\n ? getMarkRange(selection.$from, instance.schema.marks.link, { href: url })\n : selection\n if (!range) return\n linkSelection = { from: range.from, to: range.to, doc: instance.state.doc }\n restoreEditorFocus = true\n linkDialogInitial.value = { url, title: instance.state.doc.textBetween(range.from, range.to, \"\") }\n linkDialogOpen.value = true\n }\n const handleLinkSave = (url: string, title: string) => {\n const instance = editor.value\n const range = linkSelection\n if (!instance || props.disabled || !range) return\n linkDialogOpen.value = false\n if (range.doc !== instance.state.doc) { restoreEditorFocus = false; return }\n linkSelection = null\n const selectedText = instance.state.doc.textBetween(range.from, range.to, \"\")\n const chain = instance.chain().setTextSelection({ from: range.from, to: range.to })\n if (!url) chain.unsetLink().run()\n else if (title && title !== selectedText) chain.insertContent(linkText(title, url)).run()\n else chain.setLink({ href: url }).run()\n }\n const handleLinkRemove = () => {\n const instance = editor.value\n const range = linkSelection\n if (!instance || props.disabled || !range) return\n linkDialogOpen.value = false\n if (range.doc !== instance.state.doc) { restoreEditorFocus = false; return }\n linkSelection = null\n instance.chain().setTextSelection({ from: range.from, to: range.to }).unsetLink().run()\n }\n const handleLinkCancel = () => { linkDialogOpen.value = false }\n const handleRestoreFocus = (event: Event) => {\n keepMovedFocus(event)\n const shouldRestore = restoreEditorFocus && !event.defaultPrevented\n event.preventDefault()\n restoreEditorFocus = false\n linkSelection = null\n const instance = editor.value\n if (shouldRestore && instance && !instance.isDestroyed && !props.disabled) {\n const closingScope = event.target\n requestAnimationFrame(() => {\n if (instance.isDestroyed || !instance.isEditable) return\n const doc = instance.view.dom.ownerDocument\n const active = doc.activeElement\n if (active && active !== doc.body && !instance.view.dom.contains(active)\n && !(closingScope instanceof Node && closingScope.contains(active))) return\n // Check at the actual restore, then focus synchronously: Tiptap's\n // focus command queues another frame that could steal moved focus.\n instance.view.focus()\n })\n }\n }\n\n return () => {\n const { variant, disabled, invalid, ariaInvalid, rows } = props\n const isInvalid = invalid || ariaInvalid\n const minHeight = 20 * rows + 16\n // React renders the slot only for a truthy `toolbarEnd`\n const toolbarEnd = slots.toolbarEnd?.()\n const hasToolbarEnd = flattenSlot(toolbarEnd).length > 0\n const offered = schema.formats\n // Groups of the offered formats, a separator between two of them\n const groups = [\n [\n offered.has(\"bold\") && h(ToolbarButton, {\n tooltip: \"Bold\",\n active: activeMarks.bold,\n disabled,\n icon: BoldIcon,\n onClick: () => editor.value?.chain().focus().toggleBold().run(),\n }),\n offered.has(\"italic\") && h(ToolbarButton, {\n tooltip: \"Italic\",\n active: activeMarks.italic,\n disabled,\n icon: ItalicIcon,\n onClick: () => editor.value?.chain().focus().toggleItalic().run(),\n }),\n ],\n [\n offered.has(\"orderedList\") && h(ToolbarButton, {\n tooltip: \"Numbered list\",\n active: activeMarks.orderedList,\n disabled,\n icon: ListNumbersIcon,\n onClick: () => editor.value?.chain().focus().toggleOrderedList().run(),\n }),\n offered.has(\"bulletList\") && h(ToolbarButton, {\n tooltip: \"Bullet list\",\n active: activeMarks.bulletList,\n disabled,\n icon: ListIcon,\n onClick: () => editor.value?.chain().focus().toggleBulletList().run(),\n }),\n ],\n [\n offered.has(\"link\") && h(ToolbarButton, {\n tooltip: \"Link\",\n active: activeMarks.link,\n disabled: disabled || !linkCanEnable.value,\n icon: LinkIcon,\n onClick: openLinkDialog,\n }),\n ],\n ].map((group) => group.filter((button) => button !== false)).filter((group) => group.length > 0)\n\n return h(\n \"div\",\n {\n \"class\": [s.Container, attrs.class],\n \"data-variant\": variant,\n \"data-focused\": String(focused.value),\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-invalid\": isInvalid ? \"\" : undefined,\n \"onMousedown\": handleContainerMouseDown,\n },\n [\n groups.length || hasToolbarEnd\n ? h(\"div\", { class: s.Toolbar, onMousedown: (e: MouseEvent) => e.preventDefault() }, [\n h(\"div\", { class: s.ToolbarGroup }, [\n ...groups.flatMap((group, index) => [\n ...(index ? [h(\"div\", { \"class\": s.ToolbarSeparator, \"aria-hidden\": \"true\" })] : []),\n ...group,\n ]),\n ...(hasToolbarEnd\n ? [\n ...(groups.length ? [h(\"div\", { \"class\": s.ToolbarSeparator, \"aria-hidden\": \"true\" })] : []),\n h(\"div\", { class: s.ToolbarEnd }, toolbarEnd),\n ]\n : []),\n ]),\n ])\n : null,\n\n h(\"div\", { class: s.Editor, style: { minHeight: `${minHeight}px` } }, [\n editor.value\n ? h(EditorContent, { editor: editor.value })\n : editorFirstFrame(props.value ?? props.defaultValue ?? \"\", props.placeholder, props.disabled, schema),\n ]),\n\n h(LinkDialog, {\n open: linkDialogOpen.value,\n initialUrl: linkDialogInitial.value.url,\n initialTitle: linkDialogInitial.value.title,\n isEditing: !!linkDialogInitial.value.url,\n disabled,\n onRestoreFocus: handleRestoreFocus,\n onSave: handleLinkSave,\n onRemove: handleLinkRemove,\n onCancel: handleLinkCancel,\n }),\n ],\n )\n }\n },\n})\n\n/**\n * The content before the editor exists, on the server and until it mounts: the markdown as the editor will show it,\n * in its schema and its own boxes (EditorContent's, then ProseMirror's), so the page does not move when ProseMirror\n * takes over, as in React. An empty editor shows its placeholder while it can be edited (`showOnlyWhenEditable`).\n */\nconst editorFirstFrame = (markdown: string, placeholder: string | undefined, disabled: boolean, schema: MarkdownEditorSchema) => {\n const hint = placeholder && !disabled ? placeholder : undefined\n return h(\"div\", null, [\n h(\"div\", { class: [\"tiptap\", s.EditorContent] }, [\n markdown.trim()\n ? renderMarkdown({\n children: markdown,\n remarkPlugins: schema.breaks ? [remarkWithoutHtml, remarkLineBreaks] : [remarkWithoutHtml],\n rehypePlugins: [rehypeEditorSchema(schema, hint)],\n })\n : h(\"p\", { class: hint ? \"is-editor-empty\" : undefined, \"data-placeholder\": hint ? placeholder : undefined }, [h(\"br\")]),\n ]),\n ])\n}\n\n/**\n * Compact rich text editor for markdown, with a formatting toolbar (bold,\n * italic, lists, links). Bind the markdown with `v-model:value`.\n */\nexport const MarkdownEditor = MarkdownEditorComponent\n\nexport type MarkdownEditorProps = InstanceType<typeof MarkdownEditorComponent>[\"$props\"]\n"]}
1
+ {"version":3,"file":"MarkdownEditor.js","sourceRoot":"","sources":["../../../../src/components/MarkdownEditor/MarkdownEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,CAAC,EACD,QAAQ,EACR,GAAG,EACH,KAAK,GAGN,MAAM,KAAK,CAAA;AACZ,OAAO,EAA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,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3H,CAAC;KACH,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA","sourcesContent":["import {\n defineComponent,\n h,\n reactive,\n ref,\n watch,\n type Component,\n type PropType,\n} from \"vue\"\nimport { EditorContent, useEditor } from \"@tiptap/vue-3\"\nimport { getMarkRange, type Editor as CoreEditor } from \"@tiptap/core\"\nimport type { Variants } from \"@plexui/styles/types\"\nimport { keepMovedFocus } from \"../../lib/helpers.js\"\nimport {\n markdownEditorExtensions,\n markdownEditorSchema,\n rehypeEditorSchema,\n remarkLineBreaks,\n remarkWithoutHtml,\n type MarkdownEditorFormat,\n type MarkdownEditorSchema,\n} from \"../../lib/markdownEditorSchema.js\"\nimport {\n Bold as BoldIcon,\n Italic as ItalicIcon,\n Link as LinkIcon,\n List as ListIcon,\n ListNumbers as ListNumbersIcon,\n} from \"../Icon/index.js\"\nimport { Tooltip } from \"../Tooltip/index.js\"\nimport { Button, NavigationButton } from \"../Button/index.js\"\nimport { Dialog, DialogContent, DialogHeader, DialogHeaderAction, DialogTitle, DialogBody, DialogFooter } from \"../Dialog/index.js\"\nimport { Field } from \"../Field/index.js\"\nimport { FieldGroup } from \"../FieldGroup/index.js\"\nimport { Input } from \"../Input/index.js\"\nimport { usePhoneLayout } from \"../PhoneLayout/index.js\"\nimport { flattenSlot } from \"../Tooltip/slot.js\"\nimport { renderMarkdown } from \"../Markdown/pipeline.js\"\nimport s from \"@plexui/styles/components/MarkdownEditor/MarkdownEditor.module.css\"\n\n// Vue port of packages/ui/src/components/MarkdownEditor/MarkdownEditor.tsx on\n// @tiptap/vue-3 with the same extensions, configured the same way, so\n// ProseMirror renders the same DOM and tiptap-markdown emits the same markdown.\n//\n// - The editor is created on mount (@tiptap/vue-3's `useEditor`, like React's\n// `immediatelyRender: false`) and destroyed on unmount.\n// - Value: `value` + `update:value` (`v-model:value`) and `change` mirror\n// React's `value` + `onChange`; `default-value` is the uncontrolled start.\n// As in React, a controlled value is only pushed into the editor when it\n// changes and differs from the editor's markdown.\n// - As in React, `update:value` / `change` also fire once when the editor is\n// created and whenever `disabled` changes (`setEditable` emits an update).\n// - Options React reads only when it creates the editor (`placeholder`,\n// `formats`, `breaks`, the initial content) are read once here too; `id`, `aria-label`,\n// `aria-labelledby`, `aria-describedby` and `aria-invalid` follow the\n// props, as React re-applies them on render.\n// - `toolbarEnd` is the `#toolbarEnd` slot. Like React, only `class` is\n// applied (to the container); other attributes are not forwarded.\n// - The shared Dialog owns focus trapping and closing. Its portal is not part\n// of the editor's click area, so editing a link preserves its selection.\n\ntype EditorLike = Pick<CoreEditor, \"isActive\" | \"state\">\n\nconst getMarkdown = (editor: CoreEditor) =>\n (editor.storage as unknown as Record<string, { getMarkdown?: () => string }>).markdown?.getMarkdown?.() ?? \"\"\n\n// A link inserted as a text node, not as `<a>` HTML: the markdown parser runs\n// with `html: false`, so HTML would land in the text as written\nconst linkText = (text: string, href: string) => ({\n type: \"text\",\n text,\n marks: [{ type: \"link\", attrs: { href } }],\n})\n\nexport const markdownEditorStyles = {\n toolbarButton: s.ToolbarButton,\n}\n\nexport type { MarkdownEditorFormat }\n\ntype LinkSelection = { from: number; to: number; doc: CoreEditor[\"state\"][\"doc\"] }\n\nconst LinkDialog = defineComponent({\n name: \"MarkdownEditorLinkDialog\",\n props: {\n open: { type: Boolean, required: true },\n initialUrl: { type: String, required: true },\n initialTitle: { type: String, required: true },\n isEditing: { type: Boolean, required: true },\n disabled: { type: Boolean, required: true },\n onSave: { type: Function as PropType<(url: string, title: string) => void>, required: true },\n onRemove: { type: Function as PropType<() => void>, required: true },\n onCancel: { type: Function as PropType<() => void>, required: true },\n onRestoreFocus: { type: Function as PropType<(event: Event) => void>, required: true },\n },\n setup(props) {\n const url = ref(props.initialUrl)\n const title = ref(props.initialTitle)\n watch(() => [props.open, props.initialUrl, props.initialTitle] as const, ([open, initialUrl, initialTitle]) => {\n if (open) { url.value = initialUrl; title.value = initialTitle }\n })\n // On a phone the dialog is a sheet of the kit's grouped form: Cancel is the sheet's close button, Save its confirm\n // button in the bar, the fields rows of a card and Remove a destructive row of its own (owner 21.11)\n const phone = usePhoneLayout()\n const fields = ref<HTMLElement | null>(null)\n const save = () => { if (!props.disabled) props.onSave(url.value, title.value) }\n const onKeydown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" && !event.isComposing && event.target instanceof HTMLInputElement) {\n event.preventDefault()\n save()\n }\n }\n const urlInput = () => h(Input, {\n type: \"url\", inputmode: \"url\", autocapitalize: \"none\", autocorrect: \"off\", spellcheck: false,\n placeholder: phone.value ? \"Required\" : \"Enter URL\", value: url.value, disabled: props.disabled,\n \"onUpdate:value\": (value: string) => { url.value = value },\n })\n const titleInput = () => h(Input, {\n placeholder: phone.value ? \"Optional\" : \"Enter link title\", value: title.value, disabled: props.disabled,\n \"onUpdate:value\": (value: string) => { title.value = value },\n })\n return () => h(Dialog, {\n \"open\": props.open,\n \"onUpdate:open\": (next: boolean) => { if (!next) props.onCancel() },\n }, { default: () => h(DialogContent, {\n width: 450, mobileVariant: \"sheet\", surface: \"grouped\", showClose: phone.value,\n // On a phone the address is what the sheet asks for: it takes the focus, not the close button before it\n onOpenAutoFocus: (event: Event) => {\n if (!phone.value) return\n event.preventDefault()\n fields.value?.querySelector<HTMLInputElement>('input[type=\"url\"]')?.focus()\n },\n onCloseAutoFocus: props.onRestoreFocus,\n }, { default: () => [\n h(DialogHeader, null, { default: () => [\n h(DialogTitle, null, { default: () => \"Link\" }),\n phone.value\n ? h(DialogHeaderAction, null, { default: () => h(NavigationButton, { action: \"confirm\", \"aria-label\": \"Save\", disabled: props.disabled, onClick: save }) })\n : null,\n ] }),\n h(DialogBody, null, { default: () => phone.value\n // The groups keep the spacing of a grouped form between them\n ? h(\"div\", { ref: fields, onKeydown }, [\n // A long address needs the cell's width: the label stands over the value, as a Textarea's row\n h(FieldGroup, null, { default: () => [\n h(Field, { row: true, orientation: \"vertical\", label: \"URL\" }, { default: urlInput }),\n h(Field, { row: true, orientation: \"vertical\", label: \"Title\" }, { default: titleInput }),\n ] }),\n props.isEditing\n ? h(FieldGroup, null, { default: () => h(\"div\", { \"data-row\": \"\" }, [\n h(Button, { block: true, color: \"danger\", variant: \"ghost\", disabled: props.disabled, onClick: () => { if (!props.disabled) props.onRemove() } }, { default: () => \"Remove Link\" }),\n ]) })\n : null,\n ])\n : h(\"div\", { ref: fields, class: s.LinkDialogFields, onKeydown }, [\n h(Field, { label: \"URL\" }, { default: urlInput }),\n h(Field, { label: \"Link title\" }, { default: titleInput }),\n ]) }),\n phone.value ? null : h(DialogFooter, null, { default: () => [\n props.isEditing ? h(Button, { color: \"danger\", variant: \"soft\", disabled: props.disabled, onClick: () => { if (!props.disabled) props.onRemove() } }, { default: () => \"Remove\" }) : null,\n h(Button, { color: \"secondary\", variant: \"soft\", onClick: () => props.onCancel() }, { default: () => \"Cancel\" }),\n h(Button, { color: \"primary\", disabled: props.disabled, onClick: save }, { default: () => \"Save\" }),\n ] }),\n ] }) })\n },\n})\n\nconst ToolbarButton = defineComponent({\n name: \"MarkdownEditorToolbarButton\",\n props: {\n tooltip: { type: String, required: true },\n active: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n icon: { type: [Object, Function] as PropType<Component>, required: true },\n onClick: { type: Function as PropType<() => void>, required: true },\n },\n setup(props) {\n return () =>\n h(\n Tooltip,\n { content: props.tooltip, compact: true },\n {\n default: () =>\n h(\n Button,\n {\n \"color\": \"secondary\", \"variant\": \"ghost\", \"size\": \"2xs\", \"iconSize\": \"sm\", \"uniform\": true, \"mobileMaterial\": \"flat\",\n \"class\": s.ToolbarButton,\n \"data-active\": props.active || undefined,\n \"selected\": props.active,\n // Formatting buttons are toggles: announce their on/off state\n \"aria-pressed\": props.active,\n // React DOM never calls onClick on a disabled button, even\n // for a dispatched event; Vue's listener would run\n \"onClick\": () => {\n if (!props.disabled) props.onClick()\n },\n \"disabled\": props.disabled,\n \"aria-label\": props.tooltip,\n },\n { default: () => h(props.icon) },\n ),\n },\n )\n },\n})\n\nconst MarkdownEditorComponent = defineComponent({\n name: \"MarkdownEditor\",\n inheritAttrs: false,\n props: {\n /** Visual style of the editor. @default \"outline\" */\n variant: { type: String as PropType<Variants<\"outline\" | \"soft\">>, default: \"outline\" },\n /** Disables editing and the toolbar. @default false */\n disabled: { type: Boolean, default: false },\n /** Marks the editor as invalid. @default false */\n invalid: { type: Boolean, default: false },\n /** Placeholder text when empty (read when the editor is created) */\n placeholder: String,\n /** Controlled value as a markdown string (`v-model:value`) */\n value: { type: String, default: undefined },\n /** Default value as a markdown string for uncontrolled mode */\n defaultValue: { type: String, default: undefined },\n /**\n * The formats the editor offers, read when the editor is created. A format left out has no toolbar button,\n * shortcut or input rule; in pasted text its markers stay text, as typed, pasted HTML and incoming markdown keep\n * its text without it, and the markdown does not write it.\n * @default [\"bold\", \"italic\", \"orderedList\", \"bulletList\", \"link\"]\n */\n formats: { type: Array as PropType<MarkdownEditorFormat[]>, default: undefined },\n /**\n * A single newline is a line break, read and written as one \"\\n\", read when the editor is created. Without it a\n * line break is written as a backslash and a newline, and a single newline joins the lines. @default false\n */\n breaks: { type: Boolean, default: false },\n /** Minimum visible rows. @default 1 */\n rows: { type: Number, default: 1 },\n /** `id` of the editable element */\n id: String,\n /** Accessible name of the editable element; a `<label for>` cannot name a contenteditable region */\n ariaLabel: String,\n /** Id of the element that names the editor, such as a Field label */\n ariaLabelledby: String,\n /** `aria-describedby` of the editable element */\n ariaDescribedby: String,\n /** Sets `aria-invalid=\"true\"` on the editable element and the invalid style */\n ariaInvalid: { type: Boolean, default: undefined },\n },\n emits: {\n /** The editor's markdown after a change (`v-model:value`) */\n \"update:value\": (markdown: string) => typeof markdown === \"string\",\n /** Same as `update:value` (React's `onChange`) */\n \"change\": (markdown: string) => typeof markdown === \"string\",\n },\n setup(props, { slots, attrs, emit }) {\n // The schema is the editor's, made once with it, as the toolbar offers what the schema has\n const schema = markdownEditorSchema(props.formats, props.breaks)\n const focused = ref(false)\n const linkDialogOpen = ref(false)\n const linkDialogInitial = ref({ url: \"\", title: \"\" })\n const activeMarks = reactive({\n bold: false,\n italic: false,\n link: false,\n orderedList: false,\n bulletList: false,\n })\n const isControlled = () => props.value !== undefined\n let suppressChange = false\n let linkSelection: LinkSelection | null = null\n let restoreEditorFocus = false\n\n const syncToolbar = (e: EditorLike) => {\n Object.assign(activeMarks, {\n bold: e.isActive(\"bold\"),\n italic: e.isActive(\"italic\"),\n link: e.isActive(\"link\"),\n orderedList: e.isActive(\"orderedList\"),\n bulletList: e.isActive(\"bulletList\"),\n })\n }\n\n const editorAttributes = () => ({\n \"class\": s.EditorContent,\n \"role\": \"textbox\",\n \"aria-multiline\": \"true\",\n ...(props.id && { id: props.id }),\n ...(props.ariaLabel && { \"aria-label\": props.ariaLabel }),\n ...(props.ariaLabelledby && { \"aria-labelledby\": props.ariaLabelledby }),\n ...(props.ariaDescribedby && { \"aria-describedby\": props.ariaDescribedby }),\n ...(props.ariaInvalid && { \"aria-invalid\": \"true\" }),\n })\n\n const editor = useEditor({\n extensions: markdownEditorExtensions(schema, props.placeholder),\n content: props.value ?? props.defaultValue ?? \"\",\n editable: !props.disabled,\n editorProps: {\n attributes: editorAttributes(),\n },\n onFocus: () => {\n focused.value = true\n },\n onBlur: () => {\n focused.value = false\n },\n onUpdate: ({ editor: e }) => {\n if (suppressChange) return\n const md = getMarkdown(e)\n emit(\"update:value\", md)\n emit(\"change\", md)\n },\n onSelectionUpdate: ({ editor: e }) => syncToolbar(e),\n onTransaction: ({ editor: e }) => {\n syncToolbar(e)\n if (linkSelection && linkSelection.doc !== e.state.doc) {\n linkSelection = null\n restoreEditorFocus = false\n linkDialogOpen.value = false\n }\n },\n })\n\n // React re-applies the editor props on every render\n watch(editorAttributes, (attributes) => {\n editor.value?.setOptions({ editorProps: { attributes } })\n })\n\n watch(\n () => [editor.value, props.value, isControlled()] as const,\n ([instance, value, controlled]) => {\n if (!instance || !controlled) return\n const currentMd = getMarkdown(instance)\n if (value !== currentMd) {\n suppressChange = true\n instance.commands.setContent(value || \"\", { emitUpdate: false })\n suppressChange = false\n }\n },\n )\n\n watch(\n () => [editor.value, props.disabled] as const,\n ([instance, disabled]) => {\n if (instance) instance.setEditable(!disabled)\n if (disabled) {\n linkSelection = null\n restoreEditorFocus = false\n linkDialogOpen.value = false\n }\n },\n )\n\n const handleContainerMouseDown = (evt: MouseEvent) => {\n const instance = editor.value\n if (props.disabled || !instance) return\n const target = evt.target\n if (!(target instanceof Element) || !(evt.currentTarget instanceof Element) || !evt.currentTarget.contains(target)) return\n if (target.closest(\"button, [type='button'], [role='button'], a, input, label\")) return\n // A press in the text places the caret there itself\n if (instance.view.dom.contains(target)) return\n if (instance.isFocused) return\n evt.preventDefault()\n instance.commands.focus(\"end\")\n }\n\n const openLinkDialog = () => {\n const instance = editor.value\n if (!instance || props.disabled) return\n const url = instance.getAttributes(\"link\").href ?? \"\"\n const selection = instance.state.selection\n const range = selection.empty && instance.isActive(\"link\")\n ? getMarkRange(selection.$from, instance.schema.marks.link, { href: url })\n : selection\n if (!range) return\n linkSelection = { from: range.from, to: range.to, doc: instance.state.doc }\n restoreEditorFocus = true\n linkDialogInitial.value = { url, title: instance.state.doc.textBetween(range.from, range.to, \"\") }\n linkDialogOpen.value = true\n }\n const handleLinkSave = (url: string, title: string) => {\n const instance = editor.value\n const range = linkSelection\n if (!instance || props.disabled || !range) return\n linkDialogOpen.value = false\n if (range.doc !== instance.state.doc) { restoreEditorFocus = false; return }\n linkSelection = null\n const selectedText = instance.state.doc.textBetween(range.from, range.to, \"\")\n const chain = instance.chain().setTextSelection({ from: range.from, to: range.to })\n if (!url) chain.unsetLink().run()\n // With no text selected the link is new text at the caret: its title, or the address itself\n else if (range.from === range.to) chain.insertContent(linkText(title || url, url)).run()\n else if (title && title !== selectedText) chain.insertContent(linkText(title, url)).run()\n else chain.setLink({ href: url }).run()\n }\n const handleLinkRemove = () => {\n const instance = editor.value\n const range = linkSelection\n if (!instance || props.disabled || !range) return\n linkDialogOpen.value = false\n if (range.doc !== instance.state.doc) { restoreEditorFocus = false; return }\n linkSelection = null\n instance.chain().setTextSelection({ from: range.from, to: range.to }).unsetLink().run()\n }\n const handleLinkCancel = () => { linkDialogOpen.value = false }\n const handleRestoreFocus = (event: Event) => {\n keepMovedFocus(event)\n const shouldRestore = restoreEditorFocus && !event.defaultPrevented\n event.preventDefault()\n restoreEditorFocus = false\n linkSelection = null\n const instance = editor.value\n if (shouldRestore && instance && !instance.isDestroyed && !props.disabled) {\n const closingScope = event.target\n requestAnimationFrame(() => {\n if (instance.isDestroyed || !instance.isEditable) return\n const doc = instance.view.dom.ownerDocument\n const active = doc.activeElement\n if (active && active !== doc.body && !instance.view.dom.contains(active)\n && !(closingScope instanceof Node && closingScope.contains(active))) return\n // Check at the actual restore, then focus synchronously: Tiptap's\n // focus command queues another frame that could steal moved focus.\n instance.view.focus()\n })\n }\n }\n\n return () => {\n const { variant, disabled, invalid, ariaInvalid, rows } = props\n const isInvalid = invalid || ariaInvalid\n const minHeight = 20 * rows + 16\n // React renders the slot only for a truthy `toolbarEnd`\n const toolbarEnd = slots.toolbarEnd?.()\n const hasToolbarEnd = flattenSlot(toolbarEnd).length > 0\n const offered = schema.formats\n // Groups of the offered formats, a separator between two of them\n const groups = [\n [\n offered.has(\"bold\") && h(ToolbarButton, {\n tooltip: \"Bold\",\n active: activeMarks.bold,\n disabled,\n icon: BoldIcon,\n onClick: () => editor.value?.chain().focus().toggleBold().run(),\n }),\n offered.has(\"italic\") && h(ToolbarButton, {\n tooltip: \"Italic\",\n active: activeMarks.italic,\n disabled,\n icon: ItalicIcon,\n onClick: () => editor.value?.chain().focus().toggleItalic().run(),\n }),\n ],\n [\n offered.has(\"orderedList\") && h(ToolbarButton, {\n tooltip: \"Numbered list\",\n active: activeMarks.orderedList,\n disabled,\n icon: ListNumbersIcon,\n onClick: () => editor.value?.chain().focus().toggleOrderedList().run(),\n }),\n offered.has(\"bulletList\") && h(ToolbarButton, {\n tooltip: \"Bullet list\",\n active: activeMarks.bulletList,\n disabled,\n icon: ListIcon,\n onClick: () => editor.value?.chain().focus().toggleBulletList().run(),\n }),\n ],\n [\n offered.has(\"link\") && h(ToolbarButton, {\n tooltip: \"Link\",\n active: activeMarks.link,\n disabled,\n icon: LinkIcon,\n onClick: openLinkDialog,\n }),\n ],\n ].map((group) => group.filter((button) => button !== false)).filter((group) => group.length > 0)\n\n return h(\n \"div\",\n {\n \"class\": [s.Container, attrs.class],\n \"data-variant\": variant,\n \"data-focused\": String(focused.value),\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-invalid\": isInvalid ? \"\" : undefined,\n \"onMousedown\": handleContainerMouseDown,\n },\n [\n groups.length || hasToolbarEnd\n ? h(\"div\", { class: s.Toolbar, onMousedown: (e: MouseEvent) => e.preventDefault() }, [\n h(\"div\", { class: s.ToolbarGroup }, [\n ...groups.flatMap((group, index) => [\n ...(index ? [h(\"div\", { \"class\": s.ToolbarSeparator, \"aria-hidden\": \"true\" })] : []),\n ...group,\n ]),\n ...(hasToolbarEnd\n ? [\n ...(groups.length ? [h(\"div\", { \"class\": s.ToolbarSeparator, \"aria-hidden\": \"true\" })] : []),\n h(\"div\", { class: s.ToolbarEnd }, toolbarEnd),\n ]\n : []),\n ]),\n ])\n : null,\n\n h(\"div\", { class: s.Editor, style: { minHeight: `${minHeight}px` } }, [\n editor.value\n ? h(EditorContent, { editor: editor.value })\n : editorFirstFrame(props.value ?? props.defaultValue ?? \"\", props.placeholder, props.disabled, schema),\n ]),\n\n h(LinkDialog, {\n open: linkDialogOpen.value,\n initialUrl: linkDialogInitial.value.url,\n initialTitle: linkDialogInitial.value.title,\n isEditing: !!linkDialogInitial.value.url,\n disabled,\n onRestoreFocus: handleRestoreFocus,\n onSave: handleLinkSave,\n onRemove: handleLinkRemove,\n onCancel: handleLinkCancel,\n }),\n ],\n )\n }\n },\n})\n\n/**\n * The content before the editor exists, on the server and until it mounts: the markdown as the editor will show it,\n * in its schema and its own boxes (EditorContent's, then ProseMirror's), so the page does not move when ProseMirror\n * takes over, as in React. An empty editor shows its placeholder while it can be edited (`showOnlyWhenEditable`).\n */\nconst editorFirstFrame = (markdown: string, placeholder: string | undefined, disabled: boolean, schema: MarkdownEditorSchema) => {\n const hint = placeholder && !disabled ? placeholder : undefined\n return h(\"div\", null, [\n h(\"div\", { class: [\"tiptap\", s.EditorContent] }, [\n markdown.trim()\n ? renderMarkdown({\n children: markdown,\n remarkPlugins: schema.breaks ? [remarkWithoutHtml, remarkLineBreaks] : [remarkWithoutHtml],\n rehypePlugins: [rehypeEditorSchema(schema, hint)],\n })\n : h(\"p\", { class: hint ? \"is-editor-empty\" : undefined, \"data-placeholder\": hint ? placeholder : undefined }, [h(\"br\")]),\n ]),\n ])\n}\n\n/**\n * Compact rich text editor for markdown, with a formatting toolbar (bold,\n * italic, lists, links). Bind the markdown with `v-model:value`.\n */\nexport const MarkdownEditor = MarkdownEditorComponent\n\nexport type MarkdownEditorProps = InstanceType<typeof MarkdownEditorComponent>[\"$props\"]\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/vue",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "@maskito/core": "5.2.2",
78
78
  "@maskito/kit": "5.2.2",
79
79
  "@maskito/vue": "5.2.2",
80
- "@plexui/styles": "^0.16.4",
80
+ "@plexui/styles": "^0.16.6",
81
81
  "@tanstack/table-core": "8.21.3",
82
82
  "@tanstack/vue-table": "8.21.3",
83
83
  "@tiptap/core": "3.21.0",