@nocios/crudify-ui 4.0.1 → 4.0.4
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/index.d.mts +0 -10
- package/dist/index.d.ts +0 -10
- package/dist/index.js +2 -28
- package/dist/index.mjs +2 -28
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,11 +10,6 @@ interface CrudifyLoginConfig {
|
|
|
10
10
|
env?: "dev" | "stg" | "api" | "prod";
|
|
11
11
|
appName?: string;
|
|
12
12
|
logo?: string;
|
|
13
|
-
colors?: {
|
|
14
|
-
primaryColor?: string;
|
|
15
|
-
bgColor?: string;
|
|
16
|
-
[key: string]: string | undefined;
|
|
17
|
-
};
|
|
18
13
|
loginActions?: string[];
|
|
19
14
|
}
|
|
20
15
|
interface CrudifyLoginTranslations {
|
|
@@ -381,11 +376,6 @@ type CrudifyConfig = {
|
|
|
381
376
|
appName?: string;
|
|
382
377
|
loginActions?: string[];
|
|
383
378
|
logo?: string;
|
|
384
|
-
colors?: {
|
|
385
|
-
primaryColor?: string;
|
|
386
|
-
bgColor?: string;
|
|
387
|
-
[key: string]: string | undefined;
|
|
388
|
-
};
|
|
389
379
|
};
|
|
390
380
|
type SessionContextType = {
|
|
391
381
|
isAuthenticated: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,11 +10,6 @@ interface CrudifyLoginConfig {
|
|
|
10
10
|
env?: "dev" | "stg" | "api" | "prod";
|
|
11
11
|
appName?: string;
|
|
12
12
|
logo?: string;
|
|
13
|
-
colors?: {
|
|
14
|
-
primaryColor?: string;
|
|
15
|
-
bgColor?: string;
|
|
16
|
-
[key: string]: string | undefined;
|
|
17
|
-
};
|
|
18
13
|
loginActions?: string[];
|
|
19
14
|
}
|
|
20
15
|
interface CrudifyLoginTranslations {
|
|
@@ -381,11 +376,6 @@ type CrudifyConfig = {
|
|
|
381
376
|
appName?: string;
|
|
382
377
|
loginActions?: string[];
|
|
383
378
|
logo?: string;
|
|
384
|
-
colors?: {
|
|
385
|
-
primaryColor?: string;
|
|
386
|
-
bgColor?: string;
|
|
387
|
-
[key: string]: string | undefined;
|
|
388
|
-
};
|
|
389
379
|
};
|
|
390
380
|
type SessionContextType = {
|
|
391
381
|
isAuthenticated: boolean;
|
package/dist/index.js
CHANGED
|
@@ -409,17 +409,8 @@ var LoginStateProvider = ({
|
|
|
409
409
|
cookieConfig.logo = decodedLogo;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
const colorsCookie = getCookie("colors");
|
|
413
|
-
if (colorsCookie) {
|
|
414
|
-
const decodedColorsString = decodeURIComponent(colorsCookie);
|
|
415
|
-
const parsedColors = JSON.parse(decodedColorsString);
|
|
416
|
-
cookieConfig.colors = { primaryColor: "#1066BA", ...parsedColors };
|
|
417
|
-
} else {
|
|
418
|
-
cookieConfig.colors = { primaryColor: "#1066BA" };
|
|
419
|
-
}
|
|
420
412
|
} catch (e) {
|
|
421
413
|
console.error("Error reading configuration from cookies:", e);
|
|
422
|
-
cookieConfig.colors = { primaryColor: "#1066BA" };
|
|
423
414
|
}
|
|
424
415
|
}
|
|
425
416
|
return {
|
|
@@ -427,7 +418,6 @@ var LoginStateProvider = ({
|
|
|
427
418
|
env: providedConfig?.env,
|
|
428
419
|
appName: providedConfig?.appName,
|
|
429
420
|
logo: providedConfig?.logo || cookieConfig.logo,
|
|
430
|
-
colors: { ...cookieConfig.colors, ...providedConfig?.colors },
|
|
431
421
|
loginActions: providedConfig?.loginActions
|
|
432
422
|
};
|
|
433
423
|
};
|
|
@@ -1649,7 +1639,6 @@ function InnerSessionProvider({
|
|
|
1649
1639
|
let appName;
|
|
1650
1640
|
let loginActions;
|
|
1651
1641
|
let logo;
|
|
1652
|
-
let colors;
|
|
1653
1642
|
let configSource = "unknown";
|
|
1654
1643
|
if (propConfig?.publicApiKey) {
|
|
1655
1644
|
publicApiKey = propConfig.publicApiKey;
|
|
@@ -1667,16 +1656,12 @@ function InnerSessionProvider({
|
|
|
1667
1656
|
if (propConfig?.logo) {
|
|
1668
1657
|
logo = propConfig.logo;
|
|
1669
1658
|
}
|
|
1670
|
-
if (propConfig?.colors) {
|
|
1671
|
-
colors = propConfig.colors;
|
|
1672
|
-
}
|
|
1673
1659
|
if (!publicApiKey) {
|
|
1674
1660
|
const cookieApiKey = getCookie("publicApiKey");
|
|
1675
1661
|
const cookieEnv = getCookie("environment");
|
|
1676
1662
|
const cookieAppName = getCookie("appName");
|
|
1677
1663
|
const cookieLoginActions = getCookie("loginActions");
|
|
1678
1664
|
const cookieLogo = getCookie("logo");
|
|
1679
|
-
const cookieColors = getCookie("colors");
|
|
1680
1665
|
if (cookieApiKey) {
|
|
1681
1666
|
publicApiKey = cookieApiKey;
|
|
1682
1667
|
configSource = "cookies";
|
|
@@ -1692,23 +1677,13 @@ function InnerSessionProvider({
|
|
|
1692
1677
|
loginActions = decodedActions.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1693
1678
|
}
|
|
1694
1679
|
if (cookieLogo) logo = decodeURIComponent(cookieLogo);
|
|
1695
|
-
if (cookieColors) {
|
|
1696
|
-
try {
|
|
1697
|
-
const decodedColors = decodeURIComponent(cookieColors);
|
|
1698
|
-
colors = JSON.parse(decodedColors);
|
|
1699
|
-
} catch (error) {
|
|
1700
|
-
console.error("Error parsing colors from cookie:", error);
|
|
1701
|
-
colors = {};
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
1680
|
}
|
|
1705
1681
|
return {
|
|
1706
1682
|
publicApiKey,
|
|
1707
1683
|
env,
|
|
1708
1684
|
appName,
|
|
1709
1685
|
loginActions,
|
|
1710
|
-
logo
|
|
1711
|
-
colors
|
|
1686
|
+
logo
|
|
1712
1687
|
};
|
|
1713
1688
|
}, [propConfig]);
|
|
1714
1689
|
const sessionData = (0, import_react7.useMemo)(() => {
|
|
@@ -3008,8 +2983,7 @@ var CrudifyLoginInternal = ({
|
|
|
3008
2983
|
component: "h1",
|
|
3009
2984
|
sx: {
|
|
3010
2985
|
textAlign: "center",
|
|
3011
|
-
mb: 2
|
|
3012
|
-
color: config.colors?.primaryColor || "#1066BA"
|
|
2986
|
+
mb: 2
|
|
3013
2987
|
},
|
|
3014
2988
|
children: config.appName
|
|
3015
2989
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -336,17 +336,8 @@ var LoginStateProvider = ({
|
|
|
336
336
|
cookieConfig.logo = decodedLogo;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const colorsCookie = getCookie("colors");
|
|
340
|
-
if (colorsCookie) {
|
|
341
|
-
const decodedColorsString = decodeURIComponent(colorsCookie);
|
|
342
|
-
const parsedColors = JSON.parse(decodedColorsString);
|
|
343
|
-
cookieConfig.colors = { primaryColor: "#1066BA", ...parsedColors };
|
|
344
|
-
} else {
|
|
345
|
-
cookieConfig.colors = { primaryColor: "#1066BA" };
|
|
346
|
-
}
|
|
347
339
|
} catch (e) {
|
|
348
340
|
console.error("Error reading configuration from cookies:", e);
|
|
349
|
-
cookieConfig.colors = { primaryColor: "#1066BA" };
|
|
350
341
|
}
|
|
351
342
|
}
|
|
352
343
|
return {
|
|
@@ -354,7 +345,6 @@ var LoginStateProvider = ({
|
|
|
354
345
|
env: providedConfig?.env,
|
|
355
346
|
appName: providedConfig?.appName,
|
|
356
347
|
logo: providedConfig?.logo || cookieConfig.logo,
|
|
357
|
-
colors: { ...cookieConfig.colors, ...providedConfig?.colors },
|
|
358
348
|
loginActions: providedConfig?.loginActions
|
|
359
349
|
};
|
|
360
350
|
};
|
|
@@ -1576,7 +1566,6 @@ function InnerSessionProvider({
|
|
|
1576
1566
|
let appName;
|
|
1577
1567
|
let loginActions;
|
|
1578
1568
|
let logo;
|
|
1579
|
-
let colors;
|
|
1580
1569
|
let configSource = "unknown";
|
|
1581
1570
|
if (propConfig?.publicApiKey) {
|
|
1582
1571
|
publicApiKey = propConfig.publicApiKey;
|
|
@@ -1594,16 +1583,12 @@ function InnerSessionProvider({
|
|
|
1594
1583
|
if (propConfig?.logo) {
|
|
1595
1584
|
logo = propConfig.logo;
|
|
1596
1585
|
}
|
|
1597
|
-
if (propConfig?.colors) {
|
|
1598
|
-
colors = propConfig.colors;
|
|
1599
|
-
}
|
|
1600
1586
|
if (!publicApiKey) {
|
|
1601
1587
|
const cookieApiKey = getCookie("publicApiKey");
|
|
1602
1588
|
const cookieEnv = getCookie("environment");
|
|
1603
1589
|
const cookieAppName = getCookie("appName");
|
|
1604
1590
|
const cookieLoginActions = getCookie("loginActions");
|
|
1605
1591
|
const cookieLogo = getCookie("logo");
|
|
1606
|
-
const cookieColors = getCookie("colors");
|
|
1607
1592
|
if (cookieApiKey) {
|
|
1608
1593
|
publicApiKey = cookieApiKey;
|
|
1609
1594
|
configSource = "cookies";
|
|
@@ -1619,23 +1604,13 @@ function InnerSessionProvider({
|
|
|
1619
1604
|
loginActions = decodedActions.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1620
1605
|
}
|
|
1621
1606
|
if (cookieLogo) logo = decodeURIComponent(cookieLogo);
|
|
1622
|
-
if (cookieColors) {
|
|
1623
|
-
try {
|
|
1624
|
-
const decodedColors = decodeURIComponent(cookieColors);
|
|
1625
|
-
colors = JSON.parse(decodedColors);
|
|
1626
|
-
} catch (error) {
|
|
1627
|
-
console.error("Error parsing colors from cookie:", error);
|
|
1628
|
-
colors = {};
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
1607
|
}
|
|
1632
1608
|
return {
|
|
1633
1609
|
publicApiKey,
|
|
1634
1610
|
env,
|
|
1635
1611
|
appName,
|
|
1636
1612
|
loginActions,
|
|
1637
|
-
logo
|
|
1638
|
-
colors
|
|
1613
|
+
logo
|
|
1639
1614
|
};
|
|
1640
1615
|
}, [propConfig]);
|
|
1641
1616
|
const sessionData = useMemo2(() => {
|
|
@@ -2935,8 +2910,7 @@ var CrudifyLoginInternal = ({
|
|
|
2935
2910
|
component: "h1",
|
|
2936
2911
|
sx: {
|
|
2937
2912
|
textAlign: "center",
|
|
2938
|
-
mb: 2
|
|
2939
|
-
color: config.colors?.primaryColor || "#1066BA"
|
|
2913
|
+
mb: 2
|
|
2940
2914
|
},
|
|
2941
2915
|
children: config.appName
|
|
2942
2916
|
}
|