@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,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.describeMenu = describeMenu;
|
|
7
|
+
exports.markMenubarHint = markMenubarHint;
|
|
8
|
+
exports.markMenubarPart = markMenubarPart;
|
|
9
|
+
exports.textOf = textOf;
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _linkActivation = require("../hooks/link-activation.js");
|
|
12
|
+
var _chord = require("../kbd/chord.js");
|
|
13
|
+
var _useEditAction = require("./use-edit-action.js");
|
|
14
|
+
/**
|
|
15
|
+
* A closed menu's DESCRIPTION, read from its declaration's elements without
|
|
16
|
+
* mounting them (OxyOS ADR 0021).
|
|
17
|
+
*
|
|
18
|
+
* A closed menu's rows are known to its bar so that their shortcuts work while
|
|
19
|
+
* it is closed. Mounting them headless did that by rendering every row, which
|
|
20
|
+
* cost every bar render a render of every closed menu's rows (OxyOS's shell has
|
|
21
|
+
* a Window menu of some 27). A menu's content is a declaration: Bloom's own
|
|
22
|
+
* parts (an item, a check item, a radio group and its items, a label, a
|
|
23
|
+
* separator, a group, a submenu), with their props. So a closed menu's entries
|
|
24
|
+
* are read from those elements here, as a Mac's bar keeps a menu's items as
|
|
25
|
+
* data and builds its rows as it opens: the label, the shortcut, the state, and
|
|
26
|
+
* what choosing it runs, the element's own handler.
|
|
27
|
+
*
|
|
28
|
+
* POSITIONS are the ones `DeclaredChildren` gives the mounted rows (arrays and
|
|
29
|
+
* fragments flattened, every child, `null` included, taking a place), so the
|
|
30
|
+
* order a description sorts by is the same open or closed.
|
|
31
|
+
*
|
|
32
|
+
* What is not one of Bloom's parts (an application's own component that
|
|
33
|
+
* renders rows) cannot be read without rendering it: it is returned as
|
|
34
|
+
* `unread`, with its place, for the caller to mount headless as before.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** Which of Bloom's menubar parts a component is (`createMenubarRows` marks each). */
|
|
38
|
+
|
|
39
|
+
const PART = Symbol.for('bloom.menubarPart');
|
|
40
|
+
const HINTS = new WeakSet();
|
|
41
|
+
|
|
42
|
+
/** Marks `component` as one of Bloom's menubar parts, so a description can read its elements. */
|
|
43
|
+
function markMenubarPart(component, part) {
|
|
44
|
+
component[PART] = part;
|
|
45
|
+
return component;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Marks a row's shortcut hint, which a label's text leaves out. */
|
|
49
|
+
function markMenubarHint(component) {
|
|
50
|
+
if ((typeof component === 'function' || typeof component === 'object') && component !== null) {
|
|
51
|
+
HINTS.add(component);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function partOf(type) {
|
|
55
|
+
if (typeof type !== 'function' && typeof type !== 'object' || type === null) return undefined;
|
|
56
|
+
return type[PART];
|
|
57
|
+
}
|
|
58
|
+
const isMarkedHint = type => (typeof type === 'function' || typeof type === 'object') && type !== null && HINTS.has(type);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The text of a part's children, as the platform's bar shows it: every string
|
|
62
|
+
* and number under it, element children included, except a shortcut hint
|
|
63
|
+
* (`isHint`), which is not part of the name.
|
|
64
|
+
*/
|
|
65
|
+
function textOf(children, isHint) {
|
|
66
|
+
const parts = [];
|
|
67
|
+
const visit = node => {
|
|
68
|
+
if (typeof node === 'string' || typeof node === 'number') parts.push(String(node));else if (Array.isArray(node)) node.forEach(visit);else if (/*#__PURE__*/(0, _react.isValidElement)(node) && !isHint(node.type)) {
|
|
69
|
+
visit(node.props.children);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
visit(children);
|
|
73
|
+
return parts.join('').replace(/\s+/g, ' ').trim();
|
|
74
|
+
}
|
|
75
|
+
const labelOf = children => textOf(children, isMarkedHint);
|
|
76
|
+
|
|
77
|
+
/** A radio group's selection, as its items read it. */
|
|
78
|
+
|
|
79
|
+
/** One entry of a closed menu, read from its element. */
|
|
80
|
+
|
|
81
|
+
/** What a description could not read: an element to mount headless at its place. */
|
|
82
|
+
|
|
83
|
+
/** The children of a container as `DeclaredChildren` places them: one per place. */
|
|
84
|
+
function places(children) {
|
|
85
|
+
const out = [];
|
|
86
|
+
const visit = node => {
|
|
87
|
+
if (Array.isArray(node)) {
|
|
88
|
+
node.forEach(visit);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(node) && node.type === _react.Fragment) {
|
|
92
|
+
visit(node.props.children);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
out.push(node);
|
|
96
|
+
};
|
|
97
|
+
visit(children);
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** The chord a `shortcut` declares; null when it is none (the mounted row warns once). */
|
|
102
|
+
function chordOf(shortcut) {
|
|
103
|
+
return shortcut === undefined ? null : (0, _chord.parseChord)(shortcut);
|
|
104
|
+
}
|
|
105
|
+
const keyOf = path => `d${path.join('.')}`;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* `children`'s description: its entries, each at `[...path, place]` under
|
|
109
|
+
* `parentKey`, and what it could not read.
|
|
110
|
+
*/
|
|
111
|
+
function describeMenu(children) {
|
|
112
|
+
const entries = [];
|
|
113
|
+
const unread = [];
|
|
114
|
+
const visit = (nodes, path, parentKey, radio) => {
|
|
115
|
+
places(nodes).forEach((node, place) => {
|
|
116
|
+
const at = [...path, place];
|
|
117
|
+
if (node === null || node === undefined || typeof node === 'boolean') return;
|
|
118
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(node)) {
|
|
119
|
+
// Text placed in a menu draws nowhere in a description.
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const part = partOf(node.type);
|
|
123
|
+
const props = node.props;
|
|
124
|
+
const label = labelOf(props.children) || (props.accessibilityLabel ?? '');
|
|
125
|
+
switch (part) {
|
|
126
|
+
case 'item':
|
|
127
|
+
{
|
|
128
|
+
const {
|
|
129
|
+
action
|
|
130
|
+
} = props;
|
|
131
|
+
const handler = props.onPress ?? (props.href != null ? () => (0, _linkActivation.openHref)(props.href) : undefined);
|
|
132
|
+
const menuAction = (0, _useEditAction.isMenuAction)(action) ? action : undefined;
|
|
133
|
+
const editAction = (0, _useEditAction.isMenuAction)(action) ? undefined : action;
|
|
134
|
+
entries.push({
|
|
135
|
+
key: keyOf(at),
|
|
136
|
+
kind: 'item',
|
|
137
|
+
parentKey,
|
|
138
|
+
path: at,
|
|
139
|
+
label,
|
|
140
|
+
// An item with an action needs its own handler when no field takes the action (an
|
|
141
|
+
// application's own command never is a field's); while a field takes an editing
|
|
142
|
+
// action, its state is the field's (`DescribedEntry.editAction`).
|
|
143
|
+
enabled: !props.disabled && (action === undefined || handler !== undefined),
|
|
144
|
+
shortcut: chordOf(props.shortcut ?? (0, _useEditAction.actionShortcut)(action)),
|
|
145
|
+
keepOpen: props.keepOpen ?? false,
|
|
146
|
+
...(menuAction ? {
|
|
147
|
+
action: menuAction
|
|
148
|
+
} : null),
|
|
149
|
+
...(editAction ? {
|
|
150
|
+
editAction
|
|
151
|
+
} : null),
|
|
152
|
+
run: handler,
|
|
153
|
+
runs: true
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
case 'checkbox':
|
|
158
|
+
{
|
|
159
|
+
const {
|
|
160
|
+
checked = false,
|
|
161
|
+
onCheckedChange
|
|
162
|
+
} = props;
|
|
163
|
+
entries.push({
|
|
164
|
+
key: keyOf(at),
|
|
165
|
+
kind: 'item',
|
|
166
|
+
parentKey,
|
|
167
|
+
path: at,
|
|
168
|
+
label,
|
|
169
|
+
enabled: !props.disabled,
|
|
170
|
+
shortcut: chordOf(props.shortcut),
|
|
171
|
+
checked,
|
|
172
|
+
keepOpen: props.keepOpen ?? false,
|
|
173
|
+
run: onCheckedChange ? () => onCheckedChange(!checked) : undefined,
|
|
174
|
+
runs: true
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
case 'radioGroup':
|
|
179
|
+
{
|
|
180
|
+
const {
|
|
181
|
+
value,
|
|
182
|
+
onValueChange
|
|
183
|
+
} = props;
|
|
184
|
+
visit(props.children, at, parentKey, onValueChange ? {
|
|
185
|
+
value,
|
|
186
|
+
onValueChange
|
|
187
|
+
} : null);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
case 'radio':
|
|
191
|
+
{
|
|
192
|
+
const {
|
|
193
|
+
value
|
|
194
|
+
} = props;
|
|
195
|
+
entries.push({
|
|
196
|
+
key: keyOf(at),
|
|
197
|
+
kind: 'item',
|
|
198
|
+
parentKey,
|
|
199
|
+
path: at,
|
|
200
|
+
label,
|
|
201
|
+
enabled: !props.disabled,
|
|
202
|
+
shortcut: chordOf(props.shortcut),
|
|
203
|
+
checked: radio !== null && radio.value === value,
|
|
204
|
+
keepOpen: props.keepOpen ?? false,
|
|
205
|
+
run: radio && value !== undefined ? () => radio.onValueChange(value) : undefined,
|
|
206
|
+
runs: true
|
|
207
|
+
});
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
case 'label':
|
|
211
|
+
// A group's label is shown, never chosen: an item that is never enabled.
|
|
212
|
+
entries.push({
|
|
213
|
+
key: keyOf(at),
|
|
214
|
+
kind: 'item',
|
|
215
|
+
parentKey,
|
|
216
|
+
path: at,
|
|
217
|
+
label: labelOf(props.children),
|
|
218
|
+
enabled: false,
|
|
219
|
+
shortcut: null,
|
|
220
|
+
runs: false
|
|
221
|
+
});
|
|
222
|
+
return;
|
|
223
|
+
case 'separator':
|
|
224
|
+
entries.push({
|
|
225
|
+
key: keyOf(at),
|
|
226
|
+
kind: 'separator',
|
|
227
|
+
parentKey,
|
|
228
|
+
path: at,
|
|
229
|
+
label: '',
|
|
230
|
+
enabled: true,
|
|
231
|
+
shortcut: null,
|
|
232
|
+
runs: false
|
|
233
|
+
});
|
|
234
|
+
return;
|
|
235
|
+
case 'group':
|
|
236
|
+
visit(props.children, at, parentKey, radio);
|
|
237
|
+
return;
|
|
238
|
+
case 'sub':
|
|
239
|
+
{
|
|
240
|
+
// A submenu: its trigger names it, its content is its entries, at the submenu's place.
|
|
241
|
+
const key = keyOf(at);
|
|
242
|
+
for (const child of places(props.children)) {
|
|
243
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(child)) continue;
|
|
244
|
+
const childPart = partOf(child.type);
|
|
245
|
+
if (childPart === 'subTrigger') {
|
|
246
|
+
entries.push({
|
|
247
|
+
key,
|
|
248
|
+
kind: 'submenu',
|
|
249
|
+
parentKey,
|
|
250
|
+
path: at,
|
|
251
|
+
label: labelOf(child.props.children) || (child.props.accessibilityLabel ?? ''),
|
|
252
|
+
enabled: !child.props.disabled,
|
|
253
|
+
shortcut: null,
|
|
254
|
+
runs: false
|
|
255
|
+
});
|
|
256
|
+
} else if (childPart === 'subContent') {
|
|
257
|
+
visit(child.props.children, at, key, null);
|
|
258
|
+
} else {
|
|
259
|
+
unread.push({
|
|
260
|
+
node: child,
|
|
261
|
+
parentKey: key,
|
|
262
|
+
path: at,
|
|
263
|
+
radio: null,
|
|
264
|
+
owner: {
|
|
265
|
+
parentKey
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
case 'subTrigger':
|
|
273
|
+
case 'subContent':
|
|
274
|
+
// Outside a submenu they declare nothing, mounted or not.
|
|
275
|
+
return;
|
|
276
|
+
default:
|
|
277
|
+
unread.push({
|
|
278
|
+
node,
|
|
279
|
+
parentKey,
|
|
280
|
+
path: at,
|
|
281
|
+
radio,
|
|
282
|
+
owner: null
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
visit(children, [], null, null);
|
|
288
|
+
return {
|
|
289
|
+
entries,
|
|
290
|
+
unread
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_linkActivation","_chord","_useEditAction","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","isValidElement","props","join","replace","trim","labelOf","places","out","Fragment","chordOf","shortcut","parseChord","keyOf","path","describeMenu","entries","unread","nodes","parentKey","radio","place","at","label","accessibilityLabel","action","handler","onPress","href","openHref","menuAction","isMenuAction","editAction","key","kind","enabled","disabled","actionShortcut","keepOpen","run","runs","checked","onCheckedChange","value","onValueChange","child","childPart","owner"],"sourceRoot":"../../../src","sources":["menubar/description.ts"],"mappings":";;;;;;;;;AAsBA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AA5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;;AAaA,MAAMI,IAAI,GAAGC,MAAM,CAACC,GAAG,CAAC,mBAAmB,CAAC;AAC5C,MAAMC,KAAK,GAAG,IAAIC,OAAO,CAAS,CAAC;;AAEnC;AACO,SAASC,eAAeA,CAAmBC,SAAY,EAAEC,IAAiB,EAAK;EACnFD,SAAS,CAAiCN,IAA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YAAE2B,KAAK,EAAE;UAAK,CAAC,CAAC;MAClE;IACF,CAAC,CAAC;EACJ,CAAC;EAEDrD,KAAK,CAACH,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC;EAC/B,OAAO;IAAEyB,OAAO;IAAEC;EAAO,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.MENU_ACTION_SHORTCUTS = exports.EDIT_ACTION_SHORTCUTS = void 0;
|
|
7
7
|
exports.actionShortcut = actionShortcut;
|
|
8
8
|
exports.isMenuAction = isMenuAction;
|
|
9
|
+
exports.responderOf = responderOf;
|
|
9
10
|
exports.useEditAction = useEditAction;
|
|
10
11
|
var _react = require("react");
|
|
11
12
|
var _context = require("../platform-surface/context.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_context","EDIT_ACTION_SHORTCUTS","exports","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","usePlatformEditing","listen","useCallback","listener","subscribe","responder","useSyncExternalStore","run","perform","enabled"],"sourceRoot":"../../../src","sources":["menubar/use-edit-action.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","require","_context","EDIT_ACTION_SHORTCUTS","exports","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","usePlatformEditing","listen","useCallback","listener","subscribe","responder","useSyncExternalStore","run","perform","enabled"],"sourceRoot":"../../../src","sources":["menubar/use-edit-action.ts"],"mappings":";;;;;;;;;;AAwBA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AA1BA;AACA;AACA;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AAiB,EACjBC,OAAiC,EACjB;EAChB,MAAML,OAAO,GAAG,IAAAM,2BAAkB,EAAC,CAAC;EACpC,MAAMC,MAAM,GAAG,IAAAC,kBAAW,EACvBC,QAAoB,IACnBT,OAAO,IAAIJ,MAAM,GAAGI,OAAO,CAACU,SAAS,CAACD,QAAQ,CAAC,GAAGX,gBAAgB,CAAC,CAAC,EACtE,CAACE,OAAO,EAAEJ,MAAM,CAClB,CAAC;EACD,MAAMe,SAAS,GAAG,IAAAC,2BAAoB,EACpCL,MAAM,EACN,MAAMR,WAAW,CAACC,OAAO,EAAEJ,MAAM,CAAC,EAClC,MAAM,MACR,CAAC;EACD,MAAMiB,GAAG,GAAG,IAAAL,kBAAW,EAAC,MAAM;IAC5B,IAAIZ,MAAM,IAAII,OAAO,IAAID,WAAW,CAACC,OAAO,EAAEJ,MAAM,CAAC,KAAK,MAAM,EAAE;MAChEI,OAAO,CAACc,OAAO,CAAClB,MAAM,CAAC;MACvB;IACF;IACAS,OAAO,GAAG,CAAC;EACb,CAAC,EAAE,CAACT,MAAM,EAAEI,OAAO,EAAEK,OAAO,CAAC,CAAC;EAC9B,IAAIM,SAAS,KAAK,MAAM,EAAE,OAAO;IAAEI,OAAO,EAAEJ,SAAS,KAAK,SAAS;IAAEE;EAAI,CAAC;EAC1E,OAAO;IAAEE,OAAO,EAAE,CAACX,QAAQ,KAAKR,MAAM,KAAKN,SAAS,IAAIe,OAAO,KAAKf,SAAS,CAAC;IAAEuB;EAAI,CAAC;AACvF","ignoreList":[]}
|
|
@@ -22,8 +22,14 @@ const AnimatedView = _reactNativeReanimated.default.createAnimatedComponent(_sty
|
|
|
22
22
|
|
|
23
23
|
/** How long after the field loses focus the empty search closes. */
|
|
24
24
|
const BLUR_CLOSE_MS = 150;
|
|
25
|
+
/** Between two slots of the row. */
|
|
26
|
+
const SLOT_GAP = 8;
|
|
25
27
|
|
|
26
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The search's slot and one per action share the row in equal parts, however many actions there
|
|
30
|
+
* are; the closed search covers the first slot and opens across all of them. The sidebar owns its
|
|
31
|
+
* viewport.
|
|
32
|
+
*/
|
|
27
33
|
function SidebarToolbar({
|
|
28
34
|
actions = [],
|
|
29
35
|
search,
|
|
@@ -61,10 +67,14 @@ function SidebarToolbar({
|
|
|
61
67
|
return undefined;
|
|
62
68
|
}, [search.open, reduced, progress, actionsProgress]);
|
|
63
69
|
const slots = actions.length + 1;
|
|
64
|
-
const
|
|
70
|
+
const gaps = SLOT_GAP * (slots - 1);
|
|
71
|
+
// The first slot's width. Web states it in CSS, so it holds before any layout and through
|
|
72
|
+
// resizes; native animates between numbers, so it measures the row (a share of it until then).
|
|
73
|
+
const webCollapsedWidth = slots === 1 ? '100%' : `calc((100% - ${gaps}px) / ${slots})`;
|
|
74
|
+
const collapsedWidth = width > 0 ? (width - gaps) / slots : null;
|
|
65
75
|
const searchWidth = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
66
|
-
width:
|
|
67
|
-
}), [width, collapsedWidth, progress]);
|
|
76
|
+
width: collapsedWidth != null ? collapsedWidth + (width - collapsedWidth) * progress.value : progress.value > 0 ? '100%' : `${100 / slots}%`
|
|
77
|
+
}), [width, collapsedWidth, slots, progress]);
|
|
68
78
|
const actionsStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
69
79
|
const hidden = actionsProgress.value;
|
|
70
80
|
return {
|
|
@@ -102,20 +112,24 @@ function SidebarToolbar({
|
|
|
102
112
|
}, style],
|
|
103
113
|
onLayout: event => setWidth(event.nativeEvent.layout.width),
|
|
104
114
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledPrimitives.StyledView, {
|
|
105
|
-
|
|
115
|
+
testID: testID ? `${testID}-slots` : undefined,
|
|
116
|
+
className: "h-full flex-row gap-2",
|
|
106
117
|
style: {
|
|
118
|
+
height: '100%',
|
|
107
119
|
flexDirection: 'row',
|
|
108
|
-
gap:
|
|
120
|
+
gap: SLOT_GAP
|
|
109
121
|
},
|
|
110
122
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledView, {
|
|
111
123
|
"aria-hidden": true,
|
|
112
124
|
style: {
|
|
113
|
-
flex: 1
|
|
125
|
+
flex: 1,
|
|
126
|
+
minWidth: 0
|
|
114
127
|
}
|
|
115
128
|
}), actions.map((action, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedView, {
|
|
116
129
|
className: `flex ${_platform.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'}` : ''}`,
|
|
117
130
|
style: [{
|
|
118
|
-
flex: 1
|
|
131
|
+
flex: 1,
|
|
132
|
+
minWidth: 0
|
|
119
133
|
}, !_platform.IS_WEB && actionsStyle],
|
|
120
134
|
pointerEvents: search.open ? 'none' : 'auto',
|
|
121
135
|
"aria-hidden": search.open,
|
|
@@ -127,6 +141,7 @@ function SidebarToolbar({
|
|
|
127
141
|
children: action
|
|
128
142
|
}, index))]
|
|
129
143
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedView, {
|
|
144
|
+
testID: testID ? `${testID}-search` : undefined,
|
|
130
145
|
className: `absolute inset-y-0 start-0 z-10 overflow-hidden rounded-full bg-background-tertiary-default ${_platform.IS_WEB ? 'transition-[width] duration-300 ease-in-out motion-reduce:transition-none' : ''}`,
|
|
131
146
|
style: [{
|
|
132
147
|
position: 'absolute',
|
|
@@ -136,7 +151,7 @@ function SidebarToolbar({
|
|
|
136
151
|
borderRadius: 999,
|
|
137
152
|
backgroundColor: palette.tertiary
|
|
138
153
|
}, _platform.IS_WEB ? {
|
|
139
|
-
width: search.open ? '100%' :
|
|
154
|
+
width: search.open ? '100%' : webCollapsedWidth
|
|
140
155
|
} : searchWidth],
|
|
141
156
|
children: !search.open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
142
157
|
ref: trigger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_button","_useIsRtl","_RiSearchLine","_commonMessages","_styledPrimitives","_index","_palette","_platform","_usePrefersReducedMotion","_jsxRuntime","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","AnimatedView","Animated","createAnimatedComponent","StyledView","BLUR_CLOSE_MS","SidebarToolbar","actions","search","style","testID","common","useCommonMessages","palette","useSidebarPalette","direction","useDirectionProps","rtl","useIsRtl","input","useRef","trigger","width","setWidth","useState","reduced","usePrefersReducedMotion","progress","useSharedValue","Number","open","actionsProgress","useEffect","IS_WEB","easing","Easing","bezier","value","withTiming","duration","frame","requestAnimationFrame","current","focus","cancelAnimationFrame","undefined","slots","length","collapsedWidth","searchWidth","useAnimatedStyle","actionsStyle","hidden","opacity","transform","translateX","scale","close","onValueChange","onOpenChange","onBlur","setTimeout","label","accessibilityLabel","jsxs","className","height","onLayout","event","nativeEvent","layout","children","flexDirection","gap","jsx","flex","map","action","index","pointerEvents","accessibilityElementsHidden","importantForAccessibility","inert","position","top","bottom","insetInlineStart","borderRadius","backgroundColor","tertiary","Button","ref","appearance","tone","iconOnly","leadingIcon","RiSearchLine","borderWidth","onPress","TextField","radius","paddingInlineStart","paddingInlineEnd","TextFieldIcon","icon","TextFieldInput","inputRef","placeholder","onChangeText","onKeyPress","key","insetInlineEnd","CloseButton","closeLabel","size"],"sourceRoot":"../../../src","sources":["sidebar/SidebarToolbar.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAMA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA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imated","_button","_useIsRtl","_RiSearchLine","_commonMessages","_styledPrimitives","_index","_palette","_platform","_usePrefersReducedMotion","_jsxRuntime","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","AnimatedView","Animated","createAnimatedComponent","StyledView","BLUR_CLOSE_MS","SLOT_GAP","SidebarToolbar","actions","search","style","testID","common","useCommonMessages","palette","useSidebarPalette","direction","useDirectionProps","rtl","useIsRtl","input","useRef","trigger","width","setWidth","useState","reduced","usePrefersReducedMotion","progress","useSharedValue","Number","open","actionsProgress","useEffect","IS_WEB","easing","Easing","bezier","value","withTiming","duration","frame","requestAnimationFrame","current","focus","cancelAnimationFrame","undefined","slots","length","gaps","webCollapsedWidth","collapsedWidth","searchWidth","useAnimatedStyle","actionsStyle","hidden","opacity","transform","translateX","scale","close","onValueChange","onOpenChange","onBlur","setTimeout","label","accessibilityLabel","jsxs","className","height","onLayout","event","nativeEvent","layout","children","flexDirection","gap","jsx","flex","minWidth","map","action","index","pointerEvents","accessibilityElementsHidden","importantForAccessibility","inert","position","top","bottom","insetInlineStart","borderRadius","backgroundColor","tertiary","Button","ref","appearance","tone","iconOnly","leadingIcon","RiSearchLine","borderWidth","onPress","TextField","radius","paddingInlineStart","paddingInlineEnd","TextFieldIcon","icon","TextFieldInput","inputRef","placeholder","onChangeText","onKeyPress","key","insetInlineEnd","CloseButton","closeLabel","size"],"sourceRoot":"../../../src","sources":["sidebar/SidebarToolbar.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAMA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAA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@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TREE_INDENT = exports.SidebarTreeSection = void 0;
|
|
6
|
+
exports.TREE_INSET = exports.TREE_INDENT = exports.SidebarTreeSection = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
@@ -32,13 +32,21 @@ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e;
|
|
|
32
32
|
const EASE_IN_OUT = _reactNativeReanimated.Easing.bezier(0.4, 0, 0.2, 1);
|
|
33
33
|
/** One level of nesting: a row's content starts this much further in than its parent's. */
|
|
34
34
|
const TREE_INDENT = exports.TREE_INDENT = 16;
|
|
35
|
+
/**
|
|
36
|
+
* Where a top-level row's content starts (its disclosure, glyph, avatar or label), and so where
|
|
37
|
+
* the section's label and status start: one edge from the title down.
|
|
38
|
+
*/
|
|
39
|
+
const TREE_INSET = exports.TREE_INSET = 8;
|
|
40
|
+
/** Where a row's `actions` end: the section's own `actions` end there too. */
|
|
41
|
+
const TREE_ACTIONS_INSET = 4;
|
|
35
42
|
/** Long enough that a press opens the row and a swipe still scrolls the sidebar. */
|
|
36
43
|
const LIFT_AFTER_MS = 350;
|
|
37
44
|
const DRAG_MIME = 'application/x-bloom-sidebar-row';
|
|
38
45
|
/**
|
|
39
46
|
* One labelled section of the sidebar's tree.
|
|
40
47
|
*
|
|
41
|
-
* label `tree.label` text-secondary,
|
|
48
|
+
* label `tree.label` text-secondary, inset 8 like the rows' content (its
|
|
49
|
+
* `actions` at the end, inset 4 like theirs). A
|
|
42
50
|
* `collapsible` section's label is a disclosure (16px chevron,
|
|
43
51
|
* turning 90° open) that shows and hides the rows (300ms).
|
|
44
52
|
* status `loading` / `error` (an alert, in the danger role) / `emptyLabel`,
|
|
@@ -152,8 +160,8 @@ const SidebarTreeSection = exports.SidebarTreeSection = /*#__PURE__*/(0, _react.
|
|
|
152
160
|
});
|
|
153
161
|
});
|
|
154
162
|
const statusStyle = {
|
|
155
|
-
paddingLeft:
|
|
156
|
-
paddingRight:
|
|
163
|
+
paddingLeft: TREE_INSET,
|
|
164
|
+
paddingRight: TREE_INSET
|
|
157
165
|
};
|
|
158
166
|
function SectionLabel({
|
|
159
167
|
section,
|
|
@@ -204,6 +212,9 @@ function SectionLabel({
|
|
|
204
212
|
alignItems: 'center',
|
|
205
213
|
justifyContent: 'space-between',
|
|
206
214
|
gap: 8,
|
|
215
|
+
// The title starts where its rows' content does, and its actions end where theirs do.
|
|
216
|
+
paddingInlineStart: TREE_INSET,
|
|
217
|
+
paddingInlineEnd: section.actions != null ? TREE_ACTIONS_INSET : TREE_INSET,
|
|
207
218
|
borderRadius: _tokens.borderRadius.full,
|
|
208
219
|
...(dropHere ? {
|
|
209
220
|
boxShadow: `inset 0 0 0 2px ${palette.ring}`
|
|
@@ -501,7 +512,7 @@ const TreeRow = /*#__PURE__*/(0, _react.memo)(function TreeRow({
|
|
|
501
512
|
// A row with a description is a contact (picture, name, last line): its picture is as tall as the
|
|
502
513
|
// two lines. Any other `leading` stays in the glyph's box.
|
|
503
514
|
const leadingBox = item.leading != null && item.description != null ? tree.avatar : tree.icon;
|
|
504
|
-
const inset =
|
|
515
|
+
const inset = TREE_INSET + depth * TREE_INDENT;
|
|
505
516
|
const Icon = item.icon;
|
|
506
517
|
const row = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
507
518
|
ref: ref,
|
|
@@ -526,7 +537,7 @@ const TreeRow = /*#__PURE__*/(0, _react.memo)(function TreeRow({
|
|
|
526
537
|
// With a disclosure lane the inset comes before it; without one it is
|
|
527
538
|
// part of the row's press target, as a folder's row is.
|
|
528
539
|
paddingInlineStart: nests ? inset : 0,
|
|
529
|
-
paddingInlineEnd: item.actions != null ?
|
|
540
|
+
paddingInlineEnd: item.actions != null ? TREE_ACTIONS_INSET : 0,
|
|
530
541
|
backgroundColor: lit ? palette.selected : indicator === 'inside' ? palette.tertiaryHover : selected || hovered ? palette.rowHover : 'transparent',
|
|
531
542
|
opacity: dragging && _platform.IS_WEB ? 0.5 : 1
|
|
532
543
|
},
|