@oh-just-another/diagram 0.1.1 → 0.3.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 CHANGED
@@ -1,5 +1,52 @@
1
1
  # @oh-just-another/diagram
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ac128db: Dark theme now restyles the chrome only — the canvas always stays light. Scene colors are raw hex authored against light paper, so a dark canvas silently broke user content; `UI_SURFACE.dark.canvas` and `--du-canvas-bg` are light in every theme, and the bundled color picker always offers the light element palette. Canvas-drawn chrome (selection, handles, anchors, marquee, badges, minimap frame) is unified on the iris accent (`CANVAS_CHROME_ACCENT`, iris9 — the same accent the DOM chrome uses) instead of the ad-hoc `#1a73e8`/`#2563eb` blues. Undeclared CSS variables and stale accent fallbacks in the stylesheet now resolve to the real theme tokens, so the affected popovers follow the active theme.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [ac128db]
12
+ - @oh-just-another/react-ui@0.61.0
13
+ - @oh-just-another/editor@0.61.1
14
+
15
+ ## 0.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 0548ab3: Unify the active tool into a single `editor.activeTool` value object (breaking).
20
+ - `state`: `editor.activeTool: ActiveTool` (`{ type, locked, lastActiveTool }`)
21
+ replaces `editor.mode` and `editor.toolLocked`; `setActiveTool(type)` replaces
22
+ `setMode`. `EditorOptions.initialMode` → `initialTool`. The typed `mode` event
23
+ is now `tool` and fires with the `ActiveTool` object on a type switch or a
24
+ lock flip. The action category `"mode"` is now `"tool"`. The vestigial
25
+ `"eyedropper"` mode is removed from `Mode` — colour sampling is armed from
26
+ the colour picker (`beginEyedropperPick`) and never was a toolbar tool.
27
+ - `react-ui`: `useMode()` → `useActiveTool(): ActiveTool`;
28
+ `DiagramRoot`/`DiagramCanvas` prop `initialMode` → `initialTool`.
29
+ - `editor`: `EditorAPI.getMode/setMode` → `getActiveTool/setActiveTool`;
30
+ `initialMode` prop → `initialTool`; re-exports `ActiveTool`.
31
+ - `diagram` (+ vue/svelte/angular wrappers): element methods and controller
32
+ `getMode/setMode` → `getActiveTool/setActiveTool`.
33
+
34
+ Tool ids are unchanged (`"select"`, `"draw-rect"`, …). There are no visible
35
+ behaviour changes — this is an API refactor establishing one source of truth
36
+ for "which tool is active".
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [0548ab3]
41
+ - Updated dependencies [762dd8a]
42
+ - Updated dependencies [4722388]
43
+ - Updated dependencies [05707ed]
44
+ - Updated dependencies [20af638]
45
+ - Updated dependencies [84450bc]
46
+ - @oh-just-another/react-ui@0.60.0
47
+ - @oh-just-another/editor@0.61.0
48
+ - @oh-just-another/scene@0.61.0
49
+
3
50
  ## 0.1.1
4
51
 
5
52
  ### Patch Changes
package/README.md CHANGED
@@ -47,20 +47,20 @@ el.loadScene(savedScene);
47
47
 
48
48
  ## API
49
49
 
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 | `getMode()` / `setMode(mode)`, `getSelection()` / `setSelection(ids)` | Tool mode 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. |
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