@oh-just-another/diagram 0.1.1 → 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/CHANGELOG.md +35 -0
- package/README.md +14 -14
- package/dist/.tsbuildinfo +1 -1
- package/dist/bindings.d.ts +3 -3
- package/dist/bindings.d.ts.map +1 -1
- package/dist/bindings.js +2 -2
- package/dist/bindings.js.map +1 -1
- package/dist/oja-diagram-element.d.ts +4 -4
- package/dist/oja-diagram-element.d.ts.map +1 -1
- package/dist/oja-diagram-element.js +5 -5
- package/dist/oja-diagram-element.js.map +1 -1
- package/dist/oja-diagram.global.js +31 -25
- package/dist/oja-diagram.global.js.map +4 -4
- package/dist/render-worker.js +4 -4
- package/dist/render-worker.js.map +4 -4
- package/dist/styles.generated.d.ts +1 -1
- package/dist/styles.generated.d.ts.map +1 -1
- package/dist/styles.generated.js +1 -1
- package/dist/styles.generated.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @oh-just-another/diagram
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0548ab3: Unify the active tool into a single `editor.activeTool` value object (breaking).
|
|
8
|
+
- `state`: `editor.activeTool: ActiveTool` (`{ type, locked, lastActiveTool }`)
|
|
9
|
+
replaces `editor.mode` and `editor.toolLocked`; `setActiveTool(type)` replaces
|
|
10
|
+
`setMode`. `EditorOptions.initialMode` → `initialTool`. The typed `mode` event
|
|
11
|
+
is now `tool` and fires with the `ActiveTool` object on a type switch or a
|
|
12
|
+
lock flip. The action category `"mode"` is now `"tool"`. The vestigial
|
|
13
|
+
`"eyedropper"` mode is removed from `Mode` — colour sampling is armed from
|
|
14
|
+
the colour picker (`beginEyedropperPick`) and never was a toolbar tool.
|
|
15
|
+
- `react-ui`: `useMode()` → `useActiveTool(): ActiveTool`;
|
|
16
|
+
`DiagramRoot`/`DiagramCanvas` prop `initialMode` → `initialTool`.
|
|
17
|
+
- `editor`: `EditorAPI.getMode/setMode` → `getActiveTool/setActiveTool`;
|
|
18
|
+
`initialMode` prop → `initialTool`; re-exports `ActiveTool`.
|
|
19
|
+
- `diagram` (+ vue/svelte/angular wrappers): element methods and controller
|
|
20
|
+
`getMode/setMode` → `getActiveTool/setActiveTool`.
|
|
21
|
+
|
|
22
|
+
Tool ids are unchanged (`"select"`, `"draw-rect"`, …). There are no visible
|
|
23
|
+
behaviour changes — this is an API refactor establishing one source of truth
|
|
24
|
+
for "which tool is active".
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [0548ab3]
|
|
29
|
+
- Updated dependencies [762dd8a]
|
|
30
|
+
- Updated dependencies [4722388]
|
|
31
|
+
- Updated dependencies [05707ed]
|
|
32
|
+
- Updated dependencies [20af638]
|
|
33
|
+
- Updated dependencies [84450bc]
|
|
34
|
+
- @oh-just-another/react-ui@0.60.0
|
|
35
|
+
- @oh-just-another/editor@0.61.0
|
|
36
|
+
- @oh-just-another/scene@0.61.0
|
|
37
|
+
|
|
3
38
|
## 0.1.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -47,20 +47,20 @@ el.loadScene(savedScene);
|
|
|
47
47
|
|
|
48
48
|
## API
|
|
49
49
|
|
|
50
|
-
| Kind | Name
|
|
51
|
-
| --------- |
|
|
52
|
-
| Attribute | `theme`
|
|
53
|
-
| Attribute | `renderer`
|
|
54
|
-
| Attribute | `grid` / `snap`
|
|
55
|
-
| Property | `scene`
|
|
56
|
-
| Property | `editor`
|
|
57
|
-
| Method | `getScene()` / `loadScene(scene)`
|
|
58
|
-
| Method | `undo()` / `redo()` / `zoomToFit()`
|
|
59
|
-
| Method | `
|
|
60
|
-
| Event | `ready`
|
|
61
|
-
| Event | `scenechange`
|
|
62
|
-
| Event | `selectionchange`
|
|
63
|
-
| Event | `themechange`
|
|
50
|
+
| Kind | Name | Notes |
|
|
51
|
+
| --------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
52
|
+
| Attribute | `theme` | `dark` \| `light` \| `system`. |
|
|
53
|
+
| Attribute | `renderer` | `canvas2d` \| `webgl2` \| `offscreen`. Omit to auto-detect. |
|
|
54
|
+
| Attribute | `grid` / `snap` | Boolean — present = on. |
|
|
55
|
+
| Property | `scene` | A `Scene`. Reading returns the current scene; assigning loads it. |
|
|
56
|
+
| Property | `editor` | The live engine (`EditorInstance`), or `null` before `ready`. |
|
|
57
|
+
| Method | `getScene()` / `loadScene(scene)` | Read / replace the scene. |
|
|
58
|
+
| Method | `undo()` / `redo()` / `zoomToFit()` | History and viewport. |
|
|
59
|
+
| Method | `getActiveTool()` / `setActiveTool(tool)`, `getSelection()` / `setSelection(ids)` | Active tool and selection. |
|
|
60
|
+
| Event | `ready` | Fires once the editor mounts; `detail.editor` is the live engine. |
|
|
61
|
+
| Event | `scenechange` | `detail` is the new `Scene`. |
|
|
62
|
+
| Event | `selectionchange` | `detail` is an array of selected element ids. |
|
|
63
|
+
| Event | `themechange` | `detail` is the new theme. |
|
|
64
64
|
|
|
65
65
|
`defineOjaDiagram(tag?)` registers the element (the package does this on import); pass a tag name to register under a different name.
|
|
66
66
|
|