@restless-dreams/orbit 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +165 -2
- package/dist/bin/orbit.js +8907 -0
- package/dist/bin/orbit.js.map +48 -0
- package/dist/chunk-0gwh723s.js +408 -0
- package/dist/chunk-0gwh723s.js.map +10 -0
- package/dist/chunk-7n00wx0t.js +82 -0
- package/dist/chunk-7n00wx0t.js.map +10 -0
- package/dist/chunk-mtrnm0yc.js +16993 -0
- package/dist/chunk-mtrnm0yc.js.map +63 -0
- package/dist/core/auto-render.d.ts +85 -0
- package/dist/core/browser.d.ts +23 -0
- package/dist/core/create.d.ts +23 -0
- package/dist/core/diagnostics.d.ts +40 -0
- package/dist/core/dispatch.d.ts +23 -0
- package/dist/core/document-options.d.ts +18 -0
- package/dist/core/document-source.d.ts +128 -0
- package/dist/core/editing.d.ts +63 -0
- package/dist/core/engine/animation-clock.d.ts +40 -0
- package/dist/core/engine/camera.d.ts +70 -0
- package/dist/core/engine/colors.d.ts +51 -0
- package/dist/core/engine/display.d.ts +125 -0
- package/dist/core/engine/export.d.ts +32 -0
- package/dist/core/engine/glide.d.ts +34 -0
- package/dist/core/engine/labels.d.ts +106 -0
- package/dist/core/engine/node-drag.d.ts +49 -0
- package/dist/core/engine/scene.d.ts +159 -0
- package/dist/core/engine/spin.d.ts +62 -0
- package/dist/core/engine/surface-pattern.d.ts +20 -0
- package/dist/core/engine/text-measure.d.ts +116 -0
- package/dist/core/engine/views.d.ts +353 -0
- package/dist/core/extensions.d.ts +155 -0
- package/dist/core/format-upgrades.d.ts +33 -0
- package/dist/core/index.d.ts +36 -0
- package/dist/core/input-controller.d.ts +109 -0
- package/dist/core/languages.d.ts +199 -0
- package/dist/core/layout.d.ts +61 -0
- package/dist/core/map-tools/definitions.d.ts +71 -0
- package/dist/core/map-tools/input.d.ts +62 -0
- package/dist/core/map-tools/reading.d.ts +40 -0
- package/dist/core/map-tools/tools.d.ts +51 -0
- package/dist/core/markdown-writing.d.ts +87 -0
- package/dist/core/material.d.ts +25 -0
- package/dist/core/media.d.ts +42 -0
- package/dist/core/node-attributes.d.ts +31 -0
- package/dist/core/node-links.d.ts +25 -0
- package/dist/core/parser-markdown.d.ts +42 -0
- package/dist/core/parser-yaml.d.ts +8 -0
- package/dist/core/render-to-svg.d.ts +57 -0
- package/dist/core/serializer-markdown.d.ts +18 -0
- package/dist/core/serializer-yaml.d.ts +2 -0
- package/dist/core/source-patch.d.ts +24 -0
- package/dist/core/source.d.ts +27 -0
- package/dist/core/styles.d.ts +6 -0
- package/dist/core/suggest.d.ts +8 -0
- package/dist/core/svg-renderer.d.ts +729 -0
- package/dist/core/text-layout.d.ts +54 -0
- package/dist/core/themes.d.ts +62 -0
- package/dist/core/types.d.ts +463 -0
- package/dist/core/ui/actions.d.ts +75 -0
- package/dist/core/ui/controls.d.ts +61 -0
- package/dist/core/ui/detail-sheet.d.ts +88 -0
- package/dist/core/ui/frames.d.ts +11 -0
- package/dist/core/ui/icons.d.ts +14 -0
- package/dist/core/ui/inline-editor.d.ts +79 -0
- package/dist/core/ui/media-players.d.ts +65 -0
- package/dist/core/ui/media-viewer.d.ts +169 -0
- package/dist/core/ui/media-zoom.d.ts +51 -0
- package/dist/core/ui/note-markdown.d.ts +19 -0
- package/dist/core/ui/outline.d.ts +44 -0
- package/dist/core/url-guard.d.ts +40 -0
- package/dist/core/utils.d.ts +23 -0
- package/dist/core/web-page/page.d.ts +58 -0
- package/dist/core/web-page/runtime.d.ts +13 -0
- package/dist/core/web-page/start.d.ts +1 -0
- package/dist/core/yaml-mini.d.ts +54 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1448 -0
- package/dist/index.js.map +17 -0
- package/dist/marked/index.d.ts +31 -0
- package/dist/marked/index.js +110 -0
- package/dist/marked/index.js.map +10 -0
- package/dist/react/index.d.ts +55 -0
- package/dist/react/index.js +352 -0
- package/dist/react/index.js.map +1 -0
- package/dist/web-page.d.ts +2 -0
- package/dist/web-page.js +130 -0
- package/llms-full.txt +2585 -0
- package/llms.txt +35 -0
- package/package.json +118 -4
- package/skills/orbit/SKILL.md +140 -0
- package/skills/orbit/references/editing.md +194 -0
- package/skills/orbit/references/extending.md +247 -0
- package/skills/orbit/references/format.md +303 -0
- package/skills/orbit/references/guide.md +522 -0
- package/skills/orbit/references/languages.md +159 -0
- package/skills/orbit/references/map-tools.md +188 -0
- package/skills/orbit/references/media.md +160 -0
- package/skills/orbit/references/recipes.md +227 -0
- package/skills/orbit/references/theming.md +184 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Diana Islas Ocampo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,166 @@
|
|
|
1
|
-
|
|
1
|
+
<img src="docs/media/logo.svg" alt="Orbit's logo: a golden sun with six colorful planets on a dotted orbit" width="96">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Orbit
|
|
4
|
+
|
|
5
|
+
Mind maps written in markdown and explored like a solar system.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
**[Website](https://orbit.hyuchia.com)** · [Playground](https://orbit.hyuchia.com/playground) · [Guide](docs/guide.md) · [Map format](docs/format.md) · [Recipes](docs/recipes.md) · [Theming](docs/theming.md) · [Extending](docs/extending.md) · [Editing](docs/editing.md) · [Map tools for AI](docs/map-tools.md) · [Pictures and videos](docs/media.md) · [Languages](docs/languages.md) · [Accessibility](docs/accessibility.md) · [Coding agents](docs/agents.md) · [API reference](docs/api/README.md)
|
|
10
|
+
|
|
11
|
+
- Real-markdown authoring: headers and bullet lists nest the tree.
|
|
12
|
+
- YAML alternative for app-generated maps.
|
|
13
|
+
- Explorable: zoom into a node to enter it and out to leave, flick the orbit to spin it, pan and zoom the overview. Every move is animated so you never lose your place.
|
|
14
|
+
- Readable at any size: labels stay crisp, sized for reading and in high contrast.
|
|
15
|
+
- Fourteen themes, from pastel paper and a field of stars to flat, Material and liquid glass, each restylable with CSS custom properties, and Material themes built from any color.
|
|
16
|
+
- First-class pictures, videos, embeds and multi-line notes per node: pictures and videos open over the whole window, to zoom into and to play, and the rest in a built-in detail sheet, unless you handle `onAction` yourself.
|
|
17
|
+
- Built on the map: a + in the orbit adds ideas, typed right inside their planet, and nodes can be renamed, dragged and saved back as markdown.
|
|
18
|
+
- Ready for AI: tools any model calls to read a map and change it, for Anthropic, OpenAI, Gemini, MCP and the providers that follow OpenAI's API, with every change animated on the map.
|
|
19
|
+
- Keyboard and screen-reader friendly: one tab stop, arrow-key navigation, a list view of the whole map, and announcements as you move, in English, Spanish or any language you add.
|
|
20
|
+
- Framework-agnostic core with no dependencies; React wrapper at `@restless-dreams/orbit/react`; `marked` extension at `@restless-dreams/orbit/marked`.
|
|
21
|
+
- Made for coding agents too: the docs in one file (`llms-full.txt`), an agent skill, validation as JSON, and problems reported with the fix.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @restless-dreams/orbit
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
React and marked are optional peers, needed only for their integrations: `npm install react react-dom` for `@restless-dreams/orbit/react`, and `npm install marked` for `@restless-dreams/orbit/marked`.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { createOrbitMap } from '@restless-dreams/orbit';
|
|
35
|
+
|
|
36
|
+
const map = createOrbitMap(document.getElementById('map')!, `# 🚀 Project
|
|
37
|
+
|
|
38
|
+
## Research
|
|
39
|
+
## Build
|
|
40
|
+
## Launch`);
|
|
41
|
+
|
|
42
|
+
map.on('focus-change', ({ node }) => console.log('Now looking at', node.text));
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The map fills its container, so give the container a size.
|
|
46
|
+
|
|
47
|
+
**React:**
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { OrbitMindMap } from '@restless-dreams/orbit/react';
|
|
51
|
+
|
|
52
|
+
export const ProjectMap = ({ markdown }: { markdown: string }) => {
|
|
53
|
+
return (
|
|
54
|
+
<div style={{ height: 480 }}>
|
|
55
|
+
<OrbitMindMap source={markdown} onNodeClick={(node) => console.log(node.text)} />
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Without a build step,** with the `<orbit-map>` element:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<script type="module">
|
|
65
|
+
import { defineOrbitMapElement } from 'https://cdn.jsdelivr.net/npm/@restless-dreams/orbit/+esm';
|
|
66
|
+
defineOrbitMapElement();
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<orbit-map height="420">
|
|
70
|
+
# 🚀 Project
|
|
71
|
+
|
|
72
|
+
## Research <!-- orbit status: active -->
|
|
73
|
+
## Build
|
|
74
|
+
</orbit-map>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**In a markdown pipeline,** with marked:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { Marked } from 'marked';
|
|
81
|
+
import { orbitMarked, hydrateOrbitBlocks } from '@restless-dreams/orbit/marked';
|
|
82
|
+
|
|
83
|
+
const markdown = new Marked(orbitMarked());
|
|
84
|
+
container.innerHTML = await markdown.parse(article); // orbit fences become map placeholders
|
|
85
|
+
hydrateOrbitBlocks(container); // turns them into live maps
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Without a browser,** `renderToSVGString(markdown, { width: 1200, height: 800 })` draws a standalone SVG, for static sites, emails and print.
|
|
89
|
+
|
|
90
|
+
[The guide](docs/guide.md) covers every option, event and method, and [Recipes](docs/recipes.md) shows Orbit in Vue, Svelte, Astro, Next.js and static sites.
|
|
91
|
+
|
|
92
|
+
## Write a map
|
|
93
|
+
|
|
94
|
+
Every heading and every list item is a node, the text under it is its note, and `<!-- orbit … -->` comments set attributes:
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
---
|
|
98
|
+
title: Product roadmap
|
|
99
|
+
theme: night
|
|
100
|
+
---
|
|
101
|
+
# 🚀 Product roadmap
|
|
102
|
+
|
|
103
|
+
## Research <!-- orbit status: done -->
|
|
104
|
+
Six weeks of interviews before we commit to scope.
|
|
105
|
+
- [x] User interviews
|
|
106
|
+
- Competitor teardown #market
|
|
107
|
+
|
|
108
|
+
## Build <!-- orbit status: active -->
|
|
109
|
+
### Frontend
|
|
110
|
+
- [/] App shell
|
|
111
|
+
- Offline sync
|
|
112
|
+
### Backend
|
|
113
|
+
|
|
114
|
+
## Launch
|
|
115
|
+

|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Maps can be YAML too, for the ones programs write. [The map format](docs/format.md) has every rule, attribute, option and diagnostic, and `npx @restless-dreams/orbit example` prints a map with the main features.
|
|
119
|
+
|
|
120
|
+
## Themes
|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+
Pick one with the `theme` option, the `theme` attribute or `theme:` in the frontmatter. Every color, size and finish is a CSS custom property your page can set, and `materialTheme('#0B57D0')` builds a Material theme from any color. See [Theming](docs/theming.md).
|
|
125
|
+
|
|
126
|
+
## Command line
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npx @restless-dreams/orbit validate my-map.md # every problem as my-map.md:line: severity: message [code]
|
|
130
|
+
npx @restless-dreams/orbit validate --json my-map.md # the same as JSON, for scripts and coding agents
|
|
131
|
+
npx @restless-dreams/orbit validate --tree my-map.md # the map as Orbit reads it, with each node's id
|
|
132
|
+
npx @restless-dreams/orbit render my-map.md --out my-map.svg # draw a map to SVG (--view all for the whole map)
|
|
133
|
+
npx @restless-dreams/orbit export --html my-map.md --out my-map.html # one web page to explore or present the map, offline
|
|
134
|
+
npx @restless-dreams/orbit convert --to yaml my-map.md # markdown ↔ YAML (either direction)
|
|
135
|
+
npx @restless-dreams/orbit example > my-map.md # a map with the main features (--yaml for YAML)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## AI in your app
|
|
139
|
+
|
|
140
|
+
`createMapTools(map)` gives a language model tools to read the map and change it, in the shape your provider's API takes. Its changes animate on the map, and a call it gets wrong changes nothing and says what to send instead:
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
import { createMapTools } from '@restless-dreams/orbit';
|
|
144
|
+
|
|
145
|
+
const tools = createMapTools(map); // a map on screen, or a document on a server
|
|
146
|
+
tools.for('anthropic'); // the tools for the model: also 'openai', 'openai-chat' and 'gemini'
|
|
147
|
+
tools.run('add_nodes', { parent_id: 'research', outline: '- Interviews\n- Survey' }); // each call it makes: { ok, text, changed }
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
[Map tools for AI](docs/map-tools.md) has the whole loop for each provider.
|
|
151
|
+
|
|
152
|
+
## Coding agents
|
|
153
|
+
|
|
154
|
+
Point your agent at `node_modules/@restless-dreams/orbit/llms-full.txt`, the docs in one file, or install the skill for Codex, Claude Code, Kimi Code and other agents with `npx skills add restless-dreams/orbit`. [Coding agents](docs/agents.md) has the details.
|
|
155
|
+
|
|
156
|
+
## Browsers
|
|
157
|
+
|
|
158
|
+
Orbit is made for current browsers, and draws in older ones down to Chromium 99, which some phones' WebViews still run, with plainer versions of the few effects that need newer CSS ([which ones](docs/guide.md#browsers)).
|
|
159
|
+
|
|
160
|
+
## Contributing
|
|
161
|
+
|
|
162
|
+
With [Bun](https://bun.sh) installed, `bun install`, then `bun run verify` runs the linter, the type checks, the tests and the build. [CONTRIBUTING.md](CONTRIBUTING.md) has the rest, [RELEASE.md](RELEASE.md) how releases are made, and [docs/architecture.md](docs/architecture.md) how Orbit is put together.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[MIT](LICENSE)
|