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.
@@ -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-CfZ3ctFE.js"><\/script>
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}"` : ""}>
@@ -22,7 +22,7 @@
22
22
  ]
23
23
  },
24
24
  "client/fullpage.ts": {
25
- "file": "fullpage-CfZ3ctFE.js",
25
+ "file": "fullpage-DOmxO-jm.js",
26
26
  "name": "fullpage",
27
27
  "src": "client/fullpage.ts",
28
28
  "isEntry": true,
@@ -1,4 +1,4 @@
1
- class c {
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(" "), n = new c({ modifier: t });
17
- return n.initialize(e), n;
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 n = t.split(".").filter((o) => o.length > 0).join(" "), r = new c({ modifier: n });
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 }), n = 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(n), "g"), this.modifier);
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, n = this.replaceAll(t);
55
- t !== n && (i.value = n);
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") && c.fromIframe(), window.runAccessibilityTest = async () => {
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((s) => s.a), o = await r.run("body", {
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 (!o)
70
+ if (!n)
71
71
  throw new Error("No results from html-validate");
72
- const d = /* @__PURE__ */ new Map(), l = (s) => {
73
- s.forEach((m) => {
74
- m.nodes.forEach((f) => {
75
- f.target.forEach((a) => {
76
- const p = r.utils.shadowSelect(a);
77
- if (!p)
78
- throw new Error(`Could not find element for selector: ${a}`);
79
- d.set(a, p);
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(o.violations), l(o.inapplicable), l(o.passes), l(o.incomplete), {
85
- result: o,
86
- targetMap: d
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: o } = await import("./browser-Bjhprfz3.js"), d = new o(), l = new r(d), s = document.documentElement.outerHTML, { results: m } = await l.validateString(s, {
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
- }), f = m.map((a) => a.messages).flat();
95
- return await Promise.all(f.map(async (a) => {
96
- const w = (await l.getContextualDocumentation(a))?.description;
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
- ...a,
101
+ ...s,
99
102
  ruleDescription: w
100
103
  };
101
104
  }));
102
105
  }, [i, t] = await Promise.all([
103
106
  u(),
104
107
  e()
105
- ]), n = new CustomEvent("accessibility-result", {
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(n);
112
- }) : new URLSearchParams(window.location.search).get("modifier") && c.fromUrl();
114
+ window.frameElement?.dispatchEvent(o);
115
+ }) : new URLSearchParams(window.location.search).get("modifier") && d.fromUrl();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kss-modern",
3
3
  "type": "module",
4
- "version": "0.0.24",
4
+ "version": "0.0.25",
5
5
  "description": "Modern KSS compatible styleguide generator",
6
6
  "main": "./dist/node/lib/index.mjs",
7
7
  "types": "./dist/node/lib/index.d.ts",