@nvidia-elements/core 2.23.5 → 2.23.6

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.
Files changed (209) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/accordion/accordion2.js +4 -4
  3. package/dist/alert/alert-group2.js +1 -1
  4. package/dist/alert/alert2.js +1 -1
  5. package/dist/avatar/avatar-group2.js +1 -1
  6. package/dist/avatar/avatar2.js +1 -1
  7. package/dist/badge/badge2.js +1 -1
  8. package/dist/breadcrumb/breadcrumb2.js +1 -1
  9. package/dist/bundles/index.js +7 -7
  10. package/dist/button/button2.js +1 -1
  11. package/dist/button-group/button-group2.js +1 -1
  12. package/dist/card/card2.js +4 -4
  13. package/dist/chat-message/chat-message2.js +1 -1
  14. package/dist/checkbox/checkbox-group2.js +1 -1
  15. package/dist/checkbox/checkbox2.js +1 -1
  16. package/dist/color/color2.js +1 -1
  17. package/dist/combobox/combobox2.js +1 -1
  18. package/dist/copy-button/copy-button2.js +1 -1
  19. package/dist/custom-elements.json +1000 -229
  20. package/dist/date/date2.js +1 -1
  21. package/dist/datetime/datetime2.js +1 -1
  22. package/dist/dialog/dialog-footer2.js +1 -1
  23. package/dist/dialog/dialog-header2.js +1 -1
  24. package/dist/dialog/dialog2.js +1 -1
  25. package/dist/divider/divider2.js +1 -1
  26. package/dist/dot/dot2.js +1 -1
  27. package/dist/drag-handle/drag-handle2.js +1 -1
  28. package/dist/drawer/drawer-content2.js +1 -1
  29. package/dist/drawer/drawer-footer2.js +1 -1
  30. package/dist/drawer/drawer-header2.js +1 -1
  31. package/dist/drawer/drawer2.js +1 -1
  32. package/dist/dropdown/dropdown-footer2.js +1 -1
  33. package/dist/dropdown/dropdown-header2.js +1 -1
  34. package/dist/dropdown/dropdown2.js +1 -1
  35. package/dist/dropdown-group/dropdown-group.js +1 -1
  36. package/dist/dropzone/dropzone2.js +1 -1
  37. package/dist/file/file2.js +1 -1
  38. package/dist/format-bytes/format-bytes2.js +1 -1
  39. package/dist/format-datetime/format-datetime2.js +1 -1
  40. package/dist/format-number/format-number2.js +1 -1
  41. package/dist/format-relative-time/format-relative-time2.js +1 -1
  42. package/dist/format-truncate/format-truncate2.js +1 -1
  43. package/dist/forms/control/control2.js +1 -1
  44. package/dist/forms/control-group/control-group2.js +1 -1
  45. package/dist/forms/control-message/control-message2.js +1 -1
  46. package/dist/gauge/gauge2.js +1 -1
  47. package/dist/ghost/ghost2.js +1 -1
  48. package/dist/grid/cell/cell2.js +1 -1
  49. package/dist/grid/column/column2.js +1 -1
  50. package/dist/grid/footer/footer2.js +1 -1
  51. package/dist/grid/grid2.js +1 -1
  52. package/dist/grid/header/header2.js +1 -1
  53. package/dist/grid/placeholder/placeholder2.js +1 -1
  54. package/dist/grid/row/row2.js +1 -1
  55. package/dist/icon/icon2.js +1 -1
  56. package/dist/icon-button/icon-button2.js +1 -1
  57. package/dist/iframe/iframe2.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/input/input-group2.js +1 -1
  60. package/dist/input/input2.js +1 -1
  61. package/dist/joystick/joystick2.js +1 -1
  62. package/dist/logo/logo2.js +1 -1
  63. package/dist/menu/menu-group2.js +1 -1
  64. package/dist/menu/menu-item2.js +1 -1
  65. package/dist/menu/menu2.js +1 -1
  66. package/dist/month/month2.js +1 -1
  67. package/dist/notification/notification-group2.js +1 -1
  68. package/dist/notification/notification2.js +1 -1
  69. package/dist/page/page-panel/page-panel-content2.js +1 -1
  70. package/dist/page/page-panel/page-panel-footer2.js +1 -1
  71. package/dist/page/page-panel/page-panel-header2.js +1 -1
  72. package/dist/page/page-panel/page-panel2.js +1 -1
  73. package/dist/page/page2.js +1 -1
  74. package/dist/page-header/page-header2.js +1 -1
  75. package/dist/page-loader/page-loader2.js +1 -1
  76. package/dist/pagination/pagination2.js +1 -1
  77. package/dist/panel/panel2.js +4 -4
  78. package/dist/password/password2.js +1 -1
  79. package/dist/preferences-input/preferences-input2.js +1 -1
  80. package/dist/progress-bar/progress-bar2.js +1 -1
  81. package/dist/progress-dot/progress-dot2.js +1 -1
  82. package/dist/progress-ring/progress-ring2.js +1 -1
  83. package/dist/progressive-filter-chip/progressive-filter-chip2.js +1 -1
  84. package/dist/pulse/pulse2.js +1 -1
  85. package/dist/radio/radio-group2.js +1 -1
  86. package/dist/radio/radio2.js +1 -1
  87. package/dist/range/range2.js +1 -1
  88. package/dist/resize-handle/resize-handle2.js +1 -1
  89. package/dist/search/search2.js +1 -1
  90. package/dist/select/select2.js +1 -1
  91. package/dist/skeleton/skeleton2.js +1 -1
  92. package/dist/sort-button/sort-button2.js +1 -1
  93. package/dist/sparkline/sparkline2.js +1 -1
  94. package/dist/star-rating/star-rating2.js +1 -1
  95. package/dist/steps/steps2.js +2 -2
  96. package/dist/switch/switch-group2.js +1 -1
  97. package/dist/switch/switch2.js +1 -1
  98. package/dist/tabs/tabs-group2.js +1 -1
  99. package/dist/tabs/tabs-item-group2.js +1 -1
  100. package/dist/tabs/tabs2.js +2 -2
  101. package/dist/tag/tag2.js +1 -1
  102. package/dist/textarea/textarea2.js +1 -1
  103. package/dist/time/time2.js +1 -1
  104. package/dist/toast/toast2.js +1 -1
  105. package/dist/toggletip/toggletip-footer2.js +1 -1
  106. package/dist/toggletip/toggletip-header2.js +1 -1
  107. package/dist/toggletip/toggletip2.js +1 -1
  108. package/dist/toolbar/toolbar2.js +1 -1
  109. package/dist/tooltip/tooltip2.js +1 -1
  110. package/dist/tree/tree-node2.js +1 -1
  111. package/dist/tree/tree2.js +1 -1
  112. package/dist/week/week2.js +1 -1
  113. package/dist/workspace/controllers/workspace-composition.controller.d.ts +4 -1
  114. package/dist/workspace/controllers/workspace-composition.controller.js +69 -39
  115. package/dist/workspace/controllers/workspace-composition.controller.js.map +1 -1
  116. package/dist/workspace/controllers/workspace-rearrange.controller.js +27 -27
  117. package/dist/workspace/controllers/workspace-rearrange.controller.js.map +1 -1
  118. package/dist/workspace/controllers/workspace-restoration.controller.js +2 -2
  119. package/dist/workspace/controllers/workspace-restoration.controller.js.map +1 -1
  120. package/dist/workspace/panel/panel2.js +2 -2
  121. package/dist/workspace/panel/panel2.js.map +1 -1
  122. package/dist/workspace/panel-content/panel-content2.js +1 -1
  123. package/dist/workspace/panel-footer/panel-footer2.js +1 -1
  124. package/dist/workspace/panel-header/panel-header2.js +1 -1
  125. package/dist/workspace/utils/comparison.utils.d.ts +3 -0
  126. package/dist/workspace/utils/comparison.utils.js +13 -0
  127. package/dist/workspace/utils/comparison.utils.js.map +1 -0
  128. package/dist/workspace/utils/evaluation.utils.d.ts +65 -6
  129. package/dist/workspace/utils/evaluation.utils.js +334 -99
  130. package/dist/workspace/utils/evaluation.utils.js.map +1 -1
  131. package/dist/workspace/utils/geometry/allocation.utils.js +15 -13
  132. package/dist/workspace/utils/geometry/allocation.utils.js.map +1 -1
  133. package/dist/workspace/utils/geometry/sizing.utils.d.ts +2 -0
  134. package/dist/workspace/utils/geometry/sizing.utils.js +37 -17
  135. package/dist/workspace/utils/geometry/sizing.utils.js.map +1 -1
  136. package/dist/workspace/utils/interaction/boundary.utils.d.ts +2 -2
  137. package/dist/workspace/utils/interaction/boundary.utils.js +2 -2
  138. package/dist/workspace/utils/interaction/boundary.utils.js.map +1 -1
  139. package/dist/workspace/utils/interaction/drag-preview.utils.d.ts +3 -3
  140. package/dist/workspace/utils/interaction/drag-preview.utils.js.map +1 -1
  141. package/dist/workspace/utils/interaction/insertion-offers.utils.d.ts +11 -9
  142. package/dist/workspace/utils/interaction/insertion-offers.utils.js +37 -43
  143. package/dist/workspace/utils/interaction/insertion-offers.utils.js.map +1 -1
  144. package/dist/workspace/utils/interaction/placement-decision.utils.d.ts +6 -1
  145. package/dist/workspace/utils/interaction/placement-decision.utils.js +94 -87
  146. package/dist/workspace/utils/interaction/placement-decision.utils.js.map +1 -1
  147. package/dist/workspace/utils/model/layout.utils.d.ts +2 -1
  148. package/dist/workspace/utils/model/layout.utils.js +12 -10
  149. package/dist/workspace/utils/model/layout.utils.js.map +1 -1
  150. package/dist/workspace/utils/model/membership.utils.d.ts +4 -0
  151. package/dist/workspace/utils/model/membership.utils.js +13 -4
  152. package/dist/workspace/utils/model/membership.utils.js.map +1 -1
  153. package/dist/workspace/utils/model/operations.utils.d.ts +1 -0
  154. package/dist/workspace/utils/model/operations.utils.js +51 -46
  155. package/dist/workspace/utils/model/operations.utils.js.map +1 -1
  156. package/dist/workspace/utils/model/projection.utils.d.ts +4 -2
  157. package/dist/workspace/utils/model/projection.utils.js +49 -40
  158. package/dist/workspace/utils/model/projection.utils.js.map +1 -1
  159. package/dist/workspace/utils/model/value.utils.d.ts +4 -3
  160. package/dist/workspace/utils/model/value.utils.js +15 -50
  161. package/dist/workspace/utils/model/value.utils.js.map +1 -1
  162. package/dist/workspace/utils/placement/acquisition-sizing.utils.d.ts +2 -0
  163. package/dist/workspace/utils/placement/acquisition-sizing.utils.js +30 -22
  164. package/dist/workspace/utils/placement/acquisition-sizing.utils.js.map +1 -1
  165. package/dist/workspace/utils/placement/group-insertion.utils.d.ts +19 -13
  166. package/dist/workspace/utils/placement/group-insertion.utils.js +50 -47
  167. package/dist/workspace/utils/placement/group-insertion.utils.js.map +1 -1
  168. package/dist/workspace/utils/placement/planner.utils.d.ts +13 -2
  169. package/dist/workspace/utils/placement/planner.utils.js +79 -73
  170. package/dist/workspace/utils/placement/planner.utils.js.map +1 -1
  171. package/dist/workspace/utils/placement/preparation.utils.d.ts +5 -2
  172. package/dist/workspace/utils/placement/preparation.utils.js +45 -41
  173. package/dist/workspace/utils/placement/preparation.utils.js.map +1 -1
  174. package/dist/workspace/utils/placement/region.utils.js +32 -32
  175. package/dist/workspace/utils/placement/region.utils.js.map +1 -1
  176. package/dist/workspace/utils/placement/scope.utils.d.ts +34 -0
  177. package/dist/workspace/utils/placement/scope.utils.js +155 -0
  178. package/dist/workspace/utils/placement/scope.utils.js.map +1 -0
  179. package/dist/workspace/utils/placement/session.utils.d.ts +11 -0
  180. package/dist/workspace/utils/placement/session.utils.js +78 -0
  181. package/dist/workspace/utils/placement/session.utils.js.map +1 -0
  182. package/dist/workspace/utils/placement/split-sizing.utils.d.ts +2 -2
  183. package/dist/workspace/utils/placement/split-sizing.utils.js +19 -19
  184. package/dist/workspace/utils/placement/split-sizing.utils.js.map +1 -1
  185. package/dist/workspace/utils/presentation/composition.utils.d.ts +1 -1
  186. package/dist/workspace/utils/presentation/composition.utils.js +4 -2
  187. package/dist/workspace/utils/presentation/composition.utils.js.map +1 -1
  188. package/dist/workspace/utils/presentation/groups.utils.d.ts +3 -3
  189. package/dist/workspace/utils/presentation/groups.utils.js +40 -30
  190. package/dist/workspace/utils/presentation/groups.utils.js.map +1 -1
  191. package/dist/workspace/utils/presentation/measurements.utils.d.ts +1 -0
  192. package/dist/workspace/utils/presentation/measurements.utils.js +6 -14
  193. package/dist/workspace/utils/presentation/measurements.utils.js.map +1 -1
  194. package/dist/workspace/utils/presentation/offers.utils.d.ts +1 -1
  195. package/dist/workspace/utils/presentation/offers.utils.js +3 -3
  196. package/dist/workspace/utils/presentation/offers.utils.js.map +1 -1
  197. package/dist/workspace/utils/presentation/preview.utils.d.ts +6 -0
  198. package/dist/workspace/utils/presentation/preview.utils.js +14 -3
  199. package/dist/workspace/utils/presentation/preview.utils.js.map +1 -1
  200. package/dist/workspace/workspace.examples.js.map +1 -1
  201. package/dist/workspace/workspace.examples.json +4 -4
  202. package/dist/workspace/workspace.js +1 -1
  203. package/dist/workspace/workspace.js.map +1 -1
  204. package/dist/workspace/workspace2.js +206 -212
  205. package/dist/workspace/workspace2.js.map +1 -1
  206. package/package.json +1 -1
  207. package/dist/workspace/utils/placement/context.utils.d.ts +0 -36
  208. package/dist/workspace/utils/placement/context.utils.js +0 -135
  209. package/dist/workspace/utils/placement/context.utils.js.map +0 -1
@@ -1,13 +1,39 @@
1
1
  import { getPanelIds as e } from "./model/layout.utils.js";
2
- import { createDetachedLayout as t, getFullscreenWorkspaceLayout as n, projectLayout as r } from "./model/operations.utils.js";
3
- import { clipCue as i } from "./interaction/drag-preview.utils.js";
4
- import { createPresentedGroups as a, findTabHeaderTarget as o, getTabReservationHit as s, preserveRecipientSelection as c, projectTabMembership as l } from "./presentation/groups.utils.js";
5
- import { allocateContextProxies as u, createContextRectResolver as d, getContextKey as f } from "./placement/context.utils.js";
6
- import { createWorkspaceLayoutProjector as p, findDeepestProjectionCarrier as m, getProjectionSignature as h } from "./model/projection.utils.js";
7
- import { getMinimumWorkspaceDimensions as g, getWorkspaceRequirements as _ } from "./geometry/sizing.utils.js";
8
- import { allocateWorkspace as v } from "./geometry/allocation.utils.js";
2
+ import { sameArrayItems as t, sameRect as n } from "./comparison.utils.js";
3
+ import { sameWorkspaceNode as r } from "./model/value.utils.js";
4
+ import { createDetachedLayout as i, getFullscreenWorkspaceLayout as a, projectLayout as o } from "./model/operations.utils.js";
5
+ import { clipCue as s } from "./interaction/drag-preview.utils.js";
6
+ import { getPanelMembershipKey as c } from "./model/membership.utils.js";
7
+ import { createPresentedGroups as l, findTabHeaderTarget as u, getTabReservationHit as d, preserveRecipientSelection as f, projectTabMembership as p } from "./presentation/groups.utils.js";
8
+ import { sameWorkspaceMeasurementScalars as m } from "./presentation/measurements.utils.js";
9
+ import { createWorkspaceLayoutProjector as h, findDeepestProjectionCarrier as g } from "./model/projection.utils.js";
10
+ import { createScopeRectResolver as _, getAllocatedScopes as v } from "./placement/scope.utils.js";
11
+ import { getMinimumWorkspaceDimensions as y, getWorkspaceRequirements as b, sameWorkspaceRequirements as x, snapshotWorkspaceRequirements as S } from "./geometry/sizing.utils.js";
12
+ import { allocateWorkspace as C } from "./geometry/allocation.utils.js";
9
13
  // src/workspace/utils/evaluation.utils.ts
10
- var y = class {
14
+ var w = class {
15
+ #e;
16
+ #t;
17
+ constructor(e) {
18
+ this.#e = e;
19
+ }
20
+ get current() {
21
+ return this.#t;
22
+ }
23
+ run(e, t, n) {
24
+ if (this.#t) return n(this.#t);
25
+ let r = new T(this.#e, e, t, this);
26
+ this.#t = r;
27
+ try {
28
+ return n(r);
29
+ } finally {
30
+ this.#t = void 0;
31
+ }
32
+ }
33
+ clear() {
34
+ this.geometry = void 0, this.catalog = void 0;
35
+ }
36
+ }, T = class {
11
37
  #e;
12
38
  #t;
13
39
  #n;
@@ -17,64 +43,96 @@ var y = class {
17
43
  #o;
18
44
  #s;
19
45
  #c;
20
- constructor(e, t, n) {
21
- this.projectLayout = p(), this.contextRect = d(), this.#r = /* @__PURE__ */ new WeakMap(), this.#i = /* @__PURE__ */ new Map(), this.#a = /* @__PURE__ */ new Map(), this.#o = /* @__PURE__ */ new WeakMap(), this.#e = e, this.#t = t, this.#n = n, this.panels = t.panels, this.available = t.panels.map((e) => e.id), this.requirements = _(t);
46
+ #l;
47
+ #u;
48
+ constructor(e, t, n, r) {
49
+ this.projectLayout = h(), this.resolveScopeRect = _(), this.#i = /* @__PURE__ */ new WeakMap(), this.#a = /* @__PURE__ */ new Map(), this.#o = /* @__PURE__ */ new Map(), this.#s = /* @__PURE__ */ new WeakMap(), this.#e = e, this.#t = t, this.#n = n, this.#r = r, this.panels = t.panels, this.available = t.panels.map((e) => e.id), this.requirements = b(t);
22
50
  }
23
51
  minimum(e) {
24
- let t = this.#a.get(e);
25
- return t || (t = g(e, this.requirements), this.#a.set(e, t)), t;
52
+ let t = this.#d(e);
53
+ if (t) return t;
54
+ let n = this.#o.get(e);
55
+ return n || (n = y(e, this.requirements), this.#o.set(e, n)), n;
26
56
  }
27
57
  project(e) {
58
+ if (e === this.#t.layout) {
59
+ let t = this.#v();
60
+ if (t) return t.projected ? t.projected : t.projected = this.projectLayout(e, this.available);
61
+ }
28
62
  return this.projectLayout(e, this.available);
29
63
  }
30
64
  geometry(e, t = e) {
31
- let n = this.#i.get(e.root);
32
- n || (n = /* @__PURE__ */ new Map(), this.#i.set(e.root, n));
65
+ if (t === e) {
66
+ let n = this.#v();
67
+ if (n && n.projected === e) return n.base ? n.base : n.base = E({
68
+ ...this.#t,
69
+ minimum: (e) => this.minimum(e)
70
+ }, e, t);
71
+ }
72
+ let n = this.#a.get(e.root);
73
+ n || (n = /* @__PURE__ */ new Map(), this.#a.set(e.root, n));
33
74
  let r = n.get(t.root);
34
- return r || (r = b({
75
+ return r || (r = E({
35
76
  ...this.#t,
36
77
  minimum: (e) => this.minimum(e)
37
78
  }, e, t), n.set(t.root, r)), r;
38
79
  }
39
80
  detached(e) {
40
- let n = this.#o.get(e);
41
- return n || (n = this.geometry(this.project(t(this.#t.layout, e)), this.project(this.#t.layout)), this.#o.set(e, n)), n;
81
+ let t = this.#v(e);
82
+ if (t) return t.detached ? t.detached : t.detached = this.geometry(this.project(i(this.#t.layout, e)), this.project(this.#t.layout));
83
+ let n = this.#s.get(e);
84
+ return n || (n = this.geometry(this.project(i(this.#t.layout, e)), this.project(this.#t.layout)), this.#s.set(e, n)), n;
42
85
  }
43
86
  nonOrderGeometry(e) {
44
87
  let t = this.detached(e), n = this.#n?.getCurrentPreview();
45
88
  return n?.phase !== "detached" || n.intent.kind !== "tab" || n.allocation !== "reserved" ? t : {
46
89
  ...t,
47
- groups: l(t.groups, this.geometry(this.project(n.layout)).groups)
90
+ groups: p(t.groups, this.geometry(this.project(n.layout)).groups)
48
91
  };
49
92
  }
50
93
  targetCatalog(e, t = this.nonOrderGeometry(e)) {
51
- let n = this.#l;
52
- return x({
53
- gap: this.#u.gap,
94
+ let n = this.#y, r = this.#b, i = this.#n?.getCurrentPreview(), a = {
95
+ gap: r.gap,
96
+ measurements: r,
97
+ requirements: this.requirements,
54
98
  currentLayout: n,
55
99
  catalog: this.geometry(this.project(n)).regions,
56
100
  allocation: t,
57
101
  reservation: this.presentationGeometry(),
58
- preview: this.#n?.getCurrentPreview(),
102
+ preview: i,
59
103
  source: e,
60
104
  available: this.available,
61
105
  bounds: this.bounds(),
62
106
  client: (e) => this.client(e),
63
- headerHeight: this.#u.headerHeight
64
- });
107
+ headerHeight: r.headerHeight
108
+ };
109
+ if (!this.#r || !this.#p(i)) return this.#r?.clear(), D(a);
110
+ let o = this.client({
111
+ x: 0,
112
+ y: 0,
113
+ width: 0,
114
+ height: 0
115
+ }), s = this.#r.catalog;
116
+ if (s && G(s.inputs, a, o)) return V(s.catalog, i);
117
+ this.#r.catalog = void 0;
118
+ let c = Y(D(a));
119
+ return this.#r.catalog = {
120
+ inputs: X(a, o),
121
+ catalog: c
122
+ }, V(c, i);
65
123
  }
66
124
  getPlacementCatalog(e, t) {
67
- let n = o(this.#f(e, t)), r = this.targetCatalog(e);
68
- return r.headerTarget = n, r.reservationHit = D({
69
- ...this.#f(this.#n?.getCurrentPreview()?.source ?? [], t),
125
+ let n = u(this.#S(e, t)), r = this.targetCatalog(e);
126
+ return r.headerTarget = n, r.reservationHit = P({
127
+ ...this.#S(this.#n?.getCurrentPreview()?.source ?? [], t),
70
128
  groups: this.presentationGeometry().groups
71
129
  }), r;
72
130
  }
73
131
  bounds() {
74
- return this.#c ??= A(this.#e);
132
+ return this.#u ??= L(this.#e);
75
133
  }
76
134
  client(e) {
77
- let t = this.#s ??= j(this.#e, {
135
+ let t = this.#l ??= R(this.#e, {
78
136
  x: 0,
79
137
  y: 0,
80
138
  width: 0,
@@ -90,27 +148,61 @@ var y = class {
90
148
  if (e.panels.length < 2) return 0;
91
149
  let t = this.#t.strip(e);
92
150
  if (!t) return 0;
93
- let n = this.#r.get(t);
94
- return n === void 0 && (n = t.scrollLeft, this.#r.set(t, n)), n;
151
+ let n = this.#i.get(t);
152
+ return n === void 0 && (n = t.scrollLeft, this.#i.set(t, n)), n;
95
153
  }
96
154
  presentationGeometry() {
97
- let e = n(this.project(this.#l), this.#n?.getFullscreenTarget());
98
- return e ? this.geometry(e) : this.#d();
155
+ let e = a(this.project(this.#y), this.#n?.getFullscreenTarget());
156
+ return e ? this.geometry(e) : this.#x();
157
+ }
158
+ #d(e) {
159
+ if (this.#r?.geometry?.projected?.root !== e) return;
160
+ let t = this.#v();
161
+ return t?.projected?.root === e ? (t.base ?? t.detached)?.minimum : void 0;
99
162
  }
100
- get #l() {
163
+ #f(e) {
164
+ let n = this.#n?.getCurrentPreview();
165
+ return this.#m() && n?.phase === "detached" && t(this.#t.source, n.source) && (!e || t(e, n.source));
166
+ }
167
+ #p(e) {
168
+ return this.#r?.current === this && e?.phase === "detached" && this.#e.isConnected;
169
+ }
170
+ #m() {
171
+ return this.#r?.current === this && this.#e.isConnected && this.#t.layout === this.#y && this.#t.measurements === this.#b && this.#n?.getFullscreenTarget() === void 0 && this.#n?.getResizePreview() === void 0;
172
+ }
173
+ #h() {
174
+ this.#c = void 0, this.#r && (this.#r.geometry = void 0);
175
+ }
176
+ #g() {
177
+ return this.panels.length === this.available.length && this.panels.every((e, t) => e.id === this.available[t]);
178
+ }
179
+ #_(e) {
180
+ return Z(e, this.#t, this.available) && x(e.requirements, this.requirements);
181
+ }
182
+ #v(e) {
183
+ let n = this.#r;
184
+ if (!n || !this.#f(e)) return this.#h();
185
+ let r = n.geometry;
186
+ if (r && r === this.#c && r.inputs.policy === this.#t.policy && t(r.inputs.source, this.#t.source)) return r;
187
+ if (!this.#g()) return this.#h();
188
+ if (r && this.#_(r.inputs)) return this.#c = r;
189
+ let i = { inputs: ee(this.#t, this) };
190
+ return n.geometry = i, this.#c = i;
191
+ }
192
+ get #y() {
101
193
  return this.#n?.getCurrentLayout() ?? this.#t.layout;
102
194
  }
103
- get #u() {
195
+ get #b() {
104
196
  return this.#n?.getCurrentMeasurements() ?? this.#t.measurements;
105
197
  }
106
- #d() {
198
+ #x() {
107
199
  let e = this.#n?.getCurrentPreview();
108
- return M(e) ? this.nonOrderGeometry(e.source) : e && "allocation" in e && e.allocation === "reserved" ? this.geometry(this.project(e.layout)) : N(e) ? this.detached(e.source) : this.geometry(this.project(this.#n?.getResizePreview() ?? this.#l));
200
+ return z(e) ? this.nonOrderGeometry(e.source) : e && "allocation" in e && e.allocation === "reserved" ? this.geometry(this.project(e.layout)) : B(e) ? this.detached(e.source) : this.geometry(this.project(this.#n?.getResizePreview() ?? this.#y));
109
201
  }
110
- #f(e, t) {
202
+ #S(e, t) {
111
203
  return {
112
- groups: c(this.nonOrderGeometry(e).groups, this.#l.root, e),
113
- measurements: this.#u,
204
+ groups: f(this.nonOrderGeometry(e).groups, this.#y.root, e),
205
+ measurements: this.#b,
114
206
  source: e,
115
207
  point: t,
116
208
  bounds: this.bounds(),
@@ -119,20 +211,20 @@ var y = class {
119
211
  };
120
212
  }
121
213
  };
122
- function b(e, t, n) {
123
- let r = e.minimum(n.root), i = Math.max(e.measurements.width, r.width), o = Math.max(e.measurements.height, r.height), s = v({
214
+ function E(e, t, n) {
215
+ let r = e.minimum(n.root), i = Math.max(e.measurements.width, r.width), a = Math.max(e.measurements.height, r.height), o = C({
124
216
  root: t.root,
125
217
  rect: {
126
218
  x: 0,
127
219
  y: 0,
128
220
  width: i,
129
- height: o
221
+ height: a
130
222
  },
131
223
  minimum: e.minimum,
132
224
  policy: e.policy,
133
225
  gap: e.measurements.gap
134
- }), c = a({
135
- groups: s.groups,
226
+ }), s = l({
227
+ groups: o.groups,
136
228
  panels: e.panels,
137
229
  root: e.layout.root,
138
230
  closed: e.layout.closed,
@@ -140,20 +232,20 @@ function b(e, t, n) {
140
232
  gripWidth: e.measurements.gripWidth
141
233
  });
142
234
  return {
143
- ...s,
235
+ ...o,
144
236
  width: i,
145
- height: o,
237
+ height: a,
146
238
  minimum: r,
147
- groups: c
239
+ groups: s
148
240
  };
149
241
  }
150
- function x(e) {
242
+ function D(e) {
151
243
  let { currentLayout: t, catalog: n, allocation: r, source: i, available: a, bounds: o } = e, s = {
152
244
  catalog: n,
153
245
  allocation: r.regions,
154
246
  source: i,
155
247
  bounds: o,
156
- getRemainingLayoutSignature: w({
248
+ getRemainingRootKey: j({
157
249
  currentLayout: t,
158
250
  source: i,
159
251
  available: a
@@ -161,7 +253,7 @@ function x(e) {
161
253
  }, c = n.map((t) => ({
162
254
  ...t,
163
255
  rect: e.client(t.rect)
164
- })), l = S({
256
+ })), l = O({
165
257
  ...s,
166
258
  catalog: c,
167
259
  allocation: r.regions.map((t) => ({
@@ -171,8 +263,9 @@ function x(e) {
171
263
  });
172
264
  return {
173
265
  gap: e.gap,
266
+ resolveScopeRect: _(),
174
267
  regions: l,
175
- orderingRegions: e.reservation ? S({
268
+ orderingRegions: e.reservation ? O({
176
269
  ...s,
177
270
  catalog: c,
178
271
  allocation: e.reservation.regions.map((t) => ({
@@ -180,61 +273,72 @@ function x(e) {
180
273
  rect: e.client(t.rect)
181
274
  }))
182
275
  }) : l,
183
- sourceSlot: e.reservation ? O({
276
+ sourceReservation: e.reservation ? F({
184
277
  ...e,
185
278
  groups: e.reservation.groups
186
279
  }) : void 0,
187
280
  preview: e.preview,
188
- headers: E(e),
189
- targets: T(l, i, e.headerHeight),
281
+ headers: N(e),
282
+ targets: M(l, i, e.headerHeight),
190
283
  bounds: o
191
284
  };
192
285
  }
193
- function S(e) {
194
- let t = u(e);
195
- return C(e, (e) => t.find((t) => t.key === e)?.rect);
286
+ function O(e) {
287
+ let t = v(e);
288
+ return k(e, (e) => t.find((t) => t.key === e)?.rect);
196
289
  }
197
- function C(t, n) {
198
- let { catalog: r, allocation: a, source: o, bounds: s } = t, c = a.some((t) => t.node.type === "group" && e(t.node).every((e) => o.includes(e))), l = new Set(a.filter((e) => e.node.type === "split").map((t) => f(e(t.node)))), u = /* @__PURE__ */ new Set();
199
- return [...r].reverse().flatMap((r) => {
200
- let a = e(r.node), d = a.filter((e) => !o.includes(e));
201
- if (!d.length) return [];
202
- let p = f(a), m = c && r.node.type === "split" && l.has(p) ? p : f(d), h = n(m);
203
- if (!h) return [];
204
- let g = i(h, s);
205
- if (g.width <= 0 || g.height <= 0) return [];
206
- let _ = `${m}:${t.getRemainingLayoutSignature(r.node)}`;
207
- return u.has(_) ? [] : (u.add(_), [{
208
- ...r,
290
+ function k(t, n) {
291
+ let { catalog: r, allocation: i, source: a, bounds: o } = t, l = i.some((t) => t.node.type === "group" && e(t.node).every((e) => a.includes(e))) ? new Set(i.filter((e) => e.node.type === "split").map((t) => c(e(t.node)))) : void 0, u = /* @__PURE__ */ new Set();
292
+ return [...r].reverse().flatMap((e) => {
293
+ let r = A(e, a, l);
294
+ if (!r) return [];
295
+ let i = n(r);
296
+ if (!i) return [];
297
+ let c = s(i, o);
298
+ if (c.width <= 0 || c.height <= 0) return [];
299
+ let d = `${r}:${t.getRemainingRootKey(e.node)}`;
300
+ return u.has(d) ? [] : (u.add(d), [{
301
+ ...e,
209
302
  rect: {
210
- x: h.x,
211
- y: h.y,
212
- width: h.width,
213
- height: h.height
303
+ x: i.x,
304
+ y: i.y,
305
+ width: i.width,
306
+ height: i.height
214
307
  }
215
308
  }]);
216
309
  }).reverse();
217
310
  }
218
- function w(e) {
219
- let n = e.available.filter((t) => !e.currentLayout.closed.includes(t)), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = (e) => (i.has(e) || i.set(e, r({
311
+ function A(t, n, r) {
312
+ let i = e(t.node), a = i.filter((e) => !n.includes(e));
313
+ if (a.length) {
314
+ if (a.length === i.length) return c(i);
315
+ if (r && t.node.type === "split") {
316
+ let e = c(i);
317
+ if (r.has(e)) return e;
318
+ }
319
+ return c(a);
320
+ }
321
+ }
322
+ function j(e) {
323
+ let t = e.available.filter((t) => !e.currentLayout.closed.includes(t)), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), s = [], c = (e) => (n.has(e) || n.set(e, o({
220
324
  version: 1,
221
325
  root: e,
222
326
  closed: []
223
- }, n).root), i.get(e) ?? null);
224
- return (n) => {
225
- let r = a.get(n);
226
- if (r === void 0) {
227
- let i = m(e.currentLayout.root, h(n), o), s = t({
327
+ }, t).root), n.get(e) ?? null);
328
+ return (t) => {
329
+ let n = a.get(t);
330
+ if (n === void 0) {
331
+ let o = g(e.currentLayout.root, t, c), l = i({
228
332
  version: 1,
229
- root: i ?? n,
333
+ root: o ?? t,
230
334
  closed: []
231
335
  }, e.source);
232
- r = JSON.stringify(s.root), a.set(n, r);
336
+ n = s.findIndex((e) => r(e, l.root)), n < 0 && (n = s.length, s.push(l.root)), a.set(t, n);
233
337
  }
234
- return r;
338
+ return n;
235
339
  };
236
340
  }
237
- function T(e, t, n) {
341
+ function M(e, t, n) {
238
342
  return e.flatMap((e) => e.node.type === "group" ? [{
239
343
  panels: e.node.panels.filter((e) => !t.includes(e)),
240
344
  rect: e.rect,
@@ -242,29 +346,29 @@ function T(e, t, n) {
242
346
  tabs: []
243
347
  }] : []);
244
348
  }
245
- function E(e) {
349
+ function N(e) {
246
350
  return (e.reservation?.groups ?? []).flatMap((t) => {
247
351
  if (t.panels.every((t) => e.source.includes(t.id))) return [];
248
352
  let n = e.client(t.rect);
249
- return [i({
353
+ return [s({
250
354
  ...n,
251
355
  height: Math.min(n.height, e.headerHeight)
252
356
  }, e.bounds)];
253
357
  }).filter((e) => e.width > 0 && e.height > 0);
254
358
  }
255
- function D(e) {
256
- let t = O(e);
257
- if (!t) return s(e);
258
- if (k(t, e.point)) return "group";
359
+ function P(e) {
360
+ let t = F(e);
361
+ if (!t) return d(e);
362
+ if (I(t, e.point)) return "group";
259
363
  }
260
- function O(e) {
364
+ function F(e) {
261
365
  let t = e.groups.find((t) => t.panels.length > 0 && t.panels.every((t) => e.source.includes(t.id)));
262
- return t ? i(e.client(t.rect), e.bounds) : void 0;
366
+ return t ? s(e.client(t.rect), e.bounds) : void 0;
263
367
  }
264
- function k(e, t) {
368
+ function I(e, t) {
265
369
  return e.width > 0 && e.height > 0 && t.x >= e.x && t.x < e.x + e.width && t.y >= e.y && t.y < e.y + e.height;
266
370
  }
267
- function A(e) {
371
+ function L(e) {
268
372
  let t = e.shadowRoot?.querySelector(".viewport");
269
373
  if (!(t instanceof HTMLElement)) return e.getBoundingClientRect();
270
374
  let n = t.getBoundingClientRect();
@@ -275,7 +379,7 @@ function A(e) {
275
379
  height: t.clientHeight
276
380
  };
277
381
  }
278
- function j(e, t) {
382
+ function R(e, t) {
279
383
  let n = e.shadowRoot?.querySelector(".canvas")?.getBoundingClientRect();
280
384
  return {
281
385
  ...t,
@@ -283,12 +387,143 @@ function j(e, t) {
283
387
  y: t.y + (n?.y ?? 0)
284
388
  };
285
389
  }
286
- function M(e) {
390
+ function z(e) {
287
391
  return !!e && e.phase === "detached" && e.intent.kind !== "order" && e.intent.kind !== "insert" && (e.intent.kind !== "invalid" || e.allocation !== "reserved");
288
392
  }
289
- function N(e) {
393
+ function B(e) {
290
394
  return !!e && "allocation" in e && e.allocation === "overlay" && (e.phase === "detached" || e.phase === "returning-detached");
291
395
  }
292
- export { y as WorkspaceEvaluation };
396
+ function V(e, t) {
397
+ return {
398
+ gap: e.gap,
399
+ resolveScopeRect: e.resolveScopeRect,
400
+ regions: e.regions,
401
+ orderingRegions: e.orderingRegions,
402
+ sourceReservation: e.sourceReservation,
403
+ preview: t,
404
+ headers: e.headers,
405
+ targets: e.targets,
406
+ bounds: e.bounds
407
+ };
408
+ }
409
+ function H(e) {
410
+ return {
411
+ x: e.x,
412
+ y: e.y,
413
+ width: e.width,
414
+ height: e.height
415
+ };
416
+ }
417
+ function U(e, t) {
418
+ if (e.length !== t.length) return !1;
419
+ for (let i = 0; i < e.length; i++) {
420
+ let a = e[i], o = t[i];
421
+ if (a.key !== o.key || !n(a.rect, o.rect) || !r(a.node, o.node)) return !1;
422
+ }
423
+ return !0;
424
+ }
425
+ function W(e, t) {
426
+ if (!e || !t) return e === void 0 && t === void 0;
427
+ if (e.length !== t.length) return !1;
428
+ for (let r = 0; r < e.length; r++) {
429
+ let i = e[r], a = t[r];
430
+ if (!n(i.rect, a.rect) || i.panels.length !== a.panels.length) return !1;
431
+ for (let e = 0; e < i.panels.length; e++) if (i.panels[e] !== a.panels[e].id) return !1;
432
+ }
433
+ return !0;
434
+ }
435
+ function G(e, t, n) {
436
+ return K(e, t) && q(e, t, n) && J(e, t);
437
+ }
438
+ function K(e, n) {
439
+ return e.layout === n.currentLayout && e.measurementIdentity === n.measurements && t(e.closed, n.currentLayout.closed) && t(e.source, n.source) && t(e.available, n.available);
440
+ }
441
+ function q(e, t, r) {
442
+ return m(e.measurements, t.measurements) ? n(e.bounds, t.bounds) && n(e.origin, r) && x(e.requirements, t.requirements) : !1;
443
+ }
444
+ function J(e, t) {
445
+ return !U(e.catalog, t.catalog) || !U(e.allocation, t.allocation.regions) || !!e.reservation != !!t.reservation || e.reservation && t.reservation && !U(e.reservation, t.reservation.regions) ? !1 : W(e.groups, t.reservation?.groups);
446
+ }
447
+ function Y(e) {
448
+ return {
449
+ gap: e.gap,
450
+ resolveScopeRect: e.resolveScopeRect,
451
+ regions: e.regions,
452
+ orderingRegions: e.orderingRegions,
453
+ sourceReservation: e.sourceReservation,
454
+ headers: e.headers,
455
+ targets: e.targets,
456
+ bounds: e.bounds
457
+ };
458
+ }
459
+ function X(e, t) {
460
+ let { measurements: n, requirements: r } = e, i = /* @__PURE__ */ new Map();
461
+ function a(e) {
462
+ let t = i.get(e);
463
+ return t || (t = e.type === "group" ? {
464
+ type: "group",
465
+ panels: [...e.panels],
466
+ active: e.active
467
+ } : {
468
+ type: "split",
469
+ axis: e.axis,
470
+ weights: [...e.weights],
471
+ children: e.children.map(a)
472
+ }, i.set(e, t)), t;
473
+ }
474
+ let o = (e) => e.map((e) => ({
475
+ key: e.key,
476
+ node: a(e.node),
477
+ rect: H(e.rect)
478
+ }));
479
+ return {
480
+ layout: e.currentLayout,
481
+ closed: [...e.currentLayout.closed],
482
+ source: [...e.source],
483
+ available: [...e.available],
484
+ measurementIdentity: n,
485
+ measurements: {
486
+ ...n,
487
+ panels: void 0
488
+ },
489
+ requirements: S(r),
490
+ bounds: H(e.bounds),
491
+ origin: H(t),
492
+ catalog: o(e.catalog),
493
+ allocation: o(e.allocation.regions),
494
+ reservation: e.reservation ? o(e.reservation.regions) : void 0,
495
+ groups: e.reservation?.groups.map((e) => ({
496
+ rect: H(e.rect),
497
+ panels: e.panels.map((e) => e.id)
498
+ }))
499
+ };
500
+ }
501
+ function Z(e, t, n) {
502
+ return Q(e, t) && $(e, t, n) && m(e.measurements, t.measurements);
503
+ }
504
+ function Q(e, t) {
505
+ return e.layout === t.layout && e.measurementIdentity === t.measurements && e.policy === t.policy && e.panels.length === t.panels.length;
506
+ }
507
+ function $(e, n, r) {
508
+ return t(e.closed, n.layout.closed) && t(e.source, n.source) && t(e.available, r) && e.panels.every((e, t) => e === n.panels[t] && n.panels[t].id === r[t]);
509
+ }
510
+ function ee(e, t) {
511
+ let { available: n, requirements: r } = t;
512
+ return {
513
+ layout: e.layout,
514
+ closed: [...e.layout.closed],
515
+ source: [...e.source],
516
+ available: [...n],
517
+ panels: [...e.panels],
518
+ measurementIdentity: e.measurements,
519
+ measurements: {
520
+ ...e.measurements,
521
+ panels: void 0
522
+ },
523
+ policy: e.policy,
524
+ requirements: S(r)
525
+ };
526
+ }
527
+ export { T as WorkspaceEvaluation, w as WorkspaceEvaluationCache };
293
528
 
294
529
  //# sourceMappingURL=evaluation.utils.js.map