@johnoscott/isometric-engine 0.0.0-stage → 0.10.1
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/EDITOR-GUIDE.md +355 -0
- package/LICENSE +21 -0
- package/LICENSES/ajv.txt +22 -0
- package/LICENSES/lucide-static.txt +43 -0
- package/LICENSES/yaml.txt +13 -0
- package/README.md +62 -2
- package/assets/app.css +269 -0
- package/assets/default-theme.yaml +99 -0
- package/assets/icons.svg +1 -0
- package/assets/marks.css +39 -0
- package/assets/skin.css +181 -0
- package/iso-editor.d.ts +4 -0
- package/iso-editor.js +550 -0
- package/iso-render.d.ts +3 -0
- package/iso-render.js +388 -0
- package/iso-systems.d.ts +4 -0
- package/iso-systems.js +389 -0
- package/js/iso-core/compile-schema.js +22 -0
- package/js/iso-core/depth.js +55 -0
- package/js/iso-core/errors.js +65 -0
- package/js/iso-core/glyphs.js +100 -0
- package/js/iso-core/index.js +55 -0
- package/js/iso-core/kernel.js +158 -0
- package/js/iso-core/metrics.json +1 -0
- package/js/iso-core/package.json +6 -0
- package/js/iso-core/parse.js +79 -0
- package/js/iso-core/schema-errors.js +170 -0
- package/js/iso-core/shims/crypto.js +125 -0
- package/js/iso-core/shims/path.js +49 -0
- package/js/iso-core/svg-dom.js +144 -0
- package/js/iso-core/theme.js +48 -0
- package/js/iso-core/vdom.js +48 -0
- package/js/iso-editor/adapter.js +0 -0
- package/js/iso-editor/clipboard.js +152 -0
- package/js/iso-editor/commands.js +173 -0
- package/js/iso-editor/complete.js +55 -0
- package/js/iso-editor/doc.js +182 -0
- package/js/iso-editor/index.js +105 -0
- package/js/iso-editor/model.js +210 -0
- package/js/iso-editor/outline.js +111 -0
- package/js/iso-editor/package.json +6 -0
- package/js/iso-editor/path.js +19 -0
- package/js/iso-editor/providers.js +96 -0
- package/js/iso-editor/schema-nav.js +117 -0
- package/js/iso-editor/splice.js +443 -0
- package/js/iso-editor/storage-keys.js +6 -0
- package/js/iso-editor/ui/actions.js +116 -0
- package/js/iso-editor/ui/canvas-layer.js +0 -0
- package/js/iso-editor/ui/canvas.js +1403 -0
- package/js/iso-editor/ui/clip.js +133 -0
- package/js/iso-editor/ui/dialog.js +26 -0
- package/js/iso-editor/ui/flat-canvas.js +54 -0
- package/js/iso-editor/ui/icons.js +15 -0
- package/js/iso-editor/ui/keys.js +26 -0
- package/js/iso-editor/ui/later.js +28 -0
- package/js/iso-editor/ui/layer.js +11 -0
- package/js/iso-editor/ui/menu.js +105 -0
- package/js/iso-editor/ui/monaco-entry.js +2 -0
- package/js/iso-editor/ui/mount-kit.js +0 -0
- package/js/iso-editor/ui/mount.js +767 -0
- package/js/iso-editor/ui/pane.js +0 -0
- package/js/iso-editor/ui/part.js +0 -0
- package/js/iso-editor/ui/plain-icons.js +34 -0
- package/js/iso-editor/ui/props.js +314 -0
- package/js/iso-editor/ui/scope-css.js +81 -0
- package/js/iso-editor/ui/setup.js +149 -0
- package/js/iso-editor/ui/text.js +323 -0
- package/js/iso-editor/ui/tree.js +728 -0
- package/js/iso-editor/validate.js +33 -0
- package/js/iso-editor/window/protocol.js +8 -0
- package/js/iso-objects/assemble.js +43 -0
- package/js/iso-objects/assets.js +88 -0
- package/js/iso-objects/board.js +162 -0
- package/js/iso-objects/compile.js +60 -0
- package/js/iso-objects/css.js +154 -0
- package/js/iso-objects/flat.js +696 -0
- package/js/iso-objects/focus.js +16 -0
- package/js/iso-objects/geometry.js +76 -0
- package/js/iso-objects/index.js +93 -0
- package/js/iso-objects/kinds.js +12 -0
- package/js/iso-objects/labels.js +325 -0
- package/js/iso-objects/package.json +6 -0
- package/js/iso-objects/place.js +347 -0
- package/js/iso-objects/route.js +461 -0
- package/js/iso-objects/scene.js +350 -0
- package/js/iso-objects/steps.js +246 -0
- package/js/iso-objects/types.js +0 -0
- package/js/iso-systems/catalog.js +42 -0
- package/js/iso-systems/compile.js +34 -0
- package/js/iso-systems/css.js +8 -0
- package/js/iso-systems/index.js +16 -0
- package/js/iso-systems/nodes.js +124 -0
- package/js/iso-systems/package.json +6 -0
- package/js/iso-systems/schema.json +311 -0
- package/js/iso-systems/validate.js +35 -0
- package/js/iso-viewer/bundle.js +20 -0
- package/js/iso-viewer/card-motion.js +228 -0
- package/js/iso-viewer/dom.js +14 -0
- package/js/iso-viewer/dual-view.js +212 -0
- package/js/iso-viewer/flat-view.js +124 -0
- package/js/iso-viewer/history.js +990 -0
- package/js/iso-viewer/index.js +98 -0
- package/js/iso-viewer/morph.js +192 -0
- package/js/iso-viewer/overlay.js +199 -0
- package/js/iso-viewer/package.json +6 -0
- package/js/iso-viewer/page.js +138 -0
- package/js/iso-viewer/player.js +409 -0
- package/js/iso-viewer/still.js +81 -0
- package/js/iso-viewer/timeline-contract.js +14 -0
- package/js/iso-viewer/timeline-engine.js +475 -0
- package/js/iso-viewer/timeline-export.js +36 -0
- package/js/iso-viewer/timeline-scale.js +116 -0
- package/js/iso-viewer/timeline-scope.js +58 -0
- package/js/iso-viewer/timeline-search.js +216 -0
- package/js/iso-viewer/timeline-time.js +55 -0
- package/js/iso-viewer/view-css.js +68 -0
- package/js/iso-viewer/viewport.js +177 -0
- package/package.json +511 -4
- package/src/iso-core/compile-schema.ts +23 -0
- package/src/iso-core/depth.ts +56 -0
- package/src/iso-core/errors.ts +73 -0
- package/src/iso-core/glyphs.ts +108 -0
- package/src/iso-core/index.ts +27 -0
- package/src/iso-core/kernel.ts +163 -0
- package/src/iso-core/metrics.json +1 -0
- package/src/iso-core/package.json +6 -0
- package/src/iso-core/parse.ts +91 -0
- package/src/iso-core/schema-errors.ts +163 -0
- package/src/iso-core/shims/crypto.ts +37 -0
- package/src/iso-core/shims/path.ts +24 -0
- package/src/iso-core/svg-dom.ts +103 -0
- package/src/iso-core/theme.ts +64 -0
- package/src/iso-core/vdom.ts +41 -0
- package/src/iso-editor/adapter.ts +147 -0
- package/src/iso-editor/clipboard.ts +163 -0
- package/src/iso-editor/commands.ts +191 -0
- package/src/iso-editor/complete.ts +73 -0
- package/src/iso-editor/doc.ts +207 -0
- package/src/iso-editor/index.ts +67 -0
- package/src/iso-editor/model.ts +234 -0
- package/src/iso-editor/outline.ts +126 -0
- package/src/iso-editor/package.json +6 -0
- package/src/iso-editor/path.ts +18 -0
- package/src/iso-editor/providers.ts +113 -0
- package/src/iso-editor/schema-nav.ts +129 -0
- package/src/iso-editor/splice.ts +477 -0
- package/src/iso-editor/storage-keys.ts +6 -0
- package/src/iso-editor/ui/actions.ts +119 -0
- package/src/iso-editor/ui/app.css +230 -0
- package/src/iso-editor/ui/canvas-layer.ts +56 -0
- package/src/iso-editor/ui/canvas.ts +1227 -0
- package/src/iso-editor/ui/clip.ts +97 -0
- package/src/iso-editor/ui/dialog.ts +25 -0
- package/src/iso-editor/ui/flat-canvas.ts +51 -0
- package/src/iso-editor/ui/icons.ts +21 -0
- package/src/iso-editor/ui/keys.ts +30 -0
- package/src/iso-editor/ui/later.ts +22 -0
- package/src/iso-editor/ui/layer.ts +7 -0
- package/src/iso-editor/ui/marks.css +39 -0
- package/src/iso-editor/ui/menu.ts +67 -0
- package/src/iso-editor/ui/monaco-entry.ts +6 -0
- package/src/iso-editor/ui/mount-kit.ts +35 -0
- package/src/iso-editor/ui/mount.ts +684 -0
- package/src/iso-editor/ui/pane.ts +45 -0
- package/src/iso-editor/ui/part.ts +45 -0
- package/src/iso-editor/ui/plain-icons.ts +83 -0
- package/src/iso-editor/ui/props.ts +347 -0
- package/src/iso-editor/ui/scope-css.ts +65 -0
- package/src/iso-editor/ui/setup.ts +153 -0
- package/src/iso-editor/ui/skin.css +181 -0
- package/src/iso-editor/ui/text.ts +262 -0
- package/src/iso-editor/ui/tree.ts +657 -0
- package/src/iso-editor/validate.ts +62 -0
- package/src/iso-editor/window/protocol.ts +33 -0
- package/src/iso-objects/assemble.ts +57 -0
- package/src/iso-objects/assets.ts +122 -0
- package/src/iso-objects/board.ts +169 -0
- package/src/iso-objects/compile.ts +76 -0
- package/src/iso-objects/css.ts +163 -0
- package/src/iso-objects/flat.ts +653 -0
- package/src/iso-objects/focus.ts +14 -0
- package/src/iso-objects/geometry.ts +86 -0
- package/src/iso-objects/index.ts +33 -0
- package/src/iso-objects/kinds.ts +56 -0
- package/src/iso-objects/labels.ts +310 -0
- package/src/iso-objects/package.json +6 -0
- package/src/iso-objects/place.ts +318 -0
- package/src/iso-objects/route.ts +444 -0
- package/src/iso-objects/scene.ts +376 -0
- package/src/iso-objects/steps.ts +234 -0
- package/src/iso-objects/types.ts +68 -0
- package/src/iso-systems/catalog.ts +31 -0
- package/src/iso-systems/compile.ts +39 -0
- package/src/iso-systems/css.ts +9 -0
- package/src/iso-systems/index.ts +12 -0
- package/src/iso-systems/nodes.ts +126 -0
- package/src/iso-systems/package.json +6 -0
- package/src/iso-systems/schema.json +311 -0
- package/src/iso-systems/validate.ts +34 -0
- package/src/iso-viewer/bundle.ts +15 -0
- package/src/iso-viewer/card-motion.ts +237 -0
- package/src/iso-viewer/dom.ts +13 -0
- package/src/iso-viewer/dual-view.ts +212 -0
- package/src/iso-viewer/flat-view.ts +127 -0
- package/src/iso-viewer/history.ts +781 -0
- package/src/iso-viewer/index.ts +40 -0
- package/src/iso-viewer/morph.ts +191 -0
- package/src/iso-viewer/overlay.ts +212 -0
- package/src/iso-viewer/package.json +6 -0
- package/src/iso-viewer/page.ts +150 -0
- package/src/iso-viewer/player.ts +321 -0
- package/src/iso-viewer/still.ts +74 -0
- package/src/iso-viewer/timeline-contract.ts +342 -0
- package/src/iso-viewer/timeline-engine.ts +420 -0
- package/src/iso-viewer/timeline-export.ts +31 -0
- package/src/iso-viewer/timeline-scale.ts +129 -0
- package/src/iso-viewer/timeline-scope.ts +56 -0
- package/src/iso-viewer/timeline-search.ts +198 -0
- package/src/iso-viewer/timeline-time.ts +54 -0
- package/src/iso-viewer/view-css.ts +59 -0
- package/src/iso-viewer/viewport.ts +142 -0
- package/types/iso-core/compile-schema.d.ts +11 -0
- package/types/iso-core/depth.d.ts +6 -0
- package/types/iso-core/errors.d.ts +24 -0
- package/types/iso-core/glyphs.d.ts +19 -0
- package/types/iso-core/index.d.ts +17 -0
- package/types/iso-core/kernel.d.ts +130 -0
- package/types/iso-core/metrics.json +1 -0
- package/types/iso-core/parse.d.ts +18 -0
- package/types/iso-core/schema-errors.d.ts +14 -0
- package/types/iso-core/shims/crypto.d.ts +9 -0
- package/types/iso-core/svg-dom.d.ts +15 -0
- package/types/iso-core/theme.d.ts +38 -0
- package/types/iso-core/vdom.d.ts +26 -0
- package/types/iso-editor/adapter.d.ts +178 -0
- package/types/iso-editor/clipboard.d.ts +23 -0
- package/types/iso-editor/commands.d.ts +32 -0
- package/types/iso-editor/complete.d.ts +25 -0
- package/types/iso-editor/doc.d.ts +50 -0
- package/types/iso-editor/index.d.ts +57 -0
- package/types/iso-editor/model.d.ts +96 -0
- package/types/iso-editor/outline.d.ts +28 -0
- package/types/iso-editor/path.d.ts +7 -0
- package/types/iso-editor/providers.d.ts +43 -0
- package/types/iso-editor/schema-nav.d.ts +34 -0
- package/types/iso-editor/splice.d.ts +53 -0
- package/types/iso-editor/storage-keys.d.ts +5 -0
- package/types/iso-editor/ui/actions.d.ts +23 -0
- package/types/iso-editor/ui/canvas-layer.d.ts +65 -0
- package/types/iso-editor/ui/canvas.d.ts +307 -0
- package/types/iso-editor/ui/clip.d.ts +14 -0
- package/types/iso-editor/ui/dialog.d.ts +7 -0
- package/types/iso-editor/ui/flat-canvas.d.ts +2 -0
- package/types/iso-editor/ui/icons.d.ts +5 -0
- package/types/iso-editor/ui/keys.d.ts +7 -0
- package/types/iso-editor/ui/later.d.ts +12 -0
- package/types/iso-editor/ui/layer.d.ts +2 -0
- package/types/iso-editor/ui/menu.d.ts +21 -0
- package/types/iso-editor/ui/mount-kit.d.ts +31 -0
- package/types/iso-editor/ui/mount.d.ts +146 -0
- package/types/iso-editor/ui/pane.d.ts +60 -0
- package/types/iso-editor/ui/part.d.ts +40 -0
- package/types/iso-editor/ui/plain-icons.d.ts +10 -0
- package/types/iso-editor/ui/props.d.ts +57 -0
- package/types/iso-editor/ui/scope-css.d.ts +5 -0
- package/types/iso-editor/ui/setup.d.ts +49 -0
- package/types/iso-editor/ui/text.d.ts +19 -0
- package/types/iso-editor/ui/tree.d.ts +100 -0
- package/types/iso-editor/validate.d.ts +36 -0
- package/types/iso-editor/window/protocol.d.ts +60 -0
- package/types/iso-objects/assemble.d.ts +35 -0
- package/types/iso-objects/assets.d.ts +49 -0
- package/types/iso-objects/board.d.ts +36 -0
- package/types/iso-objects/compile.d.ts +35 -0
- package/types/iso-objects/css.d.ts +16 -0
- package/types/iso-objects/flat.d.ts +130 -0
- package/types/iso-objects/focus.d.ts +1 -0
- package/types/iso-objects/geometry.d.ts +59 -0
- package/types/iso-objects/index.d.ts +26 -0
- package/types/iso-objects/kinds.d.ts +53 -0
- package/types/iso-objects/labels.d.ts +92 -0
- package/types/iso-objects/place.d.ts +25 -0
- package/types/iso-objects/route.d.ts +67 -0
- package/types/iso-objects/scene.d.ts +63 -0
- package/types/iso-objects/steps.d.ts +90 -0
- package/types/iso-objects/types.d.ts +140 -0
- package/types/iso-systems/catalog.d.ts +4 -0
- package/types/iso-systems/compile.d.ts +6 -0
- package/types/iso-systems/css.d.ts +3 -0
- package/types/iso-systems/index.d.ts +5 -0
- package/types/iso-systems/nodes.d.ts +3 -0
- package/types/iso-viewer/card-motion.d.ts +56 -0
- package/types/iso-viewer/dom.d.ts +1 -0
- package/types/iso-viewer/dual-view.d.ts +44 -0
- package/types/iso-viewer/flat-view.d.ts +25 -0
- package/types/iso-viewer/history.d.ts +91 -0
- package/types/iso-viewer/index.d.ts +31 -0
- package/types/iso-viewer/morph.d.ts +28 -0
- package/types/iso-viewer/overlay.d.ts +135 -0
- package/types/iso-viewer/page.d.ts +13 -0
- package/types/iso-viewer/still.d.ts +26 -0
- package/types/iso-viewer/timeline-contract.d.ts +345 -0
- package/types/iso-viewer/timeline-engine.d.ts +20 -0
- package/types/iso-viewer/timeline-export.d.ts +5 -0
- package/types/iso-viewer/timeline-scale.d.ts +44 -0
- package/types/iso-viewer/timeline-scope.d.ts +33 -0
- package/types/iso-viewer/timeline-search.d.ts +52 -0
- package/types/iso-viewer/timeline-time.d.ts +8 -0
- package/types/iso-viewer/view-css.d.ts +7 -0
- package/types/iso-viewer/viewport.d.ts +50 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Ajv2020Mod from "ajv/dist/2020.js";
|
|
2
|
+
const Ajv2020 = Ajv2020Mod.default ?? Ajv2020Mod;
|
|
3
|
+
const AJV_OPTIONS = { allErrors: true, verbose: true, strict: false };
|
|
4
|
+
const ajv = new Ajv2020(AJV_OPTIONS);
|
|
5
|
+
function compileSchema(schema) {
|
|
6
|
+
return ajv.compile(schema);
|
|
7
|
+
}
|
|
8
|
+
function fingerprint(schema) {
|
|
9
|
+
const t = JSON.stringify(schema);
|
|
10
|
+
let h = 2166136261;
|
|
11
|
+
for (let i = 0; i < t.length; i++) {
|
|
12
|
+
h ^= t.charCodeAt(i);
|
|
13
|
+
h = Math.imul(h, 16777619) >>> 0;
|
|
14
|
+
}
|
|
15
|
+
return h.toString(16) + ":" + t.length;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
AJV_OPTIONS,
|
|
19
|
+
Ajv2020,
|
|
20
|
+
compileSchema,
|
|
21
|
+
fingerprint
|
|
22
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { iso } from "./kernel.js";
|
|
2
|
+
function screenRect(b) {
|
|
3
|
+
const pts = [iso(b.x0, b.y0, b.z1), iso(b.x1, b.y0, b.z0), iso(b.x0, b.y1, b.z0), iso(b.x1, b.y1, b.z0), iso(b.x1, b.y1, b.z1), iso(b.x0, b.y0, b.z0)];
|
|
4
|
+
const xs = pts.map((p) => p[0]), ys = pts.map((p) => p[1]);
|
|
5
|
+
return [Math.min(...xs), Math.min(...ys), Math.max(...xs), Math.max(...ys)];
|
|
6
|
+
}
|
|
7
|
+
function behind(a, b) {
|
|
8
|
+
const e = 1e-6;
|
|
9
|
+
const ax = a.x1 <= b.x0 + e, bx = b.x1 <= a.x0 + e;
|
|
10
|
+
const ay = a.y1 <= b.y0 + e, by = b.y1 <= a.y0 + e;
|
|
11
|
+
const az = a.z1 <= b.z0 + e, bz = b.z1 <= a.z0 + e;
|
|
12
|
+
const aFirst = ax || ay || az, bFirst = bx || by || bz;
|
|
13
|
+
if (aFirst && !bFirst) return -1;
|
|
14
|
+
if (bFirst && !aFirst) return 1;
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
function depthSort(list) {
|
|
18
|
+
const n = list.length;
|
|
19
|
+
const rects = list.map((d) => screenRect(d.box));
|
|
20
|
+
const prio = (d) => d.box.x0 + d.box.y0 + d.box.z0 * 0.01;
|
|
21
|
+
const after = list.map(() => []);
|
|
22
|
+
const indeg = new Array(n).fill(0);
|
|
23
|
+
for (let i = 0; i < n; i++) for (let j = i + 1; j < n; j++) {
|
|
24
|
+
const ri = rects[i], rj = rects[j];
|
|
25
|
+
if (ri[2] <= rj[0] || rj[2] <= ri[0] || ri[3] <= rj[1] || rj[3] <= ri[1]) continue;
|
|
26
|
+
const c = behind(list[i].box, list[j].box);
|
|
27
|
+
if (c < 0) {
|
|
28
|
+
after[i].push(j);
|
|
29
|
+
indeg[j]++;
|
|
30
|
+
} else if (c > 0) {
|
|
31
|
+
after[j].push(i);
|
|
32
|
+
indeg[i]++;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const out = [];
|
|
36
|
+
const ready = list.map((_, i) => i).filter((i) => !indeg[i]);
|
|
37
|
+
const used = new Array(n).fill(false);
|
|
38
|
+
while (out.length < n) {
|
|
39
|
+
if (!ready.length) {
|
|
40
|
+
const rest = list.map((_, i2) => i2).filter((i2) => !used[i2]).sort((x, y) => prio(list[x]) - prio(list[y]));
|
|
41
|
+
ready.push(rest[0]);
|
|
42
|
+
indeg[rest[0]] = 0;
|
|
43
|
+
}
|
|
44
|
+
ready.sort((x, y) => prio(list[x]) - prio(list[y]) || x - y);
|
|
45
|
+
const i = ready.shift();
|
|
46
|
+
if (used[i]) continue;
|
|
47
|
+
used[i] = true;
|
|
48
|
+
out.push(list[i]);
|
|
49
|
+
for (const j of after[i]) if (!used[j] && --indeg[j] === 0) ready.push(j);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
depthSort
|
|
55
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
class DiagError extends Error {
|
|
2
|
+
diags;
|
|
3
|
+
constructor(diags) {
|
|
4
|
+
super(diags.map((d) => `${d.line}:${d.col} ${d.message}`).join("\n"));
|
|
5
|
+
this.diags = diags;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function distance(a, b) {
|
|
9
|
+
const m = a.length, n = b.length;
|
|
10
|
+
if (!m) return n;
|
|
11
|
+
if (!n) return m;
|
|
12
|
+
const d = Array.from({ length: m + 1 }, (_, i) => [i, ...Array(n).fill(0)]);
|
|
13
|
+
for (let j = 0; j <= n; j++) d[0][j] = j;
|
|
14
|
+
for (let i = 1; i <= m; i++) {
|
|
15
|
+
for (let j = 1; j <= n; j++) {
|
|
16
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
17
|
+
d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
|
|
18
|
+
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return d[m][n];
|
|
22
|
+
}
|
|
23
|
+
function didYouMean(word, candidates) {
|
|
24
|
+
let best, bd = Infinity;
|
|
25
|
+
const w = word.toLowerCase();
|
|
26
|
+
for (const c of candidates) {
|
|
27
|
+
const d = distance(w, c.toLowerCase());
|
|
28
|
+
if (d < bd) {
|
|
29
|
+
bd = d;
|
|
30
|
+
best = c;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (best === void 0) return void 0;
|
|
34
|
+
const limit = Math.max(1, Math.min(3, Math.floor(Math.max(word.length, best.length) / 3)));
|
|
35
|
+
return bd <= limit ? best : void 0;
|
|
36
|
+
}
|
|
37
|
+
function formatDiag(d, file, source) {
|
|
38
|
+
if (d.file) {
|
|
39
|
+
file = d.file;
|
|
40
|
+
source = d.source;
|
|
41
|
+
}
|
|
42
|
+
const where = d.line ? `${file}:${d.line}:${d.col}` : file;
|
|
43
|
+
let out = `${where} ${d.severity}: ${d.message}`;
|
|
44
|
+
if (d.hint) out += `
|
|
45
|
+
${d.hint}`;
|
|
46
|
+
if (source && d.line) {
|
|
47
|
+
const lines = source.split(/\r?\n/);
|
|
48
|
+
const text = lines[d.line - 1] ?? "";
|
|
49
|
+
const gutter = String(d.line).padStart(4);
|
|
50
|
+
out += `
|
|
51
|
+
${gutter} | ${text}
|
|
52
|
+
${" ".repeat(gutter.length)} | ${" ".repeat(Math.max(0, d.col - 1))}^`;
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
function formatDiags(diags, file, source) {
|
|
57
|
+
return diags.map((d) => formatDiag(d, file, source)).join("\n\n");
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
DiagError,
|
|
61
|
+
didYouMean,
|
|
62
|
+
distance,
|
|
63
|
+
formatDiag,
|
|
64
|
+
formatDiags
|
|
65
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { tag, n1 } from "./kernel.js";
|
|
2
|
+
function termLines(k, b, n) {
|
|
3
|
+
let s = "";
|
|
4
|
+
for (let i = 0; i < n; i++) {
|
|
5
|
+
const z = b.z1 - (b.z1 - b.z0) * (0.28 + i * 0.2);
|
|
6
|
+
const len = (b.x1 - b.x0) * (i === n - 1 ? 0.35 : 0.62 - i * 0.1);
|
|
7
|
+
s += k.line3([b.x0 + 0.35, b.y1, z], [b.x0 + 0.35 + len, b.y1, z], "det");
|
|
8
|
+
}
|
|
9
|
+
return s;
|
|
10
|
+
}
|
|
11
|
+
function envelope(k, b) {
|
|
12
|
+
const m = 0.55, z = b.z1;
|
|
13
|
+
const a = [b.x0 + m, b.y0 + m, z], bb = [b.x1 - m, b.y0 + m, z], c = [b.x1 - m, b.y1 - m, z], d = [b.x0 + m, b.y1 - m, z];
|
|
14
|
+
const mid = [(b.x0 + b.x1) / 2, (b.y0 + b.y1) / 2, z];
|
|
15
|
+
return k.poly([a, bb, c, d], "det") + k.line3(a, mid, "det") + k.line3(mid, bb, "det");
|
|
16
|
+
}
|
|
17
|
+
function bubble(k, b) {
|
|
18
|
+
const m = 0.55, z = b.z1;
|
|
19
|
+
let s = k.poly([[b.x0 + m, b.y0 + m, z], [b.x1 - m, b.y0 + m, z], [b.x1 - m, b.y1 - m, z], [b.x0 + m, b.y1 - m, z]], "det");
|
|
20
|
+
for (let i = 1; i <= 2; i++) {
|
|
21
|
+
const y = b.y0 + m + (b.y1 - b.y0 - 2 * m) * i / 3;
|
|
22
|
+
s += k.line3([b.x0 + m + 0.3, y, z], [b.x1 - m - 0.3 - (i === 2 ? 0.5 : 0), y, z], "det");
|
|
23
|
+
}
|
|
24
|
+
return s;
|
|
25
|
+
}
|
|
26
|
+
function fileLines(k, b) {
|
|
27
|
+
const m = 0.3, z = b.z1, ym = (b.y0 + b.y1) / 2;
|
|
28
|
+
return k.line3([b.x0 + m, ym - 0.2, z], [b.x1 - m, ym - 0.2, z], "det") + k.line3([b.x0 + m, ym + 0.2, z], [b.x1 - m - 0.3, ym + 0.2, z], "det");
|
|
29
|
+
}
|
|
30
|
+
function keyGlyph(k, b) {
|
|
31
|
+
const cx = (b.x0 + b.x1) / 2, cy = (b.y0 + b.y1) / 2, z = b.z1 + 5e-3, r = Math.min(b.x1 - b.x0, b.y1 - b.y0) * 0.16;
|
|
32
|
+
const ring = [];
|
|
33
|
+
for (let i = 0; i < 20; i++) {
|
|
34
|
+
const a = i / 20 * Math.PI * 2;
|
|
35
|
+
ring.push([cx - r * 1.4 + Math.cos(a) * r, cy + Math.sin(a) * r, z]);
|
|
36
|
+
}
|
|
37
|
+
return k.poly(ring, "det") + k.line3([cx - r * 0.4, cy, z], [cx + r * 2.2, cy, z], "det") + k.line3([cx + r * 1.7, cy, z], [cx + r * 1.7, cy + r * 0.8, z], "det");
|
|
38
|
+
}
|
|
39
|
+
function socketGlyph(k, b) {
|
|
40
|
+
const cx = (b.x0 + b.x1) / 2, cy = (b.y0 + b.y1) / 2, z = b.z1 + 5e-3, r = Math.min(b.x1 - b.x0, b.y1 - b.y0) * 0.28;
|
|
41
|
+
const ring = [];
|
|
42
|
+
for (let i = 0; i < 24; i++) {
|
|
43
|
+
const a = i / 24 * Math.PI * 2;
|
|
44
|
+
ring.push([cx + Math.cos(a) * r, cy + Math.sin(a) * r, z]);
|
|
45
|
+
}
|
|
46
|
+
return k.poly(ring, "det sock-hole");
|
|
47
|
+
}
|
|
48
|
+
const rect = (cls, x, y, w, h, rx = 0) => tag("rect", { class: cls, x, y, width: w, height: h, rx: rx || void 0 });
|
|
49
|
+
const screenFaces = {
|
|
50
|
+
terminal(w, h) {
|
|
51
|
+
let s = "";
|
|
52
|
+
const rows = Math.max(2, Math.floor((h - 12) / 9));
|
|
53
|
+
for (let i = 0; i < rows; i++) {
|
|
54
|
+
const y = 10 + i * 9, len = (w - 18) * [0.7, 0.45, 0.6, 0.3, 0.55][i % 5];
|
|
55
|
+
s += tag("line", { class: "ln", x1: 8, y1: y, x2: 8 + len, y2: y });
|
|
56
|
+
}
|
|
57
|
+
return s;
|
|
58
|
+
},
|
|
59
|
+
chat(w, h) {
|
|
60
|
+
const rows = [[6, 0.62, "w"], [0.3, 0.58, "m"], [6, 0.46, "w"], [0.42, 0.5, "m"]];
|
|
61
|
+
return rows.map((r, i) => {
|
|
62
|
+
const bw = (w - 14) * r[1], x = r[0] === 6 ? 7 : w - 7 - bw;
|
|
63
|
+
return rect(r[2], x, 8 + i * (h - 18) / 4, bw, (h - 18) / 4 - 4, 3);
|
|
64
|
+
}).join("");
|
|
65
|
+
},
|
|
66
|
+
desktop(w, h) {
|
|
67
|
+
return rect("wall", 5, 5, w - 10, h - 10, 2) + rect("bar", 5, 5, w - 10, 6) + rect("win", w * 0.5, 13, w * 0.38, h * 0.42, 2);
|
|
68
|
+
},
|
|
69
|
+
/** a tiled grid of terminals: a dashboard of sessions */
|
|
70
|
+
tiles(w, h) {
|
|
71
|
+
const m = 6, gap = 2.5, cols = 3, rows = 2, tw = (w - 2 * m - gap * (cols - 1)) / cols, th = (h - 2 * m - gap * (rows - 1)) / rows;
|
|
72
|
+
let s = "";
|
|
73
|
+
for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
|
|
74
|
+
const x = m + c * (tw + gap), y = m + r * (th + gap);
|
|
75
|
+
s += rect("t", x, y, tw, th, 1.5);
|
|
76
|
+
[0.3, 0.52, 0.74].forEach((k, i) => {
|
|
77
|
+
s += tag("line", { class: "ln", x1: x + 2.5, y1: y + th * k, x2: x + 2.5 + (tw - 5) * [0.8, 0.5, 0.65][(i + r + c) % 3], y2: y + th * k });
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return s;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
function placeholderFace(w, h) {
|
|
84
|
+
const cx = w / 2, cy = h / 2, r = Math.min(w, h) * 0.22;
|
|
85
|
+
return rect("unk", w * 0.2, h * 0.2, w * 0.6, h * 0.6, 2) + tag("path", { class: "unk-q", d: `M${n1(cx - r * 0.5)},${n1(cy - r * 0.45)}a${n1(r * 0.5)},${n1(r * 0.5)} 0 1 1 ${n1(r * 0.5)},${n1(r * 0.55)}v${n1(r * 0.3)}` }) + tag("circle", { class: "unk-dot", cx: n1(cx), cy: n1(cy + r * 0.75), r: n1(Math.max(0.8, r * 0.1)) });
|
|
86
|
+
}
|
|
87
|
+
function screenGlass(w, h) {
|
|
88
|
+
return rect("glass", 3, 3, w - 6, h - 6, 3);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
bubble,
|
|
92
|
+
envelope,
|
|
93
|
+
fileLines,
|
|
94
|
+
keyGlyph,
|
|
95
|
+
placeholderFace,
|
|
96
|
+
screenFaces,
|
|
97
|
+
screenGlass,
|
|
98
|
+
socketGlyph,
|
|
99
|
+
termLines
|
|
100
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { S, C, iso, n1, pt, esc, tag, FONTS, textWidth, apply, matStr, faceFrame, Bounds, Kernel, center } from "./kernel.js";
|
|
2
|
+
import { termLines, envelope, bubble, fileLines, keyGlyph, socketGlyph, screenFaces, screenGlass, placeholderFace } from "./glyphs.js";
|
|
3
|
+
import { depthSort } from "./depth.js";
|
|
4
|
+
import { loadTheme, extendTheme, colorRef, themeCss, themeParts } from "./theme.js";
|
|
5
|
+
import { DiagError, distance, didYouMean, formatDiag, formatDiags } from "./errors.js";
|
|
6
|
+
import { parse } from "./parse.js";
|
|
7
|
+
import { allowed, parseSvg, buildSvg } from "./svg-dom.js";
|
|
8
|
+
import { VEl, vdoc, serialize } from "./vdom.js";
|
|
9
|
+
import { createHash, sha256Hex } from "./shims/crypto.js";
|
|
10
|
+
export {
|
|
11
|
+
Bounds,
|
|
12
|
+
C,
|
|
13
|
+
DiagError,
|
|
14
|
+
FONTS,
|
|
15
|
+
Kernel,
|
|
16
|
+
S,
|
|
17
|
+
VEl,
|
|
18
|
+
allowed,
|
|
19
|
+
apply,
|
|
20
|
+
bubble,
|
|
21
|
+
buildSvg,
|
|
22
|
+
center,
|
|
23
|
+
colorRef,
|
|
24
|
+
createHash,
|
|
25
|
+
depthSort,
|
|
26
|
+
didYouMean,
|
|
27
|
+
distance,
|
|
28
|
+
envelope,
|
|
29
|
+
esc,
|
|
30
|
+
extendTheme,
|
|
31
|
+
faceFrame,
|
|
32
|
+
fileLines,
|
|
33
|
+
formatDiag,
|
|
34
|
+
formatDiags,
|
|
35
|
+
iso,
|
|
36
|
+
keyGlyph,
|
|
37
|
+
loadTheme,
|
|
38
|
+
matStr,
|
|
39
|
+
n1,
|
|
40
|
+
parse,
|
|
41
|
+
parseSvg,
|
|
42
|
+
placeholderFace,
|
|
43
|
+
pt,
|
|
44
|
+
screenFaces,
|
|
45
|
+
screenGlass,
|
|
46
|
+
serialize,
|
|
47
|
+
sha256Hex,
|
|
48
|
+
socketGlyph,
|
|
49
|
+
tag,
|
|
50
|
+
termLines,
|
|
51
|
+
textWidth,
|
|
52
|
+
themeCss,
|
|
53
|
+
themeParts,
|
|
54
|
+
vdoc
|
|
55
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import metrics from "./metrics.json" with { type: "json" };
|
|
2
|
+
const S = 34;
|
|
3
|
+
const C = Math.cos(Math.PI / 6);
|
|
4
|
+
const iso = (x, y, z = 0) => [(x - y) * C * S, (x + y) * 0.5 * S - z * S];
|
|
5
|
+
const n1 = (v) => {
|
|
6
|
+
const r = Math.round(v * 10) / 10;
|
|
7
|
+
return Object.is(r, -0) ? "0" : String(r);
|
|
8
|
+
};
|
|
9
|
+
const pt = (p) => `${n1(p[0])},${n1(p[1])}`;
|
|
10
|
+
const esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
11
|
+
function tag(name, attrs = {}, inner) {
|
|
12
|
+
let a = "";
|
|
13
|
+
for (const k in attrs) {
|
|
14
|
+
const v = attrs[k];
|
|
15
|
+
if (v === void 0 || v === null || v === false || v === "") continue;
|
|
16
|
+
a += ` ${k}="${esc(typeof v === "number" ? n1(v) : v)}"`;
|
|
17
|
+
}
|
|
18
|
+
return inner === void 0 ? `<${name}${a}/>` : `<${name}${a}>${inner}</${name}>`;
|
|
19
|
+
}
|
|
20
|
+
const FONTS = {
|
|
21
|
+
lbl: { key: "sans700_13", size: 13 },
|
|
22
|
+
sub: { key: "mono400_11", size: 11 },
|
|
23
|
+
slabname: { key: "sans800_15", size: 15, spacing: 0.12 },
|
|
24
|
+
sm: { key: "sans800_10_5", size: 10.5, spacing: 0.1 },
|
|
25
|
+
floor: { key: "mono600_11", size: 11, spacing: 0.01 },
|
|
26
|
+
say: { key: "sans600_12", size: 12 },
|
|
27
|
+
tunname: { key: "sans800_12", size: 12, spacing: 0.14 },
|
|
28
|
+
badge: { key: "sans800_11_5", size: 11.5 }
|
|
29
|
+
};
|
|
30
|
+
function textWidth(str, f) {
|
|
31
|
+
const table = metrics[f.key];
|
|
32
|
+
const avg = f.key.startsWith("mono") ? 0.6 : 0.58;
|
|
33
|
+
let w = 0;
|
|
34
|
+
for (const ch of str) w += table[ch] ?? avg;
|
|
35
|
+
return (w + (f.spacing ?? 0) * [...str].length) * f.size;
|
|
36
|
+
}
|
|
37
|
+
const apply = (m, x, y) => [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]];
|
|
38
|
+
const matStr = (m) => `matrix(${m.map((v) => Math.round(v * 1e4) / 1e4).join(" ")})`;
|
|
39
|
+
function faceFrame(b, face) {
|
|
40
|
+
if (face === "left") {
|
|
41
|
+
const [X2, Y2] = iso(b.x0, b.y1, b.z1);
|
|
42
|
+
return { m: [C, 0.5, 0, 1, X2, Y2], w: (b.x1 - b.x0) * S, h: (b.z1 - b.z0) * S };
|
|
43
|
+
}
|
|
44
|
+
if (face === "right") {
|
|
45
|
+
const [X2, Y2] = iso(b.x1, b.y1, b.z1);
|
|
46
|
+
return { m: [C, -0.5, 0, 1, X2, Y2], w: (b.y1 - b.y0) * S, h: (b.z1 - b.z0) * S };
|
|
47
|
+
}
|
|
48
|
+
const [X, Y] = iso(b.x0, b.y0, b.z1);
|
|
49
|
+
return { m: [C, 0.5, -C, 0.5, X, Y], w: (b.x1 - b.x0) * S, h: (b.y1 - b.y0) * S };
|
|
50
|
+
}
|
|
51
|
+
class Bounds {
|
|
52
|
+
x0 = Infinity;
|
|
53
|
+
y0 = Infinity;
|
|
54
|
+
x1 = -Infinity;
|
|
55
|
+
y1 = -Infinity;
|
|
56
|
+
add(p) {
|
|
57
|
+
if (p[0] < this.x0) this.x0 = p[0];
|
|
58
|
+
if (p[0] > this.x1) this.x1 = p[0];
|
|
59
|
+
if (p[1] < this.y0) this.y0 = p[1];
|
|
60
|
+
if (p[1] > this.y1) this.y1 = p[1];
|
|
61
|
+
}
|
|
62
|
+
addRect(x, y, w, h) {
|
|
63
|
+
this.add([x, y]);
|
|
64
|
+
this.add([x + w, y + h]);
|
|
65
|
+
}
|
|
66
|
+
get empty() {
|
|
67
|
+
return this.x0 === Infinity;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
class Kernel {
|
|
71
|
+
bounds = new Bounds();
|
|
72
|
+
texts = [];
|
|
73
|
+
/** screen bounds of text drawn in a skewed plane (floor, faces), for label placement */
|
|
74
|
+
planes = [];
|
|
75
|
+
/** the same, as the actual parallelograms */
|
|
76
|
+
planePolys = [];
|
|
77
|
+
defs = /* @__PURE__ */ new Map();
|
|
78
|
+
poly(pts, cls, extra = {}) {
|
|
79
|
+
const p = pts.map((q) => iso(q[0], q[1], q[2]));
|
|
80
|
+
p.forEach((q) => this.bounds.add(q));
|
|
81
|
+
return tag("polygon", { points: p.map(pt).join(" "), class: cls, ...extra });
|
|
82
|
+
}
|
|
83
|
+
line3(a, b, cls, extra = {}) {
|
|
84
|
+
const p = iso(...a), q = iso(...b);
|
|
85
|
+
this.bounds.add(p);
|
|
86
|
+
this.bounds.add(q);
|
|
87
|
+
return tag("line", { x1: p[0], y1: p[1], x2: q[0], y2: q[1], class: cls, ...extra });
|
|
88
|
+
}
|
|
89
|
+
/** The three visible faces of a box, as in the references: lft (+y), rgt (+x), top. */
|
|
90
|
+
blockFaces(b) {
|
|
91
|
+
const { x0, y0, x1, y1, z0, z1 } = b;
|
|
92
|
+
return this.poly([[x0, y1, z0], [x1, y1, z0], [x1, y1, z1], [x0, y1, z1]], "lft") + this.poly([[x1, y0, z0], [x1, y1, z0], [x1, y1, z1], [x1, y0, z1]], "rgt") + this.poly([[x0, y0, z1], [x1, y0, z1], [x1, y1, z1], [x0, y1, z1]], "top");
|
|
93
|
+
}
|
|
94
|
+
/** A group in a face's own 2D pixel plane. `draw` gets the face width and height. */
|
|
95
|
+
onFace(b, face, draw, cls) {
|
|
96
|
+
const f = faceFrame(b, face);
|
|
97
|
+
for (const [u, v] of [[0, 0], [f.w, 0], [0, f.h], [f.w, f.h]]) this.bounds.add(apply(f.m, u, v));
|
|
98
|
+
return tag("g", { class: cls, transform: matStr(f.m) }, draw(f.w, f.h));
|
|
99
|
+
}
|
|
100
|
+
/** Same, with an explicit matrix (screens at an angle). */
|
|
101
|
+
onMatrix(m, w, h, draw, cls) {
|
|
102
|
+
for (const [u, v] of [[0, 0], [w, 0], [0, h], [w, h]]) this.bounds.add(apply(m, u, v));
|
|
103
|
+
return tag("g", { class: cls, transform: matStr(m) }, draw(w, h));
|
|
104
|
+
}
|
|
105
|
+
/** Upright text, e.g. labels. (x, y) in screen pixels; y is the baseline. */
|
|
106
|
+
text(x, y, str, cls, font, anchor = "middle", extra = {}, owner) {
|
|
107
|
+
const w = textWidth(str, font);
|
|
108
|
+
const left = anchor === "start" ? x : anchor === "end" ? x - w : x - w / 2;
|
|
109
|
+
const r = { x: left, y: y - font.size * 0.8, w, h: font.size * 1.05, text: str, owner };
|
|
110
|
+
this.bounds.addRect(r.x - 2, r.y - 2, r.w + 4, r.h + 4);
|
|
111
|
+
this.texts.push(r);
|
|
112
|
+
return tag("text", { x, y, class: cls, "text-anchor": anchor === "start" ? void 0 : anchor, ...extra }, esc(str));
|
|
113
|
+
}
|
|
114
|
+
/** Text in a skewed plane (floor or face), with bounds through the matrix. */
|
|
115
|
+
planeText(m, str, cls, font, anchor = "start", extra = {}) {
|
|
116
|
+
const w = textWidth(str, font);
|
|
117
|
+
const left = anchor === "start" ? 0 : anchor === "end" ? -w : -w / 2;
|
|
118
|
+
const c = [[left, -font.size * 0.8], [left + w, -font.size * 0.8], [left, font.size * 0.25], [left + w, font.size * 0.25]].map(([u, v]) => apply(m, u, v));
|
|
119
|
+
c.forEach((p) => this.bounds.add(p));
|
|
120
|
+
const xs = c.map((p) => p[0]), ys = c.map((p) => p[1]);
|
|
121
|
+
this.planePolys.push([c[0], c[1], c[3], c[2]]);
|
|
122
|
+
this.planes.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
|
|
123
|
+
return tag("text", { transform: matStr(m), class: cls, "text-anchor": anchor === "start" ? void 0 : anchor, ...extra }, esc(str));
|
|
124
|
+
}
|
|
125
|
+
/** Text lying on the floor at height z: dir 'x' runs along +x, 'y' runs along −y (as in floorText()). */
|
|
126
|
+
floorText(x, y, z, str, cls, dir = "x", anchor = "start", extra = {}) {
|
|
127
|
+
const [X, Y] = iso(x, y, z);
|
|
128
|
+
const m = dir === "x" ? [C, 0.5, -C, 0.5, X, Y] : [C, -0.5, C, 0.5, X, Y];
|
|
129
|
+
return this.planeText(m, str, cls, FONTS.floor, anchor, extra);
|
|
130
|
+
}
|
|
131
|
+
/** Text standing on a +y face (left) or a +x face (right) at a point. */
|
|
132
|
+
faceText(x, y, z, str, cls, font, face = "left", anchor = "start", extra = {}) {
|
|
133
|
+
const [X, Y] = iso(x, y, z);
|
|
134
|
+
const m = face === "left" ? [C, 0.5, 0, 1, X, Y] : [C, -0.5, 0, 1, X, Y];
|
|
135
|
+
return this.planeText(m, str, cls, font, anchor, extra);
|
|
136
|
+
}
|
|
137
|
+
def(id, svg) {
|
|
138
|
+
this.defs.set(id, svg);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const center = (b) => [(b.x0 + b.x1) / 2, (b.y0 + b.y1) / 2, b.z1];
|
|
142
|
+
export {
|
|
143
|
+
Bounds,
|
|
144
|
+
C,
|
|
145
|
+
FONTS,
|
|
146
|
+
Kernel,
|
|
147
|
+
S,
|
|
148
|
+
apply,
|
|
149
|
+
center,
|
|
150
|
+
esc,
|
|
151
|
+
faceFrame,
|
|
152
|
+
iso,
|
|
153
|
+
matStr,
|
|
154
|
+
n1,
|
|
155
|
+
pt,
|
|
156
|
+
tag,
|
|
157
|
+
textWidth
|
|
158
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"sans700_13":{"0":0.6787,"1":0.5059,"2":0.6372,"3":0.6631,"4":0.6812,"5":0.6577,"6":0.6777,"7":0.6172,"8":0.688,"9":0.6777," ":0.252,"!":0.3506,"\"":0.563,"#":0.6655,"$":0.6655,"%":1.0298,"&":0.7388,"'":0.3418,"(":0.4229,")":0.4229,"*":0.4785,"+":0.6655,",":0.3418,"-":0.4785,".":0.3418,"/":0.3286,":":0.3418,";":0.3418,"<":0.6655,"=":0.6655,">":0.6655,"?":0.5513,"@":0.9214,"A":0.7266,"B":0.6875,"C":0.7354,"D":0.7417,"E":0.6162,"F":0.5918,"G":0.7544,"H":0.7773,"I":0.3125,"J":0.5952,"K":0.7036,"L":0.5889,"M":0.9009,"N":0.7622,"O":0.7808,"P":0.668,"Q":0.7808,"R":0.6885,"S":0.6694,"T":0.6543,"U":0.7544,"V":0.7153,"W":1.0034,"X":0.7236,"Y":0.7021,"Z":0.6699,"[":0.4229,"\\":0.3286,"]":0.4229,"^":0.6655,"_":0.5845,"`":0.4941,"a":0.584,"b":0.6455,"c":0.5815,"d":0.6455,"e":0.5952,"f":0.407,"g":0.6396,"h":0.6265,"i":0.2813,"j":0.2813,"k":0.5957,"l":0.2891,"m":0.9263,"n":0.6216,"o":0.6138,"p":0.6411,"q":0.6416,"r":0.4338,"s":0.5513,"t":0.4114,"u":0.6216,"v":0.5771,"w":0.8413,"x":0.5747,"y":0.5913,"z":0.5605,"{":0.4229,"|":0.2935,"}":0.4229,"~":0.6655,"·":0.3418,"→":0.9375,"←":0.9375,"↑":0.8096,"↓":0.8096,"’":0.3418,"‘":0.3418,"“":0.5474,"”":0.5474,"…":0.9482,"–":0.6216,"—":0.9045,"✕":0.7622,"×":0.6655,"≈":0.6655,"≤":0.6655,"≥":0.6655,"é":0.5952},"sans800_15":{"0":0.687,"1":0.5122,"2":0.6406,"3":0.6675,"4":0.686,"5":0.6626,"6":0.6836,"7":0.6191,"8":0.6968,"9":0.6836," ":0.2344,"!":0.3555,"\"":0.5835,"#":0.6694,"$":0.6694,"%":1.0566,"&":0.7397,"'":0.3491,"(":0.4287,")":0.4287,"*":0.4731,"+":0.6694,",":0.3491,"-":0.4731,".":0.3491,"/":0.3286,":":0.3491,";":0.3491,"<":0.6694,"=":0.6694,">":0.6694,"?":0.5562,"@":0.9146,"A":0.7363,"B":0.6899,"C":0.7339,"D":0.7388,"E":0.6147,"F":0.5903,"G":0.749,"H":0.7813,"I":0.3198,"J":0.6064,"K":0.7104,"L":0.5879,"M":0.9019,"N":0.7612,"O":0.7759,"P":0.6709,"Q":0.7759,"R":0.6924,"S":0.6719,"T":0.6533,"U":0.7524,"V":0.7212,"W":1.0073,"X":0.731,"Y":0.71,"Z":0.6646,"[":0.4287,"\\":0.3286,"]":0.4287,"^":0.6694,"_":0.5889,"`":0.4844,"a":0.5864,"b":0.6479,"c":0.5811,"d":0.6479,"e":0.5952,"f":0.4139,"g":0.6416,"h":0.6309,"i":0.2847,"j":0.2847,"k":0.605,"l":0.2935,"m":0.937,"n":0.626,"o":0.6138,"p":0.6436,"q":0.6445,"r":0.4406,"s":0.5557,"t":0.4198,"u":0.626,"v":0.5806,"w":0.856,"x":0.5835,"y":0.5996,"z":0.5601,"{":0.4287,"|":0.2974,"}":0.4287,"~":0.6694,"·":0.3491,"→":0.9404,"←":0.9404,"↑":0.811,"↓":0.811,"’":0.3491,"‘":0.3491,"“":0.5688,"”":0.5688,"…":0.9883,"–":0.626,"—":0.9118,"✕":0.7622,"×":0.6694,"≈":0.6694,"≤":0.6694,"≥":0.6694,"é":0.5952},"sans800_10_5":{"0":0.7114,"1":0.5366,"2":0.665,"3":0.6919,"4":0.7104,"5":0.687,"6":0.708,"7":0.6436,"8":0.7212,"9":0.708," ":0.2588,"!":0.3799,"\"":0.6079,"#":0.6938,"$":0.6938,"%":1.0811,"&":0.7642,"'":0.3735,"(":0.4531,")":0.4531,"*":0.4976,"+":0.6938,",":0.3735,"-":0.4976,".":0.3735,"/":0.353,":":0.3735,";":0.3735,"<":0.6938,"=":0.6938,">":0.6938,"?":0.5806,"@":0.939,"A":0.7607,"B":0.7144,"C":0.7583,"D":0.7632,"E":0.6392,"F":0.6147,"G":0.7734,"H":0.8057,"I":0.3442,"J":0.6309,"K":0.7349,"L":0.6123,"M":0.9263,"N":0.7856,"O":0.8003,"P":0.6953,"Q":0.8003,"R":0.7168,"S":0.6963,"T":0.6777,"U":0.7769,"V":0.7456,"W":1.0317,"X":0.7554,"Y":0.7344,"Z":0.689,"[":0.4531,"\\":0.353,"]":0.4531,"^":0.6938,"_":0.6133,"`":0.5088,"a":0.6108,"b":0.6724,"c":0.6055,"d":0.6724,"e":0.6196,"f":0.4383,"g":0.666,"h":0.6553,"i":0.3091,"j":0.3091,"k":0.6294,"l":0.3179,"m":0.9614,"n":0.6504,"o":0.6382,"p":0.668,"q":0.6689,"r":0.465,"s":0.5801,"t":0.4442,"u":0.6504,"v":0.605,"w":0.8804,"x":0.6079,"y":0.624,"z":0.5845,"{":0.4531,"|":0.3218,"}":0.4531,"~":0.6938,"·":0.3735,"→":0.9648,"←":0.9648,"↑":0.8354,"↓":0.8354,"’":0.3735,"‘":0.3735,"“":0.5933,"”":0.5933,"…":1.0127,"–":0.6504,"—":0.9204,"✕":0.7622,"×":0.6938,"≈":0.6938,"≤":0.6938,"≥":0.6938,"é":0.6196},"sans600_12":{"0":0.6665,"1":0.4956,"2":0.6299,"3":0.6548,"4":0.6724,"5":0.6484,"6":0.668,"7":0.6113,"8":0.6753,"9":0.668," ":0.2656,"!":0.3413,"\"":0.5386,"#":0.6577,"$":0.6577,"%":0.999,"&":0.7334,"'":0.3306,"(":0.4131,")":0.4131,"*":0.48,"+":0.6577,",":0.3306,"-":0.48,".":0.3306,"/":0.3247,":":0.3306,";":0.3306,"<":0.6577,"=":0.6577,">":0.6577,"?":0.5425,"@":0.9238,"A":0.7129,"B":0.6812,"C":0.7329,"D":0.7402,"E":0.6133,"F":0.5889,"G":0.7559,"H":0.7695,"I":0.3013,"J":0.5801,"K":0.6924,"L":0.5859,"M":0.8955,"N":0.7593,"O":0.7813,"P":0.6606,"Q":0.7813,"R":0.6807,"S":0.6626,"T":0.6514,"U":0.7524,"V":0.7056,"W":0.9956,"X":0.7124,"Y":0.6904,"Z":0.6709,"[":0.4131,"\\":0.3247,"]":0.4131,"^":0.6577,"_":0.5757,"`":0.5,"a":0.5771,"b":0.6392,"c":0.5781,"d":0.6392,"e":0.5908,"f":0.3957,"g":0.6333,"h":0.6177,"i":0.2739,"j":0.2734,"k":0.582,"l":0.2808,"m":0.9116,"n":0.6128,"o":0.6099,"p":0.6348,"q":0.6348,"r":0.4232,"s":0.543,"t":0.3991,"u":0.6128,"v":0.5693,"w":0.8228,"x":0.562,"y":0.5791,"z":0.5571,"{":0.4131,"|":0.2856,"}":0.4131,"~":0.6577,"·":0.3306,"→":0.9307,"←":0.9307,"↑":0.8037,"↓":0.8037,"’":0.3306,"‘":0.3306,"“":0.522,"”":0.522,"…":0.9043,"–":0.6128,"—":0.8957,"✕":0.7622,"×":0.6577,"≈":0.6577,"≤":0.6577,"≥":0.6577,"é":0.5908},"sans800_12":{"0":0.7026,"1":0.5278,"2":0.6563,"3":0.6831,"4":0.7017,"5":0.6782,"6":0.6992,"7":0.6348,"8":0.7124,"9":0.6992," ":0.25,"!":0.3711,"\"":0.5991,"#":0.6851,"$":0.6851,"%":1.0723,"&":0.7554,"'":0.3647,"(":0.4443,")":0.4443,"*":0.4888,"+":0.6851,",":0.3647,"-":0.4888,".":0.3647,"/":0.3442,":":0.3647,";":0.3647,"<":0.6851,"=":0.6851,">":0.6851,"?":0.5718,"@":0.9302,"A":0.752,"B":0.7056,"C":0.7495,"D":0.7544,"E":0.6304,"F":0.606,"G":0.7646,"H":0.7969,"I":0.3354,"J":0.6221,"K":0.7261,"L":0.6035,"M":0.9175,"N":0.7769,"O":0.7915,"P":0.6865,"Q":0.7915,"R":0.708,"S":0.6875,"T":0.6689,"U":0.7681,"V":0.7368,"W":1.0229,"X":0.7466,"Y":0.7256,"Z":0.6802,"[":0.4443,"\\":0.3442,"]":0.4443,"^":0.6851,"_":0.6045,"`":0.5,"a":0.6021,"b":0.6636,"c":0.5967,"d":0.6636,"e":0.6108,"f":0.4295,"g":0.6572,"h":0.6465,"i":0.3003,"j":0.3003,"k":0.6206,"l":0.3091,"m":0.9526,"n":0.6416,"o":0.6294,"p":0.6592,"q":0.6602,"r":0.4562,"s":0.5713,"t":0.4354,"u":0.6416,"v":0.5962,"w":0.8716,"x":0.5991,"y":0.6152,"z":0.5757,"{":0.4443,"|":0.313,"}":0.4443,"~":0.6851,"·":0.3647,"→":0.9561,"←":0.9561,"↑":0.8267,"↓":0.8267,"’":0.3647,"‘":0.3647,"“":0.5845,"”":0.5845,"…":1.0039,"–":0.6416,"—":0.9173,"✕":0.7622,"×":0.6851,"≈":0.6851,"≤":0.6851,"≥":0.6851,"é":0.6108},"sans800_11_5":{"0":0.7056,"1":0.5308,"2":0.6592,"3":0.686,"4":0.7046,"5":0.6812,"6":0.7021,"7":0.6377,"8":0.7153,"9":0.7021," ":0.2529,"!":0.374,"\"":0.6021,"#":0.688,"$":0.688,"%":1.0752,"&":0.7583,"'":0.3677,"(":0.4473,")":0.4473,"*":0.4917,"+":0.688,",":0.3677,"-":0.4917,".":0.3677,"/":0.3472,":":0.3677,";":0.3677,"<":0.688,"=":0.688,">":0.688,"?":0.5747,"@":0.9331,"A":0.7549,"B":0.7085,"C":0.7524,"D":0.7573,"E":0.6333,"F":0.6089,"G":0.7676,"H":0.7998,"I":0.3384,"J":0.625,"K":0.729,"L":0.6064,"M":0.9204,"N":0.7798,"O":0.7944,"P":0.6895,"Q":0.7944,"R":0.7109,"S":0.6904,"T":0.6719,"U":0.771,"V":0.7397,"W":1.0259,"X":0.7495,"Y":0.7285,"Z":0.6831,"[":0.4473,"\\":0.3472,"]":0.4473,"^":0.688,"_":0.6074,"`":0.5029,"a":0.605,"b":0.6665,"c":0.5996,"d":0.6665,"e":0.6138,"f":0.4325,"g":0.6602,"h":0.6494,"i":0.3032,"j":0.3032,"k":0.6235,"l":0.312,"m":0.9556,"n":0.6445,"o":0.6323,"p":0.6621,"q":0.6631,"r":0.4591,"s":0.5742,"t":0.4383,"u":0.6445,"v":0.5991,"w":0.8745,"x":0.6021,"y":0.6182,"z":0.5786,"{":0.4473,"|":0.3159,"}":0.4473,"~":0.688,"·":0.3677,"→":0.959,"←":0.959,"↑":0.8296,"↓":0.8296,"’":0.3677,"‘":0.3677,"“":0.5874,"”":0.5874,"…":1.0068,"–":0.6445,"—":0.9183,"✕":0.7622,"×":0.688,"≈":0.688,"≤":0.688,"≥":0.688,"é":0.6138},"sans400_13":{"0":0.624,"1":0.458,"2":0.5977,"3":0.6211,"4":0.6377,"5":0.6123,"6":0.6309,"7":0.582,"8":0.6328,"9":0.6309," ":0.2754,"!":0.3052,"\"":0.4717,"#":0.624,"$":0.624,"%":0.9194,"&":0.7056,"'":0.291,"(":0.376,")":0.376,"*":0.4658,"+":0.624,",":0.291,"-":0.4658,".":0.291,"/":0.2988,":":0.291,";":0.291,"<":0.624,"=":0.624,">":0.624,"?":0.5068,"@":0.9121,"A":0.668,"B":0.6514,"C":0.71,"D":0.7207,"E":0.5898,"F":0.5664,"G":0.7407,"H":0.7363,"I":0.2617,"J":0.5322,"K":0.6528,"L":0.562,"M":0.8682,"N":0.7363,"O":0.7656,"P":0.6294,"Q":0.7656,"R":0.6475,"S":0.6313,"T":0.6279,"U":0.7314,"V":0.668,"W":0.9619,"X":0.6729,"Y":0.6494,"Z":0.6558,"[":0.376,"\\":0.2988,"]":0.376,"^":0.624,"_":0.5405,"`":0.4941,"a":0.5459,"b":0.6084,"c":0.5537,"d":0.6084,"e":0.5654,"f":0.356,"g":0.6035,"h":0.5825,"i":0.2412,"j":0.2407,"k":0.5371,"l":0.2471,"m":0.8643,"n":0.5776,"o":0.585,"p":0.6045,"q":0.6035,"r":0.3843,"s":0.5083,"t":0.3574,"u":0.5776,"v":0.5361,"w":0.7686,"x":0.5186,"y":0.5371,"z":0.5332,"{":0.376,"|":0.2529,"}":0.376,"~":0.624,"·":0.291,"→":0.8999,"←":0.8999,"↑":0.7754,"↓":0.7754,"’":0.291,"‘":0.291,"“":0.4531,"”":0.4531,"…":0.7988,"–":0.5776,"—":0.872,"✕":0.7622,"×":0.624,"≈":0.624,"≤":0.624,"≥":0.624,"é":0.5654},"mono400_11":{"0":0.6021,"1":0.6021,"2":0.6021,"3":0.6021,"4":0.6021,"5":0.6021,"6":0.6021,"7":0.6021,"8":0.6021,"9":0.6021," ":0.6021,"!":0.6021,"\"":0.6021,"#":0.6021,"$":0.6021,"%":0.6021,"&":0.6021,"'":0.6021,"(":0.6021,")":0.6021,"*":0.6021,"+":0.6021,",":0.6021,"-":0.6021,".":0.6021,"/":0.6021,":":0.6021,";":0.6021,"<":0.6021,"=":0.6021,">":0.6021,"?":0.6021,"@":0.6021,"A":0.6021,"B":0.6021,"C":0.6021,"D":0.6021,"E":0.6021,"F":0.6021,"G":0.6021,"H":0.6021,"I":0.6021,"J":0.6021,"K":0.6021,"L":0.6021,"M":0.6021,"N":0.6021,"O":0.6021,"P":0.6021,"Q":0.6021,"R":0.6021,"S":0.6021,"T":0.6021,"U":0.6021,"V":0.6021,"W":0.6021,"X":0.6021,"Y":0.6021,"Z":0.6021,"[":0.6021,"\\":0.6021,"]":0.6021,"^":0.6021,"_":0.6021,"`":0.6021,"a":0.6021,"b":0.6021,"c":0.6021,"d":0.6021,"e":0.6021,"f":0.6021,"g":0.6021,"h":0.6021,"i":0.6021,"j":0.6021,"k":0.6021,"l":0.6021,"m":0.6021,"n":0.6021,"o":0.6021,"p":0.6021,"q":0.6021,"r":0.6021,"s":0.6021,"t":0.6021,"u":0.6021,"v":0.6021,"w":0.6021,"x":0.6021,"y":0.6021,"z":0.6021,"{":0.6021,"|":0.6021,"}":0.6021,"~":0.6021,"·":0.6021,"→":0.6021,"←":0.6021,"↑":0.6021,"↓":0.6021,"’":0.6021,"‘":0.6021,"“":0.6021,"”":0.6021,"…":0.6021,"–":0.6021,"—":0.6021,"✕":0.6021,"×":0.6021,"≈":0.6021,"≤":0.6021,"≥":0.6021,"é":0.6021},"mono600_11":{"0":0.6021,"1":0.6021,"2":0.6021,"3":0.6021,"4":0.6021,"5":0.6021,"6":0.6021,"7":0.6021,"8":0.6021,"9":0.6021," ":0.6021,"!":0.6021,"\"":0.6021,"#":0.6021,"$":0.6021,"%":0.6021,"&":0.6021,"'":0.6021,"(":0.6021,")":0.6021,"*":0.6021,"+":0.6021,",":0.6021,"-":0.6021,".":0.6021,"/":0.6021,":":0.6021,";":0.6021,"<":0.6021,"=":0.6021,">":0.6021,"?":0.6021,"@":0.6021,"A":0.6021,"B":0.6021,"C":0.6021,"D":0.6021,"E":0.6021,"F":0.6021,"G":0.6021,"H":0.6021,"I":0.6021,"J":0.6021,"K":0.6021,"L":0.6021,"M":0.6021,"N":0.6021,"O":0.6021,"P":0.6021,"Q":0.6021,"R":0.6021,"S":0.6021,"T":0.6021,"U":0.6021,"V":0.6021,"W":0.6021,"X":0.6021,"Y":0.6021,"Z":0.6021,"[":0.6021,"\\":0.6021,"]":0.6021,"^":0.6021,"_":0.6021,"`":0.6021,"a":0.6021,"b":0.6021,"c":0.6021,"d":0.6021,"e":0.6021,"f":0.6021,"g":0.6021,"h":0.6021,"i":0.6021,"j":0.6021,"k":0.6021,"l":0.6021,"m":0.6021,"n":0.6021,"o":0.6021,"p":0.6021,"q":0.6021,"r":0.6021,"s":0.6021,"t":0.6021,"u":0.6021,"v":0.6021,"w":0.6021,"x":0.6021,"y":0.6021,"z":0.6021,"{":0.6021,"|":0.6021,"}":0.6021,"~":0.6021,"·":0.6021,"→":0.6021,"←":0.6021,"↑":0.6021,"↓":0.6021,"’":0.6021,"‘":0.6021,"“":0.6021,"”":0.6021,"…":0.6021,"–":0.6021,"—":0.6021,"✕":0.6021,"×":0.6021,"≈":0.6021,"≤":0.6021,"≥":0.6021,"é":0.6021}}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { parseDocument, LineCounter, isMap, isSeq, isPair, isScalar } from "yaml";
|
|
2
|
+
function splitPath(path) {
|
|
3
|
+
return path.split("/").slice(1).map((s) => {
|
|
4
|
+
const u = s.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
5
|
+
return /^\d+$/.test(u) ? Number(u) : u;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
function parse(source) {
|
|
9
|
+
const lc = new LineCounter();
|
|
10
|
+
const doc = parseDocument(source, { lineCounter: lc, prettyErrors: false, uniqueKeys: true });
|
|
11
|
+
const diags = [];
|
|
12
|
+
const pos = (offset) => {
|
|
13
|
+
const p = lc.linePos(offset);
|
|
14
|
+
return { line: p.line, col: p.col };
|
|
15
|
+
};
|
|
16
|
+
for (const e of doc.errors) {
|
|
17
|
+
const p = pos(e.pos[0]);
|
|
18
|
+
const msg = e.message.split("\n")[0];
|
|
19
|
+
const hint = /Nested mappings|Implicit keys|mapping values/i.test(msg) ? `text that contains ": " (a colon followed by a blank) must be in quotes, e.g. command: 'send "a: b"'` : /Map keys must be unique/i.test(msg) ? "a key is written twice in the same map" : void 0;
|
|
20
|
+
diags.push({ severity: "error", message: `YAML: ${msg}`, line: p.line, col: p.col, path: "", hint });
|
|
21
|
+
}
|
|
22
|
+
for (const w of doc.warnings) {
|
|
23
|
+
const p = pos(w.pos[0]);
|
|
24
|
+
diags.push({ severity: "warning", message: `YAML: ${w.message.split("\n")[0]}`, line: p.line, col: p.col, path: "" });
|
|
25
|
+
}
|
|
26
|
+
function locate(path, opts = {}) {
|
|
27
|
+
const parts = splitPath(path);
|
|
28
|
+
let node = doc.contents;
|
|
29
|
+
let last = { line: 1, col: 1 };
|
|
30
|
+
const here = (n) => {
|
|
31
|
+
const r = n?.range;
|
|
32
|
+
if (r) last = pos(r[0]);
|
|
33
|
+
};
|
|
34
|
+
here(node);
|
|
35
|
+
for (let i = 0; i < parts.length; i++) {
|
|
36
|
+
const k = parts[i];
|
|
37
|
+
if (isMap(node)) {
|
|
38
|
+
const pair = node.items.find((p) => isPair(p) && isScalar(p.key) && String(p.key.value) === String(k));
|
|
39
|
+
if (!pair) break;
|
|
40
|
+
if (opts.key && i === parts.length - 1) {
|
|
41
|
+
here(pair.key);
|
|
42
|
+
return last;
|
|
43
|
+
}
|
|
44
|
+
here(pair.key);
|
|
45
|
+
node = pair.value;
|
|
46
|
+
if (node) here(node);
|
|
47
|
+
} else if (isSeq(node) && typeof k === "number") {
|
|
48
|
+
node = node.items[k];
|
|
49
|
+
if (!node) break;
|
|
50
|
+
here(node);
|
|
51
|
+
} else break;
|
|
52
|
+
}
|
|
53
|
+
return last;
|
|
54
|
+
}
|
|
55
|
+
function span(path) {
|
|
56
|
+
let node = doc.contents;
|
|
57
|
+
for (const k of splitPath(path)) {
|
|
58
|
+
if (isMap(node)) {
|
|
59
|
+
const pair = node.items.find((p) => isPair(p) && isScalar(p.key) && String(p.key.value) === String(k));
|
|
60
|
+
if (!pair) return void 0;
|
|
61
|
+
node = pair.value;
|
|
62
|
+
} else if (isSeq(node) && typeof k === "number") node = node.items[k];
|
|
63
|
+
else return void 0;
|
|
64
|
+
if (!node) return void 0;
|
|
65
|
+
}
|
|
66
|
+
const r = node.range;
|
|
67
|
+
if (!r) return void 0;
|
|
68
|
+
let end = lc.linePos(Math.max(r[0], r[1] - 1)).line;
|
|
69
|
+
const lines = source.split(/\r?\n/);
|
|
70
|
+
while (end > lc.linePos(r[0]).line && /^\s*(#.*)?$/.test(lines[end - 1] ?? "")) end--;
|
|
71
|
+
return { start: lc.linePos(r[0]).line, end };
|
|
72
|
+
}
|
|
73
|
+
let data = null;
|
|
74
|
+
if (!doc.errors.length) data = doc.toJS({ maxAliasCount: 100 });
|
|
75
|
+
return { data, locate, span, diags };
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
parse
|
|
79
|
+
};
|