@nvidia-elements/core 2.22.5 → 2.23.1
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 +15 -0
- package/dist/accordion/accordion2.js +4 -4
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge2.js +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +4 -0
- package/dist/bundles/index.d.ts +357 -1
- package/dist/bundles/index.js +14 -14
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color2.js +6 -6
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/custom-elements-jsx.d.ts +189 -0
- package/dist/custom-elements-vue.d.ts +189 -0
- package/dist/custom-elements.json +6561 -339
- package/dist/data.html.json +133 -0
- package/dist/date/date2.js +6 -6
- package/dist/datetime/datetime2.js +6 -6
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drag-handle/drag-handle2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-bytes/format-bytes2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-number/format-number2.js +1 -1
- package/dist/format-relative-time/format-relative-time2.js +1 -1
- package/dist/format-truncate/format-truncate2.js +1 -1
- package/dist/forms/control/control2.js +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/forms/utils/layout.d.ts +0 -1
- package/dist/forms/utils/layout.js.map +1 -1
- package/dist/forms/utils/states.d.ts +0 -1
- package/dist/forms/utils/states.js.map +1 -1
- package/dist/gauge/gauge2.js +1 -1
- package/dist/ghost/define.d.ts +6 -0
- package/dist/ghost/define.js +6 -0
- package/dist/ghost/define.js.map +1 -0
- package/dist/ghost/ghost.d.ts +27 -0
- package/dist/ghost/ghost.examples.js +5 -0
- package/dist/ghost/ghost.examples.js.map +1 -0
- package/dist/ghost/ghost.examples.json +37 -0
- package/dist/ghost/ghost.js +5 -0
- package/dist/ghost/ghost.js.map +1 -0
- package/dist/ghost/ghost2.js +28 -0
- package/dist/ghost/ghost2.js.map +1 -0
- package/dist/ghost/index.d.ts +1 -0
- package/dist/ghost/index.js +1 -0
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/iframe/iframe2.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/controllers/keynav-spatial.controller.d.ts +0 -1
- package/dist/internal/controllers/keynav-spatial.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover.utils.d.ts +0 -1
- package/dist/internal/controllers/type-native-popover.utils.js.map +1 -1
- package/dist/internal/index.d.ts +0 -1
- package/dist/internal/index.js +116 -128
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/types/index.d.ts +37 -3
- package/dist/internal/types/index.js.map +1 -1
- package/dist/internal/utils/audit-logs.d.ts +0 -1
- package/dist/internal/utils/audit-logs.js.map +1 -1
- package/dist/internal/utils/dom.d.ts +0 -5
- package/dist/internal/utils/dom.js +30 -46
- package/dist/internal/utils/dom.js.map +1 -1
- package/dist/internal/utils/events.d.ts +0 -1
- package/dist/internal/utils/events.js +4 -7
- package/dist/internal/utils/events.js.map +1 -1
- package/dist/internal/utils/keynav.d.ts +0 -1
- package/dist/internal/utils/keynav.js +2 -5
- package/dist/internal/utils/keynav.js.map +1 -1
- package/dist/internal/utils/objects.d.ts +0 -2
- package/dist/internal/utils/objects.js +2 -8
- package/dist/internal/utils/objects.js.map +1 -1
- package/dist/joystick/joystick2.js +5 -5
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-group2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month2.js +6 -6
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel2.js +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +1 -1
- package/dist/panel/panel2.js +4 -4
- package/dist/password/password2.js +6 -6
- package/dist/preferences-input/preferences-input2.js +5 -5
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-dot/progress-dot2.js +1 -1
- package/dist/progress-ring/progress-ring2.js +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +1 -1
- package/dist/resize-handle/resize-handle2.js +5 -5
- package/dist/search/search2.js +6 -6
- package/dist/select/select2.js +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +6 -6
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs-item-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +5 -5
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +6 -6
- package/dist/toast/toast2.js +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week2.js +6 -6
- package/dist/workspace/controllers/workspace-command.controller.d.ts +34 -0
- package/dist/workspace/controllers/workspace-command.controller.js +87 -0
- package/dist/workspace/controllers/workspace-command.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-composition.controller.d.ts +54 -0
- package/dist/workspace/controllers/workspace-composition.controller.js +169 -0
- package/dist/workspace/controllers/workspace-composition.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-fullscreen.controller.d.ts +25 -0
- package/dist/workspace/controllers/workspace-fullscreen.controller.js +84 -0
- package/dist/workspace/controllers/workspace-fullscreen.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-measurement.controller.d.ts +19 -0
- package/dist/workspace/controllers/workspace-measurement.controller.js +188 -0
- package/dist/workspace/controllers/workspace-measurement.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-rearrange.controller.d.ts +40 -0
- package/dist/workspace/controllers/workspace-rearrange.controller.js +385 -0
- package/dist/workspace/controllers/workspace-rearrange.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-resize.controller.d.ts +43 -0
- package/dist/workspace/controllers/workspace-resize.controller.js +168 -0
- package/dist/workspace/controllers/workspace-resize.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-restoration.controller.d.ts +24 -0
- package/dist/workspace/controllers/workspace-restoration.controller.js +193 -0
- package/dist/workspace/controllers/workspace-restoration.controller.js.map +1 -0
- package/dist/workspace/define.d.ts +10 -0
- package/dist/workspace/define.js +9 -0
- package/dist/workspace/define.js.map +1 -0
- package/dist/workspace/index.d.ts +11 -0
- package/dist/workspace/index.js +6 -0
- package/dist/workspace/panel/panel.d.ts +48 -0
- package/dist/workspace/panel/panel.js +5 -0
- package/dist/workspace/panel/panel.js.map +1 -0
- package/dist/workspace/panel/panel2.js +53 -0
- package/dist/workspace/panel/panel2.js.map +1 -0
- package/dist/workspace/panel-content/panel-content.d.ts +20 -0
- package/dist/workspace/panel-content/panel-content.js +5 -0
- package/dist/workspace/panel-content/panel-content.js.map +1 -0
- package/dist/workspace/panel-content/panel-content2.js +22 -0
- package/dist/workspace/panel-content/panel-content2.js.map +1 -0
- package/dist/workspace/panel-footer/panel-footer.d.ts +24 -0
- package/dist/workspace/panel-footer/panel-footer.js +5 -0
- package/dist/workspace/panel-footer/panel-footer.js.map +1 -0
- package/dist/workspace/panel-footer/panel-footer2.js +28 -0
- package/dist/workspace/panel-footer/panel-footer2.js.map +1 -0
- package/dist/workspace/panel-header/panel-header.d.ts +61 -0
- package/dist/workspace/panel-header/panel-header.js +5 -0
- package/dist/workspace/panel-header/panel-header.js.map +1 -0
- package/dist/workspace/panel-header/panel-header2.js +102 -0
- package/dist/workspace/panel-header/panel-header2.js.map +1 -0
- package/dist/workspace/utils/evaluation.utils.d.ts +83 -0
- package/dist/workspace/utils/evaluation.utils.js +294 -0
- package/dist/workspace/utils/evaluation.utils.js.map +1 -0
- package/dist/workspace/utils/geometry/allocation.utils.d.ts +40 -0
- package/dist/workspace/utils/geometry/allocation.utils.js +73 -0
- package/dist/workspace/utils/geometry/allocation.utils.js.map +1 -0
- package/dist/workspace/utils/geometry/partition.utils.d.ts +10 -0
- package/dist/workspace/utils/geometry/partition.utils.js +40 -0
- package/dist/workspace/utils/geometry/partition.utils.js.map +1 -0
- package/dist/workspace/utils/geometry/sizing.utils.d.ts +35 -0
- package/dist/workspace/utils/geometry/sizing.utils.js +42 -0
- package/dist/workspace/utils/geometry/sizing.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/boundary.utils.d.ts +40 -0
- package/dist/workspace/utils/interaction/boundary.utils.js +91 -0
- package/dist/workspace/utils/interaction/boundary.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/command.utils.d.ts +74 -0
- package/dist/workspace/utils/interaction/command.utils.js +189 -0
- package/dist/workspace/utils/interaction/command.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/drag-preview.utils.d.ts +79 -0
- package/dist/workspace/utils/interaction/drag-preview.utils.js +16 -0
- package/dist/workspace/utils/interaction/drag-preview.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/insertion-offers.utils.d.ts +58 -0
- package/dist/workspace/utils/interaction/insertion-offers.utils.js +259 -0
- package/dist/workspace/utils/interaction/insertion-offers.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/placement-decision.utils.d.ts +55 -0
- package/dist/workspace/utils/interaction/placement-decision.utils.js +242 -0
- package/dist/workspace/utils/interaction/placement-decision.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/resize-input.utils.d.ts +1 -0
- package/dist/workspace/utils/interaction/resize-input.utils.js +17 -0
- package/dist/workspace/utils/interaction/resize-input.utils.js.map +1 -0
- package/dist/workspace/utils/model/layout.utils.d.ts +22 -0
- package/dist/workspace/utils/model/layout.utils.js +41 -0
- package/dist/workspace/utils/model/layout.utils.js.map +1 -0
- package/dist/workspace/utils/model/membership.utils.d.ts +14 -0
- package/dist/workspace/utils/model/membership.utils.js +17 -0
- package/dist/workspace/utils/model/membership.utils.js.map +1 -0
- package/dist/workspace/utils/model/operations.utils.d.ts +31 -0
- package/dist/workspace/utils/model/operations.utils.js +178 -0
- package/dist/workspace/utils/model/operations.utils.js.map +1 -0
- package/dist/workspace/utils/model/projection.utils.d.ts +7 -0
- package/dist/workspace/utils/model/projection.utils.js +87 -0
- package/dist/workspace/utils/model/projection.utils.js.map +1 -0
- package/dist/workspace/utils/model/value.utils.d.ts +5 -0
- package/dist/workspace/utils/model/value.utils.js +68 -0
- package/dist/workspace/utils/model/value.utils.js.map +1 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.d.ts +32 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.js +152 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.js.map +1 -0
- package/dist/workspace/utils/placement/context.utils.d.ts +36 -0
- package/dist/workspace/utils/placement/context.utils.js +135 -0
- package/dist/workspace/utils/placement/context.utils.js.map +1 -0
- package/dist/workspace/utils/placement/group-insertion.utils.d.ts +26 -0
- package/dist/workspace/utils/placement/group-insertion.utils.js +171 -0
- package/dist/workspace/utils/placement/group-insertion.utils.js.map +1 -0
- package/dist/workspace/utils/placement/origin.utils.d.ts +13 -0
- package/dist/workspace/utils/placement/origin.utils.js +49 -0
- package/dist/workspace/utils/placement/origin.utils.js.map +1 -0
- package/dist/workspace/utils/placement/planner.utils.d.ts +22 -0
- package/dist/workspace/utils/placement/planner.utils.js +184 -0
- package/dist/workspace/utils/placement/planner.utils.js.map +1 -0
- package/dist/workspace/utils/placement/preparation.utils.d.ts +28 -0
- package/dist/workspace/utils/placement/preparation.utils.js +140 -0
- package/dist/workspace/utils/placement/preparation.utils.js.map +1 -0
- package/dist/workspace/utils/placement/region.utils.d.ts +15 -0
- package/dist/workspace/utils/placement/region.utils.js +111 -0
- package/dist/workspace/utils/placement/region.utils.js.map +1 -0
- package/dist/workspace/utils/placement/split-sizing.utils.d.ts +18 -0
- package/dist/workspace/utils/placement/split-sizing.utils.js +108 -0
- package/dist/workspace/utils/placement/split-sizing.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/composition.utils.d.ts +17 -0
- package/dist/workspace/utils/presentation/composition.utils.js +95 -0
- package/dist/workspace/utils/presentation/composition.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/groups.utils.d.ts +91 -0
- package/dist/workspace/utils/presentation/groups.utils.js +169 -0
- package/dist/workspace/utils/presentation/groups.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/header-configuration.utils.d.ts +11 -0
- package/dist/workspace/utils/presentation/header-configuration.utils.js +7 -0
- package/dist/workspace/utils/presentation/header-configuration.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/measurements.utils.d.ts +21 -0
- package/dist/workspace/utils/presentation/measurements.utils.js +28 -0
- package/dist/workspace/utils/presentation/measurements.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/offers.utils.d.ts +43 -0
- package/dist/workspace/utils/presentation/offers.utils.js +137 -0
- package/dist/workspace/utils/presentation/offers.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/preview.utils.d.ts +6 -0
- package/dist/workspace/utils/presentation/preview.utils.js +36 -0
- package/dist/workspace/utils/presentation/preview.utils.js.map +1 -0
- package/dist/workspace/workspace.d.ts +103 -0
- package/dist/workspace/workspace.examples.js +5 -0
- package/dist/workspace/workspace.examples.js.map +1 -0
- package/dist/workspace/workspace.examples.json +133 -0
- package/dist/workspace/workspace.js +5 -0
- package/dist/workspace/workspace.js.map +1 -0
- package/dist/workspace/workspace.types.d.ts +3 -0
- package/dist/workspace/workspace2.js +518 -0
- package/dist/workspace/workspace2.js.map +1 -0
- package/package.json +27 -3
- package/dist/internal/utils/supports.d.ts +0 -3
- package/dist/internal/utils/supports.js +0 -13
- package/dist/internal/utils/supports.js.map +0 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { normalizeLayout as e } from "../model/layout.utils.js";
|
|
2
|
+
import { findGroup as t, isValidInsertionIndex as n, placePanels as r, projectLayout as i } from "../model/operations.utils.js";
|
|
3
|
+
import { createPlacementContext as a } from "./context.utils.js";
|
|
4
|
+
import { findDeepestProjectionCarrier as o, getProjectionSignature as s, rebaseProjectedSplit as c } from "../model/projection.utils.js";
|
|
5
|
+
import { findWorkspaceRegion as l, placeRegion as u } from "./region.utils.js";
|
|
6
|
+
import { planGroupInsertion as d } from "./group-insertion.utils.js";
|
|
7
|
+
// src/workspace/utils/placement/planner.utils.ts
|
|
8
|
+
function f() {
|
|
9
|
+
let e;
|
|
10
|
+
return (t) => {
|
|
11
|
+
e && m(e, t) || (e = {
|
|
12
|
+
layout: t.layout,
|
|
13
|
+
source: [...t.source],
|
|
14
|
+
available: [...t.available],
|
|
15
|
+
entries: []
|
|
16
|
+
});
|
|
17
|
+
let n = e.entries.find((e) => e.operation === t.operation && g(e.destination, t.destination));
|
|
18
|
+
if (!n) {
|
|
19
|
+
let { target: r, position: i, region: a, index: o } = t.destination;
|
|
20
|
+
n = {
|
|
21
|
+
operation: t.operation,
|
|
22
|
+
destination: {
|
|
23
|
+
target: r,
|
|
24
|
+
position: i,
|
|
25
|
+
region: a,
|
|
26
|
+
index: o
|
|
27
|
+
},
|
|
28
|
+
plan: _(t)
|
|
29
|
+
}, e.entries.push(n);
|
|
30
|
+
}
|
|
31
|
+
return n.plan;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function p(e) {
|
|
35
|
+
return _(e);
|
|
36
|
+
}
|
|
37
|
+
function m(e, t) {
|
|
38
|
+
return e.layout === t.layout && h(e.source, t.source) && h(e.available, t.available);
|
|
39
|
+
}
|
|
40
|
+
function h(e, t) {
|
|
41
|
+
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
42
|
+
}
|
|
43
|
+
function g(e, t) {
|
|
44
|
+
return e.target === t.target && e.position === t.position && e.region === t.region && e.index === t.index;
|
|
45
|
+
}
|
|
46
|
+
function _(e) {
|
|
47
|
+
if (n(e.destination.index)) return v(e);
|
|
48
|
+
}
|
|
49
|
+
function v(e) {
|
|
50
|
+
if (e.operation === "tab") return e.destination.position === "tab" ? A(e) : void 0;
|
|
51
|
+
if (e.destination.position !== "tab") return e.operation === "order" ? b(e) : e.operation === "insert" ? b(e) ?? d(e) : e.destination.region ? u(e) : A(e);
|
|
52
|
+
}
|
|
53
|
+
function y(e) {
|
|
54
|
+
let { layout: n, source: r, destination: a } = e, o = t(n.root, r[0]);
|
|
55
|
+
if (!o || !T(o.panels, r) || a.position === "tab") return;
|
|
56
|
+
let s = a.position === "left" || a.position === "right" ? "horizontal" : "vertical", c = e.available.filter((e) => !n.closed.includes(e)), l = r.find((e) => c.includes(e));
|
|
57
|
+
if (!l) return;
|
|
58
|
+
let u = (e.projectLayout ?? i)(n, c).root, d = E(u, a);
|
|
59
|
+
if (!d) return;
|
|
60
|
+
let f = S(u, {
|
|
61
|
+
source: l,
|
|
62
|
+
target: d,
|
|
63
|
+
axis: s
|
|
64
|
+
});
|
|
65
|
+
return f ? {
|
|
66
|
+
branch: f,
|
|
67
|
+
visible: c,
|
|
68
|
+
sourceId: l,
|
|
69
|
+
target: d
|
|
70
|
+
} : void 0;
|
|
71
|
+
}
|
|
72
|
+
function b(e) {
|
|
73
|
+
let t = y(e);
|
|
74
|
+
if (!t) return;
|
|
75
|
+
let { branch: n, visible: r, sourceId: i, target: a } = t, { layout: o, destination: s } = e;
|
|
76
|
+
if (!s.region && e.source.includes(s.target)) return j(o, e, n);
|
|
77
|
+
let l = D({
|
|
78
|
+
branch: n,
|
|
79
|
+
sourceId: i,
|
|
80
|
+
targetNode: a,
|
|
81
|
+
destination: s
|
|
82
|
+
});
|
|
83
|
+
if (l.every((e, t) => e.child === n.children[t])) return j(o, e, n);
|
|
84
|
+
let u = x({
|
|
85
|
+
layout: o,
|
|
86
|
+
children: n.children,
|
|
87
|
+
reordered: l.map((e) => e.child),
|
|
88
|
+
visible: r,
|
|
89
|
+
projectLayout: e.projectLayout
|
|
90
|
+
});
|
|
91
|
+
if (!u) return;
|
|
92
|
+
let d = {
|
|
93
|
+
...n,
|
|
94
|
+
children: l.map((e) => e.child)
|
|
95
|
+
};
|
|
96
|
+
return j(c(u, d, l.map((e) => e.weight), e.available) ?? u, e, n);
|
|
97
|
+
}
|
|
98
|
+
function x(t) {
|
|
99
|
+
let { layout: n, children: r, reordered: a, visible: c } = t, l = /* @__PURE__ */ new Map(), u = (e) => (l.has(e) || l.set(e, (t.projectLayout ?? i)({
|
|
100
|
+
version: 1,
|
|
101
|
+
root: e,
|
|
102
|
+
closed: []
|
|
103
|
+
}, c).root), l.get(e) ?? null), d = r.map((e) => o(n.root, s(e), u));
|
|
104
|
+
if (d.some((e) => !e)) return;
|
|
105
|
+
let f = /* @__PURE__ */ new Map();
|
|
106
|
+
d.forEach((e, t) => f.set(e, d[r.indexOf(a[t])]));
|
|
107
|
+
let p = e(C(n.root, f));
|
|
108
|
+
return p ? {
|
|
109
|
+
...n,
|
|
110
|
+
root: p
|
|
111
|
+
} : void 0;
|
|
112
|
+
}
|
|
113
|
+
function S(e, t) {
|
|
114
|
+
if (e && e.type !== "group") {
|
|
115
|
+
if (O(e, t)) return e;
|
|
116
|
+
for (let n of e.children) {
|
|
117
|
+
let e = S(n, t);
|
|
118
|
+
if (e) return e;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function C(e, t) {
|
|
123
|
+
return t.get(e) || (e.type === "group" ? e : {
|
|
124
|
+
...e,
|
|
125
|
+
children: e.children.map((e) => C(e, t))
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function w(e, t) {
|
|
129
|
+
return e ? {
|
|
130
|
+
kind: t.position === "tab" ? "tab" : "split",
|
|
131
|
+
layout: e
|
|
132
|
+
} : void 0;
|
|
133
|
+
}
|
|
134
|
+
function T(e, t) {
|
|
135
|
+
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
136
|
+
}
|
|
137
|
+
function E(e, n) {
|
|
138
|
+
return n.region ? l(e, n.region) : t(e, n.target);
|
|
139
|
+
}
|
|
140
|
+
function D(e) {
|
|
141
|
+
let { branch: t, sourceId: n, targetNode: r, destination: i } = e, a = t.children.findIndex((e) => e.type === "group" && e.panels.includes(n)), o = t.children.map((e, n) => ({
|
|
142
|
+
child: e,
|
|
143
|
+
weight: t.weights[n]
|
|
144
|
+
})), c = o.splice(a, 1)[0], l = i.position === "right" || i.position === "bottom", u = o.findIndex((e) => s(e.child) === s(r)), d;
|
|
145
|
+
if (r === t) d = l ? o.length : 0;
|
|
146
|
+
else {
|
|
147
|
+
if (u < 0) return t.children.map((e, n) => ({
|
|
148
|
+
child: e,
|
|
149
|
+
weight: t.weights[n]
|
|
150
|
+
}));
|
|
151
|
+
d = u + +!!l;
|
|
152
|
+
}
|
|
153
|
+
return o.splice(d, 0, c), o;
|
|
154
|
+
}
|
|
155
|
+
function O(e, t) {
|
|
156
|
+
return e.axis === t.axis && e.children.length > 1 && e.children.some((e) => e.type === "group" && e.panels.includes(t.source ?? "")) && (s(e) === s(t.target) || e.children.some((e) => s(e) === s(t.target)));
|
|
157
|
+
}
|
|
158
|
+
function k(e) {
|
|
159
|
+
let { layout: t, source: n, destination: i } = e, a = r({
|
|
160
|
+
layout: t,
|
|
161
|
+
source: n,
|
|
162
|
+
destination: i
|
|
163
|
+
});
|
|
164
|
+
return a ? w(a, i) : void 0;
|
|
165
|
+
}
|
|
166
|
+
function A(e) {
|
|
167
|
+
let n = k(e);
|
|
168
|
+
if (!n) return n;
|
|
169
|
+
let r = t((e.projectLayout ?? i)(e.layout, e.available).root, e.destination.target);
|
|
170
|
+
return {
|
|
171
|
+
...n,
|
|
172
|
+
context: a("recipient", r ?? null, e.source)
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function j(e, t, n) {
|
|
176
|
+
return {
|
|
177
|
+
kind: "reorder",
|
|
178
|
+
layout: e,
|
|
179
|
+
context: a("rail", n, t.source)
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export { f as createWorkspacePlacementPlanner, p as planWorkspacePlacement };
|
|
183
|
+
|
|
184
|
+
//# sourceMappingURL=planner.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.utils.js","names":["createWorkspacePlacementPlanner","binding","samePlanningBinding","input","entry","candidate","sameDestination","planBasePlacement","planWorkspacePlacement","sameIds","left","right","id","index","isValidInsertionIndex","planPeerPlacement","localPlacement","reorderPeers","planGroupInsertion","placeRegion","peerContext","group","findGroup","layout","source","wholeGroup","destination","axis","visible","sourceId","projectedRoot","projectLayout","target","projectedTarget","branch","peerBranch","context","targetNode","peerPlacement","entries","reorderedEntries","permuteCarriers","reordered","rebaseProjectedSplit","projections","project","node","carriers","children","findDeepestProjectionCarrier","getProjectionSignature","child","carrier","replacements","slot","root","normalizeLayout","replaceCarriers","matchesPeers","found","placement","panels","findWorkspaceRegion","from","moving","after","localCandidate","placePanels","plan","recipient","createPlacementContext"],"sources":["../../../../src/workspace/utils/placement/planner.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { normalizeLayout } from '../model/layout.utils.js';\nimport { findGroup, isValidInsertionIndex, placePanels, projectLayout } from '../model/operations.utils.js';\nimport {\n findDeepestProjectionCarrier,\n getProjectionSignature,\n rebaseProjectedSplit\n} from '../model/projection.utils.js';\nimport { createPlacementContext } from './context.utils.js';\nimport { planGroupInsertion } from './group-insertion.utils.js';\nimport { findWorkspaceRegion, placeRegion } from './region.utils.js';\n\nimport type { WorkspaceLayout, WorkspaceNode, WorkspaceSplit } from '../model/layout.utils.js';\nimport type { WorkspaceDestination } from '../model/operations.utils.js';\nimport type { WorkspaceLayoutProjector } from '../model/projection.utils.js';\nimport type { WorkspacePlacementContext } from './context.utils.js';\n\nexport interface WorkspacePlacementPlan {\n kind: 'reorder' | 'split' | 'tab' | 'insert';\n context?: WorkspacePlacementContext;\n layout: WorkspaceLayout;\n}\n\ninterface PlacementInput {\n layout: WorkspaceLayout;\n source: string[];\n destination: WorkspaceDestination;\n available: string[];\n projectLayout?: WorkspaceLayoutProjector;\n operation: 'split' | 'order' | 'insert' | 'tab';\n}\n\nexport type WorkspacePlacementPlanner = (input: PlacementInput) => WorkspacePlacementPlan | undefined;\n\ninterface PlanningEntry {\n operation: PlacementInput['operation'];\n destination: WorkspaceDestination;\n plan: WorkspacePlacementPlan | undefined;\n}\n\ninterface PlanningBinding {\n layout: WorkspaceLayout;\n source: string[];\n available: string[];\n entries: PlanningEntry[];\n}\n\n/** Requires an immutable current layout; projection callbacks are never retained. */\nexport function createWorkspacePlacementPlanner(): WorkspacePlacementPlanner {\n let binding: PlanningBinding | undefined;\n return input => {\n if (!binding || !samePlanningBinding(binding, input)) {\n binding = { layout: input.layout, source: [...input.source], available: [...input.available], entries: [] };\n }\n let entry = binding.entries.find(\n candidate => candidate.operation === input.operation && sameDestination(candidate.destination, input.destination)\n );\n if (!entry) {\n const { target, position, region, index } = input.destination;\n entry = {\n operation: input.operation,\n destination: { target, position, region, index },\n plan: planBasePlacement(input)\n };\n binding.entries.push(entry);\n }\n return entry.plan;\n };\n}\n\nexport function planWorkspacePlacement(input: PlacementInput): WorkspacePlacementPlan | undefined {\n return planBasePlacement(input);\n}\n\nfunction samePlanningBinding(binding: PlanningBinding, input: PlacementInput) {\n return (\n binding.layout === input.layout &&\n sameIds(binding.source, input.source) &&\n sameIds(binding.available, input.available)\n );\n}\n\nfunction sameIds(left: string[], right: string[]) {\n return left.length === right.length && left.every((id, index) => id === right[index]);\n}\n\nfunction sameDestination(left: WorkspaceDestination, right: WorkspaceDestination) {\n return (\n left.target === right.target &&\n left.position === right.position &&\n left.region === right.region &&\n left.index === right.index\n );\n}\n\nfunction planBasePlacement(input: PlacementInput) {\n if (!isValidInsertionIndex(input.destination.index)) return undefined;\n return planPeerPlacement(input);\n}\n\nfunction planPeerPlacement(input: PlacementInput) {\n if (input.operation === 'tab') return input.destination.position === 'tab' ? localPlacement(input) : undefined;\n if (input.destination.position === 'tab') return undefined;\n if (input.operation === 'order') return reorderPeers(input);\n if (input.operation === 'insert') return reorderPeers(input) ?? planGroupInsertion(input);\n return input.destination.region ? placeRegion(input) : localPlacement(input);\n}\n\nfunction peerContext(input: PlacementInput) {\n const { layout, source, destination } = input;\n const group = findGroup(layout.root, source[0]);\n if (!group || !wholeGroup(group.panels, source)) return undefined;\n if (destination.position === 'tab') return undefined;\n const axis = destination.position === 'left' || destination.position === 'right' ? 'horizontal' : 'vertical';\n const visible = input.available.filter(id => !layout.closed.includes(id));\n const sourceId = source.find(id => visible.includes(id));\n if (!sourceId) return undefined;\n const projectedRoot = (input.projectLayout ?? projectLayout)(layout, visible).root;\n const target = projectedTarget(projectedRoot, destination);\n if (!target) return undefined;\n const branch = peerBranch(projectedRoot, { source: sourceId, target, axis });\n return branch ? { branch, visible, sourceId, target } : undefined;\n}\n\nfunction reorderPeers(input: PlacementInput): WorkspacePlacementPlan | undefined {\n const context = peerContext(input);\n if (!context) return undefined;\n const { branch, visible, sourceId, target: targetNode } = context;\n const { layout, destination } = input;\n if (!destination.region && input.source.includes(destination.target)) return peerPlacement(layout, input, branch);\n const entries = reorderedEntries({ branch, sourceId, targetNode, destination });\n if (entries.every((entry, index) => entry.child === branch.children[index]))\n return peerPlacement(layout, input, branch);\n const candidate = permuteCarriers({\n layout,\n children: branch.children,\n reordered: entries.map(entry => entry.child),\n visible,\n projectLayout: input.projectLayout\n });\n if (!candidate) return undefined;\n const reordered = { ...branch, children: entries.map(entry => entry.child) };\n return peerPlacement(\n rebaseProjectedSplit(\n candidate,\n reordered,\n entries.map(entry => entry.weight),\n input.available\n ) ?? candidate,\n input,\n branch\n );\n}\n\nfunction permuteCarriers(input: {\n layout: WorkspaceLayout;\n children: WorkspaceNode[];\n reordered: WorkspaceNode[];\n visible: string[];\n projectLayout?: WorkspaceLayoutProjector;\n}): WorkspaceLayout | undefined {\n const { layout, children, reordered, visible } = input;\n const projections = new Map<WorkspaceNode, WorkspaceNode | null>();\n const project = (node: WorkspaceNode) => {\n if (!projections.has(node)) {\n projections.set(\n node,\n (input.projectLayout ?? projectLayout)({ version: 1, root: node, closed: [] }, visible).root\n );\n }\n return projections.get(node) ?? null;\n };\n const carriers = children.map(child =>\n findDeepestProjectionCarrier(layout.root, getProjectionSignature(child), project)\n );\n if (carriers.some(carrier => !carrier)) return undefined;\n const replacements = new Map<WorkspaceNode, WorkspaceNode>();\n carriers.forEach((slot, index) => replacements.set(slot!, carriers[children.indexOf(reordered[index]!)]!));\n const root = normalizeLayout(replaceCarriers(layout.root!, replacements));\n return root ? { ...layout, root } : undefined;\n}\n\nfunction peerBranch(\n node: WorkspaceNode | null,\n input: { source?: string; target: WorkspaceNode; axis: WorkspaceSplit['axis'] }\n): WorkspaceSplit | undefined {\n if (!node || node.type === 'group') return undefined;\n if (matchesPeers(node, input)) return node;\n for (const child of node.children) {\n const found = peerBranch(child, input);\n if (found) return found;\n }\n return undefined;\n}\n\nfunction replaceCarriers(node: WorkspaceNode, replacements: Map<WorkspaceNode, WorkspaceNode>): WorkspaceNode {\n const payload = replacements.get(node);\n if (payload) return payload;\n if (node.type === 'group') return node;\n return { ...node, children: node.children.map(child => replaceCarriers(child, replacements)) };\n}\n\nfunction placement(\n layout: WorkspaceLayout | undefined,\n destination: WorkspaceDestination\n): WorkspacePlacementPlan | undefined {\n return layout ? { kind: destination.position === 'tab' ? 'tab' : 'split', layout } : undefined;\n}\n\nfunction wholeGroup(panels: string[], source: string[]) {\n return panels.length === source.length && panels.every((id, index) => id === source[index]);\n}\n\nfunction projectedTarget(root: WorkspaceNode | null, destination: WorkspaceDestination) {\n return destination.region ? findWorkspaceRegion(root, destination.region) : findGroup(root, destination.target);\n}\n\nfunction reorderedEntries(input: {\n branch: WorkspaceSplit;\n sourceId: string;\n targetNode: WorkspaceNode;\n destination: WorkspaceDestination;\n}) {\n const { branch, sourceId, targetNode, destination } = input;\n const from = branch.children.findIndex(child => child.type === 'group' && child.panels.includes(sourceId));\n const entries = branch.children.map((child, index) => ({ child, weight: branch.weights[index]! }));\n const moving = entries.splice(from, 1)[0]!;\n const after = destination.position === 'right' || destination.position === 'bottom';\n const target = entries.findIndex(entry => getProjectionSignature(entry.child) === getProjectionSignature(targetNode));\n let index: number;\n if (targetNode === branch) {\n index = after ? entries.length : 0;\n } else {\n if (target < 0) return branch.children.map((child, slot) => ({ child, weight: branch.weights[slot]! }));\n const offset = after ? 1 : 0;\n index = target + offset;\n }\n entries.splice(index, 0, moving);\n return entries;\n}\n\nfunction matchesPeers(\n node: WorkspaceSplit,\n input: { source?: string; target: WorkspaceNode; axis: WorkspaceSplit['axis'] }\n) {\n return (\n node.axis === input.axis &&\n node.children.length > 1 &&\n node.children.some(child => child.type === 'group' && child.panels.includes(input.source ?? '')) &&\n (getProjectionSignature(node) === getProjectionSignature(input.target) ||\n node.children.some(child => getProjectionSignature(child) === getProjectionSignature(input.target)))\n );\n}\n\nfunction localCandidate(input: PlacementInput): WorkspacePlacementPlan | undefined {\n const { layout, source, destination } = input;\n const candidate = placePanels({ layout, source, destination });\n return candidate ? placement(candidate, destination) : undefined;\n}\n\nfunction localPlacement(input: PlacementInput): WorkspacePlacementPlan | undefined {\n const plan = localCandidate(input);\n if (!plan) return plan;\n const recipient = findGroup(\n (input.projectLayout ?? projectLayout)(input.layout, input.available).root,\n input.destination.target\n );\n return { ...plan, context: createPlacementContext('recipient', recipient ?? null, input.source) };\n}\n\nfunction peerPlacement(layout: WorkspaceLayout, input: PlacementInput, branch: WorkspaceSplit): WorkspacePlacementPlan {\n return {\n kind: 'reorder',\n layout,\n context: createPlacementContext('rail', branch, input.source)\n };\n}\n"],"mappings":";;;;;;;AAkDA,SAAgBA,IAA6D;CAC3E,IAAIC;CACJ,QAAO,MAAS;EACd,AAAKA,KAAYC,EAAoBD,GAASE,CAAK,MACjD,IAAU;GAAE,Q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AACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WorkspacePlacedRegion } from '../geometry/allocation.utils.js';
|
|
2
|
+
import type { WorkspacePlacementIntent } from '../interaction/command.utils.js';
|
|
3
|
+
import type { WorkspaceDragOffer, WorkspaceOfferContext } from '../interaction/drag-preview.utils.js';
|
|
4
|
+
import type { WorkspaceLayout } from '../model/layout.utils.js';
|
|
5
|
+
import type { WorkspacePlacementPlanner } from './planner.utils.js';
|
|
6
|
+
import type { WorkspaceMeasurements } from '../presentation/measurements.utils.js';
|
|
7
|
+
import type { WorkspaceEvaluation } from '../evaluation.utils.js';
|
|
8
|
+
interface PreparationInput {
|
|
9
|
+
evaluation: WorkspaceEvaluation;
|
|
10
|
+
layout: WorkspaceLayout;
|
|
11
|
+
measurements: WorkspaceMeasurements;
|
|
12
|
+
}
|
|
13
|
+
interface CandidateInput extends PreparationInput {
|
|
14
|
+
source: string[];
|
|
15
|
+
intent: WorkspacePlacementIntent;
|
|
16
|
+
planner?: WorkspacePlacementPlanner;
|
|
17
|
+
}
|
|
18
|
+
interface OfferInput extends CandidateInput {
|
|
19
|
+
context?: WorkspaceOfferContext;
|
|
20
|
+
groupable: boolean;
|
|
21
|
+
currentRegions(): WorkspacePlacedRegion[];
|
|
22
|
+
}
|
|
23
|
+
export declare function getAdmissiblePlacementLayout(input: CandidateInput & {
|
|
24
|
+
groupable: boolean;
|
|
25
|
+
candidate?: WorkspaceLayout;
|
|
26
|
+
}): WorkspaceLayout | undefined;
|
|
27
|
+
export declare function evaluatePlacementOffer(input: OfferInput): WorkspaceDragOffer | undefined;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { sameSerializedWorkspaceLayout as e } from "../model/value.utils.js";
|
|
2
|
+
import { getTabCue as t } from "../presentation/groups.utils.js";
|
|
3
|
+
import { planWorkspacePlacement as n } from "./planner.utils.js";
|
|
4
|
+
import { preservesGroupMembership as r } from "../model/membership.utils.js";
|
|
5
|
+
import { admitsWorkspaceMove as i } from "../geometry/sizing.utils.js";
|
|
6
|
+
import { resolveSelectedPlacementPlan as a } from "./acquisition-sizing.utils.js";
|
|
7
|
+
import { sizePreferredSplit as o } from "./split-sizing.utils.js";
|
|
8
|
+
import { getOfferAllocation as s, getOfferPresentation as c } from "../presentation/offers.utils.js";
|
|
9
|
+
// src/workspace/utils/placement/preparation.utils.ts
|
|
10
|
+
function l(t) {
|
|
11
|
+
let { evaluation: n, layout: i, source: a, intent: o, groupable: s } = t;
|
|
12
|
+
if (!s && !r({
|
|
13
|
+
root: i.root,
|
|
14
|
+
source: a,
|
|
15
|
+
intent: o
|
|
16
|
+
})) return;
|
|
17
|
+
let c = t.candidate ?? u(t)?.layout;
|
|
18
|
+
if (c && !e(c, i) && d({
|
|
19
|
+
...t,
|
|
20
|
+
candidate: n.project(c)
|
|
21
|
+
})) return c;
|
|
22
|
+
}
|
|
23
|
+
function u(e) {
|
|
24
|
+
let { evaluation: t, layout: r, source: i, intent: a, planner: o = n } = e, s = o({
|
|
25
|
+
layout: r,
|
|
26
|
+
source: i,
|
|
27
|
+
destination: a.destination,
|
|
28
|
+
operation: a.kind,
|
|
29
|
+
available: t.available,
|
|
30
|
+
projectLayout: t.projectLayout
|
|
31
|
+
});
|
|
32
|
+
return s ? p(e, s) : void 0;
|
|
33
|
+
}
|
|
34
|
+
function d(e) {
|
|
35
|
+
return i({
|
|
36
|
+
current: e.evaluation.project(e.layout).root,
|
|
37
|
+
candidate: e.candidate.root,
|
|
38
|
+
viewport: {
|
|
39
|
+
width: e.measurements.width,
|
|
40
|
+
height: e.measurements.height
|
|
41
|
+
},
|
|
42
|
+
requirements: e.evaluation.requirements
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function f(e) {
|
|
46
|
+
let { evaluation: t, source: n, intent: r, context: i } = e, o = i?.acquisition, s = o ? p(e, o.plan) : u(e);
|
|
47
|
+
if (!s) return;
|
|
48
|
+
let { width: c, height: l } = t.geometry(t.project(s.layout)), d = a({
|
|
49
|
+
plan: s,
|
|
50
|
+
source: n,
|
|
51
|
+
available: t.available,
|
|
52
|
+
previous: i?.selected,
|
|
53
|
+
intent: r,
|
|
54
|
+
acquisition: o,
|
|
55
|
+
current: e.currentRegions(),
|
|
56
|
+
rect: {
|
|
57
|
+
x: 0,
|
|
58
|
+
y: 0,
|
|
59
|
+
width: c,
|
|
60
|
+
height: l
|
|
61
|
+
},
|
|
62
|
+
clientOrigin: t.client({
|
|
63
|
+
x: 0,
|
|
64
|
+
y: 0,
|
|
65
|
+
width: 0,
|
|
66
|
+
height: 0
|
|
67
|
+
}),
|
|
68
|
+
requirements: t.requirements
|
|
69
|
+
});
|
|
70
|
+
return m(e, d ?? s, !!d);
|
|
71
|
+
}
|
|
72
|
+
function p(e, t) {
|
|
73
|
+
if (t.kind !== "split") return t;
|
|
74
|
+
let { evaluation: n, source: r } = e;
|
|
75
|
+
return o({
|
|
76
|
+
plan: t,
|
|
77
|
+
source: r,
|
|
78
|
+
available: n.available,
|
|
79
|
+
projectLayout: n.projectLayout,
|
|
80
|
+
preference: {
|
|
81
|
+
allocation: n.detached(r).regions,
|
|
82
|
+
requirements: n.requirements,
|
|
83
|
+
contextRect: n.contextRect
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function m(e, n, i) {
|
|
88
|
+
let { evaluation: a, layout: o, measurements: l, source: u, intent: f } = e, p = a.project(n.layout), m = a.geometry(p), g = m.groups.find((e) => e.panels.some((e) => u.includes(e.id)));
|
|
89
|
+
if (!g) return;
|
|
90
|
+
let _ = a.client(g.rect), { cue: v, bounds: y } = f.kind === "tab" ? t({
|
|
91
|
+
group: g,
|
|
92
|
+
source: u,
|
|
93
|
+
intent: f,
|
|
94
|
+
root: o.root,
|
|
95
|
+
spatial: () => a.detached(u).groups,
|
|
96
|
+
measurements: l,
|
|
97
|
+
viewport: a.bounds(),
|
|
98
|
+
client: (e) => a.client(e),
|
|
99
|
+
scroll: (e) => a.scroll(e)
|
|
100
|
+
}) : {
|
|
101
|
+
cue: _,
|
|
102
|
+
bounds: a.bounds()
|
|
103
|
+
}, b = i && d({
|
|
104
|
+
...e,
|
|
105
|
+
candidate: p
|
|
106
|
+
}) && (e.groupable || r({
|
|
107
|
+
root: o.root,
|
|
108
|
+
source: u,
|
|
109
|
+
intent: f
|
|
110
|
+
})), x = c({
|
|
111
|
+
plan: n,
|
|
112
|
+
regions: m.regions,
|
|
113
|
+
sourceKey: g.key,
|
|
114
|
+
sourceRect: _,
|
|
115
|
+
cue: v,
|
|
116
|
+
bounds: y,
|
|
117
|
+
destination: f.destination,
|
|
118
|
+
feasible: b,
|
|
119
|
+
split: f.kind === "split" ? {
|
|
120
|
+
...a.detached(u),
|
|
121
|
+
source: u
|
|
122
|
+
} : void 0,
|
|
123
|
+
client: (e) => a.client(e)
|
|
124
|
+
});
|
|
125
|
+
if (h(f, x.cue)) return {
|
|
126
|
+
...x,
|
|
127
|
+
cue: {
|
|
128
|
+
kind: f.kind === "tab" ? "tab" : "group",
|
|
129
|
+
rect: x.cue
|
|
130
|
+
},
|
|
131
|
+
feasible: b,
|
|
132
|
+
...s(n, b)
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function h(e, t) {
|
|
136
|
+
return e.kind === "tab" || t.width !== 0 && t.height !== 0;
|
|
137
|
+
}
|
|
138
|
+
export { f as evaluatePlacementOffer, l as getAdmissiblePlacementLayout };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=preparation.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preparation.utils.js","names":["getAdmissiblePlacementLayout","input","groupable","preservesGroupMembership","layout","candidate","placementCandidate","placementFits","evaluation","planWorkspacePlacement","plan","planner","intent","preferredPlacement","admitsWorkspaceMove","evaluatePlacementOffer","acquisition","context","fit","resolveSelectedPlacementPlan","placementOffer","sizePreferredSplit","source","geometry","group","item","panel","rect","getTabCue","target","feasible","fitted","presentation","getOfferPresentation","hasVisiblePlacementCue","getOfferAllocation","cue"],"sources":["../../../../src/workspace/utils/placement/preparation.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Rect } from '@nvidia-elements/core/internal';\n\nimport { admitsWorkspaceMove } from '../geometry/sizing.utils.js';\nimport { preservesGroupMembership } from '../model/membership.utils.js';\nimport { sameSerializedWorkspaceLayout } from '../model/value.utils.js';\nimport { resolveSelectedPlacementPlan } from './acquisition-sizing.utils.js';\nimport { planWorkspacePlacement } from './planner.utils.js';\nimport { sizePreferredSplit } from './split-sizing.utils.js';\nimport { getTabCue } from '../presentation/groups.utils.js';\nimport { getOfferAllocation, getOfferPresentation } from '../presentation/offers.utils.js';\n\nimport type { WorkspacePlacedRegion } from '../geometry/allocation.utils.js';\nimport type { WorkspacePlacementIntent } from '../interaction/command.utils.js';\nimport type { WorkspaceDragOffer, WorkspaceOfferContext } from '../interaction/drag-preview.utils.js';\nimport type { WorkspaceLayout } from '../model/layout.utils.js';\nimport type { WorkspacePlacementPlan, WorkspacePlacementPlanner } from './planner.utils.js';\nimport type { WorkspaceMeasurements } from '../presentation/measurements.utils.js';\nimport type { WorkspaceEvaluation } from '../evaluation.utils.js';\n\ninterface PreparationInput {\n evaluation: WorkspaceEvaluation;\n layout: WorkspaceLayout;\n measurements: WorkspaceMeasurements;\n}\n\ninterface CandidateInput extends PreparationInput {\n source: string[];\n intent: WorkspacePlacementIntent;\n planner?: WorkspacePlacementPlanner;\n}\n\ninterface OfferInput extends CandidateInput {\n context?: WorkspaceOfferContext;\n groupable: boolean;\n currentRegions(): WorkspacePlacedRegion[];\n}\n\nexport function getAdmissiblePlacementLayout(\n input: CandidateInput & { groupable: boolean; candidate?: WorkspaceLayout }\n): WorkspaceLayout | undefined {\n const { evaluation, layout, source, intent, groupable } = input;\n if (!groupable && !preservesGroupMembership({ root: layout.root, source, intent })) {\n return undefined;\n }\n const candidate = input.candidate ?? placementCandidate(input)?.layout;\n if (!candidate || sameSerializedWorkspaceLayout(candidate, layout)) {\n return undefined;\n }\n if (!placementFits({ ...input, candidate: evaluation.project(candidate) })) {\n return undefined;\n }\n return candidate;\n}\n\nfunction placementCandidate(input: CandidateInput): WorkspacePlacementPlan | undefined {\n const { evaluation, layout, source, intent, planner = planWorkspacePlacement } = input;\n const plan = planner({\n layout,\n source,\n destination: intent.destination,\n operation: intent.kind,\n available: evaluation.available,\n projectLayout: evaluation.projectLayout\n });\n return plan ? preferredPlacement(input, plan) : undefined;\n}\n\nfunction placementFits(input: PreparationInput & { candidate: WorkspaceLayout }): boolean {\n return admitsWorkspaceMove({\n current: input.evaluation.project(input.layout).root,\n candidate: input.candidate.root,\n viewport: { width: input.measurements.width, height: input.measurements.height },\n requirements: input.evaluation.requirements\n });\n}\n\n// Keep discovery structural; fit the acquired candidate before admission and preview.\nexport function evaluatePlacementOffer(input: OfferInput): WorkspaceDragOffer | undefined {\n const { evaluation, source, intent, context } = input;\n const acquisition = context?.acquisition;\n const plan = acquisition ? preferredPlacement(input, acquisition.plan) : placementCandidate(input);\n if (!plan) return undefined;\n const { width, height } = evaluation.geometry(evaluation.project(plan.layout));\n const fit = resolveSelectedPlacementPlan({\n plan,\n source,\n available: evaluation.available,\n previous: context?.selected,\n intent,\n acquisition,\n current: input.currentRegions(),\n rect: { x: 0, y: 0, width, height },\n clientOrigin: evaluation.client({ x: 0, y: 0, width: 0, height: 0 }),\n requirements: evaluation.requirements\n });\n return placementOffer(input, fit ?? plan, !!fit);\n}\n\nfunction preferredPlacement(input: CandidateInput, plan: WorkspacePlacementPlan): WorkspacePlacementPlan {\n if (plan.kind !== 'split') return plan;\n const { evaluation, source } = input;\n return sizePreferredSplit({\n plan,\n source,\n available: evaluation.available,\n projectLayout: evaluation.projectLayout,\n preference: {\n allocation: evaluation.detached(source).regions,\n requirements: evaluation.requirements,\n contextRect: evaluation.contextRect\n }\n });\n}\n\nfunction placementOffer(\n input: OfferInput,\n plan: WorkspacePlacementPlan,\n fitted: boolean\n): WorkspaceDragOffer | undefined {\n const { evaluation, layout, measurements, source, intent } = input;\n const candidate = evaluation.project(plan.layout);\n const geometry = evaluation.geometry(candidate);\n const group = geometry.groups.find(item => item.panels.some(panel => source.includes(panel.id)));\n if (!group) return undefined;\n const rect = evaluation.client(group.rect);\n const { cue, bounds } =\n intent.kind === 'tab'\n ? getTabCue({\n group,\n source,\n intent,\n root: layout.root,\n spatial: () => evaluation.detached(source).groups,\n measurements,\n viewport: evaluation.bounds(),\n client: target => evaluation.client(target),\n scroll: target => evaluation.scroll(target)\n })\n : { cue: rect, bounds: evaluation.bounds() };\n const feasible =\n fitted &&\n placementFits({ ...input, candidate }) &&\n (input.groupable || preservesGroupMembership({ root: layout.root, source, intent }));\n const presentation = getOfferPresentation({\n plan,\n regions: geometry.regions,\n sourceKey: group.key,\n sourceRect: rect,\n cue,\n bounds,\n destination: intent.destination,\n feasible,\n split: intent.kind === 'split' ? { ...evaluation.detached(source), source } : undefined,\n client: target => evaluation.client(target)\n });\n if (!hasVisiblePlacementCue(intent, presentation.cue)) return undefined;\n return {\n ...presentation,\n cue: { kind: intent.kind === 'tab' ? 'tab' : 'group', rect: presentation.cue },\n feasible,\n ...getOfferAllocation(plan, feasible)\n };\n}\n\nfunction hasVisiblePlacementCue(intent: WorkspacePlacementIntent, cue: Rect): boolean {\n return intent.kind === 'tab' || (cue.width !== 0 && cue.height !== 0);\n}\n"],"mappings":";;;;;;;;;AAwCA,SAAgBA,EACd,GAC6B;CAC7B,IAAM,EAAE,eAAY,WAAQ,WAAQ,WAAQ,iBAAcC;CAC1D,IAAI,CAACC,KAAa,CAACC,EAAyB;EAAE,MAAMC,EAAO;EAAM;EAAQ;CAAO,CAAC,GAC/E;CAEF,IAAMC,IAAYJ,EAAM,aAAaK,EAAmBL,CAAK,CAAC,EAAE;CAChE,IAAKI,KAAa,GAA8BA,GAAWD,CAAM,KAG5DG,EAAc;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AA;EAC9E,SAAQ,MAAUd,EAAW,OAAOqB,CAAM;CAC5C,CAAC;CACD,IAAKK,EAAuBtB,GAAQoB,EAAa,GAAG,GACpD,OAAO;EACL,GAAGA;EACH,KAAK;GAAE,MAAMpB,EAAO,SAAS,QAAQ,QAAQ;GAAS,MAAMoB,EAAa;EAAI;EAC7E;EACA,GAAGG,EAAmBzB,GAAMoB,CAAQ;CACtC;AACF;AAEA,SAASI,EAAuB,GAAkC,GAAoB;CACpF,OAAOtB,EAAO,SAAS,SAAUwB,EAAI,UAAU,KAAKA,EAAI,WAAW;AACrE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkspaceLayout, WorkspaceNode } from '../model/layout.utils.js';
|
|
2
|
+
import type { WorkspaceDestination } from '../model/operations.utils.js';
|
|
3
|
+
import type { WorkspaceLayoutProjector } from '../model/projection.utils.js';
|
|
4
|
+
import type { WorkspacePlacementPlan } from './planner.utils.js';
|
|
5
|
+
interface WorkspaceRegionPlacementInput {
|
|
6
|
+
layout: WorkspaceLayout;
|
|
7
|
+
source: string[];
|
|
8
|
+
destination: WorkspaceDestination;
|
|
9
|
+
available: string[];
|
|
10
|
+
projectLayout?: WorkspaceLayoutProjector;
|
|
11
|
+
}
|
|
12
|
+
/** Resolves an ephemeral path in a visible arrangement, before source removal. */
|
|
13
|
+
export declare function findWorkspaceRegion(root: WorkspaceNode | null, key: string): WorkspaceNode | undefined;
|
|
14
|
+
export declare function placeRegion(input: WorkspaceRegionPlacementInput): WorkspacePlacementPlan | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { normalizeLayout as e } from "../model/layout.utils.js";
|
|
2
|
+
import { findGroup as t, projectLayout as n } from "../model/operations.utils.js";
|
|
3
|
+
import { createPlacementContext as r } from "./context.utils.js";
|
|
4
|
+
import { findDeepestProjectionCarrier as i, getProjectionSignature as a } from "../model/projection.utils.js";
|
|
5
|
+
// src/workspace/utils/placement/region.utils.ts
|
|
6
|
+
function o(e, t) {
|
|
7
|
+
let n = t.split(".");
|
|
8
|
+
if (n.shift() !== "root") return;
|
|
9
|
+
let r = e;
|
|
10
|
+
for (let e of n) {
|
|
11
|
+
if (!r || r.type !== "split" || !/^\d+$/.test(e)) return;
|
|
12
|
+
r = r.children[Number(e)] ?? null;
|
|
13
|
+
}
|
|
14
|
+
return r ?? void 0;
|
|
15
|
+
}
|
|
16
|
+
function s(t) {
|
|
17
|
+
let n = m(t);
|
|
18
|
+
if (!n) return;
|
|
19
|
+
let { layout: i, source: a, sourceGroup: o, visible: s, carrier: c, region: l, position: u, projectLayout: d, root: h } = n, g = r("recipient", l, a), _ = new Set(a), v = {
|
|
20
|
+
type: "group",
|
|
21
|
+
panels: [...a],
|
|
22
|
+
active: a.includes(o.active) ? o.active : a[0]
|
|
23
|
+
}, y = f(c, _);
|
|
24
|
+
if (!y || !d({
|
|
25
|
+
version: 1,
|
|
26
|
+
root: y,
|
|
27
|
+
closed: []
|
|
28
|
+
}, s).root) return {
|
|
29
|
+
kind: "reorder",
|
|
30
|
+
layout: i,
|
|
31
|
+
context: g
|
|
32
|
+
};
|
|
33
|
+
let b = p(h, {
|
|
34
|
+
carrier: c,
|
|
35
|
+
replacement: {
|
|
36
|
+
type: "split",
|
|
37
|
+
axis: u === "left" || u === "right" ? "horizontal" : "vertical",
|
|
38
|
+
children: u === "left" || u === "top" ? [v, y] : [y, v],
|
|
39
|
+
weights: [.5, .5]
|
|
40
|
+
},
|
|
41
|
+
removed: _
|
|
42
|
+
});
|
|
43
|
+
return b ? {
|
|
44
|
+
kind: "split",
|
|
45
|
+
layout: {
|
|
46
|
+
...i,
|
|
47
|
+
root: e(b)
|
|
48
|
+
},
|
|
49
|
+
context: g
|
|
50
|
+
} : void 0;
|
|
51
|
+
}
|
|
52
|
+
function c(e, t) {
|
|
53
|
+
let n = t.flatMap((e) => e ? [e] : []);
|
|
54
|
+
return n.length ? n.length === 1 ? n[0] : {
|
|
55
|
+
...e,
|
|
56
|
+
children: n,
|
|
57
|
+
weights: e.weights.filter((e, n) => t[n])
|
|
58
|
+
} : null;
|
|
59
|
+
}
|
|
60
|
+
function l(e, n) {
|
|
61
|
+
let r = t(e.root, n[0]);
|
|
62
|
+
if (r && new Set(n).size === n.length && n.every((e) => r.panels.includes(e))) return n.length === 1 || u(r, n) ? r : void 0;
|
|
63
|
+
}
|
|
64
|
+
function u(e, t) {
|
|
65
|
+
return e.panels.length === t.length && e.panels.every((e, n) => e === t[n]);
|
|
66
|
+
}
|
|
67
|
+
function d(e, t) {
|
|
68
|
+
let { layout: r, destination: s } = e, c = o((e.projectLayout ?? n)(r, t).root, s.region);
|
|
69
|
+
if (!c) return;
|
|
70
|
+
let l = i(r.root, a(c), (r) => (e.projectLayout ?? n)({
|
|
71
|
+
version: 1,
|
|
72
|
+
root: r,
|
|
73
|
+
closed: []
|
|
74
|
+
}, t).root);
|
|
75
|
+
return l ? {
|
|
76
|
+
carrier: l,
|
|
77
|
+
region: c
|
|
78
|
+
} : void 0;
|
|
79
|
+
}
|
|
80
|
+
function f(e, t) {
|
|
81
|
+
if (e.type === "split") return c(e, e.children.map((e) => f(e, t)));
|
|
82
|
+
let n = e.panels.filter((e) => !t.has(e));
|
|
83
|
+
return n.length ? {
|
|
84
|
+
...e,
|
|
85
|
+
panels: n,
|
|
86
|
+
active: n.includes(e.active) ? e.active : n[0]
|
|
87
|
+
} : null;
|
|
88
|
+
}
|
|
89
|
+
function p(e, t) {
|
|
90
|
+
return e === t.carrier ? t.replacement : e.type === "group" ? f(e, t.removed) : c(e, e.children.map((e) => p(e, t)));
|
|
91
|
+
}
|
|
92
|
+
function m(e) {
|
|
93
|
+
let { layout: t, source: r, destination: i } = e;
|
|
94
|
+
if (!t.root || !i.region || i.position === "tab" || !r.length) return;
|
|
95
|
+
let a = l(t, r);
|
|
96
|
+
if (!a) return;
|
|
97
|
+
let o = e.available.filter((e) => !t.closed.includes(e)), s = d(e, o);
|
|
98
|
+
if (s) return {
|
|
99
|
+
layout: t,
|
|
100
|
+
source: r,
|
|
101
|
+
sourceGroup: a,
|
|
102
|
+
visible: o,
|
|
103
|
+
...s,
|
|
104
|
+
position: i.position,
|
|
105
|
+
projectLayout: e.projectLayout ?? n,
|
|
106
|
+
root: t.root
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export { o as findWorkspaceRegion, s as placeRegion };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=region.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region.utils.js","names":["findWorkspaceRegion","parts","key","node","root","part","placeRegion","context","regionContext","input","project","canonicalRoot","contextRegion","createPlacementContext","region","source","removed","moving","sourceGroup","residual","stripRegion","carrier","visible","editRegion","position","layout","normalizeLayout","rebuild","children","mapped","child","index","regionSource","group","findGroup","id","wholeGroup","regionCarrier","projectLayout","destination","findDeepestProjectionCarrier","getProjectionSignature","panels","recipient"],"sources":["../../../../src/workspace/utils/placement/region.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { normalizeLayout } from '../model/layout.utils.js';\nimport { findGroup, projectLayout } from '../model/operations.utils.js';\nimport { findDeepestProjectionCarrier, getProjectionSignature } from '../model/projection.utils.js';\nimport { createPlacementContext } from './context.utils.js';\n\nimport type { WorkspaceGroup, WorkspaceLayout, WorkspaceNode, WorkspaceSplit } from '../model/layout.utils.js';\nimport type { WorkspaceDestination } from '../model/operations.utils.js';\nimport type { WorkspaceLayoutProjector } from '../model/projection.utils.js';\nimport type { WorkspacePlacementPlan } from './planner.utils.js';\n\ninterface WorkspaceRegionPlacementInput {\n layout: WorkspaceLayout;\n source: string[];\n destination: WorkspaceDestination;\n available: string[];\n projectLayout?: WorkspaceLayoutProjector;\n}\n\n/** Resolves an ephemeral path in a visible arrangement, before source removal. */\nexport function findWorkspaceRegion(root: WorkspaceNode | null, key: string): WorkspaceNode | undefined {\n const parts = key.split('.');\n if (parts.shift() !== 'root') return undefined;\n let node = root;\n for (const part of parts) {\n if (!node || node.type !== 'split' || !/^\\d+$/.test(part)) return undefined;\n node = node.children[Number(part)] ?? null;\n }\n return node ?? undefined;\n}\n\nexport function placeRegion(input: WorkspaceRegionPlacementInput): WorkspacePlacementPlan | undefined {\n const context = regionContext(input);\n if (!context) return undefined;\n const {\n layout,\n source,\n sourceGroup,\n visible,\n carrier,\n region,\n position,\n projectLayout: project,\n root: canonicalRoot\n } = context;\n const contextRegion = createPlacementContext('recipient', region, source);\n const removed = new Set(source);\n const moving: WorkspaceGroup = {\n type: 'group',\n panels: [...source],\n active: source.includes(sourceGroup.active) ? sourceGroup.active : source[0]!\n };\n const residual = stripRegion(carrier, removed);\n if (!residual || !project({ version: 1, root: residual, closed: [] }, visible).root)\n return { kind: 'reorder', layout, context: contextRegion };\n const before = position === 'left' || position === 'top';\n const replacement: WorkspaceSplit = {\n type: 'split',\n axis: position === 'left' || position === 'right' ? 'horizontal' : 'vertical',\n children: before ? [moving, residual] : [residual, moving],\n weights: [0.5, 0.5]\n };\n const root = editRegion(canonicalRoot, { carrier, replacement, removed });\n return root\n ? { kind: 'split', layout: { ...layout, root: normalizeLayout(root) }, context: contextRegion }\n : undefined;\n}\n\nfunction rebuild(node: WorkspaceSplit, mapped: (WorkspaceNode | null)[]): WorkspaceNode | null {\n const children = mapped.flatMap(child => (child ? [child] : []));\n if (!children.length) return null;\n if (children.length === 1) return children[0]!;\n return { ...node, children, weights: node.weights.filter((_, index) => mapped[index]) };\n}\n\nfunction regionSource(layout: WorkspaceLayout, source: string[]): WorkspaceGroup | undefined {\n const group = findGroup(layout.root, source[0]);\n if (!group || new Set(source).size !== source.length || !source.every(id => group.panels.includes(id)))\n return undefined;\n if (source.length === 1) return group;\n return wholeGroup(group, source) ? group : undefined;\n}\n\nfunction wholeGroup(group: WorkspaceGroup, source: string[]): boolean {\n return group.panels.length === source.length && group.panels.every((id, index) => id === source[index]);\n}\n\nfunction regionCarrier(input: WorkspaceRegionPlacementInput, visible: string[]) {\n const { layout, destination } = input;\n const region = findWorkspaceRegion((input.projectLayout ?? projectLayout)(layout, visible).root, destination.region!);\n if (!region) return undefined;\n const carrier = findDeepestProjectionCarrier(\n layout.root,\n getProjectionSignature(region),\n node => (input.projectLayout ?? projectLayout)({ version: 1, root: node, closed: [] }, visible).root\n );\n return carrier ? { carrier, region } : undefined;\n}\n\nfunction stripRegion(node: WorkspaceNode, removed: Set<string>): WorkspaceNode | null {\n if (node.type === 'split')\n return rebuild(\n node,\n node.children.map(child => stripRegion(child, removed))\n );\n const panels = node.panels.filter(id => !removed.has(id));\n if (!panels.length) return null;\n return { ...node, panels, active: panels.includes(node.active) ? node.active : panels[0]! };\n}\n\nfunction editRegion(\n node: WorkspaceNode,\n input: { carrier: WorkspaceNode; replacement: WorkspaceNode; removed: Set<string> }\n): WorkspaceNode | null {\n if (node === input.carrier) return input.replacement;\n if (node.type === 'group') return stripRegion(node, input.removed);\n return rebuild(\n node,\n node.children.map(child => editRegion(child, input))\n );\n}\n\nfunction regionContext(input: WorkspaceRegionPlacementInput) {\n const { layout, source, destination } = input;\n if (!layout.root || !destination.region || destination.position === 'tab' || !source.length) return undefined;\n const sourceGroup = regionSource(layout, source);\n if (!sourceGroup) return undefined;\n const visible = input.available.filter(id => !layout.closed.includes(id));\n const recipient = regionCarrier(input, visible);\n if (!recipient) return undefined;\n return {\n layout,\n source,\n sourceGroup,\n visible,\n ...recipient,\n position: destination.position,\n projectLayout: input.projectLayout ?? projectLayout,\n root: layout.root\n };\n}\n"],"mappings":";;;;;AAsBA,SAAgBA,EAAoB,GAA4B,GAAwC;CACtG,IAAMC,IAAQC,EAAI,MAAM,GAAG;CAC3B,IAAID,EAAM,MAAM,MAAM,QAAQ;CAC9B,IAAIE,IAAOC;CACX,KAAK,IAAMC,KAAQJ,GAAO;EACxB,IAAI,CAACE,KAAQA,EAAK,SAAS,WAAW,CAAC,QAAQ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C,EAAO,SAASvC,EAAK,MAAM,IAAIA,EAAK,SAASuC,EAAO;CAAI,IAD/D;AAE7B;AAEA,SAASnB,EACP,GACA,GACsB;CAGtB,OAFIpB,MAASM,EAAM,UAAgBA,EAAM,cACrCN,EAAK,SAAS,UAAgBiB,EAAYjB,GAAMM,EAAM,OAAO,IAC1DkB,EACLxB,GACAA,EAAK,SAAS,KAAI,MAASoB,EAAWO,GAAOrB,CAAK,CAAC,CACrD;AACF;AAEA,SAASD,EAAc,GAAsC;CAC3D,IAAM,EAAE,WAAQ,WAAQ,mBAAgBC;CACxC,IAAI,CAACgB,EAAO,QAAQ,CAACc,EAAY,UAAUA,EAAY,aAAa,SAAS,CAACxB,EAAO,QAAQ;CAC7F,IAAMG,IAAcc,EAAaP,GAAQV,CAAM;CAC/C,IAAI,CAACG,GAAa;CAClB,IAAMI,IAAUb,EAAM,UAAU,QAAO,MAAM,CAACgB,EAAO,OAAO,SAASU,CAAE,CAAC,GAClEQ,IAAYN,EAAc5B,GAAOa,CAAO;CAC9C,IAAKqB,GACL,OAAO;EACL;EACA;EACA;EACA;EACA,GAAGA;EACH,UAAUJ,EAAY;EACtB,eAAe9B,EAAM,iBAAiB6B;EACtC,MAAMb,EAAO;CACf;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WorkspacePlacedRegion } from '../geometry/allocation.utils.js';
|
|
2
|
+
import type { WorkspaceRequirements } from '../geometry/sizing.utils.js';
|
|
3
|
+
import type { WorkspaceLayoutProjector } from '../model/projection.utils.js';
|
|
4
|
+
import type { WorkspaceContextRectResolver } from './context.utils.js';
|
|
5
|
+
import type { WorkspacePlacementPlan } from './planner.utils.js';
|
|
6
|
+
export interface WorkspaceSplitPreference {
|
|
7
|
+
allocation: WorkspacePlacedRegion[];
|
|
8
|
+
requirements: WorkspaceRequirements;
|
|
9
|
+
contextRect?: WorkspaceContextRectResolver;
|
|
10
|
+
}
|
|
11
|
+
/** Fits placements to the final normalized branch budget, including every separator. */
|
|
12
|
+
export declare function sizePreferredSplit(input: {
|
|
13
|
+
plan: WorkspacePlacementPlan;
|
|
14
|
+
preference?: WorkspaceSplitPreference;
|
|
15
|
+
source: string[];
|
|
16
|
+
available: string[];
|
|
17
|
+
projectLayout?: WorkspaceLayoutProjector;
|
|
18
|
+
}): WorkspacePlacementPlan;
|