@nocios/crudify-ui 3.0.1 → 3.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.js +13 -32
- package/dist/index.mjs +13 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1546,47 +1546,28 @@ var import_crudify_browser2 = __toESM(require("@nocios/crudify-browser"));
|
|
|
1546
1546
|
var useCrudifyLogin = (config, _options = {}) => {
|
|
1547
1547
|
console.log("\u{1F50D} useCrudifyLogin - Input config:", config);
|
|
1548
1548
|
const finalConfig = (0, import_react9.useMemo)(() => {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
}
|
|
1560
|
-
if (!crudifyConfig && import_crudify_browser2.default && import_crudify_browser2.default.env) {
|
|
1561
|
-
crudifyConfig = {
|
|
1562
|
-
env: import_crudify_browser2.default.env,
|
|
1563
|
-
publicApiKey: import_crudify_browser2.default.publicApiKey || import_crudify_browser2.default.apiKey
|
|
1564
|
-
};
|
|
1549
|
+
const publicApiKey = config.publicApiKey || import_crudify_browser2.default?.publicApiKey || import_crudify_browser2.default?.apiKey || getCookie("publicApiKey") || null;
|
|
1550
|
+
const rawEnv = config.env || getCookie("environment") || "prod";
|
|
1551
|
+
const env = ["dev", "stg", "prod"].includes(rawEnv) ? rawEnv : "prod";
|
|
1552
|
+
const appName = config.appName || getCookie("appName") || "Crudia";
|
|
1553
|
+
const loginActions = config.loginActions || (() => {
|
|
1554
|
+
try {
|
|
1555
|
+
const cookieValue = getCookie("loginActions");
|
|
1556
|
+
return cookieValue ? cookieValue.split(",").map((action) => action.trim()).filter(Boolean) : [];
|
|
1557
|
+
} catch {
|
|
1558
|
+
return [];
|
|
1565
1559
|
}
|
|
1566
|
-
}
|
|
1567
|
-
console.log("\u{1F50D} useCrudifyLogin - No crudify instance config available:", error);
|
|
1568
|
-
}
|
|
1569
|
-
const publicApiKey = config.publicApiKey || crudifyConfig?.publicApiKey || getCookie("publicApiKey") || null;
|
|
1560
|
+
})();
|
|
1570
1561
|
console.log("\u{1F50D} useCrudifyLogin - Resolved publicApiKey:", publicApiKey);
|
|
1571
1562
|
console.log(
|
|
1572
1563
|
"\u{1F50D} useCrudifyLogin - Sources - props:",
|
|
1573
1564
|
config.publicApiKey,
|
|
1574
1565
|
"crudify:",
|
|
1575
|
-
|
|
1566
|
+
import_crudify_browser2.default?.publicApiKey,
|
|
1576
1567
|
"cookie:",
|
|
1577
1568
|
getCookie("publicApiKey")
|
|
1578
1569
|
);
|
|
1579
|
-
|
|
1580
|
-
const env = ["dev", "stg", "prod"].includes(rawEnv) ? rawEnv : "prod";
|
|
1581
|
-
const appName = config.appName || crudifyConfig?.appName || getCookie("appName") || "Crudia";
|
|
1582
|
-
const loginActions = config.loginActions || crudifyConfig?.loginActions || (() => {
|
|
1583
|
-
try {
|
|
1584
|
-
const cookieValue = getCookie("loginActions");
|
|
1585
|
-
return cookieValue ? cookieValue.split(",").map((action) => action.trim()).filter(Boolean) : [];
|
|
1586
|
-
} catch {
|
|
1587
|
-
return [];
|
|
1588
|
-
}
|
|
1589
|
-
})();
|
|
1570
|
+
console.log("\u{1F50D} useCrudifyLogin - Final env:", env, "from rawEnv:", rawEnv);
|
|
1590
1571
|
const finalResult = {
|
|
1591
1572
|
publicApiKey,
|
|
1592
1573
|
env,
|
package/dist/index.mjs
CHANGED
|
@@ -1480,47 +1480,28 @@ import crudify2 from "@nocios/crudify-browser";
|
|
|
1480
1480
|
var useCrudifyLogin = (config, _options = {}) => {
|
|
1481
1481
|
console.log("\u{1F50D} useCrudifyLogin - Input config:", config);
|
|
1482
1482
|
const finalConfig = useMemo2(() => {
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
}
|
|
1494
|
-
if (!crudifyConfig && crudify2 && crudify2.env) {
|
|
1495
|
-
crudifyConfig = {
|
|
1496
|
-
env: crudify2.env,
|
|
1497
|
-
publicApiKey: crudify2.publicApiKey || crudify2.apiKey
|
|
1498
|
-
};
|
|
1483
|
+
const publicApiKey = config.publicApiKey || crudify2?.publicApiKey || crudify2?.apiKey || getCookie("publicApiKey") || null;
|
|
1484
|
+
const rawEnv = config.env || getCookie("environment") || "prod";
|
|
1485
|
+
const env = ["dev", "stg", "prod"].includes(rawEnv) ? rawEnv : "prod";
|
|
1486
|
+
const appName = config.appName || getCookie("appName") || "Crudia";
|
|
1487
|
+
const loginActions = config.loginActions || (() => {
|
|
1488
|
+
try {
|
|
1489
|
+
const cookieValue = getCookie("loginActions");
|
|
1490
|
+
return cookieValue ? cookieValue.split(",").map((action) => action.trim()).filter(Boolean) : [];
|
|
1491
|
+
} catch {
|
|
1492
|
+
return [];
|
|
1499
1493
|
}
|
|
1500
|
-
}
|
|
1501
|
-
console.log("\u{1F50D} useCrudifyLogin - No crudify instance config available:", error);
|
|
1502
|
-
}
|
|
1503
|
-
const publicApiKey = config.publicApiKey || crudifyConfig?.publicApiKey || getCookie("publicApiKey") || null;
|
|
1494
|
+
})();
|
|
1504
1495
|
console.log("\u{1F50D} useCrudifyLogin - Resolved publicApiKey:", publicApiKey);
|
|
1505
1496
|
console.log(
|
|
1506
1497
|
"\u{1F50D} useCrudifyLogin - Sources - props:",
|
|
1507
1498
|
config.publicApiKey,
|
|
1508
1499
|
"crudify:",
|
|
1509
|
-
|
|
1500
|
+
crudify2?.publicApiKey,
|
|
1510
1501
|
"cookie:",
|
|
1511
1502
|
getCookie("publicApiKey")
|
|
1512
1503
|
);
|
|
1513
|
-
|
|
1514
|
-
const env = ["dev", "stg", "prod"].includes(rawEnv) ? rawEnv : "prod";
|
|
1515
|
-
const appName = config.appName || crudifyConfig?.appName || getCookie("appName") || "Crudia";
|
|
1516
|
-
const loginActions = config.loginActions || crudifyConfig?.loginActions || (() => {
|
|
1517
|
-
try {
|
|
1518
|
-
const cookieValue = getCookie("loginActions");
|
|
1519
|
-
return cookieValue ? cookieValue.split(",").map((action) => action.trim()).filter(Boolean) : [];
|
|
1520
|
-
} catch {
|
|
1521
|
-
return [];
|
|
1522
|
-
}
|
|
1523
|
-
})();
|
|
1504
|
+
console.log("\u{1F50D} useCrudifyLogin - Final env:", env, "from rawEnv:", rawEnv);
|
|
1524
1505
|
const finalResult = {
|
|
1525
1506
|
publicApiKey,
|
|
1526
1507
|
env,
|