@ynput/ayon-frontend-shared 0.6.4 → 0.6.5
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 +480 -477
- package/dist/ListTable.es.js +24 -25
- package/dist/NewEntity.es.js +6 -7
- package/dist/ProjectTreeTable.es.js +2016 -1996
- package/dist/Views.es.js +28 -28
- package/dist/api.es.js +291 -289
- package/dist/chunks/Actions.es.js +12 -12
- package/dist/chunks/ColumnDropIndicator.es.js +8 -9
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +31 -25
- package/dist/chunks/DeleteEntitiesContextInstance.es.js +1 -1
- package/dist/chunks/DetailsDialog.es.js +1 -1
- package/dist/chunks/EmptyPlaceholder.es.js +13 -12
- package/dist/chunks/EntityPath.es.js +67 -67
- package/dist/chunks/EntityPickerDialog.es.js +1 -1
- package/dist/chunks/EntityTooltip.es.js +8 -8
- package/dist/chunks/Feed.es.js +75 -76
- package/dist/chunks/MetaWidget.es.js +1283 -1279
- package/dist/chunks/PlayableIcon.es.js +458 -451
- package/dist/chunks/ProjectContext.es.js +20 -20
- package/dist/chunks/RepresentationsList.es.js +9 -9
- package/dist/chunks/ReviewablesSelector.es.js +1504 -1374
- package/dist/chunks/Slicer.es.js +68 -69
- package/dist/chunks/ThumbnailSimple.es.js +4 -4
- package/dist/chunks/Watchers.es.js +104 -105
- package/dist/chunks/activeEntities.es.js +58 -0
- package/dist/chunks/columnConfigConverter.es.js +57 -63
- package/dist/chunks/getUris.es.js +886 -831
- package/dist/chunks/iconUtils.es.js +151 -0
- package/dist/chunks/realtimeUpdatesUtils.es.js +113 -80
- package/dist/chunks/searchTerms.es.js +329 -247
- package/dist/chunks/useAttributeEnums.es.js +34 -34
- package/dist/chunks/viewUpdateHelper.es.js +11 -11
- package/dist/components.es.js +340 -337
- package/dist/context.es.js +48 -48
- package/dist/hooks.es.js +34 -34
- package/dist/index.es.js +1 -1
- package/dist/types/ContextMenu.d.ts +1 -1
- package/dist/types/Feed.d.ts +1 -1
- package/dist/types/ListTable.d.ts +1 -1
- package/dist/types/ProjectTreeTable.d.ts +4 -1
- package/dist/types/SimpleTable.d.ts +1 -1
- package/dist/types/Slicer.d.ts +5 -5
- package/dist/types/Views.d.ts +4 -4
- package/dist/types/api.d.ts +545 -171
- package/dist/types/components.d.ts +64 -9
- package/dist/types/context.d.ts +5 -5
- package/dist/types/util.d.ts +237 -2
- package/dist/util.es.js +127 -114
- package/package.json +1 -1
- package/dist/chunks/extractEntityHierarchyFromParents.es.js +0 -28
- package/dist/chunks/parseHtmlToPlainTextWithLinks.es.js +0 -138
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { e as g, g as _ } from "./getEntityTypeIcon.es.js";
|
|
2
|
+
import { deburr as y, snakeCase as N } from "lodash";
|
|
3
|
+
const w = (e, r, o) => {
|
|
4
|
+
let n = "format_list_bulleted";
|
|
5
|
+
const l = {
|
|
6
|
+
status: "arrow_circle_right",
|
|
7
|
+
assignees: "person",
|
|
8
|
+
author: "person",
|
|
9
|
+
tags: "local_offer",
|
|
10
|
+
priority: "keyboard_double_arrow_up",
|
|
11
|
+
fps: "30fps_select",
|
|
12
|
+
resolutionWidth: "settings_overscan",
|
|
13
|
+
resolutionHeight: "settings_overscan",
|
|
14
|
+
pixelAspect: "stop",
|
|
15
|
+
clipIn: "line_start_diamond",
|
|
16
|
+
clipOut: "line_end_diamond",
|
|
17
|
+
frameStart: "line_start_circle",
|
|
18
|
+
frameEnd: "line_end_circle",
|
|
19
|
+
handleStart: "line_start_square",
|
|
20
|
+
handleEnd: "line_end_square",
|
|
21
|
+
fullName: "id_card",
|
|
22
|
+
email: "alternate_email",
|
|
23
|
+
developerMode: "code",
|
|
24
|
+
productGroup: "inventory_2",
|
|
25
|
+
machine: "computer",
|
|
26
|
+
comment: "comment",
|
|
27
|
+
colorSpace: "palette",
|
|
28
|
+
description: "description",
|
|
29
|
+
latest: "verified"
|
|
30
|
+
}, d = {
|
|
31
|
+
integer: "pin",
|
|
32
|
+
float: "speed_1_2",
|
|
33
|
+
boolean: "check_box",
|
|
34
|
+
datetime: "calendar_month",
|
|
35
|
+
list_of_strings: "format_list_bulleted",
|
|
36
|
+
list_of_integers: "format_list_numbered",
|
|
37
|
+
list_of_any: "format_list_bulleted",
|
|
38
|
+
list_of_submodels: "format_list_bulleted",
|
|
39
|
+
dict: "format_list_bulleted",
|
|
40
|
+
string: "title"
|
|
41
|
+
};
|
|
42
|
+
return l[e] ? n = l[e] : g.includes(e) ? n = _(e) : o && r === "string" ? n = "format_list_bulleted" : o ? n = "checklist" : r && d[r] && (n = d[r]), n;
|
|
43
|
+
}, b = (e) => e ? /\s/.test(e) ? { valid: !1, error: "Spaces are not allowed in name" } : /^[a-zA-Z0-9_\.\-]+$/.test(e) ? /^[.-]/.test(e) ? { valid: !1, error: "Name cannot start with dot or dash" } : /[.-]$/.test(e) ? { valid: !1, error: "Name cannot end with dot or dash" } : { valid: !0 } : {
|
|
44
|
+
valid: !1,
|
|
45
|
+
error: "Name can only contain letters, numbers, underscores, dashes or dots"
|
|
46
|
+
} : { valid: !1, error: "Name is required" }, A = (e) => e ? e.includes("'") ? { valid: !1, error: "Label cannot contain single quotes (')" } : { valid: !0 } : { valid: !1, error: "Label is required" }, L = (e, r = { capitalization: "lower", separator: "" }) => {
|
|
47
|
+
const { capitalization: o = "lower", separator: n = "" } = r;
|
|
48
|
+
if (!e) return "";
|
|
49
|
+
const p = e.trim().split(/\s+/).filter(Boolean).map((i) => {
|
|
50
|
+
let a = i.normalize("NFD");
|
|
51
|
+
return a = y(a), a = a.replace(/[^a-zA-Z0-9_\-\.]+/g, ""), a = a.replace(/[.-]+$/g, ""), a;
|
|
52
|
+
}).filter(Boolean);
|
|
53
|
+
let t = ((i) => {
|
|
54
|
+
switch (o) {
|
|
55
|
+
case "upper":
|
|
56
|
+
return i.map((a) => a.toUpperCase());
|
|
57
|
+
case "pascal":
|
|
58
|
+
return i.map((a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase());
|
|
59
|
+
case "camel":
|
|
60
|
+
return i.map(
|
|
61
|
+
(a, h) => h === 0 ? a.toLowerCase() : a.charAt(0).toUpperCase() + a.slice(1).toLowerCase()
|
|
62
|
+
);
|
|
63
|
+
case "keep":
|
|
64
|
+
return i;
|
|
65
|
+
default:
|
|
66
|
+
return i.map((a) => a.toLowerCase());
|
|
67
|
+
}
|
|
68
|
+
})(p).join(n);
|
|
69
|
+
t = t.replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g, "");
|
|
70
|
+
const { valid: s } = b(t);
|
|
71
|
+
return s || (t = N(t)), t;
|
|
72
|
+
}, C = (e) => {
|
|
73
|
+
const r = document.createElement("div");
|
|
74
|
+
r.innerHTML = e;
|
|
75
|
+
const o = [];
|
|
76
|
+
let n = 0;
|
|
77
|
+
const l = (c) => {
|
|
78
|
+
if (c.nodeType === Node.TEXT_NODE)
|
|
79
|
+
return c.textContent || "";
|
|
80
|
+
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
81
|
+
const t = c;
|
|
82
|
+
if (t.tagName === "A") {
|
|
83
|
+
const s = t.getAttribute("href"), i = t.textContent || "";
|
|
84
|
+
return s && i ? (o.push({
|
|
85
|
+
type: "url",
|
|
86
|
+
content: i,
|
|
87
|
+
href: s,
|
|
88
|
+
key: n++
|
|
89
|
+
}), `__LINK_${n - 1}__`) : i;
|
|
90
|
+
}
|
|
91
|
+
if (t.tagName === "LI") {
|
|
92
|
+
const s = Array.from(t.childNodes).map(l).join("").trim();
|
|
93
|
+
return s ? `• ${s}` : "";
|
|
94
|
+
}
|
|
95
|
+
if (t.tagName === "OL" || t.tagName === "UL")
|
|
96
|
+
return Array.from(t.children).filter((i) => i.tagName === "LI").map(l).filter((i) => i.trim()).join(`
|
|
97
|
+
`);
|
|
98
|
+
if (t.tagName === "P") {
|
|
99
|
+
const s = Array.from(t.childNodes).map(l).join("");
|
|
100
|
+
return s.trim() ? s + `
|
|
101
|
+
` : "";
|
|
102
|
+
}
|
|
103
|
+
return t.tagName === "BR" ? `
|
|
104
|
+
` : Array.from(t.childNodes).map(l).join("");
|
|
105
|
+
}
|
|
106
|
+
return "";
|
|
107
|
+
};
|
|
108
|
+
let d = l(r);
|
|
109
|
+
d = d.replace(/\n{3,}/g, `
|
|
110
|
+
|
|
111
|
+
`).replace(/[ \t]+/g, " ").trim();
|
|
112
|
+
const p = [];
|
|
113
|
+
let u = d, f = 0;
|
|
114
|
+
return o.forEach((c) => {
|
|
115
|
+
const t = `__LINK_${c.key}__`, s = u.split(t);
|
|
116
|
+
s.length > 1 && (s[0] && p.push({
|
|
117
|
+
type: "text",
|
|
118
|
+
content: s[0],
|
|
119
|
+
key: f++
|
|
120
|
+
}), p.push({
|
|
121
|
+
type: "url",
|
|
122
|
+
content: c.content,
|
|
123
|
+
href: c.href,
|
|
124
|
+
key: f++
|
|
125
|
+
}), u = s.slice(1).join(t));
|
|
126
|
+
}), u && p.push({
|
|
127
|
+
type: "text",
|
|
128
|
+
content: u,
|
|
129
|
+
key: f++
|
|
130
|
+
}), p.length > 0 ? p : [{ type: "text", content: d, key: 0 }];
|
|
131
|
+
}, m = (e, r, o) => {
|
|
132
|
+
switch (e) {
|
|
133
|
+
case "folder":
|
|
134
|
+
return o.folder_types?.find((n) => n.name === r);
|
|
135
|
+
case "task":
|
|
136
|
+
return o.task_types?.find((n) => n.name === r);
|
|
137
|
+
case "product":
|
|
138
|
+
return o.product_base_types?.definitions?.find((n) => n.name === r) || o.product_base_types?.default;
|
|
139
|
+
default:
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
}, x = (e, r, o) => m(e, r, o)?.icon || _(e), E = (e, r, o) => m(e, r, o)?.color;
|
|
143
|
+
export {
|
|
144
|
+
b as a,
|
|
145
|
+
E as b,
|
|
146
|
+
A as c,
|
|
147
|
+
x as d,
|
|
148
|
+
C as e,
|
|
149
|
+
w as g,
|
|
150
|
+
L as p
|
|
151
|
+
};
|
|
@@ -1,112 +1,145 @@
|
|
|
1
|
-
import { v1 as
|
|
2
|
-
const N = () =>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { v1 as y } from "uuid";
|
|
2
|
+
const N = () => y().replace(/-/g, ""), k = (e) => /^[0-9a-f]{32}$/i.test(e), O = "__row_selection__", D = "drag-handle", S = 50, A = 4, P = S + A * 2, E = 5, d = "-", W = (e, s) => {
|
|
3
|
+
if (!e) return [];
|
|
4
|
+
if (typeof e == "string") return [{ id: e, desc: !!s }];
|
|
5
|
+
const o = [];
|
|
6
|
+
for (const t of e) {
|
|
7
|
+
if (typeof t != "string") continue;
|
|
8
|
+
const n = t.startsWith(d), a = n ? t.slice(d.length) : t;
|
|
9
|
+
!a || o.some((i) => i.id === a) || o.push({ id: a, desc: n });
|
|
10
|
+
}
|
|
11
|
+
return o.slice(0, E);
|
|
12
|
+
}, C = (e) => {
|
|
13
|
+
if (e?.length)
|
|
14
|
+
return e.slice(0, E).map((s) => s.desc ? `${d}${s.id}` : s.id);
|
|
15
|
+
}, U = (e) => {
|
|
16
|
+
const s = [];
|
|
17
|
+
for (const { key: n, desc: a } of e)
|
|
18
|
+
!n || s.some((i) => i.key === n) || s.push({ key: n, desc: !!a });
|
|
19
|
+
const o = s.slice(0, E);
|
|
20
|
+
if (!o.length) return { sortBy: void 0, desc: !1 };
|
|
21
|
+
const t = o[0].desc;
|
|
22
|
+
return o.length === 1 ? { sortBy: o[0].key, desc: t } : {
|
|
23
|
+
sortBy: o.map((n) => n.desc !== t ? `${d}${n.key}` : n.key),
|
|
24
|
+
desc: t
|
|
25
|
+
};
|
|
26
|
+
}, $ = (e) => {
|
|
27
|
+
const s = Array.isArray(e) ? e[0] : e;
|
|
28
|
+
if (s)
|
|
29
|
+
return s.startsWith(d) ? s.slice(d.length) : s;
|
|
30
|
+
};
|
|
31
|
+
let r = null;
|
|
32
|
+
const u = /* @__PURE__ */ new Set();
|
|
33
|
+
let p, m = [], l;
|
|
6
34
|
const I = () => {
|
|
7
|
-
if (
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
35
|
+
if (m.length === 0) return;
|
|
36
|
+
const e = [...m];
|
|
37
|
+
m = [], u.forEach(({ updater: s, entityTypes: o }) => {
|
|
38
|
+
const t = o ? e.filter((n) => o.includes(n.summary.entityType)) : e;
|
|
39
|
+
t.length > 0 && s(t);
|
|
12
40
|
});
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
if (
|
|
41
|
+
}, R = (e) => {
|
|
42
|
+
m.push(e), l && window.clearTimeout(l);
|
|
43
|
+
const s = 3e3 + Math.random() * 1e3;
|
|
44
|
+
l = window.setTimeout(() => {
|
|
45
|
+
l = void 0, I();
|
|
46
|
+
}, s);
|
|
47
|
+
}, _ = () => {
|
|
48
|
+
if (r && (r.readyState === WebSocket.OPEN || r.readyState === WebSocket.CONNECTING))
|
|
21
49
|
return;
|
|
22
|
-
const
|
|
23
|
-
|
|
50
|
+
const s = `${window.location.protocol.replace("http", "ws")}//${window.location.host}/ws`;
|
|
51
|
+
r = new WebSocket(s), r.onopen = () => {
|
|
24
52
|
const o = localStorage.getItem("accessToken");
|
|
25
|
-
|
|
53
|
+
r?.readyState === WebSocket.OPEN && r.send(
|
|
26
54
|
JSON.stringify({
|
|
27
55
|
topic: "auth",
|
|
28
56
|
token: o,
|
|
29
57
|
subscribe: ["thumbnail.updated"]
|
|
30
58
|
})
|
|
31
59
|
);
|
|
32
|
-
},
|
|
60
|
+
}, r.onmessage = (o) => {
|
|
33
61
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const n =
|
|
37
|
-
n.sender && n.sender === window.senderId ?
|
|
38
|
-
(!
|
|
39
|
-
}) :
|
|
62
|
+
const t = JSON.parse(o.data);
|
|
63
|
+
if (t.topic === "thumbnail.updated") {
|
|
64
|
+
const n = t;
|
|
65
|
+
n.sender && n.sender === window.senderId ? u.forEach(({ updater: a, entityTypes: i }) => {
|
|
66
|
+
(!i || i.includes(n.summary.entityType)) && a([n]);
|
|
67
|
+
}) : R(n);
|
|
40
68
|
}
|
|
41
|
-
} catch (
|
|
42
|
-
console.error("Failed to parse thumbnail update websocket message",
|
|
69
|
+
} catch (t) {
|
|
70
|
+
console.error("Failed to parse thumbnail update websocket message", t);
|
|
43
71
|
}
|
|
44
|
-
},
|
|
45
|
-
|
|
72
|
+
}, r.onclose = () => {
|
|
73
|
+
r = null, u.size > 0 && (p = window.setTimeout(() => _(), 5e3));
|
|
46
74
|
};
|
|
47
|
-
},
|
|
48
|
-
const o = { updater:
|
|
49
|
-
return
|
|
50
|
-
|
|
75
|
+
}, z = (e, s) => {
|
|
76
|
+
const o = { updater: e, entityTypes: s };
|
|
77
|
+
return u.add(o), u.size === 1 && _(), () => {
|
|
78
|
+
u.delete(o), u.size === 0 && (p && (window.clearTimeout(p), p = void 0), l && (window.clearTimeout(l), l = void 0, m = []), r && (r.onclose = null, r.close(), r = null));
|
|
51
79
|
};
|
|
52
|
-
},
|
|
53
|
-
function
|
|
54
|
-
if (!o.includes(
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
80
|
+
}, b = 1e4, v = 25, L = 1e3, G = ["status", "tags", "assignees", "type"];
|
|
81
|
+
function H(e, s, o) {
|
|
82
|
+
if (!o.includes(e)) return;
|
|
83
|
+
const t = s?.value;
|
|
84
|
+
if (t !== void 0)
|
|
85
|
+
return e === "tags" ? {
|
|
58
86
|
field: "tags",
|
|
59
|
-
value: Array.isArray(
|
|
60
|
-
} :
|
|
87
|
+
value: Array.isArray(t) ? t.map(String) : []
|
|
88
|
+
} : e === "assignees" ? {
|
|
61
89
|
field: "assignees",
|
|
62
|
-
value: Array.isArray(
|
|
63
|
-
} : { field:
|
|
90
|
+
value: Array.isArray(t) ? t.map(String) : []
|
|
91
|
+
} : { field: e, value: String(t) };
|
|
64
92
|
}
|
|
65
|
-
const
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
let n = null,
|
|
69
|
-
const
|
|
93
|
+
const F = () => new Promise((e) => setTimeout(e, Math.random() * L));
|
|
94
|
+
function J(e, s, o = b) {
|
|
95
|
+
const t = /* @__PURE__ */ new Map();
|
|
96
|
+
let n = null, a = !1, i = !1;
|
|
97
|
+
const T = () => {
|
|
70
98
|
n && (clearTimeout(n), n = null);
|
|
71
|
-
},
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
99
|
+
}, h = async () => {
|
|
100
|
+
if (T(), i || a || t.size === 0) return;
|
|
101
|
+
a = !0;
|
|
102
|
+
const c = Array.from(t.entries()).slice(0, v), w = c.map(([, f]) => f);
|
|
103
|
+
c.forEach(([f]) => t.delete(f));
|
|
76
104
|
try {
|
|
77
|
-
await
|
|
78
|
-
} catch (
|
|
79
|
-
console.error("Realtime batch processing failed",
|
|
105
|
+
await e(w, () => !i);
|
|
106
|
+
} catch (f) {
|
|
107
|
+
console.error("Realtime batch processing failed", f);
|
|
80
108
|
} finally {
|
|
81
|
-
|
|
109
|
+
a = !1, !i && t.size > 0 && g(0);
|
|
82
110
|
}
|
|
83
|
-
},
|
|
84
|
-
|
|
111
|
+
}, g = (c = o) => {
|
|
112
|
+
i || n || a || (n = setTimeout(h, c));
|
|
85
113
|
};
|
|
86
114
|
return {
|
|
87
|
-
add(
|
|
88
|
-
|
|
115
|
+
add(c) {
|
|
116
|
+
i || (t.set(s(c), c), g());
|
|
89
117
|
},
|
|
90
|
-
schedule:
|
|
118
|
+
schedule: g,
|
|
91
119
|
clear() {
|
|
92
|
-
|
|
120
|
+
i = !0, t.clear(), T();
|
|
93
121
|
}
|
|
94
122
|
};
|
|
95
123
|
}
|
|
96
124
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
125
|
+
A as C,
|
|
126
|
+
D,
|
|
127
|
+
E as M,
|
|
128
|
+
O as R,
|
|
129
|
+
S as W,
|
|
130
|
+
v as a,
|
|
131
|
+
L as b,
|
|
132
|
+
J as c,
|
|
133
|
+
G as d,
|
|
134
|
+
b as e,
|
|
135
|
+
U as f,
|
|
107
136
|
N as g,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
137
|
+
$ as h,
|
|
138
|
+
H as i,
|
|
139
|
+
z as j,
|
|
140
|
+
P as k,
|
|
141
|
+
W as p,
|
|
142
|
+
C as s,
|
|
143
|
+
k as v,
|
|
144
|
+
F as w
|
|
112
145
|
};
|