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