@ynput/ayon-frontend-shared 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ContextMenu.es.js +34 -16
- package/dist/DetailsPanel.es.js +292 -298
- package/dist/Feed.es.js +179 -50
- package/dist/ListTable.es.js +32 -35
- package/dist/NewEntity.es.js +1256 -11
- package/dist/ProjectTreeTable.es.js +4451 -2965
- package/dist/SimpleTable.es.js +8 -7
- package/dist/Slicer.es.js +451 -147
- package/dist/Views.es.js +918 -310
- package/dist/chunks/Actions.es.js +9 -4
- package/dist/chunks/ColumnDropIndicator.es.js +174 -328
- package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
- package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
- package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
- package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
- package/dist/chunks/EmptyPlaceholder.es.js +4 -4
- package/dist/chunks/EntityPath.es.js +58 -53
- package/dist/chunks/EntityPickerDialog.es.js +24 -20
- package/dist/chunks/EntityTooltip.es.js +20 -13
- package/dist/chunks/EntityUpdatesContext.es.js +38 -96
- package/dist/chunks/Feed.es.js +1495 -1439
- package/dist/chunks/FilterErrorActions.es.js +25 -229
- package/dist/chunks/Menu.es.js +21 -17
- package/dist/chunks/MenuContext.es.js +14 -65
- package/dist/chunks/MenuItem.es.js +34 -24
- package/dist/chunks/MetaWidget.es.js +2835 -4301
- package/dist/chunks/NewEntityContextInstance.es.js +11 -0
- package/dist/chunks/PlayableIcon.es.js +1532 -1594
- package/dist/chunks/ProjectContext.es.js +102 -66
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +457 -458
- package/dist/chunks/SimpleForm.es.js +9 -9
- package/dist/chunks/SimpleTable.es.js +15 -13
- package/dist/chunks/Slicer.es.js +163 -154
- package/dist/chunks/TableSettingsFallback.es.js +25 -13
- package/dist/chunks/ThumbnailSimple.es.js +150 -261
- package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
- package/dist/chunks/VideoPlayer.es.js +24 -28
- package/dist/chunks/Watchers.es.js +384 -389
- package/dist/chunks/entityDefinitions.es.js +2 -350
- package/dist/chunks/extractVersionFromFilename.es.js +28 -0
- package/dist/chunks/getBundleMode.es.js +61 -16
- package/dist/chunks/getUris.es.js +737 -712
- package/dist/chunks/searchTerms.es.js +57 -56
- package/dist/chunks/useAttributeEnums.es.js +4 -4
- package/dist/chunks/useCreateContextMenu.es.js +66 -90
- package/dist/chunks/useHierarchySelection.es.js +24 -0
- package/dist/chunks/useLoadModule.es.js +74 -0
- package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
- package/dist/chunks/versionUploadHelpers.es.js +16 -42
- package/dist/chunks/viewUpdateHelper.es.js +67 -50
- package/dist/components.es.js +1425 -999
- package/dist/context.es.js +791 -80
- package/dist/hooks.es.js +115 -120
- package/dist/index.es.js +19 -23
- package/dist/types/Actions.d.ts +7 -7
- package/dist/types/ContextMenu.d.ts +11 -8
- package/dist/types/DetailsPanel.d.ts +102 -9
- package/dist/types/EntityPickerDialog.d.ts +7 -7
- package/dist/types/Feed.d.ts +11 -8
- package/dist/types/ListTable.d.ts +7 -7
- package/dist/types/NewEntity.d.ts +16 -10
- package/dist/types/ProjectTreeTable.d.ts +22 -115
- package/dist/types/RepresentationsList.d.ts +7 -7
- package/dist/types/SimpleTable.d.ts +11 -8
- package/dist/types/Slicer.d.ts +10 -7
- package/dist/types/Views.d.ts +10 -7
- package/dist/types/api.d.ts +132 -120
- package/dist/types/components.d.ts +13 -8
- package/dist/types/context.d.ts +56 -16
- package/dist/types/hooks.d.ts +7 -7
- package/dist/types/index.d.ts +7 -7
- package/dist/types/util.d.ts +12 -7
- package/dist/util.es.js +72 -71
- package/package.json +1 -1
- package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
- package/dist/chunks/DetailsPanelContext.es.js +0 -155
- package/dist/chunks/GlobalContext.es.js +0 -52
- package/dist/chunks/NewEntityContext.es.js +0 -1242
- package/dist/chunks/ProjectFoldersContext.es.js +0 -134
- package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
- package/dist/chunks/VersionUploadContext.es.js +0 -232
- package/dist/chunks/ViewsContext.es.js +0 -878
- package/dist/chunks/uriUtils.es.js +0 -48
- package/dist/chunks/useColumnDragRestriction.es.js +0 -158
- package/dist/chunks/useLocalStorage.es.js +0 -355
- package/dist/chunks/useSessionStorage.es.js +0 -61
- /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
|
@@ -1,345 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as ue } from "react/jsx-runtime";
|
|
3
|
-
import { useState as Se, useEffect as M, useRef as I, useCallback as S, useMemo as G, useContext as ae } from "react";
|
|
4
|
-
import { r as U, w as ie, u as ye } from "./useSessionStorage.es.js";
|
|
5
|
-
import { S as he, b as X } from "./MetaWidget.es.js";
|
|
6
|
-
const fe = () => {
|
|
7
|
-
const r = () => ({
|
|
8
|
-
formatStatuses: () => [],
|
|
9
|
-
formatTaskTypes: () => [],
|
|
10
|
-
formatTypes: () => [],
|
|
11
|
-
formatAssignees: () => [],
|
|
12
|
-
formatAttribute: () => [],
|
|
13
|
-
formatProductTypes: () => [],
|
|
14
|
-
formatAuthors: () => []
|
|
15
|
-
}), { powerLicense: n } = W(), [c, { isLoading: a }] = ce({
|
|
16
|
-
addon: "powerpack",
|
|
17
|
-
remote: "slicer",
|
|
18
|
-
module: "useExtraSlices",
|
|
19
|
-
fallback: r,
|
|
20
|
-
skip: !n
|
|
21
|
-
// skip loading if powerpack license is not available
|
|
22
|
-
}), [h] = ce({
|
|
23
|
-
addon: "powerpack",
|
|
24
|
-
remote: "slicer",
|
|
25
|
-
module: "SlicerDropdown",
|
|
26
|
-
fallback: he,
|
|
27
|
-
skip: !n
|
|
28
|
-
// skip loading if powerpack license is not available
|
|
29
|
-
});
|
|
30
|
-
return { useExtraSlices: c, isLoadingExtraSlices: a, SlicerDropdown: h };
|
|
31
|
-
}, xe = ["slicer-selection-", "slicer-expanded-"], oe = (r, n, c) => c === "hierarchy" ? `slicer-selection-hierarchy-${r}` : `slicer-selection-${r}-${n}-${c}`, re = (r, n, c) => c === "hierarchy" ? `slicer-expanded-hierarchy-${r}` : `slicer-expanded-${r}-${n}-${c}`, ve = ({
|
|
32
|
-
sliceTypes: r,
|
|
33
|
-
page: n,
|
|
34
|
-
projectName: c,
|
|
35
|
-
...a
|
|
36
|
-
}) => {
|
|
37
|
-
const [h, _] = Se(0);
|
|
38
|
-
M(() => {
|
|
39
|
-
const e = (i) => {
|
|
40
|
-
const o = i.detail?.key ?? ("key" in i ? i.key : void 0);
|
|
41
|
-
o && !xe.some((y) => o.startsWith(y)) || _((y) => y + 1);
|
|
42
|
-
};
|
|
43
|
-
return window.addEventListener("session-storage", e), window.addEventListener("storage", e), () => {
|
|
44
|
-
window.removeEventListener("session-storage", e), window.removeEventListener("storage", e);
|
|
45
|
-
};
|
|
46
|
-
}, []);
|
|
47
|
-
const L = I(/* @__PURE__ */ new Map()), f = S((e, i) => {
|
|
48
|
-
const o = typeof window > "u" ? null : sessionStorage.getItem(e), y = L.current.get(e);
|
|
49
|
-
if (y && y.raw === o) return y.value;
|
|
50
|
-
const T = U(e, i);
|
|
51
|
-
return L.current.set(e, { raw: o, value: T }), T;
|
|
52
|
-
}, []), s = r[0], u = S(
|
|
53
|
-
(e) => a.rowSelection !== void 0 && e === s ? a.rowSelection : f(oe(c, n, e), {}),
|
|
54
|
-
// storageVersion invalidates memoized reads when any bucket changes
|
|
55
|
-
[a.rowSelection, s, c, n, f, h]
|
|
56
|
-
), x = S(
|
|
57
|
-
(e, i) => {
|
|
58
|
-
if (a.setRowSelection && e === s) {
|
|
59
|
-
a.setRowSelection(i);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const o = oe(c, n, e), y = typeof i == "function" ? i(f(o, {})) : i;
|
|
63
|
-
ie(o, y);
|
|
64
|
-
},
|
|
65
|
-
[a.setRowSelection, s, c, n, f]
|
|
66
|
-
), D = S(
|
|
67
|
-
(e) => a.expanded !== void 0 && e === s ? a.expanded : f(re(c, n, e), {}),
|
|
68
|
-
[a.expanded, s, c, n, f, h]
|
|
69
|
-
), P = S(
|
|
70
|
-
(e, i) => {
|
|
71
|
-
if (a.setExpanded && e === s) {
|
|
72
|
-
a.setExpanded(i);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const o = re(c, n, e), y = typeof i == "function" ? i(f(o, {})) : i;
|
|
76
|
-
ie(o, y);
|
|
77
|
-
},
|
|
78
|
-
[a.setExpanded, s, c, n, f]
|
|
79
|
-
), w = u(s), b = S(
|
|
80
|
-
(e, i = s) => x(i, e),
|
|
81
|
-
[x, s]
|
|
82
|
-
), k = D(s), g = S(
|
|
83
|
-
(e, i = s) => P(i, e),
|
|
84
|
-
[P, s]
|
|
85
|
-
);
|
|
86
|
-
return {
|
|
87
|
-
rowSelection: w,
|
|
88
|
-
setRowSelection: b,
|
|
89
|
-
expanded: k,
|
|
90
|
-
setExpanded: g,
|
|
91
|
-
getPanelSelection: u,
|
|
92
|
-
setPanelSelection: x,
|
|
93
|
-
getPanelExpanded: D,
|
|
94
|
-
setPanelExpanded: P
|
|
95
|
-
};
|
|
96
|
-
}, be = {
|
|
97
|
-
progress: {
|
|
98
|
-
fields: [
|
|
99
|
-
{ value: "hierarchy" },
|
|
100
|
-
{ value: "assignees" },
|
|
101
|
-
{ value: "status" },
|
|
102
|
-
{ value: "taskType" }
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
overview: {
|
|
106
|
-
fields: [
|
|
107
|
-
{ value: "hierarchy" },
|
|
108
|
-
{ value: "assignees" },
|
|
109
|
-
{ value: "status" },
|
|
110
|
-
{ value: "type" },
|
|
111
|
-
{ value: "taskType" },
|
|
112
|
-
{ value: "attributes" },
|
|
113
|
-
{ value: "entityList" }
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
versions: {
|
|
117
|
-
fields: [
|
|
118
|
-
{ value: "hierarchy" },
|
|
119
|
-
{ value: "assignees", label: "Task assignee" },
|
|
120
|
-
{ value: "status", label: "Version status" },
|
|
121
|
-
{ value: "author", label: "Version author" },
|
|
122
|
-
{ value: "productType" },
|
|
123
|
-
{ value: "taskType" },
|
|
124
|
-
{ value: "entityList" }
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
}, le = ["overview", "products"], Te = ({
|
|
128
|
-
children: r,
|
|
129
|
-
page: n,
|
|
130
|
-
projectName: c,
|
|
131
|
-
viewSettings: a,
|
|
132
|
-
isLoadingViews: h,
|
|
133
|
-
updateViewSettings: _,
|
|
134
|
-
onOpenViewer: L,
|
|
135
|
-
onAddToList: f,
|
|
136
|
-
...s
|
|
137
|
-
}) => {
|
|
138
|
-
const [u, x] = ye(
|
|
139
|
-
`slicer-pinned-slice-${n}`,
|
|
140
|
-
null
|
|
141
|
-
), { powerLicense: D } = W(), P = a, w = P?.sliceTypes, b = P?.sliceType, k = w?.length ? b && b !== w[0] ? [b, ...w.slice(1)] : w : [b ?? "hierarchy"], g = le.includes(n) && !s.sliceType && !w?.length && k[0] !== "hierarchy" && u?.sliceType === "hierarchy" && Object.values(u.rowSelection || {}).some(Boolean), e = G(
|
|
142
|
-
() => [
|
|
143
|
-
...new Set(
|
|
144
|
-
s.sliceType ? [s.sliceType] : g ? [...k, "hierarchy"] : k
|
|
145
|
-
)
|
|
146
|
-
],
|
|
147
|
-
[s.sliceType, k.join("|"), g]
|
|
148
|
-
), i = P?.collapsedSliceTypes, o = G(() => i ?? [], [i?.join("|")]), y = G(
|
|
149
|
-
() => e.map((t) => ({ id: t, sliceType: t })),
|
|
150
|
-
[e]
|
|
151
|
-
), T = y[0].sliceType, {
|
|
152
|
-
rowSelection: A,
|
|
153
|
-
setRowSelection: K,
|
|
154
|
-
expanded: O,
|
|
155
|
-
setExpanded: B,
|
|
156
|
-
getPanelSelection: H,
|
|
157
|
-
setPanelSelection: R,
|
|
158
|
-
getPanelExpanded: q,
|
|
159
|
-
setPanelExpanded: C
|
|
160
|
-
} = ve({
|
|
161
|
-
sliceTypes: e,
|
|
162
|
-
page: n,
|
|
163
|
-
projectName: c,
|
|
164
|
-
...s
|
|
165
|
-
}), z = S(
|
|
166
|
-
(t) => {
|
|
167
|
-
K(t);
|
|
168
|
-
},
|
|
169
|
-
[K]
|
|
170
|
-
), v = S(
|
|
171
|
-
(t, d) => {
|
|
172
|
-
const l = () => {
|
|
173
|
-
};
|
|
174
|
-
_(
|
|
175
|
-
{
|
|
176
|
-
sliceTypes: t,
|
|
177
|
-
sliceType: t[0],
|
|
178
|
-
collapsedSliceTypes: (d ?? o).filter((m) => t.includes(m))
|
|
179
|
-
},
|
|
180
|
-
l,
|
|
181
|
-
l,
|
|
182
|
-
{}
|
|
183
|
-
);
|
|
184
|
-
},
|
|
185
|
-
[_, o]
|
|
186
|
-
), J = S(
|
|
187
|
-
(t) => {
|
|
188
|
-
const d = o.includes(t) ? o.filter((l) => l !== t) : [...o, t];
|
|
189
|
-
v(e, d);
|
|
190
|
-
},
|
|
191
|
-
[o, v, e]
|
|
192
|
-
), $ = `${c}-${n}`, Q = I(/* @__PURE__ */ new Set());
|
|
193
|
-
M(() => {
|
|
194
|
-
!g || h || Q.current.has($) || (Q.current.add($), Object.keys(H("hierarchy")).length || (R("hierarchy", u.rowSelection), C("hierarchy", u.expanded)), v(e));
|
|
195
|
-
}, [g, h, $]);
|
|
196
|
-
const Y = I(/* @__PURE__ */ new Set());
|
|
197
|
-
M(() => {
|
|
198
|
-
if (Y.current.has($) || h || s.sliceType || s.rowSelection || s.setRowSelection || w?.length)
|
|
199
|
-
return;
|
|
200
|
-
Y.current.add($);
|
|
201
|
-
const t = `slicer-selection-${c}-${n}`, d = `slicer-expanded-${c}-${n}`, l = k[0];
|
|
202
|
-
if (l !== "hierarchy") {
|
|
203
|
-
const m = U(t, null);
|
|
204
|
-
if (m && Object.keys(m).length) {
|
|
205
|
-
R(
|
|
206
|
-
l,
|
|
207
|
-
(ne) => Object.keys(ne).length ? ne : m
|
|
208
|
-
);
|
|
209
|
-
const E = U(d, null);
|
|
210
|
-
E && C(l, E);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
sessionStorage.removeItem(t), sessionStorage.removeItem(d);
|
|
214
|
-
}, [h, w, $]), M(() => {
|
|
215
|
-
le.includes(n) && !s.sliceType && !h && u && !g && x(null);
|
|
216
|
-
}, [n, s.sliceType, h, u, g, x]);
|
|
217
|
-
const Z = S(
|
|
218
|
-
(t, d) => {
|
|
219
|
-
if (D && e.slice(1).includes(t)) return;
|
|
220
|
-
s.onSliceTypeChange ? s.onSliceTypeChange(t, d) : v([t, ...e.slice(1).filter((E) => E !== t)]);
|
|
221
|
-
const l = (E) => s.setRowSelection ? s.setRowSelection(E) : K(E, t), m = (E) => s.setExpanded ? s.setExpanded(E) : B(E, t);
|
|
222
|
-
u && t === u.sliceType ? (l(u.rowSelection), m(u.expanded), x(null)) : t !== "hierarchy" && (l({}), m({})), d && x({
|
|
223
|
-
sliceType: T,
|
|
224
|
-
rowSelection: A,
|
|
225
|
-
expanded: O
|
|
226
|
-
});
|
|
227
|
-
},
|
|
228
|
-
[
|
|
229
|
-
v,
|
|
230
|
-
e,
|
|
231
|
-
A,
|
|
232
|
-
K,
|
|
233
|
-
u,
|
|
234
|
-
x,
|
|
235
|
-
O,
|
|
236
|
-
B,
|
|
237
|
-
s.setRowSelection,
|
|
238
|
-
s.setExpanded,
|
|
239
|
-
D
|
|
240
|
-
]
|
|
241
|
-
), F = S(
|
|
242
|
-
(t) => {
|
|
243
|
-
t !== "hierarchy" && (R(t, {}), C(t, {}));
|
|
244
|
-
},
|
|
245
|
-
[R, C]
|
|
246
|
-
), V = S(
|
|
247
|
-
(t) => {
|
|
248
|
-
!t || e.includes(t) || (v([...e, t]), F(t));
|
|
249
|
-
},
|
|
250
|
-
[e, v, F]
|
|
251
|
-
), j = S(
|
|
252
|
-
(t) => {
|
|
253
|
-
if (e.length <= 1 || !e.includes(t)) return;
|
|
254
|
-
const d = e.filter((l) => l !== t);
|
|
255
|
-
v(d, d.length > 1 ? void 0 : []);
|
|
256
|
-
},
|
|
257
|
-
[e, v]
|
|
258
|
-
), p = S(
|
|
259
|
-
(t, d) => {
|
|
260
|
-
!e.includes(t) || e.includes(d) || (v(
|
|
261
|
-
e.map((l) => l === t ? d : l),
|
|
262
|
-
o.map((l) => l === t ? d : l)
|
|
263
|
-
), F(d));
|
|
264
|
-
},
|
|
265
|
-
[e, v, F, o]
|
|
266
|
-
), N = S(
|
|
267
|
-
(t) => {
|
|
268
|
-
B(t);
|
|
269
|
-
},
|
|
270
|
-
[B]
|
|
271
|
-
), { useExtraSlices: ee, isLoadingExtraSlices: te, SlicerDropdown: se } = fe(), de = G(
|
|
272
|
-
() => ({
|
|
273
|
-
projectName: c,
|
|
274
|
-
page: n,
|
|
275
|
-
useExtraSlices: ee,
|
|
276
|
-
isLoadingExtraSlices: te,
|
|
277
|
-
SlicerDropdown: se,
|
|
278
|
-
// SLICE TYPE
|
|
279
|
-
sliceType: T,
|
|
280
|
-
onSliceTypeChange: Z,
|
|
281
|
-
// SLICE PANELS
|
|
282
|
-
slices: y,
|
|
283
|
-
addSlicePanel: V,
|
|
284
|
-
removeSlicePanel: j,
|
|
285
|
-
setPanelSliceType: p,
|
|
286
|
-
getPanelSelection: H,
|
|
287
|
-
setPanelSelection: R,
|
|
288
|
-
getPanelExpanded: q,
|
|
289
|
-
setPanelExpanded: C,
|
|
290
|
-
collapsedPanels: o,
|
|
291
|
-
togglePanelCollapsed: J,
|
|
292
|
-
// ROW SELECTION
|
|
293
|
-
rowSelection: A,
|
|
294
|
-
onRowSelectionChange: z,
|
|
295
|
-
// PINNED SLICE
|
|
296
|
-
pinnedSlice: u,
|
|
297
|
-
setPinnedSlice: x,
|
|
298
|
-
expanded: O,
|
|
299
|
-
onExpandedChange: N,
|
|
300
|
-
// loading state
|
|
301
|
-
isViewSyncPending: h,
|
|
302
|
-
onOpenViewer: L,
|
|
303
|
-
onAddToList: f
|
|
304
|
-
}),
|
|
305
|
-
[
|
|
306
|
-
n,
|
|
307
|
-
ee,
|
|
308
|
-
te,
|
|
309
|
-
se,
|
|
310
|
-
T,
|
|
311
|
-
Z,
|
|
312
|
-
y,
|
|
313
|
-
o,
|
|
314
|
-
J,
|
|
315
|
-
V,
|
|
316
|
-
j,
|
|
317
|
-
p,
|
|
318
|
-
H,
|
|
319
|
-
R,
|
|
320
|
-
q,
|
|
321
|
-
C,
|
|
322
|
-
A,
|
|
323
|
-
z,
|
|
324
|
-
u,
|
|
325
|
-
x,
|
|
326
|
-
O,
|
|
327
|
-
N,
|
|
328
|
-
h,
|
|
329
|
-
L,
|
|
330
|
-
f
|
|
331
|
-
]
|
|
332
|
-
);
|
|
333
|
-
return /* @__PURE__ */ ue(X.Provider, { value: de, children: r });
|
|
334
|
-
}, Re = () => {
|
|
335
|
-
const r = ae(X);
|
|
336
|
-
if (r === void 0)
|
|
337
|
-
throw new Error("useSlicerContext must be used within a SlicerProvider");
|
|
338
|
-
return r;
|
|
339
|
-
}, Ee = () => ae(X), Ce = () => {
|
|
340
|
-
const r = Ee(), { powerLicense: n } = W();
|
|
341
|
-
return r ? (n ? r.slices : r.slices?.slice(0, 1))?.some((a) => a.sliceType === "hierarchy") ? r.getPanelSelection("hierarchy") : r.pinnedSlice?.rowSelection ?? null : null;
|
|
342
|
-
}, $e = {
|
|
1
|
+
const e = {
|
|
343
2
|
folder: {
|
|
344
3
|
label: "Folder",
|
|
345
4
|
createLabel: "Create folder",
|
|
@@ -352,12 +11,5 @@ const fe = () => {
|
|
|
352
11
|
}
|
|
353
12
|
};
|
|
354
13
|
export {
|
|
355
|
-
|
|
356
|
-
Te as a,
|
|
357
|
-
Ce as b,
|
|
358
|
-
Ee as c,
|
|
359
|
-
fe as d,
|
|
360
|
-
ve as e,
|
|
361
|
-
$e as n,
|
|
362
|
-
Re as u
|
|
14
|
+
e as n
|
|
363
15
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function c(s) {
|
|
2
|
+
const e = s.replace(/\.[^/.]+$/, ""), r = [
|
|
3
|
+
// Pattern: file_v001, file_v1, file_v01 (with 'v' prefix)
|
|
4
|
+
/.*[_\-\s]v(\d+)(?:[_\-\s].*|$)/i,
|
|
5
|
+
// Pattern: file_001, file_01, file_1 (at end of filename)
|
|
6
|
+
/.*[_\-\s](\d+)$/,
|
|
7
|
+
// Pattern: file_001_name, file_1_description (version in middle)
|
|
8
|
+
/.*[_\-\s](\d{2,})(?:[_\-\s].*)/,
|
|
9
|
+
// Pattern: 001_file, 1_file (at start of filename)
|
|
10
|
+
/^(\d+)[_\-\s]/,
|
|
11
|
+
// Pattern: fileV1, fileV001 (no separator)
|
|
12
|
+
/.*v(\d+)$/i,
|
|
13
|
+
// Pattern: file1, file001 (number at end, no separator)
|
|
14
|
+
/.*?(\d{2,})$/
|
|
15
|
+
];
|
|
16
|
+
for (const o of r) {
|
|
17
|
+
const n = e.match(o);
|
|
18
|
+
if (n) {
|
|
19
|
+
const a = n[1], t = parseInt(a, 10);
|
|
20
|
+
if (!isNaN(t) && t > 0)
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
c as e
|
|
28
|
+
};
|
|
@@ -1,23 +1,68 @@
|
|
|
1
|
-
import { b2 as
|
|
2
|
-
import { toast as
|
|
3
|
-
const
|
|
4
|
-
const [
|
|
5
|
-
return
|
|
1
|
+
import { b2 as g } from "./searchTerms.es.js";
|
|
2
|
+
import { toast as f } from "react-toastify";
|
|
3
|
+
const p = (t) => {
|
|
4
|
+
const s = t.split("://")[1].split("?"), e = s[0], r = s[1];
|
|
5
|
+
return {
|
|
6
|
+
baseUri: e,
|
|
7
|
+
queryParams: new URLSearchParams(r || "")
|
|
8
|
+
};
|
|
9
|
+
}, P = ({
|
|
10
|
+
projectName: t,
|
|
11
|
+
folderPath: s,
|
|
12
|
+
taskName: e,
|
|
13
|
+
productName: r,
|
|
14
|
+
versionName: a
|
|
15
|
+
}) => {
|
|
16
|
+
const n = new URL(`ayon+entity://${t}/${s}`);
|
|
17
|
+
return e && n.searchParams.append("task", e), r && n.searchParams.append("product", r), a && n.searchParams.append("version", a), n.toString();
|
|
18
|
+
}, u = (t) => {
|
|
19
|
+
const { baseUri: s, queryParams: e } = p(t), r = s.split("/"), a = r[0], n = r.slice(1), [o, c] = a.split(":"), d = e.get("site") ?? void 0, i = e.get("project") ?? void 0;
|
|
20
|
+
return {
|
|
21
|
+
addonName: o,
|
|
22
|
+
addonVersion: c,
|
|
23
|
+
settingsPath: n,
|
|
24
|
+
site: d,
|
|
25
|
+
project: i
|
|
26
|
+
};
|
|
27
|
+
}, l = (t) => {
|
|
28
|
+
const { baseUri: s, queryParams: e } = p(t), r = s.split("/"), a = r[0], n = r.slice(1).join("/"), o = e.get("task") ?? void 0, c = e.get("product") ?? void 0, d = e.get("version") ?? void 0;
|
|
29
|
+
let i;
|
|
30
|
+
return d ? i = "version" : c ? i = "product" : o ? i = "task" : i = "folder", {
|
|
31
|
+
projectName: a,
|
|
32
|
+
entityType: i,
|
|
33
|
+
folderPath: n,
|
|
34
|
+
taskName: o,
|
|
35
|
+
productName: c,
|
|
36
|
+
versionName: d
|
|
37
|
+
};
|
|
38
|
+
}, U = (t) => t ? t.startsWith("ayon+settings://") ? {
|
|
39
|
+
type: "settings",
|
|
40
|
+
settings: u(t)
|
|
41
|
+
} : t.startsWith("ayon+entity://") ? {
|
|
42
|
+
type: "entity",
|
|
43
|
+
entity: l(t)
|
|
44
|
+
} : { type: void 0 } : { type: void 0 }, v = (t) => t?.attrib?.developerMode ? "developer" : t?.data?.frontendPreferences?.stagingMode ? "staging" : "production", M = (t, s) => {
|
|
45
|
+
const [e] = g();
|
|
46
|
+
return [t?.data?.frontendPreferences?.stagingMode ?? !1, async (n) => {
|
|
6
47
|
try {
|
|
7
|
-
const
|
|
8
|
-
...
|
|
9
|
-
stagingMode:
|
|
48
|
+
const o = {
|
|
49
|
+
...t?.data?.frontendPreferences || {},
|
|
50
|
+
stagingMode: n
|
|
10
51
|
};
|
|
11
|
-
|
|
12
|
-
userName:
|
|
13
|
-
patchData:
|
|
14
|
-
}).unwrap(),
|
|
15
|
-
} catch (
|
|
16
|
-
console.error(
|
|
52
|
+
e({
|
|
53
|
+
userName: t.name,
|
|
54
|
+
patchData: o
|
|
55
|
+
}).unwrap(), s && s(o);
|
|
56
|
+
} catch (o) {
|
|
57
|
+
console.error(o), f.error("Failed to update staging mode");
|
|
17
58
|
}
|
|
18
59
|
}];
|
|
19
60
|
};
|
|
20
61
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
62
|
+
l as a,
|
|
63
|
+
P as b,
|
|
64
|
+
u as c,
|
|
65
|
+
v as g,
|
|
66
|
+
U as p,
|
|
67
|
+
M as u
|
|
23
68
|
};
|