funuicss 3.7.9 → 3.7.11
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/css/fun.css +65 -47
- package/package.json +1 -1
- package/ui/card/Card.d.ts +22 -2
- package/ui/card/Card.js +51 -162
- package/ui/theme/theme.d.ts +1 -1
- package/ui/theme/theme.js +98 -70
- package/ui/video/Video.d.ts +3 -1
- package/ui/video/Video.js +309 -91
- package/ui/vista/Vista.d.ts +6 -0
- package/ui/vista/Vista.js +3 -8
package/ui/theme/theme.js
CHANGED
|
@@ -117,7 +117,7 @@ var validateOriginAccess = function (projectId) { return __awaiter(void 0, void
|
|
|
117
117
|
switch (_a.label) {
|
|
118
118
|
case 0:
|
|
119
119
|
if (!projectId) {
|
|
120
|
-
console.error('❌ No project ID provided');
|
|
120
|
+
console.error('❌ No project ID provided for origin validation');
|
|
121
121
|
return [2 /*return*/, false];
|
|
122
122
|
}
|
|
123
123
|
currentOrigin = getCurrentOrigin();
|
|
@@ -179,7 +179,7 @@ var loadLocalTheme = function () { return __awaiter(void 0, void 0, void 0, func
|
|
|
179
179
|
case 3: return [3 /*break*/, 5];
|
|
180
180
|
case 4:
|
|
181
181
|
error_2 = _a.sent();
|
|
182
|
-
console.log('No local theme file found');
|
|
182
|
+
console.log('ℹ️ No local theme file found');
|
|
183
183
|
return [3 /*break*/, 5];
|
|
184
184
|
case 5: return [2 /*return*/, null];
|
|
185
185
|
}
|
|
@@ -193,28 +193,34 @@ var loadThemeFromCDN = function (projectId) { return __awaiter(void 0, void 0, v
|
|
|
193
193
|
return __generator(this, function (_a) {
|
|
194
194
|
switch (_a.label) {
|
|
195
195
|
case 0:
|
|
196
|
-
|
|
196
|
+
if (!projectId) {
|
|
197
|
+
console.error('❌ No project ID provided for CDN loading');
|
|
198
|
+
return [2 /*return*/, null];
|
|
199
|
+
}
|
|
200
|
+
_a.label = 1;
|
|
201
|
+
case 1:
|
|
202
|
+
_a.trys.push([1, 6, , 7]);
|
|
197
203
|
publicUrl = "https://firebasestorage.googleapis.com/v0/b/funui-4bcd1.firebasestorage.app/o/themes%2F".concat(projectId, ".json?alt=media");
|
|
198
204
|
return [4 /*yield*/, fetch(publicUrl, {
|
|
199
205
|
cache: 'no-cache',
|
|
200
206
|
})];
|
|
201
|
-
case
|
|
207
|
+
case 2:
|
|
202
208
|
response = _a.sent();
|
|
203
|
-
if (!response.ok) return [3 /*break*/,
|
|
209
|
+
if (!response.ok) return [3 /*break*/, 4];
|
|
204
210
|
return [4 /*yield*/, response.json()];
|
|
205
|
-
case
|
|
211
|
+
case 3:
|
|
206
212
|
data = _a.sent();
|
|
207
213
|
console.log('✅ Loaded theme from Firebase Storage CDN');
|
|
208
214
|
return [2 /*return*/, data];
|
|
209
|
-
case
|
|
210
|
-
console.error('Firebase Storage fetch failed:', response.status, response.statusText);
|
|
211
|
-
_a.label =
|
|
212
|
-
case
|
|
213
|
-
case
|
|
215
|
+
case 4:
|
|
216
|
+
console.error('❌ Firebase Storage fetch failed:', response.status, response.statusText);
|
|
217
|
+
_a.label = 5;
|
|
218
|
+
case 5: return [3 /*break*/, 7];
|
|
219
|
+
case 6:
|
|
214
220
|
error_3 = _a.sent();
|
|
215
|
-
console.error('Error loading from Firebase Storage:', error_3);
|
|
216
|
-
return [3 /*break*/,
|
|
217
|
-
case
|
|
221
|
+
console.error('❌ Error loading from Firebase Storage:', error_3);
|
|
222
|
+
return [3 /*break*/, 7];
|
|
223
|
+
case 7: return [2 /*return*/, null];
|
|
218
224
|
}
|
|
219
225
|
});
|
|
220
226
|
}); };
|
|
@@ -306,99 +312,124 @@ var ThemeProvider = function (_a) {
|
|
|
306
312
|
});
|
|
307
313
|
}
|
|
308
314
|
}, [theme]);
|
|
309
|
-
/* ----------------------
|
|
315
|
+
/* ---------------------- Theme Loading Logic ----------------------- */
|
|
310
316
|
(0, react_1.useEffect)(function () {
|
|
311
317
|
if (typeof window === 'undefined') {
|
|
312
318
|
setIsLoading(false);
|
|
313
319
|
setIsInitialLoad(false);
|
|
314
320
|
return;
|
|
315
321
|
}
|
|
316
|
-
if (!projectId) {
|
|
317
|
-
console.error('❌ ThemeProvider: No projectId provided');
|
|
318
|
-
setError('Project ID is required');
|
|
319
|
-
setIsLoading(false);
|
|
320
|
-
setIsInitialLoad(false);
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
322
|
var root = document.documentElement;
|
|
324
323
|
var pollTimer;
|
|
325
|
-
var
|
|
326
|
-
var
|
|
324
|
+
var loadTheme = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
325
|
+
var finalTheme, finalVersion, localTheme, localVersion, hasAccess, cdnTheme, cdnVersion, err_1;
|
|
327
326
|
return __generator(this, function (_a) {
|
|
328
327
|
switch (_a.label) {
|
|
329
328
|
case 0:
|
|
330
|
-
_a.trys.push([0,
|
|
331
|
-
console.log('🔄 Starting theme
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
hasAccess = _a.sent();
|
|
335
|
-
if (!hasAccess) {
|
|
336
|
-
setError('Access denied: This domain is not authorized to use this theme');
|
|
337
|
-
setIsLoading(false);
|
|
338
|
-
setIsInitialLoad(false);
|
|
339
|
-
return [2 /*return*/];
|
|
340
|
-
}
|
|
329
|
+
_a.trys.push([0, 8, 9, 10]);
|
|
330
|
+
console.log('🔄 Starting theme loading process...');
|
|
331
|
+
finalTheme = null;
|
|
332
|
+
finalVersion = null;
|
|
341
333
|
return [4 /*yield*/, loadLocalTheme()];
|
|
342
|
-
case
|
|
334
|
+
case 1:
|
|
343
335
|
localTheme = _a.sent();
|
|
344
336
|
localVersion = (localTheme === null || localTheme === void 0 ? void 0 : localTheme.version) || 0;
|
|
337
|
+
if (!projectId) return [3 /*break*/, 6];
|
|
338
|
+
console.log('🔑 Project ID provided, attempting CDN load with origin validation...');
|
|
339
|
+
return [4 /*yield*/, validateOriginAccess(projectId)];
|
|
340
|
+
case 2:
|
|
341
|
+
hasAccess = _a.sent();
|
|
342
|
+
if (!hasAccess) return [3 /*break*/, 4];
|
|
345
343
|
return [4 /*yield*/, loadThemeFromCDN(projectId)];
|
|
346
344
|
case 3:
|
|
347
345
|
cdnTheme = _a.sent();
|
|
348
346
|
cdnVersion = (cdnTheme === null || cdnTheme === void 0 ? void 0 : cdnTheme.version) || 0;
|
|
349
347
|
if (cdnTheme) {
|
|
350
|
-
//
|
|
348
|
+
// CDN theme available - use it
|
|
349
|
+
finalTheme = cdnTheme;
|
|
350
|
+
finalVersion = cdnVersion;
|
|
351
351
|
if (cdnVersion !== localVersion) {
|
|
352
352
|
console.log("\uD83D\uDD04 Version mismatch: Local(".concat(localVersion, ") vs CDN(").concat(cdnVersion, ")"));
|
|
353
353
|
console.log('ℹ️ Using CDN version. Please update your local funui.json file manually.');
|
|
354
354
|
}
|
|
355
|
-
|
|
356
|
-
if (!currentVersion || cdnVersion !== currentVersion) {
|
|
357
|
-
applyThemeData(cdnTheme, root);
|
|
358
|
-
setCurrentVersion(cdnVersion);
|
|
359
|
-
console.log('✅ Theme loaded from CDN');
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
console.log('✓ Theme up to date');
|
|
363
|
-
}
|
|
364
|
-
setError(null);
|
|
355
|
+
console.log('✅ Theme loaded from CDN');
|
|
365
356
|
}
|
|
366
357
|
else if (localTheme) {
|
|
367
|
-
// CDN not available but we have local
|
|
368
|
-
console.log('⚠️
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
setError(null);
|
|
358
|
+
// CDN not available but we have local theme
|
|
359
|
+
console.log('⚠️ CDN unavailable, using local theme');
|
|
360
|
+
finalTheme = localTheme;
|
|
361
|
+
finalVersion = localVersion;
|
|
372
362
|
}
|
|
373
363
|
else {
|
|
374
364
|
// No theme available anywhere
|
|
375
|
-
console.warn('⚠️ No theme found');
|
|
365
|
+
console.warn('⚠️ No theme found (CDN unavailable and no local theme)');
|
|
376
366
|
setError('Theme not found');
|
|
377
367
|
}
|
|
378
|
-
return [3 /*break*/,
|
|
368
|
+
return [3 /*break*/, 5];
|
|
379
369
|
case 4:
|
|
370
|
+
// Origin validation failed
|
|
371
|
+
if (localTheme) {
|
|
372
|
+
console.log('⚠️ Origin validation failed, using local theme');
|
|
373
|
+
finalTheme = localTheme;
|
|
374
|
+
finalVersion = localVersion;
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
console.error('❌ Origin validation failed and no local theme available');
|
|
378
|
+
setError('Access denied and no local theme available');
|
|
379
|
+
}
|
|
380
|
+
_a.label = 5;
|
|
381
|
+
case 5: return [3 /*break*/, 7];
|
|
382
|
+
case 6:
|
|
383
|
+
// No project ID provided - only use local theme
|
|
384
|
+
console.log('ℹ️ No project ID provided, using local theme only');
|
|
385
|
+
if (localTheme) {
|
|
386
|
+
finalTheme = localTheme;
|
|
387
|
+
finalVersion = localVersion;
|
|
388
|
+
console.log('✅ Theme loaded from local file');
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
console.log('ℹ️ No local theme file found - using base theme only');
|
|
392
|
+
// No error here - it's valid to use only base theme
|
|
393
|
+
}
|
|
394
|
+
_a.label = 7;
|
|
395
|
+
case 7:
|
|
396
|
+
// Apply the theme if we have one
|
|
397
|
+
if (finalTheme && (!currentVersion || finalVersion !== currentVersion)) {
|
|
398
|
+
applyThemeData(finalTheme, root);
|
|
399
|
+
setCurrentVersion(finalVersion);
|
|
400
|
+
setError(null);
|
|
401
|
+
}
|
|
402
|
+
else if (finalTheme) {
|
|
403
|
+
console.log('✓ Theme up to date');
|
|
404
|
+
}
|
|
405
|
+
return [3 /*break*/, 10];
|
|
406
|
+
case 8:
|
|
380
407
|
err_1 = _a.sent();
|
|
381
|
-
console.error('❌ Error
|
|
382
|
-
setError('Failed to
|
|
383
|
-
return [3 /*break*/,
|
|
384
|
-
case
|
|
408
|
+
console.error('❌ Error loading theme:', err_1);
|
|
409
|
+
setError('Failed to load theme');
|
|
410
|
+
return [3 /*break*/, 10];
|
|
411
|
+
case 9:
|
|
385
412
|
setIsLoading(false);
|
|
386
413
|
setIsInitialLoad(false);
|
|
387
414
|
return [7 /*endfinally*/];
|
|
388
|
-
case
|
|
415
|
+
case 10: return [2 /*return*/];
|
|
389
416
|
}
|
|
390
417
|
});
|
|
391
418
|
}); };
|
|
392
|
-
// Initial
|
|
393
|
-
|
|
394
|
-
//
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
419
|
+
// Initial load
|
|
420
|
+
loadTheme();
|
|
421
|
+
// Only poll for updates if we have a project ID
|
|
422
|
+
if (projectId) {
|
|
423
|
+
pollTimer = setInterval(function () {
|
|
424
|
+
loadTheme();
|
|
425
|
+
}, 5 * 60 * 1000);
|
|
426
|
+
}
|
|
398
427
|
return function () {
|
|
399
|
-
|
|
428
|
+
if (pollTimer) {
|
|
429
|
+
clearInterval(pollTimer);
|
|
430
|
+
}
|
|
400
431
|
};
|
|
401
|
-
}, [projectId, currentVersion]);
|
|
432
|
+
}, [projectId, currentVersion, theme]);
|
|
402
433
|
var applyThemeData = function (data, root) {
|
|
403
434
|
var _a;
|
|
404
435
|
var themeConfig = (_a = data.theme_config) !== null && _a !== void 0 ? _a : {};
|
|
@@ -531,9 +562,6 @@ var getAssetInfo = function (name) {
|
|
|
531
562
|
};
|
|
532
563
|
};
|
|
533
564
|
exports.getAssetInfo = getAssetInfo;
|
|
534
|
-
/* -------------------------------------------------------------------------- */
|
|
535
|
-
/* ASSETS HOOKS */
|
|
536
|
-
/* -------------------------------------------------------------------------- */
|
|
537
565
|
// Hook to access all assets
|
|
538
566
|
var useAssets = function () {
|
|
539
567
|
var projectData = (0, exports.useTheme)().projectData;
|
package/ui/video/Video.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ interface VideoProps {
|
|
|
43
43
|
rewindCss?: string;
|
|
44
44
|
forwardCss?: string;
|
|
45
45
|
buttonCss?: string;
|
|
46
|
+
volumeStyle?: 'slider' | 'compact' | 'hover';
|
|
47
|
+
variant?: string;
|
|
46
48
|
}
|
|
47
|
-
export default function Video({ src, poster, onDuration, onEnded, isPause, spacebarPlay, className, autoPlay, showControls, showPlayPause, showProgress, showVolume, showTime, showFullscreen, showDownload, showSeekButtons, playIcon, pauseIcon, fullscreenIcon, downloadIcon, volumeIcon, muteIcon, rewindIcon, forwardIcon, hideControlsDelay, loop, muted, seekAmount, funcss, containerCss, videoCss, controlsCss, progressCss, progressBarCss, timeCss, playCss, pauseCss, volumeCss, fullscreenCss, downloadCss, rewindCss, forwardCss, buttonCss, }: VideoProps): React.JSX.Element;
|
|
49
|
+
export default function Video({ src, poster, onDuration, onEnded, isPause, spacebarPlay, className, autoPlay, showControls, showPlayPause, showProgress, showVolume, showTime, showFullscreen, showDownload, showSeekButtons, playIcon, pauseIcon, fullscreenIcon, downloadIcon, volumeIcon, muteIcon, rewindIcon, forwardIcon, hideControlsDelay, loop, muted, seekAmount, funcss, containerCss, videoCss, controlsCss, progressCss, progressBarCss, timeCss, playCss, pauseCss, volumeCss, fullscreenCss, downloadCss, rewindCss, forwardCss, buttonCss, volumeStyle, variant, ...rest }: VideoProps): React.JSX.Element;
|
|
48
50
|
export {};
|