@uniformdev/mesh-sdk-react 20.72.4-alpha.13 → 20.72.4-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -66
- package/dist/index.d.ts +4 -66
- package/dist/index.esm.js +86 -154
- package/dist/index.js +352 -424
- package/dist/index.mjs +86 -154
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -51,7 +51,6 @@ __export(index_exports, {
|
|
|
51
51
|
DateEditor: () => DateEditor,
|
|
52
52
|
DateRangeEditor: () => DateRangeEditor,
|
|
53
53
|
DelegationContext: () => DelegationContext,
|
|
54
|
-
DelegationDisabledError: () => DelegationDisabledError,
|
|
55
54
|
DelegationGate: () => DelegationGate,
|
|
56
55
|
DelegationProvider: () => DelegationProvider,
|
|
57
56
|
DrawerContent: () => import_design_system54.DrawerContent,
|
|
@@ -155,10 +154,8 @@ __export(index_exports, {
|
|
|
155
154
|
VariablesProvider: () => VariablesProvider,
|
|
156
155
|
bindableFiltersMapper: () => bindableFiltersMapper,
|
|
157
156
|
convertConnectedDataToVariable: () => convertConnectedDataToVariable,
|
|
158
|
-
createDelegationFetch: () => createDelegationFetch,
|
|
159
157
|
createLocationValidator: () => createLocationValidator,
|
|
160
158
|
filterMapper: () => filterMapper,
|
|
161
|
-
isDelegationExpiredResponse: () => isDelegationExpiredResponse,
|
|
162
159
|
prettifyBindExpression: () => prettifyBindExpression,
|
|
163
160
|
readOnlyAttributes: () => readOnlyAttributes,
|
|
164
161
|
serializeVariablesEditorSerializedState: () => serializeVariablesEditorSerializedState,
|
|
@@ -169,7 +166,6 @@ __export(index_exports, {
|
|
|
169
166
|
useConnectedDataAsVariables: () => useConnectedDataAsVariables,
|
|
170
167
|
useContentDataResourceLocaleInfo: () => useContentDataResourceLocaleInfo,
|
|
171
168
|
useDelegation: () => useDelegation,
|
|
172
|
-
useDelegationFetch: () => useDelegationFetch,
|
|
173
169
|
useDynamicInputsAsVariables: () => useDynamicInputsAsVariables,
|
|
174
170
|
useMeshLocation: () => useMeshLocation,
|
|
175
171
|
useObjectSearchContext: () => useObjectSearchContext,
|
|
@@ -435,40 +431,6 @@ var SvgPlus = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
|
435
431
|
);
|
|
436
432
|
var Plus_default = SvgPlus;
|
|
437
433
|
|
|
438
|
-
// src/hooks/createDelegationFetch.ts
|
|
439
|
-
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
440
|
-
async function isDelegationExpiredResponse(response) {
|
|
441
|
-
if (response.status !== 401) {
|
|
442
|
-
return false;
|
|
443
|
-
}
|
|
444
|
-
try {
|
|
445
|
-
const body = await response.clone().json();
|
|
446
|
-
return typeof body.code === "string" && body.code === import_mesh_sdk.DELEGATION_EXPIRED_CODE;
|
|
447
|
-
} catch (e) {
|
|
448
|
-
return false;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
function createDelegationFetch(options) {
|
|
452
|
-
var _a, _b;
|
|
453
|
-
const fetchFn = (_a = options.fetch) != null ? _a : fetch;
|
|
454
|
-
const isExpired = (_b = options.isDelegationExpired) != null ? _b : isDelegationExpiredResponse;
|
|
455
|
-
return async (input3, init) => {
|
|
456
|
-
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
457
|
-
headers.set(import_mesh_sdk.CSRF_HEADER_NAME, import_mesh_sdk.CSRF_HEADER_VALUE);
|
|
458
|
-
const initWithCsrf = { ...init, headers };
|
|
459
|
-
const response = await fetchFn(input3, initWithCsrf);
|
|
460
|
-
if (!await isExpired(response)) {
|
|
461
|
-
return response;
|
|
462
|
-
}
|
|
463
|
-
try {
|
|
464
|
-
await options.reacquire();
|
|
465
|
-
} catch (e) {
|
|
466
|
-
return response;
|
|
467
|
-
}
|
|
468
|
-
return fetchFn(input3, initWithCsrf);
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
|
|
472
434
|
// src/hooks/useConnectedDataAsVariables.tsx
|
|
473
435
|
var import_react2 = require("react");
|
|
474
436
|
function useConnectedDataAsVariables(connectedData) {
|
|
@@ -503,28 +465,12 @@ function useDelegation() {
|
|
|
503
465
|
return ctx;
|
|
504
466
|
}
|
|
505
467
|
|
|
506
|
-
// src/hooks/useDelegationFetch.ts
|
|
507
|
-
var import_react5 = require("react");
|
|
508
|
-
function useDelegationFetch(options) {
|
|
509
|
-
const { reacquire } = useDelegation();
|
|
510
|
-
const fetchImpl = options == null ? void 0 : options.fetch;
|
|
511
|
-
const isDelegationExpired = options == null ? void 0 : options.isDelegationExpired;
|
|
512
|
-
return (0, import_react5.useMemo)(
|
|
513
|
-
() => createDelegationFetch({
|
|
514
|
-
reacquire,
|
|
515
|
-
fetch: fetchImpl,
|
|
516
|
-
isDelegationExpired
|
|
517
|
-
}),
|
|
518
|
-
[reacquire, fetchImpl, isDelegationExpired]
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
468
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
523
469
|
var import_canvas = require("@uniformdev/canvas");
|
|
524
|
-
var
|
|
470
|
+
var import_react5 = require("react");
|
|
525
471
|
var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
|
|
526
472
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
527
|
-
return (0,
|
|
473
|
+
return (0, import_react5.useMemo)(() => {
|
|
528
474
|
const result = Object.entries(dynamicInputs).reduce(
|
|
529
475
|
(acc, [name2, input3]) => {
|
|
530
476
|
const source = `from ${name2 === import_canvas.LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
@@ -559,18 +505,18 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
559
505
|
}
|
|
560
506
|
|
|
561
507
|
// src/hooks/useMeshLocation.ts
|
|
562
|
-
var
|
|
508
|
+
var import_react8 = require("react");
|
|
563
509
|
|
|
564
510
|
// src/components/UniformMeshLocationContext.tsx
|
|
565
|
-
var
|
|
511
|
+
var import_react7 = require("react");
|
|
566
512
|
|
|
567
513
|
// src/components/UniformMeshSdkContext.tsx
|
|
568
514
|
var import_design_system = require("@uniformdev/design-system");
|
|
569
|
-
var
|
|
515
|
+
var import_react6 = require("react");
|
|
570
516
|
var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
|
|
571
|
-
var UniformMeshSdkContext = (0,
|
|
517
|
+
var UniformMeshSdkContext = (0, import_react6.createContext)(void 0);
|
|
572
518
|
var useUniformMeshSdkContext = () => {
|
|
573
|
-
const context = (0,
|
|
519
|
+
const context = (0, import_react6.useContext)(UniformMeshSdkContext);
|
|
574
520
|
if (!context) {
|
|
575
521
|
throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");
|
|
576
522
|
}
|
|
@@ -585,13 +531,13 @@ function useUniformMeshSdk() {
|
|
|
585
531
|
|
|
586
532
|
// src/components/UniformMeshLocationContext.tsx
|
|
587
533
|
var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
|
|
588
|
-
var UniformMeshLocationContext = (0,
|
|
534
|
+
var UniformMeshLocationContext = (0, import_react7.createContext)(void 0);
|
|
589
535
|
var UniformMeshLocationContextProvider = ({
|
|
590
536
|
children
|
|
591
537
|
}) => {
|
|
592
538
|
const sdk = useUniformMeshSdk();
|
|
593
|
-
const [location, setLocation] = (0,
|
|
594
|
-
(0,
|
|
539
|
+
const [location, setLocation] = (0, import_react7.useState)(sdk.getCurrentLocation());
|
|
540
|
+
(0, import_react7.useMemo)(() => {
|
|
595
541
|
const valueChangeListener = (event) => {
|
|
596
542
|
setLocation((old) => ({ ...old, value: event.newValue }));
|
|
597
543
|
};
|
|
@@ -608,7 +554,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
608
554
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(UniformMeshLocationContext.Provider, { value: { location }, children });
|
|
609
555
|
};
|
|
610
556
|
var useUniformMeshLocationContext = () => {
|
|
611
|
-
const context = (0,
|
|
557
|
+
const context = (0, import_react7.useContext)(UniformMeshLocationContext);
|
|
612
558
|
if (!context) {
|
|
613
559
|
throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");
|
|
614
560
|
}
|
|
@@ -621,9 +567,9 @@ function useMeshLocation(expectedLocation) {
|
|
|
621
567
|
if (expectedLocation && location.type !== expectedLocation) {
|
|
622
568
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
623
569
|
}
|
|
624
|
-
const backdoorLocation = (0,
|
|
570
|
+
const backdoorLocation = (0, import_react8.useRef)(location);
|
|
625
571
|
backdoorLocation.current = location;
|
|
626
|
-
const stabilizedSetValueProxy = (0,
|
|
572
|
+
const stabilizedSetValueProxy = (0, import_react8.useMemo)(
|
|
627
573
|
() => (dispatch) => {
|
|
628
574
|
const { newValue, options } = dispatch(backdoorLocation.current.value);
|
|
629
575
|
backdoorLocation.current.setValue(newValue, options);
|
|
@@ -642,7 +588,7 @@ var import_design_system2 = require("@uniformdev/design-system");
|
|
|
642
588
|
|
|
643
589
|
// src/components/Variables/composer/ControlledValuePlugin.tsx
|
|
644
590
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
645
|
-
var
|
|
591
|
+
var import_react9 = require("react");
|
|
646
592
|
|
|
647
593
|
// src/components/Variables/util/serializeVariablesEditorState.ts
|
|
648
594
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
@@ -786,7 +732,7 @@ function ControlledValuePlugin({
|
|
|
786
732
|
extraDependencies
|
|
787
733
|
}) {
|
|
788
734
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
789
|
-
(0,
|
|
735
|
+
(0, import_react9.useEffect)(() => {
|
|
790
736
|
var _a, _b;
|
|
791
737
|
if (!enabled) {
|
|
792
738
|
return;
|
|
@@ -807,7 +753,7 @@ function ControlledValuePlugin({
|
|
|
807
753
|
|
|
808
754
|
// src/components/Variables/composer/VariableChip.tsx
|
|
809
755
|
var import_design_system3 = require("@uniformdev/design-system");
|
|
810
|
-
var
|
|
756
|
+
var import_react10 = require("react");
|
|
811
757
|
var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
|
|
812
758
|
function VariableChip({
|
|
813
759
|
displayName,
|
|
@@ -823,7 +769,7 @@ function VariableChip({
|
|
|
823
769
|
}) {
|
|
824
770
|
const hasClickEvent = !!onClick;
|
|
825
771
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
826
|
-
const Wrapper = referenceIsValidFr === "warning" ? WarningVariableReference : referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ?
|
|
772
|
+
const Wrapper = referenceIsValidFr === "warning" ? WarningVariableReference : referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? import_react10.Fragment : UndefinedVariableReference;
|
|
827
773
|
const extraTitle = !referenceIsValidFr ? errorMessage : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
828
774
|
const chippy = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system3.MultilineChip, { onClick, "aria-selected": selected ? true : void 0, "aria-disabled": disabled, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Wrapper, { children: displayName || reference }) });
|
|
829
775
|
if (tooltip) {
|
|
@@ -889,7 +835,7 @@ var import_utils2 = require("@lexical/utils");
|
|
|
889
835
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
890
836
|
var import_design_system6 = require("@uniformdev/design-system");
|
|
891
837
|
var import_lexical5 = require("lexical");
|
|
892
|
-
var
|
|
838
|
+
var import_react18 = require("react");
|
|
893
839
|
|
|
894
840
|
// src/components/Variables/util/prettifyBindExpression.tsx
|
|
895
841
|
function prettifyBindExpression(bindExpression) {
|
|
@@ -898,7 +844,7 @@ function prettifyBindExpression(bindExpression) {
|
|
|
898
844
|
}
|
|
899
845
|
|
|
900
846
|
// src/components/Variables/composer/VariablesPlugin.tsx
|
|
901
|
-
var
|
|
847
|
+
var import_react16 = require("@emotion/react");
|
|
902
848
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
903
849
|
var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
|
|
904
850
|
var import_utils = require("@lexical/utils");
|
|
@@ -907,12 +853,12 @@ var import_canvas4 = require("@uniformdev/canvas");
|
|
|
907
853
|
var import_design_system5 = require("@uniformdev/design-system");
|
|
908
854
|
var import_lite = require("dequal/lite");
|
|
909
855
|
var import_lexical4 = require("lexical");
|
|
910
|
-
var
|
|
856
|
+
var import_react17 = require("react");
|
|
911
857
|
var import_react_dom = require("react-dom");
|
|
912
858
|
|
|
913
859
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
914
|
-
var
|
|
915
|
-
var menuBtn =
|
|
860
|
+
var import_react11 = require("@emotion/react");
|
|
861
|
+
var menuBtn = import_react11.css`
|
|
916
862
|
background: none;
|
|
917
863
|
border: none;
|
|
918
864
|
color: var(--gray-500);
|
|
@@ -922,18 +868,18 @@ var menuBtn = import_react12.css`
|
|
|
922
868
|
outline: none;
|
|
923
869
|
}
|
|
924
870
|
`;
|
|
925
|
-
var menuItemTextGroup =
|
|
871
|
+
var menuItemTextGroup = import_react11.css`
|
|
926
872
|
align-items: flex-start;
|
|
927
873
|
display: flex;
|
|
928
874
|
flex-direction: column;
|
|
929
875
|
gap: 0;
|
|
930
876
|
line-height: 1em;
|
|
931
877
|
`;
|
|
932
|
-
var smallText =
|
|
878
|
+
var smallText = import_react11.css`
|
|
933
879
|
font-size: var(--fs-xs);
|
|
934
880
|
color: var(--gray-500);
|
|
935
881
|
`;
|
|
936
|
-
var variablesTipText =
|
|
882
|
+
var variablesTipText = import_react11.css`
|
|
937
883
|
${smallText}
|
|
938
884
|
color: var(--gray-500);
|
|
939
885
|
padding: 0 var(--spacing-sm);
|
|
@@ -941,18 +887,18 @@ var variablesTipText = import_react12.css`
|
|
|
941
887
|
|
|
942
888
|
// src/components/Variables/VariablesProvider.tsx
|
|
943
889
|
var import_mitt = __toESM(require("mitt"));
|
|
944
|
-
var
|
|
890
|
+
var import_react15 = require("react");
|
|
945
891
|
|
|
946
892
|
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
947
|
-
var
|
|
893
|
+
var import_react12 = require("react");
|
|
948
894
|
function useVariableEditTransaction({
|
|
949
895
|
events,
|
|
950
896
|
dispatch,
|
|
951
897
|
isEditing,
|
|
952
898
|
variables
|
|
953
899
|
}) {
|
|
954
|
-
const [isEditingBinding, setIsEditingBinding] = (0,
|
|
955
|
-
(0,
|
|
900
|
+
const [isEditingBinding, setIsEditingBinding] = (0, import_react12.useState)();
|
|
901
|
+
(0, import_react12.useEffect)(() => {
|
|
956
902
|
if (!isEditingBinding) {
|
|
957
903
|
return;
|
|
958
904
|
}
|
|
@@ -963,7 +909,7 @@ function useVariableEditTransaction({
|
|
|
963
909
|
events.on("editCompleted", fn);
|
|
964
910
|
return () => events.off("editCompleted", fn);
|
|
965
911
|
}, [events, isEditingBinding, variables]);
|
|
966
|
-
(0,
|
|
912
|
+
(0, import_react12.useEffect)(() => {
|
|
967
913
|
if (!isEditing) {
|
|
968
914
|
if (isEditingBinding) {
|
|
969
915
|
isEditingBinding.resolve({ canceled: true });
|
|
@@ -971,7 +917,7 @@ function useVariableEditTransaction({
|
|
|
971
917
|
setIsEditingBinding(void 0);
|
|
972
918
|
}
|
|
973
919
|
}, [isEditing, isEditingBinding]);
|
|
974
|
-
return (0,
|
|
920
|
+
return (0, import_react12.useCallback)(
|
|
975
921
|
async function editVariableTxn(variable, context) {
|
|
976
922
|
if (isEditingBinding) {
|
|
977
923
|
dispatch({ type: "cancelEdit" });
|
|
@@ -993,13 +939,13 @@ function useVariableEditTransaction({
|
|
|
993
939
|
// src/components/Variables/VariableEditor.tsx
|
|
994
940
|
var import_standard_schema = require("@hookform/resolvers/standard-schema");
|
|
995
941
|
var import_design_system4 = require("@uniformdev/design-system");
|
|
996
|
-
var
|
|
942
|
+
var import_react14 = require("react");
|
|
997
943
|
var import_react_hook_form = require("react-hook-form");
|
|
998
944
|
var z = __toESM(require("zod"));
|
|
999
945
|
|
|
1000
946
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
1001
|
-
var
|
|
1002
|
-
var variablesFormContainer =
|
|
947
|
+
var import_react13 = require("@emotion/react");
|
|
948
|
+
var variablesFormContainer = import_react13.css`
|
|
1003
949
|
> * {
|
|
1004
950
|
margin: var(--spacing-base) 0 0;
|
|
1005
951
|
}
|
|
@@ -1052,9 +998,9 @@ function VariableEditor({
|
|
|
1052
998
|
},
|
|
1053
999
|
activeWhenEditing: true
|
|
1054
1000
|
});
|
|
1055
|
-
const nameRef = (0,
|
|
1001
|
+
const nameRef = (0, import_react14.useRef)(null);
|
|
1056
1002
|
const { ref, ...nameRegister } = register("name");
|
|
1057
|
-
(0,
|
|
1003
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
1058
1004
|
if (nameRef.current && !nameRef.current.value) {
|
|
1059
1005
|
nameRef.current.focus();
|
|
1060
1006
|
}
|
|
@@ -1130,7 +1076,7 @@ function VariableEditor({
|
|
|
1130
1076
|
|
|
1131
1077
|
// src/components/Variables/VariablesProvider.tsx
|
|
1132
1078
|
var import_jsx_runtime19 = require("@emotion/react/jsx-runtime");
|
|
1133
|
-
var VariablesContext = (0,
|
|
1079
|
+
var VariablesContext = (0, import_react15.createContext)(null);
|
|
1134
1080
|
function VariablesProvider({
|
|
1135
1081
|
value,
|
|
1136
1082
|
onChange,
|
|
@@ -1141,9 +1087,9 @@ function VariablesProvider({
|
|
|
1141
1087
|
knownUndefinedValues = {},
|
|
1142
1088
|
onChangeKnownUndefinedValue
|
|
1143
1089
|
}) {
|
|
1144
|
-
const [editing, setEditing] = (0,
|
|
1145
|
-
const [editingContext, setEditingContext] = (0,
|
|
1146
|
-
const events = (0,
|
|
1090
|
+
const [editing, setEditing] = (0, import_react15.useState)();
|
|
1091
|
+
const [editingContext, setEditingContext] = (0, import_react15.useState)();
|
|
1092
|
+
const events = (0, import_react15.useMemo)(
|
|
1147
1093
|
() => (0, import_mitt.default)(),
|
|
1148
1094
|
[]
|
|
1149
1095
|
);
|
|
@@ -1151,7 +1097,7 @@ function VariablesProvider({
|
|
|
1151
1097
|
throw new Error("onChange must be provided when readOnly is false");
|
|
1152
1098
|
}
|
|
1153
1099
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
1154
|
-
const valueBasedContextValue = (0,
|
|
1100
|
+
const valueBasedContextValue = (0, import_react15.useMemo)(
|
|
1155
1101
|
() => ({
|
|
1156
1102
|
flatVariables: flattenVariables(value),
|
|
1157
1103
|
dispatch: (event) => {
|
|
@@ -1195,7 +1141,7 @@ function VariablesProvider({
|
|
|
1195
1141
|
isEditing: typeof editing !== "undefined",
|
|
1196
1142
|
variables: value
|
|
1197
1143
|
});
|
|
1198
|
-
const contextValue = (0,
|
|
1144
|
+
const contextValue = (0, import_react15.useMemo)(() => {
|
|
1199
1145
|
return {
|
|
1200
1146
|
...valueBasedContextValue,
|
|
1201
1147
|
editVariableTxn,
|
|
@@ -1206,7 +1152,7 @@ function VariablesProvider({
|
|
|
1206
1152
|
isLoading: !!isLoading
|
|
1207
1153
|
};
|
|
1208
1154
|
}, [valueBasedContextValue, editVariableTxn, editing, events, knownUndefinedValues, isLoading]);
|
|
1209
|
-
(0,
|
|
1155
|
+
(0, import_react15.useEffect)(() => {
|
|
1210
1156
|
if (editing === void 0) {
|
|
1211
1157
|
return;
|
|
1212
1158
|
}
|
|
@@ -1255,7 +1201,7 @@ function VariablesProvider({
|
|
|
1255
1201
|
] });
|
|
1256
1202
|
}
|
|
1257
1203
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
1258
|
-
const context = (0,
|
|
1204
|
+
const context = (0, import_react15.useContext)(VariablesContext);
|
|
1259
1205
|
if (!context) {
|
|
1260
1206
|
if (returnEmptyWithoutProvider) {
|
|
1261
1207
|
return {
|
|
@@ -1395,7 +1341,7 @@ function useVariablesMenu({
|
|
|
1395
1341
|
getEditorContext
|
|
1396
1342
|
}) {
|
|
1397
1343
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
1398
|
-
const canEditVariable = (0,
|
|
1344
|
+
const canEditVariable = (0, import_react17.useCallback)(
|
|
1399
1345
|
(name2, variable) => (
|
|
1400
1346
|
// name === '' means new var. Add var perms computed by menu options.
|
|
1401
1347
|
name2 === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -1403,7 +1349,7 @@ function useVariablesMenu({
|
|
|
1403
1349
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1404
1350
|
);
|
|
1405
1351
|
const canAddVariable = canDispatch && showAddVariableMenuOption && !readOnly;
|
|
1406
|
-
const { groupedVariables, menuOptions } = (0,
|
|
1352
|
+
const { groupedVariables, menuOptions } = (0, import_react17.useMemo)(() => {
|
|
1407
1353
|
const groupedVariables2 = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
1408
1354
|
if (canAddVariable) {
|
|
1409
1355
|
groupedVariables2.unshift({
|
|
@@ -1425,7 +1371,7 @@ function useVariablesMenu({
|
|
|
1425
1371
|
);
|
|
1426
1372
|
return { menuOptions: menuOptions2, groupedVariables: groupedVariables2 };
|
|
1427
1373
|
}, [variables, filterVariable, getEditorContext, canAddVariable, showAddVariableMenuOption]);
|
|
1428
|
-
const onSelect = (0,
|
|
1374
|
+
const onSelect = (0, import_react17.useCallback)(
|
|
1429
1375
|
({ queryString, value, nodeToReplace, editor, overwriteExistingValue }) => {
|
|
1430
1376
|
if (value === ADD_VARIABLE_OPTION) {
|
|
1431
1377
|
editor.update(() => {
|
|
@@ -1474,9 +1420,9 @@ function VariablesPlugin({
|
|
|
1474
1420
|
}) {
|
|
1475
1421
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
1476
1422
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
1477
|
-
const variablesRef = (0,
|
|
1423
|
+
const variablesRef = (0, import_react17.useRef)({ variables, knownUndefinedValues, isLoading });
|
|
1478
1424
|
variablesRef.current = { variables, knownUndefinedValues, isLoading };
|
|
1479
|
-
const canEditVariable = (0,
|
|
1425
|
+
const canEditVariable = (0, import_react17.useCallback)(
|
|
1480
1426
|
(name2, variable) => (
|
|
1481
1427
|
// name === '' means new var. Add var perms computed by menu options.
|
|
1482
1428
|
name2 === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -1484,13 +1430,13 @@ function VariablesPlugin({
|
|
|
1484
1430
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1485
1431
|
);
|
|
1486
1432
|
const { editVariable } = useVariableEditor();
|
|
1487
|
-
const [queryString, setQueryString] = (0,
|
|
1433
|
+
const [queryString, setQueryString] = (0, import_react17.useState)(null);
|
|
1488
1434
|
const { groupedVariables, menuOptions, onSelect } = useVariablesMenu({
|
|
1489
1435
|
showAddVariableMenuOption,
|
|
1490
1436
|
filterVariable,
|
|
1491
1437
|
getEditorContext
|
|
1492
1438
|
});
|
|
1493
|
-
const { filteredGroupedVariables, filteredMenuOptions } = (0,
|
|
1439
|
+
const { filteredGroupedVariables, filteredMenuOptions } = (0, import_react17.useMemo)(() => {
|
|
1494
1440
|
if (!queryString) {
|
|
1495
1441
|
return {
|
|
1496
1442
|
filteredGroupedVariables: groupedVariables,
|
|
@@ -1513,7 +1459,7 @@ function VariablesPlugin({
|
|
|
1513
1459
|
)
|
|
1514
1460
|
};
|
|
1515
1461
|
}, [queryString, groupedVariables, menuOptions]);
|
|
1516
|
-
const onSelectOption = (0,
|
|
1462
|
+
const onSelectOption = (0, import_react17.useCallback)(
|
|
1517
1463
|
(selectedOption, nodeToReplace, closeMenu) => {
|
|
1518
1464
|
onSelect({
|
|
1519
1465
|
queryString: queryString != null ? queryString : void 0,
|
|
@@ -1526,7 +1472,7 @@ function VariablesPlugin({
|
|
|
1526
1472
|
},
|
|
1527
1473
|
[editor, onSelect, queryString, replaceValueOnVariableInsert]
|
|
1528
1474
|
);
|
|
1529
|
-
(0,
|
|
1475
|
+
(0, import_react17.useEffect)(() => {
|
|
1530
1476
|
return (0, import_utils.mergeRegister)(
|
|
1531
1477
|
editor.registerCommand(
|
|
1532
1478
|
EDIT_VARIABLE_COMMAND,
|
|
@@ -1666,7 +1612,7 @@ function VariablesPlugin({
|
|
|
1666
1612
|
replaceValueOnVariableInsert,
|
|
1667
1613
|
disableVariableDisplayNames
|
|
1668
1614
|
]);
|
|
1669
|
-
const computeUpdatedVariableNodeState = (0,
|
|
1615
|
+
const computeUpdatedVariableNodeState = (0, import_react17.useCallback)(
|
|
1670
1616
|
(variableNode) => {
|
|
1671
1617
|
var _a, _b, _c, _d;
|
|
1672
1618
|
const targetVar = variablesRef.current.variables[variableNode.reference];
|
|
@@ -1691,7 +1637,7 @@ function VariablesPlugin({
|
|
|
1691
1637
|
},
|
|
1692
1638
|
[canEditVariable, disableVariableDisplayNames]
|
|
1693
1639
|
);
|
|
1694
|
-
const updateExistingNodeIfChanged = (0,
|
|
1640
|
+
const updateExistingNodeIfChanged = (0, import_react17.useCallback)(
|
|
1695
1641
|
(variableNode) => {
|
|
1696
1642
|
const newState = computeUpdatedVariableNodeState(variableNode);
|
|
1697
1643
|
if (newState) {
|
|
@@ -1700,7 +1646,7 @@ function VariablesPlugin({
|
|
|
1700
1646
|
},
|
|
1701
1647
|
[computeUpdatedVariableNodeState]
|
|
1702
1648
|
);
|
|
1703
|
-
(0,
|
|
1649
|
+
(0, import_react17.useEffect)(() => {
|
|
1704
1650
|
const pendingUpdates = [];
|
|
1705
1651
|
editor.read(() => {
|
|
1706
1652
|
(0, import_utils.$dfs)().forEach(({ node }) => {
|
|
@@ -1731,7 +1677,7 @@ function VariablesPlugin({
|
|
|
1731
1677
|
}
|
|
1732
1678
|
});
|
|
1733
1679
|
}, [editor, variables, knownUndefinedValues, computeUpdatedVariableNodeState]);
|
|
1734
|
-
(0,
|
|
1680
|
+
(0, import_react17.useEffect)(() => {
|
|
1735
1681
|
return editor.registerNodeTransform(VariableNode, (variableNode) => {
|
|
1736
1682
|
updateExistingNodeIfChanged(variableNode);
|
|
1737
1683
|
});
|
|
@@ -1756,7 +1702,7 @@ function VariablesPlugin({
|
|
|
1756
1702
|
"div",
|
|
1757
1703
|
{
|
|
1758
1704
|
"data-auto-resize-opt-in": true,
|
|
1759
|
-
css:
|
|
1705
|
+
css: import_react16.css`
|
|
1760
1706
|
box-shadow: var(--shadow-base);
|
|
1761
1707
|
border-radius: var(--rounded-base);
|
|
1762
1708
|
background: var(--gray-50);
|
|
@@ -1920,7 +1866,7 @@ function VariableNodeComponent({
|
|
|
1920
1866
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
1921
1867
|
const [isSelected, setSelected, clearSelection] = (0, import_useLexicalNodeSelection.useLexicalNodeSelection)(nodeKey);
|
|
1922
1868
|
const readOnly = !editor.isEditable();
|
|
1923
|
-
const onDelete = (0,
|
|
1869
|
+
const onDelete = (0, import_react18.useCallback)(
|
|
1924
1870
|
(event) => {
|
|
1925
1871
|
if (isSelected && (0, import_lexical5.$isNodeSelection)((0, import_lexical5.$getSelection)())) {
|
|
1926
1872
|
event.preventDefault();
|
|
@@ -1933,7 +1879,7 @@ function VariableNodeComponent({
|
|
|
1933
1879
|
},
|
|
1934
1880
|
[isSelected, nodeKey]
|
|
1935
1881
|
);
|
|
1936
|
-
(0,
|
|
1882
|
+
(0, import_react18.useEffect)(() => {
|
|
1937
1883
|
return (0, import_utils2.mergeRegister)(
|
|
1938
1884
|
editor.registerCommand(import_lexical5.KEY_DELETE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
|
|
1939
1885
|
editor.registerCommand(import_lexical5.KEY_BACKSPACE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
|
|
@@ -2021,9 +1967,9 @@ function $isTargetWithinDecorator(target) {
|
|
|
2021
1967
|
}
|
|
2022
1968
|
|
|
2023
1969
|
// src/components/Variables/InputVariables.tsx
|
|
2024
|
-
var
|
|
1970
|
+
var import_react29 = require("@emotion/react");
|
|
2025
1971
|
var import_design_system9 = require("@uniformdev/design-system");
|
|
2026
|
-
var
|
|
1972
|
+
var import_react30 = require("react");
|
|
2027
1973
|
var import_uuid = require("uuid");
|
|
2028
1974
|
|
|
2029
1975
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -2044,10 +1990,10 @@ function EditorRefPlugin({
|
|
|
2044
1990
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
2045
1991
|
var import_utils3 = require("@lexical/utils");
|
|
2046
1992
|
var import_lexical6 = require("lexical");
|
|
2047
|
-
var
|
|
1993
|
+
var import_react19 = require("react");
|
|
2048
1994
|
function PasteTransformerPlugin({ transformPaste }) {
|
|
2049
1995
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
2050
|
-
(0,
|
|
1996
|
+
(0, import_react19.useEffect)(() => {
|
|
2051
1997
|
return (0, import_utils3.mergeRegister)(
|
|
2052
1998
|
editor.registerCommand(
|
|
2053
1999
|
import_lexical6.PASTE_COMMAND,
|
|
@@ -2072,17 +2018,17 @@ function PasteTransformerPlugin({ transformPaste }) {
|
|
|
2072
2018
|
}
|
|
2073
2019
|
|
|
2074
2020
|
// src/components/Variables/styles/InputVariables.styles.ts
|
|
2075
|
-
var
|
|
2076
|
-
var menuContainer =
|
|
2021
|
+
var import_react20 = require("@emotion/react");
|
|
2022
|
+
var menuContainer = import_react20.css`
|
|
2077
2023
|
position: relative;
|
|
2078
2024
|
`;
|
|
2079
|
-
var menuBtn2 =
|
|
2025
|
+
var menuBtn2 = import_react20.css`
|
|
2080
2026
|
position: absolute;
|
|
2081
2027
|
top: 50%;
|
|
2082
2028
|
right: var(--spacing-sm);
|
|
2083
2029
|
transform: translateY(-50%);
|
|
2084
2030
|
`;
|
|
2085
|
-
var input =
|
|
2031
|
+
var input = import_react20.css`
|
|
2086
2032
|
--input-padding: 12px var(--spacing-lg) 12px var(--spacing-sm);
|
|
2087
2033
|
appearance: none;
|
|
2088
2034
|
background-color: var(--white);
|
|
@@ -2127,7 +2073,7 @@ var input = import_react21.css`
|
|
|
2127
2073
|
margin: 0;
|
|
2128
2074
|
}
|
|
2129
2075
|
`;
|
|
2130
|
-
var inputCompact =
|
|
2076
|
+
var inputCompact = import_react20.css`
|
|
2131
2077
|
border: 1px solid var(--white);
|
|
2132
2078
|
padding-block: var(--spacing-sm);
|
|
2133
2079
|
font-size: var(--fs-sm);
|
|
@@ -2136,11 +2082,11 @@ var inputCompact = import_react21.css`
|
|
|
2136
2082
|
min-height: 39px;
|
|
2137
2083
|
}
|
|
2138
2084
|
`;
|
|
2139
|
-
var inputDisabled =
|
|
2085
|
+
var inputDisabled = import_react20.css`
|
|
2140
2086
|
cursor: not-allowed;
|
|
2141
2087
|
opacity: var(--opacity-50);
|
|
2142
2088
|
`;
|
|
2143
|
-
var placeholderCaption =
|
|
2089
|
+
var placeholderCaption = import_react20.css`
|
|
2144
2090
|
position: absolute;
|
|
2145
2091
|
color: var(--gray-400);
|
|
2146
2092
|
inset: 12px var(--spacing-base) 12px var(--spacing-sm);
|
|
@@ -2149,14 +2095,14 @@ var placeholderCaption = import_react21.css`
|
|
|
2149
2095
|
white-space: nowrap;
|
|
2150
2096
|
pointer-events: none;
|
|
2151
2097
|
`;
|
|
2152
|
-
var placeholderCompact =
|
|
2098
|
+
var placeholderCompact = import_react20.css`
|
|
2153
2099
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
|
|
2154
2100
|
`;
|
|
2155
2101
|
|
|
2156
2102
|
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
2157
|
-
var
|
|
2103
|
+
var import_react21 = require("@emotion/react");
|
|
2158
2104
|
var import_design_system7 = require("@uniformdev/design-system");
|
|
2159
|
-
var variableBindButton =
|
|
2105
|
+
var variableBindButton = import_react21.css`
|
|
2160
2106
|
--hover-color: var(--accent-dark-hover);
|
|
2161
2107
|
--active-color: var(--accent-dark-active);
|
|
2162
2108
|
border: 1px solid transparent;
|
|
@@ -2199,7 +2145,7 @@ var variableBindButton = import_react22.css`
|
|
|
2199
2145
|
max-height: unset;
|
|
2200
2146
|
}
|
|
2201
2147
|
`;
|
|
2202
|
-
var input2 =
|
|
2148
|
+
var input2 = import_react21.css`
|
|
2203
2149
|
display: block;
|
|
2204
2150
|
appearance: none;
|
|
2205
2151
|
box-sizing: border-box;
|
|
@@ -2253,7 +2199,7 @@ var input2 = import_react22.css`
|
|
|
2253
2199
|
margin: 0;
|
|
2254
2200
|
}
|
|
2255
2201
|
`;
|
|
2256
|
-
var inputMultiLine = (lines) =>
|
|
2202
|
+
var inputMultiLine = (lines) => import_react21.css`
|
|
2257
2203
|
${import_design_system7.scrollbarStyles}
|
|
2258
2204
|
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
2259
2205
|
// as the text looked to close to the bottom of the input
|
|
@@ -2264,7 +2210,7 @@ var inputMultiLine = (lines) => import_react22.css`
|
|
|
2264
2210
|
|
|
2265
2211
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
2266
2212
|
var import_canvas6 = require("@uniformdev/canvas");
|
|
2267
|
-
var
|
|
2213
|
+
var import_react22 = require("react");
|
|
2268
2214
|
function useInputVariablesState({
|
|
2269
2215
|
value,
|
|
2270
2216
|
onChange,
|
|
@@ -2280,14 +2226,14 @@ function useInputVariablesState({
|
|
|
2280
2226
|
}) {
|
|
2281
2227
|
const { variables } = useVariables(true);
|
|
2282
2228
|
const variableReferenceCountInValue = (0, import_canvas6.hasReferencedVariables)(value != null ? value : "");
|
|
2283
|
-
const [lastKnownId, setLastKnownId] = (0,
|
|
2284
|
-
const [hadVariablesInValue, setHadVariablesInValue] = (0,
|
|
2285
|
-
(0,
|
|
2229
|
+
const [lastKnownId, setLastKnownId] = (0, import_react22.useState)(id);
|
|
2230
|
+
const [hadVariablesInValue, setHadVariablesInValue] = (0, import_react22.useState)(variableReferenceCountInValue > 0);
|
|
2231
|
+
(0, import_react22.useEffect)(() => {
|
|
2286
2232
|
if (variableReferenceCountInValue) {
|
|
2287
2233
|
setHadVariablesInValue(true);
|
|
2288
2234
|
}
|
|
2289
2235
|
}, [variableReferenceCountInValue]);
|
|
2290
|
-
(0,
|
|
2236
|
+
(0, import_react22.useEffect)(() => {
|
|
2291
2237
|
if (id !== lastKnownId) {
|
|
2292
2238
|
setLastKnownId(id);
|
|
2293
2239
|
setHadVariablesInValue(variableReferenceCountInValue > 0);
|
|
@@ -2296,7 +2242,7 @@ function useInputVariablesState({
|
|
|
2296
2242
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
|
|
2297
2243
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
2298
2244
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
2299
|
-
const sharedMenuProps = (0,
|
|
2245
|
+
const sharedMenuProps = (0, import_react22.useMemo)(
|
|
2300
2246
|
() => ({
|
|
2301
2247
|
menuTooltip,
|
|
2302
2248
|
showAddVariableMenuOption,
|
|
@@ -2329,8 +2275,8 @@ function useInputVariablesState({
|
|
|
2329
2275
|
}
|
|
2330
2276
|
|
|
2331
2277
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
2332
|
-
var
|
|
2333
|
-
var labelText =
|
|
2278
|
+
var import_react23 = require("@emotion/react");
|
|
2279
|
+
var labelText = import_react23.css`
|
|
2334
2280
|
align-items: center;
|
|
2335
2281
|
display: flex;
|
|
2336
2282
|
gap: var(--spacing-xs);
|
|
@@ -2346,7 +2292,7 @@ var import_lexical7 = require("lexical");
|
|
|
2346
2292
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
2347
2293
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
2348
2294
|
var import_design_system8 = require("@uniformdev/design-system");
|
|
2349
|
-
var
|
|
2295
|
+
var import_react24 = require("react");
|
|
2350
2296
|
var import_jsx_runtime22 = require("@emotion/react/jsx-runtime");
|
|
2351
2297
|
function SelectVariableMenu({
|
|
2352
2298
|
onSelectVariable,
|
|
@@ -2361,7 +2307,7 @@ function SelectVariableMenu({
|
|
|
2361
2307
|
filterVariable
|
|
2362
2308
|
}) {
|
|
2363
2309
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
2364
|
-
const btnRef = (0,
|
|
2310
|
+
const btnRef = (0, import_react24.useRef)(null);
|
|
2365
2311
|
const { editVariable } = useVariableEditor();
|
|
2366
2312
|
const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
2367
2313
|
const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
|
|
@@ -2494,14 +2440,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
2494
2440
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
2495
2441
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
2496
2442
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
2497
|
-
var
|
|
2443
|
+
var import_react27 = require("react");
|
|
2498
2444
|
|
|
2499
2445
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
2500
2446
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
2501
|
-
var
|
|
2447
|
+
var import_react25 = require("react");
|
|
2502
2448
|
function DisablePlugin({ disabled }) {
|
|
2503
2449
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
2504
|
-
(0,
|
|
2450
|
+
(0, import_react25.useEffect)(() => {
|
|
2505
2451
|
editor.setEditable(!disabled);
|
|
2506
2452
|
}, [editor, disabled]);
|
|
2507
2453
|
return null;
|
|
@@ -2510,10 +2456,10 @@ function DisablePlugin({ disabled }) {
|
|
|
2510
2456
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
2511
2457
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
2512
2458
|
var import_lexical8 = require("lexical");
|
|
2513
|
-
var
|
|
2459
|
+
var import_react26 = require("react");
|
|
2514
2460
|
function SingleLineTextPlugin() {
|
|
2515
2461
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
2516
|
-
(0,
|
|
2462
|
+
(0, import_react26.useEffect)(() => {
|
|
2517
2463
|
editor.registerNodeTransform(import_lexical8.LineBreakNode, (node) => {
|
|
2518
2464
|
node.remove();
|
|
2519
2465
|
});
|
|
@@ -2534,8 +2480,8 @@ function VariablesComposer(props) {
|
|
|
2534
2480
|
autoFocus,
|
|
2535
2481
|
...variablesPluginProps
|
|
2536
2482
|
} = props;
|
|
2537
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
2538
|
-
const editorConfig = (0,
|
|
2483
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react27.useState)(value);
|
|
2484
|
+
const editorConfig = (0, import_react27.useMemo)(
|
|
2539
2485
|
() => ({
|
|
2540
2486
|
namespace: "uniform",
|
|
2541
2487
|
onError(error) {
|
|
@@ -2547,8 +2493,8 @@ function VariablesComposer(props) {
|
|
|
2547
2493
|
// oxlint-disable-next-line react/exhaustive-deps
|
|
2548
2494
|
[]
|
|
2549
2495
|
);
|
|
2550
|
-
const editorState = (0,
|
|
2551
|
-
const updateTimeout = (0,
|
|
2496
|
+
const editorState = (0, import_react27.useRef)(void 0);
|
|
2497
|
+
const updateTimeout = (0, import_react27.useRef)(void 0);
|
|
2552
2498
|
if (typeof document === "undefined") return null;
|
|
2553
2499
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
2554
2500
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -2590,7 +2536,7 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
2590
2536
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
2591
2537
|
var import_utils4 = require("@lexical/utils");
|
|
2592
2538
|
var import_lexical9 = require("lexical");
|
|
2593
|
-
var
|
|
2539
|
+
var import_react28 = require("react");
|
|
2594
2540
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2595
2541
|
function VariablesComposerInput({
|
|
2596
2542
|
css: css24,
|
|
@@ -2612,7 +2558,7 @@ function VariablesComposerInput({
|
|
|
2612
2558
|
}
|
|
2613
2559
|
function RichishCopyAndPastePlugin() {
|
|
2614
2560
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
2615
|
-
(0,
|
|
2561
|
+
(0, import_react28.useEffect)(() => {
|
|
2616
2562
|
return (0, import_utils4.mergeRegister)(
|
|
2617
2563
|
editor.registerCommand(
|
|
2618
2564
|
import_lexical9.COPY_COMMAND,
|
|
@@ -2719,7 +2665,7 @@ function InputVariables(props) {
|
|
|
2719
2665
|
singleTokenMode,
|
|
2720
2666
|
disableVariableDisplayNames
|
|
2721
2667
|
} = props;
|
|
2722
|
-
const [finalId] = (0,
|
|
2668
|
+
const [finalId] = (0, import_react30.useState)(id != null ? id : (() => (0, import_uuid.v4)()));
|
|
2723
2669
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
2724
2670
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
2725
2671
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -2738,7 +2684,7 @@ function InputVariables(props) {
|
|
|
2738
2684
|
{
|
|
2739
2685
|
align: "center",
|
|
2740
2686
|
gap: "xs",
|
|
2741
|
-
css:
|
|
2687
|
+
css: import_react29.css`
|
|
2742
2688
|
position: relative;
|
|
2743
2689
|
& > div:first-of-type {
|
|
2744
2690
|
flex-grow: 1;
|
|
@@ -2867,7 +2813,7 @@ function InputVariablesOverlayMenu({
|
|
|
2867
2813
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
2868
2814
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
2869
2815
|
var import_design_system10 = require("@uniformdev/design-system");
|
|
2870
|
-
var
|
|
2816
|
+
var import_react31 = require("react");
|
|
2871
2817
|
var import_jsx_runtime28 = require("@emotion/react/jsx-runtime");
|
|
2872
2818
|
function ParameterConnectionIndicator({
|
|
2873
2819
|
children,
|
|
@@ -2878,7 +2824,7 @@ function ParameterConnectionIndicator({
|
|
|
2878
2824
|
overrideMenuButtonParentMargin,
|
|
2879
2825
|
renderMenuInPortal = false
|
|
2880
2826
|
}) {
|
|
2881
|
-
const hasVariablesInValue = (0,
|
|
2827
|
+
const hasVariablesInValue = (0, import_react31.useMemo)(() => {
|
|
2882
2828
|
let result = false;
|
|
2883
2829
|
(0, import_canvas7.bindVariablesToObject)({
|
|
2884
2830
|
value,
|
|
@@ -2923,21 +2869,21 @@ function ParameterConnectionIndicator({
|
|
|
2923
2869
|
|
|
2924
2870
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
2925
2871
|
var import_design_system11 = require("@uniformdev/design-system");
|
|
2926
|
-
var
|
|
2872
|
+
var import_react33 = require("react");
|
|
2927
2873
|
|
|
2928
2874
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
2929
2875
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
2930
2876
|
var import_utils5 = require("@lexical/utils");
|
|
2931
2877
|
var import_lexical10 = require("lexical");
|
|
2932
|
-
var
|
|
2878
|
+
var import_react32 = require("react");
|
|
2933
2879
|
function OnDisconnectPlugin({
|
|
2934
2880
|
onDisconnect
|
|
2935
2881
|
}) {
|
|
2936
2882
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
2937
2883
|
const { variables } = useVariables(true);
|
|
2938
|
-
const variablesRef = (0,
|
|
2884
|
+
const variablesRef = (0, import_react32.useRef)(variables);
|
|
2939
2885
|
variablesRef.current = variables;
|
|
2940
|
-
(0,
|
|
2886
|
+
(0, import_react32.useEffect)(() => {
|
|
2941
2887
|
return (0, import_utils5.mergeRegister)(
|
|
2942
2888
|
editor.registerCommand(
|
|
2943
2889
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -2982,7 +2928,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2982
2928
|
hasVariablesInValue,
|
|
2983
2929
|
setHadVariablesInValue
|
|
2984
2930
|
} = useInputVariablesState(props);
|
|
2985
|
-
const handleDisconnect = (0,
|
|
2931
|
+
const handleDisconnect = (0, import_react33.useCallback)(
|
|
2986
2932
|
(variable) => {
|
|
2987
2933
|
setHadVariablesInValue(false);
|
|
2988
2934
|
if (onDisconnect) {
|
|
@@ -3035,7 +2981,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
3035
2981
|
}
|
|
3036
2982
|
|
|
3037
2983
|
// src/components/Variables/ParameterVariables.tsx
|
|
3038
|
-
var
|
|
2984
|
+
var import_react34 = require("@emotion/react");
|
|
3039
2985
|
var import_design_system12 = require("@uniformdev/design-system");
|
|
3040
2986
|
var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
|
|
3041
2987
|
function ParameterVariables(props) {
|
|
@@ -3092,8 +3038,8 @@ function ParameterVariables(props) {
|
|
|
3092
3038
|
"data-text-value": value,
|
|
3093
3039
|
css: [
|
|
3094
3040
|
input2,
|
|
3095
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
3096
|
-
inputCss != null ? inputCss :
|
|
3041
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react34.css``,
|
|
3042
|
+
inputCss != null ? inputCss : import_react34.css``
|
|
3097
3043
|
]
|
|
3098
3044
|
}
|
|
3099
3045
|
)
|
|
@@ -3129,18 +3075,18 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
3129
3075
|
}
|
|
3130
3076
|
|
|
3131
3077
|
// src/components/Variables/VariablesList.tsx
|
|
3132
|
-
var
|
|
3078
|
+
var import_react37 = require("@emotion/react");
|
|
3133
3079
|
var import_dnd2 = require("@hello-pangea/dnd");
|
|
3134
3080
|
var import_CgTrash = require("@react-icons/all-files/cg/CgTrash");
|
|
3135
3081
|
var import_design_system13 = require("@uniformdev/design-system");
|
|
3136
3082
|
|
|
3137
3083
|
// src/components/DragDropContext.tsx
|
|
3138
3084
|
var import_dnd = require("@hello-pangea/dnd");
|
|
3139
|
-
var
|
|
3085
|
+
var import_react35 = require("react");
|
|
3140
3086
|
var import_react_use = require("react-use");
|
|
3141
3087
|
var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
|
|
3142
3088
|
function DragDropContext({ children, ...props }) {
|
|
3143
|
-
const [isReady, setIsReady] = (0,
|
|
3089
|
+
const [isReady, setIsReady] = (0, import_react35.useState)(false);
|
|
3144
3090
|
(0, import_react_use.useDebounce)(
|
|
3145
3091
|
() => {
|
|
3146
3092
|
setIsReady(true);
|
|
@@ -3152,8 +3098,8 @@ function DragDropContext({ children, ...props }) {
|
|
|
3152
3098
|
}
|
|
3153
3099
|
|
|
3154
3100
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
3155
|
-
var
|
|
3156
|
-
var tableRow = (isDragging) =>
|
|
3101
|
+
var import_react36 = require("@emotion/react");
|
|
3102
|
+
var tableRow = (isDragging) => import_react36.css`
|
|
3157
3103
|
position: relative;
|
|
3158
3104
|
${isDragging ? `
|
|
3159
3105
|
display: table;
|
|
@@ -3161,7 +3107,7 @@ var tableRow = (isDragging) => import_react37.css`
|
|
|
3161
3107
|
top: auto !important;
|
|
3162
3108
|
` : void 0}
|
|
3163
3109
|
`;
|
|
3164
|
-
var tableCellDragIcon =
|
|
3110
|
+
var tableCellDragIcon = import_react36.css`
|
|
3165
3111
|
&::after {
|
|
3166
3112
|
content: '';
|
|
3167
3113
|
display: block;
|
|
@@ -3179,7 +3125,7 @@ var tableCellDragIcon = import_react37.css`
|
|
|
3179
3125
|
opacity: 1;
|
|
3180
3126
|
}
|
|
3181
3127
|
`;
|
|
3182
|
-
var variableName =
|
|
3128
|
+
var variableName = import_react36.css`
|
|
3183
3129
|
border: none;
|
|
3184
3130
|
font-weight: var(--fw-medium);
|
|
3185
3131
|
padding: 0;
|
|
@@ -3189,7 +3135,7 @@ var variableName = import_react37.css`
|
|
|
3189
3135
|
white-space: nowrap;
|
|
3190
3136
|
max-width: 20ch;
|
|
3191
3137
|
`;
|
|
3192
|
-
var variableValue =
|
|
3138
|
+
var variableValue = import_react36.css`
|
|
3193
3139
|
overflow: hidden;
|
|
3194
3140
|
text-overflow: ellipsis;
|
|
3195
3141
|
white-space: nowrap;
|
|
@@ -3268,7 +3214,7 @@ function VariablesList() {
|
|
|
3268
3214
|
title: `delete ${text}`,
|
|
3269
3215
|
css: [
|
|
3270
3216
|
import_design_system13.button,
|
|
3271
|
-
|
|
3217
|
+
import_react37.css`
|
|
3272
3218
|
background: transparent;
|
|
3273
3219
|
`
|
|
3274
3220
|
],
|
|
@@ -3398,9 +3344,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3398
3344
|
}
|
|
3399
3345
|
|
|
3400
3346
|
// src/components/Request/RequestBody.tsx
|
|
3401
|
-
var
|
|
3347
|
+
var import_react39 = require("@emotion/react");
|
|
3402
3348
|
var import_design_system15 = require("@uniformdev/design-system");
|
|
3403
|
-
var
|
|
3349
|
+
var import_react40 = require("react");
|
|
3404
3350
|
|
|
3405
3351
|
// src/components/Request/RequestProvider.tsx
|
|
3406
3352
|
var React4 = __toESM(require("react"));
|
|
@@ -3488,11 +3434,11 @@ function useRequest() {
|
|
|
3488
3434
|
}
|
|
3489
3435
|
|
|
3490
3436
|
// src/components/Request/styles/Request.styles.ts
|
|
3491
|
-
var
|
|
3492
|
-
var innerContentStyles =
|
|
3437
|
+
var import_react38 = require("@emotion/react");
|
|
3438
|
+
var innerContentStyles = import_react38.css`
|
|
3493
3439
|
background: var(--white);
|
|
3494
3440
|
`;
|
|
3495
|
-
var requestTypeContainer = (bgColor) =>
|
|
3441
|
+
var requestTypeContainer = (bgColor) => import_react38.css`
|
|
3496
3442
|
align-items: start;
|
|
3497
3443
|
background: ${bgColor};
|
|
3498
3444
|
display: grid;
|
|
@@ -3530,11 +3476,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
3530
3476
|
};
|
|
3531
3477
|
function RequestBody() {
|
|
3532
3478
|
const { request, dispatch } = useRequest();
|
|
3533
|
-
const [language, setLanguage] = (0,
|
|
3479
|
+
const [language, setLanguage] = (0, import_react40.useState)("json");
|
|
3534
3480
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3535
3481
|
"div",
|
|
3536
3482
|
{
|
|
3537
|
-
css:
|
|
3483
|
+
css: import_react39.css`
|
|
3538
3484
|
background: var(--white);
|
|
3539
3485
|
`,
|
|
3540
3486
|
children: [
|
|
@@ -3542,7 +3488,7 @@ function RequestBody() {
|
|
|
3542
3488
|
RequestTypeContainer,
|
|
3543
3489
|
{
|
|
3544
3490
|
bgColor: "var(--gray-100)",
|
|
3545
|
-
css:
|
|
3491
|
+
css: import_react39.css`
|
|
3546
3492
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
3547
3493
|
`,
|
|
3548
3494
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
@@ -3819,8 +3765,8 @@ function RequestParameters({
|
|
|
3819
3765
|
}
|
|
3820
3766
|
|
|
3821
3767
|
// src/components/Request/RequestUrl.tsx
|
|
3822
|
-
var
|
|
3823
|
-
var
|
|
3768
|
+
var import_react41 = require("@emotion/react");
|
|
3769
|
+
var import_react42 = require("react");
|
|
3824
3770
|
|
|
3825
3771
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
3826
3772
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -3846,7 +3792,7 @@ function RequestUrl() {
|
|
|
3846
3792
|
var _a, _b;
|
|
3847
3793
|
const { variables } = useVariables();
|
|
3848
3794
|
const { request } = useRequest();
|
|
3849
|
-
const mergedParameters = (0,
|
|
3795
|
+
const mergedParameters = (0, import_react42.useMemo)(() => {
|
|
3850
3796
|
var _a2;
|
|
3851
3797
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
3852
3798
|
return request.parameters;
|
|
@@ -3856,7 +3802,7 @@ function RequestUrl() {
|
|
|
3856
3802
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3857
3803
|
"small",
|
|
3858
3804
|
{
|
|
3859
|
-
css:
|
|
3805
|
+
css: import_react41.css`
|
|
3860
3806
|
display: inline-block;
|
|
3861
3807
|
margin-bottom: var(--spacing-xs);
|
|
3862
3808
|
word-break: break-word;
|
|
@@ -4091,11 +4037,11 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
4091
4037
|
|
|
4092
4038
|
// src/components/Delegation/DelegationGate.tsx
|
|
4093
4039
|
var import_design_system19 = require("@uniformdev/design-system");
|
|
4094
|
-
var
|
|
4040
|
+
var import_react44 = require("react");
|
|
4095
4041
|
|
|
4096
4042
|
// src/components/Delegation/styles/DelegationGate.style.ts
|
|
4097
|
-
var
|
|
4098
|
-
var delegationGateStyle =
|
|
4043
|
+
var import_react43 = require("@emotion/react");
|
|
4044
|
+
var delegationGateStyle = import_react43.css`
|
|
4099
4045
|
min-height: 12rem;
|
|
4100
4046
|
width: 100%;
|
|
4101
4047
|
`;
|
|
@@ -4109,7 +4055,7 @@ function DefaultDelegationDisabled() {
|
|
|
4109
4055
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.Callout, { type: "caution", title: "Feature unavailable", children: "This app requires permissions that are not currently enabled. Please contact your Uniform administrator to enable identity delegation for this integration." });
|
|
4110
4056
|
}
|
|
4111
4057
|
function DefaultDelegationError({ error }) {
|
|
4112
|
-
(0,
|
|
4058
|
+
(0, import_react44.useEffect)(() => {
|
|
4113
4059
|
console.error("Delegation connection failed", error);
|
|
4114
4060
|
}, [error]);
|
|
4115
4061
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.Callout, { type: "error", title: "Connection error", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "Failed to connect to Uniform. Try again, or contact your administrator if the problem persists." }) });
|
|
@@ -4144,15 +4090,9 @@ function DelegationGate({
|
|
|
4144
4090
|
}
|
|
4145
4091
|
|
|
4146
4092
|
// src/components/Delegation/DelegationProvider.tsx
|
|
4147
|
-
var
|
|
4093
|
+
var import_react45 = require("react");
|
|
4148
4094
|
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
4149
|
-
var
|
|
4150
|
-
constructor() {
|
|
4151
|
-
super("Identity delegation is not enabled for this integration.");
|
|
4152
|
-
this.name = "DelegationDisabledError";
|
|
4153
|
-
}
|
|
4154
|
-
};
|
|
4155
|
-
var DEFAULT_REVALIDATE_AFTER_MS = 30 * 1e3;
|
|
4095
|
+
var DEFAULT_REVALIDATE_AFTER_MS = 5 * 60 * 1e3;
|
|
4156
4096
|
function DelegationProvider({
|
|
4157
4097
|
sdk,
|
|
4158
4098
|
onSessionToken,
|
|
@@ -4161,70 +4101,60 @@ function DelegationProvider({
|
|
|
4161
4101
|
revalidateAfterMs = DEFAULT_REVALIDATE_AFTER_MS,
|
|
4162
4102
|
children
|
|
4163
4103
|
}) {
|
|
4164
|
-
const [status, setStatus] = (0,
|
|
4165
|
-
const [error, setError] = (0,
|
|
4166
|
-
const
|
|
4167
|
-
const
|
|
4104
|
+
const [status, setStatus] = (0, import_react45.useState)("idle");
|
|
4105
|
+
const [error, setError] = (0, import_react45.useState)(null);
|
|
4106
|
+
const acquiringRef = (0, import_react45.useRef)(false);
|
|
4107
|
+
const mountedRef = (0, import_react45.useRef)(true);
|
|
4108
|
+
const statusRef = (0, import_react45.useRef)("idle");
|
|
4168
4109
|
statusRef.current = status;
|
|
4169
|
-
const
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
try {
|
|
4180
|
-
const isActive = await checkActive();
|
|
4181
|
-
if (isActive) {
|
|
4182
|
-
if (mountedRef.current) {
|
|
4183
|
-
setStatus("active");
|
|
4184
|
-
}
|
|
4185
|
-
return;
|
|
4186
|
-
}
|
|
4187
|
-
if (!mountedRef.current) {
|
|
4188
|
-
return;
|
|
4189
|
-
}
|
|
4190
|
-
const sessionToken = await sdk.getSessionToken();
|
|
4191
|
-
if (!mountedRef.current) {
|
|
4192
|
-
return;
|
|
4193
|
-
}
|
|
4194
|
-
if (!sessionToken) {
|
|
4195
|
-
if (mountedRef.current) {
|
|
4196
|
-
setStatus("disabled");
|
|
4197
|
-
}
|
|
4198
|
-
throw new DelegationDisabledError();
|
|
4199
|
-
}
|
|
4200
|
-
await onSessionToken(sessionToken);
|
|
4110
|
+
const acquire = (0, import_react45.useCallback)(async () => {
|
|
4111
|
+
if (acquiringRef.current) {
|
|
4112
|
+
return;
|
|
4113
|
+
}
|
|
4114
|
+
acquiringRef.current = true;
|
|
4115
|
+
setStatus("acquiring");
|
|
4116
|
+
setError(null);
|
|
4117
|
+
try {
|
|
4118
|
+
const isActive = await checkActive();
|
|
4119
|
+
if (isActive) {
|
|
4201
4120
|
if (mountedRef.current) {
|
|
4202
4121
|
setStatus("active");
|
|
4203
4122
|
}
|
|
4204
|
-
|
|
4205
|
-
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
4206
|
-
if (mountedRef.current && !(err instanceof DelegationDisabledError)) {
|
|
4207
|
-
setError(error2);
|
|
4208
|
-
setStatus("error");
|
|
4209
|
-
}
|
|
4210
|
-
throw error2;
|
|
4123
|
+
return;
|
|
4211
4124
|
}
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4125
|
+
if (!mountedRef.current) {
|
|
4126
|
+
return;
|
|
4127
|
+
}
|
|
4128
|
+
const sessionToken = await sdk.getSessionToken();
|
|
4129
|
+
if (!mountedRef.current) {
|
|
4130
|
+
return;
|
|
4131
|
+
}
|
|
4132
|
+
if (!sessionToken) {
|
|
4133
|
+
setStatus("disabled");
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
await onSessionToken(sessionToken);
|
|
4137
|
+
if (mountedRef.current) {
|
|
4138
|
+
setStatus("active");
|
|
4139
|
+
}
|
|
4140
|
+
} catch (err) {
|
|
4141
|
+
if (mountedRef.current) {
|
|
4142
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
4143
|
+
setStatus("error");
|
|
4144
|
+
}
|
|
4145
|
+
} finally {
|
|
4146
|
+
acquiringRef.current = false;
|
|
4147
|
+
}
|
|
4217
4148
|
}, [sdk, onSessionToken, checkActive]);
|
|
4218
|
-
(0,
|
|
4149
|
+
(0, import_react45.useEffect)(() => {
|
|
4219
4150
|
mountedRef.current = true;
|
|
4220
|
-
void acquire()
|
|
4221
|
-
});
|
|
4151
|
+
void acquire();
|
|
4222
4152
|
return () => {
|
|
4223
4153
|
mountedRef.current = false;
|
|
4224
4154
|
};
|
|
4225
4155
|
}, [acquire]);
|
|
4226
|
-
const revalidate = (0,
|
|
4227
|
-
if (
|
|
4156
|
+
const revalidate = (0, import_react45.useCallback)(async () => {
|
|
4157
|
+
if (acquiringRef.current) {
|
|
4228
4158
|
return;
|
|
4229
4159
|
}
|
|
4230
4160
|
if (statusRef.current !== "active") {
|
|
@@ -4236,13 +4166,12 @@ function DelegationProvider({
|
|
|
4236
4166
|
return;
|
|
4237
4167
|
}
|
|
4238
4168
|
if (!isActive) {
|
|
4239
|
-
void acquire()
|
|
4240
|
-
});
|
|
4169
|
+
void acquire();
|
|
4241
4170
|
}
|
|
4242
4171
|
} catch (e) {
|
|
4243
4172
|
}
|
|
4244
4173
|
}, [checkActive, acquire]);
|
|
4245
|
-
(0,
|
|
4174
|
+
(0, import_react45.useEffect)(() => {
|
|
4246
4175
|
if (!revalidateOnFocus) {
|
|
4247
4176
|
return;
|
|
4248
4177
|
}
|
|
@@ -4268,7 +4197,10 @@ function DelegationProvider({
|
|
|
4268
4197
|
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
4269
4198
|
};
|
|
4270
4199
|
}, [revalidateOnFocus, revalidateAfterMs, revalidate]);
|
|
4271
|
-
const
|
|
4200
|
+
const reacquire = (0, import_react45.useCallback)(() => {
|
|
4201
|
+
void acquire();
|
|
4202
|
+
}, [acquire]);
|
|
4203
|
+
const value = (0, import_react45.useMemo)(() => ({ status, error, reacquire }), [status, error, reacquire]);
|
|
4272
4204
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DelegationContext.Provider, { value, children });
|
|
4273
4205
|
}
|
|
4274
4206
|
|
|
@@ -4276,20 +4208,20 @@ function DelegationProvider({
|
|
|
4276
4208
|
var import_design_system20 = require("@uniformdev/design-system");
|
|
4277
4209
|
|
|
4278
4210
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
4279
|
-
var
|
|
4280
|
-
var
|
|
4211
|
+
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
4212
|
+
var import_react46 = require("react");
|
|
4281
4213
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
4282
|
-
const [error, setError] = (0,
|
|
4283
|
-
const [sdk, setSdk] = (0,
|
|
4284
|
-
const initializationInProgress = (0,
|
|
4285
|
-
(0,
|
|
4214
|
+
const [error, setError] = (0, import_react46.useState)();
|
|
4215
|
+
const [sdk, setSdk] = (0, import_react46.useState)();
|
|
4216
|
+
const initializationInProgress = (0, import_react46.useRef)(false);
|
|
4217
|
+
(0, import_react46.useEffect)(
|
|
4286
4218
|
() => {
|
|
4287
4219
|
if (typeof window === "undefined" || sdk) {
|
|
4288
4220
|
return;
|
|
4289
4221
|
}
|
|
4290
4222
|
if (typeof window.UniformMeshSDK === "undefined" && !initializationInProgress.current) {
|
|
4291
4223
|
initializationInProgress.current = true;
|
|
4292
|
-
(0,
|
|
4224
|
+
(0, import_mesh_sdk.initializeUniformMeshSDK)({ autoResizingDisabled }).then((sdk2) => {
|
|
4293
4225
|
setSdk(sdk2);
|
|
4294
4226
|
}).catch((err) => {
|
|
4295
4227
|
setError(err);
|
|
@@ -4340,7 +4272,7 @@ var MeshApp = ({
|
|
|
4340
4272
|
};
|
|
4341
4273
|
|
|
4342
4274
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
4343
|
-
var
|
|
4275
|
+
var import_react47 = require("@emotion/react");
|
|
4344
4276
|
var import_design_system21 = require("@uniformdev/design-system");
|
|
4345
4277
|
var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
|
|
4346
4278
|
var DataRefreshButton = ({
|
|
@@ -4353,7 +4285,7 @@ var DataRefreshButton = ({
|
|
|
4353
4285
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4354
4286
|
import_design_system21.LoadingIndicator,
|
|
4355
4287
|
{
|
|
4356
|
-
css:
|
|
4288
|
+
css: import_react47.css`
|
|
4357
4289
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
4358
4290
|
`
|
|
4359
4291
|
}
|
|
@@ -4363,15 +4295,15 @@ var DataRefreshButton = ({
|
|
|
4363
4295
|
};
|
|
4364
4296
|
|
|
4365
4297
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4366
|
-
var
|
|
4298
|
+
var import_react50 = require("@emotion/react");
|
|
4367
4299
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
4368
4300
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
4369
4301
|
|
|
4370
4302
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
4371
4303
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
4372
|
-
var
|
|
4304
|
+
var import_react48 = require("react");
|
|
4373
4305
|
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
4374
|
-
var ObjectSearchContext = (0,
|
|
4306
|
+
var ObjectSearchContext = (0, import_react48.createContext)({
|
|
4375
4307
|
onSetQuery: () => {
|
|
4376
4308
|
},
|
|
4377
4309
|
onSelectItem: () => {
|
|
@@ -4392,16 +4324,16 @@ var ObjectSearchProvider = ({
|
|
|
4392
4324
|
children,
|
|
4393
4325
|
defaultQuery
|
|
4394
4326
|
}) => {
|
|
4395
|
-
const [query, setQuery] = (0,
|
|
4327
|
+
const [query, setQuery] = (0, import_react48.useState)({
|
|
4396
4328
|
contentType: "",
|
|
4397
4329
|
keyword: "",
|
|
4398
4330
|
...defaultQuery
|
|
4399
4331
|
});
|
|
4400
4332
|
const { flatVariables } = useVariables(true);
|
|
4401
|
-
const querySearchDeferred = (0,
|
|
4402
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
4403
|
-
const [list, setList] = (0,
|
|
4404
|
-
const onSetQuery = (0,
|
|
4333
|
+
const querySearchDeferred = (0, import_react48.useDeferredValue)(query);
|
|
4334
|
+
const [selectedItems, setSelectedItems] = (0, import_react48.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4335
|
+
const [list, setList] = (0, import_react48.useState)({});
|
|
4336
|
+
const onSetQuery = (0, import_react48.useCallback)(
|
|
4405
4337
|
(value2) => {
|
|
4406
4338
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
4407
4339
|
return setQuery({
|
|
@@ -4413,7 +4345,7 @@ var ObjectSearchProvider = ({
|
|
|
4413
4345
|
},
|
|
4414
4346
|
[setQuery]
|
|
4415
4347
|
);
|
|
4416
|
-
const onSelectItem = (0,
|
|
4348
|
+
const onSelectItem = (0, import_react48.useCallback)(
|
|
4417
4349
|
(selectedResult) => {
|
|
4418
4350
|
if (Array.isArray(selectedResult)) {
|
|
4419
4351
|
setSelectedItems(selectedResult);
|
|
@@ -4427,17 +4359,17 @@ var ObjectSearchProvider = ({
|
|
|
4427
4359
|
},
|
|
4428
4360
|
[setSelectedItems, selectedItems]
|
|
4429
4361
|
);
|
|
4430
|
-
const onRemoveAllSelectedItems = (0,
|
|
4362
|
+
const onRemoveAllSelectedItems = (0, import_react48.useCallback)(() => {
|
|
4431
4363
|
setSelectedItems([]);
|
|
4432
4364
|
}, [setSelectedItems]);
|
|
4433
|
-
const onSetList = (0,
|
|
4365
|
+
const onSetList = (0, import_react48.useCallback)(
|
|
4434
4366
|
(value2) => {
|
|
4435
4367
|
setList(value2);
|
|
4436
4368
|
},
|
|
4437
4369
|
[setList]
|
|
4438
4370
|
);
|
|
4439
|
-
const boundQuery = (0,
|
|
4440
|
-
const value = (0,
|
|
4371
|
+
const boundQuery = (0, import_react48.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4372
|
+
const value = (0, import_react48.useMemo)(
|
|
4441
4373
|
() => ({
|
|
4442
4374
|
boundQuery,
|
|
4443
4375
|
onSetQuery,
|
|
@@ -4464,7 +4396,7 @@ var ObjectSearchProvider = ({
|
|
|
4464
4396
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
4465
4397
|
};
|
|
4466
4398
|
function useObjectSearchContext() {
|
|
4467
|
-
return (0,
|
|
4399
|
+
return (0, import_react48.useContext)(ObjectSearchContext);
|
|
4468
4400
|
}
|
|
4469
4401
|
function bindQuery(query, inputs) {
|
|
4470
4402
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -4482,9 +4414,9 @@ function bindQuery(query, inputs) {
|
|
|
4482
4414
|
var import_design_system23 = require("@uniformdev/design-system");
|
|
4483
4415
|
|
|
4484
4416
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
4485
|
-
var
|
|
4417
|
+
var import_react49 = require("@emotion/react");
|
|
4486
4418
|
var import_design_system22 = require("@uniformdev/design-system");
|
|
4487
|
-
var ObjectListItemContainer =
|
|
4419
|
+
var ObjectListItemContainer = import_react49.css`
|
|
4488
4420
|
align-items: center;
|
|
4489
4421
|
border: 1px solid var(--gray-300);
|
|
4490
4422
|
border-radius: var(--rounded-base);
|
|
@@ -4493,11 +4425,11 @@ var ObjectListItemContainer = import_react50.css`
|
|
|
4493
4425
|
grid-template-columns: 1fr auto;
|
|
4494
4426
|
padding: var(--spacing-sm);
|
|
4495
4427
|
`;
|
|
4496
|
-
var ObjectListItemContainerDisabled =
|
|
4428
|
+
var ObjectListItemContainerDisabled = import_react49.css`
|
|
4497
4429
|
opacity: var(--opacity-50);
|
|
4498
4430
|
pointer-events: none;
|
|
4499
4431
|
`;
|
|
4500
|
-
var ObjectListItemLoading =
|
|
4432
|
+
var ObjectListItemLoading = import_react49.css`
|
|
4501
4433
|
animation: ${import_design_system22.skeletonLoading} 1s linear infinite alternate;
|
|
4502
4434
|
border-color: transparent;
|
|
4503
4435
|
min-height: 42px;
|
|
@@ -4521,37 +4453,37 @@ var ObjectListItemLoading = import_react50.css`
|
|
|
4521
4453
|
width: 1rem;
|
|
4522
4454
|
}
|
|
4523
4455
|
`;
|
|
4524
|
-
var ObjectListItemHeadingGroup =
|
|
4456
|
+
var ObjectListItemHeadingGroup = import_react49.css`
|
|
4525
4457
|
align-items: center;
|
|
4526
4458
|
display: grid;
|
|
4527
4459
|
`;
|
|
4528
|
-
var ObjectListItemThumbnail =
|
|
4460
|
+
var ObjectListItemThumbnail = import_react49.css`
|
|
4529
4461
|
width: 30px;
|
|
4530
4462
|
height: 30px;
|
|
4531
4463
|
object-fit: cover;
|
|
4532
4464
|
`;
|
|
4533
|
-
var ObjectListItemTitle =
|
|
4465
|
+
var ObjectListItemTitle = import_react49.css`
|
|
4534
4466
|
color: var(--typography-base);
|
|
4535
4467
|
display: block;
|
|
4536
4468
|
font-size: var(--fs-sm);
|
|
4537
4469
|
`;
|
|
4538
|
-
var ObjectListItemSubtitle =
|
|
4470
|
+
var ObjectListItemSubtitle = import_react49.css`
|
|
4539
4471
|
color: var(--gray-500);
|
|
4540
4472
|
display: block;
|
|
4541
4473
|
font-size: var(--fs-xs);
|
|
4542
4474
|
line-height: 1;
|
|
4543
4475
|
`;
|
|
4544
|
-
var ObjectListItemInfoContainer =
|
|
4476
|
+
var ObjectListItemInfoContainer = import_react49.css`
|
|
4545
4477
|
align-items: center;
|
|
4546
4478
|
display: flex;
|
|
4547
4479
|
gap: var(--spacing-sm);
|
|
4548
4480
|
justify-content: center;
|
|
4549
4481
|
`;
|
|
4550
|
-
var ObjectListItemControlledContent =
|
|
4482
|
+
var ObjectListItemControlledContent = import_react49.css`
|
|
4551
4483
|
display: flex;
|
|
4552
4484
|
gap: var(--spacing-sm);
|
|
4553
4485
|
`;
|
|
4554
|
-
var ObjectListItemUnControlledContent =
|
|
4486
|
+
var ObjectListItemUnControlledContent = import_react49.css`
|
|
4555
4487
|
margin-top: var(--spacing-sm);
|
|
4556
4488
|
grid-column: 1 / -1;
|
|
4557
4489
|
`;
|
|
@@ -4644,7 +4576,7 @@ var ObjectSearchContainer = ({
|
|
|
4644
4576
|
import_design_system24.ScrollableList,
|
|
4645
4577
|
{
|
|
4646
4578
|
role: "list",
|
|
4647
|
-
css:
|
|
4579
|
+
css: import_react50.css`
|
|
4648
4580
|
> div {
|
|
4649
4581
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4650
4582
|
}
|
|
@@ -4716,11 +4648,11 @@ var DefaultResultList = () => {
|
|
|
4716
4648
|
|
|
4717
4649
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4718
4650
|
var import_design_system25 = require("@uniformdev/design-system");
|
|
4719
|
-
var
|
|
4651
|
+
var import_react52 = require("react");
|
|
4720
4652
|
|
|
4721
4653
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4722
|
-
var
|
|
4723
|
-
var ObjectSearchFilterContainerLabel =
|
|
4654
|
+
var import_react51 = require("@emotion/react");
|
|
4655
|
+
var ObjectSearchFilterContainerLabel = import_react51.css`
|
|
4724
4656
|
align-items: center;
|
|
4725
4657
|
display: flex;
|
|
4726
4658
|
font-size: var(--fs-sm);
|
|
@@ -4728,11 +4660,11 @@ var ObjectSearchFilterContainerLabel = import_react52.css`
|
|
|
4728
4660
|
line-height: 1rem;
|
|
4729
4661
|
margin-bottom: var(--spacing-sm);
|
|
4730
4662
|
`;
|
|
4731
|
-
var ObjectSearchFilterContainer =
|
|
4663
|
+
var ObjectSearchFilterContainer = import_react51.css`
|
|
4732
4664
|
display: grid;
|
|
4733
4665
|
gap: var(--spacing-base);
|
|
4734
4666
|
`;
|
|
4735
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
4667
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react51.css`
|
|
4736
4668
|
display: grid;
|
|
4737
4669
|
grid-template-columns: ${gridColumns};
|
|
4738
4670
|
gap: var(--spacing-base);
|
|
@@ -4750,7 +4682,7 @@ var ObjectSearchFilter = ({
|
|
|
4750
4682
|
}) => {
|
|
4751
4683
|
var _a, _b;
|
|
4752
4684
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4753
|
-
const [searchState, setSearchState] = (0,
|
|
4685
|
+
const [searchState, setSearchState] = (0, import_react52.useState)({
|
|
4754
4686
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4755
4687
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
4756
4688
|
});
|
|
@@ -4760,7 +4692,7 @@ var ObjectSearchFilter = ({
|
|
|
4760
4692
|
});
|
|
4761
4693
|
onSetQuery({ ...query, ...value });
|
|
4762
4694
|
};
|
|
4763
|
-
const memoizedSelectOptions = (0,
|
|
4695
|
+
const memoizedSelectOptions = (0, import_react52.useMemo)(() => {
|
|
4764
4696
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4765
4697
|
return [];
|
|
4766
4698
|
}
|
|
@@ -4822,9 +4754,9 @@ function Image({ src, alt, className }) {
|
|
|
4822
4754
|
}
|
|
4823
4755
|
|
|
4824
4756
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
4825
|
-
var
|
|
4757
|
+
var import_react53 = require("@emotion/react");
|
|
4826
4758
|
var import_design_system26 = require("@uniformdev/design-system");
|
|
4827
|
-
var ButtonStyles =
|
|
4759
|
+
var ButtonStyles = import_react53.css`
|
|
4828
4760
|
${import_design_system26.button}
|
|
4829
4761
|
background: transparent;
|
|
4830
4762
|
border: 1px solid var(--typography-base);
|
|
@@ -4852,7 +4784,7 @@ var ButtonStyles = import_react54.css`
|
|
|
4852
4784
|
text-decoration: none;
|
|
4853
4785
|
}
|
|
4854
4786
|
`;
|
|
4855
|
-
var ButtonIcon =
|
|
4787
|
+
var ButtonIcon = import_react53.css`
|
|
4856
4788
|
width: 1rem;
|
|
4857
4789
|
height: 1rem;
|
|
4858
4790
|
`;
|
|
@@ -4881,8 +4813,8 @@ var LinkButton = ({
|
|
|
4881
4813
|
};
|
|
4882
4814
|
|
|
4883
4815
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
4884
|
-
var
|
|
4885
|
-
var ObjectSearchResultItemContainer =
|
|
4816
|
+
var import_react54 = require("@emotion/react");
|
|
4817
|
+
var ObjectSearchResultItemContainer = import_react54.css`
|
|
4886
4818
|
align-items: center;
|
|
4887
4819
|
border: 1px solid var(--gray-300);
|
|
4888
4820
|
border-radius: var(--rounded-base);
|
|
@@ -4898,7 +4830,7 @@ var ObjectSearchResultItemContainer = import_react55.css`
|
|
|
4898
4830
|
}
|
|
4899
4831
|
}
|
|
4900
4832
|
`;
|
|
4901
|
-
var ObjectSearchDragHandle =
|
|
4833
|
+
var ObjectSearchDragHandle = import_react54.css`
|
|
4902
4834
|
border-left: 2px dotted var(--gray-300);
|
|
4903
4835
|
border-right: 2px dotted var(--gray-300);
|
|
4904
4836
|
position: absolute;
|
|
@@ -4907,40 +4839,40 @@ var ObjectSearchDragHandle = import_react55.css`
|
|
|
4907
4839
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4908
4840
|
opacity: 0;
|
|
4909
4841
|
`;
|
|
4910
|
-
var ObjectSearchResultItemSubtitle =
|
|
4842
|
+
var ObjectSearchResultItemSubtitle = import_react54.css`
|
|
4911
4843
|
color: var(--gray-500);
|
|
4912
4844
|
display: block;
|
|
4913
4845
|
font-size: var(--fs-xs);
|
|
4914
4846
|
line-height: 1;
|
|
4915
4847
|
`;
|
|
4916
|
-
var ObjectSearchResultItemTitle =
|
|
4848
|
+
var ObjectSearchResultItemTitle = import_react54.css`
|
|
4917
4849
|
align-items: center;
|
|
4918
4850
|
color: var(--typography-base);
|
|
4919
4851
|
display: flex;
|
|
4920
4852
|
gap: var(--spacing-xs);
|
|
4921
4853
|
`;
|
|
4922
|
-
var ObjectSearchResultItemTimeStamp =
|
|
4854
|
+
var ObjectSearchResultItemTimeStamp = import_react54.css`
|
|
4923
4855
|
color: var(--gray-500);
|
|
4924
4856
|
font-size: var(--fs-xs);
|
|
4925
4857
|
`;
|
|
4926
|
-
var ObjectSearchResultItemTitleLink =
|
|
4858
|
+
var ObjectSearchResultItemTitleLink = import_react54.css`
|
|
4927
4859
|
text-decoration: none;
|
|
4928
4860
|
color: var(--primary-action-default);
|
|
4929
4861
|
font-size: var(--fs-sm);
|
|
4930
4862
|
`;
|
|
4931
|
-
var ObjectSearchAuthorStateGroup =
|
|
4863
|
+
var ObjectSearchAuthorStateGroup = import_react54.css`
|
|
4932
4864
|
align-items: center;
|
|
4933
4865
|
display: flex;
|
|
4934
4866
|
gap: var(--spacing-sm);
|
|
4935
4867
|
`;
|
|
4936
|
-
var ObjectSearchUpdateGroup =
|
|
4868
|
+
var ObjectSearchUpdateGroup = import_react54.css`
|
|
4937
4869
|
display: grid;
|
|
4938
4870
|
`;
|
|
4939
|
-
var ObjectSearchContentContainer =
|
|
4871
|
+
var ObjectSearchContentContainer = import_react54.css`
|
|
4940
4872
|
display: flex;
|
|
4941
4873
|
gap: var(--spacing-base);
|
|
4942
4874
|
`;
|
|
4943
|
-
var ObjectSearchImage =
|
|
4875
|
+
var ObjectSearchImage = import_react54.css`
|
|
4944
4876
|
width: 56px;
|
|
4945
4877
|
height: 56px;
|
|
4946
4878
|
object-fit: cover;
|
|
@@ -5043,26 +4975,26 @@ var import_dnd3 = require("@hello-pangea/dnd");
|
|
|
5043
4975
|
var import_design_system28 = require("@uniformdev/design-system");
|
|
5044
4976
|
|
|
5045
4977
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
5046
|
-
var
|
|
5047
|
-
var ObjectSearchResultListContainer =
|
|
4978
|
+
var import_react55 = require("@emotion/react");
|
|
4979
|
+
var ObjectSearchResultListContainer = import_react55.css`
|
|
5048
4980
|
align-items: center;
|
|
5049
4981
|
display: flex;
|
|
5050
4982
|
gap: var(--spacing-sm);
|
|
5051
4983
|
justify-content: space-between;
|
|
5052
4984
|
`;
|
|
5053
|
-
var ObjectSearchDragContainer =
|
|
4985
|
+
var ObjectSearchDragContainer = import_react55.css`
|
|
5054
4986
|
margin: 0 0 var(--spacing-sm);
|
|
5055
4987
|
`;
|
|
5056
|
-
var ObjectSearchContainerDragging =
|
|
4988
|
+
var ObjectSearchContainerDragging = import_react55.css`
|
|
5057
4989
|
box-shadow: var(--shadow-base);
|
|
5058
4990
|
opacity: var(--opacity-50);
|
|
5059
4991
|
`;
|
|
5060
|
-
var ObjectSearchResultListCounterContainer =
|
|
4992
|
+
var ObjectSearchResultListCounterContainer = import_react55.css`
|
|
5061
4993
|
align-items: center;
|
|
5062
4994
|
display: flex;
|
|
5063
4995
|
gap: var(--spacing-sm);
|
|
5064
4996
|
`;
|
|
5065
|
-
var ObjectSearchResultListTitle =
|
|
4997
|
+
var ObjectSearchResultListTitle = import_react55.css`
|
|
5066
4998
|
font-weight: var(--fw-bold);
|
|
5067
4999
|
line-height: 1;
|
|
5068
5000
|
`;
|
|
@@ -5169,7 +5101,7 @@ function ObjectSearchResultList({
|
|
|
5169
5101
|
|
|
5170
5102
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
5171
5103
|
var import_design_system29 = require("@uniformdev/design-system");
|
|
5172
|
-
var
|
|
5104
|
+
var import_react56 = require("react");
|
|
5173
5105
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
5174
5106
|
var QueryFilter = ({
|
|
5175
5107
|
requireContentType,
|
|
@@ -5198,7 +5130,7 @@ var QueryFilter = ({
|
|
|
5198
5130
|
}) => {
|
|
5199
5131
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
5200
5132
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
5201
|
-
const [queryState, setQueryState] = (0,
|
|
5133
|
+
const [queryState, setQueryState] = (0, import_react56.useState)({
|
|
5202
5134
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
5203
5135
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
5204
5136
|
count: (_c = query.count) != null ? _c : 5,
|
|
@@ -5209,7 +5141,7 @@ var QueryFilter = ({
|
|
|
5209
5141
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
5210
5142
|
onSetQuery({ ...query, ...value });
|
|
5211
5143
|
};
|
|
5212
|
-
(0,
|
|
5144
|
+
(0, import_react56.useEffect)(() => {
|
|
5213
5145
|
onSetQuery(queryState);
|
|
5214
5146
|
}, []);
|
|
5215
5147
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("fieldset", { children: [
|
|
@@ -5335,7 +5267,7 @@ var QueryFilter = ({
|
|
|
5335
5267
|
};
|
|
5336
5268
|
|
|
5337
5269
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
5338
|
-
var
|
|
5270
|
+
var import_react57 = require("react");
|
|
5339
5271
|
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
5340
5272
|
function ParamTypeDynamicDataProvider(props) {
|
|
5341
5273
|
const { children } = props;
|
|
@@ -5344,7 +5276,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
5344
5276
|
} = useMeshLocation("paramType");
|
|
5345
5277
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5346
5278
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
5347
|
-
const variables = (0,
|
|
5279
|
+
const variables = (0, import_react57.useMemo)(
|
|
5348
5280
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
5349
5281
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
5350
5282
|
);
|
|
@@ -5357,9 +5289,9 @@ var JsonMeshVariableEditor = ({
|
|
|
5357
5289
|
variable,
|
|
5358
5290
|
context
|
|
5359
5291
|
}) => {
|
|
5360
|
-
const sillyRef = (0,
|
|
5292
|
+
const sillyRef = (0, import_react57.useRef)(false);
|
|
5361
5293
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
5362
|
-
(0,
|
|
5294
|
+
(0, import_react57.useEffect)(() => {
|
|
5363
5295
|
if (sillyRef.current) {
|
|
5364
5296
|
return;
|
|
5365
5297
|
}
|
|
@@ -5829,7 +5761,7 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5829
5761
|
|
|
5830
5762
|
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
5831
5763
|
var import_design_system30 = require("@uniformdev/design-system");
|
|
5832
|
-
var
|
|
5764
|
+
var import_react58 = require("react");
|
|
5833
5765
|
var import_react_use2 = require("react-use");
|
|
5834
5766
|
var import_jsx_runtime60 = require("@emotion/react/jsx-runtime");
|
|
5835
5767
|
var DateEditor = ({
|
|
@@ -5840,7 +5772,7 @@ var DateEditor = ({
|
|
|
5840
5772
|
readOnly,
|
|
5841
5773
|
valueTestId
|
|
5842
5774
|
}) => {
|
|
5843
|
-
const [innerValue, setInnerValue] = (0,
|
|
5775
|
+
const [innerValue, setInnerValue] = (0, import_react58.useState)(value != null ? value : "");
|
|
5844
5776
|
(0, import_react_use2.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
5845
5777
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5846
5778
|
import_design_system30.Input,
|
|
@@ -5859,7 +5791,7 @@ var DateEditor = ({
|
|
|
5859
5791
|
|
|
5860
5792
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5861
5793
|
var import_design_system32 = require("@uniformdev/design-system");
|
|
5862
|
-
var
|
|
5794
|
+
var import_react59 = require("react");
|
|
5863
5795
|
var import_react_use3 = require("react-use");
|
|
5864
5796
|
|
|
5865
5797
|
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
@@ -5895,9 +5827,9 @@ var DateRangeEditor = ({
|
|
|
5895
5827
|
readOnly,
|
|
5896
5828
|
valueTestId
|
|
5897
5829
|
}) => {
|
|
5898
|
-
const [minDateValue, setMinDateValue] = (0,
|
|
5899
|
-
const [maxDateValue, setMaxDateValue] = (0,
|
|
5900
|
-
const [error, setError] = (0,
|
|
5830
|
+
const [minDateValue, setMinDateValue] = (0, import_react59.useState)(value ? value[0] : "");
|
|
5831
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react59.useState)(value ? value[1] : "");
|
|
5832
|
+
const [error, setError] = (0, import_react59.useState)("");
|
|
5901
5833
|
(0, import_react_use3.useDebounce)(
|
|
5902
5834
|
() => {
|
|
5903
5835
|
if (minDateValue && maxDateValue && !error) {
|
|
@@ -5909,7 +5841,7 @@ var DateRangeEditor = ({
|
|
|
5909
5841
|
500,
|
|
5910
5842
|
[minDateValue, maxDateValue]
|
|
5911
5843
|
);
|
|
5912
|
-
(0,
|
|
5844
|
+
(0, import_react59.useEffect)(() => {
|
|
5913
5845
|
if (!minDateValue || !maxDateValue) {
|
|
5914
5846
|
return;
|
|
5915
5847
|
}
|
|
@@ -5981,7 +5913,7 @@ var DateRangeEditor = ({
|
|
|
5981
5913
|
|
|
5982
5914
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5983
5915
|
var import_design_system33 = require("@uniformdev/design-system");
|
|
5984
|
-
var
|
|
5916
|
+
var import_react60 = require("react");
|
|
5985
5917
|
|
|
5986
5918
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5987
5919
|
var readOnlyAttributes = {
|
|
@@ -6002,7 +5934,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
6002
5934
|
}) => {
|
|
6003
5935
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6004
5936
|
const isClearable = !readOnly || !disabled;
|
|
6005
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5937
|
+
const { groupedOptions, selectedOptions } = (0, import_react60.useMemo)(
|
|
6006
5938
|
() => (0, import_design_system33.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
6007
5939
|
[options, value]
|
|
6008
5940
|
);
|
|
@@ -6036,7 +5968,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
6036
5968
|
|
|
6037
5969
|
// src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
|
|
6038
5970
|
var import_design_system34 = require("@uniformdev/design-system");
|
|
6039
|
-
var
|
|
5971
|
+
var import_react61 = require("react");
|
|
6040
5972
|
var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
|
|
6041
5973
|
var FilterSingleChoiceEditor = ({
|
|
6042
5974
|
options,
|
|
@@ -6047,7 +5979,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
6047
5979
|
valueTestId
|
|
6048
5980
|
}) => {
|
|
6049
5981
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6050
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5982
|
+
const { groupedOptions, selectedOptions } = (0, import_react61.useMemo)(
|
|
6051
5983
|
() => (0, import_design_system34.convertComboBoxGroupsToSelectableGroups)({
|
|
6052
5984
|
options: options != null ? options : [],
|
|
6053
5985
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
@@ -6085,7 +6017,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
6085
6017
|
|
|
6086
6018
|
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
6087
6019
|
var import_design_system35 = require("@uniformdev/design-system");
|
|
6088
|
-
var
|
|
6020
|
+
var import_react62 = require("react");
|
|
6089
6021
|
var import_react_use4 = require("react-use");
|
|
6090
6022
|
var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
|
|
6091
6023
|
var NumberEditor = ({
|
|
@@ -6096,7 +6028,7 @@ var NumberEditor = ({
|
|
|
6096
6028
|
readOnly,
|
|
6097
6029
|
valueTestId
|
|
6098
6030
|
}) => {
|
|
6099
|
-
const [innerValue, setInnerValue] = (0,
|
|
6031
|
+
const [innerValue, setInnerValue] = (0, import_react62.useState)(value != null ? value : "");
|
|
6100
6032
|
(0, import_react_use4.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
6101
6033
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6102
6034
|
import_design_system35.Input,
|
|
@@ -6116,7 +6048,7 @@ var NumberEditor = ({
|
|
|
6116
6048
|
|
|
6117
6049
|
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
6118
6050
|
var import_design_system36 = require("@uniformdev/design-system");
|
|
6119
|
-
var
|
|
6051
|
+
var import_react63 = require("react");
|
|
6120
6052
|
var import_react_use5 = require("react-use");
|
|
6121
6053
|
var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
|
|
6122
6054
|
var NumberRangeEditor = ({
|
|
@@ -6127,9 +6059,9 @@ var NumberRangeEditor = ({
|
|
|
6127
6059
|
readOnly,
|
|
6128
6060
|
valueTestId
|
|
6129
6061
|
}) => {
|
|
6130
|
-
const [minValue, setMinValue] = (0,
|
|
6131
|
-
const [maxValue, setMaxValue] = (0,
|
|
6132
|
-
const [error, setError] = (0,
|
|
6062
|
+
const [minValue, setMinValue] = (0, import_react63.useState)("");
|
|
6063
|
+
const [maxValue, setMaxValue] = (0, import_react63.useState)("");
|
|
6064
|
+
const [error, setError] = (0, import_react63.useState)("");
|
|
6133
6065
|
(0, import_react_use5.useDebounce)(
|
|
6134
6066
|
() => {
|
|
6135
6067
|
if (minValue && maxValue && !error) {
|
|
@@ -6141,7 +6073,7 @@ var NumberRangeEditor = ({
|
|
|
6141
6073
|
500,
|
|
6142
6074
|
[minValue, maxValue]
|
|
6143
6075
|
);
|
|
6144
|
-
(0,
|
|
6076
|
+
(0, import_react63.useEffect)(() => {
|
|
6145
6077
|
if (!maxValue && !minValue) {
|
|
6146
6078
|
return;
|
|
6147
6079
|
}
|
|
@@ -6204,7 +6136,7 @@ var NumberRangeEditor = ({
|
|
|
6204
6136
|
|
|
6205
6137
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
6206
6138
|
var import_design_system38 = require("@uniformdev/design-system");
|
|
6207
|
-
var
|
|
6139
|
+
var import_react64 = require("react");
|
|
6208
6140
|
|
|
6209
6141
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
6210
6142
|
var import_design_system37 = require("@uniformdev/design-system");
|
|
@@ -6230,7 +6162,7 @@ var StatusMultiEditor = ({
|
|
|
6230
6162
|
valueTestId
|
|
6231
6163
|
}) => {
|
|
6232
6164
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6233
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6165
|
+
const { groupedOptions, selectedOptions } = (0, import_react64.useMemo)(
|
|
6234
6166
|
() => (0, import_design_system38.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
6235
6167
|
[options, value]
|
|
6236
6168
|
);
|
|
@@ -6262,7 +6194,7 @@ var StatusMultiEditor = ({
|
|
|
6262
6194
|
|
|
6263
6195
|
// src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
|
|
6264
6196
|
var import_design_system39 = require("@uniformdev/design-system");
|
|
6265
|
-
var
|
|
6197
|
+
var import_react65 = require("react");
|
|
6266
6198
|
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
6267
6199
|
var StatusSingleEditor = ({
|
|
6268
6200
|
options,
|
|
@@ -6273,7 +6205,7 @@ var StatusSingleEditor = ({
|
|
|
6273
6205
|
valueTestId
|
|
6274
6206
|
}) => {
|
|
6275
6207
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6276
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6208
|
+
const { groupedOptions, selectedOptions } = (0, import_react65.useMemo)(
|
|
6277
6209
|
() => (0, import_design_system39.convertComboBoxGroupsToSelectableGroups)({
|
|
6278
6210
|
options: options != null ? options : [],
|
|
6279
6211
|
selectedItems: new Set(value ? [value] : void 0),
|
|
@@ -6310,7 +6242,7 @@ var StatusSingleEditor = ({
|
|
|
6310
6242
|
|
|
6311
6243
|
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
6312
6244
|
var import_design_system40 = require("@uniformdev/design-system");
|
|
6313
|
-
var
|
|
6245
|
+
var import_react66 = require("react");
|
|
6314
6246
|
var import_react_use6 = require("react-use");
|
|
6315
6247
|
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
6316
6248
|
var TextEditor = ({
|
|
@@ -6320,7 +6252,7 @@ var TextEditor = ({
|
|
|
6320
6252
|
readOnly,
|
|
6321
6253
|
valueTestId
|
|
6322
6254
|
}) => {
|
|
6323
|
-
const [innerValue, setInnerValue] = (0,
|
|
6255
|
+
const [innerValue, setInnerValue] = (0, import_react66.useState)(value != null ? value : "");
|
|
6324
6256
|
(0, import_react_use6.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
6325
6257
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6326
6258
|
import_design_system40.Input,
|
|
@@ -6338,7 +6270,7 @@ var TextEditor = ({
|
|
|
6338
6270
|
|
|
6339
6271
|
// src/components/SearchAndFilter/editors/TextMultiChoiceEditor.tsx
|
|
6340
6272
|
var import_design_system41 = require("@uniformdev/design-system");
|
|
6341
|
-
var
|
|
6273
|
+
var import_react67 = require("react");
|
|
6342
6274
|
var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
|
|
6343
6275
|
var TextMultiChoiceEditor = ({
|
|
6344
6276
|
value,
|
|
@@ -6349,7 +6281,7 @@ var TextMultiChoiceEditor = ({
|
|
|
6349
6281
|
}) => {
|
|
6350
6282
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6351
6283
|
const isClearable = !readOnly || !disabled;
|
|
6352
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6284
|
+
const { groupedOptions, selectedOptions } = (0, import_react67.useMemo)(() => {
|
|
6353
6285
|
var _a;
|
|
6354
6286
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
6355
6287
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
@@ -6388,21 +6320,21 @@ var TextMultiChoiceEditor = ({
|
|
|
6388
6320
|
var import_design_system43 = require("@uniformdev/design-system");
|
|
6389
6321
|
|
|
6390
6322
|
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
6391
|
-
var
|
|
6323
|
+
var import_react68 = require("@emotion/react");
|
|
6392
6324
|
var import_design_system42 = require("@uniformdev/design-system");
|
|
6393
|
-
var SearchAndFilterControlsWrapper = (gridColumns) =>
|
|
6325
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => import_react68.css`
|
|
6394
6326
|
align-items: stretch;
|
|
6395
6327
|
display: grid;
|
|
6396
6328
|
grid-template-columns: ${gridColumns};
|
|
6397
6329
|
gap: var(--spacing-sm);
|
|
6398
6330
|
`;
|
|
6399
|
-
var SearchAndFilterOutterControlWrapper = (gridColumns) =>
|
|
6331
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react68.css`
|
|
6400
6332
|
align-items: stretch;
|
|
6401
6333
|
display: grid;
|
|
6402
6334
|
grid-template-columns: ${gridColumns};
|
|
6403
6335
|
gap: var(--spacing-sm);
|
|
6404
6336
|
`;
|
|
6405
|
-
var ConditionalFilterRow =
|
|
6337
|
+
var ConditionalFilterRow = import_react68.css`
|
|
6406
6338
|
align-items: baseline;
|
|
6407
6339
|
display: grid;
|
|
6408
6340
|
grid-template-columns: 35px 1fr;
|
|
@@ -6438,7 +6370,7 @@ var ConditionalFilterRow = import_react69.css`
|
|
|
6438
6370
|
animation: ${import_design_system42.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
6439
6371
|
}
|
|
6440
6372
|
`;
|
|
6441
|
-
var ConditionalInputRow =
|
|
6373
|
+
var ConditionalInputRow = import_react68.css`
|
|
6442
6374
|
display: flex;
|
|
6443
6375
|
gap: var(--spacing-sm);
|
|
6444
6376
|
flex-wrap: wrap;
|
|
@@ -6462,16 +6394,16 @@ var ConditionalInputRow = import_react69.css`
|
|
|
6462
6394
|
}
|
|
6463
6395
|
}
|
|
6464
6396
|
`;
|
|
6465
|
-
var ConditionalInputRowEmpty =
|
|
6397
|
+
var ConditionalInputRowEmpty = import_react68.css`
|
|
6466
6398
|
flex-wrap: nowrap;
|
|
6467
6399
|
`;
|
|
6468
|
-
var SearchInput =
|
|
6400
|
+
var SearchInput = import_react68.css`
|
|
6469
6401
|
&& {
|
|
6470
6402
|
max-height: 40px;
|
|
6471
6403
|
min-height: unset;
|
|
6472
6404
|
}
|
|
6473
6405
|
`;
|
|
6474
|
-
var BindableKeywordSearchInputStyles =
|
|
6406
|
+
var BindableKeywordSearchInputStyles = import_react68.css`
|
|
6475
6407
|
position: relative;
|
|
6476
6408
|
width: 100%;
|
|
6477
6409
|
|
|
@@ -6486,19 +6418,19 @@ var BindableKeywordSearchInputStyles = import_react69.css`
|
|
|
6486
6418
|
white-space: nowrap;
|
|
6487
6419
|
}
|
|
6488
6420
|
`;
|
|
6489
|
-
var ClearSearchButtonContainer =
|
|
6421
|
+
var ClearSearchButtonContainer = import_react68.css`
|
|
6490
6422
|
align-items: center;
|
|
6491
6423
|
display: flex;
|
|
6492
6424
|
position: absolute;
|
|
6493
6425
|
inset: 0 var(--spacing-lg) 0 auto;
|
|
6494
6426
|
`;
|
|
6495
|
-
var ClearSearchButtonStyles =
|
|
6427
|
+
var ClearSearchButtonStyles = import_react68.css`
|
|
6496
6428
|
background: none;
|
|
6497
6429
|
border: none;
|
|
6498
6430
|
padding: 0;
|
|
6499
6431
|
pointer-events: all;
|
|
6500
6432
|
`;
|
|
6501
|
-
var FilterButton =
|
|
6433
|
+
var FilterButton = import_react68.css`
|
|
6502
6434
|
align-items: center;
|
|
6503
6435
|
background: var(--white);
|
|
6504
6436
|
border: 1px solid var(--gray-300);
|
|
@@ -6535,13 +6467,13 @@ var FilterButton = import_react69.css`
|
|
|
6535
6467
|
opacity: var(--opacity-50);
|
|
6536
6468
|
}
|
|
6537
6469
|
`;
|
|
6538
|
-
var FilterButtonText =
|
|
6470
|
+
var FilterButtonText = import_react68.css`
|
|
6539
6471
|
overflow: hidden;
|
|
6540
6472
|
text-overflow: ellipsis;
|
|
6541
6473
|
white-space: nowrap;
|
|
6542
6474
|
max-width: 14ch;
|
|
6543
6475
|
`;
|
|
6544
|
-
var FilterButtonSelected =
|
|
6476
|
+
var FilterButtonSelected = import_react68.css`
|
|
6545
6477
|
background: var(--gray-100);
|
|
6546
6478
|
border-color: var(--gray-300);
|
|
6547
6479
|
|
|
@@ -6549,7 +6481,7 @@ var FilterButtonSelected = import_react69.css`
|
|
|
6549
6481
|
color: var(--accent-dark);
|
|
6550
6482
|
}
|
|
6551
6483
|
`;
|
|
6552
|
-
var FilterButtonWithOptions =
|
|
6484
|
+
var FilterButtonWithOptions = import_react68.css`
|
|
6553
6485
|
:where([aria-expanded='true']) {
|
|
6554
6486
|
background: var(--purple-rain-100);
|
|
6555
6487
|
border-color: var(--accent-light);
|
|
@@ -6561,14 +6493,14 @@ var FilterButtonWithOptions = import_react69.css`
|
|
|
6561
6493
|
}
|
|
6562
6494
|
}
|
|
6563
6495
|
`;
|
|
6564
|
-
var SearchIcon =
|
|
6496
|
+
var SearchIcon = import_react68.css`
|
|
6565
6497
|
color: var(--icon-color);
|
|
6566
6498
|
position: absolute;
|
|
6567
6499
|
inset: 0 var(--spacing-base) 0 auto;
|
|
6568
6500
|
margin: auto;
|
|
6569
6501
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
6570
6502
|
`;
|
|
6571
|
-
var AddConditionalBtn =
|
|
6503
|
+
var AddConditionalBtn = import_react68.css`
|
|
6572
6504
|
align-items: center;
|
|
6573
6505
|
background: transparent;
|
|
6574
6506
|
border: none;
|
|
@@ -6587,14 +6519,14 @@ var AddConditionalBtn = import_react69.css`
|
|
|
6587
6519
|
color: var(--gray-400);
|
|
6588
6520
|
}
|
|
6589
6521
|
`;
|
|
6590
|
-
var Title =
|
|
6522
|
+
var Title = import_react68.css`
|
|
6591
6523
|
color: var(--typography-light);
|
|
6592
6524
|
|
|
6593
6525
|
&:focus {
|
|
6594
6526
|
outline: none;
|
|
6595
6527
|
}
|
|
6596
6528
|
`;
|
|
6597
|
-
var ResetConditionsBtn =
|
|
6529
|
+
var ResetConditionsBtn = import_react68.css`
|
|
6598
6530
|
background: transparent;
|
|
6599
6531
|
border: none;
|
|
6600
6532
|
color: var(--action-destructive-default);
|
|
@@ -6609,7 +6541,7 @@ var ResetConditionsBtn = import_react69.css`
|
|
|
6609
6541
|
color: var(--gray-400);
|
|
6610
6542
|
}
|
|
6611
6543
|
`;
|
|
6612
|
-
var CriteriaGroupOperatorTrigger =
|
|
6544
|
+
var CriteriaGroupOperatorTrigger = import_react68.css`
|
|
6613
6545
|
&& {
|
|
6614
6546
|
padding: 0;
|
|
6615
6547
|
border-radius: var(--rounded-sm);
|
|
@@ -6628,13 +6560,13 @@ var CriteriaGroupOperatorTrigger = import_react69.css`
|
|
|
6628
6560
|
}
|
|
6629
6561
|
}
|
|
6630
6562
|
`;
|
|
6631
|
-
var IconBtn =
|
|
6563
|
+
var IconBtn = import_react68.css`
|
|
6632
6564
|
align-self: center;
|
|
6633
6565
|
background: transparent;
|
|
6634
6566
|
border: none;
|
|
6635
6567
|
padding: var(--spacing-sm);
|
|
6636
6568
|
`;
|
|
6637
|
-
var SearchAndFilterOptionsContainer =
|
|
6569
|
+
var SearchAndFilterOptionsContainer = import_react68.css`
|
|
6638
6570
|
background: var(--gray-50);
|
|
6639
6571
|
border: 1px solid var(--gray-300);
|
|
6640
6572
|
border-radius: var(--rounded-base);
|
|
@@ -6645,17 +6577,17 @@ var SearchAndFilterOptionsContainer = import_react69.css`
|
|
|
6645
6577
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6646
6578
|
will-change: height;
|
|
6647
6579
|
`;
|
|
6648
|
-
var SearchAndFilterOptionsInnerContainer =
|
|
6580
|
+
var SearchAndFilterOptionsInnerContainer = import_react68.css`
|
|
6649
6581
|
display: flex;
|
|
6650
6582
|
flex-direction: column;
|
|
6651
6583
|
gap: var(--spacing-sm);
|
|
6652
6584
|
padding-inline: var(--spacing-md);
|
|
6653
6585
|
`;
|
|
6654
|
-
var SearchAndFilterButtonGroup =
|
|
6586
|
+
var SearchAndFilterButtonGroup = import_react68.css`
|
|
6655
6587
|
margin-top: var(--spacing-xs);
|
|
6656
6588
|
margin-left: calc(56px + var(--spacing-md));
|
|
6657
6589
|
`;
|
|
6658
|
-
var SearchAndFilterAdditionalContainer =
|
|
6590
|
+
var SearchAndFilterAdditionalContainer = import_react68.css`
|
|
6659
6591
|
align-items: center;
|
|
6660
6592
|
border-top: 1px solid var(--gray-300);
|
|
6661
6593
|
display: flex;
|
|
@@ -6701,13 +6633,13 @@ var import_CgClose = require("@react-icons/all-files/cg/CgClose");
|
|
|
6701
6633
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
6702
6634
|
var import_design_system45 = require("@uniformdev/design-system");
|
|
6703
6635
|
var import_lexical11 = require("lexical");
|
|
6704
|
-
var
|
|
6636
|
+
var import_react70 = require("react");
|
|
6705
6637
|
var import_react_use7 = require("react-use");
|
|
6706
6638
|
var import_uuid2 = require("uuid");
|
|
6707
6639
|
|
|
6708
6640
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6709
6641
|
var import_design_system44 = require("@uniformdev/design-system");
|
|
6710
|
-
var
|
|
6642
|
+
var import_react69 = require("react");
|
|
6711
6643
|
|
|
6712
6644
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
6713
6645
|
var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
|
|
@@ -6783,7 +6715,7 @@ var bindableFiltersMapper = {
|
|
|
6783
6715
|
|
|
6784
6716
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6785
6717
|
var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
|
|
6786
|
-
var SearchAndFilterContext = (0,
|
|
6718
|
+
var SearchAndFilterContext = (0, import_react69.createContext)({
|
|
6787
6719
|
searchTerm: "",
|
|
6788
6720
|
setSearchTerm: () => {
|
|
6789
6721
|
},
|
|
@@ -6822,17 +6754,17 @@ var SearchAndFilterProvider = ({
|
|
|
6822
6754
|
children,
|
|
6823
6755
|
allowBindingSearchTerm
|
|
6824
6756
|
}) => {
|
|
6825
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
6826
|
-
const deferredSearchTerm = (0,
|
|
6827
|
-
const [filterVisibility, setFilterVisibility] = (0,
|
|
6828
|
-
const handleSearchTerm = (0,
|
|
6757
|
+
const [searchTerm, setSearchTerm] = (0, import_react69.useState)(defaultSearchTerm);
|
|
6758
|
+
const deferredSearchTerm = (0, import_react69.useDeferredValue)(searchTerm);
|
|
6759
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react69.useState)(alwaysVisible || filterVisible);
|
|
6760
|
+
const handleSearchTerm = (0, import_react69.useCallback)(
|
|
6829
6761
|
(term) => {
|
|
6830
6762
|
setSearchTerm(term);
|
|
6831
6763
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
6832
6764
|
},
|
|
6833
6765
|
[setSearchTerm, onSearchChange]
|
|
6834
6766
|
);
|
|
6835
|
-
const handleToggleFilterVisibility = (0,
|
|
6767
|
+
const handleToggleFilterVisibility = (0, import_react69.useCallback)(
|
|
6836
6768
|
(visible) => {
|
|
6837
6769
|
if (alwaysVisible) {
|
|
6838
6770
|
return;
|
|
@@ -6841,10 +6773,10 @@ var SearchAndFilterProvider = ({
|
|
|
6841
6773
|
},
|
|
6842
6774
|
[alwaysVisible]
|
|
6843
6775
|
);
|
|
6844
|
-
const handleAddFilter = (0,
|
|
6776
|
+
const handleAddFilter = (0, import_react69.useCallback)(() => {
|
|
6845
6777
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6846
6778
|
}, [filters, onChange]);
|
|
6847
|
-
const handleResetFilters = (0,
|
|
6779
|
+
const handleResetFilters = (0, import_react69.useCallback)(() => {
|
|
6848
6780
|
setSearchTerm("");
|
|
6849
6781
|
if (onResetFilterValues) {
|
|
6850
6782
|
return onResetFilterValues();
|
|
@@ -6852,20 +6784,20 @@ var SearchAndFilterProvider = ({
|
|
|
6852
6784
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6853
6785
|
onChange(resetFilterValues);
|
|
6854
6786
|
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6855
|
-
const handleDeleteFilter = (0,
|
|
6787
|
+
const handleDeleteFilter = (0, import_react69.useCallback)(
|
|
6856
6788
|
(index) => {
|
|
6857
6789
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
6858
6790
|
onChange(remainingFilters);
|
|
6859
6791
|
},
|
|
6860
6792
|
[filters, onChange]
|
|
6861
6793
|
);
|
|
6862
|
-
const validFilterQuery = (0,
|
|
6794
|
+
const validFilterQuery = (0, import_react69.useMemo)(() => {
|
|
6863
6795
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6864
6796
|
if (hasValidFilters) {
|
|
6865
6797
|
return filters;
|
|
6866
6798
|
}
|
|
6867
6799
|
}, [filters]);
|
|
6868
|
-
(0,
|
|
6800
|
+
(0, import_react69.useEffect)(() => {
|
|
6869
6801
|
if (filterVisibility) {
|
|
6870
6802
|
const handleEscKeyFilterClose = (e) => {
|
|
6871
6803
|
if (e.key === "Escape") {
|
|
@@ -6903,7 +6835,7 @@ var SearchAndFilterProvider = ({
|
|
|
6903
6835
|
);
|
|
6904
6836
|
};
|
|
6905
6837
|
var useSearchAndFilter = () => {
|
|
6906
|
-
const value = (0,
|
|
6838
|
+
const value = (0, import_react69.useContext)(SearchAndFilterContext);
|
|
6907
6839
|
return { ...value };
|
|
6908
6840
|
};
|
|
6909
6841
|
|
|
@@ -6921,10 +6853,10 @@ var FilterControls = ({
|
|
|
6921
6853
|
searchTerm,
|
|
6922
6854
|
allowBindingSearchTerm
|
|
6923
6855
|
} = useSearchAndFilter();
|
|
6924
|
-
const editorRef = (0,
|
|
6856
|
+
const editorRef = (0, import_react70.useRef)(null);
|
|
6925
6857
|
const variableRefernceCountInSearchTerm = (0, import_canvas10.hasReferencedVariables)(searchTerm);
|
|
6926
|
-
const [idToResetInputVariables, setIdToResetInputVariables] = (0,
|
|
6927
|
-
const [localSearchTerm, setLocalSearchTerm] = (0,
|
|
6858
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react70.useState)("data-resource-search-term-input");
|
|
6859
|
+
const [localSearchTerm, setLocalSearchTerm] = (0, import_react70.useState)(searchTerm);
|
|
6928
6860
|
(0, import_react_use7.useDebounce)(
|
|
6929
6861
|
() => {
|
|
6930
6862
|
if (localSearchTerm !== searchTerm) {
|
|
@@ -6934,7 +6866,7 @@ var FilterControls = ({
|
|
|
6934
6866
|
300,
|
|
6935
6867
|
[localSearchTerm]
|
|
6936
6868
|
);
|
|
6937
|
-
(0,
|
|
6869
|
+
(0, import_react70.useEffect)(() => {
|
|
6938
6870
|
if (searchTerm === "") {
|
|
6939
6871
|
setLocalSearchTerm("");
|
|
6940
6872
|
setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid2.v4)()}`);
|
|
@@ -7009,7 +6941,7 @@ var FilterControls = ({
|
|
|
7009
6941
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
7010
6942
|
var import_CgTrash2 = require("@react-icons/all-files/cg/CgTrash");
|
|
7011
6943
|
var import_design_system46 = require("@uniformdev/design-system");
|
|
7012
|
-
var
|
|
6944
|
+
var import_react71 = require("react");
|
|
7013
6945
|
|
|
7014
6946
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
7015
6947
|
function isFilterBindable(filter, operator) {
|
|
@@ -7037,7 +6969,7 @@ var FilterItem = ({
|
|
|
7037
6969
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
7038
6970
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
7039
6971
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
7040
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0,
|
|
6972
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react71.useMemo)(() => {
|
|
7041
6973
|
var _a2;
|
|
7042
6974
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
7043
6975
|
var _a3;
|
|
@@ -7205,7 +7137,7 @@ var import_design_system48 = require("@uniformdev/design-system");
|
|
|
7205
7137
|
|
|
7206
7138
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
7207
7139
|
var import_design_system47 = require("@uniformdev/design-system");
|
|
7208
|
-
var
|
|
7140
|
+
var import_react72 = __toESM(require("react"));
|
|
7209
7141
|
var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
|
|
7210
7142
|
var SearchAndFilterOptionsContainer2 = ({
|
|
7211
7143
|
buttonRow,
|
|
@@ -7237,8 +7169,8 @@ var FilterMenu = ({
|
|
|
7237
7169
|
resetButtonText = "reset"
|
|
7238
7170
|
}) => {
|
|
7239
7171
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
7240
|
-
const innerMenuRef =
|
|
7241
|
-
(0,
|
|
7172
|
+
const innerMenuRef = import_react72.default.useRef(null);
|
|
7173
|
+
(0, import_react72.useEffect)(() => {
|
|
7242
7174
|
var _a;
|
|
7243
7175
|
if (filterVisibility) {
|
|
7244
7176
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
@@ -7587,17 +7519,17 @@ var SearchAndFilter = ({
|
|
|
7587
7519
|
|
|
7588
7520
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
7589
7521
|
var import_design_system51 = require("@uniformdev/design-system");
|
|
7590
|
-
var
|
|
7522
|
+
var import_react73 = require("react");
|
|
7591
7523
|
var import_react_use8 = require("react-use");
|
|
7592
7524
|
var import_jsx_runtime81 = require("@emotion/react/jsx-runtime");
|
|
7593
|
-
var SearchOnlyContext = (0,
|
|
7525
|
+
var SearchOnlyContext = (0, import_react73.createContext)({
|
|
7594
7526
|
searchTerm: "",
|
|
7595
7527
|
setSearchTerm: () => {
|
|
7596
7528
|
}
|
|
7597
7529
|
});
|
|
7598
7530
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
7599
7531
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
7600
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
7532
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react73.useState)("");
|
|
7601
7533
|
(0, import_react_use8.useDebounce)(
|
|
7602
7534
|
() => {
|
|
7603
7535
|
setSearchTerm(localeSearchTerm);
|
|
@@ -7631,9 +7563,9 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7631
7563
|
var import_design_system53 = require("@uniformdev/design-system");
|
|
7632
7564
|
|
|
7633
7565
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
7634
|
-
var
|
|
7566
|
+
var import_react74 = require("@emotion/react");
|
|
7635
7567
|
var import_design_system52 = require("@uniformdev/design-system");
|
|
7636
|
-
var ConditionalFilterRow2 =
|
|
7568
|
+
var ConditionalFilterRow2 = import_react74.css`
|
|
7637
7569
|
display: grid;
|
|
7638
7570
|
grid-template-columns: 35px 1fr;
|
|
7639
7571
|
gap: var(--spacing-sm);
|
|
@@ -7670,7 +7602,7 @@ var ConditionalFilterRow2 = import_react75.css`
|
|
|
7670
7602
|
animation: ${import_design_system52.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
7671
7603
|
}
|
|
7672
7604
|
`;
|
|
7673
|
-
var ConditionalInputRow2 =
|
|
7605
|
+
var ConditionalInputRow2 = import_react74.css`
|
|
7674
7606
|
display: flex;
|
|
7675
7607
|
gap: var(--spacing-sm);
|
|
7676
7608
|
flex-wrap: wrap;
|
|
@@ -7693,13 +7625,13 @@ var ConditionalInputRow2 = import_react75.css`
|
|
|
7693
7625
|
}
|
|
7694
7626
|
}
|
|
7695
7627
|
`;
|
|
7696
|
-
var SearchInput2 =
|
|
7628
|
+
var SearchInput2 = import_react74.css`
|
|
7697
7629
|
&& {
|
|
7698
7630
|
max-height: 40px;
|
|
7699
7631
|
min-height: unset;
|
|
7700
7632
|
}
|
|
7701
7633
|
`;
|
|
7702
|
-
var FilterButton3 =
|
|
7634
|
+
var FilterButton3 = import_react74.css`
|
|
7703
7635
|
align-items: center;
|
|
7704
7636
|
background: var(--white);
|
|
7705
7637
|
border: 1px solid var(--gray-300);
|
|
@@ -7736,13 +7668,13 @@ var FilterButton3 = import_react75.css`
|
|
|
7736
7668
|
opacity: var(--opacity-50);
|
|
7737
7669
|
}
|
|
7738
7670
|
`;
|
|
7739
|
-
var FilterButtonText2 =
|
|
7671
|
+
var FilterButtonText2 = import_react74.css`
|
|
7740
7672
|
overflow: hidden;
|
|
7741
7673
|
text-overflow: ellipsis;
|
|
7742
7674
|
white-space: nowrap;
|
|
7743
7675
|
max-width: 14ch;
|
|
7744
7676
|
`;
|
|
7745
|
-
var FilterButtonSelected2 =
|
|
7677
|
+
var FilterButtonSelected2 = import_react74.css`
|
|
7746
7678
|
background: var(--gray-100);
|
|
7747
7679
|
border-color: var(--gray-300);
|
|
7748
7680
|
|
|
@@ -7750,7 +7682,7 @@ var FilterButtonSelected2 = import_react75.css`
|
|
|
7750
7682
|
color: var(--accent-dark);
|
|
7751
7683
|
}
|
|
7752
7684
|
`;
|
|
7753
|
-
var FilterButtonWithOptions2 =
|
|
7685
|
+
var FilterButtonWithOptions2 = import_react74.css`
|
|
7754
7686
|
:where([aria-expanded='true']) {
|
|
7755
7687
|
background: var(--purple-rain-100);
|
|
7756
7688
|
border-color: var(--accent-light);
|
|
@@ -7762,14 +7694,14 @@ var FilterButtonWithOptions2 = import_react75.css`
|
|
|
7762
7694
|
}
|
|
7763
7695
|
}
|
|
7764
7696
|
`;
|
|
7765
|
-
var SearchIcon2 =
|
|
7697
|
+
var SearchIcon2 = import_react74.css`
|
|
7766
7698
|
color: var(--icon-color);
|
|
7767
7699
|
position: absolute;
|
|
7768
7700
|
inset: 0 var(--spacing-base) 0 auto;
|
|
7769
7701
|
margin: auto;
|
|
7770
7702
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7771
7703
|
`;
|
|
7772
|
-
var AddConditionalBtn2 =
|
|
7704
|
+
var AddConditionalBtn2 = import_react74.css`
|
|
7773
7705
|
align-items: center;
|
|
7774
7706
|
background: transparent;
|
|
7775
7707
|
border: none;
|
|
@@ -7788,14 +7720,14 @@ var AddConditionalBtn2 = import_react75.css`
|
|
|
7788
7720
|
color: var(--gray-400);
|
|
7789
7721
|
}
|
|
7790
7722
|
`;
|
|
7791
|
-
var Title2 =
|
|
7723
|
+
var Title2 = import_react74.css`
|
|
7792
7724
|
color: var(--typography-light);
|
|
7793
7725
|
|
|
7794
7726
|
&:focus {
|
|
7795
7727
|
outline: none;
|
|
7796
7728
|
}
|
|
7797
7729
|
`;
|
|
7798
|
-
var ResetConditionsBtn2 =
|
|
7730
|
+
var ResetConditionsBtn2 = import_react74.css`
|
|
7799
7731
|
background: transparent;
|
|
7800
7732
|
border: none;
|
|
7801
7733
|
color: var(--action-destructive-default);
|
|
@@ -7807,12 +7739,12 @@ var ResetConditionsBtn2 = import_react75.css`
|
|
|
7807
7739
|
color: var(--action-destructive-hover);
|
|
7808
7740
|
}
|
|
7809
7741
|
`;
|
|
7810
|
-
var IconBtn2 =
|
|
7742
|
+
var IconBtn2 = import_react74.css`
|
|
7811
7743
|
background: transparent;
|
|
7812
7744
|
border: none;
|
|
7813
7745
|
padding: var(--spacing-sm);
|
|
7814
7746
|
`;
|
|
7815
|
-
var SearchAndFilterOptionsContainer3 =
|
|
7747
|
+
var SearchAndFilterOptionsContainer3 = import_react74.css`
|
|
7816
7748
|
background: var(--gray-50);
|
|
7817
7749
|
border: 1px solid var(--gray-300);
|
|
7818
7750
|
border-radius: var(--rounded-base);
|
|
@@ -7825,17 +7757,17 @@ var SearchAndFilterOptionsContainer3 = import_react75.css`
|
|
|
7825
7757
|
position: relative;
|
|
7826
7758
|
z-index: 1;
|
|
7827
7759
|
`;
|
|
7828
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
7760
|
+
var SearchAndFilterOptionsInnerContainer2 = import_react74.css`
|
|
7829
7761
|
display: flex;
|
|
7830
7762
|
flex-direction: column;
|
|
7831
7763
|
gap: var(--spacing-sm);
|
|
7832
7764
|
padding-inline: var(--spacing-md);
|
|
7833
7765
|
`;
|
|
7834
|
-
var SearchAndFilterButtonGroup2 =
|
|
7766
|
+
var SearchAndFilterButtonGroup2 = import_react74.css`
|
|
7835
7767
|
margin-top: var(--spacing-xs);
|
|
7836
7768
|
margin-left: calc(56px + var(--spacing-md));
|
|
7837
7769
|
`;
|
|
7838
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
7770
|
+
var SortFilterWrapper = (hiddenLocaleInput) => import_react74.css`
|
|
7839
7771
|
align-items: center;
|
|
7840
7772
|
display: flex;
|
|
7841
7773
|
gap: var(--spacing-base);
|
|
@@ -7846,13 +7778,13 @@ var SortFilterWrapper = (hiddenLocaleInput) => import_react75.css`
|
|
|
7846
7778
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
7847
7779
|
}
|
|
7848
7780
|
`;
|
|
7849
|
-
var SortFilterInputRow =
|
|
7781
|
+
var SortFilterInputRow = import_react74.css`
|
|
7850
7782
|
align-items: center;
|
|
7851
7783
|
display: grid;
|
|
7852
7784
|
grid-template-columns: 1fr auto;
|
|
7853
7785
|
gap: var(--spacing-base);
|
|
7854
7786
|
`;
|
|
7855
|
-
var InputVariableWrapper =
|
|
7787
|
+
var InputVariableWrapper = import_react74.css`
|
|
7856
7788
|
flex-grow: 1;
|
|
7857
7789
|
|
|
7858
7790
|
// we need to override label styles nested within the input variable
|
|
@@ -7998,7 +7930,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7998
7930
|
|
|
7999
7931
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
8000
7932
|
var import_canvas12 = require("@uniformdev/canvas");
|
|
8001
|
-
var
|
|
7933
|
+
var import_react75 = require("react");
|
|
8002
7934
|
function useContentDataResourceLocaleInfo({
|
|
8003
7935
|
locale,
|
|
8004
7936
|
defaultLocale,
|
|
@@ -8006,12 +7938,12 @@ function useContentDataResourceLocaleInfo({
|
|
|
8006
7938
|
dynamicInputs
|
|
8007
7939
|
}) {
|
|
8008
7940
|
var _a;
|
|
8009
|
-
const setLocaleRef = (0,
|
|
7941
|
+
const setLocaleRef = (0, import_react75.useRef)(setLocale);
|
|
8010
7942
|
setLocaleRef.current = setLocale;
|
|
8011
7943
|
const { flatVariables } = useVariables();
|
|
8012
7944
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas12.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas12.createVariableReference)(import_canvas12.LOCALE_DYNAMIC_INPUT_NAME) : defaultLocale != null ? defaultLocale : "";
|
|
8013
7945
|
const boundLocale = (_a = (0, import_canvas12.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
8014
|
-
(0,
|
|
7946
|
+
(0, import_react75.useEffect)(() => {
|
|
8015
7947
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
8016
7948
|
setLocaleRef.current(effectiveLocale);
|
|
8017
7949
|
}
|
|
@@ -8043,7 +7975,6 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
8043
7975
|
DateEditor,
|
|
8044
7976
|
DateRangeEditor,
|
|
8045
7977
|
DelegationContext,
|
|
8046
|
-
DelegationDisabledError,
|
|
8047
7978
|
DelegationGate,
|
|
8048
7979
|
DelegationProvider,
|
|
8049
7980
|
DrawerContent,
|
|
@@ -8147,10 +8078,8 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
8147
8078
|
VariablesProvider,
|
|
8148
8079
|
bindableFiltersMapper,
|
|
8149
8080
|
convertConnectedDataToVariable,
|
|
8150
|
-
createDelegationFetch,
|
|
8151
8081
|
createLocationValidator,
|
|
8152
8082
|
filterMapper,
|
|
8153
|
-
isDelegationExpiredResponse,
|
|
8154
8083
|
prettifyBindExpression,
|
|
8155
8084
|
readOnlyAttributes,
|
|
8156
8085
|
serializeVariablesEditorSerializedState,
|
|
@@ -8161,7 +8090,6 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
8161
8090
|
useConnectedDataAsVariables,
|
|
8162
8091
|
useContentDataResourceLocaleInfo,
|
|
8163
8092
|
useDelegation,
|
|
8164
|
-
useDelegationFetch,
|
|
8165
8093
|
useDynamicInputsAsVariables,
|
|
8166
8094
|
useMeshLocation,
|
|
8167
8095
|
useObjectSearchContext,
|