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 +193 -77
- package/package.json +1 -1
- package/ui/specials/Circle.d.ts +2 -1
- package/ui/specials/Circle.js +2 -2
- package/ui/theme/theme.d.ts +1 -1
- package/ui/theme/theme.js +98 -70
- package/ui/video/Video.d.ts +39 -2
- package/ui/video/Video.js +431 -144
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
|
-
|
|
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
|
-
|
|
1432
|
+
|
|
1433
|
+
.video_controls {
|
|
1431
1434
|
position: absolute;
|
|
1432
1435
|
bottom: 0;
|
|
1433
1436
|
left: 0;
|
|
1434
1437
|
width: 100%;
|
|
1435
|
-
|
|
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
|
-
.
|
|
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
|
-
|
|
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
|
-
|
|
1460
|
-
|
|
1473
|
+
/* Beautiful Progress Bar */
|
|
1474
|
+
.progress-container {
|
|
1475
|
+
width: 100%;
|
|
1476
|
+
padding: 0 0.5rem;
|
|
1461
1477
|
}
|
|
1462
1478
|
|
|
1463
|
-
.
|
|
1464
|
-
|
|
1479
|
+
.progress-wrapper {
|
|
1480
|
+
position: relative;
|
|
1481
|
+
width: 100%;
|
|
1465
1482
|
}
|
|
1466
1483
|
|
|
1467
|
-
.
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
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
|
-
.
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
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
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
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
|
-
.
|
|
1561
|
+
.volume-slider {
|
|
1562
|
+
-webkit-appearance: none;
|
|
1519
1563
|
appearance: none;
|
|
1520
1564
|
width: 100%;
|
|
1521
|
-
height:
|
|
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)
|
|
1526
|
-
|
|
1527
|
-
|
|
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
|
-
|
|
1532
|
-
|
|
1576
|
+
cursor: pointer;
|
|
1577
|
+
transition: all 0.3s ease;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
.volume-slider:hover {
|
|
1581
|
+
height: 6px;
|
|
1533
1582
|
}
|
|
1534
1583
|
|
|
1535
|
-
|
|
1536
|
-
|
|
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
|
-
|
|
1545
|
-
transition:
|
|
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
|
-
.
|
|
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.
|
|
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",
|
package/ui/specials/Circle.d.ts
CHANGED
|
@@ -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 {};
|
package/ui/specials/Circle.js
CHANGED
|
@@ -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
|
}
|
package/ui/theme/theme.d.ts
CHANGED
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;
|