@ynput/ayon-frontend-shared 0.6.3 → 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 +692 -689
- 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
package/dist/util.es.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { K as S, g as I, a as
|
|
1
|
+
import { K as S, g as I, a as A } from "./chunks/platform.es.js";
|
|
2
2
|
import { c as d } from "./chunks/confirmDelete.es.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import { e as
|
|
5
|
-
import { g as
|
|
6
|
-
import { e as
|
|
7
|
-
import { c as
|
|
8
|
-
import { g as
|
|
9
|
-
import { c as
|
|
3
|
+
import { a as R } from "./chunks/confirmDelete.es.js";
|
|
4
|
+
import { e as F, g as M } from "./chunks/getEntityTypeIcon.es.js";
|
|
5
|
+
import { g as v, r as D } from "./chunks/replaceRoot.es.js";
|
|
6
|
+
import { A as U, c as w, e as N, g as O, a as V, s as k, u as H, b as K } from "./chunks/activeEntities.es.js";
|
|
7
|
+
import { c as z } from "./chunks/copyToClipboard.es.js";
|
|
8
|
+
import { g as q, h as J } from "./chunks/humanizeFieldName.es.js";
|
|
9
|
+
import { c as W, a as X, g as Y, b as $, d as G, p as Z, e as ee } from "./chunks/iconUtils.es.js";
|
|
10
10
|
import { bk as g } from "./chunks/searchTerms.es.js";
|
|
11
|
-
import { bl as
|
|
12
|
-
import { a as
|
|
13
|
-
import { e as
|
|
14
|
-
import { c as
|
|
15
|
-
import { c as
|
|
16
|
-
import { p as
|
|
17
|
-
import { b as
|
|
18
|
-
import { g as
|
|
19
|
-
import { b as
|
|
20
|
-
import { b as
|
|
21
|
-
import { g as
|
|
22
|
-
import { p as
|
|
23
|
-
import { i as
|
|
24
|
-
import { ConfirmDialog as
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
|
|
29
|
-
for (const
|
|
30
|
-
const
|
|
31
|
-
|
|
11
|
+
import { bl as ae, be as re, bm as se, bg as oe, bn as ie, bi as ne, bo as le, bp as me, bj as ce, bf as pe, bq as de, br as ge, bs as be, bh as ue, bt as Ee, bu as fe, bv as he, bw as Te } from "./chunks/searchTerms.es.js";
|
|
12
|
+
import { M as xe, a as Se, b as Ie, d as Ae, e as Pe, f as Re, c as Ce, g as Fe, h as Me, i as _e, p as ve, s as De, j as Le, v as Ue, w as we } from "./chunks/realtimeUpdatesUtils.es.js";
|
|
13
|
+
import { e as Oe } from "./chunks/extractVersionFromFilename.es.js";
|
|
14
|
+
import { c as ke, a as He, b as Ke, g as Be, h as ze, s as je, v as qe, d as Je, e as Qe } from "./chunks/versionUploadHelpers.es.js";
|
|
15
|
+
import { c as Xe, a as Ye } from "./chunks/columnConfigConverter.es.js";
|
|
16
|
+
import { p as Ge } from "./chunks/pluralize.es.js";
|
|
17
|
+
import { b as et, a as tt, h as at, p as rt, r as st } from "./chunks/colorUtils.es.js";
|
|
18
|
+
import { g as it } from "./chunks/getGroupByDataType.es.js";
|
|
19
|
+
import { b as lt, g as mt, a as ct, c as pt, p as dt, u as gt } from "./chunks/getBundleMode.es.js";
|
|
20
|
+
import { b as ut, s as Et } from "./chunks/buildHierarchicalTableRows.es.js";
|
|
21
|
+
import { g as ht, a as Tt } from "./chunks/getThumbnailUrl.es.js";
|
|
22
|
+
import { p as xt } from "./chunks/parseFilename.es.js";
|
|
23
|
+
import { i as It } from "./chunks/isHTMLElement.es.js";
|
|
24
|
+
import { ConfirmDialog as Pt } from "primereact/confirmdialog";
|
|
25
|
+
const E = (e) => {
|
|
26
|
+
const a = /* @__PURE__ */ new Map(), s = [];
|
|
27
|
+
for (const t of e)
|
|
28
|
+
a.set(t.id, { ...t, children: [] });
|
|
29
|
+
for (const t of e) {
|
|
30
|
+
const o = a.get(t.id);
|
|
31
|
+
t.parentId && a.has(t.parentId) ? a.get(t.parentId).children.push(o) : s.push(o);
|
|
32
32
|
}
|
|
33
|
-
return { folderMap:
|
|
34
|
-
},
|
|
33
|
+
return { folderMap: a, rootFolders: s };
|
|
34
|
+
}, f = async ({
|
|
35
35
|
folderIds: e,
|
|
36
|
-
folders:
|
|
37
|
-
deleteMutation:
|
|
38
|
-
onSelect:
|
|
39
|
-
itemTypeName:
|
|
36
|
+
folders: a,
|
|
37
|
+
deleteMutation: s,
|
|
38
|
+
onSelect: t,
|
|
39
|
+
itemTypeName: o,
|
|
40
40
|
messageDetail: l
|
|
41
41
|
}) => {
|
|
42
|
-
const
|
|
42
|
+
const n = Array.isArray(e) ? e : [e], i = n.map((r) => a?.find((p) => p.id === r)).filter(Boolean), m = i.length === 1 ? i[0]?.label || "Folder" : i.length > 1 ? `${i.length} folders` : "Folder", c = `Only the folder(s) will be deleted. ${o} inside the folder will remain.`;
|
|
43
43
|
d({
|
|
44
44
|
accept: async () => {
|
|
45
45
|
try {
|
|
46
|
-
await Promise.all(
|
|
46
|
+
await Promise.all(n.map((r) => s(r))), t([]);
|
|
47
47
|
} catch (r) {
|
|
48
48
|
throw g(r, "Failed to delete folder(s)");
|
|
49
49
|
}
|
|
@@ -64,88 +64,101 @@ const f = (e) => {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
U as ACTIVE_ENTITIES_PRIORITY,
|
|
68
|
+
Pt as ConfirmDialog,
|
|
69
|
+
ae as ENUM_CONTEXT_PARAMS,
|
|
69
70
|
S as KeyMode,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
xe as MAX_SORT_KEYS,
|
|
72
|
+
re as PubSub,
|
|
73
|
+
Se as REALTIME_REST_CALL_LIMIT,
|
|
74
|
+
Ie as REALTIME_REST_JITTER,
|
|
75
|
+
Ae as REALTIME_TASK_SUPPORTED_VALUE_FIELDS,
|
|
76
|
+
Pe as REALTIME_UPDATE_DEBOUNCE,
|
|
77
|
+
et as blendCategoryColor,
|
|
78
|
+
tt as blendColors,
|
|
79
|
+
lt as buildEntityUri,
|
|
80
|
+
E as buildFolderHierarchy,
|
|
81
|
+
ut as buildHierarchicalTableRows,
|
|
82
|
+
Re as buildSortArgs,
|
|
83
|
+
W as checkLabel,
|
|
84
|
+
X as checkName,
|
|
85
|
+
w as clearActiveEntities,
|
|
82
86
|
d as confirmDelete,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
R as confirmDeleteDialog,
|
|
88
|
+
Xe as convertColumnConfigToTanstackStates,
|
|
89
|
+
Ye as convertTanstackStatesToColumnConfig,
|
|
90
|
+
z as copyToClipboard,
|
|
91
|
+
ke as createProductAndVersion,
|
|
92
|
+
He as createProductHelper,
|
|
93
|
+
Ce as createRealtimeBatcher,
|
|
94
|
+
Ke as createVersionHelper,
|
|
95
|
+
F as entityTypesWithIcons,
|
|
96
|
+
N as extractEntityHierarchyFromParents,
|
|
97
|
+
Oe as extractVersionFromFilename,
|
|
98
|
+
O as getActiveEntities,
|
|
99
|
+
Y as getAttributeIcon,
|
|
100
|
+
mt as getBundleModeFromUser,
|
|
96
101
|
I as getCurrentPlatform,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
$ as getEntityColor,
|
|
103
|
+
G as getEntityIcon,
|
|
104
|
+
Fe as getEntityId,
|
|
105
|
+
ct as getEntityStateFromUri,
|
|
106
|
+
ht as getEntityThumbnailUrl,
|
|
100
107
|
M as getEntityTypeIcon,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
se as getEnumContextParams,
|
|
109
|
+
oe as getEnumErrorText,
|
|
110
|
+
ie as getEnumItemIcon,
|
|
104
111
|
g as getErrorMessage,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
it as getGroupByDataType,
|
|
113
|
+
q as getMixedState,
|
|
114
|
+
Be as getNextVersionNumber,
|
|
115
|
+
A as getPlatformShortcutKey,
|
|
116
|
+
Me as getPrimarySortKey,
|
|
117
|
+
V as getPriorityOptions,
|
|
110
118
|
h as getProjectDisplayName,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
Tt as getProjectThumbnailUrl,
|
|
120
|
+
ne as getRequestErrorString,
|
|
121
|
+
le as getSelectableAssignees,
|
|
122
|
+
me as getSelectableEnumItems,
|
|
123
|
+
pt as getSettingsStateFromUri,
|
|
124
|
+
_e as getSupportedEntityPatch,
|
|
125
|
+
v as groupResult,
|
|
126
|
+
f as handleDeleteFolders,
|
|
127
|
+
ze as handleUploadError,
|
|
128
|
+
ce as hasEnumOptions,
|
|
129
|
+
pe as hasEnumResolver,
|
|
130
|
+
at as hexToRgb,
|
|
131
|
+
J as humanizeField,
|
|
132
|
+
de as isEnumContextParam,
|
|
133
|
+
ge as isEnumIconImage,
|
|
134
|
+
It as isHTMLElement,
|
|
135
|
+
be as matchSearchQuery,
|
|
128
136
|
T as mentionTypeOptions,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
137
|
+
ue as normalizeEnumItems,
|
|
138
|
+
Z as parseAndFormatName,
|
|
139
|
+
rt as parseColor,
|
|
140
|
+
xt as parseFilename,
|
|
141
|
+
ee as parseHtmlToPlainTextWithLinks,
|
|
142
|
+
Ee as parseSearchQuery,
|
|
143
|
+
dt as parseUri,
|
|
144
|
+
ve as parseViewSorting,
|
|
145
|
+
fe as pastedListToSearch,
|
|
146
|
+
Ge as pluralize,
|
|
147
|
+
D as replaceRoot,
|
|
148
|
+
st as rgbToHex,
|
|
149
|
+
je as sanitizeProductName,
|
|
150
|
+
De as serializeViewSorting,
|
|
151
|
+
k as setActiveEntities,
|
|
152
|
+
Et as shouldBlockShortcuts,
|
|
153
|
+
he as sortKeysDeep,
|
|
154
|
+
Le as subscribeToThumbnailUpdates,
|
|
155
|
+
Te as toDropdownErrorText,
|
|
156
|
+
H as useActiveEntities,
|
|
157
|
+
K as useRegisterActiveEntities,
|
|
158
|
+
gt as useStagingModeState,
|
|
159
|
+
Ue as validateEntityId,
|
|
160
|
+
qe as validateFormData,
|
|
161
|
+
Je as validateProductName,
|
|
162
|
+
Qe as validateVersion,
|
|
163
|
+
we as waitForRealtimeJitter
|
|
151
164
|
};
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const a = (e, l) => {
|
|
2
|
-
if (!(!e?.scope?.includes(l) || e?.name !== "priority"))
|
|
3
|
-
return e.data.enum || [];
|
|
4
|
-
}, n = (e, l, c) => {
|
|
5
|
-
let o = "", t, i, r;
|
|
6
|
-
switch (l) {
|
|
7
|
-
case "folder":
|
|
8
|
-
o = [...e, c].join("/");
|
|
9
|
-
break;
|
|
10
|
-
case "task":
|
|
11
|
-
o = e.join("/"), t = c;
|
|
12
|
-
break;
|
|
13
|
-
case "product":
|
|
14
|
-
o = e.join("/"), i = c;
|
|
15
|
-
break;
|
|
16
|
-
case "version":
|
|
17
|
-
e.length > 0 && (o = e.slice(0, -1).join("/"), i = e[e.length - 1]), r = c;
|
|
18
|
-
break;
|
|
19
|
-
case "representation":
|
|
20
|
-
e.length > 1 && (o = e.slice(0, -2).join("/"), i = e[e.length - 2], r = e[e.length - 1]);
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
return { folderPath: o, taskName: t, productName: i, versionName: r };
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
n as e,
|
|
27
|
-
a as g
|
|
28
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { e as m, g as h } from "./getEntityTypeIcon.es.js";
|
|
2
|
-
import { deburr as g, snakeCase as y } from "lodash";
|
|
3
|
-
const w = (t, s, p) => {
|
|
4
|
-
let n = "format_list_bulleted";
|
|
5
|
-
const i = {
|
|
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
|
-
}, c = {
|
|
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 i[t] ? n = i[t] : m.includes(t) ? n = h(t) : p && s === "string" ? n = "format_list_bulleted" : p ? n = "checklist" : s && c[s] && (n = c[s]), n;
|
|
43
|
-
}, N = (t) => t ? /\s/.test(t) ? { valid: !1, error: "Spaces are not allowed in name" } : /^[a-zA-Z0-9_\.\-]+$/.test(t) ? /^[.-]/.test(t) ? { valid: !1, error: "Name cannot start with dot or dash" } : /[.-]$/.test(t) ? { 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" }, L = (t) => t ? t.includes("'") ? { valid: !1, error: "Label cannot contain single quotes (')" } : { valid: !0 } : { valid: !1, error: "Label is required" }, k = (t, s = { capitalization: "lower", separator: "" }) => {
|
|
47
|
-
const { capitalization: p = "lower", separator: n = "" } = s;
|
|
48
|
-
if (!t) return "";
|
|
49
|
-
const d = t.trim().split(/\s+/).filter(Boolean).map((o) => {
|
|
50
|
-
let r = o.normalize("NFD");
|
|
51
|
-
return r = g(r), r = r.replace(/[^a-zA-Z0-9_\-\.]+/g, ""), r = r.replace(/[.-]+$/g, ""), r;
|
|
52
|
-
}).filter(Boolean);
|
|
53
|
-
let e = ((o) => {
|
|
54
|
-
switch (p) {
|
|
55
|
-
case "upper":
|
|
56
|
-
return o.map((r) => r.toUpperCase());
|
|
57
|
-
case "pascal":
|
|
58
|
-
return o.map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase());
|
|
59
|
-
case "camel":
|
|
60
|
-
return o.map(
|
|
61
|
-
(r, _) => _ === 0 ? r.toLowerCase() : r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()
|
|
62
|
-
);
|
|
63
|
-
case "keep":
|
|
64
|
-
return o;
|
|
65
|
-
default:
|
|
66
|
-
return o.map((r) => r.toLowerCase());
|
|
67
|
-
}
|
|
68
|
-
})(d).join(n);
|
|
69
|
-
e = e.replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g, "");
|
|
70
|
-
const { valid: a } = N(e);
|
|
71
|
-
return a || (e = y(e)), e;
|
|
72
|
-
}, A = (t) => {
|
|
73
|
-
const s = document.createElement("div");
|
|
74
|
-
s.innerHTML = t;
|
|
75
|
-
const p = [];
|
|
76
|
-
let n = 0;
|
|
77
|
-
const i = (l) => {
|
|
78
|
-
if (l.nodeType === Node.TEXT_NODE)
|
|
79
|
-
return l.textContent || "";
|
|
80
|
-
if (l.nodeType === Node.ELEMENT_NODE) {
|
|
81
|
-
const e = l;
|
|
82
|
-
if (e.tagName === "A") {
|
|
83
|
-
const a = e.getAttribute("href"), o = e.textContent || "";
|
|
84
|
-
return a && o ? (p.push({
|
|
85
|
-
type: "url",
|
|
86
|
-
content: o,
|
|
87
|
-
href: a,
|
|
88
|
-
key: n++
|
|
89
|
-
}), `__LINK_${n - 1}__`) : o;
|
|
90
|
-
}
|
|
91
|
-
if (e.tagName === "LI") {
|
|
92
|
-
const a = Array.from(e.childNodes).map(i).join("").trim();
|
|
93
|
-
return a ? `• ${a}` : "";
|
|
94
|
-
}
|
|
95
|
-
if (e.tagName === "OL" || e.tagName === "UL")
|
|
96
|
-
return Array.from(e.children).filter((o) => o.tagName === "LI").map(i).filter((o) => o.trim()).join(`
|
|
97
|
-
`);
|
|
98
|
-
if (e.tagName === "P") {
|
|
99
|
-
const a = Array.from(e.childNodes).map(i).join("");
|
|
100
|
-
return a.trim() ? a + `
|
|
101
|
-
` : "";
|
|
102
|
-
}
|
|
103
|
-
return e.tagName === "BR" ? `
|
|
104
|
-
` : Array.from(e.childNodes).map(i).join("");
|
|
105
|
-
}
|
|
106
|
-
return "";
|
|
107
|
-
};
|
|
108
|
-
let c = i(s);
|
|
109
|
-
c = c.replace(/\n{3,}/g, `
|
|
110
|
-
|
|
111
|
-
`).replace(/[ \t]+/g, " ").trim();
|
|
112
|
-
const d = [];
|
|
113
|
-
let u = c, f = 0;
|
|
114
|
-
return p.forEach((l) => {
|
|
115
|
-
const e = `__LINK_${l.key}__`, a = u.split(e);
|
|
116
|
-
a.length > 1 && (a[0] && d.push({
|
|
117
|
-
type: "text",
|
|
118
|
-
content: a[0],
|
|
119
|
-
key: f++
|
|
120
|
-
}), d.push({
|
|
121
|
-
type: "url",
|
|
122
|
-
content: l.content,
|
|
123
|
-
href: l.href,
|
|
124
|
-
key: f++
|
|
125
|
-
}), u = a.slice(1).join(e));
|
|
126
|
-
}), u && d.push({
|
|
127
|
-
type: "text",
|
|
128
|
-
content: u,
|
|
129
|
-
key: f++
|
|
130
|
-
}), d.length > 0 ? d : [{ type: "text", content: c, key: 0 }];
|
|
131
|
-
};
|
|
132
|
-
export {
|
|
133
|
-
N as a,
|
|
134
|
-
A as b,
|
|
135
|
-
L as c,
|
|
136
|
-
w as g,
|
|
137
|
-
k as p
|
|
138
|
-
};
|