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