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