kss-modern 0.0.24 → 0.0.25
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
CHANGED
|
@@ -833,7 +833,7 @@ async function generateFullPageFile(data) {
|
|
|
833
833
|
<link rel="icon" type="image/svg+xml" href="/styleguide-assets/favicon/fullpage-light.svg">
|
|
834
834
|
`}
|
|
835
835
|
${data.ogImageUrl ? `<meta property="og:image" content="${data.ogImageUrl}">` : ""}
|
|
836
|
-
<script type="module" src="/styleguide-assets/fullpage-
|
|
836
|
+
<script type="module" src="/styleguide-assets/fullpage-DOmxO-jm.js"><\/script>
|
|
837
837
|
${computedStyleTags}
|
|
838
838
|
</head>
|
|
839
839
|
<body${data.page.bodyclass ? ` class="${data.page.bodyclass}"` : ""}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class d {
|
|
2
2
|
modifier;
|
|
3
3
|
placeholder;
|
|
4
4
|
constructor(e) {
|
|
@@ -13,19 +13,19 @@ class c {
|
|
|
13
13
|
const i = window.frameElement.getAttribute("data-modifier");
|
|
14
14
|
if (!i)
|
|
15
15
|
return null;
|
|
16
|
-
const t = i.split(".").filter((r) => r.length > 0).join(" "),
|
|
17
|
-
return
|
|
16
|
+
const t = i.split(".").filter((r) => r.length > 0).join(" "), o = new d({ modifier: t });
|
|
17
|
+
return o.initialize(e), o;
|
|
18
18
|
}
|
|
19
19
|
static fromUrl(e = document) {
|
|
20
20
|
const t = new URLSearchParams(window.location.search).get("modifier");
|
|
21
21
|
if (!t)
|
|
22
22
|
return null;
|
|
23
|
-
const
|
|
23
|
+
const o = t.split(".").filter((n) => n.length > 0).join(" "), r = new d({ modifier: o });
|
|
24
24
|
return r.initialize(e), r;
|
|
25
25
|
}
|
|
26
26
|
replaceAll(e) {
|
|
27
|
-
const i = encodeURIComponent(JSON.stringify(this.placeholder)), t = JSON.stringify({ modifierClass: this.placeholder }),
|
|
28
|
-
return e.replace(new RegExp(this.escapeRegExp(this.placeholder), "g"), this.modifier).replace(new RegExp(this.escapeRegExp(i), "g"), this.modifier).replace(new RegExp(this.escapeRegExp(
|
|
27
|
+
const i = encodeURIComponent(JSON.stringify(this.placeholder)), t = JSON.stringify({ modifierClass: this.placeholder }), o = encodeURIComponent(t);
|
|
28
|
+
return e.replace(new RegExp(this.escapeRegExp(this.placeholder), "g"), this.modifier).replace(new RegExp(this.escapeRegExp(i), "g"), this.modifier).replace(new RegExp(this.escapeRegExp(o), "g"), this.modifier);
|
|
29
29
|
}
|
|
30
30
|
escapeRegExp(e) {
|
|
31
31
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -51,14 +51,14 @@ class c {
|
|
|
51
51
|
}
|
|
52
52
|
replaceInElementAttributes(e) {
|
|
53
53
|
Array.from(e.attributes).forEach((i) => {
|
|
54
|
-
const t = i.value,
|
|
55
|
-
t !==
|
|
54
|
+
const t = i.value, o = this.replaceAll(t);
|
|
55
|
+
t !== o && (i.value = o);
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
window.frameElement ? (window.frameElement.getAttribute("data-preview") === "true" && document.documentElement.classList.add("styleguide-preview"), window.frameElement.hasAttribute("data-modifier") &&
|
|
59
|
+
window.frameElement ? (window.frameElement.getAttribute("data-preview") === "true" && document.documentElement.classList.add("styleguide-preview"), window.frameElement.hasAttribute("data-modifier") && d.fromIframe(), window.runAccessibilityTest = async () => {
|
|
60
60
|
const u = async () => {
|
|
61
|
-
const { default: r } = await import("./axe-A2Ows1Aj.js").then((
|
|
61
|
+
const { default: r } = await import("./axe-A2Ows1Aj.js").then((a) => a.a), n = await r.run("body", {
|
|
62
62
|
rules: {
|
|
63
63
|
// color contrast can't be calculated correctly yet in axe-core
|
|
64
64
|
// when using dark-mode. See: https://github.com/dequelabs/axe-core/issues/3605
|
|
@@ -67,46 +67,49 @@ window.frameElement ? (window.frameElement.getAttribute("data-preview") === "tru
|
|
|
67
67
|
"landmark-one-main": { enabled: !1 }
|
|
68
68
|
}
|
|
69
69
|
}).catch(console.error);
|
|
70
|
-
if (!
|
|
70
|
+
if (!n)
|
|
71
71
|
throw new Error("No results from html-validate");
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
78
|
-
throw new Error(`Could not find element for selector: ${
|
|
79
|
-
|
|
72
|
+
const m = /* @__PURE__ */ new Map(), l = (a) => {
|
|
73
|
+
a.forEach((f) => {
|
|
74
|
+
f.nodes.forEach((p) => {
|
|
75
|
+
p.target.forEach((c) => {
|
|
76
|
+
const s = r.utils.shadowSelect(c);
|
|
77
|
+
if (!s)
|
|
78
|
+
throw new Error(`Could not find element for selector: ${c}`);
|
|
79
|
+
m.set(c, s);
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
|
-
return l(
|
|
85
|
-
result:
|
|
86
|
-
targetMap:
|
|
84
|
+
return l(n.violations), l(n.inapplicable), l(n.passes), l(n.incomplete), {
|
|
85
|
+
result: n,
|
|
86
|
+
targetMap: m
|
|
87
87
|
};
|
|
88
88
|
}, e = async () => {
|
|
89
|
-
const { HtmlValidate: r, StaticConfigLoader:
|
|
89
|
+
const { HtmlValidate: r, StaticConfigLoader: n } = await import("./browser-Bjhprfz3.js"), m = new n(), l = new r(m), a = await fetch(window.location.href);
|
|
90
|
+
if (!a.ok)
|
|
91
|
+
throw new Error(`Failed to fetch document for html-validate: ${a.status} ${a.statusText}`);
|
|
92
|
+
const f = await a.text(), { results: p } = await l.validateString(f, {
|
|
90
93
|
rules: {
|
|
91
94
|
"no-trailing-whitespace": "off",
|
|
92
95
|
"no-inline-style": "off"
|
|
93
96
|
}
|
|
94
|
-
}),
|
|
95
|
-
return await Promise.all(
|
|
96
|
-
const w = (await l.getContextualDocumentation(
|
|
97
|
+
}), c = p.map((s) => s.messages).flat();
|
|
98
|
+
return await Promise.all(c.map(async (s) => {
|
|
99
|
+
const w = (await l.getContextualDocumentation(s))?.description;
|
|
97
100
|
return {
|
|
98
|
-
...
|
|
101
|
+
...s,
|
|
99
102
|
ruleDescription: w
|
|
100
103
|
};
|
|
101
104
|
}));
|
|
102
105
|
}, [i, t] = await Promise.all([
|
|
103
106
|
u(),
|
|
104
107
|
e()
|
|
105
|
-
]),
|
|
108
|
+
]), o = new CustomEvent("accessibility-result", {
|
|
106
109
|
detail: {
|
|
107
110
|
axe: i,
|
|
108
111
|
htmlValidate: t
|
|
109
112
|
}
|
|
110
113
|
});
|
|
111
|
-
window.frameElement?.dispatchEvent(
|
|
112
|
-
}) : new URLSearchParams(window.location.search).get("modifier") &&
|
|
114
|
+
window.frameElement?.dispatchEvent(o);
|
|
115
|
+
}) : new URLSearchParams(window.location.search).get("modifier") && d.fromUrl();
|