pennsieve-dashboard 0.0.4 → 0.1.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/pennsieve-dashboard.es.js +377 -376
- package/dist/pennsieve-dashboard.umd.js +14 -14
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as me, createElementBlock as O, openBlock as
|
|
1
|
+
import { defineComponent as me, createElementBlock as O, openBlock as R, createElementVNode as D, ref as P, reactive as es, watch as ae, isRef as Ms, isReactive as Is, markRaw as Hs, computed as ke, resolveComponent as ee, createBlock as ne, withCtx as V, createVNode as Y, Fragment as Ce, renderList as tt, unref as le, createTextVNode as $e, inject as Os, shallowRef as ts, resolveDirective as is, renderSlot as yt, mergeProps as ei, withDirectives as Se, toDisplayString as Ee, withKeys as ss, vShow as bt, vModelText as Ps, createCommentVNode as vt, normalizeClass as $s, resolveDynamicComponent as Oi, provide as Bs, onBeforeMount as Us, onMounted as Fs, defineAsyncComponent as Ws, nextTick as Gs } from "vue";
|
|
2
2
|
import { defineStore as Vs, storeToRefs as gt } from "pinia";
|
|
3
3
|
import { ElTag as qs, ElTooltip as rs } from "element-plus";
|
|
4
4
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
@@ -6,7 +6,7 @@ var js = /* @__PURE__ */ me({
|
|
|
6
6
|
name: "CircleCloseFilled",
|
|
7
7
|
__name: "circle-close-filled",
|
|
8
8
|
setup(l) {
|
|
9
|
-
return (e, t) => (
|
|
9
|
+
return (e, t) => (R(), O("svg", {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
viewBox: "0 0 1024 1024"
|
|
12
12
|
}, [
|
|
@@ -20,7 +20,7 @@ var js = /* @__PURE__ */ me({
|
|
|
20
20
|
name: "Close",
|
|
21
21
|
__name: "close",
|
|
22
22
|
setup(l) {
|
|
23
|
-
return (e, t) => (
|
|
23
|
+
return (e, t) => (R(), O("svg", {
|
|
24
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
25
|
viewBox: "0 0 1024 1024"
|
|
26
26
|
}, [
|
|
@@ -34,7 +34,7 @@ var js = /* @__PURE__ */ me({
|
|
|
34
34
|
name: "Edit",
|
|
35
35
|
__name: "edit",
|
|
36
36
|
setup(l) {
|
|
37
|
-
return (e, t) => (
|
|
37
|
+
return (e, t) => (R(), O("svg", {
|
|
38
38
|
xmlns: "http://www.w3.org/2000/svg",
|
|
39
39
|
viewBox: "0 0 1024 1024"
|
|
40
40
|
}, [
|
|
@@ -52,7 +52,7 @@ var js = /* @__PURE__ */ me({
|
|
|
52
52
|
name: "Lock",
|
|
53
53
|
__name: "lock",
|
|
54
54
|
setup(l) {
|
|
55
|
-
return (e, t) => (
|
|
55
|
+
return (e, t) => (R(), O("svg", {
|
|
56
56
|
xmlns: "http://www.w3.org/2000/svg",
|
|
57
57
|
viewBox: "0 0 1024 1024"
|
|
58
58
|
}, [
|
|
@@ -70,7 +70,7 @@ var js = /* @__PURE__ */ me({
|
|
|
70
70
|
name: "Unlock",
|
|
71
71
|
__name: "unlock",
|
|
72
72
|
setup(l) {
|
|
73
|
-
return (e, t) => (
|
|
73
|
+
return (e, t) => (R(), O("svg", {
|
|
74
74
|
xmlns: "http://www.w3.org/2000/svg",
|
|
75
75
|
viewBox: "0 0 1024 1024"
|
|
76
76
|
}, [
|
|
@@ -95,7 +95,7 @@ const Be = Vs("globalVars", () => {
|
|
|
95
95
|
Object.assign(o, C);
|
|
96
96
|
}
|
|
97
97
|
const u = (C) => {
|
|
98
|
-
delete o[C],
|
|
98
|
+
delete o[C], B();
|
|
99
99
|
};
|
|
100
100
|
function c() {
|
|
101
101
|
for (const C of Object.keys(o)) delete o[C];
|
|
@@ -105,27 +105,27 @@ const Be = Vs("globalVars", () => {
|
|
|
105
105
|
}
|
|
106
106
|
const y = (C) => r.value.find((k) => k.id === C), x = (C, k) => {
|
|
107
107
|
s.value.push({ name: C, value: k });
|
|
108
|
-
},
|
|
108
|
+
}, I = () => {
|
|
109
109
|
s.value = [];
|
|
110
|
-
},
|
|
110
|
+
}, W = (C) => {
|
|
111
111
|
const k = H(C);
|
|
112
112
|
n.value = k;
|
|
113
|
-
},
|
|
113
|
+
}, L = () => n.value;
|
|
114
114
|
function H(C) {
|
|
115
115
|
const k = {};
|
|
116
116
|
if (!C || typeof C != "object") return k;
|
|
117
|
-
for (const [E,
|
|
118
|
-
if (
|
|
119
|
-
const Te = Object.getPrototypeOf(
|
|
120
|
-
k[E] = Te ? { ...
|
|
117
|
+
for (const [E, N] of Object.entries(C))
|
|
118
|
+
if (N && typeof N == "object" && !(Ms(N) || Is(N))) {
|
|
119
|
+
const Te = Object.getPrototypeOf(N) === Object.prototype;
|
|
120
|
+
k[E] = Te ? { ...N } : Hs(N);
|
|
121
121
|
} else
|
|
122
|
-
k[E] =
|
|
122
|
+
k[E] = N;
|
|
123
123
|
return k;
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const S = (C) => {
|
|
126
126
|
const k = r.value.find((E) => E.id === C);
|
|
127
127
|
k && (k.Props = k.Props || {}, k.Props.locked = !k.Props.locked);
|
|
128
|
-
},
|
|
128
|
+
}, m = (C) => C.map((k) => {
|
|
129
129
|
const E = e.value[k.componentKey];
|
|
130
130
|
return E ? {
|
|
131
131
|
...k,
|
|
@@ -133,33 +133,33 @@ const Be = Vs("globalVars", () => {
|
|
|
133
133
|
// attach runtime component
|
|
134
134
|
} : null;
|
|
135
135
|
}).filter((k) => !!k);
|
|
136
|
-
function
|
|
136
|
+
function b() {
|
|
137
137
|
return (i.value?.save?.() ?? []).map((k) => {
|
|
138
138
|
const E = r.value.find((Nt) => Nt.id === k.id);
|
|
139
139
|
if (!E || !E.componentKey)
|
|
140
140
|
return console.warn(`save: missing item or componentKey for id=${k?.id}`), null;
|
|
141
|
-
const { x:
|
|
141
|
+
const { x: N, y: Te, w: Ue, h: Fe } = k;
|
|
142
142
|
return {
|
|
143
143
|
id: E.id,
|
|
144
144
|
componentKey: E.componentKey,
|
|
145
145
|
componentName: E.componentName,
|
|
146
146
|
hideHeader: E.hideHeader,
|
|
147
147
|
Props: E.Props ?? {},
|
|
148
|
-
x:
|
|
148
|
+
x: N,
|
|
149
149
|
y: Te,
|
|
150
150
|
w: Ue,
|
|
151
151
|
h: Fe
|
|
152
152
|
};
|
|
153
153
|
}).filter((k) => !!k);
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const B = () => {
|
|
156
156
|
const C = {
|
|
157
157
|
version: 1,
|
|
158
|
-
items:
|
|
158
|
+
items: b(),
|
|
159
159
|
filters: f()
|
|
160
160
|
};
|
|
161
161
|
C.items?.length < 1 || localStorage.setItem(t, JSON.stringify(C));
|
|
162
|
-
},
|
|
162
|
+
}, U = () => {
|
|
163
163
|
const C = localStorage.getItem(t);
|
|
164
164
|
if (!C) {
|
|
165
165
|
r.value = l.value, a({});
|
|
@@ -167,12 +167,12 @@ const Be = Vs("globalVars", () => {
|
|
|
167
167
|
}
|
|
168
168
|
try {
|
|
169
169
|
const k = JSON.parse(C);
|
|
170
|
-
r.value = Array.isArray(k.items) ?
|
|
170
|
+
r.value = Array.isArray(k.items) ? m(k.items) : l.value, a(k.filters ?? {});
|
|
171
171
|
} catch (k) {
|
|
172
172
|
console.error("Failed to parse globalVarsStore:", k), r.value = l.value, a({});
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
|
-
return ae(o, () =>
|
|
175
|
+
return ae(o, () => B(), { deep: !0 }), {
|
|
176
176
|
DASHBOARD_ITEMS: r,
|
|
177
177
|
DefaultLayout: l,
|
|
178
178
|
ComponentRegistry: e,
|
|
@@ -185,13 +185,13 @@ const Be = Vs("globalVars", () => {
|
|
|
185
185
|
clearAllFilters: c,
|
|
186
186
|
resetFilters: a,
|
|
187
187
|
getDashItem: y,
|
|
188
|
-
toggleWidgetLock:
|
|
188
|
+
toggleWidgetLock: S,
|
|
189
189
|
addOptionsDataItems: x,
|
|
190
|
-
clearOptionsDataItems:
|
|
191
|
-
saveToLocalStorage:
|
|
192
|
-
loadFromLocalStorage:
|
|
193
|
-
setOptionServices:
|
|
194
|
-
getServices:
|
|
190
|
+
clearOptionsDataItems: I,
|
|
191
|
+
saveToLocalStorage: B,
|
|
192
|
+
loadFromLocalStorage: U,
|
|
193
|
+
setOptionServices: W,
|
|
194
|
+
getServices: L
|
|
195
195
|
};
|
|
196
196
|
}), ir = { class: "widget-settings-container" }, sr = { class: "widget-setting" }, rr = { class: "dialog-footer" }, nr = /* @__PURE__ */ me({
|
|
197
197
|
__name: "TextWidgetSettings",
|
|
@@ -225,66 +225,66 @@ const Be = Vs("globalVars", () => {
|
|
|
225
225
|
}), n.value = !1;
|
|
226
226
|
}
|
|
227
227
|
return (c, f) => {
|
|
228
|
-
const y = ee("el-option"), x = ee("el-select"),
|
|
229
|
-
return
|
|
228
|
+
const y = ee("el-option"), x = ee("el-select"), I = ee("el-input"), W = ee("el-checkbox"), L = ee("el-button"), H = ee("el-dialog");
|
|
229
|
+
return R(), ne(H, {
|
|
230
230
|
class: "full-dialog-dashboard",
|
|
231
231
|
modelValue: n.value,
|
|
232
|
-
"onUpdate:modelValue": f[4] || (f[4] = (
|
|
232
|
+
"onUpdate:modelValue": f[4] || (f[4] = (S) => n.value = S),
|
|
233
233
|
title: "Text Widget Settings",
|
|
234
234
|
"append-to-body": !0
|
|
235
235
|
}, {
|
|
236
|
-
footer:
|
|
236
|
+
footer: V(() => [
|
|
237
237
|
D("div", rr, [
|
|
238
|
-
Y(
|
|
238
|
+
Y(L, {
|
|
239
239
|
class: "secondary",
|
|
240
|
-
onClick: f[3] || (f[3] = (
|
|
240
|
+
onClick: f[3] || (f[3] = (S) => n.value = !1)
|
|
241
241
|
}, {
|
|
242
|
-
default:
|
|
242
|
+
default: V(() => [...f[8] || (f[8] = [
|
|
243
243
|
$e("Cancel", -1)
|
|
244
244
|
])]),
|
|
245
245
|
_: 1
|
|
246
246
|
}),
|
|
247
|
-
Y(
|
|
248
|
-
default:
|
|
247
|
+
Y(L, { onClick: u }, {
|
|
248
|
+
default: V(() => [...f[9] || (f[9] = [
|
|
249
249
|
$e("Save", -1)
|
|
250
250
|
])]),
|
|
251
251
|
_: 1
|
|
252
252
|
})
|
|
253
253
|
])
|
|
254
254
|
]),
|
|
255
|
-
default:
|
|
255
|
+
default: V(() => [
|
|
256
256
|
D("div", ir, [
|
|
257
257
|
D("div", sr, [
|
|
258
258
|
f[5] || (f[5] = D("h4", null, "Select This Widget's Value", -1)),
|
|
259
259
|
f[6] || (f[6] = D("h5", null, "Select From Variables", -1)),
|
|
260
260
|
Y(x, {
|
|
261
261
|
modelValue: o.value,
|
|
262
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
262
|
+
"onUpdate:modelValue": f[0] || (f[0] = (S) => o.value = S),
|
|
263
263
|
class: "text-settings-height"
|
|
264
264
|
}, {
|
|
265
|
-
default:
|
|
266
|
-
(
|
|
265
|
+
default: V(() => [
|
|
266
|
+
(R(), ne(y, {
|
|
267
267
|
value: "",
|
|
268
268
|
key: "__manual__",
|
|
269
269
|
label: "Manual entry"
|
|
270
270
|
})),
|
|
271
|
-
(
|
|
272
|
-
key:
|
|
273
|
-
label:
|
|
274
|
-
value:
|
|
271
|
+
(R(!0), O(Ce, null, tt(le(i), (S) => (R(), ne(y, {
|
|
272
|
+
key: S.name,
|
|
273
|
+
label: S.name,
|
|
274
|
+
value: S.name
|
|
275
275
|
}, null, 8, ["label", "value"]))), 128))
|
|
276
276
|
]),
|
|
277
277
|
_: 1
|
|
278
278
|
}, 8, ["modelValue"]),
|
|
279
279
|
f[7] || (f[7] = D("h5", null, "Manual Entry", -1)),
|
|
280
|
-
Y(
|
|
280
|
+
Y(I, {
|
|
281
281
|
modelValue: h.value,
|
|
282
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
282
|
+
"onUpdate:modelValue": f[1] || (f[1] = (S) => h.value = S),
|
|
283
283
|
class: "text-settings-height"
|
|
284
284
|
}, null, 8, ["modelValue"]),
|
|
285
|
-
Y(
|
|
285
|
+
Y(W, {
|
|
286
286
|
modelValue: a.value,
|
|
287
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
287
|
+
"onUpdate:modelValue": f[2] || (f[2] = (S) => a.value = S),
|
|
288
288
|
label: "Hide Header"
|
|
289
289
|
}, null, 8, ["modelValue"])
|
|
290
290
|
])
|
|
@@ -310,87 +310,87 @@ const Be = Vs("globalVars", () => {
|
|
|
310
310
|
},
|
|
311
311
|
setup(l) {
|
|
312
312
|
const e = Be(), t = l;
|
|
313
|
-
Os("dashboard:globalVars", null)
|
|
314
|
-
const
|
|
315
|
-
ae(() => t.displayText, (
|
|
316
|
-
|
|
313
|
+
Os("dashboard:globalVars", null);
|
|
314
|
+
const i = P(t.displayText ?? "");
|
|
315
|
+
ae(() => t.displayText, (L) => {
|
|
316
|
+
i.value = L ?? "";
|
|
317
317
|
}, { immediate: !0 });
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
if (!
|
|
321
|
-
const
|
|
322
|
-
return Array.isArray(
|
|
323
|
-
}),
|
|
318
|
+
const s = ke(() => !!(t.bindedKey && t.bindedKey.trim() !== "")), r = ke(() => {
|
|
319
|
+
const L = t.bindedKey?.trim();
|
|
320
|
+
if (!L) return "—";
|
|
321
|
+
const S = e.optionsData.find((m) => m?.name === L)?.value;
|
|
322
|
+
return Array.isArray(S) ? S.join(", ") : S && typeof S == "object" ? JSON.stringify(S) : S ?? "—";
|
|
323
|
+
}), n = P("Text Widget"), o = ts([{ comp: ns, event: y, tooltip: "open Text settings" }]), h = P(!1), a = P(null);
|
|
324
|
+
function u() {
|
|
325
|
+
h.value = !0, a.value?.focus?.();
|
|
326
|
+
}
|
|
324
327
|
function c() {
|
|
325
|
-
|
|
328
|
+
h.value = !1;
|
|
326
329
|
}
|
|
327
|
-
|
|
328
|
-
|
|
330
|
+
const f = P(!1);
|
|
331
|
+
function y() {
|
|
332
|
+
f.value = !0;
|
|
329
333
|
}
|
|
330
|
-
const y = P(!1);
|
|
331
334
|
function x() {
|
|
332
|
-
|
|
335
|
+
f.value = !1, e.saveToLocalStorage();
|
|
333
336
|
}
|
|
334
|
-
function
|
|
335
|
-
y.value = !1, e.saveToLocalStorage();
|
|
336
|
-
}
|
|
337
|
-
function F({ manualEdit: H, reactiveSource: T, hideHeader: _ }) {
|
|
337
|
+
function I({ manualEdit: L, reactiveSource: H, hideHeader: S }) {
|
|
338
338
|
const m = e.getDashItem(t.widgetID);
|
|
339
|
-
m && (m.hideHeader =
|
|
339
|
+
m && (m.hideHeader = S, H && H.trim() !== "" ? (m.Props = m.Props || {}, m.Props.bindedKey = H, m.Props.displayText = null, m.componentName = W(H)) : (m.Props = m.Props || {}, m.Props.bindedKey = null, m.Props.displayText = L ?? "", m.componentName = L ?? "Text"), e.saveToLocalStorage());
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
return
|
|
341
|
+
function W(L) {
|
|
342
|
+
return L ? L.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (H) => H.toUpperCase()) : "";
|
|
343
343
|
}
|
|
344
|
-
return (
|
|
345
|
-
const
|
|
346
|
-
return
|
|
347
|
-
yt(
|
|
348
|
-
widgetName:
|
|
349
|
-
childIcons:
|
|
344
|
+
return (L, H) => {
|
|
345
|
+
const S = ee("el-input"), m = is("click-out");
|
|
346
|
+
return R(), O(Ce, null, [
|
|
347
|
+
yt(L.$slots, "default", {
|
|
348
|
+
widgetName: n.value,
|
|
349
|
+
childIcons: o.value
|
|
350
350
|
}, void 0, !0),
|
|
351
|
-
D("div", ei({ class: "text-widget-wrap" },
|
|
352
|
-
|
|
353
|
-
D("h2", null, Ee(
|
|
354
|
-
])) : Se((
|
|
351
|
+
D("div", ei({ class: "text-widget-wrap" }, L.$attrs), [
|
|
352
|
+
s.value ? (R(), O("div", lr, [
|
|
353
|
+
D("h2", null, Ee(r.value), 1)
|
|
354
|
+
])) : Se((R(), O("div", {
|
|
355
355
|
key: 1,
|
|
356
|
-
onKeyup: ss(
|
|
356
|
+
onKeyup: ss(c, ["enter"]),
|
|
357
357
|
class: "tw-flex"
|
|
358
358
|
}, [
|
|
359
359
|
Se(D("div", null, [
|
|
360
|
-
Y(
|
|
360
|
+
Y(S, {
|
|
361
361
|
ref_key: "textUserInput",
|
|
362
|
-
ref:
|
|
363
|
-
modelValue:
|
|
364
|
-
"onUpdate:modelValue":
|
|
365
|
-
onFocus:
|
|
362
|
+
ref: a,
|
|
363
|
+
modelValue: i.value,
|
|
364
|
+
"onUpdate:modelValue": H[0] || (H[0] = (b) => i.value = b),
|
|
365
|
+
onFocus: H[1] || (H[1] = (b) => b.target?.select?.())
|
|
366
366
|
}, null, 8, ["modelValue"])
|
|
367
367
|
], 512), [
|
|
368
|
-
[bt,
|
|
368
|
+
[bt, h.value]
|
|
369
369
|
]),
|
|
370
370
|
Se(D("div", {
|
|
371
|
-
onClick:
|
|
371
|
+
onClick: H[2] || (H[2] = (b) => u()),
|
|
372
372
|
class: "tw-w-full tw-h-full"
|
|
373
373
|
}, [
|
|
374
|
-
D("h2", null, Ee(
|
|
374
|
+
D("h2", null, Ee(i.value), 1)
|
|
375
375
|
], 512), [
|
|
376
|
-
[bt, !
|
|
376
|
+
[bt, !h.value]
|
|
377
377
|
])
|
|
378
378
|
], 32)), [
|
|
379
|
-
[m,
|
|
379
|
+
[m, c]
|
|
380
380
|
])
|
|
381
381
|
], 16),
|
|
382
382
|
Y(or, {
|
|
383
|
-
"show-dialog":
|
|
383
|
+
"show-dialog": f.value,
|
|
384
384
|
"reactive-source-value": t.bindedKey || "",
|
|
385
|
-
"manual-entry-value":
|
|
385
|
+
"manual-entry-value": i.value,
|
|
386
386
|
"hide-header-value": t.hideHeader || !1,
|
|
387
|
-
onCloseDialog:
|
|
388
|
-
onUpdateTextVar:
|
|
387
|
+
onCloseDialog: x,
|
|
388
|
+
onUpdateTextVar: I
|
|
389
389
|
}, null, 8, ["show-dialog", "reactive-source-value", "manual-entry-value", "hide-header-value"])
|
|
390
390
|
], 64);
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
}), Zn = /* @__PURE__ */ De(ar, [["__scopeId", "data-v-
|
|
393
|
+
}), Zn = /* @__PURE__ */ De(ar, [["__scopeId", "data-v-eaf38a2d"]]);
|
|
394
394
|
function ti() {
|
|
395
395
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
396
396
|
}
|
|
@@ -399,15 +399,15 @@ function os(l) {
|
|
|
399
399
|
Le = l;
|
|
400
400
|
}
|
|
401
401
|
var et = { exec: () => null };
|
|
402
|
-
function
|
|
402
|
+
function M(l, e = "") {
|
|
403
403
|
let t = typeof l == "string" ? l : l.source, i = { replace: (s, r) => {
|
|
404
404
|
let n = typeof r == "string" ? r : r.source;
|
|
405
405
|
return n = n.replace(te.caret, "$1"), t = t.replace(s, n), i;
|
|
406
406
|
}, getRegex: () => new RegExp(t, e) };
|
|
407
407
|
return i;
|
|
408
408
|
}
|
|
409
|
-
var te = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), htmlBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i") }, hr = /^(?:[ \t]*(?:\n|$))+/, ur = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, dr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, rt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, cr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ii = /(?:[*+-]|\d{1,9}[.)])/, ls = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, as =
|
|
410
|
-
]`).replace("lheading", as).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, xr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, us = /^( {2,}|\\)\n(?!\s*$)/, kr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Dt = /[\p{P}\p{S}]/u, li = /[\s\p{P}\p{S}]/u, ds = /[^\s\p{P}\p{S}]/u, Er =
|
|
409
|
+
var te = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), htmlBeginRegex: (l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i") }, hr = /^(?:[ \t]*(?:\n|$))+/, ur = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, dr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, rt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, cr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ii = /(?:[*+-]|\d{1,9}[.)])/, ls = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, as = M(ls).replace(/bull/g, ii).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), pr = M(ls).replace(/bull/g, ii).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), si = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, fr = /^[^\n]+/, ri = /(?!\s*\])(?:\\.|[^\[\]\\])+/, gr = M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ri).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), mr = M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ii).getRegex(), At = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ni = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _r = M("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ni).replace("tag", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), hs = M(si).replace("hr", rt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), yr = M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", hs).getRegex(), oi = { blockquote: yr, code: ur, def: gr, fences: dr, heading: cr, hr: rt, html: _r, lheading: as, list: mr, newline: hr, paragraph: hs, table: et, text: fr }, Pi = M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", rt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), br = { ...oi, lheading: pr, table: Pi, paragraph: M(si).replace("hr", rt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Pi).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex() }, vr = { ...oi, html: M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ni).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: et, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: M(si).replace("hr", rt).replace("heading", ` *#{1,6} *[^
|
|
410
|
+
]`).replace("lheading", as).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, xr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, us = /^( {2,}|\\)\n(?!\s*$)/, kr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Dt = /[\p{P}\p{S}]/u, li = /[\s\p{P}\p{S}]/u, ds = /[^\s\p{P}\p{S}]/u, Er = M(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, li).getRegex(), cs = /(?!~)[\p{P}\p{S}]/u, Tr = /(?!~)[\s\p{P}\p{S}]/u, Rr = /(?:[^\s\p{P}\p{S}]|~)/u, Sr = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, ps = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Cr = M(ps, "u").replace(/punct/g, Dt).getRegex(), Ar = M(ps, "u").replace(/punct/g, cs).getRegex(), fs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Dr = M(fs, "gu").replace(/notPunctSpace/g, ds).replace(/punctSpace/g, li).replace(/punct/g, Dt).getRegex(), Lr = M(fs, "gu").replace(/notPunctSpace/g, Rr).replace(/punctSpace/g, Tr).replace(/punct/g, cs).getRegex(), Nr = M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ds).replace(/punctSpace/g, li).replace(/punct/g, Dt).getRegex(), zr = M(/\\(punct)/, "gu").replace(/punct/g, Dt).getRegex(), Mr = M(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ir = M(ni).replace("(?:-->|$)", "-->").getRegex(), Hr = M("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ir).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), wt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Or = M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", wt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), gs = M(/^!?\[(label)\]\[(ref)\]/).replace("label", wt).replace("ref", ri).getRegex(), ms = M(/^!?\[(ref)\](?:\[\])?/).replace("ref", ri).getRegex(), Pr = M("reflink|nolink(?!\\()", "g").replace("reflink", gs).replace("nolink", ms).getRegex(), ai = { _backpedal: et, anyPunctuation: zr, autolink: Mr, blockSkip: Sr, br: us, code: xr, del: et, emStrongLDelim: Cr, emStrongRDelimAst: Dr, emStrongRDelimUnd: Nr, escape: wr, link: Or, nolink: ms, punctuation: Er, reflink: gs, reflinkSearch: Pr, tag: Hr, text: kr, url: et }, $r = { ...ai, link: M(/^!?\[(label)\]\((.*?)\)/).replace("label", wt).getRegex(), reflink: M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", wt).getRegex() }, Xt = { ...ai, emStrongRDelimAst: Lr, emStrongLDelim: Ar, url: M(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, Br = { ...Xt, br: M(us).replace("{2,}", "*").getRegex(), text: M(Xt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ct = { normal: oi, gfm: br, pedantic: vr }, je = { normal: ai, gfm: Xt, breaks: Br, pedantic: $r }, Ur = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, $i = (l) => Ur[l];
|
|
411
411
|
function pe(l, e) {
|
|
412
412
|
if (e) {
|
|
413
413
|
if (te.escapeTest.test(l)) return l.replace(te.escapeReplace, $i);
|
|
@@ -535,14 +535,14 @@ ${u}` : u;
|
|
|
535
535
|
if (f?.type === "blockquote") {
|
|
536
536
|
let y = f, x = y.raw + `
|
|
537
537
|
` + t.join(`
|
|
538
|
-
`),
|
|
539
|
-
r[r.length - 1] =
|
|
538
|
+
`), I = this.blockquote(x);
|
|
539
|
+
r[r.length - 1] = I, i = i.substring(0, i.length - y.raw.length) + I.raw, s = s.substring(0, s.length - y.text.length) + I.text;
|
|
540
540
|
break;
|
|
541
541
|
} else if (f?.type === "list") {
|
|
542
542
|
let y = f, x = y.raw + `
|
|
543
543
|
` + t.join(`
|
|
544
|
-
`),
|
|
545
|
-
r[r.length - 1] =
|
|
544
|
+
`), I = this.list(x);
|
|
545
|
+
r[r.length - 1] = I, i = i.substring(0, i.length - f.raw.length) + I.raw, s = s.substring(0, s.length - y.raw.length) + I.raw, t = x.substring(r.at(-1).raw.length).split(`
|
|
546
546
|
`);
|
|
547
547
|
continue;
|
|
548
548
|
}
|
|
@@ -561,29 +561,29 @@ ${u}` : u;
|
|
|
561
561
|
if (!(e = r.exec(l)) || this.rules.block.hr.test(l)) break;
|
|
562
562
|
a = e[0], l = l.substring(a.length);
|
|
563
563
|
let c = e[2].split(`
|
|
564
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
564
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (L) => " ".repeat(3 * L.length)), f = l.split(`
|
|
565
565
|
`, 1)[0], y = !c.trim(), x = 0;
|
|
566
566
|
if (this.options.pedantic ? (x = 2, u = c.trimStart()) : y ? x = e[1].length + 1 : (x = e[2].search(this.rules.other.nonSpaceChar), x = x > 4 ? 1 : x, u = c.slice(x), x += e[1].length), y && this.rules.other.blankLine.test(f) && (a += f + `
|
|
567
567
|
`, l = l.substring(f.length + 1), h = !0), !h) {
|
|
568
|
-
let
|
|
568
|
+
let L = this.rules.other.nextBulletRegex(x), H = this.rules.other.hrRegex(x), S = this.rules.other.fencesBeginRegex(x), m = this.rules.other.headingBeginRegex(x), b = this.rules.other.htmlBeginRegex(x);
|
|
569
569
|
for (; l; ) {
|
|
570
|
-
let
|
|
571
|
-
`, 1)[0],
|
|
572
|
-
if (f =
|
|
573
|
-
if (
|
|
574
|
-
` +
|
|
570
|
+
let B = l.split(`
|
|
571
|
+
`, 1)[0], U;
|
|
572
|
+
if (f = B, this.options.pedantic ? (f = f.replace(this.rules.other.listReplaceNesting, " "), U = f) : U = f.replace(this.rules.other.tabCharGlobal, " "), S.test(f) || m.test(f) || b.test(f) || L.test(f) || H.test(f)) break;
|
|
573
|
+
if (U.search(this.rules.other.nonSpaceChar) >= x || !f.trim()) u += `
|
|
574
|
+
` + U.slice(x);
|
|
575
575
|
else {
|
|
576
|
-
if (y || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 ||
|
|
576
|
+
if (y || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || S.test(c) || m.test(c) || H.test(c)) break;
|
|
577
577
|
u += `
|
|
578
578
|
` + f;
|
|
579
579
|
}
|
|
580
|
-
!y && !f.trim() && (y = !0), a +=
|
|
581
|
-
`, l = l.substring(
|
|
580
|
+
!y && !f.trim() && (y = !0), a += B + `
|
|
581
|
+
`, l = l.substring(B.length + 1), c = U.slice(x);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
s.loose || (n ? s.loose = !0 : this.rules.other.doubleBlankLine.test(a) && (n = !0));
|
|
585
|
-
let
|
|
586
|
-
this.options.gfm && (
|
|
585
|
+
let I = null, W;
|
|
586
|
+
this.options.gfm && (I = this.rules.other.listIsTask.exec(u), I && (W = I[0] !== "[ ] ", u = u.replace(this.rules.other.listReplaceTask, ""))), s.items.push({ type: "list_item", raw: a, task: !!I, checked: W, loose: !1, text: u, tokens: [] }), s.raw += a;
|
|
587
587
|
}
|
|
588
588
|
let o = s.items.at(-1);
|
|
589
589
|
if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
@@ -1420,35 +1420,35 @@ Please report this to https://github.com/markedjs/marked.`, l) {
|
|
|
1420
1420
|
};
|
|
1421
1421
|
}
|
|
1422
1422
|
}, Ae = new Gr();
|
|
1423
|
-
function
|
|
1423
|
+
function z(l, e) {
|
|
1424
1424
|
return Ae.parse(l, e);
|
|
1425
1425
|
}
|
|
1426
|
-
|
|
1427
|
-
return Ae.setOptions(l),
|
|
1426
|
+
z.options = z.setOptions = function(l) {
|
|
1427
|
+
return Ae.setOptions(l), z.defaults = Ae.defaults, os(z.defaults), z;
|
|
1428
1428
|
};
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
return Ae.use(...l),
|
|
1429
|
+
z.getDefaults = ti;
|
|
1430
|
+
z.defaults = Le;
|
|
1431
|
+
z.use = function(...l) {
|
|
1432
|
+
return Ae.use(...l), z.defaults = Ae.defaults, os(z.defaults), z;
|
|
1433
1433
|
};
|
|
1434
|
-
|
|
1434
|
+
z.walkTokens = function(l, e) {
|
|
1435
1435
|
return Ae.walkTokens(l, e);
|
|
1436
1436
|
};
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1437
|
+
z.parseInline = Ae.parseInline;
|
|
1438
|
+
z.Parser = xe;
|
|
1439
|
+
z.parser = xe.parse;
|
|
1440
|
+
z.Renderer = kt;
|
|
1441
|
+
z.TextRenderer = hi;
|
|
1442
|
+
z.Lexer = we;
|
|
1443
|
+
z.lexer = we.lex;
|
|
1444
|
+
z.Tokenizer = xt;
|
|
1445
|
+
z.Hooks = mt;
|
|
1446
|
+
z.parse = z;
|
|
1447
|
+
z.options;
|
|
1448
|
+
z.setOptions;
|
|
1449
|
+
z.use;
|
|
1450
|
+
z.walkTokens;
|
|
1451
|
+
z.parseInline;
|
|
1452
1452
|
xe.parse;
|
|
1453
1453
|
we.lex;
|
|
1454
1454
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
@@ -1615,22 +1615,22 @@ function ws() {
|
|
|
1615
1615
|
HTMLFormElement: c,
|
|
1616
1616
|
DOMParser: f,
|
|
1617
1617
|
trustedTypes: y
|
|
1618
|
-
} = l, x = h.prototype,
|
|
1618
|
+
} = l, x = h.prototype, I = Qe(x, "cloneNode"), W = Qe(x, "remove"), L = Qe(x, "nextSibling"), H = Qe(x, "childNodes"), S = Qe(x, "parentNode");
|
|
1619
1619
|
if (typeof n == "function") {
|
|
1620
1620
|
const v = t.createElement("template");
|
|
1621
1621
|
v.content && v.content.ownerDocument && (t = v.content.ownerDocument);
|
|
1622
1622
|
}
|
|
1623
|
-
let
|
|
1623
|
+
let m, b = "";
|
|
1624
1624
|
const {
|
|
1625
|
-
implementation:
|
|
1626
|
-
createNodeIterator:
|
|
1625
|
+
implementation: B,
|
|
1626
|
+
createNodeIterator: U,
|
|
1627
1627
|
createDocumentFragment: C,
|
|
1628
1628
|
getElementsByTagName: k
|
|
1629
1629
|
} = t, {
|
|
1630
1630
|
importNode: E
|
|
1631
1631
|
} = i;
|
|
1632
|
-
let
|
|
1633
|
-
e.isSupported = typeof _s == "function" && typeof
|
|
1632
|
+
let N = Zi();
|
|
1633
|
+
e.isSupported = typeof _s == "function" && typeof S == "function" && B && B.createHTMLDocument !== void 0;
|
|
1634
1634
|
const {
|
|
1635
1635
|
MUSTACHE_EXPR: Te,
|
|
1636
1636
|
ERB_EXPR: Ue,
|
|
@@ -1647,7 +1647,7 @@ function ws() {
|
|
|
1647
1647
|
const fi = A({}, [...qi, ...Vt, ...qt, ...jt, ...ji]);
|
|
1648
1648
|
let X = null;
|
|
1649
1649
|
const gi = A({}, [...Yi, ...Yt, ...Xi, ...ft]);
|
|
1650
|
-
let
|
|
1650
|
+
let F = Object.seal(ys(null, {
|
|
1651
1651
|
tagNameCheck: {
|
|
1652
1652
|
writable: !0,
|
|
1653
1653
|
configurable: !1,
|
|
@@ -1687,32 +1687,32 @@ function ws() {
|
|
|
1687
1687
|
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1688
1688
|
if (!(Oe && Oe === d)) {
|
|
1689
1689
|
if ((!d || typeof d != "object") && (d = {}), d = ve(d), Ve = // eslint-disable-next-line unicorn/prefer-includes
|
|
1690
|
-
As.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Ds : d.PARSER_MEDIA_TYPE, j = Ve === "application/xhtml+xml" ? Gt : _t, q = ue(d, "ALLOWED_TAGS") ? A({}, d.ALLOWED_TAGS, j) : fi, X = ue(d, "ALLOWED_ATTR") ? A({}, d.ALLOWED_ATTR, j) : gi, Bt = ue(d, "ALLOWED_NAMESPACES") ? A({}, d.ALLOWED_NAMESPACES, Gt) : Ss, Pt = ue(d, "ADD_URI_SAFE_ATTR") ? A(ve(Ei), d.ADD_URI_SAFE_ATTR, j) : Ei, xi = ue(d, "ADD_DATA_URI_TAGS") ? A(ve(ki), d.ADD_DATA_URI_TAGS, j) : ki, Ie = ue(d, "FORBID_CONTENTS") ? A({}, d.FORBID_CONTENTS, j) : wi, We = ue(d, "FORBID_TAGS") ? A({}, d.FORBID_TAGS, j) : ve({}), zt = ue(d, "FORBID_ATTR") ? A({}, d.FORBID_ATTR, j) : ve({}), Me = ue(d, "USE_PROFILES") ? d.USE_PROFILES : !1, mi = d.ALLOW_ARIA_ATTR !== !1, Mt = d.ALLOW_DATA_ATTR !== !1, _i = d.ALLOW_UNKNOWN_PROTOCOLS || !1, yi = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ne = d.SAFE_FOR_TEMPLATES || !1, nt = d.SAFE_FOR_XML !== !1, Re = d.WHOLE_DOCUMENT || !1, ze = d.RETURN_DOM || !1, ot = d.RETURN_DOM_FRAGMENT || !1, lt = d.RETURN_TRUSTED_TYPE || !1, Ht = d.FORCE_BODY || !1, bi = d.SANITIZE_DOM !== !1, vi = d.SANITIZE_NAMED_PROPS || !1, Ot = d.KEEP_CONTENT !== !1, Ge = d.IN_PLACE || !1, pi = d.ALLOWED_URI_REGEXP || bs, He = d.NAMESPACE || _e, ut = d.MATHML_TEXT_INTEGRATION_POINTS || ut, dt = d.HTML_INTEGRATION_POINTS || dt,
|
|
1690
|
+
As.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Ds : d.PARSER_MEDIA_TYPE, j = Ve === "application/xhtml+xml" ? Gt : _t, q = ue(d, "ALLOWED_TAGS") ? A({}, d.ALLOWED_TAGS, j) : fi, X = ue(d, "ALLOWED_ATTR") ? A({}, d.ALLOWED_ATTR, j) : gi, Bt = ue(d, "ALLOWED_NAMESPACES") ? A({}, d.ALLOWED_NAMESPACES, Gt) : Ss, Pt = ue(d, "ADD_URI_SAFE_ATTR") ? A(ve(Ei), d.ADD_URI_SAFE_ATTR, j) : Ei, xi = ue(d, "ADD_DATA_URI_TAGS") ? A(ve(ki), d.ADD_DATA_URI_TAGS, j) : ki, Ie = ue(d, "FORBID_CONTENTS") ? A({}, d.FORBID_CONTENTS, j) : wi, We = ue(d, "FORBID_TAGS") ? A({}, d.FORBID_TAGS, j) : ve({}), zt = ue(d, "FORBID_ATTR") ? A({}, d.FORBID_ATTR, j) : ve({}), Me = ue(d, "USE_PROFILES") ? d.USE_PROFILES : !1, mi = d.ALLOW_ARIA_ATTR !== !1, Mt = d.ALLOW_DATA_ATTR !== !1, _i = d.ALLOW_UNKNOWN_PROTOCOLS || !1, yi = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ne = d.SAFE_FOR_TEMPLATES || !1, nt = d.SAFE_FOR_XML !== !1, Re = d.WHOLE_DOCUMENT || !1, ze = d.RETURN_DOM || !1, ot = d.RETURN_DOM_FRAGMENT || !1, lt = d.RETURN_TRUSTED_TYPE || !1, Ht = d.FORCE_BODY || !1, bi = d.SANITIZE_DOM !== !1, vi = d.SANITIZE_NAMED_PROPS || !1, Ot = d.KEEP_CONTENT !== !1, Ge = d.IN_PLACE || !1, pi = d.ALLOWED_URI_REGEXP || bs, He = d.NAMESPACE || _e, ut = d.MATHML_TEXT_INTEGRATION_POINTS || ut, dt = d.HTML_INTEGRATION_POINTS || dt, F = d.CUSTOM_ELEMENT_HANDLING || {}, d.CUSTOM_ELEMENT_HANDLING && Ti(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (F.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && Ti(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (F.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (F.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ne && (Mt = !1), ot && (ze = !0), Me && (q = A({}, ji), X = [], Me.html === !0 && (A(q, qi), A(X, Yi)), Me.svg === !0 && (A(q, Vt), A(X, Yt), A(X, ft)), Me.svgFilters === !0 && (A(q, qt), A(X, Yt), A(X, ft)), Me.mathMl === !0 && (A(q, jt), A(X, Xi), A(X, ft))), d.ADD_TAGS && (q === fi && (q = ve(q)), A(q, d.ADD_TAGS, j)), d.ADD_ATTR && (X === gi && (X = ve(X)), A(X, d.ADD_ATTR, j)), d.ADD_URI_SAFE_ATTR && A(Pt, d.ADD_URI_SAFE_ATTR, j), d.FORBID_CONTENTS && (Ie === wi && (Ie = ve(Ie)), A(Ie, d.FORBID_CONTENTS, j)), Ot && (q["#text"] = !0), Re && A(q, ["html", "head", "body"]), q.table && (A(q, ["tbody"]), delete We.tbody), d.TRUSTED_TYPES_POLICY) {
|
|
1691
1691
|
if (typeof d.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1692
1692
|
throw Ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1693
1693
|
if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
1694
1694
|
throw Ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1695
|
-
|
|
1695
|
+
m = d.TRUSTED_TYPES_POLICY, b = m.createHTML("");
|
|
1696
1696
|
} else
|
|
1697
|
-
|
|
1697
|
+
m === void 0 && (m = cn(y, s)), m !== null && typeof b == "string" && (b = m.createHTML(""));
|
|
1698
1698
|
ie && ie(d), Oe = d;
|
|
1699
1699
|
}
|
|
1700
1700
|
}, Ri = A({}, [...Vt, ...qt, ...en]), Si = A({}, [...jt, ...tn]), Ns = function(d) {
|
|
1701
|
-
let g =
|
|
1701
|
+
let g = S(d);
|
|
1702
1702
|
(!g || !g.tagName) && (g = {
|
|
1703
1703
|
namespaceURI: He,
|
|
1704
1704
|
tagName: "template"
|
|
1705
1705
|
});
|
|
1706
|
-
const
|
|
1707
|
-
return Bt[d.namespaceURI] ? d.namespaceURI === ht ? g.namespaceURI === _e ?
|
|
1706
|
+
const _ = _t(d.tagName), $ = _t(g.tagName);
|
|
1707
|
+
return Bt[d.namespaceURI] ? d.namespaceURI === ht ? g.namespaceURI === _e ? _ === "svg" : g.namespaceURI === at ? _ === "svg" && ($ === "annotation-xml" || ut[$]) : !!Ri[_] : d.namespaceURI === at ? g.namespaceURI === _e ? _ === "math" : g.namespaceURI === ht ? _ === "math" && dt[$] : !!Si[_] : d.namespaceURI === _e ? g.namespaceURI === ht && !dt[$] || g.namespaceURI === at && !ut[$] ? !1 : !Si[_] && (Cs[_] || !Ri[_]) : !!(Ve === "application/xhtml+xml" && Bt[d.namespaceURI]) : !1;
|
|
1708
1708
|
}, ce = function(d) {
|
|
1709
1709
|
Xe(e.removed, {
|
|
1710
1710
|
element: d
|
|
1711
1711
|
});
|
|
1712
1712
|
try {
|
|
1713
|
-
|
|
1713
|
+
S(d).removeChild(d);
|
|
1714
1714
|
} catch {
|
|
1715
|
-
|
|
1715
|
+
W(d);
|
|
1716
1716
|
}
|
|
1717
1717
|
}, Pe = function(d, g) {
|
|
1718
1718
|
try {
|
|
@@ -1738,31 +1738,31 @@ function ws() {
|
|
|
1738
1738
|
} catch {
|
|
1739
1739
|
}
|
|
1740
1740
|
}, Ci = function(d) {
|
|
1741
|
-
let g = null,
|
|
1741
|
+
let g = null, _ = null;
|
|
1742
1742
|
if (Ht)
|
|
1743
1743
|
d = "<remove></remove>" + d;
|
|
1744
1744
|
else {
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1745
|
+
const G = Vi(d, /^[\r\n\t ]+/);
|
|
1746
|
+
_ = G && G[0];
|
|
1747
1747
|
}
|
|
1748
1748
|
Ve === "application/xhtml+xml" && He === _e && (d = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + d + "</body></html>");
|
|
1749
|
-
const $ =
|
|
1749
|
+
const $ = m ? m.createHTML(d) : d;
|
|
1750
1750
|
if (He === _e)
|
|
1751
1751
|
try {
|
|
1752
1752
|
g = new f().parseFromString($, Ve);
|
|
1753
1753
|
} catch {
|
|
1754
1754
|
}
|
|
1755
1755
|
if (!g || !g.documentElement) {
|
|
1756
|
-
g =
|
|
1756
|
+
g = B.createDocument(He, "template", null);
|
|
1757
1757
|
try {
|
|
1758
|
-
g.documentElement.innerHTML = $t ?
|
|
1758
|
+
g.documentElement.innerHTML = $t ? b : $;
|
|
1759
1759
|
} catch {
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
1762
|
const Z = g.body || g.documentElement;
|
|
1763
|
-
return d &&
|
|
1763
|
+
return d && _ && Z.insertBefore(t.createTextNode(_), Z.childNodes[0] || null), He === _e ? k.call(g, Re ? "html" : "body")[0] : Re ? g.documentElement : Z;
|
|
1764
1764
|
}, Ai = function(d) {
|
|
1765
|
-
return
|
|
1765
|
+
return U.call(
|
|
1766
1766
|
d.ownerDocument || d,
|
|
1767
1767
|
d,
|
|
1768
1768
|
// eslint-disable-next-line no-bitwise
|
|
@@ -1775,42 +1775,42 @@ function ws() {
|
|
|
1775
1775
|
return typeof o == "function" && d instanceof o;
|
|
1776
1776
|
};
|
|
1777
1777
|
function ye(v, d, g) {
|
|
1778
|
-
pt(v, (
|
|
1779
|
-
|
|
1778
|
+
pt(v, (_) => {
|
|
1779
|
+
_.call(e, d, g, Oe);
|
|
1780
1780
|
});
|
|
1781
1781
|
}
|
|
1782
1782
|
const Li = function(d) {
|
|
1783
1783
|
let g = null;
|
|
1784
|
-
if (ye(
|
|
1784
|
+
if (ye(N.beforeSanitizeElements, d, null), Ft(d))
|
|
1785
1785
|
return ce(d), !0;
|
|
1786
|
-
const
|
|
1787
|
-
if (ye(
|
|
1788
|
-
tagName:
|
|
1786
|
+
const _ = j(d.nodeName);
|
|
1787
|
+
if (ye(N.uponSanitizeElement, d, {
|
|
1788
|
+
tagName: _,
|
|
1789
1789
|
allowedTags: q
|
|
1790
1790
|
}), nt && d.hasChildNodes() && !Di(d.firstElementChild) && J(/<[/\w!]/g, d.innerHTML) && J(/<[/\w!]/g, d.textContent) || d.nodeType === Je.progressingInstruction || nt && d.nodeType === Je.comment && J(/<[/\w]/g, d.data))
|
|
1791
1791
|
return ce(d), !0;
|
|
1792
|
-
if (!q[
|
|
1793
|
-
if (!We[
|
|
1792
|
+
if (!q[_] || We[_]) {
|
|
1793
|
+
if (!We[_] && zi(_) && (F.tagNameCheck instanceof RegExp && J(F.tagNameCheck, _) || F.tagNameCheck instanceof Function && F.tagNameCheck(_)))
|
|
1794
1794
|
return !1;
|
|
1795
|
-
if (Ot && !Ie[
|
|
1796
|
-
const $ =
|
|
1795
|
+
if (Ot && !Ie[_]) {
|
|
1796
|
+
const $ = S(d) || d.parentNode, Z = H(d) || d.childNodes;
|
|
1797
1797
|
if (Z && $) {
|
|
1798
|
-
const
|
|
1799
|
-
for (let re =
|
|
1800
|
-
const be =
|
|
1801
|
-
be.__removalCount = (d.__removalCount || 0) + 1, $.insertBefore(be,
|
|
1798
|
+
const G = Z.length;
|
|
1799
|
+
for (let re = G - 1; re >= 0; --re) {
|
|
1800
|
+
const be = I(Z[re], !0);
|
|
1801
|
+
be.__removalCount = (d.__removalCount || 0) + 1, $.insertBefore(be, L(d));
|
|
1802
1802
|
}
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
return ce(d), !0;
|
|
1806
1806
|
}
|
|
1807
|
-
return d instanceof h && !Ns(d) || (
|
|
1807
|
+
return d instanceof h && !Ns(d) || (_ === "noscript" || _ === "noembed" || _ === "noframes") && J(/<\/no(script|embed|frames)/i, d.innerHTML) ? (ce(d), !0) : (Ne && d.nodeType === Je.text && (g = d.textContent, pt([Te, Ue, Fe], ($) => {
|
|
1808
1808
|
g = Ke(g, $, " ");
|
|
1809
1809
|
}), d.textContent !== g && (Xe(e.removed, {
|
|
1810
1810
|
element: d.cloneNode()
|
|
1811
|
-
}), d.textContent = g)), ye(
|
|
1812
|
-
}, Ni = function(d, g,
|
|
1813
|
-
if (bi && (g === "id" || g === "name") && (
|
|
1811
|
+
}), d.textContent = g)), ye(N.afterSanitizeElements, d, null), !1);
|
|
1812
|
+
}, Ni = function(d, g, _) {
|
|
1813
|
+
if (bi && (g === "id" || g === "name") && (_ in t || _ in Ls))
|
|
1814
1814
|
return !1;
|
|
1815
1815
|
if (!(Mt && !zt[g] && J(Nt, g))) {
|
|
1816
1816
|
if (!(mi && J(ks, g))) {
|
|
@@ -1819,15 +1819,15 @@ function ws() {
|
|
|
1819
1819
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1820
1820
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1821
1821
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1822
|
-
!(zi(d) && (
|
|
1822
|
+
!(zi(d) && (F.tagNameCheck instanceof RegExp && J(F.tagNameCheck, d) || F.tagNameCheck instanceof Function && F.tagNameCheck(d)) && (F.attributeNameCheck instanceof RegExp && J(F.attributeNameCheck, g) || F.attributeNameCheck instanceof Function && F.attributeNameCheck(g)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1823
1823
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1824
|
-
g === "is" &&
|
|
1824
|
+
g === "is" && F.allowCustomizedBuiltInElements && (F.tagNameCheck instanceof RegExp && J(F.tagNameCheck, _) || F.tagNameCheck instanceof Function && F.tagNameCheck(_)))
|
|
1825
1825
|
) return !1;
|
|
1826
1826
|
} else if (!Pt[g]) {
|
|
1827
|
-
if (!J(pi, Ke(
|
|
1828
|
-
if (!((g === "src" || g === "xlink:href" || g === "href") && d !== "script" && Kr(
|
|
1829
|
-
if (!(_i && !J(Es, Ke(
|
|
1830
|
-
if (
|
|
1827
|
+
if (!J(pi, Ke(_, ci, ""))) {
|
|
1828
|
+
if (!((g === "src" || g === "xlink:href" || g === "href") && d !== "script" && Kr(_, "data:") === 0 && xi[d])) {
|
|
1829
|
+
if (!(_i && !J(Es, Ke(_, ci, "")))) {
|
|
1830
|
+
if (_)
|
|
1831
1831
|
return !1;
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
@@ -1839,13 +1839,13 @@ function ws() {
|
|
|
1839
1839
|
}, zi = function(d) {
|
|
1840
1840
|
return d !== "annotation-xml" && Vi(d, Ts);
|
|
1841
1841
|
}, Mi = function(d) {
|
|
1842
|
-
ye(
|
|
1842
|
+
ye(N.beforeSanitizeAttributes, d, null);
|
|
1843
1843
|
const {
|
|
1844
1844
|
attributes: g
|
|
1845
1845
|
} = d;
|
|
1846
1846
|
if (!g || Ft(d))
|
|
1847
1847
|
return;
|
|
1848
|
-
const
|
|
1848
|
+
const _ = {
|
|
1849
1849
|
attrName: "",
|
|
1850
1850
|
attrValue: "",
|
|
1851
1851
|
keepAttr: !0,
|
|
@@ -1855,23 +1855,23 @@ function ws() {
|
|
|
1855
1855
|
let $ = g.length;
|
|
1856
1856
|
for (; $--; ) {
|
|
1857
1857
|
const Z = g[$], {
|
|
1858
|
-
name:
|
|
1858
|
+
name: G,
|
|
1859
1859
|
namespaceURI: re,
|
|
1860
1860
|
value: be
|
|
1861
|
-
} = Z, qe = j(
|
|
1862
|
-
let Q =
|
|
1863
|
-
if (
|
|
1864
|
-
Pe(
|
|
1861
|
+
} = Z, qe = j(G), Wt = be;
|
|
1862
|
+
let Q = G === "value" ? Wt : Zr(Wt);
|
|
1863
|
+
if (_.attrName = qe, _.attrValue = Q, _.keepAttr = !0, _.forceKeepAttr = void 0, ye(N.uponSanitizeAttribute, d, _), Q = _.attrValue, vi && (qe === "id" || qe === "name") && (Pe(G, d), Q = Rs + Q), nt && J(/((--!?|])>)|<\/(style|title)/i, Q)) {
|
|
1864
|
+
Pe(G, d);
|
|
1865
1865
|
continue;
|
|
1866
1866
|
}
|
|
1867
|
-
if (
|
|
1867
|
+
if (_.forceKeepAttr)
|
|
1868
1868
|
continue;
|
|
1869
|
-
if (!
|
|
1870
|
-
Pe(
|
|
1869
|
+
if (!_.keepAttr) {
|
|
1870
|
+
Pe(G, d);
|
|
1871
1871
|
continue;
|
|
1872
1872
|
}
|
|
1873
1873
|
if (!yi && J(/\/>/i, Q)) {
|
|
1874
|
-
Pe(
|
|
1874
|
+
Pe(G, d);
|
|
1875
1875
|
continue;
|
|
1876
1876
|
}
|
|
1877
1877
|
Ne && pt([Te, Ue, Fe], (Hi) => {
|
|
@@ -1879,37 +1879,37 @@ function ws() {
|
|
|
1879
1879
|
});
|
|
1880
1880
|
const Ii = j(d.nodeName);
|
|
1881
1881
|
if (!Ni(Ii, qe, Q)) {
|
|
1882
|
-
Pe(
|
|
1882
|
+
Pe(G, d);
|
|
1883
1883
|
continue;
|
|
1884
1884
|
}
|
|
1885
|
-
if (
|
|
1885
|
+
if (m && typeof y == "object" && typeof y.getAttributeType == "function" && !re)
|
|
1886
1886
|
switch (y.getAttributeType(Ii, qe)) {
|
|
1887
1887
|
case "TrustedHTML": {
|
|
1888
|
-
Q =
|
|
1888
|
+
Q = m.createHTML(Q);
|
|
1889
1889
|
break;
|
|
1890
1890
|
}
|
|
1891
1891
|
case "TrustedScriptURL": {
|
|
1892
|
-
Q =
|
|
1892
|
+
Q = m.createScriptURL(Q);
|
|
1893
1893
|
break;
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
1896
|
if (Q !== Wt)
|
|
1897
1897
|
try {
|
|
1898
|
-
re ? d.setAttributeNS(re,
|
|
1898
|
+
re ? d.setAttributeNS(re, G, Q) : d.setAttribute(G, Q), Ft(d) ? ce(d) : Gi(e.removed);
|
|
1899
1899
|
} catch {
|
|
1900
|
-
Pe(
|
|
1900
|
+
Pe(G, d);
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
ye(
|
|
1903
|
+
ye(N.afterSanitizeAttributes, d, null);
|
|
1904
1904
|
}, zs = function v(d) {
|
|
1905
1905
|
let g = null;
|
|
1906
|
-
const
|
|
1907
|
-
for (ye(
|
|
1908
|
-
ye(
|
|
1909
|
-
ye(
|
|
1906
|
+
const _ = Ai(d);
|
|
1907
|
+
for (ye(N.beforeSanitizeShadowDOM, d, null); g = _.nextNode(); )
|
|
1908
|
+
ye(N.uponSanitizeShadowNode, g, null), Li(g), Mi(g), g.content instanceof r && v(g.content);
|
|
1909
|
+
ye(N.afterSanitizeShadowDOM, d, null);
|
|
1910
1910
|
};
|
|
1911
1911
|
return e.sanitize = function(v) {
|
|
1912
|
-
let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null,
|
|
1912
|
+
let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null, _ = null, $ = null, Z = null;
|
|
1913
1913
|
if ($t = !v, $t && (v = "<!-->"), typeof v != "string" && !Di(v))
|
|
1914
1914
|
if (typeof v.toString == "function") {
|
|
1915
1915
|
if (v = v.toString(), typeof v != "string")
|
|
@@ -1925,17 +1925,17 @@ function ws() {
|
|
|
1925
1925
|
throw Ze("root node is forbidden and cannot be sanitized in-place");
|
|
1926
1926
|
}
|
|
1927
1927
|
} else if (v instanceof o)
|
|
1928
|
-
g = Ci("<!---->"),
|
|
1928
|
+
g = Ci("<!---->"), _ = g.ownerDocument.importNode(v, !0), _.nodeType === Je.element && _.nodeName === "BODY" || _.nodeName === "HTML" ? g = _ : g.appendChild(_);
|
|
1929
1929
|
else {
|
|
1930
1930
|
if (!ze && !Ne && !Re && // eslint-disable-next-line unicorn/prefer-includes
|
|
1931
1931
|
v.indexOf("<") === -1)
|
|
1932
|
-
return
|
|
1932
|
+
return m && lt ? m.createHTML(v) : v;
|
|
1933
1933
|
if (g = Ci(v), !g)
|
|
1934
|
-
return ze ? null : lt ?
|
|
1934
|
+
return ze ? null : lt ? b : "";
|
|
1935
1935
|
}
|
|
1936
1936
|
g && Ht && ce(g.firstChild);
|
|
1937
|
-
const
|
|
1938
|
-
for (; $ =
|
|
1937
|
+
const G = Ai(Ge ? v : g);
|
|
1938
|
+
for (; $ = G.nextNode(); )
|
|
1939
1939
|
Li($), Mi($), $.content instanceof r && zs($.content);
|
|
1940
1940
|
if (Ge)
|
|
1941
1941
|
return v;
|
|
@@ -1951,7 +1951,7 @@ function ws() {
|
|
|
1951
1951
|
return Re && q["!doctype"] && g.ownerDocument && g.ownerDocument.doctype && g.ownerDocument.doctype.name && J(vs, g.ownerDocument.doctype.name) && (re = "<!DOCTYPE " + g.ownerDocument.doctype.name + `>
|
|
1952
1952
|
` + re), Ne && pt([Te, Ue, Fe], (be) => {
|
|
1953
1953
|
re = Ke(re, be, " ");
|
|
1954
|
-
}),
|
|
1954
|
+
}), m && lt ? m.createHTML(re) : re;
|
|
1955
1955
|
}, e.setConfig = function() {
|
|
1956
1956
|
let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1957
1957
|
Ut(v), It = !0;
|
|
@@ -1959,20 +1959,20 @@ function ws() {
|
|
|
1959
1959
|
Oe = null, It = !1;
|
|
1960
1960
|
}, e.isValidAttribute = function(v, d, g) {
|
|
1961
1961
|
Oe || Ut({});
|
|
1962
|
-
const
|
|
1963
|
-
return Ni(
|
|
1962
|
+
const _ = j(v), $ = j(d);
|
|
1963
|
+
return Ni(_, $, g);
|
|
1964
1964
|
}, e.addHook = function(v, d) {
|
|
1965
|
-
typeof d == "function" && Xe(
|
|
1965
|
+
typeof d == "function" && Xe(N[v], d);
|
|
1966
1966
|
}, e.removeHook = function(v, d) {
|
|
1967
1967
|
if (d !== void 0) {
|
|
1968
|
-
const g = Yr(
|
|
1969
|
-
return g === -1 ? void 0 : Xr(
|
|
1968
|
+
const g = Yr(N[v], d);
|
|
1969
|
+
return g === -1 ? void 0 : Xr(N[v], g, 1)[0];
|
|
1970
1970
|
}
|
|
1971
|
-
return Gi(
|
|
1971
|
+
return Gi(N[v]);
|
|
1972
1972
|
}, e.removeHooks = function(v) {
|
|
1973
|
-
|
|
1973
|
+
N[v] = [];
|
|
1974
1974
|
}, e.removeAllHooks = function() {
|
|
1975
|
-
|
|
1975
|
+
N = Zi();
|
|
1976
1976
|
}, e;
|
|
1977
1977
|
}
|
|
1978
1978
|
var pn = ws();
|
|
@@ -1988,7 +1988,7 @@ const fn = ["innerHTML"], gn = "Markdown", mn = /* @__PURE__ */ me({
|
|
|
1988
1988
|
emits: ["update:markdownText", "changeMode"],
|
|
1989
1989
|
setup(l, { emit: e }) {
|
|
1990
1990
|
const t = l, i = e, s = ts([{ comp: ns, event: a, tooltip: "Edit Markdown" }]);
|
|
1991
|
-
|
|
1991
|
+
z.setOptions({
|
|
1992
1992
|
gfm: !0,
|
|
1993
1993
|
breaks: !0
|
|
1994
1994
|
});
|
|
@@ -2001,7 +2001,7 @@ const fn = ["innerHTML"], gn = "Markdown", mn = /* @__PURE__ */ me({
|
|
|
2001
2001
|
u && (n.value = u === "edit");
|
|
2002
2002
|
});
|
|
2003
2003
|
const o = ke(() => {
|
|
2004
|
-
const u = t.inputFormat === "html" ? r.value ?? "" :
|
|
2004
|
+
const u = t.inputFormat === "html" ? r.value ?? "" : z.parse(r.value ?? "");
|
|
2005
2005
|
return t.sanitize === !1 ? u : pn.sanitize(u);
|
|
2006
2006
|
});
|
|
2007
2007
|
function h() {
|
|
@@ -2010,13 +2010,13 @@ const fn = ["innerHTML"], gn = "Markdown", mn = /* @__PURE__ */ me({
|
|
|
2010
2010
|
function a() {
|
|
2011
2011
|
n.value = !n.value, i("changeMode", n.value ? "edit" : "preview");
|
|
2012
2012
|
}
|
|
2013
|
-
return (u, c) => (
|
|
2013
|
+
return (u, c) => (R(), O(Ce, null, [
|
|
2014
2014
|
yt(u.$slots, "default", {
|
|
2015
2015
|
widgetName: gn,
|
|
2016
2016
|
childIcons: s.value
|
|
2017
2017
|
}, void 0, !0),
|
|
2018
2018
|
D("div", ei({ class: "markdown-widget-wrap" }, u.$attrs), [
|
|
2019
|
-
n.value ? Se((
|
|
2019
|
+
n.value ? Se((R(), O("textarea", {
|
|
2020
2020
|
key: 0,
|
|
2021
2021
|
"onUpdate:modelValue": c[0] || (c[0] = (f) => r.value = f),
|
|
2022
2022
|
onInput: h,
|
|
@@ -2024,7 +2024,7 @@ const fn = ["innerHTML"], gn = "Markdown", mn = /* @__PURE__ */ me({
|
|
|
2024
2024
|
placeholder: "Write markdown here…"
|
|
2025
2025
|
}, null, 544)), [
|
|
2026
2026
|
[Ps, r.value]
|
|
2027
|
-
]) : (
|
|
2027
|
+
]) : (R(), O("div", {
|
|
2028
2028
|
key: 1,
|
|
2029
2029
|
class: "markdown-output",
|
|
2030
2030
|
innerHTML: o.value
|
|
@@ -3468,7 +3468,7 @@ class wn {
|
|
|
3468
3468
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
3469
3469
|
*/
|
|
3470
3470
|
const K = new wn();
|
|
3471
|
-
class
|
|
3471
|
+
class T {
|
|
3472
3472
|
/**
|
|
3473
3473
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
3474
3474
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -3483,8 +3483,8 @@ class R {
|
|
|
3483
3483
|
* let grid = document.querySelector('.grid-stack').gridstack;
|
|
3484
3484
|
*/
|
|
3485
3485
|
static init(e = {}, t = ".grid-stack") {
|
|
3486
|
-
let i =
|
|
3487
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
3486
|
+
let i = T.getGridElement(t);
|
|
3487
|
+
return i ? (i.gridstack || (i.gridstack = new T(i, p.cloneDeep(e))), i.gridstack) : (console.error(typeof t == "string" ? 'GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3488
3488
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.` : "GridStack.init() no grid element was passed."), null);
|
|
3489
3489
|
}
|
|
3490
3490
|
/**
|
|
@@ -3498,8 +3498,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3498
3498
|
*/
|
|
3499
3499
|
static initAll(e = {}, t = ".grid-stack") {
|
|
3500
3500
|
let i = [];
|
|
3501
|
-
return
|
|
3502
|
-
s.gridstack || (s.gridstack = new
|
|
3501
|
+
return T.getGridElements(t).forEach((s) => {
|
|
3502
|
+
s.gridstack || (s.gridstack = new T(s, p.cloneDeep(e))), i.push(s.gridstack);
|
|
3503
3503
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3504
3504
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`), i;
|
|
3505
3505
|
}
|
|
@@ -3518,21 +3518,21 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3518
3518
|
const n = i.gridstack;
|
|
3519
3519
|
return t && (n.opts = { ...n.opts, ...t }), t.children !== void 0 && n.load(t.children), n;
|
|
3520
3520
|
}
|
|
3521
|
-
if (!e.classList.contains("grid-stack") ||
|
|
3522
|
-
if (
|
|
3523
|
-
i =
|
|
3521
|
+
if (!e.classList.contains("grid-stack") || T.addRemoveCB)
|
|
3522
|
+
if (T.addRemoveCB)
|
|
3523
|
+
i = T.addRemoveCB(e, t, !0, !0);
|
|
3524
3524
|
else {
|
|
3525
3525
|
let n = document.implementation.createHTMLDocument("");
|
|
3526
3526
|
n.body.innerHTML = `<div class="grid-stack ${t.class || ""}"></div>`, i = n.body.children[0], e.appendChild(i);
|
|
3527
3527
|
}
|
|
3528
|
-
return
|
|
3528
|
+
return T.init(t, i);
|
|
3529
3529
|
}
|
|
3530
3530
|
/** call this method to register your engine instead of the default one.
|
|
3531
3531
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
3532
3532
|
* replace just one instance.
|
|
3533
3533
|
*/
|
|
3534
3534
|
static registerEngine(e) {
|
|
3535
|
-
|
|
3535
|
+
T.engineClass = e;
|
|
3536
3536
|
}
|
|
3537
3537
|
/** @internal create placeholder DIV as needed */
|
|
3538
3538
|
get placeholder() {
|
|
@@ -3569,7 +3569,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3569
3569
|
const r = this.el.parentElement?.parentElement;
|
|
3570
3570
|
let n = r?.classList.contains(oe.itemClass) ? r.gridstackNode : void 0;
|
|
3571
3571
|
n && (n.subGrid = this, this.parentGridItem = n, this.el.classList.add("grid-stack-nested"), n.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = this.opts.cellHeight === "auto", this._isAutoCellHeight || this.opts.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof this.opts.cellHeight == "number" && this.opts.cellHeightUnit && this.opts.cellHeightUnit !== oe.cellHeightUnit && (this.opts.cellHeight = this.opts.cellHeight + this.opts.cellHeightUnit, delete this.opts.cellHeightUnit), this.cellHeight(this.opts.cellHeight, !1)), this.opts.alwaysShowResizeHandle === "mobile" && (this.opts.alwaysShowResizeHandle = de), this._styleSheetClass = "gs-id-" + fe._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
3572
|
-
let o = this.opts.engineClass ||
|
|
3572
|
+
let o = this.opts.engineClass || T.engineClass || fe;
|
|
3573
3573
|
if (this.engine = new o({
|
|
3574
3574
|
column: this.getColumn(),
|
|
3575
3575
|
float: this.opts.float,
|
|
@@ -3615,8 +3615,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3615
3615
|
} else if (arguments.length === 0 || arguments.length === 1 && i(e))
|
|
3616
3616
|
if (r = t = e, r?.el)
|
|
3617
3617
|
s = r.el;
|
|
3618
|
-
else if (
|
|
3619
|
-
s =
|
|
3618
|
+
else if (T.addRemoveCB)
|
|
3619
|
+
s = T.addRemoveCB(this.el, t, !0, !1);
|
|
3620
3620
|
else {
|
|
3621
3621
|
let o = t?.content || "", h = document.implementation.createHTMLDocument("");
|
|
3622
3622
|
h.body.innerHTML = `<div class="grid-stack-item ${this.opts.itemClass || ""}"><div class="grid-stack-item-content">${o}</div></div>`, s = h.body.children[0];
|
|
@@ -3650,8 +3650,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3650
3650
|
t.column === "auto" && (h = !0, t.column = Math.max(r.w || 1, i?.w || 1), t.disableOneColumnMode = !0);
|
|
3651
3651
|
let a = r.el.querySelector(".grid-stack-item-content"), u, c;
|
|
3652
3652
|
if (s) {
|
|
3653
|
-
if (this._removeDD(r.el), c = { ...r, x: 0, y: 0 }, p.removeInternalForSave(c), delete c.subGridOpts, r.content && (c.content = r.content, delete r.content),
|
|
3654
|
-
u =
|
|
3653
|
+
if (this._removeDD(r.el), c = { ...r, x: 0, y: 0 }, p.removeInternalForSave(c), delete c.subGridOpts, r.content && (c.content = r.content, delete r.content), T.addRemoveCB)
|
|
3654
|
+
u = T.addRemoveCB(this.el, c, !0, !1);
|
|
3655
3655
|
else {
|
|
3656
3656
|
let y = document.implementation.createHTMLDocument("");
|
|
3657
3657
|
y.body.innerHTML = '<div class="grid-stack-item"></div>', u = y.body.children[0], u.appendChild(a), y.body.innerHTML = '<div class="grid-stack-item-content"></div>', a = y.body.children[0], r.el.appendChild(a);
|
|
@@ -3659,10 +3659,10 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3659
3659
|
this._prepareDragDropByNode(r);
|
|
3660
3660
|
}
|
|
3661
3661
|
if (i) {
|
|
3662
|
-
let y = h ? t.column : r.w, x = r.h + i.h,
|
|
3663
|
-
|
|
3662
|
+
let y = h ? t.column : r.w, x = r.h + i.h, I = r.el.style;
|
|
3663
|
+
I.transition = "none", this.update(r.el, { w: y, h: x }), setTimeout(() => I.transition = null);
|
|
3664
3664
|
}
|
|
3665
|
-
let f = r.subGrid =
|
|
3665
|
+
let f = r.subGrid = T.addGrid(a, t);
|
|
3666
3666
|
return i?._moving && (f._isTemp = !0), h && (f._autoColumn = !0), s && f.addWidget(u, c), i && (i._moving ? window.setTimeout(() => p.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.addWidget(r.el, r)), f;
|
|
3667
3667
|
}
|
|
3668
3668
|
/**
|
|
@@ -3684,7 +3684,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3684
3684
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
3685
3685
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
3686
3686
|
*/
|
|
3687
|
-
save(e = !0, t = !1, i =
|
|
3687
|
+
save(e = !0, t = !1, i = T.saveCB) {
|
|
3688
3688
|
let s = this.engine.save(e, i);
|
|
3689
3689
|
if (s.forEach((r) => {
|
|
3690
3690
|
if (e && r.el && !r.subGrid && !i) {
|
|
@@ -3713,19 +3713,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3713
3713
|
* @example
|
|
3714
3714
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3715
3715
|
*/
|
|
3716
|
-
load(e, t =
|
|
3716
|
+
load(e, t = T.addRemoveCB || !0) {
|
|
3717
3717
|
e = p.cloneDeep(e);
|
|
3718
3718
|
const i = e.some((a) => a.x !== void 0 || a.y !== void 0);
|
|
3719
3719
|
i && (e = p.sort(e, -1, this._prevColumn || this.getColumn())), this._insertNotAppend = i;
|
|
3720
3720
|
const s = this.opts.column;
|
|
3721
3721
|
this._prevColumn && this._prevColumn !== s && e.some((a) => (a.x || 0) + a.w > s) && (this._ignoreLayoutsNodeChange = !0, this.engine.cacheLayout(e, this._prevColumn, !0));
|
|
3722
|
-
const r =
|
|
3723
|
-
typeof t == "function" && (
|
|
3722
|
+
const r = T.addRemoveCB;
|
|
3723
|
+
typeof t == "function" && (T.addRemoveCB = t);
|
|
3724
3724
|
let n = [];
|
|
3725
3725
|
this.batchUpdate(), t && [...this.engine.nodes].forEach((u) => {
|
|
3726
3726
|
if (!u.id)
|
|
3727
3727
|
return;
|
|
3728
|
-
p.find(e, u.id) || (
|
|
3728
|
+
p.find(e, u.id) || (T.addRemoveCB && T.addRemoveCB(this.el, u, !1, !1), n.push(u), this.removeWidget(u.el, !0, !1));
|
|
3729
3729
|
});
|
|
3730
3730
|
let o = [];
|
|
3731
3731
|
this.engine.nodes = this.engine.nodes.filter((a) => p.find(e, a.id) ? (o.push(a), !1) : !0);
|
|
@@ -3738,7 +3738,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3738
3738
|
c && c.gridstack && (c.gridstack.load(a.subGridOpts.children), this._insertNotAppend = !0);
|
|
3739
3739
|
}
|
|
3740
3740
|
} else t && this.addWidget(a);
|
|
3741
|
-
}), this.engine.removedNodes = n, this.doContentResize(h, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ?
|
|
3741
|
+
}), this.engine.removedNodes = n, this.doContentResize(h, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ? T.addRemoveCB = r : delete T.addRemoveCB, this;
|
|
3742
3742
|
}
|
|
3743
3743
|
/**
|
|
3744
3744
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3894,7 +3894,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3894
3894
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3895
3895
|
*/
|
|
3896
3896
|
makeWidget(e, t) {
|
|
3897
|
-
let i =
|
|
3897
|
+
let i = T.getElement(e);
|
|
3898
3898
|
this._prepareElement(i, !0, t);
|
|
3899
3899
|
const s = i.gridstackNode;
|
|
3900
3900
|
return this._updateContainerHeight(), this.doContentResize(!1, !1, s), s.subGridOpts && this.makeSubGrid(i, s.subGridOpts, void 0, !1), this._prevColumn && this.opts.column === 1 && (this._ignoreLayoutsNodeChange = !0), this._triggerAddEvent(), this._triggerChangeEvent(), delete this._ignoreLayoutsNodeChange, i;
|
|
@@ -3936,11 +3936,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3936
3936
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3937
3937
|
*/
|
|
3938
3938
|
removeWidget(e, t = !0, i = !0) {
|
|
3939
|
-
return
|
|
3939
|
+
return T.getElements(e).forEach((s) => {
|
|
3940
3940
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3941
3941
|
return;
|
|
3942
3942
|
let r = s.gridstackNode;
|
|
3943
|
-
r || (r = this.engine.nodes.find((n) => s === n.el)), r && (
|
|
3943
|
+
r || (r = this.engine.nodes.find((n) => s === n.el)), r && (T.addRemoveCB && T.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3944
3944
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this;
|
|
3945
3945
|
}
|
|
3946
3946
|
/**
|
|
@@ -3982,7 +3982,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3982
3982
|
let i = arguments, s = 1;
|
|
3983
3983
|
return t = { x: i[s++], y: i[s++], w: i[s++], h: i[s++] }, this.update(e, t);
|
|
3984
3984
|
}
|
|
3985
|
-
return
|
|
3985
|
+
return T.getElements(e).forEach((i) => {
|
|
3986
3986
|
let s = i?.gridstackNode;
|
|
3987
3987
|
if (!s)
|
|
3988
3988
|
return;
|
|
@@ -4022,7 +4022,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4022
4022
|
if (!r)
|
|
4023
4023
|
return;
|
|
4024
4024
|
let n = t && i.h ? i.h * r : e.clientHeight, o;
|
|
4025
|
-
if (i.resizeToContentParent && (o = e.querySelector(i.resizeToContentParent)), o || (o = e.querySelector(
|
|
4025
|
+
if (i.resizeToContentParent && (o = e.querySelector(i.resizeToContentParent)), o || (o = e.querySelector(T.resizeToContentParent)), !o)
|
|
4026
4026
|
return;
|
|
4027
4027
|
const h = e.clientHeight - o.clientHeight, a = t && i.h ? i.h * r - h : o.clientHeight;
|
|
4028
4028
|
let u;
|
|
@@ -4031,7 +4031,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4031
4031
|
else {
|
|
4032
4032
|
const y = o.firstElementChild;
|
|
4033
4033
|
if (!y) {
|
|
4034
|
-
console.log(`Error: resizeToContent() '${
|
|
4034
|
+
console.log(`Error: resizeToContent() '${T.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
4035
4035
|
return;
|
|
4036
4036
|
}
|
|
4037
4037
|
u = y.getBoundingClientRect().height || a;
|
|
@@ -4045,7 +4045,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4045
4045
|
}
|
|
4046
4046
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
4047
4047
|
resizeToContentCheck(e, t = !1) {
|
|
4048
|
-
|
|
4048
|
+
T.resizeToContentCB ? T.resizeToContentCB(e, t) : this.resizeToContent(e, t);
|
|
4049
4049
|
}
|
|
4050
4050
|
/**
|
|
4051
4051
|
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options (CSS string format of 1,2,4 values or single number).
|
|
@@ -4242,7 +4242,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4242
4242
|
}
|
|
4243
4243
|
/** @internal */
|
|
4244
4244
|
static getGridElement(e) {
|
|
4245
|
-
return
|
|
4245
|
+
return T.getElement(e);
|
|
4246
4246
|
}
|
|
4247
4247
|
/** @internal */
|
|
4248
4248
|
static getGridElements(e) {
|
|
@@ -4284,7 +4284,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4284
4284
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
4285
4285
|
*/
|
|
4286
4286
|
movable(e, t) {
|
|
4287
|
-
return this.opts.staticGrid ? this : (
|
|
4287
|
+
return this.opts.staticGrid ? this : (T.getElements(e).forEach((i) => {
|
|
4288
4288
|
let s = i.gridstackNode;
|
|
4289
4289
|
s && (t ? delete s.noMove : s.noMove = !0, this._prepareDragDropByNode(s));
|
|
4290
4290
|
}), this);
|
|
@@ -4295,7 +4295,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4295
4295
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
4296
4296
|
*/
|
|
4297
4297
|
resizable(e, t) {
|
|
4298
|
-
return this.opts.staticGrid ? this : (
|
|
4298
|
+
return this.opts.staticGrid ? this : (T.getElements(e).forEach((i) => {
|
|
4299
4299
|
let s = i.gridstackNode;
|
|
4300
4300
|
s && (t ? delete s.noResize : s.noResize = !0, this._prepareDragDropByNode(s));
|
|
4301
4301
|
}), this);
|
|
@@ -4482,35 +4482,35 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4482
4482
|
if (a = Math.min(a, x), u = Math.min(u, x), c = Math.min(c, y), f = Math.min(f, y), t.type === "drag") {
|
|
4483
4483
|
if (s._temporaryRemoved)
|
|
4484
4484
|
return;
|
|
4485
|
-
let
|
|
4486
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && p.updateScrollPosition(e, i.position,
|
|
4487
|
-
let
|
|
4488
|
-
o.x = Math.round(
|
|
4489
|
-
let
|
|
4485
|
+
let W = i.position.top - s._prevYPix;
|
|
4486
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && p.updateScrollPosition(e, i.position, W);
|
|
4487
|
+
let L = i.position.left + (i.position.left > s._lastUiPosition.left ? -u : a), H = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : c);
|
|
4488
|
+
o.x = Math.round(L / r), o.y = Math.round(H / n);
|
|
4489
|
+
let S = this._extraDragRow;
|
|
4490
4490
|
if (this.engine.collide(s, o)) {
|
|
4491
|
-
let
|
|
4492
|
-
this.opts.maxRow &&
|
|
4491
|
+
let m = this.getRow(), b = Math.max(0, o.y + s.h - m);
|
|
4492
|
+
this.opts.maxRow && m + b > this.opts.maxRow && (b = Math.max(0, this.opts.maxRow - m)), this._extraDragRow = b;
|
|
4493
4493
|
} else
|
|
4494
4494
|
this._extraDragRow = 0;
|
|
4495
|
-
if (this._extraDragRow !==
|
|
4495
|
+
if (this._extraDragRow !== S && this._updateContainerHeight(), s.x === o.x && s.y === o.y)
|
|
4496
4496
|
return;
|
|
4497
4497
|
} else if (t.type === "resize") {
|
|
4498
4498
|
if (o.x < 0 || (p.updateScrollResize(t, e, n), o.w = Math.round((i.size.width - a) / r), o.h = Math.round((i.size.height - c) / n), s.w === o.w && s.h === o.h) || s._lastTried && s._lastTried.w === o.w && s._lastTried.h === o.h)
|
|
4499
4499
|
return;
|
|
4500
|
-
let
|
|
4501
|
-
o.x = Math.round(
|
|
4500
|
+
let W = i.position.left + a, L = i.position.top + c;
|
|
4501
|
+
o.x = Math.round(W / r), o.y = Math.round(L / n), h = !0;
|
|
4502
4502
|
}
|
|
4503
4503
|
s._event = t, s._lastTried = o;
|
|
4504
|
-
let
|
|
4504
|
+
let I = {
|
|
4505
4505
|
x: i.position.left + a,
|
|
4506
4506
|
y: i.position.top + c,
|
|
4507
4507
|
w: (i.size ? i.size.width : s.w * r) - a - u,
|
|
4508
4508
|
h: (i.size ? i.size.height : s.h * n) - c - f
|
|
4509
4509
|
};
|
|
4510
|
-
if (this.engine.moveNodeCheck(s, { ...o, cellWidth: r, cellHeight: n, rect:
|
|
4510
|
+
if (this.engine.moveNodeCheck(s, { ...o, cellWidth: r, cellHeight: n, rect: I, resizing: h })) {
|
|
4511
4511
|
s._lastUiPosition = i.position, this.engine.cacheRects(r, n, c, u, f, a), delete s._skipDown, h && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4512
|
-
let
|
|
4513
|
-
this._writePosAttr(
|
|
4512
|
+
let W = t.target;
|
|
4513
|
+
this._writePosAttr(W, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, W);
|
|
4514
4514
|
}
|
|
4515
4515
|
}
|
|
4516
4516
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4526,10 +4526,10 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4526
4526
|
return _n(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4527
4527
|
}
|
|
4528
4528
|
}
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4529
|
+
T.resizeToContentParent = ".grid-stack-item-content";
|
|
4530
|
+
T.Utils = p;
|
|
4531
|
+
T.Engine = fe;
|
|
4532
|
+
T.GDRev = "9.5.1";
|
|
4533
4533
|
const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class: "color-primary" }, En = { class: "color-secondary" }, Tn = {
|
|
4534
4534
|
key: 1,
|
|
4535
4535
|
class: "empty"
|
|
@@ -4551,8 +4551,8 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4551
4551
|
if (e.order?.length) {
|
|
4552
4552
|
const c = new Map(e.order.map((f, y) => [f, y]));
|
|
4553
4553
|
u.sort((f, y) => {
|
|
4554
|
-
const x = c.has(f.key) ? c.get(f.key) : Number.MAX_SAFE_INTEGER,
|
|
4555
|
-
return x -
|
|
4554
|
+
const x = c.has(f.key) ? c.get(f.key) : Number.MAX_SAFE_INTEGER, I = c.has(y.key) ? c.get(y.key) : Number.MAX_SAFE_INTEGER;
|
|
4555
|
+
return x - I || f.key.localeCompare(y.key);
|
|
4556
4556
|
});
|
|
4557
4557
|
} else
|
|
4558
4558
|
u.sort((c, f) => c.key.localeCompare(f.key));
|
|
@@ -4570,14 +4570,14 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4570
4570
|
}
|
|
4571
4571
|
return (a, u) => {
|
|
4572
4572
|
const c = ee("el-icon"), f = ee("el-row");
|
|
4573
|
-
return
|
|
4573
|
+
return R(), ne(f, {
|
|
4574
4574
|
class: "filter-wrapper tw-m-1",
|
|
4575
4575
|
align: "middle",
|
|
4576
4576
|
justify: "space-between"
|
|
4577
4577
|
}, {
|
|
4578
|
-
default:
|
|
4578
|
+
default: V(() => [
|
|
4579
4579
|
D("div", xn, [
|
|
4580
|
-
r.value.length ? (
|
|
4580
|
+
r.value.length ? (R(!0), O(Ce, { key: 0 }, tt(r.value, (y) => (R(), ne(le(qs), {
|
|
4581
4581
|
class: "color-background",
|
|
4582
4582
|
key: y.key,
|
|
4583
4583
|
closable: "",
|
|
@@ -4585,24 +4585,24 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4585
4585
|
effect: "dark",
|
|
4586
4586
|
type: "info"
|
|
4587
4587
|
}, {
|
|
4588
|
-
default:
|
|
4588
|
+
default: V(() => [
|
|
4589
4589
|
D("b", kn, Ee(y.key) + ": ", 1),
|
|
4590
4590
|
D("span", En, Ee(n(y.value)), 1)
|
|
4591
4591
|
]),
|
|
4592
4592
|
_: 2
|
|
4593
|
-
}, 1032, ["onClose"]))), 128)) : (
|
|
4593
|
+
}, 1032, ["onClose"]))), 128)) : (R(), O("span", Tn, "No filters"))
|
|
4594
4594
|
]),
|
|
4595
|
-
r.value.length ? (
|
|
4595
|
+
r.value.length ? (R(), O("div", Rn, [
|
|
4596
4596
|
Y(le(rs), {
|
|
4597
4597
|
placement: "top-start",
|
|
4598
4598
|
content: "Clear All Filters"
|
|
4599
4599
|
}, {
|
|
4600
|
-
default:
|
|
4600
|
+
default: V(() => [
|
|
4601
4601
|
Y(c, {
|
|
4602
4602
|
color: "#FFFF",
|
|
4603
4603
|
onClick: h
|
|
4604
4604
|
}, {
|
|
4605
|
-
default:
|
|
4605
|
+
default: V(() => [
|
|
4606
4606
|
Y(le(Ys))
|
|
4607
4607
|
]),
|
|
4608
4608
|
_: 1
|
|
@@ -4654,13 +4654,13 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4654
4654
|
}
|
|
4655
4655
|
return (h, a) => {
|
|
4656
4656
|
const u = ee("el-input"), c = is("click-out");
|
|
4657
|
-
return l.hideHeader ? (
|
|
4657
|
+
return l.hideHeader ? (R(), O("div", zn, [
|
|
4658
4658
|
D("div", Mn, [
|
|
4659
4659
|
yt(h.$slots, "default", {}, void 0, !0)
|
|
4660
4660
|
])
|
|
4661
|
-
])) : (
|
|
4661
|
+
])) : (R(), O("div", An, [
|
|
4662
4662
|
D("div", null, [
|
|
4663
|
-
Se((
|
|
4663
|
+
Se((R(), O("div", {
|
|
4664
4664
|
onKeyup: ss(o, ["enter"]),
|
|
4665
4665
|
class: "tw-flex"
|
|
4666
4666
|
}, [
|
|
@@ -4744,12 +4744,12 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4744
4744
|
}
|
|
4745
4745
|
return (h, a) => {
|
|
4746
4746
|
const u = ee("el-icon");
|
|
4747
|
-
return
|
|
4747
|
+
return R(), O("div", {
|
|
4748
4748
|
ref_key: "instance",
|
|
4749
4749
|
ref: s,
|
|
4750
4750
|
class: $s(["grid-stack-item-content", { "locked-widget": l.isLocked }])
|
|
4751
4751
|
}, [
|
|
4752
|
-
(
|
|
4752
|
+
(R(), ne(Oi(l.componentTag), ei({
|
|
4753
4753
|
class: ["widget-body", { "widget-body-no-head": n.value }],
|
|
4754
4754
|
widgetID: l.widgetID,
|
|
4755
4755
|
hideHeader: n.value
|
|
@@ -4757,22 +4757,22 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4757
4757
|
style: { pointerEvents: r.value ? "none" : "auto" },
|
|
4758
4758
|
isLocked: r.value
|
|
4759
4759
|
}), {
|
|
4760
|
-
default:
|
|
4761
|
-
c ? (
|
|
4760
|
+
default: V((c) => [
|
|
4761
|
+
c ? (R(), ne(Hn, {
|
|
4762
4762
|
key: 0,
|
|
4763
4763
|
widgetName: i.componentName,
|
|
4764
4764
|
widgetID: l.widgetID,
|
|
4765
4765
|
staticMode: l.staticMode,
|
|
4766
4766
|
hideHeader: n.value
|
|
4767
4767
|
}, {
|
|
4768
|
-
default:
|
|
4768
|
+
default: V(() => [
|
|
4769
4769
|
D("div", On, [
|
|
4770
|
-
(
|
|
4771
|
-
content:
|
|
4770
|
+
(R(!0), O(Ce, null, tt(c.childIcons, (f) => (R(), ne(le(rs), { placement: "bottom-start" }, {
|
|
4771
|
+
content: V(() => [
|
|
4772
4772
|
$e(Ee(f.tooltip), 1)
|
|
4773
4773
|
]),
|
|
4774
|
-
default:
|
|
4775
|
-
(
|
|
4774
|
+
default: V(() => [
|
|
4775
|
+
(R(), ne(Oi(f.comp), {
|
|
4776
4776
|
class: "tw-w-4 header-icon",
|
|
4777
4777
|
onClick: f.event
|
|
4778
4778
|
}, null, 8, ["onClick"]))
|
|
@@ -4783,17 +4783,17 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4783
4783
|
class: "header-icon lock-toggle",
|
|
4784
4784
|
onClick: a[0] || (a[0] = (f) => o())
|
|
4785
4785
|
}, {
|
|
4786
|
-
default:
|
|
4787
|
-
r.value ? (
|
|
4786
|
+
default: V(() => [
|
|
4787
|
+
r.value ? (R(), ne(le(Js), { key: 0 })) : (R(), ne(le(tr), { key: 1 }))
|
|
4788
4788
|
]),
|
|
4789
4789
|
_: 1
|
|
4790
4790
|
}),
|
|
4791
|
-
!l.staticMode && !l.isLocked ? (
|
|
4791
|
+
!l.staticMode && !l.isLocked ? (R(), ne(u, {
|
|
4792
4792
|
key: 0,
|
|
4793
4793
|
class: "item-widget-button",
|
|
4794
4794
|
onClick: a[1] || (a[1] = (f) => h.$emit("removeWidget"))
|
|
4795
4795
|
}, {
|
|
4796
|
-
default:
|
|
4796
|
+
default: V(() => [
|
|
4797
4797
|
Y(le(Ks))
|
|
4798
4798
|
]),
|
|
4799
4799
|
_: 1
|
|
@@ -4823,7 +4823,8 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4823
4823
|
setup(l) {
|
|
4824
4824
|
const e = l, t = Be(), { DASHBOARD_ITEMS: i } = gt(t), s = {
|
|
4825
4825
|
apiUrl: ke(() => t.Services?.ApiUrl),
|
|
4826
|
-
|
|
4826
|
+
s3Url: ke(() => t.Services?.s3Url),
|
|
4827
|
+
filters: t.Filters,
|
|
4827
4828
|
setFilter: t.setFilter,
|
|
4828
4829
|
clearFilter: t.clearFilter,
|
|
4829
4830
|
resetFilters: t.resetFilters
|
|
@@ -4834,15 +4835,15 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4834
4835
|
let h = P(!0), a = 0;
|
|
4835
4836
|
const u = P([]), { ComponentRegistry: c } = gt(t), f = es({});
|
|
4836
4837
|
Us(() => {
|
|
4837
|
-
y(), t.loadFromLocalStorage(), a = i.value
|
|
4838
|
+
y(), t.loadFromLocalStorage(), a = i.value?.length + 1;
|
|
4838
4839
|
}), Fs(() => {
|
|
4839
|
-
x(),
|
|
4840
|
+
x(), I();
|
|
4840
4841
|
});
|
|
4841
4842
|
function y() {
|
|
4842
4843
|
t.DefaultLayout = e.options?.defaultLayout, t.setOptionServices(e.options?.services);
|
|
4843
4844
|
}
|
|
4844
4845
|
function x() {
|
|
4845
|
-
const
|
|
4846
|
+
const m = {
|
|
4846
4847
|
float: !0,
|
|
4847
4848
|
column: 12,
|
|
4848
4849
|
cellHeight: "70px",
|
|
@@ -4853,97 +4854,97 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4853
4854
|
handles: "e,se,s,sw,w,n"
|
|
4854
4855
|
}
|
|
4855
4856
|
};
|
|
4856
|
-
n.value =
|
|
4857
|
+
n.value = T.init(m), n.value.setStatic(h.value);
|
|
4857
4858
|
}
|
|
4858
4859
|
ae(
|
|
4859
4860
|
() => e.options?.availableWidgets,
|
|
4860
|
-
(
|
|
4861
|
-
c.value = {}, u.value = [],
|
|
4862
|
-
let
|
|
4863
|
-
if (
|
|
4864
|
-
|
|
4865
|
-
else if (
|
|
4866
|
-
|
|
4867
|
-
const k = await
|
|
4861
|
+
(m) => {
|
|
4862
|
+
c.value = {}, u.value = [], m && m.forEach((b, B) => {
|
|
4863
|
+
let U, C;
|
|
4864
|
+
if (b && typeof b == "object" && "name" in b && "component" in b)
|
|
4865
|
+
U = b.name, C = b.component;
|
|
4866
|
+
else if (b && typeof b == "object" && "name" in b && "loader" in b)
|
|
4867
|
+
U = b.name, C = Ws(async () => {
|
|
4868
|
+
const k = await b.loader();
|
|
4868
4869
|
return k.default ?? k;
|
|
4869
4870
|
});
|
|
4870
|
-
else if (
|
|
4871
|
-
C =
|
|
4872
|
-
else if (typeof
|
|
4871
|
+
else if (b && (typeof b == "function" || typeof b == "object"))
|
|
4872
|
+
C = b, U = b.name || `Widget${B + 1}`;
|
|
4873
|
+
else if (typeof b == "function")
|
|
4873
4874
|
return;
|
|
4874
|
-
!
|
|
4875
|
+
!U || !C || c.value[U] || (c.value[U] = C, u.value.push(U));
|
|
4875
4876
|
});
|
|
4876
4877
|
},
|
|
4877
4878
|
{ immediate: !0, deep: !0 }
|
|
4878
4879
|
);
|
|
4879
|
-
function
|
|
4880
|
-
const
|
|
4881
|
-
if (
|
|
4880
|
+
function I() {
|
|
4881
|
+
const m = e.options.globalData;
|
|
4882
|
+
if (m) {
|
|
4882
4883
|
t.clearOptionsDataItems();
|
|
4883
|
-
for (const
|
|
4884
|
-
t.addOptionsDataItems(
|
|
4884
|
+
for (const b in m)
|
|
4885
|
+
t.addOptionsDataItems(b, m[b]);
|
|
4885
4886
|
}
|
|
4886
4887
|
}
|
|
4887
|
-
ae(() => h.value, (
|
|
4888
|
-
n.value.setStatic(
|
|
4888
|
+
ae(() => h.value, (m) => {
|
|
4889
|
+
n.value.setStatic(m), r.value = m ? "Edit Grid" : "Save Grid";
|
|
4889
4890
|
});
|
|
4890
|
-
function
|
|
4891
|
-
if (!
|
|
4891
|
+
function W(m) {
|
|
4892
|
+
if (!m)
|
|
4892
4893
|
return;
|
|
4893
|
-
const
|
|
4894
|
-
id:
|
|
4894
|
+
const b = `${m}-${a}`, B = {
|
|
4895
|
+
id: b,
|
|
4895
4896
|
w: 2,
|
|
4896
4897
|
h: 6,
|
|
4897
4898
|
autoPosition: !0,
|
|
4898
|
-
component: c.value[
|
|
4899
|
-
componentKey:
|
|
4900
|
-
componentName:
|
|
4899
|
+
component: c.value[m],
|
|
4900
|
+
componentKey: m,
|
|
4901
|
+
componentName: m,
|
|
4901
4902
|
Props: {}
|
|
4902
4903
|
};
|
|
4903
|
-
a++, i.value.push(
|
|
4904
|
-
n.value?.makeWidget(`#${
|
|
4904
|
+
a++, i.value.push(B), Gs(() => {
|
|
4905
|
+
n.value?.makeWidget(`#${b}`);
|
|
4905
4906
|
});
|
|
4906
4907
|
}
|
|
4907
|
-
function
|
|
4908
|
-
var
|
|
4909
|
-
i.value.splice(
|
|
4910
|
-
const
|
|
4911
|
-
n.value.removeWidget(
|
|
4908
|
+
function L(m) {
|
|
4909
|
+
var b = i.value.findIndex((U) => U.id == m);
|
|
4910
|
+
i.value.splice(b, 1);
|
|
4911
|
+
const B = `#${m}`;
|
|
4912
|
+
n.value.removeWidget(B, !1);
|
|
4912
4913
|
}
|
|
4913
|
-
function H({ id:
|
|
4914
|
-
const
|
|
4915
|
-
|
|
4916
|
-
locked: !
|
|
4917
|
-
noMove: !
|
|
4918
|
-
noResize: !
|
|
4919
|
-
}), t.toggleWidgetLock(
|
|
4914
|
+
function H({ id: m, isLocked: b }) {
|
|
4915
|
+
const B = f[m];
|
|
4916
|
+
B && n.value && n.value.update(B, {
|
|
4917
|
+
locked: !b,
|
|
4918
|
+
noMove: !b,
|
|
4919
|
+
noResize: !b
|
|
4920
|
+
}), t.toggleWidgetLock(m);
|
|
4920
4921
|
}
|
|
4921
|
-
function
|
|
4922
|
+
function S() {
|
|
4922
4923
|
h.value = !h.value, h.value && t.saveToLocalStorage();
|
|
4923
4924
|
}
|
|
4924
|
-
return (
|
|
4925
|
-
const
|
|
4926
|
-
return
|
|
4927
|
-
|
|
4928
|
-
|
|
4925
|
+
return (m, b) => {
|
|
4926
|
+
const B = ee("el-button"), U = ee("el-option"), C = ee("el-select"), k = ee("el-col");
|
|
4927
|
+
return R(), O("div", Bn, [
|
|
4928
|
+
m.hideHeader ? (R(), O("div", Wn, [
|
|
4929
|
+
b[2] || (b[2] = $e("x ", -1)),
|
|
4929
4930
|
D("span", Gn, [
|
|
4930
|
-
Y(
|
|
4931
|
+
Y(B, {
|
|
4931
4932
|
class: "edit-button",
|
|
4932
|
-
onClick:
|
|
4933
|
+
onClick: b[1] || (b[1] = (E) => S())
|
|
4933
4934
|
}, {
|
|
4934
|
-
default:
|
|
4935
|
+
default: V(() => [
|
|
4935
4936
|
$e(Ee(le(r)), 1)
|
|
4936
4937
|
]),
|
|
4937
4938
|
_: 1
|
|
4938
4939
|
})
|
|
4939
4940
|
])
|
|
4940
|
-
])) : (
|
|
4941
|
+
])) : (R(), O("div", Un, [
|
|
4941
4942
|
D("span", Fn, [
|
|
4942
|
-
Y(
|
|
4943
|
+
Y(B, {
|
|
4943
4944
|
class: "edit-button",
|
|
4944
|
-
onClick:
|
|
4945
|
+
onClick: b[0] || (b[0] = (E) => S())
|
|
4945
4946
|
}, {
|
|
4946
|
-
default:
|
|
4947
|
+
default: V(() => [
|
|
4947
4948
|
$e(Ee(le(r)), 1)
|
|
4948
4949
|
]),
|
|
4949
4950
|
_: 1
|
|
@@ -4951,16 +4952,16 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4951
4952
|
]),
|
|
4952
4953
|
Y(Cn)
|
|
4953
4954
|
])),
|
|
4954
|
-
le(h) ? vt("", !0) : (
|
|
4955
|
-
default:
|
|
4955
|
+
le(h) ? vt("", !0) : (R(), ne(k, { key: 2 }, {
|
|
4956
|
+
default: V(() => [
|
|
4956
4957
|
D("div", Vn, [
|
|
4957
4958
|
Y(C, { placeholder: "Add New Widget" }, {
|
|
4958
|
-
default:
|
|
4959
|
-
(
|
|
4959
|
+
default: V(() => [
|
|
4960
|
+
(R(!0), O(Ce, null, tt(u.value, (E) => (R(), ne(U, {
|
|
4960
4961
|
key: E,
|
|
4961
4962
|
label: E,
|
|
4962
4963
|
value: E,
|
|
4963
|
-
onClick: (
|
|
4964
|
+
onClick: (N) => W(E)
|
|
4964
4965
|
}, null, 8, ["label", "value", "onClick"]))), 128))
|
|
4965
4966
|
]),
|
|
4966
4967
|
_: 1
|
|
@@ -4974,10 +4975,10 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4974
4975
|
ref: o,
|
|
4975
4976
|
class: "grid-stack tw-h-screen"
|
|
4976
4977
|
}, [
|
|
4977
|
-
(
|
|
4978
|
+
(R(!0), O(Ce, null, tt(le(i), (E) => (R(), O("div", {
|
|
4978
4979
|
class: "grid-stack-item",
|
|
4979
4980
|
ref_for: !0,
|
|
4980
|
-
ref: (
|
|
4981
|
+
ref: (N) => f[E.id] = N,
|
|
4981
4982
|
"gs-x": E.x,
|
|
4982
4983
|
"gs-y": E.y,
|
|
4983
4984
|
"gs-w": E.w,
|
|
@@ -4992,7 +4993,7 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
4992
4993
|
}, [
|
|
4993
4994
|
Y($n, {
|
|
4994
4995
|
widgetID: E.id,
|
|
4995
|
-
onRemoveWidget: (
|
|
4996
|
+
onRemoveWidget: (N) => L(E.id),
|
|
4996
4997
|
onToggleLock: H,
|
|
4997
4998
|
"static-mode": le(h),
|
|
4998
4999
|
componentTag: E.component,
|
|
@@ -5006,7 +5007,7 @@ const xn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, kn = { class:
|
|
|
5006
5007
|
]);
|
|
5007
5008
|
};
|
|
5008
5009
|
}
|
|
5009
|
-
}), Jn = /* @__PURE__ */ De(jn, [["__scopeId", "data-v-
|
|
5010
|
+
}), Jn = /* @__PURE__ */ De(jn, [["__scopeId", "data-v-f42c459e"]]);
|
|
5010
5011
|
export {
|
|
5011
5012
|
Qn as MarkdownWidget,
|
|
5012
5013
|
Jn as PennsieveDashboard,
|