@ynput/ayon-frontend-shared 0.4.7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DetailsPanel.es.js +684 -649
- package/dist/Feed.es.js +22 -22
- package/dist/ListTable.es.js +78 -67
- package/dist/ProjectTreeTable.es.js +2185 -2132
- package/dist/Slicer.es.js +152 -120
- package/dist/Views.es.js +1 -1
- package/dist/api.es.js +332 -329
- package/dist/chunks/Actions.es.js +7 -7
- package/dist/chunks/ColumnDropIndicator.es.js +127 -241
- package/dist/chunks/DeleteEntitiesContext.es.js +109 -109
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/DetailsPanelContext.es.js +155 -0
- package/dist/chunks/EntityPath.es.js +40 -40
- package/dist/chunks/EntityPickerDialog.es.js +1 -1
- package/dist/chunks/EntityTooltip.es.js +3 -3
- package/dist/chunks/EntityUpdatesContext.es.js +1 -1
- package/dist/chunks/Feed.es.js +2208 -2611
- package/dist/chunks/FilterErrorActions.es.js +5 -5
- package/dist/chunks/GlobalContext.es.js +21 -21
- package/dist/chunks/InfoMessage.es.js +146 -0
- package/dist/chunks/Menu.es.js +6 -6
- package/dist/chunks/MenuContext.es.js +51 -240
- package/dist/chunks/MenuItem.es.js +1 -1
- package/dist/chunks/MetaWidget.es.js +3211 -3761
- package/dist/chunks/NewEntityContext.es.js +539 -544
- package/dist/chunks/PlayableIcon.es.js +4261 -1163
- package/dist/chunks/ProjectContext.es.js +2 -2
- package/dist/chunks/ProjectFoldersContext.es.js +84 -76
- package/dist/chunks/RepresentationsList.es.js +3 -3
- package/dist/chunks/ReviewablesSelector.es.js +396 -384
- package/dist/chunks/SimpleForm.es.js +9 -9
- package/dist/chunks/SimpleTable.es.js +286 -283
- package/dist/chunks/Slicer.es.js +1129 -689
- package/dist/chunks/TableSettingsFallback.es.js +6 -6
- package/dist/chunks/ThumbnailSimple.es.js +410 -61
- package/dist/chunks/VersionUploadContext.es.js +30 -30
- package/dist/chunks/ViewsContext.es.js +97 -97
- package/dist/chunks/Watchers.es.js +628 -598
- package/dist/chunks/entityDefinitions.es.js +276 -134
- package/dist/chunks/expandRelativeDates.es.js +27 -0
- package/dist/chunks/getBundleMode.es.js +16 -61
- package/dist/chunks/getUris.es.js +329 -322
- package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
- package/dist/chunks/searchTerms.es.js +186 -173
- package/dist/chunks/uriUtils.es.js +48 -0
- package/dist/chunks/useAttributeEnums.es.js +69 -61
- package/dist/chunks/useColumnDragRestriction.es.js +37 -27
- package/dist/chunks/useDateRangeFilter.es.js +3 -3
- package/dist/chunks/useLocalStorage.es.js +8 -8
- package/dist/chunks/useSessionStorage.es.js +61 -0
- package/dist/chunks/viewUpdateHelper.es.js +8 -8
- package/dist/components.es.js +199 -194
- package/dist/context.es.js +60 -58
- package/dist/hooks.es.js +108 -101
- package/dist/index.es.js +20 -14
- package/dist/types/Actions.d.ts +16 -16
- package/dist/types/ContextMenu.d.ts +16 -16
- package/dist/types/DetailsPanel.d.ts +22 -16
- package/dist/types/EntityPickerDialog.d.ts +16 -16
- package/dist/types/Feed.d.ts +16 -16
- package/dist/types/ListTable.d.ts +16 -16
- package/dist/types/NewEntity.d.ts +16 -16
- package/dist/types/ProjectTreeTable.d.ts +48 -22
- package/dist/types/RepresentationsList.d.ts +19 -16
- package/dist/types/SimpleTable.d.ts +17 -16
- package/dist/types/Slicer.d.ts +119 -34
- package/dist/types/Views.d.ts +17 -17
- package/dist/types/api.d.ts +404 -95
- package/dist/types/components.d.ts +86 -25
- package/dist/types/context.d.ts +60 -17
- package/dist/types/hooks.d.ts +16 -16
- package/dist/types/index.d.ts +16 -16
- package/dist/types/util.d.ts +16 -16
- package/dist/util.es.js +108 -97
- package/package.json +26 -13
- package/dist/chunks/mentionTypeOptions.es.js +0 -15
- package/dist/chunks/useSlicerSplitter.es.js +0 -18
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as ae, jsx as
|
|
1
|
+
import { jsxs as ae, jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Z, useMemo as F, useCallback as b, useRef as De, useState as Y, createContext as Ie, useContext as Ee } from "react";
|
|
3
3
|
import "./searchTerms.es.js";
|
|
4
|
-
import {
|
|
4
|
+
import { aP as j, br as Pe, d2 as N, b3 as ne, ds as ce, dv as P, S as J, cf as Me, cT as _e, cA as We, bn as oe, cy as Re } from "./getUris.es.js";
|
|
5
5
|
import { confirmDialog as Fe } from "primereact/confirmdialog";
|
|
6
6
|
import { Button as Oe, theme as le, Icon as de } from "@ynput/ayon-react-components";
|
|
7
|
-
import
|
|
7
|
+
import M from "styled-components";
|
|
8
8
|
import K from "clsx";
|
|
9
9
|
import { a as qe, K as re } from "./platform.es.js";
|
|
10
10
|
import "lodash";
|
|
11
|
-
import { toast as
|
|
11
|
+
import { toast as v } from "react-toastify";
|
|
12
12
|
import { v4 as Ge } from "uuid";
|
|
13
13
|
import { u as Qe } from "./GlobalContext.es.js";
|
|
14
|
-
import {
|
|
14
|
+
import { a as ue, u as Ue, e as Ke } from "./useLocalStorage.es.js";
|
|
15
15
|
import { useDispatch as He } from "react-redux";
|
|
16
16
|
const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
17
17
|
id: ze(),
|
|
@@ -25,7 +25,7 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
|
25
25
|
"lists",
|
|
26
26
|
"reviews",
|
|
27
27
|
"reports"
|
|
28
|
-
], ge = "_working_", Lt = "_new_view_",
|
|
28
|
+
], ge = "_working_", Lt = "_new_view_", fe = "__base__", Ae = M.li`
|
|
29
29
|
position: relative;
|
|
30
30
|
padding: 4px 6px 4px 12px;
|
|
31
31
|
user-select: none;
|
|
@@ -78,7 +78,7 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
|
78
78
|
display: flex;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
`, X =
|
|
81
|
+
`, X = M(Oe)`
|
|
82
82
|
&.hasIcon {
|
|
83
83
|
padding: 2px;
|
|
84
84
|
}
|
|
@@ -105,10 +105,10 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
|
105
105
|
isSelected: o,
|
|
106
106
|
isEditable: d,
|
|
107
107
|
isSaveable: u,
|
|
108
|
-
highlighted:
|
|
108
|
+
highlighted: f,
|
|
109
109
|
onEdit: g,
|
|
110
110
|
onSave: i,
|
|
111
|
-
onResetView:
|
|
111
|
+
onResetView: V,
|
|
112
112
|
className: x,
|
|
113
113
|
...$
|
|
114
114
|
}, w) => {
|
|
@@ -128,34 +128,34 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
|
128
128
|
ref: w,
|
|
129
129
|
children: [
|
|
130
130
|
n && n,
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
131
|
+
/* @__PURE__ */ m("span", { className: "label", children: t }),
|
|
132
|
+
V && /* @__PURE__ */ m(
|
|
133
133
|
X,
|
|
134
134
|
{
|
|
135
135
|
icon: "restart_alt",
|
|
136
136
|
variant: "text",
|
|
137
137
|
className: "reset",
|
|
138
|
-
onClick:
|
|
138
|
+
onClick: V,
|
|
139
139
|
"data-tooltip": "Reset to Default",
|
|
140
140
|
"data-shortcut": qe("0", [re.Shift, re.Ctrl])
|
|
141
141
|
}
|
|
142
142
|
),
|
|
143
|
-
d && u && !o && /* @__PURE__ */
|
|
143
|
+
d && u && !o && /* @__PURE__ */ m(
|
|
144
144
|
X,
|
|
145
145
|
{
|
|
146
146
|
icon: "save",
|
|
147
147
|
variant: "text",
|
|
148
|
-
className: K("save", { active:
|
|
149
|
-
onClick: (a) => c(a,
|
|
148
|
+
className: K("save", { active: f === "save" }),
|
|
149
|
+
onClick: (a) => c(a, f !== "save"),
|
|
150
150
|
"data-tooltip": `Save ${l} settings from current ${l}`
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
d && g && /* @__PURE__ */
|
|
153
|
+
d && g && /* @__PURE__ */ m(
|
|
154
154
|
X,
|
|
155
155
|
{
|
|
156
156
|
variant: "text",
|
|
157
157
|
icon: "more_horiz",
|
|
158
|
-
className: K("more", { active:
|
|
158
|
+
className: K("more", { active: f === "edit" }),
|
|
159
159
|
onClick: (a) => g(a, e),
|
|
160
160
|
"data-tooltip": `Edit ${l}`
|
|
161
161
|
}
|
|
@@ -165,10 +165,10 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
|
165
165
|
}
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
|
-
), Xe =
|
|
168
|
+
), Xe = M.div`
|
|
169
169
|
overflow: auto;
|
|
170
170
|
max-height: 40vh;
|
|
171
|
-
`, Ye =
|
|
171
|
+
`, Ye = M.ul`
|
|
172
172
|
/* reset defaults */
|
|
173
173
|
margin: 0;
|
|
174
174
|
padding: 0;
|
|
@@ -178,16 +178,16 @@ const ze = () => Ge().replace(/-/g, ""), we = (e = {}) => ({
|
|
|
178
178
|
flex-direction: column;
|
|
179
179
|
gap: var(--base-gap-small);
|
|
180
180
|
margin-bottom: var(--padding-s);
|
|
181
|
-
`, Ze =
|
|
181
|
+
`, Ze = M.li`
|
|
182
182
|
height: 1px;
|
|
183
183
|
background-color: var(--md-sys-color-outline-variant);
|
|
184
184
|
margin: 4px 0;
|
|
185
185
|
`;
|
|
186
|
-
|
|
186
|
+
M.li`
|
|
187
187
|
${le.labelSmall}
|
|
188
188
|
color: var(--md-sys-color-outline);
|
|
189
189
|
`;
|
|
190
|
-
const je =
|
|
190
|
+
const je = M.li`
|
|
191
191
|
${le.labelSmall}
|
|
192
192
|
color: var(--md-sys-color-outline);
|
|
193
193
|
user-select: none;
|
|
@@ -231,14 +231,14 @@ const je = P.li`
|
|
|
231
231
|
className: K("views-section-header", { collapsed: t }, n),
|
|
232
232
|
ref: o,
|
|
233
233
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ m("span", { children: e }),
|
|
235
|
+
/* @__PURE__ */ m("span", { className: "spacer" }),
|
|
236
|
+
/* @__PURE__ */ m(de, { className: "icon", icon: "expand_more" })
|
|
237
237
|
]
|
|
238
238
|
}
|
|
239
239
|
)
|
|
240
240
|
), Te = "_divider_", et = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", Bt = Z(
|
|
241
|
-
({ items: e, selected: t, ...n }, s) => /* @__PURE__ */
|
|
241
|
+
({ items: e, selected: t, ...n }, s) => /* @__PURE__ */ m(Xe, { children: /* @__PURE__ */ m(Ye, { ...n, ref: s, children: e.map((o, d) => o === "_divider_" ? /* @__PURE__ */ m(Ze, {}, d) : et(o) ? /* @__PURE__ */ m(
|
|
242
242
|
Ne,
|
|
243
243
|
{
|
|
244
244
|
id: o.id,
|
|
@@ -247,7 +247,7 @@ const je = P.li`
|
|
|
247
247
|
onClick: o.onToggle
|
|
248
248
|
},
|
|
249
249
|
o.id
|
|
250
|
-
) : /* @__PURE__ */
|
|
250
|
+
) : /* @__PURE__ */ m(
|
|
251
251
|
Je,
|
|
252
252
|
{
|
|
253
253
|
tabIndex: 0,
|
|
@@ -258,13 +258,13 @@ const je = P.li`
|
|
|
258
258
|
(o.id || "") + d.toString()
|
|
259
259
|
)) }) })
|
|
260
260
|
), tt = (e) => {
|
|
261
|
-
const { viewsList: t, onEdit: n, onSelect: s, onSave: o } = e, d = (i,
|
|
261
|
+
const { viewsList: t, onEdit: n, onSelect: s, onSave: o } = e, d = (i, V = {}) => ({
|
|
262
262
|
id: i.id,
|
|
263
263
|
label: i.label,
|
|
264
264
|
isSelected: !1,
|
|
265
265
|
highlighted: i.highlighted,
|
|
266
266
|
onClick: () => s(i.id),
|
|
267
|
-
...
|
|
267
|
+
...V
|
|
268
268
|
}), u = t.filter((i) => i.visibility === "private" && i.isOwner && !i.working).map(
|
|
269
269
|
(i) => d(i, {
|
|
270
270
|
isEditable: !0,
|
|
@@ -272,7 +272,7 @@ const je = P.li`
|
|
|
272
272
|
onEdit: () => n(i.id),
|
|
273
273
|
onSave: () => o(i.id)
|
|
274
274
|
})
|
|
275
|
-
),
|
|
275
|
+
), f = t.filter((i) => i.visibility === "public" && !i.working).map(
|
|
276
276
|
(i) => d(i, {
|
|
277
277
|
isEditable: i.isOwner,
|
|
278
278
|
isSaveable: i.isOwner,
|
|
@@ -289,7 +289,7 @@ const je = P.li`
|
|
|
289
289
|
);
|
|
290
290
|
return {
|
|
291
291
|
myViews: u,
|
|
292
|
-
sharedViews:
|
|
292
|
+
sharedViews: f,
|
|
293
293
|
allPrivateViews: g
|
|
294
294
|
};
|
|
295
295
|
}, st = ({
|
|
@@ -300,10 +300,10 @@ const je = P.li`
|
|
|
300
300
|
projectName: o,
|
|
301
301
|
currentUser: d,
|
|
302
302
|
useWorkingView: u,
|
|
303
|
-
editingViewId:
|
|
303
|
+
editingViewId: f,
|
|
304
304
|
collapsed: g,
|
|
305
305
|
setCollapsed: i,
|
|
306
|
-
onSelect:
|
|
306
|
+
onSelect: V,
|
|
307
307
|
onEdit: x,
|
|
308
308
|
onSave: $,
|
|
309
309
|
onResetWorkingView: w,
|
|
@@ -313,13 +313,13 @@ const je = P.li`
|
|
|
313
313
|
() => e.map((r) => ({
|
|
314
314
|
...r,
|
|
315
315
|
isOwner: r.owner === d?.name,
|
|
316
|
-
highlighted:
|
|
316
|
+
highlighted: f === r.id ? "save" : void 0
|
|
317
317
|
})),
|
|
318
|
-
[e, d,
|
|
318
|
+
[e, d, f]
|
|
319
319
|
), y = {
|
|
320
320
|
id: ge,
|
|
321
321
|
label: u ? `Personal ${s.toLowerCase()}` : `Working ${s.toLowerCase()}`,
|
|
322
|
-
startContent: u && /* @__PURE__ */
|
|
322
|
+
startContent: u && /* @__PURE__ */ m(de, { icon: "person" }),
|
|
323
323
|
isEditable: !1
|
|
324
324
|
}, D = b(async () => {
|
|
325
325
|
let r = t?.id;
|
|
@@ -333,14 +333,14 @@ const je = P.li`
|
|
|
333
333
|
projectName: o
|
|
334
334
|
}).unwrap(), r = C.id;
|
|
335
335
|
} catch (C) {
|
|
336
|
-
|
|
336
|
+
v.error(`Failed to create working ${s}: ${C}`);
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
}, [t, n, a, o,
|
|
338
|
+
V(r);
|
|
339
|
+
}, [t, n, a, o, V]), _ = async (r) => {
|
|
340
340
|
try {
|
|
341
|
-
await $(r),
|
|
341
|
+
await $(r), V(r);
|
|
342
342
|
} catch (C) {
|
|
343
|
-
|
|
343
|
+
v.error(C);
|
|
344
344
|
}
|
|
345
345
|
}, [W, { isLoading: R }] = Ue({
|
|
346
346
|
addon: "powerpack",
|
|
@@ -352,7 +352,7 @@ const je = P.li`
|
|
|
352
352
|
}), { myViews: S, sharedViews: I, allPrivateViews: k } = W({
|
|
353
353
|
viewsList: h,
|
|
354
354
|
onEdit: x,
|
|
355
|
-
onSelect:
|
|
355
|
+
onSelect: V,
|
|
356
356
|
onSave: _
|
|
357
357
|
}), E = b(
|
|
358
358
|
(r) => {
|
|
@@ -397,7 +397,7 @@ const je = P.li`
|
|
|
397
397
|
}), r;
|
|
398
398
|
}, [L, O, g, E, l, c]);
|
|
399
399
|
}, it = ({ viewType: e, projectName: t }) => {
|
|
400
|
-
const { currentData: n, isLoading: s } =
|
|
400
|
+
const { currentData: n, isLoading: s } = Pe(
|
|
401
401
|
{ viewType: e, projectName: t },
|
|
402
402
|
{ skip: !e }
|
|
403
403
|
), [o] = N(), d = De({}), u = d.current[e];
|
|
@@ -413,7 +413,7 @@ const je = P.li`
|
|
|
413
413
|
projectName: t
|
|
414
414
|
}).unwrap();
|
|
415
415
|
} catch (i) {
|
|
416
|
-
|
|
416
|
+
v.warn(`Failed to set default view: ${i}`);
|
|
417
417
|
}
|
|
418
418
|
}, u, s];
|
|
419
419
|
}, ot = ({
|
|
@@ -424,12 +424,12 @@ const je = P.li`
|
|
|
424
424
|
onDelete: o,
|
|
425
425
|
onUpdate: d
|
|
426
426
|
}) => {
|
|
427
|
-
const u = He(), [
|
|
427
|
+
const u = He(), [f] = j(), [g] = ne(), [i] = ce(), [V] = N(), x = b(
|
|
428
428
|
async (c, a) => {
|
|
429
429
|
if (!e)
|
|
430
430
|
throw new Error("viewType are required for creating a view");
|
|
431
431
|
try {
|
|
432
|
-
await
|
|
432
|
+
await f({
|
|
433
433
|
viewType: e,
|
|
434
434
|
projectName: a ? void 0 : t,
|
|
435
435
|
payload: c
|
|
@@ -438,7 +438,7 @@ const je = P.li`
|
|
|
438
438
|
throw h;
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
|
-
[
|
|
441
|
+
[f, e, t, s]
|
|
442
442
|
), $ = b(
|
|
443
443
|
async (c, a, h) => {
|
|
444
444
|
if (!e)
|
|
@@ -477,13 +477,13 @@ const je = P.li`
|
|
|
477
477
|
throw new Error("viewType are required for resetting a view");
|
|
478
478
|
try {
|
|
479
479
|
u(
|
|
480
|
-
|
|
480
|
+
P.util.invalidateTags([
|
|
481
481
|
{ type: "Views", id: `base-${e}-${t}` },
|
|
482
482
|
{ type: "Views", id: `base-${e}` }
|
|
483
483
|
])
|
|
484
484
|
);
|
|
485
485
|
const S = (await u(
|
|
486
|
-
|
|
486
|
+
P.endpoints.getBaseView.initiate(
|
|
487
487
|
{ viewType: e, projectName: t },
|
|
488
488
|
{ subscribe: !1, forceRefetch: !0 }
|
|
489
489
|
)
|
|
@@ -493,7 +493,7 @@ const je = P.li`
|
|
|
493
493
|
I = S.settings, k = "project";
|
|
494
494
|
else {
|
|
495
495
|
const r = (await u(
|
|
496
|
-
|
|
496
|
+
P.endpoints.getBaseView.initiate(
|
|
497
497
|
{ viewType: e },
|
|
498
498
|
{ subscribe: !1, forceRefetch: !0 }
|
|
499
499
|
)
|
|
@@ -506,7 +506,7 @@ const je = P.li`
|
|
|
506
506
|
viewType: e,
|
|
507
507
|
projectName: t,
|
|
508
508
|
payload: { settings: I }
|
|
509
|
-
}).unwrap() : await
|
|
509
|
+
}).unwrap() : await f({
|
|
510
510
|
viewType: e,
|
|
511
511
|
projectName: t,
|
|
512
512
|
payload: {
|
|
@@ -515,20 +515,20 @@ const je = P.li`
|
|
|
515
515
|
working: !0,
|
|
516
516
|
settings: I
|
|
517
517
|
}
|
|
518
|
-
}).unwrap(), await
|
|
518
|
+
}).unwrap(), await V({
|
|
519
519
|
viewType: e,
|
|
520
520
|
projectName: t,
|
|
521
521
|
setDefaultViewRequestModel: { viewId: E }
|
|
522
522
|
}).unwrap(), y && y(E), D && D(!1), _) {
|
|
523
523
|
const L = k === "project" ? "View reset to project default view" : k === "studio" ? "View reset to studio default view" : "View reset to default settings";
|
|
524
|
-
|
|
524
|
+
v.success(L);
|
|
525
525
|
}
|
|
526
526
|
return E;
|
|
527
527
|
} catch (W) {
|
|
528
|
-
throw _ &&
|
|
528
|
+
throw _ && v.error("Failed to reset view to default"), W;
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
|
-
[
|
|
531
|
+
[f, i, V, e, t, u]
|
|
532
532
|
);
|
|
533
533
|
return {
|
|
534
534
|
onCreateView: x,
|
|
@@ -543,12 +543,12 @@ const je = P.li`
|
|
|
543
543
|
workingView: s,
|
|
544
544
|
dispatch: o
|
|
545
545
|
}) => {
|
|
546
|
-
const [d] = j(), [u] = ce(), [
|
|
546
|
+
const [d] = j(), [u] = ce(), [f] = ne(), [g] = N(), i = b(
|
|
547
547
|
async (w) => {
|
|
548
548
|
try {
|
|
549
549
|
const a = await d({
|
|
550
550
|
payload: {
|
|
551
|
-
label:
|
|
551
|
+
label: fe,
|
|
552
552
|
working: !1,
|
|
553
553
|
settings: n || {}
|
|
554
554
|
},
|
|
@@ -556,20 +556,20 @@ const je = P.li`
|
|
|
556
556
|
projectName: w ? void 0 : t
|
|
557
557
|
}).unwrap();
|
|
558
558
|
o(
|
|
559
|
-
|
|
559
|
+
P.util.invalidateTags([
|
|
560
560
|
{ type: "view", id: a.id },
|
|
561
561
|
J(e, w ? void 0 : t)
|
|
562
562
|
])
|
|
563
563
|
);
|
|
564
564
|
const h = w ? "Studio" : "Project";
|
|
565
|
-
|
|
565
|
+
v.success(`${h} default view created successfully`);
|
|
566
566
|
} catch (l) {
|
|
567
567
|
const c = w ? "studio" : "project";
|
|
568
|
-
|
|
568
|
+
v.error(`Failed to create ${c} base view: ${l?.message || l}`);
|
|
569
569
|
}
|
|
570
570
|
},
|
|
571
571
|
[d, e, t, n, o]
|
|
572
|
-
),
|
|
572
|
+
), V = b(
|
|
573
573
|
async (w, l) => {
|
|
574
574
|
try {
|
|
575
575
|
await u({
|
|
@@ -578,47 +578,47 @@ const je = P.li`
|
|
|
578
578
|
projectName: l ? void 0 : t,
|
|
579
579
|
payload: { settings: n || {} }
|
|
580
580
|
}).unwrap(), o(
|
|
581
|
-
|
|
581
|
+
P.util.invalidateTags([
|
|
582
582
|
{ type: "view", id: w },
|
|
583
583
|
J(e, l ? void 0 : t)
|
|
584
584
|
])
|
|
585
585
|
);
|
|
586
586
|
const a = l ? "Studio" : "Project";
|
|
587
|
-
|
|
587
|
+
v.success(`${a} default view updated successfully`);
|
|
588
588
|
} catch (c) {
|
|
589
589
|
const a = l ? "studio" : "project";
|
|
590
|
-
|
|
590
|
+
v.error(`Failed to update ${a} base view: ${c?.message || c}`);
|
|
591
591
|
}
|
|
592
592
|
},
|
|
593
593
|
[u, e, t, n, o]
|
|
594
594
|
), x = b(
|
|
595
595
|
async (w, l) => {
|
|
596
596
|
try {
|
|
597
|
-
await
|
|
597
|
+
await f({
|
|
598
598
|
viewId: w,
|
|
599
599
|
viewType: e,
|
|
600
600
|
projectName: l ? void 0 : t
|
|
601
601
|
}).unwrap(), o(
|
|
602
|
-
|
|
602
|
+
P.util.invalidateTags([
|
|
603
603
|
{ type: "view", id: w },
|
|
604
604
|
J(e, l ? void 0 : t)
|
|
605
605
|
])
|
|
606
606
|
);
|
|
607
607
|
const c = l ? "Studio" : "Project";
|
|
608
|
-
|
|
608
|
+
v.success(`${c} default view removed successfully`);
|
|
609
609
|
} catch (c) {
|
|
610
610
|
const a = l ? "studio" : "project";
|
|
611
|
-
|
|
611
|
+
v.error(`Failed to remove ${a} base view: ${c?.message || c}`);
|
|
612
612
|
}
|
|
613
613
|
},
|
|
614
|
-
[
|
|
614
|
+
[f, e, t, o]
|
|
615
615
|
), $ = b(
|
|
616
616
|
async (w) => {
|
|
617
617
|
try {
|
|
618
618
|
if (!s?.id)
|
|
619
619
|
throw new Error("No working view available to update");
|
|
620
620
|
const a = (await o(
|
|
621
|
-
|
|
621
|
+
P.endpoints.getBaseView.initiate(
|
|
622
622
|
{
|
|
623
623
|
viewType: e,
|
|
624
624
|
projectName: w ? void 0 : t
|
|
@@ -639,21 +639,21 @@ const je = P.li`
|
|
|
639
639
|
setDefaultViewRequestModel: { viewId: s.id }
|
|
640
640
|
}).unwrap();
|
|
641
641
|
const h = w ? "Studio" : "Project";
|
|
642
|
-
|
|
642
|
+
v.success(`Loaded ${h} default view to working view`);
|
|
643
643
|
} catch (l) {
|
|
644
644
|
const c = w ? "studio" : "project";
|
|
645
|
-
|
|
645
|
+
v.error(`Failed to load ${c} base view: ${l?.message || l}`);
|
|
646
646
|
}
|
|
647
647
|
},
|
|
648
648
|
[s, u, g, e, t, o]
|
|
649
649
|
);
|
|
650
650
|
return {
|
|
651
651
|
onCreateBaseView: i,
|
|
652
|
-
onUpdateBaseView:
|
|
652
|
+
onUpdateBaseView: V,
|
|
653
653
|
onDeleteBaseView: x,
|
|
654
654
|
onLoadBaseView: $
|
|
655
655
|
};
|
|
656
|
-
},
|
|
656
|
+
}, Ve = (e, t) => e ? t.find((s) => s.id === e)?.scope === "studio" : !0, at = ({
|
|
657
657
|
viewType: e,
|
|
658
658
|
projectName: t,
|
|
659
659
|
viewsList: n,
|
|
@@ -671,10 +671,10 @@ const je = P.li`
|
|
|
671
671
|
{
|
|
672
672
|
settings: s
|
|
673
673
|
},
|
|
674
|
-
|
|
675
|
-
),
|
|
676
|
-
} catch (
|
|
677
|
-
const g = typeof
|
|
674
|
+
Ve(u, n)
|
|
675
|
+
), v.success("View settings saved");
|
|
676
|
+
} catch (f) {
|
|
677
|
+
const g = typeof f == "string" ? "Failed to save view settings: " + f : "Failed to save view settings";
|
|
678
678
|
throw console.error(g), g;
|
|
679
679
|
}
|
|
680
680
|
},
|
|
@@ -699,7 +699,7 @@ const je = P.li`
|
|
|
699
699
|
}) => {
|
|
700
700
|
let { powerLicense: u } = ue();
|
|
701
701
|
d?.powerLicense !== void 0 && (console.warn("Using debug power license:", d.powerLicense), u = d.powerLicense);
|
|
702
|
-
const { user:
|
|
702
|
+
const { user: f } = Qe(), [g, i] = Y(!1), [V, x] = Y(null), $ = "viewsMenuCollapsed", [w, l] = Ke(
|
|
703
703
|
$,
|
|
704
704
|
{}
|
|
705
705
|
), c = (p) => {
|
|
@@ -708,9 +708,9 @@ const je = P.li`
|
|
|
708
708
|
const ie = { ...w };
|
|
709
709
|
ie[U] = !1, l(ie);
|
|
710
710
|
}
|
|
711
|
-
}, { data: a } =
|
|
711
|
+
}, { data: a } = Me(
|
|
712
712
|
{ projectName: s },
|
|
713
|
-
{ skip: !u || !
|
|
713
|
+
{ skip: !u || !V }
|
|
714
714
|
), [h, y, D, _] = it({
|
|
715
715
|
viewType: t,
|
|
716
716
|
projectName: s
|
|
@@ -721,7 +721,7 @@ const je = P.li`
|
|
|
721
721
|
{ skip: !t }
|
|
722
722
|
), k = F(
|
|
723
723
|
() => S.filter(
|
|
724
|
-
(p) => p.label !==
|
|
724
|
+
(p) => p.label !== fe && !(s && p.working && p.scope === "studio")
|
|
725
725
|
),
|
|
726
726
|
[S]
|
|
727
727
|
), { onCreateView: E, onDeleteView: O, onUpdateView: L, onResetWorkingView: q } = ot({
|
|
@@ -742,16 +742,16 @@ const je = P.li`
|
|
|
742
742
|
), { currentData: H, isLoading: pe } = oe(
|
|
743
743
|
{ projectName: void 0, viewType: t },
|
|
744
744
|
{ skip: !t }
|
|
745
|
-
),
|
|
745
|
+
), ve = I || _ || C || Q || pe, T = r?.settings, z = h?.id === ge ? T : h?.settings, ee = h?.id === r?.id, te = W && ee && D && D !== r?.id ? D : void 0, { currentData: A, isFetching: me } = Re(
|
|
746
746
|
{
|
|
747
|
-
viewId:
|
|
748
|
-
projectName:
|
|
747
|
+
viewId: V,
|
|
748
|
+
projectName: Ve(V, k) ? void 0 : s,
|
|
749
749
|
viewType: t
|
|
750
750
|
},
|
|
751
|
-
{ skip: typeof
|
|
751
|
+
{ skip: typeof V != "string" || !u }
|
|
752
752
|
), be = F(
|
|
753
|
-
() =>
|
|
754
|
-
[
|
|
753
|
+
() => V === A?.id ? A : void 0,
|
|
754
|
+
[V, A]
|
|
755
755
|
), { onSaveViewFromCurrent: ke } = at({
|
|
756
756
|
viewType: t,
|
|
757
757
|
projectName: s,
|
|
@@ -791,7 +791,7 @@ const je = P.li`
|
|
|
791
791
|
viewType: t,
|
|
792
792
|
viewAlias: n,
|
|
793
793
|
projectName: s,
|
|
794
|
-
currentUser:
|
|
794
|
+
currentUser: f,
|
|
795
795
|
useWorkingView: !u,
|
|
796
796
|
editingViewId: te,
|
|
797
797
|
selectedId: h?.id,
|
|
@@ -808,12 +808,12 @@ const je = P.li`
|
|
|
808
808
|
viewAlias: n,
|
|
809
809
|
projectName: s,
|
|
810
810
|
isMenuOpen: g,
|
|
811
|
-
editingView:
|
|
812
|
-
currentUser:
|
|
811
|
+
editingView: V,
|
|
812
|
+
currentUser: f,
|
|
813
813
|
selectedView: h,
|
|
814
814
|
viewSettings: z,
|
|
815
815
|
editingViewData: be,
|
|
816
|
-
isLoadingEditingViewData:
|
|
816
|
+
isLoadingEditingViewData: me,
|
|
817
817
|
viewsList: k,
|
|
818
818
|
// Working view
|
|
819
819
|
workingSettings: T,
|
|
@@ -830,7 +830,7 @@ const je = P.li`
|
|
|
830
830
|
onLoadBaseView: Se,
|
|
831
831
|
editingViewId: te,
|
|
832
832
|
viewMenuItems: Be,
|
|
833
|
-
isLoadingViews:
|
|
833
|
+
isLoadingViews: ve,
|
|
834
834
|
isErrorWorkingView: B,
|
|
835
835
|
// data
|
|
836
836
|
shareOptions: a,
|
|
@@ -845,10 +845,10 @@ const je = P.li`
|
|
|
845
845
|
// shared actions
|
|
846
846
|
resetWorkingView: se,
|
|
847
847
|
// api
|
|
848
|
-
api:
|
|
848
|
+
api: P,
|
|
849
849
|
dispatch: o
|
|
850
850
|
};
|
|
851
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ m(he.Provider, { value: $e, children: e });
|
|
852
852
|
}, lt = () => {
|
|
853
853
|
const e = Ee(he);
|
|
854
854
|
if (!e)
|
|
@@ -856,7 +856,7 @@ const je = P.li`
|
|
|
856
856
|
return e;
|
|
857
857
|
};
|
|
858
858
|
export {
|
|
859
|
-
|
|
859
|
+
fe as B,
|
|
860
860
|
Lt as N,
|
|
861
861
|
Ne as S,
|
|
862
862
|
Bt as V,
|
|
@@ -869,7 +869,7 @@ export {
|
|
|
869
869
|
rt as f,
|
|
870
870
|
we as g,
|
|
871
871
|
st as h,
|
|
872
|
-
|
|
872
|
+
Ve as i,
|
|
873
873
|
at as j,
|
|
874
874
|
it as k,
|
|
875
875
|
ot as l,
|