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 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
- processFile(path.join(projectRoot, 'src/App.jsx'));
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
- console.log(`Skipping fetch for ${markerClass}: InRegistry=${!!templateRegistry[markerClass]} InRemote=${!!remoteMarkerMap[markerClass]} Fetching=${fetchingMarkers.has(markerClass)}`);
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(/class=/g, 'className=')
377
- .replace(/for=/g, 'htmlFor=')
378
- .replace(/tabindex=/g, 'tabIndex=')
379
- .replace(/onclick=/g, 'onClick=')
380
- .replace(/stroke-linecap=/g, 'strokeLinecap=')
381
- .replace(/stroke-linejoin=/g, 'strokeLinejoin=')
382
- .replace(/stroke-width=/g, 'strokeWidth=')
383
- .replace(/fill-rule=/g, 'fillRule=')
384
- .replace(/clip-rule=/g, 'clipRule=')
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(/stop-color=/g, 'stopColor=')
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(/className=/g, 'class=');
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(['./src/**/*.{js,jsx,ts,tsx,html}', './*.html'], {
437
- ignored: /(node_modules|\.git|templates|bin)/,
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(filePath)).on('change', filePath => processFile(filePath));
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>