@grafloria/element 0.4.30 → 0.4.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafloria/element",
3
- "version": "0.4.30",
3
+ "version": "0.4.32",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -42,8 +42,8 @@
42
42
  * Cells are the truth and live in the existing `GridItemConfig`, so save/load
43
43
  * round-trips with no extra work — same as every other kit.
44
44
  */
45
- import { GroupModel, NodeModel, type GridColumnLayout } from '@grafloria/engine';
46
- import { type DashboardGridHandle, type TearOutPlan, type DashboardGridOptions, type DashboardResponsiveOptions } from './grid-binder.js';
45
+ import { Command, GroupModel, NodeModel, type GridColumnLayout } from '@grafloria/engine';
46
+ import { type DashboardGridHandle, type TabDropHooks, type TearOutPlan, type DashboardGridOptions, type DashboardResponsiveOptions } from './grid-binder.js';
47
47
  import type { DragHandleOption } from './grid-binder.js';
48
48
  import type { SplitNode } from './split-layout.js';
49
49
  import type { SectionCaption } from './caption.js';
@@ -373,6 +373,16 @@ export interface DashboardHandle {
373
373
  activateTab(containerId: string, pageId: string): boolean;
374
374
  /** The page showing in a tab container. */
375
375
  getActiveTab(containerId: string): string | undefined;
376
+ /**
377
+ * Move a WIDGET into `containerId` as a NEW TAB at `index` (default: the
378
+ * end): the widget becomes the only member of a fresh page named by its
379
+ * title, and that page the active tab — what dropping a widget on a strip
380
+ * does. One undoable step; the board it left re-packs, and a page it
381
+ * emptied closes.
382
+ */
383
+ moveToTab(widgetId: string, containerId: string, index?: number): Promise<boolean>;
384
+ /** Reorder a page along its container's strip. One undoable step; the order is saved with the container. */
385
+ moveTab(containerId: string, pageId: string, index: number): boolean;
376
386
  /** Live sizing/float switches — the two prototype toggles. */
377
387
  setSizing(mode: 'fit' | 'grow'): void;
378
388
  getSizing(): 'fit' | 'grow';
@@ -597,6 +607,10 @@ export interface DashboardHandleContext {
597
607
  detachTabsContainer?: (containerId: string) => void;
598
608
  /** The plan that makes a torn-out page a one-tab group of its own (the handle builder owns the specs and the registry). */
599
609
  tearOutPlan?: (containerId: string, pageId: string) => TearOutPlan | null;
610
+ /** The commands that close `boardId` when it is a tab PAGE about to lose its last member `leaving` — and its container when that was its last page. */
611
+ closePageIfEmptied?: (boardId: string, leaving: string) => Command[];
612
+ /** A widget dragged over a strip: hit-test, marks, and the drop that makes it a new tab. Handed to every binder. */
613
+ tabDrop?: TabDropHooks;
600
614
  /** Set by finalize: the user's `onTabChange`, so the handle can fire it. */
601
615
  onTabChange?: (containerId: string, pageId: string, viewId: string) => void;
602
616
  /** Set by finalize: re-bind a VIEW's board under the given layout (setLayout). */