@weasel-js/labkit 1.0.3 → 1.0.4

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 (45) hide show
  1. package/dist/_dts/{DrawCommand-uKHt4Vul.d.ts → DrawCommand-BkZztJsW.d.ts} +3 -1
  2. package/dist/_dts/{useExperimentState-vrttakTt.d.ts → useExperimentState-D7EQnnwJ.d.ts} +4 -0
  3. package/dist/{chunk-N5KTQKQA.js → chunk-BAPZPDDA.js} +628 -588
  4. package/dist/chunk-BAPZPDDA.js.map +1 -0
  5. package/dist/{chunk-73PXCRCR.js → chunk-DEWXYFEU.js} +6 -6
  6. package/dist/chunk-DEWXYFEU.js.map +1 -0
  7. package/dist/{chunk-3WPOGKUP.js → chunk-DWV7SFKR.js} +518 -217
  8. package/dist/chunk-DWV7SFKR.js.map +1 -0
  9. package/dist/{chunk-T7OKNJTY.js → chunk-KSTEW2AF.js} +18 -2
  10. package/dist/chunk-KSTEW2AF.js.map +1 -0
  11. package/dist/index.d.ts +64 -15
  12. package/dist/index.js +133 -24
  13. package/dist/index.js.map +1 -1
  14. package/dist/passthrough/weasel-canvas.d.ts +1 -1
  15. package/dist/passthrough/weasel-canvas.js +1 -1
  16. package/dist/passthrough/weasel-ui.d.ts +1 -1
  17. package/dist/passthrough/weasel-ui.js +2 -2
  18. package/dist/state/index.d.ts +4 -4
  19. package/dist/state/index.js +2 -2
  20. package/dist/styles.css +163 -6
  21. package/dist/ui/layers/index.js +3 -3
  22. package/package.json +2 -1
  23. package/src/lab/Lab.tsx +14 -2
  24. package/src/lab/LabContext.ts +1 -0
  25. package/src/lab/WorkspaceGrid.less +37 -5
  26. package/src/lab/WorkspaceGrid.stories.tsx +16 -0
  27. package/src/lab/WorkspaceGrid.test.tsx +84 -10
  28. package/src/lab/WorkspaceGrid.tsx +188 -14
  29. package/src/lab/index.ts +0 -2
  30. package/src/state/helpers.ts +2 -2
  31. package/src/state/store.test.ts +2 -1
  32. package/src/state/store.ts +19 -0
  33. package/src/state/types.ts +3 -0
  34. package/src/test-setup.ts +19 -0
  35. package/src/workspace/Workspace.stories.tsx +1 -0
  36. package/src/workspace/Workspace.test.tsx +1 -0
  37. package/src/workspace/index.ts +1 -0
  38. package/src/workspace/workspaceOps.test.ts +34 -1
  39. package/src/workspace/workspaceOps.ts +16 -0
  40. package/dist/chunk-3WPOGKUP.js.map +0 -1
  41. package/dist/chunk-73PXCRCR.js.map +0 -1
  42. package/dist/chunk-N5KTQKQA.js.map +0 -1
  43. package/dist/chunk-T7OKNJTY.js.map +0 -1
  44. package/src/lab/gridDims.test.ts +0 -35
  45. package/src/lab/gridDims.ts +0 -13
@@ -185,7 +185,9 @@ interface History {
185
185
  * 2026-05-24-modality-design.md for the full lifecycle. */
186
186
  beginJournal(opts: BeginJournalOptions): Journal;
187
187
  /** Re-activate a suspended journal. Throws if the journal was committed or
188
- * cancelled (those are terminal). Staleness checking is the caller's
188
+ * cancelled (those are terminal), or if a different journal is currently
189
+ * active — at most one journal writes to the adapter at a time, on resume
190
+ * as well as on open. Staleness checking is the caller's
189
191
  * responsibility — consult `journal.forkedAtEntryId` against
190
192
  * `currentEntryId()` and your own op-semantic rules to decide whether
191
193
  * to resume or discard before calling this. */
@@ -43,6 +43,9 @@ interface LabStoreState {
43
43
  workspaces: WorkspaceRecord[];
44
44
  savedSnapshots: SavedSnapshot[];
45
45
  mode: LabMode;
46
+ /** Per-workspace tile extents, keyed by workspace id. Opaque here — the
47
+ * shape belongs to whatever lays the workspaces out. */
48
+ layout: Record<string, unknown>;
46
49
  }
47
50
  /** Where a lab persists itself. Implementations are keyed string storage and
48
51
  * nothing more, so the same store works against localStorage, the URL hash,
@@ -103,6 +106,7 @@ interface LabStoreActions {
103
106
  deleteSnapshot: (snapshotId: string) => void;
104
107
  listSnapshots: (workspaceId?: string) => SavedSnapshot[];
105
108
  setMode: (mode: LabMode) => void;
109
+ setLayout: (layout: Record<string, unknown>) => void;
106
110
  }
107
111
  /** A lab's store: its state and actions, plus the hook instruments use to
108
112
  * register how their state is serialized. */