kss-modern 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/lib/index.mjs +2 -2
- package/dist/styleguide-assets/.vite/manifest.json +10 -10
- package/dist/styleguide-assets/{clipboard-CQ7U7_P0.js → clipboard-DULMn8xf.js} +1 -1
- package/dist/styleguide-assets/{html-validator-M0X8x6ag.js → html-validator-DLEAmrmB.js} +51 -43
- package/dist/styleguide-assets/{icons-IQYIngUi.js → icons-s_oHNZd6.js} +1 -1
- package/dist/styleguide-assets/{preview-DxsvGJsw.js → preview-Cknxd_cP.js} +3 -3
- package/dist/styleguide-assets/preview-CzDBmeSK.js +1 -0
- package/package.json +1 -1
- package/dist/styleguide-assets/preview-BqaqMVtQ.js +0 -1
package/dist/node/lib/index.mjs
CHANGED
|
@@ -145,7 +145,7 @@ async function logicalWriteFile(filepath, content) {
|
|
|
145
145
|
}
|
|
146
146
|
function fixAccessibilityIssues(html) {
|
|
147
147
|
let parsedMarkup = html;
|
|
148
|
-
const omitValue = ["required", "disabled", "checked", "selected", "multiple", "readonly"];
|
|
148
|
+
const omitValue = ["required", "disabled", "checked", "selected", "multiple", "readonly", "open"];
|
|
149
149
|
omitValue.forEach((value) => {
|
|
150
150
|
parsedMarkup = parsedMarkup.replaceAll(`${value}="${value}"`, value).replaceAll(`${value}=""`, value);
|
|
151
151
|
});
|
|
@@ -1697,7 +1697,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
1697
1697
|
});
|
|
1698
1698
|
;
|
|
1699
1699
|
<\/script>
|
|
1700
|
-
<script type="module" src="/styleguide-assets/preview-
|
|
1700
|
+
<script type="module" src="/styleguide-assets/preview-CzDBmeSK.js"><\/script>
|
|
1701
1701
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
1702
1702
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-600-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
1703
1703
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-300-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"__commonjsHelpers-C6fGbg64.js"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
|
-
"_preview-
|
|
15
|
-
"file": "preview-
|
|
14
|
+
"_preview-Cknxd_cP.js": {
|
|
15
|
+
"file": "preview-Cknxd_cP.js",
|
|
16
16
|
"name": "preview",
|
|
17
17
|
"dynamicImports": [
|
|
18
18
|
"client/lib/html-validator.ts",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
"client/lib/clipboard.ts": {
|
|
35
|
-
"file": "clipboard-
|
|
35
|
+
"file": "clipboard-DULMn8xf.js",
|
|
36
36
|
"name": "clipboard",
|
|
37
37
|
"src": "client/lib/clipboard.ts",
|
|
38
38
|
"isDynamicEntry": true,
|
|
39
39
|
"imports": [
|
|
40
|
-
"_preview-
|
|
40
|
+
"_preview-Cknxd_cP.js"
|
|
41
41
|
]
|
|
42
42
|
},
|
|
43
43
|
"client/lib/editor-select.ts": {
|
|
@@ -47,21 +47,21 @@
|
|
|
47
47
|
"isDynamicEntry": true
|
|
48
48
|
},
|
|
49
49
|
"client/lib/html-validator.ts": {
|
|
50
|
-
"file": "html-validator-
|
|
50
|
+
"file": "html-validator-DLEAmrmB.js",
|
|
51
51
|
"name": "html-validator",
|
|
52
52
|
"src": "client/lib/html-validator.ts",
|
|
53
53
|
"isDynamicEntry": true,
|
|
54
54
|
"imports": [
|
|
55
|
-
"_preview-
|
|
55
|
+
"_preview-Cknxd_cP.js"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
58
|
"client/lib/icons.ts": {
|
|
59
|
-
"file": "icons-
|
|
59
|
+
"file": "icons-s_oHNZd6.js",
|
|
60
60
|
"name": "icons",
|
|
61
61
|
"src": "client/lib/icons.ts",
|
|
62
62
|
"isDynamicEntry": true,
|
|
63
63
|
"imports": [
|
|
64
|
-
"_preview-
|
|
64
|
+
"_preview-Cknxd_cP.js"
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"client/preview-inline.ts": {
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
"isEntry": true
|
|
72
72
|
},
|
|
73
73
|
"client/preview.ts": {
|
|
74
|
-
"file": "preview-
|
|
74
|
+
"file": "preview-CzDBmeSK.js",
|
|
75
75
|
"name": "preview",
|
|
76
76
|
"src": "client/preview.ts",
|
|
77
77
|
"isEntry": true,
|
|
78
78
|
"imports": [
|
|
79
|
-
"_preview-
|
|
79
|
+
"_preview-Cknxd_cP.js"
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
82
|
"node_modules/html-validate/dist/esm/browser.js": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as $, a as p } from "./preview-
|
|
1
|
+
import { b as $, a as p } from "./preview-Cknxd_cP.js";
|
|
2
2
|
function C(n, i, e) {
|
|
3
3
|
var t = e || {}, a = t.noTrailing, s = a === void 0 ? !1 : a, r = t.noLeading, u = r === void 0 ? !1 : r, c = t.debounceMode, m = c === void 0 ? void 0 : c, d, b = !1, w = 0;
|
|
4
4
|
function E() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as L } from "./preview-
|
|
1
|
+
import { h as L } from "./preview-Cknxd_cP.js";
|
|
2
2
|
const f = (l, a) => l ? a() : "";
|
|
3
3
|
function $(l, a) {
|
|
4
4
|
return l.map((m, h) => a(m, h)).join("");
|
|
@@ -27,7 +27,7 @@ const A = T(), E = {
|
|
|
27
27
|
"font-style: italic"
|
|
28
28
|
].join(";")
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function V(l, a) {
|
|
31
31
|
console.group("%cValidation Error", E.header), console.info(
|
|
32
32
|
"%c%o",
|
|
33
33
|
E.elementStyle,
|
|
@@ -42,13 +42,13 @@ async function R(l, a, m) {
|
|
|
42
42
|
const h = l.getAttribute("data-code-audit-iframe");
|
|
43
43
|
if (!h)
|
|
44
44
|
throw new Error("No code audit template selector provided");
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
45
|
+
const d = document.querySelector(`#${h}`);
|
|
46
|
+
if (!d)
|
|
47
47
|
throw new Error("Code audit template not found");
|
|
48
|
-
if (!
|
|
48
|
+
if (!d.contentWindow)
|
|
49
49
|
throw new Error("Code audit iframe has no content window");
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
50
|
+
const w = a.querySelector(".audit-results");
|
|
51
|
+
if (!w)
|
|
52
52
|
throw new Error("No audit results list found");
|
|
53
53
|
window.validator = {
|
|
54
54
|
referenceMap: /* @__PURE__ */ new Map(),
|
|
@@ -60,22 +60,22 @@ async function R(l, a, m) {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
const u = await new Promise((e, o) => {
|
|
63
|
-
const
|
|
63
|
+
const i = setTimeout(() => {
|
|
64
64
|
o(new Error("Accessibility audit timed out"));
|
|
65
65
|
}, 3e4), n = (v) => {
|
|
66
66
|
const y = v;
|
|
67
|
-
clearTimeout(
|
|
67
|
+
clearTimeout(i), d.removeEventListener("accessibility-result", n), e(y.detail);
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
const r =
|
|
71
|
-
r.runAccessibilityTest ? r.runAccessibilityTest() : (clearTimeout(
|
|
72
|
-
}),
|
|
69
|
+
d.addEventListener("accessibility-result", n);
|
|
70
|
+
const r = d.contentWindow;
|
|
71
|
+
r.runAccessibilityTest ? r.runAccessibilityTest() : (clearTimeout(i), d.removeEventListener("accessibility-result", n), o(new Error("runAxe function not found in iframe")));
|
|
72
|
+
}), c = {
|
|
73
73
|
violations: [],
|
|
74
74
|
incomplete: [],
|
|
75
75
|
passes: [],
|
|
76
76
|
inapplicable: []
|
|
77
|
-
},
|
|
78
|
-
const
|
|
77
|
+
}, g = (e, o) => {
|
|
78
|
+
const i = o.map((n) => ({
|
|
79
79
|
id: n.id,
|
|
80
80
|
description: n.description,
|
|
81
81
|
helpUrl: n.helpUrl,
|
|
@@ -86,9 +86,9 @@ async function R(l, a, m) {
|
|
|
86
86
|
target: r.target
|
|
87
87
|
}))
|
|
88
88
|
}));
|
|
89
|
-
|
|
89
|
+
c[e].push(...i);
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
g("violations", u.axe.result.violations), g("incomplete", u.axe.result.incomplete), g("passes", u.axe.result.passes), g("inapplicable", u.axe.result.inapplicable);
|
|
92
92
|
function S(e, o) {
|
|
93
93
|
switch (o) {
|
|
94
94
|
case "off":
|
|
@@ -105,7 +105,15 @@ async function R(l, a, m) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
u.htmlValidate.forEach((e) => {
|
|
108
|
-
|
|
108
|
+
const o = c.violations.find((i) => i.id === e.ruleId);
|
|
109
|
+
if (o) {
|
|
110
|
+
o.nodes.push({
|
|
111
|
+
type: "htmlvalidate",
|
|
112
|
+
selector: e.selector
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
c.violations.push({
|
|
109
117
|
id: e.ruleId,
|
|
110
118
|
description: e.ruleDescription || e.message,
|
|
111
119
|
helpUrl: e.ruleUrl || "",
|
|
@@ -116,16 +124,16 @@ async function R(l, a, m) {
|
|
|
116
124
|
}]
|
|
117
125
|
});
|
|
118
126
|
});
|
|
119
|
-
const I = u.axe.targetMap, x = (e, o,
|
|
120
|
-
const n = e.charAt(0).toUpperCase() + e.slice(1), r = ["critical", "serious", "moderate", "minor"], v =
|
|
121
|
-
const p = r.indexOf(t.impact || "minor"), b = r.indexOf(
|
|
127
|
+
const I = u.axe.targetMap, x = (e, o, i) => {
|
|
128
|
+
const n = e.charAt(0).toUpperCase() + e.slice(1), r = ["critical", "serious", "moderate", "minor"], v = i.toSorted((t, s) => {
|
|
129
|
+
const p = r.indexOf(t.impact || "minor"), b = r.indexOf(s.impact || "minor");
|
|
122
130
|
return p - b;
|
|
123
131
|
}), y = (t) => {
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
132
|
+
const s = t.target.map((p) => I.get(p)).filter(Boolean);
|
|
133
|
+
if (s.length === 0)
|
|
126
134
|
throw new Error(`No elements found for axe-core target: ${t.target}`);
|
|
127
135
|
return `
|
|
128
|
-
${$(
|
|
136
|
+
${$(s, (p) => {
|
|
129
137
|
const b = A.next().value;
|
|
130
138
|
return window.validator.referenceMap.set(b, p), `
|
|
131
139
|
<button
|
|
@@ -138,11 +146,11 @@ async function R(l, a, m) {
|
|
|
138
146
|
})}
|
|
139
147
|
`;
|
|
140
148
|
}, M = (t) => {
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
149
|
+
const s = d.contentWindow?.document.querySelector(t.selector);
|
|
150
|
+
if (!s)
|
|
143
151
|
throw new Error(`Element not found for selector: ${t.selector}`);
|
|
144
152
|
const p = A.next().value;
|
|
145
|
-
return window.validator.referenceMap.set(p,
|
|
153
|
+
return window.validator.referenceMap.set(p, s), `
|
|
146
154
|
<button
|
|
147
155
|
class="block font-mono py-1.5 text-[13px] text-blue-600 text-sm cursor-pointer text-left"
|
|
148
156
|
onclick="console.log(window.validator.referenceMap.get('${p}')); window.validator.logReferenceAlert(this)"
|
|
@@ -159,7 +167,7 @@ async function R(l, a, m) {
|
|
|
159
167
|
<h3 class="px-6 py-4 text-sm font-semibold leading-[1]">
|
|
160
168
|
<span class="mr-2" aria-hidden="true">${o}</span>
|
|
161
169
|
<span class="text-styleguide-highlight">${n}:</span>
|
|
162
|
-
<span class="ml-2">(${
|
|
170
|
+
<span class="ml-2">(${i.length})</span>
|
|
163
171
|
</h3>
|
|
164
172
|
</summary>
|
|
165
173
|
|
|
@@ -181,7 +189,7 @@ async function R(l, a, m) {
|
|
|
181
189
|
|
|
182
190
|
<div class="pt-2 pb-6 text-sm code-audit-container">
|
|
183
191
|
<p class="mb-3">
|
|
184
|
-
${t.description
|
|
192
|
+
${t.description}
|
|
185
193
|
</p>
|
|
186
194
|
|
|
187
195
|
<p class="mb-3 pb-3 border-b border-styleguide-border">
|
|
@@ -202,10 +210,10 @@ async function R(l, a, m) {
|
|
|
202
210
|
<h3 class="font-semibold mb-2">Affected nodes (${t.nodes.length}):</h3>
|
|
203
211
|
|
|
204
212
|
<ol class="!pl-0 !list-none">
|
|
205
|
-
${$(t.nodes, (
|
|
213
|
+
${$(t.nodes, (s) => `
|
|
206
214
|
<li>
|
|
207
|
-
${f(
|
|
208
|
-
${f(
|
|
215
|
+
${f(s.type === "axe", () => `${y(s)}`)}
|
|
216
|
+
${f(s.type === "htmlvalidate", () => `${M(s)}`)}
|
|
209
217
|
</li>
|
|
210
218
|
`)}
|
|
211
219
|
</ol>
|
|
@@ -220,26 +228,26 @@ async function R(l, a, m) {
|
|
|
220
228
|
</li>
|
|
221
229
|
`)}
|
|
222
230
|
`;
|
|
223
|
-
}, k =
|
|
224
|
-
|
|
225
|
-
${x("violations", k,
|
|
226
|
-
${x("incomplete", C,
|
|
227
|
-
${x("passes", "🟢",
|
|
228
|
-
${x("inapplicable", "⚪",
|
|
229
|
-
`,
|
|
231
|
+
}, k = c.violations.length > 0 ? "🔴" : "🟢", C = c.incomplete.length > 0 ? "🟠" : "🟢";
|
|
232
|
+
w.innerHTML = `
|
|
233
|
+
${x("violations", k, c.violations)}
|
|
234
|
+
${x("incomplete", C, c.incomplete)}
|
|
235
|
+
${x("passes", "🟢", c.passes)}
|
|
236
|
+
${x("inapplicable", "⚪", c.inapplicable)}
|
|
237
|
+
`, w.querySelectorAll("[data-source-code]").forEach((e) => L(e)), w.querySelectorAll("[data-iframe-selector]").forEach((e) => {
|
|
230
238
|
const o = e.getAttribute("data-iframe-selector");
|
|
231
239
|
if (!o)
|
|
232
240
|
throw new Error("No message found");
|
|
233
241
|
e.addEventListener("click", async () => {
|
|
234
242
|
await m();
|
|
235
|
-
const
|
|
236
|
-
if (!
|
|
243
|
+
const i = e.textContent;
|
|
244
|
+
if (!i)
|
|
237
245
|
throw new Error("No selector found");
|
|
238
|
-
const n =
|
|
246
|
+
const n = d.contentDocument?.querySelectorAll(i);
|
|
239
247
|
if (!n)
|
|
240
248
|
throw new Error("No elements found");
|
|
241
249
|
n.forEach((r) => {
|
|
242
|
-
|
|
250
|
+
V(o, r), r.style.outline = "2px solid red", r.scrollIntoView({ behavior: "smooth", block: "center" }), setTimeout(() => r.style.outline = "", 5e3);
|
|
243
251
|
});
|
|
244
252
|
});
|
|
245
253
|
});
|
|
@@ -3310,7 +3310,7 @@ rn.length > 0 && rn.forEach((e) => {
|
|
|
3310
3310
|
});
|
|
3311
3311
|
const Se = document.querySelectorAll("[data-code-audit-iframe]"), Re = document.querySelector("#code-audit-dialog"), on = document.querySelector(".dialog-backdrop");
|
|
3312
3312
|
Se.length > 0 && Re && on && (async () => {
|
|
3313
|
-
const { auditCode: e } = await import("./html-validator-
|
|
3313
|
+
const { auditCode: e } = await import("./html-validator-DLEAmrmB.js"), { show: t, close: n } = ys(Re, on);
|
|
3314
3314
|
Se.forEach((s) => s.addEventListener("click", async () => {
|
|
3315
3315
|
Se.forEach((r) => r.setAttribute("aria-expanded", "false")), s.setAttribute("disabled", ""), await e(s, Re, n), s.removeAttribute("disabled"), s.setAttribute("aria-expanded", "true"), await t(
|
|
3316
3316
|
void 0,
|
|
@@ -3323,9 +3323,9 @@ Se.length > 0 && Re && on && (async () => {
|
|
|
3323
3323
|
}));
|
|
3324
3324
|
})();
|
|
3325
3325
|
const an = document.querySelector("#icon-search-input"), ln = document.querySelector("#icon-search-input-reset"), un = document.querySelector("#icon-search-list");
|
|
3326
|
-
an && un && ln && import("./icons-
|
|
3326
|
+
an && un && ln && import("./icons-s_oHNZd6.js").then(({ default: e }) => e(an, un, ln)).catch(console.error);
|
|
3327
3327
|
const Vs = "data-clipboard-value", cn = document.querySelectorAll(`button[${Vs}]`);
|
|
3328
|
-
cn.length > 0 && import("./clipboard-
|
|
3328
|
+
cn.length > 0 && import("./clipboard-DULMn8xf.js").then(({ default: e }) => e(cn, Vs)).catch(console.error);
|
|
3329
3329
|
const fn = document.querySelectorAll(".markdown-container-folded");
|
|
3330
3330
|
fn.length > 0 && fn.forEach((e) => {
|
|
3331
3331
|
const t = e.querySelector(".markdown-container");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./preview-Cknxd_cP.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./preview-DxsvGJsw.js";
|