@ynput/ayon-frontend-shared 0.7.0 → 0.7.2

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 (36) hide show
  1. package/dist/DetailsPanel.es.js +765 -739
  2. package/dist/ListTable.es.js +80 -80
  3. package/dist/NewEntity.es.js +2 -2
  4. package/dist/ProjectTreeTable.es.js +1424 -1409
  5. package/dist/Views.es.js +572 -570
  6. package/dist/api.es.js +300 -298
  7. package/dist/chunks/Actions.es.js +5 -5
  8. package/dist/chunks/DetailsDialog.es.js +3 -3
  9. package/dist/chunks/EntityPath.es.js +14 -14
  10. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  11. package/dist/chunks/EntityTooltip.es.js +18 -18
  12. package/dist/chunks/Feed.es.js +2 -2
  13. package/dist/chunks/MetaWidget.es.js +2422 -2149
  14. package/dist/chunks/PlayableIcon.es.js +20 -20
  15. package/dist/chunks/ProjectContext.es.js +6 -6
  16. package/dist/chunks/RepresentationsList.es.js +1 -1
  17. package/dist/chunks/ReviewablesSelector.es.js +2 -2
  18. package/dist/chunks/Slicer.es.js +2 -2
  19. package/dist/chunks/TableExportContextInstance.es.js +1 -1
  20. package/dist/chunks/ThumbnailSimple.es.js +12 -12
  21. package/dist/chunks/Watchers.es.js +907 -855
  22. package/dist/chunks/getUris.es.js +1272 -1209
  23. package/dist/chunks/searchTerms.es.js +30 -66
  24. package/dist/chunks/useAttributeEnums.es.js +37 -37
  25. package/dist/chunks/viewUpdateHelper.es.js +10 -10
  26. package/dist/components.es.js +132 -131
  27. package/dist/context.es.js +76 -76
  28. package/dist/hooks.es.js +51 -50
  29. package/dist/types/ProjectTreeTable.d.ts +21 -1
  30. package/dist/types/Slicer.d.ts +6 -4
  31. package/dist/types/Views.d.ts +4 -0
  32. package/dist/types/api.d.ts +411 -438
  33. package/dist/types/components.d.ts +22 -0
  34. package/dist/types/context.d.ts +2 -0
  35. package/dist/types/hooks.d.ts +36 -1
  36. package/package.json +4 -4
package/dist/Views.es.js CHANGED
@@ -1,136 +1,136 @@
1
- import { jsx as L, jsxs as A, Fragment as X } from "react/jsx-runtime";
2
- import { useMemo as _, useCallback as h, useRef as se, useState as $, useEffect as R } from "react";
1
+ import { jsx as b, jsxs as A, Fragment as X } from "react/jsx-runtime";
2
+ import { useMemo as q, useCallback as p, useRef as se, useState as W, useEffect as U } from "react";
3
3
  import { createPortal as we } from "react-dom";
4
4
  import "./chunks/searchTerms.es.js";
5
- import { aT as oe, bv as ge, da as ie, b7 as fe, dA as Ve, dD as q, W as ee, cm as He, c$ as me, cI as pe, br as Y, cG as Ge } from "./chunks/getUris.es.js";
6
- import { confirmDialog as Je } from "primereact/confirmdialog";
7
- import { a as J, ah as Ke, d as he, s as ve, ai as Qe, e as H, aj as je, ak as ze, al as Xe } from "./chunks/TableExportContextInstance.es.js";
8
- import { Icon as K, Button as ye, Dialog as Ye } from "@ynput/ayon-react-components";
5
+ import { aU as oe, bw as ge, dc as ie, b8 as fe, dC as Ve, dF as H, X as ee, cn as Ke, d0 as me, cJ as pe, bs as Y, cH as Qe } from "./chunks/getUris.es.js";
6
+ import { confirmDialog as je } from "primereact/confirmdialog";
7
+ import { a as K, ah as ze, d as he, s as ve, ai as Xe, e as G, aj as Ye, ak as Ze, al as Ne } from "./chunks/TableExportContextInstance.es.js";
8
+ import { Icon as Q, Button as ye, Dialog as Te } from "@ynput/ayon-react-components";
9
9
  import "uuid";
10
- import { toast as x } from "react-toastify";
10
+ import { toast as O } from "react-toastify";
11
11
  import "@module-federation/enhanced/runtime";
12
12
  import "lodash";
13
13
  import "./chunks/ContextMenuContextInstance.es.js";
14
14
  import ke from "clsx";
15
- import { useDispatch as Ze } from "react-redux";
15
+ import { useDispatch as et } from "react-redux";
16
16
  import "react-router-dom";
17
17
  import "semver";
18
- import G from "styled-components";
18
+ import J from "styled-components";
19
19
  import { u as Ce } from "./chunks/useLoadModule.es.js";
20
20
  import { g as be, a as Le } from "./chunks/viewUpdateHelper.es.js";
21
- import { c as Yt, b as Zt, u as Nt } from "./chunks/viewUpdateHelper.es.js";
21
+ import { c as es, b as ts, u as ss } from "./chunks/viewUpdateHelper.es.js";
22
22
  import { c as Be, a as te } from "./chunks/columnConfigConverter.es.js";
23
- const At = [
23
+ const Kt = [
24
24
  "overview",
25
25
  "taskProgress",
26
26
  "versions",
27
27
  "lists",
28
28
  "reviews",
29
29
  "reports"
30
- ], ne = "_working_", Ne = "_new_view_", De = "__base__", Te = (e) => {
31
- const { viewsList: t, onEdit: o, onSelect: s, onSave: c } = e, a = (i, V = {}) => ({
32
- id: i.id,
33
- label: i.label,
30
+ ], ne = "_working_", tt = "_new_view_", De = "__base__", st = (e) => {
31
+ const { viewsList: t, onEdit: i, onSelect: s, onSave: c } = e, a = (o, V = {}) => ({
32
+ id: o.id,
33
+ label: o.label,
34
34
  isSelected: !1,
35
- highlighted: i.highlighted,
36
- onClick: () => s(i.id),
35
+ highlighted: o.highlighted,
36
+ onClick: () => s(o.id),
37
37
  ...V
38
- }), n = t.filter((i) => i.visibility === "private" && i.isOwner && !i.working).map(
39
- (i) => a(i, {
38
+ }), r = t.filter((o) => o.visibility === "private" && o.isOwner && !o.working).map(
39
+ (o) => a(o, {
40
40
  isEditable: !0,
41
41
  isSaveable: !0,
42
- onEdit: () => o(i.id),
43
- onSave: () => c(i.id)
42
+ onEdit: () => i(o.id),
43
+ onSave: () => c(o.id)
44
44
  })
45
- ), d = t.filter((i) => i.visibility === "public" && !i.working).map(
46
- (i) => a(i, {
47
- isEditable: i.isOwner,
48
- isSaveable: i.isOwner,
49
- ...i.isOwner && {
50
- onEdit: () => o(i.id),
51
- onSave: () => c(i.id)
45
+ ), w = t.filter((o) => o.visibility === "public" && !o.working).map(
46
+ (o) => a(o, {
47
+ isEditable: o.isOwner,
48
+ isSaveable: o.isOwner,
49
+ ...o.isOwner && {
50
+ onEdit: () => i(o.id),
51
+ onSave: () => c(o.id)
52
52
  }
53
53
  })
54
- ), g = t.filter((i) => i.visibility === "private" && !i.isOwner && !i.working).map(
55
- (i) => a(i, {
54
+ ), g = t.filter((o) => o.visibility === "private" && !o.isOwner && !o.working).map(
55
+ (o) => a(o, {
56
56
  isEditable: !1,
57
57
  isSaveable: !1
58
58
  })
59
59
  );
60
60
  return {
61
- myViews: n,
62
- sharedViews: d,
61
+ myViews: r,
62
+ sharedViews: w,
63
63
  allPrivateViews: g
64
64
  };
65
- }, et = ({
65
+ }, ot = ({
66
66
  viewsList: e,
67
67
  workingView: t,
68
- viewType: o,
68
+ viewType: i,
69
69
  viewAlias: s,
70
70
  projectName: c,
71
71
  currentUser: a,
72
- useWorkingView: n,
73
- editingViewId: d,
72
+ useWorkingView: r,
73
+ editingViewId: w,
74
74
  collapsed: g,
75
- setCollapsed: i,
75
+ setCollapsed: o,
76
76
  onSelect: V,
77
- onEdit: v,
78
- onSave: p,
79
- onResetWorkingView: w,
77
+ onEdit: h,
78
+ onSave: m,
79
+ onResetWorkingView: u,
80
80
  selectedId: l
81
81
  }) => {
82
- const { powerLicense: r } = J(), [u] = oe(), y = _(
83
- () => e.map((f) => ({
84
- ...f,
85
- isOwner: f.owner === a?.name,
86
- highlighted: d === f.id ? "save" : void 0
82
+ const { powerLicense: n } = K(), [d] = oe(), y = q(
83
+ () => e.map((v) => ({
84
+ ...v,
85
+ isOwner: v.owner === a?.name,
86
+ highlighted: w === v.id ? "save" : void 0
87
87
  })),
88
- [e, a, d]
89
- ), k = {
88
+ [e, a, w]
89
+ ), C = {
90
90
  id: ne,
91
- label: n ? `Personal ${s.toLowerCase()}` : `Working ${s.toLowerCase()}`,
92
- startContent: n && /* @__PURE__ */ L(K, { icon: "person" }),
91
+ label: r ? `Personal ${s.toLowerCase()}` : `Working ${s.toLowerCase()}`,
92
+ startContent: r && /* @__PURE__ */ b(Q, { icon: "person" }),
93
93
  isEditable: !1
94
- }, B = h(async () => {
95
- let f = t?.id;
94
+ }, E = p(async () => {
95
+ let v = t?.id;
96
96
  if (!t)
97
97
  try {
98
98
  console.warn(`No working ${s.toLowerCase()} found, creating a new one`);
99
- const O = be();
100
- await u({
101
- payload: O,
102
- viewType: o,
99
+ const S = be();
100
+ await d({
101
+ payload: S,
102
+ viewType: i,
103
103
  projectName: c
104
- }).unwrap(), f = O.id;
105
- } catch (O) {
106
- x.error(`Failed to create working ${s}: ${O}`);
104
+ }).unwrap(), v = S.id;
105
+ } catch (S) {
106
+ O.error(`Failed to create working ${s}: ${S}`);
107
107
  }
108
- V(f);
109
- }, [t, o, u, c, V]), F = async (f) => {
108
+ V(v);
109
+ }, [t, i, d, c, V]), L = async (v) => {
110
110
  try {
111
- await p(f), V(f);
112
- } catch (O) {
113
- x.error(O);
111
+ await m(v), V(v);
112
+ } catch (S) {
113
+ O.error(S);
114
114
  }
115
- }, [P, { isLoading: m }] = Ce({
115
+ }, [x, { isLoading: f }] = Ce({
116
116
  addon: "powerpack",
117
117
  remote: "views",
118
118
  module: "getCustomViews",
119
- fallback: Te,
119
+ fallback: st,
120
120
  // minVersion: minVersion,
121
- skip: !o || !r
122
- }), { myViews: C, sharedViews: D, allPrivateViews: b } = P({
121
+ skip: !i || !n
122
+ }), { myViews: k, sharedViews: D, allPrivateViews: B } = x({
123
123
  viewsList: y,
124
- onEdit: v,
124
+ onEdit: h,
125
125
  onSelect: V,
126
- onSave: F
127
- }), I = h(
128
- (f) => {
129
- i({ ...g, [f]: !g[f] });
126
+ onSave: L
127
+ }), I = p(
128
+ (v) => {
129
+ o({ ...g, [v]: !g[v] });
130
130
  },
131
- [g, i]
132
- ), S = _(() => [
133
- { id: "myViews", title: `My ${s.toLowerCase()}s`, items: C },
131
+ [g, o]
132
+ ), $ = q(() => [
133
+ { id: "myViews", title: `My ${s.toLowerCase()}s`, items: k },
134
134
  {
135
135
  id: "sharedViews",
136
136
  title: `Shared ${s.toLowerCase()}s`,
@@ -139,41 +139,41 @@ const At = [
139
139
  {
140
140
  id: "allPrivateViews",
141
141
  title: `All private ${s.toLowerCase()}s`,
142
- items: b
142
+ items: B
143
143
  }
144
- ], [C, D, b]), M = _(() => ({
145
- ...k,
146
- onClick: B,
144
+ ], [k, D, B]), P = q(() => ({
145
+ ...C,
146
+ onClick: E,
147
147
  // expose reset button when handler is provided
148
- isEditable: !!w,
149
- onResetView: w
150
- }), [B, w]);
151
- return _(() => {
152
- const f = [M], O = S.filter((U) => r && (U.items?.length || 0) > 0);
153
- return O.length > 0 && f.push(Ke), O.forEach((U) => {
154
- const Q = !!g[U.id];
155
- if (f.push({
148
+ isEditable: !!u,
149
+ onResetView: u
150
+ }), [E, u]);
151
+ return q(() => {
152
+ const v = [P], S = $.filter((R) => n && (R.items?.length || 0) > 0);
153
+ return S.length > 0 && v.push(ze), S.forEach((R) => {
154
+ const F = !!g[R.id];
155
+ if (v.push({
156
156
  type: "section",
157
- id: U.id,
158
- title: U.title,
159
- collapsed: Q,
160
- onToggle: () => I(U.id)
161
- }), !Q)
162
- f.push(...U.items);
157
+ id: R.id,
158
+ title: R.title,
159
+ collapsed: F,
160
+ onToggle: () => I(R.id)
161
+ }), !F)
162
+ v.push(...R.items);
163
163
  else if (l) {
164
- const j = U.items.find((Z) => Z.id === l);
165
- j && f.push(j);
164
+ const j = R.items.find((Z) => Z.id === l);
165
+ j && v.push(j);
166
166
  }
167
- }), f;
168
- }, [M, S, g, I, l, r]);
169
- }, tt = ({ viewType: e, projectName: t }) => {
170
- const { currentData: o, isLoading: s } = ge(
167
+ }), v;
168
+ }, [P, $, g, I, l, n]);
169
+ }, it = ({ viewType: e, projectName: t }) => {
170
+ const { currentData: i, isLoading: s } = ge(
171
171
  { viewType: e, projectName: t },
172
172
  { skip: !e }
173
- ), [c] = ie(), a = se({}), n = a.current[e];
174
- return [o, async (g) => {
173
+ ), [c] = ie(), a = se({}), r = a.current[e];
174
+ return [i, async (g) => {
175
175
  if (!e) throw "No view type provided for setting default view";
176
- o?.id && o.id !== g && (a.current[e] = o.id);
176
+ i?.id && i.id !== g && (a.current[e] = i.id);
177
177
  try {
178
178
  await c({
179
179
  setDefaultViewRequestModel: {
@@ -182,101 +182,101 @@ const At = [
182
182
  viewType: e,
183
183
  projectName: t
184
184
  }).unwrap();
185
- } catch (i) {
186
- x.warn(`Failed to set default view: ${i}`);
185
+ } catch (o) {
186
+ O.warn(`Failed to set default view: ${o}`);
187
187
  }
188
- }, n, s];
189
- }, st = ({
188
+ }, r, s];
189
+ }, nt = ({
190
190
  viewType: e,
191
191
  projectName: t,
192
- viewsList: o,
192
+ viewsList: i,
193
193
  onCreate: s,
194
194
  onDelete: c,
195
195
  onUpdate: a
196
196
  }) => {
197
- const n = Ze(), [d] = oe(), [g] = fe(), [i] = Ve(), [V] = ie(), v = h(
198
- async (r, u) => {
197
+ const r = et(), [w] = oe(), [g] = fe(), [o] = Ve(), [V] = ie(), h = p(
198
+ async (n, d) => {
199
199
  if (!e)
200
200
  throw new Error("viewType are required for creating a view");
201
201
  try {
202
- await d({
202
+ await w({
203
203
  viewType: e,
204
- projectName: u ? void 0 : t,
205
- payload: r
206
- }).unwrap(), s && s(r);
204
+ projectName: d ? void 0 : t,
205
+ payload: n
206
+ }).unwrap(), s && s(n);
207
207
  } catch (y) {
208
208
  throw y;
209
209
  }
210
210
  },
211
- [d, e, t, s]
212
- ), p = h(
213
- async (r, u, y) => {
211
+ [w, e, t, s]
212
+ ), m = p(
213
+ async (n, d, y) => {
214
214
  if (!e)
215
215
  throw new Error("viewType are required for updating a view");
216
216
  try {
217
- await i({
218
- viewId: r,
217
+ await o({
218
+ viewId: n,
219
219
  viewType: e,
220
220
  projectName: y ? void 0 : t,
221
- payload: u
222
- }).unwrap(), a && a({ ...u, id: r });
223
- } catch (k) {
224
- throw k;
221
+ payload: d
222
+ }).unwrap(), a && a({ ...d, id: n });
223
+ } catch (C) {
224
+ throw C;
225
225
  }
226
226
  },
227
- [i, e, t, a]
228
- ), w = h(
229
- async (r, u) => {
227
+ [o, e, t, a]
228
+ ), u = p(
229
+ async (n, d) => {
230
230
  if (!e)
231
231
  throw new Error("viewType are required for deleting a view");
232
232
  try {
233
233
  await g({
234
234
  viewType: e,
235
- projectName: u ? void 0 : t,
236
- viewId: r
237
- }).unwrap(), c && c(r);
235
+ projectName: d ? void 0 : t,
236
+ viewId: n
237
+ }).unwrap(), c && c(n);
238
238
  } catch (y) {
239
239
  throw y;
240
240
  }
241
241
  },
242
242
  [g, e, t, c]
243
- ), l = h(
244
- async (r) => {
245
- const { existingWorkingViewId: u, selectedViewId: y, setSelectedView: k, setSettingsChanged: B, notify: F } = r || {};
243
+ ), l = p(
244
+ async (n) => {
245
+ const { existingWorkingViewId: d, selectedViewId: y, setSelectedView: C, setSettingsChanged: E, notify: L } = n || {};
246
246
  if (!e)
247
247
  throw new Error("viewType are required for resetting a view");
248
248
  try {
249
- n(
250
- q.util.invalidateTags([
249
+ r(
250
+ H.util.invalidateTags([
251
251
  { type: "Views", id: `base-${e}-${t}` },
252
252
  { type: "Views", id: `base-${e}` }
253
253
  ])
254
254
  );
255
- const C = (await n(
256
- q.endpoints.getBaseView.initiate(
255
+ const k = (await r(
256
+ H.endpoints.getBaseView.initiate(
257
257
  { viewType: e, projectName: t },
258
258
  { subscribe: !1, forceRefetch: !0 }
259
259
  )
260
260
  )).data;
261
- let D = {}, b = "default";
262
- if (C && C.settings && Object.keys(C.settings).length > 0)
263
- D = C.settings, b = "project";
261
+ let D = {}, B = "default";
262
+ if (k && k.settings && Object.keys(k.settings).length > 0)
263
+ D = k.settings, B = "project";
264
264
  else {
265
- const f = (await n(
266
- q.endpoints.getBaseView.initiate(
265
+ const v = (await r(
266
+ H.endpoints.getBaseView.initiate(
267
267
  { viewType: e },
268
268
  { subscribe: !1, forceRefetch: !0 }
269
269
  )
270
270
  )).data;
271
- f && f.settings && Object.keys(f.settings).length > 0 && (D = f.settings, b = "studio");
271
+ v && v.settings && Object.keys(v.settings).length > 0 && (D = v.settings, B = "studio");
272
272
  }
273
- const I = u ?? be().id;
274
- if (u ? await i({
275
- viewId: u,
273
+ const I = d ?? be().id;
274
+ if (d ? await o({
275
+ viewId: d,
276
276
  viewType: e,
277
277
  projectName: t,
278
278
  payload: { settings: D }
279
- }).unwrap() : await d({
279
+ }).unwrap() : await w({
280
280
  viewType: e,
281
281
  projectName: t,
282
282
  payload: {
@@ -289,337 +289,339 @@ const At = [
289
289
  viewType: e,
290
290
  projectName: t,
291
291
  setDefaultViewRequestModel: { viewId: I }
292
- }).unwrap(), k && k(I), B && B(!1), F) {
293
- const M = b === "project" ? "View reset to project default view" : b === "studio" ? "View reset to studio default view" : "View reset to default settings";
294
- x.success(M);
292
+ }).unwrap(), C && C(I), E && E(!1), L) {
293
+ const P = B === "project" ? "View reset to project default view" : B === "studio" ? "View reset to studio default view" : "View reset to default settings";
294
+ O.success(P);
295
295
  }
296
296
  return I;
297
- } catch (P) {
298
- throw F && x.error("Failed to reset view to default"), P;
297
+ } catch (x) {
298
+ throw L && O.error("Failed to reset view to default"), x;
299
299
  }
300
300
  },
301
- [d, i, V, e, t, n]
301
+ [w, o, V, e, t, r]
302
302
  );
303
303
  return {
304
- onCreateView: v,
305
- onUpdateView: p,
306
- onDeleteView: w,
304
+ onCreateView: h,
305
+ onUpdateView: m,
306
+ onDeleteView: u,
307
307
  onResetWorkingView: l
308
308
  };
309
- }, ot = ({
309
+ }, rt = ({
310
310
  viewType: e,
311
311
  projectName: t,
312
- viewSettings: o,
312
+ viewSettings: i,
313
313
  workingView: s,
314
314
  dispatch: c
315
315
  }) => {
316
- const [a] = oe(), [n] = Ve(), [d] = fe(), [g] = ie(), i = h(
317
- async (w) => {
316
+ const [a] = oe(), [r] = Ve(), [w] = fe(), [g] = ie(), o = p(
317
+ async (u) => {
318
318
  try {
319
- const u = await a({
319
+ const d = await a({
320
320
  payload: {
321
321
  label: De,
322
322
  working: !1,
323
- settings: o || {}
323
+ settings: i || {}
324
324
  },
325
325
  viewType: e,
326
- projectName: w ? void 0 : t
326
+ projectName: u ? void 0 : t
327
327
  }).unwrap();
328
328
  c(
329
- q.util.invalidateTags([
330
- { type: "view", id: u.id },
331
- ee(e, w ? void 0 : t)
329
+ H.util.invalidateTags([
330
+ { type: "view", id: d.id },
331
+ ee(e, u ? void 0 : t)
332
332
  ])
333
333
  );
334
- const y = w ? "Studio" : "Project";
335
- x.success(`${y} default view created successfully`);
334
+ const y = u ? "Studio" : "Project";
335
+ O.success(`${y} default view created successfully`);
336
336
  } catch (l) {
337
- const r = w ? "studio" : "project";
338
- x.error(`Failed to create ${r} base view: ${l?.message || l}`);
337
+ const n = u ? "studio" : "project";
338
+ O.error(`Failed to create ${n} base view: ${l?.message || l}`);
339
339
  }
340
340
  },
341
- [a, e, t, o, c]
342
- ), V = h(
343
- async (w, l) => {
341
+ [a, e, t, i, c]
342
+ ), V = p(
343
+ async (u, l) => {
344
344
  try {
345
- await n({
346
- viewId: w,
345
+ await r({
346
+ viewId: u,
347
347
  viewType: e,
348
348
  projectName: l ? void 0 : t,
349
- payload: { settings: o || {} }
349
+ payload: { settings: i || {} }
350
350
  }).unwrap(), c(
351
- q.util.invalidateTags([
352
- { type: "view", id: w },
351
+ H.util.invalidateTags([
352
+ { type: "view", id: u },
353
353
  ee(e, l ? void 0 : t)
354
354
  ])
355
355
  );
356
- const u = l ? "Studio" : "Project";
357
- x.success(`${u} default view updated successfully`);
358
- } catch (r) {
359
- const u = l ? "studio" : "project";
360
- x.error(`Failed to update ${u} base view: ${r?.message || r}`);
356
+ const d = l ? "Studio" : "Project";
357
+ O.success(`${d} default view updated successfully`);
358
+ } catch (n) {
359
+ const d = l ? "studio" : "project";
360
+ O.error(`Failed to update ${d} base view: ${n?.message || n}`);
361
361
  }
362
362
  },
363
- [n, e, t, o, c]
364
- ), v = h(
365
- async (w, l) => {
363
+ [r, e, t, i, c]
364
+ ), h = p(
365
+ async (u, l) => {
366
366
  try {
367
- await d({
368
- viewId: w,
367
+ await w({
368
+ viewId: u,
369
369
  viewType: e,
370
370
  projectName: l ? void 0 : t
371
371
  }).unwrap(), c(
372
- q.util.invalidateTags([
373
- { type: "view", id: w },
372
+ H.util.invalidateTags([
373
+ { type: "view", id: u },
374
374
  ee(e, l ? void 0 : t)
375
375
  ])
376
376
  );
377
- const r = l ? "Studio" : "Project";
378
- x.success(`${r} default view removed successfully`);
379
- } catch (r) {
380
- const u = l ? "studio" : "project";
381
- x.error(`Failed to remove ${u} base view: ${r?.message || r}`);
377
+ const n = l ? "Studio" : "Project";
378
+ O.success(`${n} default view removed successfully`);
379
+ } catch (n) {
380
+ const d = l ? "studio" : "project";
381
+ O.error(`Failed to remove ${d} base view: ${n?.message || n}`);
382
382
  }
383
383
  },
384
- [d, e, t, c]
385
- ), p = h(
386
- async (w) => {
384
+ [w, e, t, c]
385
+ ), m = p(
386
+ async (u) => {
387
387
  try {
388
388
  if (!s?.id)
389
389
  throw new Error("No working view available to update");
390
- const u = (await c(
391
- q.endpoints.getBaseView.initiate(
390
+ const d = (await c(
391
+ H.endpoints.getBaseView.initiate(
392
392
  {
393
393
  viewType: e,
394
- projectName: w ? void 0 : t
394
+ projectName: u ? void 0 : t
395
395
  },
396
396
  { subscribe: !1, forceRefetch: !0 }
397
397
  )
398
398
  )).data;
399
- if (!u || !u.settings)
399
+ if (!d || !d.settings)
400
400
  throw new Error("Base view not found or has no settings");
401
- await n({
401
+ await r({
402
402
  viewId: s.id,
403
403
  viewType: e,
404
404
  projectName: t,
405
- payload: { settings: u.settings }
405
+ payload: { settings: d.settings }
406
406
  }).unwrap(), await g({
407
407
  viewType: e,
408
408
  projectName: t,
409
409
  setDefaultViewRequestModel: { viewId: s.id }
410
410
  }).unwrap();
411
- const y = w ? "Studio" : "Project";
412
- x.success(`Loaded ${y} default view to working view`);
411
+ const y = u ? "Studio" : "Project";
412
+ O.success(`Loaded ${y} default view to working view`);
413
413
  } catch (l) {
414
- const r = w ? "studio" : "project";
415
- x.error(`Failed to load ${r} base view: ${l?.message || l}`);
414
+ const n = u ? "studio" : "project";
415
+ O.error(`Failed to load ${n} base view: ${l?.message || l}`);
416
416
  }
417
417
  },
418
- [s, n, g, e, t, c]
418
+ [s, r, g, e, t, c]
419
419
  );
420
420
  return {
421
- onCreateBaseView: i,
421
+ onCreateBaseView: o,
422
422
  onUpdateBaseView: V,
423
- onDeleteBaseView: v,
424
- onLoadBaseView: p
423
+ onDeleteBaseView: h,
424
+ onLoadBaseView: m
425
425
  };
426
- }, Ie = (e, t) => e ? t.find((s) => s.id === e)?.scope === "studio" : !0, it = ({
426
+ }, Ee = (e, t) => e ? t.find((s) => s.id === e)?.scope === "studio" : !0, at = ({
427
427
  viewType: e,
428
428
  projectName: t,
429
- viewsList: o,
429
+ viewsList: i,
430
430
  sourceSettings: s,
431
431
  onUpdateView: c
432
- }) => ({ onSaveViewFromCurrent: h(
433
- async (n) => {
432
+ }) => ({ onSaveViewFromCurrent: p(
433
+ async (r) => {
434
434
  if (!e)
435
435
  throw "viewType are required for saving a view from another view";
436
436
  if (!s)
437
437
  throw "sourceView is required for saving a view from another view";
438
438
  try {
439
439
  await c(
440
- n,
440
+ r,
441
441
  {
442
442
  settings: s
443
443
  },
444
- Ie(n, o)
445
- ), x.success("View settings saved");
446
- } catch (d) {
447
- const g = typeof d == "string" ? "Failed to save view settings: " + d : "Failed to save view settings";
444
+ Ee(r, i)
445
+ ), O.success("View settings saved");
446
+ } catch (w) {
447
+ const g = typeof w == "string" ? "Failed to save view settings: " + w : "Failed to save view settings";
448
448
  throw console.error(g), g;
449
449
  }
450
450
  },
451
451
  [e, t, s]
452
- ) }), nt = ({
452
+ ) }), ct = ({
453
453
  viewType: e
454
454
  }) => {
455
- const [t, o] = $({}), s = h(
455
+ const [t, i] = W({}), s = p(
456
456
  (a) => {
457
- e && o((n) => ({ ...n, [e]: a }));
457
+ e && i((r) => ({ ...r, [e]: a }));
458
458
  },
459
- [e, o]
459
+ [e, i]
460
460
  );
461
461
  return [e ? t[e] : !1, s];
462
- }, rt = "view", Ht = ({
462
+ }, lt = "view", dt = [], Qt = ({
463
463
  children: e,
464
464
  viewType: t,
465
- viewAlias: o = rt,
465
+ viewAlias: i = lt,
466
466
  projectName: s,
467
467
  dispatch: c,
468
- debug: a
468
+ include: a,
469
+ debug: r
469
470
  }) => {
470
- let { powerLicense: n } = J();
471
- a?.powerLicense !== void 0 && (console.warn("Using debug power license:", a.powerLicense), n = a.powerLicense);
472
- const { user: d } = he(), [g, i] = $(!1), [V, v] = $(null), p = "viewsMenuCollapsed", [w, l] = ve(
473
- p,
471
+ const w = a?.viewsList ?? !0, g = a?.baseViews ?? !0;
472
+ let { powerLicense: o } = K();
473
+ r?.powerLicense !== void 0 && (console.warn("Using debug power license:", r.powerLicense), o = r.powerLicense);
474
+ const { user: V } = he(), [h, m] = W(!1), [u, l] = W(null), n = "viewsMenuCollapsed", [d, y] = ve(
475
+ n,
474
476
  {}
475
- ), r = (E) => {
476
- const z = E.visibility === "private" ? "myViews" : "sharedViews";
477
- if (w[z]) {
478
- const de = { ...w };
479
- de[z] = !1, l(de);
477
+ ), C = (M) => {
478
+ const z = M.visibility === "private" ? "myViews" : "sharedViews";
479
+ if (d[z]) {
480
+ const de = { ...d };
481
+ de[z] = !1, y(de);
480
482
  }
481
- }, { data: u } = He(
483
+ }, { data: E } = Ke(
482
484
  { projectName: s },
483
- { skip: !n || !V }
484
- ), [y, k, B, F] = tt({
485
+ { skip: !o || !u }
486
+ ), [L, x, f, k] = it({
485
487
  viewType: t,
486
488
  projectName: s
487
- }), [P, m] = nt({
489
+ }), [D, B] = ct({
488
490
  viewType: t
489
- }), { currentData: C = [], isLoading: D } = me(
491
+ }), { currentData: I = dt, isLoading: $ } = me(
490
492
  { projectName: s, viewType: t },
491
- { skip: !t }
492
- ), b = _(
493
- () => C.filter(
494
- (E) => E.label !== De && !(s && E.working && E.scope === "studio")
493
+ { skip: !t || !w }
494
+ ), P = q(
495
+ () => I.filter(
496
+ (M) => M.label !== De && !(s && M.working && M.scope === "studio")
495
497
  ),
496
- [C]
497
- ), { onCreateView: I, onDeleteView: S, onUpdateView: M, onResetWorkingView: W } = st({
498
+ [I]
499
+ ), { onCreateView: _, onDeleteView: v, onUpdateView: S, onResetWorkingView: R } = nt({
498
500
  viewType: t,
499
501
  projectName: s,
500
- viewsList: b,
501
- onCreate: r
502
+ viewsList: P,
503
+ onCreate: C
502
504
  }), {
503
- currentData: f,
504
- isLoading: O,
505
- isError: U
505
+ currentData: F,
506
+ isLoading: j,
507
+ isError: Z
506
508
  } = pe(
507
509
  { projectName: s, viewType: t },
508
510
  { skip: !t }
509
- ), { currentData: Q, isLoading: j } = Y(
511
+ ), { currentData: Fe, isLoading: Me } = Y(
510
512
  { projectName: s, viewType: t },
511
- { skip: !t }
512
- ), { currentData: Z, isLoading: Fe } = Y(
513
+ { skip: !t || !g }
514
+ ), { currentData: Pe, isLoading: Se } = Y(
513
515
  { projectName: void 0, viewType: t },
514
- { skip: !t }
515
- ), Me = D || F || O || j || Fe, re = f?.settings, N = y?.id === ne ? re : y?.settings, ae = y?.id === f?.id, ce = P && ae && B && B !== f?.id ? B : void 0, { currentData: T, isFetching: Pe } = Ge(
516
+ { skip: !t || !g }
517
+ ), Oe = $ || k || j || Me || Se, re = F?.settings, N = L?.id === ne ? re : L?.settings, ae = L?.id === F?.id, ce = D && ae && f && f !== F?.id ? f : void 0, { currentData: T, isFetching: $e } = Qe(
516
518
  {
517
- viewId: V,
518
- projectName: Ie(V, b) ? void 0 : s,
519
+ viewId: u,
520
+ projectName: Ee(u, P) ? void 0 : s,
519
521
  viewType: t
520
522
  },
521
- { skip: typeof V != "string" || !n }
522
- ), Se = _(
523
- () => V === T?.id ? T : void 0,
524
- [V, T]
525
- ), { onSaveViewFromCurrent: Oe } = it({
523
+ { skip: typeof u != "string" || !o }
524
+ ), Re = q(
525
+ () => u === T?.id ? T : void 0,
526
+ [u, T]
527
+ ), { onSaveViewFromCurrent: We } = at({
526
528
  viewType: t,
527
529
  projectName: s,
528
- viewsList: b,
530
+ viewsList: P,
529
531
  sourceSettings: N,
530
- onUpdateView: M
531
- }), { onCreateBaseView: $e, onUpdateBaseView: Re, onDeleteBaseView: We, onLoadBaseView: Ue } = ot({
532
+ onUpdateView: S
533
+ }), { onCreateBaseView: Ue, onUpdateBaseView: _e, onDeleteBaseView: qe, onLoadBaseView: He } = rt({
532
534
  viewType: t,
533
535
  projectName: s,
534
536
  viewSettings: N,
535
- workingView: f,
537
+ workingView: F,
536
538
  dispatch: c
537
- }), _e = h(
538
- async (E, { selectView: z } = {}) => {
539
- if (!f?.id) {
539
+ }), Ae = p(
540
+ async (M, { selectView: z } = {}) => {
541
+ if (!F?.id) {
540
542
  console.error("No working view to update");
541
543
  return;
542
544
  }
543
- await M(f.id, E, !s), z && k(f.id);
545
+ await S(F.id, M, !s), z && x(F.id);
544
546
  },
545
- [M, f]
546
- ), le = h(async () => {
547
+ [S, F]
548
+ ), le = p(async () => {
547
549
  try {
548
- await W({
549
- existingWorkingViewId: f?.id,
550
- selectedViewId: y?.id,
551
- setSelectedView: k,
552
- setSettingsChanged: m,
550
+ await R({
551
+ existingWorkingViewId: F?.id,
552
+ selectedViewId: L?.id,
553
+ setSelectedView: x,
554
+ setSettingsChanged: B,
553
555
  notify: !0
554
556
  });
555
- } catch (E) {
556
- console.error("Failed to reset view:", E);
557
+ } catch (M) {
558
+ console.error("Failed to reset view:", M);
557
559
  }
558
- }, [f, W, y, k, m]), qe = et({
559
- viewsList: b,
560
- workingView: f,
560
+ }, [F, R, L, x, B]), Ge = ot({
561
+ viewsList: P,
562
+ workingView: F,
561
563
  viewType: t,
562
- viewAlias: o,
564
+ viewAlias: i,
563
565
  projectName: s,
564
- currentUser: d,
565
- useWorkingView: !n,
566
+ currentUser: V,
567
+ useWorkingView: !o,
566
568
  editingViewId: ce,
567
- selectedId: y?.id,
568
- collapsed: w,
569
- setCollapsed: l,
569
+ selectedId: L?.id,
570
+ collapsed: d,
571
+ setCollapsed: y,
570
572
  onResetWorkingView: le,
571
- onSelect: (E) => {
572
- k(E), m(!1), i(!1);
573
+ onSelect: (M) => {
574
+ x(M), B(!1), m(!1);
573
575
  },
574
- onEdit: (E) => v(E),
575
- onSave: async (E) => Oe(E)
576
- }), Ae = {
576
+ onEdit: (M) => l(M),
577
+ onSave: async (M) => We(M)
578
+ }), Je = {
577
579
  viewType: t,
578
- viewAlias: o,
580
+ viewAlias: i,
579
581
  projectName: s,
580
- isMenuOpen: g,
581
- editingView: V,
582
- currentUser: d,
583
- selectedView: y,
582
+ isMenuOpen: h,
583
+ editingView: u,
584
+ currentUser: V,
585
+ selectedView: L,
584
586
  viewSettings: N,
585
- editingViewData: Se,
586
- isLoadingEditingViewData: Pe,
587
- viewsList: b,
587
+ editingViewData: Re,
588
+ isLoadingEditingViewData: $e,
589
+ viewsList: P,
588
590
  // Working view
589
591
  workingSettings: re,
590
- workingView: f,
592
+ workingView: F,
591
593
  isViewWorking: ae,
592
- onUpdateWorkingView: _e,
594
+ onUpdateWorkingView: Ae,
593
595
  // base views
594
- projectBaseView: Q,
595
- studioBaseView: Z,
596
+ projectBaseView: Fe,
597
+ studioBaseView: Pe,
596
598
  // base view mutations
597
- onCreateBaseView: $e,
598
- onUpdateBaseView: Re,
599
- onDeleteBaseView: We,
600
- onLoadBaseView: Ue,
599
+ onCreateBaseView: Ue,
600
+ onUpdateBaseView: _e,
601
+ onDeleteBaseView: qe,
602
+ onLoadBaseView: He,
601
603
  editingViewId: ce,
602
- viewMenuItems: qe,
603
- isLoadingViews: Me,
604
- isErrorWorkingView: U,
604
+ viewMenuItems: Ge,
605
+ isLoadingViews: Oe,
606
+ isErrorWorkingView: Z,
605
607
  // data
606
- shareOptions: u,
607
- setIsMenuOpen: i,
608
- setEditingView: v,
609
- setSelectedView: k,
610
- onSettingsChanged: m,
608
+ shareOptions: E,
609
+ setIsMenuOpen: m,
610
+ setEditingView: l,
611
+ setSelectedView: x,
612
+ onSettingsChanged: B,
611
613
  // mutations
612
- onCreateView: I,
613
- onUpdateView: M,
614
- onDeleteView: S,
614
+ onCreateView: _,
615
+ onUpdateView: S,
616
+ onDeleteView: v,
615
617
  // shared actions
616
618
  resetWorkingView: le,
617
619
  // api
618
- api: q,
620
+ api: H,
619
621
  dispatch: c
620
622
  };
621
- return /* @__PURE__ */ L(Qe.Provider, { value: Ae, children: e });
622
- }, at = (e) => `${e}-views-portal`, Ee = (e) => e ? document.getElementById(at(e)) : null, ct = G(K)`
623
+ return /* @__PURE__ */ b(Xe.Provider, { value: Je, children: e });
624
+ }, ut = (e) => `${e}-views-portal`, Ie = (e) => e ? document.getElementById(ut(e)) : null, wt = J(Q)`
623
625
  padding: var(--padding-s);
624
626
  border-radius: var(--border-radius-m);
625
627
  margin: -4px 0;
@@ -640,7 +642,7 @@ const At = [
640
642
  background-color: var(--md-sys-color-primary-hover);
641
643
  }
642
644
  }
643
- `, lt = G.div`
645
+ `, gt = J.div`
644
646
  position: fixed;
645
647
  top: 0;
646
648
  left: 0;
@@ -655,13 +657,13 @@ const At = [
655
657
  background-color: var(--md-sys-color-surface-container-high);
656
658
  border-radius: var(--border-radius-l);
657
659
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15);
658
- `, dt = G.li`
660
+ `, ft = J.li`
659
661
  height: 1px;
660
662
  background-color: var(--md-sys-color-outline-variant);
661
663
  margin: 4px 0;
662
- `, ut = G.div`
664
+ `, Vt = J.div`
663
665
  margin-left: 6px;
664
- `, wt = G(ye)`
666
+ `, mt = J(ye)`
665
667
  padding: 0 8px 0 4px !important;
666
668
  outline: 1px dashed var(--md-sys-color-outline);
667
669
  margin: 0 8px 4px 0;
@@ -703,62 +705,62 @@ const At = [
703
705
  font-variation-settings: 'FILL' 1;
704
706
  }
705
707
  }
706
- `, gt = ({
708
+ `, pt = ({
707
709
  fullButton: e = !1,
708
710
  fullButtonProps: t = () => ({})
709
711
  }) => {
710
712
  const {
711
- viewType: o,
713
+ viewType: i,
712
714
  viewAlias: s,
713
715
  isMenuOpen: c,
714
716
  setIsMenuOpen: a,
715
- selectedView: n,
716
- isViewWorking: d,
717
+ selectedView: r,
718
+ isViewWorking: w,
717
719
  editingViewId: g
718
- } = H(), i = se(null);
719
- if (!o) return null;
720
+ } = G(), o = se(null);
721
+ if (!i) return null;
720
722
  const V = (l) => {
721
723
  l.preventDefault(), l.stopPropagation(), a(!c);
722
- }, v = {
724
+ }, h = {
723
725
  icon: "view_quilt",
724
726
  onClick: V,
725
727
  className: ke({ active: !!g, open: c }),
726
728
  tabIndex: 0,
727
- "data-tooltip": d ? `Working ${s.toLowerCase()}` : `${s}: ` + n?.label || "None",
729
+ "data-tooltip": w ? `Working ${s.toLowerCase()}` : `${s}: ` + r?.label || "None",
728
730
  "data-tooltip-delay": 0,
729
731
  onKeyDown: (l) => {
730
732
  (l.key === "Enter" || l.key === " ") && V(l);
731
733
  }
732
- }, p = e ? /* @__PURE__ */ L(ye, { ...v, ...t(n) }) : /* @__PURE__ */ L(ct, { ref: i, ...v }), w = Ee(o);
733
- return w ? we(p, w) : null;
734
- }, ft = () => null, xe = "views-dialog", Vt = ({}) => {
734
+ }, m = e ? /* @__PURE__ */ b(ye, { ...h, ...t(r) }) : /* @__PURE__ */ b(wt, { ref: o, ...h }), u = Ie(i);
735
+ return u ? we(m, u) : null;
736
+ }, ht = () => null, xe = "views-dialog", vt = ({}) => {
735
737
  const {
736
738
  editingView: e,
737
739
  editingViewData: t,
738
- isLoadingEditingViewData: o,
740
+ isLoadingEditingViewData: i,
739
741
  setEditingView: s,
740
742
  viewType: c,
741
743
  viewAlias: a,
742
- projectName: n,
743
- currentUser: d,
744
+ projectName: r,
745
+ currentUser: w,
744
746
  viewSettings: g,
745
- shareOptions: i,
747
+ shareOptions: o,
746
748
  setSelectedView: V,
747
- onCreateView: v,
748
- onUpdateView: p,
749
- onDeleteView: w,
749
+ onCreateView: h,
750
+ onUpdateView: m,
751
+ onDeleteView: u,
750
752
  api: l,
751
- dispatch: r
752
- } = H(), { powerLicense: u } = J(), [y, { isLoading: k, outdated: B }] = Ce({
753
+ dispatch: n
754
+ } = G(), { powerLicense: d } = K(), [y, { isLoading: C, outdated: E }] = Ce({
753
755
  addon: "powerpack",
754
756
  remote: "views",
755
757
  module: "ViewFormDialog",
756
- fallback: ft,
758
+ fallback: ht,
757
759
  minVersion: "1.1.1",
758
- skip: !c || !u
760
+ skip: !c || !d
759
761
  });
760
- return !c || !e ? null : e && B ? /* @__PURE__ */ L(
761
- Ye,
762
+ return !c || !e ? null : e && E ? /* @__PURE__ */ b(
763
+ Te,
762
764
  {
763
765
  isOpen: !0,
764
766
  header: "Powerpack Update Required",
@@ -766,30 +768,30 @@ const At = [
766
768
  size: "sm",
767
769
  children: /* @__PURE__ */ A("p", { children: [
768
770
  "Please update the Powerpack addon to at least ",
769
- B.required
771
+ E.required
770
772
  ] })
771
773
  }
772
- ) : /* @__PURE__ */ L(
774
+ ) : /* @__PURE__ */ b(
773
775
  y,
774
776
  {
775
777
  editingView: {
776
778
  viewId: e === !0 ? void 0 : e,
777
779
  ...t || {}
778
780
  },
779
- isLoading: o,
781
+ isLoading: i,
780
782
  viewSettings: g,
781
783
  setEditingView: s,
782
784
  viewType: c,
783
785
  viewAlias: a,
784
- projectName: n,
785
- shareOptions: i,
786
+ projectName: r,
787
+ shareOptions: o,
786
788
  setSelected: V,
787
- onCreateView: v,
788
- onUpdateView: p,
789
- onDeleteView: w,
789
+ onCreateView: h,
790
+ onUpdateView: m,
791
+ onDeleteView: u,
790
792
  api: l,
791
- dispatch: r,
792
- currentUser: d,
793
+ dispatch: n,
794
+ currentUser: w,
793
795
  pt: {
794
796
  dialog: {
795
797
  className: xe
@@ -797,57 +799,57 @@ const At = [
797
799
  }
798
800
  }
799
801
  );
800
- }, mt = ({ projectName: e }) => {
802
+ }, yt = ({ projectName: e }) => {
801
803
  const {
802
804
  projectBaseView: t,
803
- studioBaseView: o,
805
+ studioBaseView: i,
804
806
  onCreateBaseView: s,
805
807
  onDeleteBaseView: c,
806
808
  onLoadBaseView: a,
807
- viewAlias: n
808
- } = H(), { powerLicense: d, setPowerpackDialog: g } = J(), [i, V] = ve("collapsed-default-view", !1), v = async (p, w) => {
809
- const l = p ? o : t, r = !p && d === !1;
810
- if (r && !w) {
809
+ viewAlias: r
810
+ } = G(), { powerLicense: w, setPowerpackDialog: g } = K(), [o, V] = ve("collapsed-default-view", !1), h = async (m, u) => {
811
+ const l = m ? i : t, n = !m && w === !1;
812
+ if (n && !u) {
811
813
  g("sharedViews");
812
814
  return;
813
815
  }
814
- l ? w || r ? Je({
815
- message: `Are you sure you want to remove this default ${n.toLowerCase()}?`,
816
- header: `Remove Default ${n}`,
816
+ l ? u || n ? je({
817
+ message: `Are you sure you want to remove this default ${r.toLowerCase()}?`,
818
+ header: `Remove Default ${r}`,
817
819
  acceptLabel: "Remove",
818
820
  rejectLabel: "Cancel",
819
821
  accept: async () => {
820
- await c(l.id, p);
822
+ await c(l.id, m);
821
823
  }
822
- }) : await a(p) : await s(p);
824
+ }) : await a(m) : await s(m);
823
825
  };
824
826
  return /* @__PURE__ */ A(X, { children: [
825
- /* @__PURE__ */ L(
826
- je,
827
+ /* @__PURE__ */ b(
828
+ Ye,
827
829
  {
828
- onClick: () => V(!i),
829
- collapsed: i,
830
+ onClick: () => V(!o),
831
+ collapsed: o,
830
832
  id: "default-views",
831
- title: `Default ${n.toLowerCase()}`,
833
+ title: `Default ${r.toLowerCase()}`,
832
834
  style: { marginBottom: "10px" }
833
835
  }
834
836
  ),
835
- !i && /* @__PURE__ */ A(ut, { children: [
836
- /* @__PURE__ */ L(
837
+ !o && /* @__PURE__ */ A(Vt, { children: [
838
+ /* @__PURE__ */ b(
837
839
  ue,
838
840
  {
839
- existingView: !!o,
841
+ existingView: !!i,
840
842
  label: "Studio",
841
- onClick: (p) => v(!0, p)
843
+ onClick: (m) => h(!0, m)
842
844
  }
843
845
  ),
844
- e && /* @__PURE__ */ L(
846
+ e && /* @__PURE__ */ b(
845
847
  ue,
846
848
  {
847
849
  existingView: !!t,
848
850
  label: "Project",
849
- onClick: (p) => v(!1, p),
850
- powerLicense: d
851
+ onClick: (m) => h(!1, m),
852
+ powerLicense: w
851
853
  }
852
854
  )
853
855
  ] })
@@ -855,16 +857,16 @@ const At = [
855
857
  }, ue = ({
856
858
  existingView: e,
857
859
  onClick: t,
858
- label: o,
860
+ label: i,
859
861
  powerLicense: s = void 0
860
862
  }) => {
861
- const c = (n) => {
862
- n.stopPropagation(), t();
863
- }, a = (n) => {
864
- n.stopPropagation(), t(!0);
863
+ const c = (r) => {
864
+ r.stopPropagation(), t();
865
+ }, a = (r) => {
866
+ r.stopPropagation(), t(!0);
865
867
  };
866
868
  return /* @__PURE__ */ A(
867
- wt,
869
+ mt,
868
870
  {
869
871
  className: ke({
870
872
  "powerpack-locked": s === !1,
@@ -872,121 +874,121 @@ const At = [
872
874
  }),
873
875
  onClick: c,
874
876
  children: [
875
- /* @__PURE__ */ L(
876
- K,
877
+ /* @__PURE__ */ b(
878
+ Q,
877
879
  {
878
880
  icon: s === !1 ? "bolt" : e ? "close" : "add",
879
- onClick: (n) => e && a(n)
881
+ onClick: (r) => e && a(r)
880
882
  }
881
883
  ),
882
- o
884
+ i
883
885
  ]
884
886
  }
885
887
  );
886
- }, pt = G(K)`
888
+ }, kt = J(Q)`
887
889
  color: var(--md-sys-color-tertiary);
888
890
  font-variation-settings: 'FILL' 1;
889
- `, ht = () => {
891
+ `, Ct = () => {
890
892
  const {
891
893
  viewType: e,
892
894
  viewAlias: t,
893
- isMenuOpen: o,
895
+ isMenuOpen: i,
894
896
  setIsMenuOpen: s,
895
897
  setEditingView: c,
896
898
  selectedView: a,
897
- workingView: n,
898
- viewMenuItems: d,
899
+ workingView: r,
900
+ viewMenuItems: w,
899
901
  projectName: g
900
- } = H(), { powerLicense: i, setPowerpackDialog: V } = J(), v = se(null), { user: p } = he(), w = (p?.uiExposureLevel || 0) >= 900, l = Ee(e), r = l?.getBoundingClientRect(), y = {
901
- top: r ? r.bottom + 8 : 0,
902
- left: r ? r.left : 0
902
+ } = G(), { powerLicense: o, setPowerpackDialog: V } = K(), h = se(null), { user: m } = he(), u = (m?.uiExposureLevel || 0) >= 900, l = Ie(e), n = l?.getBoundingClientRect(), y = {
903
+ top: n ? n.bottom + 8 : 0,
904
+ left: n ? n.left : 0
903
905
  };
904
- R(() => {
905
- const F = (m) => {
906
- const C = m.target, D = v.current?.contains(C) || l?.contains(C), b = document.querySelector("." + xe)?.contains(C), I = document.querySelector(".options")?.contains(C), S = document.querySelector(".p-confirm-dialog")?.contains(C);
907
- !D && !b && !I && !S && o && s(!1);
908
- }, P = (m) => {
909
- m.key === "Escape" && o && s(!1);
906
+ U(() => {
907
+ const L = (f) => {
908
+ const k = f.target, D = h.current?.contains(k) || l?.contains(k), B = document.querySelector("." + xe)?.contains(k), I = document.querySelector(".options")?.contains(k), $ = document.querySelector(".p-confirm-dialog")?.contains(k);
909
+ !D && !B && !I && !$ && i && s(!1);
910
+ }, x = (f) => {
911
+ f.key === "Escape" && i && s(!1);
910
912
  };
911
- return document.addEventListener("mousedown", F), document.addEventListener("keydown", P), () => {
912
- document.removeEventListener("mousedown", F), document.removeEventListener("keydown", P);
913
+ return document.addEventListener("mousedown", L), document.addEventListener("keydown", x), () => {
914
+ document.removeEventListener("mousedown", L), document.removeEventListener("keydown", x);
913
915
  };
914
- }, [o, l, s]), R(() => {
915
- o && v.current && v.current.focus();
916
- }, [o]);
917
- const k = h(() => {
918
- i ? c(!0) : V("sharedViews");
919
- }, [i, V, c, s]), B = !a || n?.id === a.id ? ne : a.id;
920
- return /* @__PURE__ */ L(X, { children: o && we(
921
- /* @__PURE__ */ A(lt, { style: y, ref: v, tabIndex: 0, children: [
922
- /* @__PURE__ */ L(ze, { items: d, selected: B }),
923
- w && /* @__PURE__ */ A(X, { children: [
924
- /* @__PURE__ */ L(mt, { projectName: g }),
925
- /* @__PURE__ */ L(dt, {})
916
+ }, [i, l, s]), U(() => {
917
+ i && h.current && h.current.focus();
918
+ }, [i]);
919
+ const C = p(() => {
920
+ o ? c(!0) : V("sharedViews");
921
+ }, [o, V, c, s]), E = !a || r?.id === a.id ? ne : a.id;
922
+ return /* @__PURE__ */ b(X, { children: i && we(
923
+ /* @__PURE__ */ A(gt, { style: y, ref: h, tabIndex: 0, children: [
924
+ /* @__PURE__ */ b(Ze, { items: w, selected: E }),
925
+ u && /* @__PURE__ */ A(X, { children: [
926
+ /* @__PURE__ */ b(yt, { projectName: g }),
927
+ /* @__PURE__ */ b(ft, {})
926
928
  ] }),
927
- /* @__PURE__ */ L(
928
- Xe,
929
+ /* @__PURE__ */ b(
930
+ Ne,
929
931
  {
930
932
  label: `Create new ${t.toLowerCase()}`,
931
- id: Ne,
932
- startContent: /* @__PURE__ */ L(K, { icon: "add" }),
933
- endContent: !i && /* @__PURE__ */ L(pt, { icon: "bolt" }),
934
- onClick: k,
933
+ id: tt,
934
+ startContent: /* @__PURE__ */ b(Q, { icon: "add" }),
935
+ endContent: !o && /* @__PURE__ */ b(kt, { icon: "bolt" }),
936
+ onClick: C,
935
937
  tabIndex: 0
936
938
  }
937
939
  )
938
940
  ] }),
939
941
  document.body
940
942
  ) });
941
- }, vt = () => {
942
- const { resetWorkingView: e } = H(), t = h(async () => {
943
+ }, bt = () => {
944
+ const { resetWorkingView: e } = G(), t = p(async () => {
943
945
  await e();
944
946
  }, [e]);
945
- return R(() => {
946
- const o = (s) => {
947
+ return U(() => {
948
+ const i = (s) => {
947
949
  s.target instanceof HTMLElement && (s.target.tagName === "INPUT" || s.target.tagName === "TEXTAREA" || s.target.isContentEditable || s.target.getAttribute("role") === "textbox" || s.target.closest(".block-shortcuts")) || s.shiftKey && (s.ctrlKey || s.metaKey) && s.key === "0" && (s.preventDefault(), t());
948
950
  };
949
- return window.addEventListener("keydown", o), () => {
950
- window.removeEventListener("keydown", o);
951
+ return window.addEventListener("keydown", i), () => {
952
+ window.removeEventListener("keydown", i);
951
953
  };
952
954
  }, [t]), {
953
955
  resetViewToDefault: t
954
956
  };
955
- }, Gt = () => (vt(), /* @__PURE__ */ A(X, { children: [
956
- /* @__PURE__ */ L(gt, {}),
957
- /* @__PURE__ */ L(ht, {}),
958
- /* @__PURE__ */ L(Vt, {})
959
- ] })), Jt = ({
957
+ }, jt = () => (bt(), /* @__PURE__ */ A(X, { children: [
958
+ /* @__PURE__ */ b(pt, {}),
959
+ /* @__PURE__ */ b(Ct, {}),
960
+ /* @__PURE__ */ b(vt, {})
961
+ ] })), zt = ({
960
962
  viewType: e,
961
963
  projectName: t
962
964
  }) => {
963
- const o = !e, s = { viewType: e, projectName: t };
964
- ge(s, { skip: o }), me(s, { skip: o }), pe(s, { skip: o }), Y(s, { skip: o }), Y({ viewType: e, projectName: void 0 }, { skip: o });
965
- }, Kt = () => {
966
- const { viewSettings: e } = H(), [t, o] = $(null), [s, c] = $(null), { updateViewSettings: a } = Le(), n = e, d = n?.filter ?? {}, g = n?.columns ?? [], i = n?.sliceType;
967
- R(() => {
968
- o(null);
969
- }, [JSON.stringify(e?.filter)]), R(() => {
965
+ const i = !e, s = { viewType: e, projectName: t };
966
+ ge(s, { skip: i }), me(s, { skip: i }), pe(s, { skip: i }), Y(s, { skip: i }), Y({ viewType: e, projectName: void 0 }, { skip: i });
967
+ }, Xt = () => {
968
+ const { viewSettings: e } = G(), [t, i] = W(null), [s, c] = W(null), { updateViewSettings: a } = Le(), r = e, w = r?.filter ?? {}, g = r?.columns ?? [], o = r?.sliceType;
969
+ U(() => {
970
+ i(null);
971
+ }, [JSON.stringify(e?.filter)]), U(() => {
970
972
  c(null);
971
973
  }, [JSON.stringify(e?.columns)]);
972
- const V = t !== null ? t : d, v = s !== null ? s : g, p = h(
973
- async (u) => {
974
- await a({ filter: u }, o, u, {
974
+ const V = t !== null ? t : w, h = s !== null ? s : g, m = p(
975
+ async (d) => {
976
+ await a({ filter: d }, i, d, {
975
977
  errorMessage: "Failed to update filter settings"
976
978
  });
977
979
  },
978
980
  [a]
979
- ), w = h(
980
- async (u) => {
981
- await a({ columns: u }, c, u, {
981
+ ), u = p(
982
+ async (d) => {
983
+ await a({ columns: d }, c, d, {
982
984
  errorMessage: "Failed to update column width settings"
983
985
  });
984
986
  },
985
987
  [a]
986
- ), l = h(() => {
987
- }, []), r = h(
988
- async (u) => {
989
- await a({ sliceType: u }, l, u, {
988
+ ), l = p(() => {
989
+ }, []), n = p(
990
+ async (d) => {
991
+ await a({ sliceType: d }, l, d, {
990
992
  errorMessage: "Failed to update slicer type"
991
993
  });
992
994
  },
@@ -994,188 +996,188 @@ const At = [
994
996
  );
995
997
  return {
996
998
  filters: V,
997
- onUpdateFilters: p,
998
- columns: v,
999
- onUpdateColumns: w,
1000
- sliceType: i,
1001
- onUpdateSliceType: r
999
+ onUpdateFilters: m,
1000
+ columns: h,
1001
+ onUpdateColumns: u,
1002
+ sliceType: o,
1003
+ onUpdateSliceType: n
1002
1004
  };
1003
- }, Qt = ({ viewSettings: e, updateViewSettings: t }) => {
1004
- const [o, s] = $(null), [c, a] = $(null), [n, d] = $(null), g = e, i = g?.filter ?? {}, V = g?.showHierarchy ?? !0, v = g?.sliceType, p = _(
1005
+ }, Yt = ({ viewSettings: e, updateViewSettings: t }) => {
1006
+ const [i, s] = W(null), [c, a] = W(null), [r, w] = W(null), g = e, o = g?.filter ?? {}, V = g?.showHierarchy ?? !0, h = g?.sliceType, m = q(
1005
1007
  () => Be(g),
1006
1008
  [JSON.stringify(e)]
1007
1009
  );
1008
- R(() => {
1010
+ U(() => {
1009
1011
  s(null);
1010
- }, [JSON.stringify(e?.filter)]), R(() => {
1012
+ }, [JSON.stringify(e?.filter)]), U(() => {
1011
1013
  a(null);
1012
1014
  }, [
1013
1015
  e?.showHierarchy,
1014
1016
  e?.groupBy
1015
- ]), R(() => {
1016
- d(null);
1017
+ ]), U(() => {
1018
+ w(null);
1017
1019
  }, [JSON.stringify(e?.columns)]);
1018
- const w = o !== null ? o : i, l = c !== null ? c : V, r = n || p, u = h(() => {
1019
- }, []), y = h(
1020
- async (m) => {
1021
- await t({ sliceType: m }, u, m, {
1020
+ const u = i !== null ? i : o, l = c !== null ? c : V, n = r || m, d = p(() => {
1021
+ }, []), y = p(
1022
+ async (f) => {
1023
+ await t({ sliceType: f }, d, f, {
1022
1024
  errorMessage: "Failed to update slicer type"
1023
1025
  });
1024
1026
  },
1025
1027
  [t]
1026
- ), k = h(
1027
- async (m) => {
1028
- await t({ filter: m }, s, m, {
1028
+ ), C = p(
1029
+ async (f) => {
1030
+ await t({ filter: f }, s, f, {
1029
1031
  errorMessage: "Failed to update filter settings"
1030
1032
  });
1031
1033
  },
1032
1034
  [t]
1033
- ), B = h(
1034
- async (m) => {
1035
- if (m && r?.groupBy) {
1036
- const C = { ...r, groupBy: void 0 };
1037
- d(C);
1038
- const D = te(C);
1035
+ ), E = p(
1036
+ async (f) => {
1037
+ if (f && n?.groupBy) {
1038
+ const k = { ...n, groupBy: void 0 };
1039
+ w(k);
1040
+ const D = te(k);
1039
1041
  await t(
1040
1042
  { ...D, showHierarchy: !0 },
1041
1043
  a,
1042
- m,
1044
+ f,
1043
1045
  { errorMessage: "Failed to update hierarchy setting" }
1044
1046
  );
1045
1047
  return;
1046
1048
  }
1047
1049
  await t(
1048
- { showHierarchy: m },
1050
+ { showHierarchy: f },
1049
1051
  a,
1050
- m,
1052
+ f,
1051
1053
  { errorMessage: "Failed to update hierarchy setting" }
1052
1054
  );
1053
1055
  },
1054
- [t, r]
1055
- ), F = h(
1056
- async (m, C) => {
1057
- const D = C || [
1058
- ...m.columnOrder || [],
1059
- ...Object.keys(m.columnVisibility || {}),
1060
- ...m.columnPinning?.left || [],
1061
- ...m.columnPinning?.right || []
1062
- ].filter(Boolean).filter((S, M, W) => W.indexOf(S) === M), b = te(m, D), I = !!m.groupBy;
1056
+ [t, n]
1057
+ ), L = p(
1058
+ async (f, k) => {
1059
+ const D = k || [
1060
+ ...f.columnOrder || [],
1061
+ ...Object.keys(f.columnVisibility || {}),
1062
+ ...f.columnPinning?.left || [],
1063
+ ...f.columnPinning?.right || []
1064
+ ].filter(Boolean).filter(($, P, _) => _.indexOf($) === P), B = te(f, D), I = !!f.groupBy;
1063
1065
  I && a(!1), await t(
1064
- I ? { ...b, showHierarchy: !1 } : b,
1065
- d,
1066
- m,
1066
+ I ? { ...B, showHierarchy: !1 } : B,
1067
+ w,
1068
+ f,
1067
1069
  { errorMessage: "Failed to update columns" }
1068
1070
  );
1069
1071
  },
1070
1072
  [t]
1071
- ), P = h(
1072
- async (m, C, D) => {
1073
- const b = {
1074
- showHierarchy: C,
1075
- groupBy: m,
1076
- groupSortByDesc: m ? D ?? !1 : void 0
1077
- }, S = {
1078
- ...r,
1079
- groupBy: m ? { id: m, desc: D ?? !1 } : void 0
1073
+ ), x = p(
1074
+ async (f, k, D) => {
1075
+ const B = {
1076
+ showHierarchy: k,
1077
+ groupBy: f,
1078
+ groupSortByDesc: f ? D ?? !1 : void 0
1079
+ }, $ = {
1080
+ ...n,
1081
+ groupBy: f ? { id: f, desc: D ?? !1 } : void 0
1080
1082
  };
1081
1083
  await t(
1082
- b,
1083
- (W) => {
1084
- W === null ? (a(null), d(null)) : (a(W.showHierarchy), d(W.columns));
1084
+ B,
1085
+ (_) => {
1086
+ _ === null ? (a(null), w(null)) : (a(_.showHierarchy), w(_.columns));
1085
1087
  },
1086
- { showHierarchy: C, columns: S },
1088
+ { showHierarchy: k, columns: $ },
1087
1089
  { errorMessage: "Failed to update grouping" }
1088
1090
  );
1089
1091
  },
1090
- [t, r]
1092
+ [t, n]
1091
1093
  );
1092
1094
  return {
1093
- filters: w,
1094
- onUpdateFilters: k,
1095
+ filters: u,
1096
+ onUpdateFilters: C,
1095
1097
  showHierarchy: l,
1096
- onUpdateHierarchy: B,
1097
- columns: r,
1098
- onUpdateColumns: F,
1099
- onUpdateGroupBy: P,
1100
- sliceType: v,
1098
+ onUpdateHierarchy: E,
1099
+ columns: n,
1100
+ onUpdateColumns: L,
1101
+ onUpdateGroupBy: x,
1102
+ sliceType: h,
1101
1103
  onUpdateSliceType: y
1102
1104
  };
1103
- }, jt = () => {
1104
- const { viewSettings: e } = H(), [t, o] = $(null), [s, c] = $(null), [a, n] = $(null), { updateViewSettings: d } = Le(), g = e, i = g?.filter ?? {}, V = _(
1105
+ }, Zt = () => {
1106
+ const { viewSettings: e } = G(), [t, i] = W(null), [s, c] = W(null), [a, r] = W(null), { updateViewSettings: w } = Le(), g = e, o = g?.filter ?? {}, V = q(
1105
1107
  () => Be(g),
1106
1108
  [JSON.stringify(e)]
1107
1109
  );
1108
- R(() => {
1109
- o(null);
1110
- }, [JSON.stringify(e?.filter)]), R(() => {
1110
+ U(() => {
1111
+ i(null);
1112
+ }, [JSON.stringify(e?.filter)]), U(() => {
1111
1113
  c(null);
1112
1114
  }, [JSON.stringify(e?.columns)]);
1113
- const v = e?.listValues;
1114
- R(() => {
1115
- n(null);
1116
- }, [JSON.stringify(v)]);
1117
- const p = t !== null ? t : i, w = s || V, l = a ?? v, r = h(
1118
- async (k) => {
1119
- await d({ filter: k }, o, k, {
1115
+ const h = e?.listValues;
1116
+ U(() => {
1117
+ r(null);
1118
+ }, [JSON.stringify(h)]);
1119
+ const m = t !== null ? t : o, u = s || V, l = a ?? h, n = p(
1120
+ async (C) => {
1121
+ await w({ filter: C }, i, C, {
1120
1122
  errorMessage: "Failed to update filter settings"
1121
1123
  });
1122
1124
  },
1123
- [d]
1124
- ), u = h(
1125
- async (k, B) => {
1126
- const F = te(k, B);
1127
- await d(F, c, k, {
1125
+ [w]
1126
+ ), d = p(
1127
+ async (C, E) => {
1128
+ const L = te(C, E);
1129
+ await w(L, c, C, {
1128
1130
  errorMessage: "Failed to update columns"
1129
1131
  });
1130
1132
  },
1131
- [d]
1132
- ), y = h(
1133
- async (k) => {
1134
- await d({ listValues: k }, n, k, {
1133
+ [w]
1134
+ ), y = p(
1135
+ async (C) => {
1136
+ await w({ listValues: C }, r, C, {
1135
1137
  errorMessage: "Failed to update list values settings"
1136
1138
  });
1137
1139
  },
1138
- [d]
1140
+ [w]
1139
1141
  );
1140
1142
  return {
1141
- filters: p,
1142
- onUpdateFilters: r,
1143
- columns: w,
1144
- onUpdateColumns: u,
1143
+ filters: m,
1144
+ onUpdateFilters: n,
1145
+ columns: u,
1146
+ onUpdateColumns: d,
1145
1147
  listValues: l,
1146
1148
  onUpdateListValues: y
1147
1149
  };
1148
1150
  };
1149
1151
  export {
1150
1152
  De as BASE_VIEW_ID,
1151
- Ne as NEW_VIEW_ID,
1152
- Ke as VIEW_DIVIDER,
1153
- Gt as Views,
1154
- gt as ViewsButton,
1155
- Qe as ViewsContext,
1156
- ze as ViewsMenu,
1157
- ht as ViewsMenuContainer,
1158
- Ht as ViewsProvider,
1153
+ tt as NEW_VIEW_ID,
1154
+ ze as VIEW_DIVIDER,
1155
+ jt as Views,
1156
+ pt as ViewsButton,
1157
+ Xe as ViewsContext,
1158
+ Ze as ViewsMenu,
1159
+ Ct as ViewsMenuContainer,
1160
+ Qt as ViewsProvider,
1159
1161
  ne as WORKING_VIEW_ID,
1160
- Yt as generateViewId,
1162
+ es as generateViewId,
1161
1163
  be as generateWorkingView,
1162
- Te as getCustomViewsFallback,
1163
- Ee as getViewsPortalContainer,
1164
- at as getViewsPortalId,
1165
- Ie as isViewStudioScope,
1166
- Zt as updateViewSettings,
1167
- ot as useBaseViewMutations,
1168
- et as useBuildViewMenuItems,
1169
- jt as useListsViewSettings,
1170
- Qt as useOverviewViewSettings,
1171
- Jt as usePrefetchViews,
1172
- it as useSaveViewFromCurrent,
1173
- tt as useSelectedView,
1174
- Kt as useTaskProgressViewSettings,
1164
+ st as getCustomViewsFallback,
1165
+ Ie as getViewsPortalContainer,
1166
+ ut as getViewsPortalId,
1167
+ Ee as isViewStudioScope,
1168
+ ts as updateViewSettings,
1169
+ rt as useBaseViewMutations,
1170
+ ot as useBuildViewMenuItems,
1171
+ Zt as useListsViewSettings,
1172
+ Yt as useOverviewViewSettings,
1173
+ zt as usePrefetchViews,
1174
+ at as useSaveViewFromCurrent,
1175
+ it as useSelectedView,
1176
+ Xt as useTaskProgressViewSettings,
1175
1177
  Le as useViewUpdateHelper,
1176
- H as useViewsContext,
1177
- st as useViewsMutations,
1178
- vt as useViewsShortcuts,
1179
- Nt as useViewsState,
1180
- At as viewTypes
1178
+ G as useViewsContext,
1179
+ nt as useViewsMutations,
1180
+ bt as useViewsShortcuts,
1181
+ ss as useViewsState,
1182
+ Kt as viewTypes
1181
1183
  };