@ai-matrx/canvas 0.2.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 +16 -0
- package/README.md +11 -0
- package/dist/index.cjs +42 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +42 -1
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +56 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +22 -4
- package/dist/react.d.ts +22 -4
- package/dist/react.js +57 -3
- package/dist/react.js.map +1 -1
- package/dist/{controller-Dv6J6XZm.d.cts → toggleKind-A9v45oSb.d.cts} +30 -1
- package/dist/{controller-Dv6J6XZm.d.ts → toggleKind-A9v45oSb.d.ts} +30 -1
- package/package.json +1 -1
|
@@ -573,4 +573,33 @@ interface CanvasController {
|
|
|
573
573
|
}
|
|
574
574
|
declare function createCanvasController(options: CanvasControllerOptions): CanvasController;
|
|
575
575
|
|
|
576
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.3.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",
|