@sit-onyx/mdc 0.3.0-dev-20260715161231 → 0.3.1
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-Bd04ujwA.js +301 -0
- package/dist/components/prose/ProsePre.d.vue.ts +2 -1
- package/dist/index.js +86 -86
- package/dist/{node-Oi5de8aj.js → props-BDcmuO0J.js} +299 -280
- package/dist/{runtime-B-YpCpS_.js → runtime-Cmxarge9.js} +4814 -5380
- package/dist/stub-mdc-imports-CGrl_Mo3.js +3 -0
- package/dist/style.css +1 -1
- package/package.json +11 -12
- package/dist/MDCRenderer-CC1RH5BK.js +0 -290
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--onyx-markdown-renderer-margin-block:var(--onyx-density-md)}br[data-v-d52859e7]{height:1lh;display:block}code[data-v-3d53c5e9]{background-color:var(--onyx-color-base-background-blank);border:var(--onyx-1px-in-rem) solid var(--onyx-color-component-border-neutral);border-radius:var(--onyx-radius-sm);padding:var(--onyx-density-3xs) var(--onyx-density-2xs)}.accordion[data-v-4178c16e]{margin-block:var(--onyx-markdown-renderer-margin-block)}.header:has(.header__content:not(:empty)) .header__placeholder[data-v-4178c16e]{display:none}.onyx-headline[data-v-c5760f34]{margin-bottom:var(--onyx-density-lg)}.onyx-headline[data-v-ca207127]{margin-top:var(--onyx-density-2xl);margin-bottom:var(--onyx-density-xs)}.onyx-headline[data-v-bd6aac0c]{margin-top:var(--onyx-density-xl);margin-bottom:var(--onyx-density-2xs)}.onyx-headline[data-v-2fae4049],.onyx-headline[data-v-be90357a],.onyx-headline[data-v-e10c9588]{margin-top:var(--onyx-density-lg);margin-bottom:var(--onyx-density-3xs)}.separator[data-v-88aee9af]{margin-block:var(--onyx-markdown-renderer-margin-block)}img[data-v-f39db070]{max-width:100%;display:inline-block}ol[data-v-5adc6f71]{margin-block:var(--onyx-density-xs)}p[data-v-8d5bfaf8],.code[data-v-
|
|
1
|
+
:root{--onyx-markdown-renderer-margin-block:var(--onyx-density-md)}br[data-v-d52859e7]{height:1lh;display:block}code[data-v-3d53c5e9]{background-color:var(--onyx-color-base-background-blank);border:var(--onyx-1px-in-rem) solid var(--onyx-color-component-border-neutral);border-radius:var(--onyx-radius-sm);padding:var(--onyx-density-3xs) var(--onyx-density-2xs)}.accordion[data-v-4178c16e]{margin-block:var(--onyx-markdown-renderer-margin-block)}.header:has(.header__content:not(:empty)) .header__placeholder[data-v-4178c16e]{display:none}.onyx-headline[data-v-c5760f34]{margin-bottom:var(--onyx-density-lg)}.onyx-headline[data-v-ca207127]{margin-top:var(--onyx-density-2xl);margin-bottom:var(--onyx-density-xs)}.onyx-headline[data-v-bd6aac0c]{margin-top:var(--onyx-density-xl);margin-bottom:var(--onyx-density-2xs)}.onyx-headline[data-v-2fae4049],.onyx-headline[data-v-be90357a],.onyx-headline[data-v-e10c9588]{margin-top:var(--onyx-density-lg);margin-bottom:var(--onyx-density-3xs)}.separator[data-v-88aee9af]{margin-block:var(--onyx-markdown-renderer-margin-block)}img[data-v-f39db070]{max-width:100%;display:inline-block}ol[data-v-5adc6f71]{margin-block:var(--onyx-density-xs)}p[data-v-8d5bfaf8],.code[data-v-df4e4fd8],.table[data-v-52d1d2c2]{margin-block:var(--onyx-markdown-renderer-margin-block)}ul[data-v-17a11577]{margin-block:var(--onyx-density-xs)}@layer onyx.component{.onyx-markdown-renderer{font-family:var(--onyx-font-family-paragraph)}}
|
|
2
2
|
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sit-onyx/mdc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Wrapper for the @nuxtjs/mdc package using the onyx design system created by Schwarz Digits",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/SchwarzIT/onyx/issues"
|
|
@@ -27,21 +27,20 @@
|
|
|
27
27
|
"./style.css": "./dist/style.css"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@playwright/
|
|
33
|
-
"@playwright/test": "1.61.1",
|
|
34
|
-
"@vue/compiler-dom": "3.5.39",
|
|
35
|
-
"unplugin-dts": "1.0.3",
|
|
36
|
-
"vite": "8.0.16",
|
|
30
|
+
"@nuxtjs/mdc": "~0.23.2",
|
|
31
|
+
"@playwright/experimental-ct-vue": "1.62.1",
|
|
32
|
+
"@playwright/test": "1.62.1",
|
|
37
33
|
"@sit-onyx/playwright-utils": "^1.3.0",
|
|
38
|
-
"sit-onyx": "^1.
|
|
39
|
-
"@
|
|
34
|
+
"@sit-onyx/shared": "^0.1.0",
|
|
35
|
+
"@vue/compiler-dom": "3.5.44",
|
|
36
|
+
"sit-onyx": "^1.22.0",
|
|
37
|
+
"unplugin-dts": "1.1.2",
|
|
38
|
+
"vite": "8.3.5"
|
|
40
39
|
},
|
|
41
40
|
"peerDependencies": {
|
|
42
41
|
"@nuxtjs/mdc": ">= 0.20.2",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
42
|
+
"sit-onyx": "^1.22.0",
|
|
43
|
+
"vue": ">= 3.5.0"
|
|
45
44
|
},
|
|
46
45
|
"engines": {
|
|
47
46
|
"node": ">=20"
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { c as e, d as t, l as n, m as r, n as i, o as a, p as o } from "./node-Oi5de8aj.js";
|
|
2
|
-
import { Comment as s, Text as c, computed as l, defineAsyncComponent as u, defineComponent as d, getCurrentInstance as f, h as p, reactive as m, resolveComponent as h, toRaw as g, watch as _ } from "vue";
|
|
3
|
-
//#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
4
|
-
var v = /"(?:_|\\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*:/, y = /"(?: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*:/, b = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
5
|
-
function x(e, t) {
|
|
6
|
-
if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) {
|
|
7
|
-
S(e);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
}
|
|
12
|
-
function S(e) {
|
|
13
|
-
console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
|
|
14
|
-
}
|
|
15
|
-
function C(e, t = {}) {
|
|
16
|
-
if (typeof e != "string") return e;
|
|
17
|
-
if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
|
|
18
|
-
let n = e.trim();
|
|
19
|
-
if (n.length <= 9) switch (n.toLowerCase()) {
|
|
20
|
-
case "true": return !0;
|
|
21
|
-
case "false": return !1;
|
|
22
|
-
case "undefined": return;
|
|
23
|
-
case "null": return null;
|
|
24
|
-
case "nan": return NaN;
|
|
25
|
-
case "infinity": return Infinity;
|
|
26
|
-
case "-infinity": return -Infinity;
|
|
27
|
-
}
|
|
28
|
-
if (!b.test(e)) {
|
|
29
|
-
if (t.strict) throw SyntaxError("[destr] Invalid JSON");
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
if (v.test(e) || y.test(e)) {
|
|
34
|
-
if (t.strict) throw Error("[destr] Possible prototype pollution");
|
|
35
|
-
return JSON.parse(e, x);
|
|
36
|
-
}
|
|
37
|
-
return JSON.parse(e);
|
|
38
|
-
} catch (n) {
|
|
39
|
-
if (t.strict) throw n;
|
|
40
|
-
return e;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region ../../node_modules/.pnpm/@nuxtjs+mdc@0.22.1_magicast@0.5.3/node_modules/@nuxtjs/mdc/dist/runtime/utils/index.js
|
|
45
|
-
function w(e, t) {
|
|
46
|
-
return t.reduce((t, n) => {
|
|
47
|
-
let r = T(e, n);
|
|
48
|
-
return r !== void 0 && (t[n] = r), t;
|
|
49
|
-
}, {});
|
|
50
|
-
}
|
|
51
|
-
function T(e, t) {
|
|
52
|
-
return t.split(".").reduce((e, t) => e && e[t], e);
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region ../../node_modules/.pnpm/@nuxtjs+mdc@0.22.1_magicast@0.5.3/node_modules/@nuxtjs/mdc/dist/runtime/components/MDCRenderer.vue
|
|
56
|
-
var E = "default", D = /^@|^v-on:/, O = /^:|^v-bind:/, k = /^v-model/, A = [
|
|
57
|
-
"select",
|
|
58
|
-
"textarea",
|
|
59
|
-
"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 = d({
|
|
61
|
-
name: "MDCRenderer",
|
|
62
|
-
props: {
|
|
63
|
-
body: {
|
|
64
|
-
type: Object,
|
|
65
|
-
required: !0
|
|
66
|
-
},
|
|
67
|
-
data: {
|
|
68
|
-
type: Object,
|
|
69
|
-
default: () => ({})
|
|
70
|
-
},
|
|
71
|
-
class: {
|
|
72
|
-
type: [String, Object],
|
|
73
|
-
default: void 0
|
|
74
|
-
},
|
|
75
|
-
tag: {
|
|
76
|
-
type: [String, Boolean],
|
|
77
|
-
default: void 0
|
|
78
|
-
},
|
|
79
|
-
prose: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: void 0
|
|
82
|
-
},
|
|
83
|
-
components: {
|
|
84
|
-
type: Object,
|
|
85
|
-
default: () => ({})
|
|
86
|
-
},
|
|
87
|
-
unwrap: {
|
|
88
|
-
type: [Boolean, String],
|
|
89
|
-
default: !1
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
async setup(e) {
|
|
93
|
-
let t = f()?.appContext?.app?.$nuxt, n = t?.$route || t?._route, { mdc: r } = t?.$config?.public || {}, i = r?.components?.customElements || r?.components?.custom;
|
|
94
|
-
i && i.forEach((e) => M.add(e));
|
|
95
|
-
let a = l(() => ({
|
|
96
|
-
...r?.components?.prose && e.prose !== !1 ? N : {},
|
|
97
|
-
...r?.components?.map || {},
|
|
98
|
-
...g(e.data?.mdc?.components || {}),
|
|
99
|
-
...e.components
|
|
100
|
-
})), o = l(() => {
|
|
101
|
-
let t = (e.body?.children || []).map((e) => e.tag || e.type).filter((e) => !Q(e));
|
|
102
|
-
return Array.from(new Set(t)).sort().join(".");
|
|
103
|
-
}), s = m({ ...e.data });
|
|
104
|
-
_(() => e.data, (e) => {
|
|
105
|
-
Object.assign(s, e);
|
|
106
|
-
}), await X(e.body, { tags: a.value });
|
|
107
|
-
function c(e, t) {
|
|
108
|
-
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, s);
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
tags: a,
|
|
113
|
-
contentKey: o,
|
|
114
|
-
route: n,
|
|
115
|
-
runtimeData: s,
|
|
116
|
-
updateRuntimeData: c
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
render(e) {
|
|
120
|
-
let { tags: t, tag: n, body: r, data: a, contentKey: o, route: s, unwrap: c, runtimeData: l, updateRuntimeData: u } = e;
|
|
121
|
-
if (!r) return null;
|
|
122
|
-
let d = {
|
|
123
|
-
...a,
|
|
124
|
-
tags: t,
|
|
125
|
-
$route: s,
|
|
126
|
-
runtimeData: l,
|
|
127
|
-
updateRuntimeData: u
|
|
128
|
-
}, f = n === !1 ? void 0 : W(n || d.component?.name || d.component || "div");
|
|
129
|
-
return f ? p(f, {
|
|
130
|
-
...d.component?.props,
|
|
131
|
-
class: e.class,
|
|
132
|
-
...this.$attrs,
|
|
133
|
-
key: o
|
|
134
|
-
}, { default: m }) : m?.();
|
|
135
|
-
function m() {
|
|
136
|
-
let e = L(r, p, {
|
|
137
|
-
documentMeta: d,
|
|
138
|
-
parentScope: d,
|
|
139
|
-
resolveComponent: W
|
|
140
|
-
});
|
|
141
|
-
return e?.default ? c ? i(e.default(), typeof c == "string" ? c.split(" ") : ["*"]) : e.default() : null;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
function I(e, t, n, i) {
|
|
146
|
-
let { documentMeta: o, parentScope: l, resolveComponent: u } = n;
|
|
147
|
-
if (e.type === "text") return t(c, e.value);
|
|
148
|
-
if (e.type === "comment") return t(s, null, e.value);
|
|
149
|
-
let d = e.tag, f = Z(e, o.tags);
|
|
150
|
-
if (e.tag === "binding") return R(e, t, o, l);
|
|
151
|
-
let p = J(f) ? (e) => e : u;
|
|
152
|
-
if (P.includes(r(f).toLowerCase())) return t("pre", { class: "mdc-renderer-dangerous-tag" }, "<" + f + ">" + a(e) + "</" + f + ">");
|
|
153
|
-
let m = p(f);
|
|
154
|
-
typeof m == "object" && (m.tag = d);
|
|
155
|
-
let h = z(e, o);
|
|
156
|
-
return i && (h.key = i), t(m, h, L(e, t, {
|
|
157
|
-
documentMeta: o,
|
|
158
|
-
parentScope: {
|
|
159
|
-
...l,
|
|
160
|
-
...h
|
|
161
|
-
},
|
|
162
|
-
resolveComponent: p
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
function L(e, t, n) {
|
|
166
|
-
let { documentMeta: r, parentScope: a, resolveComponent: o } = n, s = (e.children || []).reduce((e, t) => {
|
|
167
|
-
if (!q(t)) return e[E].children.push(t), e;
|
|
168
|
-
let n = K(t);
|
|
169
|
-
return e[n] = e[n] || {
|
|
170
|
-
props: {},
|
|
171
|
-
children: []
|
|
172
|
-
}, t.type === "element" && (e[n].props = t.props, e[n].children.push(...t.children || [])), e;
|
|
173
|
-
}, { [E]: {
|
|
174
|
-
props: {},
|
|
175
|
-
children: []
|
|
176
|
-
} });
|
|
177
|
-
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) => I(e, t, {
|
|
179
|
-
documentMeta: r,
|
|
180
|
-
parentScope: {
|
|
181
|
-
...a,
|
|
182
|
-
...n
|
|
183
|
-
},
|
|
184
|
-
resolveComponent: o
|
|
185
|
-
}, String(e.props?.key || i)));
|
|
186
|
-
return s?.unwrap && (l = i(l, s.unwrap)), Y(l);
|
|
187
|
-
}), e), {});
|
|
188
|
-
}
|
|
189
|
-
function R(e, t, n, r = {}) {
|
|
190
|
-
let i = {
|
|
191
|
-
...n.runtimeData,
|
|
192
|
-
...r,
|
|
193
|
-
$document: n,
|
|
194
|
-
$doc: n
|
|
195
|
-
}, a = (e.props?.value.trim().split(/\.|\[(\d+)\]/).filter(Boolean)).reduce((e, t) => {
|
|
196
|
-
if (e && t in e) return typeof e[t] == "function" ? e[t]() : e[t];
|
|
197
|
-
}, i), o = e.props?.defaultValue;
|
|
198
|
-
return t(c, a ?? o ?? "");
|
|
199
|
-
}
|
|
200
|
-
function z(e, r) {
|
|
201
|
-
let { tag: i = "", props: a = {} } = e;
|
|
202
|
-
return Object.keys(a).reduce(function(e, o) {
|
|
203
|
-
if (o === "__ignoreMap") return e;
|
|
204
|
-
let s = a[o];
|
|
205
|
-
if (k.test(o)) return B(o, s, e, r, { native: A.includes(i) });
|
|
206
|
-
if (o === "v-bind") return V(o, s, e, r);
|
|
207
|
-
if (D.test(o)) return H(o, s, e, r);
|
|
208
|
-
if (O.test(o)) return U(o, s, e, r);
|
|
209
|
-
let { attribute: c } = t(n, o);
|
|
210
|
-
return Array.isArray(s) && s.every((e) => typeof e == "string") ? (e[c] = s.join(" "), e) : (e[c] = s, e);
|
|
211
|
-
}, {});
|
|
212
|
-
}
|
|
213
|
-
function B(e, t, n, r, { native: i }) {
|
|
214
|
-
let a = e.match(/^v-model:([^=]+)/)?.[1] || "modelValue", o = i ? "value" : a, s = i ? "onInput" : `onUpdate:${a}`;
|
|
215
|
-
return n[o] = G(t, r.runtimeData), n[s] = (e) => {
|
|
216
|
-
r.updateRuntimeData(t, i ? e.target?.value : e);
|
|
217
|
-
}, n;
|
|
218
|
-
}
|
|
219
|
-
function V(e, t, n, r) {
|
|
220
|
-
let i = G(t, r);
|
|
221
|
-
return n = Object.assign(n, i), n;
|
|
222
|
-
}
|
|
223
|
-
function H(e, t, n, r) {
|
|
224
|
-
return e = e.replace(D, ""), n.on = n.on || {}, n.on[e] = () => G(t, r), n;
|
|
225
|
-
}
|
|
226
|
-
function U(e, t, n, r) {
|
|
227
|
-
return e = e.replace(O, ""), n[e] = G(t, r), n;
|
|
228
|
-
}
|
|
229
|
-
var W = (e) => {
|
|
230
|
-
if (typeof e == "string") {
|
|
231
|
-
if (Q(e)) return e;
|
|
232
|
-
let t = h(r(e), !1);
|
|
233
|
-
return !e || t?.name === "AsyncComponentWrapper" || typeof t == "string" ? t : "setup" in t ? u(() => new Promise((e) => e(t))) : t;
|
|
234
|
-
}
|
|
235
|
-
return e;
|
|
236
|
-
};
|
|
237
|
-
function G(e, t) {
|
|
238
|
-
let n = e.split(".").reduce((e, t) => typeof e == "object" ? e[t] : void 0, t);
|
|
239
|
-
return n === void 0 ? C(e) : n;
|
|
240
|
-
}
|
|
241
|
-
function K(e) {
|
|
242
|
-
let t = "";
|
|
243
|
-
for (let n of Object.keys(e.props || {})) if (!(!n.startsWith("#") && !n.startsWith("v-slot:"))) {
|
|
244
|
-
t = n.split(/[:#]/, 2)[1];
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
return t || E;
|
|
248
|
-
}
|
|
249
|
-
function q(e) {
|
|
250
|
-
return e.tag === "template";
|
|
251
|
-
}
|
|
252
|
-
function J(e) {
|
|
253
|
-
return j.has(e);
|
|
254
|
-
}
|
|
255
|
-
function Y(e) {
|
|
256
|
-
let t = [];
|
|
257
|
-
for (let n of e) {
|
|
258
|
-
let e = t[t.length - 1];
|
|
259
|
-
n.type === c && e?.type === c ? e.children += n.children : t.push(n);
|
|
260
|
-
}
|
|
261
|
-
return t;
|
|
262
|
-
}
|
|
263
|
-
async function X(e, t) {
|
|
264
|
-
if (!e) return;
|
|
265
|
-
let n = Array.from(new Set(r(e, t)));
|
|
266
|
-
await Promise.all(n.map(async (e) => {
|
|
267
|
-
if (e?.render || e?.ssrRender || e?.__ssrInlineRender) return;
|
|
268
|
-
let t = W(e);
|
|
269
|
-
t?.__asyncLoader && !t.__asyncResolved && await t.__asyncLoader();
|
|
270
|
-
}));
|
|
271
|
-
function r(e, t) {
|
|
272
|
-
let n = e.tag;
|
|
273
|
-
if (e.type === "text" || n === "binding" || e.type === "comment") return [];
|
|
274
|
-
let i = Z(e, t.tags);
|
|
275
|
-
if (J(i)) return [];
|
|
276
|
-
let a = [];
|
|
277
|
-
e.type !== "root" && !Q(i) && a.push(i);
|
|
278
|
-
for (let n of e.children || []) a.push(...r(n, t));
|
|
279
|
-
return a;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
function Z(e, t) {
|
|
283
|
-
let n = e.tag;
|
|
284
|
-
return !n || e.props?.__ignoreMap !== void 0 ? n : t[n] || t[r(n)] || t[o(e.tag)] || n;
|
|
285
|
-
}
|
|
286
|
-
function Q(t) {
|
|
287
|
-
return (typeof t == "string" ? M.has(t) : !1) || e.has(t);
|
|
288
|
-
}
|
|
289
|
-
//#endregion
|
|
290
|
-
export { F as default };
|