@jxsuite/studio 0.10.2 → 0.13.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 +82 -0
- package/dist/studio.js +5114 -3424
- package/dist/studio.js.map +65 -49
- package/package.json +6 -3
- package/src/browse/browse.js +27 -3
- package/src/canvas/canvas-diff.js +184 -0
- package/src/canvas/canvas-helpers.js +10 -14
- package/src/canvas/canvas-live-render.js +136 -17
- package/src/canvas/canvas-render.js +154 -21
- package/src/canvas/canvas-utils.js +21 -23
- package/src/editor/component-inline-edit.js +54 -41
- package/src/editor/content-inline-edit.js +46 -47
- package/src/editor/context-menu.js +63 -39
- package/src/editor/convert-to-component.js +11 -14
- package/src/editor/insertion-helper.js +8 -10
- package/src/editor/shortcuts.js +69 -39
- package/src/files/components.js +15 -4
- package/src/files/files.js +72 -24
- package/src/panels/activity-bar.js +29 -7
- package/src/panels/block-action-bar.js +104 -80
- package/src/panels/canvas-dnd.js +132 -50
- package/src/panels/dnd.js +32 -28
- package/src/panels/editors.js +7 -14
- package/src/panels/elements-panel.js +9 -3
- package/src/panels/events-panel.js +44 -39
- package/src/panels/git-panel.js +45 -3
- package/src/panels/layers-panel.js +16 -11
- package/src/panels/left-panel.js +108 -43
- package/src/panels/overlays.js +97 -35
- package/src/panels/panel-events.js +18 -11
- package/src/panels/properties-panel.js +467 -98
- package/src/panels/right-panel.js +85 -37
- package/src/panels/shared.js +0 -22
- package/src/panels/signals-panel.js +125 -54
- package/src/panels/statusbar.js +23 -8
- package/src/panels/style-inputs.js +4 -2
- package/src/panels/style-panel.js +128 -105
- package/src/panels/stylebook-panel.js +42 -17
- package/src/panels/tab-strip.js +124 -0
- package/src/panels/toolbar.js +39 -9
- package/src/reactivity.js +28 -0
- package/src/settings/content-types-editor.js +78 -8
- package/src/settings/defs-editor.js +56 -7
- package/src/settings/schema-field-ui.js +99 -11
- package/src/site-context.js +105 -0
- package/src/state.js +0 -456
- package/src/store.js +105 -124
- package/src/studio.js +112 -121
- package/src/tabs/tab.js +153 -0
- package/src/tabs/transact.js +406 -0
- package/src/ui/spectrum.js +2 -0
- package/src/view.js +3 -0
- package/src/workspace/workspace.js +89 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# `@jxsuite/studio`
|
|
2
|
+
|
|
3
|
+
> Visual builder for Jx documents.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Jx Studio is a browser-based visual IDE for Jx applications. It renders a live canvas via `@jxsuite/runtime`, provides a layer tree for structural editing, an inspector for property/style/state management, and a Monaco-powered code editor for function bodies. The UI is built with [Adobe Spectrum Web Components](https://opensource.adobe.com/spectrum-web-components/).
|
|
8
|
+
|
|
9
|
+
At the site level, Studio acts as a CMS — providing a project explorer, content collection browser, schema-driven entry editors, and media management.
|
|
10
|
+
|
|
11
|
+
## Development usage
|
|
12
|
+
|
|
13
|
+
Studio is served by `@jxsuite/server` during development:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun run dev # starts dev server + Studio at http://localhost:3000
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
Three-column layout:
|
|
22
|
+
|
|
23
|
+
| Column | Content |
|
|
24
|
+
| ------ | ------------------------------------------------------- |
|
|
25
|
+
| Left | Activity bar + panel (layers, files, content, settings) |
|
|
26
|
+
| Center | Canvas (live preview) + toolbar |
|
|
27
|
+
| Right | Inspector (properties, style, state, code) |
|
|
28
|
+
|
|
29
|
+
### Data flow
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
.json file → Studio state (immutable) → Canvas (runtime render)
|
|
33
|
+
↓
|
|
34
|
+
Inspector panels → mutation → new state → write .json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### State model
|
|
38
|
+
|
|
39
|
+
Immutable state tree with 100-entry undo/redo history. All mutations produce a new state object. Key operations:
|
|
40
|
+
|
|
41
|
+
| Operation | Description |
|
|
42
|
+
| ------------------------------------- | ----------------------------------- |
|
|
43
|
+
| `selectNode(path)` | Select element by path |
|
|
44
|
+
| `insertNode(path, def)` | Add child element |
|
|
45
|
+
| `removeNode(path)` | Delete element |
|
|
46
|
+
| `moveNode(from, to)` | Reorder or reparent |
|
|
47
|
+
| `updateProperty(path, key, value)` | Set element property |
|
|
48
|
+
| `updateStyle(path, prop, value)` | Set style property |
|
|
49
|
+
| `updateDef(key, value)` | Update state entry |
|
|
50
|
+
| `pushDocument(doc)` / `popDocument()` | Navigate into/out of sub-components |
|
|
51
|
+
| `undo()` / `redo()` | History navigation |
|
|
52
|
+
|
|
53
|
+
### Platform Abstraction Layer (PAL)
|
|
54
|
+
|
|
55
|
+
Studio is backend-agnostic. Platform bindings (filesystem access, native dialogs, Git, package management) are injected at startup via `registerPlatform()`. Three targets share a single codebase:
|
|
56
|
+
|
|
57
|
+
| Target | Backend |
|
|
58
|
+
| -------------------- | ------------------------------ |
|
|
59
|
+
| Desktop (Electrobun) | `@jxsuite/desktop` Bun process |
|
|
60
|
+
| Dev mode (Chrome) | `@jxsuite/server` (localhost) |
|
|
61
|
+
| SaaS | Cloud API (future) |
|
|
62
|
+
|
|
63
|
+
## API
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import { createStudio } from "@jxsuite/studio";
|
|
67
|
+
import { registerPlatform } from "@jxsuite/studio/platform.js";
|
|
68
|
+
|
|
69
|
+
registerPlatform(myPlatform);
|
|
70
|
+
createStudio(document.getElementById("root"));
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Design principles
|
|
74
|
+
|
|
75
|
+
1. **JSON is the source of truth** — Studio reads and writes `.json` files directly.
|
|
76
|
+
2. **Canvas is the runtime** — Preview renders via `@jxsuite/runtime`, pixel-identical to production.
|
|
77
|
+
3. **Zero lock-in** — Studio edits produce standard Jx files that any editor can open.
|
|
78
|
+
4. **Self-hosting** — Studio is itself a Jx application.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|