pennsieve-dashboard 0.2.2 → 0.2.3
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/README.md +415 -2
- package/dist/pennsieve-dashboard.es.js +972 -913
- package/dist/pennsieve-dashboard.umd.js +38 -38
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
1
|
+
var $s = Object.defineProperty;
|
|
2
|
+
var Bs = (o, e, t) => e in o ? $s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var U = (o, e, t) => Bs(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as ce, createElementBlock as B, openBlock as T, createElementVNode as N, ref as F, reactive as Qt, isRef as Us, isReactive as Fs, markRaw as Ws, computed as ve, watch as fe, resolveComponent as re, createBlock as te, withCtx as G, createVNode as q, Fragment as Le, renderList as tt, unref as ie, createTextVNode as Se, inject as Gs, shallowRef as ls, resolveDirective as as, renderSlot as bt, mergeProps as oi, withDirectives as De, toDisplayString as Re, withKeys as hs, vShow as xt, vModelText as Vs, createCommentVNode as kt, toRaw as qs, onMounted as us, onBeforeUnmount as cs, normalizeClass as js, resolveDynamicComponent as Wi, onBeforeMount as Ys, provide as Xs, defineAsyncComponent as Zs, nextTick as Gi } from "vue";
|
|
5
5
|
import { defineStore as Ks, storeToRefs as Jt } from "pinia";
|
|
6
|
-
import { ElTag as Qs, ElTooltip as
|
|
6
|
+
import { ElTag as Qs, ElTooltip as ei } from "element-plus";
|
|
7
7
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
8
|
-
var Js = /* @__PURE__ */
|
|
8
|
+
var Js = /* @__PURE__ */ ce({
|
|
9
9
|
name: "CircleCloseFilled",
|
|
10
10
|
__name: "circle-close-filled",
|
|
11
11
|
setup(o) {
|
|
12
|
-
return (e, t) => (
|
|
12
|
+
return (e, t) => (T(), B("svg", {
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
viewBox: "0 0 1024 1024"
|
|
15
15
|
}, [
|
|
@@ -19,11 +19,11 @@ var Js = /* @__PURE__ */ be({
|
|
|
19
19
|
})
|
|
20
20
|
]));
|
|
21
21
|
}
|
|
22
|
-
}), er = Js, tr = /* @__PURE__ */
|
|
22
|
+
}), er = Js, tr = /* @__PURE__ */ ce({
|
|
23
23
|
name: "Close",
|
|
24
24
|
__name: "close",
|
|
25
25
|
setup(o) {
|
|
26
|
-
return (e, t) => (
|
|
26
|
+
return (e, t) => (T(), B("svg", {
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
viewBox: "0 0 1024 1024"
|
|
29
29
|
}, [
|
|
@@ -33,11 +33,11 @@ var Js = /* @__PURE__ */ be({
|
|
|
33
33
|
})
|
|
34
34
|
]));
|
|
35
35
|
}
|
|
36
|
-
}), ir = tr, sr = /* @__PURE__ */
|
|
36
|
+
}), ir = tr, sr = /* @__PURE__ */ ce({
|
|
37
37
|
name: "Edit",
|
|
38
38
|
__name: "edit",
|
|
39
39
|
setup(o) {
|
|
40
|
-
return (e, t) => (
|
|
40
|
+
return (e, t) => (T(), B("svg", {
|
|
41
41
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
42
|
viewBox: "0 0 1024 1024"
|
|
43
43
|
}, [
|
|
@@ -51,11 +51,25 @@ var Js = /* @__PURE__ */ be({
|
|
|
51
51
|
})
|
|
52
52
|
]));
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), ds = sr, rr = /* @__PURE__ */ ce({
|
|
55
|
+
name: "FullScreen",
|
|
56
|
+
__name: "full-screen",
|
|
57
|
+
setup(o) {
|
|
58
|
+
return (e, t) => (T(), B("svg", {
|
|
59
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
60
|
+
viewBox: "0 0 1024 1024"
|
|
61
|
+
}, [
|
|
62
|
+
N("path", {
|
|
63
|
+
fill: "currentColor",
|
|
64
|
+
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
65
|
+
})
|
|
66
|
+
]));
|
|
67
|
+
}
|
|
68
|
+
}), nr = rr, or = /* @__PURE__ */ ce({
|
|
55
69
|
name: "Lock",
|
|
56
70
|
__name: "lock",
|
|
57
71
|
setup(o) {
|
|
58
|
-
return (e, t) => (
|
|
72
|
+
return (e, t) => (T(), B("svg", {
|
|
59
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
60
74
|
viewBox: "0 0 1024 1024"
|
|
61
75
|
}, [
|
|
@@ -69,11 +83,25 @@ var Js = /* @__PURE__ */ be({
|
|
|
69
83
|
})
|
|
70
84
|
]));
|
|
71
85
|
}
|
|
72
|
-
}),
|
|
86
|
+
}), lr = or, ar = /* @__PURE__ */ ce({
|
|
87
|
+
name: "ScaleToOriginal",
|
|
88
|
+
__name: "scale-to-original",
|
|
89
|
+
setup(o) {
|
|
90
|
+
return (e, t) => (T(), B("svg", {
|
|
91
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
92
|
+
viewBox: "0 0 1024 1024"
|
|
93
|
+
}, [
|
|
94
|
+
N("path", {
|
|
95
|
+
fill: "currentColor",
|
|
96
|
+
d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"
|
|
97
|
+
})
|
|
98
|
+
]));
|
|
99
|
+
}
|
|
100
|
+
}), hr = ar, ur = /* @__PURE__ */ ce({
|
|
73
101
|
name: "Unlock",
|
|
74
102
|
__name: "unlock",
|
|
75
103
|
setup(o) {
|
|
76
|
-
return (e, t) => (
|
|
104
|
+
return (e, t) => (T(), B("svg", {
|
|
77
105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
106
|
viewBox: "0 0 1024 1024"
|
|
79
107
|
}, [
|
|
@@ -87,57 +115,57 @@ var Js = /* @__PURE__ */ be({
|
|
|
87
115
|
})
|
|
88
116
|
]));
|
|
89
117
|
}
|
|
90
|
-
}),
|
|
118
|
+
}), cr = ur;
|
|
91
119
|
const rt = Ks("globalPensieveDashVars", () => {
|
|
92
120
|
const o = F([]), e = F({}), t = "dashboard-globalVarsStore", i = F([]), s = F([]), r = F({}), l = Qt({}), n = Qt({});
|
|
93
|
-
function u(
|
|
94
|
-
l[
|
|
121
|
+
function u(D, R, j = !1) {
|
|
122
|
+
l[D] = R, n[D] = j;
|
|
95
123
|
}
|
|
96
|
-
function a(
|
|
97
|
-
for (const
|
|
98
|
-
Object.assign(l,
|
|
124
|
+
function a(D = {}) {
|
|
125
|
+
for (const R of Object.keys(l)) delete l[R];
|
|
126
|
+
Object.assign(l, D);
|
|
99
127
|
}
|
|
100
|
-
const h = (
|
|
101
|
-
delete l[
|
|
128
|
+
const h = (D) => {
|
|
129
|
+
delete l[D];
|
|
102
130
|
};
|
|
103
131
|
function p() {
|
|
104
|
-
for (const
|
|
132
|
+
for (const D of Object.keys(l)) delete l[D];
|
|
105
133
|
}
|
|
106
|
-
function
|
|
134
|
+
function d() {
|
|
107
135
|
s.value = [...o.value], a({});
|
|
108
136
|
}
|
|
109
|
-
const m = (
|
|
110
|
-
i.value.push({ name:
|
|
111
|
-
},
|
|
137
|
+
const m = (D) => s.value.find((R) => R.id === D), y = (D, R) => {
|
|
138
|
+
i.value.push({ name: D, value: R });
|
|
139
|
+
}, S = () => {
|
|
112
140
|
i.value = [];
|
|
113
|
-
},
|
|
114
|
-
r.value =
|
|
115
|
-
},
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
for (const [
|
|
120
|
-
if (
|
|
121
|
-
const M = Object.getPrototypeOf(
|
|
122
|
-
|
|
141
|
+
}, I = (D) => {
|
|
142
|
+
r.value = C(D);
|
|
143
|
+
}, x = () => r.value;
|
|
144
|
+
function C(D) {
|
|
145
|
+
const R = {};
|
|
146
|
+
if (!D || typeof D != "object") return R;
|
|
147
|
+
for (const [j, $] of Object.entries(D))
|
|
148
|
+
if ($ && typeof $ == "object" && !(Us($) || Fs($))) {
|
|
149
|
+
const M = Object.getPrototypeOf($) === Object.prototype;
|
|
150
|
+
R[j] = M ? { ...$ } : Ws($);
|
|
123
151
|
} else
|
|
124
|
-
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
const A = (
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
const
|
|
132
|
-
return
|
|
133
|
-
...
|
|
134
|
-
component:
|
|
152
|
+
R[j] = $;
|
|
153
|
+
return R;
|
|
154
|
+
}
|
|
155
|
+
const A = (D) => {
|
|
156
|
+
const R = s.value.find((j) => j.id === D);
|
|
157
|
+
R && (R.Props = R.Props || {}, R.Props.locked = !R.Props.locked);
|
|
158
|
+
}, E = (D) => D.map((R) => {
|
|
159
|
+
const j = e.value[R.componentKey];
|
|
160
|
+
return j ? {
|
|
161
|
+
...R,
|
|
162
|
+
component: j
|
|
135
163
|
// attach runtime component
|
|
136
164
|
} : null;
|
|
137
|
-
}).filter((
|
|
138
|
-
function
|
|
165
|
+
}).filter((R) => !!R);
|
|
166
|
+
function H(D) {
|
|
139
167
|
}
|
|
140
|
-
function
|
|
168
|
+
function v() {
|
|
141
169
|
}
|
|
142
170
|
return {
|
|
143
171
|
DASHBOARD_ITEMS: s,
|
|
@@ -147,35 +175,35 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
147
175
|
Services: r,
|
|
148
176
|
Filters: l,
|
|
149
177
|
displayFilters: n,
|
|
150
|
-
registerGridProvider:
|
|
151
|
-
unregisterGridProvider:
|
|
178
|
+
registerGridProvider: H,
|
|
179
|
+
unregisterGridProvider: v,
|
|
152
180
|
setFilter: u,
|
|
153
181
|
clearFilter: h,
|
|
154
182
|
clearAllFilters: p,
|
|
155
183
|
resetFilters: a,
|
|
156
|
-
resetGridLayout:
|
|
184
|
+
resetGridLayout: d,
|
|
157
185
|
getDashItem: m,
|
|
158
186
|
toggleWidgetLock: A,
|
|
159
|
-
addOptionsDataItems:
|
|
160
|
-
clearOptionsDataItems:
|
|
187
|
+
addOptionsDataItems: y,
|
|
188
|
+
clearOptionsDataItems: S,
|
|
161
189
|
//saveToLocalStorage,
|
|
162
190
|
loadFromLocalStorage: () => {
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
165
|
-
|
|
191
|
+
const D = localStorage.getItem(t);
|
|
192
|
+
if (!D) {
|
|
193
|
+
d();
|
|
166
194
|
return;
|
|
167
195
|
}
|
|
168
196
|
try {
|
|
169
|
-
const
|
|
170
|
-
s.value = Array.isArray(
|
|
171
|
-
} catch (
|
|
172
|
-
console.error("Failed to parse globalVarsStore:",
|
|
197
|
+
const R = JSON.parse(D);
|
|
198
|
+
s.value = Array.isArray(R.items) ? E(R.items) : [...o.value], a(R.filters ?? {});
|
|
199
|
+
} catch (R) {
|
|
200
|
+
console.error("Failed to parse globalVarsStore:", R), s.value = [...o.value], a({});
|
|
173
201
|
}
|
|
174
202
|
},
|
|
175
|
-
setOptionServices:
|
|
176
|
-
getServices:
|
|
203
|
+
setOptionServices: I,
|
|
204
|
+
getServices: x
|
|
177
205
|
};
|
|
178
|
-
}),
|
|
206
|
+
}), dr = { class: "widget-settings-container" }, pr = { class: "widget-setting" }, fr = { class: "dialog-footer" }, gr = /* @__PURE__ */ ce({
|
|
179
207
|
__name: "TextWidgetSettings",
|
|
180
208
|
props: {
|
|
181
209
|
showDialog: { type: Boolean },
|
|
@@ -185,73 +213,73 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
185
213
|
},
|
|
186
214
|
emits: ["close-dialog", "update-text-var"],
|
|
187
215
|
setup(o, { emit: e }) {
|
|
188
|
-
const t = rt(), { optionsData: i } = Jt(t), s = e, r = o, l =
|
|
216
|
+
const t = rt(), { optionsData: i } = Jt(t), s = e, r = o, l = ve({
|
|
189
217
|
get: () => r.showDialog,
|
|
190
218
|
set: (p) => {
|
|
191
219
|
p || s("close-dialog");
|
|
192
220
|
}
|
|
193
221
|
}), n = F(r.reactiveSourceValue ?? ""), u = F(r.manualEntryValue ?? ""), a = F(!!r.hideHeaderValue);
|
|
194
|
-
|
|
222
|
+
fe(() => r.reactiveSourceValue, (p) => {
|
|
195
223
|
n.value = p ?? "";
|
|
196
|
-
}),
|
|
224
|
+
}), fe(() => r.manualEntryValue, (p) => {
|
|
197
225
|
u.value = p ?? "";
|
|
198
|
-
}, { immediate: !0 }),
|
|
226
|
+
}, { immediate: !0 }), fe(() => r.hideHeaderValue, (p) => {
|
|
199
227
|
a.value = !!p;
|
|
200
228
|
});
|
|
201
229
|
function h() {
|
|
202
|
-
var
|
|
203
|
-
const p = (n.value || "").trim(),
|
|
230
|
+
var y;
|
|
231
|
+
const p = (n.value || "").trim(), d = p !== "", m = d ? null : ((y = u.value) == null ? void 0 : y.trim()) || "";
|
|
204
232
|
s("update-text-var", {
|
|
205
|
-
reactiveSource:
|
|
233
|
+
reactiveSource: d ? p : null,
|
|
206
234
|
manualEdit: m,
|
|
207
235
|
hideHeader: a.value
|
|
208
236
|
}), l.value = !1;
|
|
209
237
|
}
|
|
210
|
-
return (p,
|
|
211
|
-
const m =
|
|
212
|
-
return
|
|
238
|
+
return (p, d) => {
|
|
239
|
+
const m = re("el-option"), y = re("el-select"), S = re("el-input"), I = re("el-checkbox"), x = re("el-button"), C = re("el-dialog");
|
|
240
|
+
return T(), te(C, {
|
|
213
241
|
class: "full-dialog-dashboard",
|
|
214
242
|
modelValue: l.value,
|
|
215
|
-
"onUpdate:modelValue":
|
|
243
|
+
"onUpdate:modelValue": d[4] || (d[4] = (A) => l.value = A),
|
|
216
244
|
title: "Text Widget Settings",
|
|
217
245
|
"append-to-body": !0
|
|
218
246
|
}, {
|
|
219
|
-
footer:
|
|
220
|
-
N("div",
|
|
221
|
-
|
|
247
|
+
footer: G(() => [
|
|
248
|
+
N("div", fr, [
|
|
249
|
+
q(x, {
|
|
222
250
|
class: "secondary",
|
|
223
|
-
onClick:
|
|
251
|
+
onClick: d[3] || (d[3] = (A) => l.value = !1)
|
|
224
252
|
}, {
|
|
225
|
-
default:
|
|
226
|
-
|
|
253
|
+
default: G(() => [...d[8] || (d[8] = [
|
|
254
|
+
Se("Cancel", -1)
|
|
227
255
|
])]),
|
|
228
256
|
_: 1
|
|
229
257
|
}),
|
|
230
|
-
|
|
231
|
-
default:
|
|
232
|
-
|
|
258
|
+
q(x, { onClick: h }, {
|
|
259
|
+
default: G(() => [...d[9] || (d[9] = [
|
|
260
|
+
Se("Save", -1)
|
|
233
261
|
])]),
|
|
234
262
|
_: 1
|
|
235
263
|
})
|
|
236
264
|
])
|
|
237
265
|
]),
|
|
238
|
-
default:
|
|
239
|
-
N("div",
|
|
240
|
-
N("div",
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
266
|
+
default: G(() => [
|
|
267
|
+
N("div", dr, [
|
|
268
|
+
N("div", pr, [
|
|
269
|
+
d[5] || (d[5] = N("h4", null, "Select This Widget's Value", -1)),
|
|
270
|
+
d[6] || (d[6] = N("h5", null, "Select From Variables", -1)),
|
|
271
|
+
q(y, {
|
|
244
272
|
modelValue: n.value,
|
|
245
|
-
"onUpdate:modelValue":
|
|
273
|
+
"onUpdate:modelValue": d[0] || (d[0] = (A) => n.value = A),
|
|
246
274
|
class: "text-settings-height"
|
|
247
275
|
}, {
|
|
248
|
-
default:
|
|
249
|
-
(
|
|
276
|
+
default: G(() => [
|
|
277
|
+
(T(), te(m, {
|
|
250
278
|
value: "",
|
|
251
279
|
key: "__manual__",
|
|
252
280
|
label: "Manual entry"
|
|
253
281
|
})),
|
|
254
|
-
(
|
|
282
|
+
(T(!0), B(Le, null, tt(ie(i), (A) => (T(), te(m, {
|
|
255
283
|
key: A.name,
|
|
256
284
|
label: A.name,
|
|
257
285
|
value: A.name
|
|
@@ -259,15 +287,15 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
259
287
|
]),
|
|
260
288
|
_: 1
|
|
261
289
|
}, 8, ["modelValue"]),
|
|
262
|
-
|
|
263
|
-
|
|
290
|
+
d[7] || (d[7] = N("h5", null, "Manual Entry", -1)),
|
|
291
|
+
q(S, {
|
|
264
292
|
modelValue: u.value,
|
|
265
|
-
"onUpdate:modelValue":
|
|
293
|
+
"onUpdate:modelValue": d[1] || (d[1] = (A) => u.value = A),
|
|
266
294
|
class: "text-settings-height"
|
|
267
295
|
}, null, 8, ["modelValue"]),
|
|
268
|
-
|
|
296
|
+
q(I, {
|
|
269
297
|
modelValue: a.value,
|
|
270
|
-
"onUpdate:modelValue":
|
|
298
|
+
"onUpdate:modelValue": d[2] || (d[2] = (A) => a.value = A),
|
|
271
299
|
label: "Hide Header"
|
|
272
300
|
}, null, 8, ["modelValue"])
|
|
273
301
|
])
|
|
@@ -282,7 +310,7 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
282
310
|
for (const [i, s] of e)
|
|
283
311
|
t[i] = s;
|
|
284
312
|
return t;
|
|
285
|
-
},
|
|
313
|
+
}, mr = /* @__PURE__ */ Ne(gr, [["__scopeId", "data-v-769ea864"]]), _r = { key: 0 }, yr = /* @__PURE__ */ ce({
|
|
286
314
|
inheritAttrs: !1,
|
|
287
315
|
__name: "TextWidget",
|
|
288
316
|
props: {
|
|
@@ -293,70 +321,70 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
293
321
|
},
|
|
294
322
|
setup(o) {
|
|
295
323
|
const e = rt(), t = o;
|
|
296
|
-
|
|
324
|
+
Gs("dashboard:globalVars", null);
|
|
297
325
|
const i = F(t.displayText ?? "");
|
|
298
|
-
|
|
299
|
-
i.value =
|
|
326
|
+
fe(() => t.displayText, (x) => {
|
|
327
|
+
i.value = x ?? "";
|
|
300
328
|
}, { immediate: !0 });
|
|
301
|
-
const s =
|
|
302
|
-
var
|
|
303
|
-
const
|
|
304
|
-
if (!
|
|
305
|
-
const
|
|
329
|
+
const s = ve(() => !!(t.bindedKey && t.bindedKey.trim() !== "")), r = ve(() => {
|
|
330
|
+
var E;
|
|
331
|
+
const x = (E = t.bindedKey) == null ? void 0 : E.trim();
|
|
332
|
+
if (!x) return "—";
|
|
333
|
+
const C = e.optionsData.find((H) => (H == null ? void 0 : H.name) === x), A = C == null ? void 0 : C.value;
|
|
306
334
|
return Array.isArray(A) ? A.join(", ") : A && typeof A == "object" ? JSON.stringify(A) : A ?? "—";
|
|
307
|
-
}), l = F("Text Widget"), n =
|
|
335
|
+
}), l = F("Text Widget"), n = ls([{ comp: ds, event: m, tooltip: "open Text settings" }]), u = F(!1), a = F(null);
|
|
308
336
|
function h() {
|
|
309
|
-
var
|
|
310
|
-
u.value = !0, (
|
|
337
|
+
var x, C;
|
|
338
|
+
u.value = !0, (C = (x = a.value) == null ? void 0 : x.focus) == null || C.call(x);
|
|
311
339
|
}
|
|
312
340
|
function p() {
|
|
313
341
|
u.value = !1;
|
|
314
342
|
}
|
|
315
|
-
const
|
|
343
|
+
const d = F(!1);
|
|
316
344
|
function m() {
|
|
317
|
-
|
|
345
|
+
d.value = !0;
|
|
318
346
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
347
|
+
function y() {
|
|
348
|
+
d.value = !1;
|
|
321
349
|
}
|
|
322
|
-
function
|
|
323
|
-
const
|
|
324
|
-
|
|
350
|
+
function S({ manualEdit: x, reactiveSource: C, hideHeader: A }) {
|
|
351
|
+
const E = e.getDashItem(t.widgetID);
|
|
352
|
+
E && (E.hideHeader = A, C && C.trim() !== "" ? (E.Props = E.Props || {}, E.Props.bindedKey = C, E.Props.displayText = null, E.componentName = I(C)) : (E.Props = E.Props || {}, E.Props.bindedKey = null, E.Props.displayText = x ?? "", E.componentName = x ?? "Text"));
|
|
325
353
|
}
|
|
326
|
-
function
|
|
327
|
-
return
|
|
354
|
+
function I(x) {
|
|
355
|
+
return x ? x.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (C) => C.toUpperCase()) : "";
|
|
328
356
|
}
|
|
329
|
-
return (
|
|
330
|
-
const A =
|
|
331
|
-
return
|
|
332
|
-
|
|
357
|
+
return (x, C) => {
|
|
358
|
+
const A = re("el-input"), E = as("click-out");
|
|
359
|
+
return T(), B(Le, null, [
|
|
360
|
+
bt(x.$slots, "default", {
|
|
333
361
|
widgetName: l.value,
|
|
334
362
|
childIcons: n.value
|
|
335
363
|
}, void 0, !0),
|
|
336
|
-
N("div",
|
|
337
|
-
s.value ? (
|
|
364
|
+
N("div", oi({ class: "text-widget-wrap" }, x.$attrs), [
|
|
365
|
+
s.value ? (T(), B("div", _r, [
|
|
338
366
|
N("h2", null, Re(r.value), 1)
|
|
339
|
-
])) : De((
|
|
367
|
+
])) : De((T(), B("div", {
|
|
340
368
|
key: 1,
|
|
341
|
-
onKeyup:
|
|
369
|
+
onKeyup: hs(p, ["enter"]),
|
|
342
370
|
class: "tw-flex"
|
|
343
371
|
}, [
|
|
344
372
|
De(N("div", null, [
|
|
345
|
-
|
|
373
|
+
q(A, {
|
|
346
374
|
ref_key: "textUserInput",
|
|
347
375
|
ref: a,
|
|
348
376
|
modelValue: i.value,
|
|
349
|
-
"onUpdate:modelValue":
|
|
350
|
-
onFocus:
|
|
351
|
-
var
|
|
352
|
-
return (_ = (
|
|
377
|
+
"onUpdate:modelValue": C[0] || (C[0] = (H) => i.value = H),
|
|
378
|
+
onFocus: C[1] || (C[1] = (H) => {
|
|
379
|
+
var v, _;
|
|
380
|
+
return (_ = (v = H.target) == null ? void 0 : v.select) == null ? void 0 : _.call(v);
|
|
353
381
|
})
|
|
354
382
|
}, null, 8, ["modelValue"])
|
|
355
383
|
], 512), [
|
|
356
384
|
[xt, u.value]
|
|
357
385
|
]),
|
|
358
386
|
De(N("div", {
|
|
359
|
-
onClick:
|
|
387
|
+
onClick: C[2] || (C[2] = (H) => h()),
|
|
360
388
|
class: "tw-w-full tw-h-full"
|
|
361
389
|
}, [
|
|
362
390
|
N("h2", null, Re(i.value), 1)
|
|
@@ -364,62 +392,62 @@ const rt = Ks("globalPensieveDashVars", () => {
|
|
|
364
392
|
[xt, !u.value]
|
|
365
393
|
])
|
|
366
394
|
], 32)), [
|
|
367
|
-
[
|
|
395
|
+
[E, p]
|
|
368
396
|
])
|
|
369
397
|
], 16),
|
|
370
|
-
|
|
371
|
-
"show-dialog":
|
|
398
|
+
q(mr, {
|
|
399
|
+
"show-dialog": d.value,
|
|
372
400
|
"reactive-source-value": t.bindedKey || "",
|
|
373
401
|
"manual-entry-value": i.value,
|
|
374
402
|
"hide-header-value": t.hideHeader || !1,
|
|
375
|
-
onCloseDialog:
|
|
376
|
-
onUpdateTextVar:
|
|
403
|
+
onCloseDialog: y,
|
|
404
|
+
onUpdateTextVar: S
|
|
377
405
|
}, null, 8, ["show-dialog", "reactive-source-value", "manual-entry-value", "hide-header-value"])
|
|
378
406
|
], 64);
|
|
379
407
|
};
|
|
380
408
|
}
|
|
381
|
-
}),
|
|
382
|
-
function
|
|
409
|
+
}), ho = /* @__PURE__ */ Ne(yr, [["__scopeId", "data-v-bbd00006"]]);
|
|
410
|
+
function li() {
|
|
383
411
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
384
412
|
}
|
|
385
|
-
var Me =
|
|
386
|
-
function
|
|
413
|
+
var Me = li();
|
|
414
|
+
function ps(o) {
|
|
387
415
|
Me = o;
|
|
388
416
|
}
|
|
389
417
|
var et = { exec: () => null };
|
|
390
|
-
function
|
|
418
|
+
function P(o, e = "") {
|
|
391
419
|
let t = typeof o == "string" ? o : o.source, i = { replace: (s, r) => {
|
|
392
420
|
let l = typeof r == "string" ? r : r.source;
|
|
393
|
-
return l = l.replace(
|
|
421
|
+
return l = l.replace(ne.caret, "$1"), t = t.replace(s, l), i;
|
|
394
422
|
}, getRegex: () => new RegExp(t, e) };
|
|
395
423
|
return i;
|
|
396
424
|
}
|
|
397
|
-
var
|
|
398
|
-
]`).replace("lheading",
|
|
399
|
-
function
|
|
425
|
+
var ne = { 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: (o) => new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}#`), htmlBeginRegex: (o) => new RegExp(`^ {0,${Math.min(3, o - 1)}}<(?:[a-z].*>|!--)`, "i") }, vr = /^(?:[ \t]*(?:\n|$))+/, wr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, br = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, xr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ai = /(?:[*+-]|\d{1,9}[.)])/, fs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, gs = P(fs).replace(/bull/g, ai).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(), kr = P(fs).replace(/bull/g, ai).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(), hi = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Er = /^[^\n]+/, ui = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Tr = P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ui).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Rr = P(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ai).getRegex(), zt = "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", ci = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Sr = P("^ {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", ci).replace("tag", zt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ms = P(hi).replace("hr", nt).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", zt).getRegex(), Cr = P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ms).getRegex(), di = { blockquote: Cr, code: wr, def: Tr, fences: br, heading: xr, hr: nt, html: Sr, lheading: gs, list: Rr, newline: vr, paragraph: ms, table: et, text: Er }, Vi = P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", nt).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", zt).getRegex(), Ar = { ...di, lheading: kr, table: Vi, paragraph: P(hi).replace("hr", nt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Vi).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", zt).getRegex() }, Dr = { ...di, html: P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ci).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: P(hi).replace("hr", nt).replace("heading", ` *#{1,6} *[^
|
|
426
|
+
]`).replace("lheading", gs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Lr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, zr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _s = /^( {2,}|\\)\n(?!\s*$)/, Nr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Nt = /[\p{P}\p{S}]/u, pi = /[\s\p{P}\p{S}]/u, ys = /[^\s\p{P}\p{S}]/u, Mr = P(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, pi).getRegex(), vs = /(?!~)[\p{P}\p{S}]/u, Ir = /(?!~)[\s\p{P}\p{S}]/u, Hr = /(?:[^\s\p{P}\p{S}]|~)/u, Or = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, ws = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Pr = P(ws, "u").replace(/punct/g, Nt).getRegex(), $r = P(ws, "u").replace(/punct/g, vs).getRegex(), bs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Br = P(bs, "gu").replace(/notPunctSpace/g, ys).replace(/punctSpace/g, pi).replace(/punct/g, Nt).getRegex(), Ur = P(bs, "gu").replace(/notPunctSpace/g, Hr).replace(/punctSpace/g, Ir).replace(/punct/g, vs).getRegex(), Fr = P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ys).replace(/punctSpace/g, pi).replace(/punct/g, Nt).getRegex(), Wr = P(/\\(punct)/, "gu").replace(/punct/g, Nt).getRegex(), Gr = P(/^<(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(), Vr = P(ci).replace("(?:-->|$)", "-->").getRegex(), qr = P("^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", Vr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Et = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, jr = P(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Et).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), xs = P(/^!?\[(label)\]\[(ref)\]/).replace("label", Et).replace("ref", ui).getRegex(), ks = P(/^!?\[(ref)\](?:\[\])?/).replace("ref", ui).getRegex(), Yr = P("reflink|nolink(?!\\()", "g").replace("reflink", xs).replace("nolink", ks).getRegex(), fi = { _backpedal: et, anyPunctuation: Wr, autolink: Gr, blockSkip: Or, br: _s, code: zr, del: et, emStrongLDelim: Pr, emStrongRDelimAst: Br, emStrongRDelimUnd: Fr, escape: Lr, link: jr, nolink: ks, punctuation: Mr, reflink: xs, reflinkSearch: Yr, tag: qr, text: Nr, url: et }, Xr = { ...fi, link: P(/^!?\[(label)\]\((.*?)\)/).replace("label", Et).getRegex(), reflink: P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Et).getRegex() }, ti = { ...fi, emStrongRDelimAst: Ur, emStrongLDelim: $r, url: P(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/ }, Zr = { ...ti, br: P(_s).replace("{2,}", "*").getRegex(), text: P(ti.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, mt = { normal: di, gfm: Ar, pedantic: Dr }, je = { normal: fi, gfm: ti, breaks: Zr, pedantic: Xr }, Kr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, qi = (o) => Kr[o];
|
|
427
|
+
function me(o, e) {
|
|
400
428
|
if (e) {
|
|
401
|
-
if (
|
|
402
|
-
} else if (
|
|
429
|
+
if (ne.escapeTest.test(o)) return o.replace(ne.escapeReplace, qi);
|
|
430
|
+
} else if (ne.escapeTestNoEncode.test(o)) return o.replace(ne.escapeReplaceNoEncode, qi);
|
|
403
431
|
return o;
|
|
404
432
|
}
|
|
405
|
-
function
|
|
433
|
+
function ji(o) {
|
|
406
434
|
try {
|
|
407
|
-
o = encodeURI(o).replace(
|
|
435
|
+
o = encodeURI(o).replace(ne.percentDecode, "%");
|
|
408
436
|
} catch {
|
|
409
437
|
return null;
|
|
410
438
|
}
|
|
411
439
|
return o;
|
|
412
440
|
}
|
|
413
|
-
function
|
|
441
|
+
function Yi(o, e) {
|
|
414
442
|
var r;
|
|
415
|
-
let t = o.replace(
|
|
443
|
+
let t = o.replace(ne.findPipe, (l, n, u) => {
|
|
416
444
|
let a = !1, h = n;
|
|
417
445
|
for (; --h >= 0 && u[h] === "\\"; ) a = !a;
|
|
418
446
|
return a ? "|" : " |";
|
|
419
|
-
}), i = t.split(
|
|
447
|
+
}), i = t.split(ne.splitPipe), s = 0;
|
|
420
448
|
if (i[0].trim() || i.shift(), i.length > 0 && !((r = i.at(-1)) != null && r.trim()) && i.pop(), e) if (i.length > e) i.splice(e);
|
|
421
449
|
else for (; i.length < e; ) i.push("");
|
|
422
|
-
for (; s < i.length; s++) i[s] = i[s].trim().replace(
|
|
450
|
+
for (; s < i.length; s++) i[s] = i[s].trim().replace(ne.slashPipe, "|");
|
|
423
451
|
return i;
|
|
424
452
|
}
|
|
425
453
|
function Ye(o, e, t) {
|
|
@@ -430,7 +458,7 @@ function Ye(o, e, t) {
|
|
|
430
458
|
s++;
|
|
431
459
|
return o.slice(0, i - s);
|
|
432
460
|
}
|
|
433
|
-
function
|
|
461
|
+
function Qr(o, e) {
|
|
434
462
|
if (o.indexOf(e[1]) === -1) return -1;
|
|
435
463
|
let t = 0;
|
|
436
464
|
for (let i = 0; i < o.length; i++) if (o[i] === "\\") i++;
|
|
@@ -438,13 +466,13 @@ function Yr(o, e) {
|
|
|
438
466
|
else if (o[i] === e[1] && (t--, t < 0)) return i;
|
|
439
467
|
return t > 0 ? -2 : -1;
|
|
440
468
|
}
|
|
441
|
-
function
|
|
469
|
+
function Xi(o, e, t, i, s) {
|
|
442
470
|
let r = e.href, l = e.title || null, n = o[1].replace(s.other.outputLinkReplace, "$1");
|
|
443
471
|
i.state.inLink = !0;
|
|
444
472
|
let u = { type: o[0].charAt(0) === "!" ? "image" : "link", raw: t, href: r, title: l, text: n, tokens: i.inlineTokens(n) };
|
|
445
473
|
return i.state.inLink = !1, u;
|
|
446
474
|
}
|
|
447
|
-
function
|
|
475
|
+
function Jr(o, e, t) {
|
|
448
476
|
let i = o.match(t.other.indentCodeCompensation);
|
|
449
477
|
if (i === null) return e;
|
|
450
478
|
let s = i[1];
|
|
@@ -459,9 +487,9 @@ function Xr(o, e, t) {
|
|
|
459
487
|
}
|
|
460
488
|
var Tt = class {
|
|
461
489
|
constructor(o) {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
490
|
+
U(this, "options");
|
|
491
|
+
U(this, "rules");
|
|
492
|
+
U(this, "lexer");
|
|
465
493
|
this.options = o || Me;
|
|
466
494
|
}
|
|
467
495
|
space(o) {
|
|
@@ -479,7 +507,7 @@ var Tt = class {
|
|
|
479
507
|
fences(o) {
|
|
480
508
|
let e = this.rules.block.fences.exec(o);
|
|
481
509
|
if (e) {
|
|
482
|
-
let t = e[0], i =
|
|
510
|
+
let t = e[0], i = Jr(t, e[3] || "", this.rules);
|
|
483
511
|
return { type: "code", raw: t, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
|
|
484
512
|
}
|
|
485
513
|
}
|
|
@@ -519,19 +547,19 @@ ${a}` : a, s = s ? `${s}
|
|
|
519
547
|
${h}` : h;
|
|
520
548
|
let p = this.lexer.state.top;
|
|
521
549
|
if (this.lexer.state.top = !0, this.lexer.blockTokens(h, r, !0), this.lexer.state.top = p, t.length === 0) break;
|
|
522
|
-
let
|
|
523
|
-
if ((
|
|
524
|
-
if ((
|
|
525
|
-
let m =
|
|
550
|
+
let d = r.at(-1);
|
|
551
|
+
if ((d == null ? void 0 : d.type) === "code") break;
|
|
552
|
+
if ((d == null ? void 0 : d.type) === "blockquote") {
|
|
553
|
+
let m = d, y = m.raw + `
|
|
526
554
|
` + t.join(`
|
|
527
|
-
`),
|
|
528
|
-
r[r.length - 1] =
|
|
555
|
+
`), S = this.blockquote(y);
|
|
556
|
+
r[r.length - 1] = S, i = i.substring(0, i.length - m.raw.length) + S.raw, s = s.substring(0, s.length - m.text.length) + S.text;
|
|
529
557
|
break;
|
|
530
|
-
} else if ((
|
|
531
|
-
let m =
|
|
558
|
+
} else if ((d == null ? void 0 : d.type) === "list") {
|
|
559
|
+
let m = d, y = m.raw + `
|
|
532
560
|
` + t.join(`
|
|
533
|
-
`),
|
|
534
|
-
r[r.length - 1] =
|
|
561
|
+
`), S = this.list(y);
|
|
562
|
+
r[r.length - 1] = S, i = i.substring(0, i.length - d.raw.length) + S.raw, s = s.substring(0, s.length - m.raw.length) + S.raw, t = y.substring(r.at(-1).raw.length).split(`
|
|
535
563
|
`);
|
|
536
564
|
continue;
|
|
537
565
|
}
|
|
@@ -550,29 +578,29 @@ ${h}` : h;
|
|
|
550
578
|
if (!(e = r.exec(o)) || this.rules.block.hr.test(o)) break;
|
|
551
579
|
a = e[0], o = o.substring(a.length);
|
|
552
580
|
let p = e[2].split(`
|
|
553
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
554
|
-
`, 1)[0], m = !p.trim(),
|
|
555
|
-
if (this.options.pedantic ? (
|
|
556
|
-
`, o = o.substring(
|
|
557
|
-
let
|
|
581
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (x) => " ".repeat(3 * x.length)), d = o.split(`
|
|
582
|
+
`, 1)[0], m = !p.trim(), y = 0;
|
|
583
|
+
if (this.options.pedantic ? (y = 2, h = p.trimStart()) : m ? y = e[1].length + 1 : (y = e[2].search(this.rules.other.nonSpaceChar), y = y > 4 ? 1 : y, h = p.slice(y), y += e[1].length), m && this.rules.other.blankLine.test(d) && (a += d + `
|
|
584
|
+
`, o = o.substring(d.length + 1), u = !0), !u) {
|
|
585
|
+
let x = this.rules.other.nextBulletRegex(y), C = this.rules.other.hrRegex(y), A = this.rules.other.fencesBeginRegex(y), E = this.rules.other.headingBeginRegex(y), H = this.rules.other.htmlBeginRegex(y);
|
|
558
586
|
for (; o; ) {
|
|
559
|
-
let
|
|
587
|
+
let v = o.split(`
|
|
560
588
|
`, 1)[0], _;
|
|
561
|
-
if (
|
|
562
|
-
if (_.search(this.rules.other.nonSpaceChar) >=
|
|
563
|
-
` + _.slice(
|
|
589
|
+
if (d = v, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), _ = d) : _ = d.replace(this.rules.other.tabCharGlobal, " "), A.test(d) || E.test(d) || H.test(d) || x.test(d) || C.test(d)) break;
|
|
590
|
+
if (_.search(this.rules.other.nonSpaceChar) >= y || !d.trim()) h += `
|
|
591
|
+
` + _.slice(y);
|
|
564
592
|
else {
|
|
565
|
-
if (m || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || A.test(p) ||
|
|
593
|
+
if (m || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || A.test(p) || E.test(p) || C.test(p)) break;
|
|
566
594
|
h += `
|
|
567
|
-
` +
|
|
595
|
+
` + d;
|
|
568
596
|
}
|
|
569
|
-
!m && !
|
|
570
|
-
`, o = o.substring(
|
|
597
|
+
!m && !d.trim() && (m = !0), a += v + `
|
|
598
|
+
`, o = o.substring(v.length + 1), p = _.slice(y);
|
|
571
599
|
}
|
|
572
600
|
}
|
|
573
601
|
s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(a) && (l = !0));
|
|
574
|
-
let
|
|
575
|
-
this.options.gfm && (
|
|
602
|
+
let S = null, I;
|
|
603
|
+
this.options.gfm && (S = this.rules.other.listIsTask.exec(h), S && (I = S[0] !== "[ ] ", h = h.replace(this.rules.other.listReplaceTask, ""))), s.items.push({ type: "list_item", raw: a, task: !!S, checked: I, loose: !1, text: h, tokens: [] }), s.raw += a;
|
|
576
604
|
}
|
|
577
605
|
let n = s.items.at(-1);
|
|
578
606
|
if (n) n.raw = n.raw.trimEnd(), n.text = n.text.trimEnd();
|
|
@@ -601,12 +629,12 @@ ${h}` : h;
|
|
|
601
629
|
var l;
|
|
602
630
|
let e = this.rules.block.table.exec(o);
|
|
603
631
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
604
|
-
let t =
|
|
632
|
+
let t = Yi(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (l = e[3]) != null && l.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
605
633
|
`) : [], r = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
606
634
|
if (t.length === i.length) {
|
|
607
635
|
for (let n of i) this.rules.other.tableAlignRight.test(n) ? r.align.push("right") : this.rules.other.tableAlignCenter.test(n) ? r.align.push("center") : this.rules.other.tableAlignLeft.test(n) ? r.align.push("left") : r.align.push(null);
|
|
608
636
|
for (let n = 0; n < t.length; n++) r.header.push({ text: t[n], tokens: this.lexer.inline(t[n]), header: !0, align: r.align[n] });
|
|
609
|
-
for (let n of s) r.rows.push(
|
|
637
|
+
for (let n of s) r.rows.push(Yi(n, r.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: !1, align: r.align[a] })));
|
|
610
638
|
return r;
|
|
611
639
|
}
|
|
612
640
|
}
|
|
@@ -643,7 +671,7 @@ ${h}` : h;
|
|
|
643
671
|
let r = Ye(t.slice(0, -1), "\\");
|
|
644
672
|
if ((t.length - r.length) % 2 === 0) return;
|
|
645
673
|
} else {
|
|
646
|
-
let r =
|
|
674
|
+
let r = Qr(e[2], "()");
|
|
647
675
|
if (r === -2) return;
|
|
648
676
|
if (r > -1) {
|
|
649
677
|
let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + r;
|
|
@@ -655,7 +683,7 @@ ${h}` : h;
|
|
|
655
683
|
let r = this.rules.other.pedanticHrefTitle.exec(i);
|
|
656
684
|
r && (i = r[1], s = r[3]);
|
|
657
685
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
658
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? i = i.slice(1) : i = i.slice(1, -1)),
|
|
686
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? i = i.slice(1) : i = i.slice(1, -1)), Xi(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
659
687
|
}
|
|
660
688
|
}
|
|
661
689
|
reflink(o, e) {
|
|
@@ -666,7 +694,7 @@ ${h}` : h;
|
|
|
666
694
|
let r = t[0].charAt(0);
|
|
667
695
|
return { type: "text", raw: r, text: r };
|
|
668
696
|
}
|
|
669
|
-
return
|
|
697
|
+
return Xi(t, s, t[0], this.lexer, this.rules);
|
|
670
698
|
}
|
|
671
699
|
}
|
|
672
700
|
emStrong(o, e, t = "") {
|
|
@@ -689,8 +717,8 @@ ${h}` : h;
|
|
|
689
717
|
let m = p.slice(1, -1);
|
|
690
718
|
return { type: "em", raw: p, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
691
719
|
}
|
|
692
|
-
let
|
|
693
|
-
return { type: "strong", raw: p, text:
|
|
720
|
+
let d = p.slice(2, -2);
|
|
721
|
+
return { type: "strong", raw: p, text: d, tokens: this.lexer.inlineTokens(d) };
|
|
694
722
|
}
|
|
695
723
|
}
|
|
696
724
|
}
|
|
@@ -739,28 +767,28 @@ ${h}` : h;
|
|
|
739
767
|
return { type: "text", raw: e[0], text: e[0], escaped: t };
|
|
740
768
|
}
|
|
741
769
|
}
|
|
742
|
-
}, Ee = class
|
|
770
|
+
}, Ee = class ii {
|
|
743
771
|
constructor(e) {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
772
|
+
U(this, "tokens");
|
|
773
|
+
U(this, "options");
|
|
774
|
+
U(this, "state");
|
|
775
|
+
U(this, "tokenizer");
|
|
776
|
+
U(this, "inlineQueue");
|
|
749
777
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Me, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
750
|
-
let t = { other:
|
|
778
|
+
let t = { other: ne, block: mt.normal, inline: je.normal };
|
|
751
779
|
this.options.pedantic ? (t.block = mt.pedantic, t.inline = je.pedantic) : this.options.gfm && (t.block = mt.gfm, this.options.breaks ? t.inline = je.breaks : t.inline = je.gfm), this.tokenizer.rules = t;
|
|
752
780
|
}
|
|
753
781
|
static get rules() {
|
|
754
782
|
return { block: mt, inline: je };
|
|
755
783
|
}
|
|
756
784
|
static lex(e, t) {
|
|
757
|
-
return new
|
|
785
|
+
return new ii(t).lex(e);
|
|
758
786
|
}
|
|
759
787
|
static lexInline(e, t) {
|
|
760
|
-
return new
|
|
788
|
+
return new ii(t).inlineTokens(e);
|
|
761
789
|
}
|
|
762
790
|
lex(e) {
|
|
763
|
-
e = e.replace(
|
|
791
|
+
e = e.replace(ne.carriageReturn, `
|
|
764
792
|
`), this.blockTokens(e, this.tokens);
|
|
765
793
|
for (let t = 0; t < this.inlineQueue.length; t++) {
|
|
766
794
|
let i = this.inlineQueue[t];
|
|
@@ -770,7 +798,7 @@ ${h}` : h;
|
|
|
770
798
|
}
|
|
771
799
|
blockTokens(e, t = [], i = !1) {
|
|
772
800
|
var s, r, l;
|
|
773
|
-
for (this.options.pedantic && (e = e.replace(
|
|
801
|
+
for (this.options.pedantic && (e = e.replace(ne.tabCharGlobal, " ").replace(ne.spaceLine, "")); e; ) {
|
|
774
802
|
let n;
|
|
775
803
|
if ((r = (s = this.options.extensions) == null ? void 0 : s.block) != null && r.some((a) => (n = a.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1)) continue;
|
|
776
804
|
if (n = this.tokenizer.space(e)) {
|
|
@@ -833,8 +861,8 @@ ${h}` : h;
|
|
|
833
861
|
let u = e;
|
|
834
862
|
if ((l = this.options.extensions) != null && l.startBlock) {
|
|
835
863
|
let a = 1 / 0, h = e.slice(1), p;
|
|
836
|
-
this.options.extensions.startBlock.forEach((
|
|
837
|
-
p =
|
|
864
|
+
this.options.extensions.startBlock.forEach((d) => {
|
|
865
|
+
p = d.call({ lexer: this }, h), typeof p == "number" && p >= 0 && (a = Math.min(a, p));
|
|
838
866
|
}), a < 1 / 0 && a >= 0 && (u = e.substring(0, a + 1));
|
|
839
867
|
}
|
|
840
868
|
if (this.state.top && (n = this.tokenizer.paragraph(u))) {
|
|
@@ -880,7 +908,7 @@ ${h}` : h;
|
|
|
880
908
|
for (; e; ) {
|
|
881
909
|
r || (l = ""), r = !1;
|
|
882
910
|
let h;
|
|
883
|
-
if ((u = (n = this.options.extensions) == null ? void 0 : n.inline) != null && u.some((
|
|
911
|
+
if ((u = (n = this.options.extensions) == null ? void 0 : n.inline) != null && u.some((d) => (h = d.call({ lexer: this }, e, t)) ? (e = e.substring(h.raw.length), t.push(h), !0) : !1)) continue;
|
|
884
912
|
if (h = this.tokenizer.escape(e)) {
|
|
885
913
|
e = e.substring(h.raw.length), t.push(h);
|
|
886
914
|
continue;
|
|
@@ -895,8 +923,8 @@ ${h}` : h;
|
|
|
895
923
|
}
|
|
896
924
|
if (h = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
897
925
|
e = e.substring(h.raw.length);
|
|
898
|
-
let
|
|
899
|
-
h.type === "text" && (
|
|
926
|
+
let d = t.at(-1);
|
|
927
|
+
h.type === "text" && (d == null ? void 0 : d.type) === "text" ? (d.raw += h.raw, d.text += h.text) : t.push(h);
|
|
900
928
|
continue;
|
|
901
929
|
}
|
|
902
930
|
if (h = this.tokenizer.emStrong(e, i, l)) {
|
|
@@ -925,31 +953,31 @@ ${h}` : h;
|
|
|
925
953
|
}
|
|
926
954
|
let p = e;
|
|
927
955
|
if ((a = this.options.extensions) != null && a.startInline) {
|
|
928
|
-
let
|
|
929
|
-
this.options.extensions.startInline.forEach((
|
|
930
|
-
|
|
931
|
-
}),
|
|
956
|
+
let d = 1 / 0, m = e.slice(1), y;
|
|
957
|
+
this.options.extensions.startInline.forEach((S) => {
|
|
958
|
+
y = S.call({ lexer: this }, m), typeof y == "number" && y >= 0 && (d = Math.min(d, y));
|
|
959
|
+
}), d < 1 / 0 && d >= 0 && (p = e.substring(0, d + 1));
|
|
932
960
|
}
|
|
933
961
|
if (h = this.tokenizer.inlineText(p)) {
|
|
934
962
|
e = e.substring(h.raw.length), h.raw.slice(-1) !== "_" && (l = h.raw.slice(-1)), r = !0;
|
|
935
|
-
let
|
|
936
|
-
(
|
|
963
|
+
let d = t.at(-1);
|
|
964
|
+
(d == null ? void 0 : d.type) === "text" ? (d.raw += h.raw, d.text += h.text) : t.push(h);
|
|
937
965
|
continue;
|
|
938
966
|
}
|
|
939
967
|
if (e) {
|
|
940
|
-
let
|
|
968
|
+
let d = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
941
969
|
if (this.options.silent) {
|
|
942
|
-
console.error(
|
|
970
|
+
console.error(d);
|
|
943
971
|
break;
|
|
944
|
-
} else throw new Error(
|
|
972
|
+
} else throw new Error(d);
|
|
945
973
|
}
|
|
946
974
|
}
|
|
947
975
|
return t;
|
|
948
976
|
}
|
|
949
977
|
}, Rt = class {
|
|
950
978
|
constructor(o) {
|
|
951
|
-
|
|
952
|
-
|
|
979
|
+
U(this, "options");
|
|
980
|
+
U(this, "parser");
|
|
953
981
|
this.options = o || Me;
|
|
954
982
|
}
|
|
955
983
|
space(o) {
|
|
@@ -957,10 +985,10 @@ ${h}` : h;
|
|
|
957
985
|
}
|
|
958
986
|
code({ text: o, lang: e, escaped: t }) {
|
|
959
987
|
var r;
|
|
960
|
-
let i = (r = (e || "").match(
|
|
988
|
+
let i = (r = (e || "").match(ne.notSpaceStart)) == null ? void 0 : r[0], s = o.replace(ne.endingNewline, "") + `
|
|
961
989
|
`;
|
|
962
|
-
return i ? '<pre><code class="language-' +
|
|
963
|
-
` : "<pre><code>" + (t ? s :
|
|
990
|
+
return i ? '<pre><code class="language-' + me(i) + '">' + (t ? s : me(s, !0)) + `</code></pre>
|
|
991
|
+
` : "<pre><code>" + (t ? s : me(s, !0)) + `</code></pre>
|
|
964
992
|
`;
|
|
965
993
|
}
|
|
966
994
|
blockquote({ tokens: o }) {
|
|
@@ -998,7 +1026,7 @@ ${this.parser.parse(o)}</blockquote>
|
|
|
998
1026
|
let e = "";
|
|
999
1027
|
if (o.task) {
|
|
1000
1028
|
let i = this.checkbox({ checked: !!o.checked });
|
|
1001
|
-
o.loose ? ((t = o.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (o.tokens[0].text = i + " " + o.tokens[0].text, o.tokens[0].tokens && o.tokens[0].tokens.length > 0 && o.tokens[0].tokens[0].type === "text" && (o.tokens[0].tokens[0].text = i + " " +
|
|
1029
|
+
o.loose ? ((t = o.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (o.tokens[0].text = i + " " + o.tokens[0].text, o.tokens[0].tokens && o.tokens[0].tokens.length > 0 && o.tokens[0].tokens[0].type === "text" && (o.tokens[0].tokens[0].text = i + " " + me(o.tokens[0].tokens[0].text), o.tokens[0].tokens[0].escaped = !0)) : o.tokens.unshift({ type: "text", raw: i + " ", text: i + " ", escaped: !0 }) : e += i + " ";
|
|
1002
1030
|
}
|
|
1003
1031
|
return e += this.parser.parse(o.tokens, !!o.loose), `<li>${e}</li>
|
|
1004
1032
|
`;
|
|
@@ -1044,7 +1072,7 @@ ${o}</tr>
|
|
|
1044
1072
|
return `<em>${this.parser.parseInline(o)}</em>`;
|
|
1045
1073
|
}
|
|
1046
1074
|
codespan({ text: o }) {
|
|
1047
|
-
return `<code>${
|
|
1075
|
+
return `<code>${me(o, !0)}</code>`;
|
|
1048
1076
|
}
|
|
1049
1077
|
br(o) {
|
|
1050
1078
|
return "<br>";
|
|
@@ -1053,24 +1081,24 @@ ${o}</tr>
|
|
|
1053
1081
|
return `<del>${this.parser.parseInline(o)}</del>`;
|
|
1054
1082
|
}
|
|
1055
1083
|
link({ href: o, title: e, tokens: t }) {
|
|
1056
|
-
let i = this.parser.parseInline(t), s =
|
|
1084
|
+
let i = this.parser.parseInline(t), s = ji(o);
|
|
1057
1085
|
if (s === null) return i;
|
|
1058
1086
|
o = s;
|
|
1059
1087
|
let r = '<a href="' + o + '"';
|
|
1060
|
-
return e && (r += ' title="' +
|
|
1088
|
+
return e && (r += ' title="' + me(e) + '"'), r += ">" + i + "</a>", r;
|
|
1061
1089
|
}
|
|
1062
1090
|
image({ href: o, title: e, text: t, tokens: i }) {
|
|
1063
1091
|
i && (t = this.parser.parseInline(i, this.parser.textRenderer));
|
|
1064
|
-
let s =
|
|
1065
|
-
if (s === null) return
|
|
1092
|
+
let s = ji(o);
|
|
1093
|
+
if (s === null) return me(t);
|
|
1066
1094
|
o = s;
|
|
1067
1095
|
let r = `<img src="${o}" alt="${t}"`;
|
|
1068
|
-
return e && (r += ` title="${
|
|
1096
|
+
return e && (r += ` title="${me(e)}"`), r += ">", r;
|
|
1069
1097
|
}
|
|
1070
1098
|
text(o) {
|
|
1071
|
-
return "tokens" in o && o.tokens ? this.parser.parseInline(o.tokens) : "escaped" in o && o.escaped ? o.text :
|
|
1099
|
+
return "tokens" in o && o.tokens ? this.parser.parseInline(o.tokens) : "escaped" in o && o.escaped ? o.text : me(o.text);
|
|
1072
1100
|
}
|
|
1073
|
-
},
|
|
1101
|
+
}, gi = class {
|
|
1074
1102
|
strong({ text: o }) {
|
|
1075
1103
|
return o;
|
|
1076
1104
|
}
|
|
@@ -1098,18 +1126,18 @@ ${o}</tr>
|
|
|
1098
1126
|
br() {
|
|
1099
1127
|
return "";
|
|
1100
1128
|
}
|
|
1101
|
-
}, Te = class
|
|
1129
|
+
}, Te = class si {
|
|
1102
1130
|
constructor(e) {
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
this.options = e || Me, this.options.renderer = this.options.renderer || new Rt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new
|
|
1131
|
+
U(this, "options");
|
|
1132
|
+
U(this, "renderer");
|
|
1133
|
+
U(this, "textRenderer");
|
|
1134
|
+
this.options = e || Me, this.options.renderer = this.options.renderer || new Rt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new gi();
|
|
1107
1135
|
}
|
|
1108
1136
|
static parse(e, t) {
|
|
1109
|
-
return new
|
|
1137
|
+
return new si(t).parse(e);
|
|
1110
1138
|
}
|
|
1111
1139
|
static parseInline(e, t) {
|
|
1112
|
-
return new
|
|
1140
|
+
return new si(t).parseInline(e);
|
|
1113
1141
|
}
|
|
1114
1142
|
parse(e, t = !0) {
|
|
1115
1143
|
var s, r;
|
|
@@ -1244,10 +1272,10 @@ ${o}</tr>
|
|
|
1244
1272
|
}
|
|
1245
1273
|
return i;
|
|
1246
1274
|
}
|
|
1247
|
-
}, Kt,
|
|
1275
|
+
}, Kt, vt = (Kt = class {
|
|
1248
1276
|
constructor(o) {
|
|
1249
|
-
|
|
1250
|
-
|
|
1277
|
+
U(this, "options");
|
|
1278
|
+
U(this, "block");
|
|
1251
1279
|
this.options = o || Me;
|
|
1252
1280
|
}
|
|
1253
1281
|
preprocess(o) {
|
|
@@ -1265,18 +1293,18 @@ ${o}</tr>
|
|
|
1265
1293
|
provideParser() {
|
|
1266
1294
|
return this.block ? Te.parse : Te.parseInline;
|
|
1267
1295
|
}
|
|
1268
|
-
},
|
|
1296
|
+
}, U(Kt, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Kt), en = class {
|
|
1269
1297
|
constructor(...o) {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1298
|
+
U(this, "defaults", li());
|
|
1299
|
+
U(this, "options", this.setOptions);
|
|
1300
|
+
U(this, "parse", this.parseMarkdown(!0));
|
|
1301
|
+
U(this, "parseInline", this.parseMarkdown(!1));
|
|
1302
|
+
U(this, "Parser", Te);
|
|
1303
|
+
U(this, "Renderer", Rt);
|
|
1304
|
+
U(this, "TextRenderer", gi);
|
|
1305
|
+
U(this, "Lexer", Ee);
|
|
1306
|
+
U(this, "Tokenizer", Tt);
|
|
1307
|
+
U(this, "Hooks", vt);
|
|
1280
1308
|
this.use(...o);
|
|
1281
1309
|
}
|
|
1282
1310
|
walkTokens(o, e) {
|
|
@@ -1350,12 +1378,12 @@ ${o}</tr>
|
|
|
1350
1378
|
i.tokenizer = s;
|
|
1351
1379
|
}
|
|
1352
1380
|
if (t.hooks) {
|
|
1353
|
-
let s = this.defaults.hooks || new
|
|
1381
|
+
let s = this.defaults.hooks || new vt();
|
|
1354
1382
|
for (let r in t.hooks) {
|
|
1355
1383
|
if (!(r in s)) throw new Error(`hook '${r}' does not exist`);
|
|
1356
1384
|
if (["options", "block"].includes(r)) continue;
|
|
1357
1385
|
let l = r, n = t.hooks[l], u = s[l];
|
|
1358
|
-
|
|
1386
|
+
vt.passThroughHooks.has(r) ? s[l] = (a) => {
|
|
1359
1387
|
if (this.defaults.async) return Promise.resolve(n.call(s, a)).then((p) => u.call(s, p));
|
|
1360
1388
|
let h = n.call(s, a);
|
|
1361
1389
|
return u.call(s, h);
|
|
@@ -1409,149 +1437,149 @@ ${o}</tr>
|
|
|
1409
1437
|
return (t) => {
|
|
1410
1438
|
if (t.message += `
|
|
1411
1439
|
Please report this to https://github.com/markedjs/marked.`, o) {
|
|
1412
|
-
let i = "<p>An error occurred:</p><pre>" +
|
|
1440
|
+
let i = "<p>An error occurred:</p><pre>" + me(t.message + "", !0) + "</pre>";
|
|
1413
1441
|
return e ? Promise.resolve(i) : i;
|
|
1414
1442
|
}
|
|
1415
1443
|
if (e) return Promise.reject(t);
|
|
1416
1444
|
throw t;
|
|
1417
1445
|
};
|
|
1418
1446
|
}
|
|
1419
|
-
}, ze = new
|
|
1420
|
-
function
|
|
1447
|
+
}, ze = new en();
|
|
1448
|
+
function O(o, e) {
|
|
1421
1449
|
return ze.parse(o, e);
|
|
1422
1450
|
}
|
|
1423
|
-
|
|
1424
|
-
return ze.setOptions(o),
|
|
1451
|
+
O.options = O.setOptions = function(o) {
|
|
1452
|
+
return ze.setOptions(o), O.defaults = ze.defaults, ps(O.defaults), O;
|
|
1425
1453
|
};
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
return ze.use(...o),
|
|
1454
|
+
O.getDefaults = li;
|
|
1455
|
+
O.defaults = Me;
|
|
1456
|
+
O.use = function(...o) {
|
|
1457
|
+
return ze.use(...o), O.defaults = ze.defaults, ps(O.defaults), O;
|
|
1430
1458
|
};
|
|
1431
|
-
|
|
1459
|
+
O.walkTokens = function(o, e) {
|
|
1432
1460
|
return ze.walkTokens(o, e);
|
|
1433
1461
|
};
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1462
|
+
O.parseInline = ze.parseInline;
|
|
1463
|
+
O.Parser = Te;
|
|
1464
|
+
O.parser = Te.parse;
|
|
1465
|
+
O.Renderer = Rt;
|
|
1466
|
+
O.TextRenderer = gi;
|
|
1467
|
+
O.Lexer = Ee;
|
|
1468
|
+
O.lexer = Ee.lex;
|
|
1469
|
+
O.Tokenizer = Tt;
|
|
1470
|
+
O.Hooks = vt;
|
|
1471
|
+
O.parse = O;
|
|
1472
|
+
O.options;
|
|
1473
|
+
O.setOptions;
|
|
1474
|
+
O.use;
|
|
1475
|
+
O.walkTokens;
|
|
1476
|
+
O.parseInline;
|
|
1449
1477
|
Te.parse;
|
|
1450
1478
|
Ee.lex;
|
|
1451
1479
|
/*! @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 */
|
|
1452
1480
|
const {
|
|
1453
|
-
entries:
|
|
1454
|
-
setPrototypeOf:
|
|
1455
|
-
isFrozen:
|
|
1456
|
-
getPrototypeOf:
|
|
1457
|
-
getOwnPropertyDescriptor:
|
|
1481
|
+
entries: Es,
|
|
1482
|
+
setPrototypeOf: Zi,
|
|
1483
|
+
isFrozen: tn,
|
|
1484
|
+
getPrototypeOf: sn,
|
|
1485
|
+
getOwnPropertyDescriptor: rn
|
|
1458
1486
|
} = Object;
|
|
1459
1487
|
let {
|
|
1460
|
-
freeze:
|
|
1488
|
+
freeze: oe,
|
|
1461
1489
|
seal: ue,
|
|
1462
|
-
create:
|
|
1490
|
+
create: Ts
|
|
1463
1491
|
} = Object, {
|
|
1464
|
-
apply:
|
|
1465
|
-
construct:
|
|
1492
|
+
apply: ri,
|
|
1493
|
+
construct: ni
|
|
1466
1494
|
} = typeof Reflect < "u" && Reflect;
|
|
1467
|
-
|
|
1495
|
+
oe || (oe = function(e) {
|
|
1468
1496
|
return e;
|
|
1469
1497
|
});
|
|
1470
1498
|
ue || (ue = function(e) {
|
|
1471
1499
|
return e;
|
|
1472
1500
|
});
|
|
1473
|
-
|
|
1501
|
+
ri || (ri = function(e, t, i) {
|
|
1474
1502
|
return e.apply(t, i);
|
|
1475
1503
|
});
|
|
1476
|
-
|
|
1504
|
+
ni || (ni = function(e, t) {
|
|
1477
1505
|
return new e(...t);
|
|
1478
1506
|
});
|
|
1479
|
-
const _t =
|
|
1480
|
-
function
|
|
1507
|
+
const _t = le(Array.prototype.forEach), nn = le(Array.prototype.lastIndexOf), Ki = le(Array.prototype.pop), Xe = le(Array.prototype.push), on = le(Array.prototype.splice), wt = le(String.prototype.toLowerCase), qt = le(String.prototype.toString), Qi = le(String.prototype.match), Ze = le(String.prototype.replace), ln = le(String.prototype.indexOf), an = le(String.prototype.trim), de = le(Object.prototype.hasOwnProperty), se = le(RegExp.prototype.test), Ke = hn(TypeError);
|
|
1508
|
+
function le(o) {
|
|
1481
1509
|
return function(e) {
|
|
1482
1510
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
1483
1511
|
for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
1484
1512
|
i[s - 1] = arguments[s];
|
|
1485
|
-
return
|
|
1513
|
+
return ri(o, e, i);
|
|
1486
1514
|
};
|
|
1487
1515
|
}
|
|
1488
|
-
function
|
|
1516
|
+
function hn(o) {
|
|
1489
1517
|
return function() {
|
|
1490
1518
|
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
|
|
1491
1519
|
t[i] = arguments[i];
|
|
1492
|
-
return
|
|
1520
|
+
return ni(o, t);
|
|
1493
1521
|
};
|
|
1494
1522
|
}
|
|
1495
|
-
function
|
|
1523
|
+
function z(o, e) {
|
|
1496
1524
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : wt;
|
|
1497
|
-
|
|
1525
|
+
Zi && Zi(o, null);
|
|
1498
1526
|
let i = e.length;
|
|
1499
1527
|
for (; i--; ) {
|
|
1500
1528
|
let s = e[i];
|
|
1501
1529
|
if (typeof s == "string") {
|
|
1502
1530
|
const r = t(s);
|
|
1503
|
-
r !== s && (
|
|
1531
|
+
r !== s && (tn(e) || (e[i] = r), s = r);
|
|
1504
1532
|
}
|
|
1505
1533
|
o[s] = !0;
|
|
1506
1534
|
}
|
|
1507
1535
|
return o;
|
|
1508
1536
|
}
|
|
1509
|
-
function
|
|
1537
|
+
function un(o) {
|
|
1510
1538
|
for (let e = 0; e < o.length; e++)
|
|
1511
|
-
|
|
1539
|
+
de(o, e) || (o[e] = null);
|
|
1512
1540
|
return o;
|
|
1513
1541
|
}
|
|
1514
1542
|
function ke(o) {
|
|
1515
|
-
const e =
|
|
1516
|
-
for (const [t, i] of
|
|
1517
|
-
|
|
1543
|
+
const e = Ts(null);
|
|
1544
|
+
for (const [t, i] of Es(o))
|
|
1545
|
+
de(o, t) && (Array.isArray(i) ? e[t] = un(i) : i && typeof i == "object" && i.constructor === Object ? e[t] = ke(i) : e[t] = i);
|
|
1518
1546
|
return e;
|
|
1519
1547
|
}
|
|
1520
1548
|
function Qe(o, e) {
|
|
1521
1549
|
for (; o !== null; ) {
|
|
1522
|
-
const i =
|
|
1550
|
+
const i = rn(o, e);
|
|
1523
1551
|
if (i) {
|
|
1524
1552
|
if (i.get)
|
|
1525
|
-
return
|
|
1553
|
+
return le(i.get);
|
|
1526
1554
|
if (typeof i.value == "function")
|
|
1527
|
-
return
|
|
1555
|
+
return le(i.value);
|
|
1528
1556
|
}
|
|
1529
|
-
o =
|
|
1557
|
+
o = sn(o);
|
|
1530
1558
|
}
|
|
1531
1559
|
function t() {
|
|
1532
1560
|
return null;
|
|
1533
1561
|
}
|
|
1534
1562
|
return t;
|
|
1535
1563
|
}
|
|
1536
|
-
const
|
|
1564
|
+
const Ji = oe(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), jt = oe(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Yt = oe(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), cn = oe(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Xt = oe(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), dn = oe(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), es = oe(["#text"]), ts = oe(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Zt = oe(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), is = oe(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), yt = oe(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pn = ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm), fn = ue(/<%[\w\W]*|[\w\W]*%>/gm), gn = ue(/\$\{[\w\W]*/gm), mn = ue(/^data-[\-\w.\u00B7-\uFFFF]+$/), _n = ue(/^aria-[\-\w]+$/), Rs = ue(
|
|
1537
1565
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
1538
1566
|
// eslint-disable-line no-useless-escape
|
|
1539
|
-
),
|
|
1567
|
+
), yn = ue(/^(?:\w+script|data):/i), vn = ue(
|
|
1540
1568
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
1541
1569
|
// eslint-disable-line no-control-regex
|
|
1542
|
-
),
|
|
1543
|
-
var
|
|
1570
|
+
), Ss = ue(/^html$/i), wn = ue(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
1571
|
+
var ss = /* @__PURE__ */ Object.freeze({
|
|
1544
1572
|
__proto__: null,
|
|
1545
|
-
ARIA_ATTR:
|
|
1546
|
-
ATTR_WHITESPACE:
|
|
1547
|
-
CUSTOM_ELEMENT:
|
|
1548
|
-
DATA_ATTR:
|
|
1549
|
-
DOCTYPE_NAME:
|
|
1550
|
-
ERB_EXPR:
|
|
1551
|
-
IS_ALLOWED_URI:
|
|
1552
|
-
IS_SCRIPT_OR_DATA:
|
|
1553
|
-
MUSTACHE_EXPR:
|
|
1554
|
-
TMPLIT_EXPR:
|
|
1573
|
+
ARIA_ATTR: _n,
|
|
1574
|
+
ATTR_WHITESPACE: vn,
|
|
1575
|
+
CUSTOM_ELEMENT: wn,
|
|
1576
|
+
DATA_ATTR: mn,
|
|
1577
|
+
DOCTYPE_NAME: Ss,
|
|
1578
|
+
ERB_EXPR: fn,
|
|
1579
|
+
IS_ALLOWED_URI: Rs,
|
|
1580
|
+
IS_SCRIPT_OR_DATA: yn,
|
|
1581
|
+
MUSTACHE_EXPR: pn,
|
|
1582
|
+
TMPLIT_EXPR: gn
|
|
1555
1583
|
});
|
|
1556
1584
|
const Je = {
|
|
1557
1585
|
element: 1,
|
|
@@ -1560,9 +1588,9 @@ const Je = {
|
|
|
1560
1588
|
progressingInstruction: 7,
|
|
1561
1589
|
comment: 8,
|
|
1562
1590
|
document: 9
|
|
1563
|
-
},
|
|
1591
|
+
}, bn = function() {
|
|
1564
1592
|
return typeof window > "u" ? null : window;
|
|
1565
|
-
},
|
|
1593
|
+
}, xn = function(e, t) {
|
|
1566
1594
|
if (typeof e != "object" || typeof e.createPolicy != "function")
|
|
1567
1595
|
return null;
|
|
1568
1596
|
let i = null;
|
|
@@ -1581,7 +1609,7 @@ const Je = {
|
|
|
1581
1609
|
} catch {
|
|
1582
1610
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
1583
1611
|
}
|
|
1584
|
-
},
|
|
1612
|
+
}, rs = function() {
|
|
1585
1613
|
return {
|
|
1586
1614
|
afterSanitizeAttributes: [],
|
|
1587
1615
|
afterSanitizeElements: [],
|
|
@@ -1594,9 +1622,9 @@ const Je = {
|
|
|
1594
1622
|
uponSanitizeShadowNode: []
|
|
1595
1623
|
};
|
|
1596
1624
|
};
|
|
1597
|
-
function
|
|
1598
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1599
|
-
const e = (
|
|
1625
|
+
function Cs() {
|
|
1626
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bn();
|
|
1627
|
+
const e = (b) => Cs(b);
|
|
1600
1628
|
if (e.version = "3.2.6", e.removed = [], !o || !o.document || o.document.nodeType !== Je.document || !o.Element)
|
|
1601
1629
|
return e.isSupported = !1, e;
|
|
1602
1630
|
let {
|
|
@@ -1610,41 +1638,41 @@ function Rs() {
|
|
|
1610
1638
|
NodeFilter: a,
|
|
1611
1639
|
NamedNodeMap: h = o.NamedNodeMap || o.MozNamedAttrMap,
|
|
1612
1640
|
HTMLFormElement: p,
|
|
1613
|
-
DOMParser:
|
|
1641
|
+
DOMParser: d,
|
|
1614
1642
|
trustedTypes: m
|
|
1615
|
-
} = o,
|
|
1643
|
+
} = o, y = u.prototype, S = Qe(y, "cloneNode"), I = Qe(y, "remove"), x = Qe(y, "nextSibling"), C = Qe(y, "childNodes"), A = Qe(y, "parentNode");
|
|
1616
1644
|
if (typeof l == "function") {
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1645
|
+
const b = t.createElement("template");
|
|
1646
|
+
b.content && b.content.ownerDocument && (t = b.content.ownerDocument);
|
|
1619
1647
|
}
|
|
1620
|
-
let
|
|
1648
|
+
let E, H = "";
|
|
1621
1649
|
const {
|
|
1622
|
-
implementation:
|
|
1650
|
+
implementation: v,
|
|
1623
1651
|
createNodeIterator: _,
|
|
1624
|
-
createDocumentFragment:
|
|
1625
|
-
getElementsByTagName:
|
|
1652
|
+
createDocumentFragment: D,
|
|
1653
|
+
getElementsByTagName: R
|
|
1626
1654
|
} = t, {
|
|
1627
|
-
importNode:
|
|
1655
|
+
importNode: j
|
|
1628
1656
|
} = i;
|
|
1629
|
-
let
|
|
1630
|
-
e.isSupported = typeof
|
|
1657
|
+
let $ = rs();
|
|
1658
|
+
e.isSupported = typeof Es == "function" && typeof A == "function" && v && v.createHTMLDocument !== void 0;
|
|
1631
1659
|
const {
|
|
1632
1660
|
MUSTACHE_EXPR: M,
|
|
1633
|
-
ERB_EXPR:
|
|
1661
|
+
ERB_EXPR: Ce,
|
|
1634
1662
|
TMPLIT_EXPR: Ie,
|
|
1635
1663
|
DATA_ATTR: ot,
|
|
1636
1664
|
ARIA_ATTR: lt,
|
|
1637
1665
|
IS_SCRIPT_OR_DATA: at,
|
|
1638
|
-
ATTR_WHITESPACE:
|
|
1639
|
-
CUSTOM_ELEMENT:
|
|
1640
|
-
} =
|
|
1666
|
+
ATTR_WHITESPACE: yi,
|
|
1667
|
+
CUSTOM_ELEMENT: Ds
|
|
1668
|
+
} = ss;
|
|
1641
1669
|
let {
|
|
1642
|
-
IS_ALLOWED_URI:
|
|
1643
|
-
} =
|
|
1644
|
-
const
|
|
1670
|
+
IS_ALLOWED_URI: vi
|
|
1671
|
+
} = ss, X = null;
|
|
1672
|
+
const wi = z({}, [...Ji, ...jt, ...Yt, ...Xt, ...es]);
|
|
1645
1673
|
let K = null;
|
|
1646
|
-
const
|
|
1647
|
-
let
|
|
1674
|
+
const bi = z({}, [...ts, ...Zt, ...is, ...yt]);
|
|
1675
|
+
let V = Object.seal(Ts(null, {
|
|
1648
1676
|
tagNameCheck: {
|
|
1649
1677
|
writable: !0,
|
|
1650
1678
|
configurable: !1,
|
|
@@ -1663,58 +1691,58 @@ function Rs() {
|
|
|
1663
1691
|
enumerable: !0,
|
|
1664
1692
|
value: !1
|
|
1665
1693
|
}
|
|
1666
|
-
})), We = null, It = null,
|
|
1667
|
-
const
|
|
1694
|
+
})), We = null, It = null, xi = !0, Ht = !0, ki = !1, Ei = !0, He = !1, ht = !0, Ae = !1, Ot = !1, Pt = !1, Oe = !1, ut = !1, ct = !1, Ti = !0, Ri = !1;
|
|
1695
|
+
const Ls = "user-content-";
|
|
1668
1696
|
let $t = !0, Ge = !1, Pe = {}, $e = null;
|
|
1669
|
-
const
|
|
1670
|
-
let
|
|
1671
|
-
const
|
|
1697
|
+
const Si = z({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
1698
|
+
let Ci = null;
|
|
1699
|
+
const Ai = z({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1672
1700
|
let Bt = null;
|
|
1673
|
-
const
|
|
1701
|
+
const Di = z({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), dt = "http://www.w3.org/1998/Math/MathML", pt = "http://www.w3.org/2000/svg", we = "http://www.w3.org/1999/xhtml";
|
|
1674
1702
|
let Be = we, Ut = !1, Ft = null;
|
|
1675
|
-
const
|
|
1676
|
-
let ft =
|
|
1677
|
-
const
|
|
1703
|
+
const zs = z({}, [dt, pt, we], qt);
|
|
1704
|
+
let ft = z({}, ["mi", "mo", "mn", "ms", "mtext"]), gt = z({}, ["annotation-xml"]);
|
|
1705
|
+
const Ns = z({}, ["title", "style", "font", "a", "script"]);
|
|
1678
1706
|
let Ve = null;
|
|
1679
|
-
const
|
|
1707
|
+
const Ms = ["application/xhtml+xml", "text/html"], Is = "text/html";
|
|
1680
1708
|
let Z = null, Ue = null;
|
|
1681
|
-
const
|
|
1682
|
-
return
|
|
1709
|
+
const Hs = t.createElement("form"), Li = function(c) {
|
|
1710
|
+
return c instanceof RegExp || c instanceof Function;
|
|
1683
1711
|
}, Wt = function() {
|
|
1684
|
-
let
|
|
1685
|
-
if (!(Ue && Ue ===
|
|
1686
|
-
if ((!
|
|
1687
|
-
|
|
1688
|
-
if (typeof
|
|
1712
|
+
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1713
|
+
if (!(Ue && Ue === c)) {
|
|
1714
|
+
if ((!c || typeof c != "object") && (c = {}), c = ke(c), Ve = // eslint-disable-next-line unicorn/prefer-includes
|
|
1715
|
+
Ms.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? Is : c.PARSER_MEDIA_TYPE, Z = Ve === "application/xhtml+xml" ? qt : wt, X = de(c, "ALLOWED_TAGS") ? z({}, c.ALLOWED_TAGS, Z) : wi, K = de(c, "ALLOWED_ATTR") ? z({}, c.ALLOWED_ATTR, Z) : bi, Ft = de(c, "ALLOWED_NAMESPACES") ? z({}, c.ALLOWED_NAMESPACES, qt) : zs, Bt = de(c, "ADD_URI_SAFE_ATTR") ? z(ke(Di), c.ADD_URI_SAFE_ATTR, Z) : Di, Ci = de(c, "ADD_DATA_URI_TAGS") ? z(ke(Ai), c.ADD_DATA_URI_TAGS, Z) : Ai, $e = de(c, "FORBID_CONTENTS") ? z({}, c.FORBID_CONTENTS, Z) : Si, We = de(c, "FORBID_TAGS") ? z({}, c.FORBID_TAGS, Z) : ke({}), It = de(c, "FORBID_ATTR") ? z({}, c.FORBID_ATTR, Z) : ke({}), Pe = de(c, "USE_PROFILES") ? c.USE_PROFILES : !1, xi = c.ALLOW_ARIA_ATTR !== !1, Ht = c.ALLOW_DATA_ATTR !== !1, ki = c.ALLOW_UNKNOWN_PROTOCOLS || !1, Ei = c.ALLOW_SELF_CLOSE_IN_ATTR !== !1, He = c.SAFE_FOR_TEMPLATES || !1, ht = c.SAFE_FOR_XML !== !1, Ae = c.WHOLE_DOCUMENT || !1, Oe = c.RETURN_DOM || !1, ut = c.RETURN_DOM_FRAGMENT || !1, ct = c.RETURN_TRUSTED_TYPE || !1, Pt = c.FORCE_BODY || !1, Ti = c.SANITIZE_DOM !== !1, Ri = c.SANITIZE_NAMED_PROPS || !1, $t = c.KEEP_CONTENT !== !1, Ge = c.IN_PLACE || !1, vi = c.ALLOWED_URI_REGEXP || Rs, Be = c.NAMESPACE || we, ft = c.MATHML_TEXT_INTEGRATION_POINTS || ft, gt = c.HTML_INTEGRATION_POINTS || gt, V = c.CUSTOM_ELEMENT_HANDLING || {}, c.CUSTOM_ELEMENT_HANDLING && Li(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (V.tagNameCheck = c.CUSTOM_ELEMENT_HANDLING.tagNameCheck), c.CUSTOM_ELEMENT_HANDLING && Li(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (V.attributeNameCheck = c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), c.CUSTOM_ELEMENT_HANDLING && typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (V.allowCustomizedBuiltInElements = c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), He && (Ht = !1), ut && (Oe = !0), Pe && (X = z({}, es), K = [], Pe.html === !0 && (z(X, Ji), z(K, ts)), Pe.svg === !0 && (z(X, jt), z(K, Zt), z(K, yt)), Pe.svgFilters === !0 && (z(X, Yt), z(K, Zt), z(K, yt)), Pe.mathMl === !0 && (z(X, Xt), z(K, is), z(K, yt))), c.ADD_TAGS && (X === wi && (X = ke(X)), z(X, c.ADD_TAGS, Z)), c.ADD_ATTR && (K === bi && (K = ke(K)), z(K, c.ADD_ATTR, Z)), c.ADD_URI_SAFE_ATTR && z(Bt, c.ADD_URI_SAFE_ATTR, Z), c.FORBID_CONTENTS && ($e === Si && ($e = ke($e)), z($e, c.FORBID_CONTENTS, Z)), $t && (X["#text"] = !0), Ae && z(X, ["html", "head", "body"]), X.table && (z(X, ["tbody"]), delete We.tbody), c.TRUSTED_TYPES_POLICY) {
|
|
1716
|
+
if (typeof c.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1689
1717
|
throw Ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1690
|
-
if (typeof
|
|
1718
|
+
if (typeof c.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
1691
1719
|
throw Ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1692
|
-
|
|
1720
|
+
E = c.TRUSTED_TYPES_POLICY, H = E.createHTML("");
|
|
1693
1721
|
} else
|
|
1694
|
-
|
|
1695
|
-
|
|
1722
|
+
E === void 0 && (E = xn(m, s)), E !== null && typeof H == "string" && (H = E.createHTML(""));
|
|
1723
|
+
oe && oe(c), Ue = c;
|
|
1696
1724
|
}
|
|
1697
|
-
},
|
|
1698
|
-
let g = A(
|
|
1725
|
+
}, zi = z({}, [...jt, ...Yt, ...cn]), Ni = z({}, [...Xt, ...dn]), Os = function(c) {
|
|
1726
|
+
let g = A(c);
|
|
1699
1727
|
(!g || !g.tagName) && (g = {
|
|
1700
1728
|
namespaceURI: Be,
|
|
1701
1729
|
tagName: "template"
|
|
1702
1730
|
});
|
|
1703
|
-
const w = wt(
|
|
1704
|
-
return Ft[
|
|
1705
|
-
},
|
|
1731
|
+
const w = wt(c.tagName), W = wt(g.tagName);
|
|
1732
|
+
return Ft[c.namespaceURI] ? c.namespaceURI === pt ? g.namespaceURI === we ? w === "svg" : g.namespaceURI === dt ? w === "svg" && (W === "annotation-xml" || ft[W]) : !!zi[w] : c.namespaceURI === dt ? g.namespaceURI === we ? w === "math" : g.namespaceURI === pt ? w === "math" && gt[W] : !!Ni[w] : c.namespaceURI === we ? g.namespaceURI === pt && !gt[W] || g.namespaceURI === dt && !ft[W] ? !1 : !Ni[w] && (Ns[w] || !zi[w]) : !!(Ve === "application/xhtml+xml" && Ft[c.namespaceURI]) : !1;
|
|
1733
|
+
}, ge = function(c) {
|
|
1706
1734
|
Xe(e.removed, {
|
|
1707
|
-
element:
|
|
1735
|
+
element: c
|
|
1708
1736
|
});
|
|
1709
1737
|
try {
|
|
1710
|
-
A(
|
|
1738
|
+
A(c).removeChild(c);
|
|
1711
1739
|
} catch {
|
|
1712
|
-
|
|
1740
|
+
I(c);
|
|
1713
1741
|
}
|
|
1714
|
-
}, Fe = function(
|
|
1742
|
+
}, Fe = function(c, g) {
|
|
1715
1743
|
try {
|
|
1716
1744
|
Xe(e.removed, {
|
|
1717
|
-
attribute: g.getAttributeNode(
|
|
1745
|
+
attribute: g.getAttributeNode(c),
|
|
1718
1746
|
from: g
|
|
1719
1747
|
});
|
|
1720
1748
|
} catch {
|
|
@@ -1723,107 +1751,107 @@ function Rs() {
|
|
|
1723
1751
|
from: g
|
|
1724
1752
|
});
|
|
1725
1753
|
}
|
|
1726
|
-
if (g.removeAttribute(
|
|
1754
|
+
if (g.removeAttribute(c), c === "is")
|
|
1727
1755
|
if (Oe || ut)
|
|
1728
1756
|
try {
|
|
1729
|
-
|
|
1757
|
+
ge(g);
|
|
1730
1758
|
} catch {
|
|
1731
1759
|
}
|
|
1732
1760
|
else
|
|
1733
1761
|
try {
|
|
1734
|
-
g.setAttribute(
|
|
1762
|
+
g.setAttribute(c, "");
|
|
1735
1763
|
} catch {
|
|
1736
1764
|
}
|
|
1737
|
-
},
|
|
1765
|
+
}, Mi = function(c) {
|
|
1738
1766
|
let g = null, w = null;
|
|
1739
1767
|
if (Pt)
|
|
1740
|
-
|
|
1768
|
+
c = "<remove></remove>" + c;
|
|
1741
1769
|
else {
|
|
1742
|
-
const
|
|
1743
|
-
w =
|
|
1770
|
+
const Y = Qi(c, /^[\r\n\t ]+/);
|
|
1771
|
+
w = Y && Y[0];
|
|
1744
1772
|
}
|
|
1745
|
-
Ve === "application/xhtml+xml" && Be === we && (
|
|
1746
|
-
const W =
|
|
1773
|
+
Ve === "application/xhtml+xml" && Be === we && (c = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + c + "</body></html>");
|
|
1774
|
+
const W = E ? E.createHTML(c) : c;
|
|
1747
1775
|
if (Be === we)
|
|
1748
1776
|
try {
|
|
1749
|
-
g = new
|
|
1777
|
+
g = new d().parseFromString(W, Ve);
|
|
1750
1778
|
} catch {
|
|
1751
1779
|
}
|
|
1752
1780
|
if (!g || !g.documentElement) {
|
|
1753
|
-
g =
|
|
1781
|
+
g = v.createDocument(Be, "template", null);
|
|
1754
1782
|
try {
|
|
1755
|
-
g.documentElement.innerHTML = Ut ?
|
|
1783
|
+
g.documentElement.innerHTML = Ut ? H : W;
|
|
1756
1784
|
} catch {
|
|
1757
1785
|
}
|
|
1758
1786
|
}
|
|
1759
1787
|
const J = g.body || g.documentElement;
|
|
1760
|
-
return
|
|
1761
|
-
},
|
|
1788
|
+
return c && w && J.insertBefore(t.createTextNode(w), J.childNodes[0] || null), Be === we ? R.call(g, Ae ? "html" : "body")[0] : Ae ? g.documentElement : J;
|
|
1789
|
+
}, Ii = function(c) {
|
|
1762
1790
|
return _.call(
|
|
1763
|
-
|
|
1764
|
-
|
|
1791
|
+
c.ownerDocument || c,
|
|
1792
|
+
c,
|
|
1765
1793
|
// eslint-disable-next-line no-bitwise
|
|
1766
1794
|
a.SHOW_ELEMENT | a.SHOW_COMMENT | a.SHOW_TEXT | a.SHOW_PROCESSING_INSTRUCTION | a.SHOW_CDATA_SECTION,
|
|
1767
1795
|
null
|
|
1768
1796
|
);
|
|
1769
|
-
}, Gt = function(
|
|
1770
|
-
return
|
|
1771
|
-
},
|
|
1772
|
-
return typeof n == "function" &&
|
|
1797
|
+
}, Gt = function(c) {
|
|
1798
|
+
return c instanceof p && (typeof c.nodeName != "string" || typeof c.textContent != "string" || typeof c.removeChild != "function" || !(c.attributes instanceof h) || typeof c.removeAttribute != "function" || typeof c.setAttribute != "function" || typeof c.namespaceURI != "string" || typeof c.insertBefore != "function" || typeof c.hasChildNodes != "function");
|
|
1799
|
+
}, Hi = function(c) {
|
|
1800
|
+
return typeof n == "function" && c instanceof n;
|
|
1773
1801
|
};
|
|
1774
|
-
function
|
|
1775
|
-
_t(
|
|
1776
|
-
w.call(e,
|
|
1802
|
+
function be(b, c, g) {
|
|
1803
|
+
_t(b, (w) => {
|
|
1804
|
+
w.call(e, c, g, Ue);
|
|
1777
1805
|
});
|
|
1778
1806
|
}
|
|
1779
|
-
const
|
|
1807
|
+
const Oi = function(c) {
|
|
1780
1808
|
let g = null;
|
|
1781
|
-
if (
|
|
1782
|
-
return
|
|
1783
|
-
const w = Z(
|
|
1784
|
-
if (
|
|
1809
|
+
if (be($.beforeSanitizeElements, c, null), Gt(c))
|
|
1810
|
+
return ge(c), !0;
|
|
1811
|
+
const w = Z(c.nodeName);
|
|
1812
|
+
if (be($.uponSanitizeElement, c, {
|
|
1785
1813
|
tagName: w,
|
|
1786
1814
|
allowedTags: X
|
|
1787
|
-
}), ht &&
|
|
1788
|
-
return
|
|
1815
|
+
}), ht && c.hasChildNodes() && !Hi(c.firstElementChild) && se(/<[/\w!]/g, c.innerHTML) && se(/<[/\w!]/g, c.textContent) || c.nodeType === Je.progressingInstruction || ht && c.nodeType === Je.comment && se(/<[/\w]/g, c.data))
|
|
1816
|
+
return ge(c), !0;
|
|
1789
1817
|
if (!X[w] || We[w]) {
|
|
1790
|
-
if (!We[w] &&
|
|
1818
|
+
if (!We[w] && $i(w) && (V.tagNameCheck instanceof RegExp && se(V.tagNameCheck, w) || V.tagNameCheck instanceof Function && V.tagNameCheck(w)))
|
|
1791
1819
|
return !1;
|
|
1792
1820
|
if ($t && !$e[w]) {
|
|
1793
|
-
const W = A(
|
|
1821
|
+
const W = A(c) || c.parentNode, J = C(c) || c.childNodes;
|
|
1794
1822
|
if (J && W) {
|
|
1795
|
-
const
|
|
1796
|
-
for (let
|
|
1797
|
-
const xe =
|
|
1798
|
-
xe.__removalCount = (
|
|
1823
|
+
const Y = J.length;
|
|
1824
|
+
for (let ae = Y - 1; ae >= 0; --ae) {
|
|
1825
|
+
const xe = S(J[ae], !0);
|
|
1826
|
+
xe.__removalCount = (c.__removalCount || 0) + 1, W.insertBefore(xe, x(c));
|
|
1799
1827
|
}
|
|
1800
1828
|
}
|
|
1801
1829
|
}
|
|
1802
|
-
return
|
|
1830
|
+
return ge(c), !0;
|
|
1803
1831
|
}
|
|
1804
|
-
return
|
|
1832
|
+
return c instanceof u && !Os(c) || (w === "noscript" || w === "noembed" || w === "noframes") && se(/<\/no(script|embed|frames)/i, c.innerHTML) ? (ge(c), !0) : (He && c.nodeType === Je.text && (g = c.textContent, _t([M, Ce, Ie], (W) => {
|
|
1805
1833
|
g = Ze(g, W, " ");
|
|
1806
|
-
}),
|
|
1807
|
-
element:
|
|
1808
|
-
}),
|
|
1809
|
-
},
|
|
1810
|
-
if (
|
|
1834
|
+
}), c.textContent !== g && (Xe(e.removed, {
|
|
1835
|
+
element: c.cloneNode()
|
|
1836
|
+
}), c.textContent = g)), be($.afterSanitizeElements, c, null), !1);
|
|
1837
|
+
}, Pi = function(c, g, w) {
|
|
1838
|
+
if (Ti && (g === "id" || g === "name") && (w in t || w in Hs))
|
|
1811
1839
|
return !1;
|
|
1812
|
-
if (!(Ht && !It[g] &&
|
|
1813
|
-
if (!(
|
|
1840
|
+
if (!(Ht && !It[g] && se(ot, g))) {
|
|
1841
|
+
if (!(xi && se(lt, g))) {
|
|
1814
1842
|
if (!K[g] || It[g]) {
|
|
1815
1843
|
if (
|
|
1816
1844
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1817
1845
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1818
1846
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1819
|
-
!(
|
|
1847
|
+
!($i(c) && (V.tagNameCheck instanceof RegExp && se(V.tagNameCheck, c) || V.tagNameCheck instanceof Function && V.tagNameCheck(c)) && (V.attributeNameCheck instanceof RegExp && se(V.attributeNameCheck, g) || V.attributeNameCheck instanceof Function && V.attributeNameCheck(g)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1820
1848
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1821
|
-
g === "is" &&
|
|
1849
|
+
g === "is" && V.allowCustomizedBuiltInElements && (V.tagNameCheck instanceof RegExp && se(V.tagNameCheck, w) || V.tagNameCheck instanceof Function && V.tagNameCheck(w)))
|
|
1822
1850
|
) return !1;
|
|
1823
1851
|
} else if (!Bt[g]) {
|
|
1824
|
-
if (!
|
|
1825
|
-
if (!((g === "src" || g === "xlink:href" || g === "href") &&
|
|
1826
|
-
if (!(
|
|
1852
|
+
if (!se(vi, Ze(w, yi, ""))) {
|
|
1853
|
+
if (!((g === "src" || g === "xlink:href" || g === "href") && c !== "script" && ln(w, "data:") === 0 && Ci[c])) {
|
|
1854
|
+
if (!(ki && !se(at, Ze(w, yi, "")))) {
|
|
1827
1855
|
if (w)
|
|
1828
1856
|
return !1;
|
|
1829
1857
|
}
|
|
@@ -1833,14 +1861,14 @@ function Rs() {
|
|
|
1833
1861
|
}
|
|
1834
1862
|
}
|
|
1835
1863
|
return !0;
|
|
1836
|
-
},
|
|
1837
|
-
return
|
|
1838
|
-
},
|
|
1839
|
-
|
|
1864
|
+
}, $i = function(c) {
|
|
1865
|
+
return c !== "annotation-xml" && Qi(c, Ds);
|
|
1866
|
+
}, Bi = function(c) {
|
|
1867
|
+
be($.beforeSanitizeAttributes, c, null);
|
|
1840
1868
|
const {
|
|
1841
1869
|
attributes: g
|
|
1842
|
-
} =
|
|
1843
|
-
if (!g || Gt(
|
|
1870
|
+
} = c;
|
|
1871
|
+
if (!g || Gt(c))
|
|
1844
1872
|
return;
|
|
1845
1873
|
const w = {
|
|
1846
1874
|
attrName: "",
|
|
@@ -1852,128 +1880,128 @@ function Rs() {
|
|
|
1852
1880
|
let W = g.length;
|
|
1853
1881
|
for (; W--; ) {
|
|
1854
1882
|
const J = g[W], {
|
|
1855
|
-
name:
|
|
1856
|
-
namespaceURI:
|
|
1883
|
+
name: Y,
|
|
1884
|
+
namespaceURI: ae,
|
|
1857
1885
|
value: xe
|
|
1858
|
-
} = J, qe = Z(
|
|
1859
|
-
let ee =
|
|
1860
|
-
if (w.attrName = qe, w.attrValue = ee, w.keepAttr = !0, w.forceKeepAttr = void 0,
|
|
1861
|
-
Fe(
|
|
1886
|
+
} = J, qe = Z(Y), Vt = xe;
|
|
1887
|
+
let ee = Y === "value" ? Vt : an(Vt);
|
|
1888
|
+
if (w.attrName = qe, w.attrValue = ee, w.keepAttr = !0, w.forceKeepAttr = void 0, be($.uponSanitizeAttribute, c, w), ee = w.attrValue, Ri && (qe === "id" || qe === "name") && (Fe(Y, c), ee = Ls + ee), ht && se(/((--!?|])>)|<\/(style|title)/i, ee)) {
|
|
1889
|
+
Fe(Y, c);
|
|
1862
1890
|
continue;
|
|
1863
1891
|
}
|
|
1864
1892
|
if (w.forceKeepAttr)
|
|
1865
1893
|
continue;
|
|
1866
1894
|
if (!w.keepAttr) {
|
|
1867
|
-
Fe(
|
|
1895
|
+
Fe(Y, c);
|
|
1868
1896
|
continue;
|
|
1869
1897
|
}
|
|
1870
|
-
if (!
|
|
1871
|
-
Fe(
|
|
1898
|
+
if (!Ei && se(/\/>/i, ee)) {
|
|
1899
|
+
Fe(Y, c);
|
|
1872
1900
|
continue;
|
|
1873
1901
|
}
|
|
1874
|
-
He && _t([M,
|
|
1875
|
-
ee = Ze(ee,
|
|
1902
|
+
He && _t([M, Ce, Ie], (Fi) => {
|
|
1903
|
+
ee = Ze(ee, Fi, " ");
|
|
1876
1904
|
});
|
|
1877
|
-
const
|
|
1878
|
-
if (!
|
|
1879
|
-
Fe(
|
|
1905
|
+
const Ui = Z(c.nodeName);
|
|
1906
|
+
if (!Pi(Ui, qe, ee)) {
|
|
1907
|
+
Fe(Y, c);
|
|
1880
1908
|
continue;
|
|
1881
1909
|
}
|
|
1882
|
-
if (
|
|
1883
|
-
switch (m.getAttributeType(
|
|
1910
|
+
if (E && typeof m == "object" && typeof m.getAttributeType == "function" && !ae)
|
|
1911
|
+
switch (m.getAttributeType(Ui, qe)) {
|
|
1884
1912
|
case "TrustedHTML": {
|
|
1885
|
-
ee =
|
|
1913
|
+
ee = E.createHTML(ee);
|
|
1886
1914
|
break;
|
|
1887
1915
|
}
|
|
1888
1916
|
case "TrustedScriptURL": {
|
|
1889
|
-
ee =
|
|
1917
|
+
ee = E.createScriptURL(ee);
|
|
1890
1918
|
break;
|
|
1891
1919
|
}
|
|
1892
1920
|
}
|
|
1893
1921
|
if (ee !== Vt)
|
|
1894
1922
|
try {
|
|
1895
|
-
|
|
1923
|
+
ae ? c.setAttributeNS(ae, Y, ee) : c.setAttribute(Y, ee), Gt(c) ? ge(c) : Ki(e.removed);
|
|
1896
1924
|
} catch {
|
|
1897
|
-
Fe(
|
|
1925
|
+
Fe(Y, c);
|
|
1898
1926
|
}
|
|
1899
1927
|
}
|
|
1900
|
-
|
|
1901
|
-
},
|
|
1928
|
+
be($.afterSanitizeAttributes, c, null);
|
|
1929
|
+
}, Ps = function b(c) {
|
|
1902
1930
|
let g = null;
|
|
1903
|
-
const w =
|
|
1904
|
-
for (
|
|
1905
|
-
|
|
1906
|
-
|
|
1931
|
+
const w = Ii(c);
|
|
1932
|
+
for (be($.beforeSanitizeShadowDOM, c, null); g = w.nextNode(); )
|
|
1933
|
+
be($.uponSanitizeShadowNode, g, null), Oi(g), Bi(g), g.content instanceof r && b(g.content);
|
|
1934
|
+
be($.afterSanitizeShadowDOM, c, null);
|
|
1907
1935
|
};
|
|
1908
|
-
return e.sanitize = function(
|
|
1909
|
-
let
|
|
1910
|
-
if (Ut = !
|
|
1911
|
-
if (typeof
|
|
1912
|
-
if (
|
|
1936
|
+
return e.sanitize = function(b) {
|
|
1937
|
+
let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null, w = null, W = null, J = null;
|
|
1938
|
+
if (Ut = !b, Ut && (b = "<!-->"), typeof b != "string" && !Hi(b))
|
|
1939
|
+
if (typeof b.toString == "function") {
|
|
1940
|
+
if (b = b.toString(), typeof b != "string")
|
|
1913
1941
|
throw Ke("dirty is not a string, aborting");
|
|
1914
1942
|
} else
|
|
1915
1943
|
throw Ke("toString is not a function");
|
|
1916
1944
|
if (!e.isSupported)
|
|
1917
|
-
return
|
|
1918
|
-
if (Ot || Wt(
|
|
1919
|
-
if (
|
|
1920
|
-
const xe = Z(
|
|
1945
|
+
return b;
|
|
1946
|
+
if (Ot || Wt(c), e.removed = [], typeof b == "string" && (Ge = !1), Ge) {
|
|
1947
|
+
if (b.nodeName) {
|
|
1948
|
+
const xe = Z(b.nodeName);
|
|
1921
1949
|
if (!X[xe] || We[xe])
|
|
1922
1950
|
throw Ke("root node is forbidden and cannot be sanitized in-place");
|
|
1923
1951
|
}
|
|
1924
|
-
} else if (
|
|
1925
|
-
g =
|
|
1952
|
+
} else if (b instanceof n)
|
|
1953
|
+
g = Mi("<!---->"), w = g.ownerDocument.importNode(b, !0), w.nodeType === Je.element && w.nodeName === "BODY" || w.nodeName === "HTML" ? g = w : g.appendChild(w);
|
|
1926
1954
|
else {
|
|
1927
|
-
if (!Oe && !He && !
|
|
1928
|
-
|
|
1929
|
-
return
|
|
1930
|
-
if (g =
|
|
1931
|
-
return Oe ? null : ct ?
|
|
1955
|
+
if (!Oe && !He && !Ae && // eslint-disable-next-line unicorn/prefer-includes
|
|
1956
|
+
b.indexOf("<") === -1)
|
|
1957
|
+
return E && ct ? E.createHTML(b) : b;
|
|
1958
|
+
if (g = Mi(b), !g)
|
|
1959
|
+
return Oe ? null : ct ? H : "";
|
|
1932
1960
|
}
|
|
1933
|
-
g && Pt &&
|
|
1934
|
-
const
|
|
1935
|
-
for (; W =
|
|
1936
|
-
|
|
1961
|
+
g && Pt && ge(g.firstChild);
|
|
1962
|
+
const Y = Ii(Ge ? b : g);
|
|
1963
|
+
for (; W = Y.nextNode(); )
|
|
1964
|
+
Oi(W), Bi(W), W.content instanceof r && Ps(W.content);
|
|
1937
1965
|
if (Ge)
|
|
1938
|
-
return
|
|
1966
|
+
return b;
|
|
1939
1967
|
if (Oe) {
|
|
1940
1968
|
if (ut)
|
|
1941
|
-
for (J =
|
|
1969
|
+
for (J = D.call(g.ownerDocument); g.firstChild; )
|
|
1942
1970
|
J.appendChild(g.firstChild);
|
|
1943
1971
|
else
|
|
1944
1972
|
J = g;
|
|
1945
|
-
return (K.shadowroot || K.shadowrootmode) && (J =
|
|
1973
|
+
return (K.shadowroot || K.shadowrootmode) && (J = j.call(i, J, !0)), J;
|
|
1946
1974
|
}
|
|
1947
|
-
let
|
|
1948
|
-
return
|
|
1949
|
-
` +
|
|
1950
|
-
|
|
1951
|
-
}),
|
|
1975
|
+
let ae = Ae ? g.outerHTML : g.innerHTML;
|
|
1976
|
+
return Ae && X["!doctype"] && g.ownerDocument && g.ownerDocument.doctype && g.ownerDocument.doctype.name && se(Ss, g.ownerDocument.doctype.name) && (ae = "<!DOCTYPE " + g.ownerDocument.doctype.name + `>
|
|
1977
|
+
` + ae), He && _t([M, Ce, Ie], (xe) => {
|
|
1978
|
+
ae = Ze(ae, xe, " ");
|
|
1979
|
+
}), E && ct ? E.createHTML(ae) : ae;
|
|
1952
1980
|
}, e.setConfig = function() {
|
|
1953
|
-
let
|
|
1954
|
-
Wt(
|
|
1981
|
+
let b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1982
|
+
Wt(b), Ot = !0;
|
|
1955
1983
|
}, e.clearConfig = function() {
|
|
1956
1984
|
Ue = null, Ot = !1;
|
|
1957
|
-
}, e.isValidAttribute = function(
|
|
1985
|
+
}, e.isValidAttribute = function(b, c, g) {
|
|
1958
1986
|
Ue || Wt({});
|
|
1959
|
-
const w = Z(
|
|
1960
|
-
return
|
|
1961
|
-
}, e.addHook = function(
|
|
1962
|
-
typeof
|
|
1963
|
-
}, e.removeHook = function(
|
|
1964
|
-
if (
|
|
1965
|
-
const g =
|
|
1966
|
-
return g === -1 ? void 0 :
|
|
1987
|
+
const w = Z(b), W = Z(c);
|
|
1988
|
+
return Pi(w, W, g);
|
|
1989
|
+
}, e.addHook = function(b, c) {
|
|
1990
|
+
typeof c == "function" && Xe($[b], c);
|
|
1991
|
+
}, e.removeHook = function(b, c) {
|
|
1992
|
+
if (c !== void 0) {
|
|
1993
|
+
const g = nn($[b], c);
|
|
1994
|
+
return g === -1 ? void 0 : on($[b], g, 1)[0];
|
|
1967
1995
|
}
|
|
1968
|
-
return
|
|
1969
|
-
}, e.removeHooks = function(
|
|
1970
|
-
|
|
1996
|
+
return Ki($[b]);
|
|
1997
|
+
}, e.removeHooks = function(b) {
|
|
1998
|
+
$[b] = [];
|
|
1971
1999
|
}, e.removeAllHooks = function() {
|
|
1972
|
-
|
|
2000
|
+
$ = rs();
|
|
1973
2001
|
}, e;
|
|
1974
2002
|
}
|
|
1975
|
-
var
|
|
1976
|
-
const
|
|
2003
|
+
var kn = Cs();
|
|
2004
|
+
const En = ["innerHTML"], Tn = "Markdown", Rn = /* @__PURE__ */ ce({
|
|
1977
2005
|
inheritAttrs: !1,
|
|
1978
2006
|
__name: "Markdown",
|
|
1979
2007
|
props: {
|
|
@@ -1984,22 +2012,22 @@ const wn = ["innerHTML"], vn = "Markdown", xn = /* @__PURE__ */ be({
|
|
|
1984
2012
|
},
|
|
1985
2013
|
emits: ["update:markdownText", "changeMode"],
|
|
1986
2014
|
setup(o, { emit: e }) {
|
|
1987
|
-
const t = o, i = e, s =
|
|
1988
|
-
|
|
2015
|
+
const t = o, i = e, s = ls([{ comp: ds, event: a, tooltip: "Edit Markdown" }]);
|
|
2016
|
+
O.setOptions({
|
|
1989
2017
|
gfm: !0,
|
|
1990
2018
|
breaks: !0
|
|
1991
2019
|
});
|
|
1992
2020
|
const r = F(t.markdownText ?? "");
|
|
1993
|
-
|
|
2021
|
+
fe(() => t.markdownText, (h) => {
|
|
1994
2022
|
h !== void 0 && h !== r.value && (r.value = h);
|
|
1995
2023
|
});
|
|
1996
2024
|
const l = F(t.mode ? t.mode === "edit" : !1);
|
|
1997
|
-
|
|
2025
|
+
fe(() => t.mode, (h) => {
|
|
1998
2026
|
h && (l.value = h === "edit");
|
|
1999
2027
|
});
|
|
2000
|
-
const n =
|
|
2001
|
-
const h = t.inputFormat === "html" ? r.value ?? "" :
|
|
2002
|
-
return t.sanitize === !1 ? h :
|
|
2028
|
+
const n = ve(() => {
|
|
2029
|
+
const h = t.inputFormat === "html" ? r.value ?? "" : O.parse(r.value ?? "");
|
|
2030
|
+
return t.sanitize === !1 ? h : kn.sanitize(h);
|
|
2003
2031
|
});
|
|
2004
2032
|
function u() {
|
|
2005
2033
|
i("update:markdownText", r.value);
|
|
@@ -2007,30 +2035,30 @@ const wn = ["innerHTML"], vn = "Markdown", xn = /* @__PURE__ */ be({
|
|
|
2007
2035
|
function a() {
|
|
2008
2036
|
l.value = !l.value, i("changeMode", l.value ? "edit" : "preview");
|
|
2009
2037
|
}
|
|
2010
|
-
return (h, p) => (
|
|
2011
|
-
|
|
2012
|
-
widgetName:
|
|
2038
|
+
return (h, p) => (T(), B(Le, null, [
|
|
2039
|
+
bt(h.$slots, "default", {
|
|
2040
|
+
widgetName: Tn,
|
|
2013
2041
|
childIcons: s.value
|
|
2014
2042
|
}, void 0, !0),
|
|
2015
|
-
N("div",
|
|
2016
|
-
l.value ? De((
|
|
2043
|
+
N("div", oi({ class: "markdown-widget-wrap" }, h.$attrs), [
|
|
2044
|
+
l.value ? De((T(), B("textarea", {
|
|
2017
2045
|
key: 0,
|
|
2018
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
2046
|
+
"onUpdate:modelValue": p[0] || (p[0] = (d) => r.value = d),
|
|
2019
2047
|
onInput: u,
|
|
2020
2048
|
class: "markdown-input",
|
|
2021
2049
|
placeholder: "Write markdown here…"
|
|
2022
2050
|
}, null, 544)), [
|
|
2023
|
-
[
|
|
2024
|
-
]) : (
|
|
2051
|
+
[Vs, r.value]
|
|
2052
|
+
]) : (T(), B("div", {
|
|
2025
2053
|
key: 1,
|
|
2026
2054
|
class: "markdown-output",
|
|
2027
2055
|
innerHTML: n.value
|
|
2028
|
-
}, null, 8,
|
|
2056
|
+
}, null, 8, En))
|
|
2029
2057
|
], 16)
|
|
2030
2058
|
], 64));
|
|
2031
2059
|
}
|
|
2032
|
-
}),
|
|
2033
|
-
function
|
|
2060
|
+
}), uo = /* @__PURE__ */ Ne(Rn, [["__scopeId", "data-v-5bf532d5"]]);
|
|
2061
|
+
function Sn(o, e, t, i, s) {
|
|
2034
2062
|
let r = (...l) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(o, l));
|
|
2035
2063
|
return r.prototype = e.prototype, r;
|
|
2036
2064
|
}
|
|
@@ -2331,7 +2359,7 @@ class f {
|
|
|
2331
2359
|
), (i || e.target).dispatchEvent(s);
|
|
2332
2360
|
}
|
|
2333
2361
|
}
|
|
2334
|
-
class
|
|
2362
|
+
class _e {
|
|
2335
2363
|
constructor(e = {}) {
|
|
2336
2364
|
this.addedNodes = [], this.removedNodes = [], this.column = e.column || 12, this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
|
|
2337
2365
|
}
|
|
@@ -2382,8 +2410,8 @@ class me {
|
|
|
2382
2410
|
return;
|
|
2383
2411
|
let a = u._rect, h = Number.MAX_VALUE, p = Number.MAX_VALUE;
|
|
2384
2412
|
s.y < a.y ? h = (r.y + r.h - a.y) / a.h : s.y + s.h > a.y + a.h && (h = (a.y + a.h - r.y) / a.h), s.x < a.x ? p = (r.x + r.w - a.x) / a.w : s.x + s.w > a.x + a.w && (p = (a.x + a.w - r.x) / a.w);
|
|
2385
|
-
let
|
|
2386
|
-
|
|
2413
|
+
let d = Math.min(p, h);
|
|
2414
|
+
d > n && (n = d, l = u);
|
|
2387
2415
|
}), t.collide = l, l;
|
|
2388
2416
|
}
|
|
2389
2417
|
/** does a pixel coverage returning the node that has the most coverage by area */
|
|
@@ -2497,7 +2525,7 @@ class me {
|
|
|
2497
2525
|
* @param resizing if out of bound, resize down or move into the grid to fit ?
|
|
2498
2526
|
*/
|
|
2499
2527
|
prepareNode(e, t) {
|
|
2500
|
-
e._id = e._id ??
|
|
2528
|
+
e._id = e._id ?? _e._idSeq++, (e.x === void 0 || e.y === void 0 || e.x === null || e.y === null) && (e.autoPosition = !0);
|
|
2501
2529
|
let i = { x: 0, y: 0, w: 1, h: 1 };
|
|
2502
2530
|
return f.defaults(e, i), e.autoPosition || delete e.autoPosition, e.noResize || delete e.noResize, e.noMove || delete e.noMove, f.sanitizeMinMax(e), typeof e.x == "string" && (e.x = Number(e.x)), typeof e.y == "string" && (e.y = Number(e.y)), typeof e.w == "string" && (e.w = Number(e.w)), typeof e.h == "string" && (e.h = Number(e.h)), isNaN(e.x) && (e.x = i.x, e.autoPosition = !0), isNaN(e.y) && (e.y = i.y, e.autoPosition = !0), isNaN(e.w) && (e.w = i.w), isNaN(e.h) && (e.h = i.h), this.nodeBoundFix(e, t), e;
|
|
2503
2531
|
}
|
|
@@ -2579,7 +2607,7 @@ class me {
|
|
|
2579
2607
|
return !1;
|
|
2580
2608
|
if (t.pack = !0, !this.maxRow)
|
|
2581
2609
|
return this.moveNode(e, t);
|
|
2582
|
-
let i, s = new
|
|
2610
|
+
let i, s = new _e({
|
|
2583
2611
|
column: this.column,
|
|
2584
2612
|
float: this.float,
|
|
2585
2613
|
nodes: this.nodes.map((l) => l._id === e._id ? (i = { ...l }, i) : { ...l })
|
|
@@ -2601,7 +2629,7 @@ class me {
|
|
|
2601
2629
|
willItFit(e) {
|
|
2602
2630
|
if (delete e._willFitPos, !this.maxRow)
|
|
2603
2631
|
return !0;
|
|
2604
|
-
let t = new
|
|
2632
|
+
let t = new _e({
|
|
2605
2633
|
column: this.column,
|
|
2606
2634
|
float: this.float,
|
|
2607
2635
|
nodes: this.nodes.map((s) => ({ ...s }))
|
|
@@ -2625,12 +2653,12 @@ class me {
|
|
|
2625
2653
|
return !1;
|
|
2626
2654
|
let l = f.copyPos({}, e), n = this.collideAll(e, r, t.skip), u = !0;
|
|
2627
2655
|
if (n.length) {
|
|
2628
|
-
let p = e._moving && !t.nested,
|
|
2629
|
-
if (p &&
|
|
2630
|
-
let m = f.areaIntercept(t.rect,
|
|
2631
|
-
m / (
|
|
2656
|
+
let p = e._moving && !t.nested, d = p ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
2657
|
+
if (p && d && ((h = (a = e.grid) == null ? void 0 : a.opts) != null && h.subGridDynamic) && !e.grid._isTemp) {
|
|
2658
|
+
let m = f.areaIntercept(t.rect, d._rect), y = f.area(t.rect), S = f.area(d._rect);
|
|
2659
|
+
m / (y < S ? y : S) > 0.8 && (d.grid.makeSubGrid(d.el, void 0, e), d = void 0);
|
|
2632
2660
|
}
|
|
2633
|
-
|
|
2661
|
+
d ? u = !this._fixCollisions(e, r, d, t) : (u = !1, i && delete t.pack);
|
|
2634
2662
|
}
|
|
2635
2663
|
return u && (e._dirty = !0, f.copyPos(e, r)), t.pack && this._packNodes()._notify(), !f.samePos(e, l);
|
|
2636
2664
|
}
|
|
@@ -2702,17 +2730,17 @@ class me {
|
|
|
2702
2730
|
const a = this._layouts[t] || [];
|
|
2703
2731
|
let h = this._layouts.length - 1;
|
|
2704
2732
|
!a.length && e !== h && ((u = this._layouts[h]) != null && u.length) && (e = h, this._layouts[h].forEach((p) => {
|
|
2705
|
-
let
|
|
2706
|
-
|
|
2733
|
+
let d = i.find((m) => m._id === p._id);
|
|
2734
|
+
d && (!r && !p.autoPosition && (d.x = p.x ?? d.x, d.y = p.y ?? d.y), d.w = p.w ?? d.w, (p.x == null || p.y === void 0) && (d.autoPosition = !0));
|
|
2707
2735
|
})), a.forEach((p) => {
|
|
2708
|
-
let
|
|
2709
|
-
if (
|
|
2710
|
-
const m = i[
|
|
2736
|
+
let d = i.findIndex((m) => m._id === p._id);
|
|
2737
|
+
if (d !== -1) {
|
|
2738
|
+
const m = i[d];
|
|
2711
2739
|
if (r) {
|
|
2712
2740
|
m.w = p.w;
|
|
2713
2741
|
return;
|
|
2714
2742
|
}
|
|
2715
|
-
(p.autoPosition || isNaN(p.x) || isNaN(p.y)) && this.findEmptyPosition(p, l), p.autoPosition || (m.x = p.x ?? m.x, m.y = p.y ?? m.y, m.w = p.w ?? m.w, l.push(m)), i.splice(
|
|
2743
|
+
(p.autoPosition || isNaN(p.x) || isNaN(p.y)) && this.findEmptyPosition(p, l), p.autoPosition || (m.x = p.x ?? m.x, m.y = p.y ?? m.y, m.w = p.w ?? m.w, l.push(m)), i.splice(d, 1);
|
|
2716
2744
|
}
|
|
2717
2745
|
});
|
|
2718
2746
|
}
|
|
@@ -2724,8 +2752,8 @@ class me {
|
|
|
2724
2752
|
s(t, e, l, i);
|
|
2725
2753
|
else if (!n) {
|
|
2726
2754
|
let a = r || s === "none" ? 1 : t / e, h = s === "move" || s === "moveScale", p = s === "scale" || s === "moveScale";
|
|
2727
|
-
i.forEach((
|
|
2728
|
-
|
|
2755
|
+
i.forEach((d) => {
|
|
2756
|
+
d.x = t === 1 ? 0 : h ? Math.round(d.x * a) : Math.min(d.x, t - 1), d.w = t === 1 || e === 1 ? 1 : p ? Math.round(d.w * a) || 1 : Math.min(d.w, t), l.push(d);
|
|
2729
2757
|
}), i = [];
|
|
2730
2758
|
}
|
|
2731
2759
|
}
|
|
@@ -2746,7 +2774,7 @@ class me {
|
|
|
2746
2774
|
return e.forEach((r, l) => {
|
|
2747
2775
|
if (r._id === void 0) {
|
|
2748
2776
|
const n = r.id ? this.nodes.find((u) => u.id === r.id) : void 0;
|
|
2749
|
-
r._id = (n == null ? void 0 : n._id) ??
|
|
2777
|
+
r._id = (n == null ? void 0 : n._id) ?? _e._idSeq++;
|
|
2750
2778
|
}
|
|
2751
2779
|
s[l] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
2752
2780
|
}), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
|
|
@@ -2757,7 +2785,7 @@ class me {
|
|
|
2757
2785
|
* @param column corresponding column index to save it under
|
|
2758
2786
|
*/
|
|
2759
2787
|
cacheOneLayout(e, t) {
|
|
2760
|
-
e._id = e._id ??
|
|
2788
|
+
e._id = e._id ?? _e._idSeq++;
|
|
2761
2789
|
let i = { x: e.x, y: e.y, w: e.w, _id: e._id };
|
|
2762
2790
|
(e.autoPosition || e.x === void 0) && (delete i.x, delete i.y, e.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[t] = this._layouts[t] || [];
|
|
2763
2791
|
let s = this.findCacheLayout(e, t);
|
|
@@ -2781,8 +2809,8 @@ class me {
|
|
|
2781
2809
|
return this;
|
|
2782
2810
|
}
|
|
2783
2811
|
}
|
|
2784
|
-
|
|
2785
|
-
const
|
|
2812
|
+
_e._idSeq = 0;
|
|
2813
|
+
const he = {
|
|
2786
2814
|
alwaysShowResizeHandle: "mobile",
|
|
2787
2815
|
animate: !0,
|
|
2788
2816
|
auto: !0,
|
|
@@ -2814,16 +2842,16 @@ const ae = {
|
|
|
2814
2842
|
// staticGrid: false,
|
|
2815
2843
|
// styleInHead: false,
|
|
2816
2844
|
//removable
|
|
2817
|
-
},
|
|
2845
|
+
}, Cn = {
|
|
2818
2846
|
handle: ".grid-stack-item-content",
|
|
2819
2847
|
appendTo: "body"
|
|
2820
2848
|
// revert: 'invalid',
|
|
2821
2849
|
// scroll: false,
|
|
2822
2850
|
};
|
|
2823
|
-
class
|
|
2851
|
+
class k {
|
|
2824
2852
|
}
|
|
2825
|
-
const
|
|
2826
|
-
class
|
|
2853
|
+
const pe = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2854
|
+
class ye {
|
|
2827
2855
|
}
|
|
2828
2856
|
function St(o, e) {
|
|
2829
2857
|
if (o.touches.length > 1)
|
|
@@ -2863,7 +2891,7 @@ function St(o, e) {
|
|
|
2863
2891
|
// relatedTarget
|
|
2864
2892
|
), o.target.dispatchEvent(i);
|
|
2865
2893
|
}
|
|
2866
|
-
function
|
|
2894
|
+
function As(o, e) {
|
|
2867
2895
|
o.cancelable && o.preventDefault();
|
|
2868
2896
|
const t = document.createEvent("MouseEvents");
|
|
2869
2897
|
t.initMouseEvent(
|
|
@@ -2900,27 +2928,27 @@ function Ss(o, e) {
|
|
|
2900
2928
|
), o.target.dispatchEvent(t);
|
|
2901
2929
|
}
|
|
2902
2930
|
function Ct(o) {
|
|
2903
|
-
|
|
2931
|
+
ye.touchHandled || (ye.touchHandled = !0, St(o, "mousedown"));
|
|
2904
2932
|
}
|
|
2905
2933
|
function At(o) {
|
|
2906
|
-
|
|
2934
|
+
ye.touchHandled && St(o, "mousemove");
|
|
2907
2935
|
}
|
|
2908
2936
|
function Dt(o) {
|
|
2909
|
-
if (!
|
|
2937
|
+
if (!ye.touchHandled)
|
|
2910
2938
|
return;
|
|
2911
|
-
|
|
2912
|
-
const e = !!
|
|
2913
|
-
St(o, "mouseup"), e || St(o, "click"),
|
|
2939
|
+
ye.pointerLeaveTimeout && (window.clearTimeout(ye.pointerLeaveTimeout), delete ye.pointerLeaveTimeout);
|
|
2940
|
+
const e = !!k.dragElement;
|
|
2941
|
+
St(o, "mouseup"), e || St(o, "click"), ye.touchHandled = !1;
|
|
2914
2942
|
}
|
|
2915
2943
|
function Lt(o) {
|
|
2916
2944
|
o.pointerType !== "mouse" && o.target.releasePointerCapture(o.pointerId);
|
|
2917
2945
|
}
|
|
2918
|
-
function rs(o) {
|
|
2919
|
-
x.dragElement && o.pointerType !== "mouse" && Ss(o, "mouseenter");
|
|
2920
|
-
}
|
|
2921
2946
|
function ns(o) {
|
|
2922
|
-
|
|
2923
|
-
|
|
2947
|
+
k.dragElement && o.pointerType !== "mouse" && As(o, "mouseenter");
|
|
2948
|
+
}
|
|
2949
|
+
function os(o) {
|
|
2950
|
+
k.dragElement && o.pointerType !== "mouse" && (ye.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2951
|
+
delete ye.pointerLeaveTimeout, As(o, "mouseleave");
|
|
2924
2952
|
}, 10));
|
|
2925
2953
|
}
|
|
2926
2954
|
class Mt {
|
|
@@ -2930,15 +2958,15 @@ class Mt {
|
|
|
2930
2958
|
/** @internal */
|
|
2931
2959
|
_init() {
|
|
2932
2960
|
const e = document.createElement("div");
|
|
2933
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Mt.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.el = e, this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown),
|
|
2961
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Mt.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.el = e, this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), pe && (this.el.addEventListener("touchstart", Ct), this.el.addEventListener("pointerdown", Lt)), this;
|
|
2934
2962
|
}
|
|
2935
2963
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2936
2964
|
destroy() {
|
|
2937
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
2965
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), pe && (this.el.removeEventListener("touchstart", Ct), this.el.removeEventListener("pointerdown", Lt)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2938
2966
|
}
|
|
2939
2967
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2940
2968
|
_mouseDown(e) {
|
|
2941
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2969
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0), pe && (this.el.addEventListener("touchmove", At), this.el.addEventListener("touchend", Dt)), e.stopPropagation(), e.preventDefault();
|
|
2942
2970
|
}
|
|
2943
2971
|
/** @internal */
|
|
2944
2972
|
_mouseMove(e) {
|
|
@@ -2947,7 +2975,7 @@ class Mt {
|
|
|
2947
2975
|
}
|
|
2948
2976
|
/** @internal */
|
|
2949
2977
|
_mouseUp(e) {
|
|
2950
|
-
this.moving && this._triggerEvent("stop", e), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2978
|
+
this.moving && this._triggerEvent("stop", e), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), pe && (this.el.removeEventListener("touchmove", At), this.el.removeEventListener("touchend", Dt)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2951
2979
|
}
|
|
2952
2980
|
/** @internal */
|
|
2953
2981
|
_triggerEvent(e, t) {
|
|
@@ -2955,7 +2983,7 @@ class Mt {
|
|
|
2955
2983
|
}
|
|
2956
2984
|
}
|
|
2957
2985
|
Mt.prefix = "ui-resizable-";
|
|
2958
|
-
class
|
|
2986
|
+
class mi {
|
|
2959
2987
|
constructor() {
|
|
2960
2988
|
this._eventRegister = {};
|
|
2961
2989
|
}
|
|
@@ -2983,7 +3011,7 @@ class gi {
|
|
|
2983
3011
|
return this._eventRegister[e](t);
|
|
2984
3012
|
}
|
|
2985
3013
|
}
|
|
2986
|
-
class it extends
|
|
3014
|
+
class it extends mi {
|
|
2987
3015
|
constructor(e, t = {}) {
|
|
2988
3016
|
super(), this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
2989
3017
|
const s = this.el.parentElement.getBoundingClientRect(), r = {
|
|
@@ -3038,17 +3066,17 @@ class it extends gi {
|
|
|
3038
3066
|
}
|
|
3039
3067
|
/** @internal turns auto hide on/off */
|
|
3040
3068
|
_setupAutoHide(e) {
|
|
3041
|
-
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut),
|
|
3069
|
+
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut), k.overResizeElement === this && delete k.overResizeElement), this;
|
|
3042
3070
|
}
|
|
3043
3071
|
/** @internal */
|
|
3044
3072
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3045
3073
|
_mouseOver(e) {
|
|
3046
|
-
|
|
3074
|
+
k.overResizeElement || k.dragElement || (k.overResizeElement = this, this.el.classList.remove("ui-resizable-autohide"));
|
|
3047
3075
|
}
|
|
3048
3076
|
/** @internal */
|
|
3049
3077
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3050
3078
|
_mouseOut(e) {
|
|
3051
|
-
|
|
3079
|
+
k.overResizeElement === this && (delete k.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
3052
3080
|
}
|
|
3053
3081
|
/** @internal */
|
|
3054
3082
|
_setupHandlers() {
|
|
@@ -3142,8 +3170,8 @@ class it extends gi {
|
|
|
3142
3170
|
}
|
|
3143
3171
|
}
|
|
3144
3172
|
it._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
3145
|
-
const
|
|
3146
|
-
class st extends
|
|
3173
|
+
const An = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
3174
|
+
class st extends mi {
|
|
3147
3175
|
constructor(e, t = {}) {
|
|
3148
3176
|
super(), this.dragScale = { x: 1, y: 1 }, this.el = e, this.option = t;
|
|
3149
3177
|
let i = t.handle.substring(1);
|
|
@@ -3156,10 +3184,10 @@ class st extends gi {
|
|
|
3156
3184
|
super.off(e);
|
|
3157
3185
|
}
|
|
3158
3186
|
enable() {
|
|
3159
|
-
this.disabled !== !1 && (super.enable(), this.dragEl.addEventListener("mousedown", this._mouseDown),
|
|
3187
|
+
this.disabled !== !1 && (super.enable(), this.dragEl.addEventListener("mousedown", this._mouseDown), pe && (this.dragEl.addEventListener("touchstart", Ct), this.dragEl.addEventListener("pointerdown", Lt)), this.el.classList.remove("ui-draggable-disabled"));
|
|
3160
3188
|
}
|
|
3161
3189
|
disable(e = !1) {
|
|
3162
|
-
this.disabled !== !0 && (super.disable(), this.dragEl.removeEventListener("mousedown", this._mouseDown),
|
|
3190
|
+
this.disabled !== !0 && (super.disable(), this.dragEl.removeEventListener("mousedown", this._mouseDown), pe && (this.dragEl.removeEventListener("touchstart", Ct), this.dragEl.removeEventListener("pointerdown", Lt)), e || this.el.classList.add("ui-draggable-disabled"));
|
|
3163
3191
|
}
|
|
3164
3192
|
destroy() {
|
|
3165
3193
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), delete this.dragTimeout, this.mouseDownEvent && this._mouseUp(this.mouseDownEvent), this.disable(!0), delete this.el, delete this.helper, delete this.option, super.destroy();
|
|
@@ -3169,8 +3197,8 @@ class st extends gi {
|
|
|
3169
3197
|
}
|
|
3170
3198
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
3171
3199
|
_mouseDown(e) {
|
|
3172
|
-
if (!
|
|
3173
|
-
return e.button !== 0 || e.target.closest(
|
|
3200
|
+
if (!k.mouseHandled)
|
|
3201
|
+
return e.button !== 0 || e.target.closest(An) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete k.dragElement, delete k.dropElement, document.addEventListener("mousemove", this._mouseMove, !0), document.addEventListener("mouseup", this._mouseUp, !0), pe && (this.dragEl.addEventListener("touchmove", At), this.dragEl.addEventListener("touchend", Dt)), e.preventDefault(), document.activeElement && document.activeElement.blur(), k.mouseHandled = !0), !0;
|
|
3174
3202
|
}
|
|
3175
3203
|
/** @internal method to call actual drag event */
|
|
3176
3204
|
_callDrag(e) {
|
|
@@ -3184,15 +3212,15 @@ class st extends gi {
|
|
|
3184
3212
|
var i;
|
|
3185
3213
|
let t = this.mouseDownEvent;
|
|
3186
3214
|
if (this.dragging)
|
|
3187
|
-
if (this._dragFollow(e),
|
|
3188
|
-
const s = Number.isInteger(
|
|
3215
|
+
if (this._dragFollow(e), k.pauseDrag) {
|
|
3216
|
+
const s = Number.isInteger(k.pauseDrag) ? k.pauseDrag : 100;
|
|
3189
3217
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), this.dragTimeout = window.setTimeout(() => this._callDrag(e), s);
|
|
3190
3218
|
} else
|
|
3191
3219
|
this._callDrag(e);
|
|
3192
3220
|
else if (Math.abs(e.x - t.x) + Math.abs(e.y - t.y) > 3) {
|
|
3193
|
-
this.dragging = !0,
|
|
3221
|
+
this.dragging = !0, k.dragElement = this;
|
|
3194
3222
|
let s = (i = this.el.gridstackNode) == null ? void 0 : i.grid;
|
|
3195
|
-
s ?
|
|
3223
|
+
s ? k.dropElement = s.el.ddElement.ddDroppable : delete k.dropElement, this.helper = this._createHelper(e), this._setupHelperContainmentStyle(), this.dragOffset = this._getDragOffset(e, this.el, this.helperContainment);
|
|
3196
3224
|
const r = f.initEvent(e, { target: this.el, type: "dragstart" });
|
|
3197
3225
|
this._setupHelperStyle(e), this.option.start && this.option.start(r, this.ui()), this.triggerEvent("dragstart", r);
|
|
3198
3226
|
}
|
|
@@ -3201,12 +3229,12 @@ class st extends gi {
|
|
|
3201
3229
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
3202
3230
|
_mouseUp(e) {
|
|
3203
3231
|
var t;
|
|
3204
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
3205
|
-
delete this.dragging, ((t =
|
|
3232
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), pe && (this.dragEl.removeEventListener("touchmove", At, !0), this.dragEl.removeEventListener("touchend", Dt, !0)), this.dragging) {
|
|
3233
|
+
delete this.dragging, ((t = k.dropElement) == null ? void 0 : t.el) === this.el.parentElement && delete k.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper === this.el ? this._removeHelperStyle() : this.helper.remove();
|
|
3206
3234
|
const i = f.initEvent(e, { target: this.el, type: "dragstop" });
|
|
3207
|
-
this.option.stop && this.option.stop(i), this.triggerEvent("dragstop", i),
|
|
3235
|
+
this.option.stop && this.option.stop(i), this.triggerEvent("dragstop", i), k.dropElement && k.dropElement.drop(e);
|
|
3208
3236
|
}
|
|
3209
|
-
delete this.helper, delete this.mouseDownEvent, delete
|
|
3237
|
+
delete this.helper, delete this.mouseDownEvent, delete k.dragElement, delete k.dropElement, delete k.mouseHandled, e.preventDefault();
|
|
3210
3238
|
}
|
|
3211
3239
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
3212
3240
|
_createHelper(e) {
|
|
@@ -3288,7 +3316,7 @@ class st extends gi {
|
|
|
3288
3316
|
}
|
|
3289
3317
|
}
|
|
3290
3318
|
st.originStyleProp = ["transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
3291
|
-
class
|
|
3319
|
+
class Dn extends mi {
|
|
3292
3320
|
constructor(e, t = {}) {
|
|
3293
3321
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
3294
3322
|
}
|
|
@@ -3299,10 +3327,10 @@ class Rn extends gi {
|
|
|
3299
3327
|
super.off(e);
|
|
3300
3328
|
}
|
|
3301
3329
|
enable() {
|
|
3302
|
-
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave),
|
|
3330
|
+
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), pe && (this.el.addEventListener("pointerenter", ns), this.el.addEventListener("pointerleave", os)));
|
|
3303
3331
|
}
|
|
3304
3332
|
disable(e = !1) {
|
|
3305
|
-
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave),
|
|
3333
|
+
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), pe && (this.el.removeEventListener("pointerenter", ns), this.el.removeEventListener("pointerleave", os)));
|
|
3306
3334
|
}
|
|
3307
3335
|
destroy() {
|
|
3308
3336
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -3312,21 +3340,21 @@ class Rn extends gi {
|
|
|
3312
3340
|
}
|
|
3313
3341
|
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
|
|
3314
3342
|
_mouseEnter(e) {
|
|
3315
|
-
if (!
|
|
3343
|
+
if (!k.dragElement || !this._canDrop(k.dragElement.el))
|
|
3316
3344
|
return;
|
|
3317
|
-
e.preventDefault(), e.stopPropagation(),
|
|
3345
|
+
e.preventDefault(), e.stopPropagation(), k.dropElement && k.dropElement !== this && k.dropElement._mouseLeave(e), k.dropElement = this;
|
|
3318
3346
|
const t = f.initEvent(e, { target: this.el, type: "dropover" });
|
|
3319
|
-
this.option.over && this.option.over(t, this._ui(
|
|
3347
|
+
this.option.over && this.option.over(t, this._ui(k.dragElement)), this.triggerEvent("dropover", t), this.el.classList.add("ui-droppable-over");
|
|
3320
3348
|
}
|
|
3321
3349
|
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
|
|
3322
3350
|
_mouseLeave(e) {
|
|
3323
3351
|
var i;
|
|
3324
|
-
if (!
|
|
3352
|
+
if (!k.dragElement || k.dropElement !== this)
|
|
3325
3353
|
return;
|
|
3326
3354
|
e.preventDefault(), e.stopPropagation();
|
|
3327
3355
|
const t = f.initEvent(e, { target: this.el, type: "dropout" });
|
|
3328
|
-
if (this.option.out && this.option.out(t, this._ui(
|
|
3329
|
-
delete
|
|
3356
|
+
if (this.option.out && this.option.out(t, this._ui(k.dragElement)), this.triggerEvent("dropout", t), k.dropElement === this) {
|
|
3357
|
+
delete k.dropElement;
|
|
3330
3358
|
let s, r = this.el.parentElement;
|
|
3331
3359
|
for (; !s && r; )
|
|
3332
3360
|
s = (i = r.ddElement) == null ? void 0 : i.ddDroppable, r = r.parentElement;
|
|
@@ -3337,7 +3365,7 @@ class Rn extends gi {
|
|
|
3337
3365
|
drop(e) {
|
|
3338
3366
|
e.preventDefault();
|
|
3339
3367
|
const t = f.initEvent(e, { target: this.el, type: "drop" });
|
|
3340
|
-
this.option.drop && this.option.drop(t, this._ui(
|
|
3368
|
+
this.option.drop && this.option.drop(t, this._ui(k.dragElement)), this.triggerEvent("drop", t);
|
|
3341
3369
|
}
|
|
3342
3370
|
/** @internal true if element matches the string/method accept option */
|
|
3343
3371
|
_canDrop(e) {
|
|
@@ -3355,9 +3383,9 @@ class Rn extends gi {
|
|
|
3355
3383
|
};
|
|
3356
3384
|
}
|
|
3357
3385
|
}
|
|
3358
|
-
class
|
|
3386
|
+
class _i {
|
|
3359
3387
|
static init(e) {
|
|
3360
|
-
return e.ddElement || (e.ddElement = new
|
|
3388
|
+
return e.ddElement || (e.ddElement = new _i(e)), e.ddElement;
|
|
3361
3389
|
}
|
|
3362
3390
|
constructor(e) {
|
|
3363
3391
|
this.el = e;
|
|
@@ -3381,13 +3409,13 @@ class mi {
|
|
|
3381
3409
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
3382
3410
|
}
|
|
3383
3411
|
setupDroppable(e) {
|
|
3384
|
-
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new
|
|
3412
|
+
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new Dn(this.el, e), this;
|
|
3385
3413
|
}
|
|
3386
3414
|
cleanDroppable() {
|
|
3387
3415
|
return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
|
|
3388
3416
|
}
|
|
3389
3417
|
}
|
|
3390
|
-
class
|
|
3418
|
+
class Ln {
|
|
3391
3419
|
resizable(e, t, i, s) {
|
|
3392
3420
|
return this._getDDElements(e).forEach((r) => {
|
|
3393
3421
|
if (t === "disable" || t === "enable")
|
|
@@ -3452,7 +3480,7 @@ class Sn {
|
|
|
3452
3480
|
}
|
|
3453
3481
|
on(e, t, i) {
|
|
3454
3482
|
return this._getDDElements(e).forEach((s) => s.on(t, (r) => {
|
|
3455
|
-
i(r,
|
|
3483
|
+
i(r, k.dragElement ? k.dragElement.el : r.target, k.dragElement ? k.dragElement.helper : null);
|
|
3456
3484
|
})), this;
|
|
3457
3485
|
}
|
|
3458
3486
|
off(e, t) {
|
|
@@ -3463,7 +3491,7 @@ class Sn {
|
|
|
3463
3491
|
let i = f.getElements(e);
|
|
3464
3492
|
if (!i.length)
|
|
3465
3493
|
return [];
|
|
3466
|
-
let s = i.map((r) => r.ddElement || (t ?
|
|
3494
|
+
let s = i.map((r) => r.ddElement || (t ? _i.init(r) : null));
|
|
3467
3495
|
return t || s.filter((r) => r), s;
|
|
3468
3496
|
}
|
|
3469
3497
|
}
|
|
@@ -3474,8 +3502,8 @@ class Sn {
|
|
|
3474
3502
|
* Copyright (c) 2021-2022 Alain Dumesny
|
|
3475
3503
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
3476
3504
|
*/
|
|
3477
|
-
const Q = new
|
|
3478
|
-
class
|
|
3505
|
+
const Q = new Ln();
|
|
3506
|
+
class L {
|
|
3479
3507
|
/**
|
|
3480
3508
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
3481
3509
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -3490,8 +3518,8 @@ class R {
|
|
|
3490
3518
|
* let grid = document.querySelector('.grid-stack').gridstack;
|
|
3491
3519
|
*/
|
|
3492
3520
|
static init(e = {}, t = ".grid-stack") {
|
|
3493
|
-
let i =
|
|
3494
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
3521
|
+
let i = L.getGridElement(t);
|
|
3522
|
+
return i ? (i.gridstack || (i.gridstack = new L(i, f.cloneDeep(e))), i.gridstack) : (console.error(typeof t == "string" ? 'GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3495
3523
|
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);
|
|
3496
3524
|
}
|
|
3497
3525
|
/**
|
|
@@ -3505,8 +3533,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3505
3533
|
*/
|
|
3506
3534
|
static initAll(e = {}, t = ".grid-stack") {
|
|
3507
3535
|
let i = [];
|
|
3508
|
-
return
|
|
3509
|
-
s.gridstack || (s.gridstack = new
|
|
3536
|
+
return L.getGridElements(t).forEach((s) => {
|
|
3537
|
+
s.gridstack || (s.gridstack = new L(s, f.cloneDeep(e))), i.push(s.gridstack);
|
|
3510
3538
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
3511
3539
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`), i;
|
|
3512
3540
|
}
|
|
@@ -3525,27 +3553,27 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3525
3553
|
const l = i.gridstack;
|
|
3526
3554
|
return t && (l.opts = { ...l.opts, ...t }), t.children !== void 0 && l.load(t.children), l;
|
|
3527
3555
|
}
|
|
3528
|
-
if (!e.classList.contains("grid-stack") ||
|
|
3529
|
-
if (
|
|
3530
|
-
i =
|
|
3556
|
+
if (!e.classList.contains("grid-stack") || L.addRemoveCB)
|
|
3557
|
+
if (L.addRemoveCB)
|
|
3558
|
+
i = L.addRemoveCB(e, t, !0, !0);
|
|
3531
3559
|
else {
|
|
3532
3560
|
let l = document.implementation.createHTMLDocument("");
|
|
3533
3561
|
l.body.innerHTML = `<div class="grid-stack ${t.class || ""}"></div>`, i = l.body.children[0], e.appendChild(i);
|
|
3534
3562
|
}
|
|
3535
|
-
return
|
|
3563
|
+
return L.init(t, i);
|
|
3536
3564
|
}
|
|
3537
3565
|
/** call this method to register your engine instead of the default one.
|
|
3538
3566
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
3539
3567
|
* replace just one instance.
|
|
3540
3568
|
*/
|
|
3541
3569
|
static registerEngine(e) {
|
|
3542
|
-
|
|
3570
|
+
L.engineClass = e;
|
|
3543
3571
|
}
|
|
3544
3572
|
/** @internal create placeholder DIV as needed */
|
|
3545
3573
|
get placeholder() {
|
|
3546
3574
|
if (!this._placeholder) {
|
|
3547
3575
|
let e = document.createElement("div");
|
|
3548
|
-
e.className = "placeholder-content", this.opts.placeholderText && (e.innerHTML = this.opts.placeholderText), this._placeholder = document.createElement("div"), this._placeholder.classList.add(this.opts.placeholderClass,
|
|
3576
|
+
e.className = "placeholder-content", this.opts.placeholderText && (e.innerHTML = this.opts.placeholderText), this._placeholder = document.createElement("div"), this._placeholder.classList.add(this.opts.placeholderClass, he.itemClass, this.opts.itemClass), this.placeholder.appendChild(e);
|
|
3549
3577
|
}
|
|
3550
3578
|
return this._placeholder;
|
|
3551
3579
|
}
|
|
@@ -3560,42 +3588,42 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3560
3588
|
let i = f.toNumber(e.getAttribute("gs-row"));
|
|
3561
3589
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
3562
3590
|
let s = {
|
|
3563
|
-
...f.cloneDeep(
|
|
3564
|
-
column: f.toNumber(e.getAttribute("gs-column")) ||
|
|
3565
|
-
minRow: i || f.toNumber(e.getAttribute("gs-min-row")) ||
|
|
3566
|
-
maxRow: i || f.toNumber(e.getAttribute("gs-max-row")) ||
|
|
3567
|
-
staticGrid: f.toBool(e.getAttribute("gs-static")) ||
|
|
3591
|
+
...f.cloneDeep(he),
|
|
3592
|
+
column: f.toNumber(e.getAttribute("gs-column")) || he.column,
|
|
3593
|
+
minRow: i || f.toNumber(e.getAttribute("gs-min-row")) || he.minRow,
|
|
3594
|
+
maxRow: i || f.toNumber(e.getAttribute("gs-max-row")) || he.maxRow,
|
|
3595
|
+
staticGrid: f.toBool(e.getAttribute("gs-static")) || he.staticGrid,
|
|
3568
3596
|
draggable: {
|
|
3569
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
3597
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || he.draggable.handle
|
|
3570
3598
|
},
|
|
3571
3599
|
removableOptions: {
|
|
3572
|
-
accept: t.itemClass ||
|
|
3573
|
-
decline:
|
|
3600
|
+
accept: t.itemClass || he.removableOptions.accept,
|
|
3601
|
+
decline: he.removableOptions.decline
|
|
3574
3602
|
}
|
|
3575
3603
|
};
|
|
3576
3604
|
e.getAttribute("gs-animate") && (s.animate = f.toBool(e.getAttribute("gs-animate"))), this.opts = f.defaults(t, s), t = null, this._initMargin(), this.opts.column !== 1 && !this.opts.disableOneColumnMode && this._widthOrContainer() <= this.opts.oneColumnSize && (this._prevColumn = this.getColumn(), this.opts.column = 1), this.opts.rtl === "auto" && (this.opts.rtl = e.style.direction === "rtl"), this.opts.rtl && this.el.classList.add("grid-stack-rtl");
|
|
3577
3605
|
const r = (u = this.el.parentElement) == null ? void 0 : u.parentElement;
|
|
3578
|
-
let l = r != null && r.classList.contains(
|
|
3579
|
-
l && (l.subGrid = this, this.parentGridItem = l, this.el.classList.add("grid-stack-nested"), l.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 !==
|
|
3580
|
-
let n = this.opts.engineClass ||
|
|
3606
|
+
let l = r != null && r.classList.contains(he.itemClass) ? r.gridstackNode : void 0;
|
|
3607
|
+
l && (l.subGrid = this, this.parentGridItem = l, this.el.classList.add("grid-stack-nested"), l.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 !== he.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 = pe), this._styleSheetClass = "gs-id-" + _e._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
3608
|
+
let n = this.opts.engineClass || L.engineClass || _e;
|
|
3581
3609
|
if (this.engine = new n({
|
|
3582
3610
|
column: this.getColumn(),
|
|
3583
3611
|
float: this.opts.float,
|
|
3584
3612
|
maxRow: this.opts.maxRow,
|
|
3585
3613
|
onChange: (h) => {
|
|
3586
3614
|
let p = 0;
|
|
3587
|
-
this.engine.nodes.forEach((
|
|
3588
|
-
p = Math.max(p,
|
|
3589
|
-
}), h.forEach((
|
|
3590
|
-
let m =
|
|
3591
|
-
m && (
|
|
3615
|
+
this.engine.nodes.forEach((d) => {
|
|
3616
|
+
p = Math.max(p, d.y + d.h);
|
|
3617
|
+
}), h.forEach((d) => {
|
|
3618
|
+
let m = d.el;
|
|
3619
|
+
m && (d._removeDOM ? (m && m.remove(), delete d._removeDOM) : this._writePosAttr(m, d));
|
|
3592
3620
|
}), this._updateStyles(!1, p);
|
|
3593
3621
|
}
|
|
3594
3622
|
}), this.opts.auto && (this.batchUpdate(), this.getGridItems().forEach((h) => this._prepareElement(h)), this.batchUpdate(!1)), this.opts.children) {
|
|
3595
3623
|
let h = this.opts.children;
|
|
3596
3624
|
delete this.opts.children, h.length && this.load(h);
|
|
3597
3625
|
}
|
|
3598
|
-
this.setAnimation(this.opts.animate), this._updateStyles(), this.el.classList.add("gs-" + this.opts.column), this.opts.subGridDynamic && !
|
|
3626
|
+
this.setAnimation(this.opts.animate), this._updateStyles(), this.el.classList.add("gs-" + this.opts.column), this.opts.subGridDynamic && !k.pauseDrag && (k.pauseDrag = !0), ((a = this.opts.draggable) == null ? void 0 : a.pause) !== void 0 && (k.pauseDrag = this.opts.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
3599
3627
|
}
|
|
3600
3628
|
/**
|
|
3601
3629
|
* add a new widget and returns it.
|
|
@@ -3623,8 +3651,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3623
3651
|
} else if (arguments.length === 0 || arguments.length === 1 && i(e))
|
|
3624
3652
|
if (r = t = e, r != null && r.el)
|
|
3625
3653
|
s = r.el;
|
|
3626
|
-
else if (
|
|
3627
|
-
s =
|
|
3654
|
+
else if (L.addRemoveCB)
|
|
3655
|
+
s = L.addRemoveCB(this.el, t, !0, !1);
|
|
3628
3656
|
else {
|
|
3629
3657
|
let n = (t == null ? void 0 : t.content) || "", u = document.implementation.createHTMLDocument("");
|
|
3630
3658
|
u.body.innerHTML = `<div class="grid-stack-item ${this.opts.itemClass || ""}"><div class="grid-stack-item-content">${n}</div></div>`, s = u.body.children[0];
|
|
@@ -3647,32 +3675,32 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3647
3675
|
* @returns newly created grid
|
|
3648
3676
|
*/
|
|
3649
3677
|
makeSubGrid(e, t, i, s = !0) {
|
|
3650
|
-
var m,
|
|
3678
|
+
var m, y, S;
|
|
3651
3679
|
let r = e.gridstackNode;
|
|
3652
3680
|
if (r || (r = this.makeWidget(e).gridstackNode), (m = r.subGrid) != null && m.el)
|
|
3653
3681
|
return r.subGrid;
|
|
3654
3682
|
let l, n = this;
|
|
3655
3683
|
for (; n && !l; )
|
|
3656
|
-
l = (
|
|
3684
|
+
l = (y = n.opts) == null ? void 0 : y.subGridOpts, n = (S = n.parentGridItem) == null ? void 0 : S.grid;
|
|
3657
3685
|
t = f.cloneDeep({ ...l || {}, children: void 0, ...t || r.subGridOpts }), r.subGridOpts = t;
|
|
3658
3686
|
let u;
|
|
3659
3687
|
t.column === "auto" && (u = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), t.disableOneColumnMode = !0);
|
|
3660
3688
|
let a = r.el.querySelector(".grid-stack-item-content"), h, p;
|
|
3661
3689
|
if (s) {
|
|
3662
|
-
if (this._removeDD(r.el), p = { ...r, x: 0, y: 0 }, f.removeInternalForSave(p), delete p.subGridOpts, r.content && (p.content = r.content, delete r.content),
|
|
3663
|
-
h =
|
|
3690
|
+
if (this._removeDD(r.el), p = { ...r, x: 0, y: 0 }, f.removeInternalForSave(p), delete p.subGridOpts, r.content && (p.content = r.content, delete r.content), L.addRemoveCB)
|
|
3691
|
+
h = L.addRemoveCB(this.el, p, !0, !1);
|
|
3664
3692
|
else {
|
|
3665
|
-
let
|
|
3666
|
-
|
|
3693
|
+
let I = document.implementation.createHTMLDocument("");
|
|
3694
|
+
I.body.innerHTML = '<div class="grid-stack-item"></div>', h = I.body.children[0], h.appendChild(a), I.body.innerHTML = '<div class="grid-stack-item-content"></div>', a = I.body.children[0], r.el.appendChild(a);
|
|
3667
3695
|
}
|
|
3668
3696
|
this._prepareDragDropByNode(r);
|
|
3669
3697
|
}
|
|
3670
3698
|
if (i) {
|
|
3671
|
-
let
|
|
3672
|
-
|
|
3699
|
+
let I = u ? t.column : r.w, x = r.h + i.h, C = r.el.style;
|
|
3700
|
+
C.transition = "none", this.update(r.el, { w: I, h: x }), setTimeout(() => C.transition = null);
|
|
3673
3701
|
}
|
|
3674
|
-
let
|
|
3675
|
-
return i != null && i._moving && (
|
|
3702
|
+
let d = r.subGrid = L.addGrid(a, t);
|
|
3703
|
+
return i != null && i._moving && (d._isTemp = !0), u && (d._autoColumn = !0), s && d.addWidget(h, p), i && (i._moving ? window.setTimeout(() => f.simulateMouseEvent(i._event, "mouseenter", d.el), 0) : d.addWidget(r.el, r)), d;
|
|
3676
3704
|
}
|
|
3677
3705
|
/**
|
|
3678
3706
|
* called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
|
|
@@ -3694,7 +3722,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3694
3722
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
3695
3723
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
3696
3724
|
*/
|
|
3697
|
-
save(e = !0, t = !1, i =
|
|
3725
|
+
save(e = !0, t = !1, i = L.saveCB) {
|
|
3698
3726
|
let s = this.engine.save(e, i);
|
|
3699
3727
|
if (s.forEach((r) => {
|
|
3700
3728
|
var l;
|
|
@@ -3710,7 +3738,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3710
3738
|
let r = f.cloneDeep(this.opts);
|
|
3711
3739
|
r.marginBottom === r.marginTop && r.marginRight === r.marginLeft && r.marginTop === r.marginRight && (r.margin = r.marginTop, delete r.marginTop, delete r.marginRight, delete r.marginBottom, delete r.marginLeft), r.rtl === (this.el.style.direction === "rtl") && (r.rtl = "auto"), this._isAutoCellHeight && (r.cellHeight = "auto"), this._autoColumn && (r.column = "auto", delete r.disableOneColumnMode);
|
|
3712
3740
|
const l = r._alwaysShowResizeHandle;
|
|
3713
|
-
return delete r._alwaysShowResizeHandle, l !== void 0 ? r.alwaysShowResizeHandle = l : delete r.alwaysShowResizeHandle, f.removeInternalAndSame(r,
|
|
3741
|
+
return delete r._alwaysShowResizeHandle, l !== void 0 ? r.alwaysShowResizeHandle = l : delete r.alwaysShowResizeHandle, f.removeInternalAndSame(r, he), r.children = s, r;
|
|
3714
3742
|
}
|
|
3715
3743
|
return s;
|
|
3716
3744
|
}
|
|
@@ -3724,19 +3752,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3724
3752
|
* @example
|
|
3725
3753
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3726
3754
|
*/
|
|
3727
|
-
load(e, t =
|
|
3755
|
+
load(e, t = L.addRemoveCB || !0) {
|
|
3728
3756
|
e = f.cloneDeep(e);
|
|
3729
3757
|
const i = e.some((a) => a.x !== void 0 || a.y !== void 0);
|
|
3730
3758
|
i && (e = f.sort(e, -1, this._prevColumn || this.getColumn())), this._insertNotAppend = i;
|
|
3731
3759
|
const s = this.opts.column;
|
|
3732
3760
|
this._prevColumn && this._prevColumn !== s && e.some((a) => (a.x || 0) + a.w > s) && (this._ignoreLayoutsNodeChange = !0, this.engine.cacheLayout(e, this._prevColumn, !0));
|
|
3733
|
-
const r =
|
|
3734
|
-
typeof t == "function" && (
|
|
3761
|
+
const r = L.addRemoveCB;
|
|
3762
|
+
typeof t == "function" && (L.addRemoveCB = t);
|
|
3735
3763
|
let l = [];
|
|
3736
3764
|
this.batchUpdate(), t && [...this.engine.nodes].forEach((h) => {
|
|
3737
3765
|
if (!h.id)
|
|
3738
3766
|
return;
|
|
3739
|
-
f.find(e, h.id) || (
|
|
3767
|
+
f.find(e, h.id) || (L.addRemoveCB && L.addRemoveCB(this.el, h, !1, !1), l.push(h), this.removeWidget(h.el, !0, !1));
|
|
3740
3768
|
});
|
|
3741
3769
|
let n = [];
|
|
3742
3770
|
this.engine.nodes = this.engine.nodes.filter((a) => f.find(e, a.id) ? (n.push(a), !1) : !0);
|
|
@@ -3746,11 +3774,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3746
3774
|
let h = f.find(n, a.id);
|
|
3747
3775
|
if (h) {
|
|
3748
3776
|
if (f.shouldSizeToContent(h) && (a.h = h.h), this.engine.nodeBoundFix(a), (a.autoPosition || a.x === void 0 || a.y === void 0) && (a.w = a.w || h.w, a.h = a.h || h.h, this.engine.findEmptyPosition(a)), u = u || a.w !== void 0 && a.w !== h.w, this.engine.nodes.push(h), f.samePos(h, a) && this.moveNode(h, { ...a, forceCollide: !0 }), this.update(h.el, a), (p = a.subGridOpts) != null && p.children) {
|
|
3749
|
-
let
|
|
3750
|
-
|
|
3777
|
+
let d = h.el.querySelector(".grid-stack");
|
|
3778
|
+
d && d.gridstack && (d.gridstack.load(a.subGridOpts.children), this._insertNotAppend = !0);
|
|
3751
3779
|
}
|
|
3752
3780
|
} else t && this.addWidget(a);
|
|
3753
|
-
}), this.engine.removedNodes = l, this.doContentResize(u, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ?
|
|
3781
|
+
}), this.engine.removedNodes = l, this.doContentResize(u, !0), this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this._insertNotAppend, r ? L.addRemoveCB = r : delete L.addRemoveCB, this;
|
|
3754
3782
|
}
|
|
3755
3783
|
/**
|
|
3756
3784
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3906,7 +3934,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3906
3934
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3907
3935
|
*/
|
|
3908
3936
|
makeWidget(e, t) {
|
|
3909
|
-
let i =
|
|
3937
|
+
let i = L.getElement(e);
|
|
3910
3938
|
this._prepareElement(i, !0, t);
|
|
3911
3939
|
const s = i.gridstackNode;
|
|
3912
3940
|
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;
|
|
@@ -3948,11 +3976,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3948
3976
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3949
3977
|
*/
|
|
3950
3978
|
removeWidget(e, t = !0, i = !0) {
|
|
3951
|
-
return
|
|
3979
|
+
return L.getElements(e).forEach((s) => {
|
|
3952
3980
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3953
3981
|
return;
|
|
3954
3982
|
let r = s.gridstackNode;
|
|
3955
|
-
r || (r = this.engine.nodes.find((l) => s === l.el)), r && (
|
|
3983
|
+
r || (r = this.engine.nodes.find((l) => s === l.el)), r && (L.addRemoveCB && L.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3956
3984
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this;
|
|
3957
3985
|
}
|
|
3958
3986
|
/**
|
|
@@ -3994,7 +4022,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3994
4022
|
let i = arguments, s = 1;
|
|
3995
4023
|
return t = { x: i[s++], y: i[s++], w: i[s++], h: i[s++] }, this.update(e, t);
|
|
3996
4024
|
}
|
|
3997
|
-
return
|
|
4025
|
+
return L.getElements(e).forEach((i) => {
|
|
3998
4026
|
var h;
|
|
3999
4027
|
let s = i == null ? void 0 : i.gridstackNode;
|
|
4000
4028
|
if (!s)
|
|
@@ -4035,7 +4063,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4035
4063
|
if (!r)
|
|
4036
4064
|
return;
|
|
4037
4065
|
let l = t && i.h ? i.h * r : e.clientHeight, n;
|
|
4038
|
-
if (i.resizeToContentParent && (n = e.querySelector(i.resizeToContentParent)), n || (n = e.querySelector(
|
|
4066
|
+
if (i.resizeToContentParent && (n = e.querySelector(i.resizeToContentParent)), n || (n = e.querySelector(L.resizeToContentParent)), !n)
|
|
4039
4067
|
return;
|
|
4040
4068
|
const u = e.clientHeight - n.clientHeight, a = t && i.h ? i.h * r - u : n.clientHeight;
|
|
4041
4069
|
let h;
|
|
@@ -4044,7 +4072,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4044
4072
|
else {
|
|
4045
4073
|
const m = n.firstElementChild;
|
|
4046
4074
|
if (!m) {
|
|
4047
|
-
console.log(`Error: resizeToContent() '${
|
|
4075
|
+
console.log(`Error: resizeToContent() '${L.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
4048
4076
|
return;
|
|
4049
4077
|
}
|
|
4050
4078
|
h = m.getBoundingClientRect().height || a;
|
|
@@ -4053,12 +4081,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4053
4081
|
return;
|
|
4054
4082
|
l += h - a;
|
|
4055
4083
|
let p = Math.ceil(l / r);
|
|
4056
|
-
const
|
|
4057
|
-
|
|
4084
|
+
const d = Number.isInteger(i.sizeToContent) ? i.sizeToContent : 0;
|
|
4085
|
+
d && p > d && (p = d, e.classList.add("size-to-content-max")), i.minH && p < i.minH ? p = i.minH : i.maxH && p > i.maxH && (p = i.maxH), p !== i.h && (s._ignoreLayoutsNodeChange = !0, s.moveNode(i, { h: p }), delete s._ignoreLayoutsNodeChange);
|
|
4058
4086
|
}
|
|
4059
4087
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
4060
4088
|
resizeToContentCheck(e, t = !1) {
|
|
4061
|
-
|
|
4089
|
+
L.resizeToContentCB ? L.resizeToContentCB(e, t) : this.resizeToContent(e, t);
|
|
4062
4090
|
}
|
|
4063
4091
|
/**
|
|
4064
4092
|
* 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).
|
|
@@ -4136,8 +4164,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4136
4164
|
}), !this._styles)
|
|
4137
4165
|
return this;
|
|
4138
4166
|
this._styles._max = 0, f.addCSSRule(this._styles, r, `height: ${i}${s}`);
|
|
4139
|
-
let n = this.opts.marginTop + this.opts.marginUnit, u = this.opts.marginBottom + this.opts.marginUnit, a = this.opts.marginRight + this.opts.marginUnit, h = this.opts.marginLeft + this.opts.marginUnit, p = `${r} > .grid-stack-item-content`,
|
|
4140
|
-
f.addCSSRule(this._styles, p, `top: ${n}; right: ${a}; bottom: ${u}; left: ${h};`), f.addCSSRule(this._styles,
|
|
4167
|
+
let n = this.opts.marginTop + this.opts.marginUnit, u = this.opts.marginBottom + this.opts.marginUnit, a = this.opts.marginRight + this.opts.marginUnit, h = this.opts.marginLeft + this.opts.marginUnit, p = `${r} > .grid-stack-item-content`, d = `.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;
|
|
4168
|
+
f.addCSSRule(this._styles, p, `top: ${n}; right: ${a}; bottom: ${u}; left: ${h};`), f.addCSSRule(this._styles, d, `top: ${n}; right: ${a}; bottom: ${u}; left: ${h};`), f.addCSSRule(this._styles, `${r} > .ui-resizable-ne`, `right: ${a}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${a}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${a}; bottom: ${u}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${h}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${h}`), f.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${h}; bottom: ${u}`);
|
|
4141
4169
|
}
|
|
4142
4170
|
if (t = t || this._styles._max, t > this._styles._max) {
|
|
4143
4171
|
let l = (n) => i * n + s;
|
|
@@ -4258,7 +4286,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4258
4286
|
}
|
|
4259
4287
|
/** @internal */
|
|
4260
4288
|
static getGridElement(e) {
|
|
4261
|
-
return
|
|
4289
|
+
return L.getElement(e);
|
|
4262
4290
|
}
|
|
4263
4291
|
/** @internal */
|
|
4264
4292
|
static getGridElements(e) {
|
|
@@ -4287,7 +4315,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4287
4315
|
* @param root optional root which defaults to document (for shadow dom pas the parent HTMLDocument)
|
|
4288
4316
|
*/
|
|
4289
4317
|
static setupDragIn(e, t, i = document) {
|
|
4290
|
-
(t == null ? void 0 : t.pause) !== void 0 && (
|
|
4318
|
+
(t == null ? void 0 : t.pause) !== void 0 && (k.pauseDrag = t.pause), t = { ...Cn, ...t || {} };
|
|
4291
4319
|
let s = typeof e == "string" ? f.getElements(e, i) : e;
|
|
4292
4320
|
s.length && (s == null || s.forEach((r) => {
|
|
4293
4321
|
Q.isDraggable(r) || Q.dragIn(r, t);
|
|
@@ -4300,7 +4328,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4300
4328
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
4301
4329
|
*/
|
|
4302
4330
|
movable(e, t) {
|
|
4303
|
-
return this.opts.staticGrid ? this : (
|
|
4331
|
+
return this.opts.staticGrid ? this : (L.getElements(e).forEach((i) => {
|
|
4304
4332
|
let s = i.gridstackNode;
|
|
4305
4333
|
s && (t ? delete s.noMove : s.noMove = !0, this._prepareDragDropByNode(s));
|
|
4306
4334
|
}), this);
|
|
@@ -4311,7 +4339,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4311
4339
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
4312
4340
|
*/
|
|
4313
4341
|
resizable(e, t) {
|
|
4314
|
-
return this.opts.staticGrid ? this : (
|
|
4342
|
+
return this.opts.staticGrid ? this : (L.getElements(e).forEach((i) => {
|
|
4315
4343
|
let s = i.gridstackNode;
|
|
4316
4344
|
s && (t ? delete s.noResize : s.noResize = !0, this._prepareDragDropByNode(s));
|
|
4317
4345
|
}), this);
|
|
@@ -4421,7 +4449,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4421
4449
|
let n = r.gridstackNode;
|
|
4422
4450
|
return n && (!n.grid || n.grid === this) && (this._leave(r, l), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
4423
4451
|
}).on(this.el, "drop", (s, r, l) => {
|
|
4424
|
-
var p,
|
|
4452
|
+
var p, d;
|
|
4425
4453
|
let n = r.gridstackNode;
|
|
4426
4454
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
4427
4455
|
return !1;
|
|
@@ -4435,8 +4463,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4435
4463
|
if (!n || (u && (this.engine.cleanupNode(n), n.grid = this), delete n.grid._isTemp, Q.off(r, "drag"), l !== r ? (l.remove(), r.gridstackNode = a, u && (r = r.cloneNode(!0))) : (r.remove(), this._removeDD(r)), !u))
|
|
4436
4464
|
return !1;
|
|
4437
4465
|
r.gridstackNode = n, n.el = r;
|
|
4438
|
-
let h = (
|
|
4439
|
-
return f.copyPos(n, this._readAttr(this.placeholder)), f.removePositioningStyles(r), this._writeAttr(r, n), r.classList.add(
|
|
4466
|
+
let h = (d = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : d.gridstack;
|
|
4467
|
+
return f.copyPos(n, this._readAttr(this.placeholder)), f.removePositioningStyles(r), this._writeAttr(r, n), r.classList.add(he.itemClass, this.opts.itemClass), this.el.appendChild(r), h && (h.parentGridItem = n, h.opts.styleInHead || h._updateStyles(!0)), this._prepareDragDropByNode(n), this._updateContainerHeight(), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, a && a.grid ? a : void 0, n), !1;
|
|
4440
4468
|
}), this;
|
|
4441
4469
|
}
|
|
4442
4470
|
/** @internal mark item for removal */
|
|
@@ -4470,8 +4498,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4470
4498
|
let p = h.target;
|
|
4471
4499
|
if (!(!p.gridstackNode || p.gridstackNode.grid !== this)) {
|
|
4472
4500
|
if (e.el = p, e._isAboutToRemove) {
|
|
4473
|
-
let
|
|
4474
|
-
|
|
4501
|
+
let d = t.gridstackNode.grid;
|
|
4502
|
+
d._gsEventHandler[h.type] && d._gsEventHandler[h.type](h, p), d.engine.nodes.push(e), d.removeWidget(t, !0, !0);
|
|
4475
4503
|
} else
|
|
4476
4504
|
f.removePositioningStyles(p), e._temporaryRemoved ? (f.copyPos(e, e._orig), this._writePosAttr(p, e), this.engine.addNode(e)) : this._writePosAttr(p, e), this._gsEventHandler[h.type] && this._gsEventHandler[h.type](h, p);
|
|
4477
4505
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), h.type === "resizestop" && (Number.isInteger(e.sizeToContent) && (e.sizeToContent = e.h), this.doContentResize(!1, !0, e));
|
|
@@ -4495,18 +4523,18 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4495
4523
|
}
|
|
4496
4524
|
/** @internal handles actual drag/resize */
|
|
4497
4525
|
_dragOrResize(e, t, i, s, r, l) {
|
|
4498
|
-
let n = { ...s._orig }, u, a = this.opts.marginLeft, h = this.opts.marginRight, p = this.opts.marginTop,
|
|
4499
|
-
if (a = Math.min(a,
|
|
4526
|
+
let n = { ...s._orig }, u, a = this.opts.marginLeft, h = this.opts.marginRight, p = this.opts.marginTop, d = this.opts.marginBottom, m = Math.round(l * 0.1), y = Math.round(r * 0.1);
|
|
4527
|
+
if (a = Math.min(a, y), h = Math.min(h, y), p = Math.min(p, m), d = Math.min(d, m), t.type === "drag") {
|
|
4500
4528
|
if (s._temporaryRemoved)
|
|
4501
4529
|
return;
|
|
4502
|
-
let
|
|
4503
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && f.updateScrollPosition(e, i.position,
|
|
4504
|
-
let
|
|
4505
|
-
n.x = Math.round(
|
|
4530
|
+
let I = i.position.top - s._prevYPix;
|
|
4531
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && f.updateScrollPosition(e, i.position, I);
|
|
4532
|
+
let x = i.position.left + (i.position.left > s._lastUiPosition.left ? -h : a), C = i.position.top + (i.position.top > s._lastUiPosition.top ? -d : p);
|
|
4533
|
+
n.x = Math.round(x / r), n.y = Math.round(C / l);
|
|
4506
4534
|
let A = this._extraDragRow;
|
|
4507
4535
|
if (this.engine.collide(s, n)) {
|
|
4508
|
-
let
|
|
4509
|
-
this.opts.maxRow &&
|
|
4536
|
+
let E = this.getRow(), H = Math.max(0, n.y + s.h - E);
|
|
4537
|
+
this.opts.maxRow && E + H > this.opts.maxRow && (H = Math.max(0, this.opts.maxRow - E)), this._extraDragRow = H;
|
|
4510
4538
|
} else
|
|
4511
4539
|
this._extraDragRow = 0;
|
|
4512
4540
|
if (this._extraDragRow !== A && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
@@ -4514,20 +4542,20 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4514
4542
|
} else if (t.type === "resize") {
|
|
4515
4543
|
if (n.x < 0 || (f.updateScrollResize(t, e, l), n.w = Math.round((i.size.width - a) / r), n.h = Math.round((i.size.height - p) / l), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
4516
4544
|
return;
|
|
4517
|
-
let
|
|
4518
|
-
n.x = Math.round(
|
|
4545
|
+
let I = i.position.left + a, x = i.position.top + p;
|
|
4546
|
+
n.x = Math.round(I / r), n.y = Math.round(x / l), u = !0;
|
|
4519
4547
|
}
|
|
4520
4548
|
s._event = t, s._lastTried = n;
|
|
4521
|
-
let
|
|
4549
|
+
let S = {
|
|
4522
4550
|
x: i.position.left + a,
|
|
4523
4551
|
y: i.position.top + p,
|
|
4524
4552
|
w: (i.size ? i.size.width : s.w * r) - a - h,
|
|
4525
|
-
h: (i.size ? i.size.height : s.h * l) - p -
|
|
4553
|
+
h: (i.size ? i.size.height : s.h * l) - p - d
|
|
4526
4554
|
};
|
|
4527
|
-
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: l, rect:
|
|
4528
|
-
s._lastUiPosition = i.position, this.engine.cacheRects(r, l, p, h,
|
|
4529
|
-
let
|
|
4530
|
-
this._writePosAttr(
|
|
4555
|
+
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: l, rect: S, resizing: u })) {
|
|
4556
|
+
s._lastUiPosition = i.position, this.engine.cacheRects(r, l, p, h, d, a), delete s._skipDown, u && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4557
|
+
let I = t.target;
|
|
4558
|
+
this._writePosAttr(I, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, I);
|
|
4531
4559
|
}
|
|
4532
4560
|
}
|
|
4533
4561
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4540,43 +4568,43 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4540
4568
|
}
|
|
4541
4569
|
// legacy method removed
|
|
4542
4570
|
commit() {
|
|
4543
|
-
return
|
|
4571
|
+
return Sn(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4544
4572
|
}
|
|
4545
4573
|
}
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
const
|
|
4574
|
+
L.resizeToContentParent = ".grid-stack-item-content";
|
|
4575
|
+
L.Utils = f;
|
|
4576
|
+
L.Engine = _e;
|
|
4577
|
+
L.GDRev = "9.5.1";
|
|
4578
|
+
const zn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, Nn = { class: "color-primary" }, Mn = { class: "color-secondary" }, In = {
|
|
4551
4579
|
key: 1,
|
|
4552
4580
|
class: "empty"
|
|
4553
|
-
},
|
|
4581
|
+
}, Hn = {
|
|
4554
4582
|
key: 0,
|
|
4555
4583
|
class: "clear-filter-div"
|
|
4556
|
-
},
|
|
4584
|
+
}, On = /* @__PURE__ */ ce({
|
|
4557
4585
|
__name: "Filter",
|
|
4558
4586
|
props: {
|
|
4559
4587
|
order: {}
|
|
4560
4588
|
},
|
|
4561
4589
|
setup(o) {
|
|
4562
|
-
const e = o, t = rt(), i =
|
|
4590
|
+
const e = o, t = rt(), i = ve(() => ({ ...t.Filters })), s = ve(() => ({ ...t.displayFilters })), r = ve(() => {
|
|
4563
4591
|
const h = i.value;
|
|
4564
4592
|
return Object.keys(h).map((p) => ({ key: p, value: h[p] })).filter(({ value: p }) => !(p == null || typeof p == "string" && p.trim() === "" || Array.isArray(p) && p.length === 0));
|
|
4565
|
-
}), l =
|
|
4593
|
+
}), l = ve(() => {
|
|
4566
4594
|
var p;
|
|
4567
|
-
const h = r.value.filter((
|
|
4595
|
+
const h = r.value.filter((d) => s.value.hasOwnProperty(d.key) && s.value[d.key]);
|
|
4568
4596
|
if ((p = e.order) != null && p.length) {
|
|
4569
|
-
const
|
|
4570
|
-
h.sort((m,
|
|
4571
|
-
const
|
|
4572
|
-
return
|
|
4597
|
+
const d = new Map(e.order.map((m, y) => [m, y]));
|
|
4598
|
+
h.sort((m, y) => {
|
|
4599
|
+
const S = d.has(m.key) ? d.get(m.key) : Number.MAX_SAFE_INTEGER, I = d.has(y.key) ? d.get(y.key) : Number.MAX_SAFE_INTEGER;
|
|
4600
|
+
return S - I || m.key.localeCompare(y.key);
|
|
4573
4601
|
});
|
|
4574
4602
|
} else
|
|
4575
|
-
h.sort((
|
|
4603
|
+
h.sort((d, m) => d.key.localeCompare(m.key));
|
|
4576
4604
|
return h;
|
|
4577
4605
|
});
|
|
4578
4606
|
function n(h) {
|
|
4579
|
-
return Array.isArray(h) ?
|
|
4607
|
+
return Array.isArray(h) ? qs(h).map((d) => d && typeof d == "object" ? d.name ?? JSON.stringify(d).replace(/[{}"]/g, "") : String(d ?? "")).join(", ") : h && typeof h == "object" ? JSON.stringify(h).replace(/[{}"]/g, "") : String(h ?? "");
|
|
4580
4608
|
}
|
|
4581
4609
|
function u(h) {
|
|
4582
4610
|
const p = t;
|
|
@@ -4586,41 +4614,41 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4586
4614
|
t.resetFilters({});
|
|
4587
4615
|
}
|
|
4588
4616
|
return (h, p) => {
|
|
4589
|
-
const
|
|
4590
|
-
return
|
|
4617
|
+
const d = re("el-icon"), m = re("el-row");
|
|
4618
|
+
return T(), te(m, {
|
|
4591
4619
|
class: "filter-wrapper tw-m-1",
|
|
4592
4620
|
align: "middle",
|
|
4593
4621
|
justify: "space-between"
|
|
4594
4622
|
}, {
|
|
4595
|
-
default:
|
|
4596
|
-
N("div",
|
|
4597
|
-
l.value.length ? (
|
|
4623
|
+
default: G(() => [
|
|
4624
|
+
N("div", zn, [
|
|
4625
|
+
l.value.length ? (T(!0), B(Le, { key: 0 }, tt(l.value, (y) => (T(), te(ie(Qs), {
|
|
4598
4626
|
class: "color-background",
|
|
4599
|
-
key:
|
|
4627
|
+
key: y.key,
|
|
4600
4628
|
closable: "",
|
|
4601
|
-
onClose: (
|
|
4629
|
+
onClose: (S) => u(y.key),
|
|
4602
4630
|
effect: "dark",
|
|
4603
4631
|
type: "info"
|
|
4604
4632
|
}, {
|
|
4605
|
-
default:
|
|
4606
|
-
N("b",
|
|
4607
|
-
N("span",
|
|
4633
|
+
default: G(() => [
|
|
4634
|
+
N("b", Nn, Re(y.key) + ": ", 1),
|
|
4635
|
+
N("span", Mn, Re(n(y.value)), 1)
|
|
4608
4636
|
]),
|
|
4609
4637
|
_: 2
|
|
4610
|
-
}, 1032, ["onClose"]))), 128)) : (
|
|
4638
|
+
}, 1032, ["onClose"]))), 128)) : (T(), B("span", In))
|
|
4611
4639
|
]),
|
|
4612
|
-
l.value.length ? (
|
|
4613
|
-
|
|
4640
|
+
l.value.length ? (T(), B("div", Hn, [
|
|
4641
|
+
q(ie(ei), {
|
|
4614
4642
|
placement: "top-start",
|
|
4615
4643
|
content: "Clear All Filters"
|
|
4616
4644
|
}, {
|
|
4617
|
-
default:
|
|
4618
|
-
|
|
4645
|
+
default: G(() => [
|
|
4646
|
+
q(d, {
|
|
4619
4647
|
color: "#FFFF",
|
|
4620
4648
|
onClick: a
|
|
4621
4649
|
}, {
|
|
4622
|
-
default:
|
|
4623
|
-
|
|
4650
|
+
default: G(() => [
|
|
4651
|
+
q(ie(er))
|
|
4624
4652
|
]),
|
|
4625
4653
|
_: 1
|
|
4626
4654
|
})
|
|
@@ -4633,13 +4661,13 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4633
4661
|
});
|
|
4634
4662
|
};
|
|
4635
4663
|
}
|
|
4636
|
-
}),
|
|
4664
|
+
}), Pn = /* @__PURE__ */ Ne(On, [["__scopeId", "data-v-55b985b8"]]), $n = {
|
|
4637
4665
|
key: 0,
|
|
4638
4666
|
class: "content-header dash-header-visible stick-to-top tw-flex tw-flex-row tw-items-center tw-justify-between tw-h-10"
|
|
4639
|
-
},
|
|
4667
|
+
}, Bn = { class: "editing-div" }, Un = { class: "tw-m-4 tw-leading-none tw-pl-1 widget-name" }, Fn = { class: "header-slot-icon" }, Wn = {
|
|
4640
4668
|
key: 1,
|
|
4641
4669
|
class: "dash-header-hide content-header"
|
|
4642
|
-
},
|
|
4670
|
+
}, Gn = { class: "header-slot-icon" }, Vn = {
|
|
4643
4671
|
__name: "DashHeader",
|
|
4644
4672
|
props: {
|
|
4645
4673
|
widgetName: {
|
|
@@ -4655,7 +4683,7 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4655
4683
|
},
|
|
4656
4684
|
setup(o) {
|
|
4657
4685
|
const e = rt(), t = o, i = F(null);
|
|
4658
|
-
|
|
4686
|
+
fe(() => t.widgetName, (u) => {
|
|
4659
4687
|
i.value = u;
|
|
4660
4688
|
}, { immediate: !0 });
|
|
4661
4689
|
const s = F(!1), r = F(null);
|
|
@@ -4670,33 +4698,33 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4670
4698
|
u.componentName = i;
|
|
4671
4699
|
}
|
|
4672
4700
|
return (u, a) => {
|
|
4673
|
-
const h =
|
|
4674
|
-
return o.hideHeader ? (
|
|
4675
|
-
N("div",
|
|
4676
|
-
|
|
4701
|
+
const h = re("el-input"), p = as("click-out");
|
|
4702
|
+
return o.hideHeader ? (T(), B("div", Wn, [
|
|
4703
|
+
N("div", Gn, [
|
|
4704
|
+
bt(u.$slots, "default", {}, void 0, !0)
|
|
4677
4705
|
])
|
|
4678
|
-
])) : (
|
|
4706
|
+
])) : (T(), B("div", $n, [
|
|
4679
4707
|
N("div", null, [
|
|
4680
|
-
De((
|
|
4681
|
-
onKeyup:
|
|
4708
|
+
De((T(), B("div", {
|
|
4709
|
+
onKeyup: hs(n, ["enter"]),
|
|
4682
4710
|
class: "tw-flex"
|
|
4683
4711
|
}, [
|
|
4684
|
-
De(N("div",
|
|
4685
|
-
|
|
4686
|
-
onFocus: a[0] || (a[0] = (
|
|
4712
|
+
De(N("div", Bn, [
|
|
4713
|
+
q(h, {
|
|
4714
|
+
onFocus: a[0] || (a[0] = (d) => d.target.select()),
|
|
4687
4715
|
ref_key: "textUserInput",
|
|
4688
4716
|
ref: r,
|
|
4689
4717
|
modelValue: i.value,
|
|
4690
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
4718
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => i.value = d)
|
|
4691
4719
|
}, null, 8, ["modelValue"])
|
|
4692
4720
|
], 512), [
|
|
4693
4721
|
[xt, s.value]
|
|
4694
4722
|
]),
|
|
4695
4723
|
De(N("div", {
|
|
4696
|
-
onClick: a[2] || (a[2] = (
|
|
4724
|
+
onClick: a[2] || (a[2] = (d) => l()),
|
|
4697
4725
|
class: "visible-div"
|
|
4698
4726
|
}, [
|
|
4699
|
-
N("div",
|
|
4727
|
+
N("div", Un, Re(i.value), 1)
|
|
4700
4728
|
], 512), [
|
|
4701
4729
|
[xt, !s.value]
|
|
4702
4730
|
])
|
|
@@ -4704,67 +4732,81 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4704
4732
|
[p, n]
|
|
4705
4733
|
])
|
|
4706
4734
|
]),
|
|
4707
|
-
N("div",
|
|
4708
|
-
|
|
4735
|
+
N("div", Fn, [
|
|
4736
|
+
bt(u.$slots, "default", {}, void 0, !0)
|
|
4709
4737
|
])
|
|
4710
4738
|
]));
|
|
4711
4739
|
};
|
|
4712
4740
|
}
|
|
4713
|
-
},
|
|
4741
|
+
}, qn = /* @__PURE__ */ Ne(Vn, [["__scopeId", "data-v-4f4aa869"]]), jn = { class: "tw-flex" }, Yn = {
|
|
4714
4742
|
__name: "WidgetWrapper",
|
|
4715
4743
|
props: {
|
|
4716
|
-
widgetID: {
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
},
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
},
|
|
4724
|
-
componentTag: {
|
|
4725
|
-
required: !0
|
|
4726
|
-
},
|
|
4727
|
-
componentProperties: {
|
|
4728
|
-
type: Object
|
|
4729
|
-
},
|
|
4730
|
-
componentName: {
|
|
4731
|
-
type: String
|
|
4732
|
-
},
|
|
4733
|
-
//refactor to make hideHeader populated by getDashItem
|
|
4734
|
-
hideWidgetsHeader: {
|
|
4735
|
-
type: Boolean
|
|
4736
|
-
},
|
|
4737
|
-
isLocked: {
|
|
4738
|
-
type: Boolean,
|
|
4739
|
-
default: !1
|
|
4740
|
-
}
|
|
4744
|
+
widgetID: { type: String, required: !0 },
|
|
4745
|
+
staticMode: { type: Boolean, required: !0 },
|
|
4746
|
+
componentTag: { required: !0 },
|
|
4747
|
+
componentProperties: { type: Object },
|
|
4748
|
+
componentName: { type: String },
|
|
4749
|
+
hideWidgetsHeader: { type: Boolean },
|
|
4750
|
+
isLocked: { type: Boolean, default: !1 }
|
|
4741
4751
|
},
|
|
4742
4752
|
emits: ["removeWidget", "toggle-lock"],
|
|
4743
4753
|
setup(o, { emit: e }) {
|
|
4744
|
-
const t = e, i = o;
|
|
4745
|
-
|
|
4746
|
-
const r = F(!1);
|
|
4747
|
-
pe(() => i.isLocked, (u) => {
|
|
4748
|
-
r.value = u;
|
|
4749
|
-
}, { immediate: !0 });
|
|
4754
|
+
const t = e, i = o, s = F(null), r = F(!1);
|
|
4755
|
+
fe(() => i.isLocked, (x) => r.value = x, { immediate: !0 });
|
|
4750
4756
|
const l = F(null);
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4757
|
+
fe(() => i.hideWidgetsHeader, (x) => l.value = x, { immediate: !0 });
|
|
4758
|
+
const n = F(!1), u = F(!1), a = () => document.fullscreenElement === s.value;
|
|
4759
|
+
async function h() {
|
|
4760
|
+
const x = s.value;
|
|
4761
|
+
if (x) {
|
|
4762
|
+
if (x.requestFullscreen)
|
|
4763
|
+
try {
|
|
4764
|
+
await x.requestFullscreen(), u.value = !0, n.value = !0;
|
|
4765
|
+
return;
|
|
4766
|
+
} catch {
|
|
4767
|
+
}
|
|
4768
|
+
u.value = !1, n.value = !0, S(!0);
|
|
4769
|
+
}
|
|
4759
4770
|
}
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4771
|
+
async function p() {
|
|
4772
|
+
if (document.fullscreenElement && a() && document.exitFullscreen) {
|
|
4773
|
+
try {
|
|
4774
|
+
await document.exitFullscreen();
|
|
4775
|
+
} catch {
|
|
4776
|
+
u.value = !1, n.value = !1, S(!1);
|
|
4777
|
+
}
|
|
4778
|
+
return;
|
|
4779
|
+
}
|
|
4780
|
+
u.value = !1, n.value = !1, S(!1);
|
|
4781
|
+
}
|
|
4782
|
+
function d() {
|
|
4783
|
+
n.value ? p() : h();
|
|
4784
|
+
}
|
|
4785
|
+
function m() {
|
|
4786
|
+
t("toggle-lock", { id: i.widgetID, isLocked: r.value });
|
|
4787
|
+
}
|
|
4788
|
+
let y = "";
|
|
4789
|
+
function S(x) {
|
|
4790
|
+
x ? (y = document.body.style.overflow || "", document.body.style.overflow = "hidden") : document.body.style.overflow = y;
|
|
4791
|
+
}
|
|
4792
|
+
function I() {
|
|
4793
|
+
u.value = !!document.fullscreenElement, u.value ? (n.value = a(), n.value || S(!1)) : (n.value = !1, S(!1));
|
|
4794
|
+
}
|
|
4795
|
+
return us(() => {
|
|
4796
|
+
document.addEventListener("fullscreenchange", I);
|
|
4797
|
+
}), cs(() => {
|
|
4798
|
+
document.removeEventListener("fullscreenchange", I), S(!1);
|
|
4799
|
+
}), (x, C) => {
|
|
4800
|
+
const A = re("el-icon");
|
|
4801
|
+
return T(), B("div", {
|
|
4763
4802
|
ref_key: "instance",
|
|
4764
4803
|
ref: s,
|
|
4765
|
-
class:
|
|
4804
|
+
class: js(["grid-stack-item-content", {
|
|
4805
|
+
"locked-widget": o.isLocked,
|
|
4806
|
+
"gs-fullscreen": n.value && !u.value
|
|
4807
|
+
}])
|
|
4766
4808
|
}, [
|
|
4767
|
-
(
|
|
4809
|
+
(T(), te(Wi(o.componentTag), oi({
|
|
4768
4810
|
class: ["widget-body", { "widget-body-no-head": l.value }],
|
|
4769
4811
|
widgetID: o.widgetID,
|
|
4770
4812
|
hideHeader: l.value
|
|
@@ -4772,44 +4814,61 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4772
4814
|
style: { pointerEvents: r.value ? "none" : "auto" },
|
|
4773
4815
|
isLocked: r.value
|
|
4774
4816
|
}), {
|
|
4775
|
-
default:
|
|
4776
|
-
|
|
4817
|
+
default: G((E) => [
|
|
4818
|
+
E ? (T(), te(qn, {
|
|
4777
4819
|
key: 0,
|
|
4778
4820
|
widgetName: i.componentName,
|
|
4779
4821
|
widgetID: o.widgetID,
|
|
4780
4822
|
staticMode: o.staticMode,
|
|
4781
4823
|
hideHeader: l.value
|
|
4782
4824
|
}, {
|
|
4783
|
-
default:
|
|
4784
|
-
N("div",
|
|
4785
|
-
(
|
|
4786
|
-
content:
|
|
4787
|
-
|
|
4825
|
+
default: G(() => [
|
|
4826
|
+
N("div", jn, [
|
|
4827
|
+
(T(!0), B(Le, null, tt(E.childIcons, (H) => (T(), te(ie(ei), { placement: "bottom-start" }, {
|
|
4828
|
+
content: G(() => [
|
|
4829
|
+
Se(Re(H.tooltip), 1)
|
|
4788
4830
|
]),
|
|
4789
|
-
default:
|
|
4790
|
-
(
|
|
4831
|
+
default: G(() => [
|
|
4832
|
+
(T(), te(Wi(H.comp), {
|
|
4791
4833
|
class: "tw-w-4 header-icon",
|
|
4792
|
-
onClick:
|
|
4834
|
+
onClick: H.event
|
|
4793
4835
|
}, null, 8, ["onClick"]))
|
|
4794
4836
|
]),
|
|
4795
4837
|
_: 2
|
|
4796
4838
|
}, 1024))), 256)),
|
|
4797
|
-
|
|
4839
|
+
q(ie(ei), { placement: "bottom-start" }, {
|
|
4840
|
+
content: G(() => [
|
|
4841
|
+
Se(Re(n.value ? "Exit Fullscreen" : "Fullscreen"), 1)
|
|
4842
|
+
]),
|
|
4843
|
+
default: G(() => [
|
|
4844
|
+
q(A, {
|
|
4845
|
+
class: "header-icon",
|
|
4846
|
+
onClick: d
|
|
4847
|
+
}, {
|
|
4848
|
+
default: G(() => [
|
|
4849
|
+
n.value ? (T(), te(ie(hr), { key: 0 })) : (T(), te(ie(nr), { key: 1 }))
|
|
4850
|
+
]),
|
|
4851
|
+
_: 1
|
|
4852
|
+
})
|
|
4853
|
+
]),
|
|
4854
|
+
_: 1
|
|
4855
|
+
}),
|
|
4856
|
+
q(A, {
|
|
4798
4857
|
class: "header-icon lock-toggle",
|
|
4799
|
-
onClick:
|
|
4858
|
+
onClick: C[0] || (C[0] = (H) => m())
|
|
4800
4859
|
}, {
|
|
4801
|
-
default:
|
|
4802
|
-
r.value ? (
|
|
4860
|
+
default: G(() => [
|
|
4861
|
+
r.value ? (T(), te(ie(lr), { key: 0 })) : (T(), te(ie(cr), { key: 1 }))
|
|
4803
4862
|
]),
|
|
4804
4863
|
_: 1
|
|
4805
4864
|
}),
|
|
4806
|
-
!o.staticMode && !o.isLocked ? (
|
|
4865
|
+
!o.staticMode && !o.isLocked ? (T(), te(A, {
|
|
4807
4866
|
key: 0,
|
|
4808
4867
|
class: "item-widget-button",
|
|
4809
|
-
onClick:
|
|
4868
|
+
onClick: C[1] || (C[1] = (H) => x.$emit("removeWidget"))
|
|
4810
4869
|
}, {
|
|
4811
|
-
default:
|
|
4812
|
-
|
|
4870
|
+
default: G(() => [
|
|
4871
|
+
q(ie(ir))
|
|
4813
4872
|
]),
|
|
4814
4873
|
_: 1
|
|
4815
4874
|
})) : kt("", !0)
|
|
@@ -4823,13 +4882,13 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4823
4882
|
], 2);
|
|
4824
4883
|
};
|
|
4825
4884
|
}
|
|
4826
|
-
},
|
|
4885
|
+
}, Xn = /* @__PURE__ */ Ne(Yn, [["__scopeId", "data-v-6b7fdde8"]]), Zn = { class: "dashboard-app" }, Kn = {
|
|
4827
4886
|
key: 0,
|
|
4828
4887
|
class: "dash-header tw-max-h-screen tw-flex tw-flex-col"
|
|
4829
|
-
},
|
|
4888
|
+
}, Qn = { class: "tw-float-left tw-m-1 button" }, Jn = {
|
|
4830
4889
|
key: 1,
|
|
4831
4890
|
class: "tw-h-10 dash-header"
|
|
4832
|
-
},
|
|
4891
|
+
}, eo = { class: "tw-float-left tw-m-1" }, to = { class: "tw-m-4 tw-w-50 tw-flex-row tw-flex" }, io = { class: "tw-m-w-4 tw-w-40" }, so = ["gs-x", "gs-y", "gs-w", "gs-h", "gs-id", "id", "props", "gs-locked", "gs-no-move", "gs-no-resize"], ro = /* @__PURE__ */ ce({
|
|
4833
4892
|
__name: "Dashboard",
|
|
4834
4893
|
props: {
|
|
4835
4894
|
hideHeader: {},
|
|
@@ -4841,25 +4900,25 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4841
4900
|
const l = F(null);
|
|
4842
4901
|
let n = F(!0), u = 0;
|
|
4843
4902
|
const a = F([]), { ComponentRegistry: h } = Jt(t), p = Qt({});
|
|
4844
|
-
|
|
4845
|
-
var
|
|
4846
|
-
|
|
4847
|
-
}),
|
|
4848
|
-
|
|
4849
|
-
}),
|
|
4850
|
-
|
|
4903
|
+
Ys(() => {
|
|
4904
|
+
var v;
|
|
4905
|
+
d(), m(), t.loadFromLocalStorage(), u = ((v = i.value) == null ? void 0 : v.length) + 1;
|
|
4906
|
+
}), us(() => {
|
|
4907
|
+
S(), x();
|
|
4908
|
+
}), cs(() => {
|
|
4909
|
+
I(), t.unregisterGridProvider();
|
|
4851
4910
|
});
|
|
4852
|
-
function
|
|
4853
|
-
var
|
|
4854
|
-
t.DefaultLayout = (
|
|
4911
|
+
function d() {
|
|
4912
|
+
var v, _;
|
|
4913
|
+
t.DefaultLayout = (v = e.options) == null ? void 0 : v.defaultLayout, t.setOptionServices((_ = e.options) == null ? void 0 : _.services);
|
|
4855
4914
|
}
|
|
4856
4915
|
function m() {
|
|
4857
|
-
const
|
|
4858
|
-
apiUrl:
|
|
4916
|
+
const v = {
|
|
4917
|
+
apiUrl: ve(() => {
|
|
4859
4918
|
var _;
|
|
4860
4919
|
return (_ = t.Services) == null ? void 0 : _.ApiUrl;
|
|
4861
4920
|
}),
|
|
4862
|
-
s3Url:
|
|
4921
|
+
s3Url: ve(() => {
|
|
4863
4922
|
var _;
|
|
4864
4923
|
return (_ = t.Services) == null ? void 0 : _.s3Url;
|
|
4865
4924
|
}),
|
|
@@ -4869,24 +4928,24 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4869
4928
|
clearFilter: t.clearFilter,
|
|
4870
4929
|
resetFilters: t.resetFilters
|
|
4871
4930
|
};
|
|
4872
|
-
Xs("dashboard:globalVars",
|
|
4931
|
+
Xs("dashboard:globalVars", v);
|
|
4873
4932
|
}
|
|
4874
|
-
async function
|
|
4875
|
-
if (t.resetGridLayout(), await
|
|
4933
|
+
async function y() {
|
|
4934
|
+
if (t.resetGridLayout(), await Gi(), !!r) {
|
|
4876
4935
|
r.batchUpdate(), r.removeAll();
|
|
4877
|
-
for (const
|
|
4878
|
-
const _ = document.getElementById(
|
|
4936
|
+
for (const v of i.value) {
|
|
4937
|
+
const _ = document.getElementById(v.id);
|
|
4879
4938
|
if (!_) {
|
|
4880
|
-
console.warn("makeWidget: element not found for id",
|
|
4939
|
+
console.warn("makeWidget: element not found for id", v.id);
|
|
4881
4940
|
continue;
|
|
4882
4941
|
}
|
|
4883
|
-
_.classList.add("grid-stack-item"),
|
|
4942
|
+
_.classList.add("grid-stack-item"), v.w != null && _.setAttribute("gs-w", String(v.w)), v.h != null && _.setAttribute("gs-h", String(v.h)), v.x != null && _.setAttribute("gs-x", String(v.x)), v.y != null && _.setAttribute("gs-y", String(v.y)), v.x == null && v.y == null && v.autoPosition && _.setAttribute("gs-auto-position", "true"), !_.gridstackNode && r.makeWidget(_);
|
|
4884
4943
|
}
|
|
4885
4944
|
r.commit();
|
|
4886
4945
|
}
|
|
4887
4946
|
}
|
|
4888
|
-
function
|
|
4889
|
-
const
|
|
4947
|
+
function S() {
|
|
4948
|
+
const v = {
|
|
4890
4949
|
float: !0,
|
|
4891
4950
|
column: 12,
|
|
4892
4951
|
cellHeight: "70px",
|
|
@@ -4897,130 +4956,130 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
4897
4956
|
handles: "e,se,s,sw,w,n"
|
|
4898
4957
|
}
|
|
4899
4958
|
};
|
|
4900
|
-
r =
|
|
4959
|
+
r = L.init(v), t.registerGridProvider(() => r), r.setStatic(n.value);
|
|
4901
4960
|
}
|
|
4902
|
-
function
|
|
4961
|
+
function I() {
|
|
4903
4962
|
r && (r.destroy(!1), r = null);
|
|
4904
4963
|
}
|
|
4905
|
-
|
|
4964
|
+
fe(
|
|
4906
4965
|
() => {
|
|
4907
|
-
var
|
|
4908
|
-
return (
|
|
4966
|
+
var v;
|
|
4967
|
+
return (v = e.options) == null ? void 0 : v.availableWidgets;
|
|
4909
4968
|
},
|
|
4910
|
-
(
|
|
4911
|
-
h.value = {}, a.value = [],
|
|
4912
|
-
let
|
|
4969
|
+
(v) => {
|
|
4970
|
+
h.value = {}, a.value = [], v && v.forEach((_, D) => {
|
|
4971
|
+
let R, j;
|
|
4913
4972
|
if (_ && typeof _ == "object" && "name" in _ && "component" in _)
|
|
4914
|
-
|
|
4973
|
+
R = _.name, j = _.component;
|
|
4915
4974
|
else if (_ && typeof _ == "object" && "name" in _ && "loader" in _)
|
|
4916
|
-
|
|
4917
|
-
const
|
|
4918
|
-
return
|
|
4975
|
+
R = _.name, j = Zs(async () => {
|
|
4976
|
+
const $ = await _.loader();
|
|
4977
|
+
return $.default ?? $;
|
|
4919
4978
|
});
|
|
4920
4979
|
else if (_ && (typeof _ == "function" || typeof _ == "object"))
|
|
4921
|
-
|
|
4980
|
+
j = _, R = _.name || `Widget${D + 1}`;
|
|
4922
4981
|
else if (typeof _ == "function")
|
|
4923
4982
|
return;
|
|
4924
|
-
!
|
|
4983
|
+
!R || !j || h.value[R] || (h.value[R] = j, a.value.push(R));
|
|
4925
4984
|
});
|
|
4926
4985
|
},
|
|
4927
4986
|
{ immediate: !0, deep: !0 }
|
|
4928
4987
|
);
|
|
4929
|
-
function
|
|
4930
|
-
const
|
|
4931
|
-
if (
|
|
4988
|
+
function x() {
|
|
4989
|
+
const v = e.options.globalData;
|
|
4990
|
+
if (v) {
|
|
4932
4991
|
t.clearOptionsDataItems();
|
|
4933
|
-
for (const _ in
|
|
4934
|
-
t.addOptionsDataItems(_,
|
|
4992
|
+
for (const _ in v)
|
|
4993
|
+
t.addOptionsDataItems(_, v[_]);
|
|
4935
4994
|
}
|
|
4936
4995
|
}
|
|
4937
|
-
|
|
4938
|
-
r.setStatic(
|
|
4996
|
+
fe(() => n.value, (v) => {
|
|
4997
|
+
r.setStatic(v), s.value = v ? "Edit Grid" : "Save Grid";
|
|
4939
4998
|
});
|
|
4940
|
-
function
|
|
4941
|
-
if (!
|
|
4999
|
+
function C(v) {
|
|
5000
|
+
if (!v)
|
|
4942
5001
|
return;
|
|
4943
|
-
const _ = `${
|
|
5002
|
+
const _ = `${v}-${u}`, D = {
|
|
4944
5003
|
id: _,
|
|
4945
5004
|
w: 2,
|
|
4946
5005
|
h: 6,
|
|
4947
5006
|
autoPosition: !0,
|
|
4948
|
-
component: h.value[
|
|
4949
|
-
componentKey:
|
|
4950
|
-
componentName:
|
|
5007
|
+
component: h.value[v],
|
|
5008
|
+
componentKey: v,
|
|
5009
|
+
componentName: v,
|
|
4951
5010
|
Props: {}
|
|
4952
5011
|
};
|
|
4953
|
-
u++, i.value.push(
|
|
5012
|
+
u++, i.value.push(D), Gi(() => {
|
|
4954
5013
|
r == null || r.makeWidget(`#${_}`);
|
|
4955
5014
|
});
|
|
4956
5015
|
}
|
|
4957
|
-
function A(
|
|
4958
|
-
var _ = i.value.findIndex((
|
|
5016
|
+
function A(v) {
|
|
5017
|
+
var _ = i.value.findIndex((R) => R.id == v);
|
|
4959
5018
|
i.value.splice(_, 1);
|
|
4960
|
-
const
|
|
4961
|
-
r.removeWidget(
|
|
5019
|
+
const D = `#${v}`;
|
|
5020
|
+
r.removeWidget(D, !1);
|
|
4962
5021
|
}
|
|
4963
|
-
function
|
|
4964
|
-
const
|
|
4965
|
-
|
|
5022
|
+
function E({ id: v, isLocked: _ }) {
|
|
5023
|
+
const D = p[v];
|
|
5024
|
+
D && r && r.update(D, {
|
|
4966
5025
|
locked: !_,
|
|
4967
5026
|
noMove: !_,
|
|
4968
5027
|
noResize: !_
|
|
4969
|
-
}), t.toggleWidgetLock(
|
|
5028
|
+
}), t.toggleWidgetLock(v);
|
|
4970
5029
|
}
|
|
4971
|
-
function
|
|
5030
|
+
function H() {
|
|
4972
5031
|
n.value = !n.value, n.value;
|
|
4973
5032
|
}
|
|
4974
|
-
return (
|
|
4975
|
-
const
|
|
4976
|
-
return
|
|
4977
|
-
|
|
4978
|
-
_[3] || (_[3] =
|
|
4979
|
-
N("span",
|
|
4980
|
-
|
|
5033
|
+
return (v, _) => {
|
|
5034
|
+
const D = re("el-button"), R = re("el-option"), j = re("el-select"), $ = re("el-col");
|
|
5035
|
+
return T(), B("div", Zn, [
|
|
5036
|
+
v.hideHeader ? (T(), B("div", Jn, [
|
|
5037
|
+
_[3] || (_[3] = Se("x ", -1)),
|
|
5038
|
+
N("span", eo, [
|
|
5039
|
+
q(D, {
|
|
4981
5040
|
class: "edit-button",
|
|
4982
|
-
onClick: _[1] || (_[1] = (M) =>
|
|
5041
|
+
onClick: _[1] || (_[1] = (M) => H())
|
|
4983
5042
|
}, {
|
|
4984
|
-
default:
|
|
4985
|
-
|
|
5043
|
+
default: G(() => [
|
|
5044
|
+
Se(Re(ie(s)), 1)
|
|
4986
5045
|
]),
|
|
4987
5046
|
_: 1
|
|
4988
5047
|
})
|
|
4989
5048
|
])
|
|
4990
|
-
])) : (
|
|
4991
|
-
N("span",
|
|
4992
|
-
|
|
5049
|
+
])) : (T(), B("div", Kn, [
|
|
5050
|
+
N("span", Qn, [
|
|
5051
|
+
q(D, {
|
|
4993
5052
|
class: "edit-button",
|
|
4994
|
-
onClick: _[0] || (_[0] = (M) =>
|
|
5053
|
+
onClick: _[0] || (_[0] = (M) => H())
|
|
4995
5054
|
}, {
|
|
4996
|
-
default:
|
|
4997
|
-
|
|
5055
|
+
default: G(() => [
|
|
5056
|
+
Se(Re(ie(s)), 1)
|
|
4998
5057
|
]),
|
|
4999
5058
|
_: 1
|
|
5000
5059
|
})
|
|
5001
5060
|
]),
|
|
5002
|
-
|
|
5061
|
+
q(Pn)
|
|
5003
5062
|
])),
|
|
5004
|
-
|
|
5005
|
-
default:
|
|
5006
|
-
N("div",
|
|
5007
|
-
|
|
5008
|
-
default:
|
|
5009
|
-
(
|
|
5063
|
+
ie(n) ? kt("", !0) : (T(), te($, { key: 2 }, {
|
|
5064
|
+
default: G(() => [
|
|
5065
|
+
N("div", to, [
|
|
5066
|
+
q(j, { placeholder: "Add New Widget" }, {
|
|
5067
|
+
default: G(() => [
|
|
5068
|
+
(T(!0), B(Le, null, tt(a.value, (M) => (T(), te(R, {
|
|
5010
5069
|
key: M,
|
|
5011
5070
|
label: M,
|
|
5012
5071
|
value: M,
|
|
5013
|
-
onClick: (
|
|
5072
|
+
onClick: (Ce) => C(M)
|
|
5014
5073
|
}, null, 8, ["label", "value", "onClick"]))), 128))
|
|
5015
5074
|
]),
|
|
5016
5075
|
_: 1
|
|
5017
5076
|
}),
|
|
5018
|
-
N("div",
|
|
5019
|
-
|
|
5020
|
-
onClick: _[2] || (_[2] = (M) =>
|
|
5077
|
+
N("div", io, [
|
|
5078
|
+
q(D, {
|
|
5079
|
+
onClick: _[2] || (_[2] = (M) => y())
|
|
5021
5080
|
}, {
|
|
5022
|
-
default:
|
|
5023
|
-
|
|
5081
|
+
default: G(() => [..._[4] || (_[4] = [
|
|
5082
|
+
Se("Reset Grid Layout", -1)
|
|
5024
5083
|
])]),
|
|
5025
5084
|
_: 1
|
|
5026
5085
|
})
|
|
@@ -5034,9 +5093,9 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
5034
5093
|
ref: l,
|
|
5035
5094
|
class: "grid-stack tw-h-screen"
|
|
5036
5095
|
}, [
|
|
5037
|
-
(
|
|
5038
|
-
var
|
|
5039
|
-
return
|
|
5096
|
+
(T(!0), B(Le, null, tt(ie(i), (M) => {
|
|
5097
|
+
var Ce, Ie, ot, lt;
|
|
5098
|
+
return T(), B("div", {
|
|
5040
5099
|
class: "grid-stack-item",
|
|
5041
5100
|
ref_for: !0,
|
|
5042
5101
|
ref: (at) => p[M.id] = at,
|
|
@@ -5048,30 +5107,30 @@ const Cn = { class: "tw-flex tw-flex-row tw-flex-wrap tw-gap-2" }, An = { class:
|
|
|
5048
5107
|
id: M.id,
|
|
5049
5108
|
key: M.id,
|
|
5050
5109
|
props: M.Props,
|
|
5051
|
-
"gs-locked": (
|
|
5110
|
+
"gs-locked": (Ce = M.Props) == null ? void 0 : Ce.locked,
|
|
5052
5111
|
"gs-no-move": (Ie = M.Props) == null ? void 0 : Ie.locked,
|
|
5053
5112
|
"gs-no-resize": (ot = M.Props) == null ? void 0 : ot.locked
|
|
5054
5113
|
}, [
|
|
5055
|
-
|
|
5114
|
+
q(Xn, {
|
|
5056
5115
|
widgetID: M.id,
|
|
5057
5116
|
onRemoveWidget: (at) => A(M.id),
|
|
5058
|
-
onToggleLock:
|
|
5059
|
-
"static-mode":
|
|
5117
|
+
onToggleLock: E,
|
|
5118
|
+
"static-mode": ie(n),
|
|
5060
5119
|
componentTag: M.component,
|
|
5061
5120
|
componentProperties: M.Props,
|
|
5062
5121
|
componentName: M.componentName,
|
|
5063
5122
|
hideWidgetsHeader: M.hideHeader,
|
|
5064
5123
|
"is-locked": (lt = M.Props) == null ? void 0 : lt.locked
|
|
5065
5124
|
}, null, 8, ["widgetID", "onRemoveWidget", "static-mode", "componentTag", "componentProperties", "componentName", "hideWidgetsHeader", "is-locked"])
|
|
5066
|
-
], 8,
|
|
5125
|
+
], 8, so);
|
|
5067
5126
|
}), 128))
|
|
5068
5127
|
], 512)
|
|
5069
5128
|
]);
|
|
5070
5129
|
};
|
|
5071
5130
|
}
|
|
5072
|
-
}),
|
|
5131
|
+
}), co = /* @__PURE__ */ Ne(ro, [["__scopeId", "data-v-240ef3ec"]]);
|
|
5073
5132
|
export {
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5133
|
+
uo as MarkdownWidget,
|
|
5134
|
+
co as PennsieveDashboard,
|
|
5135
|
+
ho as TextWidget
|
|
5077
5136
|
};
|