@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,84 @@
|
|
|
1
|
+
// src/workspace/controllers/workspace-fullscreen.controller.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
#e;
|
|
4
|
+
#t;
|
|
5
|
+
#n;
|
|
6
|
+
#r;
|
|
7
|
+
#i = [];
|
|
8
|
+
#a;
|
|
9
|
+
constructor(e, t) {
|
|
10
|
+
this.#e = e, this.#t = t, e.addController(this);
|
|
11
|
+
}
|
|
12
|
+
get active() {
|
|
13
|
+
return this.#r !== void 0 && this.#c();
|
|
14
|
+
}
|
|
15
|
+
get targetPanelId() {
|
|
16
|
+
return this.active ? this.#r : void 0;
|
|
17
|
+
}
|
|
18
|
+
get canExit() {
|
|
19
|
+
return this.#r !== void 0;
|
|
20
|
+
}
|
|
21
|
+
hostConnected() {
|
|
22
|
+
this.#n = this.#e.ownerDocument, this.#n.addEventListener("fullscreenchange", this.#l);
|
|
23
|
+
}
|
|
24
|
+
hostDisconnected() {
|
|
25
|
+
this.#n?.removeEventListener("fullscreenchange", this.#l), this.#n = void 0, this.exit();
|
|
26
|
+
}
|
|
27
|
+
hostUpdate() {
|
|
28
|
+
if (!this.#r) return;
|
|
29
|
+
let e = this.#t.getGroup(this.#r);
|
|
30
|
+
if (e.length) {
|
|
31
|
+
this.#i = e;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let t = this.#i.find((e) => this.#t.getGroup(e).length);
|
|
35
|
+
t ? (this.#r = t, this.#i = this.#t.getGroup(t), this.#t.invalidateCommandAvailability()) : this.exit();
|
|
36
|
+
}
|
|
37
|
+
isSelectedGroup(e) {
|
|
38
|
+
return this.#r !== void 0 && this.#t.getGroup(e).includes(this.#r);
|
|
39
|
+
}
|
|
40
|
+
canEnter(e) {
|
|
41
|
+
return this.isSelectedGroup(e) || !this.#e.fullscreenable || !this.#t.getGroup(e).length ? !1 : this.canExit || typeof this.#e.requestFullscreen == "function" && this.#e.ownerDocument.fullscreenEnabled;
|
|
42
|
+
}
|
|
43
|
+
enter(e) {
|
|
44
|
+
let t = this.#t.getGroup(e);
|
|
45
|
+
if (!t.length) return;
|
|
46
|
+
let n = this.#r !== void 0;
|
|
47
|
+
this.#t.cancelInteractions(), this.#r = e, this.#i = t, this.#t.invalidateCommandAvailability(), n || this.#o();
|
|
48
|
+
}
|
|
49
|
+
exit() {
|
|
50
|
+
this.#a = void 0, this.#c() ? this.#s() : this.#u();
|
|
51
|
+
}
|
|
52
|
+
async #o() {
|
|
53
|
+
let e = this.#e.requestFullscreen();
|
|
54
|
+
this.#a = e;
|
|
55
|
+
try {
|
|
56
|
+
await e, this.#a === e ? this.#l() : !this.#r && this.#c() && this.exit();
|
|
57
|
+
} catch {
|
|
58
|
+
this.#a === e && this.#u();
|
|
59
|
+
} finally {
|
|
60
|
+
this.#a === e && (this.#a = void 0);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async #s() {
|
|
64
|
+
try {
|
|
65
|
+
await this.#e.ownerDocument.exitFullscreen();
|
|
66
|
+
} catch {
|
|
67
|
+
this.#l();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
#c() {
|
|
71
|
+
let e = this.#e.getRootNode();
|
|
72
|
+
return (e instanceof ShadowRoot ? e.fullscreenElement : this.#e.ownerDocument.fullscreenElement) === this.#e;
|
|
73
|
+
}
|
|
74
|
+
#l = () => {
|
|
75
|
+
this.#c() && this.#r ? (this.#t.invalidateCommandAvailability(), this.#e.requestUpdate()) : this.#c() ? this.exit() : this.#u();
|
|
76
|
+
};
|
|
77
|
+
#u() {
|
|
78
|
+
let e = this.#r !== void 0;
|
|
79
|
+
this.#a = void 0, this.#r = void 0, this.#i = [], e && this.#t.invalidateCommandAvailability(), this.#e.requestUpdate();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
export { e as WorkspaceFullscreenController };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=workspace-fullscreen.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-fullscreen.controller.js","names":["WorkspaceFullscreenController","#host","host","#delegate","delegate","#targetPanelId","#isNativeFullscreen","#listeningDocument","#sync","groupPanelIds","#groupPanelIds","fallback","id","targetPanelId","switching","#requestFullscreen","#pendingRequest","#exitFullscreen","#reset","request","root","shouldInvalidateAvailability"],"sources":["../../../src/workspace/controllers/workspace-fullscreen.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveControllerHost } from 'lit';\n\ninterface WorkspaceFullscreenHost extends HTMLElement, ReactiveControllerHost {\n readonly fullscreenable: boolean;\n}\n\ninterface WorkspaceFullscreenDelegate {\n readonly getGroup: (targetPanelId: string) => string[];\n readonly cancelInteractions: () => void;\n readonly invalidateCommandAvailability: () => void;\n}\n\n/** Projects one durable group while the browser owns fullscreen admission and lifetime. */\nexport class WorkspaceFullscreenController {\n readonly #host: WorkspaceFullscreenHost;\n readonly #delegate: WorkspaceFullscreenDelegate;\n #listeningDocument?: Document;\n #targetPanelId?: string;\n #groupPanelIds: string[] = [];\n #pendingRequest?: Promise<void>;\n\n constructor(host: WorkspaceFullscreenHost, delegate: WorkspaceFullscreenDelegate) {\n this.#host = host;\n this.#delegate = delegate;\n host.addController(this);\n }\n\n get active() {\n return this.#targetPanelId !== undefined && this.#isNativeFullscreen();\n }\n\n get targetPanelId() {\n return this.active ? this.#targetPanelId : undefined;\n }\n\n get canExit() {\n return this.#targetPanelId !== undefined;\n }\n\n hostConnected() {\n this.#listeningDocument = this.#host.ownerDocument;\n this.#listeningDocument.addEventListener('fullscreenchange', this.#sync);\n }\n\n hostDisconnected() {\n this.#listeningDocument?.removeEventListener('fullscreenchange', this.#sync);\n this.#listeningDocument = undefined;\n this.exit();\n }\n\n hostUpdate() {\n if (!this.#targetPanelId) return;\n\n const groupPanelIds = this.#delegate.getGroup(this.#targetPanelId);\n if (groupPanelIds.length) {\n this.#groupPanelIds = groupPanelIds;\n return;\n }\n\n const fallback = this.#groupPanelIds.find(id => this.#delegate.getGroup(id).length);\n if (fallback) {\n this.#targetPanelId = fallback;\n this.#groupPanelIds = this.#delegate.getGroup(fallback);\n this.#delegate.invalidateCommandAvailability();\n } else {\n this.exit();\n }\n }\n\n isSelectedGroup(targetPanelId: string) {\n return this.#targetPanelId !== undefined && this.#delegate.getGroup(targetPanelId).includes(this.#targetPanelId);\n }\n\n canEnter(targetPanelId: string) {\n if (this.isSelectedGroup(targetPanelId)) {\n return false;\n }\n if (!this.#host.fullscreenable || !this.#delegate.getGroup(targetPanelId).length) {\n return false;\n }\n return (\n this.canExit || (typeof this.#host.requestFullscreen === 'function' && this.#host.ownerDocument.fullscreenEnabled)\n );\n }\n\n enter(targetPanelId: string) {\n const groupPanelIds = this.#delegate.getGroup(targetPanelId);\n if (!groupPanelIds.length) return;\n\n const switching = this.#targetPanelId !== undefined;\n\n this.#delegate.cancelInteractions();\n this.#targetPanelId = targetPanelId;\n this.#groupPanelIds = groupPanelIds;\n this.#delegate.invalidateCommandAvailability();\n if (!switching) {\n void this.#requestFullscreen();\n }\n }\n\n exit() {\n this.#pendingRequest = undefined;\n\n if (this.#isNativeFullscreen()) {\n void this.#exitFullscreen();\n } else {\n this.#reset();\n }\n }\n\n async #requestFullscreen() {\n const request = this.#host.requestFullscreen();\n this.#pendingRequest = request;\n\n try {\n await request;\n\n if (this.#pendingRequest === request) {\n this.#sync();\n } else if (!this.#targetPanelId && this.#isNativeFullscreen()) {\n this.exit();\n }\n } catch {\n if (this.#pendingRequest === request) {\n this.#reset();\n }\n } finally {\n if (this.#pendingRequest === request) {\n this.#pendingRequest = undefined;\n }\n }\n }\n\n async #exitFullscreen() {\n try {\n await this.#host.ownerDocument.exitFullscreen();\n } catch {\n this.#sync();\n }\n }\n\n #isNativeFullscreen() {\n const root = this.#host.getRootNode();\n\n return (\n (root instanceof ShadowRoot ? root.fullscreenElement : this.#host.ownerDocument.fullscreenElement) === this.#host\n );\n }\n\n #sync = () => {\n if (this.#isNativeFullscreen() && this.#targetPanelId) {\n this.#delegate.invalidateCommandAvailability();\n this.#host.requestUpdate();\n } else if (this.#isNativeFullscreen()) {\n this.exit();\n } else {\n this.#reset();\n }\n };\n\n #reset() {\n const shouldInvalidateAvailability = this.#targetPanelId !== undefined;\n\n this.#pendingRequest = undefined;\n this.#targetPanelId = undefined;\n this.#groupPanelIds = [];\n\n if (shouldInvalidateAvailability) {\n this.#delegate.invalidateCommandAvailability();\n }\n\n this.#host.requestUpdate();\n }\n}\n"],"mappings":";AAgBA,IAAaA,IAAb,MAA2C;CACzC;CACA;CACA;CACA;CACA,KAA2B,CAAC;CAC5B;CAEA,YAAY,GAA+B,GAAuC;EAGhF,AAFA,KAAKC,KAAQC,GACb,KAAKC,KAAYC,GACjBF,EAAK,cAAc,IAAI;CACzB;CAEA,IAAI,SAAS;EACX,OAAO,KAAKG,OAAmB,KAAA,KAAa,KAAKC,GAAoB;CACvE;CAEA,IAAI,gBAAgB;EAClB,OAAO,KAAK,SAAS,KAAKD,KAAiB,KAAA;CAC7C;CAEA,IAAI,UAAU;EACZ,OAAO,KAAKA,OAAmB,KAAA;CACjC;CAEA,gBAAgB;EAEd,AADA,KAAKE,KAAqB,KAAKN,GAAM,eACrC,KAAKM,GAAmB,iBAAiB,oBAAoB,KAAKC,EAAK;CACzE;CAEA,mBAAmB;EAGjB,AAFA,KAAKD,IAAoB,oBAAoB,oBAAoB,KAAKC,EAAK,GAC3E,KAAKD,KAAqB,KAAA,GAC1B,KAAK,KAAK;CACZ;CAEA,aAAa;EACX,IAAI,CAAC,KAAKF,IAAgB;EAE1B,IAAMI,IAAgB,KAAKN,GAAU,SAAS,KAAKE,EAAc;EACjE,IAAII,EAAc,QAAQ;GACxB,KAAKC,KAAiBD;GACtB;EACF;EAEA,IAAME,IAAW,KAAKD,GAAe,MAAK,MAAM,KAAKP,GAAU,SAASS,CAAE,CAAC,CAAC,MAAM;EAClF,AAAID,KACF,KAAKN,KAAiBM,GACtB,KAAKD,KAAiB,KAAKP,GAA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eAAe;EAChD,QAAQ;GACN,KAAKO,GAAM;EACb;CACF;CAEA,KAAsB;EACpB,IAAMY,IAAO,KAAKnB,GAAM,YAAY;EAEpC,QACGmB,aAAgB,aAAaA,EAAK,oBAAoB,KAAKnB,GAAM,cAAc,uBAAuB,KAAKA;CAEhH;CAEA,WAAc;EACZ,AAAI,KAAKK,GAAoB,KAAK,KAAKD,MACrC,KAAKF,GAAU,8BAA8B,GAC7C,KAAKF,GAAM,cAAc,KAChB,KAAKK,GAAoB,IAClC,KAAK,KAAK,IAEV,KAAKY,GAAO;CAEhB;CAEA,KAAS;EACP,IAAMG,IAA+B,KAAKhB,OAAmB,KAAA;EAU7D,AARA,KAAKW,KAAkB,KAAA,GACvB,KAAKX,KAAiB,KAAA,GACtB,KAAKK,KAAiB,CAAC,GAEnBW,KACF,KAAKlB,GAAU,8BAA8B,GAG/C,KAAKF,GAAM,cAAc;CAC3B;AACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { WorkspaceMeasurementChange } from '../utils/presentation/measurements.utils.js';
|
|
3
|
+
import type { WorkspacePanel } from '../panel/panel.js';
|
|
4
|
+
interface WorkspaceMeasurementDelegate {
|
|
5
|
+
readonly getPanels: () => WorkspacePanel[];
|
|
6
|
+
readonly isPresented: (id: string) => boolean;
|
|
7
|
+
readonly isCarried: (id: string) => boolean;
|
|
8
|
+
readonly applyMeasurements: (change: WorkspaceMeasurementChange) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Measures intrinsic controls and viewport dimensions independently of allocated group geometry. */
|
|
11
|
+
export declare class WorkspaceMeasurementController {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(host: HTMLElement & ReactiveControllerHost, delegate: WorkspaceMeasurementDelegate);
|
|
14
|
+
hostConnected(): void;
|
|
15
|
+
hostDisconnected(): void;
|
|
16
|
+
hostUpdated(): void;
|
|
17
|
+
invalidate(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { sameWorkspaceMeasurements as e } from "../utils/presentation/measurements.utils.js";
|
|
2
|
+
// src/workspace/controllers/workspace-measurement.controller.ts
|
|
3
|
+
var t = {
|
|
4
|
+
suffixWidth: 0,
|
|
5
|
+
footerHeight: 0
|
|
6
|
+
}, n = class {
|
|
7
|
+
#e;
|
|
8
|
+
#t;
|
|
9
|
+
#n;
|
|
10
|
+
#r = /* @__PURE__ */ new Map();
|
|
11
|
+
#i = [];
|
|
12
|
+
#a;
|
|
13
|
+
#o;
|
|
14
|
+
#s;
|
|
15
|
+
#c;
|
|
16
|
+
#l = !0;
|
|
17
|
+
#u = !0;
|
|
18
|
+
#d;
|
|
19
|
+
constructor(e, t) {
|
|
20
|
+
this.#e = e, this.#t = t, e.addController(this);
|
|
21
|
+
}
|
|
22
|
+
hostConnected() {
|
|
23
|
+
this.invalidate(), this.#o = void 0, this.#n = new ResizeObserver((e) => {
|
|
24
|
+
let t = !1;
|
|
25
|
+
for (let n of e) t = this.#g(n) || t;
|
|
26
|
+
t && this.#v();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
hostDisconnected() {
|
|
30
|
+
this.#n?.disconnect(), this.#r.clear(), this.#i = [], this.#a = void 0, this.#s = void 0, this.#o = void 0, this.#c = void 0;
|
|
31
|
+
}
|
|
32
|
+
hostUpdated() {
|
|
33
|
+
this.#l && this.#f(), this.#v();
|
|
34
|
+
}
|
|
35
|
+
invalidate() {
|
|
36
|
+
this.#l = !0, this.#u = !0;
|
|
37
|
+
}
|
|
38
|
+
#f() {
|
|
39
|
+
let e = this.#e.shadowRoot, t = e?.querySelector(".viewport") ?? void 0;
|
|
40
|
+
if (t !== this.#a && (this.#o = void 0), this.#a = t, this.#s = e?.querySelector("[data-chrome]") ?? void 0, !this.#a || !this.#s) return;
|
|
41
|
+
let n = /* @__PURE__ */ new Map(), r = (e, t) => {
|
|
42
|
+
e && n.set(e, {
|
|
43
|
+
width: NaN,
|
|
44
|
+
height: NaN,
|
|
45
|
+
...this.#r.get(e),
|
|
46
|
+
...t
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
r(this.#a, { axis: "both" });
|
|
50
|
+
for (let e of this.#s.querySelectorAll(".gap-probe, .tab-min-probe, .tab-probe, .chrome-header, .group-actions, nve-drag-handle, nve-icon-button")) r(e, { axis: "both" });
|
|
51
|
+
this.#p(r), this.#m(n), this.#l = !1;
|
|
52
|
+
}
|
|
53
|
+
#p(e) {
|
|
54
|
+
let t = new Map(this.#i.map((e) => [e.panel, e]));
|
|
55
|
+
this.#i = this.#t.getPanels().map((e) => r(e, t.get(e)));
|
|
56
|
+
for (let t of this.#i) e(t.label, {
|
|
57
|
+
axis: "height",
|
|
58
|
+
panel: t
|
|
59
|
+
}), e(t.suffix, {
|
|
60
|
+
axis: "both",
|
|
61
|
+
panel: t
|
|
62
|
+
}), e(t.footer, {
|
|
63
|
+
axis: "height",
|
|
64
|
+
panel: t
|
|
65
|
+
}), !t.header || t.label && t.suffix || this.#h(t);
|
|
66
|
+
}
|
|
67
|
+
#m(e) {
|
|
68
|
+
this.#r.forEach((t, n) => {
|
|
69
|
+
e.has(n) || this.#n?.unobserve(n);
|
|
70
|
+
}), e.forEach((e, t) => {
|
|
71
|
+
this.#r.has(t) || this.#n?.observe(t, t === this.#a ? void 0 : { box: "border-box" });
|
|
72
|
+
}), this.#r = e;
|
|
73
|
+
}
|
|
74
|
+
async #h(e) {
|
|
75
|
+
let t = e.header;
|
|
76
|
+
await t.updateComplete, this.#e.isConnected && t.parentElement === e.panel && e.panel.parentElement === this.#e && (this.invalidate(), this.#e.requestUpdate());
|
|
77
|
+
}
|
|
78
|
+
#g(e) {
|
|
79
|
+
if (e.target === this.#a) return this.#_();
|
|
80
|
+
let t = this.#r.get(e.target);
|
|
81
|
+
if (!t) return !1;
|
|
82
|
+
let { width: n, height: r } = e.target.getBoundingClientRect(), i = t.height !== r || !Number.isFinite(t.height) || t.axis === "both" && (t.width !== n || !Number.isFinite(t.width));
|
|
83
|
+
return t.width = n, t.height = r, i ? (t.panel ? t.panel.dirty = !0 : this.#u = !0, !0) : !1;
|
|
84
|
+
}
|
|
85
|
+
#_() {
|
|
86
|
+
if (!this.#a) return !1;
|
|
87
|
+
let e = this.#a.clientWidth, t = this.#a.clientHeight;
|
|
88
|
+
return e === this.#o?.width && t === this.#o.height ? !1 : (this.#o = {
|
|
89
|
+
width: e,
|
|
90
|
+
height: t
|
|
91
|
+
}, !0);
|
|
92
|
+
}
|
|
93
|
+
#v() {
|
|
94
|
+
if (!this.#a || !this.#s) return;
|
|
95
|
+
(this.#u || !this.#c) && (this.#c = i(this.#s), this.#u = !1), this.#o || this.#_();
|
|
96
|
+
let { panels: e, headerHeight: t } = this.#y(this.#c), n = {
|
|
97
|
+
gap: this.#c.gap,
|
|
98
|
+
gripWidth: this.#c.gripWidth,
|
|
99
|
+
actionWidth: this.#c.actionWidth,
|
|
100
|
+
groupActionWidth: this.#c.groupActionWidth,
|
|
101
|
+
tabWidth: this.#c.tabWidth,
|
|
102
|
+
tabMinWidth: this.#c.tabMinWidth,
|
|
103
|
+
panels: e,
|
|
104
|
+
headerHeight: t,
|
|
105
|
+
width: this.#o.width,
|
|
106
|
+
height: this.#o.height
|
|
107
|
+
};
|
|
108
|
+
this.#x(n);
|
|
109
|
+
}
|
|
110
|
+
#y(e) {
|
|
111
|
+
let n = Object.create(null), r = e.headerHeight;
|
|
112
|
+
for (let i of this.#i) {
|
|
113
|
+
let a = this.#t.isPresented(i.panel.id), o = !a && this.#t.isCarried(i.panel.id);
|
|
114
|
+
this.#b(i, a), n[i.panel.id] = a || o ? i.measurements : t, (a || o) && (r = Math.max(r, i.labelHeight, i.suffixHeight), i.header || (r = Math.max(r, e.headerlessHeight)));
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
panels: n,
|
|
118
|
+
headerHeight: r
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
#b(e, t) {
|
|
122
|
+
let n = e.dirty || t && !e.presented;
|
|
123
|
+
if (e.presented = t, !t || !n) return;
|
|
124
|
+
let { suffixWidth: r, suffixHeight: i } = a(e.suffix), s = o(e, e.measurements.footerHeight);
|
|
125
|
+
(r !== e.measurements.suffixWidth || s !== e.measurements.footerHeight) && (e.measurements = {
|
|
126
|
+
suffixWidth: r,
|
|
127
|
+
footerHeight: s
|
|
128
|
+
}), e.suffixHeight = i, e.labelHeight = c(e.label, "height"), e.dirty = !1;
|
|
129
|
+
}
|
|
130
|
+
#x(t) {
|
|
131
|
+
let n = this.#d;
|
|
132
|
+
if (e(n, t)) return;
|
|
133
|
+
let r = t.width !== (n?.width ?? 0) || t.height !== (n?.height ?? 0) || t.gap !== (n?.gap ?? 0);
|
|
134
|
+
this.#d = t, this.#t.applyMeasurements({
|
|
135
|
+
measurements: t,
|
|
136
|
+
spaceChanged: r
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
function r(e, n) {
|
|
141
|
+
let r = n ?? {
|
|
142
|
+
panel: e,
|
|
143
|
+
header: null,
|
|
144
|
+
label: null,
|
|
145
|
+
suffix: null,
|
|
146
|
+
footer: null,
|
|
147
|
+
dirty: !0,
|
|
148
|
+
presented: !1,
|
|
149
|
+
labelHeight: 0,
|
|
150
|
+
suffixHeight: 0,
|
|
151
|
+
measurements: t
|
|
152
|
+
}, i = e.querySelector(":scope > nve-workspace-panel-header"), a = i?._getMeasurementTargets(), o = a?.label ?? null;
|
|
153
|
+
return r.label !== o && (r.labelHeight = 0), r.header = i, r.label = o, r.suffix = a?.suffix ?? null, r.footer = e.querySelector(":scope > nve-workspace-panel-footer"), r.dirty = !0, r;
|
|
154
|
+
}
|
|
155
|
+
function i(e) {
|
|
156
|
+
return {
|
|
157
|
+
gap: c(e.querySelector(".gap-probe"), "width"),
|
|
158
|
+
headerHeight: Math.max(c(e.querySelector(".tab-probe"), "height"), c(e.querySelector("nve-drag-handle"), "height"), c(e.querySelector("[part~=\"close-button\"]"), "height"), c(e.querySelector("[part~=\"fullscreen-button\"]"), "height")),
|
|
159
|
+
headerlessHeight: c(e.querySelector(".chrome-header"), "height"),
|
|
160
|
+
gripWidth: c(e.querySelector("nve-drag-handle"), "width"),
|
|
161
|
+
tabWidth: c(e.querySelector(".tab-probe"), "width"),
|
|
162
|
+
tabMinWidth: c(e.querySelector(".tab-min-probe"), "width"),
|
|
163
|
+
actionWidth: s(e),
|
|
164
|
+
groupActionWidth: c(e.querySelector(".group-actions"), "width")
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function a(e) {
|
|
168
|
+
return e ? {
|
|
169
|
+
suffixWidth: c(e, "width"),
|
|
170
|
+
suffixHeight: c(e, "height")
|
|
171
|
+
} : {
|
|
172
|
+
suffixWidth: 0,
|
|
173
|
+
suffixHeight: 0
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function o(e, t) {
|
|
177
|
+
return e.panel.getAttribute("aria-hidden") !== "false" || !e.panel.shadowRoot?.querySelector(".content:not([hidden])") ? t : c(e.footer, "height");
|
|
178
|
+
}
|
|
179
|
+
function s(e) {
|
|
180
|
+
let t = e.querySelector("[part~=\"close-button\"]"), n = t?.closest("nve-tabs-item-group");
|
|
181
|
+
return t && n ? Math.max(0, n.getBoundingClientRect().right - t.getBoundingClientRect().left) : 0;
|
|
182
|
+
}
|
|
183
|
+
function c(e, t) {
|
|
184
|
+
return e?.getBoundingClientRect()[t] ?? 0;
|
|
185
|
+
}
|
|
186
|
+
export { n as WorkspaceMeasurementController };
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=workspace-measurement.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-measurement.controller.js","names":["emptyPanelMeasurements","WorkspaceMeasurementController","#host","host","#delegate","delegate","#viewportExtent","#observer","changed","entry","entries","#updateObservation","#measure","#observed","#panels","#viewport","#probe","#intrinsic","#dirty","#discover","#probeDirty","root","viewport","observed","observe","node","options","#discoverPanels","#observeNodes","previous","item","discoverPanel","panel","#awaitHeader","header","#measureViewport","height","width","measureProbe","#measurePanels","measurements","#publish","panels","headerHeight","intrinsic","presented","carried","#measurePanel","refresh","measureSuffix","footerHeight","measureFooter","suffixWidth","suffixHeight","extent","#publishedMeasurements","sameWorkspaceMeasurements","spaceChanged","targets","label","probe","tabActionWidth","suffix","cached","button","group","element","axis"],"sources":["../../../src/workspace/controllers/workspace-measurement.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveControllerHost } from 'lit';\n\nimport { sameWorkspaceMeasurements } from '../utils/presentation/measurements.utils.js';\n\nimport type {\n WorkspaceMeasurementChange,\n WorkspaceMeasurements,\n WorkspacePanelMeasurements\n} from '../utils/presentation/measurements.utils.js';\n\nimport type { WorkspacePanelHeader } from '../panel-header/panel-header.js';\nimport type { WorkspacePanel } from '../panel/panel.js';\n\ninterface WorkspaceMeasurementDelegate {\n readonly getPanels: () => WorkspacePanel[];\n readonly isPresented: (id: string) => boolean;\n readonly isCarried: (id: string) => boolean;\n readonly applyMeasurements: (change: WorkspaceMeasurementChange) => void;\n}\n\ninterface PanelMeasurement {\n panel: WorkspacePanel;\n header: WorkspacePanelHeader | null;\n label: Element | null;\n suffix: Element | null;\n footer: Element | null;\n dirty: boolean;\n presented: boolean;\n labelHeight: number;\n suffixHeight: number;\n measurements: WorkspacePanelMeasurements;\n}\n\ninterface Observation {\n panel?: PanelMeasurement;\n axis: 'height' | 'both';\n width: number;\n height: number;\n}\n\ntype ObserveNode = (node: Element | null, options: Pick<Observation, 'axis' | 'panel'>) => void;\n\nconst emptyPanelMeasurements: WorkspacePanelMeasurements = { suffixWidth: 0, footerHeight: 0 };\n\n/** Measures intrinsic controls and viewport dimensions independently of allocated group geometry. */\nexport class WorkspaceMeasurementController {\n readonly #host: HTMLElement & ReactiveControllerHost;\n readonly #delegate: WorkspaceMeasurementDelegate;\n\n #observer?: ResizeObserver;\n #observed = new Map<Element, Observation>();\n #panels: PanelMeasurement[] = [];\n #viewport?: HTMLElement;\n #viewportExtent?: { width: number; height: number };\n #probe?: Element;\n #intrinsic?: ReturnType<typeof measureProbe>;\n #dirty = true;\n #probeDirty = true;\n #publishedMeasurements?: WorkspaceMeasurements;\n\n constructor(host: HTMLElement & ReactiveControllerHost, delegate: WorkspaceMeasurementDelegate) {\n this.#host = host;\n this.#delegate = delegate;\n host.addController(this);\n }\n\n hostConnected() {\n this.invalidate();\n this.#viewportExtent = undefined;\n this.#observer = new ResizeObserver(entries => {\n let changed = false;\n for (const entry of entries) {\n changed = this.#updateObservation(entry) || changed;\n }\n if (changed) {\n this.#measure();\n }\n });\n }\n\n hostDisconnected() {\n this.#observer?.disconnect();\n this.#observed.clear();\n this.#panels = [];\n this.#viewport = undefined;\n this.#probe = undefined;\n this.#viewportExtent = undefined;\n this.#intrinsic = undefined;\n }\n\n hostUpdated() {\n if (this.#dirty) {\n this.#discover();\n }\n this.#measure();\n }\n\n invalidate() {\n this.#dirty = true;\n this.#probeDirty = true;\n }\n\n #discover() {\n const root = this.#host.shadowRoot;\n const viewport = root?.querySelector<HTMLElement>('.viewport') ?? undefined;\n if (viewport !== this.#viewport) {\n this.#viewportExtent = undefined;\n }\n this.#viewport = viewport;\n this.#probe = root?.querySelector('[data-chrome]') ?? undefined;\n if (!this.#viewport || !this.#probe) return;\n const observed = new Map<Element, Observation>();\n const observe = (node: Element | null, options: Pick<Observation, 'axis' | 'panel'>) => {\n if (!node) return;\n observed.set(node, { width: NaN, height: NaN, ...this.#observed.get(node), ...options });\n };\n observe(this.#viewport, { axis: 'both' });\n for (const node of this.#probe.querySelectorAll(\n '.gap-probe, .tab-min-probe, .tab-probe, .chrome-header, .group-actions, nve-drag-handle, nve-icon-button'\n )) {\n observe(node, { axis: 'both' });\n }\n this.#discoverPanels(observe);\n this.#observeNodes(observed);\n this.#dirty = false;\n }\n\n #discoverPanels(observe: ObserveNode) {\n const previous = new Map(this.#panels.map(item => [item.panel, item]));\n this.#panels = this.#delegate.getPanels().map(panel => discoverPanel(panel, previous.get(panel)));\n for (const item of this.#panels) {\n observe(item.label, { axis: 'height', panel: item });\n observe(item.suffix, { axis: 'both', panel: item });\n observe(item.footer, { axis: 'height', panel: item });\n if (item.header && (!item.label || !item.suffix)) {\n void this.#awaitHeader(item);\n }\n }\n }\n\n #observeNodes(observed: Map<Element, Observation>) {\n this.#observed.forEach((_, node) => {\n if (!observed.has(node)) {\n this.#observer?.unobserve(node);\n }\n });\n observed.forEach((_, node) => {\n if (!this.#observed.has(node)) {\n this.#observer?.observe(node, node === this.#viewport ? undefined : { box: 'border-box' });\n }\n });\n this.#observed = observed;\n }\n\n async #awaitHeader(item: PanelMeasurement) {\n const header = item.header!;\n await header.updateComplete;\n\n if (!this.#host.isConnected || header.parentElement !== item.panel || item.panel.parentElement !== this.#host) {\n return;\n }\n\n this.invalidate();\n this.#host.requestUpdate();\n }\n\n #updateObservation(entry: ResizeObserverEntry) {\n if (entry.target === this.#viewport) return this.#measureViewport();\n const observed = this.#observed.get(entry.target);\n if (!observed) return false;\n const { width, height } = entry.target.getBoundingClientRect();\n const changed =\n observed.height !== height ||\n !Number.isFinite(observed.height) ||\n (observed.axis === 'both' && (observed.width !== width || !Number.isFinite(observed.width)));\n observed.width = width;\n observed.height = height;\n if (!changed) return false;\n if (observed.panel) {\n observed.panel.dirty = true;\n } else {\n this.#probeDirty = true;\n }\n return true;\n }\n\n #measureViewport() {\n if (!this.#viewport) return false;\n const width = this.#viewport.clientWidth;\n const height = this.#viewport.clientHeight;\n if (width === this.#viewportExtent?.width && height === this.#viewportExtent.height) return false;\n this.#viewportExtent = { width, height };\n return true;\n }\n\n #measure() {\n if (!this.#viewport || !this.#probe) return;\n if (this.#probeDirty || !this.#intrinsic) {\n this.#intrinsic = measureProbe(this.#probe);\n this.#probeDirty = false;\n }\n if (!this.#viewportExtent) {\n this.#measureViewport();\n }\n const { panels, headerHeight } = this.#measurePanels(this.#intrinsic);\n const measurements: WorkspaceMeasurements = {\n gap: this.#intrinsic.gap,\n gripWidth: this.#intrinsic.gripWidth,\n actionWidth: this.#intrinsic.actionWidth,\n groupActionWidth: this.#intrinsic.groupActionWidth,\n tabWidth: this.#intrinsic.tabWidth,\n tabMinWidth: this.#intrinsic.tabMinWidth,\n panels,\n headerHeight,\n width: this.#viewportExtent!.width,\n height: this.#viewportExtent!.height\n };\n this.#publish(measurements);\n }\n\n #measurePanels(intrinsic: ReturnType<typeof measureProbe>) {\n const panels = Object.create(null) as Record<string, WorkspacePanelMeasurements>;\n let headerHeight = intrinsic.headerHeight;\n for (const item of this.#panels) {\n const presented = this.#delegate.isPresented(item.panel.id);\n const carried = !presented && this.#delegate.isCarried(item.panel.id);\n this.#measurePanel(item, presented);\n panels[item.panel.id] = presented || carried ? item.measurements : emptyPanelMeasurements;\n if (!presented && !carried) continue;\n\n headerHeight = Math.max(headerHeight, item.labelHeight, item.suffixHeight);\n if (!item.header) {\n headerHeight = Math.max(headerHeight, intrinsic.headerlessHeight);\n }\n }\n return { panels, headerHeight };\n }\n\n #measurePanel(item: PanelMeasurement, presented: boolean) {\n const refresh = item.dirty || (presented && !item.presented);\n item.presented = presented;\n if (!presented || !refresh) return;\n\n const { suffixWidth, suffixHeight } = measureSuffix(item.suffix);\n const footerHeight = measureFooter(item, item.measurements.footerHeight);\n if (suffixWidth !== item.measurements.suffixWidth || footerHeight !== item.measurements.footerHeight) {\n item.measurements = { suffixWidth, footerHeight };\n }\n item.suffixHeight = suffixHeight;\n item.labelHeight = extent(item.label, 'height');\n item.dirty = false;\n }\n\n #publish(measurements: WorkspaceMeasurements) {\n const previous = this.#publishedMeasurements;\n if (sameWorkspaceMeasurements(previous, measurements)) return;\n\n const spaceChanged =\n measurements.width !== (previous?.width ?? 0) ||\n measurements.height !== (previous?.height ?? 0) ||\n measurements.gap !== (previous?.gap ?? 0);\n this.#publishedMeasurements = measurements;\n this.#delegate.applyMeasurements({ measurements, spaceChanged });\n }\n}\n\nfunction discoverPanel(panel: WorkspacePanel, previous?: PanelMeasurement): PanelMeasurement {\n const item = previous ?? {\n panel,\n header: null,\n label: null,\n suffix: null,\n footer: null,\n dirty: true,\n presented: false,\n labelHeight: 0,\n suffixHeight: 0,\n measurements: emptyPanelMeasurements\n };\n const header = panel.querySelector<WorkspacePanelHeader>(':scope > nve-workspace-panel-header');\n const targets = header?._getMeasurementTargets();\n const label = targets?.label ?? null;\n if (item.label !== label) {\n item.labelHeight = 0;\n }\n item.header = header;\n item.label = label;\n item.suffix = targets?.suffix ?? null;\n item.footer = panel.querySelector(':scope > nve-workspace-panel-footer');\n item.dirty = true;\n return item;\n}\n\nfunction measureProbe(probe: Element) {\n return {\n gap: extent(probe.querySelector('.gap-probe'), 'width'),\n headerHeight: Math.max(\n extent(probe.querySelector('.tab-probe'), 'height'),\n extent(probe.querySelector('nve-drag-handle'), 'height'),\n extent(probe.querySelector('[part~=\"close-button\"]'), 'height'),\n extent(probe.querySelector('[part~=\"fullscreen-button\"]'), 'height')\n ),\n headerlessHeight: extent(probe.querySelector('.chrome-header'), 'height'),\n gripWidth: extent(probe.querySelector('nve-drag-handle'), 'width'),\n tabWidth: extent(probe.querySelector('.tab-probe'), 'width'),\n tabMinWidth: extent(probe.querySelector('.tab-min-probe'), 'width'),\n actionWidth: tabActionWidth(probe),\n groupActionWidth: extent(probe.querySelector('.group-actions'), 'width')\n };\n}\n\nfunction measureSuffix(suffix: Element | null) {\n if (!suffix) return { suffixWidth: 0, suffixHeight: 0 };\n return { suffixWidth: extent(suffix, 'width'), suffixHeight: extent(suffix, 'height') };\n}\n\nfunction measureFooter(item: PanelMeasurement, cached: number) {\n if (item.panel.getAttribute('aria-hidden') !== 'false') return cached;\n if (!item.panel.shadowRoot?.querySelector('.content:not([hidden])')) return cached;\n return extent(item.footer, 'height');\n}\n\nfunction tabActionWidth(probe: Element) {\n const button = probe.querySelector('[part~=\"close-button\"]');\n const group = button?.closest('nve-tabs-item-group');\n return button && group ? Math.max(0, group.getBoundingClientRect().right - button.getBoundingClientRect().left) : 0;\n}\n\nfunction extent(element: Element | null, axis: 'width' | 'height') {\n return element?.getBoundingClientRect()[axis] ?? 0;\n}\n"],"mappings":";;AA6CA,IAAMA,IAAqD;CAAE,aAAa;CAAG,cAAc;AAAE,GAGhFC,IAAb,MAA4C;CAC1C;CACA;CAEA;CACA,qBAAY,IAAI,IAA0B;CAC1C,KAA8B,CAAC;CAC/B;CACA;CACA;CACA;CACA,KAAS;CACT,KAAc;CACd;CAEA,YAAY,GAA4C,GAAwC;EAG9F,AAFA,KAAKC,KAAQC,GACb,KAAKC,KAAYC,GACjBF,EAAK,cAAc,IAAI;CACzB;CAEA,gBAAgB;EAGd,AAFA,KAAK,WAAW,GAChB,KAAKG,KAAkB,KAAA,GACvB,KAAKC,KAAY,IAAI,gBAAe,MAAW;GAC7C,IAAIC,IAAU;GACd,KAAK,IAAMC,KAASC,GAClB,IAAU,KAAKC,GAAmBF,CAAK,KAAKD;GAE9C,AAAIA,KACF,KAAKI,GAAS;EAElB,CAAC;CACH;CAEA,mBAAmB;EAOjB,AANA,KAAKL,IAAW,WAAW,GAC3B,KAAKM,GAAU,MAAM,GACrB,KAAKC,KAAU,CAAC,GAChB,KAAKC,KAAY,KAAA,GACjB,KAAKC,KAAS,KAAA,GACd,KAAKV,KAAkB,KAAA,GACvB,KAAKW,KAAa,KAAA;CACpB;CAEA,cAAc;EAIZ,AAHI,KAAKC,MACP,KAAKC,GAAU,GAEjB,KAAKP,GAAS;CAChB;CAEA,aAAa;EAEX,AADA,KAAKM,KAAS,IACd,KAAKE,KAAc;CACrB;CAEA,KAAY;EACV,IAAMC,IAAO,KAAKnB,GAAM,YAClBoB,IAAWD,GAAM,cAA2B,WAAW,KAAK,KAAA;EAMlE,IALIC,MAAa,KAAKP,OACpB,KAAKT,KAAkB,KAAA,IAEzB,KAAKS,KAAYO,GACjB,KAAKN,KAASK,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M,cAAc,gBAAgB,GAAG,QAAQ;EACxE,WAAWN,EAAOM,EAAM,cAAc,iBAAiB,GAAG,OAAO;EACjE,UAAUN,EAAOM,EAAM,cAAc,YAAY,GAAG,OAAO;EAC3D,aAAaN,EAAOM,EAAM,cAAc,gBAAgB,GAAG,OAAO;EAClE,aAAaC,EAAeD,CAAK;EACjC,kBAAkBN,EAAOM,EAAM,cAAc,gBAAgB,GAAG,OAAO;CACzE;AACF;AAEA,SAASX,EAAc,GAAwB;CAE7C,OADKa,IACE;EAAE,aAAaR,EAAOQ,GAAQ,OAAO;EAAG,cAAcR,EAAOQ,GAAQ,QAAQ;CAAE,IADlE;EAAE,aAAa;EAAG,cAAc;CAAE;AAExD;AAEA,SAASX,EAAc,GAAwB,GAAgB;CAG7D,OAFIrB,EAAK,MAAM,aAAa,aAAa,MAAM,WAC3C,CAACA,EAAK,MAAM,YAAY,cAAc,wBAAwB,IAAUiC,IACrET,EAAOxB,EAAK,QAAQ,QAAQ;AACrC;AAEA,SAAS+B,EAAe,GAAgB;CACtC,IAAMG,IAASJ,EAAM,cAAc,0BAAwB,GACrDK,IAAQD,GAAQ,QAAQ,qBAAqB;CACnD,OAAOA,KAAUC,IAAQ,KAAK,IAAI,GAAGA,EAAM,sBAAsB,CAAC,CAAC,QAAQD,EAAO,sBAAsB,CAAC,CAAC,IAAI,IAAI;AACpH;AAEA,SAASV,EAAO,GAAyB,GAA0B;CACjE,OAAOY,GAAS,sBAAsB,CAAC,CAACC,MAAS;AACnD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { WorkspaceDragPreview, WorkspaceDropIntent } from '../utils/interaction/drag-preview.utils.js';
|
|
3
|
+
import type { WorkspaceLayout } from '../utils/model/layout.utils.js';
|
|
4
|
+
import type { WorkspaceMeasurementChange, WorkspaceMeasurements } from '../utils/presentation/measurements.utils.js';
|
|
5
|
+
import type { WorkspaceEvaluation } from '../utils/evaluation.utils.js';
|
|
6
|
+
export interface WorkspaceRearrangeCapabilities {
|
|
7
|
+
rearrangeable: boolean;
|
|
8
|
+
groupable: boolean;
|
|
9
|
+
}
|
|
10
|
+
type WorkspaceRearrangeHost = HTMLElement & ReactiveControllerHost & {
|
|
11
|
+
readonly rearrangeable: boolean;
|
|
12
|
+
readonly groupable: boolean;
|
|
13
|
+
readonly detachThreshold: number;
|
|
14
|
+
};
|
|
15
|
+
interface WorkspaceRearrangeDelegate {
|
|
16
|
+
readonly evaluateWithContext: <T>(work: (evaluation: WorkspaceEvaluation) => T) => T;
|
|
17
|
+
readonly isRearrangementAllowed: () => boolean;
|
|
18
|
+
readonly getLayout: () => WorkspaceLayout | undefined;
|
|
19
|
+
readonly getAvailablePanels: () => string[];
|
|
20
|
+
readonly getMeasurements: () => WorkspaceMeasurements;
|
|
21
|
+
readonly activateSource: (source: string[], group: boolean) => void;
|
|
22
|
+
readonly applyPreview: (preview: WorkspaceDragPreview | undefined) => void;
|
|
23
|
+
readonly commitPlacement: (source: string[], intent: Exclude<WorkspaceDropIntent, {
|
|
24
|
+
kind: 'invalid';
|
|
25
|
+
}>, layout?: WorkspaceLayout) => boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class WorkspaceRearrangeController {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(host: WorkspaceRearrangeHost, delegate: WorkspaceRearrangeDelegate);
|
|
30
|
+
get capabilities(): WorkspaceRearrangeCapabilities | undefined;
|
|
31
|
+
get suppressSelection(): boolean;
|
|
32
|
+
hostConnected(): void;
|
|
33
|
+
hostDisconnected(): void;
|
|
34
|
+
getPreviewHint(preview: WorkspaceDragPreview, evaluation: WorkspaceEvaluation): import("../utils/interaction/insertion-offers.utils.js").WorkspaceInsertionOffer | undefined;
|
|
35
|
+
handleMeasurementsChange(change: WorkspaceMeasurementChange): void;
|
|
36
|
+
refresh(): void;
|
|
37
|
+
cancelForUser(): void;
|
|
38
|
+
cancel(): void;
|
|
39
|
+
}
|
|
40
|
+
export {};
|