@uniformdev/mesh-sdk-react 20.72.3-alpha.2 → 20.72.3-alpha.23
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 +166 -2
- package/dist/index.d.ts +166 -2
- package/dist/index.esm.js +680 -385
- package/dist/index.js +947 -644
- package/dist/index.mjs +680 -385
- 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) {
|
|
@@ -267,12 +301,44 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
267
301
|
);
|
|
268
302
|
}
|
|
269
303
|
|
|
304
|
+
// src/hooks/useDelegation.ts
|
|
305
|
+
import { useContext } from "react";
|
|
306
|
+
|
|
307
|
+
// src/components/Delegation/DelegationContext.ts
|
|
308
|
+
import { createContext } from "react";
|
|
309
|
+
var DelegationContext = createContext(null);
|
|
310
|
+
|
|
311
|
+
// src/hooks/useDelegation.ts
|
|
312
|
+
function useDelegation() {
|
|
313
|
+
const ctx = useContext(DelegationContext);
|
|
314
|
+
if (!ctx) {
|
|
315
|
+
throw new Error("useDelegation must be used within a <DelegationProvider>");
|
|
316
|
+
}
|
|
317
|
+
return ctx;
|
|
318
|
+
}
|
|
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
|
+
|
|
270
336
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
271
337
|
import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
|
|
272
|
-
import { useMemo as
|
|
338
|
+
import { useMemo as useMemo3 } from "react";
|
|
273
339
|
import { Fragment, jsx as jsx15 } from "@emotion/react/jsx-runtime";
|
|
274
340
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
275
|
-
return
|
|
341
|
+
return useMemo3(() => {
|
|
276
342
|
const result = Object.entries(dynamicInputs).reduce(
|
|
277
343
|
(acc, [name2, input3]) => {
|
|
278
344
|
const source = `from ${name2 === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
@@ -307,18 +373,18 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
307
373
|
}
|
|
308
374
|
|
|
309
375
|
// src/hooks/useMeshLocation.ts
|
|
310
|
-
import { useMemo as
|
|
376
|
+
import { useMemo as useMemo5, useRef } from "react";
|
|
311
377
|
|
|
312
378
|
// src/components/UniformMeshLocationContext.tsx
|
|
313
|
-
import { createContext as
|
|
379
|
+
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo4, useState } from "react";
|
|
314
380
|
|
|
315
381
|
// src/components/UniformMeshSdkContext.tsx
|
|
316
382
|
import { Theme } from "@uniformdev/design-system";
|
|
317
|
-
import { createContext, useContext } from "react";
|
|
383
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
318
384
|
import { jsx as jsx16, jsxs as jsxs4 } from "@emotion/react/jsx-runtime";
|
|
319
|
-
var UniformMeshSdkContext =
|
|
385
|
+
var UniformMeshSdkContext = createContext2(void 0);
|
|
320
386
|
var useUniformMeshSdkContext = () => {
|
|
321
|
-
const context =
|
|
387
|
+
const context = useContext2(UniformMeshSdkContext);
|
|
322
388
|
if (!context) {
|
|
323
389
|
throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");
|
|
324
390
|
}
|
|
@@ -333,13 +399,13 @@ function useUniformMeshSdk() {
|
|
|
333
399
|
|
|
334
400
|
// src/components/UniformMeshLocationContext.tsx
|
|
335
401
|
import { jsx as jsx17 } from "@emotion/react/jsx-runtime";
|
|
336
|
-
var UniformMeshLocationContext =
|
|
402
|
+
var UniformMeshLocationContext = createContext3(void 0);
|
|
337
403
|
var UniformMeshLocationContextProvider = ({
|
|
338
404
|
children
|
|
339
405
|
}) => {
|
|
340
406
|
const sdk = useUniformMeshSdk();
|
|
341
407
|
const [location, setLocation] = useState(sdk.getCurrentLocation());
|
|
342
|
-
|
|
408
|
+
useMemo4(() => {
|
|
343
409
|
const valueChangeListener = (event) => {
|
|
344
410
|
setLocation((old) => ({ ...old, value: event.newValue }));
|
|
345
411
|
};
|
|
@@ -356,7 +422,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
356
422
|
return /* @__PURE__ */ jsx17(UniformMeshLocationContext.Provider, { value: { location }, children });
|
|
357
423
|
};
|
|
358
424
|
var useUniformMeshLocationContext = () => {
|
|
359
|
-
const context =
|
|
425
|
+
const context = useContext3(UniformMeshLocationContext);
|
|
360
426
|
if (!context) {
|
|
361
427
|
throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");
|
|
362
428
|
}
|
|
@@ -371,7 +437,7 @@ function useMeshLocation(expectedLocation) {
|
|
|
371
437
|
}
|
|
372
438
|
const backdoorLocation = useRef(location);
|
|
373
439
|
backdoorLocation.current = location;
|
|
374
|
-
const stabilizedSetValueProxy =
|
|
440
|
+
const stabilizedSetValueProxy = useMemo5(
|
|
375
441
|
() => (dispatch) => {
|
|
376
442
|
const { newValue, options } = dispatch(backdoorLocation.current.value);
|
|
377
443
|
backdoorLocation.current.setValue(newValue, options);
|
|
@@ -688,7 +754,7 @@ import {
|
|
|
688
754
|
createCommand,
|
|
689
755
|
SKIP_DOM_SELECTION_TAG
|
|
690
756
|
} from "lexical";
|
|
691
|
-
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";
|
|
692
758
|
import { createPortal } from "react-dom";
|
|
693
759
|
|
|
694
760
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
@@ -722,7 +788,7 @@ var variablesTipText = css`
|
|
|
722
788
|
|
|
723
789
|
// src/components/Variables/VariablesProvider.tsx
|
|
724
790
|
import mitt from "mitt";
|
|
725
|
-
import { createContext as
|
|
791
|
+
import { createContext as createContext4, useContext as useContext4, useEffect as useEffect3, useMemo as useMemo6, useState as useState3 } from "react";
|
|
726
792
|
|
|
727
793
|
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
728
794
|
import { useCallback, useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -911,7 +977,7 @@ function VariableEditor({
|
|
|
911
977
|
|
|
912
978
|
// src/components/Variables/VariablesProvider.tsx
|
|
913
979
|
import { jsx as jsx20, jsxs as jsxs6 } from "@emotion/react/jsx-runtime";
|
|
914
|
-
var VariablesContext =
|
|
980
|
+
var VariablesContext = createContext4(null);
|
|
915
981
|
function VariablesProvider({
|
|
916
982
|
value,
|
|
917
983
|
onChange,
|
|
@@ -924,7 +990,7 @@ function VariablesProvider({
|
|
|
924
990
|
}) {
|
|
925
991
|
const [editing, setEditing] = useState3();
|
|
926
992
|
const [editingContext, setEditingContext] = useState3();
|
|
927
|
-
const events =
|
|
993
|
+
const events = useMemo6(
|
|
928
994
|
() => mitt(),
|
|
929
995
|
[]
|
|
930
996
|
);
|
|
@@ -932,7 +998,7 @@ function VariablesProvider({
|
|
|
932
998
|
throw new Error("onChange must be provided when readOnly is false");
|
|
933
999
|
}
|
|
934
1000
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
935
|
-
const valueBasedContextValue =
|
|
1001
|
+
const valueBasedContextValue = useMemo6(
|
|
936
1002
|
() => ({
|
|
937
1003
|
flatVariables: flattenVariables(value),
|
|
938
1004
|
dispatch: (event) => {
|
|
@@ -976,7 +1042,7 @@ function VariablesProvider({
|
|
|
976
1042
|
isEditing: typeof editing !== "undefined",
|
|
977
1043
|
variables: value
|
|
978
1044
|
});
|
|
979
|
-
const contextValue =
|
|
1045
|
+
const contextValue = useMemo6(() => {
|
|
980
1046
|
return {
|
|
981
1047
|
...valueBasedContextValue,
|
|
982
1048
|
editVariableTxn,
|
|
@@ -1036,7 +1102,7 @@ function VariablesProvider({
|
|
|
1036
1102
|
] });
|
|
1037
1103
|
}
|
|
1038
1104
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
1039
|
-
const context =
|
|
1105
|
+
const context = useContext4(VariablesContext);
|
|
1040
1106
|
if (!context) {
|
|
1041
1107
|
if (returnEmptyWithoutProvider) {
|
|
1042
1108
|
return {
|
|
@@ -1184,7 +1250,7 @@ function useVariablesMenu({
|
|
|
1184
1250
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1185
1251
|
);
|
|
1186
1252
|
const canAddVariable = canDispatch && showAddVariableMenuOption && !readOnly;
|
|
1187
|
-
const { groupedVariables, menuOptions } =
|
|
1253
|
+
const { groupedVariables, menuOptions } = useMemo7(() => {
|
|
1188
1254
|
const groupedVariables2 = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
1189
1255
|
if (canAddVariable) {
|
|
1190
1256
|
groupedVariables2.unshift({
|
|
@@ -1271,7 +1337,7 @@ function VariablesPlugin({
|
|
|
1271
1337
|
filterVariable,
|
|
1272
1338
|
getEditorContext
|
|
1273
1339
|
});
|
|
1274
|
-
const { filteredGroupedVariables, filteredMenuOptions } =
|
|
1340
|
+
const { filteredGroupedVariables, filteredMenuOptions } = useMemo7(() => {
|
|
1275
1341
|
if (!queryString) {
|
|
1276
1342
|
return {
|
|
1277
1343
|
filteredGroupedVariables: groupedVariables,
|
|
@@ -2051,7 +2117,7 @@ var inputMultiLine = (lines) => css5`
|
|
|
2051
2117
|
|
|
2052
2118
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
2053
2119
|
import { hasReferencedVariables } from "@uniformdev/canvas";
|
|
2054
|
-
import { useEffect as useEffect7, useMemo as
|
|
2120
|
+
import { useEffect as useEffect7, useMemo as useMemo8, useState as useState5 } from "react";
|
|
2055
2121
|
function useInputVariablesState({
|
|
2056
2122
|
value,
|
|
2057
2123
|
onChange,
|
|
@@ -2083,7 +2149,7 @@ function useInputVariablesState({
|
|
|
2083
2149
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
|
|
2084
2150
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
2085
2151
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
2086
|
-
const sharedMenuProps =
|
|
2152
|
+
const sharedMenuProps = useMemo8(
|
|
2087
2153
|
() => ({
|
|
2088
2154
|
menuTooltip,
|
|
2089
2155
|
showAddVariableMenuOption,
|
|
@@ -2281,7 +2347,7 @@ import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
|
2281
2347
|
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
|
|
2282
2348
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
2283
2349
|
import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
|
|
2284
|
-
import { useMemo as
|
|
2350
|
+
import { useEffect as useEffect10, useMemo as useMemo9, useRef as useRef5, useState as useState6 } from "react";
|
|
2285
2351
|
|
|
2286
2352
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
2287
2353
|
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
@@ -2308,6 +2374,13 @@ function SingleLineTextPlugin() {
|
|
|
2308
2374
|
return null;
|
|
2309
2375
|
}
|
|
2310
2376
|
|
|
2377
|
+
// src/components/Variables/toolbox/useVariablesComposerFlushPending.ts
|
|
2378
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
2379
|
+
var VariablesComposerFlushPendingContext = createContext5(false);
|
|
2380
|
+
function useVariablesComposerFlushPending() {
|
|
2381
|
+
return useContext5(VariablesComposerFlushPendingContext);
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2311
2384
|
// src/components/Variables/toolbox/VariablesComposer.tsx
|
|
2312
2385
|
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs10 } from "@emotion/react/jsx-runtime";
|
|
2313
2386
|
function VariablesComposer(props) {
|
|
@@ -2322,7 +2395,8 @@ function VariablesComposer(props) {
|
|
|
2322
2395
|
...variablesPluginProps
|
|
2323
2396
|
} = props;
|
|
2324
2397
|
const [lastEmittedValue, setLastEmittedValue] = useState6(value);
|
|
2325
|
-
const
|
|
2398
|
+
const [flushPending, setFlushPending] = useState6(false);
|
|
2399
|
+
const editorConfig = useMemo9(
|
|
2326
2400
|
() => ({
|
|
2327
2401
|
namespace: "uniform",
|
|
2328
2402
|
onError(error) {
|
|
@@ -2336,6 +2410,24 @@ function VariablesComposer(props) {
|
|
|
2336
2410
|
);
|
|
2337
2411
|
const editorState = useRef5(void 0);
|
|
2338
2412
|
const updateTimeout = useRef5(void 0);
|
|
2413
|
+
const flushDepsRef = useRef5({ onChange, lastEmittedValue });
|
|
2414
|
+
flushDepsRef.current = { onChange, lastEmittedValue };
|
|
2415
|
+
useEffect10(
|
|
2416
|
+
() => () => {
|
|
2417
|
+
if (!updateTimeout.current) {
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2420
|
+
clearTimeout(updateTimeout.current);
|
|
2421
|
+
const { onChange: emit, lastEmittedValue: lastEmitted } = flushDepsRef.current;
|
|
2422
|
+
const valueToEmit = editorState.current ? serializeVariablesEditorState(editorState.current) : void 0;
|
|
2423
|
+
const shouldEmit = editorState.current != null && valueToEmit !== lastEmitted;
|
|
2424
|
+
if (!shouldEmit) {
|
|
2425
|
+
return;
|
|
2426
|
+
}
|
|
2427
|
+
queueMicrotask(() => emit(valueToEmit));
|
|
2428
|
+
},
|
|
2429
|
+
[]
|
|
2430
|
+
);
|
|
2339
2431
|
if (typeof document === "undefined") return null;
|
|
2340
2432
|
return /* @__PURE__ */ jsxs10(LexicalComposer, { initialConfig: editorConfig, children: [
|
|
2341
2433
|
/* @__PURE__ */ jsx26(
|
|
@@ -2347,6 +2439,7 @@ function VariablesComposer(props) {
|
|
|
2347
2439
|
if (updateTimeout.current) {
|
|
2348
2440
|
clearTimeout(updateTimeout.current);
|
|
2349
2441
|
}
|
|
2442
|
+
setFlushPending(true);
|
|
2350
2443
|
updateTimeout.current = window.setTimeout(() => {
|
|
2351
2444
|
if (editorState.current) {
|
|
2352
2445
|
const valueToEmit = serializeVariablesEditorState(editorState.current);
|
|
@@ -2355,6 +2448,8 @@ function VariablesComposer(props) {
|
|
|
2355
2448
|
onChange(valueToEmit);
|
|
2356
2449
|
}
|
|
2357
2450
|
}
|
|
2451
|
+
setFlushPending(false);
|
|
2452
|
+
updateTimeout.current = void 0;
|
|
2358
2453
|
}, 400);
|
|
2359
2454
|
}
|
|
2360
2455
|
}
|
|
@@ -2364,7 +2459,7 @@ function VariablesComposer(props) {
|
|
|
2364
2459
|
/* @__PURE__ */ jsx26(VariablesPlugin, { ...variablesPluginProps }),
|
|
2365
2460
|
/* @__PURE__ */ jsx26(DisablePlugin, { disabled }),
|
|
2366
2461
|
/* @__PURE__ */ jsx26(Fragment5, { children: autoFocus ? /* @__PURE__ */ jsx26(AutoFocusPlugin, {}) : null }),
|
|
2367
|
-
/* @__PURE__ */ jsx26(
|
|
2462
|
+
/* @__PURE__ */ jsx26(VariablesComposerFlushPendingContext.Provider, { value: flushPending, children })
|
|
2368
2463
|
] });
|
|
2369
2464
|
}
|
|
2370
2465
|
|
|
@@ -2389,18 +2484,27 @@ import {
|
|
|
2389
2484
|
CUT_COMMAND,
|
|
2390
2485
|
PASTE_COMMAND as PASTE_COMMAND2
|
|
2391
2486
|
} from "lexical";
|
|
2392
|
-
import { useEffect as
|
|
2487
|
+
import { useEffect as useEffect11 } from "react";
|
|
2393
2488
|
import { Fragment as Fragment6, jsx as jsx27, jsxs as jsxs11 } from "@emotion/react/jsx-runtime";
|
|
2394
2489
|
function VariablesComposerInput({
|
|
2395
|
-
css:
|
|
2490
|
+
css: css24,
|
|
2396
2491
|
placeholder,
|
|
2397
2492
|
...contentEditableProps
|
|
2398
2493
|
}) {
|
|
2494
|
+
const flushPending = useVariablesComposerFlushPending();
|
|
2399
2495
|
return /* @__PURE__ */ jsxs11("div", { children: [
|
|
2400
2496
|
/* @__PURE__ */ jsx27(
|
|
2401
2497
|
PlainTextPlugin,
|
|
2402
2498
|
{
|
|
2403
|
-
contentEditable: /* @__PURE__ */ jsx27(
|
|
2499
|
+
contentEditable: /* @__PURE__ */ jsx27(
|
|
2500
|
+
ContentEditable,
|
|
2501
|
+
{
|
|
2502
|
+
...contentEditableProps,
|
|
2503
|
+
"data-flush-pending": flushPending,
|
|
2504
|
+
placeholder: null,
|
|
2505
|
+
"aria-placeholder": void 0
|
|
2506
|
+
}
|
|
2507
|
+
),
|
|
2404
2508
|
placeholder: placeholder ? /* @__PURE__ */ jsx27(Fragment6, { children: placeholder }) : null,
|
|
2405
2509
|
ErrorBoundary: LexicalErrorBoundary
|
|
2406
2510
|
}
|
|
@@ -2411,7 +2515,7 @@ function VariablesComposerInput({
|
|
|
2411
2515
|
}
|
|
2412
2516
|
function RichishCopyAndPastePlugin() {
|
|
2413
2517
|
const [editor] = useLexicalComposerContext9();
|
|
2414
|
-
|
|
2518
|
+
useEffect11(() => {
|
|
2415
2519
|
return mergeRegister4(
|
|
2416
2520
|
editor.registerCommand(
|
|
2417
2521
|
COPY_COMMAND,
|
|
@@ -2666,7 +2770,7 @@ function InputVariablesOverlayMenu({
|
|
|
2666
2770
|
import { CgUsbC as CgUsbC2 } from "@react-icons/all-files/cg/CgUsbC";
|
|
2667
2771
|
import { bindVariablesToObject } from "@uniformdev/canvas";
|
|
2668
2772
|
import { HorizontalRhythm as HorizontalRhythm5, Menu as Menu2 } from "@uniformdev/design-system";
|
|
2669
|
-
import { useMemo as
|
|
2773
|
+
import { useMemo as useMemo10 } from "react";
|
|
2670
2774
|
import { jsx as jsx29, jsxs as jsxs13 } from "@emotion/react/jsx-runtime";
|
|
2671
2775
|
function ParameterConnectionIndicator({
|
|
2672
2776
|
children,
|
|
@@ -2677,7 +2781,7 @@ function ParameterConnectionIndicator({
|
|
|
2677
2781
|
overrideMenuButtonParentMargin,
|
|
2678
2782
|
renderMenuInPortal = false
|
|
2679
2783
|
}) {
|
|
2680
|
-
const hasVariablesInValue =
|
|
2784
|
+
const hasVariablesInValue = useMemo10(() => {
|
|
2681
2785
|
let result = false;
|
|
2682
2786
|
bindVariablesToObject({
|
|
2683
2787
|
value,
|
|
@@ -2728,7 +2832,7 @@ import { useCallback as useCallback4 } from "react";
|
|
|
2728
2832
|
import { useLexicalComposerContext as useLexicalComposerContext10 } from "@lexical/react/LexicalComposerContext";
|
|
2729
2833
|
import { mergeRegister as mergeRegister5 } from "@lexical/utils";
|
|
2730
2834
|
import { $getNodeByKey as $getNodeByKey3, COMMAND_PRIORITY_HIGH as COMMAND_PRIORITY_HIGH3 } from "lexical";
|
|
2731
|
-
import { useEffect as
|
|
2835
|
+
import { useEffect as useEffect12, useRef as useRef6 } from "react";
|
|
2732
2836
|
function OnDisconnectPlugin({
|
|
2733
2837
|
onDisconnect
|
|
2734
2838
|
}) {
|
|
@@ -2736,7 +2840,7 @@ function OnDisconnectPlugin({
|
|
|
2736
2840
|
const { variables } = useVariables(true);
|
|
2737
2841
|
const variablesRef = useRef6(variables);
|
|
2738
2842
|
variablesRef.current = variables;
|
|
2739
|
-
|
|
2843
|
+
useEffect12(() => {
|
|
2740
2844
|
return mergeRegister5(
|
|
2741
2845
|
editor.registerCommand(
|
|
2742
2846
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -3649,7 +3753,7 @@ function RequestParameters({
|
|
|
3649
3753
|
|
|
3650
3754
|
// src/components/Request/RequestUrl.tsx
|
|
3651
3755
|
import { css as css13 } from "@emotion/react";
|
|
3652
|
-
import { useMemo as
|
|
3756
|
+
import { useMemo as useMemo12 } from "react";
|
|
3653
3757
|
|
|
3654
3758
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
3655
3759
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -3675,7 +3779,7 @@ function RequestUrl() {
|
|
|
3675
3779
|
var _a, _b;
|
|
3676
3780
|
const { variables } = useVariables();
|
|
3677
3781
|
const { request } = useRequest();
|
|
3678
|
-
const mergedParameters =
|
|
3782
|
+
const mergedParameters = useMemo12(() => {
|
|
3679
3783
|
var _a2;
|
|
3680
3784
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
3681
3785
|
return request.parameters;
|
|
@@ -3918,17 +4022,200 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
3918
4022
|
};
|
|
3919
4023
|
}
|
|
3920
4024
|
|
|
4025
|
+
// src/components/Delegation/DelegationGate.tsx
|
|
4026
|
+
import { Callout as Callout3, LoadingOverlay } from "@uniformdev/design-system";
|
|
4027
|
+
import { useEffect as useEffect13 } from "react";
|
|
4028
|
+
|
|
4029
|
+
// src/components/Delegation/styles/DelegationGate.style.ts
|
|
4030
|
+
import { css as css14 } from "@emotion/react";
|
|
4031
|
+
var delegationGateStyle = css14`
|
|
4032
|
+
min-height: 12rem;
|
|
4033
|
+
width: 100%;
|
|
4034
|
+
`;
|
|
4035
|
+
|
|
4036
|
+
// src/components/Delegation/DelegationGate.tsx
|
|
4037
|
+
import { Fragment as Fragment10, jsx as jsx46 } from "@emotion/react/jsx-runtime";
|
|
4038
|
+
function DefaultDelegationLoading() {
|
|
4039
|
+
return /* @__PURE__ */ jsx46("div", { css: delegationGateStyle, children: /* @__PURE__ */ jsx46(LoadingOverlay, { isActive: true, statusMessage: "Connecting to Uniform..." }) });
|
|
4040
|
+
}
|
|
4041
|
+
function DefaultDelegationDisabled() {
|
|
4042
|
+
return /* @__PURE__ */ jsx46(Callout3, { 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." });
|
|
4043
|
+
}
|
|
4044
|
+
function DefaultDelegationError({ error }) {
|
|
4045
|
+
useEffect13(() => {
|
|
4046
|
+
console.error("Delegation connection failed", error);
|
|
4047
|
+
}, [error]);
|
|
4048
|
+
return /* @__PURE__ */ jsx46(Callout3, { type: "error", title: "Connection error", children: /* @__PURE__ */ jsx46("p", { children: "Failed to connect to Uniform. Try again, or contact your administrator if the problem persists." }) });
|
|
4049
|
+
}
|
|
4050
|
+
function DelegationGate({
|
|
4051
|
+
children,
|
|
4052
|
+
loadingComponent,
|
|
4053
|
+
disabledComponent,
|
|
4054
|
+
errorComponent
|
|
4055
|
+
}) {
|
|
4056
|
+
const { status, error } = useDelegation();
|
|
4057
|
+
if (status === "active") {
|
|
4058
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children });
|
|
4059
|
+
}
|
|
4060
|
+
if (status === "idle" || status === "acquiring") {
|
|
4061
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: loadingComponent !== void 0 ? loadingComponent : /* @__PURE__ */ jsx46(DefaultDelegationLoading, {}) });
|
|
4062
|
+
}
|
|
4063
|
+
if (status === "disabled") {
|
|
4064
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: disabledComponent !== void 0 ? disabledComponent : /* @__PURE__ */ jsx46(DefaultDelegationDisabled, {}) });
|
|
4065
|
+
}
|
|
4066
|
+
if (status === "error") {
|
|
4067
|
+
const resolvedError = error != null ? error : new Error("Unknown delegation error");
|
|
4068
|
+
if (errorComponent !== void 0) {
|
|
4069
|
+
if (typeof errorComponent === "function") {
|
|
4070
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: errorComponent({ error: resolvedError }) });
|
|
4071
|
+
}
|
|
4072
|
+
return /* @__PURE__ */ jsx46(Fragment10, { children: errorComponent });
|
|
4073
|
+
}
|
|
4074
|
+
return /* @__PURE__ */ jsx46(DefaultDelegationError, { error: resolvedError });
|
|
4075
|
+
}
|
|
4076
|
+
return null;
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
// src/components/Delegation/DelegationProvider.tsx
|
|
4080
|
+
import { useCallback as useCallback5, useEffect as useEffect14, useMemo as useMemo13, useRef as useRef7, useState as useState11 } from "react";
|
|
4081
|
+
import { jsx as jsx47 } from "@emotion/react/jsx-runtime";
|
|
4082
|
+
var DelegationDisabledError = class extends Error {
|
|
4083
|
+
constructor() {
|
|
4084
|
+
super("Identity delegation is not enabled for this integration.");
|
|
4085
|
+
this.name = "DelegationDisabledError";
|
|
4086
|
+
}
|
|
4087
|
+
};
|
|
4088
|
+
var DEFAULT_REVALIDATE_AFTER_MS = 30 * 1e3;
|
|
4089
|
+
function DelegationProvider({
|
|
4090
|
+
sdk,
|
|
4091
|
+
onSessionToken,
|
|
4092
|
+
checkActive,
|
|
4093
|
+
revalidateOnFocus = true,
|
|
4094
|
+
revalidateAfterMs = DEFAULT_REVALIDATE_AFTER_MS,
|
|
4095
|
+
children
|
|
4096
|
+
}) {
|
|
4097
|
+
const [status, setStatus] = useState11("idle");
|
|
4098
|
+
const [error, setError] = useState11(null);
|
|
4099
|
+
const mountedRef = useRef7(true);
|
|
4100
|
+
const statusRef = useRef7("idle");
|
|
4101
|
+
statusRef.current = status;
|
|
4102
|
+
const acquirePromiseRef = useRef7(null);
|
|
4103
|
+
const acquire = useCallback5(() => {
|
|
4104
|
+
if (acquirePromiseRef.current) {
|
|
4105
|
+
return acquirePromiseRef.current;
|
|
4106
|
+
}
|
|
4107
|
+
const run = (async () => {
|
|
4108
|
+
if (statusRef.current !== "active") {
|
|
4109
|
+
setStatus("acquiring");
|
|
4110
|
+
}
|
|
4111
|
+
setError(null);
|
|
4112
|
+
try {
|
|
4113
|
+
const isActive = await checkActive();
|
|
4114
|
+
if (isActive) {
|
|
4115
|
+
if (mountedRef.current) {
|
|
4116
|
+
setStatus("active");
|
|
4117
|
+
}
|
|
4118
|
+
return;
|
|
4119
|
+
}
|
|
4120
|
+
if (!mountedRef.current) {
|
|
4121
|
+
return;
|
|
4122
|
+
}
|
|
4123
|
+
const sessionToken = await sdk.getSessionToken();
|
|
4124
|
+
if (!mountedRef.current) {
|
|
4125
|
+
return;
|
|
4126
|
+
}
|
|
4127
|
+
if (!sessionToken) {
|
|
4128
|
+
if (mountedRef.current) {
|
|
4129
|
+
setStatus("disabled");
|
|
4130
|
+
}
|
|
4131
|
+
throw new DelegationDisabledError();
|
|
4132
|
+
}
|
|
4133
|
+
await onSessionToken(sessionToken);
|
|
4134
|
+
if (mountedRef.current) {
|
|
4135
|
+
setStatus("active");
|
|
4136
|
+
}
|
|
4137
|
+
} catch (err) {
|
|
4138
|
+
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
4139
|
+
if (mountedRef.current && !(err instanceof DelegationDisabledError)) {
|
|
4140
|
+
setError(error2);
|
|
4141
|
+
setStatus("error");
|
|
4142
|
+
}
|
|
4143
|
+
throw error2;
|
|
4144
|
+
}
|
|
4145
|
+
})();
|
|
4146
|
+
acquirePromiseRef.current = run.finally(() => {
|
|
4147
|
+
acquirePromiseRef.current = null;
|
|
4148
|
+
});
|
|
4149
|
+
return acquirePromiseRef.current;
|
|
4150
|
+
}, [sdk, onSessionToken, checkActive]);
|
|
4151
|
+
useEffect14(() => {
|
|
4152
|
+
mountedRef.current = true;
|
|
4153
|
+
void acquire().catch(() => {
|
|
4154
|
+
});
|
|
4155
|
+
return () => {
|
|
4156
|
+
mountedRef.current = false;
|
|
4157
|
+
};
|
|
4158
|
+
}, [acquire]);
|
|
4159
|
+
const revalidate = useCallback5(async () => {
|
|
4160
|
+
if (acquirePromiseRef.current) {
|
|
4161
|
+
return;
|
|
4162
|
+
}
|
|
4163
|
+
if (statusRef.current !== "active") {
|
|
4164
|
+
return;
|
|
4165
|
+
}
|
|
4166
|
+
try {
|
|
4167
|
+
const isActive = await checkActive();
|
|
4168
|
+
if (!mountedRef.current) {
|
|
4169
|
+
return;
|
|
4170
|
+
}
|
|
4171
|
+
if (!isActive) {
|
|
4172
|
+
void acquire().catch(() => {
|
|
4173
|
+
});
|
|
4174
|
+
}
|
|
4175
|
+
} catch (e) {
|
|
4176
|
+
}
|
|
4177
|
+
}, [checkActive, acquire]);
|
|
4178
|
+
useEffect14(() => {
|
|
4179
|
+
if (!revalidateOnFocus) {
|
|
4180
|
+
return;
|
|
4181
|
+
}
|
|
4182
|
+
if (typeof document === "undefined") {
|
|
4183
|
+
return;
|
|
4184
|
+
}
|
|
4185
|
+
let hiddenAt = document.visibilityState === "hidden" ? Date.now() : null;
|
|
4186
|
+
const handleVisibilityChange = () => {
|
|
4187
|
+
if (document.visibilityState === "hidden") {
|
|
4188
|
+
hiddenAt = Date.now();
|
|
4189
|
+
return;
|
|
4190
|
+
}
|
|
4191
|
+
if (document.visibilityState === "visible") {
|
|
4192
|
+
const elapsed = hiddenAt === null ? 0 : Date.now() - hiddenAt;
|
|
4193
|
+
hiddenAt = null;
|
|
4194
|
+
if (elapsed >= revalidateAfterMs) {
|
|
4195
|
+
void revalidate();
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
};
|
|
4199
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
4200
|
+
return () => {
|
|
4201
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
4202
|
+
};
|
|
4203
|
+
}, [revalidateOnFocus, revalidateAfterMs, revalidate]);
|
|
4204
|
+
const value = useMemo13(() => ({ status, error, reacquire: acquire }), [status, error, acquire]);
|
|
4205
|
+
return /* @__PURE__ */ jsx47(DelegationContext.Provider, { value, children });
|
|
4206
|
+
}
|
|
4207
|
+
|
|
3921
4208
|
// src/components/MeshApp.tsx
|
|
3922
4209
|
import { IconsProvider, LoadingIndicator as LoadingIndicator2, Theme as Theme2 } from "@uniformdev/design-system";
|
|
3923
4210
|
|
|
3924
4211
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
3925
4212
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
3926
|
-
import { useEffect as
|
|
4213
|
+
import { useEffect as useEffect15, useRef as useRef8, useState as useState12 } from "react";
|
|
3927
4214
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
3928
|
-
const [error, setError] =
|
|
3929
|
-
const [sdk, setSdk] =
|
|
3930
|
-
const initializationInProgress =
|
|
3931
|
-
|
|
4215
|
+
const [error, setError] = useState12();
|
|
4216
|
+
const [sdk, setSdk] = useState12();
|
|
4217
|
+
const initializationInProgress = useRef8(false);
|
|
4218
|
+
useEffect15(
|
|
3932
4219
|
() => {
|
|
3933
4220
|
if (typeof window === "undefined" || sdk) {
|
|
3934
4221
|
return;
|
|
@@ -3961,7 +4248,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
3961
4248
|
};
|
|
3962
4249
|
|
|
3963
4250
|
// src/components/MeshApp.tsx
|
|
3964
|
-
import { jsx as
|
|
4251
|
+
import { jsx as jsx48, jsxs as jsxs21 } from "@emotion/react/jsx-runtime";
|
|
3965
4252
|
var MeshApp = ({
|
|
3966
4253
|
children,
|
|
3967
4254
|
loadingComponent,
|
|
@@ -3970,25 +4257,25 @@ var MeshApp = ({
|
|
|
3970
4257
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
3971
4258
|
if (initializing || !sdk) {
|
|
3972
4259
|
const LoadingComponent = loadingComponent;
|
|
3973
|
-
return LoadingComponent ? /* @__PURE__ */
|
|
4260
|
+
return LoadingComponent ? /* @__PURE__ */ jsx48(LoadingComponent, {}) : /* @__PURE__ */ jsx48(LoadingIndicator2, {});
|
|
3974
4261
|
}
|
|
3975
4262
|
if (error) {
|
|
3976
4263
|
const ErrorComponent = errorComponent;
|
|
3977
4264
|
if (ErrorComponent) {
|
|
3978
|
-
return /* @__PURE__ */
|
|
4265
|
+
return /* @__PURE__ */ jsx48(ErrorComponent, { error });
|
|
3979
4266
|
}
|
|
3980
4267
|
throw error;
|
|
3981
4268
|
}
|
|
3982
4269
|
return /* @__PURE__ */ jsxs21(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
3983
|
-
/* @__PURE__ */
|
|
3984
|
-
/* @__PURE__ */
|
|
4270
|
+
/* @__PURE__ */ jsx48(Theme2, {}),
|
|
4271
|
+
/* @__PURE__ */ jsx48(IconsProvider, { children: /* @__PURE__ */ jsx48(UniformMeshLocationContextProvider, { children }) })
|
|
3985
4272
|
] });
|
|
3986
4273
|
};
|
|
3987
4274
|
|
|
3988
4275
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
3989
|
-
import { css as
|
|
4276
|
+
import { css as css15 } from "@emotion/react";
|
|
3990
4277
|
import { Button as Button2, LoadingIndicator as LoadingIndicator3 } from "@uniformdev/design-system";
|
|
3991
|
-
import { jsx as
|
|
4278
|
+
import { jsx as jsx49, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
3992
4279
|
var DataRefreshButton = ({
|
|
3993
4280
|
buttonText,
|
|
3994
4281
|
isLoading,
|
|
@@ -3996,10 +4283,10 @@ var DataRefreshButton = ({
|
|
|
3996
4283
|
...props
|
|
3997
4284
|
}) => {
|
|
3998
4285
|
return /* @__PURE__ */ jsxs22(Button2, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
3999
|
-
!isLoading ? null : /* @__PURE__ */
|
|
4286
|
+
!isLoading ? null : /* @__PURE__ */ jsx49(
|
|
4000
4287
|
LoadingIndicator3,
|
|
4001
4288
|
{
|
|
4002
|
-
css:
|
|
4289
|
+
css: css15`
|
|
4003
4290
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
4004
4291
|
`
|
|
4005
4292
|
}
|
|
@@ -4009,22 +4296,22 @@ var DataRefreshButton = ({
|
|
|
4009
4296
|
};
|
|
4010
4297
|
|
|
4011
4298
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4012
|
-
import { css as
|
|
4299
|
+
import { css as css17 } from "@emotion/react";
|
|
4013
4300
|
import { bindVariables } from "@uniformdev/canvas";
|
|
4014
|
-
import { Callout as
|
|
4301
|
+
import { Callout as Callout4, Container, ScrollableList, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
|
|
4015
4302
|
|
|
4016
4303
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
4017
4304
|
import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
|
|
4018
4305
|
import {
|
|
4019
|
-
createContext as
|
|
4020
|
-
useCallback as
|
|
4021
|
-
useContext as
|
|
4306
|
+
createContext as createContext7,
|
|
4307
|
+
useCallback as useCallback6,
|
|
4308
|
+
useContext as useContext7,
|
|
4022
4309
|
useDeferredValue,
|
|
4023
|
-
useMemo as
|
|
4024
|
-
useState as
|
|
4310
|
+
useMemo as useMemo14,
|
|
4311
|
+
useState as useState13
|
|
4025
4312
|
} from "react";
|
|
4026
|
-
import { jsx as
|
|
4027
|
-
var ObjectSearchContext =
|
|
4313
|
+
import { jsx as jsx50 } from "@emotion/react/jsx-runtime";
|
|
4314
|
+
var ObjectSearchContext = createContext7({
|
|
4028
4315
|
onSetQuery: () => {
|
|
4029
4316
|
},
|
|
4030
4317
|
onSelectItem: () => {
|
|
@@ -4045,16 +4332,16 @@ var ObjectSearchProvider = ({
|
|
|
4045
4332
|
children,
|
|
4046
4333
|
defaultQuery
|
|
4047
4334
|
}) => {
|
|
4048
|
-
const [query, setQuery] =
|
|
4335
|
+
const [query, setQuery] = useState13({
|
|
4049
4336
|
contentType: "",
|
|
4050
4337
|
keyword: "",
|
|
4051
4338
|
...defaultQuery
|
|
4052
4339
|
});
|
|
4053
4340
|
const { flatVariables } = useVariables(true);
|
|
4054
4341
|
const querySearchDeferred = useDeferredValue(query);
|
|
4055
|
-
const [selectedItems, setSelectedItems] =
|
|
4056
|
-
const [list, setList] =
|
|
4057
|
-
const onSetQuery =
|
|
4342
|
+
const [selectedItems, setSelectedItems] = useState13(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4343
|
+
const [list, setList] = useState13({});
|
|
4344
|
+
const onSetQuery = useCallback6(
|
|
4058
4345
|
(value2) => {
|
|
4059
4346
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
4060
4347
|
return setQuery({
|
|
@@ -4066,7 +4353,7 @@ var ObjectSearchProvider = ({
|
|
|
4066
4353
|
},
|
|
4067
4354
|
[setQuery]
|
|
4068
4355
|
);
|
|
4069
|
-
const onSelectItem =
|
|
4356
|
+
const onSelectItem = useCallback6(
|
|
4070
4357
|
(selectedResult) => {
|
|
4071
4358
|
if (Array.isArray(selectedResult)) {
|
|
4072
4359
|
setSelectedItems(selectedResult);
|
|
@@ -4080,17 +4367,17 @@ var ObjectSearchProvider = ({
|
|
|
4080
4367
|
},
|
|
4081
4368
|
[setSelectedItems, selectedItems]
|
|
4082
4369
|
);
|
|
4083
|
-
const onRemoveAllSelectedItems =
|
|
4370
|
+
const onRemoveAllSelectedItems = useCallback6(() => {
|
|
4084
4371
|
setSelectedItems([]);
|
|
4085
4372
|
}, [setSelectedItems]);
|
|
4086
|
-
const onSetList =
|
|
4373
|
+
const onSetList = useCallback6(
|
|
4087
4374
|
(value2) => {
|
|
4088
4375
|
setList(value2);
|
|
4089
4376
|
},
|
|
4090
4377
|
[setList]
|
|
4091
4378
|
);
|
|
4092
|
-
const boundQuery =
|
|
4093
|
-
const value =
|
|
4379
|
+
const boundQuery = useMemo14(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4380
|
+
const value = useMemo14(
|
|
4094
4381
|
() => ({
|
|
4095
4382
|
boundQuery,
|
|
4096
4383
|
onSetQuery,
|
|
@@ -4114,10 +4401,10 @@ var ObjectSearchProvider = ({
|
|
|
4114
4401
|
onSetList
|
|
4115
4402
|
]
|
|
4116
4403
|
);
|
|
4117
|
-
return /* @__PURE__ */
|
|
4404
|
+
return /* @__PURE__ */ jsx50(ObjectSearchContext.Provider, { value, children });
|
|
4118
4405
|
};
|
|
4119
4406
|
function useObjectSearchContext() {
|
|
4120
|
-
return
|
|
4407
|
+
return useContext7(ObjectSearchContext);
|
|
4121
4408
|
}
|
|
4122
4409
|
function bindQuery(query, inputs) {
|
|
4123
4410
|
const { result, errors } = bindVariablesToObject2({
|
|
@@ -4135,9 +4422,9 @@ function bindQuery(query, inputs) {
|
|
|
4135
4422
|
import { Chip, Popover } from "@uniformdev/design-system";
|
|
4136
4423
|
|
|
4137
4424
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
4138
|
-
import { css as
|
|
4425
|
+
import { css as css16 } from "@emotion/react";
|
|
4139
4426
|
import { skeletonLoading } from "@uniformdev/design-system";
|
|
4140
|
-
var ObjectListItemContainer =
|
|
4427
|
+
var ObjectListItemContainer = css16`
|
|
4141
4428
|
align-items: center;
|
|
4142
4429
|
border: 1px solid var(--gray-300);
|
|
4143
4430
|
border-radius: var(--rounded-base);
|
|
@@ -4146,11 +4433,11 @@ var ObjectListItemContainer = css15`
|
|
|
4146
4433
|
grid-template-columns: 1fr auto;
|
|
4147
4434
|
padding: var(--spacing-sm);
|
|
4148
4435
|
`;
|
|
4149
|
-
var ObjectListItemContainerDisabled =
|
|
4436
|
+
var ObjectListItemContainerDisabled = css16`
|
|
4150
4437
|
opacity: var(--opacity-50);
|
|
4151
4438
|
pointer-events: none;
|
|
4152
4439
|
`;
|
|
4153
|
-
var ObjectListItemLoading =
|
|
4440
|
+
var ObjectListItemLoading = css16`
|
|
4154
4441
|
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
4155
4442
|
border-color: transparent;
|
|
4156
4443
|
min-height: 42px;
|
|
@@ -4174,43 +4461,43 @@ var ObjectListItemLoading = css15`
|
|
|
4174
4461
|
width: 1rem;
|
|
4175
4462
|
}
|
|
4176
4463
|
`;
|
|
4177
|
-
var ObjectListItemHeadingGroup =
|
|
4464
|
+
var ObjectListItemHeadingGroup = css16`
|
|
4178
4465
|
align-items: center;
|
|
4179
4466
|
display: grid;
|
|
4180
4467
|
`;
|
|
4181
|
-
var ObjectListItemThumbnail =
|
|
4468
|
+
var ObjectListItemThumbnail = css16`
|
|
4182
4469
|
width: 30px;
|
|
4183
4470
|
height: 30px;
|
|
4184
4471
|
object-fit: cover;
|
|
4185
4472
|
`;
|
|
4186
|
-
var ObjectListItemTitle =
|
|
4473
|
+
var ObjectListItemTitle = css16`
|
|
4187
4474
|
color: var(--typography-base);
|
|
4188
4475
|
display: block;
|
|
4189
4476
|
font-size: var(--fs-sm);
|
|
4190
4477
|
`;
|
|
4191
|
-
var ObjectListItemSubtitle =
|
|
4478
|
+
var ObjectListItemSubtitle = css16`
|
|
4192
4479
|
color: var(--gray-500);
|
|
4193
4480
|
display: block;
|
|
4194
4481
|
font-size: var(--fs-xs);
|
|
4195
4482
|
line-height: 1;
|
|
4196
4483
|
`;
|
|
4197
|
-
var ObjectListItemInfoContainer =
|
|
4484
|
+
var ObjectListItemInfoContainer = css16`
|
|
4198
4485
|
align-items: center;
|
|
4199
4486
|
display: flex;
|
|
4200
4487
|
gap: var(--spacing-sm);
|
|
4201
4488
|
justify-content: center;
|
|
4202
4489
|
`;
|
|
4203
|
-
var ObjectListItemControlledContent =
|
|
4490
|
+
var ObjectListItemControlledContent = css16`
|
|
4204
4491
|
display: flex;
|
|
4205
4492
|
gap: var(--spacing-sm);
|
|
4206
4493
|
`;
|
|
4207
|
-
var ObjectListItemUnControlledContent =
|
|
4494
|
+
var ObjectListItemUnControlledContent = css16`
|
|
4208
4495
|
margin-top: var(--spacing-sm);
|
|
4209
4496
|
grid-column: 1 / -1;
|
|
4210
4497
|
`;
|
|
4211
4498
|
|
|
4212
4499
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
4213
|
-
import { jsx as
|
|
4500
|
+
import { jsx as jsx51, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
|
|
4214
4501
|
var ObjectSearchListItem = ({
|
|
4215
4502
|
id,
|
|
4216
4503
|
title,
|
|
@@ -4251,7 +4538,7 @@ var ObjectSearchListItem = ({
|
|
|
4251
4538
|
css: ObjectListItemControlledContent,
|
|
4252
4539
|
"aria-disabled": disabled,
|
|
4253
4540
|
children: [
|
|
4254
|
-
imageUrl ? /* @__PURE__ */
|
|
4541
|
+
imageUrl ? /* @__PURE__ */ jsx51(
|
|
4255
4542
|
"img",
|
|
4256
4543
|
{
|
|
4257
4544
|
src: imageUrl,
|
|
@@ -4261,27 +4548,27 @@ var ObjectSearchListItem = ({
|
|
|
4261
4548
|
}
|
|
4262
4549
|
) : null,
|
|
4263
4550
|
/* @__PURE__ */ jsxs23("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
4264
|
-
!contentType ? null : /* @__PURE__ */
|
|
4265
|
-
/* @__PURE__ */
|
|
4551
|
+
!contentType ? null : /* @__PURE__ */ jsx51("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
4552
|
+
/* @__PURE__ */ jsx51("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
4266
4553
|
] })
|
|
4267
4554
|
]
|
|
4268
4555
|
}
|
|
4269
4556
|
),
|
|
4270
4557
|
/* @__PURE__ */ jsxs23("div", { css: ObjectListItemInfoContainer, children: [
|
|
4271
|
-
selected ? /* @__PURE__ */
|
|
4272
|
-
!popoverData ? null : /* @__PURE__ */
|
|
4558
|
+
selected ? /* @__PURE__ */ jsx51(Chip, { text: "selected", size: "xs" }) : null,
|
|
4559
|
+
!popoverData ? null : /* @__PURE__ */ jsx51(Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4273
4560
|
] }),
|
|
4274
|
-
!children ? null : /* @__PURE__ */
|
|
4561
|
+
!children ? null : /* @__PURE__ */ jsx51("div", { css: ObjectListItemUnControlledContent, children })
|
|
4275
4562
|
]
|
|
4276
4563
|
}
|
|
4277
4564
|
);
|
|
4278
4565
|
};
|
|
4279
4566
|
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
4280
|
-
return /* @__PURE__ */
|
|
4567
|
+
return /* @__PURE__ */ jsx51("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
4281
4568
|
};
|
|
4282
4569
|
|
|
4283
4570
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4284
|
-
import { jsx as
|
|
4571
|
+
import { jsx as jsx52, jsxs as jsxs24 } from "@emotion/react/jsx-runtime";
|
|
4285
4572
|
var ObjectSearchContainer = ({
|
|
4286
4573
|
label,
|
|
4287
4574
|
enableDynamicInputToResultId,
|
|
@@ -4293,16 +4580,16 @@ var ObjectSearchContainer = ({
|
|
|
4293
4580
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
4294
4581
|
const { flatVariables } = useVariables(true);
|
|
4295
4582
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
4296
|
-
const listItems = resultList != null ? resultList : /* @__PURE__ */
|
|
4583
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx52(
|
|
4297
4584
|
ScrollableList,
|
|
4298
4585
|
{
|
|
4299
4586
|
role: "list",
|
|
4300
|
-
css:
|
|
4587
|
+
css: css17`
|
|
4301
4588
|
> div {
|
|
4302
4589
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4303
4590
|
}
|
|
4304
4591
|
`,
|
|
4305
|
-
children: /* @__PURE__ */
|
|
4592
|
+
children: /* @__PURE__ */ jsx52(DefaultResultList, {})
|
|
4306
4593
|
}
|
|
4307
4594
|
);
|
|
4308
4595
|
const body = /* @__PURE__ */ jsxs24(VerticalRhythm3, { children: [
|
|
@@ -4337,7 +4624,7 @@ var ObjectSearchContainer = ({
|
|
|
4337
4624
|
]);
|
|
4338
4625
|
};
|
|
4339
4626
|
return /* @__PURE__ */ jsxs24(VerticalRhythm3, { children: [
|
|
4340
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ jsx52(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx52(
|
|
4341
4628
|
InputVariables,
|
|
4342
4629
|
{
|
|
4343
4630
|
label,
|
|
@@ -4359,21 +4646,21 @@ var DefaultResultList = () => {
|
|
|
4359
4646
|
var _a;
|
|
4360
4647
|
const { list } = useObjectSearchContext();
|
|
4361
4648
|
if (!list.items) {
|
|
4362
|
-
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */
|
|
4649
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx52(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
4363
4650
|
}
|
|
4364
4651
|
if (list.items.length === 0) {
|
|
4365
|
-
return /* @__PURE__ */
|
|
4652
|
+
return /* @__PURE__ */ jsx52(Callout4, { type: "info", children: "No results were found" });
|
|
4366
4653
|
}
|
|
4367
|
-
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */
|
|
4654
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx52(ObjectSearchListItem, { ...item }, item.id));
|
|
4368
4655
|
};
|
|
4369
4656
|
|
|
4370
4657
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4371
4658
|
import { DebouncedInputKeywordSearch, InputSelect as InputSelect3 } from "@uniformdev/design-system";
|
|
4372
|
-
import { useMemo as
|
|
4659
|
+
import { useMemo as useMemo15, useState as useState14 } from "react";
|
|
4373
4660
|
|
|
4374
4661
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4375
|
-
import { css as
|
|
4376
|
-
var ObjectSearchFilterContainerLabel =
|
|
4662
|
+
import { css as css18 } from "@emotion/react";
|
|
4663
|
+
var ObjectSearchFilterContainerLabel = css18`
|
|
4377
4664
|
align-items: center;
|
|
4378
4665
|
display: flex;
|
|
4379
4666
|
font-size: var(--fs-sm);
|
|
@@ -4381,18 +4668,18 @@ var ObjectSearchFilterContainerLabel = css17`
|
|
|
4381
4668
|
line-height: 1rem;
|
|
4382
4669
|
margin-bottom: var(--spacing-sm);
|
|
4383
4670
|
`;
|
|
4384
|
-
var ObjectSearchFilterContainer =
|
|
4671
|
+
var ObjectSearchFilterContainer = css18`
|
|
4385
4672
|
display: grid;
|
|
4386
4673
|
gap: var(--spacing-base);
|
|
4387
4674
|
`;
|
|
4388
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
4675
|
+
var ObjectSearchFilterGrid = (gridColumns) => css18`
|
|
4389
4676
|
display: grid;
|
|
4390
4677
|
grid-template-columns: ${gridColumns};
|
|
4391
4678
|
gap: var(--spacing-base);
|
|
4392
4679
|
`;
|
|
4393
4680
|
|
|
4394
4681
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4395
|
-
import { jsx as
|
|
4682
|
+
import { jsx as jsx53, jsxs as jsxs25 } from "@emotion/react/jsx-runtime";
|
|
4396
4683
|
var ObjectSearchFilter = ({
|
|
4397
4684
|
requireContentType,
|
|
4398
4685
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -4403,7 +4690,7 @@ var ObjectSearchFilter = ({
|
|
|
4403
4690
|
}) => {
|
|
4404
4691
|
var _a, _b;
|
|
4405
4692
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4406
|
-
const [searchState, setSearchState] =
|
|
4693
|
+
const [searchState, setSearchState] = useState14({
|
|
4407
4694
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4408
4695
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
4409
4696
|
});
|
|
@@ -4413,7 +4700,7 @@ var ObjectSearchFilter = ({
|
|
|
4413
4700
|
});
|
|
4414
4701
|
onSetQuery({ ...query, ...value });
|
|
4415
4702
|
};
|
|
4416
|
-
const memoizedSelectOptions =
|
|
4703
|
+
const memoizedSelectOptions = useMemo15(() => {
|
|
4417
4704
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4418
4705
|
return [];
|
|
4419
4706
|
}
|
|
@@ -4431,7 +4718,7 @@ var ObjectSearchFilter = ({
|
|
|
4431
4718
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
4432
4719
|
],
|
|
4433
4720
|
children: [
|
|
4434
|
-
memoizedSelectOptions.length ? /* @__PURE__ */
|
|
4721
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ jsx53(
|
|
4435
4722
|
InputSelect3,
|
|
4436
4723
|
{
|
|
4437
4724
|
label: selectLabel,
|
|
@@ -4441,7 +4728,7 @@ var ObjectSearchFilter = ({
|
|
|
4441
4728
|
value: query.contentType
|
|
4442
4729
|
}
|
|
4443
4730
|
) : null,
|
|
4444
|
-
/* @__PURE__ */
|
|
4731
|
+
/* @__PURE__ */ jsx53(
|
|
4445
4732
|
DebouncedInputKeywordSearch,
|
|
4446
4733
|
{
|
|
4447
4734
|
inputFieldName: searchInputName,
|
|
@@ -4458,9 +4745,9 @@ var ObjectSearchFilter = ({
|
|
|
4458
4745
|
};
|
|
4459
4746
|
|
|
4460
4747
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
4461
|
-
import { jsx as
|
|
4748
|
+
import { jsx as jsx54 } from "@emotion/react/jsx-runtime";
|
|
4462
4749
|
var ObjectSearchFilterContainer2 = ({ children }) => {
|
|
4463
|
-
return /* @__PURE__ */
|
|
4750
|
+
return /* @__PURE__ */ jsx54("div", { children: /* @__PURE__ */ jsx54("div", { css: ObjectSearchFilterContainer, children }) });
|
|
4464
4751
|
};
|
|
4465
4752
|
|
|
4466
4753
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
@@ -4468,16 +4755,16 @@ import { Button as Button3, Chip as Chip2, Link, Popover as Popover2 } from "@un
|
|
|
4468
4755
|
import { format as timeagoFormat } from "timeago.js";
|
|
4469
4756
|
|
|
4470
4757
|
// src/components/Image/Image.tsx
|
|
4471
|
-
import { jsx as
|
|
4758
|
+
import { jsx as jsx55 } from "@emotion/react/jsx-runtime";
|
|
4472
4759
|
function Image({ src, alt, className }) {
|
|
4473
4760
|
const CompImage = src && typeof src !== "string" ? src : null;
|
|
4474
|
-
return CompImage ? /* @__PURE__ */
|
|
4761
|
+
return CompImage ? /* @__PURE__ */ jsx55(CompImage, { className }) : /* @__PURE__ */ jsx55("img", { src, alt, className });
|
|
4475
4762
|
}
|
|
4476
4763
|
|
|
4477
4764
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
4478
|
-
import { css as
|
|
4765
|
+
import { css as css19 } from "@emotion/react";
|
|
4479
4766
|
import { button as button2 } from "@uniformdev/design-system";
|
|
4480
|
-
var ButtonStyles =
|
|
4767
|
+
var ButtonStyles = css19`
|
|
4481
4768
|
${button2}
|
|
4482
4769
|
background: transparent;
|
|
4483
4770
|
border: 1px solid var(--typography-base);
|
|
@@ -4505,20 +4792,20 @@ var ButtonStyles = css18`
|
|
|
4505
4792
|
text-decoration: none;
|
|
4506
4793
|
}
|
|
4507
4794
|
`;
|
|
4508
|
-
var ButtonIcon =
|
|
4795
|
+
var ButtonIcon = css19`
|
|
4509
4796
|
width: 1rem;
|
|
4510
4797
|
height: 1rem;
|
|
4511
4798
|
`;
|
|
4512
4799
|
|
|
4513
4800
|
// src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
|
|
4514
|
-
import { jsx as
|
|
4801
|
+
import { jsx as jsx56, jsxs as jsxs26 } from "@emotion/react/jsx-runtime";
|
|
4515
4802
|
var ObjectSearchResultItemButton = ({
|
|
4516
4803
|
text,
|
|
4517
4804
|
icon,
|
|
4518
4805
|
...props
|
|
4519
4806
|
}) => {
|
|
4520
4807
|
return /* @__PURE__ */ jsxs26("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4521
|
-
!icon ? null : /* @__PURE__ */
|
|
4808
|
+
!icon ? null : /* @__PURE__ */ jsx56(Image, { src: icon, css: ButtonIcon }),
|
|
4522
4809
|
text
|
|
4523
4810
|
] });
|
|
4524
4811
|
};
|
|
@@ -4528,14 +4815,14 @@ var LinkButton = ({
|
|
|
4528
4815
|
...props
|
|
4529
4816
|
}) => {
|
|
4530
4817
|
return /* @__PURE__ */ jsxs26("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4531
|
-
!icon ? null : /* @__PURE__ */
|
|
4818
|
+
!icon ? null : /* @__PURE__ */ jsx56(Image, { src: icon, css: ButtonIcon }),
|
|
4532
4819
|
text
|
|
4533
4820
|
] });
|
|
4534
4821
|
};
|
|
4535
4822
|
|
|
4536
4823
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
4537
|
-
import { css as
|
|
4538
|
-
var ObjectSearchResultItemContainer =
|
|
4824
|
+
import { css as css20 } from "@emotion/react";
|
|
4825
|
+
var ObjectSearchResultItemContainer = css20`
|
|
4539
4826
|
align-items: center;
|
|
4540
4827
|
border: 1px solid var(--gray-300);
|
|
4541
4828
|
border-radius: var(--rounded-base);
|
|
@@ -4551,7 +4838,7 @@ var ObjectSearchResultItemContainer = css19`
|
|
|
4551
4838
|
}
|
|
4552
4839
|
}
|
|
4553
4840
|
`;
|
|
4554
|
-
var ObjectSearchDragHandle =
|
|
4841
|
+
var ObjectSearchDragHandle = css20`
|
|
4555
4842
|
border-left: 2px dotted var(--gray-300);
|
|
4556
4843
|
border-right: 2px dotted var(--gray-300);
|
|
4557
4844
|
position: absolute;
|
|
@@ -4560,47 +4847,47 @@ var ObjectSearchDragHandle = css19`
|
|
|
4560
4847
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4561
4848
|
opacity: 0;
|
|
4562
4849
|
`;
|
|
4563
|
-
var ObjectSearchResultItemSubtitle =
|
|
4850
|
+
var ObjectSearchResultItemSubtitle = css20`
|
|
4564
4851
|
color: var(--gray-500);
|
|
4565
4852
|
display: block;
|
|
4566
4853
|
font-size: var(--fs-xs);
|
|
4567
4854
|
line-height: 1;
|
|
4568
4855
|
`;
|
|
4569
|
-
var ObjectSearchResultItemTitle =
|
|
4856
|
+
var ObjectSearchResultItemTitle = css20`
|
|
4570
4857
|
align-items: center;
|
|
4571
4858
|
color: var(--typography-base);
|
|
4572
4859
|
display: flex;
|
|
4573
4860
|
gap: var(--spacing-xs);
|
|
4574
4861
|
`;
|
|
4575
|
-
var ObjectSearchResultItemTimeStamp =
|
|
4862
|
+
var ObjectSearchResultItemTimeStamp = css20`
|
|
4576
4863
|
color: var(--gray-500);
|
|
4577
4864
|
font-size: var(--fs-xs);
|
|
4578
4865
|
`;
|
|
4579
|
-
var ObjectSearchResultItemTitleLink =
|
|
4866
|
+
var ObjectSearchResultItemTitleLink = css20`
|
|
4580
4867
|
text-decoration: none;
|
|
4581
4868
|
color: var(--primary-action-default);
|
|
4582
4869
|
font-size: var(--fs-sm);
|
|
4583
4870
|
`;
|
|
4584
|
-
var ObjectSearchAuthorStateGroup =
|
|
4871
|
+
var ObjectSearchAuthorStateGroup = css20`
|
|
4585
4872
|
align-items: center;
|
|
4586
4873
|
display: flex;
|
|
4587
4874
|
gap: var(--spacing-sm);
|
|
4588
4875
|
`;
|
|
4589
|
-
var ObjectSearchUpdateGroup =
|
|
4876
|
+
var ObjectSearchUpdateGroup = css20`
|
|
4590
4877
|
display: grid;
|
|
4591
4878
|
`;
|
|
4592
|
-
var ObjectSearchContentContainer =
|
|
4879
|
+
var ObjectSearchContentContainer = css20`
|
|
4593
4880
|
display: flex;
|
|
4594
4881
|
gap: var(--spacing-base);
|
|
4595
4882
|
`;
|
|
4596
|
-
var ObjectSearchImage =
|
|
4883
|
+
var ObjectSearchImage = css20`
|
|
4597
4884
|
width: 56px;
|
|
4598
4885
|
height: 56px;
|
|
4599
4886
|
object-fit: cover;
|
|
4600
4887
|
`;
|
|
4601
4888
|
|
|
4602
4889
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4603
|
-
import { jsx as
|
|
4890
|
+
import { jsx as jsx57, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
4604
4891
|
var ObjectSearchResultItem = ({
|
|
4605
4892
|
id,
|
|
4606
4893
|
title,
|
|
@@ -4625,9 +4912,9 @@ var ObjectSearchResultItem = ({
|
|
|
4625
4912
|
onRemove == null ? void 0 : onRemove();
|
|
4626
4913
|
};
|
|
4627
4914
|
return /* @__PURE__ */ jsxs27("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
|
|
4628
|
-
disableDnD ? null : /* @__PURE__ */
|
|
4629
|
-
/* @__PURE__ */
|
|
4630
|
-
!imageUrl ? null : /* @__PURE__ */
|
|
4915
|
+
disableDnD ? null : /* @__PURE__ */ jsx57("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
|
|
4916
|
+
/* @__PURE__ */ jsx57("div", { children: /* @__PURE__ */ jsxs27("div", { css: ObjectSearchContentContainer, children: [
|
|
4917
|
+
!imageUrl ? null : /* @__PURE__ */ jsx57(
|
|
4631
4918
|
"img",
|
|
4632
4919
|
{
|
|
4633
4920
|
src: imageUrl,
|
|
@@ -4637,9 +4924,9 @@ var ObjectSearchResultItem = ({
|
|
|
4637
4924
|
}
|
|
4638
4925
|
),
|
|
4639
4926
|
/* @__PURE__ */ jsxs27("div", { children: [
|
|
4640
|
-
/* @__PURE__ */
|
|
4927
|
+
/* @__PURE__ */ jsx57("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4641
4928
|
/* @__PURE__ */ jsxs27("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4642
|
-
onClick ? /* @__PURE__ */
|
|
4929
|
+
onClick ? /* @__PURE__ */ jsx57(
|
|
4643
4930
|
Link,
|
|
4644
4931
|
{
|
|
4645
4932
|
onClick: (e) => {
|
|
@@ -4651,28 +4938,28 @@ var ObjectSearchResultItem = ({
|
|
|
4651
4938
|
text: title != null ? title : name,
|
|
4652
4939
|
css: ObjectSearchResultItemTitleLink
|
|
4653
4940
|
}
|
|
4654
|
-
) : /* @__PURE__ */
|
|
4655
|
-
!popoverData ? null : /* @__PURE__ */
|
|
4941
|
+
) : /* @__PURE__ */ jsx57("span", { children: title != null ? title : name }),
|
|
4942
|
+
!popoverData ? null : /* @__PURE__ */ jsx57(Popover2, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4656
4943
|
] }),
|
|
4657
4944
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4658
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */
|
|
4945
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx57(Chip2, { theme: legacyThemeMapper(publishStatus.theme), text: publishStatus.text, size: "xs" }),
|
|
4659
4946
|
!createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchUpdateGroup, children: [
|
|
4660
4947
|
!createdAt ? null : /* @__PURE__ */ jsxs27("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4661
|
-
/* @__PURE__ */
|
|
4948
|
+
/* @__PURE__ */ jsx57("strong", { children: "Last updated: " }),
|
|
4662
4949
|
timeagoFormat(createdAt)
|
|
4663
4950
|
] }),
|
|
4664
4951
|
!publishedAt ? null : /* @__PURE__ */ jsxs27("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4665
|
-
/* @__PURE__ */
|
|
4952
|
+
/* @__PURE__ */ jsx57("strong", { children: "Last published: " }),
|
|
4666
4953
|
timeagoFormat(publishedAt)
|
|
4667
4954
|
] })
|
|
4668
4955
|
] })
|
|
4669
4956
|
] }),
|
|
4670
|
-
/* @__PURE__ */
|
|
4957
|
+
/* @__PURE__ */ jsx57("div", { children })
|
|
4671
4958
|
] })
|
|
4672
4959
|
] }) }),
|
|
4673
4960
|
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4674
|
-
!editLink ? null : /* @__PURE__ */
|
|
4675
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
4961
|
+
!editLink ? null : /* @__PURE__ */ jsx57(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4962
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx57(Button3, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4676
4963
|
] })
|
|
4677
4964
|
] });
|
|
4678
4965
|
};
|
|
@@ -4699,32 +4986,32 @@ import {
|
|
|
4699
4986
|
import { Button as Button4, Counter } from "@uniformdev/design-system";
|
|
4700
4987
|
|
|
4701
4988
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4702
|
-
import { css as
|
|
4703
|
-
var ObjectSearchResultListContainer =
|
|
4989
|
+
import { css as css21 } from "@emotion/react";
|
|
4990
|
+
var ObjectSearchResultListContainer = css21`
|
|
4704
4991
|
align-items: center;
|
|
4705
4992
|
display: flex;
|
|
4706
4993
|
gap: var(--spacing-sm);
|
|
4707
4994
|
justify-content: space-between;
|
|
4708
4995
|
`;
|
|
4709
|
-
var ObjectSearchDragContainer =
|
|
4996
|
+
var ObjectSearchDragContainer = css21`
|
|
4710
4997
|
margin: 0 0 var(--spacing-sm);
|
|
4711
4998
|
`;
|
|
4712
|
-
var ObjectSearchContainerDragging =
|
|
4999
|
+
var ObjectSearchContainerDragging = css21`
|
|
4713
5000
|
box-shadow: var(--shadow-base);
|
|
4714
5001
|
opacity: var(--opacity-50);
|
|
4715
5002
|
`;
|
|
4716
|
-
var ObjectSearchResultListCounterContainer =
|
|
5003
|
+
var ObjectSearchResultListCounterContainer = css21`
|
|
4717
5004
|
align-items: center;
|
|
4718
5005
|
display: flex;
|
|
4719
5006
|
gap: var(--spacing-sm);
|
|
4720
5007
|
`;
|
|
4721
|
-
var ObjectSearchResultListTitle =
|
|
5008
|
+
var ObjectSearchResultListTitle = css21`
|
|
4722
5009
|
font-weight: var(--fw-bold);
|
|
4723
5010
|
line-height: 1;
|
|
4724
5011
|
`;
|
|
4725
5012
|
|
|
4726
5013
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4727
|
-
import { Fragment as
|
|
5014
|
+
import { Fragment as Fragment11, jsx as jsx58, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4728
5015
|
var DroppableHack2 = Droppable2;
|
|
4729
5016
|
var DraggableHack2 = Draggable2;
|
|
4730
5017
|
function ObjectSearchResultList({
|
|
@@ -4734,7 +5021,7 @@ function ObjectSearchResultList({
|
|
|
4734
5021
|
hideRemoveButton = false,
|
|
4735
5022
|
resultLabelOverride,
|
|
4736
5023
|
additionalButtons,
|
|
4737
|
-
renderResultComponent = (value) => /* @__PURE__ */
|
|
5024
|
+
renderResultComponent = (value) => /* @__PURE__ */ jsx58(ObjectSearchResultItem, { ...value }),
|
|
4738
5025
|
multiSelectId,
|
|
4739
5026
|
disableDnD = false,
|
|
4740
5027
|
getContainerForDnDReparenting,
|
|
@@ -4761,7 +5048,7 @@ function ObjectSearchResultList({
|
|
|
4761
5048
|
...item,
|
|
4762
5049
|
disableDnD: selectedListItems.length === 1 || disableDnD
|
|
4763
5050
|
});
|
|
4764
|
-
return /* @__PURE__ */
|
|
5051
|
+
return /* @__PURE__ */ jsx58(
|
|
4765
5052
|
"div",
|
|
4766
5053
|
{
|
|
4767
5054
|
css: [
|
|
@@ -4776,16 +5063,16 @@ function ObjectSearchResultList({
|
|
|
4776
5063
|
}
|
|
4777
5064
|
);
|
|
4778
5065
|
};
|
|
4779
|
-
return /* @__PURE__ */ jsxs28(
|
|
5066
|
+
return /* @__PURE__ */ jsxs28(Fragment11, { children: [
|
|
4780
5067
|
/* @__PURE__ */ jsxs28("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
4781
5068
|
!resultLabelOverride ? /* @__PURE__ */ jsxs28("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
4782
|
-
/* @__PURE__ */
|
|
5069
|
+
/* @__PURE__ */ jsx58("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
4783
5070
|
" ",
|
|
4784
|
-
!selectedListItems.length ? null : /* @__PURE__ */
|
|
5071
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx58(Counter, { count: selectedListItems.length })
|
|
4785
5072
|
] }) : resultLabelOverride,
|
|
4786
5073
|
/* @__PURE__ */ jsxs28("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
4787
5074
|
additionalButtons,
|
|
4788
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
5075
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx58(
|
|
4789
5076
|
Button4,
|
|
4790
5077
|
{
|
|
4791
5078
|
buttonType: "ghostDestructive",
|
|
@@ -4797,7 +5084,7 @@ function ObjectSearchResultList({
|
|
|
4797
5084
|
)
|
|
4798
5085
|
] })
|
|
4799
5086
|
] }),
|
|
4800
|
-
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */
|
|
5087
|
+
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ jsx58(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx58(
|
|
4801
5088
|
DroppableHack2,
|
|
4802
5089
|
{
|
|
4803
5090
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
@@ -4805,7 +5092,7 @@ function ObjectSearchResultList({
|
|
|
4805
5092
|
getContainerForClone: getContainerForDnDReparenting,
|
|
4806
5093
|
children: (provided) => /* @__PURE__ */ jsxs28("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4807
5094
|
selectedListItems.map((item, i) => {
|
|
4808
|
-
return /* @__PURE__ */
|
|
5095
|
+
return /* @__PURE__ */ jsx58(
|
|
4809
5096
|
DraggableHack2,
|
|
4810
5097
|
{
|
|
4811
5098
|
draggableId: item.id,
|
|
@@ -4825,8 +5112,8 @@ function ObjectSearchResultList({
|
|
|
4825
5112
|
|
|
4826
5113
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
4827
5114
|
import { DebouncedInputKeywordSearch as DebouncedInputKeywordSearch2, Input as Input4, InputSelect as InputSelect4, VerticalRhythm as VerticalRhythm4 } from "@uniformdev/design-system";
|
|
4828
|
-
import { useEffect as
|
|
4829
|
-
import { jsx as
|
|
5115
|
+
import { useEffect as useEffect16, useState as useState15 } from "react";
|
|
5116
|
+
import { jsx as jsx59, jsxs as jsxs29 } from "@emotion/react/jsx-runtime";
|
|
4830
5117
|
var QueryFilter = ({
|
|
4831
5118
|
requireContentType,
|
|
4832
5119
|
queryFilterTitle = "Configure Query",
|
|
@@ -4854,7 +5141,7 @@ var QueryFilter = ({
|
|
|
4854
5141
|
}) => {
|
|
4855
5142
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4856
5143
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4857
|
-
const [queryState, setQueryState] =
|
|
5144
|
+
const [queryState, setQueryState] = useState15({
|
|
4858
5145
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4859
5146
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
4860
5147
|
count: (_c = query.count) != null ? _c : 5,
|
|
@@ -4865,13 +5152,13 @@ var QueryFilter = ({
|
|
|
4865
5152
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4866
5153
|
onSetQuery({ ...query, ...value });
|
|
4867
5154
|
};
|
|
4868
|
-
|
|
5155
|
+
useEffect16(() => {
|
|
4869
5156
|
onSetQuery(queryState);
|
|
4870
5157
|
}, []);
|
|
4871
5158
|
return /* @__PURE__ */ jsxs29("fieldset", { children: [
|
|
4872
|
-
/* @__PURE__ */
|
|
4873
|
-
/* @__PURE__ */
|
|
4874
|
-
/* @__PURE__ */
|
|
5159
|
+
/* @__PURE__ */ jsx59("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
5160
|
+
/* @__PURE__ */ jsx59("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs29(VerticalRhythm4, { children: [
|
|
5161
|
+
/* @__PURE__ */ jsx59(
|
|
4875
5162
|
InputVariables,
|
|
4876
5163
|
{
|
|
4877
5164
|
label: searchInputLabel,
|
|
@@ -4879,7 +5166,7 @@ var QueryFilter = ({
|
|
|
4879
5166
|
onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
|
|
4880
5167
|
disableInlineMenu: true,
|
|
4881
5168
|
id: "qf_searchText",
|
|
4882
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5169
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4883
5170
|
DebouncedInputKeywordSearch2,
|
|
4884
5171
|
{
|
|
4885
5172
|
id: "qf_searchText",
|
|
@@ -4894,7 +5181,7 @@ var QueryFilter = ({
|
|
|
4894
5181
|
}
|
|
4895
5182
|
),
|
|
4896
5183
|
/* @__PURE__ */ jsxs29("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
|
|
4897
|
-
/* @__PURE__ */
|
|
5184
|
+
/* @__PURE__ */ jsx59(
|
|
4898
5185
|
InputVariables,
|
|
4899
5186
|
{
|
|
4900
5187
|
label: contentTypeLabel,
|
|
@@ -4902,7 +5189,7 @@ var QueryFilter = ({
|
|
|
4902
5189
|
value: (_g = queryState.contentType) != null ? _g : "",
|
|
4903
5190
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
4904
5191
|
disableInlineMenu: true,
|
|
4905
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5192
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4906
5193
|
InputSelect4,
|
|
4907
5194
|
{
|
|
4908
5195
|
id: "qf_contentType",
|
|
@@ -4916,7 +5203,7 @@ var QueryFilter = ({
|
|
|
4916
5203
|
)
|
|
4917
5204
|
}
|
|
4918
5205
|
),
|
|
4919
|
-
/* @__PURE__ */
|
|
5206
|
+
/* @__PURE__ */ jsx59(
|
|
4920
5207
|
InputVariables,
|
|
4921
5208
|
{
|
|
4922
5209
|
label: countLabel,
|
|
@@ -4925,7 +5212,7 @@ var QueryFilter = ({
|
|
|
4925
5212
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
4926
5213
|
disableInlineMenu: true,
|
|
4927
5214
|
valueToResetTo: "5",
|
|
4928
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5215
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4929
5216
|
Input4,
|
|
4930
5217
|
{
|
|
4931
5218
|
id: "qf_count",
|
|
@@ -4941,7 +5228,7 @@ var QueryFilter = ({
|
|
|
4941
5228
|
)
|
|
4942
5229
|
] }),
|
|
4943
5230
|
/* @__PURE__ */ jsxs29("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
|
|
4944
|
-
/* @__PURE__ */
|
|
5231
|
+
/* @__PURE__ */ jsx59(
|
|
4945
5232
|
InputVariables,
|
|
4946
5233
|
{
|
|
4947
5234
|
id: "qf_sortBy",
|
|
@@ -4949,7 +5236,7 @@ var QueryFilter = ({
|
|
|
4949
5236
|
value: queryState.sortBy,
|
|
4950
5237
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
4951
5238
|
disableInlineMenu: true,
|
|
4952
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5239
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4953
5240
|
InputSelect4,
|
|
4954
5241
|
{
|
|
4955
5242
|
label: sortLabel,
|
|
@@ -4963,7 +5250,7 @@ var QueryFilter = ({
|
|
|
4963
5250
|
)
|
|
4964
5251
|
}
|
|
4965
5252
|
),
|
|
4966
|
-
/* @__PURE__ */
|
|
5253
|
+
/* @__PURE__ */ jsx59(
|
|
4967
5254
|
InputVariables,
|
|
4968
5255
|
{
|
|
4969
5256
|
label: sortOrderLabel,
|
|
@@ -4971,7 +5258,7 @@ var QueryFilter = ({
|
|
|
4971
5258
|
value: queryState.sortOrder,
|
|
4972
5259
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
4973
5260
|
disableInlineMenu: true,
|
|
4974
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
5261
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx59(
|
|
4975
5262
|
InputSelect4,
|
|
4976
5263
|
{
|
|
4977
5264
|
label: sortOrderLabel,
|
|
@@ -4991,8 +5278,8 @@ var QueryFilter = ({
|
|
|
4991
5278
|
};
|
|
4992
5279
|
|
|
4993
5280
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
4994
|
-
import { useEffect as
|
|
4995
|
-
import { jsx as
|
|
5281
|
+
import { useEffect as useEffect17, useMemo as useMemo16, useRef as useRef9 } from "react";
|
|
5282
|
+
import { jsx as jsx60 } from "@emotion/react/jsx-runtime";
|
|
4996
5283
|
function ParamTypeDynamicDataProvider(props) {
|
|
4997
5284
|
const { children } = props;
|
|
4998
5285
|
const {
|
|
@@ -5000,11 +5287,11 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
5000
5287
|
} = useMeshLocation("paramType");
|
|
5001
5288
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5002
5289
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
5003
|
-
const variables =
|
|
5290
|
+
const variables = useMemo16(
|
|
5004
5291
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
5005
5292
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
5006
5293
|
);
|
|
5007
|
-
return /* @__PURE__ */
|
|
5294
|
+
return /* @__PURE__ */ jsx60(VariablesProvider, { value: variables, onChange: () => {
|
|
5008
5295
|
}, editVariableComponent: JsonMeshVariableEditor, children });
|
|
5009
5296
|
}
|
|
5010
5297
|
var JsonMeshVariableEditor = ({
|
|
@@ -5013,9 +5300,9 @@ var JsonMeshVariableEditor = ({
|
|
|
5013
5300
|
variable,
|
|
5014
5301
|
context
|
|
5015
5302
|
}) => {
|
|
5016
|
-
const sillyRef =
|
|
5303
|
+
const sillyRef = useRef9(false);
|
|
5017
5304
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
5018
|
-
|
|
5305
|
+
useEffect17(() => {
|
|
5019
5306
|
if (sillyRef.current) {
|
|
5020
5307
|
return;
|
|
5021
5308
|
}
|
|
@@ -5485,9 +5772,9 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5485
5772
|
|
|
5486
5773
|
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
5487
5774
|
import { Input as Input5 } from "@uniformdev/design-system";
|
|
5488
|
-
import { useState as
|
|
5775
|
+
import { useState as useState16 } from "react";
|
|
5489
5776
|
import { useDebounce as useDebounce2 } from "react-use";
|
|
5490
|
-
import { jsx as
|
|
5777
|
+
import { jsx as jsx61 } from "@emotion/react/jsx-runtime";
|
|
5491
5778
|
var DateEditor = ({
|
|
5492
5779
|
onChange,
|
|
5493
5780
|
ariaLabel,
|
|
@@ -5496,9 +5783,9 @@ var DateEditor = ({
|
|
|
5496
5783
|
readOnly,
|
|
5497
5784
|
valueTestId
|
|
5498
5785
|
}) => {
|
|
5499
|
-
const [innerValue, setInnerValue] =
|
|
5786
|
+
const [innerValue, setInnerValue] = useState16(value != null ? value : "");
|
|
5500
5787
|
useDebounce2(() => onChange(innerValue), 500, [innerValue]);
|
|
5501
|
-
return /* @__PURE__ */
|
|
5788
|
+
return /* @__PURE__ */ jsx61(
|
|
5502
5789
|
Input5,
|
|
5503
5790
|
{
|
|
5504
5791
|
type: "date",
|
|
@@ -5515,21 +5802,21 @@ var DateEditor = ({
|
|
|
5515
5802
|
|
|
5516
5803
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5517
5804
|
import { Input as Input6 } from "@uniformdev/design-system";
|
|
5518
|
-
import { useEffect as
|
|
5805
|
+
import { useEffect as useEffect18, useState as useState17 } from "react";
|
|
5519
5806
|
import { useDebounce as useDebounce3 } from "react-use";
|
|
5520
5807
|
|
|
5521
5808
|
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
5522
5809
|
import { FieldMessage } from "@uniformdev/design-system";
|
|
5523
|
-
import { jsx as
|
|
5810
|
+
import { jsx as jsx62 } from "@emotion/react/jsx-runtime";
|
|
5524
5811
|
var ErrorContainer = ({ errorMessage }) => {
|
|
5525
|
-
return /* @__PURE__ */
|
|
5812
|
+
return /* @__PURE__ */ jsx62(
|
|
5526
5813
|
"div",
|
|
5527
5814
|
{
|
|
5528
5815
|
css: {
|
|
5529
5816
|
gridColumn: "span 6",
|
|
5530
5817
|
order: 6
|
|
5531
5818
|
},
|
|
5532
|
-
children: /* @__PURE__ */
|
|
5819
|
+
children: /* @__PURE__ */ jsx62(FieldMessage, { errorMessage })
|
|
5533
5820
|
}
|
|
5534
5821
|
);
|
|
5535
5822
|
};
|
|
@@ -5542,7 +5829,7 @@ var twoColumnGrid = {
|
|
|
5542
5829
|
};
|
|
5543
5830
|
|
|
5544
5831
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5545
|
-
import { Fragment as
|
|
5832
|
+
import { Fragment as Fragment12, jsx as jsx63, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
|
|
5546
5833
|
var DateRangeEditor = ({
|
|
5547
5834
|
ariaLabel,
|
|
5548
5835
|
onChange,
|
|
@@ -5551,9 +5838,9 @@ var DateRangeEditor = ({
|
|
|
5551
5838
|
readOnly,
|
|
5552
5839
|
valueTestId
|
|
5553
5840
|
}) => {
|
|
5554
|
-
const [minDateValue, setMinDateValue] =
|
|
5555
|
-
const [maxDateValue, setMaxDateValue] =
|
|
5556
|
-
const [error, setError] =
|
|
5841
|
+
const [minDateValue, setMinDateValue] = useState17(value ? value[0] : "");
|
|
5842
|
+
const [maxDateValue, setMaxDateValue] = useState17(value ? value[1] : "");
|
|
5843
|
+
const [error, setError] = useState17("");
|
|
5557
5844
|
useDebounce3(
|
|
5558
5845
|
() => {
|
|
5559
5846
|
if (minDateValue && maxDateValue && !error) {
|
|
@@ -5565,7 +5852,7 @@ var DateRangeEditor = ({
|
|
|
5565
5852
|
500,
|
|
5566
5853
|
[minDateValue, maxDateValue]
|
|
5567
5854
|
);
|
|
5568
|
-
|
|
5855
|
+
useEffect18(() => {
|
|
5569
5856
|
if (!minDateValue || !maxDateValue) {
|
|
5570
5857
|
return;
|
|
5571
5858
|
}
|
|
@@ -5600,9 +5887,9 @@ var DateRangeEditor = ({
|
|
|
5600
5887
|
setMaxDateValue("");
|
|
5601
5888
|
}
|
|
5602
5889
|
}, [minDateValue, maxDateValue, setError]);
|
|
5603
|
-
return /* @__PURE__ */ jsxs30(
|
|
5890
|
+
return /* @__PURE__ */ jsxs30(Fragment12, { children: [
|
|
5604
5891
|
/* @__PURE__ */ jsxs30("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
5605
|
-
/* @__PURE__ */
|
|
5892
|
+
/* @__PURE__ */ jsx63(
|
|
5606
5893
|
Input6,
|
|
5607
5894
|
{
|
|
5608
5895
|
label: `${ariaLabel}-min-date`,
|
|
@@ -5616,7 +5903,7 @@ var DateRangeEditor = ({
|
|
|
5616
5903
|
"data-testid": "value-low"
|
|
5617
5904
|
}
|
|
5618
5905
|
),
|
|
5619
|
-
/* @__PURE__ */
|
|
5906
|
+
/* @__PURE__ */ jsx63(
|
|
5620
5907
|
Input6,
|
|
5621
5908
|
{
|
|
5622
5909
|
label: `${ariaLabel}-max-date`,
|
|
@@ -5631,7 +5918,7 @@ var DateRangeEditor = ({
|
|
|
5631
5918
|
}
|
|
5632
5919
|
)
|
|
5633
5920
|
] }),
|
|
5634
|
-
/* @__PURE__ */
|
|
5921
|
+
/* @__PURE__ */ jsx63(ErrorContainer, { errorMessage: error })
|
|
5635
5922
|
] });
|
|
5636
5923
|
};
|
|
5637
5924
|
|
|
@@ -5641,7 +5928,7 @@ import {
|
|
|
5641
5928
|
getComboBoxSelectedSelectableGroups,
|
|
5642
5929
|
InputComboBox
|
|
5643
5930
|
} from "@uniformdev/design-system";
|
|
5644
|
-
import { useMemo as
|
|
5931
|
+
import { useMemo as useMemo17 } from "react";
|
|
5645
5932
|
|
|
5646
5933
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5647
5934
|
var readOnlyAttributes = {
|
|
@@ -5651,7 +5938,7 @@ var readOnlyAttributes = {
|
|
|
5651
5938
|
};
|
|
5652
5939
|
|
|
5653
5940
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5654
|
-
import { jsx as
|
|
5941
|
+
import { jsx as jsx64 } from "@emotion/react/jsx-runtime";
|
|
5655
5942
|
var FilterMultiChoiceEditor = ({
|
|
5656
5943
|
value,
|
|
5657
5944
|
options,
|
|
@@ -5662,11 +5949,11 @@ var FilterMultiChoiceEditor = ({
|
|
|
5662
5949
|
}) => {
|
|
5663
5950
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5664
5951
|
const isClearable = !readOnly || !disabled;
|
|
5665
|
-
const { groupedOptions, selectedOptions } =
|
|
5952
|
+
const { groupedOptions, selectedOptions } = useMemo17(
|
|
5666
5953
|
() => convertComboBoxGroupsToSelectableGroups({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5667
5954
|
[options, value]
|
|
5668
5955
|
);
|
|
5669
|
-
return /* @__PURE__ */
|
|
5956
|
+
return /* @__PURE__ */ jsx64("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx64(
|
|
5670
5957
|
InputComboBox,
|
|
5671
5958
|
{
|
|
5672
5959
|
...props,
|
|
@@ -5699,8 +5986,8 @@ import {
|
|
|
5699
5986
|
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups2,
|
|
5700
5987
|
InputComboBox as InputComboBox2
|
|
5701
5988
|
} from "@uniformdev/design-system";
|
|
5702
|
-
import { useMemo as
|
|
5703
|
-
import { jsx as
|
|
5989
|
+
import { useMemo as useMemo18 } from "react";
|
|
5990
|
+
import { jsx as jsx65 } from "@emotion/react/jsx-runtime";
|
|
5704
5991
|
var FilterSingleChoiceEditor = ({
|
|
5705
5992
|
options,
|
|
5706
5993
|
value,
|
|
@@ -5710,7 +5997,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
5710
5997
|
valueTestId
|
|
5711
5998
|
}) => {
|
|
5712
5999
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5713
|
-
const { groupedOptions, selectedOptions } =
|
|
6000
|
+
const { groupedOptions, selectedOptions } = useMemo18(
|
|
5714
6001
|
() => convertComboBoxGroupsToSelectableGroups2({
|
|
5715
6002
|
options: options != null ? options : [],
|
|
5716
6003
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
@@ -5718,7 +6005,7 @@ var FilterSingleChoiceEditor = ({
|
|
|
5718
6005
|
}),
|
|
5719
6006
|
[options, value]
|
|
5720
6007
|
);
|
|
5721
|
-
return /* @__PURE__ */
|
|
6008
|
+
return /* @__PURE__ */ jsx65("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx65(
|
|
5722
6009
|
InputComboBox2,
|
|
5723
6010
|
{
|
|
5724
6011
|
placeholder: "Type to search...",
|
|
@@ -5748,9 +6035,9 @@ var FilterSingleChoiceEditor = ({
|
|
|
5748
6035
|
|
|
5749
6036
|
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
5750
6037
|
import { Input as Input7 } from "@uniformdev/design-system";
|
|
5751
|
-
import { useState as
|
|
6038
|
+
import { useState as useState18 } from "react";
|
|
5752
6039
|
import { useDebounce as useDebounce4 } from "react-use";
|
|
5753
|
-
import { jsx as
|
|
6040
|
+
import { jsx as jsx66 } from "@emotion/react/jsx-runtime";
|
|
5754
6041
|
var NumberEditor = ({
|
|
5755
6042
|
ariaLabel,
|
|
5756
6043
|
onChange,
|
|
@@ -5759,9 +6046,9 @@ var NumberEditor = ({
|
|
|
5759
6046
|
readOnly,
|
|
5760
6047
|
valueTestId
|
|
5761
6048
|
}) => {
|
|
5762
|
-
const [innerValue, setInnerValue] =
|
|
6049
|
+
const [innerValue, setInnerValue] = useState18(value != null ? value : "");
|
|
5763
6050
|
useDebounce4(() => onChange(innerValue), 500, [innerValue]);
|
|
5764
|
-
return /* @__PURE__ */
|
|
6051
|
+
return /* @__PURE__ */ jsx66(
|
|
5765
6052
|
Input7,
|
|
5766
6053
|
{
|
|
5767
6054
|
label: ariaLabel,
|
|
@@ -5779,9 +6066,9 @@ var NumberEditor = ({
|
|
|
5779
6066
|
|
|
5780
6067
|
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
5781
6068
|
import { Input as Input8 } from "@uniformdev/design-system";
|
|
5782
|
-
import { useEffect as
|
|
6069
|
+
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
5783
6070
|
import { useDebounce as useDebounce5 } from "react-use";
|
|
5784
|
-
import { Fragment as
|
|
6071
|
+
import { Fragment as Fragment13, jsx as jsx67, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
5785
6072
|
var NumberRangeEditor = ({
|
|
5786
6073
|
onChange,
|
|
5787
6074
|
disabled,
|
|
@@ -5790,9 +6077,9 @@ var NumberRangeEditor = ({
|
|
|
5790
6077
|
readOnly,
|
|
5791
6078
|
valueTestId
|
|
5792
6079
|
}) => {
|
|
5793
|
-
const [minValue, setMinValue] =
|
|
5794
|
-
const [maxValue, setMaxValue] =
|
|
5795
|
-
const [error, setError] =
|
|
6080
|
+
const [minValue, setMinValue] = useState19("");
|
|
6081
|
+
const [maxValue, setMaxValue] = useState19("");
|
|
6082
|
+
const [error, setError] = useState19("");
|
|
5796
6083
|
useDebounce5(
|
|
5797
6084
|
() => {
|
|
5798
6085
|
if (minValue && maxValue && !error) {
|
|
@@ -5804,7 +6091,7 @@ var NumberRangeEditor = ({
|
|
|
5804
6091
|
500,
|
|
5805
6092
|
[minValue, maxValue]
|
|
5806
6093
|
);
|
|
5807
|
-
|
|
6094
|
+
useEffect19(() => {
|
|
5808
6095
|
if (!maxValue && !minValue) {
|
|
5809
6096
|
return;
|
|
5810
6097
|
}
|
|
@@ -5826,9 +6113,9 @@ var NumberRangeEditor = ({
|
|
|
5826
6113
|
setMaxValue(maxValue);
|
|
5827
6114
|
}
|
|
5828
6115
|
}, [maxValue, minValue, setError]);
|
|
5829
|
-
return /* @__PURE__ */ jsxs31(
|
|
6116
|
+
return /* @__PURE__ */ jsxs31(Fragment13, { children: [
|
|
5830
6117
|
/* @__PURE__ */ jsxs31("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
5831
|
-
/* @__PURE__ */
|
|
6118
|
+
/* @__PURE__ */ jsx67(
|
|
5832
6119
|
Input8,
|
|
5833
6120
|
{
|
|
5834
6121
|
label: `${ariaLabel}-min`,
|
|
@@ -5844,7 +6131,7 @@ var NumberRangeEditor = ({
|
|
|
5844
6131
|
"data-testid": "value-low"
|
|
5845
6132
|
}
|
|
5846
6133
|
),
|
|
5847
|
-
/* @__PURE__ */
|
|
6134
|
+
/* @__PURE__ */ jsx67(
|
|
5848
6135
|
Input8,
|
|
5849
6136
|
{
|
|
5850
6137
|
type: "number",
|
|
@@ -5861,7 +6148,7 @@ var NumberRangeEditor = ({
|
|
|
5861
6148
|
}
|
|
5862
6149
|
)
|
|
5863
6150
|
] }),
|
|
5864
|
-
/* @__PURE__ */
|
|
6151
|
+
/* @__PURE__ */ jsx67(ErrorContainer, { errorMessage: error })
|
|
5865
6152
|
] });
|
|
5866
6153
|
};
|
|
5867
6154
|
|
|
@@ -5871,13 +6158,13 @@ import {
|
|
|
5871
6158
|
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups2,
|
|
5872
6159
|
InputComboBox as InputComboBox3
|
|
5873
6160
|
} from "@uniformdev/design-system";
|
|
5874
|
-
import { useMemo as
|
|
6161
|
+
import { useMemo as useMemo19 } from "react";
|
|
5875
6162
|
|
|
5876
6163
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
5877
6164
|
import { StatusBullet } from "@uniformdev/design-system";
|
|
5878
|
-
import { jsx as
|
|
6165
|
+
import { jsx as jsx68 } from "@emotion/react/jsx-runtime";
|
|
5879
6166
|
var CustomOptions = ({ label, value }) => {
|
|
5880
|
-
return /* @__PURE__ */
|
|
6167
|
+
return /* @__PURE__ */ jsx68(
|
|
5881
6168
|
StatusBullet,
|
|
5882
6169
|
{
|
|
5883
6170
|
status: label,
|
|
@@ -5887,7 +6174,7 @@ var CustomOptions = ({ label, value }) => {
|
|
|
5887
6174
|
};
|
|
5888
6175
|
|
|
5889
6176
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
5890
|
-
import { jsx as
|
|
6177
|
+
import { jsx as jsx69 } from "@emotion/react/jsx-runtime";
|
|
5891
6178
|
var StatusMultiEditor = ({
|
|
5892
6179
|
options,
|
|
5893
6180
|
value,
|
|
@@ -5897,11 +6184,11 @@ var StatusMultiEditor = ({
|
|
|
5897
6184
|
valueTestId
|
|
5898
6185
|
}) => {
|
|
5899
6186
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5900
|
-
const { groupedOptions, selectedOptions } =
|
|
6187
|
+
const { groupedOptions, selectedOptions } = useMemo19(
|
|
5901
6188
|
() => convertComboBoxGroupsToSelectableGroups3({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5902
6189
|
[options, value]
|
|
5903
6190
|
);
|
|
5904
|
-
return /* @__PURE__ */
|
|
6191
|
+
return /* @__PURE__ */ jsx69("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx69(
|
|
5905
6192
|
InputComboBox3,
|
|
5906
6193
|
{
|
|
5907
6194
|
options: groupedOptions != null ? groupedOptions : [],
|
|
@@ -5932,8 +6219,8 @@ import {
|
|
|
5932
6219
|
convertComboBoxGroupsToSelectableGroups as convertComboBoxGroupsToSelectableGroups4,
|
|
5933
6220
|
InputComboBox as InputComboBox4
|
|
5934
6221
|
} from "@uniformdev/design-system";
|
|
5935
|
-
import { useMemo as
|
|
5936
|
-
import { jsx as
|
|
6222
|
+
import { useMemo as useMemo20 } from "react";
|
|
6223
|
+
import { jsx as jsx70 } from "@emotion/react/jsx-runtime";
|
|
5937
6224
|
var StatusSingleEditor = ({
|
|
5938
6225
|
options,
|
|
5939
6226
|
value,
|
|
@@ -5943,7 +6230,7 @@ var StatusSingleEditor = ({
|
|
|
5943
6230
|
valueTestId
|
|
5944
6231
|
}) => {
|
|
5945
6232
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5946
|
-
const { groupedOptions, selectedOptions } =
|
|
6233
|
+
const { groupedOptions, selectedOptions } = useMemo20(
|
|
5947
6234
|
() => convertComboBoxGroupsToSelectableGroups4({
|
|
5948
6235
|
options: options != null ? options : [],
|
|
5949
6236
|
selectedItems: new Set(value ? [value] : void 0),
|
|
@@ -5951,7 +6238,7 @@ var StatusSingleEditor = ({
|
|
|
5951
6238
|
}),
|
|
5952
6239
|
[options, value]
|
|
5953
6240
|
);
|
|
5954
|
-
return /* @__PURE__ */
|
|
6241
|
+
return /* @__PURE__ */ jsx70("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx70(
|
|
5955
6242
|
InputComboBox4,
|
|
5956
6243
|
{
|
|
5957
6244
|
options: groupedOptions,
|
|
@@ -5980,9 +6267,9 @@ var StatusSingleEditor = ({
|
|
|
5980
6267
|
|
|
5981
6268
|
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
5982
6269
|
import { Input as Input9 } from "@uniformdev/design-system";
|
|
5983
|
-
import { useState as
|
|
6270
|
+
import { useState as useState20 } from "react";
|
|
5984
6271
|
import { useDebounce as useDebounce6 } from "react-use";
|
|
5985
|
-
import { jsx as
|
|
6272
|
+
import { jsx as jsx71 } from "@emotion/react/jsx-runtime";
|
|
5986
6273
|
var TextEditor = ({
|
|
5987
6274
|
onChange,
|
|
5988
6275
|
ariaLabel,
|
|
@@ -5990,9 +6277,9 @@ var TextEditor = ({
|
|
|
5990
6277
|
readOnly,
|
|
5991
6278
|
valueTestId
|
|
5992
6279
|
}) => {
|
|
5993
|
-
const [innerValue, setInnerValue] =
|
|
6280
|
+
const [innerValue, setInnerValue] = useState20(value != null ? value : "");
|
|
5994
6281
|
useDebounce6(() => onChange(innerValue), 500, [innerValue]);
|
|
5995
|
-
return /* @__PURE__ */
|
|
6282
|
+
return /* @__PURE__ */ jsx71(
|
|
5996
6283
|
Input9,
|
|
5997
6284
|
{
|
|
5998
6285
|
showLabel: false,
|
|
@@ -6012,8 +6299,8 @@ import {
|
|
|
6012
6299
|
getComboBoxSelectedSelectableGroups as getComboBoxSelectedSelectableGroups3,
|
|
6013
6300
|
InputCreatableComboBox
|
|
6014
6301
|
} from "@uniformdev/design-system";
|
|
6015
|
-
import { useMemo as
|
|
6016
|
-
import { jsx as
|
|
6302
|
+
import { useMemo as useMemo21 } from "react";
|
|
6303
|
+
import { jsx as jsx72 } from "@emotion/react/jsx-runtime";
|
|
6017
6304
|
var TextMultiChoiceEditor = ({
|
|
6018
6305
|
value,
|
|
6019
6306
|
disabled,
|
|
@@ -6023,13 +6310,13 @@ var TextMultiChoiceEditor = ({
|
|
|
6023
6310
|
}) => {
|
|
6024
6311
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6025
6312
|
const isClearable = !readOnly || !disabled;
|
|
6026
|
-
const { groupedOptions, selectedOptions } =
|
|
6313
|
+
const { groupedOptions, selectedOptions } = useMemo21(() => {
|
|
6027
6314
|
var _a;
|
|
6028
6315
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
6029
6316
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
6030
6317
|
return convertComboBoxGroupsToSelectableGroups5({ options, selectedItems: new Set(value) });
|
|
6031
6318
|
}, [value]);
|
|
6032
|
-
return /* @__PURE__ */
|
|
6319
|
+
return /* @__PURE__ */ jsx72("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx72(
|
|
6033
6320
|
InputCreatableComboBox,
|
|
6034
6321
|
{
|
|
6035
6322
|
...props,
|
|
@@ -6062,21 +6349,21 @@ var TextMultiChoiceEditor = ({
|
|
|
6062
6349
|
import { Counter as Counter2, customIcons, Icon as Icon2 } from "@uniformdev/design-system";
|
|
6063
6350
|
|
|
6064
6351
|
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
6065
|
-
import { css as
|
|
6352
|
+
import { css as css22 } from "@emotion/react";
|
|
6066
6353
|
import { cq, fadeInLtr } from "@uniformdev/design-system";
|
|
6067
|
-
var SearchAndFilterControlsWrapper = (gridColumns) =>
|
|
6354
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => css22`
|
|
6068
6355
|
align-items: stretch;
|
|
6069
6356
|
display: grid;
|
|
6070
6357
|
grid-template-columns: ${gridColumns};
|
|
6071
6358
|
gap: var(--spacing-sm);
|
|
6072
6359
|
`;
|
|
6073
|
-
var SearchAndFilterOutterControlWrapper = (gridColumns) =>
|
|
6360
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => css22`
|
|
6074
6361
|
align-items: stretch;
|
|
6075
6362
|
display: grid;
|
|
6076
6363
|
grid-template-columns: ${gridColumns};
|
|
6077
6364
|
gap: var(--spacing-sm);
|
|
6078
6365
|
`;
|
|
6079
|
-
var ConditionalFilterRow =
|
|
6366
|
+
var ConditionalFilterRow = css22`
|
|
6080
6367
|
align-items: baseline;
|
|
6081
6368
|
display: grid;
|
|
6082
6369
|
grid-template-columns: 35px 1fr;
|
|
@@ -6112,7 +6399,7 @@ var ConditionalFilterRow = css21`
|
|
|
6112
6399
|
animation: ${fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
6113
6400
|
}
|
|
6114
6401
|
`;
|
|
6115
|
-
var ConditionalInputRow =
|
|
6402
|
+
var ConditionalInputRow = css22`
|
|
6116
6403
|
display: flex;
|
|
6117
6404
|
gap: var(--spacing-sm);
|
|
6118
6405
|
flex-wrap: wrap;
|
|
@@ -6136,16 +6423,16 @@ var ConditionalInputRow = css21`
|
|
|
6136
6423
|
}
|
|
6137
6424
|
}
|
|
6138
6425
|
`;
|
|
6139
|
-
var ConditionalInputRowEmpty =
|
|
6426
|
+
var ConditionalInputRowEmpty = css22`
|
|
6140
6427
|
flex-wrap: nowrap;
|
|
6141
6428
|
`;
|
|
6142
|
-
var SearchInput =
|
|
6429
|
+
var SearchInput = css22`
|
|
6143
6430
|
&& {
|
|
6144
6431
|
max-height: 40px;
|
|
6145
6432
|
min-height: unset;
|
|
6146
6433
|
}
|
|
6147
6434
|
`;
|
|
6148
|
-
var BindableKeywordSearchInputStyles =
|
|
6435
|
+
var BindableKeywordSearchInputStyles = css22`
|
|
6149
6436
|
position: relative;
|
|
6150
6437
|
width: 100%;
|
|
6151
6438
|
|
|
@@ -6160,19 +6447,19 @@ var BindableKeywordSearchInputStyles = css21`
|
|
|
6160
6447
|
white-space: nowrap;
|
|
6161
6448
|
}
|
|
6162
6449
|
`;
|
|
6163
|
-
var ClearSearchButtonContainer =
|
|
6450
|
+
var ClearSearchButtonContainer = css22`
|
|
6164
6451
|
align-items: center;
|
|
6165
6452
|
display: flex;
|
|
6166
6453
|
position: absolute;
|
|
6167
6454
|
inset: 0 var(--spacing-lg) 0 auto;
|
|
6168
6455
|
`;
|
|
6169
|
-
var ClearSearchButtonStyles =
|
|
6456
|
+
var ClearSearchButtonStyles = css22`
|
|
6170
6457
|
background: none;
|
|
6171
6458
|
border: none;
|
|
6172
6459
|
padding: 0;
|
|
6173
6460
|
pointer-events: all;
|
|
6174
6461
|
`;
|
|
6175
|
-
var FilterButton =
|
|
6462
|
+
var FilterButton = css22`
|
|
6176
6463
|
align-items: center;
|
|
6177
6464
|
background: var(--white);
|
|
6178
6465
|
border: 1px solid var(--gray-300);
|
|
@@ -6209,13 +6496,13 @@ var FilterButton = css21`
|
|
|
6209
6496
|
opacity: var(--opacity-50);
|
|
6210
6497
|
}
|
|
6211
6498
|
`;
|
|
6212
|
-
var FilterButtonText =
|
|
6499
|
+
var FilterButtonText = css22`
|
|
6213
6500
|
overflow: hidden;
|
|
6214
6501
|
text-overflow: ellipsis;
|
|
6215
6502
|
white-space: nowrap;
|
|
6216
6503
|
max-width: 14ch;
|
|
6217
6504
|
`;
|
|
6218
|
-
var FilterButtonSelected =
|
|
6505
|
+
var FilterButtonSelected = css22`
|
|
6219
6506
|
background: var(--gray-100);
|
|
6220
6507
|
border-color: var(--gray-300);
|
|
6221
6508
|
|
|
@@ -6223,7 +6510,7 @@ var FilterButtonSelected = css21`
|
|
|
6223
6510
|
color: var(--accent-dark);
|
|
6224
6511
|
}
|
|
6225
6512
|
`;
|
|
6226
|
-
var FilterButtonWithOptions =
|
|
6513
|
+
var FilterButtonWithOptions = css22`
|
|
6227
6514
|
:where([aria-expanded='true']) {
|
|
6228
6515
|
background: var(--purple-rain-100);
|
|
6229
6516
|
border-color: var(--accent-light);
|
|
@@ -6235,14 +6522,14 @@ var FilterButtonWithOptions = css21`
|
|
|
6235
6522
|
}
|
|
6236
6523
|
}
|
|
6237
6524
|
`;
|
|
6238
|
-
var SearchIcon =
|
|
6525
|
+
var SearchIcon = css22`
|
|
6239
6526
|
color: var(--icon-color);
|
|
6240
6527
|
position: absolute;
|
|
6241
6528
|
inset: 0 var(--spacing-base) 0 auto;
|
|
6242
6529
|
margin: auto;
|
|
6243
6530
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
6244
6531
|
`;
|
|
6245
|
-
var AddConditionalBtn =
|
|
6532
|
+
var AddConditionalBtn = css22`
|
|
6246
6533
|
align-items: center;
|
|
6247
6534
|
background: transparent;
|
|
6248
6535
|
border: none;
|
|
@@ -6261,14 +6548,14 @@ var AddConditionalBtn = css21`
|
|
|
6261
6548
|
color: var(--gray-400);
|
|
6262
6549
|
}
|
|
6263
6550
|
`;
|
|
6264
|
-
var Title =
|
|
6551
|
+
var Title = css22`
|
|
6265
6552
|
color: var(--typography-light);
|
|
6266
6553
|
|
|
6267
6554
|
&:focus {
|
|
6268
6555
|
outline: none;
|
|
6269
6556
|
}
|
|
6270
6557
|
`;
|
|
6271
|
-
var ResetConditionsBtn =
|
|
6558
|
+
var ResetConditionsBtn = css22`
|
|
6272
6559
|
background: transparent;
|
|
6273
6560
|
border: none;
|
|
6274
6561
|
color: var(--action-destructive-default);
|
|
@@ -6283,7 +6570,7 @@ var ResetConditionsBtn = css21`
|
|
|
6283
6570
|
color: var(--gray-400);
|
|
6284
6571
|
}
|
|
6285
6572
|
`;
|
|
6286
|
-
var CriteriaGroupOperatorTrigger =
|
|
6573
|
+
var CriteriaGroupOperatorTrigger = css22`
|
|
6287
6574
|
&& {
|
|
6288
6575
|
padding: 0;
|
|
6289
6576
|
border-radius: var(--rounded-sm);
|
|
@@ -6302,13 +6589,13 @@ var CriteriaGroupOperatorTrigger = css21`
|
|
|
6302
6589
|
}
|
|
6303
6590
|
}
|
|
6304
6591
|
`;
|
|
6305
|
-
var IconBtn =
|
|
6592
|
+
var IconBtn = css22`
|
|
6306
6593
|
align-self: center;
|
|
6307
6594
|
background: transparent;
|
|
6308
6595
|
border: none;
|
|
6309
6596
|
padding: var(--spacing-sm);
|
|
6310
6597
|
`;
|
|
6311
|
-
var SearchAndFilterOptionsContainer =
|
|
6598
|
+
var SearchAndFilterOptionsContainer = css22`
|
|
6312
6599
|
background: var(--gray-50);
|
|
6313
6600
|
border: 1px solid var(--gray-300);
|
|
6314
6601
|
border-radius: var(--rounded-base);
|
|
@@ -6319,17 +6606,17 @@ var SearchAndFilterOptionsContainer = css21`
|
|
|
6319
6606
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6320
6607
|
will-change: height;
|
|
6321
6608
|
`;
|
|
6322
|
-
var SearchAndFilterOptionsInnerContainer =
|
|
6609
|
+
var SearchAndFilterOptionsInnerContainer = css22`
|
|
6323
6610
|
display: flex;
|
|
6324
6611
|
flex-direction: column;
|
|
6325
6612
|
gap: var(--spacing-sm);
|
|
6326
6613
|
padding-inline: var(--spacing-md);
|
|
6327
6614
|
`;
|
|
6328
|
-
var SearchAndFilterButtonGroup =
|
|
6615
|
+
var SearchAndFilterButtonGroup = css22`
|
|
6329
6616
|
margin-top: var(--spacing-xs);
|
|
6330
6617
|
margin-left: calc(56px + var(--spacing-md));
|
|
6331
6618
|
`;
|
|
6332
|
-
var SearchAndFilterAdditionalContainer =
|
|
6619
|
+
var SearchAndFilterAdditionalContainer = css22`
|
|
6333
6620
|
align-items: center;
|
|
6334
6621
|
border-top: 1px solid var(--gray-300);
|
|
6335
6622
|
display: flex;
|
|
@@ -6339,7 +6626,7 @@ var SearchAndFilterAdditionalContainer = css21`
|
|
|
6339
6626
|
`;
|
|
6340
6627
|
|
|
6341
6628
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
6342
|
-
import { jsx as
|
|
6629
|
+
import { jsx as jsx73, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
|
|
6343
6630
|
var FilterButton2 = ({
|
|
6344
6631
|
text = "Filters",
|
|
6345
6632
|
icon = customIcons["filter-add"],
|
|
@@ -6361,10 +6648,10 @@ var FilterButton2 = ({
|
|
|
6361
6648
|
...props,
|
|
6362
6649
|
"data-testid": dataTestId,
|
|
6363
6650
|
children: [
|
|
6364
|
-
/* @__PURE__ */
|
|
6365
|
-
/* @__PURE__ */
|
|
6366
|
-
filterCount ? /* @__PURE__ */
|
|
6367
|
-
showDropdownIcon ? /* @__PURE__ */
|
|
6651
|
+
/* @__PURE__ */ jsx73(Icon2, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
6652
|
+
/* @__PURE__ */ jsx73("span", { css: FilterButtonText, children: text }),
|
|
6653
|
+
filterCount ? /* @__PURE__ */ jsx73(Counter2, { count: filterCount, bgColor: "var(--white)" }) : null,
|
|
6654
|
+
showDropdownIcon ? /* @__PURE__ */ jsx73(Icon2, { icon: "chevron-down", iconColor: "currentColor", size: "1rem" }) : null
|
|
6368
6655
|
]
|
|
6369
6656
|
}
|
|
6370
6657
|
);
|
|
@@ -6375,31 +6662,31 @@ import { CgClose } from "@react-icons/all-files/cg/CgClose";
|
|
|
6375
6662
|
import { hasReferencedVariables as hasReferencedVariables2 } from "@uniformdev/canvas";
|
|
6376
6663
|
import { Icon as Icon3, InputKeywordSearch } from "@uniformdev/design-system";
|
|
6377
6664
|
import { CLEAR_EDITOR_COMMAND as CLEAR_EDITOR_COMMAND2 } from "lexical";
|
|
6378
|
-
import { useEffect as
|
|
6665
|
+
import { useEffect as useEffect21, useRef as useRef10, useState as useState22 } from "react";
|
|
6379
6666
|
import { useDebounce as useDebounce7 } from "react-use";
|
|
6380
6667
|
import { v4 as v42 } from "uuid";
|
|
6381
6668
|
|
|
6382
6669
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6383
6670
|
import { VerticalRhythm as VerticalRhythm5 } from "@uniformdev/design-system";
|
|
6384
6671
|
import {
|
|
6385
|
-
createContext as
|
|
6386
|
-
useCallback as
|
|
6387
|
-
useContext as
|
|
6672
|
+
createContext as createContext8,
|
|
6673
|
+
useCallback as useCallback7,
|
|
6674
|
+
useContext as useContext8,
|
|
6388
6675
|
useDeferredValue as useDeferredValue2,
|
|
6389
|
-
useEffect as
|
|
6390
|
-
useMemo as
|
|
6391
|
-
useState as
|
|
6676
|
+
useEffect as useEffect20,
|
|
6677
|
+
useMemo as useMemo22,
|
|
6678
|
+
useState as useState21
|
|
6392
6679
|
} from "react";
|
|
6393
6680
|
|
|
6394
6681
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
6395
|
-
import { jsx as
|
|
6682
|
+
import { jsx as jsx74 } from "@emotion/react/jsx-runtime";
|
|
6396
6683
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
6397
6684
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
6398
6685
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
6399
6686
|
if (!Editor || editorType === "empty") {
|
|
6400
|
-
return /* @__PURE__ */
|
|
6687
|
+
return /* @__PURE__ */ jsx74("span", {});
|
|
6401
6688
|
}
|
|
6402
|
-
return /* @__PURE__ */
|
|
6689
|
+
return /* @__PURE__ */ jsx74(Editor, { ...props });
|
|
6403
6690
|
};
|
|
6404
6691
|
var filterMapper = {
|
|
6405
6692
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -6417,9 +6704,9 @@ var filterMapper = {
|
|
|
6417
6704
|
function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
6418
6705
|
const WithInputVariables = (props) => {
|
|
6419
6706
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
6420
|
-
return /* @__PURE__ */
|
|
6707
|
+
return /* @__PURE__ */ jsx74(WrappedComponent, { ...props });
|
|
6421
6708
|
}
|
|
6422
|
-
return /* @__PURE__ */
|
|
6709
|
+
return /* @__PURE__ */ jsx74(
|
|
6423
6710
|
InputVariables,
|
|
6424
6711
|
{
|
|
6425
6712
|
"data-testid": "filter-value",
|
|
@@ -6428,7 +6715,7 @@ function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
|
6428
6715
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
6429
6716
|
value: props.value,
|
|
6430
6717
|
disabled: props.disabled,
|
|
6431
|
-
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */
|
|
6718
|
+
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ jsx74(WrappedComponent, { ...props })
|
|
6432
6719
|
}
|
|
6433
6720
|
);
|
|
6434
6721
|
};
|
|
@@ -6438,9 +6725,9 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6438
6725
|
const WithInputVariables = (props) => {
|
|
6439
6726
|
var _a;
|
|
6440
6727
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
6441
|
-
return /* @__PURE__ */
|
|
6728
|
+
return /* @__PURE__ */ jsx74(WrappedComponent, { ...props });
|
|
6442
6729
|
}
|
|
6443
|
-
return /* @__PURE__ */
|
|
6730
|
+
return /* @__PURE__ */ jsx74(
|
|
6444
6731
|
InputVariables,
|
|
6445
6732
|
{
|
|
6446
6733
|
"data-testid": "filter-value",
|
|
@@ -6448,7 +6735,7 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6448
6735
|
showMenuPosition: "inline-right",
|
|
6449
6736
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
6450
6737
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
6451
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
6738
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx74(WrappedComponent, { ...props })
|
|
6452
6739
|
}
|
|
6453
6740
|
);
|
|
6454
6741
|
};
|
|
@@ -6464,8 +6751,8 @@ var bindableFiltersMapper = {
|
|
|
6464
6751
|
};
|
|
6465
6752
|
|
|
6466
6753
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6467
|
-
import { jsx as
|
|
6468
|
-
var SearchAndFilterContext =
|
|
6754
|
+
import { jsx as jsx75 } from "@emotion/react/jsx-runtime";
|
|
6755
|
+
var SearchAndFilterContext = createContext8({
|
|
6469
6756
|
searchTerm: "",
|
|
6470
6757
|
setSearchTerm: () => {
|
|
6471
6758
|
},
|
|
@@ -6504,17 +6791,17 @@ var SearchAndFilterProvider = ({
|
|
|
6504
6791
|
children,
|
|
6505
6792
|
allowBindingSearchTerm
|
|
6506
6793
|
}) => {
|
|
6507
|
-
const [searchTerm, setSearchTerm] =
|
|
6794
|
+
const [searchTerm, setSearchTerm] = useState21(defaultSearchTerm);
|
|
6508
6795
|
const deferredSearchTerm = useDeferredValue2(searchTerm);
|
|
6509
|
-
const [filterVisibility, setFilterVisibility] =
|
|
6510
|
-
const handleSearchTerm =
|
|
6796
|
+
const [filterVisibility, setFilterVisibility] = useState21(alwaysVisible || filterVisible);
|
|
6797
|
+
const handleSearchTerm = useCallback7(
|
|
6511
6798
|
(term) => {
|
|
6512
6799
|
setSearchTerm(term);
|
|
6513
6800
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
6514
6801
|
},
|
|
6515
6802
|
[setSearchTerm, onSearchChange]
|
|
6516
6803
|
);
|
|
6517
|
-
const handleToggleFilterVisibility =
|
|
6804
|
+
const handleToggleFilterVisibility = useCallback7(
|
|
6518
6805
|
(visible) => {
|
|
6519
6806
|
if (alwaysVisible) {
|
|
6520
6807
|
return;
|
|
@@ -6523,10 +6810,10 @@ var SearchAndFilterProvider = ({
|
|
|
6523
6810
|
},
|
|
6524
6811
|
[alwaysVisible]
|
|
6525
6812
|
);
|
|
6526
|
-
const handleAddFilter =
|
|
6813
|
+
const handleAddFilter = useCallback7(() => {
|
|
6527
6814
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6528
6815
|
}, [filters, onChange]);
|
|
6529
|
-
const handleResetFilters =
|
|
6816
|
+
const handleResetFilters = useCallback7(() => {
|
|
6530
6817
|
setSearchTerm("");
|
|
6531
6818
|
if (onResetFilterValues) {
|
|
6532
6819
|
return onResetFilterValues();
|
|
@@ -6534,20 +6821,20 @@ var SearchAndFilterProvider = ({
|
|
|
6534
6821
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6535
6822
|
onChange(resetFilterValues);
|
|
6536
6823
|
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6537
|
-
const handleDeleteFilter =
|
|
6824
|
+
const handleDeleteFilter = useCallback7(
|
|
6538
6825
|
(index) => {
|
|
6539
6826
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
6540
6827
|
onChange(remainingFilters);
|
|
6541
6828
|
},
|
|
6542
6829
|
[filters, onChange]
|
|
6543
6830
|
);
|
|
6544
|
-
const validFilterQuery =
|
|
6831
|
+
const validFilterQuery = useMemo22(() => {
|
|
6545
6832
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6546
6833
|
if (hasValidFilters) {
|
|
6547
6834
|
return filters;
|
|
6548
6835
|
}
|
|
6549
6836
|
}, [filters]);
|
|
6550
|
-
|
|
6837
|
+
useEffect20(() => {
|
|
6551
6838
|
if (filterVisibility) {
|
|
6552
6839
|
const handleEscKeyFilterClose = (e) => {
|
|
6553
6840
|
if (e.key === "Escape") {
|
|
@@ -6560,7 +6847,7 @@ var SearchAndFilterProvider = ({
|
|
|
6560
6847
|
};
|
|
6561
6848
|
}
|
|
6562
6849
|
}, [filterVisibility, handleToggleFilterVisibility]);
|
|
6563
|
-
return /* @__PURE__ */
|
|
6850
|
+
return /* @__PURE__ */ jsx75(
|
|
6564
6851
|
SearchAndFilterContext.Provider,
|
|
6565
6852
|
{
|
|
6566
6853
|
value: {
|
|
@@ -6580,17 +6867,17 @@ var SearchAndFilterProvider = ({
|
|
|
6580
6867
|
filterMapper: filterMapper2,
|
|
6581
6868
|
allowBindingSearchTerm
|
|
6582
6869
|
},
|
|
6583
|
-
children: /* @__PURE__ */
|
|
6870
|
+
children: /* @__PURE__ */ jsx75(VerticalRhythm5, { children })
|
|
6584
6871
|
}
|
|
6585
6872
|
);
|
|
6586
6873
|
};
|
|
6587
6874
|
var useSearchAndFilter = () => {
|
|
6588
|
-
const value =
|
|
6875
|
+
const value = useContext8(SearchAndFilterContext);
|
|
6589
6876
|
return { ...value };
|
|
6590
6877
|
};
|
|
6591
6878
|
|
|
6592
6879
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
6593
|
-
import { Fragment as
|
|
6880
|
+
import { Fragment as Fragment14, jsx as jsx76, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
6594
6881
|
var FilterControls = ({
|
|
6595
6882
|
children,
|
|
6596
6883
|
hideSearchInput
|
|
@@ -6603,10 +6890,10 @@ var FilterControls = ({
|
|
|
6603
6890
|
searchTerm,
|
|
6604
6891
|
allowBindingSearchTerm
|
|
6605
6892
|
} = useSearchAndFilter();
|
|
6606
|
-
const editorRef =
|
|
6893
|
+
const editorRef = useRef10(null);
|
|
6607
6894
|
const variableRefernceCountInSearchTerm = hasReferencedVariables2(searchTerm);
|
|
6608
|
-
const [idToResetInputVariables, setIdToResetInputVariables] =
|
|
6609
|
-
const [localSearchTerm, setLocalSearchTerm] =
|
|
6895
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = useState22("data-resource-search-term-input");
|
|
6896
|
+
const [localSearchTerm, setLocalSearchTerm] = useState22(searchTerm);
|
|
6610
6897
|
useDebounce7(
|
|
6611
6898
|
() => {
|
|
6612
6899
|
if (localSearchTerm !== searchTerm) {
|
|
@@ -6616,14 +6903,14 @@ var FilterControls = ({
|
|
|
6616
6903
|
300,
|
|
6617
6904
|
[localSearchTerm]
|
|
6618
6905
|
);
|
|
6619
|
-
|
|
6906
|
+
useEffect21(() => {
|
|
6620
6907
|
if (searchTerm === "") {
|
|
6621
6908
|
setLocalSearchTerm("");
|
|
6622
6909
|
setIdToResetInputVariables(`data-resource-search-term-input-${v42()}`);
|
|
6623
6910
|
}
|
|
6624
6911
|
}, [searchTerm]);
|
|
6625
|
-
return /* @__PURE__ */ jsxs33(
|
|
6626
|
-
/* @__PURE__ */
|
|
6912
|
+
return /* @__PURE__ */ jsxs33(Fragment14, { children: [
|
|
6913
|
+
/* @__PURE__ */ jsx76(
|
|
6627
6914
|
FilterButton2,
|
|
6628
6915
|
{
|
|
6629
6916
|
"aria-controls": "search-and-filter-options",
|
|
@@ -6637,7 +6924,7 @@ var FilterControls = ({
|
|
|
6637
6924
|
}
|
|
6638
6925
|
),
|
|
6639
6926
|
hideSearchInput ? null : /* @__PURE__ */ jsxs33("div", { css: BindableKeywordSearchInputStyles, "data-testid": "search-container", children: [
|
|
6640
|
-
/* @__PURE__ */
|
|
6927
|
+
/* @__PURE__ */ jsx76(
|
|
6641
6928
|
InputVariables,
|
|
6642
6929
|
{
|
|
6643
6930
|
label: "",
|
|
@@ -6647,7 +6934,7 @@ var FilterControls = ({
|
|
|
6647
6934
|
value: localSearchTerm,
|
|
6648
6935
|
onChange: (value) => setLocalSearchTerm(value != null ? value : ""),
|
|
6649
6936
|
disableVariables: !allowBindingSearchTerm,
|
|
6650
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
6937
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx76(
|
|
6651
6938
|
InputKeywordSearch,
|
|
6652
6939
|
{
|
|
6653
6940
|
placeholder: "Search...",
|
|
@@ -6666,7 +6953,7 @@ var FilterControls = ({
|
|
|
6666
6953
|
)
|
|
6667
6954
|
}
|
|
6668
6955
|
),
|
|
6669
|
-
variableRefernceCountInSearchTerm ? /* @__PURE__ */
|
|
6956
|
+
variableRefernceCountInSearchTerm ? /* @__PURE__ */ jsx76("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ jsx76(
|
|
6670
6957
|
"button",
|
|
6671
6958
|
{
|
|
6672
6959
|
css: ClearSearchButtonStyles,
|
|
@@ -6680,7 +6967,7 @@ var FilterControls = ({
|
|
|
6680
6967
|
},
|
|
6681
6968
|
type: "button",
|
|
6682
6969
|
"data-testid": "keyword-search-clear-button",
|
|
6683
|
-
children: /* @__PURE__ */
|
|
6970
|
+
children: /* @__PURE__ */ jsx76(Icon3, { icon: CgClose, iconColor: "red", size: "1rem" })
|
|
6684
6971
|
}
|
|
6685
6972
|
) }) : null
|
|
6686
6973
|
] }),
|
|
@@ -6697,7 +6984,7 @@ import {
|
|
|
6697
6984
|
Menu as Menu3,
|
|
6698
6985
|
SelectableMenuItem
|
|
6699
6986
|
} from "@uniformdev/design-system";
|
|
6700
|
-
import { useMemo as
|
|
6987
|
+
import { useMemo as useMemo23 } from "react";
|
|
6701
6988
|
|
|
6702
6989
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
6703
6990
|
function isFilterBindable(filter, operator) {
|
|
@@ -6706,7 +6993,7 @@ function isFilterBindable(filter, operator) {
|
|
|
6706
6993
|
}
|
|
6707
6994
|
|
|
6708
6995
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6709
|
-
import { jsx as
|
|
6996
|
+
import { jsx as jsx77, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
6710
6997
|
var FilterItem = ({
|
|
6711
6998
|
index,
|
|
6712
6999
|
operatorOptions,
|
|
@@ -6725,7 +7012,7 @@ var FilterItem = ({
|
|
|
6725
7012
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
6726
7013
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
6727
7014
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
6728
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } =
|
|
7015
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = useMemo23(() => {
|
|
6729
7016
|
var _a2;
|
|
6730
7017
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
6731
7018
|
var _a3;
|
|
@@ -6758,7 +7045,7 @@ var FilterItem = ({
|
|
|
6758
7045
|
const joinLabel = index === 0 ? initialCriteriaTitle : index === 1 && onCriteriaGroupOperatorChange ? /* @__PURE__ */ jsxs34(
|
|
6759
7046
|
Menu3,
|
|
6760
7047
|
{
|
|
6761
|
-
menuTrigger: /* @__PURE__ */
|
|
7048
|
+
menuTrigger: /* @__PURE__ */ jsx77(
|
|
6762
7049
|
DropdownStyleMenuTrigger,
|
|
6763
7050
|
{
|
|
6764
7051
|
bgColor: "transparent",
|
|
@@ -6771,7 +7058,7 @@ var FilterItem = ({
|
|
|
6771
7058
|
size: "small",
|
|
6772
7059
|
placement: "bottom-start",
|
|
6773
7060
|
children: [
|
|
6774
|
-
/* @__PURE__ */
|
|
7061
|
+
/* @__PURE__ */ jsx77(
|
|
6775
7062
|
SelectableMenuItem,
|
|
6776
7063
|
{
|
|
6777
7064
|
selected: criteriaGroupOperator === "and",
|
|
@@ -6780,7 +7067,7 @@ var FilterItem = ({
|
|
|
6780
7067
|
children: "and"
|
|
6781
7068
|
}
|
|
6782
7069
|
),
|
|
6783
|
-
/* @__PURE__ */
|
|
7070
|
+
/* @__PURE__ */ jsx77(
|
|
6784
7071
|
SelectableMenuItem,
|
|
6785
7072
|
{
|
|
6786
7073
|
selected: criteriaGroupOperator === "or",
|
|
@@ -6793,9 +7080,9 @@ var FilterItem = ({
|
|
|
6793
7080
|
}
|
|
6794
7081
|
) : criteriaGroupOperator;
|
|
6795
7082
|
return /* @__PURE__ */ jsxs34("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
6796
|
-
/* @__PURE__ */
|
|
7083
|
+
/* @__PURE__ */ jsx77("span", { children: joinLabel }),
|
|
6797
7084
|
/* @__PURE__ */ jsxs34("div", { css: [ConditionalInputRow, isEmptyOperator ? ConditionalInputRowEmpty : null], children: [
|
|
6798
|
-
CustomLeftHandComponent ? /* @__PURE__ */
|
|
7085
|
+
CustomLeftHandComponent ? /* @__PURE__ */ jsx77(
|
|
6799
7086
|
CustomLeftHandComponent,
|
|
6800
7087
|
{
|
|
6801
7088
|
filterOption: selectedFieldValue,
|
|
@@ -6805,7 +7092,7 @@ var FilterItem = ({
|
|
|
6805
7092
|
onFilterOptionChange("");
|
|
6806
7093
|
}
|
|
6807
7094
|
}
|
|
6808
|
-
) : /* @__PURE__ */
|
|
7095
|
+
) : /* @__PURE__ */ jsx77(
|
|
6809
7096
|
InputComboBox5,
|
|
6810
7097
|
{
|
|
6811
7098
|
"aria-label": label,
|
|
@@ -6832,7 +7119,7 @@ var FilterItem = ({
|
|
|
6832
7119
|
name: `filter-field-${index}`
|
|
6833
7120
|
}
|
|
6834
7121
|
),
|
|
6835
|
-
/* @__PURE__ */
|
|
7122
|
+
/* @__PURE__ */ jsx77(
|
|
6836
7123
|
InputComboBox5,
|
|
6837
7124
|
{
|
|
6838
7125
|
"aria-label": operatorLabel,
|
|
@@ -6856,7 +7143,7 @@ var FilterItem = ({
|
|
|
6856
7143
|
name: `filter-operator-${index}`
|
|
6857
7144
|
}
|
|
6858
7145
|
),
|
|
6859
|
-
/* @__PURE__ */
|
|
7146
|
+
/* @__PURE__ */ jsx77(
|
|
6860
7147
|
FilterEditorRenderer,
|
|
6861
7148
|
{
|
|
6862
7149
|
"aria-label": metaDataLabel,
|
|
@@ -6871,7 +7158,7 @@ var FilterItem = ({
|
|
|
6871
7158
|
filterFieldName: filters[index].field
|
|
6872
7159
|
}
|
|
6873
7160
|
),
|
|
6874
|
-
readOnly ? null : /* @__PURE__ */
|
|
7161
|
+
readOnly ? null : /* @__PURE__ */ jsx77(
|
|
6875
7162
|
"button",
|
|
6876
7163
|
{
|
|
6877
7164
|
type: "button",
|
|
@@ -6880,7 +7167,7 @@ var FilterItem = ({
|
|
|
6880
7167
|
css: IconBtn,
|
|
6881
7168
|
"data-testid": "delete-filter",
|
|
6882
7169
|
disabled: filters.length === 1,
|
|
6883
|
-
children: /* @__PURE__ */
|
|
7170
|
+
children: /* @__PURE__ */ jsx77(Icon4, { icon: CgTrash2, iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
|
|
6884
7171
|
}
|
|
6885
7172
|
)
|
|
6886
7173
|
] })
|
|
@@ -6893,16 +7180,16 @@ import { Icon as Icon5 } from "@uniformdev/design-system";
|
|
|
6893
7180
|
|
|
6894
7181
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
6895
7182
|
import { HorizontalRhythm as HorizontalRhythm8, VerticalRhythm as VerticalRhythm6 } from "@uniformdev/design-system";
|
|
6896
|
-
import
|
|
6897
|
-
import { jsx as
|
|
7183
|
+
import React8, { useEffect as useEffect22 } from "react";
|
|
7184
|
+
import { jsx as jsx78, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6898
7185
|
var SearchAndFilterOptionsContainer2 = ({
|
|
6899
7186
|
buttonRow,
|
|
6900
7187
|
additionalFiltersContainer,
|
|
6901
7188
|
children
|
|
6902
7189
|
}) => {
|
|
6903
7190
|
return /* @__PURE__ */ jsxs35("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
6904
|
-
/* @__PURE__ */
|
|
6905
|
-
buttonRow ? /* @__PURE__ */
|
|
7191
|
+
/* @__PURE__ */ jsx78("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
7192
|
+
buttonRow ? /* @__PURE__ */ jsx78(
|
|
6906
7193
|
HorizontalRhythm8,
|
|
6907
7194
|
{
|
|
6908
7195
|
css: SearchAndFilterButtonGroup,
|
|
@@ -6912,7 +7199,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
6912
7199
|
children: buttonRow
|
|
6913
7200
|
}
|
|
6914
7201
|
) : null,
|
|
6915
|
-
additionalFiltersContainer ? /* @__PURE__ */
|
|
7202
|
+
additionalFiltersContainer ? /* @__PURE__ */ jsx78("div", { css: SearchAndFilterAdditionalContainer, children: additionalFiltersContainer }) : null
|
|
6916
7203
|
] });
|
|
6917
7204
|
};
|
|
6918
7205
|
var FilterMenu = ({
|
|
@@ -6925,22 +7212,22 @@ var FilterMenu = ({
|
|
|
6925
7212
|
resetButtonText = "reset"
|
|
6926
7213
|
}) => {
|
|
6927
7214
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
6928
|
-
const innerMenuRef =
|
|
6929
|
-
|
|
7215
|
+
const innerMenuRef = React8.useRef(null);
|
|
7216
|
+
useEffect22(() => {
|
|
6930
7217
|
var _a;
|
|
6931
7218
|
if (filterVisibility) {
|
|
6932
7219
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
6933
7220
|
}
|
|
6934
7221
|
}, [filterVisibility]);
|
|
6935
|
-
return /* @__PURE__ */
|
|
7222
|
+
return /* @__PURE__ */ jsx78(VerticalRhythm6, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs35(
|
|
6936
7223
|
SearchAndFilterOptionsContainer2,
|
|
6937
7224
|
{
|
|
6938
7225
|
buttonRow: menuControls,
|
|
6939
7226
|
additionalFiltersContainer,
|
|
6940
7227
|
children: [
|
|
6941
7228
|
/* @__PURE__ */ jsxs35(HorizontalRhythm8, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
6942
|
-
filterTitle ? /* @__PURE__ */
|
|
6943
|
-
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */
|
|
7229
|
+
filterTitle ? /* @__PURE__ */ jsx78("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
|
|
7230
|
+
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ jsx78(
|
|
6944
7231
|
"button",
|
|
6945
7232
|
{
|
|
6946
7233
|
type: "button",
|
|
@@ -7051,7 +7338,7 @@ function hasBindings(currentValue) {
|
|
|
7051
7338
|
}
|
|
7052
7339
|
|
|
7053
7340
|
// src/components/SearchAndFilter/FilterItems.tsx
|
|
7054
|
-
import { jsx as
|
|
7341
|
+
import { jsx as jsx79, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
7055
7342
|
var FilterItems = ({
|
|
7056
7343
|
addButtonText = "add condition",
|
|
7057
7344
|
additionalFiltersContainer,
|
|
@@ -7089,7 +7376,7 @@ var FilterItems = ({
|
|
|
7089
7376
|
}
|
|
7090
7377
|
setFilters(next);
|
|
7091
7378
|
};
|
|
7092
|
-
return /* @__PURE__ */
|
|
7379
|
+
return /* @__PURE__ */ jsx79(
|
|
7093
7380
|
FilterMenu,
|
|
7094
7381
|
{
|
|
7095
7382
|
id: "search-and-filter-options",
|
|
@@ -7102,7 +7389,7 @@ var FilterItems = ({
|
|
|
7102
7389
|
onClick: handleAddFilter,
|
|
7103
7390
|
"data-testid": "add-filter",
|
|
7104
7391
|
children: [
|
|
7105
|
-
/* @__PURE__ */
|
|
7392
|
+
/* @__PURE__ */ jsx79(Icon5, { icon: CgMathPlus, iconColor: "currentColor", size: "1rem" }),
|
|
7106
7393
|
addButtonText
|
|
7107
7394
|
]
|
|
7108
7395
|
}
|
|
@@ -7118,7 +7405,7 @@ var FilterItems = ({
|
|
|
7118
7405
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
7119
7406
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
7120
7407
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
7121
|
-
return /* @__PURE__ */
|
|
7408
|
+
return /* @__PURE__ */ jsx79(
|
|
7122
7409
|
FilterItem,
|
|
7123
7410
|
{
|
|
7124
7411
|
index: i,
|
|
@@ -7143,8 +7430,8 @@ var FilterItems = ({
|
|
|
7143
7430
|
import { VerticalRhythm as VerticalRhythm7 } from "@uniformdev/design-system";
|
|
7144
7431
|
|
|
7145
7432
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
7146
|
-
import { Button as Button5, Callout as
|
|
7147
|
-
import { Fragment as
|
|
7433
|
+
import { Button as Button5, Callout as Callout5, HorizontalRhythm as HorizontalRhythm9, Paragraph } from "@uniformdev/design-system";
|
|
7434
|
+
import { Fragment as Fragment15, jsx as jsx80, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
7148
7435
|
var SearchAndFilterResultContainer = ({
|
|
7149
7436
|
buttonText,
|
|
7150
7437
|
clearButtonLabel = "clear",
|
|
@@ -7195,18 +7482,18 @@ var SearchAndFilterResultContainer = ({
|
|
|
7195
7482
|
handleResetFilters();
|
|
7196
7483
|
}
|
|
7197
7484
|
};
|
|
7198
|
-
return /* @__PURE__ */ jsxs37(
|
|
7485
|
+
return /* @__PURE__ */ jsxs37(Fragment15, { children: [
|
|
7199
7486
|
/* @__PURE__ */ jsxs37(HorizontalRhythm9, { children: [
|
|
7200
7487
|
/* @__PURE__ */ jsxs37("span", { children: [
|
|
7201
7488
|
totalResults,
|
|
7202
7489
|
" results ",
|
|
7203
7490
|
searchTerm ? `for "${searchTerm}"` : null
|
|
7204
7491
|
] }),
|
|
7205
|
-
!searchTerm || hideClearButton ? null : /* @__PURE__ */
|
|
7492
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx80(Button5, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
|
|
7206
7493
|
] }),
|
|
7207
|
-
totalResults === 0 ? /* @__PURE__ */ jsxs37(
|
|
7208
|
-
calloutText ? /* @__PURE__ */
|
|
7209
|
-
hideClearButton ? null : /* @__PURE__ */
|
|
7494
|
+
totalResults === 0 ? /* @__PURE__ */ jsxs37(Callout5, { title: automateCalloutTitle, type: "note", children: [
|
|
7495
|
+
calloutText ? /* @__PURE__ */ jsx80(Paragraph, { children: calloutText }) : null,
|
|
7496
|
+
hideClearButton ? null : /* @__PURE__ */ jsx80(
|
|
7210
7497
|
Button5,
|
|
7211
7498
|
{
|
|
7212
7499
|
buttonType: "tertiaryOutline",
|
|
@@ -7221,14 +7508,14 @@ var SearchAndFilterResultContainer = ({
|
|
|
7221
7508
|
};
|
|
7222
7509
|
|
|
7223
7510
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
7224
|
-
import { jsx as
|
|
7511
|
+
import { jsx as jsx81, jsxs as jsxs38 } from "@emotion/react/jsx-runtime";
|
|
7225
7512
|
var SearchAndFilter = ({
|
|
7226
7513
|
filters,
|
|
7227
7514
|
filterOptions,
|
|
7228
7515
|
filterVisible,
|
|
7229
7516
|
filterControls,
|
|
7230
7517
|
viewSwitchControls,
|
|
7231
|
-
resultsContainerView = /* @__PURE__ */
|
|
7518
|
+
resultsContainerView = /* @__PURE__ */ jsx81(SearchAndFilterResultContainer, {}),
|
|
7232
7519
|
filterMapper: filterMapper2 = filterMapper,
|
|
7233
7520
|
additionalFiltersContainer,
|
|
7234
7521
|
onChange,
|
|
@@ -7240,7 +7527,7 @@ var SearchAndFilter = ({
|
|
|
7240
7527
|
resetFilterValues = [],
|
|
7241
7528
|
onResetFilterValues
|
|
7242
7529
|
}) => {
|
|
7243
|
-
return /* @__PURE__ */
|
|
7530
|
+
return /* @__PURE__ */ jsx81(
|
|
7244
7531
|
SearchAndFilterProvider,
|
|
7245
7532
|
{
|
|
7246
7533
|
filters,
|
|
@@ -7257,16 +7544,16 @@ var SearchAndFilter = ({
|
|
|
7257
7544
|
onResetFilterValues,
|
|
7258
7545
|
children: /* @__PURE__ */ jsxs38(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
|
|
7259
7546
|
/* @__PURE__ */ jsxs38("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7260
|
-
/* @__PURE__ */
|
|
7547
|
+
/* @__PURE__ */ jsx81(
|
|
7261
7548
|
"div",
|
|
7262
7549
|
{
|
|
7263
7550
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
7264
|
-
children: !filterControls ? /* @__PURE__ */
|
|
7551
|
+
children: !filterControls ? /* @__PURE__ */ jsx81(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
7265
7552
|
}
|
|
7266
7553
|
),
|
|
7267
7554
|
viewSwitchControls
|
|
7268
7555
|
] }),
|
|
7269
|
-
/* @__PURE__ */
|
|
7556
|
+
/* @__PURE__ */ jsx81(FilterItems, { additionalFiltersContainer }),
|
|
7270
7557
|
resultsContainerView
|
|
7271
7558
|
] })
|
|
7272
7559
|
}
|
|
@@ -7275,17 +7562,17 @@ var SearchAndFilter = ({
|
|
|
7275
7562
|
|
|
7276
7563
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
7277
7564
|
import { InputKeywordSearch as InputKeywordSearch2 } from "@uniformdev/design-system";
|
|
7278
|
-
import { createContext as
|
|
7565
|
+
import { createContext as createContext9, useState as useState23 } from "react";
|
|
7279
7566
|
import { useDebounce as useDebounce8 } from "react-use";
|
|
7280
|
-
import { jsx as
|
|
7281
|
-
var SearchOnlyContext =
|
|
7567
|
+
import { jsx as jsx82 } from "@emotion/react/jsx-runtime";
|
|
7568
|
+
var SearchOnlyContext = createContext9({
|
|
7282
7569
|
searchTerm: "",
|
|
7283
7570
|
setSearchTerm: () => {
|
|
7284
7571
|
}
|
|
7285
7572
|
});
|
|
7286
7573
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
7287
7574
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
7288
|
-
const [localeSearchTerm, setLocaleSearchTerm] =
|
|
7575
|
+
const [localeSearchTerm, setLocaleSearchTerm] = useState23("");
|
|
7289
7576
|
useDebounce8(
|
|
7290
7577
|
() => {
|
|
7291
7578
|
setSearchTerm(localeSearchTerm);
|
|
@@ -7294,14 +7581,14 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7294
7581
|
300,
|
|
7295
7582
|
[localeSearchTerm]
|
|
7296
7583
|
);
|
|
7297
|
-
return /* @__PURE__ */
|
|
7584
|
+
return /* @__PURE__ */ jsx82(
|
|
7298
7585
|
SearchOnlyContext.Provider,
|
|
7299
7586
|
{
|
|
7300
7587
|
value: {
|
|
7301
7588
|
searchTerm,
|
|
7302
7589
|
setSearchTerm: setLocaleSearchTerm
|
|
7303
7590
|
},
|
|
7304
|
-
children: /* @__PURE__ */
|
|
7591
|
+
children: /* @__PURE__ */ jsx82("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx82(
|
|
7305
7592
|
InputKeywordSearch2,
|
|
7306
7593
|
{
|
|
7307
7594
|
placeholder: "Search...",
|
|
@@ -7319,9 +7606,9 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7319
7606
|
import { InputComboBox as InputComboBox6, InputSelect as InputSelect5, SegmentedControl, VerticalRhythm as VerticalRhythm8 } from "@uniformdev/design-system";
|
|
7320
7607
|
|
|
7321
7608
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
7322
|
-
import { css as
|
|
7609
|
+
import { css as css23 } from "@emotion/react";
|
|
7323
7610
|
import { cq as cq2, fadeInLtr as fadeInLtr2 } from "@uniformdev/design-system";
|
|
7324
|
-
var ConditionalFilterRow2 =
|
|
7611
|
+
var ConditionalFilterRow2 = css23`
|
|
7325
7612
|
display: grid;
|
|
7326
7613
|
grid-template-columns: 35px 1fr;
|
|
7327
7614
|
gap: var(--spacing-sm);
|
|
@@ -7358,7 +7645,7 @@ var ConditionalFilterRow2 = css22`
|
|
|
7358
7645
|
animation: ${fadeInLtr2} var(--duration-fast) var(--timing-ease-out);
|
|
7359
7646
|
}
|
|
7360
7647
|
`;
|
|
7361
|
-
var ConditionalInputRow2 =
|
|
7648
|
+
var ConditionalInputRow2 = css23`
|
|
7362
7649
|
display: flex;
|
|
7363
7650
|
gap: var(--spacing-sm);
|
|
7364
7651
|
flex-wrap: wrap;
|
|
@@ -7381,13 +7668,13 @@ var ConditionalInputRow2 = css22`
|
|
|
7381
7668
|
}
|
|
7382
7669
|
}
|
|
7383
7670
|
`;
|
|
7384
|
-
var SearchInput2 =
|
|
7671
|
+
var SearchInput2 = css23`
|
|
7385
7672
|
&& {
|
|
7386
7673
|
max-height: 40px;
|
|
7387
7674
|
min-height: unset;
|
|
7388
7675
|
}
|
|
7389
7676
|
`;
|
|
7390
|
-
var FilterButton3 =
|
|
7677
|
+
var FilterButton3 = css23`
|
|
7391
7678
|
align-items: center;
|
|
7392
7679
|
background: var(--white);
|
|
7393
7680
|
border: 1px solid var(--gray-300);
|
|
@@ -7424,13 +7711,13 @@ var FilterButton3 = css22`
|
|
|
7424
7711
|
opacity: var(--opacity-50);
|
|
7425
7712
|
}
|
|
7426
7713
|
`;
|
|
7427
|
-
var FilterButtonText2 =
|
|
7714
|
+
var FilterButtonText2 = css23`
|
|
7428
7715
|
overflow: hidden;
|
|
7429
7716
|
text-overflow: ellipsis;
|
|
7430
7717
|
white-space: nowrap;
|
|
7431
7718
|
max-width: 14ch;
|
|
7432
7719
|
`;
|
|
7433
|
-
var FilterButtonSelected2 =
|
|
7720
|
+
var FilterButtonSelected2 = css23`
|
|
7434
7721
|
background: var(--gray-100);
|
|
7435
7722
|
border-color: var(--gray-300);
|
|
7436
7723
|
|
|
@@ -7438,7 +7725,7 @@ var FilterButtonSelected2 = css22`
|
|
|
7438
7725
|
color: var(--accent-dark);
|
|
7439
7726
|
}
|
|
7440
7727
|
`;
|
|
7441
|
-
var FilterButtonWithOptions2 =
|
|
7728
|
+
var FilterButtonWithOptions2 = css23`
|
|
7442
7729
|
:where([aria-expanded='true']) {
|
|
7443
7730
|
background: var(--purple-rain-100);
|
|
7444
7731
|
border-color: var(--accent-light);
|
|
@@ -7450,14 +7737,14 @@ var FilterButtonWithOptions2 = css22`
|
|
|
7450
7737
|
}
|
|
7451
7738
|
}
|
|
7452
7739
|
`;
|
|
7453
|
-
var SearchIcon2 =
|
|
7740
|
+
var SearchIcon2 = css23`
|
|
7454
7741
|
color: var(--icon-color);
|
|
7455
7742
|
position: absolute;
|
|
7456
7743
|
inset: 0 var(--spacing-base) 0 auto;
|
|
7457
7744
|
margin: auto;
|
|
7458
7745
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7459
7746
|
`;
|
|
7460
|
-
var AddConditionalBtn2 =
|
|
7747
|
+
var AddConditionalBtn2 = css23`
|
|
7461
7748
|
align-items: center;
|
|
7462
7749
|
background: transparent;
|
|
7463
7750
|
border: none;
|
|
@@ -7476,14 +7763,14 @@ var AddConditionalBtn2 = css22`
|
|
|
7476
7763
|
color: var(--gray-400);
|
|
7477
7764
|
}
|
|
7478
7765
|
`;
|
|
7479
|
-
var Title2 =
|
|
7766
|
+
var Title2 = css23`
|
|
7480
7767
|
color: var(--typography-light);
|
|
7481
7768
|
|
|
7482
7769
|
&:focus {
|
|
7483
7770
|
outline: none;
|
|
7484
7771
|
}
|
|
7485
7772
|
`;
|
|
7486
|
-
var ResetConditionsBtn2 =
|
|
7773
|
+
var ResetConditionsBtn2 = css23`
|
|
7487
7774
|
background: transparent;
|
|
7488
7775
|
border: none;
|
|
7489
7776
|
color: var(--action-destructive-default);
|
|
@@ -7495,12 +7782,12 @@ var ResetConditionsBtn2 = css22`
|
|
|
7495
7782
|
color: var(--action-destructive-hover);
|
|
7496
7783
|
}
|
|
7497
7784
|
`;
|
|
7498
|
-
var IconBtn2 =
|
|
7785
|
+
var IconBtn2 = css23`
|
|
7499
7786
|
background: transparent;
|
|
7500
7787
|
border: none;
|
|
7501
7788
|
padding: var(--spacing-sm);
|
|
7502
7789
|
`;
|
|
7503
|
-
var SearchAndFilterOptionsContainer3 =
|
|
7790
|
+
var SearchAndFilterOptionsContainer3 = css23`
|
|
7504
7791
|
background: var(--gray-50);
|
|
7505
7792
|
border: 1px solid var(--gray-300);
|
|
7506
7793
|
border-radius: var(--rounded-base);
|
|
@@ -7513,17 +7800,17 @@ var SearchAndFilterOptionsContainer3 = css22`
|
|
|
7513
7800
|
position: relative;
|
|
7514
7801
|
z-index: 1;
|
|
7515
7802
|
`;
|
|
7516
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
7803
|
+
var SearchAndFilterOptionsInnerContainer2 = css23`
|
|
7517
7804
|
display: flex;
|
|
7518
7805
|
flex-direction: column;
|
|
7519
7806
|
gap: var(--spacing-sm);
|
|
7520
7807
|
padding-inline: var(--spacing-md);
|
|
7521
7808
|
`;
|
|
7522
|
-
var SearchAndFilterButtonGroup2 =
|
|
7809
|
+
var SearchAndFilterButtonGroup2 = css23`
|
|
7523
7810
|
margin-top: var(--spacing-xs);
|
|
7524
7811
|
margin-left: calc(56px + var(--spacing-md));
|
|
7525
7812
|
`;
|
|
7526
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
7813
|
+
var SortFilterWrapper = (hiddenLocaleInput) => css23`
|
|
7527
7814
|
align-items: center;
|
|
7528
7815
|
display: flex;
|
|
7529
7816
|
gap: var(--spacing-base);
|
|
@@ -7534,13 +7821,13 @@ var SortFilterWrapper = (hiddenLocaleInput) => css22`
|
|
|
7534
7821
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
7535
7822
|
}
|
|
7536
7823
|
`;
|
|
7537
|
-
var SortFilterInputRow =
|
|
7824
|
+
var SortFilterInputRow = css23`
|
|
7538
7825
|
align-items: center;
|
|
7539
7826
|
display: grid;
|
|
7540
7827
|
grid-template-columns: 1fr auto;
|
|
7541
7828
|
gap: var(--spacing-base);
|
|
7542
7829
|
`;
|
|
7543
|
-
var InputVariableWrapper =
|
|
7830
|
+
var InputVariableWrapper = css23`
|
|
7544
7831
|
flex-grow: 1;
|
|
7545
7832
|
|
|
7546
7833
|
// we need to override label styles nested within the input variable
|
|
@@ -7551,7 +7838,7 @@ var InputVariableWrapper = css22`
|
|
|
7551
7838
|
`;
|
|
7552
7839
|
|
|
7553
7840
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
7554
|
-
import { jsx as
|
|
7841
|
+
import { jsx as jsx83, jsxs as jsxs39 } from "@emotion/react/jsx-runtime";
|
|
7555
7842
|
var SortItems = ({
|
|
7556
7843
|
sortByLabel = "Sort by",
|
|
7557
7844
|
localeLabel = "Show locale",
|
|
@@ -7575,9 +7862,9 @@ var SortItems = ({
|
|
|
7575
7862
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
7576
7863
|
return /* @__PURE__ */ jsxs39("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
7577
7864
|
/* @__PURE__ */ jsxs39(VerticalRhythm8, { gap: "xs", children: [
|
|
7578
|
-
/* @__PURE__ */
|
|
7865
|
+
/* @__PURE__ */ jsx83("span", { css: Title2, children: sortByLabel }),
|
|
7579
7866
|
/* @__PURE__ */ jsxs39("div", { css: SortFilterInputRow, children: [
|
|
7580
|
-
/* @__PURE__ */
|
|
7867
|
+
/* @__PURE__ */ jsx83(
|
|
7581
7868
|
InputVariables,
|
|
7582
7869
|
{
|
|
7583
7870
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7585,7 +7872,7 @@ var SortItems = ({
|
|
|
7585
7872
|
value: sortField,
|
|
7586
7873
|
valueToResetTo: "created_at",
|
|
7587
7874
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
7588
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7875
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
7589
7876
|
InputComboBox6,
|
|
7590
7877
|
{
|
|
7591
7878
|
id: "sort-by-field",
|
|
@@ -7608,7 +7895,7 @@ var SortItems = ({
|
|
|
7608
7895
|
)
|
|
7609
7896
|
}
|
|
7610
7897
|
),
|
|
7611
|
-
/* @__PURE__ */
|
|
7898
|
+
/* @__PURE__ */ jsx83(
|
|
7612
7899
|
InputVariables,
|
|
7613
7900
|
{
|
|
7614
7901
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7616,7 +7903,7 @@ var SortItems = ({
|
|
|
7616
7903
|
valueToResetTo: "DESC",
|
|
7617
7904
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
7618
7905
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
7619
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7906
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
7620
7907
|
SegmentedControl,
|
|
7621
7908
|
{
|
|
7622
7909
|
noCheckmark: true,
|
|
@@ -7648,14 +7935,14 @@ var SortItems = ({
|
|
|
7648
7935
|
)
|
|
7649
7936
|
] })
|
|
7650
7937
|
] }),
|
|
7651
|
-
hideLocaleOptions ? null : /* @__PURE__ */
|
|
7938
|
+
hideLocaleOptions ? null : /* @__PURE__ */ jsx83(VerticalRhythm8, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ jsx83(
|
|
7652
7939
|
InputVariables,
|
|
7653
7940
|
{
|
|
7654
7941
|
label: localeLabelValue,
|
|
7655
7942
|
value: localeValue,
|
|
7656
7943
|
showMenuPosition: "inline-right",
|
|
7657
7944
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
7658
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7945
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx83(
|
|
7659
7946
|
InputSelect5,
|
|
7660
7947
|
{
|
|
7661
7948
|
name: "localeReturned",
|
|
@@ -7686,7 +7973,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7686
7973
|
|
|
7687
7974
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7688
7975
|
import { bindVariables as bindVariables2, createVariableReference as createVariableReference4, LOCALE_DYNAMIC_INPUT_NAME as LOCALE_DYNAMIC_INPUT_NAME2 } from "@uniformdev/canvas";
|
|
7689
|
-
import { useEffect as
|
|
7976
|
+
import { useEffect as useEffect23, useRef as useRef11 } from "react";
|
|
7690
7977
|
function useContentDataResourceLocaleInfo({
|
|
7691
7978
|
locale,
|
|
7692
7979
|
defaultLocale,
|
|
@@ -7694,12 +7981,12 @@ function useContentDataResourceLocaleInfo({
|
|
|
7694
7981
|
dynamicInputs
|
|
7695
7982
|
}) {
|
|
7696
7983
|
var _a;
|
|
7697
|
-
const setLocaleRef =
|
|
7984
|
+
const setLocaleRef = useRef11(setLocale);
|
|
7698
7985
|
setLocaleRef.current = setLocale;
|
|
7699
7986
|
const { flatVariables } = useVariables();
|
|
7700
7987
|
const effectiveLocale = locale != null ? locale : dynamicInputs[LOCALE_DYNAMIC_INPUT_NAME2] ? createVariableReference4(LOCALE_DYNAMIC_INPUT_NAME2) : defaultLocale != null ? defaultLocale : "";
|
|
7701
7988
|
const boundLocale = (_a = bindVariables2({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7702
|
-
|
|
7989
|
+
useEffect23(() => {
|
|
7703
7990
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7704
7991
|
setLocaleRef.current(effectiveLocale);
|
|
7705
7992
|
}
|
|
@@ -7711,7 +7998,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
7711
7998
|
import {
|
|
7712
7999
|
AddListButton as AddListButton2,
|
|
7713
8000
|
Button as Button6,
|
|
7714
|
-
Callout as
|
|
8001
|
+
Callout as Callout6,
|
|
7715
8002
|
DrawerContent,
|
|
7716
8003
|
Heading,
|
|
7717
8004
|
Input as Input10,
|
|
@@ -7721,7 +8008,7 @@ import {
|
|
|
7721
8008
|
InputToggle as InputToggle3,
|
|
7722
8009
|
Label,
|
|
7723
8010
|
LoadingIndicator as LoadingIndicator4,
|
|
7724
|
-
LoadingOverlay,
|
|
8011
|
+
LoadingOverlay as LoadingOverlay2,
|
|
7725
8012
|
Menu as Menu4,
|
|
7726
8013
|
MenuItem as MenuItem2,
|
|
7727
8014
|
ParameterGroup,
|
|
@@ -7752,7 +8039,7 @@ export {
|
|
|
7752
8039
|
AddListButton2 as AddListButton,
|
|
7753
8040
|
Button6 as Button,
|
|
7754
8041
|
CHECKBOX_OPERATORS,
|
|
7755
|
-
|
|
8042
|
+
Callout6 as Callout,
|
|
7756
8043
|
ControlledValuePlugin,
|
|
7757
8044
|
DATE_OPERATORS,
|
|
7758
8045
|
DATE_TIME_OPERATORS,
|
|
@@ -7765,6 +8052,10 @@ export {
|
|
|
7765
8052
|
DataTypeEditor,
|
|
7766
8053
|
DateEditor,
|
|
7767
8054
|
DateRangeEditor,
|
|
8055
|
+
DelegationContext,
|
|
8056
|
+
DelegationDisabledError,
|
|
8057
|
+
DelegationGate,
|
|
8058
|
+
DelegationProvider,
|
|
7768
8059
|
DrawerContent,
|
|
7769
8060
|
EDIT_VARIABLE_COMMAND,
|
|
7770
8061
|
FilterButton2 as FilterButton,
|
|
@@ -7787,7 +8078,7 @@ export {
|
|
|
7787
8078
|
Label,
|
|
7788
8079
|
LinkButton,
|
|
7789
8080
|
LoadingIndicator4 as LoadingIndicator,
|
|
7790
|
-
LoadingOverlay,
|
|
8081
|
+
LoadingOverlay2 as LoadingOverlay,
|
|
7791
8082
|
MULTI_SELECT_OPERATORS,
|
|
7792
8083
|
Menu4 as Menu,
|
|
7793
8084
|
MenuItem2 as MenuItem,
|
|
@@ -7866,8 +8157,10 @@ export {
|
|
|
7866
8157
|
VariablesProvider,
|
|
7867
8158
|
bindableFiltersMapper,
|
|
7868
8159
|
convertConnectedDataToVariable,
|
|
8160
|
+
createDelegationFetch,
|
|
7869
8161
|
createLocationValidator,
|
|
7870
8162
|
filterMapper,
|
|
8163
|
+
isDelegationExpiredResponse,
|
|
7871
8164
|
prettifyBindExpression,
|
|
7872
8165
|
readOnlyAttributes,
|
|
7873
8166
|
serializeVariablesEditorSerializedState,
|
|
@@ -7877,6 +8170,8 @@ export {
|
|
|
7877
8170
|
urlEncodeRequestUrl,
|
|
7878
8171
|
useConnectedDataAsVariables,
|
|
7879
8172
|
useContentDataResourceLocaleInfo,
|
|
8173
|
+
useDelegation,
|
|
8174
|
+
useDelegationFetch,
|
|
7880
8175
|
useDynamicInputsAsVariables,
|
|
7881
8176
|
useMeshLocation,
|
|
7882
8177
|
useObjectSearchContext,
|