@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
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import * as controller from "../components/ui-tree-item/ui-tree-item.js";
4
4
  import "../styles/ui-tree-item.css";
5
5
 
6
- const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"container":{"type":"boolean","required":false,"target":{"attribute":"container"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"dragType":{"type":"string","required":false,"target":{"attribute":"data-drag-type"},"default":"item"},"dropDepth":{"type":"number","required":false,"target":{"attribute":"data-drop-depth"}},"dropScope":{"type":"string","required":false,"target":{"attribute":"data-drop-scope"},"default":""},"expanded":{"type":"boolean","required":false,"target":{"attribute":"expanded"},"default":false},"itemId":{"type":"string","required":false,"target":{"attribute":"data-item-id"},"default":""},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"aria-selected"},"default":false},"sortable":{"type":"boolean","required":false,"target":{"attribute":"sortable"},"default":false},"subtreeDepth":{"type":"number","required":false,"target":{"attribute":"data-subtree-depth"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"treeitem"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-level","expression":"structuralLevel","expressionPlan":{"source":"structuralLevel","ast":{"kind":"id","name":"structuralLevel"},"dependencies":["structuralLevel"]}},{"kind":"attribute","name":"aria-selected","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-item-id","expression":"itemId","expressionPlan":{"source":"itemId","ast":{"kind":"id","name":"itemId"},"dependencies":["itemId"]}},{"kind":"attribute","name":"data-drag-type","expression":"dragType","expressionPlan":{"source":"dragType","ast":{"kind":"id","name":"dragType"},"dependencies":["dragType"]}},{"kind":"attribute","name":"data-drop-scope","expression":"dropScope","expressionPlan":{"source":"dropScope","ast":{"kind":"id","name":"dropScope"},"dependencies":["dropScope"]}},{"kind":"attribute","name":"data-accepts","expression":"accepts","expressionPlan":{"source":"accepts","ast":{"kind":"id","name":"accepts"},"dependencies":["accepts"]}},{"kind":"attribute","name":"data-drop-depth","expression":"dropDepth","expressionPlan":{"source":"dropDepth","ast":{"kind":"id","name":"dropDepth"},"dependencies":["dropDepth"]}},{"kind":"attribute","name":"data-subtree-depth","expression":"subtreeDepth","expressionPlan":{"source":"subtreeDepth","ast":{"kind":"id","name":"subtreeDepth"},"dependencies":["subtreeDepth"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"row"}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"drag-handle"},{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"draggable","value":"true"},{"kind":"attribute","name":"aria-label","expression":"format('Drag %s to reorder', label)","expressionPlan":{"source":"format('Drag %s to reorder', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Drag %s to reorder"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"literal","name":"focusable","value":"false"},{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]}]}],"flow":{"kind":"if","test":"sortable and not disabled","testPlan":{"source":"sortable and not disabled","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"sortable"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}},"dependencies":["disabled","sortable"]}},"ref":"dragHandle"},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"disclosure"},{"kind":"literal","name":"type","value":"button"},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"hidden","expression":"not isContainer","expressionPlan":{"source":"not isContainer","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"isContainer"}},"dependencies":["isContainer"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"disclosure-icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"disclosure"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"leading"}],"children":[{"kind":"slot","fallback":[],"name":"leading"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label-text"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}],"name":"label"}],"ref":"labelText"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"slot","fallback":[],"name":"actions"}],"ref":"actions"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator row-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"row"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"children"},{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"hidden","expression":"not (isContainer and internalExpanded)","expressionPlan":{"source":"not (isContainer and internalExpanded)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"isContainer"},"right":{"kind":"id","name":"internalExpanded"}}},"dependencies":["internalExpanded","isContainer"]}}],"children":[{"kind":"slot"}],"ref":"children"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator subtree-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}]},"declarations":[{"kind":"state","name":"internalExpanded","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"structuralLevel","expression":{"source":"1","ast":{"kind":"literal","value":1},"dependencies":[]}},{"kind":"state","name":"tabStop","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"isContainer","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"expand","type":"object({ id: string, expanded: boolean, trigger: keyboard | pointer | programmatic })","bubbles":false,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
6
+ const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"container":{"type":"boolean","required":false,"target":{"attribute":"container"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"dragType":{"type":"string","required":false,"target":{"attribute":"data-drag-type"},"default":"item"},"dropDepth":{"type":"number","required":false,"target":{"attribute":"data-drop-depth"}},"dropScope":{"type":"string","required":false,"target":{"attribute":"data-drop-scope"},"default":""},"expanded":{"type":"boolean","required":false,"target":{"attribute":"expanded"},"default":false},"itemId":{"type":"string","required":false,"target":{"attribute":"data-item-id"},"default":""},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"aria-selected"},"default":false},"sortable":{"type":"boolean","required":false,"target":{"attribute":"sortable"},"default":false},"subtreeDepth":{"type":"number","required":false,"target":{"attribute":"data-subtree-depth"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"treeitem"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-level","expression":"structuralLevel","expressionPlan":{"source":"structuralLevel","ast":{"kind":"id","name":"structuralLevel"},"dependencies":["structuralLevel"]}},{"kind":"attribute","name":"aria-selected","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-item-id","expression":"itemId","expressionPlan":{"source":"itemId","ast":{"kind":"id","name":"itemId"},"dependencies":["itemId"]}},{"kind":"attribute","name":"data-drag-type","expression":"dragType","expressionPlan":{"source":"dragType","ast":{"kind":"id","name":"dragType"},"dependencies":["dragType"]}},{"kind":"attribute","name":"data-drop-scope","expression":"dropScope","expressionPlan":{"source":"dropScope","ast":{"kind":"id","name":"dropScope"},"dependencies":["dropScope"]}},{"kind":"attribute","name":"data-accepts","expression":"accepts","expressionPlan":{"source":"accepts","ast":{"kind":"id","name":"accepts"},"dependencies":["accepts"]}},{"kind":"attribute","name":"data-drop-depth","expression":"dropDepth","expressionPlan":{"source":"dropDepth","ast":{"kind":"id","name":"dropDepth"},"dependencies":["dropDepth"]}},{"kind":"attribute","name":"data-subtree-depth","expression":"subtreeDepth","expressionPlan":{"source":"subtreeDepth","ast":{"kind":"id","name":"subtreeDepth"},"dependencies":["subtreeDepth"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"row"}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"drag-handle"},{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"draggable","value":"true"},{"kind":"attribute","name":"aria-label","expression":"format('Drag %s to reorder', label)","expressionPlan":{"source":"format('Drag %s to reorder', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Drag %s to reorder"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"literal","name":"focusable","value":"false"},{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]}]}],"flow":{"kind":"if","test":"sortable and not disabled","testPlan":{"source":"sortable and not disabled","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"sortable"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}},"dependencies":["disabled","sortable"]}},"ref":"dragHandle"},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"disclosure"},{"kind":"literal","name":"type","value":"button"},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"hidden","expression":"not isContainer","expressionPlan":{"source":"not isContainer","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"isContainer"}},"dependencies":["isContainer"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"disclosure-icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"disclosure"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"leading"}],"children":[{"kind":"slot","fallback":[],"name":"leading"}],"ref":"leading"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label-text"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}],"name":"label"}],"ref":"labelText"}],"ref":"label"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"slot","fallback":[],"name":"actions"}],"ref":"actions"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator row-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"row"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"children"},{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"hidden","expression":"not (isContainer and internalExpanded)","expressionPlan":{"source":"not (isContainer and internalExpanded)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"isContainer"},"right":{"kind":"id","name":"internalExpanded"}}},"dependencies":["internalExpanded","isContainer"]}}],"children":[{"kind":"slot"}],"ref":"children"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator subtree-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}]},"declarations":[{"kind":"state","name":"internalExpanded","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"structuralLevel","expression":{"source":"1","ast":{"kind":"literal","value":1},"dependencies":[]}},{"kind":"state","name":"tabStop","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"isContainer","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"expand","type":"object({ id: string, expanded: boolean, trigger: keyboard | pointer | programmatic })","bubbles":false,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
7
7
 
8
8
  export function createUiTreeItem(options = {}) {
9
9
  const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
package/vanilla/index.js CHANGED
@@ -31,6 +31,7 @@ export * from "./UiPopover.js";
31
31
  export * from "./UiRadio.js";
32
32
  export * from "./UiRadioGroup.js";
33
33
  export * from "./UiReel.js";
34
+ export * from "./UiScrollArea.js";
34
35
  export * from "./UiSearchResultRow.js";
35
36
  export * from "./UiSearchShell.js";
36
37
  export * from "./UiSelect.js";
package/vue/UiDialog.vue CHANGED
@@ -202,6 +202,27 @@ html[data-ui-input-modality="touch"] [data-component~="ui-dialog"] .close {
202
202
  overflow: auto;
203
203
  overscroll-behavior: contain;
204
204
  padding: var(--ui-space-5);
205
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
206
+ --_ui-scroll-fade-direction: to bottom;
207
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
208
+ mask-image: linear-gradient(
209
+ var(--_ui-scroll-fade-direction),
210
+ transparent,
211
+ #000 var(--_ui-scroll-fade-start),
212
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
213
+ transparent
214
+ );
215
+ animation:
216
+ ui-scroll-fade-start linear,
217
+ ui-scroll-fade-start-hold linear,
218
+ ui-scroll-fade-end-hold linear,
219
+ ui-scroll-fade-end linear;
220
+ animation-timeline: scroll(self block);
221
+ animation-range:
222
+ 0 var(--_ui-scroll-fade-size),
223
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
224
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
225
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
205
226
  }
206
227
 
207
228
  footer {
@@ -144,6 +144,27 @@ useComponentHost(controllerModule.default, {
144
144
  overflow-y: auto;
145
145
  overscroll-behavior: contain;
146
146
  list-style: none;
147
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
148
+ --_ui-scroll-fade-direction: to bottom;
149
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
150
+ mask-image: linear-gradient(
151
+ var(--_ui-scroll-fade-direction),
152
+ transparent,
153
+ #000 var(--_ui-scroll-fade-start),
154
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
155
+ transparent
156
+ );
157
+ animation:
158
+ ui-scroll-fade-start linear,
159
+ ui-scroll-fade-start-hold linear,
160
+ ui-scroll-fade-end-hold linear,
161
+ ui-scroll-fade-end linear;
162
+ animation-timeline: scroll(self block);
163
+ animation-range:
164
+ 0 var(--_ui-scroll-fade-size),
165
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
166
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
167
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
147
168
  }
148
169
 
149
170
  .item {
@@ -152,6 +152,27 @@ useComponentHost(controllerModule.default, {
152
152
  overflow-y: auto;
153
153
  max-height: 280px;
154
154
  overscroll-behavior: contain;
155
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
156
+ --_ui-scroll-fade-direction: to bottom;
157
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
158
+ mask-image: linear-gradient(
159
+ var(--_ui-scroll-fade-direction),
160
+ transparent,
161
+ #000 var(--_ui-scroll-fade-start),
162
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
163
+ transparent
164
+ );
165
+ animation:
166
+ ui-scroll-fade-start linear,
167
+ ui-scroll-fade-start-hold linear,
168
+ ui-scroll-fade-end-hold linear,
169
+ ui-scroll-fade-end linear;
170
+ animation-timeline: scroll(self block);
171
+ animation-range:
172
+ 0 var(--_ui-scroll-fade-size),
173
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
174
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
175
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
155
176
  }
156
177
 
157
178
  @media (max-width: 767px) {
@@ -1,8 +1,6 @@
1
1
  <!-- Generated by HTML Next 1.0.0-alpha.5 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { computed, ref, useTemplateRef } from 'vue'
4
- import * as controllerModule from '../components/ui-editor-toolbar/ui-editor-toolbar.js'
5
- import { createDispatch, useComponentHost } from './host'
3
+ import { computed, useTemplateRef } from 'vue'
6
4
 
7
5
  defineOptions({ inheritAttrs: false })
8
6
 
@@ -15,29 +13,14 @@ const props = withDefaults(
15
13
  },
16
14
  )
17
15
 
18
- const root = ref<HTMLElement | null>(null)
19
16
  const stripElement = useTemplateRef<HTMLElement>('strip')
20
- const overflowStart = ref(false)
21
- const overflowEnd = ref(false)
22
17
 
23
18
  /** The values the styles' :host-state() rules test. */
24
19
  const hostState = computed(() =>
25
20
  [
26
- overflowStart.value && 'overflowStart',
27
- overflowEnd.value && 'overflowEnd',
28
21
  props.floating && 'floating',
29
22
  ].filter(Boolean).join(' ')
30
23
  )
31
-
32
- const dispatch = createDispatch(root)
33
-
34
- useComponentHost(controllerModule.default, {
35
- root,
36
- dispatch,
37
- props,
38
- refs: { strip: stripElement },
39
- state: { overflowStart, overflowEnd },
40
- })
41
24
  </script>
42
25
 
43
26
  <template>
@@ -47,7 +30,6 @@ useComponentHost(controllerModule.default, {
47
30
  aria-label="Editor toolbar"
48
31
  v-bind="$attrs"
49
32
  :data-ui-editor-toolbar-state="hostState || undefined"
50
- ref="root"
51
33
  >
52
34
  <div class="strip" ref="strip"><slot /></div>
53
35
  </div>
@@ -55,9 +37,6 @@ useComponentHost(controllerModule.default, {
55
37
 
56
38
  <style scoped>
57
39
  [data-component~="ui-editor-toolbar"] {
58
- /* The colour the edge fades blend into: whatever the toolbar is painted with. */
59
- --_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
60
-
61
40
  position: sticky;
62
41
  top: 0;
63
42
  z-index: var(--ui-editor-toolbar-z-index, 10);
@@ -93,41 +72,33 @@ useComponentHost(controllerModule.default, {
93
72
  flex: 0 0 auto;
94
73
  }
95
74
 
96
- /* The fades are mattes laid over the strip in the toolbar's own colour, not a mask, so a floating
97
- toolbar's border and shadow stay whole. Each appears only while that edge hides controls. */
98
- [data-component~="ui-editor-toolbar"]::before,
99
- [data-component~="ui-editor-toolbar"]::after {
100
- position: absolute;
101
- z-index: 1;
102
- inset-block: 0;
103
- inline-size: var(--ui-editor-toolbar-fade-size, 32px);
104
- content: "";
105
- opacity: 0;
106
- pointer-events: none;
107
- transition: opacity var(--ui-motion-fast, 120ms) var(--ui-motion-ease, ease);
108
- }
109
-
110
- [data-component~="ui-editor-toolbar"]::before {
111
- inset-inline-start: 0;
112
- background: linear-gradient(to right, var(--_matte), transparent);
113
- }
114
-
115
- [data-component~="ui-editor-toolbar"]::after {
116
- inset-inline-end: 0;
117
- background: linear-gradient(to left, var(--_matte), transparent);
118
- }
119
-
120
- [data-component~="ui-editor-toolbar"]:dir(rtl)::before {
121
- background: linear-gradient(to left, var(--_matte), transparent);
122
- }
123
-
124
- [data-component~="ui-editor-toolbar"]:dir(rtl)::after {
125
- background: linear-gradient(to right, var(--_matte), transparent);
75
+ /* The edge fades are the scroll fade every Looma scroller uses (see ui-scroll-area), a mask on the
76
+ strip, so a floating toolbar's border and shadow stay whole. */
77
+ .strip {
78
+ --_ui-scroll-fade-direction: to right;
79
+ --_ui-scroll-fade-size: var(--ui-editor-toolbar-fade-size, var(--ui-scroll-fade-size, 24px));
80
+ mask-image: linear-gradient(
81
+ var(--_ui-scroll-fade-direction),
82
+ transparent,
83
+ #000 var(--_ui-scroll-fade-start),
84
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
85
+ transparent
86
+ );
87
+ animation:
88
+ ui-scroll-fade-start linear,
89
+ ui-scroll-fade-start-hold linear,
90
+ ui-scroll-fade-end-hold linear,
91
+ ui-scroll-fade-end linear;
92
+ animation-timeline: scroll(self inline);
93
+ animation-range:
94
+ 0 var(--_ui-scroll-fade-size),
95
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
96
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
97
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
126
98
  }
127
99
 
128
- [data-component~="ui-editor-toolbar"][data-ui-editor-toolbar-state~="overflowStart"]::before,
129
- [data-component~="ui-editor-toolbar"][data-ui-editor-toolbar-state~="overflowEnd"]::after {
130
- opacity: 1;
100
+ [data-component~="ui-editor-toolbar"]:dir(rtl) .strip {
101
+ --_ui-scroll-fade-direction: to left;
131
102
  }
132
103
 
133
104
  :slotted(.divider) {
@@ -187,8 +158,6 @@ useComponentHost(controllerModule.default, {
187
158
 
188
159
  /* Inside LoomaEditor's sticky shell, the shell is the sticky surface. */
189
160
  .looma-editor__sticky-toolbar-shell [data-component~="ui-editor-toolbar"] {
190
- --_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
191
-
192
161
  position: relative;
193
162
  min-height: var(--ui-editor-toolbar-min-height, 48px);
194
163
  background: transparent;
package/vue/UiReel.vue CHANGED
@@ -47,6 +47,34 @@ const hostState = computed(() =>
47
47
  overscroll-behavior-inline: contain;
48
48
  }
49
49
 
50
+ /* Each end that hides items fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
51
+ [data-component~="ui-reel"] {
52
+ --_ui-scroll-fade-direction: to right;
53
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
54
+ mask-image: linear-gradient(
55
+ var(--_ui-scroll-fade-direction),
56
+ transparent,
57
+ #000 var(--_ui-scroll-fade-start),
58
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
59
+ transparent
60
+ );
61
+ animation:
62
+ ui-scroll-fade-start linear,
63
+ ui-scroll-fade-start-hold linear,
64
+ ui-scroll-fade-end-hold linear,
65
+ ui-scroll-fade-end linear;
66
+ animation-timeline: scroll(self inline);
67
+ animation-range:
68
+ 0 var(--_ui-scroll-fade-size),
69
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
70
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
71
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
72
+ }
73
+
74
+ [data-component~="ui-reel"]:dir(rtl) {
75
+ --_ui-scroll-fade-direction: to left;
76
+ }
77
+
50
78
  [data-component~="ui-reel"] > :slotted(*) {
51
79
  min-inline-size: 0;
52
80
  flex: 0 0 var(--ui-reel-item-width, var(--_reel-item-width));
@@ -0,0 +1,18 @@
1
+ type __VLS_Props = {
2
+ orientation?: 'vertical' | 'horizontal';
3
+ };
4
+ declare var __VLS_1: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ };
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ orientation: "vertical" | "horizontal";
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,2 @@
1
+ import { t as UiScrollArea_default } from "./chunks/UiScrollArea.js";
2
+ export { UiScrollArea_default as default };
@@ -0,0 +1,85 @@
1
+ <!-- Generated by HTML Next 1.0.0-alpha.5 for Vue 3.5. Do not edit. -->
2
+ <script setup lang="ts">
3
+ import { computed } from 'vue'
4
+
5
+ defineOptions({ inheritAttrs: false })
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ orientation?: 'vertical' | 'horizontal'
10
+ }>(),
11
+ {
12
+ orientation: 'vertical',
13
+ },
14
+ )
15
+
16
+ /** The values the styles' :host-state() rules test. */
17
+ const hostState = computed(() =>
18
+ [
19
+ props.orientation && `orientation orientation=${props.orientation}`,
20
+ ].filter(Boolean).join(' ')
21
+ )
22
+ </script>
23
+
24
+ <template>
25
+ <div
26
+ data-component="ui-scroll-area"
27
+ v-bind="$attrs"
28
+ :data-ui-scroll-area-state="hostState || undefined"
29
+ >
30
+ <slot />
31
+ </div>
32
+ </template>
33
+
34
+ <style scoped>
35
+ /* A region that scrolls when its content outgrows it. Each edge that hides content fades, growing
36
+ in as the content leaves that edge (the scroll fade in tokens.css), so the reader can tell there
37
+ is more; an edge with nothing past it stays crisp, and content that fits shows no fade. The
38
+ fade is a mask, so it blends into whatever is behind the area without knowing its colour. */
39
+ [data-component~="ui-scroll-area"] {
40
+ display: block;
41
+ box-sizing: border-box;
42
+ min-block-size: 0;
43
+ min-inline-size: 0;
44
+ overflow-x: hidden;
45
+ overflow-y: auto;
46
+ overscroll-behavior: contain;
47
+ --_ui-scroll-fade-direction: to bottom;
48
+ --_ui-scroll-fade-inline: to right;
49
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
50
+ mask-image: linear-gradient(
51
+ var(--_ui-scroll-fade-direction),
52
+ transparent,
53
+ #000 var(--_ui-scroll-fade-start),
54
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
55
+ transparent
56
+ );
57
+ animation:
58
+ ui-scroll-fade-start linear,
59
+ ui-scroll-fade-start-hold linear,
60
+ ui-scroll-fade-end-hold linear,
61
+ ui-scroll-fade-end linear;
62
+ animation-timeline: scroll(self block);
63
+ animation-range:
64
+ 0 var(--_ui-scroll-fade-size),
65
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
66
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
67
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
68
+ }
69
+
70
+ [data-component~="ui-scroll-area"][data-ui-scroll-area-state~="orientation=horizontal"] {
71
+ overflow-x: auto;
72
+ overflow-y: hidden;
73
+ --_ui-scroll-fade-direction: var(--_ui-scroll-fade-inline);
74
+ animation-timeline: scroll(self inline);
75
+ }
76
+
77
+ [data-component~="ui-scroll-area"]:dir(rtl) {
78
+ --_ui-scroll-fade-inline: to left;
79
+ }
80
+
81
+ /* A component that sets its display still honours the hidden attribute on its root. */
82
+ [data-component~="ui-scroll-area"][hidden] {
83
+ display: none;
84
+ }
85
+ </style>
@@ -183,6 +183,27 @@ dialog::backdrop {
183
183
  min-block-size: 0;
184
184
  overflow: auto;
185
185
  padding: var(--ui-space-2);
186
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
187
+ --_ui-scroll-fade-direction: to bottom;
188
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
189
+ mask-image: linear-gradient(
190
+ var(--_ui-scroll-fade-direction),
191
+ transparent,
192
+ #000 var(--_ui-scroll-fade-start),
193
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
194
+ transparent
195
+ );
196
+ animation:
197
+ ui-scroll-fade-start linear,
198
+ ui-scroll-fade-start-hold linear,
199
+ ui-scroll-fade-end-hold linear,
200
+ ui-scroll-fade-end linear;
201
+ animation-timeline: scroll(self block);
202
+ animation-range:
203
+ 0 var(--_ui-scroll-fade-size),
204
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
205
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
206
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
186
207
  }
187
208
 
188
209
  @media (max-width: 47.9375rem) {
package/vue/UiSidebar.vue CHANGED
@@ -133,10 +133,32 @@ useComponentHost(controllerModule.default, {
133
133
  border-inline-start: 1px solid var(--ui-sidebar-border, var(--ui-border-default));
134
134
  }
135
135
 
136
+ /* The panel's content scrolls, and each edge that hides content fades: the scroll fade every
137
+ Looma scroller uses (see ui-scroll-area). */
136
138
  .content {
137
139
  flex: 1;
138
140
  min-block-size: 0;
139
141
  overflow: auto;
142
+ --_ui-scroll-fade-direction: to bottom;
143
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
144
+ mask-image: linear-gradient(
145
+ var(--_ui-scroll-fade-direction),
146
+ transparent,
147
+ #000 var(--_ui-scroll-fade-start),
148
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
149
+ transparent
150
+ );
151
+ animation:
152
+ ui-scroll-fade-start linear,
153
+ ui-scroll-fade-start-hold linear,
154
+ ui-scroll-fade-end-hold linear,
155
+ ui-scroll-fade-end linear;
156
+ animation-timeline: scroll(self block);
157
+ animation-range:
158
+ 0 var(--_ui-scroll-fade-size),
159
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
160
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
161
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
140
162
  }
141
163
 
142
164
  /* Collapsed while docked. */