kss-modern 1.3.0-beta.2 → 1.4.0
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 +2 -1
- package/dist/node/lib/index.d.mts +20 -0
- package/dist/node/lib/index.d.ts +20 -0
- package/dist/node/lib/index.mjs +86 -27
- package/dist/node/lib/pug/worker.mjs +1 -1
- package/dist/node/shared/{kss-modern.BQiL0d8K.mjs → kss-modern.DQ_V-57G.mjs} +4 -1
- package/dist/styleguide-assets/.vite/manifest.json +43 -9
- package/dist/styleguide-assets/{a11y-report-BgeWSrYe.js → a11y-report-BFnWMaWr.js} +13 -12
- package/dist/styleguide-assets/{section-previews-D-Mr2eVX.js → audit-runner-Ch009v98.js} +1 -10
- package/dist/styleguide-assets/{fullpage-D-fU_bAa.js → fullpage-B7IV3eSt.js} +57 -57
- package/dist/styleguide-assets/global-theme-select-DM7GN8Dn.js +7 -0
- package/dist/styleguide-assets/{html-validator-DJGwslsw.js → html-validator-sgeZtEeH.js} +19 -18
- package/dist/styleguide-assets/kss-modern-Cg1aeKi1.css +3 -0
- package/dist/styleguide-assets/preview-theme-DS4xqXIm.js +50 -0
- package/dist/styleguide-assets/{preview-DEipbLLB.js → preview-tkLDBWOv.js} +8 -4
- package/dist/styleguide-assets/section-previews-CnlrC8Gz.js +10 -0
- package/dist/styleguide-assets/section-theme-select-BHhiP4pl.js +12 -0
- package/package.json +1 -1
- package/dist/styleguide-assets/kss-modern-BJ971T05.css +0 -3
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ A modern, KSS-compatible styleguide generator. Parses KSS comment blocks from CS
|
|
|
6
6
|
|
|
7
7
|
- KSS-compatible comment parsing from CSS/SCSS files
|
|
8
8
|
- Live component previews with modifier variants
|
|
9
|
+
- Theme dropdowns — a global one in the header (`themes` option) and per-section ones (`Themes:`) — switch previews between the default and themed views
|
|
9
10
|
- Pug template support via worker thread pool
|
|
10
11
|
- Color palette and icon gallery documentation
|
|
11
12
|
- Figma embed integration with light/dark theme sync
|
|
@@ -47,7 +48,7 @@ This scans all `.css` and `.scss` files in `contentDir` for KSS comment blocks a
|
|
|
47
48
|
## Documentation
|
|
48
49
|
|
|
49
50
|
- **[Setup Guide](docs/setup.md)** — Installation, configuration reference, watch mode, project structure, and API reference
|
|
50
|
-
- **[Usage Guide](docs/usage.md)** — Writing KSS comments, all available properties (markup, modifiers, colors, icons, Markdown, Figma, status, wrapper, html/body classes, etc.), and styleguide UI features
|
|
51
|
+
- **[Usage Guide](docs/usage.md)** — Writing KSS comments, all available properties (markup, modifiers, colors, icons, Markdown, Figma, status, wrapper, html/body classes, themes, etc.), and styleguide UI features
|
|
51
52
|
- **[Changelog](CHANGELOG.md)** — Version history and release notes
|
|
52
53
|
|
|
53
54
|
## Basic KSS Example
|
|
@@ -4,6 +4,14 @@ interface SectionMeta {
|
|
|
4
4
|
}[];
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* One entry of a section's `Themes:` block — a theme class (or class list, e.g. `.theme-a.compact`)
|
|
9
|
+
* written as in the KSS comment, plus the label shown in the theme dropdown.
|
|
10
|
+
*/
|
|
11
|
+
interface ThemeOption {
|
|
12
|
+
value: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
7
15
|
interface ColorObject {
|
|
8
16
|
name?: string;
|
|
9
17
|
color: string;
|
|
@@ -31,6 +39,8 @@ interface in2Section {
|
|
|
31
39
|
wrapper?: string;
|
|
32
40
|
htmlclass?: string;
|
|
33
41
|
bodyclass?: string;
|
|
42
|
+
/** Theme contexts offered by the section's theme dropdown; classes are applied to the preview's <html>. */
|
|
43
|
+
themes?: ThemeOption[];
|
|
34
44
|
source: {
|
|
35
45
|
css: {
|
|
36
46
|
file: string;
|
|
@@ -95,6 +105,16 @@ interface StyleguideConfiguration {
|
|
|
95
105
|
contentDir: `${string}/`;
|
|
96
106
|
projectTitle: string;
|
|
97
107
|
deactivateDarkMode?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Themes offered by the header's global **Theme** dropdown. Each entry is a theme class (or class
|
|
110
|
+
* list — `'theme-midnight'`, `'.theme-midnight.compact'`) that is added to the `<html>` of every
|
|
111
|
+
* preview iframe while selected, plus the label shown in the dropdown. A section's own `Themes:`
|
|
112
|
+
* dropdown overrides the global theme for that section.
|
|
113
|
+
*/
|
|
114
|
+
themes?: {
|
|
115
|
+
value: string;
|
|
116
|
+
label: string;
|
|
117
|
+
}[];
|
|
98
118
|
launchInEditor?: boolean | {
|
|
99
119
|
rootDir: string;
|
|
100
120
|
};
|
package/dist/node/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ interface SectionMeta {
|
|
|
4
4
|
}[];
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* One entry of a section's `Themes:` block — a theme class (or class list, e.g. `.theme-a.compact`)
|
|
9
|
+
* written as in the KSS comment, plus the label shown in the theme dropdown.
|
|
10
|
+
*/
|
|
11
|
+
interface ThemeOption {
|
|
12
|
+
value: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
7
15
|
interface ColorObject {
|
|
8
16
|
name?: string;
|
|
9
17
|
color: string;
|
|
@@ -31,6 +39,8 @@ interface in2Section {
|
|
|
31
39
|
wrapper?: string;
|
|
32
40
|
htmlclass?: string;
|
|
33
41
|
bodyclass?: string;
|
|
42
|
+
/** Theme contexts offered by the section's theme dropdown; classes are applied to the preview's <html>. */
|
|
43
|
+
themes?: ThemeOption[];
|
|
34
44
|
source: {
|
|
35
45
|
css: {
|
|
36
46
|
file: string;
|
|
@@ -95,6 +105,16 @@ interface StyleguideConfiguration {
|
|
|
95
105
|
contentDir: `${string}/`;
|
|
96
106
|
projectTitle: string;
|
|
97
107
|
deactivateDarkMode?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Themes offered by the header's global **Theme** dropdown. Each entry is a theme class (or class
|
|
110
|
+
* list — `'theme-midnight'`, `'.theme-midnight.compact'`) that is added to the `<html>` of every
|
|
111
|
+
* preview iframe while selected, plus the label shown in the dropdown. A section's own `Themes:`
|
|
112
|
+
* dropdown overrides the global theme for that section.
|
|
113
|
+
*/
|
|
114
|
+
themes?: {
|
|
115
|
+
value: string;
|
|
116
|
+
label: string;
|
|
117
|
+
}[];
|
|
98
118
|
launchInEditor?: boolean | {
|
|
99
119
|
rootDir: string;
|
|
100
120
|
};
|
package/dist/node/lib/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import process from 'node:process';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import fs from 'fs-extra';
|
|
5
5
|
import { glob } from 'tinyglobby';
|
|
6
|
-
import { l as logger, s as sanitizeSpecialCharacters, I as INSERT_VITE_PUG_TAG_RE, P as PUG_SRC_RE, a as PUG_ERROR_OVERLAY_TAG, c as compileMarkup, p as pugErrorFile, b as slugify, d as sectionSanitizeId, e as stripPugErrorOverlay, f as ensureStartingSlash, g as generateId, r as replaceWrapperContent, h as htmlToSearchText } from '../shared/kss-modern.
|
|
7
|
-
export { i as createLogger } from '../shared/kss-modern.
|
|
6
|
+
import { l as logger, s as sanitizeSpecialCharacters, I as INSERT_VITE_PUG_TAG_RE, P as PUG_SRC_RE, t as themeClassList, a as PUG_ERROR_OVERLAY_TAG, c as compileMarkup, p as pugErrorFile, b as slugify, d as sectionSanitizeId, e as stripPugErrorOverlay, f as ensureStartingSlash, g as generateId, r as replaceWrapperContent, h as htmlToSearchText } from '../shared/kss-modern.DQ_V-57G.mjs';
|
|
7
|
+
export { i as createLogger } from '../shared/kss-modern.DQ_V-57G.mjs';
|
|
8
8
|
import htmlLang from '@shikijs/langs/html';
|
|
9
9
|
import markdownLang from '@shikijs/langs/markdown';
|
|
10
10
|
import scssLang from '@shikijs/langs/scss';
|
|
@@ -506,6 +506,16 @@ function parseIcons(text) {
|
|
|
506
506
|
});
|
|
507
507
|
return icons;
|
|
508
508
|
}
|
|
509
|
+
function parseThemes(text) {
|
|
510
|
+
return text.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).map((line) => {
|
|
511
|
+
const [value, ...labelParts] = line.split(/\s+-\s+/);
|
|
512
|
+
const description = labelParts.join(" - ").trim();
|
|
513
|
+
return {
|
|
514
|
+
value: value.trim(),
|
|
515
|
+
description: description.length > 0 ? description : themeClassList(value)
|
|
516
|
+
};
|
|
517
|
+
});
|
|
518
|
+
}
|
|
509
519
|
function toFloat(value) {
|
|
510
520
|
return Number.isNaN(Number(value)) ? 0 : Number.parseFloat(value);
|
|
511
521
|
}
|
|
@@ -563,6 +573,7 @@ function kssParser(input, options = {}) {
|
|
|
563
573
|
processProperty(sectionRecord, paragraphs, "Wrapper", (x) => x.trim());
|
|
564
574
|
processProperty(sectionRecord, paragraphs, "htmlclass", (x) => x.trim());
|
|
565
575
|
processProperty(sectionRecord, paragraphs, "bodyclass", (x) => x.trim());
|
|
576
|
+
processProperty(sectionRecord, paragraphs, "Themes", parseThemes);
|
|
566
577
|
processProperty(sectionRecord, paragraphs, "Icons", parseIcons);
|
|
567
578
|
processProperty(sectionRecord, paragraphs, "Figma", (x) => x.trim());
|
|
568
579
|
processProperty(sectionRecord, paragraphs, "Status", (x) => x.trim().toLowerCase());
|
|
@@ -867,6 +878,7 @@ async function parse(input, contentDir) {
|
|
|
867
878
|
wrapper: section.wrapper,
|
|
868
879
|
htmlclass: section.htmlclass,
|
|
869
880
|
bodyclass: section.bodyclass,
|
|
881
|
+
themes: section.themes,
|
|
870
882
|
source: computeSource(section),
|
|
871
883
|
previewFileName: `preview-${section.reference}.html`,
|
|
872
884
|
fullpageFileName: `fullpage-${section.reference}.html`
|
|
@@ -905,6 +917,7 @@ async function parse(input, contentDir) {
|
|
|
905
917
|
wrapper: section.wrapper,
|
|
906
918
|
htmlclass: section.htmlclass,
|
|
907
919
|
bodyclass: section.bodyclass,
|
|
920
|
+
themes: section.themes,
|
|
908
921
|
source: computeSource(section),
|
|
909
922
|
previewFileName: `preview-${section.reference}.html`,
|
|
910
923
|
fullpageFileName: `fullpage-${section.reference}.html`
|
|
@@ -934,6 +947,7 @@ async function parse(input, contentDir) {
|
|
|
934
947
|
wrapper: section.wrapper,
|
|
935
948
|
htmlclass: section.htmlclass,
|
|
936
949
|
bodyclass: section.bodyclass,
|
|
950
|
+
themes: section.themes,
|
|
937
951
|
sections: [],
|
|
938
952
|
source: computeSource(section),
|
|
939
953
|
previewFileName: `preview-${section.reference}.html`,
|
|
@@ -1354,7 +1368,7 @@ async function generateFullPageFile(data) {
|
|
|
1354
1368
|
<meta name="theme-color" media="(prefers-color-scheme: light)" content="${data.theme.light}">
|
|
1355
1369
|
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="${data.theme.dark}">
|
|
1356
1370
|
` : `<meta name="theme-color" content="${data.theme}">`}
|
|
1357
|
-
<script type="module" src="/styleguide-assets/fullpage-
|
|
1371
|
+
<script type="module" src="/styleguide-assets/fullpage-B7IV3eSt.js"><\/script>
|
|
1358
1372
|
${computedStyleTags}
|
|
1359
1373
|
</head>
|
|
1360
1374
|
<body${data.page.bodyclass ? ` class="${data.page.bodyclass}"` : ""}>
|
|
@@ -1421,6 +1435,7 @@ function getHeaderHtml(config) {
|
|
|
1421
1435
|
</button>
|
|
1422
1436
|
|
|
1423
1437
|
<div class="flex gap-4">
|
|
1438
|
+
${config.themes?.length ? renderGlobalThemeSelect(config.themes) : ""}
|
|
1424
1439
|
${config.mode === "development" && config.launchInEditor ? `
|
|
1425
1440
|
<form class="hidden editor-select md:block">
|
|
1426
1441
|
<fieldset class="flex items-center rounded-3xl border border-styleguide-border">
|
|
@@ -1554,30 +1569,34 @@ function getCodeAuditDialog() {
|
|
|
1554
1569
|
</dialog>
|
|
1555
1570
|
`;
|
|
1556
1571
|
}
|
|
1557
|
-
function renderTab(data) {
|
|
1572
|
+
function renderTab(data, aside = "") {
|
|
1558
1573
|
const tabId = generateId();
|
|
1559
1574
|
return `
|
|
1560
1575
|
<div class="tabs">
|
|
1561
|
-
<div
|
|
1562
|
-
class="inline-flex relative justify-start flex-wrap rounded-md p-0.5 bg-styleguide-bg-highlight"
|
|
1563
|
-
role="tablist"
|
|
1564
|
-
>
|
|
1576
|
+
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
1565
1577
|
<div
|
|
1566
|
-
class="
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1578
|
+
class="inline-flex relative justify-start flex-wrap rounded-md p-0.5 bg-styleguide-bg-highlight"
|
|
1579
|
+
role="tablist"
|
|
1580
|
+
>
|
|
1581
|
+
<div
|
|
1582
|
+
class="tab-trigger-background absolute inset-y-0.5 left-0 bg-[rgb(242,242,242)] dark:bg-[rgb(26,26,26)] rounded"
|
|
1583
|
+
></div>
|
|
1584
|
+
|
|
1585
|
+
${data.map((tab, index) => `
|
|
1586
|
+
<button
|
|
1587
|
+
id="tab-trigger-${tabId}-${index}"
|
|
1588
|
+
role="tab"
|
|
1589
|
+
aria-selected="${(index === 0).toString()}"
|
|
1590
|
+
aria-controls="tab-panel-${tabId}-${index}"
|
|
1591
|
+
class="inline-flex gap-1 items-center relative px-4 py-2 text-sm cursor-pointer aria-selected:text-styleguide-highlight transition duration-400"
|
|
1592
|
+
>
|
|
1593
|
+
${tab.icon ?? ""}
|
|
1594
|
+
${tab.title}
|
|
1595
|
+
</button>
|
|
1596
|
+
`).join("\n")}
|
|
1597
|
+
</div>
|
|
1598
|
+
|
|
1599
|
+
${aside}
|
|
1581
1600
|
</div>
|
|
1582
1601
|
|
|
1583
1602
|
${data.map((tab, index) => `
|
|
@@ -1594,6 +1613,37 @@ function renderTab(data) {
|
|
|
1594
1613
|
</div>
|
|
1595
1614
|
`;
|
|
1596
1615
|
}
|
|
1616
|
+
function renderThemeSelectControl(id, themes, scope) {
|
|
1617
|
+
const wrapperClass = scope === "global" ? "hidden md:inline-flex" : "inline-flex";
|
|
1618
|
+
return `
|
|
1619
|
+
<div class="${wrapperClass} items-center gap-2 text-sm">
|
|
1620
|
+
<label for="${id}" class="select-none">Theme</label>
|
|
1621
|
+
<span class="relative inline-flex">
|
|
1622
|
+
<select
|
|
1623
|
+
id="${id}"
|
|
1624
|
+
class="appearance-none cursor-pointer rounded-md border py-1.5 pl-3 pr-8 text-sm transition duration-200 border-styleguide-border bg-styleguide-bg-highlight hover:text-styleguide-highlight focus:text-styleguide-highlight focus-visible:outline focus-visible:outline-blue-600"
|
|
1625
|
+
data-${scope}-theme-select
|
|
1626
|
+
>
|
|
1627
|
+
<option value="">Default</option>
|
|
1628
|
+
${themes.map((theme) => `<option value="${sanitizeSpecialCharacters(themeClassList(theme.value))}">${sanitizeSpecialCharacters(theme.label)}</option>`).join("\n")}
|
|
1629
|
+
</select>
|
|
1630
|
+
<svg class="pointer-events-none absolute top-1/2 right-2.5 size-3.5 -translate-y-1/2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
|
1631
|
+
<path fill-rule="evenodd" d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"/>
|
|
1632
|
+
</svg>
|
|
1633
|
+
</span>
|
|
1634
|
+
</div>
|
|
1635
|
+
`;
|
|
1636
|
+
}
|
|
1637
|
+
function renderGlobalThemeSelect(themes) {
|
|
1638
|
+
return renderThemeSelectControl("global-theme-select", themes, "global");
|
|
1639
|
+
}
|
|
1640
|
+
function renderThemeSelect(section, themes) {
|
|
1641
|
+
return renderThemeSelectControl(
|
|
1642
|
+
`theme-select-${sectionSanitizeId(section.id)}`,
|
|
1643
|
+
themes.map((theme) => ({ value: theme.value, label: theme.description })),
|
|
1644
|
+
"section"
|
|
1645
|
+
);
|
|
1646
|
+
}
|
|
1597
1647
|
function getMainContentHtml(secondLevelSection, config) {
|
|
1598
1648
|
let output = "";
|
|
1599
1649
|
function renderSection(section) {
|
|
@@ -1728,6 +1778,7 @@ function getMainContentRegular(section, config) {
|
|
|
1728
1778
|
>
|
|
1729
1779
|
</a>
|
|
1730
1780
|
`;
|
|
1781
|
+
const themeSelectMarkup = section.markup && section.themes && section.themes.length > 0 ? renderThemeSelect(section, section.themes) : "";
|
|
1731
1782
|
const codePreviewMarkup = `
|
|
1732
1783
|
<!-- Preview Box -->
|
|
1733
1784
|
<div class="mt-4 overflow-hidden rounded-2xl border border-styleguide-border">
|
|
@@ -1933,8 +1984,16 @@ function getMainContentRegular(section, config) {
|
|
|
1933
1984
|
}
|
|
1934
1985
|
return `
|
|
1935
1986
|
<div class="mt-4">
|
|
1936
|
-
${renderTab(tabs).replaceAll("<replace-figma-iframe-loading-strategy>", tabs.length > 1 ? "lazy" : "eager")}
|
|
1987
|
+
${renderTab(tabs, themeSelectMarkup).replaceAll("<replace-figma-iframe-loading-strategy>", tabs.length > 1 ? "lazy" : "eager")}
|
|
1988
|
+
</div>
|
|
1989
|
+
`;
|
|
1990
|
+
}
|
|
1991
|
+
if (themeSelectMarkup) {
|
|
1992
|
+
return `
|
|
1993
|
+
<div class="mt-4 flex flex-wrap items-center justify-end gap-3">
|
|
1994
|
+
${themeSelectMarkup}
|
|
1937
1995
|
</div>
|
|
1996
|
+
${codePreviewMarkup}
|
|
1938
1997
|
`;
|
|
1939
1998
|
}
|
|
1940
1999
|
return codePreviewMarkup;
|
|
@@ -2173,7 +2232,7 @@ async function generatePreviewFile(data) {
|
|
|
2173
2232
|
<meta name="theme-color" media="(prefers-color-scheme: light)" content="${data.theme.light}">
|
|
2174
2233
|
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="${data.theme.dark}">
|
|
2175
2234
|
` : `<meta name="theme-color" content="${data.theme}">`}
|
|
2176
|
-
<link rel="stylesheet" type="text/css" href="/styleguide-assets/kss-modern-
|
|
2235
|
+
<link rel="stylesheet" type="text/css" href="/styleguide-assets/kss-modern-Cg1aeKi1.css">
|
|
2177
2236
|
<script>
|
|
2178
2237
|
//#region client/lib/iframe-resize.ts
|
|
2179
2238
|
var e = [
|
|
@@ -2336,7 +2395,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
2336
2395
|
//#endregion
|
|
2337
2396
|
;
|
|
2338
2397
|
<\/script>
|
|
2339
|
-
<script type="module" src="/styleguide-assets/preview-
|
|
2398
|
+
<script type="module" src="/styleguide-assets/preview-tkLDBWOv.js"><\/script>
|
|
2340
2399
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
2341
2400
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-600-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
2342
2401
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-300-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
@@ -2747,7 +2806,7 @@ async function buildContext(config) {
|
|
|
2747
2806
|
}
|
|
2748
2807
|
const ASSETS_MARKER_FILE = ".kss-modern-assets";
|
|
2749
2808
|
function getAssetsBuildId(theme) {
|
|
2750
|
-
return `kss-modern-
|
|
2809
|
+
return `kss-modern-Cg1aeKi1.css
|
|
2751
2810
|
${JSON.stringify(theme)}
|
|
2752
2811
|
`;
|
|
2753
2812
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parentPort } from 'node:worker_threads';
|
|
2
|
-
import { c as compileMarkup, p as pugErrorFile } from '../../shared/kss-modern.
|
|
2
|
+
import { c as compileMarkup, p as pugErrorFile } from '../../shared/kss-modern.DQ_V-57G.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'node:path';
|
|
@@ -80,6 +80,9 @@ const WRAPPER_CONTENT_RE = /<wrapper-content\s*\/>|\{\{\s*wrapper-content\s*\}\}
|
|
|
80
80
|
function replaceWrapperContent(wrapper, content) {
|
|
81
81
|
return wrapper.replace(WRAPPER_CONTENT_RE, () => content);
|
|
82
82
|
}
|
|
83
|
+
function themeClassList(value) {
|
|
84
|
+
return value.split(/[.\s]+/).filter(Boolean).join(" ");
|
|
85
|
+
}
|
|
83
86
|
function* idGenerator() {
|
|
84
87
|
let id = 0;
|
|
85
88
|
while (true) {
|
|
@@ -251,4 +254,4 @@ async function compileMarkup(contentDir, mode, html, sectionId) {
|
|
|
251
254
|
return { html: result, dependencies: [...new Set(dependencies)] };
|
|
252
255
|
}
|
|
253
256
|
|
|
254
|
-
export { INSERT_VITE_PUG_TAG_RE as I, PUG_SRC_RE as P, PUG_ERROR_OVERLAY_TAG as a, slugify as b, compileMarkup as c, sectionSanitizeId as d, stripPugErrorOverlay as e, ensureStartingSlash as f, generateId as g, htmlToSearchText as h, createLogger as i, logger as l, pugErrorFile as p, replaceWrapperContent as r, sanitizeSpecialCharacters as s };
|
|
257
|
+
export { INSERT_VITE_PUG_TAG_RE as I, PUG_SRC_RE as P, PUG_ERROR_OVERLAY_TAG as a, slugify as b, compileMarkup as c, sectionSanitizeId as d, stripPugErrorOverlay as e, ensureStartingSlash as f, generateId as g, htmlToSearchText as h, createLogger as i, logger as l, pugErrorFile as p, replaceWrapperContent as r, sanitizeSpecialCharacters as s, themeClassList as t };
|
|
@@ -3,16 +3,27 @@
|
|
|
3
3
|
"file": "animate-x_9xNIEv.js",
|
|
4
4
|
"name": "animate"
|
|
5
5
|
},
|
|
6
|
+
"_audit-runner-Ch009v98.js": {
|
|
7
|
+
"file": "audit-runner-Ch009v98.js",
|
|
8
|
+
"name": "audit-runner"
|
|
9
|
+
},
|
|
6
10
|
"_code-highlight-Fm7cxf-E.js": {
|
|
7
11
|
"file": "code-highlight-Fm7cxf-E.js",
|
|
8
12
|
"name": "code-highlight"
|
|
9
13
|
},
|
|
14
|
+
"_preview-theme-DS4xqXIm.js": {
|
|
15
|
+
"file": "preview-theme-DS4xqXIm.js",
|
|
16
|
+
"name": "preview-theme",
|
|
17
|
+
"imports": [
|
|
18
|
+
"_section-previews-CnlrC8Gz.js"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
10
21
|
"_rolldown-runtime-B1bRi_D7.js": {
|
|
11
22
|
"file": "rolldown-runtime-B1bRi_D7.js",
|
|
12
23
|
"name": "rolldown-runtime"
|
|
13
24
|
},
|
|
14
|
-
"_section-previews-
|
|
15
|
-
"file": "section-previews-
|
|
25
|
+
"_section-previews-CnlrC8Gz.js": {
|
|
26
|
+
"file": "section-previews-CnlrC8Gz.js",
|
|
16
27
|
"name": "section-previews"
|
|
17
28
|
},
|
|
18
29
|
"_shared-hGcWlnRM.js": {
|
|
@@ -28,7 +39,7 @@
|
|
|
28
39
|
"name": "utils"
|
|
29
40
|
},
|
|
30
41
|
"client/fullpage.ts": {
|
|
31
|
-
"file": "fullpage-
|
|
42
|
+
"file": "fullpage-B7IV3eSt.js",
|
|
32
43
|
"name": "fullpage",
|
|
33
44
|
"src": "client/fullpage.ts",
|
|
34
45
|
"isEntry": true,
|
|
@@ -42,13 +53,14 @@
|
|
|
42
53
|
]
|
|
43
54
|
},
|
|
44
55
|
"client/lib/a11y-report.ts": {
|
|
45
|
-
"file": "a11y-report-
|
|
56
|
+
"file": "a11y-report-BFnWMaWr.js",
|
|
46
57
|
"name": "a11y-report",
|
|
47
58
|
"src": "client/lib/a11y-report.ts",
|
|
48
59
|
"isDynamicEntry": true,
|
|
49
60
|
"imports": [
|
|
50
61
|
"_utils-DtB-AzJa.js",
|
|
51
|
-
"
|
|
62
|
+
"_audit-runner-Ch009v98.js",
|
|
63
|
+
"_section-previews-CnlrC8Gz.js"
|
|
52
64
|
]
|
|
53
65
|
},
|
|
54
66
|
"client/lib/clipboard.ts": {
|
|
@@ -68,8 +80,17 @@
|
|
|
68
80
|
"src": "client/lib/editor-select.ts",
|
|
69
81
|
"isDynamicEntry": true
|
|
70
82
|
},
|
|
83
|
+
"client/lib/global-theme-select.ts": {
|
|
84
|
+
"file": "global-theme-select-DM7GN8Dn.js",
|
|
85
|
+
"name": "global-theme-select",
|
|
86
|
+
"src": "client/lib/global-theme-select.ts",
|
|
87
|
+
"isDynamicEntry": true,
|
|
88
|
+
"imports": [
|
|
89
|
+
"_preview-theme-DS4xqXIm.js"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
71
92
|
"client/lib/html-validator.ts": {
|
|
72
|
-
"file": "html-validator-
|
|
93
|
+
"file": "html-validator-sgeZtEeH.js",
|
|
73
94
|
"name": "html-validator",
|
|
74
95
|
"src": "client/lib/html-validator.ts",
|
|
75
96
|
"isDynamicEntry": true,
|
|
@@ -77,7 +98,8 @@
|
|
|
77
98
|
"_code-highlight-Fm7cxf-E.js",
|
|
78
99
|
"_utils-DtB-AzJa.js",
|
|
79
100
|
"_shared-hGcWlnRM.js",
|
|
80
|
-
"
|
|
101
|
+
"_audit-runner-Ch009v98.js",
|
|
102
|
+
"_section-previews-CnlrC8Gz.js"
|
|
81
103
|
]
|
|
82
104
|
},
|
|
83
105
|
"client/lib/icons.ts": {
|
|
@@ -90,6 +112,16 @@
|
|
|
90
112
|
"_utils-DtB-AzJa.js"
|
|
91
113
|
]
|
|
92
114
|
},
|
|
115
|
+
"client/lib/section-theme-select.ts": {
|
|
116
|
+
"file": "section-theme-select-BHhiP4pl.js",
|
|
117
|
+
"name": "section-theme-select",
|
|
118
|
+
"src": "client/lib/section-theme-select.ts",
|
|
119
|
+
"isDynamicEntry": true,
|
|
120
|
+
"imports": [
|
|
121
|
+
"_section-previews-CnlrC8Gz.js",
|
|
122
|
+
"_preview-theme-DS4xqXIm.js"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
93
125
|
"client/preview-inline.ts": {
|
|
94
126
|
"file": "preview-inline-ByTkw_pt.js",
|
|
95
127
|
"name": "preview-inline",
|
|
@@ -97,7 +129,7 @@
|
|
|
97
129
|
"isEntry": true
|
|
98
130
|
},
|
|
99
131
|
"client/preview.ts": {
|
|
100
|
-
"file": "preview-
|
|
132
|
+
"file": "preview-tkLDBWOv.js",
|
|
101
133
|
"name": "preview",
|
|
102
134
|
"src": "client/preview.ts",
|
|
103
135
|
"isEntry": true,
|
|
@@ -113,6 +145,8 @@
|
|
|
113
145
|
"client/lib/html-validator.ts",
|
|
114
146
|
"client/lib/icons.ts",
|
|
115
147
|
"client/lib/clipboard.ts",
|
|
148
|
+
"client/lib/global-theme-select.ts",
|
|
149
|
+
"client/lib/section-theme-select.ts",
|
|
116
150
|
"client/lib/editor-select.ts"
|
|
117
151
|
]
|
|
118
152
|
},
|
|
@@ -135,7 +169,7 @@
|
|
|
135
169
|
]
|
|
136
170
|
},
|
|
137
171
|
"style.css": {
|
|
138
|
-
"file": "kss-modern-
|
|
172
|
+
"file": "kss-modern-Cg1aeKi1.css",
|
|
139
173
|
"src": "style.css"
|
|
140
174
|
}
|
|
141
175
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as e } from "./utils-DtB-AzJa.js";
|
|
2
|
-
import { a as t,
|
|
2
|
+
import { a as t, i as n, n as r, o as i, r as a } from "./audit-runner-Ch009v98.js";
|
|
3
|
+
import { n as o, r as s } from "./section-previews-CnlrC8Gz.js";
|
|
3
4
|
//#region client/lib/a11y-report.ts
|
|
4
5
|
var c = {
|
|
5
6
|
violations: ["violations", "incomplete"],
|
|
@@ -9,8 +10,8 @@ function l(t) {
|
|
|
9
10
|
return e(t.trim()).replace(/^section-/, "");
|
|
10
11
|
}
|
|
11
12
|
function u() {
|
|
12
|
-
return Array.from(document.querySelectorAll(
|
|
13
|
-
let { base: t, modifiers: n } =
|
|
13
|
+
return Array.from(document.querySelectorAll(o)).flatMap((e) => {
|
|
14
|
+
let { base: t, modifiers: n } = s(e);
|
|
14
15
|
if (!t) return [];
|
|
15
16
|
let r = Number.parseInt(e.dataset.sourceLine ?? "", 10);
|
|
16
17
|
return [{
|
|
@@ -37,7 +38,7 @@ function d(e, t) {
|
|
|
37
38
|
}
|
|
38
39
|
function f(e) {
|
|
39
40
|
return {
|
|
40
|
-
target:
|
|
41
|
+
target: a(e.target),
|
|
41
42
|
html: e.html || void 0,
|
|
42
43
|
failureSummary: e.failureSummary || void 0,
|
|
43
44
|
measured: e.measured,
|
|
@@ -60,24 +61,24 @@ function p(e, t, n = {}) {
|
|
|
60
61
|
function m(e) {
|
|
61
62
|
let t = /* @__PURE__ */ new Map();
|
|
62
63
|
return e.forEach((e) => {
|
|
63
|
-
let
|
|
64
|
+
let r = {
|
|
64
65
|
target: e.selector ?? void 0,
|
|
65
66
|
failureSummary: e.message,
|
|
66
67
|
line: e.line,
|
|
67
68
|
column: e.column
|
|
68
|
-
},
|
|
69
|
-
if (
|
|
70
|
-
|
|
69
|
+
}, i = t.get(e.ruleId);
|
|
70
|
+
if (i) {
|
|
71
|
+
i.nodes.push(r);
|
|
71
72
|
return;
|
|
72
73
|
}
|
|
73
74
|
t.set(e.ruleId, {
|
|
74
75
|
source: "html-validate",
|
|
75
76
|
group: "violations",
|
|
76
77
|
id: e.ruleId,
|
|
77
|
-
impact:
|
|
78
|
+
impact: n(e.severity.toString()),
|
|
78
79
|
description: e.ruleDescription || e.message,
|
|
79
80
|
helpUrl: e.ruleUrl || "",
|
|
80
|
-
nodes: [
|
|
81
|
+
nodes: [r]
|
|
81
82
|
});
|
|
82
83
|
}), Array.from(t.values());
|
|
83
84
|
}
|
|
@@ -128,8 +129,8 @@ async function b(e) {
|
|
|
128
129
|
for (; !e.every(t) && Date.now() < n;) await new Promise((e) => setTimeout(e, 100));
|
|
129
130
|
}
|
|
130
131
|
var x = {
|
|
131
|
-
runAccessibilityAudit:
|
|
132
|
-
runModifierContrastAudit:
|
|
132
|
+
runAccessibilityAudit: t,
|
|
133
|
+
runModifierContrastAudit: i,
|
|
133
134
|
waitForIframes: b
|
|
134
135
|
};
|
|
135
136
|
async function S(e = {}, t = x) {
|
|
@@ -37,13 +37,4 @@ function s(e, t) {
|
|
|
37
37
|
return a(e, "runColorContrastAudit", t);
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
|
|
41
|
-
var c = ".styleguide-section";
|
|
42
|
-
function l(e) {
|
|
43
|
-
return {
|
|
44
|
-
base: e?.querySelector("iframe.preview-iframe:not([data-modifier])") ?? null,
|
|
45
|
-
modifiers: Array.from(e?.querySelectorAll("iframe.preview-iframe[data-modifier]") ?? [])
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
export { n as a, s as c, t as i, l as n, r as o, e as r, o as s, c as t };
|
|
40
|
+
export { o as a, r as i, t as n, s as o, n as r, e as t };
|