@synopackageland/ui 0.20.4 → 0.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSES/THIRD_PARTY.md +2 -32
  3. package/dist/cli.js +0 -0
  4. package/dist/components/app/app-layout/AppLayout.vue.d.ts +21 -1
  5. package/dist/components/app/app-layout/pageTitle.d.ts +24 -0
  6. package/dist/components/app/app-tab-bar/AppTabBar.vue.d.ts +1 -1
  7. package/dist/components/app/aside-panel/AsidePanel.vue.d.ts +1 -1
  8. package/dist/components/app/section-tabs/SectionTabs.vue.d.ts +22 -4
  9. package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +1 -1
  10. package/dist/components/composite/adaptive-panel/AdaptivePanel.vue.d.ts +1 -1
  11. package/dist/components/composite/data-grid/DataGrid.vue.d.ts +19 -1
  12. package/dist/components/composite/data-grid/labels.d.ts +15 -0
  13. package/dist/components/composite/data-grid/listLayout.d.ts +26 -0
  14. package/dist/components/composite/data-table/DataTable.vue.d.ts +33 -7
  15. package/dist/components/composite/file-picker/FilePicker.vue.d.ts +3 -2
  16. package/dist/components/composite/form/FormGroup.vue.d.ts +1 -1
  17. package/dist/components/composite/form/context.d.ts +13 -0
  18. package/dist/components/composite/form-actions/FormActions.vue.d.ts +6 -2
  19. package/dist/components/composite/record-panel/RecordPanel.vue.d.ts +20 -6
  20. package/dist/components/composite/settings-section/SettingsSection.vue.d.ts +1 -1
  21. package/dist/components/composite/tag-editor/TagEditor.vue.d.ts +2 -2
  22. package/dist/components/composite/tree-view/TreeView.vue.d.ts +4 -4
  23. package/dist/components/composite/wizard/WizardDialog.vue.d.ts +2 -2
  24. package/dist/components/containers/list-detail/ListDetail.vue.d.ts +5 -3
  25. package/dist/components/feedback/validation-popup/ValidationPopup.vue.d.ts +1 -1
  26. package/dist/components/primitives/color-picker/ColorPicker.vue.d.ts +4 -4
  27. package/dist/components/primitives/combobox/Combobox.vue.d.ts +4 -4
  28. package/dist/components/primitives/context-menu/ContextMenu.vue.d.ts +2 -2
  29. package/dist/components/primitives/date-picker/DatePicker.vue.d.ts +1 -1
  30. package/dist/components/primitives/dialog/Dialog.vue.d.ts +17 -9
  31. package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +3 -3
  32. package/dist/components/primitives/dropdown-menu/DropdownMenuSheet.vue.d.ts +28 -0
  33. package/dist/components/primitives/input/Input.vue.d.ts +8 -1
  34. package/dist/components/primitives/input/Textarea.vue.d.ts +1 -1
  35. package/dist/components/primitives/input-steppers/InputSteppers.vue.d.ts +1 -1
  36. package/dist/components/primitives/motion/PushTransition.vue.d.ts +38 -0
  37. package/dist/components/primitives/multiple-select/MultipleSelect.vue.d.ts +4 -4
  38. package/dist/components/primitives/pagination/Pagination.vue.d.ts +22 -9
  39. package/dist/components/primitives/pagination/PaginationSheet.vue.d.ts +27 -0
  40. package/dist/components/primitives/pagination/labels.d.ts +6 -0
  41. package/dist/components/primitives/popover/Popover.vue.d.ts +1 -1
  42. package/dist/components/primitives/select/internal/ComboboxField.vue.d.ts +5 -5
  43. package/dist/components/primitives/select/internal/SelectSheet.vue.d.ts +42 -0
  44. package/dist/components/primitives/sheet/BottomSheet.vue.d.ts +69 -0
  45. package/dist/components/primitives/sheet/Sheet.vue.d.ts +13 -5
  46. package/dist/components/primitives/sheet/phone.d.ts +7 -0
  47. package/dist/components/primitives/superbox-select/SuperboxSelect.vue.d.ts +4 -4
  48. package/dist/components/rich-text-editor/RichTextEditor.vue.d.ts +1 -1
  49. package/dist/components/rich-text-editor/extensions.d.ts +2 -0
  50. package/dist/composables/formControl.d.ts +18 -0
  51. package/dist/composables/phoneSurface.d.ts +35 -0
  52. package/dist/feedback/StatusSlot.vue.d.ts +1 -1
  53. package/dist/grid/host/GridHost.vue.d.ts +1 -1
  54. package/dist/grid.js +358 -259
  55. package/dist/i18n/text.d.ts +11 -0
  56. package/dist/index.d.ts +7 -2
  57. package/dist/index.js +21205 -16551
  58. package/dist/json-preview/preview.js +16913 -12418
  59. package/dist/reka-runtime.json +15 -12
  60. package/dist/rich-text.js +259 -255
  61. package/dist/theme.css +1 -1
  62. package/dist/themes/dsm7-embedded-reset.css +1 -1
  63. package/dist/themes/dsm7-embedded-theme.css +1 -1
  64. package/dist/themes/dsm7-embedded.css +1 -1
  65. package/dist/themes/dsm7.css +1 -1
  66. package/docs/adaptive-layout.md +11 -9
  67. package/docs/app-local-modal.md +1 -1
  68. package/docs/layout-rules.md +14 -0
  69. package/docs/list-detail.md +9 -3
  70. package/docs/mobile-native.md +299 -11
  71. package/docs/release-checks.md +5 -0
  72. package/docs/theme-hooks.md +2 -2
  73. package/package.json +65 -57
package/dist/rich-text.js CHANGED
@@ -1,16 +1,16 @@
1
- import { defineComponent as At, computed as M, ref as q, watch as G, useId as St, reactive as zt, onMounted as Et, onBeforeUnmount as Bt, openBlock as p, createElementBlock as y, mergeProps as Tt, createElementVNode as B, unref as l, Fragment as Q, renderList as Z, withModifiers as F, normalizeClass as E, createBlock as T, resolveDynamicComponent as we, withCtx as I, createVNode as _, createCommentVNode as C, createTextVNode as Ge, toDisplayString as ee, normalizeStyle as It, shallowRef as Rt } from "vue";
2
- import { useEditor as Ht, EditorContent as qt } from "@tiptap/vue-3";
3
- import { BubbleMenu as Ft } from "@tiptap/vue-3/menus";
4
- import { Bold as Nt, Italic as Ut, Link as Vt, List as Dt, ListOrdered as Ot, Heading2 as jt, Heading3 as Kt, Code as Gt, TextQuote as Qt, SquareCode as Wt, Strikethrough as Jt, ImagePlus as Qe, AtSign as We, Ellipsis as Xt, Unlink as Je, X as Me, RotateCw as Yt, CaseSensitive as Zt, SendHorizontal as ea } from "@lucide/vue";
5
- import { richTextParts as ta, useUiText as aa, useUploadQueue as ra, DropdownMenu as ia, Input as Xe, Button as Ye, IconButton as te, MentionList as na, Spinner as Ze, UploadQueue as oa, isUnsupportedPicture as la, isPicture as sa } from "./index.js";
6
- import { Extension as Ce, mergeAttributes as tt, Node as ua } from "@tiptap/core";
7
- import da from "@tiptap/starter-kit";
8
- import { Placeholder as ca } from "@tiptap/extensions";
9
- import fa from "@tiptap/extension-mention";
10
- import { Plugin as pa } from "@tiptap/pm/state";
11
- const ma = /^(?:https?:\/\/[^\s/]|mailto:[^\s@]+@)/i;
12
- function va(a) {
13
- return ua.create({
1
+ import { defineComponent as At, computed as x, ref as q, watch as G, useId as zt, reactive as Et, onMounted as Bt, onBeforeUnmount as Tt, openBlock as p, createElementBlock as y, mergeProps as It, createElementVNode as B, unref as l, Fragment as Q, renderList as Z, withModifiers as F, normalizeClass as E, createBlock as T, resolveDynamicComponent as Me, withCtx as I, createVNode as _, createCommentVNode as C, createTextVNode as Qe, toDisplayString as ee, normalizeStyle as Rt, shallowRef as Ht } from "vue";
2
+ import { useEditor as qt, EditorContent as Ft } from "@tiptap/vue-3";
3
+ import { BubbleMenu as Nt } from "@tiptap/vue-3/menus";
4
+ import { Bold as Ut, Italic as Vt, Link as Dt, List as Ot, ListOrdered as jt, Heading2 as Kt, Heading3 as Gt, Code as Qt, TextQuote as Wt, SquareCode as Jt, Strikethrough as Xt, ImagePlus as We, AtSign as Je, Ellipsis as Yt, Unlink as Xe, X as _e, RotateCw as Zt, CaseSensitive as ea, SendHorizontal as ta } from "@lucide/vue";
5
+ import { richTextParts as aa, useUiText as ra, useUploadQueue as ia, DropdownMenu as na, Input as Ye, Button as Ze, IconButton as te, MentionList as oa, Spinner as et, UploadQueue as la, isUnsupportedPicture as sa, isPicture as ua } from "./index.js";
6
+ import { Extension as $e, mergeAttributes as at, Node as da } from "@tiptap/core";
7
+ import ca from "@tiptap/starter-kit";
8
+ import { Placeholder as fa } from "@tiptap/extensions";
9
+ import pa from "@tiptap/extension-mention";
10
+ import { Plugin as ma } from "@tiptap/pm/state";
11
+ const va = /^(?:https?:\/\/[^\s/]|mailto:[^\s@]+@)/i;
12
+ function ba(a) {
13
+ return da.create({
14
14
  name: "fileImage",
15
15
  group: "block",
16
16
  atom: !0,
@@ -27,17 +27,17 @@ function va(a) {
27
27
  },
28
28
  // Only an image this editor made is taken back from the clipboard; any other is handled by the paste code.
29
29
  parseHTML: () => [{ tag: "img[data-file-id]" }],
30
- renderHTML: ({ HTMLAttributes: o }) => ["img", tt(o)],
30
+ renderHTML: ({ HTMLAttributes: o }) => ["img", at(o)],
31
31
  addNodeView() {
32
32
  return ({ node: o }) => {
33
33
  let i = o;
34
34
  const u = document.createElement("div");
35
35
  u.className = "relative my-1 flex w-fit max-w-full overflow-hidden rounded-[var(--ui-radius-md)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-subtle)] [&.ProseMirror-selectednode]:shadow-[var(--ui-shadow-focus)]", u.setAttribute("data-ui-rich-editor-image", ""), u.contentEditable = "false";
36
36
  const n = () => {
37
- const { id: s, alt: A, upload: k, src: h } = i.attrs, m = s ? a.file(s) : void 0, v = i.attrs.progress < 0 ? "failed" : i.attrs.progress, c = h ?? m?.preview ?? m?.url ?? m?.thumb;
37
+ const { id: s, alt: S, upload: k, src: h } = i.attrs, m = s ? a.file(s) : void 0, v = i.attrs.progress < 0 ? "failed" : i.attrs.progress, c = h ?? m?.preview ?? m?.url ?? m?.thumb;
38
38
  if (u.replaceChildren(), u.style.background = m?.dominant ?? "", u.dataset.state = v === "failed" ? "failed" : k ? "uploading" : m?.state ?? (c ? "ready" : "missing"), c) {
39
39
  const f = document.createElement("img");
40
- f.src = c, f.alt = A || m?.name || "", f.draggable = !1, f.className = `block max-h-80 max-w-full object-contain ${k ? "opacity-60" : ""}`, m?.width && m.height && (f.style.aspectRatio = `${m.width} / ${m.height}`), u.append(f);
40
+ f.src = c, f.alt = S || m?.name || "", f.draggable = !1, f.className = `block max-h-80 max-w-full object-contain ${k ? "opacity-60" : ""}`, m?.width && m.height && (f.style.aspectRatio = `${m.width} / ${m.height}`), u.append(f);
41
41
  } else {
42
42
  const f = document.createElement("span");
43
43
  f.className = "flex h-24 min-w-40 items-center justify-center px-3 text-[length:var(--ui-font-size-sm)] text-[var(--ui-text-secondary)]", f.textContent = a.labels.missing, u.append(f);
@@ -45,8 +45,8 @@ function va(a) {
45
45
  if (k) {
46
46
  const f = document.createElement("span");
47
47
  f.className = "absolute inset-x-0 bottom-0 h-1 bg-[var(--ui-surface-subtle)]", f.setAttribute("role", "progressbar"), f.setAttribute("aria-label", v === "failed" ? a.labels.failed : a.labels.uploading);
48
- const x = document.createElement("span");
49
- x.className = v === "failed" ? "block h-full w-full bg-[var(--ui-danger)]" : "block h-full bg-[var(--ui-primary)] transition-[width]", v !== "failed" && (x.style.width = `${Math.round((v ?? 0) * 100)}%`, f.setAttribute("aria-valuenow", String(Math.round((v ?? 0) * 100)))), f.append(x), u.append(f);
48
+ const w = document.createElement("span");
49
+ w.className = v === "failed" ? "block h-full w-full bg-[var(--ui-danger)]" : "block h-full bg-[var(--ui-primary)] transition-[width]", v !== "failed" && (w.style.width = `${Math.round((v ?? 0) * 100)}%`, f.setAttribute("aria-valuenow", String(Math.round((v ?? 0) * 100)))), f.append(w), u.append(f);
50
50
  }
51
51
  };
52
52
  return n(), {
@@ -58,7 +58,7 @@ function va(a) {
58
58
  }
59
59
  });
60
60
  }
61
- const ba = Ce.create({
61
+ const ha = $e.create({
62
62
  name: "listDepth",
63
63
  priority: 1e3,
64
64
  addKeyboardShortcuts() {
@@ -71,18 +71,18 @@ const ba = Ce.create({
71
71
  }
72
72
  };
73
73
  }
74
- }), ha = Ce.create({
74
+ }), ga = $e.create({
75
75
  name: "imeBackspaceGuard",
76
76
  addProseMirrorPlugins() {
77
77
  const a = this.editor;
78
- return [new pa({
78
+ return [new ma({
79
79
  filterTransaction: (o) => !a.view.composing || o.docChanged || o.selectionSet || o.storedMarksSet || Object.keys(o.meta).length > 0
80
80
  })];
81
81
  }
82
82
  });
83
- function ga(a) {
83
+ function ya(a) {
84
84
  return [
85
- da.configure({
85
+ ca.configure({
86
86
  heading: a.headings ? { levels: [2, 3] } : !1,
87
87
  horizontalRule: !1,
88
88
  underline: !1,
@@ -93,26 +93,27 @@ function ga(a) {
93
93
  linkOnPaste: !0,
94
94
  defaultProtocol: "https",
95
95
  protocols: [],
96
- isAllowedUri: (o) => ma.test(o),
96
+ isAllowedUri: (o) => va.test(o),
97
97
  HTMLAttributes: { rel: "noopener noreferrer", target: null }
98
98
  }
99
99
  }),
100
- ca.configure({ placeholder: a.placeholder }),
101
- ba,
100
+ fa.configure({ placeholder: a.placeholder }),
102
101
  ha,
103
- va(a.image),
104
- fa.configure({
102
+ ga,
103
+ ba(a.image),
104
+ pa.configure({
105
105
  HTMLAttributes: { class: "font-semibold text-[var(--ui-primary)]" },
106
106
  renderText: ({ node: o }) => `@${o.attrs.label ?? o.attrs.id}`,
107
- renderHTML: ({ node: o, options: i }) => ["span", tt({ "data-type": "mention", "data-id": o.attrs.id }, i.HTMLAttributes), `@${o.attrs.label ?? o.attrs.id}`],
107
+ renderHTML: ({ node: o, options: i }) => ["span", at({ "data-type": "mention", "data-id": o.attrs.id }, i.HTMLAttributes), `@${o.attrs.label ?? o.attrs.id}`],
108
108
  suggestion: { char: "@", ...a.mention }
109
109
  }),
110
- Ce.create({
110
+ $e.create({
111
111
  name: "editorKeys",
112
112
  addKeyboardShortcuts() {
113
113
  const o = () => !this.editor.view.composing;
114
114
  return {
115
115
  "Mod-Enter": () => o() && (a.submit?.() ?? !1),
116
+ Enter: () => o() && (a.enter?.() ?? !1),
116
117
  "Mod-k": () => o() && a.link(),
117
118
  Escape: () => o() && a.escape()
118
119
  };
@@ -120,52 +121,52 @@ function ga(a) {
120
121
  })
121
122
  ];
122
123
  }
123
- function ya(a, o = {}) {
124
- const i = [], u = ta(a, { people: o.people, headings: o.headings }).flatMap((n) => at(n, o, i));
124
+ function ka(a, o = {}) {
125
+ const i = [], u = aa(a, { people: o.people, headings: o.headings }).flatMap((n) => rt(n, o, i));
125
126
  return { doc: { type: "doc", content: u.length ? u : [{ type: "paragraph" }] }, images: i };
126
127
  }
127
- function at(a, o, i) {
128
+ function rt(a, o, i) {
128
129
  if (a.type === "code") return [{ type: "codeBlock", content: a.text ? [{ type: "text", text: a.text }] : void 0 }];
129
- if (a.type === "quote") return [{ type: "blockquote", content: a.blocks.flatMap((s) => at(s, o, i)) }];
130
- if (a.type === "list") return [it(a, o, i)];
131
- const u = (s) => a.type === "heading" ? { type: "heading", attrs: { level: a.level }, content: s } : { type: "paragraph", content: s }, n = rt(a.parts, u, o, i);
130
+ if (a.type === "quote") return [{ type: "blockquote", content: a.blocks.flatMap((s) => rt(s, o, i)) }];
131
+ if (a.type === "list") return [nt(a, o, i)];
132
+ const u = (s) => a.type === "heading" ? { type: "heading", attrs: { level: a.level }, content: s } : { type: "paragraph", content: s }, n = it(a.parts, u, o, i);
132
133
  return o.imagesApart && a.parts.some((s) => s.type === "image") && n.every((s) => !s.content) ? [] : n;
133
134
  }
134
- function rt(a, o, i, u) {
135
+ function it(a, o, i, u) {
135
136
  const n = [];
136
137
  let s = [];
137
- const A = (k = !1) => {
138
+ const S = (k = !1) => {
138
139
  for (; s.at(-1)?.type === "hardBreak"; ) s.pop();
139
140
  for (; s[0]?.type === "hardBreak"; ) s.shift();
140
141
  (s.length || k) && n.push(o(s.length ? s : [])), s = [];
141
142
  };
142
143
  for (const k of a) {
143
144
  if (k.type !== "image") {
144
- s.push(...ka(k));
145
+ s.push(...xa(k));
145
146
  continue;
146
147
  }
147
148
  if (i.imagesApart) {
148
149
  u.push({ id: k.id, alt: k.alt });
149
150
  continue;
150
151
  }
151
- A(), n.push({ type: "fileImage", attrs: { id: k.id, alt: k.alt } });
152
+ S(), n.push({ type: "fileImage", attrs: { id: k.id, alt: k.alt } });
152
153
  }
153
- return A(!n.length), n.map((k) => k.content?.length === 0 ? { ...k, content: void 0 } : k);
154
+ return S(!n.length), n.map((k) => k.content?.length === 0 ? { ...k, content: void 0 } : k);
154
155
  }
155
- function it(a, o, i) {
156
+ function nt(a, o, i) {
156
157
  return {
157
158
  type: a.ordered ? "orderedList" : "bulletList",
158
159
  attrs: a.ordered ? { start: a.start } : void 0,
159
160
  content: a.items.map((u) => ({
160
161
  type: "listItem",
161
162
  content: [
162
- ...rt(u.parts, (n) => ({ type: "paragraph", content: n }), o, i),
163
- ...u.list ? [it(u.list, o, i)] : []
163
+ ...it(u.parts, (n) => ({ type: "paragraph", content: n }), o, i),
164
+ ...u.list ? [nt(u.list, o, i)] : []
164
165
  ]
165
166
  }))
166
167
  };
167
168
  }
168
- function ka(a) {
169
+ function xa(a) {
169
170
  if (a.type === "mention") return [{ type: "mention", attrs: { id: a.id, label: a.label } }];
170
171
  if (a.type === "code") return [{ type: "text", text: a.text, marks: [{ type: "code" }] }];
171
172
  const o = [];
@@ -176,31 +177,31 @@ function ka(a) {
176
177
  n && i.push({ type: "hardBreak" }), u && i.push(o.length ? { type: "text", text: u, marks: o } : { type: "text", text: u });
177
178
  }), i;
178
179
  }
179
- function xa(a, o = {}) {
180
+ function wa(a, o = {}) {
180
181
  const i = o.blockSeparator ?? `
181
182
 
182
183
  `;
183
- return nt(a.content ?? [], "", i).replace(/\s+$/, "");
184
+ return ot(a.content ?? [], "", i).replace(/\s+$/, "");
184
185
  }
185
- function nt(a, o, i) {
186
+ function ot(a, o, i) {
186
187
  const u = [];
187
188
  for (const n of a) {
188
- const s = wa(n, o);
189
+ const s = Ma(n, o);
189
190
  s !== null && u.push(s);
190
191
  }
191
192
  return u.join(i);
192
193
  }
193
- function wa(a, o) {
194
+ function Ma(a, o) {
194
195
  switch (a.type) {
195
196
  case "paragraph":
196
- return _e(a.content ?? [], o);
197
+ return Ce(a.content ?? [], o);
197
198
  case "heading":
198
- return `${"#".repeat(a.attrs?.level === 3 ? 3 : 2)} ${_e(a.content ?? [], o)}`;
199
+ return `${"#".repeat(a.attrs?.level === 3 ? 3 : 2)} ${Ce(a.content ?? [], o)}`;
199
200
  case "bulletList":
200
201
  case "orderedList":
201
- return st(a, 0);
202
+ return ut(a, 0);
202
203
  case "blockquote":
203
- return nt(a.content ?? [], "", `
204
+ return ot(a.content ?? [], "", `
204
205
 
205
206
  `).split(`
206
207
  `).map((i) => i ? `> ${i}` : ">").join(`
@@ -212,31 +213,31 @@ ${i}
212
213
  ${u}`;
213
214
  }
214
215
  case "fileImage":
215
- return a.attrs?.id ? lt(a) : null;
216
+ return a.attrs?.id ? st(a) : null;
216
217
  default:
217
218
  return null;
218
219
  }
219
220
  }
220
- const ot = (a) => a.replace(/\n/g, " ").replace(/[\\[\]]/g, "\\$&"), lt = (a) => `![${ot(String(a.attrs?.alt ?? ""))}](file:${a.attrs.id})`, Ma = (a) => a.replace(/[\\*`[\]]/g, "\\$&").replace(/~(?=~)/g, "\\~").replace(/&(?=(?:lt|gt|amp|nbsp);)/g, "\\&"), _a = /^([ \t]*)(?:(#|>|-(?=[ \t]))|(\d{1,9})(?=[.)][ \t]))/gm, Ca = (a) => a.replace(_a, (o, i, u, n) => u ? `${i}\\${u}` : `${i}${n}\\`);
221
- function st(a, o) {
221
+ const lt = (a) => a.replace(/\n/g, " ").replace(/[\\[\]]/g, "\\$&"), st = (a) => `![${lt(String(a.attrs?.alt ?? ""))}](file:${a.attrs.id})`, _a = (a) => a.replace(/[\\*`[\]]/g, "\\$&").replace(/~(?=~)/g, "\\~").replace(/&(?=(?:lt|gt|amp|nbsp);)/g, "\\&"), Ca = /^([ \t]*)(?:(#|>|-(?=[ \t]))|(\d{1,9})(?=[.)][ \t]))/gm, $a = (a) => a.replace(Ca, (o, i, u, n) => u ? `${i}\\${u}` : `${i}${n}\\`);
222
+ function ut(a, o) {
222
223
  const i = a.type === "orderedList", u = Number(a.attrs?.start ?? 1) || 1, n = " ".repeat(Math.min(o, 1)), s = [];
223
- return (a.content ?? []).forEach((A, k) => {
224
+ return (a.content ?? []).forEach((S, k) => {
224
225
  const h = i ? `${u + k}. ` : "- ", m = n + " ".repeat(h.length);
225
226
  let v = !0;
226
- for (const c of A.content ?? []) {
227
+ for (const c of S.content ?? []) {
227
228
  if (c.type === "bulletList" || c.type === "orderedList") {
228
- s.push(st(c, o + 1));
229
+ s.push(ut(c, o + 1));
229
230
  continue;
230
231
  }
231
- const f = c.type === "fileImage" ? c.attrs?.id ? lt(c) : "" : c.type === "paragraph" || c.type === "heading" ? _e(c.content ?? [], m) : "";
232
+ const f = c.type === "fileImage" ? c.attrs?.id ? st(c) : "" : c.type === "paragraph" || c.type === "heading" ? Ce(c.content ?? [], m) : "";
232
233
  !f && !v || (s.push(v ? `${n}${h}${f}` : `${m}${f}`), v = !1);
233
234
  }
234
235
  v && s.push(`${n}${h}`.trimEnd());
235
236
  }), s.join(`
236
237
  `);
237
238
  }
238
- const et = [["bold", "**"], ["italic", "*"], ["strike", "~~"]], $a = /^(?:https?:\/\/[^\s/]|mailto:[^\s@]+@)/i;
239
- function _e(a, o) {
239
+ const tt = [["bold", "**"], ["italic", "*"], ["strike", "~~"]], Pa = /^(?:https?:\/\/[^\s/]|mailto:[^\s@]+@)/i;
240
+ function Ce(a, o) {
240
241
  const i = [];
241
242
  for (let h = 0; h < a.length; h++) {
242
243
  const m = a[h];
@@ -250,29 +251,29 @@ function _e(a, o) {
250
251
  }
251
252
  if (m.type !== "text" || !m.text) continue;
252
253
  const v = new Set((m.marks ?? []).map((f) => f.type)), c = m.marks?.find((f) => f.type === "link")?.attrs?.href;
253
- if (c && $a.test(c)) {
254
+ if (c && Pa.test(c)) {
254
255
  let f = m.text;
255
- const x = new Set(v);
256
+ const w = new Set(v);
256
257
  for (; a[h + 1]?.type === "text" && a[h + 1].marks?.some((z) => z.type === "link" && z.attrs?.href === c); ) {
257
258
  const z = a[++h];
258
259
  f += z.text;
259
260
  const N = new Set((z.marks ?? []).map(($) => $.type));
260
- for (const $ of x) N.has($) || x.delete($);
261
+ for (const $ of w) N.has($) || w.delete($);
261
262
  }
262
- x.delete("link"), x.delete("code"), i.push({ marks: x, raw: `[${ot(f.trim()) || c}](${c})` });
263
+ w.delete("link"), w.delete("code"), i.push({ marks: w, raw: `[${lt(f.trim()) || c}](${c})` });
263
264
  continue;
264
265
  }
265
266
  if (v.has("code")) {
266
267
  v.delete("code"), i.push({ marks: v, raw: `\`${m.text.replace(/`/g, "ˋ")}\`` });
267
268
  continue;
268
269
  }
269
- i.push({ marks: v, raw: Ma(m.text) });
270
+ i.push({ marks: v, raw: _a(m.text) });
270
271
  }
271
272
  let u = "", n = [], s = "";
272
- const A = (h) => {
273
+ const S = (h) => {
273
274
  const m = n.findIndex((v) => !h.has(v));
274
275
  if (!(m < 0)) {
275
- for (const v of n.slice(m).reverse()) u += et.find(([c]) => c === v)[1];
276
+ for (const v of n.slice(m).reverse()) u += tt.find(([c]) => c === v)[1];
276
277
  n = n.slice(0, m);
277
278
  }
278
279
  }, k = (h, m) => {
@@ -286,7 +287,7 @@ function _e(a, o) {
286
287
  };
287
288
  return i.forEach((h, m) => {
288
289
  if ("lineBreak" in h) {
289
- A(/* @__PURE__ */ new Set()), u += s + `
290
+ S(/* @__PURE__ */ new Set()), u += s + `
290
291
  ` + o, s = "";
291
292
  return;
292
293
  }
@@ -295,39 +296,39 @@ function _e(a, o) {
295
296
  s += h.raw;
296
297
  return;
297
298
  }
298
- A(h.marks), u += s + v, s = h.raw.slice(v.length + c.length);
299
- const f = et.filter(([x]) => h.marks.has(x) && !n.includes(x)).sort((x, z) => k(m, z[0]) - k(m, x[0]));
300
- for (const [x, z] of f)
301
- u += z, n.push(x);
299
+ S(h.marks), u += s + v, s = h.raw.slice(v.length + c.length);
300
+ const f = tt.filter(([w]) => h.marks.has(w) && !n.includes(w)).sort((w, z) => k(m, z[0]) - k(m, w[0]));
301
+ for (const [w, z] of f)
302
+ u += z, n.push(w);
302
303
  u += c;
303
- }), A(/* @__PURE__ */ new Set()), Ca(u + s).replace(/\s+$/, "");
304
+ }), S(/* @__PURE__ */ new Set()), $a(u + s).replace(/\s+$/, "");
304
305
  }
305
- const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label", "title", "aria-pressed", "disabled", "data-ui-rich-tool", "onClick"], Sa = ["aria-label", "title", "disabled"], za = {
306
+ const La = ["data-variant", "data-over"], Sa = ["aria-label"], Aa = ["aria-label", "title", "aria-pressed", "disabled", "data-ui-rich-tool", "onClick"], za = ["aria-label", "title", "disabled"], Ea = {
306
307
  key: 1,
307
308
  class: "flex items-center gap-1.5 border-b border-[var(--ui-border-subtle)] px-2 py-1.5",
308
309
  "data-ui-rich-link-row": ""
309
- }, Ea = ["aria-label"], Ba = ["aria-label", "title", "aria-pressed", "onClick"], Ta = ["aria-label"], Ia = ["data-ui-rich-attachment"], Ra = ["src", "alt"], Ha = {
310
+ }, Ba = ["aria-label"], Ta = ["aria-label", "title", "aria-pressed", "onClick"], Ia = ["aria-label"], Ra = ["data-ui-rich-attachment"], Ha = ["src", "alt"], qa = {
310
311
  key: 0,
311
312
  class: "absolute inset-0 flex items-center justify-center bg-[color-mix(in_srgb,var(--ui-danger)_35%,transparent)]"
312
- }, qa = {
313
+ }, Fa = {
313
314
  key: 1,
314
315
  class: "absolute inset-0 flex items-center justify-center"
315
- }, Fa = ["aria-label", "onClick"], Na = {
316
+ }, Na = ["aria-label", "onClick"], Ua = {
316
317
  key: 4,
317
318
  class: "flex items-center gap-1.5 border-t border-[var(--ui-border-subtle)] px-2 py-1.5",
318
319
  "data-ui-rich-link-row": ""
319
- }, Ua = ["aria-label"], Va = ["aria-label", "title", "aria-pressed", "disabled", "data-ui-rich-tool", "onClick"], Da = {
320
+ }, Va = ["aria-label"], Da = ["aria-label", "title", "aria-pressed", "disabled", "data-ui-rich-tool", "onClick"], Oa = {
320
321
  key: 6,
321
322
  class: "flex min-w-0 items-center gap-0.5 px-1 pb-1",
322
323
  "data-ui-rich-actions": ""
323
- }, Oa = ["aria-label", "title", "disabled"], ja = ["aria-label", "title", "disabled"], Ka = ["aria-label", "title", "aria-pressed", "aria-expanded", "disabled"], Ga = ["aria-label", "title", "disabled"], Qa = {
324
+ }, ja = ["aria-label", "title", "disabled"], Ka = ["aria-label", "title", "disabled"], Ga = ["aria-label", "title", "aria-pressed", "aria-expanded", "disabled"], Qa = ["aria-label", "title", "disabled"], Wa = {
324
325
  key: 7,
325
326
  class: "flex flex-col gap-2 border-t border-[var(--ui-border-subtle)] px-3 py-2"
326
- }, Wa = {
327
+ }, Ja = {
327
328
  "aria-live": "polite",
328
329
  class: "empty:hidden",
329
330
  "data-ui-rich-notes": ""
330
- }, oe = Rt(null), lr = /* @__PURE__ */ At({
331
+ }, oe = Ht(null), sr = /* @__PURE__ */ At({
331
332
  inheritAttrs: !1,
332
333
  __name: "RichTextEditor",
333
334
  props: {
@@ -350,30 +351,30 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
350
351
  },
351
352
  emits: ["update:modelValue", "submit", "search", "pending"],
352
353
  setup(a, { emit: o }) {
353
- const i = a, u = o, n = aa(), s = M(() => i.variant === "compact"), A = M(() => i.headings ?? !s.value), k = M(() => i.maxImages ?? (s.value ? 20 : 50)), h = typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches, v = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl+", c = q([]), f = /* @__PURE__ */ new Set(), x = q([]);
354
+ const i = a, u = o, n = ra(), s = x(() => i.variant === "compact"), S = x(() => i.headings ?? !s.value), k = x(() => i.maxImages ?? (s.value ? 20 : 50)), h = typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches, v = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl+", c = q([]), f = /* @__PURE__ */ new Set(), w = q([]);
354
355
  let z;
355
356
  function N(...e) {
356
- clearTimeout(z), x.value = e, e.length && (z = setTimeout(() => {
357
- x.value = [];
357
+ clearTimeout(z), w.value = e, e.length && (z = setTimeout(() => {
358
+ w.value = [];
358
359
  }, 8e3));
359
360
  }
360
- const $ = ra((e, t) => i.upload(e, t), {
361
- onDone: (e) => ut(e),
361
+ const $ = ia((e, t) => i.upload(e, t), {
362
+ onDone: (e) => dt(e),
362
363
  onFailed: (e) => ue(e.key, -1)
363
- }), U = M(() => $.tasks.filter((e) => e.status !== "done" && e.status !== "canceled")), le = M(() => U.value.length);
364
+ }), U = x(() => $.tasks.filter((e) => e.status !== "done" && e.status !== "canceled")), le = x(() => U.value.length);
364
365
  G(() => $.tasks.map((e) => e.status === "uploading" && e.size ? e.loaded / e.size : -2), (e) => {
365
366
  e.forEach((t, r) => {
366
367
  t >= 0 && ue($.tasks[r].key, t);
367
368
  });
368
369
  }), G(le, (e) => u("pending", e));
369
- function ut(e) {
370
+ function dt(e) {
370
371
  const t = c.value.find((r) => r.task === e.key);
371
372
  t && (t.id = e.result, t.task = void 0), de(e.key, (r, d) => g.value?.view.dispatch(g.value.state.tr.setNodeMarkup(r, void 0, { ...d, id: e.result, upload: null, progress: 1 }))), $.remove(e.key), Y();
372
373
  }
373
374
  const se = /* @__PURE__ */ new Map();
374
375
  function ue(e, t) {
375
376
  const r = t < 0 ? -1 : Math.floor(t * 20) / 20;
376
- se.get(e) !== r && (se.set(e, r), de(e, (d, w) => g.value?.view.dispatch(g.value.state.tr.setNodeMarkup(d, void 0, { ...w, progress: r }).setMeta("addToHistory", !1))));
377
+ se.get(e) !== r && (se.set(e, r), de(e, (d, M) => g.value?.view.dispatch(g.value.state.tr.setNodeMarkup(d, void 0, { ...M, progress: r }).setMeta("addToHistory", !1))));
377
378
  }
378
379
  function de(e, t) {
379
380
  g.value?.state.doc.descendants((r, d) => {
@@ -381,79 +382,79 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
381
382
  return t(d, r.attrs), !1;
382
383
  });
383
384
  }
384
- function dt() {
385
+ function ct() {
385
386
  if (s.value) return c.value.length;
386
387
  let e = 0;
387
388
  return g.value?.state.doc.descendants((t) => {
388
389
  t.type.name === "fileImage" && e++;
389
390
  }), e;
390
391
  }
391
- const ct = (e) => e.split(".").pop()?.toUpperCase() ?? "";
392
+ const ft = (e) => e.split(".").pop()?.toUpperCase() ?? "";
392
393
  function ae(e, t) {
393
394
  if (!i.upload || i.disabled || !e.length) return;
394
395
  const r = [], d = [];
395
- let w = k.value - dt();
396
+ let M = k.value - ct();
396
397
  for (const L of e)
397
- la(L) ? r.push(n("{name}: {kind} images are not supported; on an iPhone, set Settings > Camera > Formats to Most Compatible", { name: L.name, kind: ct(L.name) || "HEIC" })) : sa(L) ? w <= 0 ? r.push(n("You can add up to {count} images", { count: k.value })) : (d.push(L), w--) : r.push(n("{name} is not a JPEG, PNG, WebP or GIF image", { name: L.name }));
398
+ sa(L) ? r.push(n("{name}: {kind} images are not supported; on an iPhone, set Settings > Camera > Formats to Most Compatible", { name: L.name, kind: ft(L.name) || "HEIC" })) : ua(L) ? M <= 0 ? r.push(n("You can add up to {count} images", { count: k.value })) : (d.push(L), M--) : r.push(n("{name} is not a JPEG, PNG, WebP or GIF image", { name: L.name }));
398
399
  if (N(...new Set(r)), !d.length) return;
399
- const Ve = $.add(d).map((L, je) => {
400
- const Ke = URL.createObjectURL(d[je]);
401
- return f.add(Ke), { key: L.key, name: d[je].name, src: Ke };
400
+ const De = $.add(d).map((L, Ke) => {
401
+ const Ge = URL.createObjectURL(d[Ke]);
402
+ return f.add(Ge), { key: L.key, name: d[Ke].name, src: Ge };
402
403
  });
403
404
  if (s.value) {
404
- c.value.push(...Ve.map((L) => ({ key: L.key, task: L.key, name: L.name, alt: "", src: L.src }))), Y();
405
+ c.value.push(...De.map((L) => ({ key: L.key, task: L.key, name: L.name, alt: "", src: L.src }))), Y();
405
406
  return;
406
407
  }
407
- const De = Ve.map((L) => ({ type: "fileImage", attrs: { upload: L.key, src: L.src, alt: "", progress: 0 } })), Oe = g.value?.chain().focus();
408
- t === void 0 ? Oe?.insertContent(De).run() : Oe?.insertContentAt(t, De).run();
408
+ const Oe = De.map((L) => ({ type: "fileImage", attrs: { upload: L.key, src: L.src, alt: "", progress: 0 } })), je = g.value?.chain().focus();
409
+ t === void 0 ? je?.insertContent(Oe).run() : je?.insertContentAt(t, Oe).run();
409
410
  }
410
- function ft(e) {
411
+ function pt(e) {
411
412
  e.task && $.remove(e.task), c.value = c.value.filter((t) => t.key !== e.key), Y();
412
413
  }
413
414
  function ce(e) {
414
415
  se.delete(e), ue(e, 0), $.retry(e);
415
416
  }
416
- function $e(e) {
417
+ function Pe(e) {
417
418
  $.remove(e), c.value = c.value.filter((t) => t.task !== e), de(e, (t, r) => {
418
419
  g.value?.view.dispatch(g.value.state.tr.delete(t, t + 1));
419
420
  }), Y();
420
421
  }
421
- const Pe = q();
422
- function Le() {
423
- Pe.value?.click();
422
+ const Le = q();
423
+ function Se() {
424
+ Le.value?.click();
424
425
  }
425
- function pt(e) {
426
+ function mt(e) {
426
427
  const t = e.target;
427
428
  ae(Array.from(t.files ?? [])), t.value = "";
428
429
  }
429
430
  const fe = [];
430
- function mt(e) {
431
+ function vt(e) {
431
432
  const t = new DOMParser().parseFromString(e, "text/html");
432
433
  let r = !1;
433
434
  for (const d of Array.from(t.querySelectorAll("img"))) {
434
435
  if (d.hasAttribute("data-file-id")) continue;
435
- const w = d.getAttribute("src") ?? "";
436
- /^data:image\//i.test(w) || w && new URL(w, location.href).origin === location.origin && !/^data:/i.test(w) ? fe.push(w) : r = !0, d.remove();
436
+ const M = d.getAttribute("src") ?? "";
437
+ /^data:image\//i.test(M) || M && new URL(M, location.href).origin === location.origin && !/^data:/i.test(M) ? fe.push(M) : r = !0, d.remove();
437
438
  }
438
- return r && N(n("Images from other websites are not pasted; save them first and add them as files")), fe.length && setTimeout(vt), t.body.innerHTML;
439
+ return r && N(n("Images from other websites are not pasted; save them first and add them as files")), fe.length && setTimeout(bt), t.body.innerHTML;
439
440
  }
440
- async function vt() {
441
+ async function bt() {
441
442
  const e = fe.splice(0), t = [];
442
443
  for (const [r, d] of e.entries())
443
444
  try {
444
- const w = await (await fetch(d)).blob();
445
- t.push(new File([w], `pasted-${r + 1}.${w.type.split("/")[1] ?? "png"}`, { type: w.type }));
445
+ const M = await (await fetch(d)).blob();
446
+ t.push(new File([M], `pasted-${r + 1}.${M.type.split("/")[1] ?? "png"}`, { type: M.type }));
446
447
  } catch {
447
448
  }
448
449
  ae(t);
449
450
  }
450
- const pe = St(), b = zt({
451
+ const pe = zt(), b = Et({
451
452
  open: !1,
452
453
  query: "",
453
454
  active: 0,
454
455
  reference: null,
455
456
  command: null
456
- }), W = M(() => {
457
+ }), W = x(() => {
457
458
  const e = b.query.toLocaleLowerCase();
458
459
  return i.filter && e ? i.candidates.filter((t) => [t.label, t.id, t.description ?? ""].some((r) => r.toLocaleLowerCase().includes(e))) : i.candidates;
459
460
  });
@@ -464,80 +465,80 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
464
465
  const t = e.clientRect;
465
466
  b.reference = t ? { getBoundingClientRect: () => t() ?? new DOMRect() } : null, b.command = (r) => e.command(r), !(e.editor.view.composing && b.open) && ((b.query !== e.query || !b.open) && (b.query = e.query, b.active = 0, u("search", e.query)), b.open = !0);
466
467
  }
467
- function Se(e) {
468
+ function ze(e) {
468
469
  b.command?.({ id: e.id, label: e.label }), b.open = !1;
469
470
  }
470
- function bt({ event: e }) {
471
+ function ht({ event: e }) {
471
472
  if (e.isComposing || e.keyCode === 229) return !1;
472
473
  const t = W.value.length;
473
474
  if (e.key === "ArrowDown" && t) b.active = (b.active + 1) % t;
474
475
  else if (e.key === "ArrowUp" && t) b.active = (b.active - 1 + t) % t;
475
- else if ((e.key === "Enter" || e.key === "Tab") && t) Se(W.value[b.active]);
476
+ else if ((e.key === "Enter" || e.key === "Tab") && t) ze(W.value[b.active]);
476
477
  else if (e.key === "Escape") b.open = !1;
477
478
  else return !1;
478
479
  return !0;
479
480
  }
480
- const ht = (e) => `${pe}-${e}`, S = () => g.value.chain().focus(), P = (e, t) => g.value?.isActive(e, t) ?? !1, gt = [
481
- { key: "bold", label: "Bold", icon: Nt, shortcut: `${v}B`, active: () => P("bold"), run: () => S().toggleBold().run() },
482
- { key: "italic", label: "Italic", icon: Ut, shortcut: `${v}I`, active: () => P("italic"), run: () => S().toggleItalic().run() },
483
- { key: "link", label: "Link", icon: Vt, shortcut: `${v}K`, active: () => P("link"), run: () => He() },
484
- { key: "bulletList", label: "Bulleted list", icon: Dt, active: () => P("bulletList"), run: () => S().toggleBulletList().run() },
485
- { key: "orderedList", label: "Numbered list", icon: Ot, active: () => P("orderedList"), run: () => S().toggleOrderedList().run() },
486
- { key: "h2", label: "Heading", icon: jt, active: () => P("heading", { level: 2 }), run: () => S().toggleHeading({ level: 2 }).run(), full: !0 },
487
- { key: "h3", label: "Subheading", icon: Kt, active: () => P("heading", { level: 3 }), run: () => S().toggleHeading({ level: 3 }).run(), full: !0 },
488
- { key: "code", label: "Code", icon: Gt, active: () => P("code"), run: () => S().toggleCode().run() },
489
- { key: "quote", label: "Quote", icon: Qt, active: () => P("blockquote"), run: () => S().toggleBlockquote().run() },
490
- { key: "codeBlock", label: "Code block", icon: Wt, active: () => P("codeBlock"), run: () => S().toggleCodeBlock().run() },
491
- { key: "strike", label: "Strikethrough", icon: Jt, active: () => P("strike"), run: () => S().toggleStrike().run() }
492
- ], re = M(() => gt.filter((e) => !e.full || A.value)), yt = ["bold", "italic", "link", "code", "bulletList"], kt = M(() => re.value.filter((e) => yt.includes(e.key))), V = (e) => e.shortcut ? `${n(e.label)} (${e.shortcut})` : n(e.label), me = /* @__PURE__ */ Symbol("rich-text-editor"), J = M(() => oe.value === me);
493
- function ze() {
481
+ const gt = (e) => `${pe}-${e}`, A = () => g.value.chain().focus(), P = (e, t) => g.value?.isActive(e, t) ?? !1, yt = [
482
+ { key: "bold", label: "Bold", icon: Ut, shortcut: `${v}B`, active: () => P("bold"), run: () => A().toggleBold().run() },
483
+ { key: "italic", label: "Italic", icon: Vt, shortcut: `${v}I`, active: () => P("italic"), run: () => A().toggleItalic().run() },
484
+ { key: "link", label: "Link", icon: Dt, shortcut: `${v}K`, active: () => P("link"), run: () => qe() },
485
+ { key: "bulletList", label: "Bulleted list", icon: Ot, active: () => P("bulletList"), run: () => A().toggleBulletList().run() },
486
+ { key: "orderedList", label: "Numbered list", icon: jt, active: () => P("orderedList"), run: () => A().toggleOrderedList().run() },
487
+ { key: "h2", label: "Heading", icon: Kt, active: () => P("heading", { level: 2 }), run: () => A().toggleHeading({ level: 2 }).run(), full: !0 },
488
+ { key: "h3", label: "Subheading", icon: Gt, active: () => P("heading", { level: 3 }), run: () => A().toggleHeading({ level: 3 }).run(), full: !0 },
489
+ { key: "code", label: "Code", icon: Qt, active: () => P("code"), run: () => A().toggleCode().run() },
490
+ { key: "quote", label: "Quote", icon: Wt, active: () => P("blockquote"), run: () => A().toggleBlockquote().run() },
491
+ { key: "codeBlock", label: "Code block", icon: Jt, active: () => P("codeBlock"), run: () => A().toggleCodeBlock().run() },
492
+ { key: "strike", label: "Strikethrough", icon: Xt, active: () => P("strike"), run: () => A().toggleStrike().run() }
493
+ ], re = x(() => yt.filter((e) => !e.full || S.value)), kt = ["bold", "italic", "link", "code", "bulletList"], xt = x(() => re.value.filter((e) => kt.includes(e.key))), V = (e) => e.shortcut ? `${n(e.label)} (${e.shortcut})` : n(e.label), me = /* @__PURE__ */ Symbol("rich-text-editor"), J = x(() => oe.value === me);
494
+ function Ee() {
494
495
  oe.value = J.value ? null : me, g.value?.commands.focus();
495
496
  }
496
497
  const ve = q(), be = q(1 / 0);
497
498
  let he;
498
- const ge = 34, ie = M(() => [
499
+ const ge = h ? 46 : 34, ie = x(() => [
499
500
  ...re.value.map((e) => ({ key: e.key, label: e.label, icon: e.icon, action: e })),
500
- ...i.upload ? [{ key: "image", label: "Add image", icon: Qe, action: void 0 }] : [],
501
- { key: "mention", label: "Mention someone", icon: We, action: void 0 }
502
- ]), Ee = M(() => ie.value.length * ge <= be.value ? ie.value.length : Math.max(1, Math.floor((be.value - ge) / ge))), xt = M(() => ie.value.slice(0, Ee.value)), Be = M(() => ie.value.slice(Ee.value).map((e) => ({ key: e.key, label: n(e.label), icon: e.icon })));
503
- function Te(e) {
504
- if (e === "image") return Le();
505
- if (e === "mention") return Ie();
501
+ ...i.upload ? [{ key: "image", label: "Add image", icon: We, action: void 0 }] : [],
502
+ { key: "mention", label: "Mention someone", icon: Je, action: void 0 }
503
+ ]), Be = x(() => ie.value.length * ge <= be.value ? ie.value.length : Math.max(1, Math.floor((be.value - ge) / ge))), wt = x(() => ie.value.slice(0, Be.value)), Te = x(() => ie.value.slice(Be.value).map((e) => ({ key: e.key, label: n(e.label), icon: e.icon })));
504
+ function Ie(e) {
505
+ if (e === "image") return Se();
506
+ if (e === "mention") return Re();
506
507
  re.value.find((t) => t.key === e)?.run();
507
508
  }
508
- function Ie() {
509
+ function Re() {
509
510
  const e = g.value;
510
511
  if (!e) return;
511
512
  const { $from: t } = e.state.selection, r = t.parent.textBetween(Math.max(0, t.parentOffset - 1), t.parentOffset, `
512
513
  `, " ");
513
- S().insertContent(r && !/\s/.test(r) ? " @" : "@").run();
514
+ A().insertContent(r && !/\s/.test(r) ? " @" : "@").run();
514
515
  }
515
- const Re = /^(?:https?:\/\/[^\s/]|mailto:[^\s@]+@)/i, D = q(!1), O = q(""), ne = q();
516
- function He() {
516
+ const He = /^(?:https?:\/\/[^\s/]|mailto:[^\s@]+@)/i, D = q(!1), O = q(""), ne = q();
517
+ function qe() {
517
518
  return O.value = g.value?.getAttributes("link").href ?? "", D.value = !0, setTimeout(() => (ne.value?.$el?.querySelector("input") ?? ne.value?.$el)?.focus?.()), !0;
518
519
  }
519
- function wt(e) {
520
+ function Mt(e) {
520
521
  const t = e.trim();
521
- return !t || Re.test(t) ? t : /^[^\s@/]+@[^\s@]+\.[^\s@]+$/.test(t) ? `mailto:${t}` : /^[^\s]+\.[^\s]+$/.test(t) ? `https://${t}` : t;
522
+ return !t || He.test(t) ? t : /^[^\s@/]+@[^\s@]+\.[^\s@]+$/.test(t) ? `mailto:${t}` : /^[^\s]+\.[^\s]+$/.test(t) ? `https://${t}` : t;
522
523
  }
523
524
  function ye() {
524
- const e = wt(O.value);
525
+ const e = Mt(O.value);
525
526
  if (!e) return ke();
526
- if (!Re.test(e)) return N(n("Links start with http://, https:// or mailto:"));
527
- g.value.state.selection.empty && !P("link") ? S().insertContent({ type: "text", text: e, marks: [{ type: "link", attrs: { href: e } }] }).run() : S().extendMarkRange("link").setLink({ href: e }).run(), j();
527
+ if (!He.test(e)) return N(n("Links start with http://, https:// or mailto:"));
528
+ g.value.state.selection.empty && !P("link") ? A().insertContent({ type: "text", text: e, marks: [{ type: "link", attrs: { href: e } }] }).run() : A().extendMarkRange("link").setLink({ href: e }).run(), j();
528
529
  }
529
530
  function ke() {
530
- S().extendMarkRange("link").unsetLink().run(), j();
531
+ A().extendMarkRange("link").unsetLink().run(), j();
531
532
  }
532
533
  function j() {
533
534
  D.value = !1, g.value?.commands.focus();
534
535
  }
535
- function qe(e) {
536
+ function Fe(e) {
536
537
  e.isComposing || e.keyCode === 229 || (e.key === "Enter" ? (e.preventDefault(), ye()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), j()));
537
538
  }
538
539
  let X = i.modelValue;
539
- function Mt() {
540
- const e = g.value?.getJSON() ?? {}, t = xa(e, s.value ? { blockSeparator: `
540
+ function _t() {
541
+ const e = g.value?.getJSON() ?? {}, t = wa(e, s.value ? { blockSeparator: `
541
542
  ` } : {});
542
543
  if (!s.value) return t;
543
544
  const r = c.value.filter((d) => d.id).map((d) => `![${d.alt.replace(/[[\]\n]/g, " ")}](file:${d.id})`);
@@ -547,19 +548,19 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
547
548
  `);
548
549
  }
549
550
  function Y() {
550
- const e = Mt();
551
+ const e = _t();
551
552
  e !== X && (X = e, u("update:modelValue", e));
552
553
  }
553
- function Fe(e) {
554
- const { doc: t, images: r } = ya(e, { people: i.candidates, headings: A.value, imagesApart: s.value });
554
+ function Ne(e) {
555
+ const { doc: t, images: r } = ka(e, { people: i.candidates, headings: S.value, imagesApart: s.value });
555
556
  for (const d of c.value) d.task && $.remove(d.task);
556
557
  return c.value = r.map((d) => ({ key: d.id, id: d.id, name: i.files?.(d.id)?.name ?? d.alt, alt: d.alt })), t;
557
558
  }
558
- const g = Ht({
559
- content: Fe(i.modelValue),
559
+ const g = qt({
560
+ content: Ne(i.modelValue),
560
561
  editable: !i.disabled,
561
- extensions: ga({
562
- headings: A.value,
562
+ extensions: ya({
563
+ headings: S.value,
563
564
  placeholder: i.placeholder,
564
565
  image: { file: (e) => i.files?.(e), labels: { uploading: n("Uploading"), failed: n("Upload failed"), missing: n("File is missing") } },
565
566
  mention: {
@@ -567,13 +568,15 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
567
568
  allowSpaces: !1,
568
569
  render: () => ({ onStart: Ae, onUpdate: Ae, onExit: () => {
569
570
  b.open = !1;
570
- }, onKeyDown: bt })
571
+ }, onKeyDown: ht })
571
572
  },
572
- submit: () => s.value ? (Ue(), !0) : !1,
573
- link: He,
573
+ submit: () => s.value ? (we(), !0) : !1,
574
+ // A phone keyboard has no Ctrl+Enter: its return key says Send and sends (an open @ list keeps Enter to pick).
575
+ enter: () => Ve.value && !b.open ? (we(), !0) : !1,
576
+ link: qe,
574
577
  escape: () => {
575
578
  if (D.value) j();
576
- else if (J.value) ze();
579
+ else if (J.value) Ee();
577
580
  else return !1;
578
581
  return !0;
579
582
  }
@@ -585,7 +588,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
585
588
  "aria-multiline": "true",
586
589
  "data-ui-rich-editor-content": ""
587
590
  },
588
- transformPastedHTML: mt,
591
+ transformPastedHTML: vt,
589
592
  handlePaste: (e, t) => {
590
593
  const r = Array.from(t.clipboardData?.files ?? []);
591
594
  if (!r.length || !i.upload) return !1;
@@ -593,47 +596,48 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
593
596
  return d && new DOMParser().parseFromString(d, "text/html").body.textContent?.trim() ? !1 : (t.preventDefault(), ae(r), !0);
594
597
  },
595
598
  handleDrop: (e, t, r, d) => {
596
- const w = Array.from(t.dataTransfer?.files ?? []);
597
- return d || !w.length || !i.upload ? !1 : (t.preventDefault(), ae(w, e.posAtCoords({ left: t.clientX, top: t.clientY })?.pos), !0);
599
+ const M = Array.from(t.dataTransfer?.files ?? []);
600
+ return d || !M.length || !i.upload ? !1 : (t.preventDefault(), ae(M, e.posAtCoords({ left: t.clientX, top: t.clientY })?.pos), !0);
598
601
  }
599
602
  },
600
603
  onUpdate: () => Y()
601
604
  });
602
605
  G(() => i.modelValue, (e) => {
603
- e === X || !g.value || (X = e, g.value.commands.setContent(Fe(e), { emitUpdate: !1 }));
606
+ e === X || !g.value || (X = e, g.value.commands.setContent(Ne(e), { emitUpdate: !1 }));
604
607
  }), G(() => i.disabled, (e) => g.value?.setEditable(!e));
605
- const _t = M(() => i.maxlength === void 0 ? 0 : Array.from(i.modelValue).length), K = M(() => (i.maxlength ?? 0) - _t.value), R = M(() => i.maxlength !== void 0 && K.value < 0), xe = M(() => i.maxlength !== void 0 && K.value <= i.maxlength * 0.1), Ct = M(() => !i.modelValue.trim()), Ne = M(() => !i.disabled && !i.sending && !Ct.value && !R.value && !le.value), $t = M(() => ({
608
+ const Ct = x(() => i.maxlength === void 0 ? 0 : Array.from(i.modelValue).length), K = x(() => (i.maxlength ?? 0) - Ct.value), R = x(() => i.maxlength !== void 0 && K.value < 0), xe = x(() => i.maxlength !== void 0 && K.value <= i.maxlength * 0.1), $t = x(() => !i.modelValue.trim()), Ue = x(() => !i.disabled && !i.sending && !$t.value && !R.value && !le.value), Ve = x(() => s.value && !!h), Pt = x(() => ({
606
609
  id: i.id,
610
+ enterkeyhint: Ve.value ? "send" : void 0,
607
611
  "aria-label": i.ariaLabel ?? (i.placeholder || void 0),
608
612
  "aria-invalid": i.invalid || R.value ? "true" : void 0,
609
613
  "aria-disabled": i.disabled ? "true" : void 0,
610
614
  "aria-autocomplete": "list",
611
615
  "aria-controls": b.open ? pe : void 0,
612
- "aria-activedescendant": b.open && W.value.length ? ht(b.active) : void 0
616
+ "aria-activedescendant": b.open && W.value.length ? gt(b.active) : void 0
613
617
  }));
614
- G([g, $t], ([e, t]) => {
618
+ G([g, Pt], ([e, t]) => {
615
619
  const r = e?.view.dom;
616
620
  if (r)
617
- for (const [d, w] of Object.entries(t))
618
- w === void 0 ? r.removeAttribute(d) : r.setAttribute(d, String(w));
621
+ for (const [d, M] of Object.entries(t))
622
+ M === void 0 ? r.removeAttribute(d) : r.setAttribute(d, String(M));
619
623
  }, { immediate: !0 });
620
- function Ue() {
621
- if (!Ne.value) {
624
+ function we() {
625
+ if (!Ue.value) {
622
626
  le.value && N(n("Wait for the images to finish uploading"));
623
627
  return;
624
628
  }
625
629
  u("submit", X);
626
630
  }
627
- const Pt = ({ from: e, to: t }) => !h && e !== t && !D.value && !!g.value?.isEditable && !P("codeBlock") && !P("fileImage");
628
- Et(() => {
631
+ const Lt = ({ from: e, to: t }) => !h && e !== t && !D.value && !!g.value?.isEditable && !P("codeBlock") && !P("fileImage");
632
+ Bt(() => {
629
633
  typeof ResizeObserver > "u" || !ve.value || (he = new ResizeObserver(([e]) => {
630
634
  be.value = e.contentRect.width;
631
635
  }), he.observe(ve.value));
632
- }), Bt(() => {
636
+ }), Tt(() => {
633
637
  he?.disconnect(), $.cancelAll(), clearTimeout(z), oe.value === me && (oe.value = null);
634
638
  for (const e of f) URL.revokeObjectURL(e);
635
639
  });
636
- const H = "relative flex size-8 shrink-0 items-center justify-center rounded-[var(--ui-radius-sm)] border-0 bg-transparent p-0 text-[var(--ui-text-secondary)] outline-none hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-text)] focus-visible:shadow-[var(--ui-shadow-focus)] disabled:pointer-events-none disabled:text-[var(--ui-text-disabled)] aria-pressed:bg-[var(--ui-primary-soft)] aria-pressed:text-[var(--ui-primary)] [@media(pointer:coarse)]:size-11", Lt = [
640
+ const H = "relative flex size-8 shrink-0 items-center justify-center rounded-[var(--ui-radius-sm)] border-0 bg-transparent p-0 text-[var(--ui-text-secondary)] outline-none hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-text)] focus-visible:shadow-[var(--ui-shadow-focus)] disabled:pointer-events-none disabled:text-[var(--ui-text-disabled)] aria-pressed:bg-[var(--ui-primary-soft)] aria-pressed:text-[var(--ui-primary)] [@media(pointer:coarse)]:size-11", St = [
637
641
  "min-w-0 text-[length:var(--ui-font-size)] leading-5 text-[var(--ui-text)] [overflow-wrap:anywhere]",
638
642
  "[&_.ProseMirror]:outline-none [&_.ProseMirror]:whitespace-pre-wrap [&_.ProseMirror_p]:m-0 [&_.ProseMirror>*+*]:mt-2",
639
643
  "[&_.ProseMirror_h2]:m-0 [&_.ProseMirror_h2]:text-[1.25em] [&_.ProseMirror_h2]:font-semibold [&_.ProseMirror_h3]:m-0 [&_.ProseMirror_h3]:text-[1.1em] [&_.ProseMirror_h3]:font-semibold",
@@ -644,7 +648,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
644
648
  "[&_.ProseMirror_a]:text-[var(--ui-primary)] [&_.ProseMirror_a]:underline [&_.ProseMirror_a]:underline-offset-2",
645
649
  "[&_.is-editor-empty:first-child]:before:pointer-events-none [&_.is-editor-empty:first-child]:before:float-start [&_.is-editor-empty:first-child]:before:h-0 [&_.is-editor-empty:first-child]:before:text-[var(--ui-text-muted)] [&_.is-editor-empty:first-child]:before:content-[attr(data-placeholder)]"
646
650
  ];
647
- return (e, t) => (p(), y("div", Tt(e.$attrs, {
651
+ return (e, t) => (p(), y("div", It(e.$attrs, {
648
652
  class: [
649
653
  "flex min-w-0 flex-col rounded-[var(--ui-radius-control)] border bg-[var(--ui-surface)] transition-[border-color,box-shadow] duration-[var(--ui-motion-fast)] focus-within:shadow-[var(--ui-shadow-focus)]",
650
654
  a.invalid || R.value ? "border-[var(--ui-danger)]" : "border-[var(--ui-border)] focus-within:border-[var(--ui-primary)]",
@@ -657,14 +661,14 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
657
661
  }), [
658
662
  B("input", {
659
663
  ref_key: "picker",
660
- ref: Pe,
664
+ ref: Le,
661
665
  type: "file",
662
666
  class: "sr-only",
663
667
  tabindex: "-1",
664
668
  "aria-hidden": "true",
665
669
  accept: "image/jpeg,image/png,image/webp,image/gif",
666
670
  multiple: "",
667
- onChange: pt
671
+ onChange: mt
668
672
  }, null, 544),
669
673
  s.value ? C("", !0) : (p(), y("div", {
670
674
  key: 0,
@@ -675,7 +679,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
675
679
  class: "sticky top-0 z-[1] flex min-w-0 items-center gap-0.5 overflow-hidden rounded-t-[var(--ui-radius-control)] border-b border-[var(--ui-border-subtle)] bg-[var(--ui-surface)] px-1 py-1",
676
680
  "data-ui-rich-toolbar": ""
677
681
  }, [
678
- (p(!0), y(Q, null, Z(xt.value, (r) => (p(), y("button", {
682
+ (p(!0), y(Q, null, Z(wt.value, (r) => (p(), y("button", {
679
683
  key: r.key,
680
684
  type: "button",
681
685
  class: E(H),
@@ -686,18 +690,18 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
686
690
  "data-ui-rich-tool": r.key,
687
691
  onMousedown: t[0] || (t[0] = F(() => {
688
692
  }, ["prevent"])),
689
- onClick: (d) => Te(r.key)
693
+ onClick: (d) => Ie(r.key)
690
694
  }, [
691
- (p(), T(we(r.icon), {
695
+ (p(), T(Me(r.icon), {
692
696
  class: "size-4",
693
697
  "aria-hidden": "true"
694
698
  }))
695
699
  ], 40, Aa))), 128)),
696
- Be.value.length ? (p(), T(l(ia), {
700
+ Te.value.length ? (p(), T(l(na), {
697
701
  key: 0,
698
- items: Be.value,
702
+ items: Te.value,
699
703
  align: "end",
700
- onSelect: Te
704
+ onSelect: Ie
701
705
  }, {
702
706
  trigger: I(() => [
703
707
  B("button", {
@@ -710,17 +714,17 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
710
714
  onMousedown: t[1] || (t[1] = F(() => {
711
715
  }, ["prevent"]))
712
716
  }, [
713
- _(l(Xt), {
717
+ _(l(Yt), {
714
718
  class: "size-4",
715
719
  "aria-hidden": "true"
716
720
  })
717
- ], 40, Sa)
721
+ ], 40, za)
718
722
  ]),
719
723
  _: 1
720
724
  }, 8, ["items"])) : C("", !0)
721
- ], 8, La)),
722
- D.value && !s.value ? (p(), y("div", za, [
723
- _(l(Xe), {
725
+ ], 8, Sa)),
726
+ D.value && !s.value ? (p(), y("div", Ea, [
727
+ _(l(Ye), {
724
728
  ref_key: "linkInput",
725
729
  ref: ne,
726
730
  modelValue: O.value,
@@ -731,15 +735,15 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
731
735
  inputmode: "url",
732
736
  "aria-label": l(n)("Link address"),
733
737
  placeholder: "https://",
734
- onKeydown: qe
738
+ onKeydown: Fe
735
739
  }, null, 8, ["modelValue", "aria-label"]),
736
- _(l(Ye), {
740
+ _(l(Ze), {
737
741
  size: "sm",
738
742
  variant: "primary",
739
743
  onClick: ye
740
744
  }, {
741
745
  default: I(() => [
742
- Ge(ee(l(n)("Apply")), 1)
746
+ Qe(ee(l(n)("Apply")), 1)
743
747
  ]),
744
748
  _: 1
745
749
  }),
@@ -750,7 +754,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
750
754
  onClick: ke
751
755
  }, {
752
756
  default: I(() => [
753
- _(l(Je), {
757
+ _(l(Xe), {
754
758
  class: "size-4",
755
759
  "aria-hidden": "true"
756
760
  })
@@ -763,7 +767,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
763
767
  onClick: j
764
768
  }, {
765
769
  default: I(() => [
766
- _(l(Me), {
770
+ _(l(_e), {
767
771
  class: "size-4",
768
772
  "aria-hidden": "true"
769
773
  })
@@ -771,11 +775,11 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
771
775
  _: 1
772
776
  }, 8, ["label"])
773
777
  ])) : C("", !0),
774
- _(l(qt), {
778
+ _(l(Ft), {
775
779
  editor: l(g),
776
- class: E([Lt, s.value ? "max-h-[calc(8lh+16px)] overflow-y-auto px-2.5 py-2" : "min-h-32 px-3 py-2.5"])
780
+ class: E([St, s.value ? "max-h-[calc(8lh+16px)] overflow-y-auto px-2.5 py-2" : "min-h-32 px-3 py-2.5"])
777
781
  }, null, 8, ["editor", "class"]),
778
- _(l(na), {
782
+ _(l(oa), {
779
783
  id: l(pe),
780
784
  open: b.open,
781
785
  reference: b.reference,
@@ -783,16 +787,16 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
783
787
  active: b.active,
784
788
  loading: a.loading,
785
789
  boundary: l(g)?.view.dom,
786
- onChoose: Se,
790
+ onChoose: ze,
787
791
  onHover: t[3] || (t[3] = (r) => {
788
792
  b.active = r;
789
793
  }),
790
794
  onClose: t[4] || (t[4] = (r) => b.open = !1)
791
795
  }, null, 8, ["id", "open", "reference", "people", "active", "loading", "boundary"]),
792
- l(g) ? (p(), T(l(Ft), {
796
+ l(g) ? (p(), T(l(Nt), {
793
797
  key: 2,
794
798
  editor: l(g),
795
- "should-show": Pt,
799
+ "should-show": Lt,
796
800
  options: { placement: "top", offset: 6 }
797
801
  }, {
798
802
  default: I(() => [
@@ -802,7 +806,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
802
806
  class: "flex items-center gap-0.5 rounded-[var(--ui-radius-md)] border border-[var(--ui-border)] bg-[var(--ui-surface-raised)] p-0.5 shadow-[var(--ui-shadow-menu)]",
803
807
  "data-ui-rich-bubble": ""
804
808
  }, [
805
- (p(!0), y(Q, null, Z(kt.value, (r) => (p(), y("button", {
809
+ (p(!0), y(Q, null, Z(xt.value, (r) => (p(), y("button", {
806
810
  key: r.key,
807
811
  type: "button",
808
812
  class: E(H),
@@ -813,12 +817,12 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
813
817
  }, ["prevent"])),
814
818
  onClick: (d) => r.run()
815
819
  }, [
816
- (p(), T(we(r.icon), {
820
+ (p(), T(Me(r.icon), {
817
821
  class: "size-4",
818
822
  "aria-hidden": "true"
819
823
  }))
820
- ], 40, Ba))), 128))
821
- ], 8, Ea)
824
+ ], 40, Ta))), 128))
825
+ ], 8, Ba)
822
826
  ]),
823
827
  _: 1
824
828
  }, 8, ["editor"])) : C("", !0),
@@ -835,7 +839,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
835
839
  }, [
836
840
  B("div", {
837
841
  class: "relative flex size-16 items-center justify-center overflow-hidden rounded-[var(--ui-radius-md)] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-subtle)]",
838
- style: It({ background: a.files?.(r.id ?? "")?.dominant })
842
+ style: Rt({ background: a.files?.(r.id ?? "")?.dominant })
839
843
  }, [
840
844
  r.src ?? a.files?.(r.id ?? "")?.thumb ? (p(), y("img", {
841
845
  key: 0,
@@ -843,9 +847,9 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
843
847
  alt: r.name,
844
848
  class: E(["size-full object-cover", r.task && "opacity-60"]),
845
849
  draggable: "false"
846
- }, null, 10, Ra)) : C("", !0),
850
+ }, null, 10, Ha)) : C("", !0),
847
851
  r.task ? (p(), y(Q, { key: 1 }, [
848
- l($).tasks.find((d) => d.key === r.task)?.status === "failed" ? (p(), y("span", Ha, [
852
+ l($).tasks.find((d) => d.key === r.task)?.status === "failed" ? (p(), y("span", qa, [
849
853
  _(l(te), {
850
854
  size: "sm",
851
855
  variant: "secondary",
@@ -853,15 +857,15 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
853
857
  onClick: (d) => ce(r.task)
854
858
  }, {
855
859
  default: I(() => [
856
- _(l(Yt), {
860
+ _(l(Zt), {
857
861
  class: "size-4",
858
862
  "aria-hidden": "true"
859
863
  })
860
864
  ]),
861
865
  _: 1
862
866
  }, 8, ["label", "onClick"])
863
- ])) : (p(), y("span", qa, [
864
- _(l(Ze), {
867
+ ])) : (p(), y("span", Fa, [
868
+ _(l(et), {
865
869
  size: 20,
866
870
  inline: "",
867
871
  label: l(n)("Uploading")
@@ -874,17 +878,17 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
874
878
  class: "absolute -end-1.5 -top-1.5 flex size-5 items-center justify-center rounded-full border border-[var(--ui-surface)] bg-[var(--ui-text-secondary)] p-0 text-[var(--ui-surface)] outline-none hover:bg-[var(--ui-text)] focus-visible:shadow-[var(--ui-shadow-focus)] after:absolute after:-inset-3 [@media(pointer:fine)]:after:hidden",
875
879
  "aria-label": l(n)("Remove {name}", { name: r.name }),
876
880
  "data-ui-rich-attachment-remove": "",
877
- onClick: (d) => ft(r)
881
+ onClick: (d) => pt(r)
878
882
  }, [
879
- _(l(Me), {
883
+ _(l(_e), {
880
884
  class: "size-3",
881
885
  "aria-hidden": "true"
882
886
  })
883
- ], 8, Fa)
884
- ], 8, Ia))), 128))
885
- ], 8, Ta)) : C("", !0),
886
- D.value && s.value ? (p(), y("div", Na, [
887
- _(l(Xe), {
887
+ ], 8, Na)
888
+ ], 8, Ra))), 128))
889
+ ], 8, Ia)) : C("", !0),
890
+ D.value && s.value ? (p(), y("div", Ua, [
891
+ _(l(Ye), {
888
892
  ref_key: "linkInput",
889
893
  ref: ne,
890
894
  modelValue: O.value,
@@ -895,15 +899,15 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
895
899
  inputmode: "url",
896
900
  "aria-label": l(n)("Link address"),
897
901
  placeholder: "https://",
898
- onKeydown: qe
902
+ onKeydown: Fe
899
903
  }, null, 8, ["modelValue", "aria-label"]),
900
- _(l(Ye), {
904
+ _(l(Ze), {
901
905
  size: "sm",
902
906
  variant: "primary",
903
907
  onClick: ye
904
908
  }, {
905
909
  default: I(() => [
906
- Ge(ee(l(n)("Apply")), 1)
910
+ Qe(ee(l(n)("Apply")), 1)
907
911
  ]),
908
912
  _: 1
909
913
  }),
@@ -914,7 +918,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
914
918
  onClick: ke
915
919
  }, {
916
920
  default: I(() => [
917
- _(l(Je), {
921
+ _(l(Xe), {
918
922
  class: "size-4",
919
923
  "aria-hidden": "true"
920
924
  })
@@ -927,7 +931,7 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
927
931
  onClick: j
928
932
  }, {
929
933
  default: I(() => [
930
- _(l(Me), {
934
+ _(l(_e), {
931
935
  class: "size-4",
932
936
  "aria-hidden": "true"
933
937
  })
@@ -955,13 +959,13 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
955
959
  }, ["prevent"])),
956
960
  onClick: (d) => r.run()
957
961
  }, [
958
- (p(), T(we(r.icon), {
962
+ (p(), T(Me(r.icon), {
959
963
  class: "size-4",
960
964
  "aria-hidden": "true"
961
965
  }))
962
- ], 40, Va))), 128))
963
- ], 8, Ua)) : C("", !0),
964
- s.value ? (p(), y("div", Da, [
966
+ ], 40, Da))), 128))
967
+ ], 8, Va)) : C("", !0),
968
+ s.value ? (p(), y("div", Oa, [
965
969
  a.upload ? (p(), y("button", {
966
970
  key: 0,
967
971
  type: "button",
@@ -972,13 +976,13 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
972
976
  "data-ui-rich-tool": "image",
973
977
  onMousedown: t[8] || (t[8] = F(() => {
974
978
  }, ["prevent"])),
975
- onClick: Le
979
+ onClick: Se
976
980
  }, [
977
- _(l(Qe), {
981
+ _(l(We), {
978
982
  class: "size-4",
979
983
  "aria-hidden": "true"
980
984
  })
981
- ], 40, Oa)) : C("", !0),
985
+ ], 40, ja)) : C("", !0),
982
986
  B("button", {
983
987
  type: "button",
984
988
  class: E(H),
@@ -988,13 +992,13 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
988
992
  "data-ui-rich-tool": "mention",
989
993
  onMousedown: t[9] || (t[9] = F(() => {
990
994
  }, ["prevent"])),
991
- onClick: Ie
995
+ onClick: Re
992
996
  }, [
993
- _(l(We), {
997
+ _(l(Je), {
994
998
  class: "size-4",
995
999
  "aria-hidden": "true"
996
1000
  })
997
- ], 40, ja),
1001
+ ], 40, Ka),
998
1002
  B("button", {
999
1003
  type: "button",
1000
1004
  class: E(H),
@@ -1006,13 +1010,13 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
1006
1010
  "data-ui-rich-format-toggle": "",
1007
1011
  onMousedown: t[10] || (t[10] = F(() => {
1008
1012
  }, ["prevent"])),
1009
- onClick: ze
1013
+ onClick: Ee
1010
1014
  }, [
1011
- _(l(Zt), {
1015
+ _(l(ea), {
1012
1016
  class: "size-4",
1013
1017
  "aria-hidden": "true"
1014
1018
  })
1015
- ], 40, Ka),
1019
+ ], 40, Ga),
1016
1020
  t[14] || (t[14] = B("span", { class: "flex-1" }, null, -1)),
1017
1021
  xe.value ? (p(), y("span", {
1018
1022
  key: 1,
@@ -1025,51 +1029,51 @@ const Pa = ["data-variant", "data-over"], La = ["aria-label"], Aa = ["aria-label
1025
1029
  class: E([H, "text-[var(--ui-primary)] disabled:text-[var(--ui-text-disabled)]"]),
1026
1030
  "aria-label": `${l(n)("Send")} (${l(v)}Enter)`,
1027
1031
  title: `${l(n)("Send")} (${l(v)}Enter)`,
1028
- disabled: !Ne.value,
1032
+ disabled: !Ue.value,
1029
1033
  "data-ui-rich-send": "",
1030
1034
  onMousedown: t[11] || (t[11] = F(() => {
1031
1035
  }, ["prevent"])),
1032
- onClick: Ue
1036
+ onClick: we
1033
1037
  }, [
1034
- a.sending ? (p(), T(l(Ze), {
1038
+ a.sending ? (p(), T(l(et), {
1035
1039
  key: 0,
1036
1040
  size: 16,
1037
1041
  inline: "",
1038
1042
  label: l(n)("Sending")
1039
- }, null, 8, ["label"])) : (p(), T(l(ea), {
1043
+ }, null, 8, ["label"])) : (p(), T(l(ta), {
1040
1044
  key: 1,
1041
1045
  class: "size-4 rtl:-scale-x-100",
1042
1046
  "aria-hidden": "true"
1043
1047
  }))
1044
- ], 42, Ga)
1048
+ ], 42, Qa)
1045
1049
  ])) : C("", !0),
1046
- !s.value && (xe.value || U.value.length) ? (p(), y("div", Qa, [
1050
+ !s.value && (xe.value || U.value.length) ? (p(), y("div", Wa, [
1047
1051
  xe.value ? (p(), y("span", {
1048
1052
  key: 0,
1049
1053
  "aria-live": "polite",
1050
1054
  class: E(["self-end text-[length:var(--ui-font-size-sm)] tabular-nums", R.value ? "text-[var(--ui-danger-text)]" : "text-[var(--ui-text-secondary)]"]),
1051
1055
  "data-ui-rich-count": ""
1052
1056
  }, ee(R.value ? l(n)("{count} characters over the limit", { count: -K.value }) : l(n)("{count} characters left", { count: K.value })), 3)) : C("", !0),
1053
- U.value.length ? (p(), T(l(oa), {
1057
+ U.value.length ? (p(), T(l(la), {
1054
1058
  key: 1,
1055
1059
  tasks: U.value,
1056
1060
  onRetry: ce,
1057
- onCancel: $e,
1061
+ onCancel: Pe,
1058
1062
  onRetryAll: t[12] || (t[12] = (r) => U.value.forEach((d) => d.status === "failed" && ce(d.key))),
1059
- onCancelAll: t[13] || (t[13] = (r) => U.value.forEach((d) => $e(d.key)))
1063
+ onCancelAll: t[13] || (t[13] = (r) => U.value.forEach((d) => Pe(d.key)))
1060
1064
  }, null, 8, ["tasks"])) : C("", !0)
1061
1065
  ])) : C("", !0),
1062
- B("div", Wa, [
1063
- (p(!0), y(Q, null, Z(x.value, (r) => (p(), y("p", {
1066
+ B("div", Ja, [
1067
+ (p(!0), y(Q, null, Z(w.value, (r) => (p(), y("p", {
1064
1068
  key: r,
1065
1069
  class: "m-0 border-t border-[var(--ui-border-subtle)] px-3 py-1.5 text-[length:var(--ui-font-size-sm)] text-[var(--ui-danger-text)]"
1066
1070
  }, ee(r), 1))), 128))
1067
1071
  ])
1068
- ], 16, Pa));
1072
+ ], 16, La));
1069
1073
  }
1070
1074
  });
1071
1075
  export {
1072
- lr as RichTextEditor,
1073
- xa as docToMarkdown,
1074
- ya as markdownToDoc
1076
+ sr as RichTextEditor,
1077
+ wa as docToMarkdown,
1078
+ ka as markdownToDoc
1075
1079
  };