worldorbit 2.5.12 → 2.5.15
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 +37 -11
- package/dist/unpkg/worldorbit-core.min.js +12 -5
- package/dist/unpkg/worldorbit-markdown.min.js +29 -20
- package/dist/unpkg/worldorbit-viewer.min.js +52 -38
- package/dist/unpkg/worldorbit.js +1737 -245
- package/dist/unpkg/worldorbit.min.js +56 -42
- package/package.json +2 -2
- package/packages/core/README.md +5 -1
- package/packages/core/dist/atlas-edit.d.ts +2 -2
- package/packages/core/dist/atlas-edit.js +70 -7
- package/packages/core/dist/atlas-utils.d.ts +22 -0
- package/packages/core/dist/atlas-utils.js +189 -0
- package/packages/core/dist/atlas-validate.d.ts +2 -0
- package/packages/core/dist/atlas-validate.js +285 -0
- package/packages/core/dist/draft-parse.js +786 -153
- package/packages/core/dist/draft.d.ts +3 -0
- package/packages/core/dist/draft.js +47 -3
- package/packages/core/dist/format.js +165 -9
- package/packages/core/dist/load.js +58 -13
- package/packages/core/dist/normalize.js +7 -0
- package/packages/core/dist/scene.js +92 -27
- package/packages/core/dist/types.d.ts +97 -3
- package/packages/markdown/README.md +1 -1
- package/packages/viewer/README.md +2 -1
- package/packages/viewer/dist/atlas-state.js +7 -1
- package/packages/viewer/dist/atlas-viewer.js +35 -1
- package/packages/viewer/dist/render.js +16 -7
- package/packages/viewer/dist/theme.js +4 -0
- package/packages/viewer/dist/tooltip.js +35 -0
- package/packages/viewer/dist/types.d.ts +7 -0
- package/packages/viewer/dist/viewer.js +4 -0
- package/packages/editor/dist/editor.d.ts +0 -2
- package/packages/editor/dist/editor.js +0 -2626
- package/packages/editor/dist/index.d.ts +0 -2
- package/packages/editor/dist/index.js +0 -1
- package/packages/editor/dist/types.d.ts +0 -53
- package/packages/editor/dist/types.js +0 -1
- package/packages/markdown/dist/html.d.ts +0 -3
- package/packages/markdown/dist/html.js +0 -57
- package/packages/markdown/dist/index.d.ts +0 -4
- package/packages/markdown/dist/index.js +0 -3
- package/packages/markdown/dist/rehype.d.ts +0 -10
- package/packages/markdown/dist/rehype.js +0 -49
- package/packages/markdown/dist/remark.d.ts +0 -9
- package/packages/markdown/dist/remark.js +0 -28
- package/packages/markdown/dist/types.d.ts +0 -11
- package/packages/markdown/dist/types.js +0 -1
|
@@ -32,6 +32,13 @@ export function renderSceneToSvg(scene, options = {}) {
|
|
|
32
32
|
.map((leader) => `<line class="wo-leader wo-leader-${leader.mode}" x1="${leader.x1}" y1="${leader.y1}" x2="${leader.x2}" y2="${leader.y2}" data-render-id="${escapeXml(leader.renderId)}" data-group-id="${escapeAttribute(leader.groupId ?? "")}" />`)
|
|
33
33
|
.join("")
|
|
34
34
|
: "";
|
|
35
|
+
const relationMarkup = layers.relations
|
|
36
|
+
? scene.relations
|
|
37
|
+
.filter((relation) => !relation.hidden)
|
|
38
|
+
.filter((relation) => visibleObjectIds.has(relation.fromObjectId) && visibleObjectIds.has(relation.toObjectId))
|
|
39
|
+
.map((relation) => `<line class="wo-relation" x1="${relation.x1}" y1="${relation.y1}" x2="${relation.x2}" y2="${relation.y2}" data-render-id="${escapeXml(relation.renderId)}" data-relation-id="${escapeAttribute(relation.relationId)}" />`)
|
|
40
|
+
.join("")
|
|
41
|
+
: "";
|
|
35
42
|
const objectMarkup = layers.objects
|
|
36
43
|
? visibleObjects
|
|
37
44
|
.map((object) => renderSceneObject(object, options.selectedObjectId ?? null, theme))
|
|
@@ -75,10 +82,11 @@ export function renderSceneToSvg(scene, options = {}) {
|
|
|
75
82
|
.wo-bg-glow { fill: url(#wo-bg-glow); }
|
|
76
83
|
.wo-grid { fill: none; stroke: ${theme.guide}; stroke-width: 1; }
|
|
77
84
|
.wo-orbit { fill: none; stroke: ${theme.orbit}; stroke-width: 1.5; }
|
|
78
|
-
.wo-orbit-back { opacity: 0.38; stroke-dasharray: 8 6; }
|
|
79
|
-
.wo-orbit-front { opacity: 0.9; }
|
|
80
|
-
.wo-orbit-band { stroke: ${theme.orbitBand}; stroke-linecap: round; }
|
|
81
|
-
.wo-
|
|
85
|
+
.wo-orbit-back { opacity: 0.38; stroke-dasharray: 8 6; }
|
|
86
|
+
.wo-orbit-front { opacity: 0.9; }
|
|
87
|
+
.wo-orbit-band { stroke: ${theme.orbitBand}; stroke-linecap: round; }
|
|
88
|
+
.wo-relation { stroke: ${theme.relation}; stroke-width: 2; stroke-dasharray: 10 6; }
|
|
89
|
+
.wo-leader { stroke: ${theme.leader}; stroke-width: 1.5; stroke-dasharray: 6 5; }
|
|
82
90
|
.wo-label { fill: ${theme.ink}; font-family: ${theme.fontFamily}; font-weight: 600; letter-spacing: 0.02em; }
|
|
83
91
|
.wo-label-secondary { fill: ${theme.muted}; font-family: ${theme.fontFamily}; font-weight: 500; }
|
|
84
92
|
.wo-title { fill: ${theme.ink}; font: 700 24px ${theme.displayFont}; letter-spacing: 0.06em; text-transform: uppercase; }
|
|
@@ -109,9 +117,10 @@ export function renderSceneToSvg(scene, options = {}) {
|
|
|
109
117
|
<g data-worldorbit-world="true">
|
|
110
118
|
<g data-worldorbit-camera-root="${WORLD_LAYER_ID}" id="${WORLD_LAYER_ID}">
|
|
111
119
|
<g data-worldorbit-world-content="true">
|
|
112
|
-
${layers.orbits ? `<g data-layer-id="orbits-back">${orbitMarkup.back}</g>` : ""}
|
|
113
|
-
${layers.guides ? `<g data-layer-id="guides">${leaderMarkup}</g>` : ""}
|
|
114
|
-
${layers.
|
|
120
|
+
${layers.orbits ? `<g data-layer-id="orbits-back">${orbitMarkup.back}</g>` : ""}
|
|
121
|
+
${layers.guides ? `<g data-layer-id="guides">${leaderMarkup}</g>` : ""}
|
|
122
|
+
${layers.relations ? `<g data-layer-id="relations">${relationMarkup}</g>` : ""}
|
|
123
|
+
${layers.objects ? `<g data-layer-id="objects">${objectMarkup}</g>` : ""}
|
|
115
124
|
${layers.orbits ? `<g data-layer-id="orbits-front">${orbitMarkup.front}</g>` : ""}
|
|
116
125
|
${layers.labels ? `<g data-layer-id="labels">${labelMarkup}</g>` : ""}
|
|
117
126
|
</g>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const DEFAULT_LAYERS = {
|
|
2
2
|
background: true,
|
|
3
3
|
guides: true,
|
|
4
|
+
relations: true,
|
|
4
5
|
orbits: true,
|
|
5
6
|
objects: true,
|
|
6
7
|
labels: true,
|
|
@@ -15,6 +16,7 @@ const THEME_PRESETS = {
|
|
|
15
16
|
backgroundGlow: "rgba(240, 180, 100, 0.18)",
|
|
16
17
|
panel: "rgba(7, 17, 27, 0.9)",
|
|
17
18
|
panelLine: "rgba(168, 207, 242, 0.18)",
|
|
19
|
+
relation: "rgba(240, 180, 100, 0.42)",
|
|
18
20
|
orbit: "rgba(163, 209, 255, 0.24)",
|
|
19
21
|
orbitBand: "rgba(255, 190, 120, 0.28)",
|
|
20
22
|
guide: "rgba(255, 255, 255, 0.04)",
|
|
@@ -37,6 +39,7 @@ const THEME_PRESETS = {
|
|
|
37
39
|
backgroundGlow: "rgba(120, 255, 215, 0.16)",
|
|
38
40
|
panel: "rgba(7, 20, 30, 0.9)",
|
|
39
41
|
panelLine: "rgba(120, 255, 215, 0.16)",
|
|
42
|
+
relation: "rgba(156, 231, 255, 0.42)",
|
|
40
43
|
orbit: "rgba(120, 255, 215, 0.2)",
|
|
41
44
|
orbitBand: "rgba(137, 185, 255, 0.24)",
|
|
42
45
|
guide: "rgba(255, 255, 255, 0.035)",
|
|
@@ -59,6 +62,7 @@ const THEME_PRESETS = {
|
|
|
59
62
|
backgroundGlow: "rgba(255, 127, 95, 0.18)",
|
|
60
63
|
panel: "rgba(24, 9, 13, 0.9)",
|
|
61
64
|
panelLine: "rgba(255, 166, 149, 0.16)",
|
|
65
|
+
relation: "rgba(255, 178, 125, 0.42)",
|
|
62
66
|
orbit: "rgba(255, 188, 164, 0.22)",
|
|
63
67
|
orbitBand: "rgba(255, 214, 139, 0.24)",
|
|
64
68
|
guide: "rgba(255, 255, 255, 0.03)",
|
|
@@ -76,6 +76,41 @@ function buildTooltipFields(details) {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
const placement = details.object.placement;
|
|
79
|
+
if (details.object.groups?.length) {
|
|
80
|
+
fields.set("groups", {
|
|
81
|
+
key: "groups",
|
|
82
|
+
label: "Groups",
|
|
83
|
+
value: details.object.groups.join(", "),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (details.object.epoch) {
|
|
87
|
+
fields.set("epoch", {
|
|
88
|
+
key: "epoch",
|
|
89
|
+
label: "Epoch",
|
|
90
|
+
value: details.object.epoch,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (details.object.referencePlane) {
|
|
94
|
+
fields.set("referencePlane", {
|
|
95
|
+
key: "referencePlane",
|
|
96
|
+
label: "Reference Plane",
|
|
97
|
+
value: details.object.referencePlane,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (details.object.tidalLock !== undefined) {
|
|
101
|
+
fields.set("tidalLock", {
|
|
102
|
+
key: "tidalLock",
|
|
103
|
+
label: "Tidal Lock",
|
|
104
|
+
value: details.object.tidalLock ? "true" : "false",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (details.object.resonance) {
|
|
108
|
+
fields.set("resonance", {
|
|
109
|
+
key: "resonance",
|
|
110
|
+
label: "Resonance",
|
|
111
|
+
value: `${details.object.resonance.targetObjectId} ${details.object.resonance.ratio}`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
79
114
|
if (placement?.mode === "at") {
|
|
80
115
|
fields.set("placement", {
|
|
81
116
|
key: "placement",
|
|
@@ -9,6 +9,7 @@ export interface WorldOrbitTheme {
|
|
|
9
9
|
backgroundGlow: string;
|
|
10
10
|
panel: string;
|
|
11
11
|
panelLine: string;
|
|
12
|
+
relation: string;
|
|
12
13
|
orbit: string;
|
|
13
14
|
orbitBand: string;
|
|
14
15
|
guide: string;
|
|
@@ -27,6 +28,7 @@ export interface WorldOrbitTheme {
|
|
|
27
28
|
export interface ViewerLayerOptions {
|
|
28
29
|
background?: boolean;
|
|
29
30
|
guides?: boolean;
|
|
31
|
+
relations?: boolean;
|
|
30
32
|
orbits?: boolean;
|
|
31
33
|
objects?: boolean;
|
|
32
34
|
labels?: boolean;
|
|
@@ -73,8 +75,10 @@ export interface ViewerObjectDetails {
|
|
|
73
75
|
renderObject: RenderSceneObject;
|
|
74
76
|
label: RenderSceneLabel | null;
|
|
75
77
|
group: RenderSceneGroup | null;
|
|
78
|
+
semanticGroups: RenderScene["semanticGroups"];
|
|
76
79
|
orbit: RenderOrbitVisual | null;
|
|
77
80
|
relatedOrbits: RenderOrbitVisual[];
|
|
81
|
+
relations: RenderScene["relations"];
|
|
78
82
|
parent: RenderSceneObject | null;
|
|
79
83
|
children: RenderSceneObject[];
|
|
80
84
|
ancestors: RenderSceneObject[];
|
|
@@ -117,6 +121,7 @@ export interface ViewerBookmark {
|
|
|
117
121
|
export interface AtlasViewerControls {
|
|
118
122
|
search?: boolean;
|
|
119
123
|
typeFilter?: boolean;
|
|
124
|
+
groupFilter?: boolean;
|
|
120
125
|
viewpointSelect?: boolean;
|
|
121
126
|
inspector?: boolean;
|
|
122
127
|
bookmarks?: boolean;
|
|
@@ -132,6 +137,8 @@ export interface AtlasInspectorSnapshot {
|
|
|
132
137
|
projection: ViewProjection;
|
|
133
138
|
renderPreset: RenderPresetName | null;
|
|
134
139
|
groupCount: number;
|
|
140
|
+
semanticGroupCount: number;
|
|
141
|
+
relationCount: number;
|
|
135
142
|
viewpointCount: number;
|
|
136
143
|
};
|
|
137
144
|
}
|
|
@@ -644,11 +644,15 @@ export function createInteractiveViewer(container, options) {
|
|
|
644
644
|
renderObject,
|
|
645
645
|
label: scene.labels.find((label) => label.objectId === renderObject.objectId && !label.hidden) ?? null,
|
|
646
646
|
group: scene.groups.find((group) => group.renderId === renderObject.groupId) ?? null,
|
|
647
|
+
semanticGroups: scene.semanticGroups.filter((group) => renderObject.semanticGroupIds.includes(group.id)),
|
|
647
648
|
orbit: scene.orbitVisuals.find((orbit) => orbit.objectId === renderObject.objectId && !orbit.hidden) ?? null,
|
|
648
649
|
relatedOrbits: scene.orbitVisuals.filter((orbit) => !orbit.hidden &&
|
|
649
650
|
(orbit.objectId === renderObject.objectId ||
|
|
650
651
|
renderObject.ancestorIds.includes(orbit.objectId) ||
|
|
651
652
|
renderObject.childIds.includes(orbit.objectId))),
|
|
653
|
+
relations: scene.relations.filter((relation) => !relation.hidden &&
|
|
654
|
+
(relation.fromObjectId === renderObject.objectId ||
|
|
655
|
+
relation.toObjectId === renderObject.objectId)),
|
|
652
656
|
parent: getObjectById(renderObject.parentId),
|
|
653
657
|
children: renderObject.childIds.map((childId) => getObjectById(childId)).filter(Boolean),
|
|
654
658
|
ancestors: renderObject.ancestorIds
|