funuicss 3.7.8 → 3.7.10

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 CHANGED
@@ -1412,152 +1412,268 @@ border-radius: var(--borderRadius);
1412
1412
  outline-offset: 2px;
1413
1413
  }
1414
1414
 
1415
-
1416
-
1417
- /* video */
1418
- .video_player{
1415
+ /* Video Component Styles */
1416
+ .video_player {
1419
1417
  border-radius: 1rem;
1420
1418
  width: 100%;
1419
+ cursor: pointer;
1421
1420
  }
1422
- .video_container{
1421
+
1422
+ .video_container {
1423
1423
  position: relative;
1424
1424
  width: fit-content;
1425
1425
  height: fit-content;
1426
1426
  padding: 0;
1427
1427
  border-radius: 1rem;
1428
1428
  color: var(--text-color);
1429
+ cursor: pointer;
1430
+ transition: all 0.3s ease;
1429
1431
  }
1430
- .video_controls{
1432
+
1433
+ .video_controls {
1431
1434
  position: absolute;
1432
1435
  bottom: 0;
1433
1436
  left: 0;
1434
1437
  width: 100%;
1435
- height: 100%;
1438
+ padding: 1.5rem 1rem 1rem;
1436
1439
  display: flex;
1437
1440
  flex-direction: column;
1438
1441
  justify-content: flex-end;
1439
- padding: 1rem ;
1440
- display: none;
1441
-
1442
1442
  border-radius: 1rem;
1443
+ transition: all 0.3s ease;
1444
+ opacity: 1;
1445
+ transform: translateY(0);
1443
1446
  }
1444
1447
 
1445
- .video_poster{
1448
+ .video_controls.hide_controls {
1449
+ opacity: 0;
1450
+ transform: translateY(10px);
1451
+ pointer-events: none;
1452
+ }
1453
+
1454
+ .video_controls.show_controls {
1455
+ opacity: 1;
1456
+ transform: translateY(0);
1457
+ pointer-events: all;
1458
+ }
1459
+
1460
+ .video_poster {
1446
1461
  position: absolute;
1447
1462
  top: 0;
1448
1463
  width: 100%;
1449
1464
  height: 100%;
1450
1465
  border-radius: 1rem;
1451
1466
  background-position: center !important;
1452
- background-size: cover;
1453
- background-repeat: no-repeat;
1454
- }
1455
- .video_controls.show_controls{
1456
- display: flex ;
1467
+ background-size: cover !important;
1468
+ background-repeat: no-repeat !important;
1469
+ cursor: pointer;
1470
+ z-index: 1;
1457
1471
  }
1458
1472
 
1459
- .video_controls.hide_controls{
1460
- display: none !important;
1473
+ /* Beautiful Progress Bar */
1474
+ .progress-container {
1475
+ width: 100%;
1476
+ padding: 0 0.5rem;
1461
1477
  }
1462
1478
 
1463
- .video_container:hover .video_controls{
1464
- display: flex;
1479
+ .progress-wrapper {
1480
+ position: relative;
1481
+ width: 100%;
1465
1482
  }
1466
1483
 
1467
- .video_player_design {
1468
- border-radius: 1.5rem;
1469
- /* box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; */
1470
- box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
1484
+ .video-progress {
1485
+ -webkit-appearance: none;
1486
+ appearance: none;
1487
+ width: 100%;
1488
+ padding: 0 !important;
1489
+ height: 5px !important;
1490
+ border-radius: 10px;
1491
+ background: linear-gradient(
1492
+ to right,
1493
+ var(--primary) 0%,
1494
+ var(--primary) var(--progress-percent),
1495
+ rgba(255, 255, 255, 0.3) var(--progress-percent),
1496
+ rgba(255, 255, 255, 0.3) 100%
1497
+ );
1498
+ outline: none;
1499
+ cursor: pointer;
1500
+ transition: all 0.3s ease;
1501
+ position: relative;
1471
1502
  }
1472
1503
 
1504
+ .video-progress:hover {
1505
+ height: 8px;
1506
+ }
1473
1507
 
1474
- ._center-play-icon{
1475
- position: absolute;
1476
- top: 50%;
1477
- left: 50%;
1478
- transform: translate(-50%, -50%);
1479
- z-index: 2;
1508
+ .video-progress::-webkit-slider-thumb {
1509
+ -webkit-appearance: none;
1510
+ appearance: none;
1511
+ /* opacity: 0 !important; */
1512
+ width: 16px;
1513
+ height: 16px;
1514
+ border-radius: 50%;
1515
+ background: var(--primary);
1516
+ cursor: pointer;
1517
+ border: 2px solid white;
1518
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
1519
+ transition: all 0.2s ease;
1520
+ opacity: 0;
1480
1521
  }
1481
- .video_time{
1482
- background-color: var(--raiseThemes) !important;
1483
- backdrop-filter: var(--raiseBackdrop) !important;
1484
- border-radius:2rem;
1485
- padding: 1rem;
1486
- line-height: 0;
1487
- color: var(--text-color);
1522
+
1523
+ .video-progress:hover::-webkit-slider-thumb {
1524
+ opacity: 1;
1525
+ transform: scale(1.1);
1488
1526
  }
1489
-
1490
1527
 
1528
+ .video-progress::-moz-range-thumb {
1529
+ width: 16px;
1530
+ height: 16px;
1531
+ border-radius: 50%;
1532
+ background: var(--primary);
1533
+ cursor: pointer;
1534
+ border: 2px solid white;
1535
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
1536
+ transition: all 0.2s ease;
1537
+ opacity: 0;
1538
+ }
1491
1539
 
1540
+ .video-progress:hover::-moz-range-thumb {
1541
+ opacity: 1;
1542
+ transform: scale(1.1);
1543
+ }
1492
1544
 
1493
- ._play-button {
1494
- display: flex;
1495
- align-items: center;
1496
- justify-content: center;
1497
- width: 5rem;
1498
- height: 5rem;
1499
- border-radius: 50%;
1500
- background-color: var(--raiseOpaque);
1501
- backdrop-filter: var(--raiseBackdrop) !important;
1502
- transition: transform 0.3s ease;
1503
- cursor: pointer;
1504
- line-height: 0 !important;
1505
- z-index: 2;
1506
1545
 
1507
- }
1508
1546
 
1509
- ._play-button:hover {
1510
- background-color: var(--primary) !important;
1511
- color: var(--white) !important;
1512
- border-color: var(--primary400);
1513
- color: var(--text-color);
1514
- }
1515
1547
 
1548
+ /* Beautiful Volume Control */
1549
+ .volume-control-wrapper {
1550
+ display: flex;
1551
+ align-items: center;
1552
+ gap: 8px;
1553
+ position: relative;
1554
+ }
1516
1555
 
1556
+ .volume-slider-wrapper {
1557
+ width: 80px;
1558
+ padding: 8px 0;
1559
+ }
1517
1560
 
1518
- .styled-slider {
1561
+ .volume-slider {
1562
+ -webkit-appearance: none;
1519
1563
  appearance: none;
1520
1564
  width: 100%;
1521
- height: 10px;
1565
+ height: 15px !important;
1566
+ padding: 0 !important;
1567
+ border-radius: 10px;
1522
1568
  background: linear-gradient(
1523
1569
  to right,
1524
1570
  var(--primary) 0%,
1525
- var(--primary) calc(var(--progress, 0%) * 1%),
1526
- var(--primary50) calc(var(--progress, 0%) * 1%),
1527
- var(--primary50) 100%
1571
+ var(--primary) var(--volume-percent),
1572
+ rgba(255, 255, 255, 0.3) var(--volume-percent),
1573
+ rgba(255, 255, 255, 0.3) 100%
1528
1574
  );
1529
- border-radius: 3px;
1530
1575
  outline: none;
1531
- transition: background 0.3s ease;
1532
- position: relative;
1576
+ cursor: pointer;
1577
+ transition: all 0.3s ease;
1578
+ }
1579
+
1580
+ .volume-slider:hover {
1581
+ height: 6px;
1533
1582
  }
1534
1583
 
1535
- /* Thumb hidden by default */
1536
- .styled-slider::-webkit-slider-thumb {
1584
+ .volume-slider::-webkit-slider-thumb {
1585
+ -webkit-appearance: none;
1537
1586
  appearance: none;
1538
- height: 14px;
1539
1587
  width: 14px;
1588
+ opacity: 0 !important;
1589
+ height: 14px;
1540
1590
  border-radius: 50%;
1541
1591
  background: var(--primary);
1542
- border: none;
1543
1592
  cursor: pointer;
1544
- opacity: 0;
1545
- transition: opacity 0.3s ease;
1546
- margin-top: -4px;
1593
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
1594
+ transition: all 0.2s ease;
1547
1595
  }
1548
1596
 
1597
+ .volume-slider:hover::-webkit-slider-thumb {
1598
+ opacity: 1;
1599
+ transform: scale(1.1);
1600
+ }
1549
1601
 
1550
- .styled-slider::-moz-range-thumb {
1551
- height: 14px;
1602
+ .volume-slider::-moz-range-thumb {
1552
1603
  width: 14px;
1604
+ height: 14px;
1553
1605
  border-radius: 50%;
1554
1606
  background: var(--primary);
1555
- border: none;
1556
1607
  cursor: pointer;
1608
+ border: 2px solid white;
1609
+ transition: all 0.2s ease;
1557
1610
  opacity: 0;
1558
- transition: opacity 0.3s ease;
1559
1611
  }
1560
1612
 
1613
+ .volume-slider:hover::-moz-range-thumb {
1614
+ opacity: 1;
1615
+ transform: scale(1.1);
1616
+ }
1617
+
1618
+ /* Time display */
1619
+ .video_time {
1620
+ background-color: var(--raiseThemes);
1621
+ backdrop-filter: var(--raiseBackdrop);
1622
+ border-radius: 1rem;
1623
+ padding: 0.5rem 1rem;
1624
+ line-height: 1;
1625
+ font-size: 0.875rem;
1626
+ font-weight: 500;
1627
+ }
1628
+
1629
+ /* Control buttons hover effects */
1630
+ .video_container .circle {
1631
+ transition: all 0.2s ease;
1632
+ }
1633
+
1634
+ .video_container .circle:hover {
1635
+ background-color: var(--primary) !important;
1636
+ color: var(--white) !important;
1637
+ transform: scale(1.1);
1638
+ }
1639
+
1640
+ /* Responsive design */
1641
+ @media (max-width: 768px) {
1642
+ .video_controls {
1643
+ padding: 1rem 0.5rem 0.5rem;
1644
+ }
1645
+
1646
+ .video_time {
1647
+ padding: 0.25rem 0.75rem;
1648
+ font-size: 0.75rem;
1649
+ }
1650
+
1651
+ .controls-row {
1652
+ gap: 0.5rem !important;
1653
+ }
1654
+
1655
+ .volume-slider-wrapper {
1656
+ width: 60px;
1657
+ }
1658
+ }
1659
+
1660
+ /* Fullscreen adjustments */
1661
+ .video_container:fullscreen {
1662
+ width: 100vw;
1663
+ height: 100vh;
1664
+ border-radius: 0;
1665
+ }
1666
+
1667
+ .video_container:fullscreen .video_player {
1668
+ border-radius: 0;
1669
+ }
1670
+
1671
+ .video_container:fullscreen .video_controls {
1672
+ border-radius: 0;
1673
+ padding: 2rem 1.5rem 1rem;
1674
+ }
1675
+
1676
+
1561
1677
 
1562
1678
 
1563
1679
  /* Mobile layout when menu is open */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.7.8",
2
+ "version": "3.7.10",
3
3
  "name": "funuicss",
4
4
  "description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
5
5
  "main": "index.js",
@@ -7,11 +7,12 @@ interface Circle_Props extends HTMLProps<HTMLDivElement> {
7
7
  color?: string;
8
8
  children?: ReactNode;
9
9
  hoverable?: boolean;
10
+ className?: string;
10
11
  raised?: boolean;
11
12
  bordered?: boolean;
12
13
  key?: React.Key;
13
14
  style?: React.CSSProperties;
14
15
  onClick?: () => void;
15
16
  }
16
- export default function Circle({ size, funcss, bg, color, children, hoverable, raised, key, onClick, bordered, style, ...rest }: Circle_Props): React.JSX.Element;
17
+ export default function Circle({ size, funcss, bg, color, children, hoverable, raised, key, onClick, className, bordered, style, ...rest }: Circle_Props): React.JSX.Element;
17
18
  export {};
@@ -59,7 +59,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
59
59
  exports.default = Circle;
60
60
  var React = __importStar(require("react"));
61
61
  function Circle(_a) {
62
- var _b = _a.size, size = _b === void 0 ? 2 : _b, funcss = _a.funcss, bg = _a.bg, color = _a.color, children = _a.children, hoverable = _a.hoverable, raised = _a.raised, key = _a.key, onClick = _a.onClick, bordered = _a.bordered, style = _a.style, rest = __rest(_a, ["size", "funcss", "bg", "color", "children", "hoverable", "raised", "key", "onClick", "bordered", "style"]);
63
- return (React.createElement("div", __assign({ className: " animated fade-in ".concat(bordered ? "border" : "", " pointer avatar ").concat(funcss || '', " ").concat("text-" + (color === null || color === void 0 ? void 0 : color.trim()) || '', " ").concat(raised ? "raised" : '', " ").concat(bg || 'lighter', " ").concat(hoverable ? 'hoverable' : ''), style: __assign({ width: "".concat(size + "rem" || '2.3rem'), height: "".concat(size + "rem" || '2.3rem') }, style), key: key, onClick: onClick }, rest),
62
+ var _b = _a.size, size = _b === void 0 ? 2 : _b, funcss = _a.funcss, bg = _a.bg, color = _a.color, children = _a.children, hoverable = _a.hoverable, raised = _a.raised, key = _a.key, onClick = _a.onClick, _c = _a.className, className = _c === void 0 ? '' : _c, bordered = _a.bordered, style = _a.style, rest = __rest(_a, ["size", "funcss", "bg", "color", "children", "hoverable", "raised", "key", "onClick", "className", "bordered", "style"]);
63
+ return (React.createElement("div", __assign({ className: " ".concat(className, " animated fade-in ").concat(bordered ? "border" : "", " pointer avatar ").concat(funcss || '', " ").concat("text-" + (color === null || color === void 0 ? void 0 : color.trim()) || '', " ").concat(raised ? "raised" : '', " ").concat(bg || 'lighter', " ").concat(hoverable ? 'hoverable' : ''), style: __assign({ width: "".concat(size + "rem" || '2.3rem'), height: "".concat(size + "rem" || '2.3rem') }, style), key: key, onClick: onClick }, rest),
64
64
  React.createElement(React.Fragment, null, children)));
65
65
  }
@@ -30,7 +30,7 @@ interface ProjectData {
30
30
  }
31
31
  interface ThemeProviderProps {
32
32
  theme: ThemeName;
33
- projectId: string;
33
+ projectId?: string;
34
34
  funcss?: string;
35
35
  minHeight?: string;
36
36
  children: ReactNode;
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
- _a.trys.push([0, 5, , 6]);
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 1:
207
+ case 2:
202
208
  response = _a.sent();
203
- if (!response.ok) return [3 /*break*/, 3];
209
+ if (!response.ok) return [3 /*break*/, 4];
204
210
  return [4 /*yield*/, response.json()];
205
- case 2:
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 3:
210
- console.error('Firebase Storage fetch failed:', response.status, response.statusText);
211
- _a.label = 4;
212
- case 4: return [3 /*break*/, 6];
213
- case 5:
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*/, 6];
217
- case 6: return [2 /*return*/, null];
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
- /* ---------------------- CDN Theme Sync with Origin Validation ----------------------- */
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 syncTheme = function () { return __awaiter(void 0, void 0, void 0, function () {
326
- var hasAccess, localTheme, localVersion, cdnTheme, cdnVersion, err_1;
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, 4, 5, 6]);
331
- console.log('🔄 Starting theme sync with origin validation...');
332
- return [4 /*yield*/, validateOriginAccess(projectId)];
333
- case 1:
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 2:
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
- // Compare versions and use the newer one
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
- // Always use CDN theme if available
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('âš ī¸ Using local theme (CDN unavailable)');
369
- applyThemeData(localTheme, root);
370
- setCurrentVersion(localVersion);
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*/, 6];
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 syncing theme:', err_1);
382
- setError('Failed to sync theme');
383
- return [3 /*break*/, 6];
384
- case 5:
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 6: return [2 /*return*/];
415
+ case 10: return [2 /*return*/];
389
416
  }
390
417
  });
391
418
  }); };
392
- // Initial sync
393
- syncTheme();
394
- // Poll for updates every 5 minutes
395
- pollTimer = setInterval(function () {
396
- syncTheme();
397
- }, 5 * 60 * 1000);
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
- clearInterval(pollTimer);
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;