@oxy.so/bloom 19.9.0 → 19.10.0
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/docs/adoption-matrix.mdx +5 -5
- package/docs/conversation-sidebar.mdx +1 -1
- package/docs/menubar.mdx +3 -3
- package/docs/sidebar.mdx +2 -2
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/lib/commonjs/conversation-sidebar/create-conversation-sidebar.js +6 -3
- package/lib/commonjs/conversation-sidebar/create-conversation-sidebar.js.map +1 -1
- package/lib/commonjs/conversation-sidebar/index.js +1 -1
- package/lib/commonjs/conversation-sidebar/index.web.js +1 -1
- package/lib/commonjs/menubar/declared.js +171 -66
- package/lib/commonjs/menubar/declared.js.map +1 -1
- package/lib/commonjs/menubar/description.js +293 -0
- package/lib/commonjs/menubar/description.js.map +1 -0
- package/lib/commonjs/menubar/use-edit-action.js +1 -0
- package/lib/commonjs/menubar/use-edit-action.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarToolbar.js +24 -9
- package/lib/commonjs/sidebar/SidebarToolbar.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarTreeSection.js +17 -6
- package/lib/commonjs/sidebar/SidebarTreeSection.js.map +1 -1
- package/lib/module/conversation-sidebar/create-conversation-sidebar.js +6 -3
- package/lib/module/conversation-sidebar/create-conversation-sidebar.js.map +1 -1
- package/lib/module/conversation-sidebar/index.js +1 -1
- package/lib/module/conversation-sidebar/index.web.js +1 -1
- package/lib/module/menubar/declared.js +145 -43
- package/lib/module/menubar/declared.js.map +1 -1
- package/lib/module/menubar/description.js +286 -0
- package/lib/module/menubar/description.js.map +1 -0
- package/lib/module/menubar/use-edit-action.js +1 -1
- package/lib/module/menubar/use-edit-action.js.map +1 -1
- package/lib/module/sidebar/SidebarToolbar.js +24 -9
- package/lib/module/sidebar/SidebarToolbar.js.map +1 -1
- package/lib/module/sidebar/SidebarTreeSection.js +16 -5
- package/lib/module/sidebar/SidebarTreeSection.js.map +1 -1
- package/lib/typescript/commonjs/conversation-sidebar/create-conversation-sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/conversation-sidebar/index.d.ts +1 -1
- package/lib/typescript/commonjs/conversation-sidebar/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/menubar/declared.d.ts +29 -20
- package/lib/typescript/commonjs/menubar/declared.d.ts.map +1 -1
- package/lib/typescript/commonjs/menubar/description.d.ts +90 -0
- package/lib/typescript/commonjs/menubar/description.d.ts.map +1 -0
- package/lib/typescript/commonjs/menubar/types.d.ts +7 -6
- package/lib/typescript/commonjs/menubar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/menubar/use-edit-action.d.ts +4 -1
- package/lib/typescript/commonjs/menubar/use-edit-action.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarToolbar.d.ts +5 -1
- package/lib/typescript/commonjs/sidebar/SidebarToolbar.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarTreeSection.d.ts +7 -1
- package/lib/typescript/commonjs/sidebar/SidebarTreeSection.d.ts.map +1 -1
- package/lib/typescript/module/conversation-sidebar/create-conversation-sidebar.d.ts.map +1 -1
- package/lib/typescript/module/conversation-sidebar/index.d.ts +1 -1
- package/lib/typescript/module/conversation-sidebar/index.web.d.ts +1 -1
- package/lib/typescript/module/menubar/declared.d.ts +29 -20
- package/lib/typescript/module/menubar/declared.d.ts.map +1 -1
- package/lib/typescript/module/menubar/description.d.ts +90 -0
- package/lib/typescript/module/menubar/description.d.ts.map +1 -0
- package/lib/typescript/module/menubar/types.d.ts +7 -6
- package/lib/typescript/module/menubar/types.d.ts.map +1 -1
- package/lib/typescript/module/menubar/use-edit-action.d.ts +4 -1
- package/lib/typescript/module/menubar/use-edit-action.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarToolbar.d.ts +5 -1
- package/lib/typescript/module/sidebar/SidebarToolbar.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarTreeSection.d.ts +7 -1
- package/lib/typescript/module/sidebar/SidebarTreeSection.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/conversation-sidebar/create-conversation-sidebar.tsx +3 -2
- package/src/conversation-sidebar/index.ts +1 -1
- package/src/conversation-sidebar/index.web.ts +1 -1
- package/src/menubar/declared.tsx +166 -39
- package/src/menubar/description.ts +337 -0
- package/src/menubar/types.ts +7 -6
- package/src/menubar/use-edit-action.ts +2 -2
- package/src/sidebar/SidebarToolbar.tsx +22 -10
- package/src/sidebar/SidebarTreeSection.tsx +15 -4
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A closed menu's DESCRIPTION, read from its declaration's elements without
|
|
5
|
+
* mounting them (OxyOS ADR 0021).
|
|
6
|
+
*
|
|
7
|
+
* A closed menu's rows are known to its bar so that their shortcuts work while
|
|
8
|
+
* it is closed. Mounting them headless did that by rendering every row, which
|
|
9
|
+
* cost every bar render a render of every closed menu's rows (OxyOS's shell has
|
|
10
|
+
* a Window menu of some 27). A menu's content is a declaration: Bloom's own
|
|
11
|
+
* parts (an item, a check item, a radio group and its items, a label, a
|
|
12
|
+
* separator, a group, a submenu), with their props. So a closed menu's entries
|
|
13
|
+
* are read from those elements here, as a Mac's bar keeps a menu's items as
|
|
14
|
+
* data and builds its rows as it opens: the label, the shortcut, the state, and
|
|
15
|
+
* what choosing it runs, the element's own handler.
|
|
16
|
+
*
|
|
17
|
+
* POSITIONS are the ones `DeclaredChildren` gives the mounted rows (arrays and
|
|
18
|
+
* fragments flattened, every child, `null` included, taking a place), so the
|
|
19
|
+
* order a description sorts by is the same open or closed.
|
|
20
|
+
*
|
|
21
|
+
* What is not one of Bloom's parts (an application's own component that
|
|
22
|
+
* renders rows) cannot be read without rendering it: it is returned as
|
|
23
|
+
* `unread`, with its place, for the caller to mount headless as before.
|
|
24
|
+
*/
|
|
25
|
+
import { Fragment, isValidElement } from 'react';
|
|
26
|
+
import { openHref } from "../hooks/link-activation.js";
|
|
27
|
+
import { parseChord } from "../kbd/chord.js";
|
|
28
|
+
import { actionShortcut, isMenuAction } from "./use-edit-action.js";
|
|
29
|
+
|
|
30
|
+
/** Which of Bloom's menubar parts a component is (`createMenubarRows` marks each). */
|
|
31
|
+
|
|
32
|
+
const PART = Symbol.for('bloom.menubarPart');
|
|
33
|
+
const HINTS = new WeakSet();
|
|
34
|
+
|
|
35
|
+
/** Marks `component` as one of Bloom's menubar parts, so a description can read its elements. */
|
|
36
|
+
export function markMenubarPart(component, part) {
|
|
37
|
+
component[PART] = part;
|
|
38
|
+
return component;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Marks a row's shortcut hint, which a label's text leaves out. */
|
|
42
|
+
export function markMenubarHint(component) {
|
|
43
|
+
if ((typeof component === 'function' || typeof component === 'object') && component !== null) {
|
|
44
|
+
HINTS.add(component);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function partOf(type) {
|
|
48
|
+
if (typeof type !== 'function' && typeof type !== 'object' || type === null) return undefined;
|
|
49
|
+
return type[PART];
|
|
50
|
+
}
|
|
51
|
+
const isMarkedHint = type => (typeof type === 'function' || typeof type === 'object') && type !== null && HINTS.has(type);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The text of a part's children, as the platform's bar shows it: every string
|
|
55
|
+
* and number under it, element children included, except a shortcut hint
|
|
56
|
+
* (`isHint`), which is not part of the name.
|
|
57
|
+
*/
|
|
58
|
+
export function textOf(children, isHint) {
|
|
59
|
+
const parts = [];
|
|
60
|
+
const visit = node => {
|
|
61
|
+
if (typeof node === 'string' || typeof node === 'number') parts.push(String(node));else if (Array.isArray(node)) node.forEach(visit);else if (/*#__PURE__*/isValidElement(node) && !isHint(node.type)) {
|
|
62
|
+
visit(node.props.children);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
visit(children);
|
|
66
|
+
return parts.join('').replace(/\s+/g, ' ').trim();
|
|
67
|
+
}
|
|
68
|
+
const labelOf = children => textOf(children, isMarkedHint);
|
|
69
|
+
|
|
70
|
+
/** A radio group's selection, as its items read it. */
|
|
71
|
+
|
|
72
|
+
/** One entry of a closed menu, read from its element. */
|
|
73
|
+
|
|
74
|
+
/** What a description could not read: an element to mount headless at its place. */
|
|
75
|
+
|
|
76
|
+
/** The children of a container as `DeclaredChildren` places them: one per place. */
|
|
77
|
+
function places(children) {
|
|
78
|
+
const out = [];
|
|
79
|
+
const visit = node => {
|
|
80
|
+
if (Array.isArray(node)) {
|
|
81
|
+
node.forEach(visit);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (/*#__PURE__*/isValidElement(node) && node.type === Fragment) {
|
|
85
|
+
visit(node.props.children);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
out.push(node);
|
|
89
|
+
};
|
|
90
|
+
visit(children);
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The chord a `shortcut` declares; null when it is none (the mounted row warns once). */
|
|
95
|
+
function chordOf(shortcut) {
|
|
96
|
+
return shortcut === undefined ? null : parseChord(shortcut);
|
|
97
|
+
}
|
|
98
|
+
const keyOf = path => `d${path.join('.')}`;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* `children`'s description: its entries, each at `[...path, place]` under
|
|
102
|
+
* `parentKey`, and what it could not read.
|
|
103
|
+
*/
|
|
104
|
+
export function describeMenu(children) {
|
|
105
|
+
const entries = [];
|
|
106
|
+
const unread = [];
|
|
107
|
+
const visit = (nodes, path, parentKey, radio) => {
|
|
108
|
+
places(nodes).forEach((node, place) => {
|
|
109
|
+
const at = [...path, place];
|
|
110
|
+
if (node === null || node === undefined || typeof node === 'boolean') return;
|
|
111
|
+
if (! /*#__PURE__*/isValidElement(node)) {
|
|
112
|
+
// Text placed in a menu draws nowhere in a description.
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const part = partOf(node.type);
|
|
116
|
+
const props = node.props;
|
|
117
|
+
const label = labelOf(props.children) || (props.accessibilityLabel ?? '');
|
|
118
|
+
switch (part) {
|
|
119
|
+
case 'item':
|
|
120
|
+
{
|
|
121
|
+
const {
|
|
122
|
+
action
|
|
123
|
+
} = props;
|
|
124
|
+
const handler = props.onPress ?? (props.href != null ? () => openHref(props.href) : undefined);
|
|
125
|
+
const menuAction = isMenuAction(action) ? action : undefined;
|
|
126
|
+
const editAction = isMenuAction(action) ? undefined : action;
|
|
127
|
+
entries.push({
|
|
128
|
+
key: keyOf(at),
|
|
129
|
+
kind: 'item',
|
|
130
|
+
parentKey,
|
|
131
|
+
path: at,
|
|
132
|
+
label,
|
|
133
|
+
// An item with an action needs its own handler when no field takes the action (an
|
|
134
|
+
// application's own command never is a field's); while a field takes an editing
|
|
135
|
+
// action, its state is the field's (`DescribedEntry.editAction`).
|
|
136
|
+
enabled: !props.disabled && (action === undefined || handler !== undefined),
|
|
137
|
+
shortcut: chordOf(props.shortcut ?? actionShortcut(action)),
|
|
138
|
+
keepOpen: props.keepOpen ?? false,
|
|
139
|
+
...(menuAction ? {
|
|
140
|
+
action: menuAction
|
|
141
|
+
} : null),
|
|
142
|
+
...(editAction ? {
|
|
143
|
+
editAction
|
|
144
|
+
} : null),
|
|
145
|
+
run: handler,
|
|
146
|
+
runs: true
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
case 'checkbox':
|
|
151
|
+
{
|
|
152
|
+
const {
|
|
153
|
+
checked = false,
|
|
154
|
+
onCheckedChange
|
|
155
|
+
} = props;
|
|
156
|
+
entries.push({
|
|
157
|
+
key: keyOf(at),
|
|
158
|
+
kind: 'item',
|
|
159
|
+
parentKey,
|
|
160
|
+
path: at,
|
|
161
|
+
label,
|
|
162
|
+
enabled: !props.disabled,
|
|
163
|
+
shortcut: chordOf(props.shortcut),
|
|
164
|
+
checked,
|
|
165
|
+
keepOpen: props.keepOpen ?? false,
|
|
166
|
+
run: onCheckedChange ? () => onCheckedChange(!checked) : undefined,
|
|
167
|
+
runs: true
|
|
168
|
+
});
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
case 'radioGroup':
|
|
172
|
+
{
|
|
173
|
+
const {
|
|
174
|
+
value,
|
|
175
|
+
onValueChange
|
|
176
|
+
} = props;
|
|
177
|
+
visit(props.children, at, parentKey, onValueChange ? {
|
|
178
|
+
value,
|
|
179
|
+
onValueChange
|
|
180
|
+
} : null);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
case 'radio':
|
|
184
|
+
{
|
|
185
|
+
const {
|
|
186
|
+
value
|
|
187
|
+
} = props;
|
|
188
|
+
entries.push({
|
|
189
|
+
key: keyOf(at),
|
|
190
|
+
kind: 'item',
|
|
191
|
+
parentKey,
|
|
192
|
+
path: at,
|
|
193
|
+
label,
|
|
194
|
+
enabled: !props.disabled,
|
|
195
|
+
shortcut: chordOf(props.shortcut),
|
|
196
|
+
checked: radio !== null && radio.value === value,
|
|
197
|
+
keepOpen: props.keepOpen ?? false,
|
|
198
|
+
run: radio && value !== undefined ? () => radio.onValueChange(value) : undefined,
|
|
199
|
+
runs: true
|
|
200
|
+
});
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
case 'label':
|
|
204
|
+
// A group's label is shown, never chosen: an item that is never enabled.
|
|
205
|
+
entries.push({
|
|
206
|
+
key: keyOf(at),
|
|
207
|
+
kind: 'item',
|
|
208
|
+
parentKey,
|
|
209
|
+
path: at,
|
|
210
|
+
label: labelOf(props.children),
|
|
211
|
+
enabled: false,
|
|
212
|
+
shortcut: null,
|
|
213
|
+
runs: false
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
case 'separator':
|
|
217
|
+
entries.push({
|
|
218
|
+
key: keyOf(at),
|
|
219
|
+
kind: 'separator',
|
|
220
|
+
parentKey,
|
|
221
|
+
path: at,
|
|
222
|
+
label: '',
|
|
223
|
+
enabled: true,
|
|
224
|
+
shortcut: null,
|
|
225
|
+
runs: false
|
|
226
|
+
});
|
|
227
|
+
return;
|
|
228
|
+
case 'group':
|
|
229
|
+
visit(props.children, at, parentKey, radio);
|
|
230
|
+
return;
|
|
231
|
+
case 'sub':
|
|
232
|
+
{
|
|
233
|
+
// A submenu: its trigger names it, its content is its entries, at the submenu's place.
|
|
234
|
+
const key = keyOf(at);
|
|
235
|
+
for (const child of places(props.children)) {
|
|
236
|
+
if (! /*#__PURE__*/isValidElement(child)) continue;
|
|
237
|
+
const childPart = partOf(child.type);
|
|
238
|
+
if (childPart === 'subTrigger') {
|
|
239
|
+
entries.push({
|
|
240
|
+
key,
|
|
241
|
+
kind: 'submenu',
|
|
242
|
+
parentKey,
|
|
243
|
+
path: at,
|
|
244
|
+
label: labelOf(child.props.children) || (child.props.accessibilityLabel ?? ''),
|
|
245
|
+
enabled: !child.props.disabled,
|
|
246
|
+
shortcut: null,
|
|
247
|
+
runs: false
|
|
248
|
+
});
|
|
249
|
+
} else if (childPart === 'subContent') {
|
|
250
|
+
visit(child.props.children, at, key, null);
|
|
251
|
+
} else {
|
|
252
|
+
unread.push({
|
|
253
|
+
node: child,
|
|
254
|
+
parentKey: key,
|
|
255
|
+
path: at,
|
|
256
|
+
radio: null,
|
|
257
|
+
owner: {
|
|
258
|
+
parentKey
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
case 'subTrigger':
|
|
266
|
+
case 'subContent':
|
|
267
|
+
// Outside a submenu they declare nothing, mounted or not.
|
|
268
|
+
return;
|
|
269
|
+
default:
|
|
270
|
+
unread.push({
|
|
271
|
+
node,
|
|
272
|
+
parentKey,
|
|
273
|
+
path: at,
|
|
274
|
+
radio,
|
|
275
|
+
owner: null
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
visit(children, [], null, null);
|
|
281
|
+
return {
|
|
282
|
+
entries,
|
|
283
|
+
unread
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Fragment","isValidElement","openHref","parseChord","actionShortcut","isMenuAction","PART","Symbol","for","HINTS","WeakSet","markMenubarPart","component","part","markMenubarHint","add","partOf","type","undefined","isMarkedHint","has","textOf","children","isHint","parts","visit","node","push","String","Array","isArray","forEach","props","join","replace","trim","labelOf","places","out","chordOf","shortcut","keyOf","path","describeMenu","entries","unread","nodes","parentKey","radio","place","at","label","accessibilityLabel","action","handler","onPress","href","menuAction","editAction","key","kind","enabled","disabled","keepOpen","run","runs","checked","onCheckedChange","value","onValueChange","child","childPart","owner"],"sourceRoot":"../../../src","sources":["menubar/description.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,cAAc,QAAwB,OAAO;AAEhE,SAASC,QAAQ,QAAQ,6BAA0B;AACnD,SAAqBC,UAAU,QAAQ,iBAAc;AAGrD,SAASC,cAAc,EAAEC,YAAY,QAAQ,sBAAmB;;AAEhE;;AAaA,MAAMC,IAAI,GAAGC,MAAM,CAACC,GAAG,CAAC,mBAAmB,CAAC;AAC5C,MAAMC,KAAK,GAAG,IAAIC,OAAO,CAAS,CAAC;;AAEnC;AACA,OAAO,SAASC,eAAeA,CAAmBC,SAAY,EAAEC,IAAiB,EAAK;EACnFD,SAAS,CAAiCN,IAAI,CAAC,GAAGO,IAAI;EACvD,OAAOD,SAAS;AAClB;;AAEA;AACA,OAAO,SAASE,eAAeA,CAACF,SAAkB,EAAQ;EACxD,IAAI,CAAC,OAAOA,SAAS,KAAK,UAAU,IAAI,OAAOA,SAAS,KAAK,QAAQ,KAAKA,SAAS,KAAK,IAAI,EAAE;IAC5FH,KAAK,CAACM,GAAG,CAACH,SAAS,CAAC;EACtB;AACF;AAEA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YAAY,EAAE;gBAC9B3B,OAAO,CAACjB,IAAI,CAAC;kBACXgC,GAAG;kBACHC,IAAI,EAAE,SAAS;kBACfb,SAAS;kBACTL,IAAI,EAAEQ,EAAE;kBACRC,KAAK,EAAEf,OAAO,CAACkC,KAAK,CAACtC,KAAK,CAACV,QAAQ,CAAC,KAAKgD,KAAK,CAACtC,KAAK,CAACoB,kBAAkB,IAAI,EAAE,CAAC;kBAC9ES,OAAO,EAAE,CAACS,KAAK,CAACtC,KAAK,CAAC8B,QAAQ;kBAC9BtB,QAAQ,EAAE,IAAI;kBACdyB,IAAI,EAAE;gBACR,CAAC,CAAC;cACJ,CAAC,MAAM,IAAIM,SAAS,KAAK,YAAY,EAAE;gBACrC9C,KAAK,CAAC6C,KAAK,CAACtC,KAAK,CAACV,QAAQ,EAAE4B,EAAE,EAAES,GAAG,EAAE,IAAI,CAAC;cAC5C,CAAC,MAAM;gBACLd,MAAM,CAAClB,IAAI,CAAC;kBACVD,IAAI,EAAE4C,KAAK;kBACXvB,SAAS,EAAEY,GAAG;kBACdjB,IAAI,EAAEQ,EAAE;kBACRF,KAAK,EAAE,IAAI;kBACXwB,KAAK,EAAE;oBAAEzB;kBAAU;gBACrB,CAAC,CAAC;cACJ;YACF;YACA;UACF;QACA,KAAK,YAAY;QACjB,KAAK,YAAY;UACf;UACA;QACF;UACEF,MAAM,CAAClB,IAAI,CAAC;YAAED,IAAI;YAAEqB,SAAS;YAAEL,IAAI,EAAEQ,EAAE;YAAEF,KAAK;YAAEwB,KAAK,EAAE;UAAK,CAAC,CAAC;MAClE;IACF,CAAC,CAAC;EACJ,CAAC;EAED/C,KAAK,CAACH,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC;EAC/B,OAAO;IAAEsB,OAAO;IAAEC;EAAO,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -61,7 +61,7 @@ const subscribeNowhere = () => () => undefined;
|
|
|
61
61
|
|
|
62
62
|
/** What a field can do with `action` now: 'none' with no field focused. */
|
|
63
63
|
|
|
64
|
-
function responderOf(editing, action) {
|
|
64
|
+
export function responderOf(editing, action) {
|
|
65
65
|
if (!editing || !action) return 'none';
|
|
66
66
|
const state = editing.getState();
|
|
67
67
|
if (!state) return 'none';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useSyncExternalStore","usePlatformEditing","EDIT_ACTION_SHORTCUTS","undo","redo","cut","copy","paste","pasteAndMatchStyle","delete","undefined","selectAll","MENU_ACTION_SHORTCUTS","about","settings","isMenuAction","action","actionShortcut","subscribeNowhere","responderOf","editing","state","getState","useEditAction","disabled","handler","listen","listener","subscribe","responder","run","perform","enabled"],"sourceRoot":"../../../src","sources":["menubar/use-edit-action.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AAEzD,SAASC,kBAAkB,QAAQ,gCAA6B;AAOhE;AACA,OAAO,MAAMC,qBAA+E,GAAG;EAC7FC,IAAI,EAAE,OAAO;EACbC,IAAI,EAAE,aAAa;EACnBC,GAAG,EAAE,OAAO;EACZC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,OAAO;EACdC,kBAAkB,EAAE,iBAAiB;EACrCC,MAAM,EAAEC,SAAS;EACjBC,SAAS,EAAE;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAA+E,GAAG;EAC7FC,KAAK,EAAEH,SAAS;EAChBI,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA,OAAO,SAASC,YAAYA,CAACC,MAA0B,EAAgC;EACrF,OAAOA,MAAM,KAAK,OAAO,IAAIA,MAAM,KAAK,UAAU;AACpD;;AAEA;AACA,OAAO,SAASC,cAAcA,CAC5BD,MAA2D,EACvC;EACpB,IAAI,CAACA,MAAM,EAAE,OAAON,SAAS;EAC7B,OAAOK,YAAY,CAACC,MAAM,CAAC,GAAGJ,qBAAqB,CAACI,MAAM,CAAC,GAAGd,qBAAqB,CAACc,MAAM,CAAC;AAC7F;AAEA,MAAME,gBAAgB,GAAGA,CAAA,KAAM,MAAMR,SAAS;;AAE9C;;AAGA,SAASS,WAAWA,
|
|
1
|
+
{"version":3,"names":["useCallback","useSyncExternalStore","usePlatformEditing","EDIT_ACTION_SHORTCUTS","undo","redo","cut","copy","paste","pasteAndMatchStyle","delete","undefined","selectAll","MENU_ACTION_SHORTCUTS","about","settings","isMenuAction","action","actionShortcut","subscribeNowhere","responderOf","editing","state","getState","useEditAction","disabled","handler","listen","listener","subscribe","responder","run","perform","enabled"],"sourceRoot":"../../../src","sources":["menubar/use-edit-action.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AAEzD,SAASC,kBAAkB,QAAQ,gCAA6B;AAOhE;AACA,OAAO,MAAMC,qBAA+E,GAAG;EAC7FC,IAAI,EAAE,OAAO;EACbC,IAAI,EAAE,aAAa;EACnBC,GAAG,EAAE,OAAO;EACZC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,OAAO;EACdC,kBAAkB,EAAE,iBAAiB;EACrCC,MAAM,EAAEC,SAAS;EACjBC,SAAS,EAAE;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAA+E,GAAG;EAC7FC,KAAK,EAAEH,SAAS;EAChBI,QAAQ,EAAE;AACZ,CAAC;;AAED;AACA,OAAO,SAASC,YAAYA,CAACC,MAA0B,EAAgC;EACrF,OAAOA,MAAM,KAAK,OAAO,IAAIA,MAAM,KAAK,UAAU;AACpD;;AAEA;AACA,OAAO,SAASC,cAAcA,CAC5BD,MAA2D,EACvC;EACpB,IAAI,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,OAAO,CAAC,CAAC;EAC9B,IAAII,SAAS,KAAK,MAAM,EAAE,OAAO;IAAEG,OAAO,EAAEH,SAAS,KAAK,SAAS;IAAEC;EAAI,CAAC;EAC1E,OAAO;IAAEE,OAAO,EAAE,CAACR,QAAQ,KAAKR,MAAM,KAAKN,SAAS,IAAIe,OAAO,KAAKf,SAAS,CAAC;IAAEoB;EAAI,CAAC;AACvF","ignoreList":[]}
|
|
@@ -16,8 +16,14 @@ const AnimatedView = Animated.createAnimatedComponent(StyledView);
|
|
|
16
16
|
|
|
17
17
|
/** How long after the field loses focus the empty search closes. */
|
|
18
18
|
const BLUR_CLOSE_MS = 150;
|
|
19
|
+
/** Between two slots of the row. */
|
|
20
|
+
const SLOT_GAP = 8;
|
|
19
21
|
|
|
20
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* The search's slot and one per action share the row in equal parts, however many actions there
|
|
24
|
+
* are; the closed search covers the first slot and opens across all of them. The sidebar owns its
|
|
25
|
+
* viewport.
|
|
26
|
+
*/
|
|
21
27
|
export function SidebarToolbar({
|
|
22
28
|
actions = [],
|
|
23
29
|
search,
|
|
@@ -55,10 +61,14 @@ export function SidebarToolbar({
|
|
|
55
61
|
return undefined;
|
|
56
62
|
}, [search.open, reduced, progress, actionsProgress]);
|
|
57
63
|
const slots = actions.length + 1;
|
|
58
|
-
const
|
|
64
|
+
const gaps = SLOT_GAP * (slots - 1);
|
|
65
|
+
// The first slot's width. Web states it in CSS, so it holds before any layout and through
|
|
66
|
+
// resizes; native animates between numbers, so it measures the row (a share of it until then).
|
|
67
|
+
const webCollapsedWidth = slots === 1 ? '100%' : `calc((100% - ${gaps}px) / ${slots})`;
|
|
68
|
+
const collapsedWidth = width > 0 ? (width - gaps) / slots : null;
|
|
59
69
|
const searchWidth = useAnimatedStyle(() => ({
|
|
60
|
-
width:
|
|
61
|
-
}), [width, collapsedWidth, progress]);
|
|
70
|
+
width: collapsedWidth != null ? collapsedWidth + (width - collapsedWidth) * progress.value : progress.value > 0 ? '100%' : `${100 / slots}%`
|
|
71
|
+
}), [width, collapsedWidth, slots, progress]);
|
|
62
72
|
const actionsStyle = useAnimatedStyle(() => {
|
|
63
73
|
const hidden = actionsProgress.value;
|
|
64
74
|
return {
|
|
@@ -96,20 +106,24 @@ export function SidebarToolbar({
|
|
|
96
106
|
}, style],
|
|
97
107
|
onLayout: event => setWidth(event.nativeEvent.layout.width),
|
|
98
108
|
children: [/*#__PURE__*/_jsxs(StyledView, {
|
|
99
|
-
|
|
109
|
+
testID: testID ? `${testID}-slots` : undefined,
|
|
110
|
+
className: "h-full flex-row gap-2",
|
|
100
111
|
style: {
|
|
112
|
+
height: '100%',
|
|
101
113
|
flexDirection: 'row',
|
|
102
|
-
gap:
|
|
114
|
+
gap: SLOT_GAP
|
|
103
115
|
},
|
|
104
116
|
children: [/*#__PURE__*/_jsx(StyledView, {
|
|
105
117
|
"aria-hidden": true,
|
|
106
118
|
style: {
|
|
107
|
-
flex: 1
|
|
119
|
+
flex: 1,
|
|
120
|
+
minWidth: 0
|
|
108
121
|
}
|
|
109
122
|
}), actions.map((action, index) => /*#__PURE__*/_jsx(AnimatedView, {
|
|
110
123
|
className: `flex ${IS_WEB ? `transition-[opacity,transform] duration-200 motion-reduce:transition-none ${search.open ? `pointer-events-none ${rtl ? '-translate-x-2' : 'translate-x-2'} scale-95 opacity-0` : 'translate-x-0 scale-100 opacity-100'}` : ''}`,
|
|
111
124
|
style: [{
|
|
112
|
-
flex: 1
|
|
125
|
+
flex: 1,
|
|
126
|
+
minWidth: 0
|
|
113
127
|
}, !IS_WEB && actionsStyle],
|
|
114
128
|
pointerEvents: search.open ? 'none' : 'auto',
|
|
115
129
|
"aria-hidden": search.open,
|
|
@@ -121,6 +135,7 @@ export function SidebarToolbar({
|
|
|
121
135
|
children: action
|
|
122
136
|
}, index))]
|
|
123
137
|
}), /*#__PURE__*/_jsx(AnimatedView, {
|
|
138
|
+
testID: testID ? `${testID}-search` : undefined,
|
|
124
139
|
className: `absolute inset-y-0 start-0 z-10 overflow-hidden rounded-full bg-background-tertiary-default ${IS_WEB ? 'transition-[width] duration-300 ease-in-out motion-reduce:transition-none' : ''}`,
|
|
125
140
|
style: [{
|
|
126
141
|
position: 'absolute',
|
|
@@ -130,7 +145,7 @@ export function SidebarToolbar({
|
|
|
130
145
|
borderRadius: 999,
|
|
131
146
|
backgroundColor: palette.tertiary
|
|
132
147
|
}, IS_WEB ? {
|
|
133
|
-
width: search.open ? '100%' :
|
|
148
|
+
width: search.open ? '100%' : webCollapsedWidth
|
|
134
149
|
} : searchWidth],
|
|
135
150
|
children: !search.open ? /*#__PURE__*/_jsx(Button, {
|
|
136
151
|
ref: trigger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Animated","Easing","useAnimatedStyle","useSharedValue","withTiming","Button","CloseButton","useDirectionProps","useIsRtl","RiSearchLine","useCommonMessages","StyledView","TextField","TextFieldIcon","TextFieldInput","useSidebarPalette","IS_WEB","usePrefersReducedMotion","jsx","_jsx","jsxs","_jsxs","AnimatedView","createAnimatedComponent","BLUR_CLOSE_MS","SidebarToolbar","actions","search","style","testID","common","palette","direction","rtl","input","trigger","width","setWidth","reduced","progress","Number","open","actionsProgress","easing","bezier","value","duration","frame","requestAnimationFrame","current","focus","cancelAnimationFrame","undefined","slots","length","collapsedWidth","searchWidth","actionsStyle","hidden","opacity","transform","translateX","scale","close","onValueChange","onOpenChange","onBlur","setTimeout","label","accessibilityLabel","className","height","onLayout","event","nativeEvent","layout","children","flexDirection","gap","flex","map","action","index","pointerEvents","accessibilityElementsHidden","importantForAccessibility","inert","position","top","bottom","insetInlineStart","borderRadius","backgroundColor","tertiary","ref","appearance","tone","iconOnly","leadingIcon","borderWidth","onPress","radius","paddingInlineStart","paddingInlineEnd","icon","inputRef","placeholder","onChangeText","onKeyPress","key","insetInlineEnd","closeLabel","size"],"sourceRoot":"../../../src","sources":["sidebar/SidebarToolbar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAuBC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAE7E,OAAOC,QAAQ,IACbC,MAAM,EACNC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,QAAQ,WAAW;AAC/C,SAASC,iBAAiB,EAAEC,QAAQ,QAAQ,wBAAqB;AACjE,SAASC,YAAY,QAAQ,gCAA6B;AAC1D,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,UAAU,QAAQ,gCAA6B;AACxD,SAASC,SAAS,EAAEC,aAAa,EAAEC,cAAc,QAAQ,wBAAe;AACxE,SAASC,iBAAiB,QAAQ,cAAW;AAG7C,SAASC,MAAM,QAAQ,uBAAoB;AAC3C,SAASC,uBAAuB,QAAQ,wCAAqC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9E,MAAMC,YAAY,GAAGtB,QAAQ,CAACuB,uBAAuB,CAACZ,UAAU,CAAC;;AAEjE;AACA,MAAMa,aAAa,GAAG,GAAG;;
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Animated","Easing","useAnimatedStyle","useSharedValue","withTiming","Button","CloseButton","useDirectionProps","useIsRtl","RiSearchLine","useCommonMessages","StyledView","TextField","TextFieldIcon","TextFieldInput","useSidebarPalette","IS_WEB","usePrefersReducedMotion","jsx","_jsx","jsxs","_jsxs","AnimatedView","createAnimatedComponent","BLUR_CLOSE_MS","SLOT_GAP","SidebarToolbar","actions","search","style","testID","common","palette","direction","rtl","input","trigger","width","setWidth","reduced","progress","Number","open","actionsProgress","easing","bezier","value","duration","frame","requestAnimationFrame","current","focus","cancelAnimationFrame","undefined","slots","length","gaps","webCollapsedWidth","collapsedWidth","searchWidth","actionsStyle","hidden","opacity","transform","translateX","scale","close","onValueChange","onOpenChange","onBlur","setTimeout","label","accessibilityLabel","className","height","onLayout","event","nativeEvent","layout","children","flexDirection","gap","flex","minWidth","map","action","index","pointerEvents","accessibilityElementsHidden","importantForAccessibility","inert","position","top","bottom","insetInlineStart","borderRadius","backgroundColor","tertiary","ref","appearance","tone","iconOnly","leadingIcon","borderWidth","onPress","radius","paddingInlineStart","paddingInlineEnd","icon","inputRef","placeholder","onChangeText","onKeyPress","key","insetInlineEnd","closeLabel","size"],"sourceRoot":"../../../src","sources":["sidebar/SidebarToolbar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAuBC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAE7E,OAAOC,QAAQ,IACbC,MAAM,EACNC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,QAAQ,WAAW;AAC/C,SAASC,iBAAiB,EAAEC,QAAQ,QAAQ,wBAAqB;AACjE,SAASC,YAAY,QAAQ,gCAA6B;AAC1D,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,UAAU,QAAQ,gCAA6B;AACxD,SAASC,SAAS,EAAEC,aAAa,EAAEC,cAAc,QAAQ,wBAAe;AACxE,SAASC,iBAAiB,QAAQ,cAAW;AAG7C,SAASC,MAAM,QAAQ,uBAAoB;AAC3C,SAASC,uBAAuB,QAAQ,wCAAqC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9E,MAAMC,YAAY,GAAGtB,QAAQ,CAACuB,uBAAuB,CAACZ,UAAU,CAAC;;AAEjE;AACA,MAAMa,aAAa,GAAG,GAAG;AACzB;AACA,MAAMC,QAAQ,GAAG,CAAC;;AAElB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAC;EAAEC,OAAO,GAAG,EAAE;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAA4B,CAAC,EAAE;EAC3F,MAAMC,MAAM,GAAGrB,iBAAiB,CAAC,CAAC;EAClC,MAAMsB,OAAO,GAAGjB,iBAAiB,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;YACf2C,UAAU,EAAGpC,KAAK,IAAK;cACrB,IAAIA,KAAK,CAACC,WAAW,CAACoC,GAAG,KAAK,QAAQ,EAAE/C,KAAK,CAAC,CAAC;YACjD;UAAE,CACH,CAAC;QAAA,CACO,CAAC,eACZ/C,IAAA,CAACR,UAAU;UACT8D,SAAS,EAAC,sBAAsB;UAChC5C,KAAK,EAAE;YAAE8D,QAAQ,EAAE,UAAU;YAAEuB,cAAc,EAAE,CAAC;YAAEtB,GAAG,EAAE;UAAE,CAAE;UAAAb,QAAA,eAE3D5D,IAAA,CAACb,WAAW;YACVkE,kBAAkB,EAAE5C,MAAM,CAACuF,UAAU,IAAIpF,MAAM,CAACmC,KAAM;YACtDkD,IAAI,EAAC,IAAI;YACTZ,OAAO,EAAEtC;UAAM,CAChB;QAAC,CACQ,CAAC;MAAA,CACH;IACb,CACW,CAAC;EAAA,CACL,CAAC;AAEjB","ignoreList":[]}
|
|
@@ -26,13 +26,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
26
26
|
const EASE_IN_OUT = Easing.bezier(0.4, 0, 0.2, 1);
|
|
27
27
|
/** One level of nesting: a row's content starts this much further in than its parent's. */
|
|
28
28
|
export const TREE_INDENT = 16;
|
|
29
|
+
/**
|
|
30
|
+
* Where a top-level row's content starts (its disclosure, glyph, avatar or label), and so where
|
|
31
|
+
* the section's label and status start: one edge from the title down.
|
|
32
|
+
*/
|
|
33
|
+
export const TREE_INSET = 8;
|
|
34
|
+
/** Where a row's `actions` end: the section's own `actions` end there too. */
|
|
35
|
+
const TREE_ACTIONS_INSET = 4;
|
|
29
36
|
/** Long enough that a press opens the row and a swipe still scrolls the sidebar. */
|
|
30
37
|
const LIFT_AFTER_MS = 350;
|
|
31
38
|
const DRAG_MIME = 'application/x-bloom-sidebar-row';
|
|
32
39
|
/**
|
|
33
40
|
* One labelled section of the sidebar's tree.
|
|
34
41
|
*
|
|
35
|
-
* label `tree.label` text-secondary,
|
|
42
|
+
* label `tree.label` text-secondary, inset 8 like the rows' content (its
|
|
43
|
+
* `actions` at the end, inset 4 like theirs). A
|
|
36
44
|
* `collapsible` section's label is a disclosure (16px chevron,
|
|
37
45
|
* turning 90° open) that shows and hides the rows (300ms).
|
|
38
46
|
* status `loading` / `error` (an alert, in the danger role) / `emptyLabel`,
|
|
@@ -146,8 +154,8 @@ export const SidebarTreeSection = /*#__PURE__*/memo(function SidebarTreeSection(
|
|
|
146
154
|
});
|
|
147
155
|
});
|
|
148
156
|
const statusStyle = {
|
|
149
|
-
paddingLeft:
|
|
150
|
-
paddingRight:
|
|
157
|
+
paddingLeft: TREE_INSET,
|
|
158
|
+
paddingRight: TREE_INSET
|
|
151
159
|
};
|
|
152
160
|
function SectionLabel({
|
|
153
161
|
section,
|
|
@@ -198,6 +206,9 @@ function SectionLabel({
|
|
|
198
206
|
alignItems: 'center',
|
|
199
207
|
justifyContent: 'space-between',
|
|
200
208
|
gap: 8,
|
|
209
|
+
// The title starts where its rows' content does, and its actions end where theirs do.
|
|
210
|
+
paddingInlineStart: TREE_INSET,
|
|
211
|
+
paddingInlineEnd: section.actions != null ? TREE_ACTIONS_INSET : TREE_INSET,
|
|
201
212
|
borderRadius: borderRadius.full,
|
|
202
213
|
...(dropHere ? {
|
|
203
214
|
boxShadow: `inset 0 0 0 2px ${palette.ring}`
|
|
@@ -495,7 +506,7 @@ const TreeRow = /*#__PURE__*/memo(function TreeRow({
|
|
|
495
506
|
// A row with a description is a contact (picture, name, last line): its picture is as tall as the
|
|
496
507
|
// two lines. Any other `leading` stays in the glyph's box.
|
|
497
508
|
const leadingBox = item.leading != null && item.description != null ? tree.avatar : tree.icon;
|
|
498
|
-
const inset =
|
|
509
|
+
const inset = TREE_INSET + depth * TREE_INDENT;
|
|
499
510
|
const Icon = item.icon;
|
|
500
511
|
const row = /*#__PURE__*/_jsxs(View, {
|
|
501
512
|
ref: ref,
|
|
@@ -520,7 +531,7 @@ const TreeRow = /*#__PURE__*/memo(function TreeRow({
|
|
|
520
531
|
// With a disclosure lane the inset comes before it; without one it is
|
|
521
532
|
// part of the row's press target, as a folder's row is.
|
|
522
533
|
paddingInlineStart: nests ? inset : 0,
|
|
523
|
-
paddingInlineEnd: item.actions != null ?
|
|
534
|
+
paddingInlineEnd: item.actions != null ? TREE_ACTIONS_INSET : 0,
|
|
524
535
|
backgroundColor: lit ? palette.selected : indicator === 'inside' ? palette.tertiaryHover : selected || hovered ? palette.rowHover : 'transparent',
|
|
525
536
|
opacity: dragging && IS_WEB ? 0.5 : 1
|
|
526
537
|
},
|