@threadlabs/looma 0.28.6 → 0.28.7

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 (105) 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/dist/index.js +36 -34
  8. package/package.json +1 -1
  9. package/styles/ui-editor-block-actions.css +1 -0
  10. package/styles/ui-editor-link-card.css +1 -0
  11. package/vanilla/UiEditorBlockActions.d.ts +16 -0
  12. package/vanilla/UiEditorBlockActions.js +41 -0
  13. package/vanilla/UiEditorImageToolbar.js +1 -1
  14. package/vanilla/UiEditorLinkCard.d.ts +20 -0
  15. package/vanilla/UiEditorLinkCard.js +153 -0
  16. package/vanilla/index.js +2 -0
  17. package/vue/UiEditorBlockActions.d.ts +33 -0
  18. package/vue/UiEditorBlockActions.js +2 -0
  19. package/vue/UiEditorBlockActions.vue +125 -0
  20. package/vue/UiEditorImageToolbar.vue +5 -6
  21. package/vue/UiEditorLinkCard.d.ts +58 -0
  22. package/vue/UiEditorLinkCard.js +2 -0
  23. package/vue/UiEditorLinkCard.vue +319 -0
  24. package/vue/chunks/UiAffordanceScope.js +1 -1
  25. package/vue/chunks/UiAvatar.js +1 -1
  26. package/vue/chunks/UiAvatarGroup.js +1 -1
  27. package/vue/chunks/UiBadge.js +1 -1
  28. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  29. package/vue/chunks/UiBreadcrumbs.js +1 -1
  30. package/vue/chunks/UiButton.js +1 -1
  31. package/vue/chunks/UiCallout.js +1 -1
  32. package/vue/chunks/UiCard.js +1 -1
  33. package/vue/chunks/UiCheckbox.js +1 -1
  34. package/vue/chunks/UiCluster.js +1 -1
  35. package/vue/chunks/UiCombobox.js +1 -1
  36. package/vue/chunks/UiContainer.js +1 -1
  37. package/vue/chunks/UiContextMenu.js +1 -1
  38. package/vue/chunks/UiCover.js +1 -1
  39. package/vue/chunks/UiDescriptionItem.js +1 -1
  40. package/vue/chunks/UiDescriptionList.js +1 -1
  41. package/vue/chunks/UiDialog.js +1 -1
  42. package/vue/chunks/UiDisclosure.js +1 -1
  43. package/vue/chunks/UiEditable.js +1 -1
  44. package/vue/chunks/UiEditorBlockActions.js +127 -0
  45. package/vue/chunks/UiEditorImageToolbar.js +7 -25
  46. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  47. package/vue/chunks/UiEditorLinkCard.js +356 -0
  48. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  49. package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
  50. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  51. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  52. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  53. package/vue/chunks/UiEditorSurface.js +1 -1
  54. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  55. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  56. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  57. package/vue/chunks/UiEditorToolbar.js +1 -1
  58. package/vue/chunks/UiFloatingActionButton.js +1 -1
  59. package/vue/chunks/UiFormField.js +1 -1
  60. package/vue/chunks/UiGrid.js +1 -1
  61. package/vue/chunks/UiIcon.js +1 -1
  62. package/vue/chunks/UiIconButton.js +1 -1
  63. package/vue/chunks/UiImage.js +1 -1
  64. package/vue/chunks/UiInput.js +1 -1
  65. package/vue/chunks/UiInputGroup.js +1 -1
  66. package/vue/chunks/UiList.js +1 -1
  67. package/vue/chunks/UiListItem.js +1 -1
  68. package/vue/chunks/UiListbox.js +1 -1
  69. package/vue/chunks/UiMenu.js +1 -1
  70. package/vue/chunks/UiMenuGroup.js +1 -1
  71. package/vue/chunks/UiMenuItem.js +1 -1
  72. package/vue/chunks/UiMeter.js +1 -1
  73. package/vue/chunks/UiNavItem.js +1 -1
  74. package/vue/chunks/UiPageHeader.js +1 -1
  75. package/vue/chunks/UiPopover.js +1 -1
  76. package/vue/chunks/UiRadio.js +1 -1
  77. package/vue/chunks/UiRadioGroup.js +1 -1
  78. package/vue/chunks/UiReel.js +1 -1
  79. package/vue/chunks/UiScrollArea.js +1 -1
  80. package/vue/chunks/UiSearchResultRow.js +1 -1
  81. package/vue/chunks/UiSearchShell.js +1 -1
  82. package/vue/chunks/UiSection.js +1 -1
  83. package/vue/chunks/UiSelect.js +1 -1
  84. package/vue/chunks/UiSeparator.js +1 -1
  85. package/vue/chunks/UiSidebar.js +1 -1
  86. package/vue/chunks/UiSpinner.js +1 -1
  87. package/vue/chunks/UiStack.js +1 -1
  88. package/vue/chunks/UiStatusMessage.js +1 -1
  89. package/vue/chunks/UiSwitch.js +1 -1
  90. package/vue/chunks/UiSwitcher.js +1 -1
  91. package/vue/chunks/UiTable.js +1 -1
  92. package/vue/chunks/UiTabs.js +1 -1
  93. package/vue/chunks/UiText.js +1 -1
  94. package/vue/chunks/UiTextarea.js +1 -1
  95. package/vue/chunks/UiToast.js +1 -1
  96. package/vue/chunks/UiToastRegion.js +1 -1
  97. package/vue/chunks/UiTooltip.js +1 -1
  98. package/vue/chunks/UiTree.js +1 -1
  99. package/vue/chunks/UiTreeItem.js +1 -1
  100. package/vue/chunks/_plugin-vue_export-helper.js +1 -1
  101. package/vue/components.css +1176 -1176
  102. package/vue/editor/index.js +29 -94
  103. package/vue/editor/primitives.d.ts +8 -2
  104. package/vue/index.d.ts +2 -0
  105. package/vue/index.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.28.6",
3
+ "version": "0.28.7",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -0,0 +1 @@
1
+ /* Generated by HTML Next 1.0.0-alpha.51. Do not edit. */
@@ -0,0 +1 @@
1
+ /* Generated by HTML Next 1.0.0-alpha.51. Do not edit. */
@@ -0,0 +1,16 @@
1
+ // Generated by HTML Next 1.0.0-alpha.51 for Vanilla DOM. Do not edit.
2
+ export interface UiEditorBlockActionsEventMap {
3
+ action: CustomEvent<{ readonly action: "insert-below" | "duplicate" | "delete" }>;
4
+ }
5
+ export interface UiEditorBlockActionsElement extends HTMLDivElement {
6
+ addEventListener<K extends keyof UiEditorBlockActionsEventMap>(type: K, listener: (this: UiEditorBlockActionsElement, event: UiEditorBlockActionsEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
7
+ removeEventListener<K extends keyof UiEditorBlockActionsEventMap>(type: K, listener: (this: UiEditorBlockActionsElement, event: UiEditorBlockActionsEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
8
+ }
9
+ export interface UiEditorBlockActionsProps {
10
+ for?: string | null;
11
+ placement?: "bottom-start" | "top-start" | null;
12
+ attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
13
+ children?: readonly (string | Node)[];
14
+ slots?: Readonly<Record<string, readonly (string | Node)[]>>;
15
+ }
16
+ export declare function createUiEditorBlockActions(props?: UiEditorBlockActionsProps): UiEditorBlockActionsElement;
@@ -0,0 +1,41 @@
1
+ // Generated by HTML Next 1.0.0-alpha.51 for Vanilla DOM. Do not edit.
2
+ import { attachGeneratedController, buildTemplate, toAttribute, writeAttribute, dispatchDeclared, detailCheck, formatOf, keywordFormat, acceptProps, manageProps, checkConstrained, checkFormat, checkObject, checkString } from "@nextwebwg/html-next/generated-runtime";
3
+ import * as controller from "../components/ui-editor-block-actions/ui-editor-block-actions.js";
4
+ import "../styles/ui-editor-block-actions.css";
5
+
6
+ const T0 = ["",[],["ui-menu",["aria-label","Block actions"],["ui-menu-item",["value","insert-below"],"Insert paragraph below"],["ui-menu-item",["value","duplicate"],"Duplicate block"],["ui-menu-item",["value","delete"],"Delete block"]]];
7
+ let P0;
8
+ const S = { n: [], t: [], f: import.meta.url, g: "ui-editor-block-actions", d: { "action": [detailCheck(checkObject([["action", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["insert-below","duplicate","delete"]}), false]], false)), true, true, false] }, x: dispatchDeclared };
9
+ const D = { props: { "for": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "placement": { "required":false,"values":["bottom-start","top-start"],"default":"bottom-start", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] } } };
10
+ const C = (host) => controller.default(host);
11
+
12
+ export function createUiEditorBlockActions(options = {}, html) {
13
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
14
+ const element = document.createElement("div");
15
+ for (const [name, value] of Object.entries(attributes)) {
16
+ if (value === null || value === undefined || value === false) continue;
17
+ element.setAttribute(name, value === true ? "" : String(value));
18
+ }
19
+ element.setAttribute("data-component", "ui-editor-block-actions");
20
+ element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
21
+ const v = [null, null];
22
+ const B = acceptProps(element, D, S.n, v, componentProps, [], html);
23
+ const p0 = (r, c, d) => {
24
+ if (c & 1) {
25
+ const x0 = v[0];
26
+ const s0 = toAttribute(x0, "for");
27
+ if (s0 !== r.v0) writeAttribute(r.a0, "for", r.v0 = s0);
28
+ }
29
+ if (c & 1073741826) {
30
+ const x1 = v[1];
31
+ const s1 = toAttribute(x1, "placement");
32
+ if (s1 !== r.v1) writeAttribute(r.a0, "placement", r.v1 = s1);
33
+ }
34
+ };
35
+ const t0 = element.firstChild;
36
+ const R = { a0: t0, v0: null, v1: null };
37
+ const I = { B };
38
+ attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), C, undefined, I);
39
+ manageProps(I);
40
+ return element;
41
+ }
@@ -3,7 +3,7 @@ import { attachGeneratedController, buildTemplate, NONCONFORMING, readIndex, tex
3
3
  import * as controller from "../components/ui-editor-image-toolbar/ui-editor-image-toolbar.js";
4
4
  import "../styles/ui-editor-image-toolbar.css";
5
5
 
6
- const T0 = ["",[],["ui-text",["as","div","font","sans"],["ui-editor-toolbar",["aria-label","Image actions"],["ui-icon-button",["label","Image in line","size","sm","data-image-placement","block"],["ui-icon",["name","panel-top","size","sm"]]],["ui-icon-button",["label","Center image","size","sm","data-image-placement","center"],["ui-icon",["name","align-center","size","sm"]]],["ui-icon-button",["label","Wrap text to the right","size","sm","data-image-placement","wrap-left"],["ui-icon",["name","panel-left","size","sm"]]],["ui-icon-button",["label","Wrap text to the left","size","sm","data-image-placement","wrap-right"],["ui-icon",["name","panel-right","size","sm"]]],["ui-icon-button",["label","Image description","size","sm","variant","ghost"],["ui-icon",["name","file-text","size","sm"]]],["ui-icon-button",["label","Delete image","size","sm","variant","ghost","data-image-action","delete"],["ui-icon",["name","trash","size","sm"]]]],["ui-tooltip",[],"Image in line"],["ui-tooltip",[],"Center image"],["ui-tooltip",[],"Wrap text to the right"],["ui-tooltip",[],"Wrap text to the left"],["ui-tooltip",[],"Image description"],["ui-tooltip",[],"Delete image"],["ui-popover",["data-image-description","","size","sm","aria-label","Image description"],["form",["aria-label","Image description"],["ui-stack",["gap","s"],["ui-form-field",[],["label",["slot","label"],"Alt text"],["ui-input",["data-image-alt","","size","sm"]]],["ui-text",["size","xs","tone","secondary"],"Describe the image for people using a screen reader."],["ui-cluster",["justify","end","gap","xs"],["ui-button",["type","button","variant","ghost","tone","neutral","size","sm","data-image-action","cancel"],"Cancel"],["ui-button",["type","submit","variant","solid","size","sm"],"Save"]]]]]]];
6
+ const T0 = ["",[],["ui-text",["as","div","font","sans"],["ui-editor-toolbar",["aria-label","Image actions"],["ui-icon-button",["label","Image in line","size","sm","data-image-placement","block"],["ui-icon",["name","panel-top"]]],["ui-icon-button",["label","Center image","size","sm","data-image-placement","center"],["ui-icon",["name","align-center"]]],["ui-icon-button",["label","Wrap text to the right","size","sm","data-image-placement","wrap-left"],["ui-icon",["name","panel-left"]]],["ui-icon-button",["label","Wrap text to the left","size","sm","data-image-placement","wrap-right"],["ui-icon",["name","panel-right"]]],["ui-icon-button",["label","Image description","size","sm","variant","ghost"],["ui-icon",["name","file-text"]]],["ui-icon-button",["label","Delete image","size","sm","variant","ghost","data-image-action","delete"],["ui-icon",["name","trash"]]]],["ui-tooltip",[],"Image in line"],["ui-tooltip",[],"Center image"],["ui-tooltip",[],"Wrap text to the right"],["ui-tooltip",[],"Wrap text to the left"],["ui-tooltip",[],"Image description"],["ui-tooltip",[],"Delete image"],["ui-popover",["data-image-description","","size","sm","aria-label","Image description"],["form",["aria-label","Image description"],["ui-stack",["gap","s"],["ui-form-field",[],["label",["slot","label"],"Alt text"],["ui-input",["data-image-alt","","size","sm"]]],["ui-text",["size","xs","tone","secondary"],"Describe the image for people using a screen reader."],["ui-cluster",["justify","end","gap","xs"],["ui-button",["type","button","variant","ghost","tone","neutral","size","sm","data-image-action","cancel"],"Cancel"],["ui-button",["type","submit","variant","solid","size","sm"],"Save"]]]]]]];
7
7
  let P0;
8
8
  const S = { n: ["base","describing","draft"], t: ["s","b","s"], f: import.meta.url, g: "ui-editor-image-toolbar", d: { "placement": [detailCheck(checkObject([["placement", checkConstrained(checkFormat("keyword", keywordFormat), "keyword", {"values":["block","center","wrap-left","wrap-right"]}), false]], false)), true, true, false], "describe": [detailCheck(checkObject([["alt", checkString, false]], false)), true, true, false], "delete": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared };
9
9
  const D = { props: { "alt": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "placement": { "required":false,"values":["block","center","wrap-left","wrap-right"],"default":"block", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "target": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
@@ -0,0 +1,20 @@
1
+ // Generated by HTML Next 1.0.0-alpha.51 for Vanilla DOM. Do not edit.
2
+ export interface UiEditorLinkCardEventMap {
3
+ edit: CustomEvent<Readonly<Record<string, unknown>>>;
4
+ remove: CustomEvent<Readonly<Record<string, unknown>>>;
5
+ }
6
+ export interface UiEditorLinkCardElement extends HTMLDivElement {
7
+ addEventListener<K extends keyof UiEditorLinkCardEventMap>(type: K, listener: (this: UiEditorLinkCardElement, event: UiEditorLinkCardEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
8
+ removeEventListener<K extends keyof UiEditorLinkCardEventMap>(type: K, listener: (this: UiEditorLinkCardElement, event: UiEditorLinkCardEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
9
+ }
10
+ export interface UiEditorLinkCardProps {
11
+ detail?: string | null;
12
+ href?: string | null;
13
+ label?: string | null;
14
+ openHref?: string | null;
15
+ targetLabel?: string | null;
16
+ attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
17
+ children?: readonly (string | Node)[];
18
+ slots?: Readonly<Record<string, readonly (string | Node)[]>>;
19
+ }
20
+ export declare function createUiEditorLinkCard(props?: UiEditorLinkCardProps): UiEditorLinkCardElement;
@@ -0,0 +1,153 @@
1
+ // Generated by HTML Next 1.0.0-alpha.51 for Vanilla DOM. Do not edit.
2
+ import { attachGeneratedController, buildTemplate, clearRegion, NONCONFORMING, readIndex, textCall, toAttribute, toText, writeAttribute, writeUrlAttribute, computedCycle, dispatchDeclared, detailCheck, acceptProps, manageProps, readonlyView, checkRecord, checkString, checkUnknown } from "@nextwebwg/html-next/generated-runtime";
3
+ import * as controller from "../components/ui-editor-link-card/ui-editor-link-card.js";
4
+ import "../styles/ui-editor-link-card.css";
5
+
6
+ const T0 = ["",[],["ui-card",["variant","elevated","padding","xs","size","content"],["ui-cluster",["gap","xs","wrap","nowrap","role","group","aria-label","Link actions"],["ui-icon",[]],["ui-stack",["gap","none"],["ui-text",["as","strong","size","sm","weight","medium","font","sans","wrap","anywhere"],0],1],1,["ui-icon-button",["label","Edit link","variant","ghost","size","sm","data-link-action","edit"],["ui-icon",["name","pencil"]]],["ui-tooltip",[],"Edit link"],["ui-icon-button",["label","Remove link","variant","ghost","size","sm","data-link-action","remove"],["ui-icon",["name","unlink"]]],["ui-tooltip",[],"Remove link"]]]];
7
+ const T1 = ["ui-text",["as","small","size","xs","tone","secondary","font","sans"],0];
8
+ const T2 = ["",[],["ui-button",["as","a","variant","ghost","tone","neutral","size","sm","target","_blank","rel","noopener noreferrer","aria-label","Open link"],["ui-cluster",["gap","xs","wrap","nowrap"],["ui-icon",["name","external-link"]],"Open link"]],["ui-tooltip",[],"Open link"]];
9
+ let P0, P1, P2;
10
+ const S = { n: ["base","resolved","shown"], t: ["s","?","?"], f: import.meta.url, g: "ui-editor-link-card", k: 1, d: { "edit": [detailCheck(checkRecord(checkUnknown)), true, true, false], "remove": [detailCheck(checkRecord(checkUnknown)), true, true, false] }, x: dispatchDeclared, r: readonlyView };
11
+ const D = { props: { "detail": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "href": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "label": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "openHref": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "targetLabel": { "required":false,"default":"Item", c: checkString, t: "string", j: 0, m: "s" } } };
12
+ const C = (host) => controller.default(host);
13
+
14
+ export function createUiEditorLinkCard(options = {}, html) {
15
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
16
+ const element = document.createElement("div");
17
+ for (const [name, value] of Object.entries(attributes)) {
18
+ if (value === null || value === undefined || value === false) continue;
19
+ element.setAttribute(name, value === true ? "" : String(value));
20
+ }
21
+ element.setAttribute("data-component", "ui-editor-link-card");
22
+ element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
23
+ const v = ["ui-editor-link-card", undefined, undefined, null, null, null, null, null];
24
+ const B = acceptProps(element, D, S.n, v, componentProps, [], html);
25
+ const X = { e: 0, g: (j) => g(j), w: new Set() };
26
+ const ke = [];
27
+ const K = [() => (v[5] !== ""), () => readIndex({ "true": v[5], "false": v[4] }, textCall("concat", [g(1)]))];
28
+ const g = (j) => {
29
+ const i = j - 1;
30
+ if (ke[i] === X.e) return v[j];
31
+ if (ke[i] === -1) computedCycle();
32
+ ke[i] = -1;
33
+ let next;
34
+ try { next = K[i](); } catch (error) { ke[i] = undefined; throw error; }
35
+ ke[i] = X.e;
36
+ const previous = v[j];
37
+ if (!Object.is(previous, next)) { v[j] = next; X.n?.(j, previous, next); }
38
+ return next;
39
+ };
40
+ const m1 = (d) => {
41
+ const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
42
+ const t0 = n.firstChild;
43
+ const r = { n, a0: t0, v0: "" };
44
+ p1(r, -1, d);
45
+ return r;
46
+ };
47
+ const p1 = (r, c, d) => {
48
+ if (c & 8) {
49
+ const x0 = v[3];
50
+ const s0 = toText(x0);
51
+ if (s0 !== r.v0) r.a0.data = r.v0 = s0;
52
+ }
53
+ };
54
+ const m2 = (d) => {
55
+ const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
56
+ const t0 = n.firstChild;
57
+ const t1 = t0.nextSibling;
58
+ const r = { n, a0: t0, a1: t1, v0: null, v1: null, v2: null };
59
+ p2(r, -1, d);
60
+ return r;
61
+ };
62
+ const p2 = (r, c, d) => {
63
+ if (c & 1) {
64
+ const x0 = textCall("concat", [v[0], "-open"]);
65
+ if (x0 !== NONCONFORMING) {
66
+ const s0 = toAttribute(x0, "id");
67
+ if (s0 !== r.v0) writeAttribute(r.a0, "id", r.v0 = s0);
68
+ }
69
+ if (x0 !== NONCONFORMING) {
70
+ const s2 = toAttribute(x0, "for");
71
+ if (s2 !== r.v2) writeAttribute(r.a1, "for", r.v2 = s2);
72
+ }
73
+ }
74
+ if (c & 64) {
75
+ const x1 = v[6];
76
+ const s1 = toAttribute(x1, "href");
77
+ if (s1 !== r.v1) writeUrlAttribute(r.a0, "href", r.v1 = s1);
78
+ }
79
+ };
80
+ const p0 = (r, c, d) => {
81
+ if (c & 1073741856) {
82
+ const x0 = readIndex({ "true": "file-text", "false": "link" }, textCall("concat", [g(1)]));
83
+ if (x0 !== NONCONFORMING) {
84
+ const s0 = toAttribute(x0, "name");
85
+ if (s0 !== r.v0) writeAttribute(r.a0, "name", r.v0 = s0);
86
+ }
87
+ }
88
+ if (c & 16) {
89
+ const x1 = v[4];
90
+ const s1 = toAttribute(x1, "title");
91
+ if (s1 !== r.v1) writeAttribute(r.a1, "title", r.v1 = s1);
92
+ }
93
+ if (c & 1073742000) {
94
+ const x2 = textCall("concat", [readIndex({ "true": v[7], "false": "URL" }, textCall("concat", [g(1)])), ": ", g(2)]);
95
+ if (x2 !== NONCONFORMING) {
96
+ const s2 = toAttribute(x2, "aria-label");
97
+ if (s2 !== r.v2) writeAttribute(r.a1, "aria-label", r.v2 = s2);
98
+ }
99
+ }
100
+ if (c & 1073741872) {
101
+ const x3 = g(2);
102
+ if (x3 !== NONCONFORMING) {
103
+ const s3 = toText(x3);
104
+ if (s3 !== r.v3) r.a2.data = r.v3 = s3;
105
+ }
106
+ }
107
+ if (c & 1) {
108
+ const x4 = textCall("concat", [v[0], "-edit"]);
109
+ if (x4 !== NONCONFORMING) {
110
+ const s4 = toAttribute(x4, "id");
111
+ if (s4 !== r.v4) writeAttribute(r.a5, "id", r.v4 = s4);
112
+ }
113
+ if (x4 !== NONCONFORMING) {
114
+ const s5 = toAttribute(x4, "for");
115
+ if (s5 !== r.v5) writeAttribute(r.a6, "for", r.v5 = s5);
116
+ }
117
+ const x5 = textCall("concat", [v[0], "-remove"]);
118
+ if (x5 !== NONCONFORMING) {
119
+ const s6 = toAttribute(x5, "id");
120
+ if (s6 !== r.v6) writeAttribute(r.a7, "id", r.v6 = s6);
121
+ }
122
+ if (x5 !== NONCONFORMING) {
123
+ const s7 = toAttribute(x5, "for");
124
+ if (s7 !== r.v7) writeAttribute(r.a8, "for", r.v7 = s7);
125
+ }
126
+ }
127
+ if (c & 8 && !((v[3] !== "")) !== !r.b0) {
128
+ if (r.b0) { r.b0 = undefined; clearRegion(r.a3, r.e0); }
129
+ else { r.b0 = m1(d); r.e0.before(r.b0.n); }
130
+ } else if (r.b0 !== undefined) p1(r.b0, c, d);
131
+ if (c & 64 && !((v[6] !== "")) !== !r.b1) {
132
+ if (r.b1) { r.b1 = undefined; clearRegion(r.a4, r.e1); }
133
+ else { r.b1 = m2(d); r.e1.before(r.b1.n); }
134
+ } else if (r.b1 !== undefined) p2(r.b1, c, d);
135
+ };
136
+ const t0 = element.firstChild.firstChild;
137
+ const t1 = t0.firstChild;
138
+ const t2 = t1.nextSibling;
139
+ const t3 = t2.firstChild;
140
+ const t4 = t3.firstChild;
141
+ const t5 = t3.nextSibling;
142
+ const t6 = t2.nextSibling;
143
+ const t7 = t6.nextSibling.nextSibling;
144
+ const t8 = t7.nextSibling;
145
+ const t9 = t8.nextSibling;
146
+ const t10 = t9.nextSibling;
147
+ const R = { a0: t1, a1: t2, a2: t4, a5: t7, a6: t8, a7: t9, a8: t10, v0: null, v1: null, v2: null, v3: "", v4: null, v5: null, v6: null, v7: null, a3: t5, e0: t5.nextSibling, b0: undefined, a4: t6, e1: t6.nextSibling, b1: undefined };
148
+ const I = { B };
149
+ I.R = new Set();
150
+ 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);
151
+ manageProps(I);
152
+ return element;
153
+ }
package/vanilla/index.js CHANGED
@@ -19,8 +19,10 @@ 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";
24
26
  export * from "./UiEditorMentionMenu.js";
25
27
  export * from "./UiEditorMentionMenuItem.js";
26
28
  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 };