worldorbit 2.6.0 → 3.0.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/README.md +20 -9
- package/dist/browser/core/dist/atlas-edit.d.ts +11 -0
- package/dist/browser/core/dist/atlas-edit.js +347 -0
- package/dist/browser/core/dist/atlas-utils.d.ts +22 -0
- package/dist/browser/core/dist/atlas-utils.js +189 -0
- package/dist/browser/core/dist/atlas-validate.d.ts +2 -0
- package/dist/browser/core/dist/atlas-validate.js +488 -0
- package/dist/browser/core/dist/diagnostics.d.ts +10 -0
- package/dist/browser/core/dist/diagnostics.js +109 -0
- package/dist/browser/core/dist/draft-parse.d.ts +3 -0
- package/dist/browser/core/dist/draft-parse.js +1654 -0
- package/dist/browser/core/dist/draft.d.ts +21 -0
- package/dist/browser/core/dist/draft.js +482 -0
- package/dist/browser/core/dist/errors.d.ts +7 -0
- package/dist/browser/core/dist/errors.js +16 -0
- package/dist/browser/core/dist/format.d.ts +4 -0
- package/dist/browser/core/dist/format.js +613 -0
- package/dist/browser/core/dist/index.d.ts +29 -0
- package/dist/browser/core/dist/index.js +35 -6542
- package/dist/browser/core/dist/load.d.ts +4 -0
- package/dist/browser/core/dist/load.js +182 -0
- package/dist/browser/core/dist/markdown.d.ts +2 -0
- package/dist/browser/core/dist/markdown.js +37 -0
- package/dist/browser/core/dist/normalize.d.ts +2 -0
- package/dist/browser/core/dist/normalize.js +312 -0
- package/dist/browser/core/dist/parse.d.ts +2 -0
- package/dist/browser/core/dist/parse.js +133 -0
- package/dist/browser/core/dist/scene.d.ts +3 -0
- package/dist/browser/core/dist/scene.js +1901 -0
- package/dist/browser/core/dist/schema.d.ts +8 -0
- package/dist/browser/core/dist/schema.js +298 -0
- package/dist/browser/core/dist/spatial-scene.d.ts +3 -0
- package/dist/browser/core/dist/spatial-scene.js +420 -0
- package/dist/browser/core/dist/tokenize.d.ts +4 -0
- package/dist/browser/core/dist/tokenize.js +68 -0
- package/dist/browser/core/dist/types.d.ts +637 -0
- package/dist/browser/core/dist/types.js +1 -0
- package/dist/browser/core/dist/validate.d.ts +2 -0
- package/dist/browser/core/dist/validate.js +56 -0
- package/dist/browser/editor/dist/editor.d.ts +2 -0
- package/dist/browser/editor/dist/editor.js +3700 -0
- package/dist/browser/editor/dist/index.d.ts +2 -0
- package/dist/browser/editor/dist/index.js +1 -12250
- package/dist/browser/editor/dist/types.d.ts +59 -0
- package/dist/browser/editor/dist/types.js +1 -0
- package/dist/browser/markdown/dist/html.d.ts +3 -0
- package/dist/browser/markdown/dist/html.js +64 -0
- package/dist/browser/markdown/dist/index.d.ts +4 -0
- package/dist/browser/markdown/dist/index.js +3 -6179
- package/dist/browser/markdown/dist/rehype.d.ts +10 -0
- package/dist/browser/markdown/dist/rehype.js +49 -0
- package/dist/browser/markdown/dist/remark.d.ts +9 -0
- package/dist/browser/markdown/dist/remark.js +28 -0
- package/dist/browser/markdown/dist/types.d.ts +11 -0
- package/dist/browser/markdown/dist/types.js +1 -0
- package/dist/browser/viewer/dist/atlas-state.d.ts +12 -0
- package/dist/browser/viewer/dist/atlas-state.js +269 -0
- package/dist/browser/viewer/dist/atlas-viewer.d.ts +2 -0
- package/dist/browser/viewer/dist/atlas-viewer.js +495 -0
- package/dist/browser/viewer/dist/custom-element.d.ts +1 -0
- package/dist/browser/viewer/dist/custom-element.js +78 -0
- package/dist/browser/viewer/dist/embed.d.ts +24 -0
- package/dist/browser/viewer/dist/embed.js +172 -0
- package/dist/browser/viewer/dist/errors.d.ts +6 -0
- package/dist/browser/viewer/dist/errors.js +12 -0
- package/dist/browser/viewer/dist/index.d.ts +10 -0
- package/dist/browser/viewer/dist/index.js +9 -8334
- package/dist/browser/viewer/dist/minimap.d.ts +3 -0
- package/dist/browser/viewer/dist/minimap.js +63 -0
- package/dist/browser/viewer/dist/render.d.ts +6 -0
- package/dist/browser/viewer/dist/render.js +670 -0
- package/dist/browser/viewer/dist/runtime-3d.d.ts +19 -0
- package/dist/browser/viewer/dist/runtime-3d.js +494 -0
- package/dist/browser/viewer/dist/theme.d.ts +4 -0
- package/dist/browser/viewer/dist/theme.js +103 -0
- package/dist/browser/viewer/dist/tooltip.d.ts +3 -0
- package/dist/browser/viewer/dist/tooltip.js +198 -0
- package/dist/browser/viewer/dist/types.d.ts +292 -0
- package/dist/browser/viewer/dist/types.js +1 -0
- package/dist/browser/viewer/dist/vendor/three.module.js +53032 -0
- package/dist/browser/viewer/dist/viewer-state.d.ts +19 -0
- package/dist/browser/viewer/dist/viewer-state.js +162 -0
- package/dist/browser/viewer/dist/viewer.d.ts +2 -0
- package/dist/browser/viewer/dist/viewer.js +1662 -0
- package/dist/unpkg/core/dist/atlas-edit.d.ts +11 -0
- package/dist/unpkg/core/dist/atlas-edit.js +347 -0
- package/dist/unpkg/core/dist/atlas-utils.d.ts +22 -0
- package/dist/unpkg/core/dist/atlas-utils.js +189 -0
- package/dist/unpkg/core/dist/atlas-validate.d.ts +2 -0
- package/dist/unpkg/core/dist/atlas-validate.js +488 -0
- package/dist/unpkg/core/dist/diagnostics.d.ts +10 -0
- package/dist/unpkg/core/dist/diagnostics.js +109 -0
- package/dist/unpkg/core/dist/draft-parse.d.ts +3 -0
- package/dist/unpkg/core/dist/draft-parse.js +1654 -0
- package/dist/unpkg/core/dist/draft.d.ts +21 -0
- package/dist/unpkg/core/dist/draft.js +482 -0
- package/dist/unpkg/core/dist/errors.d.ts +7 -0
- package/dist/unpkg/core/dist/errors.js +16 -0
- package/dist/unpkg/core/dist/format.d.ts +4 -0
- package/dist/unpkg/core/dist/format.js +613 -0
- package/dist/unpkg/core/dist/index.d.ts +29 -0
- package/dist/unpkg/core/dist/index.js +35 -6614
- package/dist/unpkg/core/dist/load.d.ts +4 -0
- package/dist/unpkg/core/dist/load.js +182 -0
- package/dist/unpkg/core/dist/markdown.d.ts +2 -0
- package/dist/unpkg/core/dist/markdown.js +37 -0
- package/dist/unpkg/core/dist/normalize.d.ts +2 -0
- package/dist/unpkg/core/dist/normalize.js +312 -0
- package/dist/unpkg/core/dist/parse.d.ts +2 -0
- package/dist/unpkg/core/dist/parse.js +133 -0
- package/dist/unpkg/core/dist/scene.d.ts +3 -0
- package/dist/unpkg/core/dist/scene.js +1901 -0
- package/dist/unpkg/core/dist/schema.d.ts +8 -0
- package/dist/unpkg/core/dist/schema.js +298 -0
- package/dist/unpkg/core/dist/spatial-scene.d.ts +3 -0
- package/dist/unpkg/core/dist/spatial-scene.js +420 -0
- package/dist/unpkg/core/dist/tokenize.d.ts +4 -0
- package/dist/unpkg/core/dist/tokenize.js +68 -0
- package/dist/unpkg/core/dist/types.d.ts +637 -0
- package/dist/unpkg/core/dist/types.js +1 -0
- package/dist/unpkg/core/dist/validate.d.ts +2 -0
- package/dist/unpkg/core/dist/validate.js +56 -0
- package/dist/unpkg/editor/dist/editor.d.ts +2 -0
- package/dist/unpkg/editor/dist/editor.js +3700 -0
- package/dist/unpkg/editor/dist/index.d.ts +2 -0
- package/dist/unpkg/editor/dist/index.js +1 -12275
- package/dist/unpkg/editor/dist/types.d.ts +59 -0
- package/dist/unpkg/editor/dist/types.js +1 -0
- package/dist/unpkg/markdown/dist/html.d.ts +3 -0
- package/dist/unpkg/markdown/dist/html.js +64 -0
- package/dist/unpkg/markdown/dist/index.d.ts +4 -0
- package/dist/unpkg/markdown/dist/index.js +3 -6207
- package/dist/unpkg/markdown/dist/rehype.d.ts +10 -0
- package/dist/unpkg/markdown/dist/rehype.js +49 -0
- package/dist/unpkg/markdown/dist/remark.d.ts +9 -0
- package/dist/unpkg/markdown/dist/remark.js +28 -0
- package/dist/unpkg/markdown/dist/types.d.ts +11 -0
- package/dist/unpkg/markdown/dist/types.js +1 -0
- package/dist/unpkg/viewer/dist/atlas-state.d.ts +12 -0
- package/dist/unpkg/viewer/dist/atlas-state.js +269 -0
- package/dist/unpkg/viewer/dist/atlas-viewer.d.ts +2 -0
- package/dist/unpkg/viewer/dist/atlas-viewer.js +495 -0
- package/dist/unpkg/viewer/dist/custom-element.d.ts +1 -0
- package/dist/unpkg/viewer/dist/custom-element.js +78 -0
- package/dist/unpkg/viewer/dist/embed.d.ts +24 -0
- package/dist/unpkg/viewer/dist/embed.js +172 -0
- package/dist/unpkg/viewer/dist/errors.d.ts +6 -0
- package/dist/unpkg/viewer/dist/errors.js +12 -0
- package/dist/unpkg/viewer/dist/index.d.ts +10 -0
- package/dist/unpkg/viewer/dist/index.js +9 -8391
- package/dist/unpkg/viewer/dist/minimap.d.ts +3 -0
- package/dist/unpkg/viewer/dist/minimap.js +63 -0
- package/dist/unpkg/viewer/dist/render.d.ts +6 -0
- package/dist/unpkg/viewer/dist/render.js +670 -0
- package/dist/unpkg/viewer/dist/runtime-3d.d.ts +19 -0
- package/dist/unpkg/viewer/dist/runtime-3d.js +494 -0
- package/dist/unpkg/viewer/dist/theme.d.ts +4 -0
- package/dist/unpkg/viewer/dist/theme.js +103 -0
- package/dist/unpkg/viewer/dist/tooltip.d.ts +3 -0
- package/dist/unpkg/viewer/dist/tooltip.js +198 -0
- package/dist/unpkg/viewer/dist/types.d.ts +292 -0
- package/dist/unpkg/viewer/dist/types.js +1 -0
- package/dist/unpkg/viewer/dist/vendor/three.module.js +53032 -0
- package/dist/unpkg/viewer/dist/viewer-state.d.ts +19 -0
- package/dist/unpkg/viewer/dist/viewer-state.js +162 -0
- package/dist/unpkg/viewer/dist/viewer.d.ts +2 -0
- package/dist/unpkg/viewer/dist/viewer.js +1662 -0
- package/dist/unpkg/worldorbit-core.min.js +10 -10
- package/dist/unpkg/worldorbit-editor.min.js +4109 -256
- package/dist/unpkg/worldorbit-markdown.min.js +26 -26
- package/dist/unpkg/worldorbit-viewer.min.js +3945 -92
- package/dist/unpkg/worldorbit.js +32219 -199
- package/dist/unpkg/worldorbit.min.js +3949 -96
- package/package.json +1 -1
- package/packages/core/dist/index.d.ts +1 -0
- package/packages/core/dist/index.js +1 -0
- package/packages/core/dist/spatial-scene.d.ts +3 -0
- package/packages/core/dist/spatial-scene.js +420 -0
- package/packages/core/dist/types.d.ts +105 -0
- package/packages/editor/dist/editor.js +25 -4
- package/packages/editor/dist/types.d.ts +4 -0
- package/packages/markdown/dist/html.js +10 -3
- package/packages/viewer/dist/atlas-state.js +3 -0
- package/packages/viewer/dist/atlas-viewer.js +1 -0
- package/packages/viewer/dist/custom-element.js +18 -4
- package/packages/viewer/dist/embed.d.ts +5 -1
- package/packages/viewer/dist/embed.js +58 -24
- package/packages/viewer/dist/errors.d.ts +6 -0
- package/packages/viewer/dist/errors.js +12 -0
- package/packages/viewer/dist/index.d.ts +1 -0
- package/packages/viewer/dist/index.js +1 -0
- package/packages/viewer/dist/runtime-3d.d.ts +19 -0
- package/packages/viewer/dist/runtime-3d.js +494 -0
- package/packages/viewer/dist/types.d.ts +21 -2
- package/packages/viewer/dist/vendor/three.module.js +53032 -0
- package/packages/viewer/dist/viewer.js +501 -41
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
import { upgradeDocumentToDraftV2, upgradeDocumentToV2 } from "./draft.js";
|
|
2
|
+
const CANONICAL_FIELD_ORDER = [
|
|
3
|
+
"title",
|
|
4
|
+
"view",
|
|
5
|
+
"scale",
|
|
6
|
+
"units",
|
|
7
|
+
"kind",
|
|
8
|
+
"class",
|
|
9
|
+
"tags",
|
|
10
|
+
"color",
|
|
11
|
+
"image",
|
|
12
|
+
"hidden",
|
|
13
|
+
"orbit",
|
|
14
|
+
"distance",
|
|
15
|
+
"semiMajor",
|
|
16
|
+
"eccentricity",
|
|
17
|
+
"period",
|
|
18
|
+
"angle",
|
|
19
|
+
"inclination",
|
|
20
|
+
"phase",
|
|
21
|
+
"at",
|
|
22
|
+
"surface",
|
|
23
|
+
"free",
|
|
24
|
+
"radius",
|
|
25
|
+
"mass",
|
|
26
|
+
"density",
|
|
27
|
+
"gravity",
|
|
28
|
+
"temperature",
|
|
29
|
+
"albedo",
|
|
30
|
+
"atmosphere",
|
|
31
|
+
"inner",
|
|
32
|
+
"outer",
|
|
33
|
+
"on",
|
|
34
|
+
"source",
|
|
35
|
+
"cycle",
|
|
36
|
+
];
|
|
37
|
+
export function formatDocument(document, options = {}) {
|
|
38
|
+
const schema = options.schema ?? "auto";
|
|
39
|
+
const useDraft = schema === "2.0" ||
|
|
40
|
+
schema === "2.1" ||
|
|
41
|
+
schema === "2.5" ||
|
|
42
|
+
schema === "2.0-draft" ||
|
|
43
|
+
document.version === "2.0" ||
|
|
44
|
+
document.version === "2.1" ||
|
|
45
|
+
document.version === "2.5" ||
|
|
46
|
+
document.version === "2.0-draft";
|
|
47
|
+
if (useDraft) {
|
|
48
|
+
if (schema === "2.0-draft") {
|
|
49
|
+
const legacyDraftDocument = document.version === "2.0-draft"
|
|
50
|
+
? document
|
|
51
|
+
: document.version === "2.0" || document.version === "2.1" || document.version === "2.5"
|
|
52
|
+
? {
|
|
53
|
+
...document,
|
|
54
|
+
version: "2.0-draft",
|
|
55
|
+
schemaVersion: "2.0-draft",
|
|
56
|
+
}
|
|
57
|
+
: upgradeDocumentToDraftV2(document);
|
|
58
|
+
return formatDraftDocument(legacyDraftDocument);
|
|
59
|
+
}
|
|
60
|
+
const atlasDocument = document.version === "2.0" || document.version === "2.1" || document.version === "2.5"
|
|
61
|
+
? document
|
|
62
|
+
: document.version === "2.0-draft"
|
|
63
|
+
? {
|
|
64
|
+
...document,
|
|
65
|
+
version: "2.0",
|
|
66
|
+
schemaVersion: "2.0",
|
|
67
|
+
}
|
|
68
|
+
: upgradeDocumentToV2(document);
|
|
69
|
+
if ((schema === "2.0" || schema === "2.1" || schema === "2.5") && atlasDocument.version !== schema) {
|
|
70
|
+
return formatAtlasDocument({
|
|
71
|
+
...atlasDocument,
|
|
72
|
+
version: schema,
|
|
73
|
+
schemaVersion: schema,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return formatAtlasDocument(atlasDocument);
|
|
77
|
+
}
|
|
78
|
+
const lines = [];
|
|
79
|
+
const stableDocument = document;
|
|
80
|
+
if (stableDocument.system) {
|
|
81
|
+
lines.push(...formatSystem(stableDocument.system));
|
|
82
|
+
}
|
|
83
|
+
const sortedObjects = [...stableDocument.objects].sort(compareObjects);
|
|
84
|
+
for (const object of sortedObjects) {
|
|
85
|
+
if (lines.length > 0) {
|
|
86
|
+
lines.push("");
|
|
87
|
+
}
|
|
88
|
+
lines.push(...formatObject(object));
|
|
89
|
+
}
|
|
90
|
+
return lines.join("\n");
|
|
91
|
+
}
|
|
92
|
+
export function formatAtlasDocument(document) {
|
|
93
|
+
const lines = [`schema ${document.version}`, ""];
|
|
94
|
+
if (document.system) {
|
|
95
|
+
lines.push(...formatAtlasSystem(document.system));
|
|
96
|
+
}
|
|
97
|
+
for (const group of [...document.groups].sort(compareIdLike)) {
|
|
98
|
+
lines.push("");
|
|
99
|
+
lines.push(...formatAtlasGroup(group));
|
|
100
|
+
}
|
|
101
|
+
for (const relation of [...document.relations].sort(compareIdLike)) {
|
|
102
|
+
lines.push("");
|
|
103
|
+
lines.push(...formatAtlasRelation(relation));
|
|
104
|
+
}
|
|
105
|
+
for (const event of [...document.events].sort(compareIdLike)) {
|
|
106
|
+
lines.push("");
|
|
107
|
+
lines.push(...formatAtlasEvent(event));
|
|
108
|
+
}
|
|
109
|
+
const sortedObjects = [...document.objects].sort(compareObjects);
|
|
110
|
+
if (sortedObjects.length > 0 && lines.at(-1) !== "") {
|
|
111
|
+
lines.push("");
|
|
112
|
+
}
|
|
113
|
+
sortedObjects.forEach((object, index) => {
|
|
114
|
+
if (index > 0) {
|
|
115
|
+
lines.push("");
|
|
116
|
+
}
|
|
117
|
+
lines.push(...formatAtlasObject(object));
|
|
118
|
+
});
|
|
119
|
+
return lines.join("\n");
|
|
120
|
+
}
|
|
121
|
+
export function formatDraftDocument(document) {
|
|
122
|
+
const legacy = document.version === "2.0-draft"
|
|
123
|
+
? document
|
|
124
|
+
: {
|
|
125
|
+
...document,
|
|
126
|
+
version: "2.0-draft",
|
|
127
|
+
schemaVersion: "2.0-draft",
|
|
128
|
+
};
|
|
129
|
+
const lines = ["schema 2.0-draft", ""];
|
|
130
|
+
if (legacy.system) {
|
|
131
|
+
lines.push(...formatAtlasSystem(legacy.system));
|
|
132
|
+
}
|
|
133
|
+
for (const group of [...legacy.groups].sort(compareIdLike)) {
|
|
134
|
+
lines.push("");
|
|
135
|
+
lines.push(...formatAtlasGroup(group));
|
|
136
|
+
}
|
|
137
|
+
for (const relation of [...legacy.relations].sort(compareIdLike)) {
|
|
138
|
+
lines.push("");
|
|
139
|
+
lines.push(...formatAtlasRelation(relation));
|
|
140
|
+
}
|
|
141
|
+
for (const event of [...legacy.events].sort(compareIdLike)) {
|
|
142
|
+
lines.push("");
|
|
143
|
+
lines.push(...formatAtlasEvent(event));
|
|
144
|
+
}
|
|
145
|
+
const sortedObjects = [...legacy.objects].sort(compareObjects);
|
|
146
|
+
if (sortedObjects.length > 0 && lines.at(-1) !== "") {
|
|
147
|
+
lines.push("");
|
|
148
|
+
}
|
|
149
|
+
sortedObjects.forEach((object, index) => {
|
|
150
|
+
if (index > 0) {
|
|
151
|
+
lines.push("");
|
|
152
|
+
}
|
|
153
|
+
lines.push(...formatAtlasObject(object));
|
|
154
|
+
});
|
|
155
|
+
return lines.join("\n");
|
|
156
|
+
}
|
|
157
|
+
function formatSystem(system) {
|
|
158
|
+
return formatLines("system", system.id, system.properties, null, system.info);
|
|
159
|
+
}
|
|
160
|
+
function formatLines(objectType, id, properties, placement, info) {
|
|
161
|
+
const lines = [`${objectType} ${id}`];
|
|
162
|
+
const fieldLines = [...formatPlacement(placement), ...formatProperties(properties)];
|
|
163
|
+
for (const fieldLine of fieldLines) {
|
|
164
|
+
lines.push(` ${fieldLine}`);
|
|
165
|
+
}
|
|
166
|
+
const infoEntries = Object.entries(info).sort(([left], [right]) => left.localeCompare(right));
|
|
167
|
+
if (infoEntries.length > 0) {
|
|
168
|
+
if (fieldLines.length > 0) {
|
|
169
|
+
lines.push("");
|
|
170
|
+
}
|
|
171
|
+
lines.push(" info");
|
|
172
|
+
for (const [key, value] of infoEntries) {
|
|
173
|
+
lines.push(` ${key} ${quoteIfNeeded(value)}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return lines;
|
|
177
|
+
}
|
|
178
|
+
function formatAtlasSystem(system) {
|
|
179
|
+
const lines = [`system ${system.id}`];
|
|
180
|
+
if (system.title) {
|
|
181
|
+
lines.push(` title ${quoteIfNeeded(system.title)}`);
|
|
182
|
+
}
|
|
183
|
+
if (system.description) {
|
|
184
|
+
lines.push(` description ${quoteIfNeeded(system.description)}`);
|
|
185
|
+
}
|
|
186
|
+
if (system.epoch) {
|
|
187
|
+
lines.push(` epoch ${quoteIfNeeded(system.epoch)}`);
|
|
188
|
+
}
|
|
189
|
+
if (system.referencePlane) {
|
|
190
|
+
lines.push(` referencePlane ${quoteIfNeeded(system.referencePlane)}`);
|
|
191
|
+
}
|
|
192
|
+
lines.push("");
|
|
193
|
+
lines.push("defaults");
|
|
194
|
+
lines.push(` view ${system.defaults.view}`);
|
|
195
|
+
if (system.defaults.scale) {
|
|
196
|
+
lines.push(` scale ${quoteIfNeeded(system.defaults.scale)}`);
|
|
197
|
+
}
|
|
198
|
+
if (system.defaults.units) {
|
|
199
|
+
lines.push(` units ${quoteIfNeeded(system.defaults.units)}`);
|
|
200
|
+
}
|
|
201
|
+
if (system.defaults.preset) {
|
|
202
|
+
lines.push(` preset ${system.defaults.preset}`);
|
|
203
|
+
}
|
|
204
|
+
if (system.defaults.theme) {
|
|
205
|
+
lines.push(` theme ${quoteIfNeeded(system.defaults.theme)}`);
|
|
206
|
+
}
|
|
207
|
+
if (Object.keys(system.atlasMetadata).length > 0) {
|
|
208
|
+
lines.push("");
|
|
209
|
+
lines.push("atlas");
|
|
210
|
+
lines.push(" metadata");
|
|
211
|
+
for (const [key, value] of Object.entries(system.atlasMetadata).sort(([left], [right]) => left.localeCompare(right))) {
|
|
212
|
+
lines.push(` ${key} ${quoteIfNeeded(value)}`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
for (const viewpoint of system.viewpoints) {
|
|
216
|
+
lines.push("");
|
|
217
|
+
lines.push(...formatAtlasViewpoint(viewpoint));
|
|
218
|
+
}
|
|
219
|
+
for (const annotation of system.annotations) {
|
|
220
|
+
lines.push("");
|
|
221
|
+
lines.push(...formatAtlasAnnotation(annotation));
|
|
222
|
+
}
|
|
223
|
+
return lines;
|
|
224
|
+
}
|
|
225
|
+
function formatObject(object) {
|
|
226
|
+
return formatWorldOrbitObject(object.type, object.id, object);
|
|
227
|
+
}
|
|
228
|
+
function formatAtlasObject(object) {
|
|
229
|
+
return formatWorldOrbitObject(`object ${object.type}`, object.id, object);
|
|
230
|
+
}
|
|
231
|
+
function formatWorldOrbitObject(objectType, id, object) {
|
|
232
|
+
const lines = [`${objectType} ${id}`];
|
|
233
|
+
const fieldLines = [
|
|
234
|
+
...formatPlacement(object.placement),
|
|
235
|
+
...formatProperties(object.properties),
|
|
236
|
+
...formatObjectMetadata(object),
|
|
237
|
+
];
|
|
238
|
+
for (const fieldLine of fieldLines) {
|
|
239
|
+
lines.push(` ${fieldLine}`);
|
|
240
|
+
}
|
|
241
|
+
const infoEntries = Object.entries(object.info).sort(([left], [right]) => left.localeCompare(right));
|
|
242
|
+
if (infoEntries.length > 0) {
|
|
243
|
+
if (fieldLines.length > 0) {
|
|
244
|
+
lines.push("");
|
|
245
|
+
}
|
|
246
|
+
lines.push(" info");
|
|
247
|
+
for (const [key, value] of infoEntries) {
|
|
248
|
+
lines.push(` ${key} ${quoteIfNeeded(value)}`);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
for (const blockName of ["climate", "habitability", "settlement"]) {
|
|
252
|
+
const blockEntries = Object.entries(object.typedBlocks?.[blockName] ?? {}).sort(([left], [right]) => left.localeCompare(right));
|
|
253
|
+
if (blockEntries.length > 0) {
|
|
254
|
+
lines.push("");
|
|
255
|
+
lines.push(` ${blockName}`);
|
|
256
|
+
for (const [key, value] of blockEntries) {
|
|
257
|
+
lines.push(` ${key} ${quoteIfNeeded(value)}`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return lines;
|
|
262
|
+
}
|
|
263
|
+
function formatPlacement(placement) {
|
|
264
|
+
if (!placement)
|
|
265
|
+
return [];
|
|
266
|
+
switch (placement.mode) {
|
|
267
|
+
case "orbit":
|
|
268
|
+
return [
|
|
269
|
+
`orbit ${placement.target}`,
|
|
270
|
+
...formatOptionalUnit("distance", placement.distance),
|
|
271
|
+
...formatOptionalUnit("semiMajor", placement.semiMajor),
|
|
272
|
+
...formatOptionalNumber("eccentricity", placement.eccentricity),
|
|
273
|
+
...formatOptionalUnit("period", placement.period),
|
|
274
|
+
...formatOptionalUnit("angle", placement.angle),
|
|
275
|
+
...formatOptionalUnit("inclination", placement.inclination),
|
|
276
|
+
...formatOptionalUnit("phase", placement.phase),
|
|
277
|
+
];
|
|
278
|
+
case "at":
|
|
279
|
+
return [`at ${formatAtReference(placement.reference)}`];
|
|
280
|
+
case "surface":
|
|
281
|
+
return [`surface ${placement.target}`];
|
|
282
|
+
case "free":
|
|
283
|
+
return [`free ${placement.distance ? formatUnitValue(placement.distance) : placement.descriptor ?? ""}`.trim()];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function formatProperties(properties) {
|
|
287
|
+
return Object.keys(properties)
|
|
288
|
+
.sort(compareFieldKeys)
|
|
289
|
+
.map((key) => `${key} ${formatValue(properties[key])}`);
|
|
290
|
+
}
|
|
291
|
+
function formatObjectMetadata(object) {
|
|
292
|
+
const lines = [];
|
|
293
|
+
if (object.groups?.length) {
|
|
294
|
+
lines.push(`groups ${object.groups.join(" ")}`);
|
|
295
|
+
}
|
|
296
|
+
if (object.epoch) {
|
|
297
|
+
lines.push(`epoch ${quoteIfNeeded(object.epoch)}`);
|
|
298
|
+
}
|
|
299
|
+
if (object.referencePlane) {
|
|
300
|
+
lines.push(`referencePlane ${quoteIfNeeded(object.referencePlane)}`);
|
|
301
|
+
}
|
|
302
|
+
if (object.tidalLock !== undefined) {
|
|
303
|
+
lines.push(`tidalLock ${object.tidalLock ? "true" : "false"}`);
|
|
304
|
+
}
|
|
305
|
+
if (object.renderHints?.renderLabel !== undefined) {
|
|
306
|
+
lines.push(`renderLabel ${object.renderHints.renderLabel ? "true" : "false"}`);
|
|
307
|
+
}
|
|
308
|
+
if (object.renderHints?.renderOrbit !== undefined) {
|
|
309
|
+
lines.push(`renderOrbit ${object.renderHints.renderOrbit ? "true" : "false"}`);
|
|
310
|
+
}
|
|
311
|
+
if (object.renderHints?.renderPriority !== undefined) {
|
|
312
|
+
lines.push(`renderPriority ${object.renderHints.renderPriority}`);
|
|
313
|
+
}
|
|
314
|
+
if (object.resonance) {
|
|
315
|
+
lines.push(`resonance ${object.resonance.targetObjectId} ${object.resonance.ratio}`);
|
|
316
|
+
}
|
|
317
|
+
for (const rule of object.deriveRules ?? []) {
|
|
318
|
+
lines.push(`derive ${rule.field} ${rule.strategy}`);
|
|
319
|
+
}
|
|
320
|
+
for (const rule of object.validationRules ?? []) {
|
|
321
|
+
lines.push(`validate ${rule.rule}`);
|
|
322
|
+
}
|
|
323
|
+
if (object.lockedFields?.length) {
|
|
324
|
+
lines.push(`locked ${object.lockedFields.join(" ")}`);
|
|
325
|
+
}
|
|
326
|
+
for (const tolerance of object.tolerances ?? []) {
|
|
327
|
+
lines.push(`tolerance ${tolerance.field} ${formatValue(tolerance.value)}`);
|
|
328
|
+
}
|
|
329
|
+
return lines;
|
|
330
|
+
}
|
|
331
|
+
function formatAtlasViewpoint(viewpoint) {
|
|
332
|
+
const lines = [`viewpoint ${viewpoint.id}`, ` label ${quoteIfNeeded(viewpoint.label)}`];
|
|
333
|
+
if (viewpoint.focusObjectId) {
|
|
334
|
+
lines.push(` focus ${viewpoint.focusObjectId}`);
|
|
335
|
+
}
|
|
336
|
+
if (viewpoint.selectedObjectId && viewpoint.selectedObjectId !== viewpoint.focusObjectId) {
|
|
337
|
+
lines.push(` select ${viewpoint.selectedObjectId}`);
|
|
338
|
+
}
|
|
339
|
+
if (viewpoint.summary) {
|
|
340
|
+
lines.push(` summary ${quoteIfNeeded(viewpoint.summary)}`);
|
|
341
|
+
}
|
|
342
|
+
if (viewpoint.projection) {
|
|
343
|
+
lines.push(` projection ${viewpoint.projection}`);
|
|
344
|
+
}
|
|
345
|
+
if (viewpoint.preset) {
|
|
346
|
+
lines.push(` preset ${viewpoint.preset}`);
|
|
347
|
+
}
|
|
348
|
+
if (viewpoint.zoom !== null) {
|
|
349
|
+
lines.push(` zoom ${viewpoint.zoom}`);
|
|
350
|
+
}
|
|
351
|
+
if (viewpoint.rotationDeg !== 0) {
|
|
352
|
+
lines.push(` rotation ${viewpoint.rotationDeg}`);
|
|
353
|
+
}
|
|
354
|
+
if (viewpoint.camera && hasCameraValues(viewpoint.camera)) {
|
|
355
|
+
lines.push(" camera");
|
|
356
|
+
if (viewpoint.camera.azimuth !== null) {
|
|
357
|
+
lines.push(` azimuth ${viewpoint.camera.azimuth}`);
|
|
358
|
+
}
|
|
359
|
+
if (viewpoint.camera.elevation !== null) {
|
|
360
|
+
lines.push(` elevation ${viewpoint.camera.elevation}`);
|
|
361
|
+
}
|
|
362
|
+
if (viewpoint.camera.roll !== null) {
|
|
363
|
+
lines.push(` roll ${viewpoint.camera.roll}`);
|
|
364
|
+
}
|
|
365
|
+
if (viewpoint.camera.distance !== null) {
|
|
366
|
+
lines.push(` distance ${viewpoint.camera.distance}`);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
const layerTokens = formatDraftLayers(viewpoint.layers);
|
|
370
|
+
if (layerTokens.length > 0) {
|
|
371
|
+
lines.push(` layers ${layerTokens.join(" ")}`);
|
|
372
|
+
}
|
|
373
|
+
if (viewpoint.events.length > 0) {
|
|
374
|
+
lines.push(` events ${viewpoint.events.join(" ")}`);
|
|
375
|
+
}
|
|
376
|
+
if (viewpoint.filter) {
|
|
377
|
+
lines.push(" filter");
|
|
378
|
+
if (viewpoint.filter.query) {
|
|
379
|
+
lines.push(` query ${quoteIfNeeded(viewpoint.filter.query)}`);
|
|
380
|
+
}
|
|
381
|
+
if (viewpoint.filter.objectTypes.length > 0) {
|
|
382
|
+
lines.push(` objectTypes ${viewpoint.filter.objectTypes.join(" ")}`);
|
|
383
|
+
}
|
|
384
|
+
if (viewpoint.filter.tags.length > 0) {
|
|
385
|
+
lines.push(` tags ${viewpoint.filter.tags.map(quoteIfNeeded).join(" ")}`);
|
|
386
|
+
}
|
|
387
|
+
if (viewpoint.filter.groupIds.length > 0) {
|
|
388
|
+
lines.push(` groups ${viewpoint.filter.groupIds.join(" ")}`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return lines;
|
|
392
|
+
}
|
|
393
|
+
function formatAtlasAnnotation(annotation) {
|
|
394
|
+
const lines = [`annotation ${annotation.id}`, ` label ${quoteIfNeeded(annotation.label)}`];
|
|
395
|
+
if (annotation.targetObjectId) {
|
|
396
|
+
lines.push(` target ${annotation.targetObjectId}`);
|
|
397
|
+
}
|
|
398
|
+
lines.push(` body ${quoteIfNeeded(annotation.body)}`);
|
|
399
|
+
if (annotation.tags.length > 0) {
|
|
400
|
+
lines.push(` tags ${annotation.tags.map(quoteIfNeeded).join(" ")}`);
|
|
401
|
+
}
|
|
402
|
+
return lines;
|
|
403
|
+
}
|
|
404
|
+
function formatAtlasGroup(group) {
|
|
405
|
+
const lines = [`group ${group.id}`, ` label ${quoteIfNeeded(group.label)}`];
|
|
406
|
+
if (group.summary) {
|
|
407
|
+
lines.push(` summary ${quoteIfNeeded(group.summary)}`);
|
|
408
|
+
}
|
|
409
|
+
if (group.color) {
|
|
410
|
+
lines.push(` color ${quoteIfNeeded(group.color)}`);
|
|
411
|
+
}
|
|
412
|
+
if (group.tags.length > 0) {
|
|
413
|
+
lines.push(` tags ${group.tags.map(quoteIfNeeded).join(" ")}`);
|
|
414
|
+
}
|
|
415
|
+
if (group.hidden) {
|
|
416
|
+
lines.push(" hidden true");
|
|
417
|
+
}
|
|
418
|
+
return lines;
|
|
419
|
+
}
|
|
420
|
+
function formatAtlasRelation(relation) {
|
|
421
|
+
const lines = [`relation ${relation.id}`];
|
|
422
|
+
if (relation.from) {
|
|
423
|
+
lines.push(` from ${quoteIfNeeded(relation.from)}`);
|
|
424
|
+
}
|
|
425
|
+
if (relation.to) {
|
|
426
|
+
lines.push(` to ${quoteIfNeeded(relation.to)}`);
|
|
427
|
+
}
|
|
428
|
+
if (relation.kind) {
|
|
429
|
+
lines.push(` kind ${quoteIfNeeded(relation.kind)}`);
|
|
430
|
+
}
|
|
431
|
+
if (relation.label) {
|
|
432
|
+
lines.push(` label ${quoteIfNeeded(relation.label)}`);
|
|
433
|
+
}
|
|
434
|
+
if (relation.summary) {
|
|
435
|
+
lines.push(` summary ${quoteIfNeeded(relation.summary)}`);
|
|
436
|
+
}
|
|
437
|
+
if (relation.tags.length > 0) {
|
|
438
|
+
lines.push(` tags ${relation.tags.map(quoteIfNeeded).join(" ")}`);
|
|
439
|
+
}
|
|
440
|
+
if (relation.color) {
|
|
441
|
+
lines.push(` color ${quoteIfNeeded(relation.color)}`);
|
|
442
|
+
}
|
|
443
|
+
if (relation.hidden) {
|
|
444
|
+
lines.push(" hidden true");
|
|
445
|
+
}
|
|
446
|
+
return lines;
|
|
447
|
+
}
|
|
448
|
+
function formatAtlasEvent(event) {
|
|
449
|
+
const lines = [`event ${event.id}`, ` kind ${quoteIfNeeded(event.kind)}`];
|
|
450
|
+
if (event.label) {
|
|
451
|
+
lines.push(` label ${quoteIfNeeded(event.label)}`);
|
|
452
|
+
}
|
|
453
|
+
if (event.summary) {
|
|
454
|
+
lines.push(` summary ${quoteIfNeeded(event.summary)}`);
|
|
455
|
+
}
|
|
456
|
+
if (event.targetObjectId) {
|
|
457
|
+
lines.push(` target ${event.targetObjectId}`);
|
|
458
|
+
}
|
|
459
|
+
if (event.participantObjectIds.length > 0) {
|
|
460
|
+
lines.push(` participants ${event.participantObjectIds.join(" ")}`);
|
|
461
|
+
}
|
|
462
|
+
if (event.timing) {
|
|
463
|
+
lines.push(` timing ${quoteIfNeeded(event.timing)}`);
|
|
464
|
+
}
|
|
465
|
+
if (event.visibility) {
|
|
466
|
+
lines.push(` visibility ${quoteIfNeeded(event.visibility)}`);
|
|
467
|
+
}
|
|
468
|
+
if (event.epoch) {
|
|
469
|
+
lines.push(` epoch ${quoteIfNeeded(event.epoch)}`);
|
|
470
|
+
}
|
|
471
|
+
if (event.referencePlane) {
|
|
472
|
+
lines.push(` referencePlane ${quoteIfNeeded(event.referencePlane)}`);
|
|
473
|
+
}
|
|
474
|
+
if (event.tags.length > 0) {
|
|
475
|
+
lines.push(` tags ${event.tags.map(quoteIfNeeded).join(" ")}`);
|
|
476
|
+
}
|
|
477
|
+
if (event.color) {
|
|
478
|
+
lines.push(` color ${quoteIfNeeded(event.color)}`);
|
|
479
|
+
}
|
|
480
|
+
if (event.hidden) {
|
|
481
|
+
lines.push(" hidden true");
|
|
482
|
+
}
|
|
483
|
+
if (event.positions.length > 0) {
|
|
484
|
+
lines.push("");
|
|
485
|
+
lines.push(" positions");
|
|
486
|
+
for (const pose of [...event.positions].sort(comparePoseObjectId)) {
|
|
487
|
+
lines.push(` pose ${pose.objectId}`);
|
|
488
|
+
for (const fieldLine of formatEventPoseFields(pose)) {
|
|
489
|
+
lines.push(` ${fieldLine}`);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return lines;
|
|
494
|
+
}
|
|
495
|
+
function formatEventPoseFields(pose) {
|
|
496
|
+
return [
|
|
497
|
+
...formatPlacement(pose.placement),
|
|
498
|
+
...(pose.epoch ? [`epoch ${quoteIfNeeded(pose.epoch)}`] : []),
|
|
499
|
+
...(pose.referencePlane ? [`referencePlane ${quoteIfNeeded(pose.referencePlane)}`] : []),
|
|
500
|
+
...formatOptionalUnit("inner", pose.inner),
|
|
501
|
+
...formatOptionalUnit("outer", pose.outer),
|
|
502
|
+
];
|
|
503
|
+
}
|
|
504
|
+
function hasCameraValues(camera) {
|
|
505
|
+
return (camera.azimuth !== null ||
|
|
506
|
+
camera.elevation !== null ||
|
|
507
|
+
camera.roll !== null ||
|
|
508
|
+
camera.distance !== null);
|
|
509
|
+
}
|
|
510
|
+
function formatValue(value) {
|
|
511
|
+
if (Array.isArray(value)) {
|
|
512
|
+
return value.map((item) => quoteIfNeeded(item)).join(" ");
|
|
513
|
+
}
|
|
514
|
+
if (typeof value === "boolean") {
|
|
515
|
+
return value ? "true" : "false";
|
|
516
|
+
}
|
|
517
|
+
if (typeof value === "number") {
|
|
518
|
+
return String(value);
|
|
519
|
+
}
|
|
520
|
+
if (typeof value === "string") {
|
|
521
|
+
return quoteIfNeeded(value);
|
|
522
|
+
}
|
|
523
|
+
return formatUnitValue(value);
|
|
524
|
+
}
|
|
525
|
+
function formatUnitValue(value) {
|
|
526
|
+
return `${value.value}${value.unit ?? ""}`;
|
|
527
|
+
}
|
|
528
|
+
function formatOptionalUnit(key, value) {
|
|
529
|
+
return value ? [`${key} ${formatUnitValue(value)}`] : [];
|
|
530
|
+
}
|
|
531
|
+
function formatOptionalNumber(key, value) {
|
|
532
|
+
return value === undefined ? [] : [`${key} ${value}`];
|
|
533
|
+
}
|
|
534
|
+
function formatAtReference(reference) {
|
|
535
|
+
switch (reference.kind) {
|
|
536
|
+
case "lagrange":
|
|
537
|
+
return reference.secondary
|
|
538
|
+
? `${reference.primary}-${reference.secondary}:${reference.point}`
|
|
539
|
+
: `${reference.primary}:${reference.point}`;
|
|
540
|
+
case "anchor":
|
|
541
|
+
return `${reference.objectId}:${reference.anchor}`;
|
|
542
|
+
case "named":
|
|
543
|
+
return reference.name;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function formatDraftLayers(layers) {
|
|
547
|
+
const tokens = [];
|
|
548
|
+
const orbitFront = layers["orbits-front"];
|
|
549
|
+
const orbitBack = layers["orbits-back"];
|
|
550
|
+
if (orbitFront !== undefined || orbitBack !== undefined) {
|
|
551
|
+
tokens.push(orbitFront !== false || orbitBack !== false
|
|
552
|
+
? "orbits"
|
|
553
|
+
: "-orbits");
|
|
554
|
+
}
|
|
555
|
+
for (const key of ["background", "guides", "relations", "events", "objects", "labels", "metadata"]) {
|
|
556
|
+
if (layers[key] !== undefined) {
|
|
557
|
+
tokens.push(layers[key] ? key : `-${key}`);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return tokens;
|
|
561
|
+
}
|
|
562
|
+
function compareFieldKeys(left, right) {
|
|
563
|
+
const leftIndex = CANONICAL_FIELD_ORDER.indexOf(left);
|
|
564
|
+
const rightIndex = CANONICAL_FIELD_ORDER.indexOf(right);
|
|
565
|
+
if (leftIndex === -1 && rightIndex === -1)
|
|
566
|
+
return left.localeCompare(right);
|
|
567
|
+
if (leftIndex === -1)
|
|
568
|
+
return 1;
|
|
569
|
+
if (rightIndex === -1)
|
|
570
|
+
return -1;
|
|
571
|
+
return leftIndex - rightIndex;
|
|
572
|
+
}
|
|
573
|
+
function compareObjects(left, right) {
|
|
574
|
+
const leftIndex = objectTypeIndex(left.type);
|
|
575
|
+
const rightIndex = objectTypeIndex(right.type);
|
|
576
|
+
if (leftIndex !== rightIndex)
|
|
577
|
+
return leftIndex - rightIndex;
|
|
578
|
+
return left.id.localeCompare(right.id);
|
|
579
|
+
}
|
|
580
|
+
function compareIdLike(left, right) {
|
|
581
|
+
return left.id.localeCompare(right.id);
|
|
582
|
+
}
|
|
583
|
+
function comparePoseObjectId(left, right) {
|
|
584
|
+
return left.objectId.localeCompare(right.objectId);
|
|
585
|
+
}
|
|
586
|
+
function objectTypeIndex(objectType) {
|
|
587
|
+
switch (objectType) {
|
|
588
|
+
case "star":
|
|
589
|
+
return 0;
|
|
590
|
+
case "planet":
|
|
591
|
+
return 1;
|
|
592
|
+
case "moon":
|
|
593
|
+
return 2;
|
|
594
|
+
case "belt":
|
|
595
|
+
return 3;
|
|
596
|
+
case "asteroid":
|
|
597
|
+
return 4;
|
|
598
|
+
case "comet":
|
|
599
|
+
return 5;
|
|
600
|
+
case "ring":
|
|
601
|
+
return 6;
|
|
602
|
+
case "structure":
|
|
603
|
+
return 7;
|
|
604
|
+
case "phenomenon":
|
|
605
|
+
return 8;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function quoteIfNeeded(value) {
|
|
609
|
+
if (!/\s/.test(value) && !value.includes('"')) {
|
|
610
|
+
return value;
|
|
611
|
+
}
|
|
612
|
+
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
613
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./schema.js";
|
|
4
|
+
export { tokenizeLine, tokenizeLineDetailed } from "./tokenize.js";
|
|
5
|
+
export { parseWorldOrbit } from "./parse.js";
|
|
6
|
+
export { normalizeDocument } from "./normalize.js";
|
|
7
|
+
export { validateDocument } from "./validate.js";
|
|
8
|
+
export { createDiagnostic, diagnosticFromError, normalizeWithDiagnostics, parseWithDiagnostics, validateDocumentWithDiagnostics, } from "./diagnostics.js";
|
|
9
|
+
export { renderDocumentToScene, rotatePoint } from "./scene.js";
|
|
10
|
+
export { evaluateSpatialSceneAtTime, renderDocumentToSpatialScene, } from "./spatial-scene.js";
|
|
11
|
+
export { formatAtlasDocument, formatDocument, formatDraftDocument } from "./format.js";
|
|
12
|
+
export { materializeAtlasDocument, materializeDraftDocument, upgradeDocumentToDraftV2, upgradeDocumentToV2, } from "./draft.js";
|
|
13
|
+
export { parseWorldOrbitAtlas, parseWorldOrbitDraft } from "./draft-parse.js";
|
|
14
|
+
export { cloneAtlasDocument, createEmptyAtlasDocument, getAtlasDocumentNode, listAtlasDocumentPaths, removeAtlasDocumentNode, resolveAtlasDiagnosticPath, resolveAtlasDiagnostics, updateAtlasDocumentNode, upsertAtlasDocumentNode, validateAtlasDocumentWithDiagnostics, } from "./atlas-edit.js";
|
|
15
|
+
export { detectWorldOrbitSchemaVersion, loadWorldOrbitSource, loadWorldOrbitSourceWithDiagnostics, } from "./load.js";
|
|
16
|
+
export { extractWorldOrbitBlocks } from "./markdown.js";
|
|
17
|
+
import type { AstDocument, FormatDocumentOptions, FormattableWorldOrbitDocument, RenderScene, WorldOrbitDocument } from "./types.js";
|
|
18
|
+
export interface ParseResult {
|
|
19
|
+
ast: AstDocument;
|
|
20
|
+
document: WorldOrbitDocument;
|
|
21
|
+
}
|
|
22
|
+
export interface RenderResult extends ParseResult {
|
|
23
|
+
scene: RenderScene;
|
|
24
|
+
}
|
|
25
|
+
export declare function parse(source: string): ParseResult;
|
|
26
|
+
export declare function render(source: string): RenderResult;
|
|
27
|
+
export declare function load(source: string): import("./types.js").LoadedWorldOrbitSource;
|
|
28
|
+
export declare function parseSafe(source: string): import("./types.js").DiagnosticResult<import("./diagnostics.js").ParsedWorldOrbitDocument>;
|
|
29
|
+
export declare function stringify(document: FormattableWorldOrbitDocument, options?: FormatDocumentOptions): string;
|