@uniformdev/mesh-sdk-react 20.72.4-alpha.11 → 20.72.4-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -66
- package/dist/index.d.ts +4 -66
- package/dist/index.esm.js +85 -153
- package/dist/index.js +351 -423
- package/dist/index.mjs +85 -153
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -249,40 +249,6 @@ var SvgPlus = (props) => /* @__PURE__ */ jsx14(
|
|
|
249
249
|
);
|
|
250
250
|
var Plus_default = SvgPlus;
|
|
251
251
|
|
|
252
|
-
// src/hooks/createDelegationFetch.ts
|
|
253
|
-
import { CSRF_HEADER_NAME, CSRF_HEADER_VALUE, DELEGATION_EXPIRED_CODE } from "@uniformdev/mesh-sdk";
|
|
254
|
-
async function isDelegationExpiredResponse(response) {
|
|
255
|
-
if (response.status !== 401) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
try {
|
|
259
|
-
const body = await response.clone().json();
|
|
260
|
-
return typeof body.code === "string" && body.code === DELEGATION_EXPIRED_CODE;
|
|
261
|
-
} catch (e) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function createDelegationFetch(options) {
|
|
266
|
-
var _a, _b;
|
|
267
|
-
const fetchFn = (_a = options.fetch) != null ? _a : fetch;
|
|
268
|
-
const isExpired = (_b = options.isDelegationExpired) != null ? _b : isDelegationExpiredResponse;
|
|
269
|
-
return async (input3, init) => {
|
|
270
|
-
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
271
|
-
headers.set(CSRF_HEADER_NAME, CSRF_HEADER_VALUE);
|
|
272
|
-
const initWithCsrf = { ...init, headers };
|
|
273
|
-
const response = await fetchFn(input3, initWithCsrf);
|
|
274
|
-
if (!await isExpired(response)) {
|
|
275
|
-
return response;
|
|
276
|
-
}
|
|
277
|
-
try {
|
|
278
|
-
await options.reacquire();
|
|
279
|
-
} catch (e) {
|
|
280
|
-
return response;
|
|
281
|
-
}
|
|
282
|
-
return fetchFn(input3, initWithCsrf);
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
252
|
// src/hooks/useConnectedDataAsVariables.tsx
|
|
287
253
|
import { useMemo } from "react";
|
|
288
254
|
function useConnectedDataAsVariables(connectedData) {
|
|
@@ -317,28 +283,12 @@ function useDelegation() {
|
|
|
317
283
|
return ctx;
|
|
318
284
|
}
|
|
319
285
|
|
|
320
|
-
// src/hooks/useDelegationFetch.ts
|
|
321
|
-
import { useMemo as useMemo2 } from "react";
|
|
322
|
-
function useDelegationFetch(options) {
|
|
323
|
-
const { reacquire } = useDelegation();
|
|
324
|
-
const fetchImpl = options == null ? void 0 : options.fetch;
|
|
325
|
-
const isDelegationExpired = options == null ? void 0 : options.isDelegationExpired;
|
|
326
|
-
return useMemo2(
|
|
327
|
-
() => createDelegationFetch({
|
|
328
|
-
reacquire,
|
|
329
|
-
fetch: fetchImpl,
|
|
330
|
-
isDelegationExpired
|
|
331
|
-
}),
|
|
332
|
-
[reacquire, fetchImpl, isDelegationExpired]
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
286
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
337
287
|
import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
|
|
338
|
-
import { useMemo as
|
|
288
|
+
import { useMemo as useMemo2 } from "react";
|
|
339
289
|
import { Fragment, jsx as jsx15 } from "@emotion/react/jsx-runtime";
|
|
340
290
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
341
|
-
return
|
|
291
|
+
return useMemo2(() => {
|
|
342
292
|
const result = Object.entries(dynamicInputs).reduce(
|
|
343
293
|
(acc, [name2, input3]) => {
|
|
344
294
|
const source = `from ${name2 === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
@@ -373,10 +323,10 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
373
323
|
}
|
|
374
324
|
|
|
375
325
|
// src/hooks/useMeshLocation.ts
|
|
376
|
-
import { useMemo as
|
|
326
|
+
import { useMemo as useMemo4, useRef } from "react";
|
|
377
327
|
|
|
378
328
|
// src/components/UniformMeshLocationContext.tsx
|
|
379
|
-
import { createContext as createContext3, useContext as useContext3, useMemo as
|
|
329
|
+
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo3, useState } from "react";
|
|
380
330
|
|
|
381
331
|
// src/components/UniformMeshSdkContext.tsx
|
|
382
332
|
import { Theme } from "@uniformdev/design-system";
|
|
@@ -405,7 +355,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
405
355
|
}) => {
|
|
406
356
|
const sdk = useUniformMeshSdk();
|
|
407
357
|
const [location, setLocation] = useState(sdk.getCurrentLocation());
|
|
408
|
-
|
|
358
|
+
useMemo3(() => {
|
|
409
359
|
const valueChangeListener = (event) => {
|
|
410
360
|
setLocation((old) => ({ ...old, value: event.newValue }));
|
|
411
361
|
};
|
|
@@ -437,7 +387,7 @@ function useMeshLocation(expectedLocation) {
|
|
|
437
387
|
}
|
|
438
388
|
const backdoorLocation = useRef(location);
|
|
439
389
|
backdoorLocation.current = location;
|
|
440
|
-
const stabilizedSetValueProxy =
|
|
390
|
+
const stabilizedSetValueProxy = useMemo4(
|
|
441
391
|
() => (dispatch) => {
|
|
442
392
|
const { newValue, options } = dispatch(backdoorLocation.current.value);
|
|
443
393
|
backdoorLocation.current.setValue(newValue, options);
|
|
@@ -754,7 +704,7 @@ import {
|
|
|
754
704
|
createCommand,
|
|
755
705
|
SKIP_DOM_SELECTION_TAG
|
|
756
706
|
} from "lexical";
|
|
757
|
-
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as
|
|
707
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo6, useRef as useRef3, useState as useState4 } from "react";
|
|
758
708
|
import { createPortal } from "react-dom";
|
|
759
709
|
|
|
760
710
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
@@ -788,7 +738,7 @@ var variablesTipText = css`
|
|
|
788
738
|
|
|
789
739
|
// src/components/Variables/VariablesProvider.tsx
|
|
790
740
|
import mitt from "mitt";
|
|
791
|
-
import { createContext as createContext4, useContext as useContext4, useEffect as useEffect3, useMemo as
|
|
741
|
+
import { createContext as createContext4, useContext as useContext4, useEffect as useEffect3, useMemo as useMemo5, useState as useState3 } from "react";
|
|
792
742
|
|
|
793
743
|
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
794
744
|
import { useCallback, useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -990,7 +940,7 @@ function VariablesProvider({
|
|
|
990
940
|
}) {
|
|
991
941
|
const [editing, setEditing] = useState3();
|
|
992
942
|
const [editingContext, setEditingContext] = useState3();
|
|
993
|
-
const events =
|
|
943
|
+
const events = useMemo5(
|
|
994
944
|
() => mitt(),
|
|
995
945
|
[]
|
|
996
946
|
);
|
|
@@ -998,7 +948,7 @@ function VariablesProvider({
|
|
|
998
948
|
throw new Error("onChange must be provided when readOnly is false");
|
|
999
949
|
}
|
|
1000
950
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
1001
|
-
const valueBasedContextValue =
|
|
951
|
+
const valueBasedContextValue = useMemo5(
|
|
1002
952
|
() => ({
|
|
1003
953
|
flatVariables: flattenVariables(value),
|
|
1004
954
|
dispatch: (event) => {
|
|
@@ -1042,7 +992,7 @@ function VariablesProvider({
|
|
|
1042
992
|
isEditing: typeof editing !== "undefined",
|
|
1043
993
|
variables: value
|
|
1044
994
|
});
|
|
1045
|
-
const contextValue =
|
|
995
|
+
const contextValue = useMemo5(() => {
|
|
1046
996
|
return {
|
|
1047
997
|
...valueBasedContextValue,
|
|
1048
998
|
editVariableTxn,
|
|
@@ -1250,7 +1200,7 @@ function useVariablesMenu({
|
|
|
1250
1200
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1251
1201
|
);
|
|
1252
1202
|
const canAddVariable = canDispatch && showAddVariableMenuOption && !readOnly;
|
|
1253
|
-
const { groupedVariables, menuOptions } =
|
|
1203
|
+
const { groupedVariables, menuOptions } = useMemo6(() => {
|
|
1254
1204
|
const groupedVariables2 = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
1255
1205
|
if (canAddVariable) {
|
|
1256
1206
|
groupedVariables2.unshift({
|
|
@@ -1337,7 +1287,7 @@ function VariablesPlugin({
|
|
|
1337
1287
|
filterVariable,
|
|
1338
1288
|
getEditorContext
|
|
1339
1289
|
});
|
|
1340
|
-
const { filteredGroupedVariables, filteredMenuOptions } =
|
|
1290
|
+
const { filteredGroupedVariables, filteredMenuOptions } = useMemo6(() => {
|
|
1341
1291
|
if (!queryString) {
|
|
1342
1292
|
return {
|
|
1343
1293
|
filteredGroupedVariables: groupedVariables,
|
|
@@ -2117,7 +2067,7 @@ var inputMultiLine = (lines) => css5`
|
|
|
2117
2067
|
|
|
2118
2068
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
2119
2069
|
import { hasReferencedVariables } from "@uniformdev/canvas";
|
|
2120
|
-
import { useEffect as useEffect7, useMemo as
|
|
2070
|
+
import { useEffect as useEffect7, useMemo as useMemo7, useState as useState5 } from "react";
|
|
2121
2071
|
function useInputVariablesState({
|
|
2122
2072
|
value,
|
|
2123
2073
|
onChange,
|
|
@@ -2149,7 +2099,7 @@ function useInputVariablesState({
|
|
|
2149
2099
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
|
|
2150
2100
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
2151
2101
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
2152
|
-
const sharedMenuProps =
|
|
2102
|
+
const sharedMenuProps = useMemo7(
|
|
2153
2103
|
() => ({
|
|
2154
2104
|
menuTooltip,
|
|
2155
2105
|
showAddVariableMenuOption,
|
|
@@ -2347,7 +2297,7 @@ import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
|
2347
2297
|
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
|
|
2348
2298
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
2349
2299
|
import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
|
|
2350
|
-
import { useMemo as
|
|
2300
|
+
import { useMemo as useMemo8, useRef as useRef5, useState as useState6 } from "react";
|
|
2351
2301
|
|
|
2352
2302
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
2353
2303
|
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
@@ -2388,7 +2338,7 @@ function VariablesComposer(props) {
|
|
|
2388
2338
|
...variablesPluginProps
|
|
2389
2339
|
} = props;
|
|
2390
2340
|
const [lastEmittedValue, setLastEmittedValue] = useState6(value);
|
|
2391
|
-
const editorConfig =
|
|
2341
|
+
const editorConfig = useMemo8(
|
|
2392
2342
|
() => ({
|
|
2393
2343
|
namespace: "uniform",
|
|
2394
2344
|
onError(error) {
|
|
@@ -2732,7 +2682,7 @@ function InputVariablesOverlayMenu({
|
|
|
2732
2682
|
import { CgUsbC as CgUsbC2 } from "@react-icons/all-files/cg/CgUsbC";
|
|
2733
2683
|
import { bindVariablesToObject } from "@uniformdev/canvas";
|
|
2734
2684
|
import { HorizontalRhythm as HorizontalRhythm5, Menu as Menu2 } from "@uniformdev/design-system";
|
|
2735
|
-
import { useMemo as
|
|
2685
|
+
import { useMemo as useMemo9 } from "react";
|
|
2736
2686
|
import { jsx as jsx29, jsxs as jsxs13 } from "@emotion/react/jsx-runtime";
|
|
2737
2687
|
function ParameterConnectionIndicator({
|
|
2738
2688
|
children,
|
|
@@ -2743,7 +2693,7 @@ function ParameterConnectionIndicator({
|
|
|
2743
2693
|
overrideMenuButtonParentMargin,
|
|
2744
2694
|
renderMenuInPortal = false
|
|
2745
2695
|
}) {
|
|
2746
|
-
const hasVariablesInValue =
|
|
2696
|
+
const hasVariablesInValue = useMemo9(() => {
|
|
2747
2697
|
let result = false;
|
|
2748
2698
|
bindVariablesToObject({
|
|
2749
2699
|
value,
|
|
@@ -3715,7 +3665,7 @@ function RequestParameters({
|
|
|
3715
3665
|
|
|
3716
3666
|
// src/components/Request/RequestUrl.tsx
|
|
3717
3667
|
import { css as css13 } from "@emotion/react";
|
|
3718
|
-
import { useMemo as
|
|
3668
|
+
import { useMemo as useMemo11 } from "react";
|
|
3719
3669
|
|
|
3720
3670
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
3721
3671
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -3741,7 +3691,7 @@ function RequestUrl() {
|
|
|
3741
3691
|
var _a, _b;
|
|
3742
3692
|
const { variables } = useVariables();
|
|
3743
3693
|
const { request } = useRequest();
|
|
3744
|
-
const mergedParameters =
|
|
3694
|
+
const mergedParameters = useMemo11(() => {
|
|
3745
3695
|
var _a2;
|
|
3746
3696
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
3747
3697
|
return request.parameters;
|
|
@@ -4039,14 +3989,8 @@ function DelegationGate({
|
|
|
4039
3989
|
}
|
|
4040
3990
|
|
|
4041
3991
|
// src/components/Delegation/DelegationProvider.tsx
|
|
4042
|
-
import { useCallback as useCallback5, useEffect as useEffect13, useMemo as
|
|
3992
|
+
import { useCallback as useCallback5, useEffect as useEffect13, useMemo as useMemo12, useRef as useRef7, useState as useState11 } from "react";
|
|
4043
3993
|
import { jsx as jsx47 } from "@emotion/react/jsx-runtime";
|
|
4044
|
-
var DelegationDisabledError = class extends Error {
|
|
4045
|
-
constructor() {
|
|
4046
|
-
super("Identity delegation is not enabled for this integration.");
|
|
4047
|
-
this.name = "DelegationDisabledError";
|
|
4048
|
-
}
|
|
4049
|
-
};
|
|
4050
3994
|
var DEFAULT_REVALIDATE_AFTER_MS = 5 * 60 * 1e3;
|
|
4051
3995
|
function DelegationProvider({
|
|
4052
3996
|
sdk,
|
|
@@ -4058,68 +4002,58 @@ function DelegationProvider({
|
|
|
4058
4002
|
}) {
|
|
4059
4003
|
const [status, setStatus] = useState11("idle");
|
|
4060
4004
|
const [error, setError] = useState11(null);
|
|
4005
|
+
const acquiringRef = useRef7(false);
|
|
4061
4006
|
const mountedRef = useRef7(true);
|
|
4062
4007
|
const statusRef = useRef7("idle");
|
|
4063
4008
|
statusRef.current = status;
|
|
4064
|
-
const
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
try {
|
|
4075
|
-
const isActive = await checkActive();
|
|
4076
|
-
if (isActive) {
|
|
4077
|
-
if (mountedRef.current) {
|
|
4078
|
-
setStatus("active");
|
|
4079
|
-
}
|
|
4080
|
-
return;
|
|
4081
|
-
}
|
|
4082
|
-
if (!mountedRef.current) {
|
|
4083
|
-
return;
|
|
4084
|
-
}
|
|
4085
|
-
const sessionToken = await sdk.getSessionToken();
|
|
4086
|
-
if (!mountedRef.current) {
|
|
4087
|
-
return;
|
|
4088
|
-
}
|
|
4089
|
-
if (!sessionToken) {
|
|
4090
|
-
if (mountedRef.current) {
|
|
4091
|
-
setStatus("disabled");
|
|
4092
|
-
}
|
|
4093
|
-
throw new DelegationDisabledError();
|
|
4094
|
-
}
|
|
4095
|
-
await onSessionToken(sessionToken);
|
|
4009
|
+
const acquire = useCallback5(async () => {
|
|
4010
|
+
if (acquiringRef.current) {
|
|
4011
|
+
return;
|
|
4012
|
+
}
|
|
4013
|
+
acquiringRef.current = true;
|
|
4014
|
+
setStatus("acquiring");
|
|
4015
|
+
setError(null);
|
|
4016
|
+
try {
|
|
4017
|
+
const isActive = await checkActive();
|
|
4018
|
+
if (isActive) {
|
|
4096
4019
|
if (mountedRef.current) {
|
|
4097
4020
|
setStatus("active");
|
|
4098
4021
|
}
|
|
4099
|
-
|
|
4100
|
-
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
4101
|
-
if (mountedRef.current && !(err instanceof DelegationDisabledError)) {
|
|
4102
|
-
setError(error2);
|
|
4103
|
-
setStatus("error");
|
|
4104
|
-
}
|
|
4105
|
-
throw error2;
|
|
4022
|
+
return;
|
|
4106
4023
|
}
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4024
|
+
if (!mountedRef.current) {
|
|
4025
|
+
return;
|
|
4026
|
+
}
|
|
4027
|
+
const sessionToken = await sdk.getSessionToken();
|
|
4028
|
+
if (!mountedRef.current) {
|
|
4029
|
+
return;
|
|
4030
|
+
}
|
|
4031
|
+
if (!sessionToken) {
|
|
4032
|
+
setStatus("disabled");
|
|
4033
|
+
return;
|
|
4034
|
+
}
|
|
4035
|
+
await onSessionToken(sessionToken);
|
|
4036
|
+
if (mountedRef.current) {
|
|
4037
|
+
setStatus("active");
|
|
4038
|
+
}
|
|
4039
|
+
} catch (err) {
|
|
4040
|
+
if (mountedRef.current) {
|
|
4041
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
4042
|
+
setStatus("error");
|
|
4043
|
+
}
|
|
4044
|
+
} finally {
|
|
4045
|
+
acquiringRef.current = false;
|
|
4046
|
+
}
|
|
4112
4047
|
}, [sdk, onSessionToken, checkActive]);
|
|
4113
4048
|
useEffect13(() => {
|
|
4114
4049
|
mountedRef.current = true;
|
|
4115
|
-
void acquire()
|
|
4116
|
-
});
|
|
4050
|
+
void acquire();
|
|
4117
4051
|
return () => {
|
|
4118
4052
|
mountedRef.current = false;
|
|
4119
4053
|
};
|
|
4120
4054
|
}, [acquire]);
|
|
4121
4055
|
const revalidate = useCallback5(async () => {
|
|
4122
|
-
if (
|
|
4056
|
+
if (acquiringRef.current) {
|
|
4123
4057
|
return;
|
|
4124
4058
|
}
|
|
4125
4059
|
if (statusRef.current !== "active") {
|
|
@@ -4131,8 +4065,7 @@ function DelegationProvider({
|
|
|
4131
4065
|
return;
|
|
4132
4066
|
}
|
|
4133
4067
|
if (!isActive) {
|
|
4134
|
-
void acquire()
|
|
4135
|
-
});
|
|
4068
|
+
void acquire();
|
|
4136
4069
|
}
|
|
4137
4070
|
} catch (e) {
|
|
4138
4071
|
}
|
|
@@ -4163,7 +4096,10 @@ function DelegationProvider({
|
|
|
4163
4096
|
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
4164
4097
|
};
|
|
4165
4098
|
}, [revalidateOnFocus, revalidateAfterMs, revalidate]);
|
|
4166
|
-
const
|
|
4099
|
+
const reacquire = useCallback5(() => {
|
|
4100
|
+
void acquire();
|
|
4101
|
+
}, [acquire]);
|
|
4102
|
+
const value = useMemo12(() => ({ status, error, reacquire }), [status, error, reacquire]);
|
|
4167
4103
|
return /* @__PURE__ */ jsx47(DelegationContext.Provider, { value, children });
|
|
4168
4104
|
}
|
|
4169
4105
|
|
|
@@ -4269,7 +4205,7 @@ import {
|
|
|
4269
4205
|
useCallback as useCallback6,
|
|
4270
4206
|
useContext as useContext6,
|
|
4271
4207
|
useDeferredValue,
|
|
4272
|
-
useMemo as
|
|
4208
|
+
useMemo as useMemo13,
|
|
4273
4209
|
useState as useState13
|
|
4274
4210
|
} from "react";
|
|
4275
4211
|
import { jsx as jsx50 } from "@emotion/react/jsx-runtime";
|
|
@@ -4338,8 +4274,8 @@ var ObjectSearchProvider = ({
|
|
|
4338
4274
|
},
|
|
4339
4275
|
[setList]
|
|
4340
4276
|
);
|
|
4341
|
-
const boundQuery =
|
|
4342
|
-
const value =
|
|
4277
|
+
const boundQuery = useMemo13(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4278
|
+
const value = useMemo13(
|
|
4343
4279
|
() => ({
|
|
4344
4280
|
boundQuery,
|
|
4345
4281
|
onSetQuery,
|
|
@@ -4618,7 +4554,7 @@ var DefaultResultList = () => {
|
|
|
4618
4554
|
|
|
4619
4555
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4620
4556
|
import { DebouncedInputKeywordSearch, InputSelect as InputSelect3 } from "@uniformdev/design-system";
|
|
4621
|
-
import { useMemo as
|
|
4557
|
+
import { useMemo as useMemo14, useState as useState14 } from "react";
|
|
4622
4558
|
|
|
4623
4559
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4624
4560
|
import { css as css18 } from "@emotion/react";
|
|
@@ -4662,7 +4598,7 @@ var ObjectSearchFilter = ({
|
|
|
4662
4598
|
});
|
|
4663
4599
|
onSetQuery({ ...query, ...value });
|
|
4664
4600
|
};
|
|
4665
|
-
const memoizedSelectOptions =
|
|
4601
|
+
const memoizedSelectOptions = useMemo14(() => {
|
|
4666
4602
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4667
4603
|
return [];
|
|
4668
4604
|
}
|
|
@@ -5240,7 +5176,7 @@ var QueryFilter = ({
|
|
|
5240
5176
|
};
|
|
5241
5177
|
|
|
5242
5178
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
5243
|
-
import { useEffect as useEffect16, useMemo as
|
|
5179
|
+
import { useEffect as useEffect16, useMemo as useMemo15, useRef as useRef9 } from "react";
|
|
5244
5180
|
import { jsx as jsx60 } from "@emotion/react/jsx-runtime";
|
|
5245
5181
|
function ParamTypeDynamicDataProvider(props) {
|
|
5246
5182
|
const { children } = props;
|
|
@@ -5249,7 +5185,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
5249
5185
|
} = useMeshLocation("paramType");
|
|
5250
5186
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5251
5187
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
5252
|
-
const variables =
|
|
5188
|
+
const variables = useMemo15(
|
|
5253
5189
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
5254
5190
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
5255
5191
|
);
|
|
@@ -5890,7 +5826,7 @@ import {
|
|
|
5890
5826
|
getComboBoxSelectedSelectableGroups,
|
|
5891
5827
|
InputComboBox
|
|
5892
5828
|
} from "@uniformdev/design-system";
|
|
5893
|
-
import { useMemo as
|
|
5829
|
+
import { useMemo as useMemo16 } from "react";
|
|
5894
5830
|
|
|
5895
5831
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5896
5832
|
var readOnlyAttributes = {
|
|
@@ -5911,7 +5847,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
5911
5847
|
}) => {
|
|
5912
5848
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5913
5849
|
const isClearable = !readOnly || !disabled;
|
|
5914
|
-
const { groupedOptions, selectedOptions } =
|
|
5850
|
+
const { groupedOptions, selectedOptions } = useMemo16(
|
|
5915
5851
|
() => convertComboBoxGroupsToSelectableGroups({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5916
5852
|
[options, value]
|
|
5917
5853
|
);
|
|
@@ -5948,7 +5884,7 @@ import {
|
|
|
5948
5884
|
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups2,
|
|
5949
5885
|
InputComboBox as InputComboBox2
|
|
5950
5886
|
} from "@uniformdev/design-system";
|
|
5951
|
-
import { useMemo as
|
|
5887
|
+
import { useMemo as useMemo17 } from "react";
|
|
5952
5888
|
import { jsx as jsx65 } from "@emotion/react/jsx-runtime";
|
|
5953
5889
|
var FilterSingleChoiceEditor = ({
|
|
5954
5890
|
options,
|
|
@@ -5959,7 +5895,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
5959
5895
|
valueTestId
|
|
5960
5896
|
}) => {
|
|
5961
5897
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5962
|
-
const { groupedOptions, selectedOptions } =
|
|
5898
|
+
const { groupedOptions, selectedOptions } = useMemo17(
|
|
5963
5899
|
() => convertComboBoxGroupsToSelectableGroups2({
|
|
5964
5900
|
options: options != null ? options : [],
|
|
5965
5901
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
@@ -6120,7 +6056,7 @@ import {
|
|
|
6120
6056
|
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups2,
|
|
6121
6057
|
InputComboBox as InputComboBox3
|
|
6122
6058
|
} from "@uniformdev/design-system";
|
|
6123
|
-
import { useMemo as
|
|
6059
|
+
import { useMemo as useMemo18 } from "react";
|
|
6124
6060
|
|
|
6125
6061
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
6126
6062
|
import { StatusBullet } from "@uniformdev/design-system";
|
|
@@ -6146,7 +6082,7 @@ var StatusMultiEditor = ({
|
|
|
6146
6082
|
valueTestId
|
|
6147
6083
|
}) => {
|
|
6148
6084
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6149
|
-
const { groupedOptions, selectedOptions } =
|
|
6085
|
+
const { groupedOptions, selectedOptions } = useMemo18(
|
|
6150
6086
|
() => convertComboBoxGroupsToSelectableGroups3({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
6151
6087
|
[options, value]
|
|
6152
6088
|
);
|
|
@@ -6181,7 +6117,7 @@ import {
|
|
|
6181
6117
|
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups4,
|
|
6182
6118
|
InputComboBox as InputComboBox4
|
|
6183
6119
|
} from "@uniformdev/design-system";
|
|
6184
|
-
import { useMemo as
|
|
6120
|
+
import { useMemo as useMemo19 } from "react";
|
|
6185
6121
|
import { jsx as jsx70 } from "@emotion/react/jsx-runtime";
|
|
6186
6122
|
var StatusSingleEditor = ({
|
|
6187
6123
|
options,
|
|
@@ -6192,7 +6128,7 @@ var StatusSingleEditor = ({
|
|
|
6192
6128
|
valueTestId
|
|
6193
6129
|
}) => {
|
|
6194
6130
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6195
|
-
const { groupedOptions, selectedOptions } =
|
|
6131
|
+
const { groupedOptions, selectedOptions } = useMemo19(
|
|
6196
6132
|
() => convertComboBoxGroupsToSelectableGroups4({
|
|
6197
6133
|
options: options != null ? options : [],
|
|
6198
6134
|
selectedItems: new Set(value ? [value] : void 0),
|
|
@@ -6261,7 +6197,7 @@ import {
|
|
|
6261
6197
|
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups3,
|
|
6262
6198
|
InputCreatableComboBox
|
|
6263
6199
|
} from "@uniformdev/design-system";
|
|
6264
|
-
import { useMemo as
|
|
6200
|
+
import { useMemo as useMemo20 } from "react";
|
|
6265
6201
|
import { jsx as jsx72 } from "@emotion/react/jsx-runtime";
|
|
6266
6202
|
var TextMultiChoiceEditor = ({
|
|
6267
6203
|
value,
|
|
@@ -6272,7 +6208,7 @@ var TextMultiChoiceEditor = ({
|
|
|
6272
6208
|
}) => {
|
|
6273
6209
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6274
6210
|
const isClearable = !readOnly || !disabled;
|
|
6275
|
-
const { groupedOptions, selectedOptions } =
|
|
6211
|
+
const { groupedOptions, selectedOptions } = useMemo20(() => {
|
|
6276
6212
|
var _a;
|
|
6277
6213
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
6278
6214
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
@@ -6636,7 +6572,7 @@ import {
|
|
|
6636
6572
|
useContext as useContext7,
|
|
6637
6573
|
useDeferredValue as useDeferredValue2,
|
|
6638
6574
|
useEffect as useEffect19,
|
|
6639
|
-
useMemo as
|
|
6575
|
+
useMemo as useMemo21,
|
|
6640
6576
|
useState as useState21
|
|
6641
6577
|
} from "react";
|
|
6642
6578
|
|
|
@@ -6790,7 +6726,7 @@ var SearchAndFilterProvider = ({
|
|
|
6790
6726
|
},
|
|
6791
6727
|
[filters, onChange]
|
|
6792
6728
|
);
|
|
6793
|
-
const validFilterQuery =
|
|
6729
|
+
const validFilterQuery = useMemo21(() => {
|
|
6794
6730
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6795
6731
|
if (hasValidFilters) {
|
|
6796
6732
|
return filters;
|
|
@@ -6946,7 +6882,7 @@ import {
|
|
|
6946
6882
|
Menu as Menu3,
|
|
6947
6883
|
SelectableMenuItem
|
|
6948
6884
|
} from "@uniformdev/design-system";
|
|
6949
|
-
import { useMemo as
|
|
6885
|
+
import { useMemo as useMemo22 } from "react";
|
|
6950
6886
|
|
|
6951
6887
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
6952
6888
|
function isFilterBindable(filter, operator) {
|
|
@@ -6974,7 +6910,7 @@ var FilterItem = ({
|
|
|
6974
6910
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
6975
6911
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
6976
6912
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
6977
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } =
|
|
6913
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = useMemo22(() => {
|
|
6978
6914
|
var _a2;
|
|
6979
6915
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
6980
6916
|
var _a3;
|
|
@@ -8015,7 +7951,6 @@ export {
|
|
|
8015
7951
|
DateEditor,
|
|
8016
7952
|
DateRangeEditor,
|
|
8017
7953
|
DelegationContext,
|
|
8018
|
-
DelegationDisabledError,
|
|
8019
7954
|
DelegationGate,
|
|
8020
7955
|
DelegationProvider,
|
|
8021
7956
|
DrawerContent,
|
|
@@ -8119,10 +8054,8 @@ export {
|
|
|
8119
8054
|
VariablesProvider,
|
|
8120
8055
|
bindableFiltersMapper,
|
|
8121
8056
|
convertConnectedDataToVariable,
|
|
8122
|
-
createDelegationFetch,
|
|
8123
8057
|
createLocationValidator,
|
|
8124
8058
|
filterMapper,
|
|
8125
|
-
isDelegationExpiredResponse,
|
|
8126
8059
|
prettifyBindExpression,
|
|
8127
8060
|
readOnlyAttributes,
|
|
8128
8061
|
serializeVariablesEditorSerializedState,
|
|
@@ -8133,7 +8066,6 @@ export {
|
|
|
8133
8066
|
useConnectedDataAsVariables,
|
|
8134
8067
|
useContentDataResourceLocaleInfo,
|
|
8135
8068
|
useDelegation,
|
|
8136
|
-
useDelegationFetch,
|
|
8137
8069
|
useDynamicInputsAsVariables,
|
|
8138
8070
|
useMeshLocation,
|
|
8139
8071
|
useObjectSearchContext,
|