@sp-days-framework/docusaurus-plugin-slidev 1.1.0-beta2 → 1.1.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/docs/advanced-configuration.mdx +103 -24
- package/docs/changelog.mdx +41 -9
- package/docs/install.mdx +28 -19
- package/docs/slide-directory.mdx +184 -0
- package/docs/slidev-link.mdx +40 -0
- package/lib/plugin/builder.d.ts +9 -3
- package/lib/plugin/builder.d.ts.map +1 -1
- package/lib/plugin/builder.js +130 -39
- package/lib/plugin/builder.js.map +1 -1
- package/lib/plugin/index.d.ts.map +1 -1
- package/lib/plugin/index.js +108 -26
- package/lib/plugin/index.js.map +1 -1
- package/lib/plugin/scanner.d.ts +9 -2
- package/lib/plugin/scanner.d.ts.map +1 -1
- package/lib/plugin/scanner.js +180 -29
- package/lib/plugin/scanner.js.map +1 -1
- package/lib/theme/SlidevCard/index.d.ts.map +1 -1
- package/lib/theme/SlidevCard/index.js +1 -2
- package/lib/theme/SlidevCard/index.js.map +1 -1
- package/lib/theme/SlidevCard/styles.module.css +6 -2
- package/lib/theme/SlidevCategoryCard/index.d.ts +11 -0
- package/lib/theme/SlidevCategoryCard/index.d.ts.map +1 -0
- package/lib/theme/SlidevCategoryCard/index.js +31 -0
- package/lib/theme/SlidevCategoryCard/index.js.map +1 -0
- package/lib/theme/SlidevCategoryCard/styles.module.css +158 -0
- package/lib/theme/SlidevLink/index.d.ts +32 -0
- package/lib/theme/SlidevLink/index.d.ts.map +1 -0
- package/lib/theme/SlidevLink/index.js +139 -0
- package/lib/theme/SlidevLink/index.js.map +1 -0
- package/lib/theme/SlidevLink/styles.module.css +228 -0
- package/lib/theme/SlidevListItem/index.d.ts +18 -0
- package/lib/theme/SlidevListItem/index.d.ts.map +1 -0
- package/lib/theme/SlidevListItem/index.js +44 -0
- package/lib/theme/SlidevListItem/index.js.map +1 -0
- package/lib/theme/SlidevListItem/styles.module.css +128 -0
- package/lib/theme/SlidevOverview/index.d.ts +1 -0
- package/lib/theme/SlidevOverview/index.d.ts.map +1 -1
- package/lib/theme/SlidevOverview/index.js +156 -71
- package/lib/theme/SlidevOverview/index.js.map +1 -1
- package/lib/theme/SlidevOverview/styles.module.css +176 -147
- package/lib/types/index.d.ts +85 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/utils/fileSystem.d.ts +53 -0
- package/lib/utils/fileSystem.d.ts.map +1 -1
- package/lib/utils/fileSystem.js +151 -0
- package/lib/utils/fileSystem.js.map +1 -1
- package/lib/utils/icons.d.ts +34 -0
- package/lib/utils/icons.d.ts.map +1 -1
- package/lib/utils/icons.js +60 -0
- package/lib/utils/icons.js.map +1 -1
- package/lib/utils/logger.d.ts +11 -2
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +64 -8
- package/lib/utils/logger.js.map +1 -1
- package/package.json +2 -1
- package/publish-package-docs.js +11 -3
package/lib/utils/fileSystem.js
CHANGED
|
@@ -6,12 +6,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SLIDEV_CACHE_DIR = void 0;
|
|
9
10
|
exports.cleanupOutputDirectory = cleanupOutputDirectory;
|
|
10
11
|
exports.cleanupSourceDirectory = cleanupSourceDirectory;
|
|
11
12
|
exports.createGitignore = createGitignore;
|
|
13
|
+
exports.getSlidevCacheDir = getSlidevCacheDir;
|
|
14
|
+
exports.createIsolatedBuildDir = createIsolatedBuildDir;
|
|
15
|
+
exports.cleanupIsolatedBuildDir = cleanupIsolatedBuildDir;
|
|
16
|
+
exports.cleanupSlidevCache = cleanupSlidevCache;
|
|
17
|
+
exports.getSlidevBuildOutputDir = getSlidevBuildOutputDir;
|
|
18
|
+
exports.copyBuiltPresentationsToOutput = copyBuiltPresentationsToOutput;
|
|
12
19
|
const fs_1 = __importDefault(require("fs"));
|
|
13
20
|
const path_1 = __importDefault(require("path"));
|
|
14
21
|
const logger_1 = require("./logger");
|
|
22
|
+
/**
|
|
23
|
+
* The cache directory name within .docusaurus
|
|
24
|
+
*/
|
|
25
|
+
exports.SLIDEV_CACHE_DIR = "docusaurus-plugin-slidev";
|
|
15
26
|
/**
|
|
16
27
|
* Cleans up the output directory before building presentations
|
|
17
28
|
* Removes all subdirectories and files but preserves .gitignore
|
|
@@ -86,4 +97,144 @@ function createGitignore(outputPath) {
|
|
|
86
97
|
(0, logger_1.logInfo)(`Created .gitignore in ${(0, logger_1.formatPath)(outputPath)}`);
|
|
87
98
|
}
|
|
88
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Gets the Slidev cache directory path within .docusaurus
|
|
102
|
+
* This is used to isolate builds and prevent race conditions
|
|
103
|
+
* @param siteDir The Docusaurus site root directory
|
|
104
|
+
* @param pluginId The plugin instance ID (for multi-instance support)
|
|
105
|
+
* @returns Path to the plugin's cache directory
|
|
106
|
+
*/
|
|
107
|
+
function getSlidevCacheDir(siteDir, pluginId = "default") {
|
|
108
|
+
return path_1.default.join(siteDir, ".docusaurus", exports.SLIDEV_CACHE_DIR, pluginId);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates an isolated build directory for a single presentation
|
|
112
|
+
* Copies the source .md file to its own directory to prevent index.html conflicts
|
|
113
|
+
* during parallel builds.
|
|
114
|
+
*
|
|
115
|
+
* @param sourceAbsolutePath Absolute path to the source .md file
|
|
116
|
+
* @param presentationId The unique ID for this presentation
|
|
117
|
+
* @param cacheDir The base cache directory
|
|
118
|
+
* @returns Path to the copied .md file in the isolated directory
|
|
119
|
+
*/
|
|
120
|
+
function createIsolatedBuildDir(sourceAbsolutePath, presentationId, cacheDir) {
|
|
121
|
+
// Create a unique directory for this presentation
|
|
122
|
+
// Replace path separators with dashes to flatten the structure
|
|
123
|
+
const safeId = presentationId.replace(/[\/\\]/g, "__");
|
|
124
|
+
const isolatedDir = path_1.default.join(cacheDir, "builds", safeId);
|
|
125
|
+
// Ensure the directory exists
|
|
126
|
+
fs_1.default.mkdirSync(isolatedDir, { recursive: true });
|
|
127
|
+
// Copy the source file to the isolated directory
|
|
128
|
+
const sourceFileName = path_1.default.basename(sourceAbsolutePath);
|
|
129
|
+
const isolatedSourcePath = path_1.default.join(isolatedDir, sourceFileName);
|
|
130
|
+
fs_1.default.copyFileSync(sourceAbsolutePath, isolatedSourcePath);
|
|
131
|
+
return isolatedSourcePath;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Cleans up the isolated build directory after a build completes
|
|
135
|
+
* Removes Slidev artifacts (index.html, .slidev, dist) from the isolated directory
|
|
136
|
+
*
|
|
137
|
+
* @param isolatedDir The isolated build directory to clean
|
|
138
|
+
*/
|
|
139
|
+
function cleanupIsolatedBuildDir(isolatedDir) {
|
|
140
|
+
if (!fs_1.default.existsSync(isolatedDir)) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const artifactsToRemove = ["index.html", ".slidev", "dist", "node_modules"];
|
|
144
|
+
for (const artifact of artifactsToRemove) {
|
|
145
|
+
const artifactPath = path_1.default.join(isolatedDir, artifact);
|
|
146
|
+
if (fs_1.default.existsSync(artifactPath)) {
|
|
147
|
+
try {
|
|
148
|
+
const stats = fs_1.default.statSync(artifactPath);
|
|
149
|
+
if (stats.isDirectory()) {
|
|
150
|
+
fs_1.default.rmSync(artifactPath, { recursive: true, force: true });
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
fs_1.default.rmSync(artifactPath, { force: true });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
// Ignore cleanup errors
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Cleans the entire Slidev cache directory
|
|
164
|
+
* Should be called at the start of a build to ensure a clean state
|
|
165
|
+
*
|
|
166
|
+
* @param cacheDir The cache directory to clean
|
|
167
|
+
*/
|
|
168
|
+
function cleanupSlidevCache(cacheDir) {
|
|
169
|
+
if (!fs_1.default.existsSync(cacheDir)) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
fs_1.default.rmSync(cacheDir, { recursive: true, force: true });
|
|
174
|
+
(0, logger_1.logInfo)(`Cleaned Slidev cache: ${(0, logger_1.formatPath)(cacheDir)}`);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
(0, logger_1.logWarn)(`Failed to clean Slidev cache: ${error}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets the Slidev build output directory path within .docusaurus cache
|
|
182
|
+
* This is where built presentations are stored before being copied to final output
|
|
183
|
+
* @param siteDir The Docusaurus site root directory
|
|
184
|
+
* @param pluginId The plugin instance ID (for multi-instance support)
|
|
185
|
+
* @returns Path to the plugin's build output directory
|
|
186
|
+
*/
|
|
187
|
+
function getSlidevBuildOutputDir(siteDir, pluginId = "default") {
|
|
188
|
+
return path_1.default.join(siteDir, ".docusaurus", exports.SLIDEV_CACHE_DIR, pluginId, "output");
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Recursively copies a directory
|
|
192
|
+
* @param src Source directory
|
|
193
|
+
* @param dest Destination directory
|
|
194
|
+
*/
|
|
195
|
+
function copyDirRecursive(src, dest) {
|
|
196
|
+
// Create destination directory if it doesn't exist
|
|
197
|
+
if (!fs_1.default.existsSync(dest)) {
|
|
198
|
+
fs_1.default.mkdirSync(dest, { recursive: true });
|
|
199
|
+
}
|
|
200
|
+
const entries = fs_1.default.readdirSync(src, { withFileTypes: true });
|
|
201
|
+
for (const entry of entries) {
|
|
202
|
+
const srcPath = path_1.default.join(src, entry.name);
|
|
203
|
+
const destPath = path_1.default.join(dest, entry.name);
|
|
204
|
+
if (entry.isDirectory()) {
|
|
205
|
+
copyDirRecursive(srcPath, destPath);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
fs_1.default.copyFileSync(srcPath, destPath);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Copies built presentations from cache directory to final output directory
|
|
214
|
+
* This is called in the postBuild hook to copy presentations to the final build output
|
|
215
|
+
*
|
|
216
|
+
* @param cacheOutputDir The cache directory containing built presentations
|
|
217
|
+
* @param finalOutputDir The final output directory (e.g., build/slides)
|
|
218
|
+
*/
|
|
219
|
+
function copyBuiltPresentationsToOutput(cacheOutputDir, finalOutputDir) {
|
|
220
|
+
if (!fs_1.default.existsSync(cacheOutputDir)) {
|
|
221
|
+
(0, logger_1.logWarn)(`Cache output directory not found: ${(0, logger_1.formatPath)(cacheOutputDir)}`);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
// Ensure final output directory exists
|
|
225
|
+
if (!fs_1.default.existsSync(finalOutputDir)) {
|
|
226
|
+
fs_1.default.mkdirSync(finalOutputDir, { recursive: true });
|
|
227
|
+
}
|
|
228
|
+
const entries = fs_1.default.readdirSync(cacheOutputDir, { withFileTypes: true });
|
|
229
|
+
for (const entry of entries) {
|
|
230
|
+
const srcPath = path_1.default.join(cacheOutputDir, entry.name);
|
|
231
|
+
const destPath = path_1.default.join(finalOutputDir, entry.name);
|
|
232
|
+
if (entry.isDirectory()) {
|
|
233
|
+
copyDirRecursive(srcPath, destPath);
|
|
234
|
+
}
|
|
235
|
+
else if (entry.isFile()) {
|
|
236
|
+
fs_1.default.copyFileSync(srcPath, destPath);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
89
240
|
//# sourceMappingURL=fileSystem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.js","sourceRoot":"","sources":["../../src/utils/fileSystem.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"fileSystem.js","sourceRoot":"","sources":["../../src/utils/fileSystem.ts"],"names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B,CAC5C,cAAsB,EACtB,cAAsB;IAEtB,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,IAAA,gBAAO,EAAC,qCAAqC,IAAA,mBAAU,EAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QAC3E,OAAO;IACT,CAAC;IAED,uCAAuC;IACvC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,YAAE,CAAC,SAAS,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,OAAO,GAAG,YAAE,CAAC,WAAW,CAAC,cAAc,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAExE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1B,YAAE,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/utils/icons.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Icon components for Slidev Plugin
|
|
3
3
|
*/
|
|
4
|
+
import React from 'react';
|
|
4
5
|
interface IconProps {
|
|
5
6
|
className?: string;
|
|
6
7
|
width?: number;
|
|
7
8
|
height?: number;
|
|
9
|
+
style?: React.CSSProperties;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Presentation placeholder icon
|
|
@@ -19,5 +21,37 @@ export declare function SortAscIcon({ className, width, height }: IconProps): JS
|
|
|
19
21
|
* Sort descending icon (A-Z with up arrow)
|
|
20
22
|
*/
|
|
21
23
|
export declare function SortDescIcon({ className, width, height }: IconProps): JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Grid view icon
|
|
26
|
+
* Used for toggling to grid layout
|
|
27
|
+
*/
|
|
28
|
+
export declare function GridViewIcon({ className, width, height }: IconProps): JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* Details/list view icon
|
|
31
|
+
* Used for toggling to details/table layout
|
|
32
|
+
*/
|
|
33
|
+
export declare function DetailsViewIcon({ className, width, height }: IconProps): JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Warning/alert triangle icon
|
|
36
|
+
* Used for development mode warnings
|
|
37
|
+
*/
|
|
38
|
+
export declare function WarningIcon({ className, width, height }: IconProps): JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* Empty presentation icon (presentation with X/crossed out)
|
|
41
|
+
* Used for empty state when no presentations are found
|
|
42
|
+
*/
|
|
43
|
+
export declare function EmptyPresentationIcon({ className, width, height }: IconProps): JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Folder icon for category/directory cards
|
|
46
|
+
*/
|
|
47
|
+
export declare function FolderIcon({ className, width, height, style }: IconProps): JSX.Element;
|
|
48
|
+
/**
|
|
49
|
+
* Back/return icon for navigating back from directory views
|
|
50
|
+
*/
|
|
51
|
+
export declare function BackIcon({ className, width, height }: IconProps): JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Author/user icon for displaying presentation authors
|
|
54
|
+
*/
|
|
55
|
+
export declare function AuthorIcon({ className, width, height, style }: IconProps): JSX.Element;
|
|
22
56
|
export {};
|
|
23
57
|
//# sourceMappingURL=icons.d.ts.map
|
package/lib/utils/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/utils/icons.tsx"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/utils/icons.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,SAAS;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAS/F;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAe1F;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAe3F;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAa3F;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAa9F;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAY1F;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAYpG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAahG;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAYvF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,KAAU,EAAE,MAAW,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAchG"}
|
package/lib/utils/icons.js
CHANGED
|
@@ -9,6 +9,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.PresentationIcon = PresentationIcon;
|
|
10
10
|
exports.SortAscIcon = SortAscIcon;
|
|
11
11
|
exports.SortDescIcon = SortDescIcon;
|
|
12
|
+
exports.GridViewIcon = GridViewIcon;
|
|
13
|
+
exports.DetailsViewIcon = DetailsViewIcon;
|
|
14
|
+
exports.WarningIcon = WarningIcon;
|
|
15
|
+
exports.EmptyPresentationIcon = EmptyPresentationIcon;
|
|
16
|
+
exports.FolderIcon = FolderIcon;
|
|
17
|
+
exports.BackIcon = BackIcon;
|
|
18
|
+
exports.AuthorIcon = AuthorIcon;
|
|
12
19
|
const react_1 = __importDefault(require("react"));
|
|
13
20
|
/**
|
|
14
21
|
* Presentation placeholder icon
|
|
@@ -34,4 +41,57 @@ function SortDescIcon({ className, width = 24, height = 24 }) {
|
|
|
34
41
|
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 1024 1024", className: className },
|
|
35
42
|
react_1.default.createElement("path", { fill: "currentColor", d: "M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9c0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4c2.4-.8 4.3-2.4 5.5-4.6c1.1-2.2 1.3-4.7.6-7.1M663.3 325.5l32.8-116.9h6.3l32.1 116.9zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3M310.3 167.1a8 8 0 0 0-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13z" })));
|
|
36
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Grid view icon
|
|
46
|
+
* Used for toggling to grid layout
|
|
47
|
+
*/
|
|
48
|
+
function GridViewIcon({ className, width = 24, height = 24 }) {
|
|
49
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", fill: "currentColor", className: className },
|
|
50
|
+
react_1.default.createElement("path", { d: "M3 3v8h8V3H3zm6 6H5V5h4v4zm-6 4v8h8v-8H3zm6 6H5v-4h4v4zm4-16v8h8V3h-8zm6 6h-4V5h4v4zm-6 4v8h8v-8h-8zm6 6h-4v-4h4v4z" })));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Details/list view icon
|
|
54
|
+
* Used for toggling to details/table layout
|
|
55
|
+
*/
|
|
56
|
+
function DetailsViewIcon({ className, width = 24, height = 24 }) {
|
|
57
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", fill: "currentColor", className: className },
|
|
58
|
+
react_1.default.createElement("path", { d: "M3 13h8v-2H3v2zm0 4h8v-2H3v2zm0-8h8V7H3v2zm10 0v2h8V9h-8zm0 8h8v-2h-8v2zm0-4h8v-2h-8v2z" })));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Warning/alert triangle icon
|
|
62
|
+
* Used for development mode warnings
|
|
63
|
+
*/
|
|
64
|
+
function WarningIcon({ className, width = 24, height = 24 }) {
|
|
65
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", className: className },
|
|
66
|
+
react_1.default.createElement("path", { fill: "currentColor", d: "M12 1.67c.955 0 1.845.467 2.39 1.247l.105.16l8.114 13.548a2.914 2.914 0 0 1-2.307 4.363l-.195.008H3.882a2.914 2.914 0 0 1-2.582-4.2l.099-.185l8.11-13.538A2.91 2.91 0 0 1 12 1.67M12.01 15l-.127.007a1 1 0 0 0 0 1.986L12 17l.127-.007a1 1 0 0 0 0-1.986zM12 8a1 1 0 0 0-.993.883L11 9v4l.007.117a1 1 0 0 0 1.986 0L13 13V9l-.007-.117A1 1 0 0 0 12 8" })));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Empty presentation icon (presentation with X/crossed out)
|
|
70
|
+
* Used for empty state when no presentations are found
|
|
71
|
+
*/
|
|
72
|
+
function EmptyPresentationIcon({ className, width = 24, height = 24 }) {
|
|
73
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", className: className },
|
|
74
|
+
react_1.default.createElement("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M3 4h1m4 0h13M4 4v10a2 2 0 0 0 2 2h10m3.42-.592c.359-.362.58-.859.58-1.408V4m-8 12v4m-3 0h6m-7-8l2-2m4 0l2-2M3 3l18 18" })));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Folder icon for category/directory cards
|
|
78
|
+
*/
|
|
79
|
+
function FolderIcon({ className, width = 24, height = 24, style }) {
|
|
80
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", className: className, style: style },
|
|
81
|
+
react_1.default.createElement("path", { fill: "currentColor", d: "M20 6h-8l-1.41-1.41C10.21 4.21 9.7 4 9.17 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-1 12H5c-.55 0-1-.45-1-1V9c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1" })));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Back/return icon for navigating back from directory views
|
|
85
|
+
*/
|
|
86
|
+
function BackIcon({ className, width = 24, height = 24 }) {
|
|
87
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 48 48", className: className },
|
|
88
|
+
react_1.default.createElement("path", { fill: "none", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: "4", d: "M44 40.836q-7.34-8.96-13.036-10.168t-10.846-.365V41L4 23.545L20.118 7v10.167q9.523.075 16.192 6.833q6.668 6.758 7.69 16.836Z", clipRule: "evenodd" })));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Author/user icon for displaying presentation authors
|
|
92
|
+
*/
|
|
93
|
+
function AuthorIcon({ className, width = 16, height = 16, style }) {
|
|
94
|
+
return (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 16 16", fill: "currentColor", className: className, style: style },
|
|
95
|
+
react_1.default.createElement("path", { d: "M8 8a3 3 0 100-6 3 3 0 000 6zm0 1a6 6 0 00-6 6h12a6 6 0 00-6-6z" })));
|
|
96
|
+
}
|
|
37
97
|
//# sourceMappingURL=icons.js.map
|
package/lib/utils/icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/utils/icons.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/utils/icons.tsx"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAeH,4CASC;AAKD,kCAeC;AAKD,oCAeC;AAMD,oCAaC;AAMD,0CAaC;AAMD,kCAYC;AAMD,sDAYC;AAKD,gCAaC;AAKD,4BAYC;AAKD,gCAcC;AA9LD,kDAA0B;AAS1B;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAa;IAChF,OAAO,CACL,uCAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAC,WAAW;QAC7G,qCAAG,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAC,GAAG;YAC/F,wCAAM,CAAC,EAAC,gEAAgE,GAAG;YAC3E,wCAAM,CAAC,EAAC,mBAAmB,GAAG,CAC5B,CACA,CACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAa;IAC3E,OAAO,CACL,uCACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAC,eAAe,EACvB,SAAS,EAAE,SAAS;QAEpB,wCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,wsBAAwsB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M,EAAC,MAAM,EAAC,cAAc,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAC,GAAG,EAAC,CAAC,EAAC,8HAA8H,EAAC,QAAQ,EAAC,SAAS,GAAG,CACjO,CACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,EAAa;IACjF,OAAO,CACL,uCACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,EACnB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK;QAEZ,wCAAM,CAAC,EAAC,iEAAiE,GAAG,CACxE,CACP,CAAC;AACJ,CAAC"}
|
package/lib/utils/logger.d.ts
CHANGED
|
@@ -36,8 +36,17 @@ export declare function formatNumber(num: number): string;
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function formatCode(code: string): string;
|
|
38
38
|
/**
|
|
39
|
-
* Filter Slidev build output to remove unwanted warnings
|
|
40
|
-
*
|
|
39
|
+
* Filter Slidev build output to remove unwanted warnings and verbose messages
|
|
40
|
+
* Filters:
|
|
41
|
+
* - outDir "will not be emptied" warning (plugin handles cleanup)
|
|
42
|
+
* - Vite chunk manifest output (*.js file sizes)
|
|
43
|
+
* - "transforming..." progress messages
|
|
44
|
+
* - Module transformation counts
|
|
41
45
|
*/
|
|
42
46
|
export declare function filterSlidevOutput(output: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a log line should be shown in non-verbose mode
|
|
49
|
+
* Only shows important progress/completion messages
|
|
50
|
+
*/
|
|
51
|
+
export declare function isImportantOutput(line: string): boolean;
|
|
43
52
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],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AAG,MAAM,CAE/C;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAkDzD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAiBvD"}
|
package/lib/utils/logger.js
CHANGED
|
@@ -16,8 +16,9 @@ exports.formatPath = formatPath;
|
|
|
16
16
|
exports.formatNumber = formatNumber;
|
|
17
17
|
exports.formatCode = formatCode;
|
|
18
18
|
exports.filterSlidevOutput = filterSlidevOutput;
|
|
19
|
+
exports.isImportantOutput = isImportantOutput;
|
|
19
20
|
const logger_1 = __importDefault(require("@docusaurus/logger"));
|
|
20
|
-
const PLUGIN_PREFIX =
|
|
21
|
+
const PLUGIN_PREFIX = "Slidev Plugin";
|
|
21
22
|
/**
|
|
22
23
|
* Log info message
|
|
23
24
|
* Format: [INFO] [Slidev Plugin] message
|
|
@@ -71,22 +72,77 @@ function formatCode(code) {
|
|
|
71
72
|
return logger_1.default.code(code);
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
|
-
* Filter Slidev build output to remove unwanted warnings
|
|
75
|
-
*
|
|
75
|
+
* Filter Slidev build output to remove unwanted warnings and verbose messages
|
|
76
|
+
* Filters:
|
|
77
|
+
* - outDir "will not be emptied" warning (plugin handles cleanup)
|
|
78
|
+
* - Vite chunk manifest output (*.js file sizes)
|
|
79
|
+
* - "transforming..." progress messages
|
|
80
|
+
* - Module transformation counts
|
|
76
81
|
*/
|
|
77
82
|
function filterSlidevOutput(output) {
|
|
78
|
-
const lines = output.split(
|
|
79
|
-
const filtered = lines.filter(line => {
|
|
83
|
+
const lines = output.split("\n");
|
|
84
|
+
const filtered = lines.filter((line) => {
|
|
85
|
+
const trimmedLine = line.trim();
|
|
80
86
|
// Filter out the outDir warning
|
|
81
|
-
if (line.includes(
|
|
87
|
+
if (line.includes("outDir") && line.includes("will not be emptied")) {
|
|
82
88
|
return false;
|
|
83
89
|
}
|
|
84
90
|
// Filter out the empty override suggestion line
|
|
85
|
-
if (line.includes(
|
|
91
|
+
if (line.includes("Use --emptyOutDir to override")) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
// Filter out "not inside project root" warnings
|
|
95
|
+
if (line.includes("is not inside project root")) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
// Filter out Vite chunk manifest output (*.js file sizes)
|
|
99
|
+
// Pattern: "path/to/file.js 1.23 kB │ gzip: 0.45 kB"
|
|
100
|
+
if (/\.js\s+[\d.]+\s*(kB|KB|MB|B)\s*[│|]\s*gzip:/i.test(trimmedLine)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
// Filter out CSS chunk output too
|
|
104
|
+
if (/\.css\s+[\d.]+\s*(kB|KB|MB|B)\s*[│|]\s*gzip:/i.test(trimmedLine)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
// Filter out "transforming..." messages
|
|
108
|
+
if (trimmedLine === "transforming..." ||
|
|
109
|
+
trimmedLine.startsWith("transforming (")) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// Filter out "✓ N modules transformed" messages
|
|
113
|
+
if (/^✓\s*\d+\s*modules? transformed/i.test(trimmedLine)) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
// Filter out rendering progress messages
|
|
117
|
+
if (/^rendering\s+\(\d+\/\d+\)/i.test(trimmedLine)) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
// Filter out empty lines that result from filtering
|
|
121
|
+
if (trimmedLine === "") {
|
|
86
122
|
return false;
|
|
87
123
|
}
|
|
88
124
|
return true;
|
|
89
125
|
});
|
|
90
|
-
return filtered.join(
|
|
126
|
+
return filtered.join("\n").trim();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Check if a log line should be shown in non-verbose mode
|
|
130
|
+
* Only shows important progress/completion messages
|
|
131
|
+
*/
|
|
132
|
+
function isImportantOutput(line) {
|
|
133
|
+
const trimmed = line.trim();
|
|
134
|
+
// Show build completion messages
|
|
135
|
+
if (trimmed.includes("✓ built in")) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
// Show error messages
|
|
139
|
+
if (/error|failed|cannot find/i.test(trimmed)) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
// Show warning messages (but not filtered ones)
|
|
143
|
+
if (trimmed.startsWith("⚠") && !trimmed.includes("outDir")) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
91
147
|
}
|
|
92
148
|
//# sourceMappingURL=logger.js.map
|
package/lib/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAUH,0BAEC;AAMD,0BAEC;AAMD,4BAOC;AAMD,gCAEC;AAKD,gCAEC;AAKD,oCAEC;AAKD,gCAEC;AAMD,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAUH,0BAEC;AAMD,0BAEC;AAMD,4BAOC;AAMD,gCAEC;AAKD,gCAEC;AAKD,oCAEC;AAKD,gCAEC;AAUD,gDAkDC;AAMD,8CAiBC;AA/ID,gEAAwC;AAExC,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,gBAAM,CAAC,IAAI,CAAA,IAAI,aAAa,KAAK,OAAO,EAAE,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,gBAAM,CAAC,IAAI,CAAA,IAAI,aAAa,KAAK,OAAO,EAAE,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,KAAW;IACnD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C9C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,gDAAgD;IAChD,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sp-days-framework/docusaurus-plugin-slidev",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A Docusaurus plugin to integrate Slidev presentations into your Docusaurus site.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@docusaurus/types": "^3.9.2",
|
|
59
59
|
"@docusaurus/utils-validation": "^3.9.2",
|
|
60
60
|
"@types/fs-extra": "^11.0.1",
|
|
61
|
+
"@types/js-yaml": "^4.0.9",
|
|
61
62
|
"@types/node": "^24.9.1",
|
|
62
63
|
"@types/react": "^18.3.0",
|
|
63
64
|
"@types/react-dom": "^18.3.0",
|
package/publish-package-docs.js
CHANGED
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
module.exports = {
|
|
9
|
-
id:
|
|
10
|
-
path: require(
|
|
11
|
-
|
|
9
|
+
id: "slidev-integration-docs",
|
|
10
|
+
path: require("path").join(__dirname, "docs"),
|
|
11
|
+
editUrl: function (params) {
|
|
12
|
+
// Remove node_modules/@sp-days-framework/docusaurus-plugin-slidev/docs from the path
|
|
13
|
+
const cleanPath = params.docPath.replace(
|
|
14
|
+
/^.*node_modules\/@sp-days-framework\/docusaurus-plugin-slidev\/docs\//,
|
|
15
|
+
"",
|
|
16
|
+
);
|
|
17
|
+
return `https://github.com/helse-sorost/sp-days-framework/edit/main/docusaurus-plugin-slidev/docs/${cleanPath}`;
|
|
18
|
+
},
|
|
19
|
+
routeBasePath: "package-docs/slidev-integration",
|
|
12
20
|
};
|