@sit-onyx/mdc 0.3.0 → 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.
- package/README.md +1 -1
- package/dist/{MDCRenderer-CC1RH5BK.js → MDCRenderer-BonoinDm.js} +114 -101
- package/dist/components/prose/ProsePre.d.vue.ts +2 -1
- package/dist/index.js +86 -86
- package/dist/{node-Oi5de8aj.js → props-D9WqZr0-.js} +389 -315
- package/dist/{runtime-B-YpCpS_.js → runtime-R-aI3I9T.js} +7370 -7085
- package/dist/stub-mdc-imports-CGrl_Mo3.js +3 -0
- package/dist/style.css +1 -1
- package/package.json +13 -14
package/README.md
CHANGED
|
@@ -12,4 +12,4 @@ Wrapper for the [@nuxtjs/mdc](https://github.com/nuxt-content/mdc) package using
|
|
|
12
12
|
|
|
13
13
|
## Documentation
|
|
14
14
|
|
|
15
|
-
You can find our documentation [here](https://
|
|
15
|
+
You can find our documentation [here](https://onyx.schwarz/components/docs/markdown).
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { c as e, d as t,
|
|
2
|
-
import { Comment as
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t)
|
|
7
|
-
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
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
|
+
// ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
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
|
+
else return t;
|
|
11
8
|
}
|
|
12
|
-
function
|
|
9
|
+
function te(e) {
|
|
13
10
|
console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
|
|
14
11
|
}
|
|
15
12
|
function C(e, t = {}) {
|
|
@@ -25,14 +22,14 @@ function C(e, t = {}) {
|
|
|
25
22
|
case "infinity": return Infinity;
|
|
26
23
|
case "-infinity": return -Infinity;
|
|
27
24
|
}
|
|
28
|
-
if (!
|
|
25
|
+
if (!ee.test(e)) {
|
|
29
26
|
if (t.strict) throw SyntaxError("[destr] Invalid JSON");
|
|
30
27
|
return e;
|
|
31
28
|
}
|
|
32
29
|
try {
|
|
33
|
-
if (
|
|
30
|
+
if (b.test(e) || x.test(e)) {
|
|
34
31
|
if (t.strict) throw Error("[destr] Possible prototype pollution");
|
|
35
|
-
return JSON.parse(e,
|
|
32
|
+
return JSON.parse(e, S);
|
|
36
33
|
}
|
|
37
34
|
return JSON.parse(e);
|
|
38
35
|
} catch (n) {
|
|
@@ -40,8 +37,7 @@ function C(e, t = {}) {
|
|
|
40
37
|
return e;
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
//#region ../../node_modules/.pnpm/@nuxtjs+mdc@0.22.1_magicast@0.5.3/node_modules/@nuxtjs/mdc/dist/runtime/utils/index.js
|
|
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
|
|
45
41
|
function w(e, t) {
|
|
46
42
|
return t.reduce((t, n) => {
|
|
47
43
|
let r = T(e, n);
|
|
@@ -51,13 +47,22 @@ function w(e, t) {
|
|
|
51
47
|
function T(e, t) {
|
|
52
48
|
return t.split(".").reduce((e, t) => e && e[t], e);
|
|
53
49
|
}
|
|
54
|
-
|
|
55
|
-
//#region ../../node_modules/.pnpm/@nuxtjs+mdc@0.22.1_magicast@0.5.3/node_modules/@nuxtjs/mdc/dist/runtime/components/MDCRenderer.vue
|
|
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
|
|
56
51
|
var E = "default", D = /^@|^v-on:/, O = /^:|^v-bind:/, k = /^v-model/, A = [
|
|
57
52
|
"select",
|
|
58
53
|
"textarea",
|
|
59
54
|
"input"
|
|
60
|
-
], 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 =
|
|
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
|
+
"iframe",
|
|
58
|
+
"frame",
|
|
59
|
+
"frameset",
|
|
60
|
+
"embed",
|
|
61
|
+
"object",
|
|
62
|
+
"style",
|
|
63
|
+
"link",
|
|
64
|
+
"meta"
|
|
65
|
+
]), I = /^[a-z][\w-]*$/i, L = p({
|
|
61
66
|
name: "MDCRenderer",
|
|
62
67
|
props: {
|
|
63
68
|
body: {
|
|
@@ -90,30 +95,37 @@ var E = "default", D = /^@|^v-on:/, O = /^:|^v-bind:/, k = /^v-model/, A = [
|
|
|
90
95
|
}
|
|
91
96
|
},
|
|
92
97
|
async setup(e) {
|
|
93
|
-
let t =
|
|
98
|
+
let t = m()?.appContext?.app?.$nuxt, n = t?.$route || t?._route, { mdc: r } = t?.$config?.public || {}, i = r?.components?.customElements || r?.components?.custom;
|
|
94
99
|
i && i.forEach((e) => M.add(e));
|
|
95
|
-
let
|
|
100
|
+
let o = d(() => ({
|
|
96
101
|
...r?.components?.prose && e.prose !== !1 ? N : {},
|
|
97
102
|
...r?.components?.map || {},
|
|
98
|
-
...
|
|
103
|
+
...Object.fromEntries(Object.entries(v(e.data?.mdc?.components || {})).filter(([, e]) => typeof e == "string")),
|
|
99
104
|
...e.components
|
|
100
|
-
})),
|
|
101
|
-
let t = (e.body?.children || []).map((e) => e.tag || e.type).filter((e) =>
|
|
105
|
+
})), s = d(() => {
|
|
106
|
+
let t = (e.body?.children || []).map((e) => e.tag || e.type).filter((e) => !$(e));
|
|
102
107
|
return Array.from(new Set(t)).sort().join(".");
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
Object.assign(
|
|
106
|
-
}), await
|
|
107
|
-
function
|
|
108
|
+
}), c = g({ ...e.data });
|
|
109
|
+
y(() => e.data, (e) => {
|
|
110
|
+
Object.assign(c, e);
|
|
111
|
+
}), await ne(e.body, { tags: o.value });
|
|
112
|
+
function l(e, t) {
|
|
108
113
|
let n = e.split(".").length - 1;
|
|
109
|
-
return e.split(".").reduce((e, r, i) => i == n && e ? (e[r] = t, e[r]) : typeof e == "object" ? e[r] : void 0,
|
|
114
|
+
return e.split(".").reduce((e, r, i) => i == n && e ? (e[r] = t, e[r]) : typeof e == "object" ? e[r] : void 0, c);
|
|
110
115
|
}
|
|
111
116
|
return {
|
|
112
|
-
tags:
|
|
113
|
-
contentKey:
|
|
117
|
+
tags: o,
|
|
118
|
+
contentKey: s,
|
|
114
119
|
route: n,
|
|
115
|
-
runtimeData:
|
|
116
|
-
updateRuntimeData:
|
|
120
|
+
runtimeData: c,
|
|
121
|
+
updateRuntimeData: l,
|
|
122
|
+
root: d(() => {
|
|
123
|
+
let t = e.data?.component, n = e.tag || t?.name || t || "div", r = t?.props;
|
|
124
|
+
return !e.tag && t && ((typeof n != "string" || !I.test(n) || F.has(n.toLowerCase())) && (n = "div"), r &&= a(n, r)), {
|
|
125
|
+
tag: n,
|
|
126
|
+
props: r
|
|
127
|
+
};
|
|
128
|
+
})
|
|
117
129
|
};
|
|
118
130
|
},
|
|
119
131
|
render(e) {
|
|
@@ -125,47 +137,49 @@ var E = "default", D = /^@|^v-on:/, O = /^:|^v-bind:/, k = /^v-model/, A = [
|
|
|
125
137
|
$route: s,
|
|
126
138
|
runtimeData: l,
|
|
127
139
|
updateRuntimeData: u
|
|
128
|
-
}, f = n === !1 ? void 0 :
|
|
129
|
-
return
|
|
130
|
-
...
|
|
140
|
+
}, { tag: f, props: p } = e.root, m = n === !1 ? void 0 : K(f);
|
|
141
|
+
return m ? h(m, {
|
|
142
|
+
...p,
|
|
131
143
|
class: e.class,
|
|
132
144
|
...this.$attrs,
|
|
133
145
|
key: o
|
|
134
|
-
}, { default:
|
|
135
|
-
function
|
|
136
|
-
let e =
|
|
146
|
+
}, { default: g }) : g?.();
|
|
147
|
+
function g() {
|
|
148
|
+
let e = z(r, h, {
|
|
137
149
|
documentMeta: d,
|
|
138
150
|
parentScope: d,
|
|
139
|
-
resolveComponent:
|
|
151
|
+
resolveComponent: K
|
|
140
152
|
});
|
|
141
153
|
return e?.default ? c ? i(e.default(), typeof c == "string" ? c.split(" ") : ["*"]) : e.default() : null;
|
|
142
154
|
}
|
|
143
155
|
}
|
|
144
156
|
});
|
|
145
|
-
function
|
|
146
|
-
let { documentMeta: o, parentScope:
|
|
147
|
-
if (
|
|
148
|
-
if (
|
|
149
|
-
let d =
|
|
150
|
-
if (
|
|
151
|
-
let
|
|
152
|
-
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 + ">");
|
|
153
167
|
let m = p(f);
|
|
154
168
|
typeof m == "object" && (m.tag = d);
|
|
155
|
-
let h =
|
|
156
|
-
return
|
|
169
|
+
let h = V(t, o);
|
|
170
|
+
return a && (h.key = a), r(m, h, z(t, r, {
|
|
157
171
|
documentMeta: o,
|
|
158
172
|
parentScope: {
|
|
159
|
-
...
|
|
173
|
+
...s,
|
|
160
174
|
...h
|
|
161
175
|
},
|
|
162
176
|
resolveComponent: p
|
|
163
177
|
}));
|
|
164
178
|
}
|
|
165
|
-
function
|
|
179
|
+
function z(e, t, n) {
|
|
166
180
|
let { documentMeta: r, parentScope: a, resolveComponent: o } = n, s = (e.children || []).reduce((e, t) => {
|
|
167
|
-
if (!
|
|
168
|
-
let n =
|
|
181
|
+
if (!Y(t)) return e[E].children.push(t), e;
|
|
182
|
+
let n = J(t);
|
|
169
183
|
return e[n] = e[n] || {
|
|
170
184
|
props: {},
|
|
171
185
|
children: []
|
|
@@ -175,7 +189,7 @@ function L(e, t, n) {
|
|
|
175
189
|
children: []
|
|
176
190
|
} });
|
|
177
191
|
return Object.entries(s).reduce((e, [n, { props: s, children: c }]) => (c.length && (e[n] = (e = {}) => {
|
|
178
|
-
let n = w(e, Object.keys(s || {})), l = c.map((e, i) =>
|
|
192
|
+
let n = w(e, Object.keys(s || {})), l = c.map((e, i) => R(e, t, {
|
|
179
193
|
documentMeta: r,
|
|
180
194
|
parentScope: {
|
|
181
195
|
...a,
|
|
@@ -183,10 +197,10 @@ function L(e, t, n) {
|
|
|
183
197
|
},
|
|
184
198
|
resolveComponent: o
|
|
185
199
|
}, String(e.props?.key || i)));
|
|
186
|
-
return s?.unwrap && (l = i(l, s.unwrap)),
|
|
200
|
+
return s?.unwrap && (l = i(l, s.unwrap)), Z(l);
|
|
187
201
|
}), e), {});
|
|
188
202
|
}
|
|
189
|
-
function
|
|
203
|
+
function B(e, t, n, r = {}) {
|
|
190
204
|
let i = {
|
|
191
205
|
...n.runtimeData,
|
|
192
206
|
...r,
|
|
@@ -195,96 +209,95 @@ function R(e, t, n, r = {}) {
|
|
|
195
209
|
}, a = (e.props?.value.trim().split(/\.|\[(\d+)\]/).filter(Boolean)).reduce((e, t) => {
|
|
196
210
|
if (e && t in e) return typeof e[t] == "function" ? e[t]() : e[t];
|
|
197
211
|
}, i), o = e.props?.defaultValue;
|
|
198
|
-
return t(
|
|
212
|
+
return t(u, a ?? o ?? "");
|
|
199
213
|
}
|
|
200
|
-
function
|
|
201
|
-
let { tag:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
let { attribute: c } = t(n, o);
|
|
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);
|
|
210
223
|
return Array.isArray(s) && s.every((e) => typeof e == "string") ? (e[c] = s.join(" "), e) : (e[c] = s, e);
|
|
211
224
|
}, {});
|
|
225
|
+
return Object.fromEntries(Object.entries(a).filter(([e, t]) => !s(e, t)));
|
|
212
226
|
}
|
|
213
|
-
function
|
|
227
|
+
function H(e, t, n, r, { native: i }) {
|
|
214
228
|
let a = e.match(/^v-model:([^=]+)/)?.[1] || "modelValue", o = i ? "value" : a, s = i ? "onInput" : `onUpdate:${a}`;
|
|
215
|
-
return n[o] =
|
|
229
|
+
return n[o] = q(t, r.runtimeData), n[s] = (e) => {
|
|
216
230
|
r.updateRuntimeData(t, i ? e.target?.value : e);
|
|
217
231
|
}, n;
|
|
218
232
|
}
|
|
219
|
-
function
|
|
220
|
-
let i =
|
|
233
|
+
function U(e, t, n, r) {
|
|
234
|
+
let i = q(t, r);
|
|
221
235
|
return n = Object.assign(n, i), n;
|
|
222
236
|
}
|
|
223
|
-
function
|
|
224
|
-
return e = e.replace(D, ""), n.on = n.on || {}, n.on[e] = () =>
|
|
237
|
+
function W(e, t, n, r) {
|
|
238
|
+
return e = e.replace(D, ""), n.on = n.on || {}, n.on[e] = () => q(t, r), n;
|
|
225
239
|
}
|
|
226
|
-
function
|
|
227
|
-
return e = e.replace(O, ""), n[e] =
|
|
240
|
+
function G(e, t, n, r) {
|
|
241
|
+
return e = e.replace(O, ""), n[e] = q(t, r), n;
|
|
228
242
|
}
|
|
229
|
-
var
|
|
243
|
+
var K = (e) => {
|
|
230
244
|
if (typeof e == "string") {
|
|
231
|
-
if (
|
|
232
|
-
let t =
|
|
233
|
-
return !e || t?.name === "AsyncComponentWrapper" || typeof t == "string" ? t : "setup" in t ?
|
|
245
|
+
if ($(e)) 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;
|
|
234
248
|
}
|
|
235
249
|
return e;
|
|
236
250
|
};
|
|
237
|
-
function
|
|
251
|
+
function q(e, t) {
|
|
238
252
|
let n = e.split(".").reduce((e, t) => typeof e == "object" ? e[t] : void 0, t);
|
|
239
253
|
return n === void 0 ? C(e) : n;
|
|
240
254
|
}
|
|
241
|
-
function
|
|
255
|
+
function J(e) {
|
|
242
256
|
let t = "";
|
|
243
|
-
for (let n of Object.keys(e.props || {})) if (
|
|
257
|
+
for (let n of Object.keys(e.props || {})) if (n.startsWith("#") || n.startsWith("v-slot:")) {
|
|
244
258
|
t = n.split(/[:#]/, 2)[1];
|
|
245
259
|
break;
|
|
246
260
|
}
|
|
247
261
|
return t || E;
|
|
248
262
|
}
|
|
249
|
-
function
|
|
263
|
+
function Y(e) {
|
|
250
264
|
return e.tag === "template";
|
|
251
265
|
}
|
|
252
|
-
function
|
|
266
|
+
function X(e) {
|
|
253
267
|
return j.has(e);
|
|
254
268
|
}
|
|
255
|
-
function
|
|
269
|
+
function Z(e) {
|
|
256
270
|
let t = [];
|
|
257
271
|
for (let n of e) {
|
|
258
272
|
let e = t[t.length - 1];
|
|
259
|
-
n.type ===
|
|
273
|
+
n.type === u && e?.type === u ? e.children += n.children : t.push(n);
|
|
260
274
|
}
|
|
261
275
|
return t;
|
|
262
276
|
}
|
|
263
|
-
async function
|
|
277
|
+
async function ne(e, t) {
|
|
264
278
|
if (!e) return;
|
|
265
279
|
let n = Array.from(new Set(r(e, t)));
|
|
266
280
|
await Promise.all(n.map(async (e) => {
|
|
267
281
|
if (e?.render || e?.ssrRender || e?.__ssrInlineRender) return;
|
|
268
|
-
let t =
|
|
282
|
+
let t = K(e);
|
|
269
283
|
t?.__asyncLoader && !t.__asyncResolved && await t.__asyncLoader();
|
|
270
284
|
}));
|
|
271
285
|
function r(e, t) {
|
|
272
286
|
let n = e.tag;
|
|
273
|
-
if (e.type === "text" || n === "binding" || e.type === "comment") return [];
|
|
274
|
-
let i =
|
|
275
|
-
if (
|
|
287
|
+
if (e.type === "text" || n === "binding" || e.type === "comment" || e.type !== "root" && typeof n != "string") return [];
|
|
288
|
+
let i = Q(e, t.tags);
|
|
289
|
+
if (X(i)) return [];
|
|
276
290
|
let a = [];
|
|
277
|
-
e.type !== "root" &&
|
|
291
|
+
e.type !== "root" && !$(i) && a.push(i);
|
|
278
292
|
for (let n of e.children || []) a.push(...r(n, t));
|
|
279
293
|
return a;
|
|
280
294
|
}
|
|
281
295
|
}
|
|
282
|
-
function
|
|
283
|
-
let
|
|
284
|
-
return !
|
|
296
|
+
function Q(e, t) {
|
|
297
|
+
let i = e.tag;
|
|
298
|
+
return !i || e.props?.__ignoreMap !== void 0 ? i : t[i] || t[n(i)] || t[r(e.tag)] || i;
|
|
285
299
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
300
|
+
function $(e) {
|
|
301
|
+
return typeof e == "string" && M.has(e) || c.has(e);
|
|
288
302
|
}
|
|
289
|
-
|
|
290
|
-
export { F as default };
|
|
303
|
+
export { L as default };
|