@ttoss/layouts 0.4.35 → 0.4.37
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/esm/index.js +21 -211
- package/package.json +8 -8
package/dist/esm/index.js
CHANGED
|
@@ -16,10 +16,10 @@ var Footer = props => {
|
|
|
16
16
|
};
|
|
17
17
|
Footer.displayName = "Footer";
|
|
18
18
|
|
|
19
|
-
// ../../node_modules/.pnpm/@iconify-icon+react@2.
|
|
19
|
+
// ../../node_modules/.pnpm/@iconify-icon+react@2.3.0_react@19.1.1/node_modules/@iconify-icon/react/dist/iconify.mjs
|
|
20
20
|
import React from "react";
|
|
21
21
|
|
|
22
|
-
// ../../node_modules/.pnpm/iconify-icon@2.
|
|
22
|
+
// ../../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
23
23
|
var defaultIconDimensions = Object.freeze({
|
|
24
24
|
left: 0,
|
|
25
25
|
top: 0,
|
|
@@ -869,181 +869,6 @@ function sendAPIQuery(target, query, callback) {
|
|
|
869
869
|
}
|
|
870
870
|
return redundancy.query(query, send2, callback)().abort;
|
|
871
871
|
}
|
|
872
|
-
var browserCacheVersion = "iconify2";
|
|
873
|
-
var browserCachePrefix = "iconify";
|
|
874
|
-
var browserCacheCountKey = browserCachePrefix + "-count";
|
|
875
|
-
var browserCacheVersionKey = browserCachePrefix + "-version";
|
|
876
|
-
var browserStorageHour = 36e5;
|
|
877
|
-
var browserStorageCacheExpiration = 168;
|
|
878
|
-
var browserStorageLimit = 50;
|
|
879
|
-
function getStoredItem(func, key) {
|
|
880
|
-
try {
|
|
881
|
-
return func.getItem(key);
|
|
882
|
-
} catch (err) {}
|
|
883
|
-
}
|
|
884
|
-
function setStoredItem(func, key, value) {
|
|
885
|
-
try {
|
|
886
|
-
func.setItem(key, value);
|
|
887
|
-
return true;
|
|
888
|
-
} catch (err) {}
|
|
889
|
-
}
|
|
890
|
-
function removeStoredItem(func, key) {
|
|
891
|
-
try {
|
|
892
|
-
func.removeItem(key);
|
|
893
|
-
} catch (err) {}
|
|
894
|
-
}
|
|
895
|
-
function setBrowserStorageItemsCount(storage2, value) {
|
|
896
|
-
return setStoredItem(storage2, browserCacheCountKey, value.toString());
|
|
897
|
-
}
|
|
898
|
-
function getBrowserStorageItemsCount(storage2) {
|
|
899
|
-
return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
|
|
900
|
-
}
|
|
901
|
-
var browserStorageConfig = {
|
|
902
|
-
local: true,
|
|
903
|
-
session: true
|
|
904
|
-
};
|
|
905
|
-
var browserStorageEmptyItems = {
|
|
906
|
-
local: /* @__PURE__ */new Set(),
|
|
907
|
-
session: /* @__PURE__ */new Set()
|
|
908
|
-
};
|
|
909
|
-
var browserStorageStatus = false;
|
|
910
|
-
function setBrowserStorageStatus(status) {
|
|
911
|
-
browserStorageStatus = status;
|
|
912
|
-
}
|
|
913
|
-
var _window = typeof window === "undefined" ? {} : window;
|
|
914
|
-
function getBrowserStorage(key) {
|
|
915
|
-
const attr = key + "Storage";
|
|
916
|
-
try {
|
|
917
|
-
if (_window && _window[attr] && typeof _window[attr].length === "number") {
|
|
918
|
-
return _window[attr];
|
|
919
|
-
}
|
|
920
|
-
} catch (err) {}
|
|
921
|
-
browserStorageConfig[key] = false;
|
|
922
|
-
}
|
|
923
|
-
function iterateBrowserStorage(key, callback) {
|
|
924
|
-
const func = getBrowserStorage(key);
|
|
925
|
-
if (!func) {
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
const version = getStoredItem(func, browserCacheVersionKey);
|
|
929
|
-
if (version !== browserCacheVersion) {
|
|
930
|
-
if (version) {
|
|
931
|
-
const total2 = getBrowserStorageItemsCount(func);
|
|
932
|
-
for (let i = 0; i < total2; i++) {
|
|
933
|
-
removeStoredItem(func, browserCachePrefix + i.toString());
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
|
|
937
|
-
setBrowserStorageItemsCount(func, 0);
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
|
|
941
|
-
const parseItem = index => {
|
|
942
|
-
const name = browserCachePrefix + index.toString();
|
|
943
|
-
const item = getStoredItem(func, name);
|
|
944
|
-
if (typeof item !== "string") {
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
try {
|
|
948
|
-
const data = JSON.parse(item);
|
|
949
|
-
if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" &&
|
|
950
|
-
// Valid item: run callback
|
|
951
|
-
callback(data, index)) {
|
|
952
|
-
return true;
|
|
953
|
-
}
|
|
954
|
-
} catch (err) {}
|
|
955
|
-
removeStoredItem(func, name);
|
|
956
|
-
};
|
|
957
|
-
let total = getBrowserStorageItemsCount(func);
|
|
958
|
-
for (let i = total - 1; i >= 0; i--) {
|
|
959
|
-
if (!parseItem(i)) {
|
|
960
|
-
if (i === total - 1) {
|
|
961
|
-
total--;
|
|
962
|
-
setBrowserStorageItemsCount(func, total);
|
|
963
|
-
} else {
|
|
964
|
-
browserStorageEmptyItems[key].add(i);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
function initBrowserStorage() {
|
|
970
|
-
if (browserStorageStatus) {
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
setBrowserStorageStatus(true);
|
|
974
|
-
for (const key in browserStorageConfig) {
|
|
975
|
-
iterateBrowserStorage(key, item => {
|
|
976
|
-
const iconSet = item.data;
|
|
977
|
-
const provider = item.provider;
|
|
978
|
-
const prefix = iconSet.prefix;
|
|
979
|
-
const storage2 = getStorage(provider, prefix);
|
|
980
|
-
if (!addIconSet(storage2, iconSet).length) {
|
|
981
|
-
return false;
|
|
982
|
-
}
|
|
983
|
-
const lastModified = iconSet.lastModified || -1;
|
|
984
|
-
storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
|
|
985
|
-
return true;
|
|
986
|
-
});
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
function updateLastModified(storage2, lastModified) {
|
|
990
|
-
const lastValue = storage2.lastModifiedCached;
|
|
991
|
-
if (
|
|
992
|
-
// Matches or newer
|
|
993
|
-
lastValue && lastValue >= lastModified) {
|
|
994
|
-
return lastValue === lastModified;
|
|
995
|
-
}
|
|
996
|
-
storage2.lastModifiedCached = lastModified;
|
|
997
|
-
if (lastValue) {
|
|
998
|
-
for (const key in browserStorageConfig) {
|
|
999
|
-
iterateBrowserStorage(key, item => {
|
|
1000
|
-
const iconSet = item.data;
|
|
1001
|
-
return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
|
|
1002
|
-
});
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
return true;
|
|
1006
|
-
}
|
|
1007
|
-
function storeInBrowserStorage(storage2, data) {
|
|
1008
|
-
if (!browserStorageStatus) {
|
|
1009
|
-
initBrowserStorage();
|
|
1010
|
-
}
|
|
1011
|
-
function store(key) {
|
|
1012
|
-
let func;
|
|
1013
|
-
if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
|
|
1014
|
-
return;
|
|
1015
|
-
}
|
|
1016
|
-
const set = browserStorageEmptyItems[key];
|
|
1017
|
-
let index;
|
|
1018
|
-
if (set.size) {
|
|
1019
|
-
set.delete(index = Array.from(set).shift());
|
|
1020
|
-
} else {
|
|
1021
|
-
index = getBrowserStorageItemsCount(func);
|
|
1022
|
-
if (index >= browserStorageLimit || !setBrowserStorageItemsCount(func, index + 1)) {
|
|
1023
|
-
return;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
const item = {
|
|
1027
|
-
cached: Math.floor(Date.now() / browserStorageHour),
|
|
1028
|
-
provider: storage2.provider,
|
|
1029
|
-
data
|
|
1030
|
-
};
|
|
1031
|
-
return setStoredItem(func, browserCachePrefix + index.toString(), JSON.stringify(item));
|
|
1032
|
-
}
|
|
1033
|
-
if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
|
|
1034
|
-
return;
|
|
1035
|
-
}
|
|
1036
|
-
if (!Object.keys(data.icons).length) {
|
|
1037
|
-
return;
|
|
1038
|
-
}
|
|
1039
|
-
if (data.not_found) {
|
|
1040
|
-
data = Object.assign({}, data);
|
|
1041
|
-
delete data.not_found;
|
|
1042
|
-
}
|
|
1043
|
-
if (!store("local")) {
|
|
1044
|
-
store("session");
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
872
|
function emptyCallback() {}
|
|
1048
873
|
function loadedNewIcons(storage2) {
|
|
1049
874
|
if (!storage2.iconsLoaderFlag) {
|
|
@@ -1065,7 +890,7 @@ function checkIconNamesForAPI(icons) {
|
|
|
1065
890
|
invalid
|
|
1066
891
|
};
|
|
1067
892
|
}
|
|
1068
|
-
function parseLoaderResponse(storage2, icons, data
|
|
893
|
+
function parseLoaderResponse(storage2, icons, data) {
|
|
1069
894
|
function checkMissing() {
|
|
1070
895
|
const pending = storage2.pendingIcons;
|
|
1071
896
|
icons.forEach(name => {
|
|
@@ -1084,9 +909,6 @@ function parseLoaderResponse(storage2, icons, data, isAPIResponse) {
|
|
|
1084
909
|
checkMissing();
|
|
1085
910
|
return;
|
|
1086
911
|
}
|
|
1087
|
-
if (isAPIResponse) {
|
|
1088
|
-
storeInBrowserStorage(storage2, data);
|
|
1089
|
-
}
|
|
1090
912
|
} catch (err) {
|
|
1091
913
|
console.error(err);
|
|
1092
914
|
}
|
|
@@ -1127,7 +949,7 @@ function loadNewIcons(storage2, icons) {
|
|
|
1127
949
|
const customIconLoader = storage2.loadIcon;
|
|
1128
950
|
if (storage2.loadIcons && (icons2.length > 1 || !customIconLoader)) {
|
|
1129
951
|
parsePossiblyAsyncResponse(storage2.loadIcons(icons2, prefix, provider), data => {
|
|
1130
|
-
parseLoaderResponse(storage2, icons2, data
|
|
952
|
+
parseLoaderResponse(storage2, icons2, data);
|
|
1131
953
|
});
|
|
1132
954
|
return;
|
|
1133
955
|
}
|
|
@@ -1141,7 +963,7 @@ function loadNewIcons(storage2, icons) {
|
|
|
1141
963
|
[name]: data
|
|
1142
964
|
}
|
|
1143
965
|
} : null;
|
|
1144
|
-
parseLoaderResponse(storage2, [name], iconSet
|
|
966
|
+
parseLoaderResponse(storage2, [name], iconSet);
|
|
1145
967
|
});
|
|
1146
968
|
});
|
|
1147
969
|
return;
|
|
@@ -1151,20 +973,20 @@ function loadNewIcons(storage2, icons) {
|
|
|
1151
973
|
invalid
|
|
1152
974
|
} = checkIconNamesForAPI(icons2);
|
|
1153
975
|
if (invalid.length) {
|
|
1154
|
-
parseLoaderResponse(storage2, invalid, null
|
|
976
|
+
parseLoaderResponse(storage2, invalid, null);
|
|
1155
977
|
}
|
|
1156
978
|
if (!valid.length) {
|
|
1157
979
|
return;
|
|
1158
980
|
}
|
|
1159
981
|
const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
|
|
1160
982
|
if (!api) {
|
|
1161
|
-
parseLoaderResponse(storage2, valid, null
|
|
983
|
+
parseLoaderResponse(storage2, valid, null);
|
|
1162
984
|
return;
|
|
1163
985
|
}
|
|
1164
986
|
const params = api.prepare(provider, prefix, valid);
|
|
1165
987
|
params.forEach(item => {
|
|
1166
988
|
sendAPIQuery(provider, item, data => {
|
|
1167
|
-
parseLoaderResponse(storage2, item.icons, data
|
|
989
|
+
parseLoaderResponse(storage2, item.icons, data);
|
|
1168
990
|
});
|
|
1169
991
|
});
|
|
1170
992
|
});
|
|
@@ -1641,19 +1463,6 @@ function setCustomIconsLoader$1(loader, prefix, provider) {
|
|
|
1641
1463
|
function setCustomIconLoader$1(loader, prefix, provider) {
|
|
1642
1464
|
getStorage(provider || "", prefix).loadIcon = loader;
|
|
1643
1465
|
}
|
|
1644
|
-
function toggleBrowserCache(storage2, value) {
|
|
1645
|
-
switch (storage2) {
|
|
1646
|
-
case "local":
|
|
1647
|
-
case "session":
|
|
1648
|
-
browserStorageConfig[storage2] = value;
|
|
1649
|
-
break;
|
|
1650
|
-
case "all":
|
|
1651
|
-
for (const key in browserStorageConfig) {
|
|
1652
|
-
browserStorageConfig[key] = value;
|
|
1653
|
-
}
|
|
1654
|
-
break;
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
1466
|
var nodeAttr = "data-style";
|
|
1658
1467
|
var customStyle = "";
|
|
1659
1468
|
function appendCustomStyle(style) {
|
|
@@ -1671,14 +1480,13 @@ function updateStyle(parent, inline) {
|
|
|
1671
1480
|
function exportFunctions() {
|
|
1672
1481
|
setAPIModule("", fetchAPIModule);
|
|
1673
1482
|
allowSimpleNames(true);
|
|
1674
|
-
let
|
|
1483
|
+
let _window;
|
|
1675
1484
|
try {
|
|
1676
|
-
|
|
1485
|
+
_window = window;
|
|
1677
1486
|
} catch (err) {}
|
|
1678
|
-
if (
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
const preload = _window2.IconifyPreload;
|
|
1487
|
+
if (_window) {
|
|
1488
|
+
if (_window.IconifyPreload !== void 0) {
|
|
1489
|
+
const preload = _window.IconifyPreload;
|
|
1682
1490
|
const err = "Invalid IconifyPreload syntax.";
|
|
1683
1491
|
if (typeof preload === "object" && preload !== null) {
|
|
1684
1492
|
(preload instanceof Array ? preload : [preload]).forEach(item => {
|
|
@@ -1698,8 +1506,8 @@ function exportFunctions() {
|
|
|
1698
1506
|
});
|
|
1699
1507
|
}
|
|
1700
1508
|
}
|
|
1701
|
-
if (
|
|
1702
|
-
const providers =
|
|
1509
|
+
if (_window.IconifyProviders !== void 0) {
|
|
1510
|
+
const providers = _window.IconifyProviders;
|
|
1703
1511
|
if (typeof providers === "object" && providers !== null) {
|
|
1704
1512
|
for (const key in providers) {
|
|
1705
1513
|
const err = "IconifyProviders[" + key + "] is invalid.";
|
|
@@ -1727,8 +1535,10 @@ function exportFunctions() {
|
|
|
1727
1535
|
listAPIProviders
|
|
1728
1536
|
};
|
|
1729
1537
|
return {
|
|
1730
|
-
|
|
1731
|
-
|
|
1538
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1539
|
+
enableCache: storage2 => {},
|
|
1540
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1541
|
+
disableCache: storage2 => {},
|
|
1732
1542
|
iconLoaded: iconLoaded$1,
|
|
1733
1543
|
iconExists: iconLoaded$1,
|
|
1734
1544
|
// deprecated, kept to avoid breaking changes
|
|
@@ -2242,7 +2052,7 @@ var {
|
|
|
2242
2052
|
_api
|
|
2243
2053
|
} = IconifyIconComponent;
|
|
2244
2054
|
|
|
2245
|
-
// ../../node_modules/.pnpm/@iconify-icon+react@2.
|
|
2055
|
+
// ../../node_modules/.pnpm/@iconify-icon+react@2.3.0_react@19.1.1/node_modules/@iconify-icon/react/dist/iconify.mjs
|
|
2246
2056
|
var Icon = React.forwardRef((props, ref) => {
|
|
2247
2057
|
const newProps = {
|
|
2248
2058
|
...props,
|
|
@@ -2674,6 +2484,6 @@ iconify-icon/dist/iconify-icon.mjs:
|
|
|
2674
2484
|
* Licensed under MIT.
|
|
2675
2485
|
*
|
|
2676
2486
|
* @license MIT
|
|
2677
|
-
* @version 2.
|
|
2487
|
+
* @version 2.3.0
|
|
2678
2488
|
*)
|
|
2679
2489
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/layouts",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "Layout components for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": ">=16.8.0",
|
|
28
|
-
"@ttoss/
|
|
29
|
-
"@ttoss/
|
|
28
|
+
"@ttoss/components": "^2.2.26",
|
|
29
|
+
"@ttoss/ui": "^5.9.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/jest": "^30.0.0",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"jest": "^30.0.4",
|
|
35
35
|
"react": "^19.1.0",
|
|
36
36
|
"tsup": "^8.5.0",
|
|
37
|
-
"@ttoss/
|
|
38
|
-
"@ttoss/ui": "^5.9.
|
|
39
|
-
"@ttoss/
|
|
40
|
-
"@ttoss/
|
|
41
|
-
"@ttoss/react-icons": "^0.4.
|
|
37
|
+
"@ttoss/config": "^1.35.6",
|
|
38
|
+
"@ttoss/ui": "^5.9.2",
|
|
39
|
+
"@ttoss/components": "^2.2.26",
|
|
40
|
+
"@ttoss/test-utils": "^2.1.26",
|
|
41
|
+
"@ttoss/react-icons": "^0.4.15"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"React"
|