@fluid-app/portal-sdk 0.1.198 → 0.1.200
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/dist/{CardWidget-HgYL7cEj.cjs → CardWidget-BVYjwdua.cjs} +2 -2
- package/dist/{CardWidget-BDIscQev.mjs → CardWidget-BjvrudYQ.mjs} +2 -2
- package/dist/{CardWidget-BDIscQev.mjs.map → CardWidget-BjvrudYQ.mjs.map} +1 -1
- package/dist/{CardWidget-DSq_Q8kv.cjs → CardWidget-DVi0NVhb.cjs} +2 -2
- package/dist/{CardWidget-DSq_Q8kv.cjs.map → CardWidget-DVi0NVhb.cjs.map} +1 -1
- package/dist/{ContactsScreen-Cheiwaxn.cjs → ContactsScreen-BOMxeTG8.cjs} +2 -2
- package/dist/{ContactsScreen-BtBNMZzG.mjs → ContactsScreen-Bm9SlMY3.mjs} +17 -7
- package/dist/ContactsScreen-Bm9SlMY3.mjs.map +1 -0
- package/dist/{ContactsScreen-DvohvoOE.cjs → ContactsScreen-DflUjayA.cjs} +291 -281
- package/dist/ContactsScreen-DflUjayA.cjs.map +1 -0
- package/dist/{ContainerWidget-PjWuvAlm.mjs → ContainerWidget-B51UF7DK.mjs} +2 -2
- package/dist/{ContainerWidget-PjWuvAlm.mjs.map → ContainerWidget-B51UF7DK.mjs.map} +1 -1
- package/dist/{ContainerWidget-Blb9A9i6.cjs → ContainerWidget-DNo8CkQ7.cjs} +2 -2
- package/dist/{ContainerWidget-Blb9A9i6.cjs.map → ContainerWidget-DNo8CkQ7.cjs.map} +1 -1
- package/dist/{ContainerWidget-CTP4UZXI.cjs → ContainerWidget-gtjlMITv.cjs} +3 -3
- package/dist/{FluidProvider-j5QX1XRm.cjs → FluidProvider-ByBDIQeW.cjs} +61 -999
- package/dist/FluidProvider-ByBDIQeW.cjs.map +1 -0
- package/dist/{FluidProvider-CGqVqcHP.mjs → FluidProvider-DFZiXiqm.mjs} +58 -827
- package/dist/FluidProvider-DFZiXiqm.mjs.map +1 -0
- package/dist/{LayoutWidget-oVmk8nm9.mjs → LayoutWidget-CtqIb8_Z.mjs} +2 -2
- package/dist/{LayoutWidget-oVmk8nm9.mjs.map → LayoutWidget-CtqIb8_Z.mjs.map} +1 -1
- package/dist/{LayoutWidget-D05U-Fai.cjs → LayoutWidget-D5gh0ejr.cjs} +2 -2
- package/dist/{LayoutWidget-BUxgiC_H.cjs → LayoutWidget-DHlXzqUk.cjs} +2 -2
- package/dist/{LayoutWidget-BUxgiC_H.cjs.map → LayoutWidget-DHlXzqUk.cjs.map} +1 -1
- package/dist/{MessagingScreen-CpUfQIFf.mjs → MessagingScreen-D6d83q2n.mjs} +2 -2
- package/dist/{MessagingScreen-CpUfQIFf.mjs.map → MessagingScreen-D6d83q2n.mjs.map} +1 -1
- package/dist/{MessagingScreen-Beyb0TUm.cjs → MessagingScreen-HT_HSiNW.cjs} +7 -7
- package/dist/{MessagingScreen-BaGLql5n.cjs → MessagingScreen-shEWzTmQ.cjs} +2 -2
- package/dist/{MessagingScreen-BaGLql5n.cjs.map → MessagingScreen-shEWzTmQ.cjs.map} +1 -1
- package/dist/{OrdersScreen-BgyMsZpn.mjs → OrdersScreen-BioiulGx.mjs} +2 -2
- package/dist/{OrdersScreen-BgyMsZpn.mjs.map → OrdersScreen-BioiulGx.mjs.map} +1 -1
- package/dist/{OrdersScreen-CCVPgVWa.cjs → OrdersScreen-DzCvZ6AW.cjs} +2 -2
- package/dist/{OrdersScreen-CCVPgVWa.cjs.map → OrdersScreen-DzCvZ6AW.cjs.map} +1 -1
- package/dist/{OrdersScreen-DWNylH_i.cjs → OrdersScreen-NIJGMwfQ.cjs} +1 -1
- package/dist/{PortalContentApiProvider-tSZDt_f2.mjs → PortalContentApiProvider-CNYq1_OD.mjs} +195 -91
- package/dist/PortalContentApiProvider-CNYq1_OD.mjs.map +1 -0
- package/dist/{PortalContentApiProvider-Bn44plrY.cjs → PortalContentApiProvider-ChmcXmbv.cjs} +194 -90
- package/dist/PortalContentApiProvider-ChmcXmbv.cjs.map +1 -0
- package/dist/{PortalProductsApiProvider-D0jul2Fh.mjs → PortalProductsApiProvider-B1IjNhl8.mjs} +22 -2
- package/dist/PortalProductsApiProvider-B1IjNhl8.mjs.map +1 -0
- package/dist/{PortalProductsApiProvider-CRN-i8Rh.cjs → PortalProductsApiProvider-o1axGadc.cjs} +22 -2
- package/dist/{PortalProductsApiProvider-CRN-i8Rh.cjs.map → PortalProductsApiProvider-o1axGadc.cjs.map} +1 -1
- package/dist/{ProductsScreen-o7LU64rN.mjs → ProductsScreen-CDjpHF49.mjs} +3 -3
- package/dist/{ProductsScreen-o7LU64rN.mjs.map → ProductsScreen-CDjpHF49.mjs.map} +1 -1
- package/dist/{ProductsScreen-uTXJCUPs.cjs → ProductsScreen-CzfDX0xx.cjs} +3 -3
- package/dist/{ProductsScreen-uTXJCUPs.cjs.map → ProductsScreen-CzfDX0xx.cjs.map} +1 -1
- package/dist/{ProductsScreen-nryGJv7S.mjs → ProductsScreen-D6-ehQjh.mjs} +3 -3
- package/dist/{ProductsScreen-Cvzwt-X-.cjs → ProductsScreen-fN3fh3PB.cjs} +3 -3
- package/dist/{ProfileScreen-CtMB7I96.cjs → ProfileScreen-B0EU-TLa.cjs} +101 -101
- package/dist/{ProfileScreen-CtMB7I96.cjs.map → ProfileScreen-B0EU-TLa.cjs.map} +1 -1
- package/dist/{ProfileScreen-th1mmEn0.mjs → ProfileScreen-BIs70k9W.mjs} +3 -3
- package/dist/{ProfileScreen-th1mmEn0.mjs.map → ProfileScreen-BIs70k9W.mjs.map} +1 -1
- package/dist/{ProfileScreen-BoFYel4G.cjs → ProfileScreen-Dqu2nK_2.cjs} +7 -7
- package/dist/{ScreenRenderer-CgSF9HEd.mjs → ScreenRenderer-Cv2rxvtF.mjs} +1 -9
- package/dist/ScreenRenderer-Cv2rxvtF.mjs.map +1 -0
- package/dist/{ScreenRenderer-Cx2KWPVu.cjs → ScreenRenderer-DfeRRgBO.cjs} +1 -9
- package/dist/ScreenRenderer-DfeRRgBO.cjs.map +1 -0
- package/dist/{ShareablesScreen-DPAjypds.mjs → ShareablesScreen-B8rPq-_7.mjs} +3 -3
- package/dist/{ShareablesScreen-DPAjypds.mjs.map → ShareablesScreen-B8rPq-_7.mjs.map} +1 -1
- package/dist/{ShareablesScreen-iUMt1ep3.cjs → ShareablesScreen-DFLAJxjs.cjs} +3 -3
- package/dist/{ShareablesScreen-Dw818mdV.cjs → ShareablesScreen-DLXK1PAg.cjs} +3 -3
- package/dist/{ShareablesScreen-Dw818mdV.cjs.map → ShareablesScreen-DLXK1PAg.cjs.map} +1 -1
- package/dist/{ShareablesScreen-DrMFfqJl.mjs → ShareablesScreen-Dc57L9m8.mjs} +3 -3
- package/dist/{ShopScreen-BBFsy04y.mjs → ShopScreen-2yMsyFwk.mjs} +3 -3
- package/dist/{ShopScreen-BBFsy04y.mjs.map → ShopScreen-2yMsyFwk.mjs.map} +1 -1
- package/dist/{ShopScreen-BCZ_tsd3.cjs → ShopScreen-BmHSLZ7H.cjs} +3 -3
- package/dist/{ShopScreen-BCZ_tsd3.cjs.map → ShopScreen-BmHSLZ7H.cjs.map} +1 -1
- package/dist/{ShopScreen-tjFoj6_r.cjs → ShopScreen-kk4yLzrW.cjs} +8 -8
- package/dist/{SubscriptionsScreen-BwRoXYF8.mjs → SubscriptionsScreen-1G9oa46y.mjs} +2 -2
- package/dist/{SubscriptionsScreen-BwRoXYF8.mjs.map → SubscriptionsScreen-1G9oa46y.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-mhTl7OIp.cjs → SubscriptionsScreen-Bt_YtoA3.cjs} +1 -1
- package/dist/{SubscriptionsScreen-DbcnEDD0.cjs → SubscriptionsScreen-Dn6LldL3.cjs} +2 -2
- package/dist/{SubscriptionsScreen-DbcnEDD0.cjs.map → SubscriptionsScreen-Dn6LldL3.cjs.map} +1 -1
- package/dist/index.cjs +78 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +132 -128
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +132 -128
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +32 -32
- package/dist/{portal_tenant-CWKHVgID.mjs → portal_tenant-8RPVJCll.mjs} +42 -2
- package/dist/{portal_tenant-CWKHVgID.mjs.map → portal_tenant-8RPVJCll.mjs.map} +1 -1
- package/dist/{portal_tenant-pozf8Ht6.cjs → portal_tenant-BdKp073-.cjs} +65 -1
- package/dist/{portal_tenant-pozf8Ht6.cjs.map → portal_tenant-BdKp073-.cjs.map} +1 -1
- package/dist/{portal_tenant_content-Dwmo8XZ-.cjs → portal_tenant_content-0zpnjBot.cjs} +97 -1
- package/dist/{portal_tenant_content-Dwmo8XZ-.cjs.map → portal_tenant_content-0zpnjBot.cjs.map} +1 -1
- package/dist/{portal_tenant_content-DgM42X08.mjs → portal_tenant_content-DzIQtSLE.mjs} +62 -2
- package/dist/{portal_tenant_content-DgM42X08.mjs.map → portal_tenant_content-DzIQtSLE.mjs.map} +1 -1
- package/dist/src-BRTXunU1.mjs +851 -0
- package/dist/src-BRTXunU1.mjs.map +1 -0
- package/dist/src-DvVPCD01.cjs +1038 -0
- package/dist/src-DvVPCD01.cjs.map +1 -0
- package/package.json +19 -19
- package/dist/ContactsScreen-BtBNMZzG.mjs.map +0 -1
- package/dist/ContactsScreen-DvohvoOE.cjs.map +0 -1
- package/dist/FluidProvider-CGqVqcHP.mjs.map +0 -1
- package/dist/FluidProvider-j5QX1XRm.cjs.map +0 -1
- package/dist/PortalContentApiProvider-Bn44plrY.cjs.map +0 -1
- package/dist/PortalContentApiProvider-tSZDt_f2.mjs.map +0 -1
- package/dist/PortalProductsApiProvider-D0jul2Fh.mjs.map +0 -1
- package/dist/ScreenRenderer-CgSF9HEd.mjs.map +0 -1
- package/dist/ScreenRenderer-Cx2KWPVu.cjs.map +0 -1
- package/dist/countries-api-context-Dob_AzPO.mjs +0 -13
- package/dist/countries-api-context-Dob_AzPO.mjs.map +0 -1
- package/dist/countries-api-context-G-NW4BoH.cjs +0 -25
- package/dist/countries-api-context-G-NW4BoH.cjs.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
const require_ScreenRenderer = require("./ScreenRenderer-
|
|
1
|
+
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
+
const require_ScreenRenderer = require("./ScreenRenderer-DfeRRgBO.cjs");
|
|
3
3
|
const require_account_api_context = require("./account-api-context-DZP9IiGg.cjs");
|
|
4
4
|
const require_store_api_context = require("./store-api-context-D1gZn22Z.cjs");
|
|
5
5
|
const require_mysite_api_context = require("./mysite-api-context-CilZcDS4.cjs");
|
|
6
|
-
const
|
|
7
|
-
const require_portal_tenant = require("./portal_tenant-
|
|
8
|
-
const require_portal_tenant_content = require("./portal_tenant_content-
|
|
6
|
+
const require_src = require("./src-DvVPCD01.cjs");
|
|
7
|
+
const require_portal_tenant = require("./portal_tenant-BdKp073-.cjs");
|
|
8
|
+
const require_portal_tenant_content = require("./portal_tenant_content-0zpnjBot.cjs");
|
|
9
9
|
const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-CVv-4rQ9.cjs");
|
|
10
10
|
const require_registry_context = require("./registry-context-RWj2xJlC.cjs");
|
|
11
11
|
const require_EmbedWidget = require("./EmbedWidget-CLArhSmx.cjs");
|
|
12
12
|
const require_error_state = require("./error-state-C-AalLnz.cjs");
|
|
13
|
-
const require_LayoutWidget = require("./LayoutWidget-
|
|
13
|
+
const require_LayoutWidget = require("./LayoutWidget-DHlXzqUk.cjs");
|
|
14
14
|
const require_TextWidget = require("./TextWidget--UgOcUQx.cjs");
|
|
15
15
|
const require_AlertWidget = require("./AlertWidget-Nx31UmWK.cjs");
|
|
16
16
|
const require_BulletListWidget = require("./BulletListWidget-CouwHMJt.cjs");
|
|
17
17
|
const require_CalendarWidget = require("./CalendarWidget-BtKzQFeO.cjs");
|
|
18
|
-
const require_CardWidget = require("./CardWidget-
|
|
18
|
+
const require_CardWidget = require("./CardWidget-DVi0NVhb.cjs");
|
|
19
19
|
const require_CarouselWidget = require("./CarouselWidget-DLqTBIrf.cjs");
|
|
20
20
|
const require_CatchUpWidget = require("./CatchUpWidget-BmibiEkX.cjs");
|
|
21
21
|
const require_ChartWidget = require("./ChartWidget-B0vgP7df.cjs");
|
|
22
|
-
const require_ContainerWidget = require("./ContainerWidget-
|
|
22
|
+
const require_ContainerWidget = require("./ContainerWidget-DNo8CkQ7.cjs");
|
|
23
23
|
const require_ImageWidget = require("./ImageWidget-B7ui4-KU.cjs");
|
|
24
24
|
const require_LinkWidget = require("./LinkWidget-BfvepYU9.cjs");
|
|
25
25
|
const require_ListWidget = require("./ListWidget-Da-YzDAs.cjs");
|
|
@@ -36,8 +36,6 @@ const require_VideoWidget = require("./VideoWidget-sEVQcp9o.cjs");
|
|
|
36
36
|
let react = require("react");
|
|
37
37
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
38
38
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
-
let colorjs_io = require("colorjs.io");
|
|
40
|
-
colorjs_io = require_chunk.__toESM(colorjs_io);
|
|
41
39
|
//#region ../../../node_modules/.pnpm/@tanstack+query-core@5.90.12/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
42
40
|
var defaultTimeoutProvider = {
|
|
43
41
|
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
@@ -712,6 +710,40 @@ function throwIfAborted(signal) {
|
|
|
712
710
|
function bffNotSupported(op) {
|
|
713
711
|
throw new Error(`[portal-tenant-adapter] "${op}" is not available on the portal-tenant BFF. Wire the legacy adapter for this feature, or re-add the endpoint to the BFF spec.`);
|
|
714
712
|
}
|
|
713
|
+
function isProduction() {
|
|
714
|
+
return globalThis.process?.env?.NODE_ENV === "production";
|
|
715
|
+
}
|
|
716
|
+
function narrowPeriod(value) {
|
|
717
|
+
if (value === "7d" || value === "30d" || value === "90d" || value === "1y" || value === "all") return value;
|
|
718
|
+
if (value !== void 0 && !isProduction()) console.warn(`[portal-sdk] narrowPeriod: unknown value "${value}" dropped`);
|
|
719
|
+
}
|
|
720
|
+
async function fetchShareVisited(shareableType, client, contentClient, query) {
|
|
721
|
+
switch (shareableType) {
|
|
722
|
+
case "products": return (await require_portal_tenant.product_metrics_share_visits(client, query)).resources ?? [];
|
|
723
|
+
case "media": return (await require_portal_tenant_content.content_media_metrics_share_visits(contentClient, query)).resources ?? [];
|
|
724
|
+
case "libraries": return (await require_portal_tenant_content.content_playlists_metrics_share_visits(contentClient, query)).resources ?? [];
|
|
725
|
+
case "pages": return (await require_portal_tenant_content.content_pages_metrics_share_visits(contentClient, query)).resources ?? [];
|
|
726
|
+
case "enrollment_packs": return (await require_portal_tenant.enrollment_pack_metrics_share_visits(client, query)).resources ?? [];
|
|
727
|
+
case "promotions": bffNotSupported(`fetchMostShared(${shareableType})`);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
async function fetchVisited(shareableType, client, contentClient, query) {
|
|
731
|
+
switch (shareableType) {
|
|
732
|
+
case "products": return (await require_portal_tenant.product_metrics_visits(client, query)).resources ?? [];
|
|
733
|
+
case "media": return (await require_portal_tenant_content.content_media_metrics_visits(contentClient, query)).resources ?? [];
|
|
734
|
+
case "libraries": return (await require_portal_tenant_content.content_playlists_metrics_visits(contentClient, query)).resources ?? [];
|
|
735
|
+
case "pages": return (await require_portal_tenant_content.content_pages_metrics_visits(contentClient, query)).resources ?? [];
|
|
736
|
+
case "enrollment_packs": return (await require_portal_tenant.enrollment_pack_metrics_visits(client, query)).resources ?? [];
|
|
737
|
+
case "promotions": bffNotSupported(`fetchMostViewed(${shareableType})`);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
function toMetricsQuery(options) {
|
|
741
|
+
const query = {};
|
|
742
|
+
const period = narrowPeriod(options.period);
|
|
743
|
+
if (period) query.period = period;
|
|
744
|
+
if (options.limit != null) query.limit = options.limit;
|
|
745
|
+
return query;
|
|
746
|
+
}
|
|
715
747
|
/**
|
|
716
748
|
* Map a BFF order response to the port's NormalizedOrder shape.
|
|
717
749
|
* Centralizes the boundary between BFF wire format and our canonical type
|
|
@@ -764,11 +796,19 @@ function toNormalizedSubscription(raw) {
|
|
|
764
796
|
*/
|
|
765
797
|
function createDataSourceApiAdapter(client, contentClient) {
|
|
766
798
|
return {
|
|
767
|
-
async fetchMostShared(_repId,
|
|
768
|
-
|
|
799
|
+
async fetchMostShared(_repId, options) {
|
|
800
|
+
throwIfAborted(options.signal);
|
|
801
|
+
const query = toMetricsQuery(options);
|
|
802
|
+
const result = await fetchShareVisited(options.shareableType, client, contentClient, query);
|
|
803
|
+
throwIfAborted(options.signal);
|
|
804
|
+
return result;
|
|
769
805
|
},
|
|
770
|
-
async fetchMostViewed(_repId,
|
|
771
|
-
|
|
806
|
+
async fetchMostViewed(_repId, options) {
|
|
807
|
+
throwIfAborted(options.signal);
|
|
808
|
+
const query = toMetricsQuery(options);
|
|
809
|
+
const result = await fetchVisited(options.shareableType, client, contentClient, query);
|
|
810
|
+
throwIfAborted(options.signal);
|
|
811
|
+
return result;
|
|
772
812
|
},
|
|
773
813
|
async fetchOrders(_customerId, options) {
|
|
774
814
|
throwIfAborted(options?.signal);
|
|
@@ -1545,816 +1585,6 @@ function createMySiteApiAdapter(client) {
|
|
|
1545
1585
|
};
|
|
1546
1586
|
}
|
|
1547
1587
|
//#endregion
|
|
1548
|
-
//#region ../core/src/theme/types.ts
|
|
1549
|
-
const SEMANTIC_COLOR_NAMES = [
|
|
1550
|
-
"background",
|
|
1551
|
-
"foreground",
|
|
1552
|
-
"primary",
|
|
1553
|
-
"secondary",
|
|
1554
|
-
"accent",
|
|
1555
|
-
"muted",
|
|
1556
|
-
"destructive"
|
|
1557
|
-
];
|
|
1558
|
-
const SHADE_STEPS = [
|
|
1559
|
-
100,
|
|
1560
|
-
200,
|
|
1561
|
-
300,
|
|
1562
|
-
400,
|
|
1563
|
-
500,
|
|
1564
|
-
600,
|
|
1565
|
-
700,
|
|
1566
|
-
800,
|
|
1567
|
-
900
|
|
1568
|
-
];
|
|
1569
|
-
const FONT_SIZE_KEYS = [
|
|
1570
|
-
"extraSmall",
|
|
1571
|
-
"small",
|
|
1572
|
-
"regular",
|
|
1573
|
-
"large",
|
|
1574
|
-
"extraLarge",
|
|
1575
|
-
"giant"
|
|
1576
|
-
];
|
|
1577
|
-
const FONT_FAMILY_KEYS = ["header", "body"];
|
|
1578
|
-
const RADIUS_KEYS = [
|
|
1579
|
-
"small",
|
|
1580
|
-
"medium",
|
|
1581
|
-
"large",
|
|
1582
|
-
"extraLarge"
|
|
1583
|
-
];
|
|
1584
|
-
//#endregion
|
|
1585
|
-
//#region ../core/src/theme/color-engine.ts
|
|
1586
|
-
/**
|
|
1587
|
-
* Attempt to convert any string into a Color using colorjs.io.
|
|
1588
|
-
* If the string is exactly 6 characters it is assumed to be a bare hex value
|
|
1589
|
-
* (e.g. "3b82f6") and a "#" prefix is added before parsing.
|
|
1590
|
-
*
|
|
1591
|
-
* @returns the parsed Color, or a neutral gray (`oklch(0.5 0 0)`) on failure
|
|
1592
|
-
*/
|
|
1593
|
-
function parseColor(value) {
|
|
1594
|
-
if (value.length === 6) value = `#${value}`;
|
|
1595
|
-
try {
|
|
1596
|
-
return new colorjs_io.default(value);
|
|
1597
|
-
} catch (error) {
|
|
1598
|
-
console.warn("[theme] Failed to parse color:", value, error);
|
|
1599
|
-
return new colorjs_io.default("oklch", [
|
|
1600
|
-
.5,
|
|
1601
|
-
0,
|
|
1602
|
-
0
|
|
1603
|
-
]);
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
/**
|
|
1607
|
-
* Returns either the original foreground or a corrected lightness variant,
|
|
1608
|
-
* whichever provides better contrast against `color`.
|
|
1609
|
-
* Inversion triggers when the APCA contrast is below 50.
|
|
1610
|
-
*/
|
|
1611
|
-
function getForegroundColor(foreground, color) {
|
|
1612
|
-
if (foreground.oklch.l == null || color.oklch.l == null) return foreground;
|
|
1613
|
-
if (color.contrastAPCA(foreground) < 50) return new colorjs_io.default("oklch", [
|
|
1614
|
-
color.oklch.l < .7 ? .95 : .15,
|
|
1615
|
-
foreground.oklch.c || 0,
|
|
1616
|
-
foreground.oklch.h || 0
|
|
1617
|
-
]);
|
|
1618
|
-
return foreground;
|
|
1619
|
-
}
|
|
1620
|
-
/**
|
|
1621
|
-
* Generate a 100–900 shade ramp from a base color.
|
|
1622
|
-
* Base anchors at 500. Light shades (100–400) step toward white,
|
|
1623
|
-
* dark shades (600–900) step toward black. Dark steps use an asymmetric
|
|
1624
|
-
* multiplier (1.6×, 1.875×, 3×, 4× of `darkStep`) for a more gradual
|
|
1625
|
-
* initial descent. Chroma is nudged per step for perceptually natural ramps.
|
|
1626
|
-
*/
|
|
1627
|
-
function generateShades(base) {
|
|
1628
|
-
const l = base.oklch.l ?? 0;
|
|
1629
|
-
const c = base.oklch.c ?? 0;
|
|
1630
|
-
const h = base.oklch.h ?? 0;
|
|
1631
|
-
const safeMax = l >= .885 ? .995 : .97;
|
|
1632
|
-
const safeMin = l <= .33 ? 0 : .21;
|
|
1633
|
-
const lightStep = (safeMax - l) / 5;
|
|
1634
|
-
const darkStep = -(l - safeMin) / 8;
|
|
1635
|
-
const shade = (lDelta, cDelta) => {
|
|
1636
|
-
return new colorjs_io.default("oklch", [
|
|
1637
|
-
Math.max(0, Math.min(1, l + lDelta)),
|
|
1638
|
-
c <= .001 ? c : Math.max(0, c + cDelta),
|
|
1639
|
-
h
|
|
1640
|
-
]);
|
|
1641
|
-
};
|
|
1642
|
-
return {
|
|
1643
|
-
100: shade(5 * lightStep, -.00375),
|
|
1644
|
-
200: shade(4 * lightStep, -.00375),
|
|
1645
|
-
300: shade(3 * lightStep, -.00375),
|
|
1646
|
-
400: shade(2 * lightStep, -.00375),
|
|
1647
|
-
500: new colorjs_io.default("oklch", [
|
|
1648
|
-
l,
|
|
1649
|
-
c,
|
|
1650
|
-
h
|
|
1651
|
-
]),
|
|
1652
|
-
600: shade(1.6 * darkStep, .025),
|
|
1653
|
-
700: shade(1.875 * 2 * darkStep, .05),
|
|
1654
|
-
800: shade(6 * darkStep, .075),
|
|
1655
|
-
900: shade(8 * darkStep, .1)
|
|
1656
|
-
};
|
|
1657
|
-
}
|
|
1658
|
-
const DARK_DERIVATION_CONFIG = {
|
|
1659
|
-
background: {
|
|
1660
|
-
baseLightness: .15,
|
|
1661
|
-
fgLightness: .93
|
|
1662
|
-
},
|
|
1663
|
-
foreground: {
|
|
1664
|
-
baseLightness: .93,
|
|
1665
|
-
fgLightness: .15
|
|
1666
|
-
},
|
|
1667
|
-
muted: {
|
|
1668
|
-
baseLightness: .22,
|
|
1669
|
-
fgLightness: .75
|
|
1670
|
-
},
|
|
1671
|
-
primary: {
|
|
1672
|
-
baseLightness: "invert",
|
|
1673
|
-
fgLightness: .95,
|
|
1674
|
-
chromaScale: .9
|
|
1675
|
-
},
|
|
1676
|
-
secondary: {
|
|
1677
|
-
baseLightness: "invert",
|
|
1678
|
-
fgLightness: .93,
|
|
1679
|
-
chromaScale: .85
|
|
1680
|
-
},
|
|
1681
|
-
accent: {
|
|
1682
|
-
baseLightness: "invert",
|
|
1683
|
-
fgLightness: .95,
|
|
1684
|
-
chromaScale: .9
|
|
1685
|
-
},
|
|
1686
|
-
destructive: {
|
|
1687
|
-
baseLightness: "invert",
|
|
1688
|
-
fgLightness: .95,
|
|
1689
|
-
chromaScale: .95
|
|
1690
|
-
}
|
|
1691
|
-
};
|
|
1692
|
-
/** Invert OKLCH lightness (1 - l), clamped to [0.35, 0.75] to avoid extremes. */
|
|
1693
|
-
function invertLightness(l) {
|
|
1694
|
-
const inverted = 1 - l;
|
|
1695
|
-
return Math.max(.35, Math.min(.75, inverted));
|
|
1696
|
-
}
|
|
1697
|
-
/**
|
|
1698
|
-
* Derive a dark-mode ThemeColorInput from its light-mode counterpart.
|
|
1699
|
-
*/
|
|
1700
|
-
function deriveDarkVariant(name, light) {
|
|
1701
|
-
const config = DARK_DERIVATION_CONFIG[name];
|
|
1702
|
-
const chromaScale = config.chromaScale ?? 1;
|
|
1703
|
-
const baseLightness = config.baseLightness === "invert" ? invertLightness(light.base.oklch.l ?? 0) : config.baseLightness;
|
|
1704
|
-
const fgLightness = config.fgLightness === "invert" ? invertLightness(light.foreground.oklch.l ?? 0) : config.fgLightness;
|
|
1705
|
-
return {
|
|
1706
|
-
base: new colorjs_io.default("oklch", [
|
|
1707
|
-
baseLightness,
|
|
1708
|
-
(light.base.oklch.c || 0) * chromaScale,
|
|
1709
|
-
light.base.oklch.h || 0
|
|
1710
|
-
]),
|
|
1711
|
-
foreground: new colorjs_io.default("oklch", [
|
|
1712
|
-
fgLightness,
|
|
1713
|
-
(light.foreground.oklch.c || 0) * chromaScale,
|
|
1714
|
-
light.foreground.oklch.h || 0
|
|
1715
|
-
])
|
|
1716
|
-
};
|
|
1717
|
-
}
|
|
1718
|
-
/**
|
|
1719
|
-
* Merge auto-derived dark colors with any user-specified overrides.
|
|
1720
|
-
* For each semantic color, if the user has fully overridden both base and
|
|
1721
|
-
* foreground those are used; otherwise the missing channels are derived.
|
|
1722
|
-
*/
|
|
1723
|
-
function mergeDarkOverrides(def) {
|
|
1724
|
-
const darkColors = {};
|
|
1725
|
-
for (const name of SEMANTIC_COLOR_NAMES) {
|
|
1726
|
-
const lightInput = def.light[name];
|
|
1727
|
-
const darkOverride = def.dark[name];
|
|
1728
|
-
if (darkOverride?.base && darkOverride?.foreground) darkColors[name] = darkOverride;
|
|
1729
|
-
else if (darkOverride) {
|
|
1730
|
-
const base = darkOverride.base ?? deriveDarkVariant(name, lightInput).base;
|
|
1731
|
-
darkColors[name] = {
|
|
1732
|
-
base,
|
|
1733
|
-
foreground: darkOverride.foreground ?? getForegroundColor(def.light.foreground.base, base)
|
|
1734
|
-
};
|
|
1735
|
-
} else darkColors[name] = deriveDarkVariant(name, lightInput);
|
|
1736
|
-
}
|
|
1737
|
-
return darkColors;
|
|
1738
|
-
}
|
|
1739
|
-
function resolveColorSet(colors) {
|
|
1740
|
-
const resolved = {};
|
|
1741
|
-
for (const name of SEMANTIC_COLOR_NAMES) {
|
|
1742
|
-
const input = colors[name];
|
|
1743
|
-
const shades = generateShades(input.base);
|
|
1744
|
-
const resolvedShades = {};
|
|
1745
|
-
for (const step of SHADE_STEPS) resolvedShades[step] = shades[step];
|
|
1746
|
-
resolved[name] = {
|
|
1747
|
-
base: input.base.clone(),
|
|
1748
|
-
foreground: input.foreground.clone(),
|
|
1749
|
-
shades: resolvedShades
|
|
1750
|
-
};
|
|
1751
|
-
}
|
|
1752
|
-
return resolved;
|
|
1753
|
-
}
|
|
1754
|
-
/**
|
|
1755
|
-
* Resolve a ThemeDefinition into a complete ResolvedTheme.
|
|
1756
|
-
* Dark mode colors are derived from light where not overridden.
|
|
1757
|
-
*/
|
|
1758
|
-
function resolveTheme(def) {
|
|
1759
|
-
return {
|
|
1760
|
-
id: def.id,
|
|
1761
|
-
name: def.name,
|
|
1762
|
-
light: resolveColorSet(def.light),
|
|
1763
|
-
dark: resolveColorSet(mergeDarkOverrides(def)),
|
|
1764
|
-
fontSizes: { ...def.fontSizes },
|
|
1765
|
-
fontFamilies: { ...def.fontFamilies },
|
|
1766
|
-
spacing: def.spacing,
|
|
1767
|
-
radii: { ...def.radii }
|
|
1768
|
-
};
|
|
1769
|
-
}
|
|
1770
|
-
//#endregion
|
|
1771
|
-
//#region ../core/src/theme/tailwind-overrides.ts
|
|
1772
|
-
/**
|
|
1773
|
-
* Specific overrides, otherwise all the overrides are generated using emitTailwindOverrides
|
|
1774
|
-
*/
|
|
1775
|
-
const OVERRIDES = {
|
|
1776
|
-
"--color-gray-50": "var(--color-muted)",
|
|
1777
|
-
"--color-gray-100": "var(--color-muted-600)",
|
|
1778
|
-
"--color-gray-200": "var(--color-border)"
|
|
1779
|
-
};
|
|
1780
|
-
/**
|
|
1781
|
-
* Returns the inverted shade for dark mode foreground colors.
|
|
1782
|
-
* In dark mode, light shades (50, 100) should map to dark values (950, 900) and vice versa.
|
|
1783
|
-
*/
|
|
1784
|
-
function getInvertedStep(shade) {
|
|
1785
|
-
const shadeIndex = SHADE_STEPS.indexOf(shade);
|
|
1786
|
-
return SHADE_STEPS[SHADE_STEPS.length - 1 - shadeIndex] || 500;
|
|
1787
|
-
}
|
|
1788
|
-
/**
|
|
1789
|
-
* Map semantic colors to Tailwind built-in color names.
|
|
1790
|
-
*/
|
|
1791
|
-
function emitTailwindOverrides(darkMode = false) {
|
|
1792
|
-
const TAILWIND_COLOR_MAP = {
|
|
1793
|
-
gray: "foreground",
|
|
1794
|
-
red: "destructive",
|
|
1795
|
-
blue: "primary",
|
|
1796
|
-
green: "accent"
|
|
1797
|
-
};
|
|
1798
|
-
const TAILWIND_SHADES = [
|
|
1799
|
-
50,
|
|
1800
|
-
100,
|
|
1801
|
-
200,
|
|
1802
|
-
300,
|
|
1803
|
-
400,
|
|
1804
|
-
500,
|
|
1805
|
-
600,
|
|
1806
|
-
700,
|
|
1807
|
-
800,
|
|
1808
|
-
900,
|
|
1809
|
-
950
|
|
1810
|
-
];
|
|
1811
|
-
const SHADE_REMAP = {
|
|
1812
|
-
50: 100,
|
|
1813
|
-
950: 900
|
|
1814
|
-
};
|
|
1815
|
-
const lines = [];
|
|
1816
|
-
for (const [twName, semantic] of Object.entries(TAILWIND_COLOR_MAP)) for (const shade of TAILWIND_SHADES) {
|
|
1817
|
-
const step = SHADE_REMAP[shade] ?? shade;
|
|
1818
|
-
const override = OVERRIDES[`--color-${twName}-${shade}`];
|
|
1819
|
-
lines.push(`--color-${twName}-${shade}: ${override ? override : `var(--color-${semantic}-${semantic === "foreground" && darkMode === true ? getInvertedStep(step) : step})`};`);
|
|
1820
|
-
}
|
|
1821
|
-
lines.push("--color-white: var(--color-background);");
|
|
1822
|
-
lines.push("--color-black: var(--color-foreground);");
|
|
1823
|
-
return lines;
|
|
1824
|
-
}
|
|
1825
|
-
//#endregion
|
|
1826
|
-
//#region ../core/src/theme/css-generator.ts
|
|
1827
|
-
function colorToCSS(color) {
|
|
1828
|
-
const result = color.toString({ format: "oklch" });
|
|
1829
|
-
if (result.includes("NaN")) {
|
|
1830
|
-
console.warn("[theme] colorToCSS produced NaN, using neutral fallback:", result);
|
|
1831
|
-
return "oklch(0.5 0 0)";
|
|
1832
|
-
}
|
|
1833
|
-
return result;
|
|
1834
|
-
}
|
|
1835
|
-
function camelToKebab(str) {
|
|
1836
|
-
return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1837
|
-
}
|
|
1838
|
-
/**
|
|
1839
|
-
* Emit --color-{name}, --color-{name}-foreground, --color-{name}-{shade} vars.
|
|
1840
|
-
* Uses --color- prefix to match portal-widgets/tailwind.config.ts.
|
|
1841
|
-
*/
|
|
1842
|
-
function emitColorVars(colors) {
|
|
1843
|
-
const lines = [];
|
|
1844
|
-
for (const name of SEMANTIC_COLOR_NAMES) {
|
|
1845
|
-
const color = colors[name];
|
|
1846
|
-
lines.push(`--color-${name}: ${colorToCSS(color.base)};`);
|
|
1847
|
-
lines.push(`--color-${name}-foreground: ${colorToCSS(color.foreground)};`);
|
|
1848
|
-
for (const step of SHADE_STEPS) lines.push(`--color-${name}-${step}: ${colorToCSS(color.shades[step])};`);
|
|
1849
|
-
}
|
|
1850
|
-
return lines;
|
|
1851
|
-
}
|
|
1852
|
-
/**
|
|
1853
|
-
* Format a font family value for CSS output.
|
|
1854
|
-
* - If the value starts with "var(" (legacy), pass through as-is
|
|
1855
|
-
* - If the value already contains a comma (has fallback), pass through as-is
|
|
1856
|
-
* - Otherwise, wrap in quotes and append a generic sans-serif fallback
|
|
1857
|
-
*/
|
|
1858
|
-
function formatFontFamily(value) {
|
|
1859
|
-
if (value.startsWith("var(")) return value;
|
|
1860
|
-
if (value.includes(",")) return value;
|
|
1861
|
-
return `'${value}', sans-serif`;
|
|
1862
|
-
}
|
|
1863
|
-
/**
|
|
1864
|
-
* Emit non-color CSS variables (font sizes, families, spacing, radii).
|
|
1865
|
-
*/
|
|
1866
|
-
function emitNonColorVars(theme) {
|
|
1867
|
-
const lines = [];
|
|
1868
|
-
for (const key of FONT_SIZE_KEYS) lines.push(`--font-size-${camelToKebab(key)}: ${theme.fontSizes[key]};`);
|
|
1869
|
-
for (const key of FONT_FAMILY_KEYS) lines.push(`--font-${key}: ${formatFontFamily(theme.fontFamilies[key])};`);
|
|
1870
|
-
lines.push(`--spacing: ${theme.spacing};`);
|
|
1871
|
-
for (const key of RADIUS_KEYS) lines.push(`--radius-${camelToKebab(key)}: ${theme.radii[key]};`);
|
|
1872
|
-
return lines;
|
|
1873
|
-
}
|
|
1874
|
-
/**
|
|
1875
|
-
* Static CSS alias variables that bridge theme var names to Tailwind/component conventions.
|
|
1876
|
-
* These are always emitted and not mode-dependent.
|
|
1877
|
-
*/
|
|
1878
|
-
const globalCSSOverride = [
|
|
1879
|
-
"--color-background-foreground: var(--color-foreground);",
|
|
1880
|
-
"--color-foreground-foreground: var(--color-background);",
|
|
1881
|
-
"--color-contrast: var(--color-foreground);",
|
|
1882
|
-
...SEMANTIC_COLOR_NAMES.map((value) => `--${value}: var(--color-${value});`),
|
|
1883
|
-
...SEMANTIC_COLOR_NAMES.map((value) => `--${value}-foreground: var(--color-${value}-foreground);`),
|
|
1884
|
-
"--sidebar-ring: var(--color-primary);",
|
|
1885
|
-
"--sidebar-border: var(--color-border);",
|
|
1886
|
-
"--sidebar-accent-foreground: var(--color-accent-foreground);",
|
|
1887
|
-
"--sidebar-accent: var(--color-accent);",
|
|
1888
|
-
"--sidebar-primary-foreground: var(--color-primary-foreground);",
|
|
1889
|
-
"--sidebar-primary: var(--color-primary);",
|
|
1890
|
-
"--sidebar-foreground: var(--color-muted-foreground);",
|
|
1891
|
-
"--sidebar: var(--color-muted);",
|
|
1892
|
-
"--border: var(--color-background-600);",
|
|
1893
|
-
"--ring: var(--color-primary);",
|
|
1894
|
-
"--popover: var(--color-background);",
|
|
1895
|
-
"--popover-foreground: var(--color-foreground);",
|
|
1896
|
-
"--card: var(--color-muted);",
|
|
1897
|
-
"--card-foreground: var(--color-muted-foreground);",
|
|
1898
|
-
"--radius-sm: var(--radius-small);",
|
|
1899
|
-
"--radius-md: var(--radius-medium);",
|
|
1900
|
-
"--radius-lg: var(--radius-large);",
|
|
1901
|
-
"--radius-xl: var(--radius-extra-large);",
|
|
1902
|
-
"--text-xs: var(--font-size-extra-small);",
|
|
1903
|
-
"--text-sm: var(--font-size-small);",
|
|
1904
|
-
"--text-base: var(--font-size-regular);",
|
|
1905
|
-
"--text-lg: var(--font-size-large);",
|
|
1906
|
-
"--text-xl: var(--font-size-extra-large);",
|
|
1907
|
-
"--text-2xl: var(--font-size-giant);"
|
|
1908
|
-
];
|
|
1909
|
-
/**
|
|
1910
|
-
* Overrides for global tailwindcss for specifically dark mode.
|
|
1911
|
-
*/
|
|
1912
|
-
const globalDarkCSSOverride = ["--border: var(--color-background-400);"];
|
|
1913
|
-
/**
|
|
1914
|
-
* Generate a complete CSS string for a resolved theme.
|
|
1915
|
-
* Outputs 2–3 blocks: light default, dark explicit via `[data-theme-mode="dark"]`,
|
|
1916
|
-
* and (unless `disableAutoTheme`) a `prefers-color-scheme: dark` media query block.
|
|
1917
|
-
*/
|
|
1918
|
-
function generateThemeCSS(theme, options = {}) {
|
|
1919
|
-
const sel = `[data-theme="${theme.id}"]`;
|
|
1920
|
-
const tw = options.mapTailwindColors ?? true;
|
|
1921
|
-
const blocks = [];
|
|
1922
|
-
blocks.push(`${sel} {`);
|
|
1923
|
-
blocks.push(...globalCSSOverride);
|
|
1924
|
-
blocks.push(...emitNonColorVars(theme));
|
|
1925
|
-
blocks.push(...emitColorVars(theme.light));
|
|
1926
|
-
if (tw) blocks.push(...emitTailwindOverrides());
|
|
1927
|
-
blocks.push(`}`);
|
|
1928
|
-
blocks.push(`${sel}[data-theme-mode="dark"] {`);
|
|
1929
|
-
blocks.push(...globalDarkCSSOverride);
|
|
1930
|
-
blocks.push(...emitColorVars(theme.dark));
|
|
1931
|
-
if (tw) blocks.push(...emitTailwindOverrides(true));
|
|
1932
|
-
blocks.push(`}`);
|
|
1933
|
-
if (!options.disableAutoTheme) {
|
|
1934
|
-
blocks.push(`@media (prefers-color-scheme: dark) {`);
|
|
1935
|
-
blocks.push(`${sel}:not([data-theme-mode]) {`);
|
|
1936
|
-
blocks.push(...globalDarkCSSOverride);
|
|
1937
|
-
blocks.push(...emitColorVars(theme.dark).map((l) => `${l}`));
|
|
1938
|
-
if (tw) blocks.push(...emitTailwindOverrides(true).map((l) => `${l}`));
|
|
1939
|
-
blocks.push(`}`);
|
|
1940
|
-
blocks.push(`}`);
|
|
1941
|
-
}
|
|
1942
|
-
return blocks.join("\n");
|
|
1943
|
-
}
|
|
1944
|
-
//#endregion
|
|
1945
|
-
//#region ../core/src/theme/defaults.ts
|
|
1946
|
-
const DEFAULT_FONT_SIZES = {
|
|
1947
|
-
extraSmall: "0.75rem",
|
|
1948
|
-
small: "0.875rem",
|
|
1949
|
-
regular: "1rem",
|
|
1950
|
-
large: "1.125rem",
|
|
1951
|
-
extraLarge: "1.25rem",
|
|
1952
|
-
giant: "1.5rem"
|
|
1953
|
-
};
|
|
1954
|
-
const DEFAULT_FONT_FAMILIES = {
|
|
1955
|
-
header: "Inter",
|
|
1956
|
-
body: "Inter"
|
|
1957
|
-
};
|
|
1958
|
-
const DEFAULT_SPACING = "0.25rem";
|
|
1959
|
-
const DEFAULT_RADII = {
|
|
1960
|
-
small: "0.25rem",
|
|
1961
|
-
medium: "0.5rem",
|
|
1962
|
-
large: "0.75rem",
|
|
1963
|
-
extraLarge: "1rem"
|
|
1964
|
-
};
|
|
1965
|
-
const DEFAULT_COLORS = {
|
|
1966
|
-
background: "#ffffff",
|
|
1967
|
-
foreground: "#1a1a1a",
|
|
1968
|
-
primary: "#3b82f6",
|
|
1969
|
-
secondary: "#6b7280",
|
|
1970
|
-
accent: "#10b981",
|
|
1971
|
-
muted: "#f3f4f6",
|
|
1972
|
-
destructive: "#ef4444",
|
|
1973
|
-
mutedForeground: "#6b7280"
|
|
1974
|
-
};
|
|
1975
|
-
const DEFAULT_THEME_ID = "default";
|
|
1976
|
-
const DEFAULT_THEME_NAME = "Default Theme";
|
|
1977
|
-
/**
|
|
1978
|
-
* Build a fresh ThemeDefinition populated with all defaults.
|
|
1979
|
-
* Returns a new object each call because Color instances are mutable — do not cache the result.
|
|
1980
|
-
*/
|
|
1981
|
-
function getDefaultThemeDefinition() {
|
|
1982
|
-
const bg = new colorjs_io.default(DEFAULT_COLORS.background);
|
|
1983
|
-
const fg = new colorjs_io.default(DEFAULT_COLORS.foreground);
|
|
1984
|
-
const primary = new colorjs_io.default(DEFAULT_COLORS.primary);
|
|
1985
|
-
const secondary = new colorjs_io.default(DEFAULT_COLORS.secondary);
|
|
1986
|
-
const accent = new colorjs_io.default(DEFAULT_COLORS.accent);
|
|
1987
|
-
const muted = new colorjs_io.default(DEFAULT_COLORS.muted);
|
|
1988
|
-
const destructive = new colorjs_io.default(DEFAULT_COLORS.destructive);
|
|
1989
|
-
const mutedFg = new colorjs_io.default(DEFAULT_COLORS.mutedForeground);
|
|
1990
|
-
const darkBg = new colorjs_io.default("#0a0a0a");
|
|
1991
|
-
const darkFg = new colorjs_io.default("#fafafa");
|
|
1992
|
-
const darkMuted = new colorjs_io.default("#171717");
|
|
1993
|
-
const darkMutedForeground = new colorjs_io.default("#dddddd");
|
|
1994
|
-
return {
|
|
1995
|
-
id: DEFAULT_THEME_ID,
|
|
1996
|
-
name: DEFAULT_THEME_NAME,
|
|
1997
|
-
light: {
|
|
1998
|
-
background: {
|
|
1999
|
-
base: bg,
|
|
2000
|
-
foreground: fg
|
|
2001
|
-
},
|
|
2002
|
-
foreground: {
|
|
2003
|
-
base: fg,
|
|
2004
|
-
foreground: bg
|
|
2005
|
-
},
|
|
2006
|
-
primary: {
|
|
2007
|
-
base: primary,
|
|
2008
|
-
foreground: getForegroundColor(fg, primary)
|
|
2009
|
-
},
|
|
2010
|
-
secondary: {
|
|
2011
|
-
base: secondary,
|
|
2012
|
-
foreground: getForegroundColor(fg, secondary)
|
|
2013
|
-
},
|
|
2014
|
-
accent: {
|
|
2015
|
-
base: accent,
|
|
2016
|
-
foreground: getForegroundColor(fg, accent)
|
|
2017
|
-
},
|
|
2018
|
-
muted: {
|
|
2019
|
-
base: muted,
|
|
2020
|
-
foreground: mutedFg
|
|
2021
|
-
},
|
|
2022
|
-
destructive: {
|
|
2023
|
-
base: destructive,
|
|
2024
|
-
foreground: getForegroundColor(fg, destructive)
|
|
2025
|
-
}
|
|
2026
|
-
},
|
|
2027
|
-
dark: {
|
|
2028
|
-
background: {
|
|
2029
|
-
base: darkBg,
|
|
2030
|
-
foreground: darkFg
|
|
2031
|
-
},
|
|
2032
|
-
foreground: {
|
|
2033
|
-
base: darkFg,
|
|
2034
|
-
foreground: darkBg
|
|
2035
|
-
},
|
|
2036
|
-
muted: {
|
|
2037
|
-
base: darkMuted,
|
|
2038
|
-
foreground: darkMutedForeground
|
|
2039
|
-
}
|
|
2040
|
-
},
|
|
2041
|
-
fontSizes: { ...DEFAULT_FONT_SIZES },
|
|
2042
|
-
fontFamilies: { ...DEFAULT_FONT_FAMILIES },
|
|
2043
|
-
spacing: DEFAULT_SPACING,
|
|
2044
|
-
radii: { ...DEFAULT_RADII }
|
|
2045
|
-
};
|
|
2046
|
-
}
|
|
2047
|
-
//#endregion
|
|
2048
|
-
//#region ../core/src/theme/serialisation.ts
|
|
2049
|
-
function colorToPlain(color) {
|
|
2050
|
-
return {
|
|
2051
|
-
l: color.oklch.l ?? 0,
|
|
2052
|
-
c: color.oklch.c ?? 0,
|
|
2053
|
-
h: color.oklch.h ?? 0
|
|
2054
|
-
};
|
|
2055
|
-
}
|
|
2056
|
-
function plainToColor(plain) {
|
|
2057
|
-
return new colorjs_io.default("oklch", [
|
|
2058
|
-
plain.l,
|
|
2059
|
-
plain.c,
|
|
2060
|
-
plain.h
|
|
2061
|
-
]);
|
|
2062
|
-
}
|
|
2063
|
-
/**
|
|
2064
|
-
* Serialise a ThemeDefinition (with Color objects) to a plain JSON payload
|
|
2065
|
-
* suitable for backend storage.
|
|
2066
|
-
*/
|
|
2067
|
-
function serialiseTheme(def) {
|
|
2068
|
-
const light = {};
|
|
2069
|
-
for (const name of SEMANTIC_COLOR_NAMES) light[name] = {
|
|
2070
|
-
base: colorToPlain(def.light[name].base),
|
|
2071
|
-
foreground: colorToPlain(def.light[name].foreground)
|
|
2072
|
-
};
|
|
2073
|
-
const dark = {};
|
|
2074
|
-
for (const [name, value] of Object.entries(def.dark)) {
|
|
2075
|
-
if (!value) continue;
|
|
2076
|
-
dark[name] = {
|
|
2077
|
-
...value.base ? { base: colorToPlain(value.base) } : {},
|
|
2078
|
-
...value.foreground ? { foreground: colorToPlain(value.foreground) } : {}
|
|
2079
|
-
};
|
|
2080
|
-
}
|
|
2081
|
-
return {
|
|
2082
|
-
id: def.id,
|
|
2083
|
-
name: def.name,
|
|
2084
|
-
light,
|
|
2085
|
-
dark,
|
|
2086
|
-
fontSizes: { ...def.fontSizes },
|
|
2087
|
-
fontFamilies: { ...def.fontFamilies },
|
|
2088
|
-
spacing: def.spacing,
|
|
2089
|
-
radii: { ...def.radii },
|
|
2090
|
-
...def.syncWithBrandColors ? { syncWithBrandColors: true } : {}
|
|
2091
|
-
};
|
|
2092
|
-
}
|
|
2093
|
-
/**
|
|
2094
|
-
* Deserialise a backend payload into a ThemeDefinition with Color objects.
|
|
2095
|
-
* Accepts `Record<string, unknown>` because API data is untyped at the boundary.
|
|
2096
|
-
* Falls back to default colors for any missing light-mode entries.
|
|
2097
|
-
*/
|
|
2098
|
-
function deserialiseTheme(payload) {
|
|
2099
|
-
const lightRaw = payload.light ?? {};
|
|
2100
|
-
const darkRaw = payload.dark ?? {};
|
|
2101
|
-
const defaults = getDefaultThemeDefinition();
|
|
2102
|
-
const light = {};
|
|
2103
|
-
for (const name of SEMANTIC_COLOR_NAMES) {
|
|
2104
|
-
const entry = lightRaw[name];
|
|
2105
|
-
if (entry) light[name] = {
|
|
2106
|
-
base: plainToColor(entry.base),
|
|
2107
|
-
foreground: plainToColor(entry.foreground)
|
|
2108
|
-
};
|
|
2109
|
-
else {
|
|
2110
|
-
console.warn(`[theme] deserialiseTheme: missing light color "${name}", using default`);
|
|
2111
|
-
light[name] = defaults.light[name];
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
const dark = {};
|
|
2115
|
-
for (const [name, value] of Object.entries(darkRaw)) {
|
|
2116
|
-
if (!value) continue;
|
|
2117
|
-
dark[name] = {
|
|
2118
|
-
...value.base ? { base: plainToColor(value.base) } : {},
|
|
2119
|
-
...value.foreground ? { foreground: plainToColor(value.foreground) } : {}
|
|
2120
|
-
};
|
|
2121
|
-
}
|
|
2122
|
-
return {
|
|
2123
|
-
id: payload.id,
|
|
2124
|
-
name: payload.name,
|
|
2125
|
-
light,
|
|
2126
|
-
dark,
|
|
2127
|
-
fontSizes: payload.fontSizes ?? DEFAULT_FONT_SIZES,
|
|
2128
|
-
fontFamilies: payload.fontFamilies ?? DEFAULT_FONT_FAMILIES,
|
|
2129
|
-
spacing: payload.spacing ?? "0.25rem",
|
|
2130
|
-
radii: payload.radii ?? DEFAULT_RADII,
|
|
2131
|
-
...payload.syncWithBrandColors === true ? { syncWithBrandColors: true } : {}
|
|
2132
|
-
};
|
|
2133
|
-
}
|
|
2134
|
-
//#endregion
|
|
2135
|
-
//#region ../core/src/theme/transforms.ts
|
|
2136
|
-
/**
|
|
2137
|
-
* Check if a theme config uses the new structured format (has a `light` key
|
|
2138
|
-
* that is an object) vs the legacy flat format.
|
|
2139
|
-
*/
|
|
2140
|
-
function isNewThemeFormat(config) {
|
|
2141
|
-
return config.light != null && typeof config.light === "object";
|
|
2142
|
-
}
|
|
2143
|
-
/**
|
|
2144
|
-
* Convert a legacy flat config to a ThemeDefinition.
|
|
2145
|
-
* Legacy format: { base: "#fff", text: "#000", primary: "oklch(0.6 0.2 250)", ... }
|
|
2146
|
-
*/
|
|
2147
|
-
function legacyConfigToDefinition(id, name, config) {
|
|
2148
|
-
const bg = parseColor(config.base ?? config.background ?? DEFAULT_COLORS.background);
|
|
2149
|
-
const fg = parseColor(config.text ?? config.foreground ?? DEFAULT_COLORS.foreground);
|
|
2150
|
-
const primary = parseColor(config.primary ?? DEFAULT_COLORS.primary);
|
|
2151
|
-
const secondary = parseColor(config.secondary ?? DEFAULT_COLORS.secondary);
|
|
2152
|
-
const accent = parseColor(config.accent ?? DEFAULT_COLORS.accent);
|
|
2153
|
-
const muted = parseColor(config.muted ?? DEFAULT_COLORS.muted);
|
|
2154
|
-
const destructive = parseColor(config.destructive ?? DEFAULT_COLORS.destructive);
|
|
2155
|
-
const mutedFg = parseColor(config.mutedForeground ?? DEFAULT_COLORS.mutedForeground);
|
|
2156
|
-
return {
|
|
2157
|
-
id: String(id),
|
|
2158
|
-
name,
|
|
2159
|
-
light: {
|
|
2160
|
-
background: {
|
|
2161
|
-
base: bg,
|
|
2162
|
-
foreground: fg
|
|
2163
|
-
},
|
|
2164
|
-
foreground: {
|
|
2165
|
-
base: fg,
|
|
2166
|
-
foreground: bg
|
|
2167
|
-
},
|
|
2168
|
-
primary: {
|
|
2169
|
-
base: primary,
|
|
2170
|
-
foreground: getForegroundColor(fg, primary)
|
|
2171
|
-
},
|
|
2172
|
-
secondary: {
|
|
2173
|
-
base: secondary,
|
|
2174
|
-
foreground: getForegroundColor(fg, secondary)
|
|
2175
|
-
},
|
|
2176
|
-
accent: {
|
|
2177
|
-
base: accent,
|
|
2178
|
-
foreground: getForegroundColor(fg, accent)
|
|
2179
|
-
},
|
|
2180
|
-
muted: {
|
|
2181
|
-
base: muted,
|
|
2182
|
-
foreground: mutedFg
|
|
2183
|
-
},
|
|
2184
|
-
destructive: {
|
|
2185
|
-
base: destructive,
|
|
2186
|
-
foreground: getForegroundColor(fg, destructive)
|
|
2187
|
-
}
|
|
2188
|
-
},
|
|
2189
|
-
dark: {},
|
|
2190
|
-
fontSizes: {
|
|
2191
|
-
extraSmall: config.extraSmall ?? DEFAULT_FONT_SIZES.extraSmall,
|
|
2192
|
-
small: config.small ?? DEFAULT_FONT_SIZES.small,
|
|
2193
|
-
regular: config.regular ?? DEFAULT_FONT_SIZES.regular,
|
|
2194
|
-
large: config.large ?? DEFAULT_FONT_SIZES.large,
|
|
2195
|
-
extraLarge: config.extraLarge ?? DEFAULT_FONT_SIZES.extraLarge,
|
|
2196
|
-
giant: config.giant ?? DEFAULT_FONT_SIZES.giant
|
|
2197
|
-
},
|
|
2198
|
-
fontFamilies: {
|
|
2199
|
-
header: config.headerFont ?? DEFAULT_FONT_FAMILIES.header,
|
|
2200
|
-
body: config.bodyFont ?? DEFAULT_FONT_FAMILIES.body
|
|
2201
|
-
},
|
|
2202
|
-
spacing: config.globalSpacing ?? "0.25rem",
|
|
2203
|
-
radii: {
|
|
2204
|
-
small: config.radiusSmall ?? DEFAULT_RADII.small,
|
|
2205
|
-
medium: config.radiusMedium ?? DEFAULT_RADII.medium,
|
|
2206
|
-
large: config.radiusLarge ?? DEFAULT_RADII.large,
|
|
2207
|
-
extraLarge: config.radiusExtraLarge ?? DEFAULT_RADII.extraLarge
|
|
2208
|
-
}
|
|
2209
|
-
};
|
|
2210
|
-
}
|
|
2211
|
-
/**
|
|
2212
|
-
* Build a ThemeDefinition from a single API theme object.
|
|
2213
|
-
* Handles both new structured format and legacy flat format.
|
|
2214
|
-
*/
|
|
2215
|
-
function buildThemeDefinition(theme) {
|
|
2216
|
-
const config = theme.config ?? {};
|
|
2217
|
-
if (isNewThemeFormat(config)) return deserialiseTheme({
|
|
2218
|
-
...config,
|
|
2219
|
-
id: String(theme.id),
|
|
2220
|
-
name: theme.name ?? "Untitled Theme"
|
|
2221
|
-
});
|
|
2222
|
-
return legacyConfigToDefinition(theme.id, theme.name ?? "Untitled Theme", config);
|
|
2223
|
-
}
|
|
2224
|
-
/**
|
|
2225
|
-
* Transform raw API themes to ThemeDefinition[].
|
|
2226
|
-
* Catches and logs errors per theme (graceful degradation).
|
|
2227
|
-
*/
|
|
2228
|
-
function transformThemes(themes) {
|
|
2229
|
-
return themes.flatMap((theme) => {
|
|
2230
|
-
try {
|
|
2231
|
-
return [buildThemeDefinition(theme)];
|
|
2232
|
-
} catch (error) {
|
|
2233
|
-
console.error(`[theme] Failed to build theme id=${theme.id}:`, error);
|
|
2234
|
-
return [];
|
|
2235
|
-
}
|
|
2236
|
-
});
|
|
2237
|
-
}
|
|
2238
|
-
/**
|
|
2239
|
-
* Get the active theme ID from a list of raw API themes.
|
|
2240
|
-
* Falls back to the first theme if none is marked active.
|
|
2241
|
-
*/
|
|
2242
|
-
function getActiveThemeId(themes) {
|
|
2243
|
-
const active = themes.find((t) => t.active) ?? themes[0];
|
|
2244
|
-
return active ? String(active.id) : void 0;
|
|
2245
|
-
}
|
|
2246
|
-
//#endregion
|
|
2247
|
-
//#region ../core/src/theme/theme-applicator.ts
|
|
2248
|
-
const STYLE_PREFIX = "theme-style-";
|
|
2249
|
-
const FONT_LINK_PREFIX = "theme-font-";
|
|
2250
|
-
const SYSTEM_FONTS = new Set([
|
|
2251
|
-
"sans-serif",
|
|
2252
|
-
"serif",
|
|
2253
|
-
"monospace",
|
|
2254
|
-
"cursive",
|
|
2255
|
-
"fantasy",
|
|
2256
|
-
"system-ui",
|
|
2257
|
-
"ui-sans-serif",
|
|
2258
|
-
"ui-serif",
|
|
2259
|
-
"ui-monospace"
|
|
2260
|
-
]);
|
|
2261
|
-
/** Build a Google Fonts CSS2 URL for a given font family with all weights. */
|
|
2262
|
-
function buildGoogleFontUrl(family) {
|
|
2263
|
-
return `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family).replace(/%20/g, "+")}:wght@100;200;300;400;500;600;700;800;900&display=swap`;
|
|
2264
|
-
}
|
|
2265
|
-
/** Check if a font family value needs to be loaded (i.e. is not a CSS var or system font). */
|
|
2266
|
-
function isLoadableFont(value) {
|
|
2267
|
-
if (!value) return false;
|
|
2268
|
-
if (value.startsWith("var(")) return false;
|
|
2269
|
-
return !SYSTEM_FONTS.has(value.toLowerCase());
|
|
2270
|
-
}
|
|
2271
|
-
/** Deterministic link element ID for a font family. */
|
|
2272
|
-
function fontLinkId(family) {
|
|
2273
|
-
return `${FONT_LINK_PREFIX}${family.replace(/\s+/g, "-").toLowerCase()}`;
|
|
2274
|
-
}
|
|
2275
|
-
/**
|
|
2276
|
-
* Inject or update `<link>` elements for Google Fonts used by the theme.
|
|
2277
|
-
* Removes links for fonts that are no longer referenced.
|
|
2278
|
-
*/
|
|
2279
|
-
function loadThemeFonts(theme) {
|
|
2280
|
-
if (typeof document === "undefined") return;
|
|
2281
|
-
const fontsToLoad = /* @__PURE__ */ new Set();
|
|
2282
|
-
for (const key of FONT_FAMILY_KEYS) {
|
|
2283
|
-
const value = theme.fontFamilies[key];
|
|
2284
|
-
if (isLoadableFont(value)) fontsToLoad.add(value);
|
|
2285
|
-
}
|
|
2286
|
-
document.querySelectorAll(`link[id^="${FONT_LINK_PREFIX}"]`).forEach((link) => {
|
|
2287
|
-
const owners = link.getAttribute("data-font-theme-ids")?.split(",") ?? [];
|
|
2288
|
-
if (!owners.includes(theme.id)) return;
|
|
2289
|
-
const fontName = link.getAttribute("data-font-family");
|
|
2290
|
-
if (fontName && !fontsToLoad.has(fontName)) {
|
|
2291
|
-
const remaining = owners.filter((id) => id !== theme.id);
|
|
2292
|
-
if (remaining.length === 0) link.remove();
|
|
2293
|
-
else link.setAttribute("data-font-theme-ids", remaining.join(","));
|
|
2294
|
-
}
|
|
2295
|
-
});
|
|
2296
|
-
for (const family of fontsToLoad) {
|
|
2297
|
-
const id = fontLinkId(family);
|
|
2298
|
-
const existing = document.getElementById(id);
|
|
2299
|
-
if (existing) {
|
|
2300
|
-
const owners = existing.getAttribute("data-font-theme-ids")?.split(",") ?? [];
|
|
2301
|
-
if (!owners.includes(theme.id)) existing.setAttribute("data-font-theme-ids", [...owners, theme.id].join(","));
|
|
2302
|
-
} else {
|
|
2303
|
-
const link = document.createElement("link");
|
|
2304
|
-
link.id = id;
|
|
2305
|
-
link.rel = "stylesheet";
|
|
2306
|
-
link.href = buildGoogleFontUrl(family);
|
|
2307
|
-
link.setAttribute("data-font-family", family);
|
|
2308
|
-
link.setAttribute("data-font-theme-ids", theme.id);
|
|
2309
|
-
document.head.appendChild(link);
|
|
2310
|
-
}
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
/** Remove all font `<link>` elements injected by the theme system. */
|
|
2314
|
-
function removeAllFontLinks() {
|
|
2315
|
-
if (typeof document === "undefined") return;
|
|
2316
|
-
document.querySelectorAll(`link[id^="${FONT_LINK_PREFIX}"]`).forEach((el) => el.remove());
|
|
2317
|
-
}
|
|
2318
|
-
/**
|
|
2319
|
-
* Inject or update a `<style>` element in `<head>` for the given theme.
|
|
2320
|
-
* The element ID is deterministic (`theme-style-{themeId}`) so repeated calls
|
|
2321
|
-
* for the same theme are idempotent — the existing element is updated in place.
|
|
2322
|
-
* Also loads Google Fonts referenced by the theme's font families.
|
|
2323
|
-
* No-op when `document` is unavailable (SSR).
|
|
2324
|
-
*/
|
|
2325
|
-
function applyTheme(theme, options) {
|
|
2326
|
-
if (typeof document === "undefined") return;
|
|
2327
|
-
try {
|
|
2328
|
-
loadThemeFonts(theme);
|
|
2329
|
-
const styleId = `${STYLE_PREFIX}${theme.id}`;
|
|
2330
|
-
let el = document.getElementById(styleId);
|
|
2331
|
-
if (!el) {
|
|
2332
|
-
el = document.createElement("style");
|
|
2333
|
-
el.id = styleId;
|
|
2334
|
-
document.head.appendChild(el);
|
|
2335
|
-
}
|
|
2336
|
-
el.textContent = generateThemeCSS(theme, options);
|
|
2337
|
-
} catch (error) {
|
|
2338
|
-
console.error(`[theme] applyTheme failed for "${theme.id}":`, error);
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
/** Remove an injected theme stylesheet and clean up font link ownership. No-op during SSR. */
|
|
2342
|
-
function removeTheme(themeId) {
|
|
2343
|
-
if (typeof document === "undefined") return;
|
|
2344
|
-
document.getElementById(`${STYLE_PREFIX}${themeId}`)?.remove();
|
|
2345
|
-
document.querySelectorAll(`link[id^="${FONT_LINK_PREFIX}"]`).forEach((link) => {
|
|
2346
|
-
const remaining = (link.getAttribute("data-font-theme-ids")?.split(",") ?? []).filter((id) => id !== themeId);
|
|
2347
|
-
if (remaining.length === 0) link.remove();
|
|
2348
|
-
else link.setAttribute("data-font-theme-ids", remaining.join(","));
|
|
2349
|
-
});
|
|
2350
|
-
}
|
|
2351
|
-
/** Remove all injected theme stylesheets and font links. No-op during SSR. */
|
|
2352
|
-
function removeAllThemes() {
|
|
2353
|
-
if (typeof document === "undefined") return;
|
|
2354
|
-
document.querySelectorAll(`style[id^="${STYLE_PREFIX}"]`).forEach((el) => el.remove());
|
|
2355
|
-
removeAllFontLinks();
|
|
2356
|
-
}
|
|
2357
|
-
//#endregion
|
|
2358
1588
|
//#region src/providers/FluidThemeProvider.tsx
|
|
2359
1589
|
/**
|
|
2360
1590
|
* Theme Provider for Fluid SDK
|
|
@@ -2368,7 +1598,7 @@ const ThemeContext = (0, react.createContext)(null);
|
|
|
2368
1598
|
*/
|
|
2369
1599
|
function applyThemeToDOM(theme, mode, container) {
|
|
2370
1600
|
const target = container ?? document.documentElement;
|
|
2371
|
-
applyTheme(resolveTheme(theme));
|
|
1601
|
+
require_src.applyTheme(require_src.resolveTheme(theme));
|
|
2372
1602
|
target.dataset.theme = theme.id;
|
|
2373
1603
|
if (mode) target.dataset.themeMode = mode;
|
|
2374
1604
|
else delete target.dataset.themeMode;
|
|
@@ -2379,7 +1609,7 @@ function FluidThemeProvider({ children, initialTheme, container }) {
|
|
|
2379
1609
|
(0, react.useEffect)(() => {
|
|
2380
1610
|
if (currentTheme) applyThemeToDOM(currentTheme, mode, container ?? null);
|
|
2381
1611
|
return () => {
|
|
2382
|
-
if (currentTheme) removeTheme(currentTheme.id);
|
|
1612
|
+
if (currentTheme) require_src.removeTheme(currentTheme.id);
|
|
2383
1613
|
};
|
|
2384
1614
|
}, [
|
|
2385
1615
|
currentTheme,
|
|
@@ -2731,14 +1961,14 @@ const widgetPropertySchemas = {
|
|
|
2731
1961
|
AlertWidget: () => Promise.resolve().then(() => require("./AlertWidget-Nx31UmWK.cjs")).then((n) => n.AlertWidget_exports).then((m) => m.alertWidgetPropertySchema),
|
|
2732
1962
|
BulletListWidget: () => Promise.resolve().then(() => require("./BulletListWidget-CouwHMJt.cjs")).then((n) => n.BulletListWidget_exports).then((m) => m.bulletListWidgetPropertySchema),
|
|
2733
1963
|
CalendarWidget: () => Promise.resolve().then(() => require("./CalendarWidget-BtKzQFeO.cjs")).then((n) => n.CalendarWidget_exports).then((m) => m.calendarWidgetPropertySchema),
|
|
2734
|
-
CardWidget: () => Promise.resolve().then(() => require("./CardWidget-
|
|
1964
|
+
CardWidget: () => Promise.resolve().then(() => require("./CardWidget-BVYjwdua.cjs")).then((m) => m.cardWidgetPropertySchema),
|
|
2735
1965
|
CarouselWidget: () => Promise.resolve().then(() => require("./CarouselWidget-BENYmIwu.cjs")).then((m) => m.carouselWidgetPropertySchema),
|
|
2736
1966
|
CatchUpWidget: () => Promise.resolve().then(() => require("./CatchUpWidget-BmibiEkX.cjs")).then((n) => n.CatchUpWidget_exports).then((m) => m.catchUpWidgetPropertySchema),
|
|
2737
1967
|
ChartWidget: () => Promise.resolve().then(() => require("./ChartWidget-DzgRlcNX.cjs")).then((m) => m.chartWidgetPropertySchema),
|
|
2738
|
-
ContainerWidget: () => Promise.resolve().then(() => require("./ContainerWidget-
|
|
1968
|
+
ContainerWidget: () => Promise.resolve().then(() => require("./ContainerWidget-gtjlMITv.cjs")).then((m) => m.containerWidgetPropertySchema),
|
|
2739
1969
|
EmbedWidget: () => Promise.resolve().then(() => require("./EmbedWidget-CLArhSmx.cjs")).then((n) => n.EmbedWidget_exports).then((m) => m.embedWidgetPropertySchema),
|
|
2740
1970
|
ImageWidget: () => Promise.resolve().then(() => require("./ImageWidget-B7ui4-KU.cjs")).then((n) => n.ImageWidget_exports).then((m) => m.imageWidgetPropertySchema),
|
|
2741
|
-
LayoutWidget: () => Promise.resolve().then(() => require("./LayoutWidget-
|
|
1971
|
+
LayoutWidget: () => Promise.resolve().then(() => require("./LayoutWidget-D5gh0ejr.cjs")).then((m) => m.layoutWidgetPropertySchema),
|
|
2742
1972
|
LinkWidget: () => Promise.resolve().then(() => require("./LinkWidget-DfVu-3zf.cjs")).then((m) => m.linkWidgetPropertySchema),
|
|
2743
1973
|
ListWidget: () => Promise.resolve().then(() => require("./ListWidget-BAf2Vfsx.cjs")).then((m) => m.listWidgetPropertySchema),
|
|
2744
1974
|
MySiteWidget: () => Promise.resolve().then(() => require("./MySiteWidget-ISV__1ng.cjs")).then((n) => n.MySiteWidget_exports).then((m) => m.mySiteWidgetPropertySchema),
|
|
@@ -2865,7 +2095,7 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
2865
2095
|
value: storeApi,
|
|
2866
2096
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PayApiProvider, {
|
|
2867
2097
|
value: payApi,
|
|
2868
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2098
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.CountriesApiProvider, {
|
|
2869
2099
|
value: countriesApi,
|
|
2870
2100
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguagesApiProvider, {
|
|
2871
2101
|
value: languagesApi,
|
|
@@ -2931,66 +2161,12 @@ Object.defineProperty(exports, "ApiError", {
|
|
|
2931
2161
|
return ApiError;
|
|
2932
2162
|
}
|
|
2933
2163
|
});
|
|
2934
|
-
Object.defineProperty(exports, "DEFAULT_COLORS", {
|
|
2935
|
-
enumerable: true,
|
|
2936
|
-
get: function() {
|
|
2937
|
-
return DEFAULT_COLORS;
|
|
2938
|
-
}
|
|
2939
|
-
});
|
|
2940
|
-
Object.defineProperty(exports, "DEFAULT_FONT_FAMILIES", {
|
|
2941
|
-
enumerable: true,
|
|
2942
|
-
get: function() {
|
|
2943
|
-
return DEFAULT_FONT_FAMILIES;
|
|
2944
|
-
}
|
|
2945
|
-
});
|
|
2946
|
-
Object.defineProperty(exports, "DEFAULT_FONT_SIZES", {
|
|
2947
|
-
enumerable: true,
|
|
2948
|
-
get: function() {
|
|
2949
|
-
return DEFAULT_FONT_SIZES;
|
|
2950
|
-
}
|
|
2951
|
-
});
|
|
2952
|
-
Object.defineProperty(exports, "DEFAULT_RADII", {
|
|
2953
|
-
enumerable: true,
|
|
2954
|
-
get: function() {
|
|
2955
|
-
return DEFAULT_RADII;
|
|
2956
|
-
}
|
|
2957
|
-
});
|
|
2958
2164
|
Object.defineProperty(exports, "DEFAULT_SDK_WIDGET_REGISTRY", {
|
|
2959
2165
|
enumerable: true,
|
|
2960
2166
|
get: function() {
|
|
2961
2167
|
return DEFAULT_SDK_WIDGET_REGISTRY;
|
|
2962
2168
|
}
|
|
2963
2169
|
});
|
|
2964
|
-
Object.defineProperty(exports, "DEFAULT_SPACING", {
|
|
2965
|
-
enumerable: true,
|
|
2966
|
-
get: function() {
|
|
2967
|
-
return DEFAULT_SPACING;
|
|
2968
|
-
}
|
|
2969
|
-
});
|
|
2970
|
-
Object.defineProperty(exports, "DEFAULT_THEME_ID", {
|
|
2971
|
-
enumerable: true,
|
|
2972
|
-
get: function() {
|
|
2973
|
-
return DEFAULT_THEME_ID;
|
|
2974
|
-
}
|
|
2975
|
-
});
|
|
2976
|
-
Object.defineProperty(exports, "DEFAULT_THEME_NAME", {
|
|
2977
|
-
enumerable: true,
|
|
2978
|
-
get: function() {
|
|
2979
|
-
return DEFAULT_THEME_NAME;
|
|
2980
|
-
}
|
|
2981
|
-
});
|
|
2982
|
-
Object.defineProperty(exports, "FONT_FAMILY_KEYS", {
|
|
2983
|
-
enumerable: true,
|
|
2984
|
-
get: function() {
|
|
2985
|
-
return FONT_FAMILY_KEYS;
|
|
2986
|
-
}
|
|
2987
|
-
});
|
|
2988
|
-
Object.defineProperty(exports, "FONT_SIZE_KEYS", {
|
|
2989
|
-
enumerable: true,
|
|
2990
|
-
get: function() {
|
|
2991
|
-
return FONT_SIZE_KEYS;
|
|
2992
|
-
}
|
|
2993
|
-
});
|
|
2994
2170
|
Object.defineProperty(exports, "FluidProvider", {
|
|
2995
2171
|
enumerable: true,
|
|
2996
2172
|
get: function() {
|
|
@@ -3003,36 +2179,6 @@ Object.defineProperty(exports, "FluidThemeProvider", {
|
|
|
3003
2179
|
return FluidThemeProvider;
|
|
3004
2180
|
}
|
|
3005
2181
|
});
|
|
3006
|
-
Object.defineProperty(exports, "RADIUS_KEYS", {
|
|
3007
|
-
enumerable: true,
|
|
3008
|
-
get: function() {
|
|
3009
|
-
return RADIUS_KEYS;
|
|
3010
|
-
}
|
|
3011
|
-
});
|
|
3012
|
-
Object.defineProperty(exports, "SEMANTIC_COLOR_NAMES", {
|
|
3013
|
-
enumerable: true,
|
|
3014
|
-
get: function() {
|
|
3015
|
-
return SEMANTIC_COLOR_NAMES;
|
|
3016
|
-
}
|
|
3017
|
-
});
|
|
3018
|
-
Object.defineProperty(exports, "SHADE_STEPS", {
|
|
3019
|
-
enumerable: true,
|
|
3020
|
-
get: function() {
|
|
3021
|
-
return SHADE_STEPS;
|
|
3022
|
-
}
|
|
3023
|
-
});
|
|
3024
|
-
Object.defineProperty(exports, "applyTheme", {
|
|
3025
|
-
enumerable: true,
|
|
3026
|
-
get: function() {
|
|
3027
|
-
return applyTheme;
|
|
3028
|
-
}
|
|
3029
|
-
});
|
|
3030
|
-
Object.defineProperty(exports, "buildThemeDefinition", {
|
|
3031
|
-
enumerable: true,
|
|
3032
|
-
get: function() {
|
|
3033
|
-
return buildThemeDefinition;
|
|
3034
|
-
}
|
|
3035
|
-
});
|
|
3036
2182
|
Object.defineProperty(exports, "createPersister", {
|
|
3037
2183
|
enumerable: true,
|
|
3038
2184
|
get: function() {
|
|
@@ -3063,90 +2209,6 @@ Object.defineProperty(exports, "deleteDatabase", {
|
|
|
3063
2209
|
return deleteDatabase;
|
|
3064
2210
|
}
|
|
3065
2211
|
});
|
|
3066
|
-
Object.defineProperty(exports, "deriveDarkVariant", {
|
|
3067
|
-
enumerable: true,
|
|
3068
|
-
get: function() {
|
|
3069
|
-
return deriveDarkVariant;
|
|
3070
|
-
}
|
|
3071
|
-
});
|
|
3072
|
-
Object.defineProperty(exports, "deserialiseTheme", {
|
|
3073
|
-
enumerable: true,
|
|
3074
|
-
get: function() {
|
|
3075
|
-
return deserialiseTheme;
|
|
3076
|
-
}
|
|
3077
|
-
});
|
|
3078
|
-
Object.defineProperty(exports, "generateShades", {
|
|
3079
|
-
enumerable: true,
|
|
3080
|
-
get: function() {
|
|
3081
|
-
return generateShades;
|
|
3082
|
-
}
|
|
3083
|
-
});
|
|
3084
|
-
Object.defineProperty(exports, "generateThemeCSS", {
|
|
3085
|
-
enumerable: true,
|
|
3086
|
-
get: function() {
|
|
3087
|
-
return generateThemeCSS;
|
|
3088
|
-
}
|
|
3089
|
-
});
|
|
3090
|
-
Object.defineProperty(exports, "getActiveThemeId", {
|
|
3091
|
-
enumerable: true,
|
|
3092
|
-
get: function() {
|
|
3093
|
-
return getActiveThemeId;
|
|
3094
|
-
}
|
|
3095
|
-
});
|
|
3096
|
-
Object.defineProperty(exports, "getDefaultThemeDefinition", {
|
|
3097
|
-
enumerable: true,
|
|
3098
|
-
get: function() {
|
|
3099
|
-
return getDefaultThemeDefinition;
|
|
3100
|
-
}
|
|
3101
|
-
});
|
|
3102
|
-
Object.defineProperty(exports, "getForegroundColor", {
|
|
3103
|
-
enumerable: true,
|
|
3104
|
-
get: function() {
|
|
3105
|
-
return getForegroundColor;
|
|
3106
|
-
}
|
|
3107
|
-
});
|
|
3108
|
-
Object.defineProperty(exports, "mergeDarkOverrides", {
|
|
3109
|
-
enumerable: true,
|
|
3110
|
-
get: function() {
|
|
3111
|
-
return mergeDarkOverrides;
|
|
3112
|
-
}
|
|
3113
|
-
});
|
|
3114
|
-
Object.defineProperty(exports, "parseColor", {
|
|
3115
|
-
enumerable: true,
|
|
3116
|
-
get: function() {
|
|
3117
|
-
return parseColor;
|
|
3118
|
-
}
|
|
3119
|
-
});
|
|
3120
|
-
Object.defineProperty(exports, "removeAllThemes", {
|
|
3121
|
-
enumerable: true,
|
|
3122
|
-
get: function() {
|
|
3123
|
-
return removeAllThemes;
|
|
3124
|
-
}
|
|
3125
|
-
});
|
|
3126
|
-
Object.defineProperty(exports, "removeTheme", {
|
|
3127
|
-
enumerable: true,
|
|
3128
|
-
get: function() {
|
|
3129
|
-
return removeTheme;
|
|
3130
|
-
}
|
|
3131
|
-
});
|
|
3132
|
-
Object.defineProperty(exports, "resolveTheme", {
|
|
3133
|
-
enumerable: true,
|
|
3134
|
-
get: function() {
|
|
3135
|
-
return resolveTheme;
|
|
3136
|
-
}
|
|
3137
|
-
});
|
|
3138
|
-
Object.defineProperty(exports, "serialiseTheme", {
|
|
3139
|
-
enumerable: true,
|
|
3140
|
-
get: function() {
|
|
3141
|
-
return serialiseTheme;
|
|
3142
|
-
}
|
|
3143
|
-
});
|
|
3144
|
-
Object.defineProperty(exports, "transformThemes", {
|
|
3145
|
-
enumerable: true,
|
|
3146
|
-
get: function() {
|
|
3147
|
-
return transformThemes;
|
|
3148
|
-
}
|
|
3149
|
-
});
|
|
3150
2212
|
Object.defineProperty(exports, "useAppDefinitionApi", {
|
|
3151
2213
|
enumerable: true,
|
|
3152
2214
|
get: function() {
|
|
@@ -3184,4 +2246,4 @@ Object.defineProperty(exports, "widgetPropertySchemas", {
|
|
|
3184
2246
|
}
|
|
3185
2247
|
});
|
|
3186
2248
|
|
|
3187
|
-
//# sourceMappingURL=FluidProvider-
|
|
2249
|
+
//# sourceMappingURL=FluidProvider-ByBDIQeW.cjs.map
|