@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const d = (t) => {
|
|
2
|
+
const n = t.split("://")[1].split("?"), s = n[0], e = n[1];
|
|
3
|
+
return {
|
|
4
|
+
baseUri: s,
|
|
5
|
+
queryParams: new URLSearchParams(e || "")
|
|
6
|
+
};
|
|
7
|
+
}, g = ({
|
|
8
|
+
projectName: t,
|
|
9
|
+
folderPath: n,
|
|
10
|
+
taskName: s,
|
|
11
|
+
productName: e,
|
|
12
|
+
versionName: a
|
|
13
|
+
}) => {
|
|
14
|
+
const r = new URL(`ayon+entity://${t}/${n}`);
|
|
15
|
+
return s && r.searchParams.append("task", s), e && r.searchParams.append("product", e), a && r.searchParams.append("version", a), r.toString();
|
|
16
|
+
}, y = (t) => {
|
|
17
|
+
const { baseUri: n, queryParams: s } = d(t), e = n.split("/"), a = e[0], r = e.slice(1), [i, c] = a.split(":"), p = s.get("site") ?? void 0, o = s.get("project") ?? void 0;
|
|
18
|
+
return {
|
|
19
|
+
addonName: i,
|
|
20
|
+
addonVersion: c,
|
|
21
|
+
settingsPath: r,
|
|
22
|
+
site: p,
|
|
23
|
+
project: o
|
|
24
|
+
};
|
|
25
|
+
}, l = (t) => {
|
|
26
|
+
const { baseUri: n, queryParams: s } = d(t), e = n.split("/"), a = e[0], r = e.slice(1).join("/"), i = s.get("task") ?? void 0, c = s.get("product") ?? void 0, p = s.get("version") ?? void 0;
|
|
27
|
+
let o;
|
|
28
|
+
return p ? o = "version" : c ? o = "product" : i ? o = "task" : o = "folder", {
|
|
29
|
+
projectName: a,
|
|
30
|
+
entityType: o,
|
|
31
|
+
folderPath: r,
|
|
32
|
+
taskName: i,
|
|
33
|
+
productName: c,
|
|
34
|
+
versionName: p
|
|
35
|
+
};
|
|
36
|
+
}, u = (t) => t ? t.startsWith("ayon+settings://") ? {
|
|
37
|
+
type: "settings",
|
|
38
|
+
settings: y(t)
|
|
39
|
+
} : t.startsWith("ayon+entity://") ? {
|
|
40
|
+
type: "entity",
|
|
41
|
+
entity: l(t)
|
|
42
|
+
} : { type: void 0 } : { type: void 0 };
|
|
43
|
+
export {
|
|
44
|
+
y as a,
|
|
45
|
+
g as b,
|
|
46
|
+
l as g,
|
|
47
|
+
u as p
|
|
48
|
+
};
|
|
@@ -1,72 +1,80 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import {
|
|
3
|
-
import { W as
|
|
1
|
+
import { useMemo as g, useRef as w, useEffect as x } from "react";
|
|
2
|
+
import { b1 as G, bh as M, aw as N, ax as C, aX as I, bi as A, bj as O } from "./searchTerms.es.js";
|
|
3
|
+
import { W as B, ci as P, cv as q, ao as F, as as Q } from "./getUris.es.js";
|
|
4
4
|
import "primereact/confirmdialog";
|
|
5
|
-
import { U
|
|
6
|
-
const
|
|
7
|
-
const { entity:
|
|
8
|
-
() =>
|
|
9
|
-
[
|
|
10
|
-
),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
import { U } from "./MetaWidget.es.js";
|
|
6
|
+
const j = [], z = 3, H = (s) => {
|
|
7
|
+
const { entity: i, groupBy: c, extraGroupBys: E, skip: p } = s, n = g(
|
|
8
|
+
() => c ? B(c, i) : null,
|
|
9
|
+
[c, i]
|
|
10
|
+
), h = g(() => {
|
|
11
|
+
if (!n) return;
|
|
12
|
+
const t = /* @__PURE__ */ new Set([n.field]), y = [];
|
|
13
|
+
for (const T of E ?? []) {
|
|
14
|
+
const S = B(T, i);
|
|
15
|
+
S && !t.has(S.field) && (t.add(S.field), y.push(S));
|
|
16
|
+
}
|
|
17
|
+
return [n, ...y];
|
|
18
|
+
}, [n, E, i]), u = !!p || !n, m = s.args.projectName, k = P(
|
|
19
|
+
{ ...s.entity === "task" ? s.args : { projectName: m }, targets: h },
|
|
20
|
+
{ skip: u || s.entity !== "task" }
|
|
21
|
+
), v = q(
|
|
22
|
+
{ ...s.entity === "version" ? s.args : { projectName: m }, targets: h },
|
|
23
|
+
{ skip: u || s.entity !== "version" }
|
|
24
|
+
), e = s.entity === "task" ? k : v, r = e.data ?? j, o = !!e.data, { counts: L, total: a, complete: l } = g(() => {
|
|
25
|
+
const t = F(r, n);
|
|
26
|
+
return t.ungrouped.count > 0 && t.counts.set(U, t.ungrouped), {
|
|
27
|
+
counts: o && t.counts.size > 0 ? t.counts : void 0,
|
|
20
28
|
total: t.total,
|
|
21
29
|
complete: t.complete
|
|
22
30
|
};
|
|
23
|
-
}, [
|
|
24
|
-
return
|
|
25
|
-
d.current.clear();
|
|
26
|
-
}, [
|
|
27
|
-
if (u || !
|
|
28
|
-
const t =
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
d.current.add(t), r.refetch();
|
|
31
|
+
}, [r, n, o]), f = w(/* @__PURE__ */ new Map()), d = w(/* @__PURE__ */ new Set()), R = g(() => JSON.stringify(s.args), [s.args]);
|
|
32
|
+
return x(() => {
|
|
33
|
+
f.current.clear(), d.current.clear();
|
|
34
|
+
}, [R]), x(() => {
|
|
35
|
+
if (u || !n || !o || e.isFetching || l) return;
|
|
36
|
+
const t = n.field;
|
|
37
|
+
if (d.current.has(t)) return;
|
|
38
|
+
if (r.some((T) => T.columnName === Q(t))) {
|
|
39
|
+
d.current.add(t);
|
|
40
|
+
return;
|
|
35
41
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
const y = f.current.get(t) ?? 0;
|
|
43
|
+
y >= z || (f.current.set(t, y + 1), e.refetch());
|
|
44
|
+
}, [u, n, o, e.isFetching, l, r, e.refetch]), {
|
|
45
|
+
counts: L,
|
|
46
|
+
complete: l,
|
|
47
|
+
total: a,
|
|
48
|
+
isLoading: !u && (e.isLoading || e.isFetching),
|
|
49
|
+
isSupported: !!n
|
|
42
50
|
};
|
|
43
|
-
},
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
49
|
-
({ name:
|
|
50
|
-
)?.acceptedParams,
|
|
51
|
-
|
|
52
|
-
}), { requests: [...
|
|
53
|
-
}, [
|
|
54
|
-
{ requests:
|
|
55
|
-
{ skip: !
|
|
51
|
+
}, J = (s, { projectName: i, request: c = "all" } = {}) => {
|
|
52
|
+
const E = c === "all" ? "all" : [...c].sort().join("\0"), { data: p, isError: n } = G(), h = !!p || n, { requests: u, keyByName: m } = g(() => {
|
|
53
|
+
const e = c === "all" ? null : new Set(c), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
54
|
+
return s.forEach((a) => {
|
|
55
|
+
if (!M(a.data) || e && !e.has(a.name)) return;
|
|
56
|
+
const l = p?.find(
|
|
57
|
+
({ name: R }) => R === a.data?.enumResolver
|
|
58
|
+
)?.acceptedParams, f = N(a.data, { projectName: i }, l), d = C(f);
|
|
59
|
+
o.set(a.name, d), r.has(d) || r.set(d, f);
|
|
60
|
+
}), { requests: [...r].sort(([a], [l]) => a.localeCompare(l)).map(([, a]) => a), keyByName: o };
|
|
61
|
+
}, [s, E, i, p]), { data: k, isError: v } = I(
|
|
62
|
+
{ requests: u },
|
|
63
|
+
{ skip: !u.length || !h }
|
|
56
64
|
);
|
|
57
|
-
return
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
return
|
|
62
|
-
...
|
|
65
|
+
return g(() => m.size ? s.map((e) => {
|
|
66
|
+
const r = m.get(e.name);
|
|
67
|
+
if (!r) return e;
|
|
68
|
+
const o = k?.[r];
|
|
69
|
+
return o ? {
|
|
70
|
+
...e,
|
|
63
71
|
enumIsLoading: !1,
|
|
64
|
-
enumError:
|
|
65
|
-
data: { ...
|
|
66
|
-
} :
|
|
67
|
-
}) :
|
|
72
|
+
enumError: o.error ? A(o.error) : void 0,
|
|
73
|
+
data: { ...e.data, enum: O(o.items) }
|
|
74
|
+
} : v ? { ...e, enumIsLoading: !1, enumError: A() } : { ...e, enumIsLoading: !0 };
|
|
75
|
+
}) : s, [s, m, k, v]);
|
|
68
76
|
};
|
|
69
77
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
H as a,
|
|
79
|
+
J as u
|
|
72
80
|
};
|
|
@@ -3,17 +3,27 @@ import "react-toastify";
|
|
|
3
3
|
import "lodash";
|
|
4
4
|
import "primereact/confirmdialog";
|
|
5
5
|
import { g as a } from "./parseHtmlToPlainTextWithLinks.es.js";
|
|
6
|
-
import {
|
|
6
|
+
import { bg as C } from "./searchTerms.es.js";
|
|
7
7
|
import "uuid";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "./PlayableIcon.es.js";
|
|
11
11
|
import "@ynput/ayon-react-components";
|
|
12
|
+
import "lexical";
|
|
13
|
+
import "@lexical/markdown";
|
|
14
|
+
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
15
|
+
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
16
|
+
import "match-sorter";
|
|
17
|
+
import "date-fns";
|
|
18
|
+
import "@lexical/code";
|
|
19
|
+
import "@lexical/list";
|
|
20
|
+
import "@lexical/rich-text";
|
|
21
|
+
import "@lexical/selection";
|
|
22
|
+
import "@lexical/utils";
|
|
23
|
+
import "./getUris.es.js";
|
|
12
24
|
import "react-router-dom";
|
|
13
25
|
import { u as k, a as v } from "./MetaWidget.es.js";
|
|
14
|
-
import "date-fns";
|
|
15
26
|
import "./ProjectContext.es.js";
|
|
16
|
-
import "./getUris.es.js";
|
|
17
27
|
import "@tanstack/react-table";
|
|
18
28
|
import "./useCreateContextMenu.es.js";
|
|
19
29
|
import "./DeleteEntitiesContext.es.js";
|
|
@@ -22,12 +32,12 @@ import "./useLocalStorage.es.js";
|
|
|
22
32
|
import "@module-federation/enhanced/runtime";
|
|
23
33
|
import "semver";
|
|
24
34
|
import "./ProjectFoldersContextInstance.es.js";
|
|
25
|
-
const E = ["string", "integer", "float"], L = (
|
|
26
|
-
allowedTypes:
|
|
35
|
+
const E = ["string", "integer", "float"], L = (o, s, r, n) => (r || E).includes(o.data.type || "") && (!s || o.scope?.includes(s)) ? n ? C(o.data) : !0 : !1, lt = ({
|
|
36
|
+
allowedTypes: o,
|
|
27
37
|
enumOnly: s,
|
|
28
38
|
scope: r
|
|
29
39
|
}) => {
|
|
30
|
-
const { columnOrder:
|
|
40
|
+
const { columnOrder: n } = k(), { attribFields: l } = v();
|
|
31
41
|
return x(
|
|
32
42
|
() => [
|
|
33
43
|
{
|
|
@@ -78,41 +88,41 @@ const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(
|
|
|
78
88
|
icon: a("tags"),
|
|
79
89
|
scopes: ["task", "version", "folder", "product"]
|
|
80
90
|
},
|
|
81
|
-
...l.filter((t) => L(t, r,
|
|
91
|
+
...l.filter((t) => L(t, r, o, s)).map((t) => ({
|
|
82
92
|
value: "attrib." + t.name,
|
|
83
93
|
label: t.data.title || t.name,
|
|
84
94
|
icon: a(t.name)
|
|
85
95
|
}))
|
|
86
96
|
].filter((t) => !r || ("scopes" in t ? t.scopes.includes(r) : !0)).sort((t, b) => {
|
|
87
|
-
const c =
|
|
97
|
+
const c = n.indexOf(t.value), p = n.indexOf(b.value);
|
|
88
98
|
return c === -1 && p === -1 ? 0 : c === -1 ? 1 : p === -1 ? -1 : c - p;
|
|
89
99
|
}),
|
|
90
|
-
[l,
|
|
100
|
+
[l, n, o, s, r]
|
|
91
101
|
);
|
|
92
|
-
}, S = "data-column-dnd-container", A = 100,
|
|
93
|
-
columnPinning:
|
|
102
|
+
}, S = "data-column-dnd-container", A = 100, ut = ({
|
|
103
|
+
columnPinning: o,
|
|
94
104
|
columnSizing: s
|
|
95
105
|
}) => {
|
|
96
|
-
const r = T(null),
|
|
97
|
-
const e =
|
|
106
|
+
const r = T(null), n = T(null), l = d(() => {
|
|
107
|
+
const e = o.left || [];
|
|
98
108
|
let i = 24;
|
|
99
109
|
return e.forEach((h) => {
|
|
100
110
|
i += s[h] || 150;
|
|
101
111
|
}), i;
|
|
102
|
-
}, [
|
|
112
|
+
}, [o.left, s]), t = d(
|
|
103
113
|
({ transform: e, activeNodeRect: i, draggingNodeRect: h, active: y }) => {
|
|
104
114
|
if (r.current === null || !i || y?.data.current?.type && y.data.current.type !== "column") return e;
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
const
|
|
115
|
+
let m = n.current;
|
|
116
|
+
m === null && (m = (document.querySelector(`[${S}]`)?.getBoundingClientRect().left ?? 0) + l());
|
|
117
|
+
const f = h?.left ?? i.left;
|
|
108
118
|
if (r.current) {
|
|
109
|
-
const g =
|
|
119
|
+
const g = f + i.width + e.x, u = m + A;
|
|
110
120
|
if (g > u)
|
|
111
|
-
return { ...e, x: u -
|
|
121
|
+
return { ...e, x: u - f - i.width };
|
|
112
122
|
} else {
|
|
113
|
-
const g =
|
|
123
|
+
const g = f + e.x, u = m - A;
|
|
114
124
|
if (g < u)
|
|
115
|
-
return { ...e, x: u -
|
|
125
|
+
return { ...e, x: u - f };
|
|
116
126
|
}
|
|
117
127
|
return e;
|
|
118
128
|
},
|
|
@@ -123,13 +133,13 @@ const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(
|
|
|
123
133
|
r.current = null;
|
|
124
134
|
return;
|
|
125
135
|
}
|
|
126
|
-
r.current =
|
|
136
|
+
r.current = o.left?.includes(e) || !1;
|
|
127
137
|
},
|
|
128
|
-
[
|
|
138
|
+
[o.left]
|
|
129
139
|
), c = d(() => {
|
|
130
|
-
r.current = null,
|
|
140
|
+
r.current = null, n.current = null;
|
|
131
141
|
}, []), p = d((e) => {
|
|
132
|
-
|
|
142
|
+
n.current = e;
|
|
133
143
|
}, []);
|
|
134
144
|
return {
|
|
135
145
|
restrictToSection: t,
|
|
@@ -142,7 +152,7 @@ const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(
|
|
|
142
152
|
export {
|
|
143
153
|
S as T,
|
|
144
154
|
E as a,
|
|
145
|
-
|
|
155
|
+
lt as b,
|
|
146
156
|
L as i,
|
|
147
|
-
|
|
157
|
+
ut as u
|
|
148
158
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as h } from "react";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as F, d as b, a as D } from "./PlayableIcon.es.js";
|
|
3
3
|
import { startOfDay as v, parse as m, endOfDay as R, format as l } from "date-fns";
|
|
4
4
|
const V = () => {
|
|
5
5
|
const [d, y] = h(null), [f, u] = h(""), [g, c] = h(""), p = (r, o) => {
|
|
@@ -52,7 +52,7 @@ const V = () => {
|
|
|
52
52
|
const s = a.id.replace("custom-", ""), i = s.indexOf("Z");
|
|
53
53
|
if (i > 0) {
|
|
54
54
|
const M = s.substring(0, i + 1), S = s.substring(i + 2);
|
|
55
|
-
if (
|
|
55
|
+
if (b(M, S)) return;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
r.stopPropagation(), p(t.id, o);
|
|
@@ -61,7 +61,7 @@ const V = () => {
|
|
|
61
61
|
handleDropdownItemClick: (r, o, e) => {
|
|
62
62
|
const n = r.target.closest("li");
|
|
63
63
|
if (!n) return !0;
|
|
64
|
-
if (n.querySelector(`span[icon="${
|
|
64
|
+
if (n.querySelector(`span[icon="${F}"]`)) {
|
|
65
65
|
const t = n.getAttribute("data-parent") || I(o, e);
|
|
66
66
|
return t && p(t, o), !1;
|
|
67
67
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as k } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as P, useState as m, useEffect as S, useContext as I, useRef as A, useCallback as C, useMemo as
|
|
3
|
-
import { registerRemotes as
|
|
2
|
+
import { createContext as P, useState as m, useEffect as S, useContext as I, useRef as A, useCallback as C, useMemo as E } from "react";
|
|
3
|
+
import { registerRemotes as O, loadRemote as j } from "@module-federation/enhanced/runtime";
|
|
4
4
|
import "./searchTerms.es.js";
|
|
5
|
-
import {
|
|
5
|
+
import { cQ as M } from "./getUris.es.js";
|
|
6
6
|
import "primereact/confirmdialog";
|
|
7
7
|
import { u as F } from "./GlobalContext.es.js";
|
|
8
8
|
import D from "semver";
|
|
@@ -34,7 +34,7 @@ const x = P({
|
|
|
34
34
|
modules: v
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
-
}),
|
|
37
|
+
}), O(
|
|
38
38
|
l.map((s) => ({
|
|
39
39
|
name: s.remote,
|
|
40
40
|
alias: s.remote,
|
|
@@ -264,7 +264,7 @@ const x = P({
|
|
|
264
264
|
}
|
|
265
265
|
})();
|
|
266
266
|
}, [t, L, f, u]);
|
|
267
|
-
const
|
|
267
|
+
const R = E(
|
|
268
268
|
() => ({
|
|
269
269
|
powerLicense: p,
|
|
270
270
|
isLoading: w,
|
|
@@ -276,7 +276,7 @@ const x = P({
|
|
|
276
276
|
}),
|
|
277
277
|
[p, o, r, i, w]
|
|
278
278
|
);
|
|
279
|
-
return /* @__PURE__ */ k(z.Provider, { value:
|
|
279
|
+
return /* @__PURE__ */ k(z.Provider, { value: R, children: e });
|
|
280
280
|
}, Y = () => {
|
|
281
281
|
const e = I(z);
|
|
282
282
|
if (e === void 0)
|
|
@@ -343,13 +343,13 @@ function te(e, t) {
|
|
|
343
343
|
export {
|
|
344
344
|
X as P,
|
|
345
345
|
_ as R,
|
|
346
|
-
|
|
346
|
+
Y as a,
|
|
347
347
|
T as b,
|
|
348
348
|
V as c,
|
|
349
349
|
N as d,
|
|
350
350
|
te as e,
|
|
351
351
|
K as p,
|
|
352
352
|
Z as r,
|
|
353
|
-
|
|
353
|
+
$ as u,
|
|
354
354
|
ee as w
|
|
355
355
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useRef as w, useState as f, useEffect as S, useCallback as m } from "react";
|
|
2
|
+
const i = (e, t = null) => {
|
|
3
|
+
if (!e) return t;
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(e);
|
|
6
|
+
} catch {
|
|
7
|
+
return t;
|
|
8
|
+
}
|
|
9
|
+
}, E = (e, t) => {
|
|
10
|
+
if (typeof window > "u") return t;
|
|
11
|
+
try {
|
|
12
|
+
return i(sessionStorage.getItem(e), t);
|
|
13
|
+
} catch {
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
}, h = (e, t) => {
|
|
17
|
+
if (!(typeof window > "u"))
|
|
18
|
+
try {
|
|
19
|
+
sessionStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } }));
|
|
20
|
+
} catch (r) {
|
|
21
|
+
console.error(r);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
function v(e, t) {
|
|
25
|
+
const r = w(t);
|
|
26
|
+
r.current = t;
|
|
27
|
+
const [c, u] = f(() => typeof window > "u" ? t : i(sessionStorage.getItem(e), t));
|
|
28
|
+
S(() => {
|
|
29
|
+
const o = sessionStorage.getItem(e);
|
|
30
|
+
u(i(o, r.current)), o || sessionStorage.setItem(e, JSON.stringify(r.current));
|
|
31
|
+
function n(s) {
|
|
32
|
+
if ("key" in s && s.key && s.key !== e) return;
|
|
33
|
+
const a = s.detail?.key;
|
|
34
|
+
if (a && a !== e) return;
|
|
35
|
+
const g = sessionStorage.getItem(e);
|
|
36
|
+
u(i(g, r.current));
|
|
37
|
+
}
|
|
38
|
+
return window.addEventListener("session-storage", n), window.addEventListener("storage", n), () => {
|
|
39
|
+
window.removeEventListener("session-storage", n), window.removeEventListener("storage", n);
|
|
40
|
+
};
|
|
41
|
+
}, [e]);
|
|
42
|
+
const d = m(
|
|
43
|
+
(o) => {
|
|
44
|
+
try {
|
|
45
|
+
u((n) => {
|
|
46
|
+
const s = typeof o == "function" ? o(n) : o;
|
|
47
|
+
return sessionStorage.setItem(e, JSON.stringify(s)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), s;
|
|
48
|
+
});
|
|
49
|
+
} catch (n) {
|
|
50
|
+
console.error(n);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
[e]
|
|
54
|
+
);
|
|
55
|
+
return [c, d];
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
E as r,
|
|
59
|
+
v as u,
|
|
60
|
+
h as w
|
|
61
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./searchTerms.es.js";
|
|
2
|
-
import {
|
|
2
|
+
import { aP as A, ds as D, dv as M } from "./getUris.es.js";
|
|
3
3
|
import "primereact/confirmdialog";
|
|
4
4
|
import { g as H, u as T } from "./ViewsContext.es.js";
|
|
5
5
|
import { toast as N } from "react-toastify";
|
|
6
|
-
import { useCallback as v, useState as
|
|
6
|
+
import { useCallback as v, useState as P, useRef as R } from "react";
|
|
7
7
|
import { useStore as U } from "react-redux";
|
|
8
8
|
let m = !1;
|
|
9
9
|
const b = () => {
|
|
10
10
|
m || (m = !0, queueMicrotask(() => {
|
|
11
11
|
m = !1;
|
|
12
12
|
}));
|
|
13
|
-
},
|
|
13
|
+
}, q = async (e, n, o, t = {}, a, g, f, s) => {
|
|
14
14
|
const {
|
|
15
15
|
viewSettings: c,
|
|
16
16
|
viewType: r,
|
|
@@ -48,7 +48,7 @@ const b = () => {
|
|
|
48
48
|
const W = t.errorMessage || `Failed to update view settings: ${S}`;
|
|
49
49
|
N.error(W);
|
|
50
50
|
}
|
|
51
|
-
},
|
|
51
|
+
}, x = () => {
|
|
52
52
|
const [e] = A(), [n] = D(), o = T(), t = U(), a = v(
|
|
53
53
|
async (s, c) => {
|
|
54
54
|
if (c) {
|
|
@@ -85,7 +85,7 @@ const b = () => {
|
|
|
85
85
|
}, [t, o]);
|
|
86
86
|
return {
|
|
87
87
|
updateViewSettings: v(
|
|
88
|
-
async (...s) => await
|
|
88
|
+
async (...s) => await q(...s, o, a, g, b),
|
|
89
89
|
[o, a, g]
|
|
90
90
|
),
|
|
91
91
|
onCreateView: a,
|
|
@@ -99,7 +99,7 @@ const b = () => {
|
|
|
99
99
|
[t]: a.length ? j(e[t] || {}, a.join("."), o) : o
|
|
100
100
|
} : e;
|
|
101
101
|
}, X = (e, n) => {
|
|
102
|
-
const { viewSettings: o, isLoadingViews: t } = T(), { updateViewSettings: a, getLatestSettings: g } =
|
|
102
|
+
const { viewSettings: o, isLoadingViews: t } = T(), { updateViewSettings: a, getLatestSettings: g } = x(), [f, s] = P(null), c = R(null), r = o, V = f !== null ? f : L(r, e) ?? n, i = v((d) => {
|
|
103
103
|
c.current = d, s(d);
|
|
104
104
|
}, []), u = v(
|
|
105
105
|
(d) => {
|
|
@@ -127,7 +127,7 @@ const b = () => {
|
|
|
127
127
|
return [V, u];
|
|
128
128
|
};
|
|
129
129
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
x as a,
|
|
131
|
+
q as b,
|
|
132
132
|
X as u
|
|
133
133
|
};
|