@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.
- package/components/ui-dialog/ui-dialog.html +17 -0
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +17 -0
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +17 -0
- package/components/ui-editor-toolbar/ui-editor-toolbar.html +24 -43
- package/components/ui-reel/ui-reel.html +24 -0
- package/components/ui-scroll-area/ui-scroll-area.html +56 -0
- package/components/ui-search-shell/ui-search-shell.html +17 -0
- package/components/ui-sidebar/ui-sidebar.html +18 -0
- package/components/ui-tree-item/ui-tree-item.html +39 -29
- package/components/ui-tree-item/ui-tree-item.js +17 -11
- package/dist/index.js +19 -20
- package/package.json +1 -1
- package/styles/ui-dialog.css +17 -0
- package/styles/ui-editor-mention-menu.css +17 -0
- package/styles/ui-editor-slash-menu.css +17 -0
- package/styles/ui-editor-toolbar.css +25 -42
- package/styles/ui-reel.css +27 -1
- package/styles/ui-scroll-area.css +57 -0
- package/styles/ui-search-shell.css +17 -0
- package/styles/ui-sidebar.css +22 -1
- package/styles/ui-tree-item.css +44 -32
- package/tokens.css +44 -0
- package/vanilla/UiEditorToolbar.js +1 -3
- package/vanilla/UiScrollArea.d.ts +14 -0
- package/vanilla/UiScrollArea.js +28 -0
- package/vanilla/UiTreeItem.js +1 -1
- package/vanilla/index.js +1 -0
- package/vue/UiDialog.vue +21 -0
- package/vue/UiEditorMentionMenu.vue +21 -0
- package/vue/UiEditorSlashMenu.vue +21 -0
- package/vue/UiEditorToolbar.vue +26 -57
- package/vue/UiReel.vue +28 -0
- package/vue/UiScrollArea.d.ts +18 -0
- package/vue/UiScrollArea.js +2 -0
- package/vue/UiScrollArea.vue +85 -0
- package/vue/UiSearchShell.vue +21 -0
- package/vue/UiSidebar.vue +22 -0
- package/vue/UiTreeItem.vue +49 -29
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiEditorMentionMenu.js +1 -1
- package/vue/chunks/UiEditorSlashMenu.js +1 -1
- package/vue/chunks/UiEditorToolbar.js +5 -29
- package/vue/chunks/UiReel.js +1 -1
- package/vue/chunks/UiScrollArea.js +21 -0
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSidebar.js +1 -1
- package/vue/chunks/UiTreeItem.js +15 -5
- package/vue/components.css +438 -248
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
- package/components/ui-editor-toolbar/ui-editor-toolbar.js +0 -24
package/package.json
CHANGED
package/styles/ui-dialog.css
CHANGED
|
@@ -135,6 +135,23 @@
|
|
|
135
135
|
overflow: auto;
|
|
136
136
|
overscroll-behavior: contain;
|
|
137
137
|
padding: var(--ui-space-5);
|
|
138
|
+
/* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
|
|
139
|
+
--_ui-scroll-fade-direction: to bottom;
|
|
140
|
+
--_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
|
|
141
|
+
mask-image: linear-gradient(
|
|
142
|
+
var(--_ui-scroll-fade-direction),
|
|
143
|
+
transparent,
|
|
144
|
+
#000 var(--_ui-scroll-fade-start),
|
|
145
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
146
|
+
transparent
|
|
147
|
+
);
|
|
148
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
149
|
+
animation-timeline: scroll(self block);
|
|
150
|
+
animation-range:
|
|
151
|
+
0 var(--_ui-scroll-fade-size),
|
|
152
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
153
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
154
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
138
155
|
}
|
|
139
156
|
|
|
140
157
|
footer {
|
|
@@ -41,6 +41,23 @@
|
|
|
41
41
|
overflow-y: auto;
|
|
42
42
|
overscroll-behavior: contain;
|
|
43
43
|
list-style: none;
|
|
44
|
+
/* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
|
|
45
|
+
--_ui-scroll-fade-direction: to bottom;
|
|
46
|
+
--_ui-scroll-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 block);
|
|
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%;
|
|
44
61
|
}
|
|
45
62
|
|
|
46
63
|
.item {
|
|
@@ -58,6 +58,23 @@
|
|
|
58
58
|
overflow-y: auto;
|
|
59
59
|
max-height: 280px;
|
|
60
60
|
overscroll-behavior: contain;
|
|
61
|
+
/* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
|
|
62
|
+
--_ui-scroll-fade-direction: to bottom;
|
|
63
|
+
--_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
|
|
64
|
+
mask-image: linear-gradient(
|
|
65
|
+
var(--_ui-scroll-fade-direction),
|
|
66
|
+
transparent,
|
|
67
|
+
#000 var(--_ui-scroll-fade-start),
|
|
68
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
69
|
+
transparent
|
|
70
|
+
);
|
|
71
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
72
|
+
animation-timeline: scroll(self block);
|
|
73
|
+
animation-range:
|
|
74
|
+
0 var(--_ui-scroll-fade-size),
|
|
75
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
76
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
77
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
61
78
|
}
|
|
62
79
|
|
|
63
80
|
@media (max-width: 767px) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/* Generated by HTML Next 1.0.0-alpha.5. Do not edit. */
|
|
2
2
|
@scope ([data-component~="ui-editor-toolbar"]) to ([data-component], [data-slotted]) {
|
|
3
3
|
:scope {
|
|
4
|
-
/* The colour the edge fades blend into: whatever the toolbar is painted with. */
|
|
5
|
-
--_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
|
|
6
|
-
|
|
7
4
|
position: sticky;
|
|
8
5
|
top: 0;
|
|
9
6
|
z-index: var(--ui-editor-toolbar-z-index, 10);
|
|
@@ -34,41 +31,29 @@
|
|
|
34
31
|
display: none;
|
|
35
32
|
}
|
|
36
33
|
|
|
37
|
-
/* The fades are
|
|
38
|
-
toolbar's border and shadow stay whole.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
:scope:dir(rtl)::before {
|
|
62
|
-
background: linear-gradient(to left, var(--_matte), transparent);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:scope:dir(rtl)::after {
|
|
66
|
-
background: linear-gradient(to right, var(--_matte), transparent);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:scope[data-ui-editor-toolbar-state~="overflowStart"]::before,
|
|
70
|
-
:scope[data-ui-editor-toolbar-state~="overflowEnd"]::after {
|
|
71
|
-
opacity: 1;
|
|
34
|
+
/* The edge fades are the scroll fade every Looma scroller uses (see ui-scroll-area), a mask on the
|
|
35
|
+
strip, so a floating toolbar's border and shadow stay whole. */
|
|
36
|
+
.strip {
|
|
37
|
+
--_ui-scroll-fade-direction: to right;
|
|
38
|
+
--_ui-scroll-fade-size: var(--ui-editor-toolbar-fade-size, var(--ui-scroll-fade-size, 24px));
|
|
39
|
+
mask-image: linear-gradient(
|
|
40
|
+
var(--_ui-scroll-fade-direction),
|
|
41
|
+
transparent,
|
|
42
|
+
#000 var(--_ui-scroll-fade-start),
|
|
43
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
44
|
+
transparent
|
|
45
|
+
);
|
|
46
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
47
|
+
animation-timeline: scroll(self inline);
|
|
48
|
+
animation-range:
|
|
49
|
+
0 var(--_ui-scroll-fade-size),
|
|
50
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
51
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
52
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:scope:dir(rtl) .strip {
|
|
56
|
+
--_ui-scroll-fade-direction: to left;
|
|
72
57
|
}
|
|
73
58
|
|
|
74
59
|
:scope[data-ui-editor-toolbar-state~="floating"] {
|
|
@@ -110,8 +95,6 @@
|
|
|
110
95
|
|
|
111
96
|
/* Inside LoomaEditor's sticky shell, the shell is the sticky surface. */
|
|
112
97
|
.looma-editor__sticky-toolbar-shell :scope {
|
|
113
|
-
--_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
|
|
114
|
-
|
|
115
98
|
position: relative;
|
|
116
99
|
min-height: var(--ui-editor-toolbar-min-height, 48px);
|
|
117
100
|
background: transparent;
|
|
@@ -149,8 +132,8 @@
|
|
|
149
132
|
flex: 0 0 auto;
|
|
150
133
|
}
|
|
151
134
|
|
|
152
|
-
/* The fades are
|
|
153
|
-
toolbar's border and shadow stay whole.
|
|
135
|
+
/* The edge fades are the scroll fade every Looma scroller uses (see ui-scroll-area), a mask on the
|
|
136
|
+
strip, so a floating toolbar's border and shadow stay whole. */
|
|
154
137
|
|
|
155
138
|
:where([data-slotted], [data-slotted] *):is(.divider) {
|
|
156
139
|
width: 1px;
|
package/styles/ui-reel.css
CHANGED
|
@@ -14,6 +14,30 @@
|
|
|
14
14
|
overscroll-behavior-inline: contain;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/* Each end that hides items fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
|
|
18
|
+
:scope {
|
|
19
|
+
--_ui-scroll-fade-direction: to right;
|
|
20
|
+
--_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
|
|
21
|
+
mask-image: linear-gradient(
|
|
22
|
+
var(--_ui-scroll-fade-direction),
|
|
23
|
+
transparent,
|
|
24
|
+
#000 var(--_ui-scroll-fade-start),
|
|
25
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
26
|
+
transparent
|
|
27
|
+
);
|
|
28
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
29
|
+
animation-timeline: scroll(self inline);
|
|
30
|
+
animation-range:
|
|
31
|
+
0 var(--_ui-scroll-fade-size),
|
|
32
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
33
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
34
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:scope:dir(rtl) {
|
|
38
|
+
--_ui-scroll-fade-direction: to left;
|
|
39
|
+
}
|
|
40
|
+
|
|
17
41
|
:scope[data-ui-reel-state~="gap=xs"] {
|
|
18
42
|
--_reel-gap: var(--ui-space-2);
|
|
19
43
|
}
|
|
@@ -48,7 +72,9 @@
|
|
|
48
72
|
}
|
|
49
73
|
}
|
|
50
74
|
@scope ([data-component~="ui-reel"]) to ([data-component]) {
|
|
51
|
-
:
|
|
75
|
+
/* Each end that hides items fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
|
|
76
|
+
|
|
77
|
+
:scope > :where([data-slotted], [data-slotted] *):is(*) {
|
|
52
78
|
min-inline-size: 0;
|
|
53
79
|
flex: 0 0 var(--ui-reel-item-width, var(--_reel-item-width));
|
|
54
80
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* Generated by HTML Next 1.0.0-alpha.5. Do not edit. */
|
|
2
|
+
@scope ([data-component~="ui-scroll-area"]) to ([data-component], [data-slotted]) {
|
|
3
|
+
/* A region that scrolls when its content outgrows it. Each edge that hides content fades, growing
|
|
4
|
+
in as the content leaves that edge (the scroll fade in tokens.css), so the reader can tell there
|
|
5
|
+
is more; an edge with nothing past it stays crisp, and content that fits shows no fade. The
|
|
6
|
+
fade is a mask, so it blends into whatever is behind the area without knowing its colour. */
|
|
7
|
+
:scope {
|
|
8
|
+
display: block;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
min-block-size: 0;
|
|
11
|
+
min-inline-size: 0;
|
|
12
|
+
overflow-x: hidden;
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
overscroll-behavior: contain;
|
|
15
|
+
--_ui-scroll-fade-direction: to bottom;
|
|
16
|
+
--_ui-scroll-fade-inline: to right;
|
|
17
|
+
--_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
|
|
18
|
+
mask-image: linear-gradient(
|
|
19
|
+
var(--_ui-scroll-fade-direction),
|
|
20
|
+
transparent,
|
|
21
|
+
#000 var(--_ui-scroll-fade-start),
|
|
22
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
23
|
+
transparent
|
|
24
|
+
);
|
|
25
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
26
|
+
animation-timeline: scroll(self block);
|
|
27
|
+
animation-range:
|
|
28
|
+
0 var(--_ui-scroll-fade-size),
|
|
29
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
30
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
31
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:scope[data-ui-scroll-area-state~="orientation=horizontal"] {
|
|
35
|
+
overflow-x: auto;
|
|
36
|
+
overflow-y: hidden;
|
|
37
|
+
--_ui-scroll-fade-direction: var(--_ui-scroll-fade-inline);
|
|
38
|
+
animation-timeline: scroll(self inline);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:scope:dir(rtl) {
|
|
42
|
+
--_ui-scroll-fade-inline: to left;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
46
|
+
:scope[hidden] {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
@scope ([data-component~="ui-scroll-area"]) to ([data-component]) {
|
|
51
|
+
/* A region that scrolls when its content outgrows it. Each edge that hides content fades, growing
|
|
52
|
+
in as the content leaves that edge (the scroll fade in tokens.css), so the reader can tell there
|
|
53
|
+
is more; an edge with nothing past it stays crisp, and content that fits shows no fade. The
|
|
54
|
+
fade is a mask, so it blends into whatever is behind the area without knowing its colour. */
|
|
55
|
+
|
|
56
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
57
|
+
}
|
|
@@ -85,6 +85,23 @@
|
|
|
85
85
|
min-block-size: 0;
|
|
86
86
|
overflow: auto;
|
|
87
87
|
padding: var(--ui-space-2);
|
|
88
|
+
/* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
|
|
89
|
+
--_ui-scroll-fade-direction: to bottom;
|
|
90
|
+
--_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
|
|
91
|
+
mask-image: linear-gradient(
|
|
92
|
+
var(--_ui-scroll-fade-direction),
|
|
93
|
+
transparent,
|
|
94
|
+
#000 var(--_ui-scroll-fade-start),
|
|
95
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
96
|
+
transparent
|
|
97
|
+
);
|
|
98
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
99
|
+
animation-timeline: scroll(self block);
|
|
100
|
+
animation-range:
|
|
101
|
+
0 var(--_ui-scroll-fade-size),
|
|
102
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
103
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
104
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
88
105
|
}
|
|
89
106
|
|
|
90
107
|
@media (max-width: 47.9375rem) {
|
package/styles/ui-sidebar.css
CHANGED
|
@@ -18,10 +18,28 @@
|
|
|
18
18
|
border-inline-start: 1px solid var(--ui-sidebar-border, var(--ui-border-default));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* The panel's content scrolls, and each edge that hides content fades: the scroll fade every
|
|
22
|
+
Looma scroller uses (see ui-scroll-area). */
|
|
21
23
|
.content {
|
|
22
24
|
flex: 1;
|
|
23
25
|
min-block-size: 0;
|
|
24
26
|
overflow: auto;
|
|
27
|
+
--_ui-scroll-fade-direction: to bottom;
|
|
28
|
+
--_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
|
|
29
|
+
mask-image: linear-gradient(
|
|
30
|
+
var(--_ui-scroll-fade-direction),
|
|
31
|
+
transparent,
|
|
32
|
+
#000 var(--_ui-scroll-fade-start),
|
|
33
|
+
#000 calc(100% - var(--_ui-scroll-fade-end)),
|
|
34
|
+
transparent
|
|
35
|
+
);
|
|
36
|
+
animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
|
|
37
|
+
animation-timeline: scroll(self block);
|
|
38
|
+
animation-range:
|
|
39
|
+
0 var(--_ui-scroll-fade-size),
|
|
40
|
+
var(--_ui-scroll-fade-size) calc(100% + 1px),
|
|
41
|
+
-1px calc(100% - var(--_ui-scroll-fade-size)),
|
|
42
|
+
calc(100% - var(--_ui-scroll-fade-size)) 100%;
|
|
25
43
|
}
|
|
26
44
|
|
|
27
45
|
/* Collapsed while docked. */
|
|
@@ -150,7 +168,10 @@
|
|
|
150
168
|
}
|
|
151
169
|
}
|
|
152
170
|
@scope ([data-component~="ui-sidebar"]) to ([data-component]) {
|
|
153
|
-
/*
|
|
171
|
+
/* The panel's content scrolls, and each edge that hides content fades: the scroll fade every
|
|
172
|
+
Looma scroller uses (see ui-scroll-area). */
|
|
173
|
+
|
|
174
|
+
/* Collapsed while docked. */
|
|
154
175
|
|
|
155
176
|
/* Drawer: a popover in the top layer, sliding in from its edge. Closed popovers are hidden by the UA. */
|
|
156
177
|
|
package/styles/ui-tree-item.css
CHANGED
|
@@ -136,6 +136,9 @@
|
|
|
136
136
|
block-size: 1em;
|
|
137
137
|
margin-inline-start: var(--ui-space-1);
|
|
138
138
|
color: var(--ui-text-muted);
|
|
139
|
+
/* Above the label, so a sliding name passes under the icon. */
|
|
140
|
+
position: relative;
|
|
141
|
+
z-index: 1;
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
.leading:empty {
|
|
@@ -156,6 +159,9 @@
|
|
|
156
159
|
/* The cell clips: a name longer than the row slides inside it rather than over its icons. */
|
|
157
160
|
overflow: hidden;
|
|
158
161
|
padding: var(--ui-tree-item-label-padding-block, var(--ui-space-1)) var(--ui-tree-item-label-padding-inline, var(--ui-space-2));
|
|
162
|
+
/* The length of the fade before the controls. The label's one flex child lays out no gap; this
|
|
163
|
+
is where the controller reads the length in pixels to stop a sliding name before the fade. */
|
|
164
|
+
column-gap: var(--ui-space-3);
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
/* Slotted label content fills the cell, so a link is the row's hit area rather than sizing to
|
|
@@ -171,6 +177,27 @@
|
|
|
171
177
|
white-space: nowrap;
|
|
172
178
|
}
|
|
173
179
|
|
|
180
|
+
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
181
|
+
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
182
|
+
.row:hover > .label,
|
|
183
|
+
.row:focus-within > .label {
|
|
184
|
+
text-overflow: clip;
|
|
185
|
+
mask-image: linear-gradient(
|
|
186
|
+
to right,
|
|
187
|
+
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
188
|
+
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.row:hover > .label:dir(rtl),
|
|
193
|
+
.row:focus-within > .label:dir(rtl) {
|
|
194
|
+
mask-image: linear-gradient(
|
|
195
|
+
to left,
|
|
196
|
+
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
197
|
+
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
174
201
|
/* A hovered row reads its whole name: the label slides far enough to show the end, waits
|
|
175
202
|
there, and comes back. Only when it actually overflows — the controller measures by how
|
|
176
203
|
much — after the controls have taken their place over its end — and hands over the distance
|
|
@@ -182,13 +209,17 @@
|
|
|
182
209
|
will-change: transform;
|
|
183
210
|
}
|
|
184
211
|
|
|
185
|
-
/*
|
|
186
|
-
|
|
212
|
+
/* This comes after the hover fade, which it replaces at the same specificity. While the name
|
|
213
|
+
slides, the label reaches back under the icon (the controller measures how far) with its text
|
|
214
|
+
where it was, and fades out across that stretch, gone by the icon's middle: the name slips
|
|
215
|
+
under the icon rather than stopping at a hard edge beside it. */
|
|
187
216
|
.row[data-ui-marquee] > .label {
|
|
217
|
+
margin-inline-start: calc(-1 * var(--_marquee-lead, 0px));
|
|
218
|
+
padding-inline-start: calc(var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2)));
|
|
188
219
|
mask-image: linear-gradient(
|
|
189
220
|
to right,
|
|
190
|
-
transparent
|
|
191
|
-
#000 var(--ui-space-2),
|
|
221
|
+
transparent calc(var(--_marquee-lead, 0px) / 2),
|
|
222
|
+
#000 calc(var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))),
|
|
192
223
|
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
193
224
|
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
194
225
|
);
|
|
@@ -197,8 +228,8 @@
|
|
|
197
228
|
.row[data-ui-marquee] > .label:dir(rtl) {
|
|
198
229
|
mask-image: linear-gradient(
|
|
199
230
|
to left,
|
|
200
|
-
transparent
|
|
201
|
-
#000 var(--ui-space-2),
|
|
231
|
+
transparent calc(var(--_marquee-lead, 0px) / 2),
|
|
232
|
+
#000 calc(var(--_marquee-lead, 0px) + var(--ui-tree-item-label-padding-inline, var(--ui-space-2))),
|
|
202
233
|
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
203
234
|
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
204
235
|
);
|
|
@@ -211,27 +242,6 @@
|
|
|
211
242
|
}
|
|
212
243
|
}
|
|
213
244
|
|
|
214
|
-
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
215
|
-
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
216
|
-
.row:hover > .label,
|
|
217
|
-
.row:focus-within > .label {
|
|
218
|
-
text-overflow: clip;
|
|
219
|
-
mask-image: linear-gradient(
|
|
220
|
-
to right,
|
|
221
|
-
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
222
|
-
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.row:hover > .label:dir(rtl),
|
|
227
|
-
.row:focus-within > .label:dir(rtl) {
|
|
228
|
-
mask-image: linear-gradient(
|
|
229
|
-
to left,
|
|
230
|
-
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
231
|
-
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
245
|
.actions {
|
|
236
246
|
position: absolute;
|
|
237
247
|
z-index: 1;
|
|
@@ -408,21 +418,23 @@
|
|
|
408
418
|
min-inline-size: 0;
|
|
409
419
|
}
|
|
410
420
|
|
|
421
|
+
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
422
|
+
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
423
|
+
|
|
411
424
|
/* A hovered row reads its whole name: the label slides far enough to show the end, waits
|
|
412
425
|
there, and comes back. Only when it actually overflows — the controller measures by how
|
|
413
426
|
much — after the controls have taken their place over its end — and hands over the distance
|
|
414
427
|
and a duration from it, so a longer name travels no faster. */
|
|
415
428
|
|
|
416
|
-
/*
|
|
417
|
-
|
|
429
|
+
/* This comes after the hover fade, which it replaces at the same specificity. While the name
|
|
430
|
+
slides, the label reaches back under the icon (the controller measures how far) with its text
|
|
431
|
+
where it was, and fades out across that stretch, gone by the icon's middle: the name slips
|
|
432
|
+
under the icon rather than stopping at a hard edge beside it. */
|
|
418
433
|
|
|
419
434
|
/* Reduced motion keeps the fade, which already says the name continues. */
|
|
420
435
|
@media (prefers-reduced-motion: reduce) {
|
|
421
436
|
}
|
|
422
437
|
|
|
423
|
-
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
424
|
-
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
425
|
-
|
|
426
438
|
.row:hover > .label > :where([data-slotted], [data-slotted] *):is(*),
|
|
427
439
|
.row:focus-within > .label > :where([data-slotted], [data-slotted] *):is(*) {
|
|
428
440
|
text-overflow: clip;
|
package/tokens.css
CHANGED
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
--ui-motion-fast: 120ms;
|
|
62
62
|
--ui-motion-ease: cubic-bezier(0.2, 0, 0.2, 1);
|
|
63
63
|
|
|
64
|
+
/* Scrolling: how far the fade reaches at each edge of a scroller that hides content. */
|
|
65
|
+
--ui-scroll-fade-size: 24px;
|
|
66
|
+
|
|
64
67
|
/* Controls: the contract every button and field shares. */
|
|
65
68
|
--ui-control-size: 2.5rem;
|
|
66
69
|
--ui-control-size-sm: 2rem;
|
|
@@ -219,3 +222,44 @@
|
|
|
219
222
|
}
|
|
220
223
|
}
|
|
221
224
|
}
|
|
225
|
+
|
|
226
|
+
/* The scroll fade every Looma scroller uses (see ui-scroll-area). Scroll-driven animations grow each
|
|
227
|
+
edge's fade in as content leaves that edge, up to the scroller's --_ui-scroll-fade-size, and take it
|
|
228
|
+
away as the last content arrives. A scroller whose content fits has no active scroll timeline, so it
|
|
229
|
+
shows no fade; a browser without scroll-driven animations shows none either.
|
|
230
|
+
|
|
231
|
+
Each edge is a ramp and a hold, neither with a fill, whose ranges never end inside the scroll range
|
|
232
|
+
with a value left over: an animation that finishes holding a value keeps it (in Chromium) after its
|
|
233
|
+
scroller stops overflowing, which would leave a fade over content that fits.
|
|
234
|
+
|
|
235
|
+
Registered here, at the top level, because a component's scoped styles cannot register properties
|
|
236
|
+
or declare keyframes. */
|
|
237
|
+
@property --_ui-scroll-fade-start {
|
|
238
|
+
syntax: "<length>";
|
|
239
|
+
inherits: false;
|
|
240
|
+
initial-value: 0px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@property --_ui-scroll-fade-end {
|
|
244
|
+
syntax: "<length>";
|
|
245
|
+
inherits: false;
|
|
246
|
+
initial-value: 0px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@keyframes ui-scroll-fade-start {
|
|
250
|
+
from { --_ui-scroll-fade-start: 0px; }
|
|
251
|
+
to { --_ui-scroll-fade-start: var(--_ui-scroll-fade-size, 24px); }
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@keyframes ui-scroll-fade-start-hold {
|
|
255
|
+
from, to { --_ui-scroll-fade-start: var(--_ui-scroll-fade-size, 24px); }
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@keyframes ui-scroll-fade-end-hold {
|
|
259
|
+
from, to { --_ui-scroll-fade-end: var(--_ui-scroll-fade-size, 24px); }
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@keyframes ui-scroll-fade-end {
|
|
263
|
+
from { --_ui-scroll-fade-end: var(--_ui-scroll-fade-size, 24px); }
|
|
264
|
+
to { --_ui-scroll-fade-end: 0px; }
|
|
265
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
2
|
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
-
import * as controller from "../components/ui-editor-toolbar/ui-editor-toolbar.js";
|
|
4
3
|
import "../styles/ui-editor-toolbar.css";
|
|
5
4
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-editor-toolbar","props":{"floating":{"type":"boolean","required":false,"target":{"attribute":"floating"},"default":false}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"toolbar"},{"kind":"literal","name":"aria-label","value":"Editor toolbar"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"strip"}],"children":[{"kind":"slot"}],"ref":"strip"}]},"declarations":[
|
|
5
|
+
const definition = {...{"contract":{"tag":"ui-editor-toolbar","props":{"floating":{"type":"boolean","required":false,"target":{"attribute":"floating"},"default":false}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"toolbar"},{"kind":"literal","name":"aria-label","value":"Editor toolbar"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"strip"}],"children":[{"kind":"slot"}],"ref":"strip"}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
6
|
|
|
8
7
|
export function createUiEditorToolbar(options = {}) {
|
|
9
8
|
const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
|
|
@@ -28,7 +27,6 @@ export function createUiEditorToolbar(options = {}) {
|
|
|
28
27
|
}
|
|
29
28
|
element.append(element0);
|
|
30
29
|
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
31
|
-
controller,
|
|
32
30
|
});
|
|
33
31
|
return element;
|
|
34
32
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
export interface UiScrollAreaEventMap {
|
|
3
|
+
}
|
|
4
|
+
export interface UiScrollAreaElement extends HTMLDivElement {
|
|
5
|
+
addEventListener<K extends keyof UiScrollAreaEventMap>(type: K, listener: (this: UiScrollAreaElement, event: UiScrollAreaEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
removeEventListener<K extends keyof UiScrollAreaEventMap>(type: K, listener: (this: UiScrollAreaElement, event: UiScrollAreaEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UiScrollAreaProps {
|
|
9
|
+
orientation?: "vertical" | "horizontal" | null;
|
|
10
|
+
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
11
|
+
children?: readonly (string | Node)[];
|
|
12
|
+
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createUiScrollArea(props?: UiScrollAreaProps): UiScrollAreaElement;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import "../styles/ui-scroll-area.css";
|
|
4
|
+
|
|
5
|
+
export function createUiScrollArea(options = {}) {
|
|
6
|
+
const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
|
|
7
|
+
const projected = [];
|
|
8
|
+
const prop0 = componentProps["orientation"] === undefined ? "vertical" : componentProps["orientation"];
|
|
9
|
+
const element = document.createElement("div");
|
|
10
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
11
|
+
if (value === null || value === undefined || value === false) continue;
|
|
12
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
13
|
+
}
|
|
14
|
+
element.setAttribute("data-component", "ui-scroll-area");
|
|
15
|
+
if (children.length > 0) {
|
|
16
|
+
for (const child of children) {
|
|
17
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
18
|
+
projected.push([node, ""]);
|
|
19
|
+
element.append(node);
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
}
|
|
23
|
+
manageGeneratedProps(element, [
|
|
24
|
+
{ name: "orientation", attribute: "data-orientation", value: componentProps["orientation"], default: "vertical", type: ["vertical","horizontal"], required: false },
|
|
25
|
+
]);
|
|
26
|
+
return element;
|
|
27
|
+
}
|
|
28
|
+
|