@oh-just-another/diagram 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.
Files changed (39) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +68 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/bindings.d.ts +73 -0
  5. package/dist/bindings.d.ts.map +1 -0
  6. package/dist/bindings.js +77 -0
  7. package/dist/bindings.js.map +1 -0
  8. package/dist/index.d.ts +18 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +20 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/oja-diagram-element.d.ts +42 -0
  13. package/dist/oja-diagram-element.d.ts.map +1 -0
  14. package/dist/oja-diagram-element.js +202 -0
  15. package/dist/oja-diagram-element.js.map +1 -0
  16. package/dist/oja-diagram.global.js +1846 -0
  17. package/dist/oja-diagram.global.js.map +7 -0
  18. package/dist/render-worker.js +5 -0
  19. package/dist/render-worker.js.map +7 -0
  20. package/dist/styles.generated.d.ts +2 -0
  21. package/dist/styles.generated.d.ts.map +1 -0
  22. package/dist/styles.generated.js +4 -0
  23. package/dist/styles.generated.js.map +1 -0
  24. package/fonts/LICENSE +25 -0
  25. package/fonts/PTSerif-Bold.woff2 +0 -0
  26. package/fonts/PTSerif-BoldItalic.woff2 +0 -0
  27. package/fonts/PTSerif-Italic.woff2 +0 -0
  28. package/fonts/PTSerif-Regular.woff2 +0 -0
  29. package/fonts/Roboto-Bold.woff2 +0 -0
  30. package/fonts/Roboto-BoldItalic.woff2 +0 -0
  31. package/fonts/Roboto-Italic.woff2 +0 -0
  32. package/fonts/Roboto-Regular.woff2 +0 -0
  33. package/fonts/RobotoMono-Bold.woff2 +0 -0
  34. package/fonts/RobotoMono-BoldItalic.woff2 +0 -0
  35. package/fonts/RobotoMono-Italic.woff2 +0 -0
  36. package/fonts/RobotoMono-Regular.woff2 +0 -0
  37. package/package.json +72 -0
  38. package/wasm/rasterizer.wasm +0 -0
  39. package/wasm/text_shaper.wasm +0 -0
@@ -0,0 +1,42 @@
1
+ import { type EditorAPI, type ElementId, type Mode } from "@oh-just-another/editor";
2
+ import type { Scene } from "@oh-just-another/scene";
3
+ type ThemeSetting = "dark" | "light" | "system";
4
+ /**
5
+ * `<oja-diagram>` — a framework-neutral custom element wrapping the React
6
+ * editor. It mounts the editor into its own shadow root (styles isolated
7
+ * via `adoptedStyleSheets`, floating UI portaled into the same root), and
8
+ * exposes a plain DOM surface: attributes / properties for configuration,
9
+ * methods for imperative control, and `CustomEvent`s for output.
10
+ *
11
+ * Attributes (string): `theme` (`dark` | `light` | `system`), `renderer`
12
+ * (`canvas2d` | `webgl2` | `offscreen`), `grid` / `snap` (boolean — present
13
+ * = on). Properties: `scene` (a `Scene` object). Events: `ready`,
14
+ * `scenechange`, `selectionchange`, `themechange`. Methods: `undo`, `redo`,
15
+ * `zoomToFit`, `getScene`, `loadScene`, `getMode`, `setMode`,
16
+ * `getSelection`, `setSelection`, plus the `editor` escape hatch.
17
+ */
18
+ export declare class OjaDiagramElement extends HTMLElement {
19
+ #private;
20
+ static get observedAttributes(): readonly string[];
21
+ connectedCallback(): void;
22
+ disconnectedCallback(): void;
23
+ attributeChangedCallback(name: string): void;
24
+ /** The current scene. Setting it loads the scene once the editor is ready. */
25
+ get scene(): Scene | undefined;
26
+ set scene(scene: Scene | undefined);
27
+ get theme(): ThemeSetting | null;
28
+ set theme(value: ThemeSetting | null);
29
+ /** The live editor engine, or `null` until `ready` fires. */
30
+ get editor(): EditorAPI["editor"];
31
+ getScene(): Scene | undefined;
32
+ loadScene(scene: Scene): void;
33
+ undo(): void;
34
+ redo(): void;
35
+ zoomToFit(): void;
36
+ getMode(): Mode | null;
37
+ setMode(mode: Mode): void;
38
+ getSelection(): ReadonlySet<ElementId>;
39
+ setSelection(ids: Iterable<ElementId>): void;
40
+ }
41
+ export {};
42
+ //# sourceMappingURL=oja-diagram-element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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x-runtime";
2
+ import { createRoot } from "react-dom/client";
3
+ import { Editor as EditorComponent, bindEditorHotkeys, } from "@oh-just-another/editor";
4
+ import { PortalContainerProvider } from "@oh-just-another/react-ui";
5
+ import { REACT_UI_STYLES } from "./styles.generated.js";
6
+ const THEMES = new Set(["dark", "light", "system"]);
7
+ const RENDERERS = new Set(["canvas2d", "webgl2", "offscreen"]);
8
+ /** Lazily built singleton stylesheet shared by every element instance. */
9
+ let sharedSheet = null;
10
+ const styleSheet = () => {
11
+ if (!sharedSheet) {
12
+ sharedSheet = new CSSStyleSheet();
13
+ // The stylesheet declares its theme variables on `:root`, which selects
14
+ // the document root and so matches nothing inside a shadow tree. Rewrite
15
+ // it to `:host` so the variables land on the shadow host and inherit
16
+ // down to every component (including portaled menus / tooltips).
17
+ sharedSheet.replaceSync(REACT_UI_STYLES.replace(/:root\b/g, ":host"));
18
+ }
19
+ return sharedSheet;
20
+ };
21
+ /**
22
+ * `<oja-diagram>` — a framework-neutral custom element wrapping the React
23
+ * editor. It mounts the editor into its own shadow root (styles isolated
24
+ * via `adoptedStyleSheets`, floating UI portaled into the same root), and
25
+ * exposes a plain DOM surface: attributes / properties for configuration,
26
+ * methods for imperative control, and `CustomEvent`s for output.
27
+ *
28
+ * Attributes (string): `theme` (`dark` | `light` | `system`), `renderer`
29
+ * (`canvas2d` | `webgl2` | `offscreen`), `grid` / `snap` (boolean — present
30
+ * = on). Properties: `scene` (a `Scene` object). Events: `ready`,
31
+ * `scenechange`, `selectionchange`, `themechange`. Methods: `undo`, `redo`,
32
+ * `zoomToFit`, `getScene`, `loadScene`, `getMode`, `setMode`,
33
+ * `getSelection`, `setSelection`, plus the `editor` escape hatch.
34
+ */
35
+ export class OjaDiagramElement extends HTMLElement {
36
+ static get observedAttributes() {
37
+ return ["theme", "renderer", "grid", "snap"];
38
+ }
39
+ #root = null;
40
+ #portalLayer = null;
41
+ /** Wraps the editor + portals; carries `data-theme` so both pick up the theme. */
42
+ #themeHost = null;
43
+ #api = null;
44
+ #unbindHotkeys = null;
45
+ /** Initial scene captured before mount; live updates go through `loadScene`. */
46
+ #scene = undefined;
47
+ connectedCallback() {
48
+ if (this.#root)
49
+ return;
50
+ const shadow = this.shadowRoot ?? this.attachShadow({ mode: "open" });
51
+ shadow.adoptedStyleSheets = [styleSheet()];
52
+ // The host element must establish a sizing context; the editor fills it.
53
+ if (!this.style.display)
54
+ this.style.display = "block";
55
+ // One container holds both the editor and the portal layer so a forced
56
+ // `data-theme` applies to menus / tooltips (portaled) and chrome alike.
57
+ const container = document.createElement("div");
58
+ container.style.cssText = "width:100%;height:100%;position:relative";
59
+ const mount = document.createElement("div");
60
+ mount.style.cssText = "width:100%;height:100%";
61
+ const portals = document.createElement("div");
62
+ this.#portalLayer = portals;
63
+ container.append(mount, portals);
64
+ shadow.append(container);
65
+ this.#themeHost = container;
66
+ this.#applyTheme();
67
+ this.#root = createRoot(mount);
68
+ this.#render();
69
+ }
70
+ disconnectedCallback() {
71
+ this.#unbindHotkeys?.();
72
+ this.#unbindHotkeys = null;
73
+ this.#root?.unmount();
74
+ this.#root = null;
75
+ this.#api = null;
76
+ this.#portalLayer = null;
77
+ this.#themeHost = null;
78
+ }
79
+ attributeChangedCallback(name) {
80
+ if (name === "theme")
81
+ this.#applyTheme();
82
+ if (this.#root)
83
+ this.#render();
84
+ }
85
+ /**
86
+ * Mirror the `theme` attribute onto the container as `data-theme` so the
87
+ * `[data-theme]` overrides in the stylesheet take effect. `system` (or
88
+ * absent) leaves it off, falling back to `:host` + `prefers-color-scheme`.
89
+ */
90
+ #applyTheme() {
91
+ const host = this.#themeHost;
92
+ if (!host)
93
+ return;
94
+ const theme = this.getAttribute("theme");
95
+ if (theme === "dark" || theme === "light")
96
+ host.dataset.theme = theme;
97
+ else
98
+ delete host.dataset.theme;
99
+ }
100
+ // --- Properties ---
101
+ /** The current scene. Setting it loads the scene once the editor is ready. */
102
+ get scene() {
103
+ return this.#api ? this.#api.getScene() : this.#scene;
104
+ }
105
+ set scene(scene) {
106
+ this.#scene = scene;
107
+ if (this.#api && scene)
108
+ this.#api.loadScene(scene);
109
+ }
110
+ get theme() {
111
+ const v = this.getAttribute("theme");
112
+ return v && THEMES.has(v) ? v : null;
113
+ }
114
+ set theme(value) {
115
+ if (value)
116
+ this.setAttribute("theme", value);
117
+ else
118
+ this.removeAttribute("theme");
119
+ }
120
+ /** The live editor engine, or `null` until `ready` fires. */
121
+ get editor() {
122
+ return this.#api?.editor ?? null;
123
+ }
124
+ // --- Methods (delegate to the editor API once ready) ---
125
+ getScene() {
126
+ return this.#api?.getScene();
127
+ }
128
+ loadScene(scene) {
129
+ this.#scene = scene;
130
+ this.#api?.loadScene(scene);
131
+ }
132
+ undo() {
133
+ this.#api?.undo();
134
+ }
135
+ redo() {
136
+ this.#api?.redo();
137
+ }
138
+ zoomToFit() {
139
+ this.#api?.zoomToFit();
140
+ }
141
+ getMode() {
142
+ return this.#api?.getMode() ?? null;
143
+ }
144
+ setMode(mode) {
145
+ this.#api?.setMode(mode);
146
+ }
147
+ getSelection() {
148
+ return this.#api?.getSelection() ?? new Set();
149
+ }
150
+ setSelection(ids) {
151
+ this.#api?.setSelection(ids);
152
+ }
153
+ // --- Internals ---
154
+ #emit(type, detail) {
155
+ this.dispatchEvent(new CustomEvent(type, { detail }));
156
+ }
157
+ #editorProps() {
158
+ const themeAttr = this.getAttribute("theme");
159
+ const rendererAttr = this.getAttribute("renderer");
160
+ const theme = themeAttr && THEMES.has(themeAttr) ? themeAttr : undefined;
161
+ const renderer = rendererAttr && RENDERERS.has(rendererAttr) ? rendererAttr : undefined;
162
+ return {
163
+ ...(this.#scene ? { initialScene: this.#scene } : {}),
164
+ grid: { enabled: this.hasAttribute("grid") },
165
+ snap: this.hasAttribute("snap"),
166
+ ...(theme ? { theme } : {}),
167
+ ...(renderer ? { capabilities: { renderer } } : {}),
168
+ onReady: (editor) => {
169
+ // Wire keyboard shortcuts so the editor is usable without a host
170
+ // doing it. Listen on `window`: a shadow-internal element doesn't
171
+ // have to hold focus for the shortcut to land, and `composedPath`
172
+ // keeps text-field suppression correct across the shadow boundary.
173
+ this.#unbindHotkeys?.();
174
+ this.#unbindHotkeys = bindEditorHotkeys(editor);
175
+ // A scene assigned before the engine was ready — e.g. a framework
176
+ // wrapper restoring persisted state on mount — was only stashed in
177
+ // `#scene` (the imperative API didn't exist yet) and the editor
178
+ // seeded from an empty `initialScene`. Apply it now via the live
179
+ // engine so the restore actually lands. (`#api` is still null here:
180
+ // `useImperativeHandle` updates the ref a render later than `onReady`.)
181
+ if (this.#scene)
182
+ editor.loadScene(this.#scene);
183
+ this.#emit("ready", { editor });
184
+ },
185
+ onSceneChange: (scene) => {
186
+ this.#emit("scenechange", scene);
187
+ },
188
+ onSelectionChange: (ids) => {
189
+ this.#emit("selectionchange", [...ids]);
190
+ },
191
+ onThemeChange: (next) => {
192
+ this.#emit("themechange", next);
193
+ },
194
+ };
195
+ }
196
+ #render() {
197
+ this.#root?.render(_jsx(PortalContainerProvider, { container: this.#portalLayer, children: _jsx(EditorComponent, { ref: (api) => {
198
+ this.#api = api;
199
+ }, ...this.#editorProps() }) }));
200
+ }
201
+ }
202
+ //# sourceMappingURL=oja-diagram-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oja-diagram-element.js","sourceRoot":"","sources":["../src/oja-diagram-element.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,iBAAiB,GAKlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,MAAM,MAAM,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC,CAAC,UAAU,EAA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