@restless-dreams/orbit 0.1.0 → 0.2.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/README.md +5 -2
- package/dist/bin/orbit.js +2972 -213
- package/dist/bin/orbit.js.map +25 -13
- package/dist/{chunk-mtrnm0yc.js → chunk-fkdfgtx9.js} +3156 -2854
- package/dist/chunk-fkdfgtx9.js.map +75 -0
- package/dist/{chunk-7n00wx0t.js → chunk-y748hzcr.js} +2 -2
- package/dist/{chunk-0gwh723s.js → chunk-zze4tc9n.js} +2 -2
- package/dist/core/branch-colors.d.ts +57 -0
- package/dist/core/document-source.d.ts +1 -1
- package/dist/core/editing.d.ts +8 -5
- package/dist/core/engine/scene.d.ts +5 -4
- package/dist/core/engine/views.d.ts +10 -2
- package/dist/core/index.d.ts +10 -0
- package/dist/core/input-controller.d.ts +7 -0
- package/dist/core/languages.d.ts +2 -0
- package/dist/core/node-attributes.d.ts +1 -1
- package/dist/core/other-apps/freemind.d.ts +8 -0
- package/dist/core/other-apps/icons.d.ts +16 -0
- package/dist/core/other-apps/ideas.d.ts +76 -0
- package/dist/core/other-apps/import.d.ts +28 -0
- package/dist/core/other-apps/inflate.d.ts +22 -0
- package/dist/core/other-apps/markup.d.ts +51 -0
- package/dist/core/other-apps/notes.d.ts +80 -0
- package/dist/core/other-apps/opml.d.ts +26 -0
- package/dist/core/other-apps/reading.d.ts +36 -0
- package/dist/core/other-apps/xmind.d.ts +14 -0
- package/dist/core/other-apps/zip.d.ts +37 -0
- package/dist/core/print-layout.d.ts +70 -0
- package/dist/core/renderer/content-painter.d.ts +30 -0
- package/dist/core/renderer/dom.d.ts +15 -0
- package/dist/core/renderer/families.d.ts +35 -0
- package/dist/core/renderer/label-painter.d.ts +93 -0
- package/dist/core/renderer/node-painter.d.ts +113 -0
- package/dist/core/renderer/numbers.d.ts +2 -0
- package/dist/core/renderer/options.d.ts +12 -0
- package/dist/core/renderer/rings-and-links.d.ts +23 -0
- package/dist/core/renderer/scene-helpers.d.ts +33 -0
- package/dist/core/renderer/trees.d.ts +22 -0
- package/dist/core/svg-renderer.d.ts +6 -109
- package/dist/core/types.d.ts +9 -1
- package/dist/core/web-page/page.d.ts +2 -1
- package/dist/core/web-page/runtime.d.ts +1 -1
- package/dist/index.js +2935 -26
- package/dist/index.js.map +18 -6
- package/dist/marked/index.js +2 -2
- package/dist/react/index.js +2 -2
- package/dist/web-page.js +79 -79
- package/llms-full.txt +205 -5
- package/llms.txt +2 -1
- package/package.json +1 -1
- package/skills/orbit/SKILL.md +1 -1
- package/skills/orbit/references/editing.md +2 -1
- package/skills/orbit/references/format.md +28 -0
- package/skills/orbit/references/guide.md +25 -1
- package/skills/orbit/references/import-export.md +115 -0
- package/skills/orbit/references/languages.md +1 -0
- package/skills/orbit/references/recipes.md +9 -0
- package/skills/orbit/references/theming.md +15 -0
- package/dist/chunk-mtrnm0yc.js.map +0 -63
- /package/dist/{chunk-7n00wx0t.js.map → chunk-y748hzcr.js.map} +0 -0
- /package/dist/{chunk-0gwh723s.js.map → chunk-zze4tc9n.js.map} +0 -0
|
@@ -26,29 +26,18 @@ export declare class OrbitSVGRenderer {
|
|
|
26
26
|
private readonly definitions;
|
|
27
27
|
/** The camera as last written to the world: a spin repaints every frame without moving it. */
|
|
28
28
|
private worldTransform;
|
|
29
|
-
/** The orbit's turn as last written to the layers of its planets and moons (see `paintTurn`). */
|
|
30
|
-
private turnTransform;
|
|
31
29
|
/** The theme the shading was last placed for (see `placeShading`). */
|
|
32
30
|
private shadingTheme;
|
|
33
|
-
/** The turn the shading of specks is turned back by (see `turnShading`). */
|
|
34
|
-
private speckLighting;
|
|
35
|
-
/** The on-screen radius (px) below which bodies were last drawn as specks (see `speckRadius`). */
|
|
36
|
-
private specksBelow;
|
|
37
|
-
/**
|
|
38
|
-
* The nodes as last painted at rest, with what they were drawn for: while
|
|
39
|
-
* only the camera or the orbit's turn changes, they hold still, all but
|
|
40
|
-
* the bodies turned back upright (see `paintNodes`).
|
|
41
|
-
*/
|
|
42
|
-
private stillNodes;
|
|
43
31
|
private readonly layers;
|
|
44
32
|
private readonly labelLayer;
|
|
45
33
|
/** The fonts the labels are drawn with, which names are measured and fitted in. */
|
|
46
34
|
private readonly labelFonts;
|
|
35
|
+
private readonly labelPainter;
|
|
47
36
|
/** Stops listening for fonts that finish loading. */
|
|
48
37
|
private readonly stopWatchingFonts;
|
|
49
38
|
/** What node types draw inside their nodes, between the nodes and the labels. */
|
|
50
39
|
private readonly contentLayer;
|
|
51
|
-
private readonly
|
|
40
|
+
private readonly contentPainter;
|
|
52
41
|
/** This map's node types, actions and status words, then the registered ones. */
|
|
53
42
|
private extensions;
|
|
54
43
|
/** The words the map speaks, in its language, and the language and words they were made for. */
|
|
@@ -110,32 +99,8 @@ export declare class OrbitSVGRenderer {
|
|
|
110
99
|
private wheelZoom;
|
|
111
100
|
private display;
|
|
112
101
|
private restingDisplay;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
* ids for a scene at rest: the order holds while the orbit spins, only the
|
|
116
|
-
* entries are new each frame.
|
|
117
|
-
*/
|
|
118
|
-
private labelOrder;
|
|
119
|
-
private readonly nodeViews;
|
|
120
|
-
/** The family group each node's element is in (see `Family`). */
|
|
121
|
-
private readonly nodeGroups;
|
|
122
|
-
private readonly families;
|
|
123
|
-
/** Counts flights, so each one's arrivals get groups of their own. */
|
|
124
|
-
private flightCount;
|
|
125
|
-
private familyCount;
|
|
126
|
-
private readonly labels;
|
|
127
|
-
private readonly ringViews;
|
|
128
|
-
/** Each view keeps what it last wrote, so the elements of a map that didn't move aren't touched. */
|
|
129
|
-
private readonly linkViews;
|
|
130
|
-
private readonly counts;
|
|
131
|
-
/** The camera labels and counts were last placed for, and the nodes they were placed for. */
|
|
132
|
-
private labelsPlaced;
|
|
133
|
-
/** Names planned to show that wait for a later frame (see `LABELS_SHOWN_PER_FRAME`), placed for `labelsPlaced`'s camera, and whether the map moved then. */
|
|
134
|
-
private waitingLabels;
|
|
135
|
-
private labelLayerTransform;
|
|
136
|
-
private readonly lightText;
|
|
137
|
-
/** The theme's label colors, resolved when first needed after each theme change. */
|
|
138
|
-
private textColors;
|
|
102
|
+
private readonly ringsAndLinks;
|
|
103
|
+
private readonly nodePainter;
|
|
139
104
|
/** The node that holds the map's single tab stop. */
|
|
140
105
|
private activeId;
|
|
141
106
|
private tabStopsChanged;
|
|
@@ -165,8 +130,6 @@ export declare class OrbitSVGRenderer {
|
|
|
165
130
|
private dropFrom;
|
|
166
131
|
/** A long press no one took a menu for, on a node it lifts: let go without moving, the node is typed into. */
|
|
167
132
|
private editOnLift;
|
|
168
|
-
/** The lifted node and the drop target last drawn, so a change draws every node again. */
|
|
169
|
-
private dragMarks;
|
|
170
133
|
private ambientRunning;
|
|
171
134
|
/** Drift not painted yet, in degrees: less than a `DRIFT_STEP`. */
|
|
172
135
|
private pendingDrift;
|
|
@@ -342,6 +305,8 @@ export declare class OrbitSVGRenderer {
|
|
|
342
305
|
* outline entries carry on too; the copy lends only its places in the source.
|
|
343
306
|
*/
|
|
344
307
|
private adoptTree;
|
|
308
|
+
/** How edits keep top-level nodes' colors: the palette's colors after the root's, and each node's own color or its type's. */
|
|
309
|
+
private branchColorRules;
|
|
345
310
|
/** Shows an edit, keeping the reader's place, and reports it. */
|
|
346
311
|
private afterEdit;
|
|
347
312
|
/** Adds a node; `arrival`, where a new idea was typed, is where it first shows. */
|
|
@@ -462,36 +427,6 @@ export declare class OrbitSVGRenderer {
|
|
|
462
427
|
/** Stops every camera and orbit motion except a flight between views. */
|
|
463
428
|
private stopMotion;
|
|
464
429
|
private paint;
|
|
465
|
-
private paintRings;
|
|
466
|
-
private paintLinks;
|
|
467
|
-
/**
|
|
468
|
-
* Turns the layers of the planets and moons with the orbit (see
|
|
469
|
-
* `OrbitTurn`). Returns the turn (degrees) its bodies are drawn in, or
|
|
470
|
-
* undefined when each is drawn where it is.
|
|
471
|
-
*/
|
|
472
|
-
private paintTurn;
|
|
473
|
-
private paintNodes;
|
|
474
|
-
/**
|
|
475
|
-
* The on-screen radius (px) below which flat bodies are specks, for this
|
|
476
|
-
* screen's pixels; the stylesheet sizes specks' rims from it.
|
|
477
|
-
*/
|
|
478
|
-
private speckRadius;
|
|
479
|
-
/**
|
|
480
|
-
* A family whose members don't all move alike in this flight (some travel
|
|
481
|
-
* on, the rest leave) splits in two, the fewer of them moving to a group of
|
|
482
|
-
* their own, so each part moves as one.
|
|
483
|
-
*/
|
|
484
|
-
private splitIfMixed;
|
|
485
|
-
/**
|
|
486
|
-
* The group a node is drawn in: its family's, in the layer of its role. A
|
|
487
|
-
* node stays in its group while its parent and role do, so nothing moves
|
|
488
|
-
* between groups when a flight lands; the ideas a flight brings in get a
|
|
489
|
-
* group of their own, so they can move as one while their siblings travel.
|
|
490
|
-
*/
|
|
491
|
-
private placeInFamily;
|
|
492
|
-
/** A new family's group; one that starts hidden (newcomers yet to appear) is hidden before it joins the map, so its members aren't styled until they show. */
|
|
493
|
-
private createFamily;
|
|
494
|
-
private moveIntoFamily;
|
|
495
430
|
/** The node whose text is being typed on the map, if any. */
|
|
496
431
|
private editedId;
|
|
497
432
|
private paintAddSlot;
|
|
@@ -506,45 +441,7 @@ export declare class OrbitSVGRenderer {
|
|
|
506
441
|
* it grows, as names do, to keep clear of the count.
|
|
507
442
|
*/
|
|
508
443
|
private editorPlacement;
|
|
509
|
-
private removeNodeView;
|
|
510
|
-
/**
|
|
511
|
-
* While only the camera moves (a pan, a pinch, a zoom, a glide), labels and counts ride along
|
|
512
|
-
* as one layer instead of being placed again on every frame, which for a big view means
|
|
513
|
-
* restyling hundreds of them. They're placed again once the camera rests, or has gone far
|
|
514
|
-
* enough that they'd be too big or too small, or missing for nodes coming into view. Returns
|
|
515
|
-
* the layer's transform from where they were placed, or null to place them now.
|
|
516
|
-
*/
|
|
517
|
-
private labelRide;
|
|
518
|
-
/** Fits and places every label again, where it is (the fonts changed). */
|
|
519
|
-
private fitLabelsAgain;
|
|
520
|
-
/** Whether the labels were placed for this very view: the same nodes, the camera where it was, nothing changed. */
|
|
521
|
-
private labelsStill;
|
|
522
|
-
private setLabelLayerTransform;
|
|
523
|
-
private paintLabels;
|
|
524
|
-
/** Shows a planned label: its view (made when it has none yet) placed and fitted as planned. */
|
|
525
|
-
private showLabel;
|
|
526
|
-
/**
|
|
527
|
-
* While the labels ride along with the camera, shows the next names
|
|
528
|
-
* waiting to: placed as planned, for the camera the labels were placed
|
|
529
|
-
* at, so they ride along with the rest.
|
|
530
|
-
*/
|
|
531
|
-
private showWaitingLabels;
|
|
532
|
-
/** Whether the node shows a picture or its type's own content, so its label goes outside. */
|
|
533
|
-
private showsImage;
|
|
534
|
-
/**
|
|
535
|
-
* Draws what node types render inside their nodes: a 100 × 100 px box per
|
|
536
|
-
* node, moved and scaled with it each frame, created when the node comes
|
|
537
|
-
* on the map and cleaned up when it leaves.
|
|
538
|
-
*/
|
|
539
|
-
private paintContents;
|
|
540
|
-
private removeContent;
|
|
541
|
-
/** Whether the theme's light text has more contrast on this node's color than its dark text. Measured once per node and color. */
|
|
542
|
-
private usesLightText;
|
|
543
|
-
/** The theme's label colors as plain values. */
|
|
544
|
-
private resolveTextColors;
|
|
545
444
|
private paintOverlay;
|
|
546
|
-
/** The "+N" of nodes with children that aren't drawn, at their lower right. In the label layer, so they ride along with the labels. */
|
|
547
|
-
private paintCounts;
|
|
548
445
|
private clearViews;
|
|
549
446
|
/** One tab stop for the whole map (roving tabindex); arrow keys move between nodes. */
|
|
550
447
|
private updateTabStops;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ export interface OrbitNode {
|
|
|
15
15
|
level: number;
|
|
16
16
|
/** Any CSS color. Without one, the node takes its branch's color from the theme or `palette`. */
|
|
17
17
|
color?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Which of the palette's colors the node takes when it has no `color` of
|
|
20
|
+
* its own: `1` is the first after the root's, cycling. Without one, a
|
|
21
|
+
* top-level node takes the next in turn and a deeper node a shade of its
|
|
22
|
+
* branch's. Edits on the map write it to keep a top-level node's color
|
|
23
|
+
* when the nodes around it change.
|
|
24
|
+
*/
|
|
25
|
+
paletteColor?: number;
|
|
18
26
|
/** An emoji (or any short symbol) shown before the text. */
|
|
19
27
|
icon?: string;
|
|
20
28
|
/** Hide the node's children until it is opened. */
|
|
@@ -211,7 +219,7 @@ export interface OrbitEdit {
|
|
|
211
219
|
tree: OrbitNode;
|
|
212
220
|
}
|
|
213
221
|
/** What `addNode` and `updateNode` take: a node's text and attributes. */
|
|
214
|
-
export type OrbitNodeInput = Partial<Pick<OrbitNode, 'text' | 'icon' | 'color' | 'status' | 'priority' | 'tags' | 'collapsed' | 'link' | 'note' | 'noteFormat' | 'image' | 'video' | 'embed' | 'type' | 'typeVersion' | 'attrs'>>;
|
|
222
|
+
export type OrbitNodeInput = Partial<Pick<OrbitNode, 'text' | 'icon' | 'color' | 'paletteColor' | 'status' | 'priority' | 'tags' | 'collapsed' | 'link' | 'note' | 'noteFormat' | 'image' | 'video' | 'embed' | 'type' | 'typeVersion' | 'attrs'>>;
|
|
215
223
|
/** What `addNode` takes: a node's text and attributes, and the nodes to add under it, as many levels down as you like. */
|
|
216
224
|
export type OrbitNewNode = OrbitNodeInput & {
|
|
217
225
|
text: string;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* A map as a web page: one HTML file with Orbit, the map and its pictures
|
|
3
3
|
* inside, which opens in any browser, offline. Readers explore it with
|
|
4
4
|
* Orbit's own controls, or present it: one idea at a time, in reading order,
|
|
5
|
-
* with its note as a caption (see runtime.ts, the page's script).
|
|
5
|
+
* with its note as a caption (see runtime.ts, the page's script). Printed,
|
|
6
|
+
* it's the map laid out for paper (print-layout.ts) instead.
|
|
6
7
|
*/
|
|
7
8
|
import { type OrbitStrings } from '../languages.js';
|
|
8
9
|
import type { OrbitDocument, OrbitRendererTheme, ViewMode } from '../types.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* from the page's JSON, with its pictures swapped for the ones inside the
|
|
4
4
|
* page, and presents it on request: one idea at a time, in reading order,
|
|
5
5
|
* with its note as a caption, stepped with keys, buttons or swipes, full
|
|
6
|
-
* screen where the browser allows.
|
|
6
|
+
* screen where the browser allows. Printed, it's the map laid out for paper.
|
|
7
7
|
*/
|
|
8
8
|
import type { OrbitSVGRenderer } from '../svg-renderer.js';
|
|
9
9
|
import type { OrbitDocument } from '../types.js';
|