@ai-matrx/canvas 0.2.2 → 0.4.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/dist/styles.css CHANGED
@@ -450,6 +450,23 @@
450
450
 
451
451
  /* ── bodies ─────────────────────────────────────────────────────────────── */
452
452
 
453
+ .mxc-item-toolbar {
454
+ flex: none;
455
+ display: flex;
456
+ align-items: center;
457
+ gap: 0.25rem;
458
+ min-height: 2.5rem;
459
+ padding: 0 0.375rem;
460
+ border-bottom: 1px solid var(--mxc-border);
461
+ background: var(--mxc-header-bg);
462
+ overflow-x: auto;
463
+ scrollbar-width: none;
464
+ }
465
+
466
+ .mxc-item-toolbar::-webkit-scrollbar {
467
+ display: none;
468
+ }
469
+
453
470
  .mxc-item {
454
471
  flex: 1 1 auto;
455
472
  min-height: 0;
@@ -573,4 +573,33 @@ interface CanvasController {
573
573
  }
574
574
  declare function createCanvasController(options: CanvasControllerOptions): CanvasController;
575
575
 
576
- export { foldCanvasWindows as $, type CanvasOrientation as A, type CanvasPersistencePort as B, type CanvasItemId as C, type CanvasRect as D, type CanvasSessionAttachReason as E, type CanvasSessionDetachReason as F, type CanvasSessionEvent as G, type CanvasSessionHooks as H, type CanvasSplitId as I, type CanvasWindowCloseMode as J, type CanvasWindowFrame as K, type CanvasWindowPorts as L, bindCanvasToReduxStore as M, canvasActions as N, canvasReducer as O, canvasWindowFrame as P, canvasWindowOfPane as Q, type ReduxStoreLike as R, clampDraggedCanvasWidth as S, consoleCanvasErrorSink as T, createCanvasController as U, createCanvasStore as V, createInitialCanvasState as W, createKeyValueCanvasPersistence as X, createLocalStorageCanvasPersistence as Y, defaultCanvasWidth as Z, fitCanvasWidth as _, type CanvasWindowId as a, isCanvasAction as a0, listCanvasWindowIds as a1, resolveCanvasLayoutRules as a2, sanitizeCanvasSnapshot as a3, shouldStackSplit as a4, toPersistableSnapshot as a5, type CanvasJson as b, type CanvasLayoutNode as c, type CanvasPaneId as d, type CanvasStoreBinding as e, type CanvasState as f, type CanvasAction as g, type CanvasController as h, type CanvasItem as i, type CanvasExtraWindow as j, type CanvasPane as k, canvasWindowOfItem as l, CANVAS_DEFAULT_WIDTH as m, CANVAS_DESKTOP_LAYOUT_RULES as n, CANVAS_MAIN_WINDOW as o, CANVAS_MIN_SPLIT_FRACTION as p, CANVAS_MIN_WIDTH as q, CANVAS_STORAGE_KEY as r, CANVAS_WEB_LAYOUT_RULES as s, type CanvasControllerOptions as t, type CanvasErrorReport as u, type CanvasErrorSink as v, type CanvasKeyValueStore as w, type CanvasLayoutRules as x, type CanvasOpenInput as y, type CanvasOpenTarget as z };
576
+ /**
577
+ * "Toggle or focus this kind" — what a toolbar icon does (the desktop's
578
+ * Terminal/Review/Browser icons, the web's quick-tool launchers):
579
+ *
580
+ * absent → open it (and reveal the canvas)
581
+ * background → bring it forward: activate its tab, focus its pane, reveal
582
+ * visible → close it (default) or put the canvas away (`whenVisible: "hide"`)
583
+ *
584
+ * "Visible" means: on the canvas, the active tab of its pane, and its window's
585
+ * canvas is open. The same item in a popped-out window counts in that window.
586
+ */
587
+
588
+ type CanvasKindVisibility = "absent" | "background" | "visible";
589
+ declare const CANVAS_DEFAULT_KEY = "default";
590
+ /** Stable primitive result — safe in useSyncExternalStore and useSelector. */
591
+ declare function selectCanvasKindVisibility(state: CanvasState, kind: string, key?: string): CanvasKindVisibility;
592
+ interface ToggleKindInput {
593
+ readonly kind: string;
594
+ /** Default "default" — one instance of the kind (a toolbar tool). */
595
+ readonly key?: string | undefined;
596
+ /** Data for a NEW item; an existing item keeps its data. */
597
+ readonly data?: CanvasJson | undefined;
598
+ readonly title?: string | null | undefined;
599
+ /** What a click does when the item is already in front. Default "close". */
600
+ readonly whenVisible?: "close" | "hide" | undefined;
601
+ }
602
+ /** Returns what the item is after the click. */
603
+ declare function toggleKind(controller: CanvasController, input: ToggleKindInput): CanvasKindVisibility;
604
+
605
+ export { createLocalStorageCanvasPersistence as $, type CanvasOpenInput as A, type CanvasOpenTarget as B, type CanvasItemId as C, type CanvasOrientation as D, type CanvasPersistencePort as E, type CanvasRect as F, type CanvasSessionAttachReason as G, type CanvasSessionDetachReason as H, type CanvasSessionEvent as I, type CanvasSessionHooks as J, type CanvasSplitId as K, type CanvasWindowCloseMode as L, type CanvasWindowFrame as M, type CanvasWindowPorts as N, bindCanvasToReduxStore as O, canvasActions as P, canvasReducer as Q, type ReduxStoreLike as R, canvasWindowFrame as S, type ToggleKindInput as T, canvasWindowOfPane as U, clampDraggedCanvasWidth as V, consoleCanvasErrorSink as W, createCanvasController as X, createCanvasStore as Y, createInitialCanvasState as Z, createKeyValueCanvasPersistence as _, type CanvasWindowId as a, defaultCanvasWidth as a0, fitCanvasWidth as a1, foldCanvasWindows as a2, isCanvasAction as a3, listCanvasWindowIds as a4, resolveCanvasLayoutRules as a5, sanitizeCanvasSnapshot as a6, selectCanvasKindVisibility as a7, shouldStackSplit as a8, toPersistableSnapshot as a9, toggleKind as aa, type CanvasJson as b, type CanvasLayoutNode as c, type CanvasPaneId as d, type CanvasStoreBinding as e, type CanvasState as f, type CanvasAction as g, type CanvasController as h, type CanvasItem as i, type CanvasExtraWindow as j, type CanvasPane as k, canvasWindowOfItem as l, CANVAS_DEFAULT_KEY as m, CANVAS_DEFAULT_WIDTH as n, CANVAS_DESKTOP_LAYOUT_RULES as o, CANVAS_MAIN_WINDOW as p, CANVAS_MIN_SPLIT_FRACTION as q, CANVAS_MIN_WIDTH as r, CANVAS_STORAGE_KEY as s, CANVAS_WEB_LAYOUT_RULES as t, type CanvasControllerOptions as u, type CanvasErrorReport as v, type CanvasErrorSink as w, type CanvasKeyValueStore as x, type CanvasKindVisibility as y, type CanvasLayoutRules as z };
@@ -573,4 +573,33 @@ interface CanvasController {
573
573
  }
574
574
  declare function createCanvasController(options: CanvasControllerOptions): CanvasController;
575
575
 
576
- export { foldCanvasWindows as $, type CanvasOrientation as A, type CanvasPersistencePort as B, type CanvasItemId as C, type CanvasRect as D, type CanvasSessionAttachReason as E, type CanvasSessionDetachReason as F, type CanvasSessionEvent as G, type CanvasSessionHooks as H, type CanvasSplitId as I, type CanvasWindowCloseMode as J, type CanvasWindowFrame as K, type CanvasWindowPorts as L, bindCanvasToReduxStore as M, canvasActions as N, canvasReducer as O, canvasWindowFrame as P, canvasWindowOfPane as Q, type ReduxStoreLike as R, clampDraggedCanvasWidth as S, consoleCanvasErrorSink as T, createCanvasController as U, createCanvasStore as V, createInitialCanvasState as W, createKeyValueCanvasPersistence as X, createLocalStorageCanvasPersistence as Y, defaultCanvasWidth as Z, fitCanvasWidth as _, type CanvasWindowId as a, isCanvasAction as a0, listCanvasWindowIds as a1, resolveCanvasLayoutRules as a2, sanitizeCanvasSnapshot as a3, shouldStackSplit as a4, toPersistableSnapshot as a5, type CanvasJson as b, type CanvasLayoutNode as c, type CanvasPaneId as d, type CanvasStoreBinding as e, type CanvasState as f, type CanvasAction as g, type CanvasController as h, type CanvasItem as i, type CanvasExtraWindow as j, type CanvasPane as k, canvasWindowOfItem as l, CANVAS_DEFAULT_WIDTH as m, CANVAS_DESKTOP_LAYOUT_RULES as n, CANVAS_MAIN_WINDOW as o, CANVAS_MIN_SPLIT_FRACTION as p, CANVAS_MIN_WIDTH as q, CANVAS_STORAGE_KEY as r, CANVAS_WEB_LAYOUT_RULES as s, type CanvasControllerOptions as t, type CanvasErrorReport as u, type CanvasErrorSink as v, type CanvasKeyValueStore as w, type CanvasLayoutRules as x, type CanvasOpenInput as y, type CanvasOpenTarget as z };
576
+ /**
577
+ * "Toggle or focus this kind" — what a toolbar icon does (the desktop's
578
+ * Terminal/Review/Browser icons, the web's quick-tool launchers):
579
+ *
580
+ * absent → open it (and reveal the canvas)
581
+ * background → bring it forward: activate its tab, focus its pane, reveal
582
+ * visible → close it (default) or put the canvas away (`whenVisible: "hide"`)
583
+ *
584
+ * "Visible" means: on the canvas, the active tab of its pane, and its window's
585
+ * canvas is open. The same item in a popped-out window counts in that window.
586
+ */
587
+
588
+ type CanvasKindVisibility = "absent" | "background" | "visible";
589
+ declare const CANVAS_DEFAULT_KEY = "default";
590
+ /** Stable primitive result — safe in useSyncExternalStore and useSelector. */
591
+ declare function selectCanvasKindVisibility(state: CanvasState, kind: string, key?: string): CanvasKindVisibility;
592
+ interface ToggleKindInput {
593
+ readonly kind: string;
594
+ /** Default "default" — one instance of the kind (a toolbar tool). */
595
+ readonly key?: string | undefined;
596
+ /** Data for a NEW item; an existing item keeps its data. */
597
+ readonly data?: CanvasJson | undefined;
598
+ readonly title?: string | null | undefined;
599
+ /** What a click does when the item is already in front. Default "close". */
600
+ readonly whenVisible?: "close" | "hide" | undefined;
601
+ }
602
+ /** Returns what the item is after the click. */
603
+ declare function toggleKind(controller: CanvasController, input: ToggleKindInput): CanvasKindVisibility;
604
+
605
+ export { createLocalStorageCanvasPersistence as $, type CanvasOpenInput as A, type CanvasOpenTarget as B, type CanvasItemId as C, type CanvasOrientation as D, type CanvasPersistencePort as E, type CanvasRect as F, type CanvasSessionAttachReason as G, type CanvasSessionDetachReason as H, type CanvasSessionEvent as I, type CanvasSessionHooks as J, type CanvasSplitId as K, type CanvasWindowCloseMode as L, type CanvasWindowFrame as M, type CanvasWindowPorts as N, bindCanvasToReduxStore as O, canvasActions as P, canvasReducer as Q, type ReduxStoreLike as R, canvasWindowFrame as S, type ToggleKindInput as T, canvasWindowOfPane as U, clampDraggedCanvasWidth as V, consoleCanvasErrorSink as W, createCanvasController as X, createCanvasStore as Y, createInitialCanvasState as Z, createKeyValueCanvasPersistence as _, type CanvasWindowId as a, defaultCanvasWidth as a0, fitCanvasWidth as a1, foldCanvasWindows as a2, isCanvasAction as a3, listCanvasWindowIds as a4, resolveCanvasLayoutRules as a5, sanitizeCanvasSnapshot as a6, selectCanvasKindVisibility as a7, shouldStackSplit as a8, toPersistableSnapshot as a9, toggleKind as aa, type CanvasJson as b, type CanvasLayoutNode as c, type CanvasPaneId as d, type CanvasStoreBinding as e, type CanvasState as f, type CanvasAction as g, type CanvasController as h, type CanvasItem as i, type CanvasExtraWindow as j, type CanvasPane as k, canvasWindowOfItem as l, CANVAS_DEFAULT_KEY as m, CANVAS_DEFAULT_WIDTH as n, CANVAS_DESKTOP_LAYOUT_RULES as o, CANVAS_MAIN_WINDOW as p, CANVAS_MIN_SPLIT_FRACTION as q, CANVAS_MIN_WIDTH as r, CANVAS_STORAGE_KEY as s, CANVAS_WEB_LAYOUT_RULES as t, type CanvasControllerOptions as u, type CanvasErrorReport as v, type CanvasErrorSink as w, type CanvasKeyValueStore as x, type CanvasKindVisibility as y, type CanvasLayoutRules as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/canvas",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "The AI Matrx canvas: a docked right-hand column with split panes, tabs, full screen, a kind registry, Redux-compatible state and persistence.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",