kss-modern 0.0.23 → 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,59 +51,65 @@ 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
|
+
// color contrast can't be calculated correctly yet in axe-core
|
|
64
|
+
// when using dark-mode. See: https://github.com/dequelabs/axe-core/issues/3605
|
|
65
|
+
"color-contrast": { enabled: !1 },
|
|
63
66
|
region: { enabled: !1 },
|
|
64
67
|
"landmark-one-main": { enabled: !1 }
|
|
65
68
|
}
|
|
66
69
|
}).catch(console.error);
|
|
67
|
-
if (!
|
|
70
|
+
if (!n)
|
|
68
71
|
throw new Error("No results from html-validate");
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
throw new Error(`Could not find element for selector: ${
|
|
76
|
-
|
|
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);
|
|
77
80
|
});
|
|
78
81
|
});
|
|
79
82
|
});
|
|
80
83
|
};
|
|
81
|
-
return l(
|
|
82
|
-
result:
|
|
83
|
-
targetMap:
|
|
84
|
+
return l(n.violations), l(n.inapplicable), l(n.passes), l(n.incomplete), {
|
|
85
|
+
result: n,
|
|
86
|
+
targetMap: m
|
|
84
87
|
};
|
|
85
88
|
}, e = async () => {
|
|
86
|
-
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, {
|
|
87
93
|
rules: {
|
|
88
94
|
"no-trailing-whitespace": "off",
|
|
89
95
|
"no-inline-style": "off"
|
|
90
96
|
}
|
|
91
|
-
}),
|
|
92
|
-
return await Promise.all(
|
|
93
|
-
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;
|
|
94
100
|
return {
|
|
95
|
-
...
|
|
101
|
+
...s,
|
|
96
102
|
ruleDescription: w
|
|
97
103
|
};
|
|
98
104
|
}));
|
|
99
105
|
}, [i, t] = await Promise.all([
|
|
100
106
|
u(),
|
|
101
107
|
e()
|
|
102
|
-
]),
|
|
108
|
+
]), o = new CustomEvent("accessibility-result", {
|
|
103
109
|
detail: {
|
|
104
110
|
axe: i,
|
|
105
111
|
htmlValidate: t
|
|
106
112
|
}
|
|
107
113
|
});
|
|
108
|
-
window.frameElement?.dispatchEvent(
|
|
109
|
-
}) : new URLSearchParams(window.location.search).get("modifier") &&
|
|
114
|
+
window.frameElement?.dispatchEvent(o);
|
|
115
|
+
}) : new URLSearchParams(window.location.search).get("modifier") && d.fromUrl();
|