@sit-onyx/mdc 0.3.1 → 0.3.2-dev-20261123100908
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Comment as
|
|
1
|
+
import { c as e, d as t, g as n, h as r, i, n as a, p as o, t as s, u as c } from "./props-D9WqZr0-.js";
|
|
2
|
+
import { Comment as l, Text as u, computed as d, defineAsyncComponent as f, defineComponent as p, getCurrentInstance as m, h, reactive as g, resolveComponent as _, toRaw as v, watch as y } from "vue";
|
|
3
3
|
// ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t)
|
|
4
|
+
var b = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, x = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, ee = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
5
|
+
function S(e, t) {
|
|
6
|
+
if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) te(e);
|
|
7
7
|
else return t;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function te(e) {
|
|
10
10
|
console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function C(e, t = {}) {
|
|
13
13
|
if (typeof e != "string") return e;
|
|
14
14
|
if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
|
|
15
15
|
let n = e.trim();
|
|
@@ -27,9 +27,9 @@ function te(e, t = {}) {
|
|
|
27
27
|
return e;
|
|
28
28
|
}
|
|
29
29
|
try {
|
|
30
|
-
if (
|
|
30
|
+
if (b.test(e) || x.test(e)) {
|
|
31
31
|
if (t.strict) throw Error("[destr] Possible prototype pollution");
|
|
32
|
-
return JSON.parse(e,
|
|
32
|
+
return JSON.parse(e, S);
|
|
33
33
|
}
|
|
34
34
|
return JSON.parse(e);
|
|
35
35
|
} catch (n) {
|
|
@@ -37,23 +37,23 @@ function te(e, t = {}) {
|
|
|
37
37
|
return e;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
// ../../node_modules/.pnpm/@nuxtjs+mdc@0.23.
|
|
41
|
-
function
|
|
40
|
+
// ../../node_modules/.pnpm/@nuxtjs+mdc@0.23.4_@nuxt+schema@4.6.4_confbox@0.3.2_dotenv@17.4.2_giget@3.3.1_jiti@2.7._8aa46dd70d56c1a2fed2f05572323d85/node_modules/@nuxtjs/mdc/dist/runtime/utils/index.js
|
|
41
|
+
function w(e, t) {
|
|
42
42
|
return t.reduce((t, n) => {
|
|
43
|
-
let r =
|
|
43
|
+
let r = T(e, n);
|
|
44
44
|
return r !== void 0 && (t[n] = r), t;
|
|
45
45
|
}, {});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function T(e, t) {
|
|
48
48
|
return t.split(".").reduce((e, t) => e && e[t], e);
|
|
49
49
|
}
|
|
50
|
-
// ../../node_modules/.pnpm/@nuxtjs+mdc@0.23.
|
|
51
|
-
var
|
|
50
|
+
// ../../node_modules/.pnpm/@nuxtjs+mdc@0.23.4_@nuxt+schema@4.6.4_confbox@0.3.2_dotenv@17.4.2_giget@3.3.1_jiti@2.7._8aa46dd70d56c1a2fed2f05572323d85/node_modules/@nuxtjs/mdc/dist/runtime/components/MDCRenderer.vue
|
|
51
|
+
var E = "default", D = /^@|^v-on:/, O = /^:|^v-bind:/, k = /^v-model/, A = [
|
|
52
52
|
"select",
|
|
53
53
|
"textarea",
|
|
54
54
|
"input"
|
|
55
|
-
],
|
|
56
|
-
...
|
|
55
|
+
], j = /* @__PURE__ */ new Set(["math", "svg"]), M = /* @__PURE__ */ new Set(), N = Object.fromEntries((/* @__PURE__ */ "p.a.blockquote.code.pre.code.em.h1.h2.h3.h4.h5.h6.hr.img.ul.ol.li.strong.table.thead.tbody.td.th.tr.script".split(".")).map((e) => [e, `prose-${e}`])), P = ["script", "base"], F = /* @__PURE__ */ new Set([
|
|
56
|
+
...P,
|
|
57
57
|
"iframe",
|
|
58
58
|
"frame",
|
|
59
59
|
"frameset",
|
|
@@ -62,7 +62,7 @@ var T = "default", E = /^@|^v-on:/, D = /^:|^v-bind:/, O = /^v-model/, k = [
|
|
|
62
62
|
"style",
|
|
63
63
|
"link",
|
|
64
64
|
"meta"
|
|
65
|
-
]),
|
|
65
|
+
]), I = /^[a-z][\w-]*$/i, L = p({
|
|
66
66
|
name: "MDCRenderer",
|
|
67
67
|
props: {
|
|
68
68
|
body: {
|
|
@@ -95,33 +95,33 @@ var T = "default", E = /^@|^v-on:/, D = /^:|^v-bind:/, O = /^v-model/, k = [
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
async setup(e) {
|
|
98
|
-
let t =
|
|
99
|
-
i && i.forEach((e) =>
|
|
100
|
-
let
|
|
101
|
-
...r?.components?.prose && e.prose !== !1 ?
|
|
98
|
+
let t = m()?.appContext?.app?.$nuxt, n = t?.$route || t?._route, { mdc: r } = t?.$config?.public || {}, i = r?.components?.customElements || r?.components?.custom;
|
|
99
|
+
i && i.forEach((e) => M.add(e));
|
|
100
|
+
let o = d(() => ({
|
|
101
|
+
...r?.components?.prose && e.prose !== !1 ? N : {},
|
|
102
102
|
...r?.components?.map || {},
|
|
103
|
-
...
|
|
103
|
+
...Object.fromEntries(Object.entries(v(e.data?.mdc?.components || {})).filter(([, e]) => typeof e == "string")),
|
|
104
104
|
...e.components
|
|
105
|
-
})), s =
|
|
105
|
+
})), s = d(() => {
|
|
106
106
|
let t = (e.body?.children || []).map((e) => e.tag || e.type).filter((e) => !$(e));
|
|
107
107
|
return Array.from(new Set(t)).sort().join(".");
|
|
108
|
-
}), c =
|
|
109
|
-
|
|
108
|
+
}), c = g({ ...e.data });
|
|
109
|
+
y(() => e.data, (e) => {
|
|
110
110
|
Object.assign(c, e);
|
|
111
|
-
}), await
|
|
111
|
+
}), await ne(e.body, { tags: o.value });
|
|
112
112
|
function l(e, t) {
|
|
113
113
|
let n = e.split(".").length - 1;
|
|
114
114
|
return e.split(".").reduce((e, r, i) => i == n && e ? (e[r] = t, e[r]) : typeof e == "object" ? e[r] : void 0, c);
|
|
115
115
|
}
|
|
116
116
|
return {
|
|
117
|
-
tags:
|
|
117
|
+
tags: o,
|
|
118
118
|
contentKey: s,
|
|
119
119
|
route: n,
|
|
120
120
|
runtimeData: c,
|
|
121
121
|
updateRuntimeData: l,
|
|
122
|
-
root:
|
|
122
|
+
root: d(() => {
|
|
123
123
|
let t = e.data?.component, n = e.tag || t?.name || t || "div", r = t?.props;
|
|
124
|
-
return !e.tag && t && (typeof n
|
|
124
|
+
return !e.tag && t && ((typeof n != "string" || !I.test(n) || F.has(n.toLowerCase())) && (n = "div"), r &&= a(n, r)), {
|
|
125
125
|
tag: n,
|
|
126
126
|
props: r
|
|
127
127
|
};
|
|
@@ -137,35 +137,37 @@ var T = "default", E = /^@|^v-on:/, D = /^:|^v-bind:/, O = /^v-model/, k = [
|
|
|
137
137
|
$route: s,
|
|
138
138
|
runtimeData: l,
|
|
139
139
|
updateRuntimeData: u
|
|
140
|
-
}, { tag: f, props: p } = e.root,
|
|
141
|
-
return
|
|
140
|
+
}, { tag: f, props: p } = e.root, m = n === !1 ? void 0 : K(f);
|
|
141
|
+
return m ? h(m, {
|
|
142
142
|
...p,
|
|
143
143
|
class: e.class,
|
|
144
144
|
...this.$attrs,
|
|
145
145
|
key: o
|
|
146
146
|
}, { default: g }) : g?.();
|
|
147
147
|
function g() {
|
|
148
|
-
let e =
|
|
148
|
+
let e = z(r, h, {
|
|
149
149
|
documentMeta: d,
|
|
150
150
|
parentScope: d,
|
|
151
|
-
resolveComponent:
|
|
151
|
+
resolveComponent: K
|
|
152
152
|
});
|
|
153
153
|
return e?.default ? c ? i(e.default(), typeof c == "string" ? c.split(" ") : ["*"]) : e.default() : null;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
function
|
|
158
|
-
let { documentMeta: o, parentScope: s, resolveComponent:
|
|
159
|
-
if (
|
|
160
|
-
if (
|
|
161
|
-
let d =
|
|
162
|
-
if (
|
|
163
|
-
let
|
|
164
|
-
if (
|
|
157
|
+
function R(t, r, i, a) {
|
|
158
|
+
let { documentMeta: o, parentScope: s, resolveComponent: c } = i;
|
|
159
|
+
if (t.type === "text") return r(u, t.value);
|
|
160
|
+
if (t.type === "comment") return r(l, null, t.value);
|
|
161
|
+
let d = t.tag;
|
|
162
|
+
if (typeof d != "string") return r(l, null, "invalid tag");
|
|
163
|
+
let f = Q(t, o.tags);
|
|
164
|
+
if (t.tag === "binding") return B(t, r, o, s);
|
|
165
|
+
let p = X(f) ? (e) => e : c;
|
|
166
|
+
if (P.includes(n(f).toLowerCase())) return r("pre", { class: "mdc-renderer-dangerous-tag" }, "<" + f + ">" + e(t) + "</" + f + ">");
|
|
165
167
|
let m = p(f);
|
|
166
168
|
typeof m == "object" && (m.tag = d);
|
|
167
|
-
let h =
|
|
168
|
-
return
|
|
169
|
+
let h = V(t, o);
|
|
170
|
+
return a && (h.key = a), r(m, h, z(t, r, {
|
|
169
171
|
documentMeta: o,
|
|
170
172
|
parentScope: {
|
|
171
173
|
...s,
|
|
@@ -174,20 +176,20 @@ function L(e, n, r, i) {
|
|
|
174
176
|
resolveComponent: p
|
|
175
177
|
}));
|
|
176
178
|
}
|
|
177
|
-
function
|
|
179
|
+
function z(e, t, n) {
|
|
178
180
|
let { documentMeta: r, parentScope: a, resolveComponent: o } = n, s = (e.children || []).reduce((e, t) => {
|
|
179
|
-
if (!
|
|
180
|
-
let n =
|
|
181
|
+
if (!Y(t)) return e[E].children.push(t), e;
|
|
182
|
+
let n = J(t);
|
|
181
183
|
return e[n] = e[n] || {
|
|
182
184
|
props: {},
|
|
183
185
|
children: []
|
|
184
186
|
}, t.type === "element" && (e[n].props = t.props, e[n].children.push(...t.children || [])), e;
|
|
185
|
-
}, { [
|
|
187
|
+
}, { [E]: {
|
|
186
188
|
props: {},
|
|
187
189
|
children: []
|
|
188
190
|
} });
|
|
189
191
|
return Object.entries(s).reduce((e, [n, { props: s, children: c }]) => (c.length && (e[n] = (e = {}) => {
|
|
190
|
-
let n =
|
|
192
|
+
let n = w(e, Object.keys(s || {})), l = c.map((e, i) => R(e, t, {
|
|
191
193
|
documentMeta: r,
|
|
192
194
|
parentScope: {
|
|
193
195
|
...a,
|
|
@@ -195,10 +197,10 @@ function R(e, t, n) {
|
|
|
195
197
|
},
|
|
196
198
|
resolveComponent: o
|
|
197
199
|
}, String(e.props?.key || i)));
|
|
198
|
-
return s?.unwrap && (l = i(l, s.unwrap)),
|
|
200
|
+
return s?.unwrap && (l = i(l, s.unwrap)), Z(l);
|
|
199
201
|
}), e), {});
|
|
200
202
|
}
|
|
201
|
-
function
|
|
203
|
+
function B(e, t, n, r = {}) {
|
|
202
204
|
let i = {
|
|
203
205
|
...n.runtimeData,
|
|
204
206
|
...r,
|
|
@@ -207,95 +209,95 @@ function z(e, t, n, r = {}) {
|
|
|
207
209
|
}, a = (e.props?.value.trim().split(/\.|\[(\d+)\]/).filter(Boolean)).reduce((e, t) => {
|
|
208
210
|
if (e && t in e) return typeof e[t] == "function" ? e[t]() : e[t];
|
|
209
211
|
}, i), o = e.props?.defaultValue;
|
|
210
|
-
return t(
|
|
212
|
+
return t(u, a ?? o ?? "");
|
|
211
213
|
}
|
|
212
|
-
function
|
|
213
|
-
let { tag: r = "", props: i = {} } =
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (
|
|
218
|
-
if (a
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return Array.isArray(o) && o.every((e) => typeof e == "string") ? (t[c] = o.join(" "), t) : (t[c] = o, t);
|
|
214
|
+
function V(e, n) {
|
|
215
|
+
let { tag: r = "", props: i = {} } = e, a = Object.keys(i).reduce(function(e, a) {
|
|
216
|
+
if (a === "__ignoreMap") return e;
|
|
217
|
+
let s = i[a];
|
|
218
|
+
if (k.test(a)) return H(a, s, e, n, { native: A.includes(r) });
|
|
219
|
+
if (a === "v-bind") return U(a, s, e, n);
|
|
220
|
+
if (D.test(a)) return W(a, s, e, n);
|
|
221
|
+
if (O.test(a)) return G(a, s, e, n);
|
|
222
|
+
let { attribute: c } = o(t, a);
|
|
223
|
+
return Array.isArray(s) && s.every((e) => typeof e == "string") ? (e[c] = s.join(" "), e) : (e[c] = s, e);
|
|
223
224
|
}, {});
|
|
225
|
+
return Object.fromEntries(Object.entries(a).filter(([e, t]) => !s(e, t)));
|
|
224
226
|
}
|
|
225
|
-
function
|
|
227
|
+
function H(e, t, n, r, { native: i }) {
|
|
226
228
|
let a = e.match(/^v-model:([^=]+)/)?.[1] || "modelValue", o = i ? "value" : a, s = i ? "onInput" : `onUpdate:${a}`;
|
|
227
|
-
return n[o] =
|
|
229
|
+
return n[o] = q(t, r.runtimeData), n[s] = (e) => {
|
|
228
230
|
r.updateRuntimeData(t, i ? e.target?.value : e);
|
|
229
231
|
}, n;
|
|
230
232
|
}
|
|
231
|
-
function H(e, t, n, r) {
|
|
232
|
-
let i = K(t, r);
|
|
233
|
-
return n = Object.assign(n, i), n;
|
|
234
|
-
}
|
|
235
233
|
function U(e, t, n, r) {
|
|
236
|
-
|
|
234
|
+
let i = q(t, r);
|
|
235
|
+
return n = Object.assign(n, i), n;
|
|
237
236
|
}
|
|
238
237
|
function W(e, t, n, r) {
|
|
239
|
-
return e = e.replace(D, ""), n[e] =
|
|
238
|
+
return e = e.replace(D, ""), n.on = n.on || {}, n.on[e] = () => q(t, r), n;
|
|
239
|
+
}
|
|
240
|
+
function G(e, t, n, r) {
|
|
241
|
+
return e = e.replace(O, ""), n[e] = q(t, r), n;
|
|
240
242
|
}
|
|
241
|
-
var
|
|
243
|
+
var K = (e) => {
|
|
242
244
|
if (typeof e == "string") {
|
|
243
245
|
if ($(e)) return e;
|
|
244
|
-
let
|
|
245
|
-
return !e ||
|
|
246
|
+
let t = _(n(e), !1);
|
|
247
|
+
return !e || t?.name === "AsyncComponentWrapper" || typeof t == "string" ? t : "setup" in t ? f(() => new Promise((e) => e(t))) : t;
|
|
246
248
|
}
|
|
247
249
|
return e;
|
|
248
250
|
};
|
|
249
|
-
function
|
|
251
|
+
function q(e, t) {
|
|
250
252
|
let n = e.split(".").reduce((e, t) => typeof e == "object" ? e[t] : void 0, t);
|
|
251
|
-
return n === void 0 ?
|
|
253
|
+
return n === void 0 ? C(e) : n;
|
|
252
254
|
}
|
|
253
|
-
function
|
|
255
|
+
function J(e) {
|
|
254
256
|
let t = "";
|
|
255
257
|
for (let n of Object.keys(e.props || {})) if (n.startsWith("#") || n.startsWith("v-slot:")) {
|
|
256
258
|
t = n.split(/[:#]/, 2)[1];
|
|
257
259
|
break;
|
|
258
260
|
}
|
|
259
|
-
return t ||
|
|
260
|
-
}
|
|
261
|
-
function J(e) {
|
|
262
|
-
return e.tag === "template";
|
|
261
|
+
return t || E;
|
|
263
262
|
}
|
|
264
263
|
function Y(e) {
|
|
265
|
-
return
|
|
264
|
+
return e.tag === "template";
|
|
266
265
|
}
|
|
267
266
|
function X(e) {
|
|
267
|
+
return j.has(e);
|
|
268
|
+
}
|
|
269
|
+
function Z(e) {
|
|
268
270
|
let t = [];
|
|
269
271
|
for (let n of e) {
|
|
270
272
|
let e = t[t.length - 1];
|
|
271
|
-
n.type ===
|
|
273
|
+
n.type === u && e?.type === u ? e.children += n.children : t.push(n);
|
|
272
274
|
}
|
|
273
275
|
return t;
|
|
274
276
|
}
|
|
275
|
-
async function
|
|
277
|
+
async function ne(e, t) {
|
|
276
278
|
if (!e) return;
|
|
277
279
|
let n = Array.from(new Set(r(e, t)));
|
|
278
280
|
await Promise.all(n.map(async (e) => {
|
|
279
281
|
if (e?.render || e?.ssrRender || e?.__ssrInlineRender) return;
|
|
280
|
-
let t =
|
|
282
|
+
let t = K(e);
|
|
281
283
|
t?.__asyncLoader && !t.__asyncResolved && await t.__asyncLoader();
|
|
282
284
|
}));
|
|
283
285
|
function r(e, t) {
|
|
284
286
|
let n = e.tag;
|
|
285
|
-
if (e.type === "text" || n === "binding" || e.type === "comment") return [];
|
|
287
|
+
if (e.type === "text" || n === "binding" || e.type === "comment" || e.type !== "root" && typeof n != "string") return [];
|
|
286
288
|
let i = Q(e, t.tags);
|
|
287
|
-
if (
|
|
289
|
+
if (X(i)) return [];
|
|
288
290
|
let a = [];
|
|
289
291
|
e.type !== "root" && !$(i) && a.push(i);
|
|
290
292
|
for (let n of e.children || []) a.push(...r(n, t));
|
|
291
293
|
return a;
|
|
292
294
|
}
|
|
293
295
|
}
|
|
294
|
-
function Q(e,
|
|
296
|
+
function Q(e, t) {
|
|
295
297
|
let i = e.tag;
|
|
296
|
-
return !i || e.props?.__ignoreMap !== void 0 ? i :
|
|
298
|
+
return !i || e.props?.__ignoreMap !== void 0 ? i : t[i] || t[n(i)] || t[r(e.tag)] || i;
|
|
297
299
|
}
|
|
298
300
|
function $(e) {
|
|
299
|
-
return typeof e == "string" &&
|
|
301
|
+
return typeof e == "string" && M.has(e) || c.has(e);
|
|
300
302
|
}
|
|
301
|
-
export {
|
|
303
|
+
export { L as default };
|
package/dist/index.js
CHANGED
|
@@ -253,9 +253,9 @@ var A = /*#__PURE__*/ k(le, [["render", de], ["__scopeId", "data-v-d52859e7"]]),
|
|
|
253
253
|
emits: ["resolve"],
|
|
254
254
|
setup(t, { expose: n, emit: a }) {
|
|
255
255
|
let o = t, s = a, { densityClass: c } = ce(o), l = g(!1), u = g(), f = async () => {
|
|
256
|
-
let { parseMarkdown: e } = await import("./runtime-
|
|
256
|
+
let { parseMarkdown: e } = await import("./runtime-R-aI3I9T.js");
|
|
257
257
|
return e;
|
|
258
|
-
}, p = ee(() => import("./MDCRenderer-
|
|
258
|
+
}, p = ee(() => import("./MDCRenderer-BonoinDm.js"));
|
|
259
259
|
ne(() => o.markdown, async () => {
|
|
260
260
|
l.value = !0;
|
|
261
261
|
try {
|