@threadlabs/looma 0.28.6 → 0.28.8

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 (114) hide show
  1. package/components/ui-editor-block-actions/ui-editor-block-actions.html +20 -0
  2. package/components/ui-editor-block-actions/ui-editor-block-actions.js +14 -0
  3. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +7 -6
  4. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.js +2 -1
  5. package/components/ui-editor-link-card/ui-editor-link-card.html +57 -0
  6. package/components/ui-editor-link-card/ui-editor-link-card.js +27 -0
  7. package/components/ui-editor-link-form/ui-editor-link-form.html +118 -0
  8. package/components/ui-editor-link-form/ui-editor-link-form.js +71 -0
  9. package/dist/index.js +37 -34
  10. package/package.json +1 -1
  11. package/styles/ui-editor-block-actions.css +1 -0
  12. package/styles/ui-editor-link-card.css +1 -0
  13. package/styles/ui-editor-link-form.css +1 -0
  14. package/vanilla/UiEditorBlockActions.d.ts +16 -0
  15. package/vanilla/UiEditorBlockActions.js +41 -0
  16. package/vanilla/UiEditorImageToolbar.js +1 -1
  17. package/vanilla/UiEditorLinkCard.d.ts +20 -0
  18. package/vanilla/UiEditorLinkCard.js +153 -0
  19. package/vanilla/UiEditorLinkForm.d.ts +32 -0
  20. package/vanilla/UiEditorLinkForm.js +354 -0
  21. package/vanilla/index.js +3 -0
  22. package/vue/UiEditorBlockActions.d.ts +33 -0
  23. package/vue/UiEditorBlockActions.js +2 -0
  24. package/vue/UiEditorBlockActions.vue +125 -0
  25. package/vue/UiEditorImageToolbar.vue +5 -6
  26. package/vue/UiEditorLinkCard.d.ts +58 -0
  27. package/vue/UiEditorLinkCard.js +2 -0
  28. package/vue/UiEditorLinkCard.vue +319 -0
  29. package/vue/UiEditorLinkForm.d.ts +165 -0
  30. package/vue/UiEditorLinkForm.js +2 -0
  31. package/vue/UiEditorLinkForm.vue +557 -0
  32. package/vue/chunks/UiAffordanceScope.js +1 -1
  33. package/vue/chunks/UiAvatar.js +1 -1
  34. package/vue/chunks/UiAvatarGroup.js +1 -1
  35. package/vue/chunks/UiBadge.js +1 -1
  36. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  37. package/vue/chunks/UiBreadcrumbs.js +1 -1
  38. package/vue/chunks/UiButton.js +1 -1
  39. package/vue/chunks/UiCallout.js +1 -1
  40. package/vue/chunks/UiCard.js +1 -1
  41. package/vue/chunks/UiCheckbox.js +1 -1
  42. package/vue/chunks/UiCluster.js +1 -1
  43. package/vue/chunks/UiCombobox.js +1 -1
  44. package/vue/chunks/UiContainer.js +1 -1
  45. package/vue/chunks/UiContextMenu.js +1 -1
  46. package/vue/chunks/UiCover.js +1 -1
  47. package/vue/chunks/UiDescriptionItem.js +1 -1
  48. package/vue/chunks/UiDescriptionList.js +1 -1
  49. package/vue/chunks/UiDialog.js +1 -1
  50. package/vue/chunks/UiDisclosure.js +1 -1
  51. package/vue/chunks/UiEditable.js +1 -1
  52. package/vue/chunks/UiEditorBlockActions.js +127 -0
  53. package/vue/chunks/UiEditorImageToolbar.js +7 -25
  54. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  55. package/vue/chunks/UiEditorLinkCard.js +356 -0
  56. package/vue/chunks/UiEditorLinkForm.js +669 -0
  57. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  58. package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
  59. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  60. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  61. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  62. package/vue/chunks/UiEditorSurface.js +1 -1
  63. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  64. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  65. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  66. package/vue/chunks/UiEditorToolbar.js +1 -1
  67. package/vue/chunks/UiFloatingActionButton.js +1 -1
  68. package/vue/chunks/UiFormField.js +1 -1
  69. package/vue/chunks/UiGrid.js +1 -1
  70. package/vue/chunks/UiIcon.js +1 -1
  71. package/vue/chunks/UiIconButton.js +1 -1
  72. package/vue/chunks/UiImage.js +1 -1
  73. package/vue/chunks/UiInput.js +1 -1
  74. package/vue/chunks/UiInputGroup.js +1 -1
  75. package/vue/chunks/UiList.js +1 -1
  76. package/vue/chunks/UiListItem.js +1 -1
  77. package/vue/chunks/UiListbox.js +1 -1
  78. package/vue/chunks/UiMenu.js +1 -1
  79. package/vue/chunks/UiMenuGroup.js +1 -1
  80. package/vue/chunks/UiMenuItem.js +1 -1
  81. package/vue/chunks/UiMeter.js +1 -1
  82. package/vue/chunks/UiNavItem.js +1 -1
  83. package/vue/chunks/UiPageHeader.js +1 -1
  84. package/vue/chunks/UiPopover.js +1 -1
  85. package/vue/chunks/UiRadio.js +1 -1
  86. package/vue/chunks/UiRadioGroup.js +1 -1
  87. package/vue/chunks/UiReel.js +1 -1
  88. package/vue/chunks/UiScrollArea.js +1 -1
  89. package/vue/chunks/UiSearchResultRow.js +1 -1
  90. package/vue/chunks/UiSearchShell.js +1 -1
  91. package/vue/chunks/UiSection.js +1 -1
  92. package/vue/chunks/UiSelect.js +1 -1
  93. package/vue/chunks/UiSeparator.js +1 -1
  94. package/vue/chunks/UiSidebar.js +1 -1
  95. package/vue/chunks/UiSpinner.js +1 -1
  96. package/vue/chunks/UiStack.js +1 -1
  97. package/vue/chunks/UiStatusMessage.js +1 -1
  98. package/vue/chunks/UiSwitch.js +1 -1
  99. package/vue/chunks/UiSwitcher.js +1 -1
  100. package/vue/chunks/UiTable.js +1 -1
  101. package/vue/chunks/UiTabs.js +1 -1
  102. package/vue/chunks/UiText.js +1 -1
  103. package/vue/chunks/UiTextarea.js +1 -1
  104. package/vue/chunks/UiToast.js +1 -1
  105. package/vue/chunks/UiToastRegion.js +1 -1
  106. package/vue/chunks/UiTooltip.js +1 -1
  107. package/vue/chunks/UiTree.js +1 -1
  108. package/vue/chunks/UiTreeItem.js +1 -1
  109. package/vue/chunks/_plugin-vue_export-helper.js +1 -1
  110. package/vue/components.css +2886 -2886
  111. package/vue/editor/index.js +98 -250
  112. package/vue/editor/primitives.d.ts +24 -2
  113. package/vue/index.d.ts +3 -0
  114. package/vue/index.js +8 -5
@@ -0,0 +1,354 @@
1
+ // Generated by HTML Next 1.0.0-alpha.51 for Vanilla DOM. Do not edit.
2
+ import { attachGeneratedController, buildTemplate, clearRegion, KeyedList, NONCONFORMING, readIndex, readMember, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, computedCycle, dispatchDeclared, detailCheck, formatOf, keywordFormat, acceptProps, manageProps, readonlyView, checkBoolean, checkFormat, checkList, checkObject, checkRecord, checkString, checkUnknown } from "@nextwebwg/html-next/generated-runtime";
3
+ import * as controller from "../components/ui-editor-link-form/ui-editor-link-form.js";
4
+ import "../styles/ui-editor-link-form.css";
5
+
6
+ const T0 = ["",[],["ui-stack",["gap","s"],["ui-text",["as","h3","size","sm","weight","semibold"],0],["ui-stack",["gap","s"],["ui-form-field",[],["label",["slot","label"],0],1,1],1,1],1,1]];
7
+ const T1 = ["ui-input-group",["prefix-kind","icon"],["ui-icon",["slot","prefix"]],["ui-input",["data-link-destination","","data-link-search","","type","text","role","searchbox","autocomplete","off"]],1];
8
+ const T2 = ["ui-icon-button",["slot","action","label","Clear search","variant","ghost","size","sm","data-link-clear",""],["ui-icon",["name","x"]]];
9
+ const T3 = ["",[],["ui-input",["data-link-destination","","type","text","inputmode","url","size","sm"]]];
10
+ const T4 = ["ui-scroll-area",["size","sm","aria-label","Destination search results"],1,2];
11
+ const T5 = ["ui-text",["size","sm","tone","secondary","role","status"],0];
12
+ const T6 = ["ui-search-result-row",["density","compact","data-link-result",""],["ui-icon",["slot","leading","name","file-text"]],["ui-text",["slot","title","as","strong","size","sm","weight","medium"],0],1,1];
13
+ const T7 = ["ui-text",["slot","meta","as","span","size","xs","tone","secondary"],0];
14
+ const T8 = ["ui-icon",["slot","trailing","name","check"]];
15
+ const T9 = ["",[],["ui-checkbox",["size","sm","data-link-new-tab",""],"Open in new tab"]];
16
+ const T10 = ["",[],["ui-form-field",[],["label",["slot","label"],"Text"],["ui-input",["data-link-text","","size","sm"]]]];
17
+ const T11 = ["ui-text",["size","sm","tone","danger","role","alert"],0];
18
+ let P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11;
19
+ const E = new Map();
20
+ const S = { n: ["base","heading","fieldLabel"], t: ["s","?","?"], f: import.meta.url, g: "ui-editor-link-form", k: 1, d: { "destination": [detailCheck(checkObject([["value", checkString, false]], false)), true, true, false], "text": [detailCheck(checkObject([["text", checkString, false]], false)), true, true, false], "new-tab": [detailCheck(checkObject([["newTab", checkBoolean, false]], false)), true, true, false], "choose": [detailCheck(checkObject([["id", checkString, false]], false)), true, true, false], "clear": [detailCheck(checkRecord(checkUnknown)), true, true, false], "save": [detailCheck(checkRecord(checkUnknown)), true, true, false], "dismiss": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared, r: readonlyView };
21
+ const D = { props: { "error": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "existing": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "mode": { "required":false,"values":["url","target"],"default":"url", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "newTab": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "placeholder": { "required":false,"default":"https://example.com", c: checkString, t: "string", j: 0, m: "s" }, "results": { "required":false,"default":[], c: checkList(checkObject([["id", checkString, false], ["label", checkString, false], ["detail", checkString, true]], false)), j: 1, m: ["l",["o",["id","s","label","s","detail","s"]]] }, "searchable": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "selected": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "status": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "text": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "textEditable": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "value": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
22
+ const C = (host) => controller.default(host);
23
+
24
+ export function createUiEditorLinkForm(options = {}, html) {
25
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
26
+ const element = document.createElement("form");
27
+ for (const [name, value] of Object.entries(attributes)) {
28
+ if (value === null || value === undefined || value === false) continue;
29
+ element.setAttribute(name, value === true ? "" : String(value));
30
+ }
31
+ if (!element.hasAttribute("aria-label")) element.setAttribute("aria-label", "Edit link");
32
+ element.setAttribute("data-component", "ui-editor-link-form");
33
+ element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
34
+ const v = ["ui-editor-link-form", undefined, undefined, null, null, null, null, null, null, null, null, null, null, null, null];
35
+ const B = acceptProps(element, D, S.n, v, componentProps, [], html);
36
+ const X = { e: 0, g: (j) => g(j), w: new Set() };
37
+ const ke = [];
38
+ const K = [() => readIndex({ "true": "Edit link", "false": "Add link" }, textCall("concat", [v[4]])), () => readIndex({ "true": "Link destination", "false": "URL" }, textCall("concat", [v[9]]))];
39
+ const g = (j) => {
40
+ const i = j - 1;
41
+ if (ke[i] === X.e) return v[j];
42
+ if (ke[i] === -1) computedCycle();
43
+ ke[i] = -1;
44
+ let next;
45
+ try { next = K[i](); } catch (error) { ke[i] = undefined; throw error; }
46
+ ke[i] = X.e;
47
+ const previous = v[j];
48
+ if (!Object.is(previous, next)) { v[j] = next; X.n?.(j, previous, next); }
49
+ return next;
50
+ };
51
+ const m1 = (d) => {
52
+ const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
53
+ const t0 = n.firstChild;
54
+ const t1 = t0.nextSibling;
55
+ const t2 = t1.nextSibling;
56
+ const r = { n, a0: t0, a1: t1, v0: null, v1: null, v2: null, v3: null, a2: t2, e0: t2.nextSibling, b0: undefined };
57
+ p1(r, -1, d);
58
+ return r;
59
+ };
60
+ const p1 = (r, c, d) => {
61
+ if (c & 1073741856) {
62
+ const x0 = readIndex({ "true": "search", "false": "link" }, textCall("concat", [(v[5] === "target")]));
63
+ if (x0 !== NONCONFORMING) {
64
+ const s0 = toAttribute(x0, "name");
65
+ if (s0 !== r.v0) writeAttribute(r.a0, "name", r.v0 = s0);
66
+ }
67
+ }
68
+ if (c & 1) {
69
+ const x1 = textCall("concat", [v[0], "-destination"]);
70
+ if (x1 !== NONCONFORMING) {
71
+ const s1 = toAttribute(x1, "id");
72
+ if (s1 !== r.v1) writeAttribute(r.a1, "id", r.v1 = s1);
73
+ }
74
+ }
75
+ if (c & 128) {
76
+ const x2 = v[7];
77
+ const s2 = toAttribute(x2, "placeholder");
78
+ if (s2 !== r.v2) writeAttribute(r.a1, "placeholder", r.v2 = s2);
79
+ }
80
+ if (c & 16384) {
81
+ const x3 = v[14];
82
+ const s3 = toAttribute(x3, "value");
83
+ if (s3 !== r.v3) writeAttribute(r.a1, "value", r.v3 = s3);
84
+ }
85
+ if (c & 16384 && !((v[14] !== "")) !== !r.b0) {
86
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a2, r.e0); }
87
+ else { r.b0 = m2(d); r.e0.before(r.b0.n); }
88
+ } else if (r.b0 !== undefined) p2(r.b0, c, d);
89
+ };
90
+ const m2 = (d) => {
91
+ const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
92
+ const r = { n };
93
+ p2(r, -1, d);
94
+ return r;
95
+ };
96
+ const p2 = (r, c, d) => {
97
+ };
98
+ const m3 = (d) => {
99
+ const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
100
+ const t0 = n.firstChild;
101
+ const r = { n, a0: t0, v0: null, v1: null, v2: null };
102
+ p3(r, -1, d);
103
+ return r;
104
+ };
105
+ const p3 = (r, c, d) => {
106
+ if (c & 1) {
107
+ const x0 = textCall("concat", [v[0], "-destination"]);
108
+ if (x0 !== NONCONFORMING) {
109
+ const s0 = toAttribute(x0, "id");
110
+ if (s0 !== r.v0) writeAttribute(r.a0, "id", r.v0 = s0);
111
+ }
112
+ }
113
+ if (c & 128) {
114
+ const x1 = v[7];
115
+ const s1 = toAttribute(x1, "placeholder");
116
+ if (s1 !== r.v1) writeAttribute(r.a0, "placeholder", r.v1 = s1);
117
+ }
118
+ if (c & 16384) {
119
+ const x2 = v[14];
120
+ const s2 = toAttribute(x2, "value");
121
+ if (s2 !== r.v2) writeAttribute(r.a0, "value", r.v2 = s2);
122
+ }
123
+ };
124
+ const m4 = (d) => {
125
+ const n = (P4 ??= buildTemplate(T4)).cloneNode(true);
126
+ const t0 = n.firstChild;
127
+ const t1 = t0.nextSibling.nextSibling;
128
+ const r = { n, a0: t0, e0: t0.nextSibling, b0: undefined, L1: new KeyedList(t1, t1.nextSibling, m6, p6, (o) => readMember(o, "id"), "result") };
129
+ p4(r, -1, d);
130
+ return r;
131
+ };
132
+ const p4 = (r, c, d) => {
133
+ if (c & 2048 && !((v[11] !== "")) !== !r.b0) {
134
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a0, r.e0); }
135
+ else { r.b0 = m5(d); r.e0.before(r.b0.n); }
136
+ } else if (r.b0 !== undefined) p5(r.b0, c, d);
137
+ if (c & 1073742080) r.L1.update(v[8], d, c);
138
+ if (c !== -1 && c & 1024) r.L1.each(c, d);
139
+ };
140
+ const m5 = (d) => {
141
+ const n = (P5 ??= buildTemplate(T5)).cloneNode(true);
142
+ const t0 = n.firstChild;
143
+ const r = { n, a0: t0, v0: "" };
144
+ p5(r, -1, d);
145
+ return r;
146
+ };
147
+ const p5 = (r, c, d) => {
148
+ if (c & 2048) {
149
+ const x0 = v[11];
150
+ const s0 = toText(x0);
151
+ if (s0 !== r.v0) r.a0.data = r.v0 = s0;
152
+ }
153
+ };
154
+ const m6 = (o, j, l) => {
155
+ const n = (P6 ??= buildTemplate(T6)).cloneNode(true);
156
+ const t0 = n.firstChild.nextSibling;
157
+ const t1 = t0.firstChild;
158
+ const t2 = t0.nextSibling;
159
+ const t3 = t2.nextSibling.nextSibling;
160
+ const r = { k: undefined, i: o, n, x: 0, y: 0, a1: t0, a2: t1, w: 0, v0: null, v1: null, v2: null, v3: null, v4: "", a3: t2, e0: t2.nextSibling, b0: undefined, a4: t3, e1: t3.nextSibling, b1: undefined };
161
+ p6(r, -1, E);
162
+ return r;
163
+ };
164
+ const p6 = (r, c, d) => {
165
+ const o = r.i;
166
+ if (c & 1073741824) r.w = 0;
167
+ if (c & 1073742848) {
168
+ const x0 = (readMember(o, "id") === v[10]);
169
+ const s0 = toAttribute(x0, "selected");
170
+ if (s0 !== r.v0) writeAttribute(r.n, "selected", r.v0 = s0);
171
+ }
172
+ if (c & 1073741824) {
173
+ const x1 = trackContainer(r, readMember(o, "id"));
174
+ const s1 = toAttribute(x1, "data-link-id");
175
+ if (s1 !== r.v1) writeAttribute(r.n, "data-link-id", r.v1 = s1);
176
+ }
177
+ if (c === -1) {
178
+ const x2 = true;
179
+ const s2 = toAttribute(x2, "truncate");
180
+ if (s2 !== r.v2) writeAttribute(r.a1, "truncate", r.v2 = s2);
181
+ }
182
+ if (c & 1073741824) {
183
+ const x3 = trackContainer(r, readMember(o, "label"));
184
+ const s3 = toAttribute(x3, "title");
185
+ if (s3 !== r.v3) writeAttribute(r.a1, "title", r.v3 = s3);
186
+ const s4 = toText(x3);
187
+ if (s4 !== r.v4) r.a2.data = r.v4 = s4;
188
+ }
189
+ if (c & 1073741824 && !(truthy(trackContainer(r, readMember(o, "detail")))) !== !r.b0) {
190
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a3, r.e0); }
191
+ else { r.b0 = m7(d, undefined, r); r.e0.before(r.b0.n); }
192
+ } else if (r.b0 !== undefined) p7(r.b0, c, d);
193
+ if (c & 1073742848 && !((readMember(o, "id") === v[10])) !== !r.b1) {
194
+ if (r.b1) { r.b1 = undefined; clearRegion(r.a4, r.e1); }
195
+ else { r.b1 = m8(d); r.e1.before(r.b1.n); }
196
+ } else if (r.b1 !== undefined) p8(r.b1, c, d);
197
+ };
198
+ const m7 = (d, o, u) => {
199
+ const n = (P7 ??= buildTemplate(T7)).cloneNode(true);
200
+ const t0 = n.firstChild;
201
+ const r = { n, u, a1: t0, w: 0, v0: null, v1: null, v2: "" };
202
+ p7(r, -1, d);
203
+ return r;
204
+ };
205
+ const p7 = (r, c, d) => {
206
+ if (c & 1073741824) r.w = 0;
207
+ if (c === -1) {
208
+ const x0 = true;
209
+ const s0 = toAttribute(x0, "truncate");
210
+ if (s0 !== r.v0) writeAttribute(r.n, "truncate", r.v0 = s0);
211
+ }
212
+ if (c & 1073741824) {
213
+ const x1 = trackContainer(r, readMember(r.u.i, "detail"));
214
+ const s1 = toAttribute(x1, "title");
215
+ if (s1 !== r.v1) writeAttribute(r.n, "title", r.v1 = s1);
216
+ const s2 = toText(x1);
217
+ if (s2 !== r.v2) r.a1.data = r.v2 = s2;
218
+ }
219
+ };
220
+ const m8 = (d) => {
221
+ const n = (P8 ??= buildTemplate(T8)).cloneNode(true);
222
+ const r = { n };
223
+ p8(r, -1, d);
224
+ return r;
225
+ };
226
+ const p8 = (r, c, d) => {
227
+ };
228
+ const m9 = (d) => {
229
+ const n = (P9 ??= buildTemplate(T9)).cloneNode(true);
230
+ const t0 = n.firstChild;
231
+ const r = { n, a0: t0, v0: null };
232
+ p9(r, -1, d);
233
+ return r;
234
+ };
235
+ const p9 = (r, c, d) => {
236
+ if (c & 64) {
237
+ const x0 = v[6];
238
+ const s0 = toAttribute(x0, "checked");
239
+ if (s0 !== r.v0) writeAttribute(r.a0, "checked", r.v0 = s0);
240
+ }
241
+ };
242
+ const m10 = (d) => {
243
+ const n = (P10 ??= buildTemplate(T10)).cloneNode(true);
244
+ const t0 = n.firstChild;
245
+ const t1 = t0.firstChild;
246
+ const t2 = t1.nextSibling;
247
+ const r = { n, a0: t1, a1: t2, v0: null, v1: null, v2: null };
248
+ p10(r, -1, d);
249
+ return r;
250
+ };
251
+ const p10 = (r, c, d) => {
252
+ if (c & 1) {
253
+ const x0 = textCall("concat", [v[0], "-text"]);
254
+ if (x0 !== NONCONFORMING) {
255
+ const s0 = toAttribute(x0, "for");
256
+ if (s0 !== r.v0) writeAttribute(r.a0, "for", r.v0 = s0);
257
+ }
258
+ if (x0 !== NONCONFORMING) {
259
+ const s1 = toAttribute(x0, "id");
260
+ if (s1 !== r.v1) writeAttribute(r.a1, "id", r.v1 = s1);
261
+ }
262
+ }
263
+ if (c & 4096) {
264
+ const x1 = v[12];
265
+ const s2 = toAttribute(x1, "value");
266
+ if (s2 !== r.v2) writeAttribute(r.a1, "value", r.v2 = s2);
267
+ }
268
+ };
269
+ const m11 = (d) => {
270
+ const n = (P11 ??= buildTemplate(T11)).cloneNode(true);
271
+ const t0 = n.firstChild;
272
+ const r = { n, a0: t0, v0: "" };
273
+ p11(r, -1, d);
274
+ return r;
275
+ };
276
+ const p11 = (r, c, d) => {
277
+ if (c & 8) {
278
+ const x0 = v[3];
279
+ const s0 = toText(x0);
280
+ if (s0 !== r.v0) r.a0.data = r.v0 = s0;
281
+ }
282
+ };
283
+ const p0 = (r, c, d) => {
284
+ if (c & 1073741840) {
285
+ const x0 = g(1);
286
+ if (x0 !== NONCONFORMING) {
287
+ const s0 = toText(x0);
288
+ if (s0 !== r.v0) r.a0.data = r.v0 = s0;
289
+ }
290
+ }
291
+ if (c & 8) {
292
+ const x1 = (v[3] !== "");
293
+ const s1 = toAttribute(x1, "invalid");
294
+ if (s1 !== r.v1) writeAttribute(r.a1, "invalid", r.v1 = s1);
295
+ }
296
+ if (c & 1) {
297
+ const x2 = textCall("concat", [v[0], "-destination"]);
298
+ if (x2 !== NONCONFORMING) {
299
+ const s2 = toAttribute(x2, "for");
300
+ if (s2 !== r.v2) writeAttribute(r.a2, "for", r.v2 = s2);
301
+ }
302
+ }
303
+ if (c & 1073742336) {
304
+ const x3 = g(2);
305
+ if (x3 !== NONCONFORMING) {
306
+ const s3 = toText(x3);
307
+ if (s3 !== r.v3) r.a3.data = r.v3 = s3;
308
+ }
309
+ }
310
+ if (c & 512 && !(truthy(v[9])) !== !r.b0) {
311
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a4, r.e0); }
312
+ else { r.b0 = m1(d); r.e0.before(r.b0.n); }
313
+ } else if (r.b0 !== undefined) p1(r.b0, c, d);
314
+ if (c & 512 && !(!truthy(v[9])) !== !r.b1) {
315
+ if (r.b1) { r.b1 = undefined; clearRegion(r.a5, r.e1); }
316
+ else { r.b1 = m3(d); r.e1.before(r.b1.n); }
317
+ } else if (r.b1 !== undefined) p3(r.b1, c, d);
318
+ if (c & 32 && !((v[5] === "target")) !== !r.b2) {
319
+ if (r.b2) { r.b2 = undefined; clearRegion(r.a6, r.e2); }
320
+ else { r.b2 = m4(d); r.e2.before(r.b2.n); }
321
+ } else if (r.b2 !== undefined) p4(r.b2, c, d);
322
+ if (c & 32 && !((v[5] === "url")) !== !r.b3) {
323
+ if (r.b3) { r.b3 = undefined; clearRegion(r.a7, r.e3); }
324
+ else { r.b3 = m9(d); r.e3.before(r.b3.n); }
325
+ } else if (r.b3 !== undefined) p9(r.b3, c, d);
326
+ if (c & 8192 && !(truthy(v[13])) !== !r.b4) {
327
+ if (r.b4) { r.b4 = undefined; clearRegion(r.a8, r.e4); }
328
+ else { r.b4 = m10(d); r.e4.before(r.b4.n); }
329
+ } else if (r.b4 !== undefined) p10(r.b4, c, d);
330
+ if (c & 8 && !((v[3] !== "")) !== !r.b5) {
331
+ if (r.b5) { r.b5 = undefined; clearRegion(r.a9, r.e5); }
332
+ else { r.b5 = m11(d); r.e5.before(r.b5.n); }
333
+ } else if (r.b5 !== undefined) p11(r.b5, c, d);
334
+ };
335
+ const t0 = element.firstChild;
336
+ const t1 = t0.firstChild;
337
+ const t2 = t1.firstChild;
338
+ const t3 = t1.nextSibling;
339
+ const t4 = t3.firstChild;
340
+ const t5 = t4.firstChild;
341
+ const t6 = t5.firstChild;
342
+ const t7 = t5.nextSibling;
343
+ const t8 = t7.nextSibling.nextSibling;
344
+ const t9 = t4.nextSibling;
345
+ const t10 = t9.nextSibling.nextSibling;
346
+ const t11 = t3.nextSibling;
347
+ const t12 = t11.nextSibling.nextSibling;
348
+ const R = { a0: t2, a1: t4, a2: t5, a3: t6, v0: "", v1: null, v2: null, v3: "", a4: t7, e0: t7.nextSibling, b0: undefined, a5: t8, e1: t8.nextSibling, b1: undefined, a6: t9, e2: t9.nextSibling, b2: undefined, a7: t10, e3: t10.nextSibling, b3: undefined, a8: t11, e4: t11.nextSibling, b4: undefined, a9: t12, e5: t12.nextSibling, b5: undefined };
349
+ const I = { B };
350
+ I.R = new Set();
351
+ attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, C, X, I);
352
+ manageProps(I);
353
+ return element;
354
+ }
package/vanilla/index.js CHANGED
@@ -19,8 +19,11 @@ export * from "./UiDescriptionList.js";
19
19
  export * from "./UiDialog.js";
20
20
  export * from "./UiDisclosure.js";
21
21
  export * from "./UiEditable.js";
22
+ export * from "./UiEditorBlockActions.js";
22
23
  export * from "./UiEditorImageToolbar.js";
23
24
  export * from "./UiEditorInsertTableGrid.js";
25
+ export * from "./UiEditorLinkCard.js";
26
+ export * from "./UiEditorLinkForm.js";
24
27
  export * from "./UiEditorMentionMenu.js";
25
28
  export * from "./UiEditorMentionMenuItem.js";
26
29
  export * from "./UiEditorSlashMenu.js";
@@ -0,0 +1,33 @@
1
+ import type { PropType } from 'vue';
2
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ for: {
4
+ type: PropType<string | null>;
5
+ default: string;
6
+ };
7
+ placement: {
8
+ type: PropType<"bottom-start" | "top-start" | null>;
9
+ default: string;
10
+ };
11
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ action: (event: CustomEvent<{
13
+ readonly action: "insert-below" | "duplicate" | "delete";
14
+ }>) => any;
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ for: {
17
+ type: PropType<string | null>;
18
+ default: string;
19
+ };
20
+ placement: {
21
+ type: PropType<"bottom-start" | "top-start" | null>;
22
+ default: string;
23
+ };
24
+ }>> & Readonly<{
25
+ onAction?: ((event: CustomEvent<{
26
+ readonly action: "insert-below" | "duplicate" | "delete";
27
+ }>) => any) | undefined;
28
+ }>, {
29
+ for: string | null;
30
+ placement: "top-start" | "bottom-start" | null;
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
+ declare const _default: typeof __VLS_export;
33
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { t as UiEditorBlockActions_default } from "./chunks/UiEditorBlockActions.js";
2
+ export { UiEditorBlockActions_default as default };
@@ -0,0 +1,125 @@
1
+ <!-- Generated by HTML Next 1.0.0-alpha.51 for Vue 3.5. Do not edit. -->
2
+ <script setup lang="ts">
3
+ import { computed, getCurrentInstance, ref, watchSyncEffect } from 'vue'
4
+ import type { PropType } from 'vue'
5
+ import {
6
+ checkHydratedRoot,
7
+ createDispatch,
8
+ nativeAttrs,
9
+ useComponentHost,
10
+ useReflectedProp,
11
+ } from './host'
12
+ import { checkedProp, propValidityState, vPropValidity } from './props'
13
+ import UiMenu from './UiMenu.vue'
14
+ import UiMenuItem from './UiMenuItem.vue'
15
+
16
+ defineOptions({ inheritAttrs: false })
17
+
18
+ const propValidityContract = {
19
+ props: {
20
+ for: {
21
+ type: { kind: 'terminal', name: 'string' },
22
+ required: false,
23
+ target: { attribute: 'for' },
24
+ description: 'The id of the button that opens the menu and anchors it.',
25
+ default: '',
26
+ },
27
+ placement: {
28
+ type: { kind: 'terminal', name: 'keyword' },
29
+ required: false,
30
+ target: { attribute: 'placement' },
31
+ description:
32
+ 'Where the menu opens beside its button; top-start suits a toolbar docked at the bottom of the screen.',
33
+ values: ['bottom-start', 'top-start'],
34
+ default: 'bottom-start',
35
+ },
36
+ },
37
+ } as const
38
+ const props = defineProps({
39
+ for: { type: null as unknown as PropType<string | null>, default: '' },
40
+ placement: {
41
+ type: null as unknown as PropType<'bottom-start' | 'top-start' | null>,
42
+ default: 'bottom-start',
43
+ },
44
+ })
45
+ const acceptedProps: Record<string, unknown> = { for: '', placement: 'bottom-start' }
46
+ const checkedProps = computed(() => ({
47
+ for: checkedProp<string>(
48
+ props['for'],
49
+ { kind: 'terminal', name: 'string' },
50
+ false,
51
+ 'for',
52
+ acceptedProps,
53
+ ) as string,
54
+ placement: checkedProp<'bottom-start' | 'top-start'>(
55
+ props['placement'],
56
+ { kind: 'terminal', name: 'keyword' },
57
+ false,
58
+ 'placement',
59
+ acceptedProps,
60
+ ) as 'bottom-start' | 'top-start',
61
+ }))
62
+ void checkedProps.value
63
+ watchSyncEffect(() => {
64
+ void checkedProps.value
65
+ })
66
+ const reflectedProp = useReflectedProp()
67
+ const hydrationInstance = getCurrentInstance()
68
+ const emit = defineEmits<{
69
+ action: [event: CustomEvent<{ readonly action: 'insert-below' | 'duplicate' | 'delete' }>]
70
+ }>()
71
+
72
+ const root = ref<HTMLElement | null>(null)
73
+ checkHydratedRoot('div', 'ui-editor-block-actions')
74
+
75
+ const isActionDetail = (
76
+ detail: unknown,
77
+ ): boolean => (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
78
+ && ((detail as Record<string, unknown>)['action'] === 'insert-below'
79
+ || (detail as Record<string, unknown>)['action'] === 'duplicate'
80
+ || (detail as Record<string, unknown>)['action'] === 'delete')
81
+ && Object.keys(detail as object).every((key) => ['action'].includes(key)))
82
+ const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
83
+ checks: {
84
+ action: isActionDetail,
85
+ },
86
+ })
87
+
88
+ useComponentHost(() => import('../components/ui-editor-block-actions/ui-editor-block-actions.js'), {
89
+ root,
90
+ dispatch,
91
+ controllerSource: {
92
+ specifier: '../components/ui-editor-block-actions/ui-editor-block-actions.js',
93
+ definition: './components/ui-editor-block-actions/ui-editor-block-actions.html',
94
+ },
95
+ props: checkedProps,
96
+ propInputs: (name: string) => {
97
+ const incoming = hydrationInstance?.vnode.props
98
+ const kebab = name.replace(/[A-Z]/g, (letter) => '-' + letter.toLowerCase())
99
+ return incoming !== null && incoming !== undefined
100
+ ? (incoming[name] ?? incoming[kebab] ?? null)
101
+ : null
102
+ },
103
+ propNames: ['for', 'placement'],
104
+ propValidity: (name: string) =>
105
+ propValidityState({ contract: propValidityContract, values: { ...props } }, name),
106
+ })
107
+ </script>
108
+
109
+ <template>
110
+ <div
111
+ v-bind="nativeAttrs($attrs)"
112
+ v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
113
+ :data-for="reflectedProp('for', 'for', checkedProps.for, undefined, false)"
114
+ :data-placement="reflectedProp('placement', 'placement', checkedProps.placement, undefined, false)"
115
+ ref="root"
116
+ >
117
+ <UiMenu
118
+ aria-label="Block actions"
119
+ :for="checkedProps.for"
120
+ :placement="checkedProps.placement"
121
+ ><UiMenuItem value="insert-below">Insert paragraph below</UiMenuItem>
122
+ <UiMenuItem value="duplicate">Duplicate block</UiMenuItem>
123
+ <UiMenuItem value="delete">Delete block</UiMenuItem></UiMenu>
124
+ </div>
125
+ </template>
@@ -343,7 +343,7 @@ useComponentHost(() => import('../components/ui-editor-image-toolbar/ui-editor-i
343
343
  :id="guarded"
344
344
  :variant="guardedBinding"
345
345
  :aria-pressed="guardedBinding2"
346
- ><UiIcon name="panel-top" size="sm" /></UiIconButton>
346
+ ><UiIcon name="panel-top" /></UiIconButton>
347
347
  <UiIconButton
348
348
  label="Center image"
349
349
  size="sm"
@@ -351,7 +351,7 @@ useComponentHost(() => import('../components/ui-editor-image-toolbar/ui-editor-i
351
351
  :id="guardedBinding3"
352
352
  :variant="guardedBinding4"
353
353
  :aria-pressed="guardedBinding5"
354
- ><UiIcon name="align-center" size="sm" /></UiIconButton>
354
+ ><UiIcon name="align-center" /></UiIconButton>
355
355
  <UiIconButton
356
356
  label="Wrap text to the right"
357
357
  size="sm"
@@ -359,7 +359,7 @@ useComponentHost(() => import('../components/ui-editor-image-toolbar/ui-editor-i
359
359
  :id="guardedBinding6"
360
360
  :variant="guardedBinding7"
361
361
  :aria-pressed="guardedBinding8"
362
- ><UiIcon name="panel-left" size="sm" /></UiIconButton>
362
+ ><UiIcon name="panel-left" /></UiIconButton>
363
363
  <UiIconButton
364
364
  label="Wrap text to the left"
365
365
  size="sm"
@@ -367,10 +367,9 @@ useComponentHost(() => import('../components/ui-editor-image-toolbar/ui-editor-i
367
367
  :id="guardedBinding9"
368
368
  :variant="guardedBinding10"
369
369
  :aria-pressed="guardedBinding11"
370
- ><UiIcon name="panel-right" size="sm" /></UiIconButton>
370
+ ><UiIcon name="panel-right" /></UiIconButton>
371
371
  <UiIconButton label="Image description" size="sm" variant="ghost" :id="base"><UiIcon
372
372
  name="file-text"
373
- size="sm"
374
373
  /></UiIconButton>
375
374
  <UiIconButton
376
375
  label="Delete image"
@@ -378,7 +377,7 @@ useComponentHost(() => import('../components/ui-editor-image-toolbar/ui-editor-i
378
377
  variant="ghost"
379
378
  data-image-action="delete"
380
379
  :id="guardedBinding12"
381
- ><UiIcon name="trash" size="sm" /></UiIconButton></UiEditorToolbar>
380
+ ><UiIcon name="trash" /></UiIconButton></UiEditorToolbar>
382
381
  <UiTooltip :for="guardedBinding13">Image in line</UiTooltip>
383
382
  <UiTooltip :for="guardedBinding14">Center image</UiTooltip>
384
383
  <UiTooltip :for="guardedBinding15">Wrap text to the right</UiTooltip>
@@ -0,0 +1,58 @@
1
+ import type { PropType } from 'vue';
2
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ detail: {
4
+ type: PropType<string | null>;
5
+ default: string;
6
+ };
7
+ href: {
8
+ type: PropType<string | null>;
9
+ default: string;
10
+ };
11
+ label: {
12
+ type: PropType<string | null>;
13
+ default: string;
14
+ };
15
+ openHref: {
16
+ type: PropType<string | null>;
17
+ default: string;
18
+ };
19
+ targetLabel: {
20
+ type: PropType<string | null>;
21
+ default: string;
22
+ };
23
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ edit: (event: CustomEvent<Readonly<Record<string, unknown>>>) => any;
25
+ remove: (event: CustomEvent<Readonly<Record<string, unknown>>>) => any;
26
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
+ detail: {
28
+ type: PropType<string | null>;
29
+ default: string;
30
+ };
31
+ href: {
32
+ type: PropType<string | null>;
33
+ default: string;
34
+ };
35
+ label: {
36
+ type: PropType<string | null>;
37
+ default: string;
38
+ };
39
+ openHref: {
40
+ type: PropType<string | null>;
41
+ default: string;
42
+ };
43
+ targetLabel: {
44
+ type: PropType<string | null>;
45
+ default: string;
46
+ };
47
+ }>> & Readonly<{
48
+ onEdit?: ((event: CustomEvent<Readonly<Record<string, unknown>>>) => any) | undefined;
49
+ onRemove?: ((event: CustomEvent<Readonly<Record<string, unknown>>>) => any) | undefined;
50
+ }>, {
51
+ detail: string | null;
52
+ label: string | null;
53
+ href: string | null;
54
+ openHref: string | null;
55
+ targetLabel: string | null;
56
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
57
+ declare const _default: typeof __VLS_export;
58
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { t as UiEditorLinkCard_default } from "./chunks/UiEditorLinkCard.js";
2
+ export { UiEditorLinkCard_default as default };