@fieldnotes/core 0.24.0 → 0.26.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 +8 -1
- package/dist/index.cjs +779 -813
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -369
- package/dist/index.d.ts +40 -369
- package/dist/index.js +778 -781
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -258,6 +258,12 @@ viewport.loadJSON(localStorage.getItem('canvas'));
|
|
|
258
258
|
|
|
259
259
|
> **Note:** Serialized state includes all layers and element `layerId` assignments. States saved before layers were introduced are automatically migrated — elements are placed on a default "Layer 1".
|
|
260
260
|
|
|
261
|
+
> **Two equivalent pairs:** `exportJSON()` / `loadJSON()` work with strings and are the
|
|
262
|
+
> canonical choice for persistence. `exportState()` / `loadState()` work with in-memory
|
|
263
|
+
> `CanvasState` objects, skipping the JSON round-trip — this is what `AutoSave` uses. The
|
|
264
|
+
> module-level `exportState` / `parseState` functions are no longer exported; use the
|
|
265
|
+
> `Viewport` methods.
|
|
266
|
+
|
|
261
267
|
## Tool Switching
|
|
262
268
|
|
|
263
269
|
```typescript
|
|
@@ -273,7 +279,8 @@ viewport.toolManager.onChange((toolName) => {
|
|
|
273
279
|
|
|
274
280
|
Defaults (remappable): `Delete`/`Backspace` delete · `Escape` deselect · `mod+Z` undo ·
|
|
275
281
|
`mod+Y`/`mod+Shift+Z` redo · `mod+A` select all · `mod+C/V/D` copy/paste/duplicate ·
|
|
276
|
-
`[`/`]` z-order (with `mod` = to back/front) · `Shift+1` zoom-to-fit ·
|
|
282
|
+
`[`/`]` z-order (with `mod` = to back/front) · `Shift+1` zoom-to-fit · `mod+=` zoom in ·
|
|
283
|
+
`mod+-` zoom out · `mod+0` reset zoom to 100% · arrows nudge
|
|
277
284
|
(`Shift` = one grid cell) · tool keys `V` select, `H` hand, `P` pencil, `E` eraser,
|
|
278
285
|
`A` arrow, `N` note, `T` text, `S` shape, `M` measure, `G` template.
|
|
279
286
|
|