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
|
@@ -7,129 +7,32 @@
|
|
|
7
7
|
// to the editor (vscode://).
|
|
8
8
|
// Console >> and == as in the trebol console, against the running app;
|
|
9
9
|
// `face` is the face picked; print shows here too.
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// Machines the machines the program holds in its words: their states as a
|
|
11
|
+
// tree, the ones they are in marked, and of the one chosen its
|
|
12
|
+
// data, the ways out of its states and the events it takes now.
|
|
13
|
+
// Log events, requests, toasts, errors and warnings, and each change
|
|
14
|
+
// of state of a machine, newest last.
|
|
15
|
+
//
|
|
16
|
+
// This file is the panel; the tabs and what they share are in devtools/.
|
|
17
|
+
import { K, mold } from "../core/index.js";
|
|
18
|
+
import { output } from "./index.js";
|
|
14
19
|
import { devLog } from "./devlog.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let panel;
|
|
23
|
-
let opener;
|
|
24
|
-
let outline;
|
|
25
|
-
let pickButton;
|
|
26
|
-
let tree;
|
|
27
|
-
let detail;
|
|
28
|
-
let consoleOut;
|
|
29
|
-
let consoleIn;
|
|
30
|
-
let consoleFace;
|
|
31
|
-
let logList;
|
|
32
|
-
const tabs = new Map();
|
|
33
|
-
/** The face chosen in Faces, `face` in Console. */
|
|
34
|
-
let picked = null;
|
|
35
|
-
/** The face under the pointer or the tree row the pointer is on. */
|
|
36
|
-
let pointed = null;
|
|
37
|
-
let picking = false;
|
|
38
|
-
let history = [];
|
|
39
|
-
let back = 0;
|
|
40
|
-
let lastLog = null;
|
|
41
|
-
let treeFrame = 0;
|
|
42
|
-
/** The code typed so far runs one piece after another. */
|
|
43
|
-
let running = Promise.resolve();
|
|
44
|
-
function el(tag, cls, content) {
|
|
45
|
-
const e = document.createElement(tag);
|
|
46
|
-
if (cls)
|
|
47
|
-
e.className = cls;
|
|
48
|
-
if (content !== undefined)
|
|
49
|
-
e.textContent = content;
|
|
50
|
-
return e;
|
|
51
|
-
}
|
|
52
|
-
function button(cls, content, act) {
|
|
53
|
-
const b = el('button', cls, content);
|
|
54
|
-
b.type = 'button';
|
|
55
|
-
b.addEventListener('click', act);
|
|
56
|
-
return b;
|
|
57
|
-
}
|
|
58
|
-
function read(store, key, fallback) {
|
|
59
|
-
try {
|
|
60
|
-
const v = store().getItem(key);
|
|
61
|
-
return v === null ? fallback : { ...fallback, ...JSON.parse(v) };
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return fallback;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function write(store, key, v) {
|
|
68
|
-
try {
|
|
69
|
-
store().setItem(key, JSON.stringify(v));
|
|
70
|
-
}
|
|
71
|
-
catch {
|
|
72
|
-
// a private window or blocked storage: the panel forgets, nothing else
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
// --- reading faces -----------------------------------------------------------------
|
|
76
|
-
function get(face, name) {
|
|
77
|
-
const i = ctxFind(face.ctx, intern(name));
|
|
78
|
-
return i < 0 ? NONE : face.ctx.vals[i];
|
|
79
|
-
}
|
|
80
|
-
function wordText(v) {
|
|
81
|
-
return v.t === K.Word || v.t === K.LitWord ? spell(v.sym) : null;
|
|
82
|
-
}
|
|
83
|
-
function short(s, most = 80) {
|
|
84
|
-
const line = s.replace(/\s+/g, ' ');
|
|
85
|
-
return line.length > most ? line.slice(0, most - 1) + '…' : line;
|
|
86
|
-
}
|
|
87
|
-
/** How a face is named in the tree, the log and errors: its style, name and text (`field email "Email"`). */
|
|
88
|
-
export function faceRef(face, rt) {
|
|
89
|
-
const style = wordText(get(face, 'style')) ?? 'face';
|
|
90
|
-
const name = wordText(get(face, 'name'));
|
|
91
|
-
const t = get(face, 'text');
|
|
92
|
-
const shown = t.t === K.None ? null : t.t === K.String || t.t === K.Map || t.t === K.Word ? translate(t, rt) : form(t);
|
|
93
|
-
return [style, name, shown !== null && shown !== '' ? `"${short(shown, 40)}"` : null].filter(x => x !== null).join(' ');
|
|
94
|
-
}
|
|
95
|
-
function on(face, name) {
|
|
96
|
-
const v = get(face, name);
|
|
97
|
-
return !(v.t === K.None || (v.t === K.Logic && !v.v));
|
|
98
|
-
}
|
|
99
|
-
function moldShort(v, most = MAX_MOLD) {
|
|
100
|
-
const s = mold(v);
|
|
101
|
-
return s.length > most ? s.slice(0, most - 1) + '…' : s;
|
|
102
|
-
}
|
|
103
|
-
/** A face's file:line:col and a vscode:// link to it, when the file is in the folder trebol dev serves. */
|
|
104
|
-
function placeOf(face) {
|
|
105
|
-
const v = get(face, 'place');
|
|
106
|
-
if (v.t !== K.String)
|
|
107
|
-
return null;
|
|
108
|
-
const at = form(v);
|
|
109
|
-
const m = /^(.*):(\d+):(\d+)$/.exec(at);
|
|
110
|
-
if (m === null)
|
|
111
|
-
return { text: at, href: null };
|
|
112
|
-
let url;
|
|
113
|
-
try {
|
|
114
|
-
url = new URL(m[1]);
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
return { text: at, href: null };
|
|
118
|
-
}
|
|
119
|
-
const path = decodeURIComponent(url.pathname);
|
|
120
|
-
const text = `${path.slice(1)}:${m[2]}:${m[3]}`;
|
|
121
|
-
const mine = url.origin === location.origin && !path.startsWith('/@trebol/') && side.root !== null;
|
|
122
|
-
return { text, href: mine ? `vscode://file${side.root.replace(/\/$/, '')}${path}:${m[2]}:${m[3]}` : null };
|
|
123
|
-
}
|
|
20
|
+
import { STATE_KEY, HISTORY_KEY, side, setSide, state, setState, panel, setPanel, opener, setOpener, outline, setOutline, pickButton, setPickButton, consoleIn, consoleFace, logList, tabs, picked, picking, setHistory, treeFrame, setTreeFrame, el, button, read, write } from "./devtools/state.js";
|
|
21
|
+
import { wordText, short, faceRef } from "./devtools/read.js";
|
|
22
|
+
import { faceKey, buildFaces, drawTree, drawDetail, point, placeOutline, setPicking, pickMove, pickDown, pickClick } from "./devtools/faces.js";
|
|
23
|
+
import { buildMachines, noteMachines, drawMachines } from "./devtools/machines.js";
|
|
24
|
+
import { buildConsole, say } from "./devtools/console.js";
|
|
25
|
+
import { buildLog, log } from "./devtools/log.js";
|
|
26
|
+
export { faceRef } from "./devtools/read.js";
|
|
124
27
|
// --- the panel -----------------------------------------------------------------------
|
|
125
28
|
/** Starts the dev tools on a page served by trebol dev; not in a frame (the documentation's examples). */
|
|
126
29
|
export function startDevtools(s) {
|
|
127
30
|
if (window !== window.top)
|
|
128
31
|
return;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
32
|
+
setSide(s);
|
|
33
|
+
setState(read(() => sessionStorage, STATE_KEY, state));
|
|
34
|
+
setHistory(read(() => localStorage, HISTORY_KEY, { lines: [] }).lines);
|
|
35
|
+
setPanel(el('section', 'tb-dev-tools'));
|
|
133
36
|
panel.popover = 'manual';
|
|
134
37
|
panel.setAttribute('aria-label', 'Trebol dev tools');
|
|
135
38
|
const grip = el('div', 'tb-dev-grip');
|
|
@@ -139,7 +42,7 @@ export function startDevtools(s) {
|
|
|
139
42
|
list.setAttribute('role', 'tablist');
|
|
140
43
|
head.append(list);
|
|
141
44
|
const body = el('div', 'tb-dev-body');
|
|
142
|
-
for (const [tab, label] of [['faces', 'Faces'], ['console', 'Console'], ['log', 'Log']]) {
|
|
45
|
+
for (const [tab, label] of [['faces', 'Faces'], ['machines', 'Machines'], ['console', 'Console'], ['log', 'Log']]) {
|
|
143
46
|
const b = button('tb-dev-tab', label, () => openTab(tab));
|
|
144
47
|
b.setAttribute('role', 'tab');
|
|
145
48
|
b.id = `tb-dev-tab-${tab}`;
|
|
@@ -150,7 +53,7 @@ export function startDevtools(s) {
|
|
|
150
53
|
body.append(pane);
|
|
151
54
|
tabs.set(tab, { button: b, pane });
|
|
152
55
|
}
|
|
153
|
-
|
|
56
|
+
setPickButton(button('tb-dev-button', 'Pick', () => setPicking(!picking)));
|
|
154
57
|
pickButton.title = 'Click a face on the page to see it here';
|
|
155
58
|
pickButton.setAttribute('aria-pressed', 'false');
|
|
156
59
|
const close = button('tb-dev-button', 'Close', () => setOpen(false));
|
|
@@ -164,12 +67,13 @@ export function startDevtools(s) {
|
|
|
164
67
|
ev.preventDefault();
|
|
165
68
|
});
|
|
166
69
|
buildFaces(tabs.get('faces').pane);
|
|
70
|
+
buildMachines(tabs.get('machines').pane);
|
|
167
71
|
buildConsole(tabs.get('console').pane);
|
|
168
72
|
buildLog(tabs.get('log').pane);
|
|
169
|
-
|
|
73
|
+
setOpener(button('tb-dev-opener', 'Trebol', () => setOpen(true)));
|
|
170
74
|
opener.popover = 'manual';
|
|
171
75
|
opener.title = 'Dev tools (Ctrl+`)';
|
|
172
|
-
|
|
76
|
+
setOutline(el('div', 'tb-dev-outline'));
|
|
173
77
|
outline.popover = 'manual';
|
|
174
78
|
outline.setAttribute('aria-hidden', 'true');
|
|
175
79
|
document.body.append(panel, opener, outline);
|
|
@@ -205,7 +109,7 @@ export function inDevtools(target) {
|
|
|
205
109
|
* Puts the panel, its opener and the outline inside the dialog on show, or back in the body: while a
|
|
206
110
|
* modal dialog is open everything outside it is inert, the panel too.
|
|
207
111
|
*/
|
|
208
|
-
function home() {
|
|
112
|
+
export function home() {
|
|
209
113
|
const modals = document.querySelectorAll('dialog:modal');
|
|
210
114
|
const into = modals.length > 0 ? modals[modals.length - 1] : document.body;
|
|
211
115
|
if (panel.parentElement === into)
|
|
@@ -217,7 +121,7 @@ function home() {
|
|
|
217
121
|
e.showPopover();
|
|
218
122
|
}
|
|
219
123
|
}
|
|
220
|
-
function setOpen(open) {
|
|
124
|
+
export function setOpen(open) {
|
|
221
125
|
state.open = open;
|
|
222
126
|
write(() => sessionStorage, STATE_KEY, state);
|
|
223
127
|
home();
|
|
@@ -240,14 +144,14 @@ function setOpen(open) {
|
|
|
240
144
|
document.body.style.paddingBottom = '';
|
|
241
145
|
}
|
|
242
146
|
}
|
|
243
|
-
function setHeight(h) {
|
|
147
|
+
export function setHeight(h) {
|
|
244
148
|
state.height = Math.round(Math.max(140, Math.min(h, innerHeight - 60)));
|
|
245
149
|
panel.style.height = `${state.height}px`;
|
|
246
150
|
// the end of the page stays reachable above the panel
|
|
247
151
|
if (state.open)
|
|
248
152
|
document.body.style.paddingBottom = `${state.height}px`;
|
|
249
153
|
}
|
|
250
|
-
function resizeFrom(ev) {
|
|
154
|
+
export function resizeFrom(ev) {
|
|
251
155
|
ev.preventDefault();
|
|
252
156
|
const grip = ev.currentTarget;
|
|
253
157
|
grip.setPointerCapture(ev.pointerId);
|
|
@@ -260,7 +164,7 @@ function resizeFrom(ev) {
|
|
|
260
164
|
grip.addEventListener('pointermove', move);
|
|
261
165
|
grip.addEventListener('pointerup', up);
|
|
262
166
|
}
|
|
263
|
-
function openTab(tab) {
|
|
167
|
+
export function openTab(tab) {
|
|
264
168
|
state.tab = tab;
|
|
265
169
|
write(() => sessionStorage, STATE_KEY, state);
|
|
266
170
|
for (const [t, { button: b, pane }] of tabs) {
|
|
@@ -276,7 +180,7 @@ function openTab(tab) {
|
|
|
276
180
|
logList.scrollTop = logList.scrollHeight;
|
|
277
181
|
}
|
|
278
182
|
/** What the host tells: events, requests, notes and repaints. */
|
|
279
|
-
function hook() {
|
|
183
|
+
export function hook() {
|
|
280
184
|
devLog.event = (fn, face, args) => {
|
|
281
185
|
if (fn === 'ui-blur')
|
|
282
186
|
return;
|
|
@@ -305,14 +209,15 @@ function hook() {
|
|
|
305
209
|
devLog.note = (kind, text) => log(kind, text);
|
|
306
210
|
devLog.repainted = () => {
|
|
307
211
|
home();
|
|
212
|
+
noteMachines();
|
|
308
213
|
if (!state.open)
|
|
309
214
|
return;
|
|
310
215
|
placeOutline();
|
|
311
|
-
if (state.tab === 'faces' && treeFrame === 0)
|
|
312
|
-
|
|
313
|
-
|
|
216
|
+
if ((state.tab === 'faces' || state.tab === 'machines') && treeFrame === 0)
|
|
217
|
+
setTreeFrame(requestAnimationFrame(() => {
|
|
218
|
+
setTreeFrame(0);
|
|
314
219
|
refresh();
|
|
315
|
-
});
|
|
220
|
+
}));
|
|
316
221
|
};
|
|
317
222
|
const line = output.line;
|
|
318
223
|
output.line = text => {
|
|
@@ -320,307 +225,14 @@ function hook() {
|
|
|
320
225
|
say('out', text);
|
|
321
226
|
};
|
|
322
227
|
}
|
|
323
|
-
function refresh() {
|
|
228
|
+
export function refresh() {
|
|
324
229
|
if (!state.open)
|
|
325
230
|
return;
|
|
326
231
|
if (state.tab === 'faces') {
|
|
327
232
|
drawTree();
|
|
328
233
|
drawDetail();
|
|
329
234
|
}
|
|
235
|
+
if (state.tab === 'machines')
|
|
236
|
+
void drawMachines();
|
|
330
237
|
consoleFace.textContent = picked !== null ? `face: ${faceRef(picked, side.host.rt)}` : 'face: none (pick one in Faces)';
|
|
331
238
|
}
|
|
332
|
-
// --- faces ---------------------------------------------------------------------------
|
|
333
|
-
const faceKeys = new WeakMap();
|
|
334
|
-
let nextKey = 1;
|
|
335
|
-
function faceKey(face) {
|
|
336
|
-
let k = faceKeys.get(face.ctx);
|
|
337
|
-
if (k === undefined)
|
|
338
|
-
faceKeys.set(face.ctx, k = nextKey++);
|
|
339
|
-
return k;
|
|
340
|
-
}
|
|
341
|
-
function buildFaces(pane) {
|
|
342
|
-
tree = el('div', 'tb-dev-tree');
|
|
343
|
-
tree.setAttribute('aria-label', 'Faces on the page');
|
|
344
|
-
tree.addEventListener('pointerleave', () => point(null));
|
|
345
|
-
detail = el('div', 'tb-dev-detail');
|
|
346
|
-
pane.append(tree, detail);
|
|
347
|
-
}
|
|
348
|
-
/** The faces on the page, in the order of their nodes, with how deep each is. */
|
|
349
|
-
function facesOnPage() {
|
|
350
|
-
const out = [];
|
|
351
|
-
const walk = (e, depth) => {
|
|
352
|
-
for (const c of Array.from(e.children)) {
|
|
353
|
-
if (c === panel || c === opener || c === outline)
|
|
354
|
-
continue;
|
|
355
|
-
const f = side.faceOf(c);
|
|
356
|
-
if (f !== null)
|
|
357
|
-
out.push({ face: f, el: c, depth });
|
|
358
|
-
walk(c, f !== null ? depth + 1 : depth);
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
walk(document.body, 0);
|
|
362
|
-
return out;
|
|
363
|
-
}
|
|
364
|
-
function drawTree() {
|
|
365
|
-
const top = tree.scrollTop;
|
|
366
|
-
tree.replaceChildren();
|
|
367
|
-
for (const { face, el: node, depth } of facesOnPage()) {
|
|
368
|
-
const row = button('tb-dev-node', faceRef(face, side.host.rt), () => pick(face));
|
|
369
|
-
row.style.paddingLeft = `${8 + depth * 14}px`;
|
|
370
|
-
if (face.ctx === picked?.ctx)
|
|
371
|
-
row.setAttribute('aria-current', 'true');
|
|
372
|
-
if (node.offsetParent === null && getComputedStyle(node).position !== 'fixed')
|
|
373
|
-
row.classList.add('tb-dev-unseen');
|
|
374
|
-
row.addEventListener('pointerenter', () => point(face));
|
|
375
|
-
tree.append(row);
|
|
376
|
-
}
|
|
377
|
-
tree.scrollTop = top;
|
|
378
|
-
}
|
|
379
|
-
function drawDetail() {
|
|
380
|
-
detail.replaceChildren();
|
|
381
|
-
if (picked === null) {
|
|
382
|
-
detail.append(el('p', 'tb-dev-hint', 'Pick a face on the page, or choose one in the tree.'));
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
const f = picked;
|
|
386
|
-
const title = el('h3', undefined, faceRef(f, side.host.rt));
|
|
387
|
-
detail.append(title);
|
|
388
|
-
const where = placeOf(f);
|
|
389
|
-
if (where !== null) {
|
|
390
|
-
const p = el('p', 'tb-dev-place');
|
|
391
|
-
if (where.href !== null) {
|
|
392
|
-
const a = el('a', undefined, where.text);
|
|
393
|
-
a.href = where.href;
|
|
394
|
-
a.title = 'Open in VS Code';
|
|
395
|
-
p.append(a);
|
|
396
|
-
}
|
|
397
|
-
else
|
|
398
|
-
p.textContent = where.text;
|
|
399
|
-
detail.append(p);
|
|
400
|
-
}
|
|
401
|
-
if (side.nodeOf(f) === null)
|
|
402
|
-
detail.append(el('p', 'tb-dev-hint', 'Not on the page any more.'));
|
|
403
|
-
const dl = el('dl');
|
|
404
|
-
const row = (k, v) => {
|
|
405
|
-
dl.append(el('dt', undefined, k), el('dd', undefined, v));
|
|
406
|
-
};
|
|
407
|
-
for (const n of ['style', 'name', 'text', 'value', 'error', 'rules', 'hint', 'role']) {
|
|
408
|
-
const v = get(f, n);
|
|
409
|
-
if (v.t !== K.None)
|
|
410
|
-
row(n, moldShort(v, 400));
|
|
411
|
-
}
|
|
412
|
-
const events = [];
|
|
413
|
-
if (get(f, 'action').t === K.Block)
|
|
414
|
-
events.push('action');
|
|
415
|
-
const ev = get(f, 'events');
|
|
416
|
-
if (ev.t === K.Block) {
|
|
417
|
-
for (const c of ev.s.data.slice(ev.i))
|
|
418
|
-
if (c.t !== K.Block)
|
|
419
|
-
events.push(form(c));
|
|
420
|
-
}
|
|
421
|
-
if (events.length > 0)
|
|
422
|
-
row('events', events.join(' '));
|
|
423
|
-
const flags = ['required', 'disabled', 'hidden', 'readonly'].filter(n => on(f, n));
|
|
424
|
-
if (flags.length > 0)
|
|
425
|
-
row('flags', flags.join(' '));
|
|
426
|
-
const data = get(f, 'data');
|
|
427
|
-
if (data.t === K.Block)
|
|
428
|
-
row('rows', String(data.s.data.length - data.i));
|
|
429
|
-
detail.append(dl);
|
|
430
|
-
}
|
|
431
|
-
function pick(face) {
|
|
432
|
-
picked = face;
|
|
433
|
-
point(null);
|
|
434
|
-
refresh();
|
|
435
|
-
}
|
|
436
|
-
/** Draws the outline around a face, or hides it. */
|
|
437
|
-
function point(face) {
|
|
438
|
-
pointed = face;
|
|
439
|
-
placeOutline();
|
|
440
|
-
}
|
|
441
|
-
function placeOutline() {
|
|
442
|
-
const face = pointed ?? (state.open && state.tab === 'faces' ? picked : null);
|
|
443
|
-
const node = face !== null ? side.nodeOf(face) : null;
|
|
444
|
-
const r = node?.getBoundingClientRect();
|
|
445
|
-
if (r === undefined || (r.width === 0 && r.height === 0)) {
|
|
446
|
-
if (outline.matches(':popover-open'))
|
|
447
|
-
outline.hidePopover();
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
Object.assign(outline.style, { left: `${r.left}px`, top: `${r.top}px`, width: `${r.width}px`, height: `${r.height}px` });
|
|
451
|
-
outline.classList.toggle('tb-dev-pointed', pointed !== null);
|
|
452
|
-
// shown again so it stays above a dialog opened since
|
|
453
|
-
if (outline.matches(':popover-open'))
|
|
454
|
-
outline.hidePopover();
|
|
455
|
-
outline.showPopover();
|
|
456
|
-
}
|
|
457
|
-
function setPicking(on) {
|
|
458
|
-
picking = on;
|
|
459
|
-
pickButton.setAttribute('aria-pressed', String(on));
|
|
460
|
-
document.documentElement.classList.toggle('tb-dev-picking', on);
|
|
461
|
-
if (on)
|
|
462
|
-
openTab('faces');
|
|
463
|
-
else
|
|
464
|
-
point(null);
|
|
465
|
-
}
|
|
466
|
-
function pickTarget(ev) {
|
|
467
|
-
const t = ev.target;
|
|
468
|
-
if (!(t instanceof Element) || inDevtools(t) || t === opener)
|
|
469
|
-
return null;
|
|
470
|
-
return side.faceAt(t);
|
|
471
|
-
}
|
|
472
|
-
function pickMove(ev) {
|
|
473
|
-
if (!picking)
|
|
474
|
-
return;
|
|
475
|
-
const at = pickTarget(ev);
|
|
476
|
-
if (at !== null)
|
|
477
|
-
point(at.face);
|
|
478
|
-
}
|
|
479
|
-
function pickDown(ev) {
|
|
480
|
-
if (!picking || pickTarget(ev) === null)
|
|
481
|
-
return;
|
|
482
|
-
// the face does not get the press: no focus, no drag
|
|
483
|
-
ev.preventDefault();
|
|
484
|
-
ev.stopImmediatePropagation();
|
|
485
|
-
}
|
|
486
|
-
function pickClick(ev) {
|
|
487
|
-
if (!picking)
|
|
488
|
-
return;
|
|
489
|
-
const at = pickTarget(ev);
|
|
490
|
-
if (at === null)
|
|
491
|
-
return;
|
|
492
|
-
ev.preventDefault();
|
|
493
|
-
ev.stopImmediatePropagation();
|
|
494
|
-
setPicking(false);
|
|
495
|
-
pick(at.face);
|
|
496
|
-
}
|
|
497
|
-
// --- console -------------------------------------------------------------------------
|
|
498
|
-
// Load errors that mean "the input is not finished yet" (as in the trebol console).
|
|
499
|
-
const UNFINISHED = /: missing ([\])]|} to close (string|binary))$/;
|
|
500
|
-
function buildConsole(pane) {
|
|
501
|
-
consoleOut = el('div', 'tb-dev-out');
|
|
502
|
-
consoleOut.setAttribute('role', 'log');
|
|
503
|
-
consoleOut.setAttribute('aria-label', 'Console output');
|
|
504
|
-
consoleFace = el('div', 'tb-dev-face');
|
|
505
|
-
const row = el('div', 'tb-dev-prompt');
|
|
506
|
-
consoleIn = el('textarea', 'tb-dev-in');
|
|
507
|
-
consoleIn.rows = 1;
|
|
508
|
-
consoleIn.spellcheck = false;
|
|
509
|
-
consoleIn.setAttribute('aria-label', 'Trebol code to run');
|
|
510
|
-
consoleIn.placeholder = 'face/text: "Hello"';
|
|
511
|
-
consoleIn.addEventListener('keydown', consoleKey);
|
|
512
|
-
consoleIn.addEventListener('input', fitInput);
|
|
513
|
-
row.append(el('span', 'tb-dev-sign', '>>'), consoleIn);
|
|
514
|
-
row.addEventListener('click', () => consoleIn.focus());
|
|
515
|
-
pane.append(consoleOut, consoleFace, row);
|
|
516
|
-
}
|
|
517
|
-
function fitInput() {
|
|
518
|
-
consoleIn.style.height = 'auto';
|
|
519
|
-
consoleIn.style.height = `${Math.min(consoleIn.scrollHeight, 160)}px`;
|
|
520
|
-
}
|
|
521
|
-
function setInput(src) {
|
|
522
|
-
consoleIn.value = src;
|
|
523
|
-
fitInput();
|
|
524
|
-
consoleIn.setSelectionRange(src.length, src.length);
|
|
525
|
-
}
|
|
526
|
-
function consoleKey(ev) {
|
|
527
|
-
const src = consoleIn.value;
|
|
528
|
-
if (ev.key === 'Enter' && !ev.shiftKey) {
|
|
529
|
-
if (src.trim() === '' || unfinished(src))
|
|
530
|
-
return;
|
|
531
|
-
ev.preventDefault();
|
|
532
|
-
setInput('');
|
|
533
|
-
running = running.then(() => run(src));
|
|
534
|
-
}
|
|
535
|
-
else if (ev.key === 'ArrowUp' && !src.slice(0, consoleIn.selectionStart).includes('\n') && back < history.length) {
|
|
536
|
-
ev.preventDefault();
|
|
537
|
-
back++;
|
|
538
|
-
setInput(history[history.length - back]);
|
|
539
|
-
}
|
|
540
|
-
else if (ev.key === 'ArrowDown' && !src.slice(consoleIn.selectionEnd).includes('\n') && back > 0) {
|
|
541
|
-
ev.preventDefault();
|
|
542
|
-
back--;
|
|
543
|
-
setInput(back === 0 ? '' : history[history.length - back]);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
function unfinished(src) {
|
|
547
|
-
try {
|
|
548
|
-
load(src);
|
|
549
|
-
return false;
|
|
550
|
-
}
|
|
551
|
-
catch (e) {
|
|
552
|
-
return e instanceof LoadError && UNFINISHED.test(e.message);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
function say(kind, text) {
|
|
556
|
-
const line = el('pre', `tb-dev-said-${kind}`, text);
|
|
557
|
-
const end = consoleOut.scrollTop + consoleOut.clientHeight >= consoleOut.scrollHeight - 4;
|
|
558
|
-
consoleOut.append(line);
|
|
559
|
-
while (consoleOut.childElementCount > MAX_LOG)
|
|
560
|
-
consoleOut.firstElementChild.remove();
|
|
561
|
-
if (end)
|
|
562
|
-
consoleOut.scrollTop = consoleOut.scrollHeight;
|
|
563
|
-
}
|
|
564
|
-
/** Runs code typed in the console in the app's user context, `face` being the face picked. */
|
|
565
|
-
async function run(src) {
|
|
566
|
-
back = 0;
|
|
567
|
-
if (history[history.length - 1] !== src)
|
|
568
|
-
history.push(src);
|
|
569
|
-
history = history.slice(-MAX_HISTORY);
|
|
570
|
-
write(() => localStorage, HISTORY_KEY, { lines: history });
|
|
571
|
-
say('in', src.split('\n').map((l, i) => (i === 0 ? '>> ' : ' ') + l).join('\n'));
|
|
572
|
-
consoleOut.scrollTop = consoleOut.scrollHeight;
|
|
573
|
-
let code;
|
|
574
|
-
try {
|
|
575
|
-
code = load(src);
|
|
576
|
-
}
|
|
577
|
-
catch (e) {
|
|
578
|
-
say('error', `** Syntax error: ${e.message}`);
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
const rt = side.host.rt;
|
|
582
|
-
bindSeries(code.s, rt.user, true);
|
|
583
|
-
if (picked !== null)
|
|
584
|
-
bindSeries(code.s, { keys: [intern('face')], vals: [picked], parent: null });
|
|
585
|
-
try {
|
|
586
|
-
const v = await taskResult(spawn(side.host.sch, code.s, scriptStart(code).start));
|
|
587
|
-
if (v.t === K.Error)
|
|
588
|
-
say('error', form(v));
|
|
589
|
-
else if (v.t !== K.Unset)
|
|
590
|
-
say('value', `== ${moldShort(v)}`);
|
|
591
|
-
}
|
|
592
|
-
catch (e) {
|
|
593
|
-
say('error', report(e));
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
// --- log -----------------------------------------------------------------------------
|
|
597
|
-
function buildLog(pane) {
|
|
598
|
-
const bar = el('div', 'tb-dev-bar');
|
|
599
|
-
bar.append(button('tb-dev-button', 'Clear', () => {
|
|
600
|
-
logList.replaceChildren();
|
|
601
|
-
lastLog = null;
|
|
602
|
-
}));
|
|
603
|
-
logList = el('ol', 'tb-dev-entries');
|
|
604
|
-
logList.setAttribute('aria-label', 'What the app did');
|
|
605
|
-
pane.append(bar, logList);
|
|
606
|
-
}
|
|
607
|
-
/** Adds a line to the log; the same one again (typing in a field) counts instead of adding. */
|
|
608
|
-
function log(kind, text, key) {
|
|
609
|
-
if (key !== undefined && lastLog?.key === key && lastLog.li.isConnected) {
|
|
610
|
-
lastLog.count++;
|
|
611
|
-
lastLog.text.textContent = `${text} (×${lastLog.count})`;
|
|
612
|
-
return;
|
|
613
|
-
}
|
|
614
|
-
const li = el('li', `tb-dev-${kind}`);
|
|
615
|
-
const now = new Date();
|
|
616
|
-
const time = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;
|
|
617
|
-
const t = el('span', 'tb-dev-text', text);
|
|
618
|
-
li.append(el('time', undefined, time), el('span', 'tb-dev-kind', kind), t);
|
|
619
|
-
const end = logList.scrollTop + logList.clientHeight >= logList.scrollHeight - 4;
|
|
620
|
-
logList.append(li);
|
|
621
|
-
while (logList.childElementCount > MAX_LOG)
|
|
622
|
-
logList.firstElementChild.remove();
|
|
623
|
-
if (end)
|
|
624
|
-
logList.scrollTop = logList.scrollHeight;
|
|
625
|
-
lastLog = key !== undefined ? { key, li, text: t, count: 1 } : null;
|
|
626
|
-
}
|
package/dist/lib/host/fonts.js
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// unicode-range of each face). They come from @fontsource-variable/inter
|
|
4
4
|
// 5.3.0, under the SIL Open Font License (fonts/OFL.txt).
|
|
5
5
|
//
|
|
6
|
-
// trebol.js declares them with addresses next to itself
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// trebol.js declares them, with addresses next to itself, in a constructed
|
|
7
|
+
// style sheet (a strict Content-Security-Policy drops a <style> made by
|
|
8
|
+
// script); a page made by `trebol build` carries the files inside and declares
|
|
9
|
+
// them in its own <style data-tb-fonts>, which the host then leaves alone.
|
|
9
10
|
// The order of @fontsource: where ranges overlap, the last face declared wins.
|
|
10
11
|
export const INTER = [
|
|
11
12
|
{ file: 'inter-cyrillic-ext.woff2', range: 'U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F' },
|
package/dist/lib/host/icons.js
CHANGED
|
@@ -40,6 +40,9 @@ const PATHS = {
|
|
|
40
40
|
truck: 'M2 6h12v11H2zM14 10h4l4 4v3h-8zM6.5 15a2 2 0 1 0 0 4a2 2 0 1 0 0-4zM17.5 15a2 2 0 1 0 0 4a2 2 0 1 0 0-4z',
|
|
41
41
|
box: 'M12 3l8 4.5v9L12 21l-8-4.5v-9zM4 7.5l8 4.5 8-4.5M12 12v9',
|
|
42
42
|
file: 'M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 16h6',
|
|
43
|
+
invoice: 'M6 3h12v18l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5-2 1.5zM9 8h6M9 12h6M9 16h3',
|
|
44
|
+
template: 'M4 4h16v5H4zM4 13h7v7H4zM15 13h5M15 17h5',
|
|
45
|
+
stack: 'M12 3l9 4.5-9 4.5-9-4.5zM3 12l9 4.5 9-4.5M3 16.5l9 4.5 9-4.5',
|
|
43
46
|
image: 'M4 5h16v14H4zM4 16l5-5 4 4 2-2 5 5M15 8.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 1 0 0-3z',
|
|
44
47
|
settings: 'M4 7h10M18 7h2M4 17h4M12 17h8M16 5v4M10 15v4',
|
|
45
48
|
filter: 'M4 5h16l-6 8v6l-4-2v-4L4 5z',
|
|
@@ -50,6 +53,7 @@ const PATHS = {
|
|
|
50
53
|
eye: 'M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12zM12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z',
|
|
51
54
|
lock: 'M5 11h14v10H5zM8 11V7a4 4 0 0 1 8 0v4',
|
|
52
55
|
calendar: 'M4 6h16v15H4zM4 10h16M8 3v4M16 3v4',
|
|
56
|
+
clock: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18zM12 7v5l3 2',
|
|
53
57
|
star: 'M12 3l2.8 5.8 6.2.9-4.5 4.4 1 6.3L12 17.5l-5.5 2.9 1-6.3L3 9.7l6.2-.9L12 3z',
|
|
54
58
|
heart: 'M12 20s-8-5-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 9c0 6-8 11-8 11z',
|
|
55
59
|
type: 'M5 7V4h14v3M12 4v16M9 20h6',
|
package/dist/lib/host/index.d.ts
CHANGED
|
@@ -2,14 +2,16 @@ import './natives.ts';
|
|
|
2
2
|
import './net.ts';
|
|
3
3
|
import './page.ts';
|
|
4
4
|
import './compress.ts';
|
|
5
|
+
import './share.ts';
|
|
5
6
|
import './locale.ts';
|
|
6
7
|
import { type Loader } from './modules.ts';
|
|
7
8
|
import { type Cell, type ObjectCell, type Runtime } from '../core/index.ts';
|
|
8
9
|
import { type Scheduler } from './scheduler.ts';
|
|
9
10
|
export { output } from './natives.ts';
|
|
10
11
|
export { fileHandle } from './net.ts';
|
|
12
|
+
export { setShareEnv, type ShareEnv, type ChannelLike, type LocksLike, type Envelope } from './share.ts';
|
|
11
13
|
export { page } from './page.ts';
|
|
12
|
-
export { mapAt, formatLocal, activeLanguage, shown, translate, uiText, editLocal, readLocal, readDate, weekStart, fileSize, LOCAL_KINDS } from './locale.ts';
|
|
14
|
+
export { mapAt, formatLocal, activeLanguage, shown, translate, uiText, editLocal, readLocal, readDate, readRange, readTime, weekStart, fileSize, LOCAL_KINDS, amountOf, countStep } from './locale.ts';
|
|
13
15
|
export type { Loader } from './modules.ts';
|
|
14
16
|
export * from './scheduler.ts';
|
|
15
17
|
export interface Host {
|