@uniformdev/mesh-sdk-react 20.72.4-alpha.6 → 20.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +67 -5
- package/dist/index.d.ts +67 -5
- package/dist/index.esm.js +229 -123
- package/dist/index.js +464 -354
- package/dist/index.mjs +229 -123
- 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_react31 = require("@emotion/react");
|
|
1971
2025
|
var import_design_system9 = require("@uniformdev/design-system");
|
|
1972
|
-
var
|
|
2026
|
+
var import_react32 = 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_react29 = 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
|
});
|
|
@@ -2467,6 +2521,13 @@ function SingleLineTextPlugin() {
|
|
|
2467
2521
|
return null;
|
|
2468
2522
|
}
|
|
2469
2523
|
|
|
2524
|
+
// src/components/Variables/toolbox/useVariablesComposerFlushPending.ts
|
|
2525
|
+
var import_react28 = require("react");
|
|
2526
|
+
var VariablesComposerFlushPendingContext = (0, import_react28.createContext)(false);
|
|
2527
|
+
function useVariablesComposerFlushPending() {
|
|
2528
|
+
return (0, import_react28.useContext)(VariablesComposerFlushPendingContext);
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2470
2531
|
// src/components/Variables/toolbox/VariablesComposer.tsx
|
|
2471
2532
|
var import_jsx_runtime25 = require("@emotion/react/jsx-runtime");
|
|
2472
2533
|
function VariablesComposer(props) {
|
|
@@ -2480,8 +2541,9 @@ function VariablesComposer(props) {
|
|
|
2480
2541
|
autoFocus,
|
|
2481
2542
|
...variablesPluginProps
|
|
2482
2543
|
} = props;
|
|
2483
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
2484
|
-
const
|
|
2544
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react29.useState)(value);
|
|
2545
|
+
const [flushPending, setFlushPending] = (0, import_react29.useState)(false);
|
|
2546
|
+
const editorConfig = (0, import_react29.useMemo)(
|
|
2485
2547
|
() => ({
|
|
2486
2548
|
namespace: "uniform",
|
|
2487
2549
|
onError(error) {
|
|
@@ -2493,8 +2555,26 @@ function VariablesComposer(props) {
|
|
|
2493
2555
|
// oxlint-disable-next-line react/exhaustive-deps
|
|
2494
2556
|
[]
|
|
2495
2557
|
);
|
|
2496
|
-
const editorState = (0,
|
|
2497
|
-
const updateTimeout = (0,
|
|
2558
|
+
const editorState = (0, import_react29.useRef)(void 0);
|
|
2559
|
+
const updateTimeout = (0, import_react29.useRef)(void 0);
|
|
2560
|
+
const flushDepsRef = (0, import_react29.useRef)({ onChange, lastEmittedValue });
|
|
2561
|
+
flushDepsRef.current = { onChange, lastEmittedValue };
|
|
2562
|
+
(0, import_react29.useEffect)(
|
|
2563
|
+
() => () => {
|
|
2564
|
+
if (!updateTimeout.current) {
|
|
2565
|
+
return;
|
|
2566
|
+
}
|
|
2567
|
+
clearTimeout(updateTimeout.current);
|
|
2568
|
+
const { onChange: emit, lastEmittedValue: lastEmitted } = flushDepsRef.current;
|
|
2569
|
+
const valueToEmit = editorState.current ? serializeVariablesEditorState(editorState.current) : void 0;
|
|
2570
|
+
const shouldEmit = editorState.current != null && valueToEmit !== lastEmitted;
|
|
2571
|
+
if (!shouldEmit) {
|
|
2572
|
+
return;
|
|
2573
|
+
}
|
|
2574
|
+
queueMicrotask(() => emit(valueToEmit));
|
|
2575
|
+
},
|
|
2576
|
+
[]
|
|
2577
|
+
);
|
|
2498
2578
|
if (typeof document === "undefined") return null;
|
|
2499
2579
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
2500
2580
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -2506,6 +2586,7 @@ function VariablesComposer(props) {
|
|
|
2506
2586
|
if (updateTimeout.current) {
|
|
2507
2587
|
clearTimeout(updateTimeout.current);
|
|
2508
2588
|
}
|
|
2589
|
+
setFlushPending(true);
|
|
2509
2590
|
updateTimeout.current = window.setTimeout(() => {
|
|
2510
2591
|
if (editorState.current) {
|
|
2511
2592
|
const valueToEmit = serializeVariablesEditorState(editorState.current);
|
|
@@ -2514,6 +2595,8 @@ function VariablesComposer(props) {
|
|
|
2514
2595
|
onChange(valueToEmit);
|
|
2515
2596
|
}
|
|
2516
2597
|
}
|
|
2598
|
+
setFlushPending(false);
|
|
2599
|
+
updateTimeout.current = void 0;
|
|
2517
2600
|
}, 400);
|
|
2518
2601
|
}
|
|
2519
2602
|
}
|
|
@@ -2523,7 +2606,7 @@ function VariablesComposer(props) {
|
|
|
2523
2606
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(VariablesPlugin, { ...variablesPluginProps }),
|
|
2524
2607
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DisablePlugin, { disabled }),
|
|
2525
2608
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: autoFocus ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_LexicalAutoFocusPlugin.AutoFocusPlugin, {}) : null }),
|
|
2526
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2609
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(VariablesComposerFlushPendingContext.Provider, { value: flushPending, children })
|
|
2527
2610
|
] });
|
|
2528
2611
|
}
|
|
2529
2612
|
|
|
@@ -2536,18 +2619,27 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
2536
2619
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
2537
2620
|
var import_utils4 = require("@lexical/utils");
|
|
2538
2621
|
var import_lexical9 = require("lexical");
|
|
2539
|
-
var
|
|
2622
|
+
var import_react30 = require("react");
|
|
2540
2623
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2541
2624
|
function VariablesComposerInput({
|
|
2542
2625
|
css: css24,
|
|
2543
2626
|
placeholder,
|
|
2544
2627
|
...contentEditableProps
|
|
2545
2628
|
}) {
|
|
2629
|
+
const flushPending = useVariablesComposerFlushPending();
|
|
2546
2630
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
2547
2631
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2548
2632
|
import_LexicalPlainTextPlugin.PlainTextPlugin,
|
|
2549
2633
|
{
|
|
2550
|
-
contentEditable: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2634
|
+
contentEditable: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2635
|
+
import_LexicalContentEditable.ContentEditable,
|
|
2636
|
+
{
|
|
2637
|
+
...contentEditableProps,
|
|
2638
|
+
"data-flush-pending": flushPending,
|
|
2639
|
+
placeholder: null,
|
|
2640
|
+
"aria-placeholder": void 0
|
|
2641
|
+
}
|
|
2642
|
+
),
|
|
2551
2643
|
placeholder: placeholder ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: placeholder }) : null,
|
|
2552
2644
|
ErrorBoundary: import_LexicalErrorBoundary.LexicalErrorBoundary
|
|
2553
2645
|
}
|
|
@@ -2558,7 +2650,7 @@ function VariablesComposerInput({
|
|
|
2558
2650
|
}
|
|
2559
2651
|
function RichishCopyAndPastePlugin() {
|
|
2560
2652
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
2561
|
-
(0,
|
|
2653
|
+
(0, import_react30.useEffect)(() => {
|
|
2562
2654
|
return (0, import_utils4.mergeRegister)(
|
|
2563
2655
|
editor.registerCommand(
|
|
2564
2656
|
import_lexical9.COPY_COMMAND,
|
|
@@ -2665,7 +2757,7 @@ function InputVariables(props) {
|
|
|
2665
2757
|
singleTokenMode,
|
|
2666
2758
|
disableVariableDisplayNames
|
|
2667
2759
|
} = props;
|
|
2668
|
-
const [finalId] = (0,
|
|
2760
|
+
const [finalId] = (0, import_react32.useState)(id != null ? id : (() => (0, import_uuid.v4)()));
|
|
2669
2761
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
2670
2762
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
2671
2763
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -2684,7 +2776,7 @@ function InputVariables(props) {
|
|
|
2684
2776
|
{
|
|
2685
2777
|
align: "center",
|
|
2686
2778
|
gap: "xs",
|
|
2687
|
-
css:
|
|
2779
|
+
css: import_react31.css`
|
|
2688
2780
|
position: relative;
|
|
2689
2781
|
& > div:first-of-type {
|
|
2690
2782
|
flex-grow: 1;
|
|
@@ -2813,7 +2905,7 @@ function InputVariablesOverlayMenu({
|
|
|
2813
2905
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
2814
2906
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
2815
2907
|
var import_design_system10 = require("@uniformdev/design-system");
|
|
2816
|
-
var
|
|
2908
|
+
var import_react33 = require("react");
|
|
2817
2909
|
var import_jsx_runtime28 = require("@emotion/react/jsx-runtime");
|
|
2818
2910
|
function ParameterConnectionIndicator({
|
|
2819
2911
|
children,
|
|
@@ -2824,7 +2916,7 @@ function ParameterConnectionIndicator({
|
|
|
2824
2916
|
overrideMenuButtonParentMargin,
|
|
2825
2917
|
renderMenuInPortal = false
|
|
2826
2918
|
}) {
|
|
2827
|
-
const hasVariablesInValue = (0,
|
|
2919
|
+
const hasVariablesInValue = (0, import_react33.useMemo)(() => {
|
|
2828
2920
|
let result = false;
|
|
2829
2921
|
(0, import_canvas7.bindVariablesToObject)({
|
|
2830
2922
|
value,
|
|
@@ -2869,21 +2961,21 @@ function ParameterConnectionIndicator({
|
|
|
2869
2961
|
|
|
2870
2962
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
2871
2963
|
var import_design_system11 = require("@uniformdev/design-system");
|
|
2872
|
-
var
|
|
2964
|
+
var import_react35 = require("react");
|
|
2873
2965
|
|
|
2874
2966
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
2875
2967
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
2876
2968
|
var import_utils5 = require("@lexical/utils");
|
|
2877
2969
|
var import_lexical10 = require("lexical");
|
|
2878
|
-
var
|
|
2970
|
+
var import_react34 = require("react");
|
|
2879
2971
|
function OnDisconnectPlugin({
|
|
2880
2972
|
onDisconnect
|
|
2881
2973
|
}) {
|
|
2882
2974
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
2883
2975
|
const { variables } = useVariables(true);
|
|
2884
|
-
const variablesRef = (0,
|
|
2976
|
+
const variablesRef = (0, import_react34.useRef)(variables);
|
|
2885
2977
|
variablesRef.current = variables;
|
|
2886
|
-
(0,
|
|
2978
|
+
(0, import_react34.useEffect)(() => {
|
|
2887
2979
|
return (0, import_utils5.mergeRegister)(
|
|
2888
2980
|
editor.registerCommand(
|
|
2889
2981
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -2928,7 +3020,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2928
3020
|
hasVariablesInValue,
|
|
2929
3021
|
setHadVariablesInValue
|
|
2930
3022
|
} = useInputVariablesState(props);
|
|
2931
|
-
const handleDisconnect = (0,
|
|
3023
|
+
const handleDisconnect = (0, import_react35.useCallback)(
|
|
2932
3024
|
(variable) => {
|
|
2933
3025
|
setHadVariablesInValue(false);
|
|
2934
3026
|
if (onDisconnect) {
|
|
@@ -2981,7 +3073,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2981
3073
|
}
|
|
2982
3074
|
|
|
2983
3075
|
// src/components/Variables/ParameterVariables.tsx
|
|
2984
|
-
var
|
|
3076
|
+
var import_react36 = require("@emotion/react");
|
|
2985
3077
|
var import_design_system12 = require("@uniformdev/design-system");
|
|
2986
3078
|
var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
|
|
2987
3079
|
function ParameterVariables(props) {
|
|
@@ -3038,8 +3130,8 @@ function ParameterVariables(props) {
|
|
|
3038
3130
|
"data-text-value": value,
|
|
3039
3131
|
css: [
|
|
3040
3132
|
input2,
|
|
3041
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
3042
|
-
inputCss != null ? inputCss :
|
|
3133
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react36.css``,
|
|
3134
|
+
inputCss != null ? inputCss : import_react36.css``
|
|
3043
3135
|
]
|
|
3044
3136
|
}
|
|
3045
3137
|
)
|
|
@@ -3075,18 +3167,18 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
3075
3167
|
}
|
|
3076
3168
|
|
|
3077
3169
|
// src/components/Variables/VariablesList.tsx
|
|
3078
|
-
var
|
|
3170
|
+
var import_react39 = require("@emotion/react");
|
|
3079
3171
|
var import_dnd2 = require("@hello-pangea/dnd");
|
|
3080
3172
|
var import_CgTrash = require("@react-icons/all-files/cg/CgTrash");
|
|
3081
3173
|
var import_design_system13 = require("@uniformdev/design-system");
|
|
3082
3174
|
|
|
3083
3175
|
// src/components/DragDropContext.tsx
|
|
3084
3176
|
var import_dnd = require("@hello-pangea/dnd");
|
|
3085
|
-
var
|
|
3177
|
+
var import_react37 = require("react");
|
|
3086
3178
|
var import_react_use = require("react-use");
|
|
3087
3179
|
var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
|
|
3088
3180
|
function DragDropContext({ children, ...props }) {
|
|
3089
|
-
const [isReady, setIsReady] = (0,
|
|
3181
|
+
const [isReady, setIsReady] = (0, import_react37.useState)(false);
|
|
3090
3182
|
(0, import_react_use.useDebounce)(
|
|
3091
3183
|
() => {
|
|
3092
3184
|
setIsReady(true);
|
|
@@ -3098,8 +3190,8 @@ function DragDropContext({ children, ...props }) {
|
|
|
3098
3190
|
}
|
|
3099
3191
|
|
|
3100
3192
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
3101
|
-
var
|
|
3102
|
-
var tableRow = (isDragging) =>
|
|
3193
|
+
var import_react38 = require("@emotion/react");
|
|
3194
|
+
var tableRow = (isDragging) => import_react38.css`
|
|
3103
3195
|
position: relative;
|
|
3104
3196
|
${isDragging ? `
|
|
3105
3197
|
display: table;
|
|
@@ -3107,7 +3199,7 @@ var tableRow = (isDragging) => import_react36.css`
|
|
|
3107
3199
|
top: auto !important;
|
|
3108
3200
|
` : void 0}
|
|
3109
3201
|
`;
|
|
3110
|
-
var tableCellDragIcon =
|
|
3202
|
+
var tableCellDragIcon = import_react38.css`
|
|
3111
3203
|
&::after {
|
|
3112
3204
|
content: '';
|
|
3113
3205
|
display: block;
|
|
@@ -3125,7 +3217,7 @@ var tableCellDragIcon = import_react36.css`
|
|
|
3125
3217
|
opacity: 1;
|
|
3126
3218
|
}
|
|
3127
3219
|
`;
|
|
3128
|
-
var variableName =
|
|
3220
|
+
var variableName = import_react38.css`
|
|
3129
3221
|
border: none;
|
|
3130
3222
|
font-weight: var(--fw-medium);
|
|
3131
3223
|
padding: 0;
|
|
@@ -3135,7 +3227,7 @@ var variableName = import_react36.css`
|
|
|
3135
3227
|
white-space: nowrap;
|
|
3136
3228
|
max-width: 20ch;
|
|
3137
3229
|
`;
|
|
3138
|
-
var variableValue =
|
|
3230
|
+
var variableValue = import_react38.css`
|
|
3139
3231
|
overflow: hidden;
|
|
3140
3232
|
text-overflow: ellipsis;
|
|
3141
3233
|
white-space: nowrap;
|
|
@@ -3214,7 +3306,7 @@ function VariablesList() {
|
|
|
3214
3306
|
title: `delete ${text}`,
|
|
3215
3307
|
css: [
|
|
3216
3308
|
import_design_system13.button,
|
|
3217
|
-
|
|
3309
|
+
import_react39.css`
|
|
3218
3310
|
background: transparent;
|
|
3219
3311
|
`
|
|
3220
3312
|
],
|
|
@@ -3344,9 +3436,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3344
3436
|
}
|
|
3345
3437
|
|
|
3346
3438
|
// src/components/Request/RequestBody.tsx
|
|
3347
|
-
var
|
|
3439
|
+
var import_react41 = require("@emotion/react");
|
|
3348
3440
|
var import_design_system15 = require("@uniformdev/design-system");
|
|
3349
|
-
var
|
|
3441
|
+
var import_react42 = require("react");
|
|
3350
3442
|
|
|
3351
3443
|
// src/components/Request/RequestProvider.tsx
|
|
3352
3444
|
var React4 = __toESM(require("react"));
|
|
@@ -3434,11 +3526,11 @@ function useRequest() {
|
|
|
3434
3526
|
}
|
|
3435
3527
|
|
|
3436
3528
|
// src/components/Request/styles/Request.styles.ts
|
|
3437
|
-
var
|
|
3438
|
-
var innerContentStyles =
|
|
3529
|
+
var import_react40 = require("@emotion/react");
|
|
3530
|
+
var innerContentStyles = import_react40.css`
|
|
3439
3531
|
background: var(--white);
|
|
3440
3532
|
`;
|
|
3441
|
-
var requestTypeContainer = (bgColor) =>
|
|
3533
|
+
var requestTypeContainer = (bgColor) => import_react40.css`
|
|
3442
3534
|
align-items: start;
|
|
3443
3535
|
background: ${bgColor};
|
|
3444
3536
|
display: grid;
|
|
@@ -3476,11 +3568,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
3476
3568
|
};
|
|
3477
3569
|
function RequestBody() {
|
|
3478
3570
|
const { request, dispatch } = useRequest();
|
|
3479
|
-
const [language, setLanguage] = (0,
|
|
3571
|
+
const [language, setLanguage] = (0, import_react42.useState)("json");
|
|
3480
3572
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3481
3573
|
"div",
|
|
3482
3574
|
{
|
|
3483
|
-
css:
|
|
3575
|
+
css: import_react41.css`
|
|
3484
3576
|
background: var(--white);
|
|
3485
3577
|
`,
|
|
3486
3578
|
children: [
|
|
@@ -3488,7 +3580,7 @@ function RequestBody() {
|
|
|
3488
3580
|
RequestTypeContainer,
|
|
3489
3581
|
{
|
|
3490
3582
|
bgColor: "var(--gray-100)",
|
|
3491
|
-
css:
|
|
3583
|
+
css: import_react41.css`
|
|
3492
3584
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
3493
3585
|
`,
|
|
3494
3586
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
@@ -3765,8 +3857,8 @@ function RequestParameters({
|
|
|
3765
3857
|
}
|
|
3766
3858
|
|
|
3767
3859
|
// src/components/Request/RequestUrl.tsx
|
|
3768
|
-
var
|
|
3769
|
-
var
|
|
3860
|
+
var import_react43 = require("@emotion/react");
|
|
3861
|
+
var import_react44 = require("react");
|
|
3770
3862
|
|
|
3771
3863
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
3772
3864
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -3792,7 +3884,7 @@ function RequestUrl() {
|
|
|
3792
3884
|
var _a, _b;
|
|
3793
3885
|
const { variables } = useVariables();
|
|
3794
3886
|
const { request } = useRequest();
|
|
3795
|
-
const mergedParameters = (0,
|
|
3887
|
+
const mergedParameters = (0, import_react44.useMemo)(() => {
|
|
3796
3888
|
var _a2;
|
|
3797
3889
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
3798
3890
|
return request.parameters;
|
|
@@ -3802,7 +3894,7 @@ function RequestUrl() {
|
|
|
3802
3894
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3803
3895
|
"small",
|
|
3804
3896
|
{
|
|
3805
|
-
css:
|
|
3897
|
+
css: import_react43.css`
|
|
3806
3898
|
display: inline-block;
|
|
3807
3899
|
margin-bottom: var(--spacing-xs);
|
|
3808
3900
|
word-break: break-word;
|
|
@@ -4037,11 +4129,11 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
4037
4129
|
|
|
4038
4130
|
// src/components/Delegation/DelegationGate.tsx
|
|
4039
4131
|
var import_design_system19 = require("@uniformdev/design-system");
|
|
4040
|
-
var
|
|
4132
|
+
var import_react46 = require("react");
|
|
4041
4133
|
|
|
4042
4134
|
// src/components/Delegation/styles/DelegationGate.style.ts
|
|
4043
|
-
var
|
|
4044
|
-
var delegationGateStyle =
|
|
4135
|
+
var import_react45 = require("@emotion/react");
|
|
4136
|
+
var delegationGateStyle = import_react45.css`
|
|
4045
4137
|
min-height: 12rem;
|
|
4046
4138
|
width: 100%;
|
|
4047
4139
|
`;
|
|
@@ -4055,7 +4147,7 @@ function DefaultDelegationDisabled() {
|
|
|
4055
4147
|
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
4148
|
}
|
|
4057
4149
|
function DefaultDelegationError({ error }) {
|
|
4058
|
-
(0,
|
|
4150
|
+
(0, import_react46.useEffect)(() => {
|
|
4059
4151
|
console.error("Delegation connection failed", error);
|
|
4060
4152
|
}, [error]);
|
|
4061
4153
|
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,9 +4182,15 @@ function DelegationGate({
|
|
|
4090
4182
|
}
|
|
4091
4183
|
|
|
4092
4184
|
// src/components/Delegation/DelegationProvider.tsx
|
|
4093
|
-
var
|
|
4185
|
+
var import_react47 = require("react");
|
|
4094
4186
|
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
4095
|
-
var
|
|
4187
|
+
var DelegationDisabledError = class extends Error {
|
|
4188
|
+
constructor() {
|
|
4189
|
+
super("Identity delegation is not enabled for this integration.");
|
|
4190
|
+
this.name = "DelegationDisabledError";
|
|
4191
|
+
}
|
|
4192
|
+
};
|
|
4193
|
+
var DEFAULT_REVALIDATE_AFTER_MS = 30 * 1e3;
|
|
4096
4194
|
function DelegationProvider({
|
|
4097
4195
|
sdk,
|
|
4098
4196
|
onSessionToken,
|
|
@@ -4101,60 +4199,70 @@ function DelegationProvider({
|
|
|
4101
4199
|
revalidateAfterMs = DEFAULT_REVALIDATE_AFTER_MS,
|
|
4102
4200
|
children
|
|
4103
4201
|
}) {
|
|
4104
|
-
const [status, setStatus] = (0,
|
|
4105
|
-
const [error, setError] = (0,
|
|
4106
|
-
const
|
|
4107
|
-
const
|
|
4108
|
-
const statusRef = (0, import_react45.useRef)("idle");
|
|
4202
|
+
const [status, setStatus] = (0, import_react47.useState)("idle");
|
|
4203
|
+
const [error, setError] = (0, import_react47.useState)(null);
|
|
4204
|
+
const mountedRef = (0, import_react47.useRef)(true);
|
|
4205
|
+
const statusRef = (0, import_react47.useRef)("idle");
|
|
4109
4206
|
statusRef.current = status;
|
|
4110
|
-
const
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4207
|
+
const acquirePromiseRef = (0, import_react47.useRef)(null);
|
|
4208
|
+
const acquire = (0, import_react47.useCallback)(() => {
|
|
4209
|
+
if (acquirePromiseRef.current) {
|
|
4210
|
+
return acquirePromiseRef.current;
|
|
4211
|
+
}
|
|
4212
|
+
const run = (async () => {
|
|
4213
|
+
if (statusRef.current !== "active") {
|
|
4214
|
+
setStatus("acquiring");
|
|
4215
|
+
}
|
|
4216
|
+
setError(null);
|
|
4217
|
+
try {
|
|
4218
|
+
const isActive = await checkActive();
|
|
4219
|
+
if (isActive) {
|
|
4220
|
+
if (mountedRef.current) {
|
|
4221
|
+
setStatus("active");
|
|
4222
|
+
}
|
|
4223
|
+
return;
|
|
4224
|
+
}
|
|
4225
|
+
if (!mountedRef.current) {
|
|
4226
|
+
return;
|
|
4227
|
+
}
|
|
4228
|
+
const sessionToken = await sdk.getSessionToken();
|
|
4229
|
+
if (!mountedRef.current) {
|
|
4230
|
+
return;
|
|
4231
|
+
}
|
|
4232
|
+
if (!sessionToken) {
|
|
4233
|
+
if (mountedRef.current) {
|
|
4234
|
+
setStatus("disabled");
|
|
4235
|
+
}
|
|
4236
|
+
throw new DelegationDisabledError();
|
|
4237
|
+
}
|
|
4238
|
+
await onSessionToken(sessionToken);
|
|
4120
4239
|
if (mountedRef.current) {
|
|
4121
4240
|
setStatus("active");
|
|
4122
4241
|
}
|
|
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");
|
|
4242
|
+
} catch (err) {
|
|
4243
|
+
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
4244
|
+
if (mountedRef.current && !(err instanceof DelegationDisabledError)) {
|
|
4245
|
+
setError(error2);
|
|
4246
|
+
setStatus("error");
|
|
4247
|
+
}
|
|
4248
|
+
throw error2;
|
|
4144
4249
|
}
|
|
4145
|
-
}
|
|
4146
|
-
|
|
4147
|
-
|
|
4250
|
+
})();
|
|
4251
|
+
acquirePromiseRef.current = run.finally(() => {
|
|
4252
|
+
acquirePromiseRef.current = null;
|
|
4253
|
+
});
|
|
4254
|
+
return acquirePromiseRef.current;
|
|
4148
4255
|
}, [sdk, onSessionToken, checkActive]);
|
|
4149
|
-
(0,
|
|
4256
|
+
(0, import_react47.useEffect)(() => {
|
|
4150
4257
|
mountedRef.current = true;
|
|
4151
|
-
void acquire()
|
|
4258
|
+
void acquire().catch(() => {
|
|
4259
|
+
});
|
|
4152
4260
|
return () => {
|
|
4153
4261
|
mountedRef.current = false;
|
|
4154
4262
|
};
|
|
4155
4263
|
}, [acquire]);
|
|
4156
|
-
const revalidate = (0,
|
|
4157
|
-
if (
|
|
4264
|
+
const revalidate = (0, import_react47.useCallback)(async () => {
|
|
4265
|
+
if (acquirePromiseRef.current) {
|
|
4158
4266
|
return;
|
|
4159
4267
|
}
|
|
4160
4268
|
if (statusRef.current !== "active") {
|
|
@@ -4166,12 +4274,13 @@ function DelegationProvider({
|
|
|
4166
4274
|
return;
|
|
4167
4275
|
}
|
|
4168
4276
|
if (!isActive) {
|
|
4169
|
-
void acquire()
|
|
4277
|
+
void acquire().catch(() => {
|
|
4278
|
+
});
|
|
4170
4279
|
}
|
|
4171
4280
|
} catch (e) {
|
|
4172
4281
|
}
|
|
4173
4282
|
}, [checkActive, acquire]);
|
|
4174
|
-
(0,
|
|
4283
|
+
(0, import_react47.useEffect)(() => {
|
|
4175
4284
|
if (!revalidateOnFocus) {
|
|
4176
4285
|
return;
|
|
4177
4286
|
}
|
|
@@ -4197,10 +4306,7 @@ function DelegationProvider({
|
|
|
4197
4306
|
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
4198
4307
|
};
|
|
4199
4308
|
}, [revalidateOnFocus, revalidateAfterMs, revalidate]);
|
|
4200
|
-
const
|
|
4201
|
-
void acquire();
|
|
4202
|
-
}, [acquire]);
|
|
4203
|
-
const value = (0, import_react45.useMemo)(() => ({ status, error, reacquire }), [status, error, reacquire]);
|
|
4309
|
+
const value = (0, import_react47.useMemo)(() => ({ status, error, reacquire: acquire }), [status, error, acquire]);
|
|
4204
4310
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DelegationContext.Provider, { value, children });
|
|
4205
4311
|
}
|
|
4206
4312
|
|
|
@@ -4208,20 +4314,20 @@ function DelegationProvider({
|
|
|
4208
4314
|
var import_design_system20 = require("@uniformdev/design-system");
|
|
4209
4315
|
|
|
4210
4316
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
4211
|
-
var
|
|
4212
|
-
var
|
|
4317
|
+
var import_mesh_sdk2 = require("@uniformdev/mesh-sdk");
|
|
4318
|
+
var import_react48 = require("react");
|
|
4213
4319
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
4214
|
-
const [error, setError] = (0,
|
|
4215
|
-
const [sdk, setSdk] = (0,
|
|
4216
|
-
const initializationInProgress = (0,
|
|
4217
|
-
(0,
|
|
4320
|
+
const [error, setError] = (0, import_react48.useState)();
|
|
4321
|
+
const [sdk, setSdk] = (0, import_react48.useState)();
|
|
4322
|
+
const initializationInProgress = (0, import_react48.useRef)(false);
|
|
4323
|
+
(0, import_react48.useEffect)(
|
|
4218
4324
|
() => {
|
|
4219
4325
|
if (typeof window === "undefined" || sdk) {
|
|
4220
4326
|
return;
|
|
4221
4327
|
}
|
|
4222
4328
|
if (typeof window.UniformMeshSDK === "undefined" && !initializationInProgress.current) {
|
|
4223
4329
|
initializationInProgress.current = true;
|
|
4224
|
-
(0,
|
|
4330
|
+
(0, import_mesh_sdk2.initializeUniformMeshSDK)({ autoResizingDisabled }).then((sdk2) => {
|
|
4225
4331
|
setSdk(sdk2);
|
|
4226
4332
|
}).catch((err) => {
|
|
4227
4333
|
setError(err);
|
|
@@ -4272,7 +4378,7 @@ var MeshApp = ({
|
|
|
4272
4378
|
};
|
|
4273
4379
|
|
|
4274
4380
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
4275
|
-
var
|
|
4381
|
+
var import_react49 = require("@emotion/react");
|
|
4276
4382
|
var import_design_system21 = require("@uniformdev/design-system");
|
|
4277
4383
|
var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
|
|
4278
4384
|
var DataRefreshButton = ({
|
|
@@ -4285,7 +4391,7 @@ var DataRefreshButton = ({
|
|
|
4285
4391
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4286
4392
|
import_design_system21.LoadingIndicator,
|
|
4287
4393
|
{
|
|
4288
|
-
css:
|
|
4394
|
+
css: import_react49.css`
|
|
4289
4395
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
4290
4396
|
`
|
|
4291
4397
|
}
|
|
@@ -4295,15 +4401,15 @@ var DataRefreshButton = ({
|
|
|
4295
4401
|
};
|
|
4296
4402
|
|
|
4297
4403
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4298
|
-
var
|
|
4404
|
+
var import_react52 = require("@emotion/react");
|
|
4299
4405
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
4300
4406
|
var import_design_system24 = require("@uniformdev/design-system");
|
|
4301
4407
|
|
|
4302
4408
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
4303
4409
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
4304
|
-
var
|
|
4410
|
+
var import_react50 = require("react");
|
|
4305
4411
|
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
4306
|
-
var ObjectSearchContext = (0,
|
|
4412
|
+
var ObjectSearchContext = (0, import_react50.createContext)({
|
|
4307
4413
|
onSetQuery: () => {
|
|
4308
4414
|
},
|
|
4309
4415
|
onSelectItem: () => {
|
|
@@ -4324,16 +4430,16 @@ var ObjectSearchProvider = ({
|
|
|
4324
4430
|
children,
|
|
4325
4431
|
defaultQuery
|
|
4326
4432
|
}) => {
|
|
4327
|
-
const [query, setQuery] = (0,
|
|
4433
|
+
const [query, setQuery] = (0, import_react50.useState)({
|
|
4328
4434
|
contentType: "",
|
|
4329
4435
|
keyword: "",
|
|
4330
4436
|
...defaultQuery
|
|
4331
4437
|
});
|
|
4332
4438
|
const { flatVariables } = useVariables(true);
|
|
4333
|
-
const querySearchDeferred = (0,
|
|
4334
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
4335
|
-
const [list, setList] = (0,
|
|
4336
|
-
const onSetQuery = (0,
|
|
4439
|
+
const querySearchDeferred = (0, import_react50.useDeferredValue)(query);
|
|
4440
|
+
const [selectedItems, setSelectedItems] = (0, import_react50.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4441
|
+
const [list, setList] = (0, import_react50.useState)({});
|
|
4442
|
+
const onSetQuery = (0, import_react50.useCallback)(
|
|
4337
4443
|
(value2) => {
|
|
4338
4444
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
4339
4445
|
return setQuery({
|
|
@@ -4345,7 +4451,7 @@ var ObjectSearchProvider = ({
|
|
|
4345
4451
|
},
|
|
4346
4452
|
[setQuery]
|
|
4347
4453
|
);
|
|
4348
|
-
const onSelectItem = (0,
|
|
4454
|
+
const onSelectItem = (0, import_react50.useCallback)(
|
|
4349
4455
|
(selectedResult) => {
|
|
4350
4456
|
if (Array.isArray(selectedResult)) {
|
|
4351
4457
|
setSelectedItems(selectedResult);
|
|
@@ -4359,17 +4465,17 @@ var ObjectSearchProvider = ({
|
|
|
4359
4465
|
},
|
|
4360
4466
|
[setSelectedItems, selectedItems]
|
|
4361
4467
|
);
|
|
4362
|
-
const onRemoveAllSelectedItems = (0,
|
|
4468
|
+
const onRemoveAllSelectedItems = (0, import_react50.useCallback)(() => {
|
|
4363
4469
|
setSelectedItems([]);
|
|
4364
4470
|
}, [setSelectedItems]);
|
|
4365
|
-
const onSetList = (0,
|
|
4471
|
+
const onSetList = (0, import_react50.useCallback)(
|
|
4366
4472
|
(value2) => {
|
|
4367
4473
|
setList(value2);
|
|
4368
4474
|
},
|
|
4369
4475
|
[setList]
|
|
4370
4476
|
);
|
|
4371
|
-
const boundQuery = (0,
|
|
4372
|
-
const value = (0,
|
|
4477
|
+
const boundQuery = (0, import_react50.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4478
|
+
const value = (0, import_react50.useMemo)(
|
|
4373
4479
|
() => ({
|
|
4374
4480
|
boundQuery,
|
|
4375
4481
|
onSetQuery,
|
|
@@ -4396,7 +4502,7 @@ var ObjectSearchProvider = ({
|
|
|
4396
4502
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
4397
4503
|
};
|
|
4398
4504
|
function useObjectSearchContext() {
|
|
4399
|
-
return (0,
|
|
4505
|
+
return (0, import_react50.useContext)(ObjectSearchContext);
|
|
4400
4506
|
}
|
|
4401
4507
|
function bindQuery(query, inputs) {
|
|
4402
4508
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -4414,9 +4520,9 @@ function bindQuery(query, inputs) {
|
|
|
4414
4520
|
var import_design_system23 = require("@uniformdev/design-system");
|
|
4415
4521
|
|
|
4416
4522
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
4417
|
-
var
|
|
4523
|
+
var import_react51 = require("@emotion/react");
|
|
4418
4524
|
var import_design_system22 = require("@uniformdev/design-system");
|
|
4419
|
-
var ObjectListItemContainer =
|
|
4525
|
+
var ObjectListItemContainer = import_react51.css`
|
|
4420
4526
|
align-items: center;
|
|
4421
4527
|
border: 1px solid var(--gray-300);
|
|
4422
4528
|
border-radius: var(--rounded-base);
|
|
@@ -4425,11 +4531,11 @@ var ObjectListItemContainer = import_react49.css`
|
|
|
4425
4531
|
grid-template-columns: 1fr auto;
|
|
4426
4532
|
padding: var(--spacing-sm);
|
|
4427
4533
|
`;
|
|
4428
|
-
var ObjectListItemContainerDisabled =
|
|
4534
|
+
var ObjectListItemContainerDisabled = import_react51.css`
|
|
4429
4535
|
opacity: var(--opacity-50);
|
|
4430
4536
|
pointer-events: none;
|
|
4431
4537
|
`;
|
|
4432
|
-
var ObjectListItemLoading =
|
|
4538
|
+
var ObjectListItemLoading = import_react51.css`
|
|
4433
4539
|
animation: ${import_design_system22.skeletonLoading} 1s linear infinite alternate;
|
|
4434
4540
|
border-color: transparent;
|
|
4435
4541
|
min-height: 42px;
|
|
@@ -4453,37 +4559,37 @@ var ObjectListItemLoading = import_react49.css`
|
|
|
4453
4559
|
width: 1rem;
|
|
4454
4560
|
}
|
|
4455
4561
|
`;
|
|
4456
|
-
var ObjectListItemHeadingGroup =
|
|
4562
|
+
var ObjectListItemHeadingGroup = import_react51.css`
|
|
4457
4563
|
align-items: center;
|
|
4458
4564
|
display: grid;
|
|
4459
4565
|
`;
|
|
4460
|
-
var ObjectListItemThumbnail =
|
|
4566
|
+
var ObjectListItemThumbnail = import_react51.css`
|
|
4461
4567
|
width: 30px;
|
|
4462
4568
|
height: 30px;
|
|
4463
4569
|
object-fit: cover;
|
|
4464
4570
|
`;
|
|
4465
|
-
var ObjectListItemTitle =
|
|
4571
|
+
var ObjectListItemTitle = import_react51.css`
|
|
4466
4572
|
color: var(--typography-base);
|
|
4467
4573
|
display: block;
|
|
4468
4574
|
font-size: var(--fs-sm);
|
|
4469
4575
|
`;
|
|
4470
|
-
var ObjectListItemSubtitle =
|
|
4576
|
+
var ObjectListItemSubtitle = import_react51.css`
|
|
4471
4577
|
color: var(--gray-500);
|
|
4472
4578
|
display: block;
|
|
4473
4579
|
font-size: var(--fs-xs);
|
|
4474
4580
|
line-height: 1;
|
|
4475
4581
|
`;
|
|
4476
|
-
var ObjectListItemInfoContainer =
|
|
4582
|
+
var ObjectListItemInfoContainer = import_react51.css`
|
|
4477
4583
|
align-items: center;
|
|
4478
4584
|
display: flex;
|
|
4479
4585
|
gap: var(--spacing-sm);
|
|
4480
4586
|
justify-content: center;
|
|
4481
4587
|
`;
|
|
4482
|
-
var ObjectListItemControlledContent =
|
|
4588
|
+
var ObjectListItemControlledContent = import_react51.css`
|
|
4483
4589
|
display: flex;
|
|
4484
4590
|
gap: var(--spacing-sm);
|
|
4485
4591
|
`;
|
|
4486
|
-
var ObjectListItemUnControlledContent =
|
|
4592
|
+
var ObjectListItemUnControlledContent = import_react51.css`
|
|
4487
4593
|
margin-top: var(--spacing-sm);
|
|
4488
4594
|
grid-column: 1 / -1;
|
|
4489
4595
|
`;
|
|
@@ -4576,7 +4682,7 @@ var ObjectSearchContainer = ({
|
|
|
4576
4682
|
import_design_system24.ScrollableList,
|
|
4577
4683
|
{
|
|
4578
4684
|
role: "list",
|
|
4579
|
-
css:
|
|
4685
|
+
css: import_react52.css`
|
|
4580
4686
|
> div {
|
|
4581
4687
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4582
4688
|
}
|
|
@@ -4648,11 +4754,11 @@ var DefaultResultList = () => {
|
|
|
4648
4754
|
|
|
4649
4755
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4650
4756
|
var import_design_system25 = require("@uniformdev/design-system");
|
|
4651
|
-
var
|
|
4757
|
+
var import_react54 = require("react");
|
|
4652
4758
|
|
|
4653
4759
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4654
|
-
var
|
|
4655
|
-
var ObjectSearchFilterContainerLabel =
|
|
4760
|
+
var import_react53 = require("@emotion/react");
|
|
4761
|
+
var ObjectSearchFilterContainerLabel = import_react53.css`
|
|
4656
4762
|
align-items: center;
|
|
4657
4763
|
display: flex;
|
|
4658
4764
|
font-size: var(--fs-sm);
|
|
@@ -4660,11 +4766,11 @@ var ObjectSearchFilterContainerLabel = import_react51.css`
|
|
|
4660
4766
|
line-height: 1rem;
|
|
4661
4767
|
margin-bottom: var(--spacing-sm);
|
|
4662
4768
|
`;
|
|
4663
|
-
var ObjectSearchFilterContainer =
|
|
4769
|
+
var ObjectSearchFilterContainer = import_react53.css`
|
|
4664
4770
|
display: grid;
|
|
4665
4771
|
gap: var(--spacing-base);
|
|
4666
4772
|
`;
|
|
4667
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
4773
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react53.css`
|
|
4668
4774
|
display: grid;
|
|
4669
4775
|
grid-template-columns: ${gridColumns};
|
|
4670
4776
|
gap: var(--spacing-base);
|
|
@@ -4682,7 +4788,7 @@ var ObjectSearchFilter = ({
|
|
|
4682
4788
|
}) => {
|
|
4683
4789
|
var _a, _b;
|
|
4684
4790
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4685
|
-
const [searchState, setSearchState] = (0,
|
|
4791
|
+
const [searchState, setSearchState] = (0, import_react54.useState)({
|
|
4686
4792
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4687
4793
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
4688
4794
|
});
|
|
@@ -4692,7 +4798,7 @@ var ObjectSearchFilter = ({
|
|
|
4692
4798
|
});
|
|
4693
4799
|
onSetQuery({ ...query, ...value });
|
|
4694
4800
|
};
|
|
4695
|
-
const memoizedSelectOptions = (0,
|
|
4801
|
+
const memoizedSelectOptions = (0, import_react54.useMemo)(() => {
|
|
4696
4802
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4697
4803
|
return [];
|
|
4698
4804
|
}
|
|
@@ -4754,9 +4860,9 @@ function Image({ src, alt, className }) {
|
|
|
4754
4860
|
}
|
|
4755
4861
|
|
|
4756
4862
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
4757
|
-
var
|
|
4863
|
+
var import_react55 = require("@emotion/react");
|
|
4758
4864
|
var import_design_system26 = require("@uniformdev/design-system");
|
|
4759
|
-
var ButtonStyles =
|
|
4865
|
+
var ButtonStyles = import_react55.css`
|
|
4760
4866
|
${import_design_system26.button}
|
|
4761
4867
|
background: transparent;
|
|
4762
4868
|
border: 1px solid var(--typography-base);
|
|
@@ -4784,7 +4890,7 @@ var ButtonStyles = import_react53.css`
|
|
|
4784
4890
|
text-decoration: none;
|
|
4785
4891
|
}
|
|
4786
4892
|
`;
|
|
4787
|
-
var ButtonIcon =
|
|
4893
|
+
var ButtonIcon = import_react55.css`
|
|
4788
4894
|
width: 1rem;
|
|
4789
4895
|
height: 1rem;
|
|
4790
4896
|
`;
|
|
@@ -4813,8 +4919,8 @@ var LinkButton = ({
|
|
|
4813
4919
|
};
|
|
4814
4920
|
|
|
4815
4921
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
4816
|
-
var
|
|
4817
|
-
var ObjectSearchResultItemContainer =
|
|
4922
|
+
var import_react56 = require("@emotion/react");
|
|
4923
|
+
var ObjectSearchResultItemContainer = import_react56.css`
|
|
4818
4924
|
align-items: center;
|
|
4819
4925
|
border: 1px solid var(--gray-300);
|
|
4820
4926
|
border-radius: var(--rounded-base);
|
|
@@ -4830,7 +4936,7 @@ var ObjectSearchResultItemContainer = import_react54.css`
|
|
|
4830
4936
|
}
|
|
4831
4937
|
}
|
|
4832
4938
|
`;
|
|
4833
|
-
var ObjectSearchDragHandle =
|
|
4939
|
+
var ObjectSearchDragHandle = import_react56.css`
|
|
4834
4940
|
border-left: 2px dotted var(--gray-300);
|
|
4835
4941
|
border-right: 2px dotted var(--gray-300);
|
|
4836
4942
|
position: absolute;
|
|
@@ -4839,40 +4945,40 @@ var ObjectSearchDragHandle = import_react54.css`
|
|
|
4839
4945
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4840
4946
|
opacity: 0;
|
|
4841
4947
|
`;
|
|
4842
|
-
var ObjectSearchResultItemSubtitle =
|
|
4948
|
+
var ObjectSearchResultItemSubtitle = import_react56.css`
|
|
4843
4949
|
color: var(--gray-500);
|
|
4844
4950
|
display: block;
|
|
4845
4951
|
font-size: var(--fs-xs);
|
|
4846
4952
|
line-height: 1;
|
|
4847
4953
|
`;
|
|
4848
|
-
var ObjectSearchResultItemTitle =
|
|
4954
|
+
var ObjectSearchResultItemTitle = import_react56.css`
|
|
4849
4955
|
align-items: center;
|
|
4850
4956
|
color: var(--typography-base);
|
|
4851
4957
|
display: flex;
|
|
4852
4958
|
gap: var(--spacing-xs);
|
|
4853
4959
|
`;
|
|
4854
|
-
var ObjectSearchResultItemTimeStamp =
|
|
4960
|
+
var ObjectSearchResultItemTimeStamp = import_react56.css`
|
|
4855
4961
|
color: var(--gray-500);
|
|
4856
4962
|
font-size: var(--fs-xs);
|
|
4857
4963
|
`;
|
|
4858
|
-
var ObjectSearchResultItemTitleLink =
|
|
4964
|
+
var ObjectSearchResultItemTitleLink = import_react56.css`
|
|
4859
4965
|
text-decoration: none;
|
|
4860
4966
|
color: var(--primary-action-default);
|
|
4861
4967
|
font-size: var(--fs-sm);
|
|
4862
4968
|
`;
|
|
4863
|
-
var ObjectSearchAuthorStateGroup =
|
|
4969
|
+
var ObjectSearchAuthorStateGroup = import_react56.css`
|
|
4864
4970
|
align-items: center;
|
|
4865
4971
|
display: flex;
|
|
4866
4972
|
gap: var(--spacing-sm);
|
|
4867
4973
|
`;
|
|
4868
|
-
var ObjectSearchUpdateGroup =
|
|
4974
|
+
var ObjectSearchUpdateGroup = import_react56.css`
|
|
4869
4975
|
display: grid;
|
|
4870
4976
|
`;
|
|
4871
|
-
var ObjectSearchContentContainer =
|
|
4977
|
+
var ObjectSearchContentContainer = import_react56.css`
|
|
4872
4978
|
display: flex;
|
|
4873
4979
|
gap: var(--spacing-base);
|
|
4874
4980
|
`;
|
|
4875
|
-
var ObjectSearchImage =
|
|
4981
|
+
var ObjectSearchImage = import_react56.css`
|
|
4876
4982
|
width: 56px;
|
|
4877
4983
|
height: 56px;
|
|
4878
4984
|
object-fit: cover;
|
|
@@ -4975,26 +5081,26 @@ var import_dnd3 = require("@hello-pangea/dnd");
|
|
|
4975
5081
|
var import_design_system28 = require("@uniformdev/design-system");
|
|
4976
5082
|
|
|
4977
5083
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4978
|
-
var
|
|
4979
|
-
var ObjectSearchResultListContainer =
|
|
5084
|
+
var import_react57 = require("@emotion/react");
|
|
5085
|
+
var ObjectSearchResultListContainer = import_react57.css`
|
|
4980
5086
|
align-items: center;
|
|
4981
5087
|
display: flex;
|
|
4982
5088
|
gap: var(--spacing-sm);
|
|
4983
5089
|
justify-content: space-between;
|
|
4984
5090
|
`;
|
|
4985
|
-
var ObjectSearchDragContainer =
|
|
5091
|
+
var ObjectSearchDragContainer = import_react57.css`
|
|
4986
5092
|
margin: 0 0 var(--spacing-sm);
|
|
4987
5093
|
`;
|
|
4988
|
-
var ObjectSearchContainerDragging =
|
|
5094
|
+
var ObjectSearchContainerDragging = import_react57.css`
|
|
4989
5095
|
box-shadow: var(--shadow-base);
|
|
4990
5096
|
opacity: var(--opacity-50);
|
|
4991
5097
|
`;
|
|
4992
|
-
var ObjectSearchResultListCounterContainer =
|
|
5098
|
+
var ObjectSearchResultListCounterContainer = import_react57.css`
|
|
4993
5099
|
align-items: center;
|
|
4994
5100
|
display: flex;
|
|
4995
5101
|
gap: var(--spacing-sm);
|
|
4996
5102
|
`;
|
|
4997
|
-
var ObjectSearchResultListTitle =
|
|
5103
|
+
var ObjectSearchResultListTitle = import_react57.css`
|
|
4998
5104
|
font-weight: var(--fw-bold);
|
|
4999
5105
|
line-height: 1;
|
|
5000
5106
|
`;
|
|
@@ -5101,7 +5207,7 @@ function ObjectSearchResultList({
|
|
|
5101
5207
|
|
|
5102
5208
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
5103
5209
|
var import_design_system29 = require("@uniformdev/design-system");
|
|
5104
|
-
var
|
|
5210
|
+
var import_react58 = require("react");
|
|
5105
5211
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
5106
5212
|
var QueryFilter = ({
|
|
5107
5213
|
requireContentType,
|
|
@@ -5130,7 +5236,7 @@ var QueryFilter = ({
|
|
|
5130
5236
|
}) => {
|
|
5131
5237
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
5132
5238
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
5133
|
-
const [queryState, setQueryState] = (0,
|
|
5239
|
+
const [queryState, setQueryState] = (0, import_react58.useState)({
|
|
5134
5240
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
5135
5241
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
5136
5242
|
count: (_c = query.count) != null ? _c : 5,
|
|
@@ -5141,7 +5247,7 @@ var QueryFilter = ({
|
|
|
5141
5247
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
5142
5248
|
onSetQuery({ ...query, ...value });
|
|
5143
5249
|
};
|
|
5144
|
-
(0,
|
|
5250
|
+
(0, import_react58.useEffect)(() => {
|
|
5145
5251
|
onSetQuery(queryState);
|
|
5146
5252
|
}, []);
|
|
5147
5253
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("fieldset", { children: [
|
|
@@ -5267,7 +5373,7 @@ var QueryFilter = ({
|
|
|
5267
5373
|
};
|
|
5268
5374
|
|
|
5269
5375
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
5270
|
-
var
|
|
5376
|
+
var import_react59 = require("react");
|
|
5271
5377
|
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
5272
5378
|
function ParamTypeDynamicDataProvider(props) {
|
|
5273
5379
|
const { children } = props;
|
|
@@ -5276,7 +5382,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
5276
5382
|
} = useMeshLocation("paramType");
|
|
5277
5383
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5278
5384
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
5279
|
-
const variables = (0,
|
|
5385
|
+
const variables = (0, import_react59.useMemo)(
|
|
5280
5386
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
5281
5387
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
5282
5388
|
);
|
|
@@ -5289,9 +5395,9 @@ var JsonMeshVariableEditor = ({
|
|
|
5289
5395
|
variable,
|
|
5290
5396
|
context
|
|
5291
5397
|
}) => {
|
|
5292
|
-
const sillyRef = (0,
|
|
5398
|
+
const sillyRef = (0, import_react59.useRef)(false);
|
|
5293
5399
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
5294
|
-
(0,
|
|
5400
|
+
(0, import_react59.useEffect)(() => {
|
|
5295
5401
|
if (sillyRef.current) {
|
|
5296
5402
|
return;
|
|
5297
5403
|
}
|
|
@@ -5761,7 +5867,7 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5761
5867
|
|
|
5762
5868
|
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
5763
5869
|
var import_design_system30 = require("@uniformdev/design-system");
|
|
5764
|
-
var
|
|
5870
|
+
var import_react60 = require("react");
|
|
5765
5871
|
var import_react_use2 = require("react-use");
|
|
5766
5872
|
var import_jsx_runtime60 = require("@emotion/react/jsx-runtime");
|
|
5767
5873
|
var DateEditor = ({
|
|
@@ -5772,7 +5878,7 @@ var DateEditor = ({
|
|
|
5772
5878
|
readOnly,
|
|
5773
5879
|
valueTestId
|
|
5774
5880
|
}) => {
|
|
5775
|
-
const [innerValue, setInnerValue] = (0,
|
|
5881
|
+
const [innerValue, setInnerValue] = (0, import_react60.useState)(value != null ? value : "");
|
|
5776
5882
|
(0, import_react_use2.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
5777
5883
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5778
5884
|
import_design_system30.Input,
|
|
@@ -5791,7 +5897,7 @@ var DateEditor = ({
|
|
|
5791
5897
|
|
|
5792
5898
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5793
5899
|
var import_design_system32 = require("@uniformdev/design-system");
|
|
5794
|
-
var
|
|
5900
|
+
var import_react61 = require("react");
|
|
5795
5901
|
var import_react_use3 = require("react-use");
|
|
5796
5902
|
|
|
5797
5903
|
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
@@ -5827,9 +5933,9 @@ var DateRangeEditor = ({
|
|
|
5827
5933
|
readOnly,
|
|
5828
5934
|
valueTestId
|
|
5829
5935
|
}) => {
|
|
5830
|
-
const [minDateValue, setMinDateValue] = (0,
|
|
5831
|
-
const [maxDateValue, setMaxDateValue] = (0,
|
|
5832
|
-
const [error, setError] = (0,
|
|
5936
|
+
const [minDateValue, setMinDateValue] = (0, import_react61.useState)(value ? value[0] : "");
|
|
5937
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react61.useState)(value ? value[1] : "");
|
|
5938
|
+
const [error, setError] = (0, import_react61.useState)("");
|
|
5833
5939
|
(0, import_react_use3.useDebounce)(
|
|
5834
5940
|
() => {
|
|
5835
5941
|
if (minDateValue && maxDateValue && !error) {
|
|
@@ -5841,7 +5947,7 @@ var DateRangeEditor = ({
|
|
|
5841
5947
|
500,
|
|
5842
5948
|
[minDateValue, maxDateValue]
|
|
5843
5949
|
);
|
|
5844
|
-
(0,
|
|
5950
|
+
(0, import_react61.useEffect)(() => {
|
|
5845
5951
|
if (!minDateValue || !maxDateValue) {
|
|
5846
5952
|
return;
|
|
5847
5953
|
}
|
|
@@ -5913,7 +6019,7 @@ var DateRangeEditor = ({
|
|
|
5913
6019
|
|
|
5914
6020
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5915
6021
|
var import_design_system33 = require("@uniformdev/design-system");
|
|
5916
|
-
var
|
|
6022
|
+
var import_react62 = require("react");
|
|
5917
6023
|
|
|
5918
6024
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5919
6025
|
var readOnlyAttributes = {
|
|
@@ -5934,7 +6040,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
5934
6040
|
}) => {
|
|
5935
6041
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5936
6042
|
const isClearable = !readOnly || !disabled;
|
|
5937
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6043
|
+
const { groupedOptions, selectedOptions } = (0, import_react62.useMemo)(
|
|
5938
6044
|
() => (0, import_design_system33.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5939
6045
|
[options, value]
|
|
5940
6046
|
);
|
|
@@ -5968,7 +6074,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
5968
6074
|
|
|
5969
6075
|
// src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
|
|
5970
6076
|
var import_design_system34 = require("@uniformdev/design-system");
|
|
5971
|
-
var
|
|
6077
|
+
var import_react63 = require("react");
|
|
5972
6078
|
var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
|
|
5973
6079
|
var FilterSingleChoiceEditor = ({
|
|
5974
6080
|
options,
|
|
@@ -5979,7 +6085,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
5979
6085
|
valueTestId
|
|
5980
6086
|
}) => {
|
|
5981
6087
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5982
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6088
|
+
const { groupedOptions, selectedOptions } = (0, import_react63.useMemo)(
|
|
5983
6089
|
() => (0, import_design_system34.convertComboBoxGroupsToSelectableGroups)({
|
|
5984
6090
|
options: options != null ? options : [],
|
|
5985
6091
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
@@ -6017,7 +6123,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
6017
6123
|
|
|
6018
6124
|
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
6019
6125
|
var import_design_system35 = require("@uniformdev/design-system");
|
|
6020
|
-
var
|
|
6126
|
+
var import_react64 = require("react");
|
|
6021
6127
|
var import_react_use4 = require("react-use");
|
|
6022
6128
|
var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
|
|
6023
6129
|
var NumberEditor = ({
|
|
@@ -6028,7 +6134,7 @@ var NumberEditor = ({
|
|
|
6028
6134
|
readOnly,
|
|
6029
6135
|
valueTestId
|
|
6030
6136
|
}) => {
|
|
6031
|
-
const [innerValue, setInnerValue] = (0,
|
|
6137
|
+
const [innerValue, setInnerValue] = (0, import_react64.useState)(value != null ? value : "");
|
|
6032
6138
|
(0, import_react_use4.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
6033
6139
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6034
6140
|
import_design_system35.Input,
|
|
@@ -6048,7 +6154,7 @@ var NumberEditor = ({
|
|
|
6048
6154
|
|
|
6049
6155
|
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
6050
6156
|
var import_design_system36 = require("@uniformdev/design-system");
|
|
6051
|
-
var
|
|
6157
|
+
var import_react65 = require("react");
|
|
6052
6158
|
var import_react_use5 = require("react-use");
|
|
6053
6159
|
var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
|
|
6054
6160
|
var NumberRangeEditor = ({
|
|
@@ -6059,9 +6165,9 @@ var NumberRangeEditor = ({
|
|
|
6059
6165
|
readOnly,
|
|
6060
6166
|
valueTestId
|
|
6061
6167
|
}) => {
|
|
6062
|
-
const [minValue, setMinValue] = (0,
|
|
6063
|
-
const [maxValue, setMaxValue] = (0,
|
|
6064
|
-
const [error, setError] = (0,
|
|
6168
|
+
const [minValue, setMinValue] = (0, import_react65.useState)("");
|
|
6169
|
+
const [maxValue, setMaxValue] = (0, import_react65.useState)("");
|
|
6170
|
+
const [error, setError] = (0, import_react65.useState)("");
|
|
6065
6171
|
(0, import_react_use5.useDebounce)(
|
|
6066
6172
|
() => {
|
|
6067
6173
|
if (minValue && maxValue && !error) {
|
|
@@ -6073,7 +6179,7 @@ var NumberRangeEditor = ({
|
|
|
6073
6179
|
500,
|
|
6074
6180
|
[minValue, maxValue]
|
|
6075
6181
|
);
|
|
6076
|
-
(0,
|
|
6182
|
+
(0, import_react65.useEffect)(() => {
|
|
6077
6183
|
if (!maxValue && !minValue) {
|
|
6078
6184
|
return;
|
|
6079
6185
|
}
|
|
@@ -6136,7 +6242,7 @@ var NumberRangeEditor = ({
|
|
|
6136
6242
|
|
|
6137
6243
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
6138
6244
|
var import_design_system38 = require("@uniformdev/design-system");
|
|
6139
|
-
var
|
|
6245
|
+
var import_react66 = require("react");
|
|
6140
6246
|
|
|
6141
6247
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
6142
6248
|
var import_design_system37 = require("@uniformdev/design-system");
|
|
@@ -6162,7 +6268,7 @@ var StatusMultiEditor = ({
|
|
|
6162
6268
|
valueTestId
|
|
6163
6269
|
}) => {
|
|
6164
6270
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6165
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6271
|
+
const { groupedOptions, selectedOptions } = (0, import_react66.useMemo)(
|
|
6166
6272
|
() => (0, import_design_system38.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
6167
6273
|
[options, value]
|
|
6168
6274
|
);
|
|
@@ -6194,7 +6300,7 @@ var StatusMultiEditor = ({
|
|
|
6194
6300
|
|
|
6195
6301
|
// src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
|
|
6196
6302
|
var import_design_system39 = require("@uniformdev/design-system");
|
|
6197
|
-
var
|
|
6303
|
+
var import_react67 = require("react");
|
|
6198
6304
|
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
6199
6305
|
var StatusSingleEditor = ({
|
|
6200
6306
|
options,
|
|
@@ -6205,7 +6311,7 @@ var StatusSingleEditor = ({
|
|
|
6205
6311
|
valueTestId
|
|
6206
6312
|
}) => {
|
|
6207
6313
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6208
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6314
|
+
const { groupedOptions, selectedOptions } = (0, import_react67.useMemo)(
|
|
6209
6315
|
() => (0, import_design_system39.convertComboBoxGroupsToSelectableGroups)({
|
|
6210
6316
|
options: options != null ? options : [],
|
|
6211
6317
|
selectedItems: new Set(value ? [value] : void 0),
|
|
@@ -6242,7 +6348,7 @@ var StatusSingleEditor = ({
|
|
|
6242
6348
|
|
|
6243
6349
|
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
6244
6350
|
var import_design_system40 = require("@uniformdev/design-system");
|
|
6245
|
-
var
|
|
6351
|
+
var import_react68 = require("react");
|
|
6246
6352
|
var import_react_use6 = require("react-use");
|
|
6247
6353
|
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
6248
6354
|
var TextEditor = ({
|
|
@@ -6252,7 +6358,7 @@ var TextEditor = ({
|
|
|
6252
6358
|
readOnly,
|
|
6253
6359
|
valueTestId
|
|
6254
6360
|
}) => {
|
|
6255
|
-
const [innerValue, setInnerValue] = (0,
|
|
6361
|
+
const [innerValue, setInnerValue] = (0, import_react68.useState)(value != null ? value : "");
|
|
6256
6362
|
(0, import_react_use6.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
6257
6363
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6258
6364
|
import_design_system40.Input,
|
|
@@ -6270,7 +6376,7 @@ var TextEditor = ({
|
|
|
6270
6376
|
|
|
6271
6377
|
// src/components/SearchAndFilter/editors/TextMultiChoiceEditor.tsx
|
|
6272
6378
|
var import_design_system41 = require("@uniformdev/design-system");
|
|
6273
|
-
var
|
|
6379
|
+
var import_react69 = require("react");
|
|
6274
6380
|
var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
|
|
6275
6381
|
var TextMultiChoiceEditor = ({
|
|
6276
6382
|
value,
|
|
@@ -6281,7 +6387,7 @@ var TextMultiChoiceEditor = ({
|
|
|
6281
6387
|
}) => {
|
|
6282
6388
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6283
6389
|
const isClearable = !readOnly || !disabled;
|
|
6284
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6390
|
+
const { groupedOptions, selectedOptions } = (0, import_react69.useMemo)(() => {
|
|
6285
6391
|
var _a;
|
|
6286
6392
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
6287
6393
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
@@ -6320,21 +6426,21 @@ var TextMultiChoiceEditor = ({
|
|
|
6320
6426
|
var import_design_system43 = require("@uniformdev/design-system");
|
|
6321
6427
|
|
|
6322
6428
|
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
6323
|
-
var
|
|
6429
|
+
var import_react70 = require("@emotion/react");
|
|
6324
6430
|
var import_design_system42 = require("@uniformdev/design-system");
|
|
6325
|
-
var SearchAndFilterControlsWrapper = (gridColumns) =>
|
|
6431
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => import_react70.css`
|
|
6326
6432
|
align-items: stretch;
|
|
6327
6433
|
display: grid;
|
|
6328
6434
|
grid-template-columns: ${gridColumns};
|
|
6329
6435
|
gap: var(--spacing-sm);
|
|
6330
6436
|
`;
|
|
6331
|
-
var SearchAndFilterOutterControlWrapper = (gridColumns) =>
|
|
6437
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react70.css`
|
|
6332
6438
|
align-items: stretch;
|
|
6333
6439
|
display: grid;
|
|
6334
6440
|
grid-template-columns: ${gridColumns};
|
|
6335
6441
|
gap: var(--spacing-sm);
|
|
6336
6442
|
`;
|
|
6337
|
-
var ConditionalFilterRow =
|
|
6443
|
+
var ConditionalFilterRow = import_react70.css`
|
|
6338
6444
|
align-items: baseline;
|
|
6339
6445
|
display: grid;
|
|
6340
6446
|
grid-template-columns: 35px 1fr;
|
|
@@ -6370,7 +6476,7 @@ var ConditionalFilterRow = import_react68.css`
|
|
|
6370
6476
|
animation: ${import_design_system42.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
6371
6477
|
}
|
|
6372
6478
|
`;
|
|
6373
|
-
var ConditionalInputRow =
|
|
6479
|
+
var ConditionalInputRow = import_react70.css`
|
|
6374
6480
|
display: flex;
|
|
6375
6481
|
gap: var(--spacing-sm);
|
|
6376
6482
|
flex-wrap: wrap;
|
|
@@ -6394,16 +6500,16 @@ var ConditionalInputRow = import_react68.css`
|
|
|
6394
6500
|
}
|
|
6395
6501
|
}
|
|
6396
6502
|
`;
|
|
6397
|
-
var ConditionalInputRowEmpty =
|
|
6503
|
+
var ConditionalInputRowEmpty = import_react70.css`
|
|
6398
6504
|
flex-wrap: nowrap;
|
|
6399
6505
|
`;
|
|
6400
|
-
var SearchInput =
|
|
6506
|
+
var SearchInput = import_react70.css`
|
|
6401
6507
|
&& {
|
|
6402
6508
|
max-height: 40px;
|
|
6403
6509
|
min-height: unset;
|
|
6404
6510
|
}
|
|
6405
6511
|
`;
|
|
6406
|
-
var BindableKeywordSearchInputStyles =
|
|
6512
|
+
var BindableKeywordSearchInputStyles = import_react70.css`
|
|
6407
6513
|
position: relative;
|
|
6408
6514
|
width: 100%;
|
|
6409
6515
|
|
|
@@ -6418,19 +6524,19 @@ var BindableKeywordSearchInputStyles = import_react68.css`
|
|
|
6418
6524
|
white-space: nowrap;
|
|
6419
6525
|
}
|
|
6420
6526
|
`;
|
|
6421
|
-
var ClearSearchButtonContainer =
|
|
6527
|
+
var ClearSearchButtonContainer = import_react70.css`
|
|
6422
6528
|
align-items: center;
|
|
6423
6529
|
display: flex;
|
|
6424
6530
|
position: absolute;
|
|
6425
6531
|
inset: 0 var(--spacing-lg) 0 auto;
|
|
6426
6532
|
`;
|
|
6427
|
-
var ClearSearchButtonStyles =
|
|
6533
|
+
var ClearSearchButtonStyles = import_react70.css`
|
|
6428
6534
|
background: none;
|
|
6429
6535
|
border: none;
|
|
6430
6536
|
padding: 0;
|
|
6431
6537
|
pointer-events: all;
|
|
6432
6538
|
`;
|
|
6433
|
-
var FilterButton =
|
|
6539
|
+
var FilterButton = import_react70.css`
|
|
6434
6540
|
align-items: center;
|
|
6435
6541
|
background: var(--white);
|
|
6436
6542
|
border: 1px solid var(--gray-300);
|
|
@@ -6467,13 +6573,13 @@ var FilterButton = import_react68.css`
|
|
|
6467
6573
|
opacity: var(--opacity-50);
|
|
6468
6574
|
}
|
|
6469
6575
|
`;
|
|
6470
|
-
var FilterButtonText =
|
|
6576
|
+
var FilterButtonText = import_react70.css`
|
|
6471
6577
|
overflow: hidden;
|
|
6472
6578
|
text-overflow: ellipsis;
|
|
6473
6579
|
white-space: nowrap;
|
|
6474
6580
|
max-width: 14ch;
|
|
6475
6581
|
`;
|
|
6476
|
-
var FilterButtonSelected =
|
|
6582
|
+
var FilterButtonSelected = import_react70.css`
|
|
6477
6583
|
background: var(--gray-100);
|
|
6478
6584
|
border-color: var(--gray-300);
|
|
6479
6585
|
|
|
@@ -6481,7 +6587,7 @@ var FilterButtonSelected = import_react68.css`
|
|
|
6481
6587
|
color: var(--accent-dark);
|
|
6482
6588
|
}
|
|
6483
6589
|
`;
|
|
6484
|
-
var FilterButtonWithOptions =
|
|
6590
|
+
var FilterButtonWithOptions = import_react70.css`
|
|
6485
6591
|
:where([aria-expanded='true']) {
|
|
6486
6592
|
background: var(--purple-rain-100);
|
|
6487
6593
|
border-color: var(--accent-light);
|
|
@@ -6493,14 +6599,14 @@ var FilterButtonWithOptions = import_react68.css`
|
|
|
6493
6599
|
}
|
|
6494
6600
|
}
|
|
6495
6601
|
`;
|
|
6496
|
-
var SearchIcon =
|
|
6602
|
+
var SearchIcon = import_react70.css`
|
|
6497
6603
|
color: var(--icon-color);
|
|
6498
6604
|
position: absolute;
|
|
6499
6605
|
inset: 0 var(--spacing-base) 0 auto;
|
|
6500
6606
|
margin: auto;
|
|
6501
6607
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
6502
6608
|
`;
|
|
6503
|
-
var AddConditionalBtn =
|
|
6609
|
+
var AddConditionalBtn = import_react70.css`
|
|
6504
6610
|
align-items: center;
|
|
6505
6611
|
background: transparent;
|
|
6506
6612
|
border: none;
|
|
@@ -6519,14 +6625,14 @@ var AddConditionalBtn = import_react68.css`
|
|
|
6519
6625
|
color: var(--gray-400);
|
|
6520
6626
|
}
|
|
6521
6627
|
`;
|
|
6522
|
-
var Title =
|
|
6628
|
+
var Title = import_react70.css`
|
|
6523
6629
|
color: var(--typography-light);
|
|
6524
6630
|
|
|
6525
6631
|
&:focus {
|
|
6526
6632
|
outline: none;
|
|
6527
6633
|
}
|
|
6528
6634
|
`;
|
|
6529
|
-
var ResetConditionsBtn =
|
|
6635
|
+
var ResetConditionsBtn = import_react70.css`
|
|
6530
6636
|
background: transparent;
|
|
6531
6637
|
border: none;
|
|
6532
6638
|
color: var(--action-destructive-default);
|
|
@@ -6541,7 +6647,7 @@ var ResetConditionsBtn = import_react68.css`
|
|
|
6541
6647
|
color: var(--gray-400);
|
|
6542
6648
|
}
|
|
6543
6649
|
`;
|
|
6544
|
-
var CriteriaGroupOperatorTrigger =
|
|
6650
|
+
var CriteriaGroupOperatorTrigger = import_react70.css`
|
|
6545
6651
|
&& {
|
|
6546
6652
|
padding: 0;
|
|
6547
6653
|
border-radius: var(--rounded-sm);
|
|
@@ -6560,13 +6666,13 @@ var CriteriaGroupOperatorTrigger = import_react68.css`
|
|
|
6560
6666
|
}
|
|
6561
6667
|
}
|
|
6562
6668
|
`;
|
|
6563
|
-
var IconBtn =
|
|
6669
|
+
var IconBtn = import_react70.css`
|
|
6564
6670
|
align-self: center;
|
|
6565
6671
|
background: transparent;
|
|
6566
6672
|
border: none;
|
|
6567
6673
|
padding: var(--spacing-sm);
|
|
6568
6674
|
`;
|
|
6569
|
-
var SearchAndFilterOptionsContainer =
|
|
6675
|
+
var SearchAndFilterOptionsContainer = import_react70.css`
|
|
6570
6676
|
background: var(--gray-50);
|
|
6571
6677
|
border: 1px solid var(--gray-300);
|
|
6572
6678
|
border-radius: var(--rounded-base);
|
|
@@ -6577,17 +6683,17 @@ var SearchAndFilterOptionsContainer = import_react68.css`
|
|
|
6577
6683
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6578
6684
|
will-change: height;
|
|
6579
6685
|
`;
|
|
6580
|
-
var SearchAndFilterOptionsInnerContainer =
|
|
6686
|
+
var SearchAndFilterOptionsInnerContainer = import_react70.css`
|
|
6581
6687
|
display: flex;
|
|
6582
6688
|
flex-direction: column;
|
|
6583
6689
|
gap: var(--spacing-sm);
|
|
6584
6690
|
padding-inline: var(--spacing-md);
|
|
6585
6691
|
`;
|
|
6586
|
-
var SearchAndFilterButtonGroup =
|
|
6692
|
+
var SearchAndFilterButtonGroup = import_react70.css`
|
|
6587
6693
|
margin-top: var(--spacing-xs);
|
|
6588
6694
|
margin-left: calc(56px + var(--spacing-md));
|
|
6589
6695
|
`;
|
|
6590
|
-
var SearchAndFilterAdditionalContainer =
|
|
6696
|
+
var SearchAndFilterAdditionalContainer = import_react70.css`
|
|
6591
6697
|
align-items: center;
|
|
6592
6698
|
border-top: 1px solid var(--gray-300);
|
|
6593
6699
|
display: flex;
|
|
@@ -6633,13 +6739,13 @@ var import_CgClose = require("@react-icons/all-files/cg/CgClose");
|
|
|
6633
6739
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
6634
6740
|
var import_design_system45 = require("@uniformdev/design-system");
|
|
6635
6741
|
var import_lexical11 = require("lexical");
|
|
6636
|
-
var
|
|
6742
|
+
var import_react72 = require("react");
|
|
6637
6743
|
var import_react_use7 = require("react-use");
|
|
6638
6744
|
var import_uuid2 = require("uuid");
|
|
6639
6745
|
|
|
6640
6746
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6641
6747
|
var import_design_system44 = require("@uniformdev/design-system");
|
|
6642
|
-
var
|
|
6748
|
+
var import_react71 = require("react");
|
|
6643
6749
|
|
|
6644
6750
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
6645
6751
|
var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
|
|
@@ -6715,7 +6821,7 @@ var bindableFiltersMapper = {
|
|
|
6715
6821
|
|
|
6716
6822
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6717
6823
|
var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
|
|
6718
|
-
var SearchAndFilterContext = (0,
|
|
6824
|
+
var SearchAndFilterContext = (0, import_react71.createContext)({
|
|
6719
6825
|
searchTerm: "",
|
|
6720
6826
|
setSearchTerm: () => {
|
|
6721
6827
|
},
|
|
@@ -6754,17 +6860,17 @@ var SearchAndFilterProvider = ({
|
|
|
6754
6860
|
children,
|
|
6755
6861
|
allowBindingSearchTerm
|
|
6756
6862
|
}) => {
|
|
6757
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
6758
|
-
const deferredSearchTerm = (0,
|
|
6759
|
-
const [filterVisibility, setFilterVisibility] = (0,
|
|
6760
|
-
const handleSearchTerm = (0,
|
|
6863
|
+
const [searchTerm, setSearchTerm] = (0, import_react71.useState)(defaultSearchTerm);
|
|
6864
|
+
const deferredSearchTerm = (0, import_react71.useDeferredValue)(searchTerm);
|
|
6865
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react71.useState)(alwaysVisible || filterVisible);
|
|
6866
|
+
const handleSearchTerm = (0, import_react71.useCallback)(
|
|
6761
6867
|
(term) => {
|
|
6762
6868
|
setSearchTerm(term);
|
|
6763
6869
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
6764
6870
|
},
|
|
6765
6871
|
[setSearchTerm, onSearchChange]
|
|
6766
6872
|
);
|
|
6767
|
-
const handleToggleFilterVisibility = (0,
|
|
6873
|
+
const handleToggleFilterVisibility = (0, import_react71.useCallback)(
|
|
6768
6874
|
(visible) => {
|
|
6769
6875
|
if (alwaysVisible) {
|
|
6770
6876
|
return;
|
|
@@ -6773,10 +6879,10 @@ var SearchAndFilterProvider = ({
|
|
|
6773
6879
|
},
|
|
6774
6880
|
[alwaysVisible]
|
|
6775
6881
|
);
|
|
6776
|
-
const handleAddFilter = (0,
|
|
6882
|
+
const handleAddFilter = (0, import_react71.useCallback)(() => {
|
|
6777
6883
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6778
6884
|
}, [filters, onChange]);
|
|
6779
|
-
const handleResetFilters = (0,
|
|
6885
|
+
const handleResetFilters = (0, import_react71.useCallback)(() => {
|
|
6780
6886
|
setSearchTerm("");
|
|
6781
6887
|
if (onResetFilterValues) {
|
|
6782
6888
|
return onResetFilterValues();
|
|
@@ -6784,20 +6890,20 @@ var SearchAndFilterProvider = ({
|
|
|
6784
6890
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6785
6891
|
onChange(resetFilterValues);
|
|
6786
6892
|
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6787
|
-
const handleDeleteFilter = (0,
|
|
6893
|
+
const handleDeleteFilter = (0, import_react71.useCallback)(
|
|
6788
6894
|
(index) => {
|
|
6789
6895
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
6790
6896
|
onChange(remainingFilters);
|
|
6791
6897
|
},
|
|
6792
6898
|
[filters, onChange]
|
|
6793
6899
|
);
|
|
6794
|
-
const validFilterQuery = (0,
|
|
6900
|
+
const validFilterQuery = (0, import_react71.useMemo)(() => {
|
|
6795
6901
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6796
6902
|
if (hasValidFilters) {
|
|
6797
6903
|
return filters;
|
|
6798
6904
|
}
|
|
6799
6905
|
}, [filters]);
|
|
6800
|
-
(0,
|
|
6906
|
+
(0, import_react71.useEffect)(() => {
|
|
6801
6907
|
if (filterVisibility) {
|
|
6802
6908
|
const handleEscKeyFilterClose = (e) => {
|
|
6803
6909
|
if (e.key === "Escape") {
|
|
@@ -6835,7 +6941,7 @@ var SearchAndFilterProvider = ({
|
|
|
6835
6941
|
);
|
|
6836
6942
|
};
|
|
6837
6943
|
var useSearchAndFilter = () => {
|
|
6838
|
-
const value = (0,
|
|
6944
|
+
const value = (0, import_react71.useContext)(SearchAndFilterContext);
|
|
6839
6945
|
return { ...value };
|
|
6840
6946
|
};
|
|
6841
6947
|
|
|
@@ -6853,10 +6959,10 @@ var FilterControls = ({
|
|
|
6853
6959
|
searchTerm,
|
|
6854
6960
|
allowBindingSearchTerm
|
|
6855
6961
|
} = useSearchAndFilter();
|
|
6856
|
-
const editorRef = (0,
|
|
6962
|
+
const editorRef = (0, import_react72.useRef)(null);
|
|
6857
6963
|
const variableRefernceCountInSearchTerm = (0, import_canvas10.hasReferencedVariables)(searchTerm);
|
|
6858
|
-
const [idToResetInputVariables, setIdToResetInputVariables] = (0,
|
|
6859
|
-
const [localSearchTerm, setLocalSearchTerm] = (0,
|
|
6964
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react72.useState)("data-resource-search-term-input");
|
|
6965
|
+
const [localSearchTerm, setLocalSearchTerm] = (0, import_react72.useState)(searchTerm);
|
|
6860
6966
|
(0, import_react_use7.useDebounce)(
|
|
6861
6967
|
() => {
|
|
6862
6968
|
if (localSearchTerm !== searchTerm) {
|
|
@@ -6866,7 +6972,7 @@ var FilterControls = ({
|
|
|
6866
6972
|
300,
|
|
6867
6973
|
[localSearchTerm]
|
|
6868
6974
|
);
|
|
6869
|
-
(0,
|
|
6975
|
+
(0, import_react72.useEffect)(() => {
|
|
6870
6976
|
if (searchTerm === "") {
|
|
6871
6977
|
setLocalSearchTerm("");
|
|
6872
6978
|
setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid2.v4)()}`);
|
|
@@ -6941,7 +7047,7 @@ var FilterControls = ({
|
|
|
6941
7047
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6942
7048
|
var import_CgTrash2 = require("@react-icons/all-files/cg/CgTrash");
|
|
6943
7049
|
var import_design_system46 = require("@uniformdev/design-system");
|
|
6944
|
-
var
|
|
7050
|
+
var import_react73 = require("react");
|
|
6945
7051
|
|
|
6946
7052
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
6947
7053
|
function isFilterBindable(filter, operator) {
|
|
@@ -6969,7 +7075,7 @@ var FilterItem = ({
|
|
|
6969
7075
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
6970
7076
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
6971
7077
|
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,
|
|
7078
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react73.useMemo)(() => {
|
|
6973
7079
|
var _a2;
|
|
6974
7080
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
6975
7081
|
var _a3;
|
|
@@ -7137,7 +7243,7 @@ var import_design_system48 = require("@uniformdev/design-system");
|
|
|
7137
7243
|
|
|
7138
7244
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
7139
7245
|
var import_design_system47 = require("@uniformdev/design-system");
|
|
7140
|
-
var
|
|
7246
|
+
var import_react74 = __toESM(require("react"));
|
|
7141
7247
|
var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
|
|
7142
7248
|
var SearchAndFilterOptionsContainer2 = ({
|
|
7143
7249
|
buttonRow,
|
|
@@ -7169,8 +7275,8 @@ var FilterMenu = ({
|
|
|
7169
7275
|
resetButtonText = "reset"
|
|
7170
7276
|
}) => {
|
|
7171
7277
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
7172
|
-
const innerMenuRef =
|
|
7173
|
-
(0,
|
|
7278
|
+
const innerMenuRef = import_react74.default.useRef(null);
|
|
7279
|
+
(0, import_react74.useEffect)(() => {
|
|
7174
7280
|
var _a;
|
|
7175
7281
|
if (filterVisibility) {
|
|
7176
7282
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
@@ -7519,17 +7625,17 @@ var SearchAndFilter = ({
|
|
|
7519
7625
|
|
|
7520
7626
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
7521
7627
|
var import_design_system51 = require("@uniformdev/design-system");
|
|
7522
|
-
var
|
|
7628
|
+
var import_react75 = require("react");
|
|
7523
7629
|
var import_react_use8 = require("react-use");
|
|
7524
7630
|
var import_jsx_runtime81 = require("@emotion/react/jsx-runtime");
|
|
7525
|
-
var SearchOnlyContext = (0,
|
|
7631
|
+
var SearchOnlyContext = (0, import_react75.createContext)({
|
|
7526
7632
|
searchTerm: "",
|
|
7527
7633
|
setSearchTerm: () => {
|
|
7528
7634
|
}
|
|
7529
7635
|
});
|
|
7530
7636
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
7531
7637
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
7532
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
7638
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react75.useState)("");
|
|
7533
7639
|
(0, import_react_use8.useDebounce)(
|
|
7534
7640
|
() => {
|
|
7535
7641
|
setSearchTerm(localeSearchTerm);
|
|
@@ -7563,9 +7669,9 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7563
7669
|
var import_design_system53 = require("@uniformdev/design-system");
|
|
7564
7670
|
|
|
7565
7671
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
7566
|
-
var
|
|
7672
|
+
var import_react76 = require("@emotion/react");
|
|
7567
7673
|
var import_design_system52 = require("@uniformdev/design-system");
|
|
7568
|
-
var ConditionalFilterRow2 =
|
|
7674
|
+
var ConditionalFilterRow2 = import_react76.css`
|
|
7569
7675
|
display: grid;
|
|
7570
7676
|
grid-template-columns: 35px 1fr;
|
|
7571
7677
|
gap: var(--spacing-sm);
|
|
@@ -7602,7 +7708,7 @@ var ConditionalFilterRow2 = import_react74.css`
|
|
|
7602
7708
|
animation: ${import_design_system52.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
7603
7709
|
}
|
|
7604
7710
|
`;
|
|
7605
|
-
var ConditionalInputRow2 =
|
|
7711
|
+
var ConditionalInputRow2 = import_react76.css`
|
|
7606
7712
|
display: flex;
|
|
7607
7713
|
gap: var(--spacing-sm);
|
|
7608
7714
|
flex-wrap: wrap;
|
|
@@ -7625,13 +7731,13 @@ var ConditionalInputRow2 = import_react74.css`
|
|
|
7625
7731
|
}
|
|
7626
7732
|
}
|
|
7627
7733
|
`;
|
|
7628
|
-
var SearchInput2 =
|
|
7734
|
+
var SearchInput2 = import_react76.css`
|
|
7629
7735
|
&& {
|
|
7630
7736
|
max-height: 40px;
|
|
7631
7737
|
min-height: unset;
|
|
7632
7738
|
}
|
|
7633
7739
|
`;
|
|
7634
|
-
var FilterButton3 =
|
|
7740
|
+
var FilterButton3 = import_react76.css`
|
|
7635
7741
|
align-items: center;
|
|
7636
7742
|
background: var(--white);
|
|
7637
7743
|
border: 1px solid var(--gray-300);
|
|
@@ -7668,13 +7774,13 @@ var FilterButton3 = import_react74.css`
|
|
|
7668
7774
|
opacity: var(--opacity-50);
|
|
7669
7775
|
}
|
|
7670
7776
|
`;
|
|
7671
|
-
var FilterButtonText2 =
|
|
7777
|
+
var FilterButtonText2 = import_react76.css`
|
|
7672
7778
|
overflow: hidden;
|
|
7673
7779
|
text-overflow: ellipsis;
|
|
7674
7780
|
white-space: nowrap;
|
|
7675
7781
|
max-width: 14ch;
|
|
7676
7782
|
`;
|
|
7677
|
-
var FilterButtonSelected2 =
|
|
7783
|
+
var FilterButtonSelected2 = import_react76.css`
|
|
7678
7784
|
background: var(--gray-100);
|
|
7679
7785
|
border-color: var(--gray-300);
|
|
7680
7786
|
|
|
@@ -7682,7 +7788,7 @@ var FilterButtonSelected2 = import_react74.css`
|
|
|
7682
7788
|
color: var(--accent-dark);
|
|
7683
7789
|
}
|
|
7684
7790
|
`;
|
|
7685
|
-
var FilterButtonWithOptions2 =
|
|
7791
|
+
var FilterButtonWithOptions2 = import_react76.css`
|
|
7686
7792
|
:where([aria-expanded='true']) {
|
|
7687
7793
|
background: var(--purple-rain-100);
|
|
7688
7794
|
border-color: var(--accent-light);
|
|
@@ -7694,14 +7800,14 @@ var FilterButtonWithOptions2 = import_react74.css`
|
|
|
7694
7800
|
}
|
|
7695
7801
|
}
|
|
7696
7802
|
`;
|
|
7697
|
-
var SearchIcon2 =
|
|
7803
|
+
var SearchIcon2 = import_react76.css`
|
|
7698
7804
|
color: var(--icon-color);
|
|
7699
7805
|
position: absolute;
|
|
7700
7806
|
inset: 0 var(--spacing-base) 0 auto;
|
|
7701
7807
|
margin: auto;
|
|
7702
7808
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7703
7809
|
`;
|
|
7704
|
-
var AddConditionalBtn2 =
|
|
7810
|
+
var AddConditionalBtn2 = import_react76.css`
|
|
7705
7811
|
align-items: center;
|
|
7706
7812
|
background: transparent;
|
|
7707
7813
|
border: none;
|
|
@@ -7720,14 +7826,14 @@ var AddConditionalBtn2 = import_react74.css`
|
|
|
7720
7826
|
color: var(--gray-400);
|
|
7721
7827
|
}
|
|
7722
7828
|
`;
|
|
7723
|
-
var Title2 =
|
|
7829
|
+
var Title2 = import_react76.css`
|
|
7724
7830
|
color: var(--typography-light);
|
|
7725
7831
|
|
|
7726
7832
|
&:focus {
|
|
7727
7833
|
outline: none;
|
|
7728
7834
|
}
|
|
7729
7835
|
`;
|
|
7730
|
-
var ResetConditionsBtn2 =
|
|
7836
|
+
var ResetConditionsBtn2 = import_react76.css`
|
|
7731
7837
|
background: transparent;
|
|
7732
7838
|
border: none;
|
|
7733
7839
|
color: var(--action-destructive-default);
|
|
@@ -7739,12 +7845,12 @@ var ResetConditionsBtn2 = import_react74.css`
|
|
|
7739
7845
|
color: var(--action-destructive-hover);
|
|
7740
7846
|
}
|
|
7741
7847
|
`;
|
|
7742
|
-
var IconBtn2 =
|
|
7848
|
+
var IconBtn2 = import_react76.css`
|
|
7743
7849
|
background: transparent;
|
|
7744
7850
|
border: none;
|
|
7745
7851
|
padding: var(--spacing-sm);
|
|
7746
7852
|
`;
|
|
7747
|
-
var SearchAndFilterOptionsContainer3 =
|
|
7853
|
+
var SearchAndFilterOptionsContainer3 = import_react76.css`
|
|
7748
7854
|
background: var(--gray-50);
|
|
7749
7855
|
border: 1px solid var(--gray-300);
|
|
7750
7856
|
border-radius: var(--rounded-base);
|
|
@@ -7757,17 +7863,17 @@ var SearchAndFilterOptionsContainer3 = import_react74.css`
|
|
|
7757
7863
|
position: relative;
|
|
7758
7864
|
z-index: 1;
|
|
7759
7865
|
`;
|
|
7760
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
7866
|
+
var SearchAndFilterOptionsInnerContainer2 = import_react76.css`
|
|
7761
7867
|
display: flex;
|
|
7762
7868
|
flex-direction: column;
|
|
7763
7869
|
gap: var(--spacing-sm);
|
|
7764
7870
|
padding-inline: var(--spacing-md);
|
|
7765
7871
|
`;
|
|
7766
|
-
var SearchAndFilterButtonGroup2 =
|
|
7872
|
+
var SearchAndFilterButtonGroup2 = import_react76.css`
|
|
7767
7873
|
margin-top: var(--spacing-xs);
|
|
7768
7874
|
margin-left: calc(56px + var(--spacing-md));
|
|
7769
7875
|
`;
|
|
7770
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
7876
|
+
var SortFilterWrapper = (hiddenLocaleInput) => import_react76.css`
|
|
7771
7877
|
align-items: center;
|
|
7772
7878
|
display: flex;
|
|
7773
7879
|
gap: var(--spacing-base);
|
|
@@ -7778,13 +7884,13 @@ var SortFilterWrapper = (hiddenLocaleInput) => import_react74.css`
|
|
|
7778
7884
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
7779
7885
|
}
|
|
7780
7886
|
`;
|
|
7781
|
-
var SortFilterInputRow =
|
|
7887
|
+
var SortFilterInputRow = import_react76.css`
|
|
7782
7888
|
align-items: center;
|
|
7783
7889
|
display: grid;
|
|
7784
7890
|
grid-template-columns: 1fr auto;
|
|
7785
7891
|
gap: var(--spacing-base);
|
|
7786
7892
|
`;
|
|
7787
|
-
var InputVariableWrapper =
|
|
7893
|
+
var InputVariableWrapper = import_react76.css`
|
|
7788
7894
|
flex-grow: 1;
|
|
7789
7895
|
|
|
7790
7896
|
// we need to override label styles nested within the input variable
|
|
@@ -7930,7 +8036,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7930
8036
|
|
|
7931
8037
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7932
8038
|
var import_canvas12 = require("@uniformdev/canvas");
|
|
7933
|
-
var
|
|
8039
|
+
var import_react77 = require("react");
|
|
7934
8040
|
function useContentDataResourceLocaleInfo({
|
|
7935
8041
|
locale,
|
|
7936
8042
|
defaultLocale,
|
|
@@ -7938,12 +8044,12 @@ function useContentDataResourceLocaleInfo({
|
|
|
7938
8044
|
dynamicInputs
|
|
7939
8045
|
}) {
|
|
7940
8046
|
var _a;
|
|
7941
|
-
const setLocaleRef = (0,
|
|
8047
|
+
const setLocaleRef = (0, import_react77.useRef)(setLocale);
|
|
7942
8048
|
setLocaleRef.current = setLocale;
|
|
7943
8049
|
const { flatVariables } = useVariables();
|
|
7944
8050
|
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
8051
|
const boundLocale = (_a = (0, import_canvas12.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7946
|
-
(0,
|
|
8052
|
+
(0, import_react77.useEffect)(() => {
|
|
7947
8053
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7948
8054
|
setLocaleRef.current(effectiveLocale);
|
|
7949
8055
|
}
|
|
@@ -7975,6 +8081,7 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7975
8081
|
DateEditor,
|
|
7976
8082
|
DateRangeEditor,
|
|
7977
8083
|
DelegationContext,
|
|
8084
|
+
DelegationDisabledError,
|
|
7978
8085
|
DelegationGate,
|
|
7979
8086
|
DelegationProvider,
|
|
7980
8087
|
DrawerContent,
|
|
@@ -8078,8 +8185,10 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
8078
8185
|
VariablesProvider,
|
|
8079
8186
|
bindableFiltersMapper,
|
|
8080
8187
|
convertConnectedDataToVariable,
|
|
8188
|
+
createDelegationFetch,
|
|
8081
8189
|
createLocationValidator,
|
|
8082
8190
|
filterMapper,
|
|
8191
|
+
isDelegationExpiredResponse,
|
|
8083
8192
|
prettifyBindExpression,
|
|
8084
8193
|
readOnlyAttributes,
|
|
8085
8194
|
serializeVariablesEditorSerializedState,
|
|
@@ -8090,6 +8199,7 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
8090
8199
|
useConnectedDataAsVariables,
|
|
8091
8200
|
useContentDataResourceLocaleInfo,
|
|
8092
8201
|
useDelegation,
|
|
8202
|
+
useDelegationFetch,
|
|
8093
8203
|
useDynamicInputsAsVariables,
|
|
8094
8204
|
useMeshLocation,
|
|
8095
8205
|
useObjectSearchContext,
|