dolphincss 1.3.2 → 1.3.3
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/bin/dolphin.js +30 -17
- package/core-templates/dolphin-loader.html +7 -0
- package/core-templates/dolphin-loading-button.html +30 -0
- package/dist/assets/{main-Ceq0_-ZS.css → main-BxPtTpfb.css} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +9 -9
- package/dolphin-css.css +1 -1
- package/marker.json +8 -0
- package/package.json +5 -3
package/bin/dolphin.js
CHANGED
|
@@ -170,6 +170,9 @@ function setupVSCodeIntelliSense(markers) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
async function init() {
|
|
173
|
+
// Always load local markers first so core/offline templates are available
|
|
174
|
+
loadLocalMarkers();
|
|
175
|
+
|
|
173
176
|
let remoteUrl = '';
|
|
174
177
|
|
|
175
178
|
// 1. Load config
|
|
@@ -213,7 +216,10 @@ async function init() {
|
|
|
213
216
|
console.log(`🚀 On-demand fetching active. (Markers will be downloaded when used)`);
|
|
214
217
|
|
|
215
218
|
setupVSCodeIntelliSense(remoteMarkerMap);
|
|
216
|
-
|
|
219
|
+
const startupAppPath = path.join(projectRoot, 'src/App.jsx');
|
|
220
|
+
if (fs.existsSync(startupAppPath)) {
|
|
221
|
+
processFile(startupAppPath);
|
|
222
|
+
}
|
|
217
223
|
startWatcher();
|
|
218
224
|
} catch (error) {
|
|
219
225
|
console.error(`❌ Sync Error: ${error.message}`);
|
|
@@ -236,7 +242,6 @@ async function init() {
|
|
|
236
242
|
}
|
|
237
243
|
|
|
238
244
|
async function processFile(filePath) {
|
|
239
|
-
console.log(`🔍 processFile triggered for: ${filePath}`);
|
|
240
245
|
if (filePath.includes('templates' + path.sep) || filePath.includes('bin' + path.sep) || filePath.includes('node_modules')) return;
|
|
241
246
|
|
|
242
247
|
const ext = path.extname(filePath).toLowerCase();
|
|
@@ -290,7 +295,7 @@ async function processFile(filePath) {
|
|
|
290
295
|
fetchingMarkers.delete(markerClass); // Always remove from fetching set
|
|
291
296
|
}
|
|
292
297
|
} else {
|
|
293
|
-
|
|
298
|
+
// Silent skip - already fetched or fetching
|
|
294
299
|
}
|
|
295
300
|
}
|
|
296
301
|
}
|
|
@@ -373,17 +378,17 @@ async function processFile(filePath) {
|
|
|
373
378
|
if (isReact) {
|
|
374
379
|
if (!templateData.isJsxTemplate) {
|
|
375
380
|
finalTemplate = finalTemplate
|
|
376
|
-
.replace(
|
|
377
|
-
.replace(
|
|
378
|
-
.replace(
|
|
379
|
-
.replace(
|
|
380
|
-
.replace(
|
|
381
|
-
.replace(
|
|
382
|
-
.replace(
|
|
383
|
-
.replace(
|
|
384
|
-
.replace(
|
|
381
|
+
.replace(/\bclass=/g, 'className=')
|
|
382
|
+
.replace(/\bfor=/g, 'htmlFor=')
|
|
383
|
+
.replace(/\btabindex=/g, 'tabIndex=')
|
|
384
|
+
.replace(/\bonclick=/g, 'onClick=')
|
|
385
|
+
.replace(/\bstroke-linecap=/g, 'strokeLinecap=')
|
|
386
|
+
.replace(/\bstroke-linejoin=/g, 'strokeLinejoin=')
|
|
387
|
+
.replace(/\bstroke-width=/g, 'strokeWidth=')
|
|
388
|
+
.replace(/\bfill-rule=/g, 'fillRule=')
|
|
389
|
+
.replace(/\bclip-rule=/g, 'clipRule=')
|
|
385
390
|
.replace(/<!--([\s\S]*?)-->/g, '{/*$1*/}')
|
|
386
|
-
.replace(
|
|
391
|
+
.replace(/\bstop-color=/g, 'stopColor=')
|
|
387
392
|
.replace(/style="([^"]*)"/g, (_, s) => {
|
|
388
393
|
const obj = s.split(';').filter(Boolean).map(p => {
|
|
389
394
|
const [k, v] = p.split(':').map(x => x.trim());
|
|
@@ -399,7 +404,7 @@ async function processFile(filePath) {
|
|
|
399
404
|
});
|
|
400
405
|
}
|
|
401
406
|
} else {
|
|
402
|
-
finalTemplate = finalTemplate.replace(
|
|
407
|
+
finalTemplate = finalTemplate.replace(/\bclassName=/g, 'class=');
|
|
403
408
|
}
|
|
404
409
|
|
|
405
410
|
if (finalTemplate.includes('{/* INNER */}')) {
|
|
@@ -433,14 +438,22 @@ async function processFile(filePath) {
|
|
|
433
438
|
}
|
|
434
439
|
|
|
435
440
|
function startWatcher() {
|
|
436
|
-
const watcher = chokidar.watch(
|
|
437
|
-
|
|
441
|
+
const watcher = chokidar.watch('.', {
|
|
442
|
+
cwd: projectRoot,
|
|
443
|
+
ignored: (file) => {
|
|
444
|
+
const normalised = file.replace(/\\/g, '/');
|
|
445
|
+
const parts = normalised.split('/');
|
|
446
|
+
return parts.some(part =>
|
|
447
|
+
['node_modules', '.git', 'templates', 'bin', 'dist'].includes(part)
|
|
448
|
+
);
|
|
449
|
+
},
|
|
438
450
|
persistent: true,
|
|
439
451
|
ignoreInitial: false,
|
|
440
452
|
awaitWriteFinish: { stabilityThreshold: 400, pollInterval: 100 },
|
|
441
453
|
});
|
|
442
454
|
|
|
443
|
-
watcher.on('add', filePath => processFile(
|
|
455
|
+
watcher.on('add', filePath => processFile(path.join(projectRoot, filePath)))
|
|
456
|
+
.on('change', filePath => processFile(path.join(projectRoot, filePath)));
|
|
444
457
|
console.log('👁️ Watching for markers...');
|
|
445
458
|
}
|
|
446
459
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div className="flex flex-col items-center justify-center gap-4 p-8 fx-crystal rounded-3xl max-w-sm mx-auto bg-surface/40">
|
|
2
|
+
<div className="loader-dolphin-jump">
|
|
3
|
+
<div className="dolphin"></div>
|
|
4
|
+
<div className="wave"></div>
|
|
5
|
+
</div>
|
|
6
|
+
<p className="text-sm font-semibold text-text-muted animate-pulse tracking-wide">Loading...</p>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div className="flex flex-col gap-8 p-8 fx-crystal rounded-3xl bg-surface/40">
|
|
2
|
+
<div className="flex flex-wrap gap-4 items-center">
|
|
3
|
+
{/* Primary Filled Loading Button */}
|
|
4
|
+
<button className="filled primary px-6 py-3 rounded-xl flex items-center justify-center gap-3 opacity-90 cursor-not-allowed glow" disabled>
|
|
5
|
+
<svg className="spin-fast h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
6
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
|
|
7
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
8
|
+
</svg>
|
|
9
|
+
<span className="font-bold">Processing...</span>
|
|
10
|
+
</button>
|
|
11
|
+
|
|
12
|
+
{/* Secondary Outlined Loading Button */}
|
|
13
|
+
<button className="outlined secondary px-6 py-3 rounded-xl flex items-center justify-center gap-3 opacity-90 cursor-not-allowed glow" disabled>
|
|
14
|
+
<svg className="spin-medium h-5 w-5 text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
15
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
|
|
16
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
17
|
+
</svg>
|
|
18
|
+
<span className="font-bold text-text">Loading...</span>
|
|
19
|
+
</button>
|
|
20
|
+
|
|
21
|
+
{/* Success Gradient Loading Button */}
|
|
22
|
+
<button className="filled success px-6 py-3 rounded-xl flex items-center justify-center gap-3 opacity-90 cursor-not-allowed glow pulse" disabled>
|
|
23
|
+
<svg className="spin-fast h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
24
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
|
|
25
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
26
|
+
</svg>
|
|
27
|
+
<span className="font-bold">Please wait...</span>
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|