@threadlabs/looma 0.10.9 → 0.10.10

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 (45) 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/dist/index.js +19 -20
  10. package/package.json +1 -1
  11. package/styles/ui-dialog.css +17 -0
  12. package/styles/ui-editor-mention-menu.css +17 -0
  13. package/styles/ui-editor-slash-menu.css +17 -0
  14. package/styles/ui-editor-toolbar.css +25 -42
  15. package/styles/ui-reel.css +27 -1
  16. package/styles/ui-scroll-area.css +57 -0
  17. package/styles/ui-search-shell.css +17 -0
  18. package/styles/ui-sidebar.css +22 -1
  19. package/tokens.css +44 -0
  20. package/vanilla/UiEditorToolbar.js +1 -3
  21. package/vanilla/UiScrollArea.d.ts +14 -0
  22. package/vanilla/UiScrollArea.js +28 -0
  23. package/vanilla/index.js +1 -0
  24. package/vue/UiDialog.vue +21 -0
  25. package/vue/UiEditorMentionMenu.vue +21 -0
  26. package/vue/UiEditorSlashMenu.vue +21 -0
  27. package/vue/UiEditorToolbar.vue +26 -57
  28. package/vue/UiReel.vue +28 -0
  29. package/vue/UiScrollArea.d.ts +18 -0
  30. package/vue/UiScrollArea.js +2 -0
  31. package/vue/UiScrollArea.vue +85 -0
  32. package/vue/UiSearchShell.vue +21 -0
  33. package/vue/UiSidebar.vue +22 -0
  34. package/vue/chunks/UiDialog.js +1 -1
  35. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  36. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  37. package/vue/chunks/UiEditorToolbar.js +5 -29
  38. package/vue/chunks/UiReel.js +1 -1
  39. package/vue/chunks/UiScrollArea.js +21 -0
  40. package/vue/chunks/UiSearchShell.js +1 -1
  41. package/vue/chunks/UiSidebar.js +1 -1
  42. package/vue/components.css +335 -161
  43. package/vue/index.d.ts +1 -0
  44. package/vue/index.js +2 -1
  45. package/components/ui-editor-toolbar/ui-editor-toolbar.js +0 -24
@@ -146,6 +146,23 @@
146
146
  overflow: auto;
147
147
  overscroll-behavior: contain;
148
148
  padding: var(--ui-space-5);
149
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
150
+ --_ui-scroll-fade-direction: to bottom;
151
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
152
+ mask-image: linear-gradient(
153
+ var(--_ui-scroll-fade-direction),
154
+ transparent,
155
+ #000 var(--_ui-scroll-fade-start),
156
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
157
+ transparent
158
+ );
159
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
160
+ animation-timeline: scroll(self block);
161
+ animation-range:
162
+ 0 var(--_ui-scroll-fade-size),
163
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
164
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
165
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
149
166
  }
150
167
 
151
168
  footer {
@@ -82,6 +82,23 @@
82
82
  overflow-y: auto;
83
83
  overscroll-behavior: contain;
84
84
  list-style: none;
85
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
86
+ --_ui-scroll-fade-direction: to bottom;
87
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
88
+ mask-image: linear-gradient(
89
+ var(--_ui-scroll-fade-direction),
90
+ transparent,
91
+ #000 var(--_ui-scroll-fade-start),
92
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
93
+ transparent
94
+ );
95
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
96
+ animation-timeline: scroll(self block);
97
+ animation-range:
98
+ 0 var(--_ui-scroll-fade-size),
99
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
100
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
101
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
85
102
  }
86
103
 
87
104
  .item {
@@ -90,6 +90,23 @@
90
90
  overflow-y: auto;
91
91
  max-height: 280px;
92
92
  overscroll-behavior: contain;
93
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
94
+ --_ui-scroll-fade-direction: to bottom;
95
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
96
+ mask-image: linear-gradient(
97
+ var(--_ui-scroll-fade-direction),
98
+ transparent,
99
+ #000 var(--_ui-scroll-fade-start),
100
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
101
+ transparent
102
+ );
103
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
104
+ animation-timeline: scroll(self block);
105
+ animation-range:
106
+ 0 var(--_ui-scroll-fade-size),
107
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
108
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
109
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
93
110
  }
94
111
 
95
112
  @media (max-width: 767px) {
@@ -1,15 +1,10 @@
1
- <template component="ui-editor-toolbar" controller="./ui-editor-toolbar.js">
1
+ <template component="ui-editor-toolbar">
2
2
  <defs>
3
3
  <prop name="floating" type="boolean" default="false">Shows the toolbar as a floating bar beside the selection rather than pinned to the editor.</prop>
4
- <state name="overflowStart" :value="false"></state>
5
- <state name="overflowEnd" :value="false"></state>
6
4
  </defs>
7
5
  <div role="toolbar" aria-label="Editor toolbar"><div class="strip" $ref="strip"><slot></slot></div></div>
8
6
  <style>
9
7
  :host {
10
- /* The colour the edge fades blend into: whatever the toolbar is painted with. */
11
- --_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
12
-
13
8
  position: sticky;
14
9
  top: 0;
15
10
  z-index: var(--ui-editor-toolbar-z-index, 10);
@@ -44,41 +39,29 @@
44
39
  flex: 0 0 auto;
45
40
  }
46
41
 
47
- /* The fades are mattes laid over the strip in the toolbar's own colour, not a mask, so a floating
48
- toolbar's border and shadow stay whole. Each appears only while that edge hides controls. */
49
- :host::before,
50
- :host::after {
51
- position: absolute;
52
- z-index: 1;
53
- inset-block: 0;
54
- inline-size: var(--ui-editor-toolbar-fade-size, 32px);
55
- content: "";
56
- opacity: 0;
57
- pointer-events: none;
58
- transition: opacity var(--ui-motion-fast, 120ms) var(--ui-motion-ease, ease);
59
- }
60
-
61
- :host::before {
62
- inset-inline-start: 0;
63
- background: linear-gradient(to right, var(--_matte), transparent);
64
- }
65
-
66
- :host::after {
67
- inset-inline-end: 0;
68
- background: linear-gradient(to left, var(--_matte), transparent);
69
- }
70
-
71
- :host:dir(rtl)::before {
72
- background: linear-gradient(to left, var(--_matte), transparent);
73
- }
74
-
75
- :host:dir(rtl)::after {
76
- background: linear-gradient(to right, var(--_matte), transparent);
77
- }
78
-
79
- :host-state([overflowStart])::before,
80
- :host-state([overflowEnd])::after {
81
- opacity: 1;
42
+ /* The edge fades are the scroll fade every Looma scroller uses (see ui-scroll-area), a mask on the
43
+ strip, so a floating toolbar's border and shadow stay whole. */
44
+ .strip {
45
+ --_ui-scroll-fade-direction: to right;
46
+ --_ui-scroll-fade-size: var(--ui-editor-toolbar-fade-size, var(--ui-scroll-fade-size, 24px));
47
+ mask-image: linear-gradient(
48
+ var(--_ui-scroll-fade-direction),
49
+ transparent,
50
+ #000 var(--_ui-scroll-fade-start),
51
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
52
+ transparent
53
+ );
54
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
55
+ animation-timeline: scroll(self inline);
56
+ animation-range:
57
+ 0 var(--_ui-scroll-fade-size),
58
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
59
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
60
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
61
+ }
62
+
63
+ :host:dir(rtl) .strip {
64
+ --_ui-scroll-fade-direction: to left;
82
65
  }
83
66
 
84
67
  :slotted(.divider) {
@@ -128,8 +111,6 @@
128
111
 
129
112
  /* Inside LoomaEditor's sticky shell, the shell is the sticky surface. */
130
113
  .looma-editor__sticky-toolbar-shell :host {
131
- --_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
132
-
133
114
  position: relative;
134
115
  min-height: var(--ui-editor-toolbar-min-height, 48px);
135
116
  background: transparent;
@@ -26,6 +26,30 @@
26
26
  overscroll-behavior-inline: contain;
27
27
  }
28
28
 
29
+ /* Each end that hides items fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
30
+ :host {
31
+ --_ui-scroll-fade-direction: to right;
32
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
33
+ mask-image: linear-gradient(
34
+ var(--_ui-scroll-fade-direction),
35
+ transparent,
36
+ #000 var(--_ui-scroll-fade-start),
37
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
38
+ transparent
39
+ );
40
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
41
+ animation-timeline: scroll(self inline);
42
+ animation-range:
43
+ 0 var(--_ui-scroll-fade-size),
44
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
45
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
46
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
47
+ }
48
+
49
+ :host:dir(rtl) {
50
+ --_ui-scroll-fade-direction: to left;
51
+ }
52
+
29
53
  :host > :slotted(*) {
30
54
  min-inline-size: 0;
31
55
  flex: 0 0 var(--ui-reel-item-width, var(--_reel-item-width));
@@ -0,0 +1,56 @@
1
+ <template component="ui-scroll-area">
2
+ <defs>
3
+ <prop name="orientation" type="vertical | horizontal" default="vertical"
4
+ >The direction the content scrolls. Vertical scrolls up and down and clips sideways overflow; horizontal scrolls sideways and clips vertical
5
+ overflow.</prop>
6
+ </defs>
7
+ <div><slot></slot></div>
8
+ <style>
9
+ /* A region that scrolls when its content outgrows it. Each edge that hides content fades, growing
10
+ in as the content leaves that edge (the scroll fade in tokens.css), so the reader can tell there
11
+ is more; an edge with nothing past it stays crisp, and content that fits shows no fade. The
12
+ fade is a mask, so it blends into whatever is behind the area without knowing its colour. */
13
+ :host {
14
+ display: block;
15
+ box-sizing: border-box;
16
+ min-block-size: 0;
17
+ min-inline-size: 0;
18
+ overflow-x: hidden;
19
+ overflow-y: auto;
20
+ overscroll-behavior: contain;
21
+ --_ui-scroll-fade-direction: to bottom;
22
+ --_ui-scroll-fade-inline: to right;
23
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
24
+ mask-image: linear-gradient(
25
+ var(--_ui-scroll-fade-direction),
26
+ transparent,
27
+ #000 var(--_ui-scroll-fade-start),
28
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
29
+ transparent
30
+ );
31
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
32
+ animation-timeline: scroll(self block);
33
+ animation-range:
34
+ 0 var(--_ui-scroll-fade-size),
35
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
36
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
37
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
38
+ }
39
+
40
+ :host-state([orientation="horizontal"]) {
41
+ overflow-x: auto;
42
+ overflow-y: hidden;
43
+ --_ui-scroll-fade-direction: var(--_ui-scroll-fade-inline);
44
+ animation-timeline: scroll(self inline);
45
+ }
46
+
47
+ :host:dir(rtl) {
48
+ --_ui-scroll-fade-inline: to left;
49
+ }
50
+
51
+ /* A component that sets its display still honours the hidden attribute on its root. */
52
+ :host[hidden] {
53
+ display: none;
54
+ }
55
+ </style>
56
+ </template>
@@ -125,6 +125,23 @@
125
125
  min-block-size: 0;
126
126
  overflow: auto;
127
127
  padding: var(--ui-space-2);
128
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
129
+ --_ui-scroll-fade-direction: to bottom;
130
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
131
+ mask-image: linear-gradient(
132
+ var(--_ui-scroll-fade-direction),
133
+ transparent,
134
+ #000 var(--_ui-scroll-fade-start),
135
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
136
+ transparent
137
+ );
138
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
139
+ animation-timeline: scroll(self block);
140
+ animation-range:
141
+ 0 var(--_ui-scroll-fade-size),
142
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
143
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
144
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
128
145
  }
129
146
 
130
147
  @media (max-width: 47.9375rem) {
@@ -49,10 +49,28 @@
49
49
  border-inline-start: 1px solid var(--ui-sidebar-border, var(--ui-border-default));
50
50
  }
51
51
 
52
+ /* The panel's content scrolls, and each edge that hides content fades: the scroll fade every
53
+ Looma scroller uses (see ui-scroll-area). */
52
54
  .content {
53
55
  flex: 1;
54
56
  min-block-size: 0;
55
57
  overflow: auto;
58
+ --_ui-scroll-fade-direction: to bottom;
59
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
60
+ mask-image: linear-gradient(
61
+ var(--_ui-scroll-fade-direction),
62
+ transparent,
63
+ #000 var(--_ui-scroll-fade-start),
64
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
65
+ transparent
66
+ );
67
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
68
+ animation-timeline: scroll(self block);
69
+ animation-range:
70
+ 0 var(--_ui-scroll-fade-size),
71
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
72
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
73
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
56
74
  }
57
75
 
58
76
  /* Collapsed while docked. */