@pol-studios/ui 1.0.1 → 1.0.7
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/README.md +2 -2
- package/dist/components/index.js +635 -530
- package/package.json +9 -9
package/dist/components/index.js
CHANGED
|
@@ -24705,16 +24705,16 @@ var init_dist = __esm({
|
|
|
24705
24705
|
var require_use_sync_external_store_with_selector_production = __commonJS({
|
|
24706
24706
|
"../../../node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js"(exports2) {
|
|
24707
24707
|
"use strict";
|
|
24708
|
-
var
|
|
24708
|
+
var React185 = __require("react");
|
|
24709
24709
|
function is2(x10, y14) {
|
|
24710
24710
|
return x10 === y14 && (0 !== x10 || 1 / x10 === 1 / y14) || x10 !== x10 && y14 !== y14;
|
|
24711
24711
|
}
|
|
24712
24712
|
var objectIs = "function" === typeof Object.is ? Object.is : is2;
|
|
24713
|
-
var useSyncExternalStore3 =
|
|
24714
|
-
var useRef62 =
|
|
24715
|
-
var
|
|
24716
|
-
var useMemo103 =
|
|
24717
|
-
var useDebugValue =
|
|
24713
|
+
var useSyncExternalStore3 = React185.useSyncExternalStore;
|
|
24714
|
+
var useRef62 = React185.useRef;
|
|
24715
|
+
var useEffect93 = React185.useEffect;
|
|
24716
|
+
var useMemo103 = React185.useMemo;
|
|
24717
|
+
var useDebugValue = React185.useDebugValue;
|
|
24718
24718
|
exports2.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot2, getServerSnapshot2, selector, isEqual9) {
|
|
24719
24719
|
var instRef = useRef62(null);
|
|
24720
24720
|
if (null === instRef.current) {
|
|
@@ -24756,7 +24756,7 @@ var require_use_sync_external_store_with_selector_production = __commonJS({
|
|
|
24756
24756
|
[getSnapshot2, getServerSnapshot2, selector, isEqual9]
|
|
24757
24757
|
);
|
|
24758
24758
|
var value = useSyncExternalStore3(subscribe2, instRef[0], instRef[1]);
|
|
24759
|
-
|
|
24759
|
+
useEffect93(
|
|
24760
24760
|
function() {
|
|
24761
24761
|
inst.hasValue = true;
|
|
24762
24762
|
inst.value = value;
|
|
@@ -24778,7 +24778,7 @@ var require_use_sync_external_store_with_selector_development = __commonJS({
|
|
|
24778
24778
|
return x10 === y14 && (0 !== x10 || 1 / x10 === 1 / y14) || x10 !== x10 && y14 !== y14;
|
|
24779
24779
|
}
|
|
24780
24780
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
24781
|
-
var
|
|
24781
|
+
var React185 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is2, useSyncExternalStore3 = React185.useSyncExternalStore, useRef62 = React185.useRef, useEffect93 = React185.useEffect, useMemo103 = React185.useMemo, useDebugValue = React185.useDebugValue;
|
|
24782
24782
|
exports2.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot2, getServerSnapshot2, selector, isEqual9) {
|
|
24783
24783
|
var instRef = useRef62(null);
|
|
24784
24784
|
if (null === instRef.current) {
|
|
@@ -24821,7 +24821,7 @@ var require_use_sync_external_store_with_selector_development = __commonJS({
|
|
|
24821
24821
|
[getSnapshot2, getServerSnapshot2, selector, isEqual9]
|
|
24822
24822
|
);
|
|
24823
24823
|
var value = useSyncExternalStore3(subscribe2, instRef[0], instRef[1]);
|
|
24824
|
-
|
|
24824
|
+
useEffect93(
|
|
24825
24825
|
function() {
|
|
24826
24826
|
inst.hasValue = true;
|
|
24827
24827
|
inst.value = value;
|
|
@@ -30628,8 +30628,8 @@ var LucideIconLoader = React13.forwardRef(
|
|
|
30628
30628
|
modulePromise.then((x10) => setIsLoaded(true));
|
|
30629
30629
|
if (isLoaded === false) return;
|
|
30630
30630
|
if (name2 in module2) {
|
|
30631
|
-
const
|
|
30632
|
-
setIconComponent(() =>
|
|
30631
|
+
const Icon5 = module2[name2];
|
|
30632
|
+
setIconComponent(() => Icon5);
|
|
30633
30633
|
} else {
|
|
30634
30634
|
setIconComponent(() => module2["CircleAlert"]);
|
|
30635
30635
|
}
|
|
@@ -43792,8 +43792,8 @@ var LucideIconLoader2 = React41.forwardRef(
|
|
|
43792
43792
|
modulePromise2.then((x10) => setIsLoaded(true));
|
|
43793
43793
|
if (isLoaded === false) return;
|
|
43794
43794
|
if (name2 in module3) {
|
|
43795
|
-
const
|
|
43796
|
-
setIconComponent(() =>
|
|
43795
|
+
const Icon5 = module3[name2];
|
|
43796
|
+
setIconComponent(() => Icon5);
|
|
43797
43797
|
} else {
|
|
43798
43798
|
setIconComponent(() => module3["CircleAlert"]);
|
|
43799
43799
|
}
|
|
@@ -103474,7 +103474,7 @@ var AccessibilityManager = /* @__PURE__ */ (function() {
|
|
|
103474
103474
|
}, {
|
|
103475
103475
|
key: "spoofMouse",
|
|
103476
103476
|
value: function spoofMouse() {
|
|
103477
|
-
var
|
|
103477
|
+
var _window2, _window22;
|
|
103478
103478
|
if (this.layout !== "horizontal") {
|
|
103479
103479
|
return;
|
|
103480
103480
|
}
|
|
@@ -103483,8 +103483,8 @@ var AccessibilityManager = /* @__PURE__ */ (function() {
|
|
|
103483
103483
|
}
|
|
103484
103484
|
var _this$container$getBo = this.container.getBoundingClientRect(), x10 = _this$container$getBo.x, y14 = _this$container$getBo.y, height = _this$container$getBo.height;
|
|
103485
103485
|
var coordinate = this.coordinateList[this.activeIndex].coordinate;
|
|
103486
|
-
var scrollOffsetX = ((
|
|
103487
|
-
var scrollOffsetY = ((
|
|
103486
|
+
var scrollOffsetX = ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.scrollX) || 0;
|
|
103487
|
+
var scrollOffsetY = ((_window22 = window) === null || _window22 === void 0 ? void 0 : _window22.scrollY) || 0;
|
|
103488
103488
|
var pageX = x10 + coordinate + scrollOffsetX;
|
|
103489
103489
|
var pageY = y14 + this.offset.top + height / 2 + scrollOffsetY;
|
|
103490
103490
|
this.mouseHandlerCallback({
|
|
@@ -118147,11 +118147,11 @@ var useTheme = () => {
|
|
|
118147
118147
|
var ThemeProvider_default = ThemeProvider2;
|
|
118148
118148
|
|
|
118149
118149
|
// src/components/FilterBuilder/FilterBuilder.tsx
|
|
118150
|
-
import
|
|
118150
|
+
import React155, {
|
|
118151
118151
|
useCallback as useCallback51,
|
|
118152
|
-
useEffect as
|
|
118152
|
+
useEffect as useEffect71,
|
|
118153
118153
|
useMemo as useMemo82,
|
|
118154
|
-
useState as
|
|
118154
|
+
useState as useState81
|
|
118155
118155
|
} from "react";
|
|
118156
118156
|
import { motion as motion27, AnimatePresence as AnimatePresence24 } from "framer-motion";
|
|
118157
118157
|
import {
|
|
@@ -120554,8 +120554,57 @@ var Slider = React150.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
120554
120554
|
));
|
|
120555
120555
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
120556
120556
|
|
|
120557
|
-
// ../../../node_modules/.pnpm/@iconify+react@
|
|
120558
|
-
import
|
|
120557
|
+
// ../../../node_modules/.pnpm/@iconify+react@4.1.1_react@19.1.1/node_modules/@iconify/react/dist/iconify.mjs
|
|
120558
|
+
import React151 from "react";
|
|
120559
|
+
var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
120560
|
+
var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
120561
|
+
const colonSeparated = value.split(":");
|
|
120562
|
+
if (value.slice(0, 1) === "@") {
|
|
120563
|
+
if (colonSeparated.length < 2 || colonSeparated.length > 3) {
|
|
120564
|
+
return null;
|
|
120565
|
+
}
|
|
120566
|
+
provider = colonSeparated.shift().slice(1);
|
|
120567
|
+
}
|
|
120568
|
+
if (colonSeparated.length > 3 || !colonSeparated.length) {
|
|
120569
|
+
return null;
|
|
120570
|
+
}
|
|
120571
|
+
if (colonSeparated.length > 1) {
|
|
120572
|
+
const name22 = colonSeparated.pop();
|
|
120573
|
+
const prefix2 = colonSeparated.pop();
|
|
120574
|
+
const result = {
|
|
120575
|
+
// Allow provider without '@': "provider:prefix:name"
|
|
120576
|
+
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
|
|
120577
|
+
prefix: prefix2,
|
|
120578
|
+
name: name22
|
|
120579
|
+
};
|
|
120580
|
+
return validate && !validateIconName(result) ? null : result;
|
|
120581
|
+
}
|
|
120582
|
+
const name2 = colonSeparated[0];
|
|
120583
|
+
const dashSeparated = name2.split("-");
|
|
120584
|
+
if (dashSeparated.length > 1) {
|
|
120585
|
+
const result = {
|
|
120586
|
+
provider,
|
|
120587
|
+
prefix: dashSeparated.shift(),
|
|
120588
|
+
name: dashSeparated.join("-")
|
|
120589
|
+
};
|
|
120590
|
+
return validate && !validateIconName(result) ? null : result;
|
|
120591
|
+
}
|
|
120592
|
+
if (allowSimpleName && provider === "") {
|
|
120593
|
+
const result = {
|
|
120594
|
+
provider,
|
|
120595
|
+
prefix: "",
|
|
120596
|
+
name: name2
|
|
120597
|
+
};
|
|
120598
|
+
return validate && !validateIconName(result, allowSimpleName) ? null : result;
|
|
120599
|
+
}
|
|
120600
|
+
return null;
|
|
120601
|
+
};
|
|
120602
|
+
var validateIconName = (icon, allowSimpleName) => {
|
|
120603
|
+
if (!icon) {
|
|
120604
|
+
return false;
|
|
120605
|
+
}
|
|
120606
|
+
return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
|
|
120607
|
+
};
|
|
120559
120608
|
var defaultIconDimensions = Object.freeze(
|
|
120560
120609
|
{
|
|
120561
120610
|
left: 0,
|
|
@@ -120625,7 +120674,7 @@ function getIconsTree(data, names) {
|
|
|
120625
120674
|
}
|
|
120626
120675
|
return resolved[name2];
|
|
120627
120676
|
}
|
|
120628
|
-
Object.keys(icons).concat(Object.keys(aliases)).forEach(resolve);
|
|
120677
|
+
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
|
|
120629
120678
|
return resolved;
|
|
120630
120679
|
}
|
|
120631
120680
|
function internalGetIconData(data, name2, tree) {
|
|
@@ -120691,15 +120740,10 @@ function quicklyValidateIconSet(obj) {
|
|
|
120691
120740
|
const icons = data.icons;
|
|
120692
120741
|
for (const name2 in icons) {
|
|
120693
120742
|
const icon = icons[name2];
|
|
120694
|
-
if (
|
|
120695
|
-
|
|
120696
|
-
|
|
120697
|
-
|
|
120698
|
-
!checkOptionalProps(
|
|
120699
|
-
icon,
|
|
120700
|
-
defaultExtendedIconProps
|
|
120701
|
-
)
|
|
120702
|
-
) {
|
|
120743
|
+
if (!name2.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
|
|
120744
|
+
icon,
|
|
120745
|
+
defaultExtendedIconProps
|
|
120746
|
+
)) {
|
|
120703
120747
|
return null;
|
|
120704
120748
|
}
|
|
120705
120749
|
}
|
|
@@ -120707,71 +120751,15 @@ function quicklyValidateIconSet(obj) {
|
|
|
120707
120751
|
for (const name2 in aliases) {
|
|
120708
120752
|
const icon = aliases[name2];
|
|
120709
120753
|
const parent = icon.parent;
|
|
120710
|
-
if (
|
|
120711
|
-
|
|
120712
|
-
|
|
120713
|
-
|
|
120714
|
-
!checkOptionalProps(
|
|
120715
|
-
icon,
|
|
120716
|
-
defaultExtendedIconProps
|
|
120717
|
-
)
|
|
120718
|
-
) {
|
|
120754
|
+
if (!name2.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
|
|
120755
|
+
icon,
|
|
120756
|
+
defaultExtendedIconProps
|
|
120757
|
+
)) {
|
|
120719
120758
|
return null;
|
|
120720
120759
|
}
|
|
120721
120760
|
}
|
|
120722
120761
|
return data;
|
|
120723
120762
|
}
|
|
120724
|
-
var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
120725
|
-
var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
120726
|
-
const colonSeparated = value.split(":");
|
|
120727
|
-
if (value.slice(0, 1) === "@") {
|
|
120728
|
-
if (colonSeparated.length < 2 || colonSeparated.length > 3) {
|
|
120729
|
-
return null;
|
|
120730
|
-
}
|
|
120731
|
-
provider = colonSeparated.shift().slice(1);
|
|
120732
|
-
}
|
|
120733
|
-
if (colonSeparated.length > 3 || !colonSeparated.length) {
|
|
120734
|
-
return null;
|
|
120735
|
-
}
|
|
120736
|
-
if (colonSeparated.length > 1) {
|
|
120737
|
-
const name22 = colonSeparated.pop();
|
|
120738
|
-
const prefix2 = colonSeparated.pop();
|
|
120739
|
-
const result = {
|
|
120740
|
-
// Allow provider without '@': "provider:prefix:name"
|
|
120741
|
-
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
|
|
120742
|
-
prefix: prefix2,
|
|
120743
|
-
name: name22
|
|
120744
|
-
};
|
|
120745
|
-
return validate && !validateIconName(result) ? null : result;
|
|
120746
|
-
}
|
|
120747
|
-
const name2 = colonSeparated[0];
|
|
120748
|
-
const dashSeparated = name2.split("-");
|
|
120749
|
-
if (dashSeparated.length > 1) {
|
|
120750
|
-
const result = {
|
|
120751
|
-
provider,
|
|
120752
|
-
prefix: dashSeparated.shift(),
|
|
120753
|
-
name: dashSeparated.join("-")
|
|
120754
|
-
};
|
|
120755
|
-
return validate && !validateIconName(result) ? null : result;
|
|
120756
|
-
}
|
|
120757
|
-
if (allowSimpleName && provider === "") {
|
|
120758
|
-
const result = {
|
|
120759
|
-
provider,
|
|
120760
|
-
prefix: "",
|
|
120761
|
-
name: name2
|
|
120762
|
-
};
|
|
120763
|
-
return validate && !validateIconName(result, allowSimpleName) ? null : result;
|
|
120764
|
-
}
|
|
120765
|
-
return null;
|
|
120766
|
-
};
|
|
120767
|
-
var validateIconName = (icon, allowSimpleName) => {
|
|
120768
|
-
if (!icon) {
|
|
120769
|
-
return false;
|
|
120770
|
-
}
|
|
120771
|
-
return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
|
|
120772
|
-
// Check name: cannot be empty
|
|
120773
|
-
((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
|
|
120774
|
-
};
|
|
120775
120763
|
var dataStorage = /* @__PURE__ */ Object.create(null);
|
|
120776
120764
|
function newStorage(provider, prefix2) {
|
|
120777
120765
|
return {
|
|
@@ -120828,12 +120816,7 @@ function addIcon(name2, data) {
|
|
|
120828
120816
|
return false;
|
|
120829
120817
|
}
|
|
120830
120818
|
const storage2 = getStorage(icon.provider, icon.prefix);
|
|
120831
|
-
|
|
120832
|
-
return addIconToStorage(storage2, icon.name, data);
|
|
120833
|
-
} else {
|
|
120834
|
-
storage2.missing.add(icon.name);
|
|
120835
|
-
return true;
|
|
120836
|
-
}
|
|
120819
|
+
return addIconToStorage(storage2, icon.name, data);
|
|
120837
120820
|
}
|
|
120838
120821
|
function addCollection(data, provider) {
|
|
120839
120822
|
if (typeof data !== "object") {
|
|
@@ -120847,7 +120830,7 @@ function addCollection(data, provider) {
|
|
|
120847
120830
|
if (quicklyValidateIconSet(data)) {
|
|
120848
120831
|
data.prefix = "";
|
|
120849
120832
|
parseIconSet(data, (name2, icon) => {
|
|
120850
|
-
if (addIcon(name2, icon)) {
|
|
120833
|
+
if (icon && addIcon(name2, icon)) {
|
|
120851
120834
|
added = true;
|
|
120852
120835
|
}
|
|
120853
120836
|
});
|
|
@@ -120856,6 +120839,7 @@ function addCollection(data, provider) {
|
|
|
120856
120839
|
}
|
|
120857
120840
|
const prefix2 = data.prefix;
|
|
120858
120841
|
if (!validateIconName({
|
|
120842
|
+
provider,
|
|
120859
120843
|
prefix: prefix2,
|
|
120860
120844
|
name: "a"
|
|
120861
120845
|
})) {
|
|
@@ -120912,34 +120896,6 @@ function calculateSize(size4, ratio, precision) {
|
|
|
120912
120896
|
isNumber4 = !isNumber4;
|
|
120913
120897
|
}
|
|
120914
120898
|
}
|
|
120915
|
-
function splitSVGDefs(content3, tag = "defs") {
|
|
120916
|
-
let defs = "";
|
|
120917
|
-
const index4 = content3.indexOf("<" + tag);
|
|
120918
|
-
while (index4 >= 0) {
|
|
120919
|
-
const start2 = content3.indexOf(">", index4);
|
|
120920
|
-
const end = content3.indexOf("</" + tag);
|
|
120921
|
-
if (start2 === -1 || end === -1) {
|
|
120922
|
-
break;
|
|
120923
|
-
}
|
|
120924
|
-
const endEnd = content3.indexOf(">", end);
|
|
120925
|
-
if (endEnd === -1) {
|
|
120926
|
-
break;
|
|
120927
|
-
}
|
|
120928
|
-
defs += content3.slice(start2 + 1, end).trim();
|
|
120929
|
-
content3 = content3.slice(0, index4).trim() + content3.slice(endEnd + 1);
|
|
120930
|
-
}
|
|
120931
|
-
return {
|
|
120932
|
-
defs,
|
|
120933
|
-
content: content3
|
|
120934
|
-
};
|
|
120935
|
-
}
|
|
120936
|
-
function mergeDefsAndContent(defs, content3) {
|
|
120937
|
-
return defs ? "<defs>" + defs + "</defs>" + content3 : content3;
|
|
120938
|
-
}
|
|
120939
|
-
function wrapSVGContent(body, start2, end) {
|
|
120940
|
-
const split = splitSVGDefs(body);
|
|
120941
|
-
return mergeDefsAndContent(split.defs, start2 + split.content + end);
|
|
120942
|
-
}
|
|
120943
120899
|
var isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
|
|
120944
120900
|
function iconToSVG(icon, customisations) {
|
|
120945
120901
|
const fullIcon = {
|
|
@@ -121016,11 +120972,7 @@ function iconToSVG(icon, customisations) {
|
|
|
121016
120972
|
}
|
|
121017
120973
|
}
|
|
121018
120974
|
if (transformations.length) {
|
|
121019
|
-
body =
|
|
121020
|
-
body,
|
|
121021
|
-
'<g transform="' + transformations.join(" ") + '">',
|
|
121022
|
-
"</g>"
|
|
121023
|
-
);
|
|
120975
|
+
body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
|
|
121024
120976
|
}
|
|
121025
120977
|
});
|
|
121026
120978
|
const customisationsWidth = fullCustomisations.width;
|
|
@@ -121044,11 +120996,9 @@ function iconToSVG(icon, customisations) {
|
|
|
121044
120996
|
};
|
|
121045
120997
|
setAttr("width", width);
|
|
121046
120998
|
setAttr("height", height);
|
|
121047
|
-
|
|
121048
|
-
attributes.viewBox = viewBox.join(" ");
|
|
120999
|
+
attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
|
|
121049
121000
|
return {
|
|
121050
121001
|
attributes,
|
|
121051
|
-
viewBox,
|
|
121052
121002
|
body
|
|
121053
121003
|
};
|
|
121054
121004
|
}
|
|
@@ -121664,63 +121614,201 @@ function sendAPIQuery(target, query, callback) {
|
|
|
121664
121614
|
}
|
|
121665
121615
|
return redundancy.query(query, send2, callback)().abort;
|
|
121666
121616
|
}
|
|
121667
|
-
|
|
121617
|
+
var browserCacheVersion = "iconify2";
|
|
121618
|
+
var browserCachePrefix = "iconify";
|
|
121619
|
+
var browserCacheCountKey = browserCachePrefix + "-count";
|
|
121620
|
+
var browserCacheVersionKey = browserCachePrefix + "-version";
|
|
121621
|
+
var browserStorageHour = 36e5;
|
|
121622
|
+
var browserStorageCacheExpiration = 168;
|
|
121623
|
+
function getStoredItem(func, key2) {
|
|
121624
|
+
try {
|
|
121625
|
+
return func.getItem(key2);
|
|
121626
|
+
} catch (err) {
|
|
121627
|
+
}
|
|
121668
121628
|
}
|
|
121669
|
-
function
|
|
121670
|
-
|
|
121671
|
-
|
|
121672
|
-
|
|
121673
|
-
|
|
121674
|
-
updateCallbacks(storage2);
|
|
121675
|
-
});
|
|
121629
|
+
function setStoredItem(func, key2, value) {
|
|
121630
|
+
try {
|
|
121631
|
+
func.setItem(key2, value);
|
|
121632
|
+
return true;
|
|
121633
|
+
} catch (err) {
|
|
121676
121634
|
}
|
|
121677
121635
|
}
|
|
121678
|
-
function
|
|
121679
|
-
|
|
121680
|
-
|
|
121681
|
-
|
|
121682
|
-
|
|
121683
|
-
});
|
|
121684
|
-
return {
|
|
121685
|
-
valid: valid2,
|
|
121686
|
-
invalid
|
|
121687
|
-
};
|
|
121636
|
+
function removeStoredItem(func, key2) {
|
|
121637
|
+
try {
|
|
121638
|
+
func.removeItem(key2);
|
|
121639
|
+
} catch (err) {
|
|
121640
|
+
}
|
|
121688
121641
|
}
|
|
121689
|
-
function
|
|
121690
|
-
|
|
121691
|
-
|
|
121692
|
-
|
|
121693
|
-
|
|
121694
|
-
|
|
121642
|
+
function setBrowserStorageItemsCount(storage2, value) {
|
|
121643
|
+
return setStoredItem(storage2, browserCacheCountKey, value.toString());
|
|
121644
|
+
}
|
|
121645
|
+
function getBrowserStorageItemsCount(storage2) {
|
|
121646
|
+
return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
|
|
121647
|
+
}
|
|
121648
|
+
var browserStorageConfig = {
|
|
121649
|
+
local: true,
|
|
121650
|
+
session: true
|
|
121651
|
+
};
|
|
121652
|
+
var browserStorageEmptyItems = {
|
|
121653
|
+
local: /* @__PURE__ */ new Set(),
|
|
121654
|
+
session: /* @__PURE__ */ new Set()
|
|
121655
|
+
};
|
|
121656
|
+
var browserStorageStatus = false;
|
|
121657
|
+
function setBrowserStorageStatus(status) {
|
|
121658
|
+
browserStorageStatus = status;
|
|
121659
|
+
}
|
|
121660
|
+
var _window = typeof window === "undefined" ? {} : window;
|
|
121661
|
+
function getBrowserStorage(key2) {
|
|
121662
|
+
const attr = key2 + "Storage";
|
|
121663
|
+
try {
|
|
121664
|
+
if (_window && _window[attr] && typeof _window[attr].length === "number") {
|
|
121665
|
+
return _window[attr];
|
|
121666
|
+
}
|
|
121667
|
+
} catch (err) {
|
|
121668
|
+
}
|
|
121669
|
+
browserStorageConfig[key2] = false;
|
|
121670
|
+
}
|
|
121671
|
+
function iterateBrowserStorage(key2, callback) {
|
|
121672
|
+
const func = getBrowserStorage(key2);
|
|
121673
|
+
if (!func) {
|
|
121674
|
+
return;
|
|
121675
|
+
}
|
|
121676
|
+
const version2 = getStoredItem(func, browserCacheVersionKey);
|
|
121677
|
+
if (version2 !== browserCacheVersion) {
|
|
121678
|
+
if (version2) {
|
|
121679
|
+
const total2 = getBrowserStorageItemsCount(func);
|
|
121680
|
+
for (let i16 = 0; i16 < total2; i16++) {
|
|
121681
|
+
removeStoredItem(func, browserCachePrefix + i16.toString());
|
|
121682
|
+
}
|
|
121683
|
+
}
|
|
121684
|
+
setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
|
|
121685
|
+
setBrowserStorageItemsCount(func, 0);
|
|
121686
|
+
return;
|
|
121687
|
+
}
|
|
121688
|
+
const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
|
|
121689
|
+
const parseItem = (index4) => {
|
|
121690
|
+
const name2 = browserCachePrefix + index4.toString();
|
|
121691
|
+
const item = getStoredItem(func, name2);
|
|
121692
|
+
if (typeof item !== "string") {
|
|
121693
|
+
return;
|
|
121694
|
+
}
|
|
121695
|
+
try {
|
|
121696
|
+
const data = JSON.parse(item);
|
|
121697
|
+
if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
|
|
121698
|
+
callback(data, index4)) {
|
|
121699
|
+
return true;
|
|
121700
|
+
}
|
|
121701
|
+
} catch (err) {
|
|
121702
|
+
}
|
|
121703
|
+
removeStoredItem(func, name2);
|
|
121704
|
+
};
|
|
121705
|
+
let total = getBrowserStorageItemsCount(func);
|
|
121706
|
+
for (let i16 = total - 1; i16 >= 0; i16--) {
|
|
121707
|
+
if (!parseItem(i16)) {
|
|
121708
|
+
if (i16 === total - 1) {
|
|
121709
|
+
total--;
|
|
121710
|
+
setBrowserStorageItemsCount(func, total);
|
|
121711
|
+
} else {
|
|
121712
|
+
browserStorageEmptyItems[key2].add(i16);
|
|
121695
121713
|
}
|
|
121696
|
-
|
|
121697
|
-
|
|
121714
|
+
}
|
|
121715
|
+
}
|
|
121716
|
+
}
|
|
121717
|
+
function initBrowserStorage() {
|
|
121718
|
+
if (browserStorageStatus) {
|
|
121719
|
+
return;
|
|
121720
|
+
}
|
|
121721
|
+
setBrowserStorageStatus(true);
|
|
121722
|
+
for (const key2 in browserStorageConfig) {
|
|
121723
|
+
iterateBrowserStorage(key2, (item) => {
|
|
121724
|
+
const iconSet = item.data;
|
|
121725
|
+
const provider = item.provider;
|
|
121726
|
+
const prefix2 = iconSet.prefix;
|
|
121727
|
+
const storage2 = getStorage(
|
|
121728
|
+
provider,
|
|
121729
|
+
prefix2
|
|
121730
|
+
);
|
|
121731
|
+
if (!addIconSet(storage2, iconSet).length) {
|
|
121732
|
+
return false;
|
|
121698
121733
|
}
|
|
121734
|
+
const lastModified = iconSet.lastModified || -1;
|
|
121735
|
+
storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
|
|
121736
|
+
return true;
|
|
121699
121737
|
});
|
|
121700
121738
|
}
|
|
121701
|
-
|
|
121702
|
-
|
|
121703
|
-
|
|
121704
|
-
|
|
121705
|
-
|
|
121739
|
+
}
|
|
121740
|
+
function updateLastModified(storage2, lastModified) {
|
|
121741
|
+
const lastValue = storage2.lastModifiedCached;
|
|
121742
|
+
if (
|
|
121743
|
+
// Matches or newer
|
|
121744
|
+
lastValue && lastValue >= lastModified
|
|
121745
|
+
) {
|
|
121746
|
+
return lastValue === lastModified;
|
|
121747
|
+
}
|
|
121748
|
+
storage2.lastModifiedCached = lastModified;
|
|
121749
|
+
if (lastValue) {
|
|
121750
|
+
for (const key2 in browserStorageConfig) {
|
|
121751
|
+
iterateBrowserStorage(key2, (item) => {
|
|
121752
|
+
const iconSet = item.data;
|
|
121753
|
+
return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
|
|
121754
|
+
});
|
|
121755
|
+
}
|
|
121756
|
+
}
|
|
121757
|
+
return true;
|
|
121758
|
+
}
|
|
121759
|
+
function storeInBrowserStorage(storage2, data) {
|
|
121760
|
+
if (!browserStorageStatus) {
|
|
121761
|
+
initBrowserStorage();
|
|
121762
|
+
}
|
|
121763
|
+
function store(key2) {
|
|
121764
|
+
let func;
|
|
121765
|
+
if (!browserStorageConfig[key2] || !(func = getBrowserStorage(key2))) {
|
|
121766
|
+
return;
|
|
121767
|
+
}
|
|
121768
|
+
const set2 = browserStorageEmptyItems[key2];
|
|
121769
|
+
let index4;
|
|
121770
|
+
if (set2.size) {
|
|
121771
|
+
set2.delete(index4 = Array.from(set2).shift());
|
|
121772
|
+
} else {
|
|
121773
|
+
index4 = getBrowserStorageItemsCount(func);
|
|
121774
|
+
if (!setBrowserStorageItemsCount(func, index4 + 1)) {
|
|
121706
121775
|
return;
|
|
121707
121776
|
}
|
|
121708
|
-
} catch (err) {
|
|
121709
|
-
console.error(err);
|
|
121710
121777
|
}
|
|
121778
|
+
const item = {
|
|
121779
|
+
cached: Math.floor(Date.now() / browserStorageHour),
|
|
121780
|
+
provider: storage2.provider,
|
|
121781
|
+
data
|
|
121782
|
+
};
|
|
121783
|
+
return setStoredItem(
|
|
121784
|
+
func,
|
|
121785
|
+
browserCachePrefix + index4.toString(),
|
|
121786
|
+
JSON.stringify(item)
|
|
121787
|
+
);
|
|
121788
|
+
}
|
|
121789
|
+
if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
|
|
121790
|
+
return;
|
|
121791
|
+
}
|
|
121792
|
+
if (!Object.keys(data.icons).length) {
|
|
121793
|
+
return;
|
|
121794
|
+
}
|
|
121795
|
+
if (data.not_found) {
|
|
121796
|
+
data = Object.assign({}, data);
|
|
121797
|
+
delete data.not_found;
|
|
121798
|
+
}
|
|
121799
|
+
if (!store("local")) {
|
|
121800
|
+
store("session");
|
|
121711
121801
|
}
|
|
121712
|
-
checkMissing();
|
|
121713
|
-
loadedNewIcons(storage2);
|
|
121714
121802
|
}
|
|
121715
|
-
function
|
|
121716
|
-
|
|
121717
|
-
|
|
121718
|
-
|
|
121719
|
-
|
|
121720
|
-
|
|
121803
|
+
function emptyCallback() {
|
|
121804
|
+
}
|
|
121805
|
+
function loadedNewIcons(storage2) {
|
|
121806
|
+
if (!storage2.iconsLoaderFlag) {
|
|
121807
|
+
storage2.iconsLoaderFlag = true;
|
|
121808
|
+
setTimeout(() => {
|
|
121809
|
+
storage2.iconsLoaderFlag = false;
|
|
121810
|
+
updateCallbacks(storage2);
|
|
121721
121811
|
});
|
|
121722
|
-
} else {
|
|
121723
|
-
callback(response);
|
|
121724
121812
|
}
|
|
121725
121813
|
}
|
|
121726
121814
|
function loadNewIcons(storage2, icons) {
|
|
@@ -121736,50 +121824,38 @@ function loadNewIcons(storage2, icons) {
|
|
|
121736
121824
|
const { provider, prefix: prefix2 } = storage2;
|
|
121737
121825
|
const icons2 = storage2.iconsToLoad;
|
|
121738
121826
|
delete storage2.iconsToLoad;
|
|
121739
|
-
|
|
121827
|
+
let api;
|
|
121828
|
+
if (!icons2 || !(api = getAPIModule(provider))) {
|
|
121740
121829
|
return;
|
|
121741
121830
|
}
|
|
121742
|
-
const
|
|
121743
|
-
if (storage2.loadIcons && (icons2.length > 1 || !customIconLoader)) {
|
|
121744
|
-
parsePossiblyAsyncResponse(
|
|
121745
|
-
storage2.loadIcons(icons2, prefix2, provider),
|
|
121746
|
-
(data) => {
|
|
121747
|
-
parseLoaderResponse(storage2, icons2, data);
|
|
121748
|
-
}
|
|
121749
|
-
);
|
|
121750
|
-
return;
|
|
121751
|
-
}
|
|
121752
|
-
if (customIconLoader) {
|
|
121753
|
-
icons2.forEach((name2) => {
|
|
121754
|
-
const response = customIconLoader(name2, prefix2, provider);
|
|
121755
|
-
parsePossiblyAsyncResponse(response, (data) => {
|
|
121756
|
-
const iconSet = data ? {
|
|
121757
|
-
prefix: prefix2,
|
|
121758
|
-
icons: {
|
|
121759
|
-
[name2]: data
|
|
121760
|
-
}
|
|
121761
|
-
} : null;
|
|
121762
|
-
parseLoaderResponse(storage2, [name2], iconSet);
|
|
121763
|
-
});
|
|
121764
|
-
});
|
|
121765
|
-
return;
|
|
121766
|
-
}
|
|
121767
|
-
const { valid: valid2, invalid } = checkIconNamesForAPI(icons2);
|
|
121768
|
-
if (invalid.length) {
|
|
121769
|
-
parseLoaderResponse(storage2, invalid, null);
|
|
121770
|
-
}
|
|
121771
|
-
if (!valid2.length) {
|
|
121772
|
-
return;
|
|
121773
|
-
}
|
|
121774
|
-
const api = prefix2.match(matchIconName) ? getAPIModule(provider) : null;
|
|
121775
|
-
if (!api) {
|
|
121776
|
-
parseLoaderResponse(storage2, valid2, null);
|
|
121777
|
-
return;
|
|
121778
|
-
}
|
|
121779
|
-
const params = api.prepare(provider, prefix2, valid2);
|
|
121831
|
+
const params = api.prepare(provider, prefix2, icons2);
|
|
121780
121832
|
params.forEach((item) => {
|
|
121781
121833
|
sendAPIQuery(provider, item, (data) => {
|
|
121782
|
-
|
|
121834
|
+
if (typeof data !== "object") {
|
|
121835
|
+
item.icons.forEach((name2) => {
|
|
121836
|
+
storage2.missing.add(name2);
|
|
121837
|
+
});
|
|
121838
|
+
} else {
|
|
121839
|
+
try {
|
|
121840
|
+
const parsed = addIconSet(
|
|
121841
|
+
storage2,
|
|
121842
|
+
data
|
|
121843
|
+
);
|
|
121844
|
+
if (!parsed.length) {
|
|
121845
|
+
return;
|
|
121846
|
+
}
|
|
121847
|
+
const pending = storage2.pendingIcons;
|
|
121848
|
+
if (pending) {
|
|
121849
|
+
parsed.forEach((name2) => {
|
|
121850
|
+
pending.delete(name2);
|
|
121851
|
+
});
|
|
121852
|
+
}
|
|
121853
|
+
storeInBrowserStorage(storage2, data);
|
|
121854
|
+
} catch (err) {
|
|
121855
|
+
console.error(err);
|
|
121856
|
+
}
|
|
121857
|
+
}
|
|
121858
|
+
loadedNewIcons(storage2);
|
|
121783
121859
|
});
|
|
121784
121860
|
});
|
|
121785
121861
|
});
|
|
@@ -121832,9 +121908,9 @@ var loadIcons = (icons, callback) => {
|
|
|
121832
121908
|
}
|
|
121833
121909
|
});
|
|
121834
121910
|
sources.forEach((storage2) => {
|
|
121835
|
-
const
|
|
121836
|
-
if (
|
|
121837
|
-
loadNewIcons(storage2,
|
|
121911
|
+
const { provider, prefix: prefix2 } = storage2;
|
|
121912
|
+
if (newIcons[provider][prefix2].length) {
|
|
121913
|
+
loadNewIcons(storage2, newIcons[provider][prefix2]);
|
|
121838
121914
|
}
|
|
121839
121915
|
});
|
|
121840
121916
|
return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
|
|
@@ -121976,31 +122052,16 @@ var inlineDefaults = {
|
|
|
121976
122052
|
function fixSize(value) {
|
|
121977
122053
|
return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
|
|
121978
122054
|
}
|
|
121979
|
-
var render = (icon, props,
|
|
121980
|
-
const defaultProps6 =
|
|
122055
|
+
var render = (icon, props, inline4, ref) => {
|
|
122056
|
+
const defaultProps6 = inline4 ? inlineDefaults : defaultExtendedIconCustomisations;
|
|
121981
122057
|
const customisations = mergeCustomisations(defaultProps6, props);
|
|
121982
122058
|
const mode = props.mode || "svg";
|
|
121983
122059
|
const style = {};
|
|
121984
122060
|
const customStyle = props.style || {};
|
|
121985
122061
|
const componentProps = {
|
|
121986
|
-
...mode === "svg" ? svgDefaults : {}
|
|
121987
|
-
|
|
121988
|
-
|
|
121989
|
-
const iconName = stringToIcon(name2, false, true);
|
|
121990
|
-
if (iconName) {
|
|
121991
|
-
const classNames = ["iconify"];
|
|
121992
|
-
const props2 = [
|
|
121993
|
-
"provider",
|
|
121994
|
-
"prefix"
|
|
121995
|
-
];
|
|
121996
|
-
for (const prop of props2) {
|
|
121997
|
-
if (iconName[prop]) {
|
|
121998
|
-
classNames.push("iconify--" + iconName[prop]);
|
|
121999
|
-
}
|
|
122000
|
-
}
|
|
122001
|
-
componentProps.className = classNames.join(" ");
|
|
122002
|
-
}
|
|
122003
|
-
}
|
|
122062
|
+
...mode === "svg" ? svgDefaults : {},
|
|
122063
|
+
ref
|
|
122064
|
+
};
|
|
122004
122065
|
for (let key2 in props) {
|
|
122005
122066
|
const value = props[key2];
|
|
122006
122067
|
if (value === void 0) {
|
|
@@ -122013,15 +122074,8 @@ var render = (icon, props, name2) => {
|
|
|
122013
122074
|
case "children":
|
|
122014
122075
|
case "onLoad":
|
|
122015
122076
|
case "mode":
|
|
122016
|
-
case "ssr":
|
|
122017
|
-
break;
|
|
122018
|
-
// Forward ref
|
|
122019
122077
|
case "_ref":
|
|
122020
|
-
|
|
122021
|
-
break;
|
|
122022
|
-
// Merge class names
|
|
122023
|
-
case "className":
|
|
122024
|
-
componentProps[key2] = (componentProps[key2] ? componentProps[key2] + " " : "") + value;
|
|
122078
|
+
case "_inline":
|
|
122025
122079
|
break;
|
|
122026
122080
|
// Boolean attributes
|
|
122027
122081
|
case "inline":
|
|
@@ -122080,7 +122134,7 @@ var render = (icon, props, name2) => {
|
|
|
122080
122134
|
componentProps.dangerouslySetInnerHTML = {
|
|
122081
122135
|
__html: cleanUpInnerHTML(replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyReact"))
|
|
122082
122136
|
};
|
|
122083
|
-
return
|
|
122137
|
+
return React151.createElement("svg", componentProps);
|
|
122084
122138
|
}
|
|
122085
122139
|
const { body, width, height } = icon;
|
|
122086
122140
|
const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
|
|
@@ -122098,14 +122152,15 @@ var render = (icon, props, name2) => {
|
|
|
122098
122152
|
...useMask ? monotoneProps : coloredProps,
|
|
122099
122153
|
...customStyle
|
|
122100
122154
|
};
|
|
122101
|
-
return
|
|
122155
|
+
return React151.createElement("span", componentProps);
|
|
122102
122156
|
};
|
|
122103
122157
|
allowSimpleNames(true);
|
|
122104
122158
|
setAPIModule("", fetchAPIModule);
|
|
122105
122159
|
if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
122106
|
-
|
|
122107
|
-
|
|
122108
|
-
|
|
122160
|
+
initBrowserStorage();
|
|
122161
|
+
const _window2 = window;
|
|
122162
|
+
if (_window2.IconifyPreload !== void 0) {
|
|
122163
|
+
const preload = _window2.IconifyPreload;
|
|
122109
122164
|
const err = "Invalid IconifyPreload syntax.";
|
|
122110
122165
|
if (typeof preload === "object" && preload !== null) {
|
|
122111
122166
|
(preload instanceof Array ? preload : [preload]).forEach((item) => {
|
|
@@ -122124,8 +122179,8 @@ if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
|
122124
122179
|
});
|
|
122125
122180
|
}
|
|
122126
122181
|
}
|
|
122127
|
-
if (
|
|
122128
|
-
const providers =
|
|
122182
|
+
if (_window2.IconifyProviders !== void 0) {
|
|
122183
|
+
const providers = _window2.IconifyProviders;
|
|
122129
122184
|
if (typeof providers === "object" && providers !== null) {
|
|
122130
122185
|
for (let key2 in providers) {
|
|
122131
122186
|
const err = "IconifyProviders[" + key2 + "] is invalid.";
|
|
@@ -122144,103 +122199,153 @@ if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
|
122144
122199
|
}
|
|
122145
122200
|
}
|
|
122146
122201
|
}
|
|
122147
|
-
|
|
122148
|
-
|
|
122149
|
-
|
|
122150
|
-
|
|
122151
|
-
|
|
122152
|
-
|
|
122153
|
-
if (typeof name3 === "object") {
|
|
122154
|
-
return {
|
|
122155
|
-
name: "",
|
|
122156
|
-
data: name3
|
|
122157
|
-
};
|
|
122158
|
-
}
|
|
122159
|
-
const data2 = getIconData(name3);
|
|
122160
|
-
if (data2) {
|
|
122161
|
-
return {
|
|
122162
|
-
name: name3,
|
|
122163
|
-
data: data2
|
|
122164
|
-
};
|
|
122165
|
-
}
|
|
122166
|
-
}
|
|
122167
|
-
return {
|
|
122168
|
-
name: ""
|
|
122202
|
+
var IconComponent = class extends React151.Component {
|
|
122203
|
+
constructor(props) {
|
|
122204
|
+
super(props);
|
|
122205
|
+
this.state = {
|
|
122206
|
+
// Render placeholder before component is mounted
|
|
122207
|
+
icon: null
|
|
122169
122208
|
};
|
|
122170
122209
|
}
|
|
122171
|
-
|
|
122172
|
-
|
|
122173
|
-
|
|
122174
|
-
|
|
122175
|
-
|
|
122176
|
-
|
|
122210
|
+
/**
|
|
122211
|
+
* Abort loading icon
|
|
122212
|
+
*/
|
|
122213
|
+
_abortLoading() {
|
|
122214
|
+
if (this._loading) {
|
|
122215
|
+
this._loading.abort();
|
|
122216
|
+
this._loading = null;
|
|
122177
122217
|
}
|
|
122178
122218
|
}
|
|
122179
|
-
|
|
122180
|
-
|
|
122181
|
-
|
|
122182
|
-
|
|
122183
|
-
|
|
122219
|
+
/**
|
|
122220
|
+
* Update state
|
|
122221
|
+
*/
|
|
122222
|
+
_setData(icon) {
|
|
122223
|
+
if (this.state.icon !== icon) {
|
|
122224
|
+
this.setState({
|
|
122225
|
+
icon
|
|
122226
|
+
});
|
|
122184
122227
|
}
|
|
122185
122228
|
}
|
|
122186
|
-
|
|
122187
|
-
|
|
122188
|
-
|
|
122189
|
-
|
|
122190
|
-
|
|
122191
|
-
|
|
122192
|
-
|
|
122193
|
-
|
|
122229
|
+
/**
|
|
122230
|
+
* Check if icon should be loaded
|
|
122231
|
+
*/
|
|
122232
|
+
_checkIcon(changed) {
|
|
122233
|
+
const state = this.state;
|
|
122234
|
+
const icon = this.props.icon;
|
|
122235
|
+
if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
|
|
122236
|
+
this._icon = "";
|
|
122237
|
+
this._abortLoading();
|
|
122238
|
+
if (changed || state.icon === null) {
|
|
122239
|
+
this._setData({
|
|
122240
|
+
data: icon
|
|
122241
|
+
});
|
|
122242
|
+
}
|
|
122194
122243
|
return;
|
|
122195
122244
|
}
|
|
122196
|
-
|
|
122197
|
-
if (
|
|
122198
|
-
|
|
122199
|
-
|
|
122200
|
-
|
|
122201
|
-
|
|
122202
|
-
|
|
122203
|
-
|
|
122204
|
-
|
|
122205
|
-
|
|
122206
|
-
|
|
122207
|
-
(
|
|
122245
|
+
let iconName;
|
|
122246
|
+
if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
|
|
122247
|
+
this._abortLoading();
|
|
122248
|
+
this._setData(null);
|
|
122249
|
+
return;
|
|
122250
|
+
}
|
|
122251
|
+
const data = getIconData(iconName);
|
|
122252
|
+
if (!data) {
|
|
122253
|
+
if (!this._loading || this._loading.name !== icon) {
|
|
122254
|
+
this._abortLoading();
|
|
122255
|
+
this._icon = "";
|
|
122256
|
+
this._setData(null);
|
|
122257
|
+
if (data !== null) {
|
|
122258
|
+
this._loading = {
|
|
122259
|
+
name: icon,
|
|
122260
|
+
abort: loadIcons([iconName], this._checkIcon.bind(this, false))
|
|
122261
|
+
};
|
|
122262
|
+
}
|
|
122263
|
+
}
|
|
122264
|
+
return;
|
|
122265
|
+
}
|
|
122266
|
+
if (this._icon !== icon || state.icon === null) {
|
|
122267
|
+
this._abortLoading();
|
|
122268
|
+
this._icon = icon;
|
|
122269
|
+
const classes = ["iconify"];
|
|
122270
|
+
if (iconName.prefix !== "") {
|
|
122271
|
+
classes.push("iconify--" + iconName.prefix);
|
|
122272
|
+
}
|
|
122273
|
+
if (iconName.provider !== "") {
|
|
122274
|
+
classes.push("iconify--" + iconName.provider);
|
|
122275
|
+
}
|
|
122276
|
+
this._setData({
|
|
122277
|
+
data,
|
|
122278
|
+
classes
|
|
122279
|
+
});
|
|
122280
|
+
if (this.props.onLoad) {
|
|
122281
|
+
this.props.onLoad(icon);
|
|
122208
122282
|
}
|
|
122209
122283
|
}
|
|
122210
122284
|
}
|
|
122211
|
-
|
|
122212
|
-
|
|
122213
|
-
|
|
122214
|
-
|
|
122215
|
-
|
|
122216
|
-
|
|
122217
|
-
|
|
122285
|
+
/**
|
|
122286
|
+
* Component mounted
|
|
122287
|
+
*/
|
|
122288
|
+
componentDidMount() {
|
|
122289
|
+
this._checkIcon(false);
|
|
122290
|
+
}
|
|
122291
|
+
/**
|
|
122292
|
+
* Component updated
|
|
122293
|
+
*/
|
|
122294
|
+
componentDidUpdate(oldProps) {
|
|
122295
|
+
if (oldProps.icon !== this.props.icon) {
|
|
122296
|
+
this._checkIcon(true);
|
|
122218
122297
|
}
|
|
122219
|
-
}, [props.icon, mounted]);
|
|
122220
|
-
const { name: name2, data } = state;
|
|
122221
|
-
if (!data) {
|
|
122222
|
-
return props.children ? props.children : props.fallback ? props.fallback : createElement24("span", {});
|
|
122223
122298
|
}
|
|
122224
|
-
|
|
122225
|
-
|
|
122226
|
-
|
|
122227
|
-
|
|
122228
|
-
|
|
122229
|
-
|
|
122230
|
-
|
|
122231
|
-
|
|
122232
|
-
|
|
122233
|
-
|
|
122234
|
-
|
|
122235
|
-
|
|
122236
|
-
|
|
122237
|
-
})
|
|
122299
|
+
/**
|
|
122300
|
+
* Abort loading
|
|
122301
|
+
*/
|
|
122302
|
+
componentWillUnmount() {
|
|
122303
|
+
this._abortLoading();
|
|
122304
|
+
}
|
|
122305
|
+
/**
|
|
122306
|
+
* Render
|
|
122307
|
+
*/
|
|
122308
|
+
render() {
|
|
122309
|
+
const props = this.props;
|
|
122310
|
+
const icon = this.state.icon;
|
|
122311
|
+
if (icon === null) {
|
|
122312
|
+
return props.children ? props.children : React151.createElement("span", {});
|
|
122313
|
+
}
|
|
122314
|
+
let newProps = props;
|
|
122315
|
+
if (icon.classes) {
|
|
122316
|
+
newProps = {
|
|
122317
|
+
...props,
|
|
122318
|
+
className: (typeof props.className === "string" ? props.className + " " : "") + icon.classes.join(" ")
|
|
122319
|
+
};
|
|
122320
|
+
}
|
|
122321
|
+
return render({
|
|
122322
|
+
...defaultIconProps,
|
|
122323
|
+
...icon.data
|
|
122324
|
+
}, newProps, props._inline, props._ref);
|
|
122325
|
+
}
|
|
122326
|
+
};
|
|
122327
|
+
var Icon3 = React151.forwardRef(function Icon4(props, ref) {
|
|
122328
|
+
const newProps = {
|
|
122329
|
+
...props,
|
|
122330
|
+
_ref: ref,
|
|
122331
|
+
_inline: false
|
|
122332
|
+
};
|
|
122333
|
+
return React151.createElement(IconComponent, newProps);
|
|
122334
|
+
});
|
|
122335
|
+
var InlineIcon = React151.forwardRef(function InlineIcon2(props, ref) {
|
|
122336
|
+
const newProps = {
|
|
122337
|
+
...props,
|
|
122338
|
+
_ref: ref,
|
|
122339
|
+
_inline: true
|
|
122340
|
+
};
|
|
122341
|
+
return React151.createElement(IconComponent, newProps);
|
|
122342
|
+
});
|
|
122238
122343
|
|
|
122239
122344
|
// src/animate-primitives/components/radix/accordion.tsx
|
|
122240
122345
|
import { ChevronDownIcon as ChevronDownIcon4 } from "lucide-react";
|
|
122241
122346
|
|
|
122242
122347
|
// src/animate-primitives/primitives/radix/accordion.tsx
|
|
122243
|
-
import * as
|
|
122348
|
+
import * as React152 from "react";
|
|
122244
122349
|
import { Accordion as AccordionPrimitive } from "radix-ui";
|
|
122245
122350
|
import { motion as motion26, AnimatePresence as AnimatePresence23 } from "motion/react";
|
|
122246
122351
|
import { jsx as jsx217 } from "react/jsx-runtime";
|
|
@@ -122263,10 +122368,10 @@ function Accordion(props) {
|
|
|
122263
122368
|
}
|
|
122264
122369
|
function AccordionItem(props) {
|
|
122265
122370
|
const { value } = useAccordion();
|
|
122266
|
-
const [isOpen, setIsOpen] =
|
|
122371
|
+
const [isOpen, setIsOpen] = React152.useState(
|
|
122267
122372
|
value?.includes(props?.value) ?? false
|
|
122268
122373
|
);
|
|
122269
|
-
|
|
122374
|
+
React152.useEffect(() => {
|
|
122270
122375
|
setIsOpen(value?.includes(props?.value) ?? false);
|
|
122271
122376
|
}, [value, props?.value]);
|
|
122272
122377
|
return /* @__PURE__ */ jsx217(AccordionItemProvider, { value: { isOpen, setIsOpen, value: props.value }, children: /* @__PURE__ */ jsx217(AccordionPrimitive.Item, { "data-slot": "accordion-item", ...props }) });
|
|
@@ -122370,10 +122475,10 @@ function AccordionContent2({
|
|
|
122370
122475
|
import { useDevice } from "@pol-studios/hooks";
|
|
122371
122476
|
|
|
122372
122477
|
// src/components/FilterBuilder/MobileFilterDrawer.tsx
|
|
122373
|
-
import
|
|
122478
|
+
import React154, { useState as useState80, useEffect as useEffect70 } from "react";
|
|
122374
122479
|
|
|
122375
122480
|
// src/components/FilterBuilder/Preview/FilterPreview.tsx
|
|
122376
|
-
import
|
|
122481
|
+
import React153 from "react";
|
|
122377
122482
|
import { jsx as jsx219, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
122378
122483
|
function isFilterState(filter) {
|
|
122379
122484
|
return "field" in filter && typeof filter.field === "string";
|
|
@@ -122402,7 +122507,7 @@ function RenderFilters({ filters, setFilters, depth = 0 }) {
|
|
|
122402
122507
|
return 0;
|
|
122403
122508
|
}).map((filter, index4) => {
|
|
122404
122509
|
if (filter.id === SEARCH_ID) {
|
|
122405
|
-
return /* @__PURE__ */ jsx219(
|
|
122510
|
+
return /* @__PURE__ */ jsx219(React153.Fragment, { children: /* @__PURE__ */ jsxs129("div", { className: "flex items-start space-x-3", children: [
|
|
122406
122511
|
index4 > 0 && /* @__PURE__ */ jsx219(
|
|
122407
122512
|
"span",
|
|
122408
122513
|
{
|
|
@@ -122417,12 +122522,12 @@ function RenderFilters({ filters, setFilters, depth = 0 }) {
|
|
|
122417
122522
|
] }) }, index4);
|
|
122418
122523
|
}
|
|
122419
122524
|
if (isFilterGroup(filter)) {
|
|
122420
|
-
return /* @__PURE__ */ jsx219(
|
|
122525
|
+
return /* @__PURE__ */ jsx219(React153.Fragment, { children: /* @__PURE__ */ jsxs129("div", { className: "flex items-start", children: [
|
|
122421
122526
|
index4 > 0 && /* @__PURE__ */ jsx219("span", { className: "mx-2 text-sm font-medium text-muted-600", children: filters.op }),
|
|
122422
122527
|
RenderFilters({ filters: filter, setFilters, depth: depth + 1 })
|
|
122423
122528
|
] }) }, index4);
|
|
122424
122529
|
} else if (isFilterState(filter)) {
|
|
122425
|
-
return /* @__PURE__ */ jsx219(
|
|
122530
|
+
return /* @__PURE__ */ jsx219(React153.Fragment, { children: /* @__PURE__ */ jsxs129("div", { className: "flex items-start space-x-3", children: [
|
|
122426
122531
|
index4 > 0 && /* @__PURE__ */ jsx219(
|
|
122427
122532
|
"span",
|
|
122428
122533
|
{
|
|
@@ -122506,10 +122611,10 @@ function MobileFilterDrawer({
|
|
|
122506
122611
|
aiSearchOptions,
|
|
122507
122612
|
updateAiSearchSimilarity
|
|
122508
122613
|
}) {
|
|
122509
|
-
const [editingFilterId, setEditingFilterId] =
|
|
122510
|
-
const [showInstructions, setShowInstructions] =
|
|
122511
|
-
const [allFiltersExpanded, setAllFiltersExpanded] =
|
|
122512
|
-
|
|
122614
|
+
const [editingFilterId, setEditingFilterId] = useState80(null);
|
|
122615
|
+
const [showInstructions, setShowInstructions] = useState80(true);
|
|
122616
|
+
const [allFiltersExpanded, setAllFiltersExpanded] = useState80(void 0);
|
|
122617
|
+
useEffect70(() => {
|
|
122513
122618
|
if (columnSearch) {
|
|
122514
122619
|
setAllFiltersExpanded("all-filters");
|
|
122515
122620
|
}
|
|
@@ -122582,7 +122687,7 @@ function MobileFilterDrawer({
|
|
|
122582
122687
|
hasRecommendedFilters && propOptions && /* @__PURE__ */ jsxs130("div", { className: "pb-2", children: [
|
|
122583
122688
|
/* @__PURE__ */ jsx220("div", { className: filterStyles.recommendedHeader, children: "Recommended" }),
|
|
122584
122689
|
/* @__PURE__ */ jsx220("div", { className: "space-y-1", children: renderOptionsGroups(propOptions, 0, "recommended").map(
|
|
122585
|
-
(item, index4) =>
|
|
122690
|
+
(item, index4) => React154.cloneElement(item, { key: index4 })
|
|
122586
122691
|
) })
|
|
122587
122692
|
] }),
|
|
122588
122693
|
hasRecommendedFilters && propOptions ? /* @__PURE__ */ jsx220(
|
|
@@ -122599,16 +122704,16 @@ function MobileFilterDrawer({
|
|
|
122599
122704
|
/* @__PURE__ */ jsx220("span", { className: "text-xs bg-muted-200 text-muted-700 px-2 py-1 rounded-full font-medium", children: filterOptions.length })
|
|
122600
122705
|
] }) }),
|
|
122601
122706
|
/* @__PURE__ */ jsx220(AccordionContent2, { className: "pb-0 pt-0", children: /* @__PURE__ */ jsx220("div", { className: "space-y-1", children: renderOptionsGroups(propOptions, 0, "all").map(
|
|
122602
|
-
(item, index4) =>
|
|
122707
|
+
(item, index4) => React154.cloneElement(item, { key: index4 })
|
|
122603
122708
|
) }) })
|
|
122604
122709
|
] })
|
|
122605
122710
|
}
|
|
122606
122711
|
) : (
|
|
122607
122712
|
// No recommended filters - render normally
|
|
122608
122713
|
/* @__PURE__ */ jsx220(Accordion2, { type: "multiple", className: "space-y-1", children: propOptions ? renderOptionsGroups(propOptions).map(
|
|
122609
|
-
(item, index4) =>
|
|
122714
|
+
(item, index4) => React154.cloneElement(item, { key: index4 })
|
|
122610
122715
|
) : renderNestedOptions(children).map(
|
|
122611
|
-
(item, index4) =>
|
|
122716
|
+
(item, index4) => React154.cloneElement(item, { key: index4 })
|
|
122612
122717
|
) })
|
|
122613
122718
|
)
|
|
122614
122719
|
] }),
|
|
@@ -123196,7 +123301,7 @@ function _FilterBuilder({
|
|
|
123196
123301
|
widgets
|
|
123197
123302
|
}) {
|
|
123198
123303
|
const supabase = useSupabase7();
|
|
123199
|
-
const [selectedQueryId, setSelectedQueryId] =
|
|
123304
|
+
const [selectedQueryId, setSelectedQueryId] = useState81(
|
|
123200
123305
|
() => {
|
|
123201
123306
|
if (typeof window === "undefined") return void 0;
|
|
123202
123307
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -123215,16 +123320,16 @@ function _FilterBuilder({
|
|
|
123215
123320
|
}
|
|
123216
123321
|
window.history.replaceState({}, "", url.toString());
|
|
123217
123322
|
}, []);
|
|
123218
|
-
const [currentFilterLayer, setCurrentFilterLayer] =
|
|
123219
|
-
const [showFilterDropdown, setShowFilterDropdown] =
|
|
123220
|
-
const [showSearch, setShowSearch] =
|
|
123221
|
-
const [showMobileDrawer, setShowMobileDrawer] =
|
|
123222
|
-
const [showManagers, setShowManagers] =
|
|
123223
|
-
const [showAdvancedFilters, setShowAdvancedFilters] =
|
|
123224
|
-
const [expandedSections, setExpandedSections] =
|
|
123323
|
+
const [currentFilterLayer, setCurrentFilterLayer] = useState81(null);
|
|
123324
|
+
const [showFilterDropdown, setShowFilterDropdown] = useState81(false);
|
|
123325
|
+
const [showSearch, setShowSearch] = useState81(false);
|
|
123326
|
+
const [showMobileDrawer, setShowMobileDrawer] = useState81(false);
|
|
123327
|
+
const [showManagers, setShowManagers] = useState81(false);
|
|
123328
|
+
const [showAdvancedFilters, setShowAdvancedFilters] = useState81(false);
|
|
123329
|
+
const [expandedSections, setExpandedSections] = useState81(
|
|
123225
123330
|
/* @__PURE__ */ new Set()
|
|
123226
123331
|
);
|
|
123227
|
-
const [allFiltersExpanded, setAllFiltersExpanded] =
|
|
123332
|
+
const [allFiltersExpanded, setAllFiltersExpanded] = useState81(void 0);
|
|
123228
123333
|
const toggleSection = (sectionTitle) => {
|
|
123229
123334
|
setExpandedSections((prev) => {
|
|
123230
123335
|
const newSet = new Set(prev);
|
|
@@ -123236,7 +123341,7 @@ function _FilterBuilder({
|
|
|
123236
123341
|
return newSet;
|
|
123237
123342
|
});
|
|
123238
123343
|
};
|
|
123239
|
-
|
|
123344
|
+
useEffect71(() => {
|
|
123240
123345
|
if (!currentFilterLayer)
|
|
123241
123346
|
setFilters((pre) => ({
|
|
123242
123347
|
...pre,
|
|
@@ -123269,24 +123374,24 @@ function _FilterBuilder({
|
|
|
123269
123374
|
return flattenOptions(propOptions);
|
|
123270
123375
|
}
|
|
123271
123376
|
const extractOptions = (child) => {
|
|
123272
|
-
if (
|
|
123377
|
+
if (React155.isValidElement(child)) {
|
|
123273
123378
|
if (child.type === _FilterBuilder.Option) {
|
|
123274
123379
|
return [child.props.value];
|
|
123275
123380
|
}
|
|
123276
123381
|
if (child.type === _FilterBuilder.NestedOptions) {
|
|
123277
|
-
return
|
|
123382
|
+
return React155.Children.toArray(child.props.children).flatMap(
|
|
123278
123383
|
extractOptions
|
|
123279
123384
|
);
|
|
123280
123385
|
}
|
|
123281
|
-
if (child.type ===
|
|
123282
|
-
return
|
|
123386
|
+
if (child.type === React155.Fragment) {
|
|
123387
|
+
return React155.Children.toArray(child.props.children).flatMap(
|
|
123283
123388
|
extractOptions
|
|
123284
123389
|
);
|
|
123285
123390
|
}
|
|
123286
123391
|
}
|
|
123287
123392
|
return [];
|
|
123288
123393
|
};
|
|
123289
|
-
const res =
|
|
123394
|
+
const res = React155.Children.toArray(children).flatMap(extractOptions);
|
|
123290
123395
|
if (customColumns.data) {
|
|
123291
123396
|
const customColumnsOptions = customColumns.data.map(
|
|
123292
123397
|
(col) => {
|
|
@@ -123477,16 +123582,16 @@ function _FilterBuilder({
|
|
|
123477
123582
|
return { ...prevFilters, filters: [] };
|
|
123478
123583
|
});
|
|
123479
123584
|
};
|
|
123480
|
-
const [columnSearch, setColumnSearch] =
|
|
123481
|
-
|
|
123585
|
+
const [columnSearch, setColumnSearch] = useState81("");
|
|
123586
|
+
useEffect71(() => {
|
|
123482
123587
|
if (columnSearch) {
|
|
123483
123588
|
setAllFiltersExpanded("all-filters");
|
|
123484
123589
|
}
|
|
123485
123590
|
}, [columnSearch]);
|
|
123486
|
-
const [searchText, setSearchText] =
|
|
123487
|
-
const [aiSearchText, setAiSearchText] =
|
|
123488
|
-
const [showAiSearch, setShowAiSearch] =
|
|
123489
|
-
const [similarityThreshold, setSimilarityThreshold] =
|
|
123591
|
+
const [searchText, setSearchText] = useState81("");
|
|
123592
|
+
const [aiSearchText, setAiSearchText] = useState81("");
|
|
123593
|
+
const [showAiSearch, setShowAiSearch] = useState81(false);
|
|
123594
|
+
const [similarityThreshold, setSimilarityThreshold] = useState81(
|
|
123490
123595
|
aiSearchOptions?.similarity ?? 0.3
|
|
123491
123596
|
);
|
|
123492
123597
|
const isAiSearchActive = useMemo82(() => {
|
|
@@ -123516,7 +123621,7 @@ function _FilterBuilder({
|
|
|
123516
123621
|
}));
|
|
123517
123622
|
}
|
|
123518
123623
|
};
|
|
123519
|
-
|
|
123624
|
+
useEffect71(() => {
|
|
123520
123625
|
const search2 = filters.filters.find((x10) => x10.id === SEARCH_ID);
|
|
123521
123626
|
if (search2 && "value" in search2 && typeof search2.value === "string")
|
|
123522
123627
|
setSearchText(search2.value);
|
|
@@ -123728,7 +123833,7 @@ function _FilterBuilder({
|
|
|
123728
123833
|
}
|
|
123729
123834
|
),
|
|
123730
123835
|
/* @__PURE__ */ jsx221("div", { className: "", children: /* @__PURE__ */ jsx221("div", { className: "pl-2 mt-2", children: renderedChildren.map(
|
|
123731
|
-
(childItem, index4) =>
|
|
123836
|
+
(childItem, index4) => React155.cloneElement(childItem, { key: index4 })
|
|
123732
123837
|
) }) })
|
|
123733
123838
|
]
|
|
123734
123839
|
},
|
|
@@ -123753,8 +123858,8 @@ function _FilterBuilder({
|
|
|
123753
123858
|
};
|
|
123754
123859
|
const renderNestedOptions = (children2, level = 0) => {
|
|
123755
123860
|
const items = [];
|
|
123756
|
-
|
|
123757
|
-
if (!
|
|
123861
|
+
React155.Children.forEach(children2, (child) => {
|
|
123862
|
+
if (!React155.isValidElement(child)) return;
|
|
123758
123863
|
const childWithChildren = child;
|
|
123759
123864
|
if (childWithChildren.type === FilterBuilder.NestedOptions) {
|
|
123760
123865
|
const isAdvanced = childWithChildren.props.advanced === true;
|
|
@@ -123778,7 +123883,7 @@ function _FilterBuilder({
|
|
|
123778
123883
|
style: { top: `${currentLevel * 41}px` },
|
|
123779
123884
|
children: /* @__PURE__ */ jsxs131("div", { className: "flex items-center justify-between w-full", children: [
|
|
123780
123885
|
/* @__PURE__ */ jsx221("span", { className: "text-muted-800 text-xs md:text-sm font-semibold tracking-tight", children: childWithChildren.props.title }),
|
|
123781
|
-
/* @__PURE__ */ jsx221("span", { className: "text-xs text-muted-600 bg-muted-100 px-2 md:px-2.5 py-1 rounded-full font-medium", children:
|
|
123886
|
+
/* @__PURE__ */ jsx221("span", { className: "text-xs text-muted-600 bg-muted-100 px-2 md:px-2.5 py-1 rounded-full font-medium", children: React155.Children.count(childWithChildren.props.children) })
|
|
123782
123887
|
] })
|
|
123783
123888
|
}
|
|
123784
123889
|
),
|
|
@@ -123786,14 +123891,14 @@ function _FilterBuilder({
|
|
|
123786
123891
|
childWithChildren.props.children,
|
|
123787
123892
|
currentLevel + 1
|
|
123788
123893
|
).map(
|
|
123789
|
-
(item, index4) =>
|
|
123894
|
+
(item, index4) => React155.cloneElement(item, { key: index4 })
|
|
123790
123895
|
) }) })
|
|
123791
123896
|
]
|
|
123792
123897
|
},
|
|
123793
123898
|
childWithChildren.props.title
|
|
123794
123899
|
)
|
|
123795
123900
|
);
|
|
123796
|
-
} else if (childWithChildren.type ===
|
|
123901
|
+
} else if (childWithChildren.type === React155.Fragment) {
|
|
123797
123902
|
items.push(
|
|
123798
123903
|
...renderNestedOptions(childWithChildren.props.children, level)
|
|
123799
123904
|
);
|
|
@@ -123829,7 +123934,7 @@ function _FilterBuilder({
|
|
|
123829
123934
|
};
|
|
123830
123935
|
return normalizeLayer(filters);
|
|
123831
123936
|
}, [filters, filterOptions, dbSchema, table2]);
|
|
123832
|
-
|
|
123937
|
+
useEffect71(() => {
|
|
123833
123938
|
if (!initQuery) {
|
|
123834
123939
|
return;
|
|
123835
123940
|
}
|
|
@@ -124105,7 +124210,7 @@ function _FilterBuilder({
|
|
|
124105
124210
|
hasRecommendedFilters && propOptions && /* @__PURE__ */ jsxs131("div", { className: "pb-2", children: [
|
|
124106
124211
|
/* @__PURE__ */ jsx221("div", { className: filterStyles.recommendedHeader, children: "Recommended" }),
|
|
124107
124212
|
/* @__PURE__ */ jsx221("div", { className: "space-y-1", children: renderOptionsGroups(propOptions, 0, "recommended").map(
|
|
124108
|
-
(item, index4) =>
|
|
124213
|
+
(item, index4) => React155.cloneElement(item, { key: index4 })
|
|
124109
124214
|
) })
|
|
124110
124215
|
] }),
|
|
124111
124216
|
hasRecommendedFilters && propOptions ? /* @__PURE__ */ jsx221(
|
|
@@ -124122,16 +124227,16 @@ function _FilterBuilder({
|
|
|
124122
124227
|
/* @__PURE__ */ jsx221("span", { className: "text-xs bg-muted-200 text-muted-700 px-2 py-1 rounded-full font-medium", children: filterOptions.length })
|
|
124123
124228
|
] }) }),
|
|
124124
124229
|
/* @__PURE__ */ jsx221(AccordionContent2, { className: "pb-0 pt-0", children: /* @__PURE__ */ jsx221("div", { className: "space-y-1", children: renderOptionsGroups(propOptions, 0, "all").map(
|
|
124125
|
-
(item, index4) =>
|
|
124230
|
+
(item, index4) => React155.cloneElement(item, { key: index4 })
|
|
124126
124231
|
) }) })
|
|
124127
124232
|
] })
|
|
124128
124233
|
}
|
|
124129
124234
|
) : (
|
|
124130
124235
|
// No recommended filters - render normally
|
|
124131
124236
|
/* @__PURE__ */ jsx221(Accordion2, { type: "multiple", className: "space-y-1", children: propOptions ? renderOptionsGroups(propOptions).map(
|
|
124132
|
-
(item, index4) =>
|
|
124237
|
+
(item, index4) => React155.cloneElement(item, { key: index4 })
|
|
124133
124238
|
) : renderNestedOptions(children).map(
|
|
124134
|
-
(item, index4) =>
|
|
124239
|
+
(item, index4) => React155.cloneElement(item, { key: index4 })
|
|
124135
124240
|
) })
|
|
124136
124241
|
)
|
|
124137
124242
|
] }),
|
|
@@ -124442,7 +124547,7 @@ FilterBuilder.NestedOptions = ({ title, children, level = 0 }) => {
|
|
|
124442
124547
|
var FilterBuilder_default = FilterBuilder;
|
|
124443
124548
|
|
|
124444
124549
|
// src/components/FilterBuilder/AutoFilterBuilder.tsx
|
|
124445
|
-
import
|
|
124550
|
+
import React156 from "react";
|
|
124446
124551
|
|
|
124447
124552
|
// src/components/FilterBuilder/generateFilterOptions.ts
|
|
124448
124553
|
function formatColumnName(name2) {
|
|
@@ -124762,10 +124867,10 @@ function AutoFilterBuilder({
|
|
|
124762
124867
|
...props
|
|
124763
124868
|
}) {
|
|
124764
124869
|
const schemaMetadata = useSchema2();
|
|
124765
|
-
const mainTableOptions =
|
|
124870
|
+
const mainTableOptions = React156.useMemo(() => {
|
|
124766
124871
|
return generateFilterOptionsFromConfig(config2, schemaMetadata);
|
|
124767
124872
|
}, [config2, schemaMetadata]);
|
|
124768
|
-
const optionsProp =
|
|
124873
|
+
const optionsProp = React156.useMemo(() => {
|
|
124769
124874
|
const root3 = [];
|
|
124770
124875
|
const markRecommended = (option) => {
|
|
124771
124876
|
if (!config2.recommendedColumns?.length) return option;
|
|
@@ -124849,7 +124954,7 @@ function AutoFilterBuilder({
|
|
|
124849
124954
|
}
|
|
124850
124955
|
|
|
124851
124956
|
// src/components/FilterBuilder/FilterBuilderInitQuery.ts
|
|
124852
|
-
import { useEffect as
|
|
124957
|
+
import { useEffect as useEffect72, useState as useState82 } from "react";
|
|
124853
124958
|
import { newUuid } from "@pol-studios/utils";
|
|
124854
124959
|
function getSearchParams() {
|
|
124855
124960
|
if (typeof window === "undefined") {
|
|
@@ -124915,8 +125020,8 @@ function createFilter(filterConfig, query) {
|
|
|
124915
125020
|
};
|
|
124916
125021
|
}
|
|
124917
125022
|
function useFilterBuilderInitQuery(initQuery, filterOptions) {
|
|
124918
|
-
const [filters, setFilters] =
|
|
124919
|
-
|
|
125023
|
+
const [filters, setFilters] = useState82(null);
|
|
125024
|
+
useEffect72(() => {
|
|
124920
125025
|
if (!initQuery) {
|
|
124921
125026
|
return;
|
|
124922
125027
|
}
|
|
@@ -125082,13 +125187,13 @@ var filterLayerToInitQuery = (root3) => {
|
|
|
125082
125187
|
import {
|
|
125083
125188
|
createContext as createContext24,
|
|
125084
125189
|
useContext as useContext33,
|
|
125085
|
-
useState as
|
|
125190
|
+
useState as useState88,
|
|
125086
125191
|
useCallback as useCallback57,
|
|
125087
125192
|
useMemo as useMemo84
|
|
125088
125193
|
} from "react";
|
|
125089
125194
|
|
|
125090
125195
|
// src/components/chat-agent/ChatAgentDialog.tsx
|
|
125091
|
-
import { useRef as useRef54, useEffect as
|
|
125196
|
+
import { useRef as useRef54, useEffect as useEffect75, useState as useState87, useCallback as useCallback55 } from "react";
|
|
125092
125197
|
import {
|
|
125093
125198
|
Sparkles,
|
|
125094
125199
|
RotateCcw,
|
|
@@ -125099,7 +125204,7 @@ import {
|
|
|
125099
125204
|
import { cn as cn125 } from "@pol-studios/utils";
|
|
125100
125205
|
|
|
125101
125206
|
// src/components/chat-agent/useChatAgent.ts
|
|
125102
|
-
import { useState as
|
|
125207
|
+
import { useState as useState83, useCallback as useCallback52, useRef as useRef53, useEffect as useEffect73 } from "react";
|
|
125103
125208
|
import { useSetupAuth as useSetupAuth5 } from "@pol-studios/db/auth";
|
|
125104
125209
|
import { getSupabaseUrl, useSupabase as useSupabase8 } from "@pol-studios/db";
|
|
125105
125210
|
var initialState3 = {
|
|
@@ -125113,7 +125218,7 @@ var initialState3 = {
|
|
|
125113
125218
|
error: null
|
|
125114
125219
|
};
|
|
125115
125220
|
function useChatAgent() {
|
|
125116
|
-
const [state, setState] =
|
|
125221
|
+
const [state, setState] = useState83(initialState3);
|
|
125117
125222
|
const auth = useSetupAuth5();
|
|
125118
125223
|
const supabase = useSupabase8();
|
|
125119
125224
|
const abortControllerRef = useRef53(null);
|
|
@@ -125121,7 +125226,7 @@ function useChatAgent() {
|
|
|
125121
125226
|
const currentResponseRef = useRef53("");
|
|
125122
125227
|
const currentThinkingRef = useRef53("");
|
|
125123
125228
|
const currentToolsRef = useRef53([]);
|
|
125124
|
-
|
|
125229
|
+
useEffect73(() => {
|
|
125125
125230
|
return () => {
|
|
125126
125231
|
if (abortControllerRef.current) {
|
|
125127
125232
|
abortControllerRef.current.abort();
|
|
@@ -125508,13 +125613,13 @@ function SuggestionChip({ text: text6, onClick }) {
|
|
|
125508
125613
|
import { Database, Brain, RefreshCw as RefreshCw3, Copy as Copy2, Check as Check6 } from "lucide-react";
|
|
125509
125614
|
|
|
125510
125615
|
// src/components/chat-agent/components/CodeBlock.tsx
|
|
125511
|
-
import { useState as
|
|
125616
|
+
import { useState as useState84, useCallback as useCallback53 } from "react";
|
|
125512
125617
|
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
|
125513
125618
|
import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
125514
125619
|
import { Check as Check5, Copy } from "lucide-react";
|
|
125515
125620
|
import { Fragment as Fragment42, jsx as jsx225, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
125516
125621
|
function CodeBlock({ language, children }) {
|
|
125517
|
-
const [copied, setCopied] =
|
|
125622
|
+
const [copied, setCopied] = useState84(false);
|
|
125518
125623
|
const handleCopy = useCallback53(async () => {
|
|
125519
125624
|
await navigator.clipboard.writeText(children);
|
|
125520
125625
|
setCopied(true);
|
|
@@ -127494,7 +127599,7 @@ var urlAttributes = {
|
|
|
127494
127599
|
|
|
127495
127600
|
// ../../../node_modules/.pnpm/react-markdown@9.1.0_@types+react@19.2.2_react@19.1.1/node_modules/react-markdown/lib/index.js
|
|
127496
127601
|
import { Fragment as Fragment43, jsx as jsx227, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
127497
|
-
import { createElement as
|
|
127602
|
+
import { createElement as createElement24, useEffect as useEffect74, useState as useState85 } from "react";
|
|
127498
127603
|
|
|
127499
127604
|
// ../../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
127500
127605
|
var emptyOptions2 = {};
|
|
@@ -137091,7 +137196,7 @@ function defaultUrlTransform(value) {
|
|
|
137091
137196
|
}
|
|
137092
137197
|
|
|
137093
137198
|
// src/components/chat-agent/components/MessageBubble.tsx
|
|
137094
|
-
import { useCallback as useCallback54, useMemo as useMemo83, useState as
|
|
137199
|
+
import { useCallback as useCallback54, useMemo as useMemo83, useState as useState86 } from "react";
|
|
137095
137200
|
import { Fragment as Fragment44, jsx as jsx228, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
137096
137201
|
function parseEntityRef(href) {
|
|
137097
137202
|
const match = href.match(/^entity:(\w+):([\w-]+)(?::([\w-]+))?$/);
|
|
@@ -137124,8 +137229,8 @@ function cleanBrokenDownloadLinks(content3) {
|
|
|
137124
137229
|
}
|
|
137125
137230
|
function MessageBubble({ message, isStreaming, onNavigate, resolveEntityRoute, onRegenerate }) {
|
|
137126
137231
|
const isUser = message.role === "user";
|
|
137127
|
-
const [showReasoning, setShowReasoning] =
|
|
137128
|
-
const [copied, setCopied] =
|
|
137232
|
+
const [showReasoning, setShowReasoning] = useState86(false);
|
|
137233
|
+
const [copied, setCopied] = useState86(false);
|
|
137129
137234
|
const handleCopy = useCallback54(() => {
|
|
137130
137235
|
navigator.clipboard.writeText(message.content);
|
|
137131
137236
|
setCopied(true);
|
|
@@ -137379,15 +137484,15 @@ function ChatAgentDialog({
|
|
|
137379
137484
|
reset,
|
|
137380
137485
|
clearError
|
|
137381
137486
|
} = useChatAgent();
|
|
137382
|
-
const [inputValue, setInputValue] =
|
|
137487
|
+
const [inputValue, setInputValue] = useState87("");
|
|
137383
137488
|
const messagesEndRef = useRef54(null);
|
|
137384
137489
|
const textareaRef = useRef54(null);
|
|
137385
|
-
|
|
137490
|
+
useEffect75(() => {
|
|
137386
137491
|
if (isOpen) {
|
|
137387
137492
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
137388
137493
|
}
|
|
137389
137494
|
}, [messages, thinkingSummary, isOpen]);
|
|
137390
|
-
|
|
137495
|
+
useEffect75(() => {
|
|
137391
137496
|
if (textareaRef.current) {
|
|
137392
137497
|
textareaRef.current.style.height = "auto";
|
|
137393
137498
|
textareaRef.current.style.height = `${Math.min(textareaRef.current.scrollHeight, 120)}px`;
|
|
@@ -137575,10 +137680,10 @@ function ChatAgentDialog({
|
|
|
137575
137680
|
}
|
|
137576
137681
|
|
|
137577
137682
|
// src/hooks/useKeyboardShortcuts.ts
|
|
137578
|
-
import { useEffect as
|
|
137683
|
+
import { useEffect as useEffect76, useCallback as useCallback56, useRef as useRef55 } from "react";
|
|
137579
137684
|
function useKeyboardShortcuts({ shortcuts, enabled = true }) {
|
|
137580
137685
|
const shortcutsRef = useRef55(shortcuts);
|
|
137581
|
-
|
|
137686
|
+
useEffect76(() => {
|
|
137582
137687
|
shortcutsRef.current = shortcuts;
|
|
137583
137688
|
}, [shortcuts]);
|
|
137584
137689
|
const handleKeyDown = useCallback56(
|
|
@@ -137622,7 +137727,7 @@ function useKeyboardShortcuts({ shortcuts, enabled = true }) {
|
|
|
137622
137727
|
},
|
|
137623
137728
|
[enabled]
|
|
137624
137729
|
);
|
|
137625
|
-
|
|
137730
|
+
useEffect76(() => {
|
|
137626
137731
|
if (!enabled) return;
|
|
137627
137732
|
window.addEventListener("keydown", handleKeyDown);
|
|
137628
137733
|
return () => {
|
|
@@ -137669,7 +137774,7 @@ function ChatAgentProvider({
|
|
|
137669
137774
|
onNavigate,
|
|
137670
137775
|
resolveEntityRoute
|
|
137671
137776
|
}) {
|
|
137672
|
-
const [isOpen, setIsOpen] =
|
|
137777
|
+
const [isOpen, setIsOpen] = useState88(false);
|
|
137673
137778
|
const open = useCallback57(() => setIsOpen(true), []);
|
|
137674
137779
|
const close = useCallback57(() => setIsOpen(false), []);
|
|
137675
137780
|
const toggle2 = useCallback57(() => setIsOpen((prev) => !prev), []);
|
|
@@ -137720,12 +137825,12 @@ function ChatAgentProvider({
|
|
|
137720
137825
|
}
|
|
137721
137826
|
|
|
137722
137827
|
// src/components/chat-agent/ChatAgentButton.tsx
|
|
137723
|
-
import { useState as
|
|
137828
|
+
import { useState as useState89 } from "react";
|
|
137724
137829
|
import { MessageSquare as MessageSquare2, Sparkles as Sparkles2 } from "lucide-react";
|
|
137725
137830
|
import { cn as cn126 } from "@pol-studios/utils";
|
|
137726
137831
|
import { jsx as jsx234, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
137727
137832
|
function ChatAgentButton({ onClick }) {
|
|
137728
|
-
const [isHovered, setIsHovered] =
|
|
137833
|
+
const [isHovered, setIsHovered] = useState89(false);
|
|
137729
137834
|
const shortcutDisplay = formatShortcut({
|
|
137730
137835
|
key: "k",
|
|
137731
137836
|
ctrl: true,
|
|
@@ -137792,7 +137897,7 @@ function ChatAgentButton({ onClick }) {
|
|
|
137792
137897
|
}
|
|
137793
137898
|
|
|
137794
137899
|
// src/components/comments/PolCommentSection.tsx
|
|
137795
|
-
import { useEffect as
|
|
137900
|
+
import { useEffect as useEffect77, useMemo as useMemo85, useState as useState90 } from "react";
|
|
137796
137901
|
|
|
137797
137902
|
// src/nav/UserProfilePicture.tsx
|
|
137798
137903
|
import { cn as cn127, isUsable as isUsable34 } from "@pol-studios/utils";
|
|
@@ -137879,11 +137984,11 @@ import { ChevronDown as ChevronDown7, ChevronUp as ChevronUp3, X as X15, MoreVer
|
|
|
137879
137984
|
import { CommentProvider as CommentSectionProvider, useComments as useCommentSection } from "@pol-studios/features";
|
|
137880
137985
|
|
|
137881
137986
|
// src/primitives/separator.tsx
|
|
137882
|
-
import * as
|
|
137987
|
+
import * as React157 from "react";
|
|
137883
137988
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
137884
137989
|
import { cn as cn128 } from "@pol-studios/utils";
|
|
137885
137990
|
import { jsx as jsx236 } from "react/jsx-runtime";
|
|
137886
|
-
var Separator2 =
|
|
137991
|
+
var Separator2 = React157.forwardRef(
|
|
137887
137992
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx236(
|
|
137888
137993
|
SeparatorPrimitive.Root,
|
|
137889
137994
|
{
|
|
@@ -137930,7 +138035,7 @@ var Comment = ({
|
|
|
137930
138035
|
isFirst
|
|
137931
138036
|
}) => {
|
|
137932
138037
|
const { setQuote, showMore, setShowMore, readComment, deleteComment } = useCommentSection();
|
|
137933
|
-
|
|
138038
|
+
useEffect77(() => {
|
|
137934
138039
|
readComment(comment.id);
|
|
137935
138040
|
}, []);
|
|
137936
138041
|
const supabase = useSupabase9();
|
|
@@ -137981,7 +138086,7 @@ var Comment = ({
|
|
|
137981
138086
|
] }) })
|
|
137982
138087
|
] });
|
|
137983
138088
|
}, [parent.data, parentAuthor.data]);
|
|
137984
|
-
const [isHovering, setIsHovering] =
|
|
138089
|
+
const [isHovering, setIsHovering] = useState90(false);
|
|
137985
138090
|
const onMouseEnter = () => {
|
|
137986
138091
|
setIsHovering(true);
|
|
137987
138092
|
};
|
|
@@ -138238,7 +138343,7 @@ var ReactionManager = ({
|
|
|
138238
138343
|
};
|
|
138239
138344
|
|
|
138240
138345
|
// src/components/sdk/AddUserDropdown.tsx
|
|
138241
|
-
import { useEffect as
|
|
138346
|
+
import { useEffect as useEffect78, useState as useState91 } from "react";
|
|
138242
138347
|
import { useSupabase as useSupabase10, useDbQuery as useDbQuery7 } from "@pol-studios/db";
|
|
138243
138348
|
import { useSearchQuery as useSearchQuery3 } from "@pol-studios/db";
|
|
138244
138349
|
import { isUsable as isUsable36 } from "@pol-studios/utils/types";
|
|
@@ -138253,9 +138358,9 @@ function AddUserDropdown({
|
|
|
138253
138358
|
className,
|
|
138254
138359
|
...props
|
|
138255
138360
|
}) {
|
|
138256
|
-
const [searchText, setSearchText] =
|
|
138361
|
+
const [searchText, setSearchText] = useState91("");
|
|
138257
138362
|
const supabase = useSupabase10();
|
|
138258
|
-
|
|
138363
|
+
useEffect78(() => {
|
|
138259
138364
|
console.log("query changed");
|
|
138260
138365
|
}, [searchText]);
|
|
138261
138366
|
const usersRequest = useDbQuery7(
|
|
@@ -138291,7 +138396,7 @@ function AddUserDropdown({
|
|
|
138291
138396
|
// src/components/sdk/PatternDropdown.tsx
|
|
138292
138397
|
import { Pattern, useDbRealtimeQuery as useDbRealtimeQuery4, useSupabase as useSupabase11 } from "@pol-studios/db";
|
|
138293
138398
|
import { useSearchQuery as useSearchQuery4 } from "@pol-studios/db";
|
|
138294
|
-
import { useMemo as useMemo86, useState as
|
|
138399
|
+
import { useMemo as useMemo86, useState as useState92 } from "react";
|
|
138295
138400
|
import { jsx as jsx239 } from "react/jsx-runtime";
|
|
138296
138401
|
function PatternDropdown({
|
|
138297
138402
|
onChange,
|
|
@@ -138304,7 +138409,7 @@ function PatternDropdown({
|
|
|
138304
138409
|
const pattern1Request = useDbRealtimeQuery4(
|
|
138305
138410
|
supabase.from("Pattern").select("*", { count: "exact" }).eq("id", patternId).single()
|
|
138306
138411
|
);
|
|
138307
|
-
const [searchText, setSearchText] =
|
|
138412
|
+
const [searchText, setSearchText] = useState92("");
|
|
138308
138413
|
const pattern = pattern1Request.data;
|
|
138309
138414
|
const goboRequest = useDbRealtimeQuery4(
|
|
138310
138415
|
useSearchQuery4(
|
|
@@ -138409,10 +138514,10 @@ function camelToWords(str) {
|
|
|
138409
138514
|
}
|
|
138410
138515
|
|
|
138411
138516
|
// src/components/utils/useDebounce.tsx
|
|
138412
|
-
import { useEffect as
|
|
138517
|
+
import { useEffect as useEffect79, useState as useState93 } from "react";
|
|
138413
138518
|
function useDebounce(value, delay2) {
|
|
138414
|
-
const [debouncedValue, setDebouncedValue] =
|
|
138415
|
-
|
|
138519
|
+
const [debouncedValue, setDebouncedValue] = useState93(value);
|
|
138520
|
+
useEffect79(
|
|
138416
138521
|
() => {
|
|
138417
138522
|
const handler = setTimeout(() => {
|
|
138418
138523
|
setDebouncedValue(value);
|
|
@@ -138430,9 +138535,9 @@ function useDebounce(value, delay2) {
|
|
|
138430
138535
|
}
|
|
138431
138536
|
|
|
138432
138537
|
// src/components/utils/useLocalStorage.tsx
|
|
138433
|
-
import { useCallback as useCallback58, useState as
|
|
138538
|
+
import { useCallback as useCallback58, useState as useState94 } from "react";
|
|
138434
138539
|
function useLocalStorage(key2, initialValue) {
|
|
138435
|
-
const [storedValue, setStoredValue] =
|
|
138540
|
+
const [storedValue, setStoredValue] = useState94(() => {
|
|
138436
138541
|
try {
|
|
138437
138542
|
const item = window.localStorage.getItem(key2);
|
|
138438
138543
|
return item ? JSON.parse(item) : initialValue;
|
|
@@ -138480,11 +138585,11 @@ var Protected = ({ accessLevel, children }) => {
|
|
|
138480
138585
|
var Protected_default = Protected;
|
|
138481
138586
|
|
|
138482
138587
|
// src/primitives/avatar.tsx
|
|
138483
|
-
import * as
|
|
138588
|
+
import * as React160 from "react";
|
|
138484
138589
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
138485
138590
|
import { cn as cn129 } from "@pol-studios/utils";
|
|
138486
138591
|
import { jsx as jsx240 } from "react/jsx-runtime";
|
|
138487
|
-
var Avatar =
|
|
138592
|
+
var Avatar = React160.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx240(
|
|
138488
138593
|
AvatarPrimitive.Root,
|
|
138489
138594
|
{
|
|
138490
138595
|
ref,
|
|
@@ -138496,7 +138601,7 @@ var Avatar = React159.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
138496
138601
|
}
|
|
138497
138602
|
));
|
|
138498
138603
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
138499
|
-
var AvatarImage =
|
|
138604
|
+
var AvatarImage = React160.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx240(
|
|
138500
138605
|
AvatarPrimitive.Image,
|
|
138501
138606
|
{
|
|
138502
138607
|
ref,
|
|
@@ -138505,7 +138610,7 @@ var AvatarImage = React159.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
138505
138610
|
}
|
|
138506
138611
|
));
|
|
138507
138612
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
138508
|
-
var AvatarFallback =
|
|
138613
|
+
var AvatarFallback = React160.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx240(
|
|
138509
138614
|
AvatarPrimitive.Fallback,
|
|
138510
138615
|
{
|
|
138511
138616
|
ref,
|
|
@@ -138594,10 +138699,10 @@ function CardRow({
|
|
|
138594
138699
|
}
|
|
138595
138700
|
|
|
138596
138701
|
// src/cards/GlassmorphicCard.tsx
|
|
138597
|
-
import
|
|
138702
|
+
import React161 from "react";
|
|
138598
138703
|
import { cn as cn132 } from "@pol-studios/utils";
|
|
138599
138704
|
import { jsx as jsx244 } from "react/jsx-runtime";
|
|
138600
|
-
var GlassmorphicCard =
|
|
138705
|
+
var GlassmorphicCard = React161.forwardRef(
|
|
138601
138706
|
({ children, className, intensity = "medium", ...props }, ref) => {
|
|
138602
138707
|
const intensityStyles = {
|
|
138603
138708
|
subtle: [
|
|
@@ -138821,20 +138926,20 @@ function useDataAdapterOptional() {
|
|
|
138821
138926
|
}
|
|
138822
138927
|
|
|
138823
138928
|
// src/providers/data/hooks/useDataQuery.ts
|
|
138824
|
-
import { useState as
|
|
138929
|
+
import { useState as useState95, useEffect as useEffect80, useCallback as useCallback59, useRef as useRef56, useMemo as useMemo88 } from "react";
|
|
138825
138930
|
function useDataQueryById(table2, id, options = {}) {
|
|
138826
138931
|
const context = useDataAdapterOptional();
|
|
138827
138932
|
const adapter = context?.adapter;
|
|
138828
138933
|
const { enabled = true, onSuccess, onError, onSettled, retry, retryDelay } = options;
|
|
138829
|
-
const [data, setData] =
|
|
138830
|
-
const [error2, setError] =
|
|
138831
|
-
const [isLoading, setIsLoading] =
|
|
138832
|
-
const [isFetching, setIsFetching] =
|
|
138934
|
+
const [data, setData] = useState95(void 0);
|
|
138935
|
+
const [error2, setError] = useState95(null);
|
|
138936
|
+
const [isLoading, setIsLoading] = useState95(false);
|
|
138937
|
+
const [isFetching, setIsFetching] = useState95(false);
|
|
138833
138938
|
const retryCountRef = useRef56(0);
|
|
138834
138939
|
const onSuccessRef = useRef56(onSuccess);
|
|
138835
138940
|
const onErrorRef = useRef56(onError);
|
|
138836
138941
|
const onSettledRef = useRef56(onSettled);
|
|
138837
|
-
|
|
138942
|
+
useEffect80(() => {
|
|
138838
138943
|
onSuccessRef.current = onSuccess;
|
|
138839
138944
|
onErrorRef.current = onError;
|
|
138840
138945
|
onSettledRef.current = onSettled;
|
|
@@ -138891,7 +138996,7 @@ function useDataQueryById(table2, id, options = {}) {
|
|
|
138891
138996
|
refetch
|
|
138892
138997
|
};
|
|
138893
138998
|
}, [fetchData]);
|
|
138894
|
-
|
|
138999
|
+
useEffect80(() => {
|
|
138895
139000
|
if (enabled && adapter && id) {
|
|
138896
139001
|
fetchData();
|
|
138897
139002
|
}
|
|
@@ -138998,7 +139103,7 @@ function UserProfilePicture2({
|
|
|
138998
139103
|
}
|
|
138999
139104
|
|
|
139000
139105
|
// src/crud/UpdateEntity.tsx
|
|
139001
|
-
import { useCallback as useCallback60, useEffect as
|
|
139106
|
+
import { useCallback as useCallback60, useEffect as useEffect81, useState as useState96 } from "react";
|
|
139002
139107
|
import { useDbUpsert as useDbUpsert5, useDbDelete as useDbDelete4 } from "@pol-studios/db";
|
|
139003
139108
|
import { jsx as jsx248, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
139004
139109
|
var UpdateEntity = ({
|
|
@@ -139008,17 +139113,17 @@ var UpdateEntity = ({
|
|
|
139008
139113
|
tableName,
|
|
139009
139114
|
showDelete = false
|
|
139010
139115
|
}) => {
|
|
139011
|
-
const [open, setOpen] =
|
|
139012
|
-
const [updatedEntity, setUpdatedEntity] =
|
|
139116
|
+
const [open, setOpen] = useState96(false);
|
|
139117
|
+
const [updatedEntity, setUpdatedEntity] = useState96(null);
|
|
139013
139118
|
const mutate = useDbUpsert5(tableName);
|
|
139014
|
-
const [isLoading, setIsLoading] =
|
|
139119
|
+
const [isLoading, setIsLoading] = useState96(false);
|
|
139015
139120
|
const deleteMutation = useDbDelete4(tableName);
|
|
139016
139121
|
const handleDelete = async () => {
|
|
139017
139122
|
setIsLoading(true);
|
|
139018
139123
|
await deleteMutation.mutateAsync(entity);
|
|
139019
139124
|
setIsLoading(false);
|
|
139020
139125
|
};
|
|
139021
|
-
|
|
139126
|
+
useEffect81(() => {
|
|
139022
139127
|
if (!open) return;
|
|
139023
139128
|
setUpdatedEntity(entity);
|
|
139024
139129
|
}, [open, entity]);
|
|
@@ -139102,7 +139207,7 @@ var UpdateEntity = ({
|
|
|
139102
139207
|
var UpdateEntity_default = UpdateEntity;
|
|
139103
139208
|
|
|
139104
139209
|
// src/contexts/contexts/core/SelectedItemsContext.tsx
|
|
139105
|
-
import { createContext as createContext26, useEffect as
|
|
139210
|
+
import { createContext as createContext26, useEffect as useEffect82, useState as useState97 } from "react";
|
|
139106
139211
|
import { isUsable as isUsable38 } from "@pol-studios/utils";
|
|
139107
139212
|
import { jsx as jsx249 } from "react/jsx-runtime";
|
|
139108
139213
|
var defaultContextValue2 = {
|
|
@@ -139124,12 +139229,12 @@ var defaultContextValue2 = {
|
|
|
139124
139229
|
function createSelectedItemsContext() {
|
|
139125
139230
|
const context = createContext26(defaultContextValue2);
|
|
139126
139231
|
const Provider = ({ children, Items, initialSelectedItems = [] }) => {
|
|
139127
|
-
const [selectedItems, setSelectedItems] =
|
|
139128
|
-
const [items, setItems] =
|
|
139129
|
-
|
|
139232
|
+
const [selectedItems, setSelectedItems] = useState97(initialSelectedItems);
|
|
139233
|
+
const [items, setItems] = useState97([]);
|
|
139234
|
+
useEffect82(() => {
|
|
139130
139235
|
setItems(Items);
|
|
139131
139236
|
}, [Items]);
|
|
139132
|
-
|
|
139237
|
+
useEffect82(() => {
|
|
139133
139238
|
setSelectedItems(
|
|
139134
139239
|
(previousItems) => previousItems.map((x10) => Items.find((i16) => i16.id == x10.id)).filter((x10) => x10 != null)
|
|
139135
139240
|
);
|
|
@@ -139189,11 +139294,11 @@ var TimeActivityDropdownContext = createContext27(
|
|
|
139189
139294
|
import { redirect } from "@tanstack/react-router";
|
|
139190
139295
|
|
|
139191
139296
|
// src/charts/CircleChartCard.tsx
|
|
139192
|
-
import
|
|
139297
|
+
import React165 from "react";
|
|
139193
139298
|
import { Link as Link4 } from "@tanstack/react-router";
|
|
139194
139299
|
import { jsx as jsx250, jsxs as jsxs147 } from "react/jsx-runtime";
|
|
139195
|
-
import { createElement as
|
|
139196
|
-
var CircleChartCard =
|
|
139300
|
+
import { createElement as createElement25 } from "react";
|
|
139301
|
+
var CircleChartCard = React165.forwardRef(({ className, title, categories, color: color3, chartData, ...props }, ref) => {
|
|
139197
139302
|
function getColor(name2, index4) {
|
|
139198
139303
|
const category = categories.find(
|
|
139199
139304
|
(c14) => c14.name.toLowerCase() === name2.toLowerCase()
|
|
@@ -139272,7 +139377,7 @@ var CircleChartCard = React164.forwardRef(({ className, title, categories, color
|
|
|
139272
139377
|
)
|
|
139273
139378
|
}
|
|
139274
139379
|
),
|
|
139275
|
-
/* @__PURE__ */ jsx250("div", { className: "flex w-full flex-col justify-center gap-4 p-4 text-tiny text-default-500 lg:p-0", children: categories.map((category, index4) => /* @__PURE__ */ jsx250("div", { onClick: category.onClick, children: /* @__PURE__ */
|
|
139380
|
+
/* @__PURE__ */ jsx250("div", { className: "flex w-full flex-col justify-center gap-4 p-4 text-tiny text-default-500 lg:p-0", children: categories.map((category, index4) => /* @__PURE__ */ jsx250("div", { onClick: category.onClick, children: /* @__PURE__ */ createElement25(
|
|
139276
139381
|
Link4,
|
|
139277
139382
|
{
|
|
139278
139383
|
...category.href,
|
|
@@ -139299,8 +139404,8 @@ var CircleChartCard_default = CircleChartCard;
|
|
|
139299
139404
|
// src/charts/generator/ChartGenerator.tsx
|
|
139300
139405
|
import {
|
|
139301
139406
|
useMemo as useMemo96,
|
|
139302
|
-
useState as
|
|
139303
|
-
useEffect as
|
|
139407
|
+
useState as useState101,
|
|
139408
|
+
useEffect as useEffect84,
|
|
139304
139409
|
useCallback as useCallback62,
|
|
139305
139410
|
useId as useId16
|
|
139306
139411
|
} from "react";
|
|
@@ -139344,7 +139449,7 @@ var BaseChartCard = ({
|
|
|
139344
139449
|
};
|
|
139345
139450
|
|
|
139346
139451
|
// src/charts/generator/ChartRenderer.tsx
|
|
139347
|
-
import { useEffect as
|
|
139452
|
+
import { useEffect as useEffect83, useState as useState99 } from "react";
|
|
139348
139453
|
|
|
139349
139454
|
// src/charts/recharts/RechartsPieChart.tsx
|
|
139350
139455
|
import { useMemo as useMemo89 } from "react";
|
|
@@ -140744,7 +140849,7 @@ var RechartsGaugeChart = ({
|
|
|
140744
140849
|
};
|
|
140745
140850
|
|
|
140746
140851
|
// src/charts/recharts/RechartsHeatmapChart.tsx
|
|
140747
|
-
import { useMemo as useMemo94, useState as
|
|
140852
|
+
import { useMemo as useMemo94, useState as useState98, useCallback as useCallback61 } from "react";
|
|
140748
140853
|
import { jsx as jsx257, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
140749
140854
|
function parseRgb(color3) {
|
|
140750
140855
|
const match = color3.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
|
|
@@ -140792,7 +140897,7 @@ var RechartsHeatmapChart = ({
|
|
|
140792
140897
|
onClick,
|
|
140793
140898
|
showValues = false
|
|
140794
140899
|
}) => {
|
|
140795
|
-
const [tooltip, setTooltip] =
|
|
140900
|
+
const [tooltip, setTooltip] = useState98({
|
|
140796
140901
|
visible: false,
|
|
140797
140902
|
x: 0,
|
|
140798
140903
|
y: 0,
|
|
@@ -141284,8 +141389,8 @@ var ChartRenderer = ({
|
|
|
141284
141389
|
showLegend,
|
|
141285
141390
|
containerRef
|
|
141286
141391
|
}) => {
|
|
141287
|
-
const [containerWidth, setContainerWidth] =
|
|
141288
|
-
|
|
141392
|
+
const [containerWidth, setContainerWidth] = useState99(0);
|
|
141393
|
+
useEffect83(() => {
|
|
141289
141394
|
if (!containerRef?.current) return;
|
|
141290
141395
|
const observer = new ResizeObserver((entries) => {
|
|
141291
141396
|
const width = entries[0]?.contentRect.width ?? 0;
|
|
@@ -141478,7 +141583,7 @@ var ChartGridView = ({
|
|
|
141478
141583
|
var ChartGridView_default = ChartGridView;
|
|
141479
141584
|
|
|
141480
141585
|
// src/charts/generator/Sidebar.tsx
|
|
141481
|
-
import
|
|
141586
|
+
import React175 from "react";
|
|
141482
141587
|
|
|
141483
141588
|
// src/charts/generator/types.ts
|
|
141484
141589
|
function hasTopValuesData(data) {
|
|
@@ -141531,7 +141636,7 @@ var ChartSidebar = ({
|
|
|
141531
141636
|
displayData,
|
|
141532
141637
|
tabConfig
|
|
141533
141638
|
}) => {
|
|
141534
|
-
const TopValuesSection =
|
|
141639
|
+
const TopValuesSection = React175.useCallback(
|
|
141535
141640
|
() => /* @__PURE__ */ jsxs158("div", { className: "space-y-3", children: [
|
|
141536
141641
|
/* @__PURE__ */ jsx262("h3", { className: "text-sm font-semibold text-muted-700 uppercase tracking-wide", children: "Chart Display" }),
|
|
141537
141642
|
/* @__PURE__ */ jsxs158("div", { className: "space-y-2", children: [
|
|
@@ -141555,7 +141660,7 @@ var ChartSidebar = ({
|
|
|
141555
141660
|
] }),
|
|
141556
141661
|
[topValuesLimit, setTopValuesLimit]
|
|
141557
141662
|
);
|
|
141558
|
-
const FilterModeSection =
|
|
141663
|
+
const FilterModeSection = React175.useCallback(
|
|
141559
141664
|
() => /* @__PURE__ */ jsxs158("div", { className: "space-y-3", children: [
|
|
141560
141665
|
/* @__PURE__ */ jsxs158("div", { className: "flex items-center justify-between gap-2", children: [
|
|
141561
141666
|
/* @__PURE__ */ jsx262("h3", { className: "text-sm font-semibold text-muted-700 uppercase tracking-wide", children: "Filter Mode" }),
|
|
@@ -141592,7 +141697,7 @@ var ChartSidebar = ({
|
|
|
141592
141697
|
] }),
|
|
141593
141698
|
[filterMode, setFilterMode, isFilterLoading, displayData.length]
|
|
141594
141699
|
);
|
|
141595
|
-
const NavigationSection =
|
|
141700
|
+
const NavigationSection = React175.useCallback(
|
|
141596
141701
|
() => /* @__PURE__ */ jsxs158("div", { className: "space-y-3", children: [
|
|
141597
141702
|
/* @__PURE__ */ jsx262("h3", { className: "text-sm font-semibold text-muted-700 uppercase tracking-wide", children: "Views" }),
|
|
141598
141703
|
/* @__PURE__ */ jsx262("div", { className: "space-y-2", children: tabConfig.map((tab2) => /* @__PURE__ */ jsxs158(
|
|
@@ -141622,7 +141727,7 @@ var ChartSidebar = ({
|
|
|
141622
141727
|
isFilterLoading
|
|
141623
141728
|
]
|
|
141624
141729
|
);
|
|
141625
|
-
const sidebarContent =
|
|
141730
|
+
const sidebarContent = React175.useMemo(
|
|
141626
141731
|
() => /* @__PURE__ */ jsxs158(Fragment47, { children: [
|
|
141627
141732
|
/* @__PURE__ */ jsx262(TopValuesSection, {}),
|
|
141628
141733
|
/* @__PURE__ */ jsx262(FilterModeSection, {}),
|
|
@@ -141762,7 +141867,7 @@ var VisualizerSkeleton = ({ title }) => {
|
|
|
141762
141867
|
var VisualizerSkeleton_default = VisualizerSkeleton;
|
|
141763
141868
|
|
|
141764
141869
|
// src/charts/ListViewModal.tsx
|
|
141765
|
-
import { useState as
|
|
141870
|
+
import { useState as useState100 } from "react";
|
|
141766
141871
|
import { jsx as jsx265, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
141767
141872
|
var ListViewModal = ({
|
|
141768
141873
|
isOpen,
|
|
@@ -141772,7 +141877,7 @@ var ListViewModal = ({
|
|
|
141772
141877
|
filterLogic,
|
|
141773
141878
|
className = ""
|
|
141774
141879
|
}) => {
|
|
141775
|
-
const [searchTerm, setSearchTerm] =
|
|
141880
|
+
const [searchTerm, setSearchTerm] = useState100("");
|
|
141776
141881
|
const filteredData = data.filter(
|
|
141777
141882
|
(item) => item.name?.toLowerCase().includes(searchTerm.toLowerCase())
|
|
141778
141883
|
);
|
|
@@ -141870,9 +141975,9 @@ var ChartGenerator = ({
|
|
|
141870
141975
|
fieldName: "",
|
|
141871
141976
|
chartId: ""
|
|
141872
141977
|
});
|
|
141873
|
-
const [previousData, setPreviousData] =
|
|
141874
|
-
const [hasHadData, setHasHadData] =
|
|
141875
|
-
|
|
141978
|
+
const [previousData, setPreviousData] = useState101([]);
|
|
141979
|
+
const [hasHadData, setHasHadData] = useState101(false);
|
|
141980
|
+
useEffect84(() => {
|
|
141876
141981
|
if (data) {
|
|
141877
141982
|
setPreviousData(data);
|
|
141878
141983
|
setHasHadData(true);
|
|
@@ -142040,7 +142145,7 @@ var resolveBreadcrumbLabel = async (label, supabase, pathname) => {
|
|
|
142040
142145
|
import { cn as cn138 } from "@pol-studios/utils";
|
|
142041
142146
|
|
|
142042
142147
|
// src/nav/aceternity/Breadcrumbs.tsx
|
|
142043
|
-
import
|
|
142148
|
+
import React178, { useEffect as useEffect85, useState as useState102 } from "react";
|
|
142044
142149
|
import { Link as Link5 } from "@tanstack/react-router";
|
|
142045
142150
|
import { cn as cn137 } from "@pol-studios/utils";
|
|
142046
142151
|
import { jsx as jsx267, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
@@ -142051,9 +142156,9 @@ var Breadcrumbs = ({
|
|
|
142051
142156
|
className,
|
|
142052
142157
|
showHome = true
|
|
142053
142158
|
}) => {
|
|
142054
|
-
const [resolvedSegments, setResolvedSegments] =
|
|
142055
|
-
const [isLoading, setIsLoading] =
|
|
142056
|
-
|
|
142159
|
+
const [resolvedSegments, setResolvedSegments] = useState102([]);
|
|
142160
|
+
const [isLoading, setIsLoading] = useState102(false);
|
|
142161
|
+
useEffect85(() => {
|
|
142057
142162
|
const processSegments = async () => {
|
|
142058
142163
|
setIsLoading(true);
|
|
142059
142164
|
const segments = customSegments || config2?.segments || [];
|
|
@@ -142102,7 +142207,7 @@ var Breadcrumbs = ({
|
|
|
142102
142207
|
children: displaySegments.map((segment, index4) => {
|
|
142103
142208
|
const isLast = index4 === displaySegments.length - 1;
|
|
142104
142209
|
const isClickable = segment.href && !isLast;
|
|
142105
|
-
return /* @__PURE__ */ jsxs163(
|
|
142210
|
+
return /* @__PURE__ */ jsxs163(React178.Fragment, { children: [
|
|
142106
142211
|
index4 > 0 && /* @__PURE__ */ jsx267("span", { className: "text-muted-400", children: "/" }),
|
|
142107
142212
|
isClickable ? /* @__PURE__ */ jsx267(
|
|
142108
142213
|
Link5,
|
|
@@ -142160,7 +142265,7 @@ var PageHeader = ({
|
|
|
142160
142265
|
var PageHeader_default = PageHeader;
|
|
142161
142266
|
|
|
142162
142267
|
// src/data/DataTable.tsx
|
|
142163
|
-
import { useState as
|
|
142268
|
+
import { useState as useState103, useRef as useRef59, useEffect as useEffect86 } from "react";
|
|
142164
142269
|
import { Link as Link6 } from "@tanstack/react-router";
|
|
142165
142270
|
import { cn as cn139 } from "@pol-studios/utils";
|
|
142166
142271
|
import { Fragment as Fragment48, jsx as jsx269, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
@@ -142205,7 +142310,7 @@ function DataTableHeader({
|
|
|
142205
142310
|
IconComponent: IconComponent2,
|
|
142206
142311
|
HeadingComponent
|
|
142207
142312
|
}) {
|
|
142208
|
-
const [showActions, setShowActions] =
|
|
142313
|
+
const [showActions, setShowActions] = useState103(false);
|
|
142209
142314
|
const TitleComponent = HeadingComponent || (({ children, className }) => /* @__PURE__ */ jsx269("h4", { className, children }));
|
|
142210
142315
|
return /* @__PURE__ */ jsxs165("div", { className: "flex items-center justify-between w-full pb-4 border-b border-white/10", children: [
|
|
142211
142316
|
/* @__PURE__ */ jsxs165("div", { className: "flex items-center gap-3 w-full", children: [
|
|
@@ -142417,11 +142522,11 @@ function DataTable({
|
|
|
142417
142522
|
IconComponent: IconComponent2,
|
|
142418
142523
|
HeadingComponent
|
|
142419
142524
|
}) {
|
|
142420
|
-
const [focusedIndex, setFocusedIndex] =
|
|
142525
|
+
const [focusedIndex, setFocusedIndex] = useState103(-1);
|
|
142421
142526
|
const scrollAreaRef = useRef59(null);
|
|
142422
142527
|
const maxCount = providedMaxCount ?? (data.length > 0 ? Math.max(...data.map((d7) => d7.count)) : 1);
|
|
142423
142528
|
const isEmpty2 = !data || data.length === 0;
|
|
142424
|
-
|
|
142529
|
+
useEffect86(() => {
|
|
142425
142530
|
const handleKeyDown = (e8) => {
|
|
142426
142531
|
if (!scrollAreaRef.current) return;
|
|
142427
142532
|
switch (e8.key) {
|
|
@@ -142529,12 +142634,12 @@ function DataTable({
|
|
|
142529
142634
|
|
|
142530
142635
|
// src/data/entity-table/EntityTableView.tsx
|
|
142531
142636
|
import { cn as cn141, isUsable as isUsable39 } from "@pol-studios/utils";
|
|
142532
|
-
import
|
|
142533
|
-
useEffect as
|
|
142637
|
+
import React181, {
|
|
142638
|
+
useEffect as useEffect88,
|
|
142534
142639
|
useMemo as useMemo97,
|
|
142535
142640
|
useCallback as useCallback64,
|
|
142536
142641
|
useRef as useRef60,
|
|
142537
|
-
useState as
|
|
142642
|
+
useState as useState106,
|
|
142538
142643
|
useLayoutEffect as useLayoutEffect20
|
|
142539
142644
|
} from "react";
|
|
142540
142645
|
import { useDevice as useDevice2 } from "@pol-studios/hooks";
|
|
@@ -142542,10 +142647,10 @@ import { useDbQuery as useDbQuery10, useSupabase as useSupabase14 } from "@pol-s
|
|
|
142542
142647
|
import { Link as Link7, useRouter as useRouter3 } from "@tanstack/react-router";
|
|
142543
142648
|
|
|
142544
142649
|
// src/data/entity-table/useGroupedTable.ts
|
|
142545
|
-
import { useState as
|
|
142650
|
+
import { useState as useState105, useEffect as useEffect87 } from "react";
|
|
142546
142651
|
|
|
142547
142652
|
// ../../../node_modules/.pnpm/@tanstack+react-table@8.21.3_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@tanstack/react-table/build/lib/index.mjs
|
|
142548
|
-
import * as
|
|
142653
|
+
import * as React179 from "react";
|
|
142549
142654
|
|
|
142550
142655
|
// ../../../node_modules/.pnpm/@tanstack+table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.mjs
|
|
142551
142656
|
function functionalUpdate(updater, input2) {
|
|
@@ -145310,10 +145415,10 @@ function useReactTable(options) {
|
|
|
145310
145415
|
renderFallbackValue: null,
|
|
145311
145416
|
...options
|
|
145312
145417
|
};
|
|
145313
|
-
const [tableRef] =
|
|
145418
|
+
const [tableRef] = React179.useState(() => ({
|
|
145314
145419
|
current: createTable(resolvedOptions)
|
|
145315
145420
|
}));
|
|
145316
|
-
const [state, setState] =
|
|
145421
|
+
const [state, setState] = React179.useState(() => tableRef.current.initialState);
|
|
145317
145422
|
tableRef.current.setOptions((prev) => ({
|
|
145318
145423
|
...prev,
|
|
145319
145424
|
...options,
|
|
@@ -145340,10 +145445,10 @@ function useGroupedTable({
|
|
|
145340
145445
|
defaultExpanded = true,
|
|
145341
145446
|
onGroupingChange
|
|
145342
145447
|
}) {
|
|
145343
|
-
const [grouping, setGrouping] =
|
|
145448
|
+
const [grouping, setGrouping] = useState105(
|
|
145344
145449
|
groupBy2?.map((g5) => String(g5)) ?? []
|
|
145345
145450
|
);
|
|
145346
|
-
const [expanded, setExpanded] =
|
|
145451
|
+
const [expanded, setExpanded] = useState105({});
|
|
145347
145452
|
const columnDefs = columns.map((col) => {
|
|
145348
145453
|
const colId = String(col.id);
|
|
145349
145454
|
return {
|
|
@@ -145386,7 +145491,7 @@ function useGroupedTable({
|
|
|
145386
145491
|
enableGrouping: true,
|
|
145387
145492
|
groupedColumnMode: "reorder"
|
|
145388
145493
|
});
|
|
145389
|
-
|
|
145494
|
+
useEffect87(() => {
|
|
145390
145495
|
if (groupBy2 && groupBy2.length > 0) {
|
|
145391
145496
|
const groupIds = groupBy2.map((g5) => String(g5));
|
|
145392
145497
|
if (JSON.stringify(groupIds) !== JSON.stringify(grouping)) {
|
|
@@ -145400,7 +145505,7 @@ function useGroupedTable({
|
|
|
145400
145505
|
}
|
|
145401
145506
|
}
|
|
145402
145507
|
}, [groupBy2]);
|
|
145403
|
-
|
|
145508
|
+
useEffect87(() => {
|
|
145404
145509
|
if (grouping.length > 0 && defaultExpanded) {
|
|
145405
145510
|
const newExpanded = {};
|
|
145406
145511
|
table2.getRowModel().rows.forEach((row) => {
|
|
@@ -145579,11 +145684,11 @@ function EntityTableView({
|
|
|
145579
145684
|
supabase.schema("core").from("Column").select("*").eq("tableName", tableNameExtraColumns).order("orderHint"),
|
|
145580
145685
|
{ enabled: hasExtra }
|
|
145581
145686
|
);
|
|
145582
|
-
|
|
145687
|
+
useEffect88(() => {
|
|
145583
145688
|
if (extraCols.data) supabase;
|
|
145584
145689
|
}, [extraCols.data, supabase]);
|
|
145585
|
-
const [lastKnownRows, setLastKnownRows] =
|
|
145586
|
-
|
|
145690
|
+
const [lastKnownRows, setLastKnownRows] = useState106(10);
|
|
145691
|
+
useEffect88(() => {
|
|
145587
145692
|
if (!data) return;
|
|
145588
145693
|
setLastKnownRows(loadingRowsCount ?? data.length ?? 10);
|
|
145589
145694
|
}, [data]);
|
|
@@ -145596,11 +145701,11 @@ function EntityTableView({
|
|
|
145596
145701
|
},
|
|
145597
145702
|
[itemKey]
|
|
145598
145703
|
);
|
|
145599
|
-
const [internalSelectedRows, setInternalSelectedRows] =
|
|
145704
|
+
const [internalSelectedRows, setInternalSelectedRows] = useState106([]);
|
|
145600
145705
|
const selRows = selectedRows ?? internalSelectedRows;
|
|
145601
145706
|
const setSelRows = setSelectedRows ?? setInternalSelectedRows;
|
|
145602
145707
|
const selectionEnabled = isUsable39(setSelectedRows);
|
|
145603
|
-
const [lastSelectedIndex, setLastSelectedIndex] =
|
|
145708
|
+
const [lastSelectedIndex, setLastSelectedIndex] = useState106(
|
|
145604
145709
|
null
|
|
145605
145710
|
);
|
|
145606
145711
|
const handleRowSelection = useCallback64(
|
|
@@ -145648,7 +145753,7 @@ function EntityTableView({
|
|
|
145648
145753
|
),
|
|
145649
145754
|
[columns]
|
|
145650
145755
|
);
|
|
145651
|
-
const [columnWidths, setColumnWidths] =
|
|
145756
|
+
const [columnWidths, setColumnWidths] = useState106(initialWidths);
|
|
145652
145757
|
useLayoutEffect20(() => {
|
|
145653
145758
|
setColumnWidths(initialWidths);
|
|
145654
145759
|
}, [columns]);
|
|
@@ -145678,7 +145783,7 @@ function EntityTableView({
|
|
|
145678
145783
|
},
|
|
145679
145784
|
[columnWidths, onMouseMove, onMouseUp]
|
|
145680
145785
|
);
|
|
145681
|
-
const [storeKey, setStoreKey] =
|
|
145786
|
+
const [storeKey, setStoreKey] = useState106(savedColumnVisibilityKey);
|
|
145682
145787
|
const device = useDevice2();
|
|
145683
145788
|
const allColumnIds = useMemo97(
|
|
145684
145789
|
() => columns.map((c14) => c14.id.toString()),
|
|
@@ -146201,7 +146306,7 @@ function EntityTableView({
|
|
|
146201
146306
|
/* @__PURE__ */ jsx271("div", { className: cn141("h-full flex-1 overflow-auto min-h-full", className), children: tableWrapper ? tableWrapper(tableElement) : tableElement })
|
|
146202
146307
|
] });
|
|
146203
146308
|
}
|
|
146204
|
-
var ComponentStackReporter = class extends
|
|
146309
|
+
var ComponentStackReporter = class extends React181.Component {
|
|
146205
146310
|
state = { hasError: false };
|
|
146206
146311
|
static getDerivedStateFromError() {
|
|
146207
146312
|
return { hasError: true };
|
|
@@ -146296,7 +146401,7 @@ function EntityTableWithHeader({
|
|
|
146296
146401
|
var EntityTableWithHeader_default = EntityTableWithHeader;
|
|
146297
146402
|
|
|
146298
146403
|
// src/data/entity-table/EntityTableWithPagination.tsx
|
|
146299
|
-
import { useEffect as
|
|
146404
|
+
import { useEffect as useEffect89, useState as useState107 } from "react";
|
|
146300
146405
|
import { isUsable as isUsable41 } from "@pol-studios/utils";
|
|
146301
146406
|
import { useDevice as useDevice3 } from "@pol-studios/hooks";
|
|
146302
146407
|
import { jsx as jsx273, jsxs as jsxs169 } from "react/jsx-runtime";
|
|
@@ -146324,14 +146429,14 @@ function EntityTableWithPagination({
|
|
|
146324
146429
|
selectedRows,
|
|
146325
146430
|
...props
|
|
146326
146431
|
}) {
|
|
146327
|
-
const [paginationData, setPaginationData] =
|
|
146432
|
+
const [paginationData, setPaginationData] = useState107({
|
|
146328
146433
|
itemPerPage: 0,
|
|
146329
146434
|
currentPageItemCount: 0,
|
|
146330
146435
|
totalPageCount: 0,
|
|
146331
146436
|
currentPage: 0,
|
|
146332
146437
|
itemCount: 0
|
|
146333
146438
|
});
|
|
146334
|
-
|
|
146439
|
+
useEffect89(() => {
|
|
146335
146440
|
if (isUsable41(request.data) === false) return;
|
|
146336
146441
|
const data = request.data;
|
|
146337
146442
|
setPaginationData({
|
|
@@ -146483,7 +146588,7 @@ function EntityTablePaginatedPage({
|
|
|
146483
146588
|
}
|
|
146484
146589
|
|
|
146485
146590
|
// src/data/entity-table/SelectableEntityTableView.tsx
|
|
146486
|
-
import { useMemo as useMemo100, useState as
|
|
146591
|
+
import { useMemo as useMemo100, useState as useState108 } from "react";
|
|
146487
146592
|
import { isNullOrWhitespace as isNullOrWhitespace15 } from "@pol-studios/utils";
|
|
146488
146593
|
import { jsx as jsx275, jsxs as jsxs171 } from "react/jsx-runtime";
|
|
146489
146594
|
function SelectableEntityTableView({
|
|
@@ -146492,7 +146597,7 @@ function SelectableEntityTableView({
|
|
|
146492
146597
|
selectedItems = [],
|
|
146493
146598
|
...props
|
|
146494
146599
|
}) {
|
|
146495
|
-
const [searchText, setSearchText] =
|
|
146600
|
+
const [searchText, setSearchText] = useState108("");
|
|
146496
146601
|
const filteredData = useMemo100(() => {
|
|
146497
146602
|
if (isNullOrWhitespace15(searchText)) return selectedItems;
|
|
146498
146603
|
const lowerCase = searchText.toLowerCase();
|
|
@@ -146532,14 +146637,14 @@ function SelectableEntityTableView({
|
|
|
146532
146637
|
|
|
146533
146638
|
// src/data/entity-table/EntityTableFilterPanel.tsx
|
|
146534
146639
|
import { cn as cn143 } from "@pol-studios/utils";
|
|
146535
|
-
import { useState as
|
|
146640
|
+
import { useState as useState109 } from "react";
|
|
146536
146641
|
import { jsx as jsx276, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
146537
146642
|
function EntityTableFilterPanel({
|
|
146538
146643
|
data,
|
|
146539
146644
|
propertiesToSortBy,
|
|
146540
146645
|
className
|
|
146541
146646
|
}) {
|
|
146542
|
-
const [sortedProperties, setSortedProperties] =
|
|
146647
|
+
const [sortedProperties, setSortedProperties] = useState109([]);
|
|
146543
146648
|
const handleSort = (property) => {
|
|
146544
146649
|
const existingProperty = sortedProperties.find(
|
|
146545
146650
|
(x10) => x10.property === property
|
|
@@ -146619,12 +146724,12 @@ import {
|
|
|
146619
146724
|
useDbDelete as useDbDelete5,
|
|
146620
146725
|
useDbQuery as useDbQuery11
|
|
146621
146726
|
} from "@pol-studios/db";
|
|
146622
|
-
import { useEffect as
|
|
146727
|
+
import { useEffect as useEffect91, useState as useState111 } from "react";
|
|
146623
146728
|
import { useToast as useToast3 } from "@pol-studios/hooks";
|
|
146624
146729
|
import { cn as cn145, isNullOrWhitespace as isNullOrWhitespace16, isUsable as isUsable44 } from "@pol-studios/utils";
|
|
146625
146730
|
|
|
146626
146731
|
// src/components/OrderHintManager.tsx
|
|
146627
|
-
import { useEffect as
|
|
146732
|
+
import { useEffect as useEffect90, useMemo as useMemo101, useState as useState110 } from "react";
|
|
146628
146733
|
import { GripVertical as GripVertical2, GripHorizontal as GripHorizontal2 } from "lucide-react";
|
|
146629
146734
|
import { cn as cn144 } from "@pol-studios/utils";
|
|
146630
146735
|
import { isUsable as isUsable43 } from "@pol-studios/utils/types";
|
|
@@ -146651,8 +146756,8 @@ var PolOrderHintManager2 = ({
|
|
|
146651
146756
|
property,
|
|
146652
146757
|
schema
|
|
146653
146758
|
);
|
|
146654
|
-
const [modalElement, setModalElement] =
|
|
146655
|
-
|
|
146759
|
+
const [modalElement, setModalElement] = useState110(null);
|
|
146760
|
+
useEffect90(() => {
|
|
146656
146761
|
const handleModalChange = () => {
|
|
146657
146762
|
const element2 = document.querySelector("[aria-ismodal]");
|
|
146658
146763
|
setModalElement(element2);
|
|
@@ -146697,7 +146802,7 @@ var PolOrderHintManager2 = ({
|
|
|
146697
146802
|
await updateOrderHint(activeItem, newPrevOrderHint, newNextOrderHint);
|
|
146698
146803
|
}
|
|
146699
146804
|
};
|
|
146700
|
-
const [draggingId, setDraggingId] =
|
|
146805
|
+
const [draggingId, setDraggingId] = useState110(null);
|
|
146701
146806
|
const withHandle = (item) => {
|
|
146702
146807
|
if (!displayHandle) return renderItem(item);
|
|
146703
146808
|
if (orientation === "horizontal") {
|
|
@@ -146847,7 +146952,7 @@ var Column = ({
|
|
|
146847
146952
|
tableName,
|
|
146848
146953
|
onUpdate
|
|
146849
146954
|
}) => {
|
|
146850
|
-
const [isEditing, setIsEditing] =
|
|
146955
|
+
const [isEditing, setIsEditing] = useState111(false);
|
|
146851
146956
|
const alert = useAlert();
|
|
146852
146957
|
const deleteMutation = useDbDelete5(
|
|
146853
146958
|
{
|
|
@@ -146972,7 +147077,7 @@ var ManageColumn = ({
|
|
|
146972
147077
|
isEditing,
|
|
146973
147078
|
onIsEditingChange
|
|
146974
147079
|
}) => {
|
|
146975
|
-
const [open, setOpen] =
|
|
147080
|
+
const [open, setOpen] = useState111(false);
|
|
146976
147081
|
const insert = useInsert(
|
|
146977
147082
|
{
|
|
146978
147083
|
schema: "core",
|
|
@@ -146988,20 +147093,20 @@ var ManageColumn = ({
|
|
|
146988
147093
|
["id"]
|
|
146989
147094
|
);
|
|
146990
147095
|
const { toast } = useToast3();
|
|
146991
|
-
|
|
147096
|
+
useEffect91(() => {
|
|
146992
147097
|
if (isEditing) {
|
|
146993
147098
|
setOpen(true);
|
|
146994
147099
|
}
|
|
146995
147100
|
}, [isEditing]);
|
|
146996
|
-
const [title, setTitle] =
|
|
146997
|
-
const [propertyType, setPropertyType] =
|
|
146998
|
-
const [options, setOptions] =
|
|
146999
|
-
const [defaultValue3, setDefaultValue] =
|
|
147101
|
+
const [title, setTitle] = useState111(column?.title || "");
|
|
147102
|
+
const [propertyType, setPropertyType] = useState111(column?.propertyType || "String");
|
|
147103
|
+
const [options, setOptions] = useState111(column?.options || []);
|
|
147104
|
+
const [defaultValue3, setDefaultValue] = useState111(
|
|
147000
147105
|
//@ts-ignore
|
|
147001
147106
|
column?.defaultValue.defaultValue || null
|
|
147002
147107
|
);
|
|
147003
|
-
const [optional, setOptional] =
|
|
147004
|
-
|
|
147108
|
+
const [optional, setOptional] = useState111(column?.isOptional || false);
|
|
147109
|
+
useEffect91(() => {
|
|
147005
147110
|
onIsEditingChange && onIsEditingChange(false);
|
|
147006
147111
|
setDefaultValue(column?.defaultValue.defaultValue || null);
|
|
147007
147112
|
setTitle(column?.title || "");
|
|
@@ -147175,7 +147280,7 @@ var OptionManager = ({
|
|
|
147175
147280
|
options,
|
|
147176
147281
|
setOptions
|
|
147177
147282
|
}) => {
|
|
147178
|
-
const [newOption, setNewOption] =
|
|
147283
|
+
const [newOption, setNewOption] = useState111("");
|
|
147179
147284
|
const handleAdd = () => {
|
|
147180
147285
|
if (options.includes(newOption)) return;
|
|
147181
147286
|
setOptions((prev) => [...prev, newOption]);
|
|
@@ -147227,7 +147332,7 @@ var OptionManager = ({
|
|
|
147227
147332
|
};
|
|
147228
147333
|
|
|
147229
147334
|
// src/data/entity-table/ColumnSortAndVisibilityManager.tsx
|
|
147230
|
-
import
|
|
147335
|
+
import React184, { useCallback as useCallback67, useEffect as useEffect92, useMemo as useMemo102, useRef as useRef61, useState as useState112 } from "react";
|
|
147231
147336
|
import { useReducedMotion } from "@pol-studios/hooks";
|
|
147232
147337
|
import { cn as cn146 } from "@pol-studios/utils";
|
|
147233
147338
|
import { motion as motion29, AnimatePresence as AnimatePresence25, Reorder } from "framer-motion";
|
|
@@ -147240,7 +147345,7 @@ function SearchInput2({
|
|
|
147240
147345
|
placeholder = "Search columns...",
|
|
147241
147346
|
className
|
|
147242
147347
|
}) {
|
|
147243
|
-
const [isFocused, setIsFocused] =
|
|
147348
|
+
const [isFocused, setIsFocused] = useState112(false);
|
|
147244
147349
|
return /* @__PURE__ */ jsxs175("div", { className: cn146("relative", className), children: [
|
|
147245
147350
|
/* @__PURE__ */ jsx279("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ jsx279(
|
|
147246
147351
|
Icon2,
|
|
@@ -147383,7 +147488,7 @@ function DraggableColumnItem({
|
|
|
147383
147488
|
}
|
|
147384
147489
|
);
|
|
147385
147490
|
}
|
|
147386
|
-
var VirtualColumnItem =
|
|
147491
|
+
var VirtualColumnItem = React184.memo(function VirtualColumnItem2({
|
|
147387
147492
|
column,
|
|
147388
147493
|
enabled,
|
|
147389
147494
|
onToggle,
|
|
@@ -147488,21 +147593,21 @@ var ColumnSortAndVisibilityManager = ({
|
|
|
147488
147593
|
[controlledDefaultVisibleColumnIds?.join(","), allIds.join(",")]
|
|
147489
147594
|
);
|
|
147490
147595
|
const [lsVisibleColumnIds, setLsVisibleColumnIds, isLoading] = useUserMetadataState(storeKey ?? "column-visibility", defaultVisibleIds);
|
|
147491
|
-
|
|
147596
|
+
useEffect92(() => {
|
|
147492
147597
|
if (isLoading === false) {
|
|
147493
147598
|
setControlledVisibleColumnIds?.(lsVisibleColumnIds);
|
|
147494
147599
|
}
|
|
147495
147600
|
}, [isLoading, lsVisibleColumnIds, setControlledVisibleColumnIds]);
|
|
147496
147601
|
const visibleColumnIds = controlledVisibleColumnIds ?? (isLoading ? allIds : lsVisibleColumnIds);
|
|
147497
147602
|
const setVisibleColumnIds = setControlledVisibleColumnIds ?? setLsVisibleColumnIds;
|
|
147498
|
-
const [open, setOpen] =
|
|
147499
|
-
const [dragOrder, setDragOrder] =
|
|
147500
|
-
const [searchQuery, setSearchQuery] =
|
|
147501
|
-
const [pendingScrollToId, setPendingScrollToId] =
|
|
147603
|
+
const [open, setOpen] = useState112(false);
|
|
147604
|
+
const [dragOrder, setDragOrder] = useState112([]);
|
|
147605
|
+
const [searchQuery, setSearchQuery] = useState112("");
|
|
147606
|
+
const [pendingScrollToId, setPendingScrollToId] = useState112(null);
|
|
147502
147607
|
const parentRef = useRef61(null);
|
|
147503
|
-
const [isReady, setIsReady] =
|
|
147608
|
+
const [isReady, setIsReady] = useState112(false);
|
|
147504
147609
|
const useVirtualization = columns.length >= VIRTUALIZATION_THRESHOLD;
|
|
147505
|
-
|
|
147610
|
+
useEffect92(() => {
|
|
147506
147611
|
if (open && useVirtualization) {
|
|
147507
147612
|
const timer = setTimeout(() => setIsReady(true), 50);
|
|
147508
147613
|
return () => clearTimeout(timer);
|
|
@@ -147512,7 +147617,7 @@ var ColumnSortAndVisibilityManager = ({
|
|
|
147512
147617
|
setIsReady(false);
|
|
147513
147618
|
}
|
|
147514
147619
|
}, [open, useVirtualization]);
|
|
147515
|
-
|
|
147620
|
+
useEffect92(() => {
|
|
147516
147621
|
setDragOrder([]);
|
|
147517
147622
|
}, [searchQuery]);
|
|
147518
147623
|
const clearSearch = useCallback67(() => {
|
|
@@ -147584,7 +147689,7 @@ var ColumnSortAndVisibilityManager = ({
|
|
|
147584
147689
|
overscan: 5,
|
|
147585
147690
|
enabled: useVirtualization
|
|
147586
147691
|
});
|
|
147587
|
-
|
|
147692
|
+
useEffect92(() => {
|
|
147588
147693
|
if (useVirtualization && pendingScrollToId && orderedColumns.length > 0) {
|
|
147589
147694
|
const index4 = orderedColumns.findIndex((c14) => c14.id === pendingScrollToId);
|
|
147590
147695
|
if (index4 !== -1) {
|
|
@@ -147605,7 +147710,7 @@ var ColumnSortAndVisibilityManager = ({
|
|
|
147605
147710
|
}
|
|
147606
147711
|
setDragOrder([]);
|
|
147607
147712
|
}, [dragOrder, visibleColumnIds, setAllVisibleColumnIds]);
|
|
147608
|
-
|
|
147713
|
+
useEffect92(() => {
|
|
147609
147714
|
if (!open) return;
|
|
147610
147715
|
const handleKeyDown = (e8) => {
|
|
147611
147716
|
if (e8.metaKey || e8.ctrlKey) {
|