kss-modern 0.0.17 → 0.0.19
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.d.mts +9 -1
- package/dist/node/lib/index.d.ts +9 -1
- package/dist/node/lib/index.mjs +98 -65
- package/dist/styleguide-assets/.vite/manifest.json +15 -15
- package/dist/styleguide-assets/assets/worker-zgOBb1zJ.js +12 -0
- package/dist/styleguide-assets/{browser-zT2GwTFu.js → browser-KlOfx-vG.js} +7466 -7500
- package/dist/styleguide-assets/client-CHYLSUpU.js +1 -0
- package/dist/styleguide-assets/client-fullpage-DjIkCnMm.js +59 -0
- package/dist/styleguide-assets/{clipboard-Dr_iJrxX.js → clipboard-BX-6wcwn.js} +1 -1
- package/dist/styleguide-assets/{html-validator-D8B6CYwU.js → html-validator-bX8Fj2mZ.js} +15 -16
- package/dist/styleguide-assets/icons-Bsi5dZux.js +36 -0
- package/dist/styleguide-assets/kss-modern-DDees9Y5.css +1 -0
- package/dist/styleguide-assets/main-CTV8iVap.js +3636 -0
- package/package.json +7 -7
- package/dist/styleguide-assets/assets/worker-BJpntQOR.js +0 -12
- package/dist/styleguide-assets/client-CgJCvRoi.js +0 -1
- package/dist/styleguide-assets/client-fullpage-1rKiNQVN.js +0 -62
- package/dist/styleguide-assets/icons-_8qk0_-D.js +0 -37
- package/dist/styleguide-assets/kss-modern-B8wkm2Af.css +0 -1
- package/dist/styleguide-assets/main-BYXbx-16.js +0 -3673
|
@@ -25,7 +25,15 @@ interface in2Section {
|
|
|
25
25
|
wrapper?: string;
|
|
26
26
|
htmlclass?: string;
|
|
27
27
|
bodyclass?: string;
|
|
28
|
-
|
|
28
|
+
source: {
|
|
29
|
+
css: {
|
|
30
|
+
file: string;
|
|
31
|
+
line: number;
|
|
32
|
+
};
|
|
33
|
+
markup?: {
|
|
34
|
+
file: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
29
37
|
previewFileName: string;
|
|
30
38
|
fullpageFileName: string;
|
|
31
39
|
}
|
package/dist/node/lib/index.d.ts
CHANGED
|
@@ -25,7 +25,15 @@ interface in2Section {
|
|
|
25
25
|
wrapper?: string;
|
|
26
26
|
htmlclass?: string;
|
|
27
27
|
bodyclass?: string;
|
|
28
|
-
|
|
28
|
+
source: {
|
|
29
|
+
css: {
|
|
30
|
+
file: string;
|
|
31
|
+
line: number;
|
|
32
|
+
};
|
|
33
|
+
markup?: {
|
|
34
|
+
file: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
29
37
|
previewFileName: string;
|
|
30
38
|
fullpageFileName: string;
|
|
31
39
|
}
|
package/dist/node/lib/index.mjs
CHANGED
|
@@ -644,8 +644,8 @@ function extractMarkdownPath(input) {
|
|
|
644
644
|
}
|
|
645
645
|
return path2;
|
|
646
646
|
}
|
|
647
|
-
async function parse(
|
|
648
|
-
const data = kssParser(
|
|
647
|
+
async function parse(input, config) {
|
|
648
|
+
const data = kssParser(input).sections.filter((section) => Boolean(section.reference));
|
|
649
649
|
const overwrittenSectionsIds = [];
|
|
650
650
|
const sortedData = data.sort((a, b) => {
|
|
651
651
|
return a.reference.localeCompare(b.reference);
|
|
@@ -666,6 +666,34 @@ async function parse(text, config) {
|
|
|
666
666
|
hasMarkdownDescription: true
|
|
667
667
|
};
|
|
668
668
|
}
|
|
669
|
+
function computeSource(section) {
|
|
670
|
+
const cssSource = section.source;
|
|
671
|
+
let sourceMarkup = void 0;
|
|
672
|
+
const hasExtractableMarkupFile = section.markup.includes('<insert-vite-pug src="');
|
|
673
|
+
if (hasExtractableMarkupFile) {
|
|
674
|
+
const regexModifierLine = /<insert-vite-pug src="(.+?)".*(?:[\n\r\u2028\u2029]\s*)?(modifierClass="(.+?)")? *><\/insert-vite-pug>/g;
|
|
675
|
+
const vitePugTags = section.markup.match(regexModifierLine);
|
|
676
|
+
if (!vitePugTags)
|
|
677
|
+
throw new Error("No Vite Pug tags found");
|
|
678
|
+
vitePugTags.forEach((vitePugTag) => {
|
|
679
|
+
let pugSourcePath = vitePugTag.match(/src="(.+?)"/)?.[1];
|
|
680
|
+
if (!pugSourcePath || !pugSourcePath.endsWith(".pug")) {
|
|
681
|
+
throw new Error("No or invalid Pug source path found");
|
|
682
|
+
}
|
|
683
|
+
pugSourcePath = path.join(config.contentDir, pugSourcePath);
|
|
684
|
+
sourceMarkup = {
|
|
685
|
+
file: pugSourcePath
|
|
686
|
+
};
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
return {
|
|
690
|
+
css: {
|
|
691
|
+
file: cssSource.filename,
|
|
692
|
+
line: cssSource.line
|
|
693
|
+
},
|
|
694
|
+
markup: sourceMarkup
|
|
695
|
+
};
|
|
696
|
+
}
|
|
669
697
|
for await (const section of sortedData) {
|
|
670
698
|
if (!section.reference)
|
|
671
699
|
return;
|
|
@@ -696,7 +724,7 @@ async function parse(text, config) {
|
|
|
696
724
|
wrapper: section.wrapper,
|
|
697
725
|
htmlclass: section.htmlclass,
|
|
698
726
|
bodyclass: section.bodyclass,
|
|
699
|
-
|
|
727
|
+
source: computeSource(section),
|
|
700
728
|
previewFileName: `preview-${section.reference}.html`,
|
|
701
729
|
fullpageFileName: `fullpage-${section.reference}.html`
|
|
702
730
|
};
|
|
@@ -732,7 +760,7 @@ async function parse(text, config) {
|
|
|
732
760
|
wrapper: section.wrapper,
|
|
733
761
|
htmlclass: section.htmlclass,
|
|
734
762
|
bodyclass: section.bodyclass,
|
|
735
|
-
|
|
763
|
+
source: computeSource(section),
|
|
736
764
|
previewFileName: `preview-${section.reference}.html`,
|
|
737
765
|
fullpageFileName: `fullpage-${section.reference}.html`
|
|
738
766
|
});
|
|
@@ -761,7 +789,7 @@ async function parse(text, config) {
|
|
|
761
789
|
htmlclass: section.htmlclass,
|
|
762
790
|
bodyclass: section.bodyclass,
|
|
763
791
|
sections: [],
|
|
764
|
-
|
|
792
|
+
source: computeSource(section),
|
|
765
793
|
previewFileName: `preview-${section.reference}.html`,
|
|
766
794
|
fullpageFileName: `fullpage-${section.reference}.html`
|
|
767
795
|
};
|
|
@@ -805,7 +833,7 @@ async function generateFullPageFile(data) {
|
|
|
805
833
|
<link rel="icon" type="image/svg+xml" href="/styleguide-assets/favicon/fullpage-light.svg">
|
|
806
834
|
`}
|
|
807
835
|
${data.ogImageUrl ? `<meta property="og:image" content="${data.ogImageUrl}">` : ""}
|
|
808
|
-
<script type="module" src="/styleguide-assets/client-fullpage-
|
|
836
|
+
<script type="module" src="/styleguide-assets/client-fullpage-DjIkCnMm.js"><\/script>
|
|
809
837
|
${computedStyleTags}
|
|
810
838
|
</head>
|
|
811
839
|
<body${data.page.bodyclass ? ` class="${data.page.bodyclass}"` : ""}>
|
|
@@ -1068,30 +1096,20 @@ ${html ?? ""}
|
|
|
1068
1096
|
`;
|
|
1069
1097
|
}
|
|
1070
1098
|
function getMainContentRegular(section, config) {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
throw new Error("No Vite Pug tags found");
|
|
1077
|
-
vitePugTags.forEach((vitePugTag) => {
|
|
1078
|
-
const pugSourcePath = vitePugTag.match(/src="(.+?)"/)?.[1];
|
|
1079
|
-
if (!pugSourcePath || !pugSourcePath.endsWith(".pug")) {
|
|
1080
|
-
throw new Error("No or invalid Pug source path found");
|
|
1081
|
-
}
|
|
1082
|
-
sourceFilePath = pugSourcePath;
|
|
1083
|
-
});
|
|
1084
|
-
} else if (config.mode === "development" && section.sourceFileName) {
|
|
1085
|
-
sourceFilePath = path.join(config.contentDir, section.sourceFileName);
|
|
1086
|
-
}
|
|
1087
|
-
const shouldLaunchInEditor = config.mode === "development" && config.launchInEditor && sourceFilePath;
|
|
1088
|
-
let openInEditorPathPhpStorm = "";
|
|
1089
|
-
let openInEditorPathVscode = "";
|
|
1090
|
-
if (shouldLaunchInEditor) {
|
|
1099
|
+
const openInEditorPaths = {
|
|
1100
|
+
css: {},
|
|
1101
|
+
html: {}
|
|
1102
|
+
};
|
|
1103
|
+
if (config.mode === "development" && config.launchInEditor) {
|
|
1091
1104
|
const computedRootPath = config.launchInEditor && typeof config.launchInEditor === "object" && "rootDir" in config.launchInEditor ? config.launchInEditor.rootDir : process.cwd();
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
|
|
1105
|
+
const cssFilePath = ensureStartingSlash(path.join(computedRootPath, section.source.css.file));
|
|
1106
|
+
openInEditorPaths.css.vscode = `vscode://file//${cssFilePath}:${section.source.css.line}`;
|
|
1107
|
+
openInEditorPaths.css.phpstorm = `phpstorm://open?file=${cssFilePath}&line=${section.source.css.line}`;
|
|
1108
|
+
if (section.source.markup && section.source.markup.file) {
|
|
1109
|
+
const htmlFilePath = ensureStartingSlash(path.join(computedRootPath, section.source.markup.file));
|
|
1110
|
+
openInEditorPaths.html.vscode = `vscode://file//${htmlFilePath}`;
|
|
1111
|
+
openInEditorPaths.html.phpstorm = `phpstorm://open?file=${htmlFilePath}`;
|
|
1112
|
+
}
|
|
1095
1113
|
}
|
|
1096
1114
|
const computeFigmaExternalLink = (url) => {
|
|
1097
1115
|
if (!url)
|
|
@@ -1100,6 +1118,14 @@ function getMainContentRegular(section, config) {
|
|
|
1100
1118
|
urlObj.hostname = "www.figma.com";
|
|
1101
1119
|
return urlObj.toString();
|
|
1102
1120
|
};
|
|
1121
|
+
const phpstormOpenLinks = [
|
|
1122
|
+
openInEditorPaths.css.phpstorm,
|
|
1123
|
+
openInEditorPaths.html.phpstorm
|
|
1124
|
+
].filter(Boolean).join(",");
|
|
1125
|
+
const vscodeOpenLinks = [
|
|
1126
|
+
openInEditorPaths.css.vscode,
|
|
1127
|
+
openInEditorPaths.html.vscode
|
|
1128
|
+
].filter(Boolean).join(",");
|
|
1103
1129
|
const codePreviewMarkup = `
|
|
1104
1130
|
<!-- Preview Box -->
|
|
1105
1131
|
<div class="mt-4 overflow-hidden rounded-2xl border border-styleguide-border">
|
|
@@ -1144,39 +1170,41 @@ function getMainContentRegular(section, config) {
|
|
|
1144
1170
|
>
|
|
1145
1171
|
</a>` : ""}
|
|
1146
1172
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1173
|
+
${phpstormOpenLinks.length > 0 ? `<a
|
|
1174
|
+
class="hidden @md:inline-flex items-center group/phpstorm gap-1.5 p-4 desktop-device-only cursor-pointer active:scale-90 transition hover:text-styleguide-highlight duration-200"
|
|
1175
|
+
href="#"
|
|
1176
|
+
data-link-multiple="${phpstormOpenLinks}"
|
|
1177
|
+
>
|
|
1178
|
+
<span class="hidden @2xl:inline-block">Open in</span>
|
|
1179
|
+
<span class="sr-only">PHPStorm</span>
|
|
1180
|
+
<img
|
|
1181
|
+
src="styleguide-assets/icons/phpstorm.svg"
|
|
1182
|
+
width="70"
|
|
1183
|
+
height="70"
|
|
1184
|
+
class="size-4 saturate-0 group-hover/phpstorm:saturate-100 transition"
|
|
1185
|
+
alt="PHPStorm Logo"
|
|
1186
|
+
aria-hidden="true"
|
|
1187
|
+
>
|
|
1188
|
+
</a>
|
|
1189
|
+
` : ""}
|
|
1190
|
+
|
|
1191
|
+
${vscodeOpenLinks.length > 0 ? `<a
|
|
1192
|
+
class="hidden @md:inline-flex items-center group/vscode gap-1.5 p-4 desktop-device-only cursor-pointer active:scale-90 transition hover:text-styleguide-highlight duration-200"
|
|
1193
|
+
href="#"
|
|
1194
|
+
data-link-multiple="${vscodeOpenLinks}"
|
|
1195
|
+
>
|
|
1196
|
+
<span class="hidden @2xl:inline-block">Open in</span>
|
|
1197
|
+
<span class="sr-only">VsCode</span>
|
|
1198
|
+
<img
|
|
1199
|
+
src="styleguide-assets/icons/vscode.svg"
|
|
1200
|
+
width="100"
|
|
1201
|
+
height="100"
|
|
1202
|
+
class="size-4 saturate-0 group-hover/vscode:saturate-100 transition"
|
|
1203
|
+
alt="VsCode Logo"
|
|
1204
|
+
aria-hidden="true"
|
|
1205
|
+
>
|
|
1206
|
+
</a>
|
|
1207
|
+
` : ""}
|
|
1180
1208
|
|
|
1181
1209
|
<button
|
|
1182
1210
|
class="inline-flex items-center gap-1.5 p-4 cursor-pointer active:scale-90 transition hover:text-styleguide-highlight duration-200"
|
|
@@ -1538,8 +1566,8 @@ async function generatePreviewFile(data) {
|
|
|
1538
1566
|
<meta name="theme-color" content="${data.theme}">
|
|
1539
1567
|
<link rel="icon" type="image/svg+xml" href="/styleguide-assets/favicon/preview-light.svg">
|
|
1540
1568
|
`}
|
|
1541
|
-
<link rel="stylesheet" type="text/css" href="/styleguide-assets/kss-modern-
|
|
1542
|
-
<script type="module" src="/styleguide-assets/client-
|
|
1569
|
+
<link rel="stylesheet" type="text/css" href="/styleguide-assets/kss-modern-DDees9Y5.css">
|
|
1570
|
+
<script type="module" src="/styleguide-assets/client-CHYLSUpU.js"><\/script>
|
|
1543
1571
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
1544
1572
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-600-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
1545
1573
|
<link rel="preload" href="/styleguide-assets/fonts/geist-mono-latin-300-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
@@ -1731,7 +1759,12 @@ globalThis.isWatchMode = false;
|
|
|
1731
1759
|
async function buildStyleguide(config) {
|
|
1732
1760
|
globalThis.styleguideConfiguration = config;
|
|
1733
1761
|
const styleguideContentPaths = await glob(`${config.contentDir}/**/*.{css,scss}`);
|
|
1734
|
-
const styleguideContent =
|
|
1762
|
+
const styleguideContent = await Promise.all(
|
|
1763
|
+
styleguideContentPaths.map(async (filePath) => ({
|
|
1764
|
+
path: filePath,
|
|
1765
|
+
contents: await fs.readFile(filePath, "utf-8")
|
|
1766
|
+
}))
|
|
1767
|
+
);
|
|
1735
1768
|
const rawParsedOutput = await parse(styleguideContent, config);
|
|
1736
1769
|
if (!rawParsedOutput)
|
|
1737
1770
|
throw new Error("Could not parse content");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_main-
|
|
3
|
-
"file": "main-
|
|
2
|
+
"_main-CTV8iVap.js": {
|
|
3
|
+
"file": "main-CTV8iVap.js",
|
|
4
4
|
"name": "main",
|
|
5
5
|
"dynamicImports": [
|
|
6
6
|
"client/lib/html-validator.ts",
|
|
@@ -9,55 +9,55 @@
|
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
11
|
"client/fullpage.ts": {
|
|
12
|
-
"file": "client-fullpage-
|
|
12
|
+
"file": "client-fullpage-DjIkCnMm.js",
|
|
13
13
|
"name": "client-fullpage",
|
|
14
14
|
"src": "client/fullpage.ts",
|
|
15
15
|
"isEntry": true
|
|
16
16
|
},
|
|
17
17
|
"client/lib/clipboard.ts": {
|
|
18
|
-
"file": "clipboard-
|
|
18
|
+
"file": "clipboard-BX-6wcwn.js",
|
|
19
19
|
"name": "clipboard",
|
|
20
20
|
"src": "client/lib/clipboard.ts",
|
|
21
21
|
"isDynamicEntry": true,
|
|
22
22
|
"imports": [
|
|
23
|
-
"_main-
|
|
23
|
+
"_main-CTV8iVap.js"
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
"client/lib/html-validator.ts": {
|
|
27
|
-
"file": "html-validator-
|
|
27
|
+
"file": "html-validator-bX8Fj2mZ.js",
|
|
28
28
|
"name": "html-validator",
|
|
29
29
|
"src": "client/lib/html-validator.ts",
|
|
30
30
|
"isDynamicEntry": true,
|
|
31
31
|
"dynamicImports": [
|
|
32
|
-
"node_modules/html-validate/dist/
|
|
32
|
+
"node_modules/html-validate/dist/esm/browser.js"
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"client/lib/icons.ts": {
|
|
36
|
-
"file": "icons-
|
|
36
|
+
"file": "icons-Bsi5dZux.js",
|
|
37
37
|
"name": "icons",
|
|
38
38
|
"src": "client/lib/icons.ts",
|
|
39
39
|
"isDynamicEntry": true,
|
|
40
40
|
"imports": [
|
|
41
|
-
"_main-
|
|
41
|
+
"_main-CTV8iVap.js"
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"client/main.ts": {
|
|
45
|
-
"file": "client-
|
|
45
|
+
"file": "client-CHYLSUpU.js",
|
|
46
46
|
"name": "client",
|
|
47
47
|
"src": "client/main.ts",
|
|
48
48
|
"isEntry": true,
|
|
49
49
|
"imports": [
|
|
50
|
-
"_main-
|
|
50
|
+
"_main-CTV8iVap.js"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"node_modules/html-validate/dist/
|
|
54
|
-
"file": "browser-
|
|
53
|
+
"node_modules/html-validate/dist/esm/browser.js": {
|
|
54
|
+
"file": "browser-KlOfx-vG.js",
|
|
55
55
|
"name": "browser",
|
|
56
|
-
"src": "node_modules/html-validate/dist/
|
|
56
|
+
"src": "node_modules/html-validate/dist/esm/browser.js",
|
|
57
57
|
"isDynamicEntry": true
|
|
58
58
|
},
|
|
59
59
|
"style.css": {
|
|
60
|
-
"file": "kss-modern-
|
|
60
|
+
"file": "kss-modern-DDees9Y5.css",
|
|
61
61
|
"src": "style.css"
|
|
62
62
|
}
|
|
63
63
|
}
|