@flux-lang/viewer 0.1.4-canary.078fd1eea
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/dist/editor-dist.d.ts +19 -0
- package/dist/editor-dist.d.ts.map +1 -0
- package/dist/editor-dist.js +110 -0
- package/dist/editor-dist.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2817 -0
- package/dist/index.js.map +1 -0
- package/dist/patching.d.ts +9 -0
- package/dist/patching.d.ts.map +1 -0
- package/dist/patching.js +87 -0
- package/dist/patching.js.map +1 -0
- package/dist/ui/OverflowMenu.d.ts +2 -0
- package/dist/ui/OverflowMenu.d.ts.map +1 -0
- package/dist/ui/OverflowMenu.js +49 -0
- package/dist/ui/OverflowMenu.js.map +1 -0
- package/dist/ui/OverflowMenu.jsx +49 -0
- package/dist/ui/OverflowMenu.jsx.map +1 -0
- package/dist/ui/ToolbarButton.d.ts +14 -0
- package/dist/ui/ToolbarButton.d.ts.map +1 -0
- package/dist/ui/ToolbarButton.js +36 -0
- package/dist/ui/ToolbarButton.js.map +1 -0
- package/dist/ui/ToolbarButton.jsx +36 -0
- package/dist/ui/ToolbarButton.jsx.map +1 -0
- package/dist/ui/ToolbarGroup.d.ts +9 -0
- package/dist/ui/ToolbarGroup.d.ts.map +1 -0
- package/dist/ui/ToolbarGroup.js +12 -0
- package/dist/ui/ToolbarGroup.js.map +1 -0
- package/dist/ui/ToolbarGroup.jsx +12 -0
- package/dist/ui/ToolbarGroup.jsx.map +1 -0
- package/dist/ui/ViewerToolbar.d.ts +3 -0
- package/dist/ui/ViewerToolbar.d.ts.map +1 -0
- package/dist/ui/ViewerToolbar.js +460 -0
- package/dist/ui/ViewerToolbar.js.map +1 -0
- package/dist/ui/ViewerToolbar.jsx +460 -0
- package/dist/ui/ViewerToolbar.jsx.map +1 -0
- package/dist/ui/viewerTheme.d.ts +2 -0
- package/dist/ui/viewerTheme.d.ts.map +1 -0
- package/dist/ui/viewerTheme.js +45 -0
- package/dist/ui/viewerTheme.js.map +1 -0
- package/editor-dist/abap-BrgZPUOV.js +7 -0
- package/editor-dist/abap-BrgZPUOV.js.map +1 -0
- package/editor-dist/apex-DyP6w7ZV.js +7 -0
- package/editor-dist/apex-DyP6w7ZV.js.map +1 -0
- package/editor-dist/azcli-BaLxmfj-.js +7 -0
- package/editor-dist/azcli-BaLxmfj-.js.map +1 -0
- package/editor-dist/bat-CFOPXBzS.js +7 -0
- package/editor-dist/bat-CFOPXBzS.js.map +1 -0
- package/editor-dist/bicep-BfEKNvv3.js +8 -0
- package/editor-dist/bicep-BfEKNvv3.js.map +1 -0
- package/editor-dist/cameligo-BFG1Mk7z.js +7 -0
- package/editor-dist/cameligo-BFG1Mk7z.js.map +1 -0
- package/editor-dist/clojure-DTECt2xU.js +7 -0
- package/editor-dist/clojure-DTECt2xU.js.map +1 -0
- package/editor-dist/codicon-DCmgc-ay.ttf +0 -0
- package/editor-dist/coffee-CDGzqUPQ.js +7 -0
- package/editor-dist/coffee-CDGzqUPQ.js.map +1 -0
- package/editor-dist/cpp-CLLBncYj.js +7 -0
- package/editor-dist/cpp-CLLBncYj.js.map +1 -0
- package/editor-dist/csharp-dUCx_-0o.js +7 -0
- package/editor-dist/csharp-dUCx_-0o.js.map +1 -0
- package/editor-dist/csp-5Rap-vPy.js +7 -0
- package/editor-dist/csp-5Rap-vPy.js.map +1 -0
- package/editor-dist/css-D3h14YRZ.js +9 -0
- package/editor-dist/css-D3h14YRZ.js.map +1 -0
- package/editor-dist/cssMode-YzLwzBxw.js +10 -0
- package/editor-dist/cssMode-YzLwzBxw.js.map +1 -0
- package/editor-dist/cypher-DrQuvNYM.js +7 -0
- package/editor-dist/cypher-DrQuvNYM.js.map +1 -0
- package/editor-dist/dart-CFKIUWau.js +7 -0
- package/editor-dist/dart-CFKIUWau.js.map +1 -0
- package/editor-dist/dockerfile-Zznr-cwX.js +7 -0
- package/editor-dist/dockerfile-Zznr-cwX.js.map +1 -0
- package/editor-dist/ecl-Ce3n6wWz.js +7 -0
- package/editor-dist/ecl-Ce3n6wWz.js.map +1 -0
- package/editor-dist/editor.worker-DX6ApQqM.js +13 -0
- package/editor-dist/editor.worker-DX6ApQqM.js.map +1 -0
- package/editor-dist/elixir-deUWdS0T.js +7 -0
- package/editor-dist/elixir-deUWdS0T.js.map +1 -0
- package/editor-dist/flow9-i9-g7ZhI.js +7 -0
- package/editor-dist/flow9-i9-g7ZhI.js.map +1 -0
- package/editor-dist/flux-mark-favicon.svg +1 -0
- package/editor-dist/freemarker2-DHMOANhp.js +9 -0
- package/editor-dist/freemarker2-DHMOANhp.js.map +1 -0
- package/editor-dist/fsharp-CzKuDChf.js +7 -0
- package/editor-dist/fsharp-CzKuDChf.js.map +1 -0
- package/editor-dist/go-Cphgjts3.js +7 -0
- package/editor-dist/go-Cphgjts3.js.map +1 -0
- package/editor-dist/graphql-Cg7bfA9N.js +7 -0
- package/editor-dist/graphql-Cg7bfA9N.js.map +1 -0
- package/editor-dist/handlebars-cOJvQNQa.js +7 -0
- package/editor-dist/handlebars-cOJvQNQa.js.map +1 -0
- package/editor-dist/hcl-0cvrggvQ.js +7 -0
- package/editor-dist/hcl-0cvrggvQ.js.map +1 -0
- package/editor-dist/html-ql7uNmCd.js +7 -0
- package/editor-dist/html-ql7uNmCd.js.map +1 -0
- package/editor-dist/htmlMode-Cadam1-q.js +10 -0
- package/editor-dist/htmlMode-Cadam1-q.js.map +1 -0
- package/editor-dist/index-BHFiyBwP.js +1101 -0
- package/editor-dist/index-BHFiyBwP.js.map +1 -0
- package/editor-dist/index-Is4aLQOs.css +1 -0
- package/editor-dist/index.html +20 -0
- package/editor-dist/ini-Drc7WvVn.js +7 -0
- package/editor-dist/ini-Drc7WvVn.js.map +1 -0
- package/editor-dist/java-B_fMsGYe.js +7 -0
- package/editor-dist/java-B_fMsGYe.js.map +1 -0
- package/editor-dist/javascript-DnRc41Cb.js +7 -0
- package/editor-dist/javascript-DnRc41Cb.js.map +1 -0
- package/editor-dist/jsonMode-8I1AZ0oD.js +16 -0
- package/editor-dist/jsonMode-8I1AZ0oD.js.map +1 -0
- package/editor-dist/julia-Bqgm2twL.js +7 -0
- package/editor-dist/julia-Bqgm2twL.js.map +1 -0
- package/editor-dist/kotlin-BSkB5QuD.js +7 -0
- package/editor-dist/kotlin-BSkB5QuD.js.map +1 -0
- package/editor-dist/less-BsTHnhdd.js +8 -0
- package/editor-dist/less-BsTHnhdd.js.map +1 -0
- package/editor-dist/lexon-YWi4-JPR.js +7 -0
- package/editor-dist/lexon-YWi4-JPR.js.map +1 -0
- package/editor-dist/liquid-BBwwPjRq.js +7 -0
- package/editor-dist/liquid-BBwwPjRq.js.map +1 -0
- package/editor-dist/lua-nf6ki56Z.js +7 -0
- package/editor-dist/lua-nf6ki56Z.js.map +1 -0
- package/editor-dist/m3-Cpb6xl2v.js +7 -0
- package/editor-dist/m3-Cpb6xl2v.js.map +1 -0
- package/editor-dist/markdown-DSZPf7rp.js +7 -0
- package/editor-dist/markdown-DSZPf7rp.js.map +1 -0
- package/editor-dist/mdx-CEF6KH1N.js +7 -0
- package/editor-dist/mdx-CEF6KH1N.js.map +1 -0
- package/editor-dist/mips-B_c3zf-v.js +7 -0
- package/editor-dist/mips-B_c3zf-v.js.map +1 -0
- package/editor-dist/msdax-rUNN04Wq.js +7 -0
- package/editor-dist/msdax-rUNN04Wq.js.map +1 -0
- package/editor-dist/mysql-DDwshQtU.js +7 -0
- package/editor-dist/mysql-DDwshQtU.js.map +1 -0
- package/editor-dist/objective-c-B5zXfXm9.js +7 -0
- package/editor-dist/objective-c-B5zXfXm9.js.map +1 -0
- package/editor-dist/pascal-CXOwvkN_.js +7 -0
- package/editor-dist/pascal-CXOwvkN_.js.map +1 -0
- package/editor-dist/pascaligo-Bc-ZgV77.js +7 -0
- package/editor-dist/pascaligo-Bc-ZgV77.js.map +1 -0
- package/editor-dist/perl-CwNk8-XU.js +7 -0
- package/editor-dist/perl-CwNk8-XU.js.map +1 -0
- package/editor-dist/pgsql-tGk8EFnU.js +7 -0
- package/editor-dist/pgsql-tGk8EFnU.js.map +1 -0
- package/editor-dist/php-CpIb_Oan.js +7 -0
- package/editor-dist/php-CpIb_Oan.js.map +1 -0
- package/editor-dist/pla-B03wrqEc.js +7 -0
- package/editor-dist/pla-B03wrqEc.js.map +1 -0
- package/editor-dist/postiats-BKlk5iyT.js +7 -0
- package/editor-dist/postiats-BKlk5iyT.js.map +1 -0
- package/editor-dist/powerquery-Bhzvs7bI.js +7 -0
- package/editor-dist/powerquery-Bhzvs7bI.js.map +1 -0
- package/editor-dist/powershell-Dd3NCNK9.js +7 -0
- package/editor-dist/powershell-Dd3NCNK9.js.map +1 -0
- package/editor-dist/protobuf-COyEY5Pt.js +8 -0
- package/editor-dist/protobuf-COyEY5Pt.js.map +1 -0
- package/editor-dist/pug-BaJupSGV.js +7 -0
- package/editor-dist/pug-BaJupSGV.js.map +1 -0
- package/editor-dist/python-BeXXsHvX.js +7 -0
- package/editor-dist/python-BeXXsHvX.js.map +1 -0
- package/editor-dist/qsharp-DXyYeYxl.js +7 -0
- package/editor-dist/qsharp-DXyYeYxl.js.map +1 -0
- package/editor-dist/r-CdQndTaG.js +7 -0
- package/editor-dist/r-CdQndTaG.js.map +1 -0
- package/editor-dist/razor-2hK06ujo.js +7 -0
- package/editor-dist/razor-2hK06ujo.js.map +1 -0
- package/editor-dist/redis-CVwtpugi.js +7 -0
- package/editor-dist/redis-CVwtpugi.js.map +1 -0
- package/editor-dist/redshift-25W9uPmb.js +7 -0
- package/editor-dist/redshift-25W9uPmb.js.map +1 -0
- package/editor-dist/restructuredtext-DfzH4Xui.js +7 -0
- package/editor-dist/restructuredtext-DfzH4Xui.js.map +1 -0
- package/editor-dist/ruby-Cp1zYvxS.js +7 -0
- package/editor-dist/ruby-Cp1zYvxS.js.map +1 -0
- package/editor-dist/rust-D5C2fndG.js +7 -0
- package/editor-dist/rust-D5C2fndG.js.map +1 -0
- package/editor-dist/sb-CDntyWJ8.js +7 -0
- package/editor-dist/sb-CDntyWJ8.js.map +1 -0
- package/editor-dist/scala-BoFRg7Ot.js +7 -0
- package/editor-dist/scala-BoFRg7Ot.js.map +1 -0
- package/editor-dist/scheme-Bio4gycK.js +7 -0
- package/editor-dist/scheme-Bio4gycK.js.map +1 -0
- package/editor-dist/scss-4Ik7cdeQ.js +9 -0
- package/editor-dist/scss-4Ik7cdeQ.js.map +1 -0
- package/editor-dist/shell-CX-rkNHf.js +7 -0
- package/editor-dist/shell-CX-rkNHf.js.map +1 -0
- package/editor-dist/solidity-Tw7wswEv.js +7 -0
- package/editor-dist/solidity-Tw7wswEv.js.map +1 -0
- package/editor-dist/sophia-C5WLch3f.js +7 -0
- package/editor-dist/sophia-C5WLch3f.js.map +1 -0
- package/editor-dist/sparql-DHaeiCBh.js +7 -0
- package/editor-dist/sparql-DHaeiCBh.js.map +1 -0
- package/editor-dist/sql-CCSDG5nI.js +7 -0
- package/editor-dist/sql-CCSDG5nI.js.map +1 -0
- package/editor-dist/st-pnP8ivHi.js +7 -0
- package/editor-dist/st-pnP8ivHi.js.map +1 -0
- package/editor-dist/swift-DwJ7jVG9.js +9 -0
- package/editor-dist/swift-DwJ7jVG9.js.map +1 -0
- package/editor-dist/systemverilog-B9Xyijhd.js +7 -0
- package/editor-dist/systemverilog-B9Xyijhd.js.map +1 -0
- package/editor-dist/tcl-DnHyzjbg.js +7 -0
- package/editor-dist/tcl-DnHyzjbg.js.map +1 -0
- package/editor-dist/tsMode-Cw5AzLtF.js +17 -0
- package/editor-dist/tsMode-Cw5AzLtF.js.map +1 -0
- package/editor-dist/twig-CPajHgWi.js +7 -0
- package/editor-dist/twig-CPajHgWi.js.map +1 -0
- package/editor-dist/typescript-BAFJZnBC.js +7 -0
- package/editor-dist/typescript-BAFJZnBC.js.map +1 -0
- package/editor-dist/typespec-D-MeaMDU.js +7 -0
- package/editor-dist/typespec-D-MeaMDU.js.map +1 -0
- package/editor-dist/vb-DgyLZaXg.js +7 -0
- package/editor-dist/vb-DgyLZaXg.js.map +1 -0
- package/editor-dist/wgsl-BIv9DU6q.js +304 -0
- package/editor-dist/wgsl-BIv9DU6q.js.map +1 -0
- package/editor-dist/xml-Ddf5gf45.js +7 -0
- package/editor-dist/xml-Ddf5gf45.js.map +1 -0
- package/editor-dist/yaml-8HeiBhL6.js +7 -0
- package/editor-dist/yaml-8HeiBhL6.js.map +1 -0
- package/index.d.ts +60 -0
- package/package.json +40 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
export type EditorDistSource = "flag" | "env" | "embedded" | "missing";
|
|
3
|
+
export interface EditorDistResolution {
|
|
4
|
+
dir: string | null;
|
|
5
|
+
indexPath: string | null;
|
|
6
|
+
source: EditorDistSource;
|
|
7
|
+
reason?: string;
|
|
8
|
+
tried?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface ResolveEditorDistOptions {
|
|
11
|
+
editorDist?: string;
|
|
12
|
+
env?: NodeJS.ProcessEnv;
|
|
13
|
+
embeddedDir?: string;
|
|
14
|
+
fsImpl?: Pick<typeof fs, "stat" | "access">;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveEditorDist(options?: ResolveEditorDistOptions): Promise<EditorDistResolution>;
|
|
17
|
+
export declare function defaultEmbeddedDir(): string;
|
|
18
|
+
export declare function buildEditorMissingHtml(resolution: EditorDistResolution): string;
|
|
19
|
+
//# sourceMappingURL=editor-dist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-dist.d.ts","sourceRoot":"","sources":["../src/editor-dist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AAIzC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;CAC7C;AAID,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiD7G;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AAaD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAiC/E"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const DEFAULT_INDEX = "index.html";
|
|
5
|
+
export async function resolveEditorDist(options = {}) {
|
|
6
|
+
const env = options.env ?? process.env;
|
|
7
|
+
const fsImpl = options.fsImpl ?? fs;
|
|
8
|
+
const tried = [];
|
|
9
|
+
const maybeCheck = async (rawPath, source) => {
|
|
10
|
+
if (!rawPath)
|
|
11
|
+
return null;
|
|
12
|
+
const resolved = path.isAbsolute(rawPath) ? rawPath : path.resolve(process.cwd(), rawPath);
|
|
13
|
+
tried.push(resolved);
|
|
14
|
+
const ok = await hasIndex(fsImpl, resolved);
|
|
15
|
+
if (ok) {
|
|
16
|
+
return {
|
|
17
|
+
dir: resolved,
|
|
18
|
+
indexPath: path.join(resolved, DEFAULT_INDEX),
|
|
19
|
+
source,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
dir: resolved,
|
|
24
|
+
indexPath: null,
|
|
25
|
+
source: "missing",
|
|
26
|
+
reason: `Missing ${DEFAULT_INDEX} in ${resolved}`,
|
|
27
|
+
tried,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const flagResult = await maybeCheck(options.editorDist, "flag");
|
|
31
|
+
if (flagResult)
|
|
32
|
+
return flagResult;
|
|
33
|
+
const envResult = await maybeCheck(env?.FLUX_EDITOR_DIST, "env");
|
|
34
|
+
if (envResult)
|
|
35
|
+
return envResult;
|
|
36
|
+
const embedded = options.embeddedDir ?? defaultEmbeddedDir();
|
|
37
|
+
tried.push(embedded);
|
|
38
|
+
if (await hasIndex(fsImpl, embedded)) {
|
|
39
|
+
return {
|
|
40
|
+
dir: embedded,
|
|
41
|
+
indexPath: path.join(embedded, DEFAULT_INDEX),
|
|
42
|
+
source: "embedded",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
dir: embedded,
|
|
47
|
+
indexPath: null,
|
|
48
|
+
source: "missing",
|
|
49
|
+
reason: `Missing ${DEFAULT_INDEX} in ${embedded}`,
|
|
50
|
+
tried,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function defaultEmbeddedDir() {
|
|
54
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
55
|
+
return path.resolve(here, "..", "editor-dist");
|
|
56
|
+
}
|
|
57
|
+
async function hasIndex(fsImpl, dir) {
|
|
58
|
+
try {
|
|
59
|
+
const stats = await fsImpl.stat(dir);
|
|
60
|
+
if (!stats.isDirectory())
|
|
61
|
+
return false;
|
|
62
|
+
await fsImpl.access(path.join(dir, DEFAULT_INDEX));
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export function buildEditorMissingHtml(resolution) {
|
|
70
|
+
const tried = resolution.tried?.filter(Boolean) ?? [];
|
|
71
|
+
const listItems = tried.map((item) => `<li><code>${escapeHtml(item)}</code></li>`).join("");
|
|
72
|
+
const reason = resolution.reason ? `<p>${escapeHtml(resolution.reason)}</p>` : "";
|
|
73
|
+
return [
|
|
74
|
+
"<!doctype html>",
|
|
75
|
+
"<html>",
|
|
76
|
+
"<head>",
|
|
77
|
+
'<meta charset="utf-8">',
|
|
78
|
+
"<title>Flux Editor Missing</title>",
|
|
79
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
80
|
+
"<style>",
|
|
81
|
+
"body { font-family: \"Source Sans 3\", system-ui, sans-serif; padding: 24px; background: #141311; color: #ece7df; }",
|
|
82
|
+
"code { background: #1f1d19; padding: 2px 6px; border-radius: 4px; }",
|
|
83
|
+
"a { color: #9fd0ff; }",
|
|
84
|
+
"ul { padding-left: 20px; }",
|
|
85
|
+
"</style>",
|
|
86
|
+
"</head>",
|
|
87
|
+
"<body>",
|
|
88
|
+
"<h1>Flux editor bundle not found</h1>",
|
|
89
|
+
reason,
|
|
90
|
+
"<p>Build the in-repo editor bundle (base <code>/edit/</code>) and sync it into the viewer package:</p>",
|
|
91
|
+
"<pre><code>npm run build --workspace @flux-lang/editor-ui</code></pre>",
|
|
92
|
+
"<pre><code>npm run sync-editor</code></pre>",
|
|
93
|
+
"<p>Or point the viewer at a local editor build:</p>",
|
|
94
|
+
"<pre><code>FLUX_EDITOR_DIST=/abs/path/to/editor/dist flux view <file></code></pre>",
|
|
95
|
+
"<p>CLI flag option:</p>",
|
|
96
|
+
"<pre><code>flux view --editor-dist /abs/path/to/flux-site/dist <file></code></pre>",
|
|
97
|
+
"<p>Paths checked:</p>",
|
|
98
|
+
`<ul>${listItems || "<li><em>none</em></li>"}</ul>`,
|
|
99
|
+
"</body>",
|
|
100
|
+
"</html>",
|
|
101
|
+
].join("\n");
|
|
102
|
+
}
|
|
103
|
+
function escapeHtml(value) {
|
|
104
|
+
return value
|
|
105
|
+
.replace(/&/g, "&")
|
|
106
|
+
.replace(/</g, "<")
|
|
107
|
+
.replace(/>/g, ">")
|
|
108
|
+
.replace(/"/g, """);
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=editor-dist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-dist.js","sourceRoot":"","sources":["../src/editor-dist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAmBzC,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAAoC,EAAE;IAC5E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;IACpC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,MAAM,UAAU,GAAG,KAAK,EAAE,OAA2B,EAAE,MAAwB,EAAwC,EAAE;QACvH,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3F,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC5C,IAAI,EAAE,EAAE,CAAC;YACP,OAAO;gBACL,GAAG,EAAE,QAAQ;gBACb,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC;gBAC7C,MAAM;aACP,CAAC;QACJ,CA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Aa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createDocumentRuntimeIR, type RenderDocumentIR } from "@flux-lang/core";
|
|
2
|
+
import { renderHtml, type RenderHtmlResult } from "@flux-lang/render-html";
|
|
3
|
+
export declare const VIEWER_VERSION: string;
|
|
4
|
+
export interface ViewerServerOptions {
|
|
5
|
+
docPath: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
host?: string;
|
|
8
|
+
docstepMs?: number;
|
|
9
|
+
seed?: number;
|
|
10
|
+
allowNet?: string[];
|
|
11
|
+
docstepStart?: number;
|
|
12
|
+
advanceTime?: boolean;
|
|
13
|
+
timeRate?: number;
|
|
14
|
+
editorDist?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ViewerServer {
|
|
17
|
+
port: number;
|
|
18
|
+
url: string;
|
|
19
|
+
buildId?: string | null;
|
|
20
|
+
editorDist?: string | null;
|
|
21
|
+
close(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
type ViewerRenderOptions = Parameters<typeof renderHtml>[1];
|
|
24
|
+
export declare function noCacheHeaders(extra?: Record<string, string>): Record<string, string>;
|
|
25
|
+
export declare function computeBuildId(dir: string | null | undefined, indexPath: string | null | undefined): Promise<string | null>;
|
|
26
|
+
export declare function advanceViewerRuntime(runtime: ReturnType<typeof createDocumentRuntimeIR>, renderOptions: ViewerRenderOptions, advanceTime: boolean, dtSeconds: number, timeRate: number): {
|
|
27
|
+
ir: RenderDocumentIR;
|
|
28
|
+
render: RenderHtmlResult;
|
|
29
|
+
};
|
|
30
|
+
export declare function startViewerServer(options: ViewerServerOptions): Promise<ViewerServer>;
|
|
31
|
+
export declare function getViewerJs(): string;
|
|
32
|
+
export { resolveEditorDist, defaultEmbeddedDir } from "./editor-dist.js";
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,uBAAuB,EASvB,KAAK,gBAAgB,EAGtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQ3E,eAAO,MAAM,cAAc,QAAyD,CAAC;AAErF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAmED,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5D,wBAAgB,cAAc,CAAC,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzF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