@grafloria/element 0.4.36 → 0.4.38
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
package/src/index.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export type { JoinColumn, JoinEnd, MatchTier, JoinGuidanceApi, JoinGuidanceOptio
|
|
|
79
79
|
export type { ErColumn, ErEntitySpec, ErRelationshipSpec, ErCardinality, ErSide, ErDiagramOptions, UmlClassSpec, UmlRelationshipSpec, UmlRelationKind, UmlSide, UmlDiagramOptions, ErEntityDelta, UmlClassDelta, CardEditingHandle, } from './lib/diagram-kit/index.js';
|
|
80
80
|
export { erTable, umlClass, erTables, umlClasses, CardHandle, ErTable, ErField, ErColumnList, UmlClass, UmlMemberList, } from './lib/diagram-kit/index.js';
|
|
81
81
|
export type { HandleApi } from './lib/diagram-kit/index.js';
|
|
82
|
-
export { bindDashboardGrid, paintTabStrip, tabStripReserve, tabStripKey, TAB_STRIP_HEIGHT, TAB_DRAG_THRESHOLD, normalizeCaption, captionReserve, captionBandHeight, paintCaptionBand, CAPTION_HEIGHT, CAPTION_HEIGHT_SUBTITLE, CAPTION_HEIGHT_TIGHT, CAPTION_PASS_THROUGH, rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, gridItemFromCell, cellFromGridItem, buildCommitCommands, ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID, dashboard, defaultWidgetRenderer, renderKpiWidget, renderLineWidget, renderBarWidget, renderDonutWidget, renderFunnelWidget, renderTableWidget, BUILT_IN_WIDGET_KINDS, } from './lib/dashboard-kit/index.js';
|
|
82
|
+
export { bindDashboardGrid, paintTabStrip, tabStripReserve, tabStripKey, TAB_STRIP_HEIGHT, TAB_DRAG_THRESHOLD, normalizeCaption, captionReserve, captionBandHeight, paintCaptionBand, CAPTION_HEIGHT, CAPTION_HEIGHT_SUBTITLE, CAPTION_HEIGHT_TIGHT, CAPTION_PASS_THROUGH, rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, gridItemFromCell, cellFromGridItem, buildCommitCommands, ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID, DASHBOARD_KIT_CSS, dashboard, defaultWidgetRenderer, renderKpiWidget, renderLineWidget, renderBarWidget, renderDonutWidget, renderFunnelWidget, renderTableWidget, BUILT_IN_WIDGET_KINDS, } from './lib/dashboard-kit/index.js';
|
|
83
83
|
export type { DashboardGridApi, DashboardGridOptions, DashboardGridHandle, CellRect, WorldRect, DashboardGridGeometry, TileDelta, DashboardOptions, DashboardSpec, DashboardSnapshot, DragHandleOption, DragGripOptions, DashboardHandle, DashboardViewSpec, DashboardWidgetSpec, SectionCaption, SectionCaptionOptions, TabsOptions, TabPage, SectionCaptionAction, SectionCaptionFont, WidgetHandle, WidgetRenderer, KpiWidgetData, LineWidgetData, LineSeries, BarWidgetData, DonutWidgetData, FunnelWidgetData, TableWidgetData, } from './lib/dashboard-kit/index.js';
|
|
84
84
|
export { bindStencilPalette, bindShapeDataPanel, ensureStencilKitStyles } from './lib/stencil-kit/index.js';
|
|
85
85
|
export type { StencilPaletteApi, StencilPaletteOptions, StencilPaletteHandle, ShapeDataPanelApi, ShapeDataPanelOptions, ShapeDataPanelHandle, } from './lib/stencil-kit/index.js';
|
package/src/index.js
CHANGED
|
@@ -230,7 +230,7 @@ export { erTable, umlClass, erTables, umlClasses, CardHandle, ErTable, ErField,
|
|
|
230
230
|
// GridItemConfig. Element-local code, so the Phase-0 wholesale re-export
|
|
231
231
|
// below does NOT cover it — this curated block is its only door.
|
|
232
232
|
// ===========================================================================
|
|
233
|
-
export { bindDashboardGrid, paintTabStrip, tabStripReserve, tabStripKey, TAB_STRIP_HEIGHT, TAB_DRAG_THRESHOLD, normalizeCaption, captionReserve, captionBandHeight, paintCaptionBand, CAPTION_HEIGHT, CAPTION_HEIGHT_SUBTITLE, CAPTION_HEIGHT_TIGHT, CAPTION_PASS_THROUGH, rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, gridItemFromCell, cellFromGridItem, buildCommitCommands, ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID,
|
|
233
|
+
export { bindDashboardGrid, paintTabStrip, tabStripReserve, tabStripKey, TAB_STRIP_HEIGHT, TAB_DRAG_THRESHOLD, normalizeCaption, captionReserve, captionBandHeight, paintCaptionBand, CAPTION_HEIGHT, CAPTION_HEIGHT_SUBTITLE, CAPTION_HEIGHT_TIGHT, CAPTION_PASS_THROUGH, rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, gridItemFromCell, cellFromGridItem, buildCommitCommands, ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID, DASHBOARD_KIT_CSS,
|
|
234
234
|
// The DATA-FIRST authoring API — the erDiagram()/umlDiagram() equivalent.
|
|
235
235
|
dashboard,
|
|
236
236
|
// …and the built-in renderers behind `kind`, so a dashboard is useful with
|
|
@@ -1486,8 +1486,13 @@ export function createDashboardHandle(ctx) {
|
|
|
1486
1486
|
},
|
|
1487
1487
|
setSizing(mode) {
|
|
1488
1488
|
var _a;
|
|
1489
|
-
|
|
1490
|
-
|
|
1489
|
+
// THE VIEWS ONLY. A nested board (a page, a section) is bound fit with no
|
|
1490
|
+
// design height — its height is its container's business — and switched
|
|
1491
|
+
// to grow it painted its rows at the base height, 700 px past a torn-out
|
|
1492
|
+
// group or a split pane (0.4.38).
|
|
1493
|
+
for (const [id, b] of binders)
|
|
1494
|
+
if (groups.has(id))
|
|
1495
|
+
b.setSizing(mode);
|
|
1491
1496
|
clampCamera();
|
|
1492
1497
|
(_a = ctx.apiRef) === null || _a === void 0 ? void 0 : _a.renderNow();
|
|
1493
1498
|
},
|
|
@@ -2,7 +2,7 @@ export { bindDashboardGrid, type DashboardGridApi, type DashboardGridOptions, ty
|
|
|
2
2
|
export { bindDashboardSplit, SetSplitTreeCommand, SPLIT_TREE_KEY, type DashboardSplitOptions, type DashboardSplitHandle, } from './split-binder.js';
|
|
3
3
|
export { projectSplit, dividersOf, addSplitLeaf, removeSplitLeaf, insertSplitLeaf, moveSplitDivider, splitFromCells, cellsFromSplit, splitLeaves, type SplitNode, type SplitGroup, type SplitLeaf, type SplitDir, type SplitSide, type SplitDivider, } from './split-layout.js';
|
|
4
4
|
export { rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, spanWidthPx, gridItemFromCell, cellFromGridItem, buildCommitCommands, type CellRect, type WorldRect, type DashboardGridGeometry, type TileDelta, } from './grid-mapping.js';
|
|
5
|
-
export { ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID } from './styles.js';
|
|
5
|
+
export { ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID, DASHBOARD_KIT_CSS } from './styles.js';
|
|
6
6
|
export { paintTabStrip, tabStripReserve, tabStripKey, TAB_STRIP_HEIGHT, TAB_DRAG_THRESHOLD, type TabsOptions, type TabPage } from './tabs.js';
|
|
7
7
|
export { normalizeCaption, captionReserve, captionBandHeight, paintCaptionBand, CAPTION_HEIGHT, CAPTION_HEIGHT_SUBTITLE, CAPTION_HEIGHT_TIGHT, CAPTION_PASS_THROUGH, type SectionCaption, type SectionCaptionOptions, type SectionCaptionAction, type SectionCaptionFont, } from './caption.js';
|
|
8
8
|
export { dashboard, type DashboardOptions, type DashboardSpec, type DashboardSnapshot, type DashboardHandle, type DashboardViewSpec, type DashboardWidgetSpec, type WidgetHandle, } from './dashboard.js';
|
|
@@ -2,7 +2,7 @@ export { bindDashboardGrid, normalizeDragHandle, } from './grid-binder.js';
|
|
|
2
2
|
export { bindDashboardSplit, SetSplitTreeCommand, SPLIT_TREE_KEY, } from './split-binder.js';
|
|
3
3
|
export { projectSplit, dividersOf, addSplitLeaf, removeSplitLeaf, insertSplitLeaf, moveSplitDivider, splitFromCells, cellsFromSplit, splitLeaves, } from './split-layout.js';
|
|
4
4
|
export { rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, spanWidthPx, gridItemFromCell, cellFromGridItem, buildCommitCommands, } from './grid-mapping.js';
|
|
5
|
-
export { ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID } from './styles.js';
|
|
5
|
+
export { ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID, DASHBOARD_KIT_CSS } from './styles.js';
|
|
6
6
|
export { paintTabStrip, tabStripReserve, tabStripKey, TAB_STRIP_HEIGHT, TAB_DRAG_THRESHOLD } from './tabs.js';
|
|
7
7
|
export { normalizeCaption, captionReserve, captionBandHeight, paintCaptionBand, CAPTION_HEIGHT, CAPTION_HEIGHT_SUBTITLE, CAPTION_HEIGHT_TIGHT, CAPTION_PASS_THROUGH, } from './caption.js';
|
|
8
8
|
// The DATA-FIRST authoring API (the erDiagram/umlDiagram equivalent).
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* the authored size.
|
|
24
24
|
*/
|
|
25
25
|
import { __awaiter } from "tslib";
|
|
26
|
-
import { Command } from '@grafloria/engine';
|
|
26
|
+
import { BatchCommand, Command } from '@grafloria/engine';
|
|
27
27
|
import { LiveRegionController, registerTool } from '@grafloria/renderer';
|
|
28
28
|
import { anyEdge, clearOtherSelections, dragHandleSelector, gripHostOf, gripOf, normalizeDragHandle, ownsPress, parentPeerOf, pressOnDragHandle, registerBoardPeer, syncGrip, DRAG_HANDLE_CLASS, EDGE_GRIP } from './grid-binder.js';
|
|
29
29
|
import { cellFromGridItem } from './grid-mapping.js';
|
|
@@ -779,6 +779,208 @@ export function bindDashboardSplit(api, group, options = {}) {
|
|
|
779
779
|
},
|
|
780
780
|
};
|
|
781
781
|
const unregisterTool = registerTool(tool);
|
|
782
|
+
// -- a tab torn out of a container on THIS board (0.4.37) --------------------
|
|
783
|
+
// The split board REFUSED every tear-out ("no cells to drop a page into"),
|
|
784
|
+
// so on a split board a tab press was a dead click — no chip, no reorder,
|
|
785
|
+
// no join. The board has a drop model of its own: a widget dropped on a
|
|
786
|
+
// pane's edge inserts there. A torn-out page uses it — the page becomes a
|
|
787
|
+
// one-tab group that IS a pane — and keeps the strip rules of the grid
|
|
788
|
+
// board: its own strip reorders, another container's strip or the centre of
|
|
789
|
+
// its body joins, the centre of its own body is home, off the canvas is
|
|
790
|
+
// nothing. One history step, like every other drop.
|
|
791
|
+
let tearing = false;
|
|
792
|
+
const EDGE_GRACE = 60;
|
|
793
|
+
/** The last batch the tear-out ran — the command manager may land it after this tick, so the board re-projects when it settles. */
|
|
794
|
+
let pendingBatch = undefined;
|
|
795
|
+
const execute = (name, commands) => {
|
|
796
|
+
if (commands.length === 0)
|
|
797
|
+
return false;
|
|
798
|
+
pendingBatch = execCommand(new BatchCommand(name, commands));
|
|
799
|
+
return true;
|
|
800
|
+
};
|
|
801
|
+
const beginTearOut = (pageId, fromGroupId, ev, plan) => {
|
|
802
|
+
var _a;
|
|
803
|
+
if (disposed || isStatic || gesture || tearing)
|
|
804
|
+
return false;
|
|
805
|
+
const from = diagram.getGroup(fromGroupId);
|
|
806
|
+
if (!from)
|
|
807
|
+
return false;
|
|
808
|
+
const tree0 = readTree();
|
|
809
|
+
tearing = true;
|
|
810
|
+
const doc = (_a = api.container.ownerDocument) !== null && _a !== void 0 ? _a : document;
|
|
811
|
+
const chip = doc.createElement('div');
|
|
812
|
+
chip.className = 'axdb-drag-chip axdb-tab-chip';
|
|
813
|
+
chip.textContent = plan.label;
|
|
814
|
+
doc.body.appendChild(chip);
|
|
815
|
+
const moveChip = (cx, cy) => {
|
|
816
|
+
chip.style.left = `${cx + 6}px`;
|
|
817
|
+
chip.style.top = `${cy + 6}px`;
|
|
818
|
+
};
|
|
819
|
+
moveChip(ev.clientX, ev.clientY);
|
|
820
|
+
const layer = htmlLayer();
|
|
821
|
+
let joinEl = null;
|
|
822
|
+
const showJoin = (r) => {
|
|
823
|
+
if (!layer)
|
|
824
|
+
return;
|
|
825
|
+
if (!joinEl) {
|
|
826
|
+
joinEl = doc.createElement('div');
|
|
827
|
+
joinEl.className = 'axdb-join';
|
|
828
|
+
layer.prepend(joinEl);
|
|
829
|
+
}
|
|
830
|
+
joinEl.style.left = `${r.x}px`;
|
|
831
|
+
joinEl.style.top = `${r.y}px`;
|
|
832
|
+
joinEl.style.width = `${r.width}px`;
|
|
833
|
+
joinEl.style.height = `${r.height}px`;
|
|
834
|
+
};
|
|
835
|
+
const hideJoin = () => {
|
|
836
|
+
joinEl === null || joinEl === void 0 ? void 0 : joinEl.remove();
|
|
837
|
+
joinEl = null;
|
|
838
|
+
};
|
|
839
|
+
const frameOfGroup = (g) => { var _a, _b, _c, _d; return ({ x: g.position.x, y: g.position.y, width: (_b = (_a = g.size) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0, height: (_d = (_c = g.size) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0 }); };
|
|
840
|
+
const inRect = (r, x, y) => x >= r.x && x <= r.x + r.width && y >= r.y && y <= r.y + r.height;
|
|
841
|
+
const targets = plan.joinTargets
|
|
842
|
+
.map((id) => diagram.getGroup(id))
|
|
843
|
+
.filter((g) => !!g && g.id !== fromGroupId && !plan.ownBoards.includes(g.id));
|
|
844
|
+
/** Inside the visible canvas plus a grace band; an unmeasurable container (no layout) is never off. */
|
|
845
|
+
const clientInsideCanvasGrace = (cx, cy) => {
|
|
846
|
+
const rect = api.container.getBoundingClientRect();
|
|
847
|
+
if (rect.width <= 0 || rect.height <= 0)
|
|
848
|
+
return true;
|
|
849
|
+
return cx >= rect.left - EDGE_GRACE && cx <= rect.right + EDGE_GRACE && cy >= rect.top - EDGE_GRACE && cy <= rect.bottom + EDGE_GRACE;
|
|
850
|
+
};
|
|
851
|
+
/** The centre third of a container's BODY (below its strip), both axes — the grid board's join zone. */
|
|
852
|
+
const centreThird = (g, w) => {
|
|
853
|
+
const f = frameOfGroup(g);
|
|
854
|
+
if (!inRect(f, w.x, w.y))
|
|
855
|
+
return false;
|
|
856
|
+
const top = f.y + plan.stripHeight(g.id);
|
|
857
|
+
const h = Math.max(0, f.y + f.height - top);
|
|
858
|
+
return w.x >= f.x + f.width / 3 && w.x <= f.x + (2 * f.width) / 3 && w.y >= top + h / 3 && w.y <= top + (2 * h) / 3;
|
|
859
|
+
};
|
|
860
|
+
const zoneAt = (cx, cy, w) => {
|
|
861
|
+
if (!clientInsideCanvasGrace(cx, cy))
|
|
862
|
+
return { kind: 'off' };
|
|
863
|
+
const own = plan.stripIndex(fromGroupId, cx, cy);
|
|
864
|
+
if (own !== null)
|
|
865
|
+
return { kind: 'reorder', index: own };
|
|
866
|
+
for (const t of targets) {
|
|
867
|
+
const i = plan.stripIndex(t.id, cx, cy);
|
|
868
|
+
if (i !== null)
|
|
869
|
+
return { kind: 'strip', targetId: t.id, index: i };
|
|
870
|
+
}
|
|
871
|
+
for (const t of targets)
|
|
872
|
+
if (centreThird(t, w))
|
|
873
|
+
return { kind: 'join', targetId: t.id };
|
|
874
|
+
if (centreThird(from, w))
|
|
875
|
+
return { kind: 'home' };
|
|
876
|
+
if (worldInsideBoard(w.x, w.y)) {
|
|
877
|
+
const t = dropTargetAt(tree0, w.x, w.y);
|
|
878
|
+
if (t)
|
|
879
|
+
return { kind: 'pane', target: t };
|
|
880
|
+
}
|
|
881
|
+
return { kind: 'home' };
|
|
882
|
+
};
|
|
883
|
+
const apply = (z) => {
|
|
884
|
+
plan.markDrop(z.kind === 'reorder' ? fromGroupId : z.kind === 'strip' ? z.targetId : null, z.kind === 'reorder' || z.kind === 'strip' ? z.index : null);
|
|
885
|
+
const jt = z.kind === 'join' ? diagram.getGroup(z.targetId) : undefined;
|
|
886
|
+
if (jt)
|
|
887
|
+
showJoin(frameOfGroup(jt));
|
|
888
|
+
else
|
|
889
|
+
hideJoin();
|
|
890
|
+
showInsertion(z.kind === 'pane' ? insertionRect(z.target.rect, z.target.side) : null);
|
|
891
|
+
chip.classList.toggle('axdb-out', z.kind === 'home' || z.kind === 'off');
|
|
892
|
+
};
|
|
893
|
+
let last = { x: ev.clientX, y: ev.clientY };
|
|
894
|
+
const detach = () => {
|
|
895
|
+
window.removeEventListener('pointermove', onMove, true);
|
|
896
|
+
window.removeEventListener('pointerup', onUp, true);
|
|
897
|
+
window.removeEventListener('pointercancel', onCancel, true);
|
|
898
|
+
window.removeEventListener('keydown', onKey, true);
|
|
899
|
+
};
|
|
900
|
+
const done = (changed, kind) => {
|
|
901
|
+
tearing = false;
|
|
902
|
+
// PAINT FROM THE TREE THAT WAS SET. The batch adds the group before it
|
|
903
|
+
// swaps the tree, and the board's member:added reconciles the interim
|
|
904
|
+
// tree by halving the LARGEST leaf; when the manager lands the batch
|
|
905
|
+
// after this tick, that interim projection is what stayed on the canvas
|
|
906
|
+
// (a pane 445 px off). Project now, and again once the batch settles.
|
|
907
|
+
const paint = () => {
|
|
908
|
+
if (disposed)
|
|
909
|
+
return;
|
|
910
|
+
project(readTree());
|
|
911
|
+
api.renderNow();
|
|
912
|
+
};
|
|
913
|
+
paint();
|
|
914
|
+
const p = pendingBatch;
|
|
915
|
+
pendingBatch = undefined;
|
|
916
|
+
if (p && typeof p.then === 'function')
|
|
917
|
+
void p.then(paint, () => undefined);
|
|
918
|
+
fire({ type: kind, kind: 'move', nodeId: pageId, changed });
|
|
919
|
+
};
|
|
920
|
+
const finish = (commit) => {
|
|
921
|
+
detach();
|
|
922
|
+
chip.remove();
|
|
923
|
+
hideJoin();
|
|
924
|
+
showInsertion(null);
|
|
925
|
+
plan.markDrop(null, null);
|
|
926
|
+
if (disposed) {
|
|
927
|
+
tearing = false;
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
const z = commit ? zoneAt(last.x, last.y, toWorld(last.x, last.y)) : { kind: 'home' };
|
|
931
|
+
if (z.kind === 'home' || z.kind === 'off') {
|
|
932
|
+
done(false, 'cancel');
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
if (z.kind === 'reorder') {
|
|
936
|
+
const cmds = plan.reorder(z.index);
|
|
937
|
+
const changed = cmds.length > 0 && execute('Reorder tab', cmds);
|
|
938
|
+
done(changed, changed ? 'commit' : 'cancel');
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
if (z.kind === 'strip' || z.kind === 'join') {
|
|
942
|
+
const index = z.kind === 'strip' ? z.index : plan.dropIndex(z.targetId, last.x, last.y);
|
|
943
|
+
const planned = plan.join(z.targetId, index, group.id);
|
|
944
|
+
done(execute('Move tab', [...planned.move, ...planned.collapse]), 'commit');
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
// A PANE: the page's new group takes the named side of the target — the
|
|
948
|
+
// widget drop's own rule — and the tree swap rides in the same step as
|
|
949
|
+
// the group's birth, so one undo removes both.
|
|
950
|
+
const side = rtl && (z.target.side === 'left' || z.target.side === 'right') ? (z.target.side === 'left' ? 'right' : 'left') : z.target.side;
|
|
951
|
+
const after = normalizeSplit(insertSplitLeaf(tree0, plan.arrivingId, targetRef(z.target), side));
|
|
952
|
+
const rect = rectsOf(after).get(plan.arrivingId);
|
|
953
|
+
const cell = cellsFromSplit(after, columns, rowsGuess()).get(plan.arrivingId);
|
|
954
|
+
if (!rect || !cell) {
|
|
955
|
+
done(false, 'cancel');
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
const planned = plan.commands(cell, rect, group.id);
|
|
959
|
+
done(execute('Move tab out', [...planned.move, new SetSplitTreeCommand(group.id, tree0, after), ...planned.collapse]), 'commit');
|
|
960
|
+
live.announce(`${plan.label} is a pane ${side === 'left' || side === 'top' ? 'before' : 'after'} ${targetName(z.target)}`, 'polite', true);
|
|
961
|
+
};
|
|
962
|
+
const onMove = (e) => {
|
|
963
|
+
if (disposed)
|
|
964
|
+
return finish(false);
|
|
965
|
+
last = { x: e.clientX, y: e.clientY };
|
|
966
|
+
moveChip(e.clientX, e.clientY);
|
|
967
|
+
apply(zoneAt(e.clientX, e.clientY, toWorld(e.clientX, e.clientY)));
|
|
968
|
+
api.render();
|
|
969
|
+
};
|
|
970
|
+
const onUp = () => finish(true);
|
|
971
|
+
const onCancel = () => finish(false);
|
|
972
|
+
const onKey = (e) => {
|
|
973
|
+
if (e.key === 'Escape')
|
|
974
|
+
finish(false);
|
|
975
|
+
};
|
|
976
|
+
window.addEventListener('pointermove', onMove, true);
|
|
977
|
+
window.addEventListener('pointerup', onUp, true);
|
|
978
|
+
window.addEventListener('pointercancel', onCancel, true);
|
|
979
|
+
window.addEventListener('keydown', onKey, true);
|
|
980
|
+
apply(zoneAt(ev.clientX, ev.clientY, toWorld(ev.clientX, ev.clientY)));
|
|
981
|
+
api.render();
|
|
982
|
+
return true;
|
|
983
|
+
};
|
|
782
984
|
// -- palette drag-in --------------------------------------------------------
|
|
783
985
|
const beginPaletteDrag = (node, spec, event) => {
|
|
784
986
|
var _a;
|
|
@@ -1251,9 +1453,8 @@ export function bindDashboardSplit(api, group, options = {}) {
|
|
|
1251
1453
|
hasItem: (id) => { var _a; return ((_a = group.members) !== null && _a !== void 0 ? _a : new Set()).has(id); },
|
|
1252
1454
|
memberCell: (id) => handle.cellOf(id),
|
|
1253
1455
|
resizeMemberBy: () => ({ changed: false }),
|
|
1254
|
-
// A
|
|
1255
|
-
|
|
1256
|
-
tearOutMember: (_pageId, _fromGroupId, _ev, _plan) => false,
|
|
1456
|
+
// A torn-out page becomes a PANE (0.4.37) — see beginTearOut.
|
|
1457
|
+
tearOutMember: (pageId, fromGroupId, ev, plan) => beginTearOut(pageId, fromGroupId, ev, plan),
|
|
1257
1458
|
// …and it has no cells to move a section across: a strip press stays a selection.
|
|
1258
1459
|
dragMember: () => false,
|
|
1259
1460
|
containsWorld: (x, y) => worldInsideBoard(x, y),
|