@oh-just-another/editor 0.58.1 → 0.59.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/CHANGELOG.md +84 -0
- package/README.md +6 -6
- package/dist/.tsbuildinfo +1 -1
- package/dist/Diagram.d.ts +8 -1
- package/dist/Diagram.d.ts.map +1 -1
- package/dist/Diagram.js +106 -65
- package/dist/Diagram.js.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +1 -8
- package/dist/capabilities.js.map +1 -1
- package/dist/constants.d.ts +17 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +17 -0
- package/dist/constants.js.map +1 -0
- package/dist/dom-focus.d.ts +7 -4
- package/dist/dom-focus.d.ts.map +1 -1
- package/dist/dom-focus.js +7 -9
- package/dist/dom-focus.js.map +1 -1
- package/dist/gif-animation.d.ts +7 -0
- package/dist/gif-animation.d.ts.map +1 -0
- package/dist/gif-animation.js +99 -0
- package/dist/gif-animation.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/png-export.d.ts +3 -9
- package/dist/png-export.d.ts.map +1 -1
- package/dist/png-export.js +5 -13
- package/dist/png-export.js.map +1 -1
- package/dist/themed-portal-container.d.ts +25 -0
- package/dist/themed-portal-container.d.ts.map +1 -0
- package/dist/themed-portal-container.js +47 -0
- package/dist/themed-portal-container.js.map +1 -0
- package/package.json +20 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @oh-just-another/editor
|
|
2
2
|
|
|
3
|
+
## 0.59.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1c7cc6c: New package `@oh-just-another/fonts` bundles the editor's fonts (Roboto, PT Serif, Roboto Mono) as web fonts, and the Canvas2D / offscreen backends now draw with them via `resolveBundledFamily`. Text is consistent across renderers instead of WebGL2 using the embedded font while Canvas2D fell back to a system font. `<Editor>` loads the fonts on mount and redraws once they're ready.
|
|
8
|
+
- 86c5b61: `<Editor>` accepts granular scene-settings props — `grid` (`{ enabled, style }`)
|
|
9
|
+
and `snap` — merged over the defaults. A persisted `initialScene` still wins over
|
|
10
|
+
them (user data over host config).
|
|
11
|
+
- 34fc660: `<Editor>` now registers a built-in GIF animation adapter by default, so dropped / pasted animated GIFs play out of the box (previously the host had to wire up a decoder). The `gifuct-js` decoder is lazy-loaded on first GIF decode, so apps that never show a GIF don't pay for it. A host `animationAdapters` entry with `kind: "gif"` still overrides the built-in. Also exports `installGifAnimationAdapter` for explicit / component-free use.
|
|
12
|
+
- 9673846: Grid model rework. The viewport's `gridSize` (spacing that doubled as a hidden/
|
|
13
|
+
shown toggle) is replaced by an explicit `gridEnabled` boolean; spacing is fixed
|
|
14
|
+
at `DEFAULT_GRID_SPACING`. The runtime `gridVisible` flag is removed — grid
|
|
15
|
+
on/off now lives on the scene viewport and persists with it. Scene documents
|
|
16
|
+
migrate v1 → v2 automatically (`gridSize > 0` → `gridEnabled: true`). `<Editor>`
|
|
17
|
+
ships gridless by default; hosts enable the grid per scene.
|
|
18
|
+
- edde5d0: Add `bindEditorHotkeys(editor, options?)` — a reusable, framework-agnostic keyboard-shortcut binding driven by the action registry. Returns an unbind function, leaves text fields alone (except `Escape`), and reads `composedPath()[0]` so the editable-target check stays correct across a shadow-root boundary. Re-exported from `@oh-just-another/editor`.
|
|
19
|
+
- c5be6e5: Transform modifier keys during pointer gestures: hold **Alt** to resize symmetrically about the element's centre, **Shift** to lock the aspect ratio while resizing, and **Shift** to constrain a move to a single axis (Cmd/Ctrl already pulls a shape off the grid for one gesture). `<Editor>` mirrors the modifiers from keyboard events automatically; headless hosts can drive them via `Editor.setTransformModifiers({ alt, shift })`. Applies to single shapes, multi-selection / group resizes, and text.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 60e315e: Fix floating chrome ignoring the app theme. The selection / property panel,
|
|
24
|
+
popovers, tooltips and the right-click context menu portal out of the editor
|
|
25
|
+
root, which also escaped the `data-theme` set there — so under an OS dark
|
|
26
|
+
preference they showed a dark surface even when the app was set to light (and
|
|
27
|
+
vice-versa). They now portal into a wrapper that mirrors the editor's theme, so
|
|
28
|
+
they always match the app. The context menu additionally portals into that
|
|
29
|
+
wrapper and its colours forward to the `--du-*` theme variables (no more
|
|
30
|
+
hard-coded dark fallbacks / hover).
|
|
31
|
+
- Updated dependencies [b4b252b]
|
|
32
|
+
- Updated dependencies [1c7cc6c]
|
|
33
|
+
- Updated dependencies [7217cac]
|
|
34
|
+
- Updated dependencies [578e728]
|
|
35
|
+
- Updated dependencies [d20d50a]
|
|
36
|
+
- Updated dependencies [0152ed6]
|
|
37
|
+
- Updated dependencies [938e7c8]
|
|
38
|
+
- Updated dependencies [9673846]
|
|
39
|
+
- Updated dependencies [60e315e]
|
|
40
|
+
- Updated dependencies [f370dba]
|
|
41
|
+
- Updated dependencies [1c7cc6c]
|
|
42
|
+
- Updated dependencies [e1fd495]
|
|
43
|
+
- Updated dependencies [8f00738]
|
|
44
|
+
- Updated dependencies [09a096c]
|
|
45
|
+
- Updated dependencies [1c7cc6c]
|
|
46
|
+
- Updated dependencies [ff90a95]
|
|
47
|
+
- Updated dependencies [da91d59]
|
|
48
|
+
- Updated dependencies [3152317]
|
|
49
|
+
- Updated dependencies [fc47ecc]
|
|
50
|
+
- Updated dependencies [8fc6b69]
|
|
51
|
+
- Updated dependencies [f98730f]
|
|
52
|
+
- Updated dependencies [904cc09]
|
|
53
|
+
- Updated dependencies [d44348a]
|
|
54
|
+
- Updated dependencies [edde5d0]
|
|
55
|
+
- Updated dependencies [1c7cc6c]
|
|
56
|
+
- Updated dependencies [60e315e]
|
|
57
|
+
- Updated dependencies [c5be6e5]
|
|
58
|
+
- @oh-just-another/state@0.59.0
|
|
59
|
+
- @oh-just-another/react-ui@0.58.0
|
|
60
|
+
- @oh-just-another/fonts@0.1.0
|
|
61
|
+
- @oh-just-another/renderer-canvas@0.59.0
|
|
62
|
+
- @oh-just-another/scene@0.59.0
|
|
63
|
+
- @oh-just-another/serialization@0.58.0
|
|
64
|
+
- @oh-just-another/renderer-core@0.58.0
|
|
65
|
+
- @oh-just-another/raster-wasm@0.57.2
|
|
66
|
+
- @oh-just-another/renderer-svg@0.57.2
|
|
67
|
+
- @oh-just-another/templates@0.57.2
|
|
68
|
+
- @oh-just-another/text-wasm@0.57.2
|
|
69
|
+
|
|
70
|
+
## 0.58.2
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [d1b96d9]
|
|
75
|
+
- Updated dependencies [d1b96d9]
|
|
76
|
+
- @oh-just-another/react-ui@0.57.3
|
|
77
|
+
- @oh-just-another/scene@0.58.0
|
|
78
|
+
- @oh-just-another/state@0.58.0
|
|
79
|
+
- @oh-just-another/raster-wasm@0.57.1
|
|
80
|
+
- @oh-just-another/renderer-canvas@0.58.1
|
|
81
|
+
- @oh-just-another/renderer-core@0.57.1
|
|
82
|
+
- @oh-just-another/renderer-svg@0.57.1
|
|
83
|
+
- @oh-just-another/serialization@0.57.1
|
|
84
|
+
- @oh-just-another/templates@0.57.1
|
|
85
|
+
- @oh-just-another/text-wasm@0.57.1
|
|
86
|
+
|
|
3
87
|
## 0.58.1
|
|
4
88
|
|
|
5
89
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ renderer (WebGL2 / Canvas2D / OffscreenCanvas), opt-in WASM text-shaping and
|
|
|
5
5
|
rasterisation, and worker offloading — then exposes one `<Editor>` component
|
|
6
6
|
plus a programmatic handle for driving it from code.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The umbrella package (L6): it composes `@oh-just-another/react-ui`,
|
|
9
9
|
`@oh-just-another/state`, the renderers, serialization and templates into a
|
|
10
10
|
ready-to-mount editor. For lower-level building blocks, depend on those
|
|
11
11
|
packages directly.
|
|
@@ -34,13 +34,13 @@ export function App() {
|
|
|
34
34
|
> set — light and dark, plus a `prefers-color-scheme` fallback for "system" —
|
|
35
35
|
> so the import above is all you need. The editor toggles `data-theme` on its
|
|
36
36
|
> own root element (not the global `<html>`, so multiple editors theme
|
|
37
|
-
> independently) via the `theme` prop; override any `--du-*`
|
|
38
|
-
>
|
|
37
|
+
> independently) via the `theme` prop; override any `--du-*` variable in your
|
|
38
|
+
> own stylesheet to re-skin.
|
|
39
39
|
|
|
40
40
|
## Driving it from code
|
|
41
41
|
|
|
42
|
-
Pass a `ref` to get an imperative handle
|
|
43
|
-
|
|
42
|
+
Pass a `ref` to get an imperative handle for programmatic control — undo/redo,
|
|
43
|
+
zoom, selection, mutations:
|
|
44
44
|
|
|
45
45
|
```tsx
|
|
46
46
|
import { useRef } from "react";
|
|
@@ -139,4 +139,4 @@ import { registerBounder, registerElementRenderer } from "@oh-just-another/edito
|
|
|
139
139
|
`layoutKinds` / `animationAdapters` props.
|
|
140
140
|
- `exportSceneToPng` — render the full scene to a PNG `Blob` headlessly.
|
|
141
141
|
|
|
142
|
-
`Diagram` is
|
|
142
|
+
`Diagram` is a deprecated alias of `Editor`.
|