@threadlabs/looma 0.10.9 → 0.10.11

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 (51) hide show
  1. package/components/ui-dialog/ui-dialog.html +17 -0
  2. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +17 -0
  3. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +17 -0
  4. package/components/ui-editor-toolbar/ui-editor-toolbar.html +24 -43
  5. package/components/ui-reel/ui-reel.html +24 -0
  6. package/components/ui-scroll-area/ui-scroll-area.html +56 -0
  7. package/components/ui-search-shell/ui-search-shell.html +17 -0
  8. package/components/ui-sidebar/ui-sidebar.html +18 -0
  9. package/components/ui-tree-item/ui-tree-item.html +39 -29
  10. package/components/ui-tree-item/ui-tree-item.js +17 -11
  11. package/dist/index.js +19 -20
  12. package/package.json +1 -1
  13. package/styles/ui-dialog.css +17 -0
  14. package/styles/ui-editor-mention-menu.css +17 -0
  15. package/styles/ui-editor-slash-menu.css +17 -0
  16. package/styles/ui-editor-toolbar.css +25 -42
  17. package/styles/ui-reel.css +27 -1
  18. package/styles/ui-scroll-area.css +57 -0
  19. package/styles/ui-search-shell.css +17 -0
  20. package/styles/ui-sidebar.css +22 -1
  21. package/styles/ui-tree-item.css +44 -32
  22. package/tokens.css +44 -0
  23. package/vanilla/UiEditorToolbar.js +1 -3
  24. package/vanilla/UiScrollArea.d.ts +14 -0
  25. package/vanilla/UiScrollArea.js +28 -0
  26. package/vanilla/UiTreeItem.js +1 -1
  27. package/vanilla/index.js +1 -0
  28. package/vue/UiDialog.vue +21 -0
  29. package/vue/UiEditorMentionMenu.vue +21 -0
  30. package/vue/UiEditorSlashMenu.vue +21 -0
  31. package/vue/UiEditorToolbar.vue +26 -57
  32. package/vue/UiReel.vue +28 -0
  33. package/vue/UiScrollArea.d.ts +18 -0
  34. package/vue/UiScrollArea.js +2 -0
  35. package/vue/UiScrollArea.vue +85 -0
  36. package/vue/UiSearchShell.vue +21 -0
  37. package/vue/UiSidebar.vue +22 -0
  38. package/vue/UiTreeItem.vue +49 -29
  39. package/vue/chunks/UiDialog.js +1 -1
  40. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  41. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  42. package/vue/chunks/UiEditorToolbar.js +5 -29
  43. package/vue/chunks/UiReel.js +1 -1
  44. package/vue/chunks/UiScrollArea.js +21 -0
  45. package/vue/chunks/UiSearchShell.js +1 -1
  46. package/vue/chunks/UiSidebar.js +1 -1
  47. package/vue/chunks/UiTreeItem.js +15 -5
  48. package/vue/components.css +438 -248
  49. package/vue/index.d.ts +1 -0
  50. package/vue/index.js +2 -1
  51. package/components/ui-editor-toolbar/ui-editor-toolbar.js +0 -24
@@ -51,6 +51,8 @@ const root = ref<HTMLElement | null>(null)
51
51
  const rowElement = useTemplateRef<HTMLElement>('row')
52
52
  const dragHandleElement = useTemplateRef<HTMLElement>('dragHandle')
53
53
  const disclosureElement = useTemplateRef<HTMLElement>('disclosure')
54
+ const leadingElement = useTemplateRef<HTMLElement>('leading')
55
+ const labelElement = useTemplateRef<HTMLElement>('label')
54
56
  const labelTextElement = useTemplateRef<HTMLElement>('labelText')
55
57
  const actionsElement = useTemplateRef<HTMLElement>('actions')
56
58
  const childrenElement = useTemplateRef<HTMLElement>('children')
@@ -92,6 +94,8 @@ useComponentHost(controllerModule.default, {
92
94
  row: rowElement,
93
95
  dragHandle: dragHandleElement,
94
96
  disclosure: disclosureElement,
97
+ leading: leadingElement,
98
+ label: labelElement,
95
99
  labelText: labelTextElement,
96
100
  actions: actionsElement,
97
101
  children: childrenElement,
@@ -154,8 +158,8 @@ useComponentHost(controllerModule.default, {
154
158
  >
155
159
  <span class="disclosure-icon" aria-hidden="true"></span>
156
160
  </button>
157
- <span class="leading"><slot name="leading" /></span>
158
- <span class="label"><span class="label-text" ref="labelText"><slot name="label">{{
161
+ <span class="leading" ref="leading"><slot name="leading" /></span>
162
+ <span class="label" ref="label"><span class="label-text" ref="labelText"><slot name="label">{{
159
163
  label
160
164
  }}</slot></span></span>
161
165
  <span class="actions" ref="actions"><slot name="actions" /></span>
@@ -296,6 +300,9 @@ useComponentHost(controllerModule.default, {
296
300
  block-size: 1em;
297
301
  margin-inline-start: var(--ui-space-1);
298
302
  color: var(--ui-text-muted);
303
+ /* Above the label, so a sliding name passes under the icon. */
304
+ position: relative;
305
+ z-index: 1;
299
306
  }
300
307
 
301
308
  .leading:empty {
@@ -324,6 +331,9 @@ useComponentHost(controllerModule.default, {
324
331
  overflow: hidden;
325
332
  padding: var(--ui-tree-item-label-padding-block, var(--ui-space-1))
326
333
  var(--ui-tree-item-label-padding-inline, var(--ui-space-2));
334
+ /* The length of the fade before the controls. The label's one flex child lays out no gap; this
335
+ is where the controller reads the length in pixels to stop a sliding name before the fade. */
336
+ column-gap: var(--ui-space-3);
327
337
  }
328
338
 
329
339
  /* Slotted label content fills the cell, so a link is the row's hit area rather than sizing to
@@ -344,6 +354,27 @@ useComponentHost(controllerModule.default, {
344
354
  min-inline-size: 0;
345
355
  }
346
356
 
357
+ /* The controls sit over the label's end, so the text fades out where they begin. The fade is
358
+ the truncation mark while it shows: an ellipsis under it would read as a second one. */
359
+ .row:hover > .label,
360
+ .row:focus-within > .label {
361
+ text-overflow: clip;
362
+ mask-image: linear-gradient(
363
+ to right,
364
+ #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
365
+ transparent calc(100% - var(--_tree-actions-width, 1.75rem))
366
+ );
367
+ }
368
+
369
+ .row:hover > .label:dir(rtl),
370
+ .row:focus-within > .label:dir(rtl) {
371
+ mask-image: linear-gradient(
372
+ to left,
373
+ #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
374
+ transparent calc(100% - var(--_tree-actions-width, 1.75rem))
375
+ );
376
+ }
377
+
347
378
  /* A hovered row reads its whole name: the label slides far enough to show the end, waits
348
379
  there, and comes back. Only when it actually overflows — the controller measures by how
349
380
  much — after the controls have taken their place over its end — and hands over the distance
@@ -355,13 +386,21 @@ useComponentHost(controllerModule.default, {
355
386
  will-change: transform;
356
387
  }
357
388
 
358
- /* While it slides, the start fades too: the name is leaving the cell at both ends, and a hard
359
- edge beside the icon reads as a collision rather than as more text. */
389
+ /* This comes after the hover fade, which it replaces at the same specificity. While the name
390
+ slides, the label reaches back under the icon (the controller measures how far) with its text
391
+ where it was, and fades out across that stretch, gone by the icon's middle: the name slips
392
+ under the icon rather than stopping at a hard edge beside it. */
360
393
  .row[data-ui-marquee] > .label {
394
+ margin-inline-start: calc(-1 * var(--_marquee-lead, 0px));
395
+ padding-inline-start: calc(
396
+ var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))
397
+ );
361
398
  mask-image: linear-gradient(
362
399
  to right,
363
- transparent 0,
364
- #000 var(--ui-space-2),
400
+ transparent calc(var(--_marquee-lead, 0px) / 2),
401
+ #000 calc(
402
+ var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))
403
+ ),
365
404
  #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
366
405
  transparent calc(100% - var(--_tree-actions-width, 1.75rem))
367
406
  );
@@ -370,8 +409,10 @@ useComponentHost(controllerModule.default, {
370
409
  .row[data-ui-marquee] > .label:dir(rtl) {
371
410
  mask-image: linear-gradient(
372
411
  to left,
373
- transparent 0,
374
- #000 var(--ui-space-2),
412
+ transparent calc(var(--_marquee-lead, 0px) / 2),
413
+ #000 calc(
414
+ var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))
415
+ ),
375
416
  #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
376
417
  transparent calc(100% - var(--_tree-actions-width, 1.75rem))
377
418
  );
@@ -394,27 +435,6 @@ useComponentHost(controllerModule.default, {
394
435
  }
395
436
  }
396
437
 
397
- /* The controls sit over the label's end, so the text fades out where they begin. The fade is
398
- the truncation mark while it shows: an ellipsis under it would read as a second one. */
399
- .row:hover > .label,
400
- .row:focus-within > .label {
401
- text-overflow: clip;
402
- mask-image: linear-gradient(
403
- to right,
404
- #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
405
- transparent calc(100% - var(--_tree-actions-width, 1.75rem))
406
- );
407
- }
408
-
409
- .row:hover > .label:dir(rtl),
410
- .row:focus-within > .label:dir(rtl) {
411
- mask-image: linear-gradient(
412
- to left,
413
- #000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
414
- transparent calc(100% - var(--_tree-actions-width, 1.75rem))
415
- );
416
- }
417
-
418
438
  .row:hover > .label > :slotted(*),
419
439
  .row:focus-within > .label > :slotted(*) {
420
440
  text-overflow: clip;
@@ -75,6 +75,6 @@ var UiDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
75
75
  ], 16, _hoisted_1);
76
76
  };
77
77
  }
78
- }), [["__scopeId", "data-v-d43d3a22"]]);
78
+ }), [["__scopeId", "data-v-0fd6654c"]]);
79
79
  //#endregion
80
80
  export { UiDialog_default as t };
@@ -101,6 +101,6 @@ var UiEditorMentionMenu_default = /*#__PURE__*/ _plugin_vue_export_helper_defaul
101
101
  ], 16, _hoisted_1);
102
102
  };
103
103
  }
104
- }), [["__scopeId", "data-v-9c76e661"]]);
104
+ }), [["__scopeId", "data-v-a6db8e19"]]);
105
105
  //#endregion
106
106
  export { UiEditorMentionMenu_default as t };
@@ -95,6 +95,6 @@ var UiEditorSlashMenu_default = /*#__PURE__*/ _plugin_vue_export_helper_default(
95
95
  ], 16, _hoisted_1);
96
96
  };
97
97
  }
98
- }), [["__scopeId", "data-v-afcbaee6"]]);
98
+ }), [["__scopeId", "data-v-dcc1f07d"]]);
99
99
  //#endregion
100
100
  export { UiEditorSlashMenu_default as t };
@@ -1,7 +1,5 @@
1
- import { n as useComponentHost, t as createDispatch } from "./host.js";
2
1
  import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
3
- import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, useTemplateRef } from "vue";
4
- import * as controllerModule from "@threadlabs/looma/components/ui-editor-toolbar/ui-editor-toolbar.js";
2
+ import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, useTemplateRef } from "vue";
5
3
  //#region .build/vue/UiEditorToolbar.vue?vue&type=script&setup=true&lang.ts
6
4
  var _hoisted_1 = ["data-ui-editor-toolbar-state"];
7
5
  var _hoisted_2 = {
@@ -19,39 +17,17 @@ var UiEditorToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
19
17
  } },
20
18
  setup(__props) {
21
19
  const props = __props;
22
- const root = ref(null);
23
- const stripElement = useTemplateRef("strip");
24
- const overflowStart = ref(false);
25
- const overflowEnd = ref(false);
20
+ useTemplateRef("strip");
26
21
  /** The values the styles' :host-state() rules test. */
27
- const hostState = computed(() => [
28
- overflowStart.value && "overflowStart",
29
- overflowEnd.value && "overflowEnd",
30
- props.floating && "floating"
31
- ].filter(Boolean).join(" "));
32
- const dispatch = createDispatch(root);
33
- useComponentHost(controllerModule.default, {
34
- root,
35
- dispatch,
36
- props,
37
- refs: { strip: stripElement },
38
- state: {
39
- overflowStart,
40
- overflowEnd
41
- }
42
- });
22
+ const hostState = computed(() => [props.floating && "floating"].filter(Boolean).join(" "));
43
23
  return (_ctx, _cache) => {
44
24
  return openBlock(), createElementBlock("div", mergeProps({
45
25
  "data-component": "ui-editor-toolbar",
46
26
  role: "toolbar",
47
27
  "aria-label": "Editor toolbar"
48
- }, _ctx.$attrs, {
49
- "data-ui-editor-toolbar-state": hostState.value || void 0,
50
- ref_key: "root",
51
- ref: root
52
- }), [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default")], 512)], 16, _hoisted_1);
28
+ }, _ctx.$attrs, { "data-ui-editor-toolbar-state": hostState.value || void 0 }), [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default")], 512)], 16, _hoisted_1);
53
29
  };
54
30
  }
55
- }), [["__scopeId", "data-v-8f7cefb2"]]);
31
+ }), [["__scopeId", "data-v-3076bb8c"]]);
56
32
  //#endregion
57
33
  export { UiEditorToolbar_default as t };
@@ -28,6 +28,6 @@ var UiReel_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
28
28
  }, _ctx.$attrs, { "data-ui-reel-state": hostState.value || void 0 }), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1);
29
29
  };
30
30
  }
31
- }), [["__scopeId", "data-v-b373e396"]]);
31
+ }), [["__scopeId", "data-v-eb18d6be"]]);
32
32
  //#endregion
33
33
  export { UiReel_default as t };
@@ -0,0 +1,21 @@
1
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
2
+ import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot } from "vue";
3
+ //#region .build/vue/UiScrollArea.vue?vue&type=script&setup=true&lang.ts
4
+ var _hoisted_1 = ["data-ui-scroll-area-state"];
5
+ //#endregion
6
+ //#region .build/vue/UiScrollArea.vue
7
+ var UiScrollArea_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
8
+ inheritAttrs: false,
9
+ __name: "UiScrollArea",
10
+ props: { orientation: { default: "vertical" } },
11
+ setup(__props) {
12
+ const props = __props;
13
+ /** The values the styles' :host-state() rules test. */
14
+ const hostState = computed(() => [props.orientation && `orientation orientation=${props.orientation}`].filter(Boolean).join(" "));
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createElementBlock("div", mergeProps({ "data-component": "ui-scroll-area" }, _ctx.$attrs, { "data-ui-scroll-area-state": hostState.value || void 0 }), [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 16, _hoisted_1);
17
+ };
18
+ }
19
+ }), [["__scopeId", "data-v-858d7508"]]);
20
+ //#endregion
21
+ export { UiScrollArea_default as t };
@@ -67,6 +67,6 @@ var UiSearchShell_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
67
67
  ])], 8, _hoisted_1)], 16);
68
68
  };
69
69
  }
70
- }), [["__scopeId", "data-v-d749a869"]]);
70
+ }), [["__scopeId", "data-v-2ba71171"]]);
71
71
  //#endregion
72
72
  export { UiSearchShell_default as t };
@@ -85,6 +85,6 @@ var UiSidebar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
85
85
  }, null, -1)])], 8, _hoisted_3)], 16, _hoisted_1);
86
86
  };
87
87
  }
88
- }), [["__scopeId", "data-v-d5bc9278"]]);
88
+ }), [["__scopeId", "data-v-20117052"]]);
89
89
  //#endregion
90
90
  export { UiSidebar_default as t };
@@ -22,8 +22,14 @@ var _hoisted_2 = {
22
22
  };
23
23
  var _hoisted_3 = ["aria-label"];
24
24
  var _hoisted_4 = ["disabled", "hidden"];
25
- var _hoisted_5 = { class: "leading" };
26
- var _hoisted_6 = { class: "label" };
25
+ var _hoisted_5 = {
26
+ class: "leading",
27
+ ref: "leading"
28
+ };
29
+ var _hoisted_6 = {
30
+ class: "label",
31
+ ref: "label"
32
+ };
27
33
  var _hoisted_7 = {
28
34
  class: "label-text",
29
35
  ref: "labelText"
@@ -79,6 +85,8 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
79
85
  const rowElement = useTemplateRef("row");
80
86
  const dragHandleElement = useTemplateRef("dragHandle");
81
87
  const disclosureElement = useTemplateRef("disclosure");
88
+ const leadingElement = useTemplateRef("leading");
89
+ const labelElement = useTemplateRef("label");
82
90
  const labelTextElement = useTemplateRef("labelText");
83
91
  const actionsElement = useTemplateRef("actions");
84
92
  const childrenElement = useTemplateRef("children");
@@ -114,6 +122,8 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
114
122
  row: rowElement,
115
123
  dragHandle: dragHandleElement,
116
124
  disclosure: disclosureElement,
125
+ leading: leadingElement,
126
+ label: labelElement,
117
127
  labelText: labelTextElement,
118
128
  actions: actionsElement,
119
129
  children: childrenElement
@@ -203,8 +213,8 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
203
213
  class: "disclosure-icon",
204
214
  "aria-hidden": "true"
205
215
  }, null, -1)])], 8, _hoisted_4),
206
- createElementVNode("span", _hoisted_5, [renderSlot(_ctx.$slots, "leading")]),
207
- createElementVNode("span", _hoisted_6, [createElementVNode("span", _hoisted_7, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 512)]),
216
+ createElementVNode("span", _hoisted_5, [renderSlot(_ctx.$slots, "leading")], 512),
217
+ createElementVNode("span", _hoisted_6, [createElementVNode("span", _hoisted_7, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 512)], 512),
208
218
  createElementVNode("span", _hoisted_8, [renderSlot(_ctx.$slots, "actions")], 512),
209
219
  _cache[2] || (_cache[2] = createElementVNode("span", {
210
220
  class: "drop-indicator row-drop-indicator",
@@ -224,6 +234,6 @@ var UiTreeItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
224
234
  ], 16, _hoisted_1);
225
235
  };
226
236
  }
227
- }), [["__scopeId", "data-v-a950b4d2"]]);
237
+ }), [["__scopeId", "data-v-3778b642"]]);
228
238
  //#endregion
229
239
  export { UiTreeItem_default as t };