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