trebol 0.1.2 → 0.2.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/README.md +2 -0
- package/dist/cli.js +10040 -7519
- package/dist/lib/core/boot.js +10 -7
- package/dist/lib/core/eval.js +2 -2
- package/dist/lib/core/machine/checks.d.ts +1 -0
- package/dist/lib/core/machine/checks.js +250 -0
- package/dist/lib/core/machine/events.d.ts +1 -0
- package/dist/lib/core/machine/events.js +365 -0
- package/dist/lib/core/machine/running.d.ts +1 -0
- package/dist/lib/core/machine/running.js +180 -0
- package/dist/lib/core/machine/shared.d.ts +1 -0
- package/dist/lib/core/machine/shared.js +123 -0
- package/dist/lib/core/machine/snapshot.d.ts +1 -0
- package/dist/lib/core/machine/snapshot.js +244 -0
- package/dist/lib/core/machine/spec.d.ts +1 -0
- package/dist/lib/core/machine/spec.js +274 -0
- package/dist/lib/core/machine/words.d.ts +1 -0
- package/dist/lib/core/machine/words.js +98 -0
- package/dist/lib/core/machine.d.ts +1 -0
- package/dist/lib/core/machine.js +17 -0
- package/dist/lib/core/mezz.js +31 -0
- package/dist/lib/core/natives/control.js +1 -1
- package/dist/lib/core/natives/data.js +6 -1
- package/dist/lib/core/natives/series.js +49 -9
- package/dist/lib/core/natives/text.js +0 -1
- package/dist/lib/host/browser/calendar.d.ts +34 -0
- package/dist/lib/host/browser/calendar.js +268 -0
- package/dist/lib/host/browser/count.d.ts +15 -0
- package/dist/lib/host/browser/count.js +48 -0
- package/dist/lib/host/browser/dialogs.d.ts +39 -0
- package/dist/lib/host/browser/dialogs.js +443 -0
- package/dist/lib/host/browser/drag.d.ts +70 -0
- package/dist/lib/host/browser/drag.js +268 -0
- package/dist/lib/host/browser/drawings.d.ts +30 -0
- package/dist/lib/host/browser/drawings.js +176 -0
- package/dist/lib/host/browser/events.d.ts +16 -0
- package/dist/lib/host/browser/events.js +125 -0
- package/dist/lib/host/browser/faces.d.ts +35 -0
- package/dist/lib/host/browser/faces.js +131 -0
- package/dist/lib/host/browser/fields.d.ts +16 -0
- package/dist/lib/host/browser/fields.js +322 -0
- package/dist/lib/host/browser/keys.d.ts +29 -0
- package/dist/lib/host/browser/keys.js +151 -0
- package/dist/lib/host/browser/lookup.d.ts +25 -0
- package/dist/lib/host/browser/lookup.js +275 -0
- package/dist/lib/host/browser/menus.d.ts +20 -0
- package/dist/lib/host/browser/menus.js +149 -0
- package/dist/lib/host/browser/mount.d.ts +92 -0
- package/dist/lib/host/browser/mount.js +448 -0
- package/dist/lib/host/browser/orbits.d.ts +90 -0
- package/dist/lib/host/browser/orbits.js +379 -0
- package/dist/lib/host/browser/page.d.ts +13 -0
- package/dist/lib/host/browser/page.js +35 -0
- package/dist/lib/host/browser/richtext.d.ts +19 -0
- package/dist/lib/host/browser/richtext.js +379 -0
- package/dist/lib/host/browser/row-faces.d.ts +5 -0
- package/dist/lib/host/browser/row-faces.js +74 -0
- package/dist/lib/host/browser/screens.d.ts +37 -0
- package/dist/lib/host/browser/screens.js +140 -0
- package/dist/lib/host/browser/swipe.d.ts +31 -0
- package/dist/lib/host/browser/swipe.js +178 -0
- package/dist/lib/host/browser/sync.d.ts +24 -0
- package/dist/lib/host/browser/sync.js +450 -0
- package/dist/lib/host/browser/tables.d.ts +65 -0
- package/dist/lib/host/browser/tables.js +505 -0
- package/dist/lib/host/browser/times.d.ts +14 -0
- package/dist/lib/host/browser/times.js +114 -0
- package/dist/lib/host/browser/toolbars.d.ts +17 -0
- package/dist/lib/host/browser/toolbars.js +129 -0
- package/dist/lib/host/browser/trees.d.ts +20 -0
- package/dist/lib/host/browser/trees.js +235 -0
- package/dist/lib/host/browser/uploads.d.ts +29 -0
- package/dist/lib/host/browser/uploads.js +370 -0
- package/dist/lib/host/browser/widget.d.ts +13 -0
- package/dist/lib/host/browser/widget.js +105 -0
- package/dist/lib/host/browser.d.ts +25 -0
- package/dist/lib/host/browser.js +84 -4812
- package/dist/lib/host/devtools/console.d.ts +9 -0
- package/dist/lib/host/devtools/console.js +104 -0
- package/dist/lib/host/devtools/faces.d.ts +25 -0
- package/dist/lib/host/devtools/faces.js +169 -0
- package/dist/lib/host/devtools/log.d.ts +3 -0
- package/dist/lib/host/devtools/log.js +32 -0
- package/dist/lib/host/devtools/machines.d.ts +34 -0
- package/dist/lib/host/devtools/machines.js +212 -0
- package/dist/lib/host/devtools/read.d.ts +13 -0
- package/dist/lib/host/devtools/read.js +52 -0
- package/dist/lib/host/devtools/state.d.ts +90 -0
- package/dist/lib/host/devtools/state.js +123 -0
- package/dist/lib/host/devtools.d.ts +15 -19
- package/dist/lib/host/devtools.js +39 -427
- package/dist/lib/host/fonts.js +4 -3
- package/dist/lib/host/icons.js +4 -0
- package/dist/lib/host/index.d.ts +3 -1
- package/dist/lib/host/index.js +107 -4
- package/dist/lib/host/locale.d.ts +18 -0
- package/dist/lib/host/locale.js +75 -5
- package/dist/lib/host/markdown.d.ts +4 -0
- package/dist/lib/host/markdown.js +8 -0
- package/dist/lib/host/modules.js +118 -19
- package/dist/lib/host/motion.d.ts +32 -0
- package/dist/lib/host/motion.js +190 -0
- package/dist/lib/host/net.js +5 -2
- package/dist/lib/host/palette.d.ts +17 -0
- package/dist/lib/host/palette.js +131 -0
- package/dist/lib/host/scheduler.d.ts +2 -0
- package/dist/lib/host/scheduler.js +4 -0
- package/dist/lib/host/share.d.ts +31 -0
- package/dist/lib/host/share.js +134 -0
- package/dist/lib/host/theme/classic.d.ts +1 -0
- package/dist/lib/host/theme/classic.js +120 -0
- package/dist/lib/host/theme/cupertino.d.ts +1 -0
- package/dist/lib/host/theme/cupertino.js +65 -0
- package/dist/lib/host/theme/data.d.ts +1 -0
- package/dist/lib/host/theme/data.js +109 -0
- package/dist/lib/host/theme/devtools.d.ts +1 -0
- package/dist/lib/host/theme/devtools.js +166 -0
- package/dist/lib/host/theme/dialogs.d.ts +1 -0
- package/dist/lib/host/theme/dialogs.js +63 -0
- package/dist/lib/host/theme/fluent.d.ts +1 -0
- package/dist/lib/host/theme/fluent.js +64 -0
- package/dist/lib/host/theme/forms.d.ts +1 -0
- package/dist/lib/host/theme/forms.js +239 -0
- package/dist/lib/host/theme/fusion.d.ts +1 -0
- package/dist/lib/host/theme/fusion.js +66 -0
- package/dist/lib/host/theme/layout.d.ts +1 -0
- package/dist/lib/host/theme/layout.js +166 -0
- package/dist/lib/host/theme/media.d.ts +1 -0
- package/dist/lib/host/theme/media.js +106 -0
- package/dist/lib/host/theme/navigation.d.ts +1 -0
- package/dist/lib/host/theme/navigation.js +36 -0
- package/dist/lib/host/theme/panes.d.ts +1 -0
- package/dist/lib/host/theme/panes.js +99 -0
- package/dist/lib/host/theme/popups.d.ts +1 -0
- package/dist/lib/host/theme/popups.js +149 -0
- package/dist/lib/host/theme/responsive.d.ts +1 -0
- package/dist/lib/host/theme/responsive.js +103 -0
- package/dist/lib/host/theme/toasts.d.ts +1 -0
- package/dist/lib/host/theme/toasts.js +62 -0
- package/dist/lib/host/theme.js +19 -1384
- package/dist/lib/ui/dialect/events.trb +276 -0
- package/dist/lib/ui/dialect/faces.trb +135 -0
- package/dist/lib/ui/dialect/layout.trb +283 -0
- package/dist/lib/ui/dialect/palette.trb +87 -0
- package/dist/lib/ui/dialect/problems.trb +174 -0
- package/dist/lib/ui/dialect/reactions.trb +198 -0
- package/dist/lib/ui/dialect/rows.trb +208 -0
- package/dist/lib/ui/dialect/screens.trb +293 -0
- package/dist/lib/ui/dialect/steps.trb +203 -0
- package/dist/lib/ui/dialect/validation.trb +137 -0
- package/dist/lib/ui/dialect/view.trb +110 -0
- package/dist/lib/ui/dialect/walking.trb +98 -0
- package/dist/lib/ui/dialect/words.trb +70 -0
- package/dist/lib/ui/i18n.trb +17 -0
- package/dist/lib/ui/test.trb +3 -556
- package/dist/lib/ui/testing/actions.trb +421 -0
- package/dist/lib/ui/testing/faces.trb +148 -0
- package/dist/lib/ui/testing/server.trb +73 -0
- package/dist/lib/ui/ui.trb +25 -1675
- package/dist/trebol.js +4463 -1891
- package/package.json +1 -1
- package/src/core/boot.ts +9 -6
- package/src/core/eval.ts +2 -2
- package/src/core/machine/checks.ts +251 -0
- package/src/core/machine/events.ts +366 -0
- package/src/core/machine/running.ts +181 -0
- package/src/core/machine/shared.ts +124 -0
- package/src/core/machine/snapshot.ts +245 -0
- package/src/core/machine/spec.ts +275 -0
- package/src/core/machine/words.ts +99 -0
- package/src/core/machine.ts +20 -0
- package/src/core/mezz.ts +31 -0
- package/src/core/natives/control.ts +1 -1
- package/src/core/natives/data.ts +6 -1
- package/src/core/natives/parse.ts +1 -1
- package/src/core/natives/series.ts +47 -11
- package/src/core/natives/text.ts +0 -1
- package/src/host/browser/calendar.ts +264 -0
- package/src/host/browser/count.ts +48 -0
- package/src/host/browser/dialogs.ts +439 -0
- package/src/host/browser/drag.ts +278 -0
- package/src/host/browser/drawings.ts +178 -0
- package/src/host/browser/events.ts +117 -0
- package/src/host/browser/faces.ts +143 -0
- package/src/host/browser/fields.ts +315 -0
- package/src/host/browser/keys.ts +145 -0
- package/src/host/browser/lookup.ts +262 -0
- package/src/host/browser/menus.ts +146 -0
- package/src/host/browser/mount.ts +420 -0
- package/src/host/browser/orbits.ts +418 -0
- package/src/host/browser/page.ts +43 -0
- package/src/host/browser/richtext.ts +346 -0
- package/src/host/browser/row-faces.ts +75 -0
- package/src/host/browser/screens.ts +142 -0
- package/src/host/browser/swipe.ts +168 -0
- package/src/host/browser/sync.ts +354 -0
- package/src/host/browser/tables.ts +461 -0
- package/src/host/browser/times.ts +115 -0
- package/src/host/browser/toolbars.ts +126 -0
- package/src/host/browser/trees.ts +205 -0
- package/src/host/browser/uploads.ts +367 -0
- package/src/host/browser/widget.ts +103 -0
- package/src/host/browser.ts +82 -4612
- package/src/host/devtools/console.ts +102 -0
- package/src/host/devtools/faces.ts +160 -0
- package/src/host/devtools/log.ts +34 -0
- package/src/host/devtools/machines.ts +208 -0
- package/src/host/devtools/read.ts +58 -0
- package/src/host/devtools/state.ts +148 -0
- package/src/host/devtools.ts +39 -442
- package/src/host/fonts.ts +4 -3
- package/src/host/icons.ts +4 -0
- package/src/host/index.ts +107 -4
- package/src/host/locale.ts +71 -5
- package/src/host/markdown.ts +9 -0
- package/src/host/modules.ts +117 -21
- package/src/host/motion.ts +204 -0
- package/src/host/net.ts +4 -2
- package/src/host/palette.ts +139 -0
- package/src/host/scheduler.ts +5 -0
- package/src/host/share.ts +168 -0
- package/src/host/theme/classic.ts +121 -0
- package/src/host/theme/cupertino.ts +66 -0
- package/src/host/theme/data.ts +110 -0
- package/src/host/theme/devtools.ts +167 -0
- package/src/host/theme/dialogs.ts +64 -0
- package/src/host/theme/fluent.ts +65 -0
- package/src/host/theme/forms.ts +240 -0
- package/src/host/theme/fusion.ts +67 -0
- package/src/host/theme/layout.ts +167 -0
- package/src/host/theme/media.ts +107 -0
- package/src/host/theme/navigation.ts +37 -0
- package/src/host/theme/panes.ts +100 -0
- package/src/host/theme/popups.ts +150 -0
- package/src/host/theme/responsive.ts +104 -0
- package/src/host/theme/toasts.ts +63 -0
- package/src/host/theme.ts +19 -1384
- package/src/ui/dialect/events.trb +276 -0
- package/src/ui/dialect/faces.trb +135 -0
- package/src/ui/dialect/layout.trb +283 -0
- package/src/ui/dialect/palette.trb +87 -0
- package/src/ui/dialect/problems.trb +174 -0
- package/src/ui/dialect/reactions.trb +198 -0
- package/src/ui/dialect/rows.trb +208 -0
- package/src/ui/dialect/screens.trb +293 -0
- package/src/ui/dialect/steps.trb +203 -0
- package/src/ui/dialect/validation.trb +137 -0
- package/src/ui/dialect/view.trb +110 -0
- package/src/ui/dialect/walking.trb +98 -0
- package/src/ui/dialect/words.trb +70 -0
- package/src/ui/i18n.trb +17 -0
- package/src/ui/test.trb +3 -556
- package/src/ui/testing/actions.trb +421 -0
- package/src/ui/testing/faces.trb +148 -0
- package/src/ui/testing/server.trb +73 -0
- package/src/ui/ui.trb +25 -1675
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// --- times ---------------------------------------------------------------------------
|
|
2
|
+
//
|
|
3
|
+
// The list of a time field: the times from its min to its max, step minutes apart (30 unless told), as a
|
|
4
|
+
// listbox. It opens on the time it holds, or the next one from now. Arrows, Home, End and the Page keys move,
|
|
5
|
+
// Enter or Space picks, Esc closes.
|
|
6
|
+
import { K, string } from "../../core/index.js";
|
|
7
|
+
import { activeLanguage, amountOf } from "../index.js";
|
|
8
|
+
import { get, own } from "./faces.js";
|
|
9
|
+
import { host, fire, el } from "./mount.js";
|
|
10
|
+
import { seenKeys } from "./events.js";
|
|
11
|
+
import { ruleArg, closeCalendar } from "./calendar.js";
|
|
12
|
+
export let times = null;
|
|
13
|
+
/** The minutes of a time! cell since midnight, or null. */
|
|
14
|
+
export function minutesOf(v) {
|
|
15
|
+
return v.t === K.Time ? Math.floor(Number(v.v) / 6e10) : null;
|
|
16
|
+
}
|
|
17
|
+
export function openTimes(face, opener) {
|
|
18
|
+
closeTimes(false);
|
|
19
|
+
closeCalendar(false);
|
|
20
|
+
const step = Math.max(1, Math.round(amountOf(get(face, 'step')) ?? 30));
|
|
21
|
+
const low = minutesOf(ruleArg(face, 'min')) ?? 0;
|
|
22
|
+
const high = minutesOf(ruleArg(face, 'max')) ?? 24 * 60 - 1;
|
|
23
|
+
const chosen = minutesOf(get(face, 'value'));
|
|
24
|
+
const now = new Date();
|
|
25
|
+
const aim = chosen ?? now.getHours() * 60 + now.getMinutes();
|
|
26
|
+
const fmt = new Intl.DateTimeFormat(activeLanguage(host.rt), { hour: 'numeric', minute: '2-digit', timeZone: 'UTC' });
|
|
27
|
+
const list = el('ul', 'tb-lookup-list tb-times');
|
|
28
|
+
list.setAttribute('role', 'listbox');
|
|
29
|
+
list.setAttribute('aria-label', opener.getAttribute('aria-label') ?? own('choose-time'));
|
|
30
|
+
list.setAttribute('popover', 'manual');
|
|
31
|
+
let first = null;
|
|
32
|
+
for (let t = low; t <= high; t += step) {
|
|
33
|
+
const li = el('li', 'tb-lookup-option');
|
|
34
|
+
li.setAttribute('role', 'option');
|
|
35
|
+
li.setAttribute('aria-selected', t === chosen ? 'true' : 'false');
|
|
36
|
+
li.tabIndex = -1;
|
|
37
|
+
const at = `${String(Math.floor(t / 60)).padStart(2, '0')}:${String(t % 60).padStart(2, '0')}`;
|
|
38
|
+
li.textContent = fmt.format(t * 60000);
|
|
39
|
+
li.addEventListener('click', () => pickTime(at));
|
|
40
|
+
list.append(li);
|
|
41
|
+
if (first === null && t >= aim)
|
|
42
|
+
first = li;
|
|
43
|
+
}
|
|
44
|
+
first ??= list.lastElementChild;
|
|
45
|
+
if (first !== null)
|
|
46
|
+
first.tabIndex = 0;
|
|
47
|
+
times = { face, opener, list };
|
|
48
|
+
opener.setAttribute('aria-expanded', 'true');
|
|
49
|
+
list.addEventListener('keydown', timesKey);
|
|
50
|
+
list.addEventListener('focusout', ev => {
|
|
51
|
+
if (times?.list === list && !list.contains(ev.relatedTarget) && ev.relatedTarget !== null)
|
|
52
|
+
closeTimes(false);
|
|
53
|
+
});
|
|
54
|
+
document.addEventListener('pointerdown', outsideTimes, true);
|
|
55
|
+
(opener.closest('dialog') ?? document.body).append(list);
|
|
56
|
+
list.showPopover?.();
|
|
57
|
+
const r = opener.closest('.tb-date').getBoundingClientRect();
|
|
58
|
+
list.style.width = `${Math.min(r.width, 240)}px`;
|
|
59
|
+
list.style.left = `${r.right - list.getBoundingClientRect().width}px`;
|
|
60
|
+
const height = list.getBoundingClientRect().height;
|
|
61
|
+
list.style.top = `${r.bottom + 4 + height > innerHeight - 8 ? Math.max(8, r.top - 4 - height) : r.bottom + 4}px`;
|
|
62
|
+
first?.scrollIntoView({ block: 'center' });
|
|
63
|
+
first?.focus();
|
|
64
|
+
}
|
|
65
|
+
export function closeTimes(refocus = true) {
|
|
66
|
+
if (times === null)
|
|
67
|
+
return;
|
|
68
|
+
const { list, opener } = times;
|
|
69
|
+
times = null;
|
|
70
|
+
list.hidePopover?.();
|
|
71
|
+
list.remove();
|
|
72
|
+
opener.setAttribute('aria-expanded', 'false');
|
|
73
|
+
document.removeEventListener('pointerdown', outsideTimes, true);
|
|
74
|
+
if (refocus)
|
|
75
|
+
opener.focus();
|
|
76
|
+
}
|
|
77
|
+
export function outsideTimes(ev) {
|
|
78
|
+
if (times !== null && !times.list.contains(ev.target) && !times.opener.contains(ev.target))
|
|
79
|
+
closeTimes(false);
|
|
80
|
+
}
|
|
81
|
+
export function pickTime(at) {
|
|
82
|
+
const face = times?.face;
|
|
83
|
+
if (face === undefined)
|
|
84
|
+
return;
|
|
85
|
+
closeTimes();
|
|
86
|
+
void fire('ui-input', face, string(at)).then(() => fire('ui-blur', face));
|
|
87
|
+
}
|
|
88
|
+
export function timesKey(ev) {
|
|
89
|
+
if (times === null)
|
|
90
|
+
return;
|
|
91
|
+
seenKeys.add(ev);
|
|
92
|
+
const items = [...times.list.children];
|
|
93
|
+
const at = items.indexOf(ev.target);
|
|
94
|
+
if (ev.key === 'Escape') {
|
|
95
|
+
ev.preventDefault();
|
|
96
|
+
ev.stopPropagation();
|
|
97
|
+
closeTimes();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (ev.key === 'Enter' || ev.key === ' ') {
|
|
101
|
+
ev.preventDefault();
|
|
102
|
+
ev.target.click();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const moves = { ArrowDown: at + 1, ArrowUp: at - 1, Home: 0, End: items.length - 1, PageDown: at + 8, PageUp: at - 8 };
|
|
106
|
+
if (!(ev.key in moves) || at < 0)
|
|
107
|
+
return;
|
|
108
|
+
ev.preventDefault();
|
|
109
|
+
const to = items[Math.max(0, Math.min(items.length - 1, moves[ev.key]))];
|
|
110
|
+
items[at].tabIndex = -1;
|
|
111
|
+
to.tabIndex = 0;
|
|
112
|
+
to.focus();
|
|
113
|
+
to.scrollIntoView({ block: 'nearest' });
|
|
114
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Cell, type ObjectCell } from '../../core/index.ts';
|
|
2
|
+
import { type Mounted } from './mount.ts';
|
|
3
|
+
export declare const BAR_ITEMS = "button, a[href], input, select, textarea, [tabindex]";
|
|
4
|
+
/** The controls of a toolbar, in order; `shown` skips hidden and disabled ones. */
|
|
5
|
+
export declare function barItems(bar: HTMLElement, shown?: boolean): HTMLElement[];
|
|
6
|
+
export declare function buildToolbar(): HTMLElement;
|
|
7
|
+
/** Keeps exactly one control of a toolbar in the Tab order, and the text of its buttons as their tooltip. */
|
|
8
|
+
export declare function syncToolbar(bar: HTMLElement): void;
|
|
9
|
+
export interface Crumb {
|
|
10
|
+
text: string;
|
|
11
|
+
id: Cell;
|
|
12
|
+
}
|
|
13
|
+
/** The items of a breadcrumb: a label and a word or path each, the last one maybe without. */
|
|
14
|
+
export declare function crumbs(face: ObjectCell): Crumb[];
|
|
15
|
+
export declare function buildBreadcrumb(m: Mounted): HTMLElement;
|
|
16
|
+
/** Rebuilds the items; on narrow screens the middle ones hide behind a "…" that lists them in a menu. */
|
|
17
|
+
export declare function syncBreadcrumb(m: Mounted): void;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// --- toolbars and breadcrumbs -------------------------------------------------------
|
|
2
|
+
import { K, NONE, form, wordOf } from "../../core/index.js";
|
|
3
|
+
import { translate } from "../index.js";
|
|
4
|
+
import { get, keepOwn, word } from "./faces.js";
|
|
5
|
+
import { host, byNode, fire, el } from "./mount.js";
|
|
6
|
+
import { openMenu } from "./menus.js";
|
|
7
|
+
import { sync } from "./sync.js";
|
|
8
|
+
export const BAR_ITEMS = 'button, a[href], input, select, textarea, [tabindex]';
|
|
9
|
+
/** The controls of a toolbar, in order; `shown` skips hidden and disabled ones. */
|
|
10
|
+
export function barItems(bar, shown = true) {
|
|
11
|
+
return Array.from(bar.querySelectorAll(BAR_ITEMS)).filter(e => e.closest('.tb-toolbar') === bar
|
|
12
|
+
&& (!shown || e.getClientRects().length > 0 && !e.disabled));
|
|
13
|
+
}
|
|
14
|
+
export function buildToolbar() {
|
|
15
|
+
const bar = el('div', 'tb-toolbar');
|
|
16
|
+
bar.setAttribute('role', 'toolbar');
|
|
17
|
+
// one Tab stop: the arrows move between the controls (roving tabindex)
|
|
18
|
+
bar.addEventListener('keydown', ev => {
|
|
19
|
+
const at = ev.target;
|
|
20
|
+
if (ev.altKey || ev.ctrlKey || ev.metaKey || at.matches('input, select, textarea'))
|
|
21
|
+
return;
|
|
22
|
+
const items = barItems(bar);
|
|
23
|
+
const i = items.indexOf(at);
|
|
24
|
+
if (i < 0)
|
|
25
|
+
return;
|
|
26
|
+
const to = ev.key === 'ArrowRight' ? (i + 1) % items.length : ev.key === 'ArrowLeft' ? (i - 1 + items.length) % items.length
|
|
27
|
+
: ev.key === 'Home' ? 0 : ev.key === 'End' ? items.length - 1 : -1;
|
|
28
|
+
if (to < 0)
|
|
29
|
+
return;
|
|
30
|
+
ev.preventDefault();
|
|
31
|
+
items[to].focus();
|
|
32
|
+
});
|
|
33
|
+
bar.addEventListener('focusin', ev => {
|
|
34
|
+
const at = ev.target;
|
|
35
|
+
if (!barItems(bar, false).includes(at))
|
|
36
|
+
return;
|
|
37
|
+
for (const e of barItems(bar, false))
|
|
38
|
+
e.tabIndex = e === at ? 0 : -1;
|
|
39
|
+
});
|
|
40
|
+
return bar;
|
|
41
|
+
}
|
|
42
|
+
/** Keeps exactly one control of a toolbar in the Tab order, and the text of its buttons as their tooltip. */
|
|
43
|
+
export function syncToolbar(bar) {
|
|
44
|
+
for (const e of Array.from(bar.children)) {
|
|
45
|
+
const m = byNode.get(e);
|
|
46
|
+
if (m !== undefined && m.el === e && word(m.face, 'style') === 'button')
|
|
47
|
+
sync(m);
|
|
48
|
+
}
|
|
49
|
+
// the bar may not be on the page yet, so visibility is checked only when moving
|
|
50
|
+
const items = barItems(bar, false);
|
|
51
|
+
const current = items.find(e => e.tabIndex === 0 && e.hasAttribute('tabindex')) ?? items[0];
|
|
52
|
+
for (const e of items)
|
|
53
|
+
e.tabIndex = e === current ? 0 : -1;
|
|
54
|
+
}
|
|
55
|
+
/** The items of a breadcrumb: a label and a word or path each, the last one maybe without. */
|
|
56
|
+
export function crumbs(face) {
|
|
57
|
+
const d = get(face, 'data');
|
|
58
|
+
if (d.t !== K.Block)
|
|
59
|
+
return [];
|
|
60
|
+
const out = [];
|
|
61
|
+
const cells = d.s.data.slice(d.i);
|
|
62
|
+
for (let i = 0; i < cells.length; i++) {
|
|
63
|
+
const c = cells[i];
|
|
64
|
+
if (c.t !== K.String && c.t !== K.Map)
|
|
65
|
+
continue;
|
|
66
|
+
const next = cells[i + 1];
|
|
67
|
+
const id = next !== undefined && (next.t === K.Word || next.t === K.Path) ? next : NONE;
|
|
68
|
+
if (id !== NONE)
|
|
69
|
+
i++;
|
|
70
|
+
out.push({ text: translate(c, host.rt), id });
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
export function buildBreadcrumb(m) {
|
|
75
|
+
const nav = el('nav', 'tb-breadcrumb');
|
|
76
|
+
keepOwn(nav, 'breadcrumb', 'aria-label');
|
|
77
|
+
m.box = el('ol');
|
|
78
|
+
nav.append(m.box);
|
|
79
|
+
return nav;
|
|
80
|
+
}
|
|
81
|
+
/** Rebuilds the items; on narrow screens the middle ones hide behind a "…" that lists them in a menu. */
|
|
82
|
+
export function syncBreadcrumb(m) {
|
|
83
|
+
const f = m.face;
|
|
84
|
+
const items = crumbs(f);
|
|
85
|
+
// choosing an item sets value, which repaints the face: keep the nodes (and the focus) if nothing changed
|
|
86
|
+
const signature = items.map(c => `${c.text}\u0000${form(c.id)}`).join('\u0001');
|
|
87
|
+
if (m.kids === signature)
|
|
88
|
+
return;
|
|
89
|
+
m.kids = signature;
|
|
90
|
+
// a lit-word or lit-path, so that passing it on does not evaluate it
|
|
91
|
+
const pick = (c) => void fire('ui-crumb', f, c.id.t === K.Path ? { ...c.id, t: K.LitPath } : wordOf(K.LitWord, form(c.id)));
|
|
92
|
+
const middle = items.length > 3 ? items.slice(1, -2) : [];
|
|
93
|
+
const nodes = items.map((c, i) => {
|
|
94
|
+
const li = el('li');
|
|
95
|
+
if (middle.includes(c))
|
|
96
|
+
li.className = 'tb-crumb-middle';
|
|
97
|
+
if (c.id === NONE) {
|
|
98
|
+
const span = el('span', 'tb-crumb');
|
|
99
|
+
span.textContent = c.text;
|
|
100
|
+
if (i === items.length - 1)
|
|
101
|
+
span.setAttribute('aria-current', 'page');
|
|
102
|
+
li.append(span);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const b = el('button', 'tb-crumb');
|
|
106
|
+
b.type = 'button';
|
|
107
|
+
b.textContent = c.text;
|
|
108
|
+
b.addEventListener('click', () => pick(c));
|
|
109
|
+
li.append(b);
|
|
110
|
+
}
|
|
111
|
+
return li;
|
|
112
|
+
});
|
|
113
|
+
if (middle.length > 0) {
|
|
114
|
+
const li = el('li', 'tb-crumb-more');
|
|
115
|
+
const b = el('button', 'tb-crumb');
|
|
116
|
+
b.type = 'button';
|
|
117
|
+
b.textContent = '…';
|
|
118
|
+
keepOwn(b, 'more-levels', 'aria-label');
|
|
119
|
+
b.setAttribute('aria-haspopup', 'menu');
|
|
120
|
+
b.setAttribute('aria-expanded', 'false');
|
|
121
|
+
b.addEventListener('click', () => {
|
|
122
|
+
const r = b.getBoundingClientRect();
|
|
123
|
+
openMenu(middle.map(c => ({ text: c.text, run: () => pick(c) })), r.left, r.bottom + 4, b);
|
|
124
|
+
});
|
|
125
|
+
li.append(b);
|
|
126
|
+
nodes.splice(1, 0, li);
|
|
127
|
+
}
|
|
128
|
+
m.box.replaceChildren(...nodes);
|
|
129
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Cell, type ObjectCell } from '../../core/index.ts';
|
|
2
|
+
import { type Mounted } from './mount.ts';
|
|
3
|
+
import { type Source, type Target } from './drag.ts';
|
|
4
|
+
export declare const CHILDREN: number;
|
|
5
|
+
export declare const EXPANDED: number;
|
|
6
|
+
export declare function treeItems(m: Mounted): HTMLElement[];
|
|
7
|
+
/** The node whose children a group holds; none for the root. */
|
|
8
|
+
export declare function groupParent(m: Mounted, group: HTMLElement): Cell;
|
|
9
|
+
export declare function buildTree(face: ObjectCell, m: Mounted): HTMLElement;
|
|
10
|
+
export declare function newTreeItem(): HTMLElement;
|
|
11
|
+
/** Creates, updates, moves or removes the items of a tree, level by level, by key. */
|
|
12
|
+
export declare function syncTree(m: Mounted): void;
|
|
13
|
+
export declare function focusItem(m: Mounted, item: HTMLElement): void;
|
|
14
|
+
export declare function selectNode(m: Mounted, item: HTMLElement): void;
|
|
15
|
+
/** Opens or closes a folder; opening runs on-expand, which may load its children. */
|
|
16
|
+
export declare function toggleNode(m: Mounted, item: HTMLElement, want?: boolean): void;
|
|
17
|
+
/** The keys of the treeview pattern: arrows, Home, End, Enter, Space and a letter to jump. */
|
|
18
|
+
export declare function treeKey(m: Mounted, ev: KeyboardEvent): void;
|
|
19
|
+
/** Where a drag over a tree lands: between siblings, or into a folder when over the middle of its row. */
|
|
20
|
+
export declare function treeTarget(m: Mounted, src: Source, x: number, y: number): Target | null;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// --- trees ---------------------------------------------------------------------------
|
|
2
|
+
import { K, NONE, form, intern } from "../../core/index.js";
|
|
3
|
+
import { rowField } from "../rows.js";
|
|
4
|
+
import { get, str, own, flag, icon } from "./faces.js";
|
|
5
|
+
import { rowOf, fire, el } from "./mount.js";
|
|
6
|
+
import { insertionAt } from "./drag.js";
|
|
7
|
+
import { columns, sameRow, cellText } from "./tables.js";
|
|
8
|
+
export const CHILDREN = intern('children');
|
|
9
|
+
export const EXPANDED = intern('expanded');
|
|
10
|
+
export function treeItems(m) {
|
|
11
|
+
return Array.from(m.box.querySelectorAll('[role="treeitem"]'));
|
|
12
|
+
}
|
|
13
|
+
/** The node whose children a group holds; none for the root. */
|
|
14
|
+
export function groupParent(m, group) {
|
|
15
|
+
if (group === m.box)
|
|
16
|
+
return NONE;
|
|
17
|
+
const item = group.closest('[role="treeitem"]');
|
|
18
|
+
return item !== null ? rowOf.get(item) ?? NONE : NONE;
|
|
19
|
+
}
|
|
20
|
+
export function buildTree(face, m) {
|
|
21
|
+
const wrap = el('div', 'tb-tree-wrap');
|
|
22
|
+
const box = el('ul', 'tb-tree');
|
|
23
|
+
box.setAttribute('role', 'tree');
|
|
24
|
+
const empty = el('p', 'tb-empty');
|
|
25
|
+
wrap.append(box, empty);
|
|
26
|
+
box.addEventListener('click', ev => {
|
|
27
|
+
const target = ev.target;
|
|
28
|
+
const item = target.closest('[role="treeitem"]');
|
|
29
|
+
if (item === null)
|
|
30
|
+
return;
|
|
31
|
+
if (target.closest('.tb-tree-toggle') !== null)
|
|
32
|
+
return toggleNode(m, item);
|
|
33
|
+
focusItem(m, item);
|
|
34
|
+
selectNode(m, item);
|
|
35
|
+
});
|
|
36
|
+
box.addEventListener('keydown', ev => treeKey(m, ev));
|
|
37
|
+
m.box = box;
|
|
38
|
+
m.rows = new Map();
|
|
39
|
+
m.empty = empty;
|
|
40
|
+
m.open = new Set();
|
|
41
|
+
return wrap;
|
|
42
|
+
}
|
|
43
|
+
export function newTreeItem() {
|
|
44
|
+
const li = el('li');
|
|
45
|
+
li.setAttribute('role', 'treeitem');
|
|
46
|
+
const row = el('div', 'tb-tree-row');
|
|
47
|
+
const toggle = el('span', 'tb-tree-toggle');
|
|
48
|
+
toggle.setAttribute('aria-hidden', 'true');
|
|
49
|
+
const chevron = icon('chevron-right');
|
|
50
|
+
if (chevron !== null)
|
|
51
|
+
toggle.append(chevron);
|
|
52
|
+
row.append(toggle, el('span', 'tb-tree-label'));
|
|
53
|
+
const group = el('ul');
|
|
54
|
+
group.setAttribute('role', 'group');
|
|
55
|
+
li.append(row, group);
|
|
56
|
+
return li;
|
|
57
|
+
}
|
|
58
|
+
/** Creates, updates, moves or removes the items of a tree, level by level, by key. */
|
|
59
|
+
export function syncTree(m) {
|
|
60
|
+
const f = m.face;
|
|
61
|
+
const label = columns(f)[0]?.sym ?? intern('name');
|
|
62
|
+
const keyWord = get(f, 'key');
|
|
63
|
+
const key = keyWord.t === K.Word || keyWord.t === K.LitWord ? keyWord.sym : intern('id');
|
|
64
|
+
const selected = get(f, 'selected');
|
|
65
|
+
const old = m.rows;
|
|
66
|
+
const open = m.open;
|
|
67
|
+
const next = new Map();
|
|
68
|
+
const level = (group, nodes, depth, parentKey) => {
|
|
69
|
+
let cursor = group.firstChild;
|
|
70
|
+
nodes.forEach((node, i) => {
|
|
71
|
+
const id = rowField(node, key);
|
|
72
|
+
let k = id.t === K.None ? `${parentKey}/${i}` : `${id.t}:${form(id)}`;
|
|
73
|
+
if (next.has(k))
|
|
74
|
+
k = `${parentKey}/${i}#${k}`;
|
|
75
|
+
const known = old.get(k);
|
|
76
|
+
const item = known ?? newTreeItem();
|
|
77
|
+
next.set(k, item);
|
|
78
|
+
rowOf.set(item, node);
|
|
79
|
+
item.dataset['key'] = k;
|
|
80
|
+
item.setAttribute('aria-level', String(depth));
|
|
81
|
+
item.style.setProperty('--tb-level', String(depth - 1));
|
|
82
|
+
const text = cellText(rowField(node, label));
|
|
83
|
+
const name = item.firstElementChild.lastElementChild;
|
|
84
|
+
if (name.textContent !== text)
|
|
85
|
+
name.textContent = text;
|
|
86
|
+
const kids = rowField(node, CHILDREN);
|
|
87
|
+
const folder = kids.t === K.Block;
|
|
88
|
+
// `expanded: true` opens a node the first time it shows
|
|
89
|
+
if (folder && known === undefined && rowField(node, EXPANDED).t === K.Logic && rowField(node, EXPANDED).v)
|
|
90
|
+
open.add(k);
|
|
91
|
+
const isOpen = folder && open.has(k);
|
|
92
|
+
if (folder)
|
|
93
|
+
item.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
|
94
|
+
else
|
|
95
|
+
item.removeAttribute('aria-expanded');
|
|
96
|
+
const sub = item.lastElementChild;
|
|
97
|
+
if (isOpen)
|
|
98
|
+
level(sub, kids.s.data.slice(kids.i), depth + 1, k);
|
|
99
|
+
else
|
|
100
|
+
sub.replaceChildren();
|
|
101
|
+
sub.hidden = sub.childElementCount === 0;
|
|
102
|
+
const on = selected.t !== K.None && sameRow(selected, node);
|
|
103
|
+
item.classList.toggle('tb-selected', on);
|
|
104
|
+
item.setAttribute('aria-selected', on ? 'true' : 'false');
|
|
105
|
+
if (item !== cursor)
|
|
106
|
+
group.insertBefore(item, cursor);
|
|
107
|
+
else
|
|
108
|
+
cursor = cursor.nextSibling;
|
|
109
|
+
});
|
|
110
|
+
// whatever is left after the last placed item is gone from the data
|
|
111
|
+
while (cursor !== null) {
|
|
112
|
+
const gone = cursor;
|
|
113
|
+
cursor = cursor.nextSibling;
|
|
114
|
+
gone.remove();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const data = get(f, 'data');
|
|
118
|
+
level(m.box, data.t === K.Block ? data.s.data.slice(data.i) : [], 1, '');
|
|
119
|
+
m.rows = next;
|
|
120
|
+
// one Tab stop: the item that had it, else the selected one, else the first
|
|
121
|
+
const items = treeItems(m);
|
|
122
|
+
const current = items.find(e => e.tabIndex === 0 && e.hasAttribute('tabindex'))
|
|
123
|
+
?? items.find(e => e.classList.contains('tb-selected')) ?? items[0];
|
|
124
|
+
for (const e of items)
|
|
125
|
+
e.tabIndex = e === current ? 0 : -1;
|
|
126
|
+
m.empty.textContent = str(f, 'text') ?? own('empty');
|
|
127
|
+
m.empty.hidden = items.length > 0;
|
|
128
|
+
}
|
|
129
|
+
export function focusItem(m, item) {
|
|
130
|
+
for (const e of treeItems(m))
|
|
131
|
+
e.tabIndex = e === item ? 0 : -1;
|
|
132
|
+
item.focus();
|
|
133
|
+
}
|
|
134
|
+
export function selectNode(m, item) {
|
|
135
|
+
const node = rowOf.get(item);
|
|
136
|
+
if (node !== undefined)
|
|
137
|
+
void fire('ui-select', m.face, node);
|
|
138
|
+
}
|
|
139
|
+
/** Opens or closes a folder; opening runs on-expand, which may load its children. */
|
|
140
|
+
export function toggleNode(m, item, want) {
|
|
141
|
+
if (!item.hasAttribute('aria-expanded'))
|
|
142
|
+
return;
|
|
143
|
+
const k = item.dataset['key'];
|
|
144
|
+
const open = want ?? !m.open.has(k);
|
|
145
|
+
if (open === m.open.has(k))
|
|
146
|
+
return;
|
|
147
|
+
const inside = document.activeElement !== item && item.contains(document.activeElement);
|
|
148
|
+
if (open)
|
|
149
|
+
m.open.add(k);
|
|
150
|
+
else
|
|
151
|
+
m.open.delete(k);
|
|
152
|
+
syncTree(m);
|
|
153
|
+
if (inside)
|
|
154
|
+
focusItem(m, item);
|
|
155
|
+
const node = rowOf.get(item);
|
|
156
|
+
if (open && node !== undefined)
|
|
157
|
+
void fire('ui-expand', m.face, node);
|
|
158
|
+
}
|
|
159
|
+
/** The keys of the treeview pattern: arrows, Home, End, Enter, Space and a letter to jump. */
|
|
160
|
+
export function treeKey(m, ev) {
|
|
161
|
+
const item = ev.target.closest('[role="treeitem"]');
|
|
162
|
+
if (item === null || ev.altKey || ev.ctrlKey || ev.metaKey)
|
|
163
|
+
return;
|
|
164
|
+
const items = treeItems(m);
|
|
165
|
+
const i = items.indexOf(item);
|
|
166
|
+
const expanded = item.getAttribute('aria-expanded');
|
|
167
|
+
let to = null;
|
|
168
|
+
switch (ev.key) {
|
|
169
|
+
case 'ArrowDown':
|
|
170
|
+
to = items[i + 1];
|
|
171
|
+
break;
|
|
172
|
+
case 'ArrowUp':
|
|
173
|
+
to = items[i - 1];
|
|
174
|
+
break;
|
|
175
|
+
case 'Home':
|
|
176
|
+
to = items[0];
|
|
177
|
+
break;
|
|
178
|
+
case 'End':
|
|
179
|
+
to = items[items.length - 1];
|
|
180
|
+
break;
|
|
181
|
+
case 'ArrowRight':
|
|
182
|
+
if (expanded === 'false')
|
|
183
|
+
toggleNode(m, item, true);
|
|
184
|
+
else if (expanded === 'true')
|
|
185
|
+
to = item.querySelector('[role="treeitem"]');
|
|
186
|
+
break;
|
|
187
|
+
case 'ArrowLeft':
|
|
188
|
+
if (expanded === 'true')
|
|
189
|
+
toggleNode(m, item, false);
|
|
190
|
+
else
|
|
191
|
+
to = item.parentElement.closest('[role="treeitem"]');
|
|
192
|
+
break;
|
|
193
|
+
case 'Enter':
|
|
194
|
+
case ' ':
|
|
195
|
+
selectNode(m, item);
|
|
196
|
+
break;
|
|
197
|
+
default: {
|
|
198
|
+
if (ev.key.length !== 1 || ev.key.trim() === '')
|
|
199
|
+
return;
|
|
200
|
+
const c = ev.key.toLowerCase();
|
|
201
|
+
const label = (e) => (e.querySelector('.tb-tree-label')?.textContent ?? '').toLowerCase();
|
|
202
|
+
to = [...items.slice(i + 1), ...items.slice(0, i)].find(e => label(e).startsWith(c));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
ev.preventDefault();
|
|
206
|
+
if (to)
|
|
207
|
+
focusItem(m, to);
|
|
208
|
+
}
|
|
209
|
+
/** Where a drag over a tree lands: between siblings, or into a folder when over the middle of its row. */
|
|
210
|
+
export function treeTarget(m, src, x, y) {
|
|
211
|
+
const at = document.elementFromPoint(x, y)?.closest('[role="treeitem"]');
|
|
212
|
+
const drop = flag(m.face, 'drop');
|
|
213
|
+
let t;
|
|
214
|
+
if (at === null || at === undefined || !m.box.contains(at)) {
|
|
215
|
+
t = { m, index: insertionAt(m, x, y), reorder: false, group: m.box, parent: NONE };
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
const r = at.querySelector(':scope > .tb-tree-row').getBoundingClientRect();
|
|
219
|
+
if (at.hasAttribute('aria-expanded') && y > r.top + r.height / 4 && y < r.bottom - r.height / 4) {
|
|
220
|
+
const node = rowOf.get(at);
|
|
221
|
+
const kids = rowField(node, CHILDREN);
|
|
222
|
+
t = { m, index: kids.s.data.length - kids.i, reorder: false, group: at.lastElementChild, parent: node, into: at };
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
const group = at.parentElement;
|
|
226
|
+
const index = Array.prototype.indexOf.call(group.children, at) + (y > r.top + r.height / 2 ? 1 : 0);
|
|
227
|
+
t = { m, index, reorder: false, group, parent: groupParent(m, group) };
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// never into itself or below itself
|
|
231
|
+
if (src.el === t.into || src.el.contains(t.group))
|
|
232
|
+
return null;
|
|
233
|
+
t.reorder = src.within === m && t.group === src.group && t.into === undefined;
|
|
234
|
+
return t.reorder || drop ? t : null;
|
|
235
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Cell, type ObjectCell } from '../../core/index.ts';
|
|
2
|
+
import { type Mounted } from './mount.ts';
|
|
3
|
+
export declare function buildUpload(face: ObjectCell, m: Mounted): HTMLElement;
|
|
4
|
+
/** The accept list of an upload: extensions ("pdf") and types ("image/*"); a photo takes images unless told. */
|
|
5
|
+
export declare function acceptList(face: ObjectCell): string[];
|
|
6
|
+
/** The picker's accept attribute for an accept list. */
|
|
7
|
+
export declare function pickerAccept(list: string[]): string;
|
|
8
|
+
/** Lets a zone take files dropped on it, unless its button is disabled. */
|
|
9
|
+
export declare function dropFiles(face: ObjectCell, zone: HTMLElement, button: HTMLButtonElement): void;
|
|
10
|
+
/** The bar of how far the files went up, while a fetch with progress sends them. */
|
|
11
|
+
export declare function sentBar(label: HTMLElement, id: string): HTMLElement;
|
|
12
|
+
export declare function syncSent(m: Mounted): void;
|
|
13
|
+
/** A video's captions as [language, address] pairs: a file alone is in the active language. */
|
|
14
|
+
export declare function captionTracks(f: ObjectCell): [string, string][];
|
|
15
|
+
export declare function syncMedia(m: Mounted): void;
|
|
16
|
+
/** The address that shows each chosen file, made once and freed when the photo shows another. */
|
|
17
|
+
export declare const shownUrls: WeakMap<HTMLElement, {
|
|
18
|
+
blob: Blob;
|
|
19
|
+
url: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function buildPhoto(face: ObjectCell, m: Mounted): HTMLElement;
|
|
22
|
+
/** What a photo shows: the image chosen, or the address of one kept elsewhere; null for none. */
|
|
23
|
+
export declare function photoSrc(frame: HTMLElement, v: Cell): string | null;
|
|
24
|
+
export declare function syncPhoto(m: Mounted, err: string | null): void;
|
|
25
|
+
export declare function accepts(file: File, list: string[]): boolean;
|
|
26
|
+
export declare function chooseFiles(face: ObjectCell, files: File[]): void;
|
|
27
|
+
/** A link as the page would follow it, relative ones too; null unless it is http or https. */
|
|
28
|
+
export declare function webHref(url: string): string | null;
|
|
29
|
+
export declare function syncUpload(m: Mounted, err: string | null): void;
|