@hpcc-js/observablehq-compiler 3.1.0 → 3.3.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/dist/index.js +4218 -15
- package/dist/index.js.map +1 -7
- package/dist/index.umd.cjs +37 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +17 -13
- package/src/__package__.ts +2 -2
- package/src/compiler.ts +1 -1
- package/src/cst.ts +1 -1
- package/src/index.ts +1 -1
- package/src/observable-shim.ts +2 -0
- package/src/parse.ts +136 -0
- package/src/types.ts +180 -0
- package/src/util.ts +2 -2
- package/src/writer.ts +1 -1
- package/types/compiler.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/observable-shim.d.ts +2 -0
- package/types/parse.d.ts +26 -0
- package/types/types.d.ts +165 -0
- package/types/util.d.ts +1 -1
- package/types/writer.d.ts +1 -1
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -7
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/observablehq-compiler",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "hpcc-js - ObservableHQ Compiler (unoffical)",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "./dist/index.umd.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
6
8
|
"exports": {
|
|
7
9
|
".": {
|
|
8
10
|
"types": "./types/index.d.ts",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.umd.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./dist/*": "./dist/*"
|
|
11
15
|
},
|
|
12
|
-
"
|
|
16
|
+
"browser": "./dist/index.umd.cjs",
|
|
13
17
|
"types": "./types/index.d.ts",
|
|
14
18
|
"files": [
|
|
15
19
|
"dist/*",
|
|
@@ -20,14 +24,14 @@
|
|
|
20
24
|
"ojscc": "bin/ojscc.mjs"
|
|
21
25
|
},
|
|
22
26
|
"scripts": {
|
|
23
|
-
"clean": "rimraf --glob lib* types dist
|
|
24
|
-
"bundle": "
|
|
25
|
-
"bundle-watch": "
|
|
27
|
+
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
|
|
28
|
+
"bundle": "vite build",
|
|
29
|
+
"bundle-watch": "vite --port 5514",
|
|
26
30
|
"gen-types": "tsc --project tsconfig.json",
|
|
27
31
|
"gen-types-watch": "npm run gen-types -- --watch",
|
|
28
32
|
"build": "run-p gen-types bundle",
|
|
29
|
-
"stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
|
|
30
33
|
"lint": "eslint ./src",
|
|
34
|
+
"lint-fix": "eslint --fix src/**/*.ts",
|
|
31
35
|
"docs": "typedoc --options tdoptions.json .",
|
|
32
36
|
"test-browser": "vitest run --project browser",
|
|
33
37
|
"test-node": "vitest run --project node",
|
|
@@ -35,15 +39,15 @@
|
|
|
35
39
|
"test-bin": "node ./bin/ojscc.mjs --version",
|
|
36
40
|
"test": "run-p test-both test-bin",
|
|
37
41
|
"coverage": "vitest run --coverage",
|
|
38
|
-
"update": "npx
|
|
39
|
-
"update-major": "npx
|
|
42
|
+
"update": "npx --yes npm-check-updates -u -t minor",
|
|
43
|
+
"update-major": "npx --yes npm-check-updates -u"
|
|
40
44
|
},
|
|
41
45
|
"dependencies": {
|
|
42
46
|
"yargs": "17.7.2"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
|
-
"@hpcc-js/esbuild-plugins": "^1.
|
|
46
|
-
"@
|
|
49
|
+
"@hpcc-js/esbuild-plugins": "^1.4.0",
|
|
50
|
+
"@observablehq/parser": "6.1.0",
|
|
47
51
|
"@observablehq/runtime": "5.9.9"
|
|
48
52
|
},
|
|
49
53
|
"repository": {
|
|
@@ -65,5 +69,5 @@
|
|
|
65
69
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
66
70
|
},
|
|
67
71
|
"homepage": "https://github.com/hpcc-systems/Visualization/tree/trunk/packages/observablehq-compiler",
|
|
68
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "145a4d4c8189c70f08e9804e63959d6dd398bd9f"
|
|
69
73
|
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/observablehq-compiler";
|
|
2
|
-
export const PKG_VERSION = "3.
|
|
3
|
-
export const BUILD_VERSION = "2.
|
|
2
|
+
export const PKG_VERSION = "3.2.0";
|
|
3
|
+
export const BUILD_VERSION = "3.2.1";
|
package/src/compiler.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ohq, splitModule } from "
|
|
1
|
+
import { ohq, splitModule } from "./observable-shim.ts";
|
|
2
2
|
import { parseCell, ParsedImportCell } from "./cst.ts";
|
|
3
3
|
import { Writer } from "./writer.ts";
|
|
4
4
|
import { fixRelativeUrl, isRelativePath, encodeBacktick, fetchEx, obfuscatedImport, ojs2notebook, omd2notebook } from "./util.ts";
|
package/src/cst.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ancestor, parseCell as ohqParseCell, Cell, Node, walk, AncestorVisitors } from "
|
|
1
|
+
import { ancestor, parseCell as ohqParseCell, Cell, Node, walk, AncestorVisitors } from "./observable-shim.ts";
|
|
2
2
|
|
|
3
3
|
import { fixRelativeUrl, createFunction, Refs } from "./util.ts";
|
|
4
4
|
|
package/src/index.ts
CHANGED
package/src/parse.ts
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Compare with ../../../node_modules/@observablehq/parser/src/parse.js
|
|
2
|
+
import { getLineInfo, tokTypes, Statement, ModuleDeclaration, Expression as ExpressionBase, Node } from "acorn";
|
|
3
|
+
import { ancestor, RecursiveVisitors, AncestorVisitors } from "acorn-walk";
|
|
4
|
+
import { CellParser, parseCell as ohqParseCell, walk as ohqWalk } from "@observablehq/parser";
|
|
5
|
+
import defaultGlobals from "../../../node_modules/@observablehq/parser/src/globals.js";
|
|
6
|
+
import findReferences from "../../../node_modules/@observablehq/parser/src/references.js";
|
|
7
|
+
import findFeatures from "../../../node_modules/@observablehq/parser/src/features.js";
|
|
8
|
+
|
|
9
|
+
export interface MutableExpression extends Node {
|
|
10
|
+
type: "MutableExpression"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ViewExpression extends Node {
|
|
14
|
+
type: "ViewExpression"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type Expression = ExpressionBase | MutableExpression | ViewExpression;
|
|
18
|
+
|
|
19
|
+
// Find references.
|
|
20
|
+
// Check for illegal references to arguments.
|
|
21
|
+
// Check for illegal assignments to global references.
|
|
22
|
+
function parseReferences(cell, input, globals = defaultGlobals) {
|
|
23
|
+
if (!cell.body) {
|
|
24
|
+
cell.references = [];
|
|
25
|
+
} else if (cell.body.type === "ImportDeclaration") {
|
|
26
|
+
// This is correct?!?
|
|
27
|
+
cell.references = cell.body.specifiers
|
|
28
|
+
? cell.body.specifiers.map(i => i.imported)
|
|
29
|
+
: [];
|
|
30
|
+
} else {
|
|
31
|
+
try {
|
|
32
|
+
cell.references = findReferences(cell, globals);
|
|
33
|
+
} catch (error: any) {
|
|
34
|
+
if (error.node) {
|
|
35
|
+
const loc = getLineInfo(input, error.node.start);
|
|
36
|
+
error.message += ` (${loc.line}:${loc.column})`;
|
|
37
|
+
error.pos = error.node.start;
|
|
38
|
+
error.loc = loc;
|
|
39
|
+
delete error.node;
|
|
40
|
+
}
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return cell;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Find features: file attachments, secrets, database clients.
|
|
48
|
+
// Check for illegal references to arguments.
|
|
49
|
+
// Check for illegal assignments to global references.
|
|
50
|
+
function parseFeatures(cell, input) {
|
|
51
|
+
if (cell.body && cell.body.type !== "ImportDeclaration") {
|
|
52
|
+
try {
|
|
53
|
+
cell.fileAttachments = findFeatures(cell, "FileAttachment");
|
|
54
|
+
cell.databaseClients = findFeatures(cell, "DatabaseClient");
|
|
55
|
+
cell.secrets = findFeatures(cell, "Secret");
|
|
56
|
+
} catch (error: any) {
|
|
57
|
+
if (error.node) {
|
|
58
|
+
const loc = getLineInfo(input, error.node.start);
|
|
59
|
+
error.message += ` (${loc.line}:${loc.column})`;
|
|
60
|
+
error.pos = error.node.start;
|
|
61
|
+
error.loc = loc;
|
|
62
|
+
delete error.node;
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
cell.fileAttachments = new Map();
|
|
68
|
+
cell.databaseClients = new Map();
|
|
69
|
+
cell.secrets = new Map();
|
|
70
|
+
}
|
|
71
|
+
return cell;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
class ModuleParser extends CellParser {
|
|
75
|
+
|
|
76
|
+
parseTopLevel(node: { cells?: Cell[] }) {
|
|
77
|
+
if (!node.cells) node.cells = [];
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
while (this.type !== tokTypes.eof) {
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
const cell: Cell = this.parseCell(this.startNode());
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
cell.input = this.input;
|
|
84
|
+
node.cells.push(cell);
|
|
85
|
+
}
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
this.next();
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
return this.finishNode(node, "Program");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
export function parseModule(input, { globals }: { globals: any } = {}) {
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
const program = ModuleParser.parse(input, { ecmaVersion: 2020 });
|
|
97
|
+
for (const cell of program.cells) {
|
|
98
|
+
parseReferences(cell, input, globals);
|
|
99
|
+
parseFeatures(cell, input);
|
|
100
|
+
}
|
|
101
|
+
return program;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface Cell extends Node {
|
|
105
|
+
type: "Cell";
|
|
106
|
+
id: Expression;
|
|
107
|
+
text: string;
|
|
108
|
+
body?: Statement | ModuleDeclaration | Expression;
|
|
109
|
+
references: unknown[];
|
|
110
|
+
async: boolean;
|
|
111
|
+
generator: boolean;
|
|
112
|
+
strict: boolean;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function splitModule(input: string): Cell[] {
|
|
116
|
+
return (ModuleParser as any)
|
|
117
|
+
.parse(input, { ecmaVersion: "latest" })
|
|
118
|
+
.cells.map((cell: any) => ({
|
|
119
|
+
type: "Cell",
|
|
120
|
+
text: input.substring(cell.start, cell.end),
|
|
121
|
+
start: cell.start,
|
|
122
|
+
end: cell.end
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
type Node,
|
|
128
|
+
ancestor,
|
|
129
|
+
type AncestorVisitors
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export function parseCell(input: string): Cell {
|
|
133
|
+
return ohqParseCell(input);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const walk: RecursiveVisitors<any> = ohqWalk;
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export namespace ohq {
|
|
2
|
+
|
|
3
|
+
// ObservableHQ Notebook Format ---
|
|
4
|
+
export interface Owner {
|
|
5
|
+
id?: string;
|
|
6
|
+
github_login?: string;
|
|
7
|
+
avatar_url?: string;
|
|
8
|
+
login?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
bio?: string;
|
|
11
|
+
home_url?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
tier?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Creator {
|
|
17
|
+
id?: string;
|
|
18
|
+
github_login?: string;
|
|
19
|
+
avatar_url?: string;
|
|
20
|
+
login?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
bio?: string;
|
|
23
|
+
home_url?: string;
|
|
24
|
+
tier?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface Author {
|
|
28
|
+
id?: string;
|
|
29
|
+
avatar_url?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
login?: string;
|
|
32
|
+
bio?: string;
|
|
33
|
+
home_url?: string;
|
|
34
|
+
github_login?: string;
|
|
35
|
+
tier?: string;
|
|
36
|
+
approved?: boolean;
|
|
37
|
+
description?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Owner2 {
|
|
41
|
+
id?: string;
|
|
42
|
+
github_login?: string;
|
|
43
|
+
avatar_url?: string;
|
|
44
|
+
login?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
bio?: string;
|
|
47
|
+
home_url?: string;
|
|
48
|
+
type?: string;
|
|
49
|
+
tier?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface Collection {
|
|
53
|
+
id?: string;
|
|
54
|
+
type?: string;
|
|
55
|
+
slug?: string;
|
|
56
|
+
title?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
update_time?: Date;
|
|
59
|
+
pinned?: boolean;
|
|
60
|
+
ordered?: boolean;
|
|
61
|
+
custom_thumbnail?: any;
|
|
62
|
+
default_thumbnail?: string;
|
|
63
|
+
thumbnail?: string;
|
|
64
|
+
listing_count?: number;
|
|
65
|
+
parent_collection_count?: number;
|
|
66
|
+
owner?: Owner2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface File {
|
|
70
|
+
id?: string;
|
|
71
|
+
url: string;
|
|
72
|
+
download_url?: string;
|
|
73
|
+
name: string;
|
|
74
|
+
create_time?: Date;
|
|
75
|
+
status?: string;
|
|
76
|
+
size?: number;
|
|
77
|
+
mime_type?: string;
|
|
78
|
+
content_encoding?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface User {
|
|
82
|
+
id?: string;
|
|
83
|
+
github_login?: string;
|
|
84
|
+
avatar_url?: string;
|
|
85
|
+
login?: string;
|
|
86
|
+
name?: string;
|
|
87
|
+
bio?: string;
|
|
88
|
+
home_url?: string;
|
|
89
|
+
tier?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface Comment {
|
|
93
|
+
id?: string;
|
|
94
|
+
content?: string;
|
|
95
|
+
node_id?: number;
|
|
96
|
+
create_time?: Date;
|
|
97
|
+
update_time?: any;
|
|
98
|
+
resolved?: boolean;
|
|
99
|
+
user?: User;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface Node {
|
|
103
|
+
id: string | number;
|
|
104
|
+
mode: string;
|
|
105
|
+
value: string;
|
|
106
|
+
pinned?: boolean; // Show source code?
|
|
107
|
+
data?: any;
|
|
108
|
+
name?: string;
|
|
109
|
+
// NodeEx ---
|
|
110
|
+
start?: number;
|
|
111
|
+
end?: number;
|
|
112
|
+
private?: boolean;
|
|
113
|
+
outputs?: string[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface Notebook {
|
|
117
|
+
id?: string;
|
|
118
|
+
slug?: any;
|
|
119
|
+
trashed?: boolean;
|
|
120
|
+
description?: string;
|
|
121
|
+
likes?: number;
|
|
122
|
+
publish_level?: string;
|
|
123
|
+
forks?: number;
|
|
124
|
+
fork_of?: any;
|
|
125
|
+
update_time?: Date;
|
|
126
|
+
publish_time?: Date;
|
|
127
|
+
publish_version?: number;
|
|
128
|
+
latest_version?: number;
|
|
129
|
+
thumbnail?: string;
|
|
130
|
+
default_thumbnail?: string;
|
|
131
|
+
roles?: any[];
|
|
132
|
+
sharing?: any;
|
|
133
|
+
owner?: Owner;
|
|
134
|
+
creator?: Creator;
|
|
135
|
+
authors?: Author[];
|
|
136
|
+
collections?: Collection[];
|
|
137
|
+
files: File[];
|
|
138
|
+
comments?: Comment[];
|
|
139
|
+
commenting_lock?: any;
|
|
140
|
+
suggestion_from?: any;
|
|
141
|
+
suggestions_to?: any[];
|
|
142
|
+
version?: number;
|
|
143
|
+
title?: string;
|
|
144
|
+
license?: string;
|
|
145
|
+
copyright?: string;
|
|
146
|
+
nodes: Node[];
|
|
147
|
+
resolutions?: any[];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// @observablehq/runtime API ---
|
|
151
|
+
export type InspectorFactory = (name?: string) => Inspector;
|
|
152
|
+
|
|
153
|
+
export interface Inspector {
|
|
154
|
+
_node?: HTMLDivElement;
|
|
155
|
+
pending();
|
|
156
|
+
fulfilled(value);
|
|
157
|
+
rejected(error);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface Runtime {
|
|
161
|
+
fileAttachments(func: (name: string) => ohq.File): any;
|
|
162
|
+
module(define?, inspector?: InspectorFactory): Module;
|
|
163
|
+
dispose(): void;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface Module {
|
|
167
|
+
derive(specifiers: string[] | { name: string, alias: string }[], source: any);
|
|
168
|
+
import(name: string, alias: string | undefined, mod: Module): Variable;
|
|
169
|
+
builtin(name: string, _: any);
|
|
170
|
+
variable(inspector?: Inspector): Variable;
|
|
171
|
+
value(name: string): Promise<any>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface Variable {
|
|
175
|
+
delete();
|
|
176
|
+
define(name?: string, inputs?: string[], definition?: any);
|
|
177
|
+
import(name: string, otherModule: ohq.Module);
|
|
178
|
+
import(name: string, alias: string, otherModule: ohq.Module);
|
|
179
|
+
}
|
|
180
|
+
}
|
package/src/util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ohq } from "
|
|
2
|
-
import { parseCell, splitModule } from "
|
|
1
|
+
import type { ohq } from "./observable-shim.ts";
|
|
2
|
+
import { parseCell, splitModule } from "./observable-shim.ts";
|
|
3
3
|
|
|
4
4
|
const FuncTypes = {
|
|
5
5
|
functionType: Object.getPrototypeOf(function () { }).constructor,
|
package/src/writer.ts
CHANGED
package/types/compiler.d.ts
CHANGED
package/types/index.d.ts
CHANGED
package/types/parse.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Statement, ModuleDeclaration, Expression as ExpressionBase, Node } from "acorn";
|
|
2
|
+
import { ancestor, RecursiveVisitors, AncestorVisitors } from "acorn-walk";
|
|
3
|
+
export interface MutableExpression extends Node {
|
|
4
|
+
type: "MutableExpression";
|
|
5
|
+
}
|
|
6
|
+
export interface ViewExpression extends Node {
|
|
7
|
+
type: "ViewExpression";
|
|
8
|
+
}
|
|
9
|
+
export type Expression = ExpressionBase | MutableExpression | ViewExpression;
|
|
10
|
+
export declare function parseModule(input: any, { globals }?: {
|
|
11
|
+
globals: any;
|
|
12
|
+
}): any;
|
|
13
|
+
export interface Cell extends Node {
|
|
14
|
+
type: "Cell";
|
|
15
|
+
id: Expression;
|
|
16
|
+
text: string;
|
|
17
|
+
body?: Statement | ModuleDeclaration | Expression;
|
|
18
|
+
references: unknown[];
|
|
19
|
+
async: boolean;
|
|
20
|
+
generator: boolean;
|
|
21
|
+
strict: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function splitModule(input: string): Cell[];
|
|
24
|
+
export { type Node, ancestor, type AncestorVisitors };
|
|
25
|
+
export declare function parseCell(input: string): Cell;
|
|
26
|
+
export declare const walk: RecursiveVisitors<any>;
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export declare namespace ohq {
|
|
2
|
+
interface Owner {
|
|
3
|
+
id?: string;
|
|
4
|
+
github_login?: string;
|
|
5
|
+
avatar_url?: string;
|
|
6
|
+
login?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
bio?: string;
|
|
9
|
+
home_url?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
tier?: string;
|
|
12
|
+
}
|
|
13
|
+
interface Creator {
|
|
14
|
+
id?: string;
|
|
15
|
+
github_login?: string;
|
|
16
|
+
avatar_url?: string;
|
|
17
|
+
login?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
bio?: string;
|
|
20
|
+
home_url?: string;
|
|
21
|
+
tier?: string;
|
|
22
|
+
}
|
|
23
|
+
interface Author {
|
|
24
|
+
id?: string;
|
|
25
|
+
avatar_url?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
login?: string;
|
|
28
|
+
bio?: string;
|
|
29
|
+
home_url?: string;
|
|
30
|
+
github_login?: string;
|
|
31
|
+
tier?: string;
|
|
32
|
+
approved?: boolean;
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
interface Owner2 {
|
|
36
|
+
id?: string;
|
|
37
|
+
github_login?: string;
|
|
38
|
+
avatar_url?: string;
|
|
39
|
+
login?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
bio?: string;
|
|
42
|
+
home_url?: string;
|
|
43
|
+
type?: string;
|
|
44
|
+
tier?: string;
|
|
45
|
+
}
|
|
46
|
+
interface Collection {
|
|
47
|
+
id?: string;
|
|
48
|
+
type?: string;
|
|
49
|
+
slug?: string;
|
|
50
|
+
title?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
update_time?: Date;
|
|
53
|
+
pinned?: boolean;
|
|
54
|
+
ordered?: boolean;
|
|
55
|
+
custom_thumbnail?: any;
|
|
56
|
+
default_thumbnail?: string;
|
|
57
|
+
thumbnail?: string;
|
|
58
|
+
listing_count?: number;
|
|
59
|
+
parent_collection_count?: number;
|
|
60
|
+
owner?: Owner2;
|
|
61
|
+
}
|
|
62
|
+
interface File {
|
|
63
|
+
id?: string;
|
|
64
|
+
url: string;
|
|
65
|
+
download_url?: string;
|
|
66
|
+
name: string;
|
|
67
|
+
create_time?: Date;
|
|
68
|
+
status?: string;
|
|
69
|
+
size?: number;
|
|
70
|
+
mime_type?: string;
|
|
71
|
+
content_encoding?: string;
|
|
72
|
+
}
|
|
73
|
+
interface User {
|
|
74
|
+
id?: string;
|
|
75
|
+
github_login?: string;
|
|
76
|
+
avatar_url?: string;
|
|
77
|
+
login?: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
bio?: string;
|
|
80
|
+
home_url?: string;
|
|
81
|
+
tier?: string;
|
|
82
|
+
}
|
|
83
|
+
interface Comment {
|
|
84
|
+
id?: string;
|
|
85
|
+
content?: string;
|
|
86
|
+
node_id?: number;
|
|
87
|
+
create_time?: Date;
|
|
88
|
+
update_time?: any;
|
|
89
|
+
resolved?: boolean;
|
|
90
|
+
user?: User;
|
|
91
|
+
}
|
|
92
|
+
interface Node {
|
|
93
|
+
id: string | number;
|
|
94
|
+
mode: string;
|
|
95
|
+
value: string;
|
|
96
|
+
pinned?: boolean;
|
|
97
|
+
data?: any;
|
|
98
|
+
name?: string;
|
|
99
|
+
start?: number;
|
|
100
|
+
end?: number;
|
|
101
|
+
private?: boolean;
|
|
102
|
+
outputs?: string[];
|
|
103
|
+
}
|
|
104
|
+
interface Notebook {
|
|
105
|
+
id?: string;
|
|
106
|
+
slug?: any;
|
|
107
|
+
trashed?: boolean;
|
|
108
|
+
description?: string;
|
|
109
|
+
likes?: number;
|
|
110
|
+
publish_level?: string;
|
|
111
|
+
forks?: number;
|
|
112
|
+
fork_of?: any;
|
|
113
|
+
update_time?: Date;
|
|
114
|
+
publish_time?: Date;
|
|
115
|
+
publish_version?: number;
|
|
116
|
+
latest_version?: number;
|
|
117
|
+
thumbnail?: string;
|
|
118
|
+
default_thumbnail?: string;
|
|
119
|
+
roles?: any[];
|
|
120
|
+
sharing?: any;
|
|
121
|
+
owner?: Owner;
|
|
122
|
+
creator?: Creator;
|
|
123
|
+
authors?: Author[];
|
|
124
|
+
collections?: Collection[];
|
|
125
|
+
files: File[];
|
|
126
|
+
comments?: Comment[];
|
|
127
|
+
commenting_lock?: any;
|
|
128
|
+
suggestion_from?: any;
|
|
129
|
+
suggestions_to?: any[];
|
|
130
|
+
version?: number;
|
|
131
|
+
title?: string;
|
|
132
|
+
license?: string;
|
|
133
|
+
copyright?: string;
|
|
134
|
+
nodes: Node[];
|
|
135
|
+
resolutions?: any[];
|
|
136
|
+
}
|
|
137
|
+
type InspectorFactory = (name?: string) => Inspector;
|
|
138
|
+
interface Inspector {
|
|
139
|
+
_node?: HTMLDivElement;
|
|
140
|
+
pending(): any;
|
|
141
|
+
fulfilled(value: any): any;
|
|
142
|
+
rejected(error: any): any;
|
|
143
|
+
}
|
|
144
|
+
interface Runtime {
|
|
145
|
+
fileAttachments(func: (name: string) => ohq.File): any;
|
|
146
|
+
module(define?: any, inspector?: InspectorFactory): Module;
|
|
147
|
+
dispose(): void;
|
|
148
|
+
}
|
|
149
|
+
interface Module {
|
|
150
|
+
derive(specifiers: string[] | {
|
|
151
|
+
name: string;
|
|
152
|
+
alias: string;
|
|
153
|
+
}[], source: any): any;
|
|
154
|
+
import(name: string, alias: string | undefined, mod: Module): Variable;
|
|
155
|
+
builtin(name: string, _: any): any;
|
|
156
|
+
variable(inspector?: Inspector): Variable;
|
|
157
|
+
value(name: string): Promise<any>;
|
|
158
|
+
}
|
|
159
|
+
interface Variable {
|
|
160
|
+
delete(): any;
|
|
161
|
+
define(name?: string, inputs?: string[], definition?: any): any;
|
|
162
|
+
import(name: string, otherModule: ohq.Module): any;
|
|
163
|
+
import(name: string, alias: string, otherModule: ohq.Module): any;
|
|
164
|
+
}
|
|
165
|
+
}
|
package/types/util.d.ts
CHANGED
package/types/writer.d.ts
CHANGED
package/dist/index.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap";:root{--syntax-normal: #1b1e23;--syntax-comment: #828282;--syntax-number: #20a5ba;--syntax-keyword: #c30771;--syntax-atom: #10a778;--syntax-string: #008ec4;--syntax-error: #ffbedc;--syntax-unknown-variable: #838383;--syntax-known-variable: #005f87;--syntax-matchbracket: #20bbfc;--syntax-key: #6636b4;--mono-fonts: 82%/1.5 Menlo, Consolas, monospace}.observablehq--expanded,.observablehq--collapsed,.observablehq--function,.observablehq--import,.observablehq--string:before,.observablehq--string:after,.observablehq--gray{color:var(--syntax-normal)}.observablehq--collapsed,.observablehq--expanded.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}a[href],.observablehq--keyword,.observablehq--blue{color:#3182bd}.hljs-deletion,.hljs-variable,.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--null,.observablehq--undefined,.observablehq--boolean,.hljs-literal{color:var(--syntax-atom)}.hljs-number,.hljs-regexp,.hljs-bullet,.hljs-link,.observablehq--bigint,.observablehq--number,.observablehq--date,.observablehq--regexp,.observablehq--symbol,.observablehq--green{color:var(--syntax-number)}.observablehq--index,.observablehq--key{color:var(--syntax-key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.hljs-string,.hljs-meta,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-addition,.observablehq--string,.observablehq--purple{color:var(--syntax-string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq:empty:after,.observablehq>link:only-child,.observablehq>style:only-child,.observablehq--inspect{font:var(--monospace-font);overflow-x:auto;display:block;padding:4px 0;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap}:root{--syntax-diff: #24292e;--syntax-diff-bg: #ffffff;--hr: rgba(0, 0, 0, .05);--monospace: Menlo, Consolas, monospace;--monospace-font: 14px/1.5 var(--monospace);--serif: "Source Serif Pro", "Iowan Old Style", "Apple Garamond", "Palatino Linotype", "Times New Roman", "Droid Serif", Times, serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--sans-serif: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, sans-serif}html{font:17px/1.5 var(--serif);-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#1b1e23}body{margin:0 14px}body.fullscreen{margin:0}h1,h2,h3,h4,h5,h6{color:#333;font-weight:700;line-height:1.15;margin-top:0;margin-bottom:.25rem}h2~p,h3~p,h4~p,h2~table,h3~table,h4~table{margin-top:0}.observablehq:first-of-type h1+h2{font-size:20px;font-style:italic;font-weight:400;margin-bottom:1rem}a[href]{text-decoration:none}a[href]:hover{text-decoration:underline}h1 code,h2 code,h3 code,h4 code,h5 code,h6 code{font-size:90%}pre,code,tt{font-family:var(--monospace);font-size:14px;line-height:1.5}img{max-width:calc(100vw - 28px)}p,table,figure,figcaption,h1,h2,h3,h4,h5,h6,.katex-display{max-width:640px}blockquote,ol,ul{max-width:600px}blockquote{margin:1rem 1.5rem}ul,ol{padding-left:28px}hr{height:1px;margin:1rem 0;padding:1rem 0;border:none;background:no-repeat center/100% 1px linear-gradient(to right,var(--hr),var(--hr))}pre{padding:2px 0}.observablehq--md-pre{overflow-x:auto}input:not([type]),input[type=email],input[type=number],input[type=password],input[type=range],input[type=search],input[type=tel],input[type=text],input[type=url]{width:240px}input,canvas,button{vertical-align:middle}button,input,textarea{accent-color:#3b5fc0}table{width:100%;border-collapse:collapse;font:13px/1.2 var(--sans-serif)}table pre,table code,table tt{font-size:inherit;line-height:inherit}th>pre:only-child,td>pre:only-child{margin:0;padding:0}th{color:#111;text-align:left;vertical-align:bottom}td{color:#444;vertical-align:top}th,td{padding:3px 6.5px 3px 0}th:last-child,td:last-child{padding-right:0}tr:not(:last-child){border-bottom:solid 1px #eee}thead tr{border-bottom:solid 1px #ccc}figure,table{margin:1rem 0}figure img{max-width:100%}figcaption{font:small var(--sans-serif);color:var(--syntax-unknown-variable)}.observablehq--caret{margin-right:4px;vertical-align:baseline}.observablehq--field{text-indent:-1rem;margin-left:1rem}.observablehq--prototype-key,.observablehq--empty,.hljs-comment{color:var(--syntax-comment)}.hljs-built_in{color:var(--syntax-known-variable)}.observablehq--unknown{color:var(--syntax-unknown-variable)}.hljs-keyword,.hljs-selector-tag,.hljs-section,.hljs-doctag,.hljs-type,.hljs-tag,.hljs-name,.hljs-selector-id,.hljs-selector-class,.hljs-strong{color:var(--syntax-keyword)}.observablehq{position:relative;margin:17px 0;min-height:1.5rem}.observablehq:before{content:"";position:absolute;left:-14px;top:0;bottom:1px;width:4px;transition:background-color .25s linear}.observablehq--running:before,.observablehq--changed:before{background-color:#a9b0bc;transition:none}.observablehq--error:before{background-color:#e7040f}.observablehq:not(.observablehq--running):empty:after{content:"<detached>";color:var(--syntax-comment);font-style:oblique}.observablehq>link:only-child,.observablehq>style:only-child{visibility:hidden;white-space:nowrap;color:var(--syntax-keyword)}.observablehq>link:only-child:before{content:"<link>";visibility:visible;text-decoration:none;pointer-events:none}.observablehq>style:only-child:before{content:"<style>";visibility:visible}.observablehq--inspect.observablehq--import{white-space:normal}.observablehq--inspect::-webkit-scrollbar{display:none}.observablehq--string-expand{margin-left:6px;padding:2px 6px;border-radius:2px;font-size:80%;background:#eee;color:var(--syntax-normal);cursor:pointer;vertical-align:middle;position:sticky;right:0}.observablehq--string-expand:hover,.observablehq--string-expand:active{background:#ddd}
|
|
2
|
-
/*# sourceMappingURL=index.css.map */
|