@uniformdev/mesh-sdk-react 20.50.2-alpha.2 → 20.50.2-alpha.77
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 +115 -5
- package/dist/index.d.ts +115 -5
- package/dist/index.esm.js +528 -322
- package/dist/index.js +844 -634
- package/dist/index.mjs +528 -322
- package/package.json +11 -10
package/dist/index.js
CHANGED
|
@@ -33,10 +33,10 @@ var src_exports = {};
|
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
$createVariableNode: () => $createVariableNode,
|
|
35
35
|
$isVariableNode: () => $isVariableNode,
|
|
36
|
-
AddListButton: () =>
|
|
37
|
-
Button: () =>
|
|
36
|
+
AddListButton: () => import_design_system54.AddListButton,
|
|
37
|
+
Button: () => import_design_system54.Button,
|
|
38
38
|
CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
|
|
39
|
-
Callout: () =>
|
|
39
|
+
Callout: () => import_design_system54.Callout,
|
|
40
40
|
ControlledValuePlugin: () => ControlledValuePlugin,
|
|
41
41
|
DATE_OPERATORS: () => DATE_OPERATORS,
|
|
42
42
|
DATE_TIME_OPERATORS: () => DATE_TIME_OPERATORS,
|
|
@@ -49,7 +49,10 @@ __export(src_exports, {
|
|
|
49
49
|
DataTypeEditor: () => DataTypeEditor,
|
|
50
50
|
DateEditor: () => DateEditor,
|
|
51
51
|
DateRangeEditor: () => DateRangeEditor,
|
|
52
|
-
|
|
52
|
+
DelegationContext: () => DelegationContext,
|
|
53
|
+
DelegationGate: () => DelegationGate,
|
|
54
|
+
DelegationProvider: () => DelegationProvider,
|
|
55
|
+
DrawerContent: () => import_design_system54.DrawerContent,
|
|
53
56
|
EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
|
|
54
57
|
FilterButton: () => FilterButton2,
|
|
55
58
|
FilterControls: () => FilterControls,
|
|
@@ -59,22 +62,22 @@ __export(src_exports, {
|
|
|
59
62
|
FilterMenu: () => FilterMenu,
|
|
60
63
|
FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
|
|
61
64
|
FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
|
|
62
|
-
Heading: () =>
|
|
65
|
+
Heading: () => import_design_system54.Heading,
|
|
63
66
|
INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
|
|
64
67
|
Icons: () => icons_exports,
|
|
65
|
-
Input: () =>
|
|
66
|
-
InputComboBox: () =>
|
|
67
|
-
InputKeywordSearch: () =>
|
|
68
|
-
InputSelect: () =>
|
|
69
|
-
InputToggle: () =>
|
|
68
|
+
Input: () => import_design_system54.Input,
|
|
69
|
+
InputComboBox: () => import_design_system54.InputComboBox,
|
|
70
|
+
InputKeywordSearch: () => import_design_system54.InputKeywordSearch,
|
|
71
|
+
InputSelect: () => import_design_system54.InputSelect,
|
|
72
|
+
InputToggle: () => import_design_system54.InputToggle,
|
|
70
73
|
InputVariables: () => InputVariables,
|
|
71
|
-
Label: () =>
|
|
74
|
+
Label: () => import_design_system54.Label,
|
|
72
75
|
LinkButton: () => LinkButton,
|
|
73
|
-
LoadingIndicator: () =>
|
|
74
|
-
LoadingOverlay: () =>
|
|
76
|
+
LoadingIndicator: () => import_design_system54.LoadingIndicator,
|
|
77
|
+
LoadingOverlay: () => import_design_system54.LoadingOverlay,
|
|
75
78
|
MULTI_SELECT_OPERATORS: () => MULTI_SELECT_OPERATORS,
|
|
76
|
-
Menu: () =>
|
|
77
|
-
MenuItem: () =>
|
|
79
|
+
Menu: () => import_design_system54.Menu,
|
|
80
|
+
MenuItem: () => import_design_system54.MenuItem,
|
|
78
81
|
MeshApp: () => MeshApp,
|
|
79
82
|
NUMBER_OPERATORS: () => NUMBER_OPERATORS,
|
|
80
83
|
NumberEditor: () => NumberEditor,
|
|
@@ -93,22 +96,22 @@ __export(src_exports, {
|
|
|
93
96
|
PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
|
|
94
97
|
ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
|
|
95
98
|
ParameterConnectionIndicator: () => ParameterConnectionIndicator,
|
|
96
|
-
ParameterGroup: () =>
|
|
97
|
-
ParameterImage: () =>
|
|
98
|
-
ParameterImageInner: () =>
|
|
99
|
-
ParameterInput: () =>
|
|
100
|
-
ParameterInputInner: () =>
|
|
101
|
-
ParameterLabel: () =>
|
|
102
|
-
ParameterMenuButton: () =>
|
|
99
|
+
ParameterGroup: () => import_design_system54.ParameterGroup,
|
|
100
|
+
ParameterImage: () => import_design_system54.ParameterImage,
|
|
101
|
+
ParameterImageInner: () => import_design_system54.ParameterImageInner,
|
|
102
|
+
ParameterInput: () => import_design_system54.ParameterInput,
|
|
103
|
+
ParameterInputInner: () => import_design_system54.ParameterInputInner,
|
|
104
|
+
ParameterLabel: () => import_design_system54.ParameterLabel,
|
|
105
|
+
ParameterMenuButton: () => import_design_system54.ParameterMenuButton,
|
|
103
106
|
ParameterOrSingleVariable: () => ParameterOrSingleVariable,
|
|
104
|
-
ParameterSelect: () =>
|
|
105
|
-
ParameterSelectInner: () =>
|
|
106
|
-
ParameterShell: () =>
|
|
107
|
+
ParameterSelect: () => import_design_system54.ParameterSelect,
|
|
108
|
+
ParameterSelectInner: () => import_design_system54.ParameterSelectInner,
|
|
109
|
+
ParameterShell: () => import_design_system54.ParameterShell,
|
|
107
110
|
ParameterShellContext: () => import_design_system2.ParameterShellContext,
|
|
108
|
-
ParameterTextarea: () =>
|
|
109
|
-
ParameterTextareaInner: () =>
|
|
110
|
-
ParameterToggle: () =>
|
|
111
|
-
ParameterToggleInner: () =>
|
|
111
|
+
ParameterTextarea: () => import_design_system54.ParameterTextarea,
|
|
112
|
+
ParameterTextareaInner: () => import_design_system54.ParameterTextareaInner,
|
|
113
|
+
ParameterToggle: () => import_design_system54.ParameterToggle,
|
|
114
|
+
ParameterToggleInner: () => import_design_system54.ParameterToggleInner,
|
|
112
115
|
ParameterVariables: () => ParameterVariables,
|
|
113
116
|
QueryFilter: () => QueryFilter,
|
|
114
117
|
RICHTEXT_OPERATORS: () => RICHTEXT_OPERATORS,
|
|
@@ -122,8 +125,8 @@ __export(src_exports, {
|
|
|
122
125
|
RequestUrlInput: () => RequestUrlInput,
|
|
123
126
|
SELECT_OPERATORS: () => SELECT_OPERATORS,
|
|
124
127
|
SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
|
|
125
|
-
ScrollableList: () =>
|
|
126
|
-
ScrollableListItem: () =>
|
|
128
|
+
ScrollableList: () => import_design_system54.ScrollableList,
|
|
129
|
+
ScrollableListItem: () => import_design_system54.ScrollableListItem,
|
|
127
130
|
SearchAndFilter: () => SearchAndFilter,
|
|
128
131
|
SearchAndFilterContext: () => SearchAndFilterContext,
|
|
129
132
|
SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
|
|
@@ -134,13 +137,13 @@ __export(src_exports, {
|
|
|
134
137
|
SortItems: () => SortItems,
|
|
135
138
|
StatusMultiEditor: () => StatusMultiEditor,
|
|
136
139
|
StatusSingleEditor: () => StatusSingleEditor,
|
|
137
|
-
Switch: () =>
|
|
140
|
+
Switch: () => import_design_system54.Switch,
|
|
138
141
|
TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
|
|
139
142
|
TextEditor: () => TextEditor,
|
|
140
143
|
TextMultiChoiceEditor: () => TextMultiChoiceEditor,
|
|
141
144
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
142
|
-
Textarea: () =>
|
|
143
|
-
Theme: () =>
|
|
145
|
+
Textarea: () => import_design_system54.Textarea,
|
|
146
|
+
Theme: () => import_design_system54.Theme,
|
|
144
147
|
USER_OPERATORS: () => USER_OPERATORS,
|
|
145
148
|
VariableChip: () => VariableChip,
|
|
146
149
|
VariableEditor: () => VariableEditor,
|
|
@@ -161,6 +164,7 @@ __export(src_exports, {
|
|
|
161
164
|
urlEncodeRequestUrl: () => urlEncodeRequestUrl,
|
|
162
165
|
useConnectedDataAsVariables: () => useConnectedDataAsVariables,
|
|
163
166
|
useContentDataResourceLocaleInfo: () => useContentDataResourceLocaleInfo,
|
|
167
|
+
useDelegation: () => useDelegation,
|
|
164
168
|
useDynamicInputsAsVariables: () => useDynamicInputsAsVariables,
|
|
165
169
|
useMeshLocation: () => useMeshLocation,
|
|
166
170
|
useObjectSearchContext: () => useObjectSearchContext,
|
|
@@ -173,7 +177,7 @@ __export(src_exports, {
|
|
|
173
177
|
useVariableEditor: () => useVariableEditor,
|
|
174
178
|
useVariables: () => useVariables,
|
|
175
179
|
useVariablesMenu: () => useVariablesMenu,
|
|
176
|
-
utilityColors: () =>
|
|
180
|
+
utilityColors: () => import_design_system54.utilityColors,
|
|
177
181
|
variableDefaultTextValue: () => variableDefaultTextValue,
|
|
178
182
|
variablePrefix: () => variablePrefix,
|
|
179
183
|
variableSuffix: () => variableSuffix,
|
|
@@ -444,12 +448,28 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
444
448
|
);
|
|
445
449
|
}
|
|
446
450
|
|
|
451
|
+
// src/hooks/useDelegation.ts
|
|
452
|
+
var import_react4 = require("react");
|
|
453
|
+
|
|
454
|
+
// src/components/Delegation/DelegationContext.ts
|
|
455
|
+
var import_react3 = require("react");
|
|
456
|
+
var DelegationContext = (0, import_react3.createContext)(null);
|
|
457
|
+
|
|
458
|
+
// src/hooks/useDelegation.ts
|
|
459
|
+
function useDelegation() {
|
|
460
|
+
const ctx = (0, import_react4.useContext)(DelegationContext);
|
|
461
|
+
if (!ctx) {
|
|
462
|
+
throw new Error("useDelegation must be used within a <DelegationProvider>");
|
|
463
|
+
}
|
|
464
|
+
return ctx;
|
|
465
|
+
}
|
|
466
|
+
|
|
447
467
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
448
468
|
var import_canvas = require("@uniformdev/canvas");
|
|
449
|
-
var
|
|
469
|
+
var import_react5 = require("react");
|
|
450
470
|
var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
|
|
451
471
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
452
|
-
return (0,
|
|
472
|
+
return (0, import_react5.useMemo)(() => {
|
|
453
473
|
const result = Object.entries(dynamicInputs).reduce(
|
|
454
474
|
(acc, [name2, input3]) => {
|
|
455
475
|
const source = `from ${name2 === import_canvas.LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
@@ -484,18 +504,18 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
484
504
|
}
|
|
485
505
|
|
|
486
506
|
// src/hooks/useMeshLocation.ts
|
|
487
|
-
var
|
|
507
|
+
var import_react8 = require("react");
|
|
488
508
|
|
|
489
509
|
// src/components/UniformMeshLocationContext.tsx
|
|
490
|
-
var
|
|
510
|
+
var import_react7 = require("react");
|
|
491
511
|
|
|
492
512
|
// src/components/UniformMeshSdkContext.tsx
|
|
493
513
|
var import_design_system = require("@uniformdev/design-system");
|
|
494
|
-
var
|
|
514
|
+
var import_react6 = require("react");
|
|
495
515
|
var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
|
|
496
|
-
var UniformMeshSdkContext = (0,
|
|
516
|
+
var UniformMeshSdkContext = (0, import_react6.createContext)(void 0);
|
|
497
517
|
var useUniformMeshSdkContext = () => {
|
|
498
|
-
const context = (0,
|
|
518
|
+
const context = (0, import_react6.useContext)(UniformMeshSdkContext);
|
|
499
519
|
if (!context) {
|
|
500
520
|
throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");
|
|
501
521
|
}
|
|
@@ -510,13 +530,13 @@ function useUniformMeshSdk() {
|
|
|
510
530
|
|
|
511
531
|
// src/components/UniformMeshLocationContext.tsx
|
|
512
532
|
var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
|
|
513
|
-
var UniformMeshLocationContext = (0,
|
|
533
|
+
var UniformMeshLocationContext = (0, import_react7.createContext)(void 0);
|
|
514
534
|
var UniformMeshLocationContextProvider = ({
|
|
515
535
|
children
|
|
516
536
|
}) => {
|
|
517
537
|
const sdk = useUniformMeshSdk();
|
|
518
|
-
const [location, setLocation] = (0,
|
|
519
|
-
(0,
|
|
538
|
+
const [location, setLocation] = (0, import_react7.useState)(sdk.getCurrentLocation());
|
|
539
|
+
(0, import_react7.useMemo)(() => {
|
|
520
540
|
const valueChangeListener = (event) => {
|
|
521
541
|
setLocation((old) => ({ ...old, value: event.newValue }));
|
|
522
542
|
};
|
|
@@ -533,7 +553,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
533
553
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(UniformMeshLocationContext.Provider, { value: { location }, children });
|
|
534
554
|
};
|
|
535
555
|
var useUniformMeshLocationContext = () => {
|
|
536
|
-
const context = (0,
|
|
556
|
+
const context = (0, import_react7.useContext)(UniformMeshLocationContext);
|
|
537
557
|
if (!context) {
|
|
538
558
|
throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");
|
|
539
559
|
}
|
|
@@ -546,9 +566,9 @@ function useMeshLocation(expectedLocation) {
|
|
|
546
566
|
if (expectedLocation && location.type !== expectedLocation) {
|
|
547
567
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
548
568
|
}
|
|
549
|
-
const backdoorLocation = (0,
|
|
569
|
+
const backdoorLocation = (0, import_react8.useRef)(location);
|
|
550
570
|
backdoorLocation.current = location;
|
|
551
|
-
const stabilizedSetValueProxy = (0,
|
|
571
|
+
const stabilizedSetValueProxy = (0, import_react8.useMemo)(
|
|
552
572
|
() => (dispatch) => {
|
|
553
573
|
const { newValue, options } = dispatch(backdoorLocation.current.value);
|
|
554
574
|
backdoorLocation.current.setValue(newValue, options);
|
|
@@ -567,7 +587,7 @@ var import_design_system2 = require("@uniformdev/design-system");
|
|
|
567
587
|
|
|
568
588
|
// src/components/Variables/composer/ControlledValuePlugin.tsx
|
|
569
589
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
570
|
-
var
|
|
590
|
+
var import_react9 = require("react");
|
|
571
591
|
|
|
572
592
|
// src/components/Variables/util/serializeVariablesEditorState.ts
|
|
573
593
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
@@ -711,7 +731,7 @@ function ControlledValuePlugin({
|
|
|
711
731
|
extraDependencies
|
|
712
732
|
}) {
|
|
713
733
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
714
|
-
(0,
|
|
734
|
+
(0, import_react9.useEffect)(() => {
|
|
715
735
|
var _a, _b;
|
|
716
736
|
if (!enabled) {
|
|
717
737
|
return;
|
|
@@ -732,7 +752,7 @@ function ControlledValuePlugin({
|
|
|
732
752
|
|
|
733
753
|
// src/components/Variables/composer/VariableChip.tsx
|
|
734
754
|
var import_design_system3 = require("@uniformdev/design-system");
|
|
735
|
-
var
|
|
755
|
+
var import_react10 = require("react");
|
|
736
756
|
var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
|
|
737
757
|
function VariableChip({
|
|
738
758
|
displayName,
|
|
@@ -748,7 +768,7 @@ function VariableChip({
|
|
|
748
768
|
}) {
|
|
749
769
|
const hasClickEvent = !!onClick;
|
|
750
770
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
751
|
-
const Wrapper = referenceIsValidFr === "warning" ? WarningVariableReference : referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ?
|
|
771
|
+
const Wrapper = referenceIsValidFr === "warning" ? WarningVariableReference : referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? import_react10.Fragment : UndefinedVariableReference;
|
|
752
772
|
const extraTitle = !referenceIsValidFr ? errorMessage : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
753
773
|
const chippy = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system3.MultilineChip, { onClick, "aria-selected": selected ? true : void 0, "aria-disabled": disabled, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Wrapper, { children: displayName || reference }) });
|
|
754
774
|
if (tooltip) {
|
|
@@ -814,7 +834,7 @@ var import_utils2 = require("@lexical/utils");
|
|
|
814
834
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
815
835
|
var import_design_system6 = require("@uniformdev/design-system");
|
|
816
836
|
var import_lexical5 = require("lexical");
|
|
817
|
-
var
|
|
837
|
+
var import_react18 = require("react");
|
|
818
838
|
|
|
819
839
|
// src/components/Variables/util/prettifyBindExpression.tsx
|
|
820
840
|
function prettifyBindExpression(bindExpression) {
|
|
@@ -823,7 +843,7 @@ function prettifyBindExpression(bindExpression) {
|
|
|
823
843
|
}
|
|
824
844
|
|
|
825
845
|
// src/components/Variables/composer/VariablesPlugin.tsx
|
|
826
|
-
var
|
|
846
|
+
var import_react16 = require("@emotion/react");
|
|
827
847
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
828
848
|
var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
|
|
829
849
|
var import_utils = require("@lexical/utils");
|
|
@@ -832,12 +852,12 @@ var import_canvas4 = require("@uniformdev/canvas");
|
|
|
832
852
|
var import_design_system5 = require("@uniformdev/design-system");
|
|
833
853
|
var import_lite = require("dequal/lite");
|
|
834
854
|
var import_lexical4 = require("lexical");
|
|
835
|
-
var
|
|
855
|
+
var import_react17 = require("react");
|
|
836
856
|
var import_react_dom = require("react-dom");
|
|
837
857
|
|
|
838
858
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
839
|
-
var
|
|
840
|
-
var menuBtn =
|
|
859
|
+
var import_react11 = require("@emotion/react");
|
|
860
|
+
var menuBtn = import_react11.css`
|
|
841
861
|
background: none;
|
|
842
862
|
border: none;
|
|
843
863
|
color: var(--gray-500);
|
|
@@ -847,18 +867,18 @@ var menuBtn = import_react9.css`
|
|
|
847
867
|
outline: none;
|
|
848
868
|
}
|
|
849
869
|
`;
|
|
850
|
-
var menuItemTextGroup =
|
|
870
|
+
var menuItemTextGroup = import_react11.css`
|
|
851
871
|
align-items: flex-start;
|
|
852
872
|
display: flex;
|
|
853
873
|
flex-direction: column;
|
|
854
874
|
gap: 0;
|
|
855
875
|
line-height: 1em;
|
|
856
876
|
`;
|
|
857
|
-
var smallText =
|
|
877
|
+
var smallText = import_react11.css`
|
|
858
878
|
font-size: var(--fs-xs);
|
|
859
879
|
color: var(--gray-500);
|
|
860
880
|
`;
|
|
861
|
-
var variablesTipText =
|
|
881
|
+
var variablesTipText = import_react11.css`
|
|
862
882
|
${smallText}
|
|
863
883
|
color: var(--gray-500);
|
|
864
884
|
padding: 0 var(--spacing-sm);
|
|
@@ -866,18 +886,18 @@ var variablesTipText = import_react9.css`
|
|
|
866
886
|
|
|
867
887
|
// src/components/Variables/VariablesProvider.tsx
|
|
868
888
|
var import_mitt = __toESM(require("mitt"));
|
|
869
|
-
var
|
|
889
|
+
var import_react15 = require("react");
|
|
870
890
|
|
|
871
891
|
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
872
|
-
var
|
|
892
|
+
var import_react12 = require("react");
|
|
873
893
|
function useVariableEditTransaction({
|
|
874
894
|
events,
|
|
875
895
|
dispatch,
|
|
876
896
|
isEditing,
|
|
877
897
|
variables
|
|
878
898
|
}) {
|
|
879
|
-
const [isEditingBinding, setIsEditingBinding] = (0,
|
|
880
|
-
(0,
|
|
899
|
+
const [isEditingBinding, setIsEditingBinding] = (0, import_react12.useState)();
|
|
900
|
+
(0, import_react12.useEffect)(() => {
|
|
881
901
|
if (!isEditingBinding) {
|
|
882
902
|
return;
|
|
883
903
|
}
|
|
@@ -888,7 +908,7 @@ function useVariableEditTransaction({
|
|
|
888
908
|
events.on("editCompleted", fn);
|
|
889
909
|
return () => events.off("editCompleted", fn);
|
|
890
910
|
}, [events, isEditingBinding, variables]);
|
|
891
|
-
(0,
|
|
911
|
+
(0, import_react12.useEffect)(() => {
|
|
892
912
|
if (!isEditing) {
|
|
893
913
|
if (isEditingBinding) {
|
|
894
914
|
isEditingBinding.resolve({ canceled: true });
|
|
@@ -896,7 +916,7 @@ function useVariableEditTransaction({
|
|
|
896
916
|
setIsEditingBinding(void 0);
|
|
897
917
|
}
|
|
898
918
|
}, [isEditing, isEditingBinding]);
|
|
899
|
-
return (0,
|
|
919
|
+
return (0, import_react12.useCallback)(
|
|
900
920
|
async function editVariableTxn(variable, context) {
|
|
901
921
|
if (isEditingBinding) {
|
|
902
922
|
dispatch({ type: "cancelEdit" });
|
|
@@ -918,13 +938,13 @@ function useVariableEditTransaction({
|
|
|
918
938
|
// src/components/Variables/VariableEditor.tsx
|
|
919
939
|
var import_zod = require("@hookform/resolvers/zod");
|
|
920
940
|
var import_design_system4 = require("@uniformdev/design-system");
|
|
921
|
-
var
|
|
941
|
+
var import_react14 = require("react");
|
|
922
942
|
var import_react_hook_form = require("react-hook-form");
|
|
923
943
|
var z = __toESM(require("zod/v3"));
|
|
924
944
|
|
|
925
945
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
926
|
-
var
|
|
927
|
-
var variablesFormContainer =
|
|
946
|
+
var import_react13 = require("@emotion/react");
|
|
947
|
+
var variablesFormContainer = import_react13.css`
|
|
928
948
|
> * {
|
|
929
949
|
margin: var(--spacing-base) 0 0;
|
|
930
950
|
}
|
|
@@ -977,9 +997,9 @@ function VariableEditor({
|
|
|
977
997
|
},
|
|
978
998
|
activeWhenEditing: true
|
|
979
999
|
});
|
|
980
|
-
const nameRef = (0,
|
|
1000
|
+
const nameRef = (0, import_react14.useRef)(null);
|
|
981
1001
|
const { ref, ...nameRegister } = register("name");
|
|
982
|
-
(0,
|
|
1002
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
983
1003
|
if (nameRef.current && !nameRef.current.value) {
|
|
984
1004
|
nameRef.current.focus();
|
|
985
1005
|
}
|
|
@@ -1055,7 +1075,7 @@ function VariableEditor({
|
|
|
1055
1075
|
|
|
1056
1076
|
// src/components/Variables/VariablesProvider.tsx
|
|
1057
1077
|
var import_jsx_runtime19 = require("@emotion/react/jsx-runtime");
|
|
1058
|
-
var VariablesContext = (0,
|
|
1078
|
+
var VariablesContext = (0, import_react15.createContext)(null);
|
|
1059
1079
|
function VariablesProvider({
|
|
1060
1080
|
value,
|
|
1061
1081
|
onChange,
|
|
@@ -1066,9 +1086,9 @@ function VariablesProvider({
|
|
|
1066
1086
|
knownUndefinedValues = {},
|
|
1067
1087
|
onChangeKnownUndefinedValue
|
|
1068
1088
|
}) {
|
|
1069
|
-
const [editing, setEditing] = (0,
|
|
1070
|
-
const [editingContext, setEditingContext] = (0,
|
|
1071
|
-
const events = (0,
|
|
1089
|
+
const [editing, setEditing] = (0, import_react15.useState)();
|
|
1090
|
+
const [editingContext, setEditingContext] = (0, import_react15.useState)();
|
|
1091
|
+
const events = (0, import_react15.useMemo)(
|
|
1072
1092
|
() => (0, import_mitt.default)(),
|
|
1073
1093
|
[]
|
|
1074
1094
|
);
|
|
@@ -1076,7 +1096,7 @@ function VariablesProvider({
|
|
|
1076
1096
|
throw new Error("onChange must be provided when readOnly is false");
|
|
1077
1097
|
}
|
|
1078
1098
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
1079
|
-
const valueBasedContextValue = (0,
|
|
1099
|
+
const valueBasedContextValue = (0, import_react15.useMemo)(
|
|
1080
1100
|
() => ({
|
|
1081
1101
|
flatVariables: flattenVariables(value),
|
|
1082
1102
|
dispatch: (event) => {
|
|
@@ -1120,7 +1140,7 @@ function VariablesProvider({
|
|
|
1120
1140
|
isEditing: typeof editing !== "undefined",
|
|
1121
1141
|
variables: value
|
|
1122
1142
|
});
|
|
1123
|
-
const contextValue = (0,
|
|
1143
|
+
const contextValue = (0, import_react15.useMemo)(() => {
|
|
1124
1144
|
return {
|
|
1125
1145
|
...valueBasedContextValue,
|
|
1126
1146
|
editVariableTxn,
|
|
@@ -1131,7 +1151,7 @@ function VariablesProvider({
|
|
|
1131
1151
|
isLoading: !!isLoading
|
|
1132
1152
|
};
|
|
1133
1153
|
}, [valueBasedContextValue, editVariableTxn, editing, events, knownUndefinedValues, isLoading]);
|
|
1134
|
-
(0,
|
|
1154
|
+
(0, import_react15.useEffect)(() => {
|
|
1135
1155
|
if (editing === void 0) {
|
|
1136
1156
|
return;
|
|
1137
1157
|
}
|
|
@@ -1180,7 +1200,7 @@ function VariablesProvider({
|
|
|
1180
1200
|
] });
|
|
1181
1201
|
}
|
|
1182
1202
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
1183
|
-
const context = (0,
|
|
1203
|
+
const context = (0, import_react15.useContext)(VariablesContext);
|
|
1184
1204
|
if (!context) {
|
|
1185
1205
|
if (returnEmptyWithoutProvider) {
|
|
1186
1206
|
return {
|
|
@@ -1315,7 +1335,7 @@ function useVariablesMenu({
|
|
|
1315
1335
|
getEditorContext
|
|
1316
1336
|
}) {
|
|
1317
1337
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
1318
|
-
const canEditVariable = (0,
|
|
1338
|
+
const canEditVariable = (0, import_react17.useCallback)(
|
|
1319
1339
|
(name2, variable) => (
|
|
1320
1340
|
// name === '' means new var. Add var perms computed by menu options.
|
|
1321
1341
|
name2 === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -1323,7 +1343,7 @@ function useVariablesMenu({
|
|
|
1323
1343
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1324
1344
|
);
|
|
1325
1345
|
const canAddVariable = canDispatch && showAddVariableMenuOption && !readOnly;
|
|
1326
|
-
const { groupedVariables, menuOptions } = (0,
|
|
1346
|
+
const { groupedVariables, menuOptions } = (0, import_react17.useMemo)(() => {
|
|
1327
1347
|
const groupedVariables2 = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
1328
1348
|
if (canAddVariable) {
|
|
1329
1349
|
groupedVariables2.unshift({
|
|
@@ -1345,7 +1365,7 @@ function useVariablesMenu({
|
|
|
1345
1365
|
);
|
|
1346
1366
|
return { menuOptions: menuOptions2, groupedVariables: groupedVariables2 };
|
|
1347
1367
|
}, [variables, filterVariable, getEditorContext, canAddVariable, showAddVariableMenuOption]);
|
|
1348
|
-
const onSelect = (0,
|
|
1368
|
+
const onSelect = (0, import_react17.useCallback)(
|
|
1349
1369
|
({ queryString, value, nodeToReplace, editor, overwriteExistingValue }) => {
|
|
1350
1370
|
if (value === ADD_VARIABLE_OPTION) {
|
|
1351
1371
|
editor.update(() => {
|
|
@@ -1394,9 +1414,9 @@ function VariablesPlugin({
|
|
|
1394
1414
|
}) {
|
|
1395
1415
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
1396
1416
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
1397
|
-
const variablesRef = (0,
|
|
1417
|
+
const variablesRef = (0, import_react17.useRef)({ variables, knownUndefinedValues, isLoading });
|
|
1398
1418
|
variablesRef.current = { variables, knownUndefinedValues, isLoading };
|
|
1399
|
-
const canEditVariable = (0,
|
|
1419
|
+
const canEditVariable = (0, import_react17.useCallback)(
|
|
1400
1420
|
(name2, variable) => (
|
|
1401
1421
|
// name === '' means new var. Add var perms computed by menu options.
|
|
1402
1422
|
name2 === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -1404,13 +1424,13 @@ function VariablesPlugin({
|
|
|
1404
1424
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1405
1425
|
);
|
|
1406
1426
|
const { editVariable } = useVariableEditor();
|
|
1407
|
-
const [queryString, setQueryString] = (0,
|
|
1427
|
+
const [queryString, setQueryString] = (0, import_react17.useState)(null);
|
|
1408
1428
|
const { groupedVariables, menuOptions, onSelect } = useVariablesMenu({
|
|
1409
1429
|
showAddVariableMenuOption,
|
|
1410
1430
|
filterVariable,
|
|
1411
1431
|
getEditorContext
|
|
1412
1432
|
});
|
|
1413
|
-
const { filteredGroupedVariables, filteredMenuOptions } = (0,
|
|
1433
|
+
const { filteredGroupedVariables, filteredMenuOptions } = (0, import_react17.useMemo)(() => {
|
|
1414
1434
|
if (!queryString) {
|
|
1415
1435
|
return {
|
|
1416
1436
|
filteredGroupedVariables: groupedVariables,
|
|
@@ -1433,7 +1453,7 @@ function VariablesPlugin({
|
|
|
1433
1453
|
)
|
|
1434
1454
|
};
|
|
1435
1455
|
}, [queryString, groupedVariables, menuOptions]);
|
|
1436
|
-
const onSelectOption = (0,
|
|
1456
|
+
const onSelectOption = (0, import_react17.useCallback)(
|
|
1437
1457
|
(selectedOption, nodeToReplace, closeMenu) => {
|
|
1438
1458
|
onSelect({
|
|
1439
1459
|
queryString: queryString != null ? queryString : void 0,
|
|
@@ -1446,7 +1466,7 @@ function VariablesPlugin({
|
|
|
1446
1466
|
},
|
|
1447
1467
|
[editor, onSelect, queryString, replaceValueOnVariableInsert]
|
|
1448
1468
|
);
|
|
1449
|
-
(0,
|
|
1469
|
+
(0, import_react17.useEffect)(() => {
|
|
1450
1470
|
return (0, import_utils.mergeRegister)(
|
|
1451
1471
|
editor.registerCommand(
|
|
1452
1472
|
EDIT_VARIABLE_COMMAND,
|
|
@@ -1586,7 +1606,7 @@ function VariablesPlugin({
|
|
|
1586
1606
|
replaceValueOnVariableInsert,
|
|
1587
1607
|
disableVariableDisplayNames
|
|
1588
1608
|
]);
|
|
1589
|
-
const updateExistingNodeIfChanged = (0,
|
|
1609
|
+
const updateExistingNodeIfChanged = (0, import_react17.useCallback)(
|
|
1590
1610
|
(variableNode) => {
|
|
1591
1611
|
var _a, _b, _c, _d;
|
|
1592
1612
|
const targetVar = variablesRef.current.variables[variableNode.reference];
|
|
@@ -1613,7 +1633,7 @@ function VariablesPlugin({
|
|
|
1613
1633
|
},
|
|
1614
1634
|
[canEditVariable, disableVariableDisplayNames]
|
|
1615
1635
|
);
|
|
1616
|
-
(0,
|
|
1636
|
+
(0, import_react17.useEffect)(() => {
|
|
1617
1637
|
let selection;
|
|
1618
1638
|
editor.read(() => {
|
|
1619
1639
|
selection = (0, import_lexical4.$getSelection)();
|
|
@@ -1627,7 +1647,7 @@ function VariablesPlugin({
|
|
|
1627
1647
|
});
|
|
1628
1648
|
});
|
|
1629
1649
|
}, [editor, variables, knownUndefinedValues, canEditVariable, updateExistingNodeIfChanged]);
|
|
1630
|
-
(0,
|
|
1650
|
+
(0, import_react17.useEffect)(() => {
|
|
1631
1651
|
return editor.registerNodeTransform(VariableNode, (variableNode) => {
|
|
1632
1652
|
updateExistingNodeIfChanged(variableNode);
|
|
1633
1653
|
});
|
|
@@ -1652,7 +1672,7 @@ function VariablesPlugin({
|
|
|
1652
1672
|
"div",
|
|
1653
1673
|
{
|
|
1654
1674
|
"data-auto-resize-opt-in": true,
|
|
1655
|
-
css:
|
|
1675
|
+
css: import_react16.css`
|
|
1656
1676
|
box-shadow: var(--shadow-base);
|
|
1657
1677
|
border-radius: var(--rounded-base);
|
|
1658
1678
|
background: var(--gray-50);
|
|
@@ -1816,7 +1836,7 @@ function VariableNodeComponent({
|
|
|
1816
1836
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
1817
1837
|
const [isSelected, setSelected, clearSelection] = (0, import_useLexicalNodeSelection.useLexicalNodeSelection)(nodeKey);
|
|
1818
1838
|
const readOnly = !editor.isEditable();
|
|
1819
|
-
const onDelete = (0,
|
|
1839
|
+
const onDelete = (0, import_react18.useCallback)(
|
|
1820
1840
|
(event) => {
|
|
1821
1841
|
if (isSelected && (0, import_lexical5.$isNodeSelection)((0, import_lexical5.$getSelection)())) {
|
|
1822
1842
|
event.preventDefault();
|
|
@@ -1829,7 +1849,7 @@ function VariableNodeComponent({
|
|
|
1829
1849
|
},
|
|
1830
1850
|
[isSelected, nodeKey]
|
|
1831
1851
|
);
|
|
1832
|
-
(0,
|
|
1852
|
+
(0, import_react18.useEffect)(() => {
|
|
1833
1853
|
return (0, import_utils2.mergeRegister)(
|
|
1834
1854
|
editor.registerCommand(import_lexical5.KEY_DELETE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
|
|
1835
1855
|
editor.registerCommand(import_lexical5.KEY_BACKSPACE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
|
|
@@ -1917,9 +1937,9 @@ function $isTargetWithinDecorator(target) {
|
|
|
1917
1937
|
}
|
|
1918
1938
|
|
|
1919
1939
|
// src/components/Variables/InputVariables.tsx
|
|
1920
|
-
var
|
|
1940
|
+
var import_react29 = require("@emotion/react");
|
|
1921
1941
|
var import_design_system9 = require("@uniformdev/design-system");
|
|
1922
|
-
var
|
|
1942
|
+
var import_react30 = require("react");
|
|
1923
1943
|
var import_uuid = require("uuid");
|
|
1924
1944
|
|
|
1925
1945
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -1940,10 +1960,10 @@ function EditorRefPlugin({
|
|
|
1940
1960
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
1941
1961
|
var import_utils3 = require("@lexical/utils");
|
|
1942
1962
|
var import_lexical6 = require("lexical");
|
|
1943
|
-
var
|
|
1963
|
+
var import_react19 = require("react");
|
|
1944
1964
|
function PasteTransformerPlugin({ transformPaste }) {
|
|
1945
1965
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
1946
|
-
(0,
|
|
1966
|
+
(0, import_react19.useEffect)(() => {
|
|
1947
1967
|
return (0, import_utils3.mergeRegister)(
|
|
1948
1968
|
editor.registerCommand(
|
|
1949
1969
|
import_lexical6.PASTE_COMMAND,
|
|
@@ -1968,17 +1988,17 @@ function PasteTransformerPlugin({ transformPaste }) {
|
|
|
1968
1988
|
}
|
|
1969
1989
|
|
|
1970
1990
|
// src/components/Variables/styles/InputVariables.styles.ts
|
|
1971
|
-
var
|
|
1972
|
-
var menuContainer =
|
|
1991
|
+
var import_react20 = require("@emotion/react");
|
|
1992
|
+
var menuContainer = import_react20.css`
|
|
1973
1993
|
position: relative;
|
|
1974
1994
|
`;
|
|
1975
|
-
var menuBtn2 =
|
|
1995
|
+
var menuBtn2 = import_react20.css`
|
|
1976
1996
|
position: absolute;
|
|
1977
1997
|
top: 50%;
|
|
1978
1998
|
right: var(--spacing-sm);
|
|
1979
1999
|
transform: translateY(-50%);
|
|
1980
2000
|
`;
|
|
1981
|
-
var input =
|
|
2001
|
+
var input = import_react20.css`
|
|
1982
2002
|
--input-padding: 12px var(--spacing-lg) 12px var(--spacing-sm);
|
|
1983
2003
|
appearance: none;
|
|
1984
2004
|
background-color: var(--white);
|
|
@@ -2023,7 +2043,7 @@ var input = import_react18.css`
|
|
|
2023
2043
|
margin: 0;
|
|
2024
2044
|
}
|
|
2025
2045
|
`;
|
|
2026
|
-
var inputCompact =
|
|
2046
|
+
var inputCompact = import_react20.css`
|
|
2027
2047
|
border: 1px solid var(--white);
|
|
2028
2048
|
padding-block: var(--spacing-sm);
|
|
2029
2049
|
font-size: var(--fs-sm);
|
|
@@ -2032,11 +2052,11 @@ var inputCompact = import_react18.css`
|
|
|
2032
2052
|
min-height: 39px;
|
|
2033
2053
|
}
|
|
2034
2054
|
`;
|
|
2035
|
-
var inputDisabled =
|
|
2055
|
+
var inputDisabled = import_react20.css`
|
|
2036
2056
|
cursor: not-allowed;
|
|
2037
2057
|
opacity: var(--opacity-50);
|
|
2038
2058
|
`;
|
|
2039
|
-
var placeholderCaption =
|
|
2059
|
+
var placeholderCaption = import_react20.css`
|
|
2040
2060
|
position: absolute;
|
|
2041
2061
|
color: var(--gray-400);
|
|
2042
2062
|
inset: 12px var(--spacing-base) 12px var(--spacing-sm);
|
|
@@ -2045,14 +2065,14 @@ var placeholderCaption = import_react18.css`
|
|
|
2045
2065
|
white-space: nowrap;
|
|
2046
2066
|
pointer-events: none;
|
|
2047
2067
|
`;
|
|
2048
|
-
var placeholderCompact =
|
|
2068
|
+
var placeholderCompact = import_react20.css`
|
|
2049
2069
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
|
|
2050
2070
|
`;
|
|
2051
2071
|
|
|
2052
2072
|
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
2053
|
-
var
|
|
2073
|
+
var import_react21 = require("@emotion/react");
|
|
2054
2074
|
var import_design_system7 = require("@uniformdev/design-system");
|
|
2055
|
-
var variableBindButton =
|
|
2075
|
+
var variableBindButton = import_react21.css`
|
|
2056
2076
|
--hover-color: var(--accent-dark-hover);
|
|
2057
2077
|
--active-color: var(--accent-dark-active);
|
|
2058
2078
|
border: 1px solid transparent;
|
|
@@ -2095,7 +2115,7 @@ var variableBindButton = import_react19.css`
|
|
|
2095
2115
|
max-height: unset;
|
|
2096
2116
|
}
|
|
2097
2117
|
`;
|
|
2098
|
-
var input2 =
|
|
2118
|
+
var input2 = import_react21.css`
|
|
2099
2119
|
display: block;
|
|
2100
2120
|
appearance: none;
|
|
2101
2121
|
box-sizing: border-box;
|
|
@@ -2149,7 +2169,7 @@ var input2 = import_react19.css`
|
|
|
2149
2169
|
margin: 0;
|
|
2150
2170
|
}
|
|
2151
2171
|
`;
|
|
2152
|
-
var inputMultiLine = (lines) =>
|
|
2172
|
+
var inputMultiLine = (lines) => import_react21.css`
|
|
2153
2173
|
${import_design_system7.scrollbarStyles}
|
|
2154
2174
|
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
2155
2175
|
// as the text looked to close to the bottom of the input
|
|
@@ -2160,7 +2180,7 @@ var inputMultiLine = (lines) => import_react19.css`
|
|
|
2160
2180
|
|
|
2161
2181
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
2162
2182
|
var import_canvas6 = require("@uniformdev/canvas");
|
|
2163
|
-
var
|
|
2183
|
+
var import_react22 = require("react");
|
|
2164
2184
|
function useInputVariablesState({
|
|
2165
2185
|
value,
|
|
2166
2186
|
onChange,
|
|
@@ -2176,14 +2196,14 @@ function useInputVariablesState({
|
|
|
2176
2196
|
}) {
|
|
2177
2197
|
const { variables } = useVariables(true);
|
|
2178
2198
|
const variableReferenceCountInValue = (0, import_canvas6.hasReferencedVariables)(value != null ? value : "");
|
|
2179
|
-
const [lastKnownId, setLastKnownId] = (0,
|
|
2180
|
-
const [hadVariablesInValue, setHadVariablesInValue] = (0,
|
|
2181
|
-
(0,
|
|
2199
|
+
const [lastKnownId, setLastKnownId] = (0, import_react22.useState)(id);
|
|
2200
|
+
const [hadVariablesInValue, setHadVariablesInValue] = (0, import_react22.useState)(variableReferenceCountInValue > 0);
|
|
2201
|
+
(0, import_react22.useEffect)(() => {
|
|
2182
2202
|
if (variableReferenceCountInValue) {
|
|
2183
2203
|
setHadVariablesInValue(true);
|
|
2184
2204
|
}
|
|
2185
2205
|
}, [variableReferenceCountInValue]);
|
|
2186
|
-
(0,
|
|
2206
|
+
(0, import_react22.useEffect)(() => {
|
|
2187
2207
|
if (id !== lastKnownId) {
|
|
2188
2208
|
setLastKnownId(id);
|
|
2189
2209
|
setHadVariablesInValue(variableReferenceCountInValue > 0);
|
|
@@ -2192,7 +2212,7 @@ function useInputVariablesState({
|
|
|
2192
2212
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
|
|
2193
2213
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
2194
2214
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
2195
|
-
const sharedMenuProps = (0,
|
|
2215
|
+
const sharedMenuProps = (0, import_react22.useMemo)(
|
|
2196
2216
|
() => ({
|
|
2197
2217
|
menuTooltip,
|
|
2198
2218
|
showAddVariableMenuOption,
|
|
@@ -2225,8 +2245,8 @@ function useInputVariablesState({
|
|
|
2225
2245
|
}
|
|
2226
2246
|
|
|
2227
2247
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
2228
|
-
var
|
|
2229
|
-
var labelText =
|
|
2248
|
+
var import_react23 = require("@emotion/react");
|
|
2249
|
+
var labelText = import_react23.css`
|
|
2230
2250
|
align-items: center;
|
|
2231
2251
|
display: flex;
|
|
2232
2252
|
gap: var(--spacing-xs);
|
|
@@ -2242,7 +2262,7 @@ var import_lexical7 = require("lexical");
|
|
|
2242
2262
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
2243
2263
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
2244
2264
|
var import_design_system8 = require("@uniformdev/design-system");
|
|
2245
|
-
var
|
|
2265
|
+
var import_react24 = require("react");
|
|
2246
2266
|
var import_jsx_runtime22 = require("@emotion/react/jsx-runtime");
|
|
2247
2267
|
function SelectVariableMenu({
|
|
2248
2268
|
onSelectVariable,
|
|
@@ -2257,7 +2277,7 @@ function SelectVariableMenu({
|
|
|
2257
2277
|
filterVariable
|
|
2258
2278
|
}) {
|
|
2259
2279
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
2260
|
-
const btnRef = (0,
|
|
2280
|
+
const btnRef = (0, import_react24.useRef)(null);
|
|
2261
2281
|
const { editVariable } = useVariableEditor();
|
|
2262
2282
|
const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
2263
2283
|
const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
|
|
@@ -2390,14 +2410,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
2390
2410
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
2391
2411
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
2392
2412
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
2393
|
-
var
|
|
2413
|
+
var import_react27 = require("react");
|
|
2394
2414
|
|
|
2395
2415
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
2396
2416
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
2397
|
-
var
|
|
2417
|
+
var import_react25 = require("react");
|
|
2398
2418
|
function DisablePlugin({ disabled }) {
|
|
2399
2419
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
2400
|
-
(0,
|
|
2420
|
+
(0, import_react25.useEffect)(() => {
|
|
2401
2421
|
editor.setEditable(!disabled);
|
|
2402
2422
|
}, [editor, disabled]);
|
|
2403
2423
|
return null;
|
|
@@ -2406,10 +2426,10 @@ function DisablePlugin({ disabled }) {
|
|
|
2406
2426
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
2407
2427
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
2408
2428
|
var import_lexical8 = require("lexical");
|
|
2409
|
-
var
|
|
2429
|
+
var import_react26 = require("react");
|
|
2410
2430
|
function SingleLineTextPlugin() {
|
|
2411
2431
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
2412
|
-
(0,
|
|
2432
|
+
(0, import_react26.useEffect)(() => {
|
|
2413
2433
|
editor.registerNodeTransform(import_lexical8.LineBreakNode, (node) => {
|
|
2414
2434
|
node.remove();
|
|
2415
2435
|
});
|
|
@@ -2430,8 +2450,8 @@ function VariablesComposer(props) {
|
|
|
2430
2450
|
autoFocus,
|
|
2431
2451
|
...variablesPluginProps
|
|
2432
2452
|
} = props;
|
|
2433
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
2434
|
-
const editorConfig = (0,
|
|
2453
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react27.useState)(value);
|
|
2454
|
+
const editorConfig = (0, import_react27.useMemo)(
|
|
2435
2455
|
() => ({
|
|
2436
2456
|
namespace: "uniform",
|
|
2437
2457
|
onError(error) {
|
|
@@ -2440,11 +2460,11 @@ function VariablesComposer(props) {
|
|
|
2440
2460
|
nodes: [VariableNode],
|
|
2441
2461
|
editorState: deserializeVariablesEditorState(props.value)
|
|
2442
2462
|
}),
|
|
2443
|
-
//
|
|
2463
|
+
// oxlint-disable-next-line react/exhaustive-deps
|
|
2444
2464
|
[]
|
|
2445
2465
|
);
|
|
2446
|
-
const editorState = (0,
|
|
2447
|
-
const updateTimeout = (0,
|
|
2466
|
+
const editorState = (0, import_react27.useRef)(void 0);
|
|
2467
|
+
const updateTimeout = (0, import_react27.useRef)(void 0);
|
|
2448
2468
|
if (typeof document === "undefined") return null;
|
|
2449
2469
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
2450
2470
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -2486,7 +2506,7 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
2486
2506
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
2487
2507
|
var import_utils4 = require("@lexical/utils");
|
|
2488
2508
|
var import_lexical9 = require("lexical");
|
|
2489
|
-
var
|
|
2509
|
+
var import_react28 = require("react");
|
|
2490
2510
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2491
2511
|
function VariablesComposerInput({
|
|
2492
2512
|
css: css23,
|
|
@@ -2508,7 +2528,7 @@ function VariablesComposerInput({
|
|
|
2508
2528
|
}
|
|
2509
2529
|
function RichishCopyAndPastePlugin() {
|
|
2510
2530
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
2511
|
-
(0,
|
|
2531
|
+
(0, import_react28.useEffect)(() => {
|
|
2512
2532
|
return (0, import_utils4.mergeRegister)(
|
|
2513
2533
|
editor.registerCommand(
|
|
2514
2534
|
import_lexical9.COPY_COMMAND,
|
|
@@ -2615,7 +2635,7 @@ function InputVariables(props) {
|
|
|
2615
2635
|
singleTokenMode,
|
|
2616
2636
|
disableVariableDisplayNames
|
|
2617
2637
|
} = props;
|
|
2618
|
-
const [finalId] = (0,
|
|
2638
|
+
const [finalId] = (0, import_react30.useState)(id != null ? id : () => (0, import_uuid.v4)());
|
|
2619
2639
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
2620
2640
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
2621
2641
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -2634,7 +2654,7 @@ function InputVariables(props) {
|
|
|
2634
2654
|
{
|
|
2635
2655
|
align: "center",
|
|
2636
2656
|
gap: "xs",
|
|
2637
|
-
css:
|
|
2657
|
+
css: import_react29.css`
|
|
2638
2658
|
position: relative;
|
|
2639
2659
|
& > div:first-of-type {
|
|
2640
2660
|
flex-grow: 1;
|
|
@@ -2763,7 +2783,7 @@ function InputVariablesOverlayMenu({
|
|
|
2763
2783
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
2764
2784
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
2765
2785
|
var import_design_system10 = require("@uniformdev/design-system");
|
|
2766
|
-
var
|
|
2786
|
+
var import_react31 = require("react");
|
|
2767
2787
|
var import_jsx_runtime28 = require("@emotion/react/jsx-runtime");
|
|
2768
2788
|
function ParameterConnectionIndicator({
|
|
2769
2789
|
children,
|
|
@@ -2774,7 +2794,7 @@ function ParameterConnectionIndicator({
|
|
|
2774
2794
|
overrideMenuButtonParentMargin,
|
|
2775
2795
|
renderMenuInPortal = false
|
|
2776
2796
|
}) {
|
|
2777
|
-
const hasVariablesInValue = (0,
|
|
2797
|
+
const hasVariablesInValue = (0, import_react31.useMemo)(() => {
|
|
2778
2798
|
let result = false;
|
|
2779
2799
|
(0, import_canvas7.bindVariablesToObject)({
|
|
2780
2800
|
value,
|
|
@@ -2819,21 +2839,21 @@ function ParameterConnectionIndicator({
|
|
|
2819
2839
|
|
|
2820
2840
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
2821
2841
|
var import_design_system11 = require("@uniformdev/design-system");
|
|
2822
|
-
var
|
|
2842
|
+
var import_react33 = require("react");
|
|
2823
2843
|
|
|
2824
2844
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
2825
2845
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
2826
2846
|
var import_utils5 = require("@lexical/utils");
|
|
2827
2847
|
var import_lexical10 = require("lexical");
|
|
2828
|
-
var
|
|
2848
|
+
var import_react32 = require("react");
|
|
2829
2849
|
function OnDisconnectPlugin({
|
|
2830
2850
|
onDisconnect
|
|
2831
2851
|
}) {
|
|
2832
2852
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
2833
2853
|
const { variables } = useVariables(true);
|
|
2834
|
-
const variablesRef = (0,
|
|
2854
|
+
const variablesRef = (0, import_react32.useRef)(variables);
|
|
2835
2855
|
variablesRef.current = variables;
|
|
2836
|
-
(0,
|
|
2856
|
+
(0, import_react32.useEffect)(() => {
|
|
2837
2857
|
return (0, import_utils5.mergeRegister)(
|
|
2838
2858
|
editor.registerCommand(
|
|
2839
2859
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -2878,7 +2898,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2878
2898
|
hasVariablesInValue,
|
|
2879
2899
|
setHadVariablesInValue
|
|
2880
2900
|
} = useInputVariablesState(props);
|
|
2881
|
-
const handleDisconnect = (0,
|
|
2901
|
+
const handleDisconnect = (0, import_react33.useCallback)(
|
|
2882
2902
|
(variable) => {
|
|
2883
2903
|
setHadVariablesInValue(false);
|
|
2884
2904
|
if (onDisconnect) {
|
|
@@ -2931,7 +2951,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2931
2951
|
}
|
|
2932
2952
|
|
|
2933
2953
|
// src/components/Variables/ParameterVariables.tsx
|
|
2934
|
-
var
|
|
2954
|
+
var import_react34 = require("@emotion/react");
|
|
2935
2955
|
var import_design_system12 = require("@uniformdev/design-system");
|
|
2936
2956
|
var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
|
|
2937
2957
|
function ParameterVariables(props) {
|
|
@@ -2988,8 +3008,8 @@ function ParameterVariables(props) {
|
|
|
2988
3008
|
"data-text-value": value,
|
|
2989
3009
|
css: [
|
|
2990
3010
|
input2,
|
|
2991
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
2992
|
-
inputCss != null ? inputCss :
|
|
3011
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react34.css``,
|
|
3012
|
+
inputCss != null ? inputCss : import_react34.css``
|
|
2993
3013
|
]
|
|
2994
3014
|
}
|
|
2995
3015
|
)
|
|
@@ -3025,18 +3045,18 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
3025
3045
|
}
|
|
3026
3046
|
|
|
3027
3047
|
// src/components/Variables/VariablesList.tsx
|
|
3028
|
-
var
|
|
3048
|
+
var import_react37 = require("@emotion/react");
|
|
3029
3049
|
var import_dnd2 = require("@hello-pangea/dnd");
|
|
3030
3050
|
var import_CgTrash = require("@react-icons/all-files/cg/CgTrash");
|
|
3031
3051
|
var import_design_system13 = require("@uniformdev/design-system");
|
|
3032
3052
|
|
|
3033
3053
|
// src/components/DragDropContext.tsx
|
|
3034
3054
|
var import_dnd = require("@hello-pangea/dnd");
|
|
3035
|
-
var
|
|
3055
|
+
var import_react35 = require("react");
|
|
3036
3056
|
var import_react_use = require("react-use");
|
|
3037
3057
|
var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
|
|
3038
3058
|
function DragDropContext({ children, ...props }) {
|
|
3039
|
-
const [isReady, setIsReady] = (0,
|
|
3059
|
+
const [isReady, setIsReady] = (0, import_react35.useState)(false);
|
|
3040
3060
|
(0, import_react_use.useDebounce)(
|
|
3041
3061
|
() => {
|
|
3042
3062
|
setIsReady(true);
|
|
@@ -3048,8 +3068,8 @@ function DragDropContext({ children, ...props }) {
|
|
|
3048
3068
|
}
|
|
3049
3069
|
|
|
3050
3070
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
3051
|
-
var
|
|
3052
|
-
var tableRow = (isDragging) =>
|
|
3071
|
+
var import_react36 = require("@emotion/react");
|
|
3072
|
+
var tableRow = (isDragging) => import_react36.css`
|
|
3053
3073
|
position: relative;
|
|
3054
3074
|
${isDragging ? `
|
|
3055
3075
|
display: table;
|
|
@@ -3057,7 +3077,7 @@ var tableRow = (isDragging) => import_react34.css`
|
|
|
3057
3077
|
top: auto !important;
|
|
3058
3078
|
` : void 0}
|
|
3059
3079
|
`;
|
|
3060
|
-
var tableCellDragIcon =
|
|
3080
|
+
var tableCellDragIcon = import_react36.css`
|
|
3061
3081
|
&::after {
|
|
3062
3082
|
content: '';
|
|
3063
3083
|
display: block;
|
|
@@ -3075,7 +3095,7 @@ var tableCellDragIcon = import_react34.css`
|
|
|
3075
3095
|
opacity: 1;
|
|
3076
3096
|
}
|
|
3077
3097
|
`;
|
|
3078
|
-
var variableName =
|
|
3098
|
+
var variableName = import_react36.css`
|
|
3079
3099
|
border: none;
|
|
3080
3100
|
font-weight: var(--fw-medium);
|
|
3081
3101
|
padding: 0;
|
|
@@ -3085,7 +3105,7 @@ var variableName = import_react34.css`
|
|
|
3085
3105
|
white-space: nowrap;
|
|
3086
3106
|
max-width: 20ch;
|
|
3087
3107
|
`;
|
|
3088
|
-
var variableValue =
|
|
3108
|
+
var variableValue = import_react36.css`
|
|
3089
3109
|
overflow: hidden;
|
|
3090
3110
|
text-overflow: ellipsis;
|
|
3091
3111
|
white-space: nowrap;
|
|
@@ -3164,7 +3184,7 @@ function VariablesList() {
|
|
|
3164
3184
|
title: `delete ${text}`,
|
|
3165
3185
|
css: [
|
|
3166
3186
|
import_design_system13.button,
|
|
3167
|
-
|
|
3187
|
+
import_react37.css`
|
|
3168
3188
|
background: transparent;
|
|
3169
3189
|
`
|
|
3170
3190
|
],
|
|
@@ -3294,9 +3314,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3294
3314
|
}
|
|
3295
3315
|
|
|
3296
3316
|
// src/components/Request/RequestBody.tsx
|
|
3297
|
-
var
|
|
3317
|
+
var import_react39 = require("@emotion/react");
|
|
3298
3318
|
var import_design_system15 = require("@uniformdev/design-system");
|
|
3299
|
-
var
|
|
3319
|
+
var import_react40 = require("react");
|
|
3300
3320
|
|
|
3301
3321
|
// src/components/Request/RequestProvider.tsx
|
|
3302
3322
|
var React4 = __toESM(require("react"));
|
|
@@ -3384,11 +3404,11 @@ function useRequest() {
|
|
|
3384
3404
|
}
|
|
3385
3405
|
|
|
3386
3406
|
// src/components/Request/styles/Request.styles.ts
|
|
3387
|
-
var
|
|
3388
|
-
var innerContentStyles =
|
|
3407
|
+
var import_react38 = require("@emotion/react");
|
|
3408
|
+
var innerContentStyles = import_react38.css`
|
|
3389
3409
|
background: var(--white);
|
|
3390
3410
|
`;
|
|
3391
|
-
var requestTypeContainer = (bgColor) =>
|
|
3411
|
+
var requestTypeContainer = (bgColor) => import_react38.css`
|
|
3392
3412
|
align-items: start;
|
|
3393
3413
|
background: ${bgColor};
|
|
3394
3414
|
display: grid;
|
|
@@ -3426,11 +3446,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
3426
3446
|
};
|
|
3427
3447
|
function RequestBody() {
|
|
3428
3448
|
const { request, dispatch } = useRequest();
|
|
3429
|
-
const [language, setLanguage] = (0,
|
|
3449
|
+
const [language, setLanguage] = (0, import_react40.useState)("json");
|
|
3430
3450
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3431
3451
|
"div",
|
|
3432
3452
|
{
|
|
3433
|
-
css:
|
|
3453
|
+
css: import_react39.css`
|
|
3434
3454
|
background: var(--white);
|
|
3435
3455
|
`,
|
|
3436
3456
|
children: [
|
|
@@ -3438,7 +3458,7 @@ function RequestBody() {
|
|
|
3438
3458
|
RequestTypeContainer,
|
|
3439
3459
|
{
|
|
3440
3460
|
bgColor: "var(--gray-100)",
|
|
3441
|
-
css:
|
|
3461
|
+
css: import_react39.css`
|
|
3442
3462
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
3443
3463
|
`,
|
|
3444
3464
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
@@ -3715,8 +3735,8 @@ function RequestParameters({
|
|
|
3715
3735
|
}
|
|
3716
3736
|
|
|
3717
3737
|
// src/components/Request/RequestUrl.tsx
|
|
3718
|
-
var
|
|
3719
|
-
var
|
|
3738
|
+
var import_react41 = require("@emotion/react");
|
|
3739
|
+
var import_react42 = require("react");
|
|
3720
3740
|
|
|
3721
3741
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
3722
3742
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -3742,7 +3762,7 @@ function RequestUrl() {
|
|
|
3742
3762
|
var _a, _b;
|
|
3743
3763
|
const { variables } = useVariables();
|
|
3744
3764
|
const { request } = useRequest();
|
|
3745
|
-
const mergedParameters = (0,
|
|
3765
|
+
const mergedParameters = (0, import_react42.useMemo)(() => {
|
|
3746
3766
|
var _a2;
|
|
3747
3767
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
3748
3768
|
return request.parameters;
|
|
@@ -3752,7 +3772,7 @@ function RequestUrl() {
|
|
|
3752
3772
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3753
3773
|
"small",
|
|
3754
3774
|
{
|
|
3755
|
-
css:
|
|
3775
|
+
css: import_react41.css`
|
|
3756
3776
|
display: inline-block;
|
|
3757
3777
|
margin-bottom: var(--spacing-xs);
|
|
3758
3778
|
word-break: break-word;
|
|
@@ -3985,17 +4005,192 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
3985
4005
|
};
|
|
3986
4006
|
}
|
|
3987
4007
|
|
|
3988
|
-
// src/components/
|
|
4008
|
+
// src/components/Delegation/DelegationGate.tsx
|
|
3989
4009
|
var import_design_system19 = require("@uniformdev/design-system");
|
|
4010
|
+
var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
|
|
4011
|
+
var defaultLoadingWrapperStyle = {
|
|
4012
|
+
position: "relative",
|
|
4013
|
+
minHeight: "12rem",
|
|
4014
|
+
width: "100%"
|
|
4015
|
+
};
|
|
4016
|
+
function DefaultDelegationLoading() {
|
|
4017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { style: defaultLoadingWrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.LoadingOverlay, { isActive: true, statusMessage: "Connecting to Uniform..." }) });
|
|
4018
|
+
}
|
|
4019
|
+
function DefaultDelegationDisabled() {
|
|
4020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.Callout, { type: "caution", title: "Feature unavailable", children: "This app requires permissions that are not currently enabled. Please contact your Uniform administrator to enable identity delegation for this integration." });
|
|
4021
|
+
}
|
|
4022
|
+
function DefaultDelegationError({ error }) {
|
|
4023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system19.Callout, { type: "error", title: "Connection error", children: [
|
|
4024
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "Failed to establish a secure connection with Uniform." }),
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4026
|
+
"pre",
|
|
4027
|
+
{
|
|
4028
|
+
style: {
|
|
4029
|
+
marginTop: 8,
|
|
4030
|
+
marginBottom: 0,
|
|
4031
|
+
whiteSpace: "pre-wrap",
|
|
4032
|
+
wordBreak: "break-word"
|
|
4033
|
+
},
|
|
4034
|
+
children: error.message
|
|
4035
|
+
}
|
|
4036
|
+
)
|
|
4037
|
+
] });
|
|
4038
|
+
}
|
|
4039
|
+
function DelegationGate({
|
|
4040
|
+
children,
|
|
4041
|
+
loadingComponent,
|
|
4042
|
+
disabledComponent,
|
|
4043
|
+
errorComponent
|
|
4044
|
+
}) {
|
|
4045
|
+
const { status, error } = useDelegation();
|
|
4046
|
+
if (status === "active") {
|
|
4047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children });
|
|
4048
|
+
}
|
|
4049
|
+
if (status === "idle" || status === "acquiring") {
|
|
4050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: loadingComponent !== void 0 ? loadingComponent : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DefaultDelegationLoading, {}) });
|
|
4051
|
+
}
|
|
4052
|
+
if (status === "disabled") {
|
|
4053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: disabledComponent !== void 0 ? disabledComponent : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DefaultDelegationDisabled, {}) });
|
|
4054
|
+
}
|
|
4055
|
+
if (status === "error") {
|
|
4056
|
+
const resolvedError = error != null ? error : new Error("Unknown delegation error");
|
|
4057
|
+
if (errorComponent !== void 0) {
|
|
4058
|
+
if (typeof errorComponent === "function") {
|
|
4059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: errorComponent({ error: resolvedError }) });
|
|
4060
|
+
}
|
|
4061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: errorComponent });
|
|
4062
|
+
}
|
|
4063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DefaultDelegationError, { error: resolvedError });
|
|
4064
|
+
}
|
|
4065
|
+
return null;
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4068
|
+
// src/components/Delegation/DelegationProvider.tsx
|
|
4069
|
+
var import_react43 = require("react");
|
|
4070
|
+
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
4071
|
+
var DEFAULT_REVALIDATE_AFTER_MS = 5 * 60 * 1e3;
|
|
4072
|
+
function DelegationProvider({
|
|
4073
|
+
sdk,
|
|
4074
|
+
onSessionToken,
|
|
4075
|
+
checkActive,
|
|
4076
|
+
revalidateOnFocus = true,
|
|
4077
|
+
revalidateAfterMs = DEFAULT_REVALIDATE_AFTER_MS,
|
|
4078
|
+
children
|
|
4079
|
+
}) {
|
|
4080
|
+
const [status, setStatus] = (0, import_react43.useState)("idle");
|
|
4081
|
+
const [error, setError] = (0, import_react43.useState)(null);
|
|
4082
|
+
const acquiringRef = (0, import_react43.useRef)(false);
|
|
4083
|
+
const mountedRef = (0, import_react43.useRef)(true);
|
|
4084
|
+
const statusRef = (0, import_react43.useRef)("idle");
|
|
4085
|
+
statusRef.current = status;
|
|
4086
|
+
const acquire = (0, import_react43.useCallback)(async () => {
|
|
4087
|
+
if (acquiringRef.current) {
|
|
4088
|
+
return;
|
|
4089
|
+
}
|
|
4090
|
+
acquiringRef.current = true;
|
|
4091
|
+
setStatus("acquiring");
|
|
4092
|
+
setError(null);
|
|
4093
|
+
try {
|
|
4094
|
+
const isActive = await checkActive();
|
|
4095
|
+
if (isActive) {
|
|
4096
|
+
if (mountedRef.current) {
|
|
4097
|
+
setStatus("active");
|
|
4098
|
+
}
|
|
4099
|
+
return;
|
|
4100
|
+
}
|
|
4101
|
+
if (!mountedRef.current) {
|
|
4102
|
+
return;
|
|
4103
|
+
}
|
|
4104
|
+
const sessionToken = await sdk.getSessionToken();
|
|
4105
|
+
if (!mountedRef.current) {
|
|
4106
|
+
return;
|
|
4107
|
+
}
|
|
4108
|
+
if (!sessionToken) {
|
|
4109
|
+
setStatus("disabled");
|
|
4110
|
+
return;
|
|
4111
|
+
}
|
|
4112
|
+
await onSessionToken(sessionToken);
|
|
4113
|
+
if (mountedRef.current) {
|
|
4114
|
+
setStatus("active");
|
|
4115
|
+
}
|
|
4116
|
+
} catch (err) {
|
|
4117
|
+
if (mountedRef.current) {
|
|
4118
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
4119
|
+
setStatus("error");
|
|
4120
|
+
}
|
|
4121
|
+
} finally {
|
|
4122
|
+
acquiringRef.current = false;
|
|
4123
|
+
}
|
|
4124
|
+
}, [sdk, onSessionToken, checkActive]);
|
|
4125
|
+
(0, import_react43.useEffect)(() => {
|
|
4126
|
+
mountedRef.current = true;
|
|
4127
|
+
void acquire();
|
|
4128
|
+
return () => {
|
|
4129
|
+
mountedRef.current = false;
|
|
4130
|
+
};
|
|
4131
|
+
}, [acquire]);
|
|
4132
|
+
const revalidate = (0, import_react43.useCallback)(async () => {
|
|
4133
|
+
if (acquiringRef.current) {
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
if (statusRef.current !== "active") {
|
|
4137
|
+
return;
|
|
4138
|
+
}
|
|
4139
|
+
try {
|
|
4140
|
+
const isActive = await checkActive();
|
|
4141
|
+
if (!mountedRef.current) {
|
|
4142
|
+
return;
|
|
4143
|
+
}
|
|
4144
|
+
if (!isActive) {
|
|
4145
|
+
void acquire();
|
|
4146
|
+
}
|
|
4147
|
+
} catch (e) {
|
|
4148
|
+
}
|
|
4149
|
+
}, [checkActive, acquire]);
|
|
4150
|
+
(0, import_react43.useEffect)(() => {
|
|
4151
|
+
if (!revalidateOnFocus) {
|
|
4152
|
+
return;
|
|
4153
|
+
}
|
|
4154
|
+
if (typeof document === "undefined") {
|
|
4155
|
+
return;
|
|
4156
|
+
}
|
|
4157
|
+
let hiddenAt = document.visibilityState === "hidden" ? Date.now() : null;
|
|
4158
|
+
const handleVisibilityChange = () => {
|
|
4159
|
+
if (document.visibilityState === "hidden") {
|
|
4160
|
+
hiddenAt = Date.now();
|
|
4161
|
+
return;
|
|
4162
|
+
}
|
|
4163
|
+
if (document.visibilityState === "visible") {
|
|
4164
|
+
const elapsed = hiddenAt === null ? 0 : Date.now() - hiddenAt;
|
|
4165
|
+
hiddenAt = null;
|
|
4166
|
+
if (elapsed >= revalidateAfterMs) {
|
|
4167
|
+
void revalidate();
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
};
|
|
4171
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
4172
|
+
return () => {
|
|
4173
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
4174
|
+
};
|
|
4175
|
+
}, [revalidateOnFocus, revalidateAfterMs, revalidate]);
|
|
4176
|
+
const reacquire = (0, import_react43.useCallback)(() => {
|
|
4177
|
+
void acquire();
|
|
4178
|
+
}, [acquire]);
|
|
4179
|
+
const value = (0, import_react43.useMemo)(() => ({ status, error, reacquire }), [status, error, reacquire]);
|
|
4180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DelegationContext.Provider, { value, children });
|
|
4181
|
+
}
|
|
4182
|
+
|
|
4183
|
+
// src/components/MeshApp.tsx
|
|
4184
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
3990
4185
|
|
|
3991
4186
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
3992
4187
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
3993
|
-
var
|
|
4188
|
+
var import_react44 = require("react");
|
|
3994
4189
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
3995
|
-
const [error, setError] = (0,
|
|
3996
|
-
const [sdk, setSdk] = (0,
|
|
3997
|
-
const initializationInProgress = (0,
|
|
3998
|
-
(0,
|
|
4190
|
+
const [error, setError] = (0, import_react44.useState)();
|
|
4191
|
+
const [sdk, setSdk] = (0, import_react44.useState)();
|
|
4192
|
+
const initializationInProgress = (0, import_react44.useRef)(false);
|
|
4193
|
+
(0, import_react44.useEffect)(
|
|
3999
4194
|
() => {
|
|
4000
4195
|
if (typeof window === "undefined" || sdk) {
|
|
4001
4196
|
return;
|
|
@@ -4013,7 +4208,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
4013
4208
|
setSdk(window.UniformMeshSDK);
|
|
4014
4209
|
}
|
|
4015
4210
|
},
|
|
4016
|
-
//
|
|
4211
|
+
// oxlint-disable-next-line react/exhaustive-deps
|
|
4017
4212
|
[autoResizingDisabled]
|
|
4018
4213
|
);
|
|
4019
4214
|
return {
|
|
@@ -4028,7 +4223,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
4028
4223
|
};
|
|
4029
4224
|
|
|
4030
4225
|
// src/components/MeshApp.tsx
|
|
4031
|
-
var
|
|
4226
|
+
var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
|
|
4032
4227
|
var MeshApp = ({
|
|
4033
4228
|
children,
|
|
4034
4229
|
loadingComponent,
|
|
@@ -4037,36 +4232,36 @@ var MeshApp = ({
|
|
|
4037
4232
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
4038
4233
|
if (initializing || !sdk) {
|
|
4039
4234
|
const LoadingComponent = loadingComponent;
|
|
4040
|
-
return LoadingComponent ? /* @__PURE__ */ (0,
|
|
4235
|
+
return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system20.LoadingIndicator, {});
|
|
4041
4236
|
}
|
|
4042
4237
|
if (error) {
|
|
4043
4238
|
const ErrorComponent = errorComponent;
|
|
4044
4239
|
if (ErrorComponent) {
|
|
4045
|
-
return /* @__PURE__ */ (0,
|
|
4240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ErrorComponent, { error });
|
|
4046
4241
|
}
|
|
4047
4242
|
throw error;
|
|
4048
4243
|
}
|
|
4049
|
-
return /* @__PURE__ */ (0,
|
|
4050
|
-
/* @__PURE__ */ (0,
|
|
4051
|
-
/* @__PURE__ */ (0,
|
|
4244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system20.Theme, {}),
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system20.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(UniformMeshLocationContextProvider, { children }) })
|
|
4052
4247
|
] });
|
|
4053
4248
|
};
|
|
4054
4249
|
|
|
4055
4250
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
4056
|
-
var
|
|
4057
|
-
var
|
|
4058
|
-
var
|
|
4251
|
+
var import_react45 = require("@emotion/react");
|
|
4252
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4253
|
+
var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
|
|
4059
4254
|
var DataRefreshButton = ({
|
|
4060
4255
|
buttonText,
|
|
4061
4256
|
isLoading,
|
|
4062
4257
|
onRefreshData,
|
|
4063
4258
|
...props
|
|
4064
4259
|
}) => {
|
|
4065
|
-
return /* @__PURE__ */ (0,
|
|
4066
|
-
!isLoading ? null : /* @__PURE__ */ (0,
|
|
4067
|
-
|
|
4260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_design_system21.Button, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
4261
|
+
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4262
|
+
import_design_system21.LoadingIndicator,
|
|
4068
4263
|
{
|
|
4069
|
-
css:
|
|
4264
|
+
css: import_react45.css`
|
|
4070
4265
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
4071
4266
|
`
|
|
4072
4267
|
}
|
|
@@ -4076,15 +4271,15 @@ var DataRefreshButton = ({
|
|
|
4076
4271
|
};
|
|
4077
4272
|
|
|
4078
4273
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4079
|
-
var
|
|
4274
|
+
var import_react48 = require("@emotion/react");
|
|
4080
4275
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
4081
|
-
var
|
|
4276
|
+
var import_design_system24 = require("@uniformdev/design-system");
|
|
4082
4277
|
|
|
4083
4278
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
4084
4279
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
4085
|
-
var
|
|
4086
|
-
var
|
|
4087
|
-
var ObjectSearchContext = (0,
|
|
4280
|
+
var import_react46 = require("react");
|
|
4281
|
+
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
4282
|
+
var ObjectSearchContext = (0, import_react46.createContext)({
|
|
4088
4283
|
onSetQuery: () => {
|
|
4089
4284
|
},
|
|
4090
4285
|
onSelectItem: () => {
|
|
@@ -4105,16 +4300,16 @@ var ObjectSearchProvider = ({
|
|
|
4105
4300
|
children,
|
|
4106
4301
|
defaultQuery
|
|
4107
4302
|
}) => {
|
|
4108
|
-
const [query, setQuery] = (0,
|
|
4303
|
+
const [query, setQuery] = (0, import_react46.useState)({
|
|
4109
4304
|
contentType: "",
|
|
4110
4305
|
keyword: "",
|
|
4111
4306
|
...defaultQuery
|
|
4112
4307
|
});
|
|
4113
4308
|
const { flatVariables } = useVariables(true);
|
|
4114
|
-
const querySearchDeferred = (0,
|
|
4115
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
4116
|
-
const [list, setList] = (0,
|
|
4117
|
-
const onSetQuery = (0,
|
|
4309
|
+
const querySearchDeferred = (0, import_react46.useDeferredValue)(query);
|
|
4310
|
+
const [selectedItems, setSelectedItems] = (0, import_react46.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4311
|
+
const [list, setList] = (0, import_react46.useState)({});
|
|
4312
|
+
const onSetQuery = (0, import_react46.useCallback)(
|
|
4118
4313
|
(value2) => {
|
|
4119
4314
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
4120
4315
|
return setQuery({
|
|
@@ -4126,7 +4321,7 @@ var ObjectSearchProvider = ({
|
|
|
4126
4321
|
},
|
|
4127
4322
|
[setQuery]
|
|
4128
4323
|
);
|
|
4129
|
-
const onSelectItem = (0,
|
|
4324
|
+
const onSelectItem = (0, import_react46.useCallback)(
|
|
4130
4325
|
(selectedResult) => {
|
|
4131
4326
|
if (Array.isArray(selectedResult)) {
|
|
4132
4327
|
setSelectedItems(selectedResult);
|
|
@@ -4140,17 +4335,17 @@ var ObjectSearchProvider = ({
|
|
|
4140
4335
|
},
|
|
4141
4336
|
[setSelectedItems, selectedItems]
|
|
4142
4337
|
);
|
|
4143
|
-
const onRemoveAllSelectedItems = (0,
|
|
4338
|
+
const onRemoveAllSelectedItems = (0, import_react46.useCallback)(() => {
|
|
4144
4339
|
setSelectedItems([]);
|
|
4145
4340
|
}, [setSelectedItems]);
|
|
4146
|
-
const onSetList = (0,
|
|
4341
|
+
const onSetList = (0, import_react46.useCallback)(
|
|
4147
4342
|
(value2) => {
|
|
4148
4343
|
setList(value2);
|
|
4149
4344
|
},
|
|
4150
4345
|
[setList]
|
|
4151
4346
|
);
|
|
4152
|
-
const boundQuery = (0,
|
|
4153
|
-
const value = (0,
|
|
4347
|
+
const boundQuery = (0, import_react46.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4348
|
+
const value = (0, import_react46.useMemo)(
|
|
4154
4349
|
() => ({
|
|
4155
4350
|
boundQuery,
|
|
4156
4351
|
onSetQuery,
|
|
@@ -4174,10 +4369,10 @@ var ObjectSearchProvider = ({
|
|
|
4174
4369
|
onSetList
|
|
4175
4370
|
]
|
|
4176
4371
|
);
|
|
4177
|
-
return /* @__PURE__ */ (0,
|
|
4372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
4178
4373
|
};
|
|
4179
4374
|
function useObjectSearchContext() {
|
|
4180
|
-
return (0,
|
|
4375
|
+
return (0, import_react46.useContext)(ObjectSearchContext);
|
|
4181
4376
|
}
|
|
4182
4377
|
function bindQuery(query, inputs) {
|
|
4183
4378
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -4192,12 +4387,12 @@ function bindQuery(query, inputs) {
|
|
|
4192
4387
|
}
|
|
4193
4388
|
|
|
4194
4389
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
4195
|
-
var
|
|
4390
|
+
var import_design_system23 = require("@uniformdev/design-system");
|
|
4196
4391
|
|
|
4197
4392
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
4198
|
-
var
|
|
4199
|
-
var
|
|
4200
|
-
var ObjectListItemContainer =
|
|
4393
|
+
var import_react47 = require("@emotion/react");
|
|
4394
|
+
var import_design_system22 = require("@uniformdev/design-system");
|
|
4395
|
+
var ObjectListItemContainer = import_react47.css`
|
|
4201
4396
|
align-items: center;
|
|
4202
4397
|
border: 1px solid var(--gray-300);
|
|
4203
4398
|
border-radius: var(--rounded-base);
|
|
@@ -4206,12 +4401,12 @@ var ObjectListItemContainer = import_react44.css`
|
|
|
4206
4401
|
grid-template-columns: 1fr auto;
|
|
4207
4402
|
padding: var(--spacing-sm);
|
|
4208
4403
|
`;
|
|
4209
|
-
var ObjectListItemContainerDisabled =
|
|
4404
|
+
var ObjectListItemContainerDisabled = import_react47.css`
|
|
4210
4405
|
opacity: var(--opacity-50);
|
|
4211
4406
|
pointer-events: none;
|
|
4212
4407
|
`;
|
|
4213
|
-
var ObjectListItemLoading =
|
|
4214
|
-
animation: ${
|
|
4408
|
+
var ObjectListItemLoading = import_react47.css`
|
|
4409
|
+
animation: ${import_design_system22.skeletonLoading} 1s linear infinite alternate;
|
|
4215
4410
|
border-color: transparent;
|
|
4216
4411
|
min-height: 42px;
|
|
4217
4412
|
position: relative;
|
|
@@ -4234,43 +4429,43 @@ var ObjectListItemLoading = import_react44.css`
|
|
|
4234
4429
|
width: 1rem;
|
|
4235
4430
|
}
|
|
4236
4431
|
`;
|
|
4237
|
-
var ObjectListItemHeadingGroup =
|
|
4432
|
+
var ObjectListItemHeadingGroup = import_react47.css`
|
|
4238
4433
|
align-items: center;
|
|
4239
4434
|
display: grid;
|
|
4240
4435
|
`;
|
|
4241
|
-
var ObjectListItemThumbnail =
|
|
4436
|
+
var ObjectListItemThumbnail = import_react47.css`
|
|
4242
4437
|
width: 30px;
|
|
4243
4438
|
height: 30px;
|
|
4244
4439
|
object-fit: cover;
|
|
4245
4440
|
`;
|
|
4246
|
-
var ObjectListItemTitle =
|
|
4441
|
+
var ObjectListItemTitle = import_react47.css`
|
|
4247
4442
|
color: var(--typography-base);
|
|
4248
4443
|
display: block;
|
|
4249
4444
|
font-size: var(--fs-sm);
|
|
4250
4445
|
`;
|
|
4251
|
-
var ObjectListItemSubtitle =
|
|
4446
|
+
var ObjectListItemSubtitle = import_react47.css`
|
|
4252
4447
|
color: var(--gray-500);
|
|
4253
4448
|
display: block;
|
|
4254
4449
|
font-size: var(--fs-xs);
|
|
4255
4450
|
line-height: 1;
|
|
4256
4451
|
`;
|
|
4257
|
-
var ObjectListItemInfoContainer =
|
|
4452
|
+
var ObjectListItemInfoContainer = import_react47.css`
|
|
4258
4453
|
align-items: center;
|
|
4259
4454
|
display: flex;
|
|
4260
4455
|
gap: var(--spacing-sm);
|
|
4261
4456
|
justify-content: center;
|
|
4262
4457
|
`;
|
|
4263
|
-
var ObjectListItemControlledContent =
|
|
4458
|
+
var ObjectListItemControlledContent = import_react47.css`
|
|
4264
4459
|
display: flex;
|
|
4265
4460
|
gap: var(--spacing-sm);
|
|
4266
4461
|
`;
|
|
4267
|
-
var ObjectListItemUnControlledContent =
|
|
4462
|
+
var ObjectListItemUnControlledContent = import_react47.css`
|
|
4268
4463
|
margin-top: var(--spacing-sm);
|
|
4269
4464
|
grid-column: 1 / -1;
|
|
4270
4465
|
`;
|
|
4271
4466
|
|
|
4272
4467
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
4273
|
-
var
|
|
4468
|
+
var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
|
|
4274
4469
|
var ObjectSearchListItem = ({
|
|
4275
4470
|
id,
|
|
4276
4471
|
title,
|
|
@@ -4295,7 +4490,7 @@ var ObjectSearchListItem = ({
|
|
|
4295
4490
|
return onSelectItem([selectedItem]);
|
|
4296
4491
|
};
|
|
4297
4492
|
const selected = selectedListItems.some((item) => item.id === id);
|
|
4298
|
-
return /* @__PURE__ */ (0,
|
|
4493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4299
4494
|
"div",
|
|
4300
4495
|
{
|
|
4301
4496
|
role: "listitem",
|
|
@@ -4303,7 +4498,7 @@ var ObjectSearchListItem = ({
|
|
|
4303
4498
|
"data-testid": "list-item",
|
|
4304
4499
|
...props,
|
|
4305
4500
|
children: [
|
|
4306
|
-
/* @__PURE__ */ (0,
|
|
4501
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4307
4502
|
"div",
|
|
4308
4503
|
{
|
|
4309
4504
|
role: "button",
|
|
@@ -4311,7 +4506,7 @@ var ObjectSearchListItem = ({
|
|
|
4311
4506
|
css: ObjectListItemControlledContent,
|
|
4312
4507
|
"aria-disabled": disabled,
|
|
4313
4508
|
children: [
|
|
4314
|
-
imageUrl ? /* @__PURE__ */ (0,
|
|
4509
|
+
imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4315
4510
|
"img",
|
|
4316
4511
|
{
|
|
4317
4512
|
src: imageUrl,
|
|
@@ -4320,28 +4515,28 @@ var ObjectSearchListItem = ({
|
|
|
4320
4515
|
loading: "lazy"
|
|
4321
4516
|
}
|
|
4322
4517
|
) : null,
|
|
4323
|
-
/* @__PURE__ */ (0,
|
|
4324
|
-
!contentType ? null : /* @__PURE__ */ (0,
|
|
4325
|
-
/* @__PURE__ */ (0,
|
|
4518
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
4519
|
+
!contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
4520
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
4326
4521
|
] })
|
|
4327
4522
|
]
|
|
4328
4523
|
}
|
|
4329
4524
|
),
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4331
|
-
selected ? /* @__PURE__ */ (0,
|
|
4332
|
-
!popoverData ? null : /* @__PURE__ */ (0,
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: ObjectListItemInfoContainer, children: [
|
|
4526
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system23.Chip, { text: "selected", size: "xs" }) : null,
|
|
4527
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system23.Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4333
4528
|
] }),
|
|
4334
|
-
!children ? null : /* @__PURE__ */ (0,
|
|
4529
|
+
!children ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { css: ObjectListItemUnControlledContent, children })
|
|
4335
4530
|
]
|
|
4336
4531
|
}
|
|
4337
4532
|
);
|
|
4338
4533
|
};
|
|
4339
4534
|
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
4340
|
-
return /* @__PURE__ */ (0,
|
|
4535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
4341
4536
|
};
|
|
4342
4537
|
|
|
4343
4538
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4344
|
-
var
|
|
4539
|
+
var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
|
|
4345
4540
|
var ObjectSearchContainer = ({
|
|
4346
4541
|
label,
|
|
4347
4542
|
enableDynamicInputToResultId,
|
|
@@ -4353,19 +4548,19 @@ var ObjectSearchContainer = ({
|
|
|
4353
4548
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
4354
4549
|
const { flatVariables } = useVariables(true);
|
|
4355
4550
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
4356
|
-
const listItems = resultList != null ? resultList : /* @__PURE__ */ (0,
|
|
4357
|
-
|
|
4551
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4552
|
+
import_design_system24.ScrollableList,
|
|
4358
4553
|
{
|
|
4359
4554
|
role: "list",
|
|
4360
|
-
css:
|
|
4555
|
+
css: import_react48.css`
|
|
4361
4556
|
> div {
|
|
4362
4557
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4363
4558
|
}
|
|
4364
4559
|
`,
|
|
4365
|
-
children: /* @__PURE__ */ (0,
|
|
4560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DefaultResultList, {})
|
|
4366
4561
|
}
|
|
4367
4562
|
);
|
|
4368
|
-
const body = /* @__PURE__ */ (0,
|
|
4563
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system24.VerticalRhythm, { children: [
|
|
4369
4564
|
searchFilters,
|
|
4370
4565
|
listItems
|
|
4371
4566
|
] });
|
|
@@ -4396,8 +4591,8 @@ var ObjectSearchContainer = ({
|
|
|
4396
4591
|
}
|
|
4397
4592
|
]);
|
|
4398
4593
|
};
|
|
4399
|
-
return /* @__PURE__ */ (0,
|
|
4400
|
-
/* @__PURE__ */ (0,
|
|
4594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system24.VerticalRhythm, { children: [
|
|
4595
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system24.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4401
4596
|
InputVariables,
|
|
4402
4597
|
{
|
|
4403
4598
|
label,
|
|
@@ -4419,21 +4614,21 @@ var DefaultResultList = () => {
|
|
|
4419
4614
|
var _a;
|
|
4420
4615
|
const { list } = useObjectSearchContext();
|
|
4421
4616
|
if (!list.items) {
|
|
4422
|
-
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0,
|
|
4617
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
4423
4618
|
}
|
|
4424
4619
|
if (list.items.length === 0) {
|
|
4425
|
-
return /* @__PURE__ */ (0,
|
|
4620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system24.Callout, { type: "info", children: "No results were found" });
|
|
4426
4621
|
}
|
|
4427
|
-
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0,
|
|
4622
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ObjectSearchListItem, { ...item }, item.id));
|
|
4428
4623
|
};
|
|
4429
4624
|
|
|
4430
4625
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4431
|
-
var
|
|
4432
|
-
var
|
|
4626
|
+
var import_design_system25 = require("@uniformdev/design-system");
|
|
4627
|
+
var import_react50 = require("react");
|
|
4433
4628
|
|
|
4434
4629
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4435
|
-
var
|
|
4436
|
-
var ObjectSearchFilterContainerLabel =
|
|
4630
|
+
var import_react49 = require("@emotion/react");
|
|
4631
|
+
var ObjectSearchFilterContainerLabel = import_react49.css`
|
|
4437
4632
|
align-items: center;
|
|
4438
4633
|
display: flex;
|
|
4439
4634
|
font-size: var(--fs-sm);
|
|
@@ -4441,18 +4636,18 @@ var ObjectSearchFilterContainerLabel = import_react46.css`
|
|
|
4441
4636
|
line-height: 1rem;
|
|
4442
4637
|
margin-bottom: var(--spacing-sm);
|
|
4443
4638
|
`;
|
|
4444
|
-
var ObjectSearchFilterContainer =
|
|
4639
|
+
var ObjectSearchFilterContainer = import_react49.css`
|
|
4445
4640
|
display: grid;
|
|
4446
4641
|
gap: var(--spacing-base);
|
|
4447
4642
|
`;
|
|
4448
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
4643
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react49.css`
|
|
4449
4644
|
display: grid;
|
|
4450
4645
|
grid-template-columns: ${gridColumns};
|
|
4451
4646
|
gap: var(--spacing-base);
|
|
4452
4647
|
`;
|
|
4453
4648
|
|
|
4454
4649
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4455
|
-
var
|
|
4650
|
+
var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
|
|
4456
4651
|
var ObjectSearchFilter = ({
|
|
4457
4652
|
requireContentType,
|
|
4458
4653
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -4463,7 +4658,7 @@ var ObjectSearchFilter = ({
|
|
|
4463
4658
|
}) => {
|
|
4464
4659
|
var _a, _b;
|
|
4465
4660
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4466
|
-
const [searchState, setSearchState] = (0,
|
|
4661
|
+
const [searchState, setSearchState] = (0, import_react50.useState)({
|
|
4467
4662
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4468
4663
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
4469
4664
|
});
|
|
@@ -4473,7 +4668,7 @@ var ObjectSearchFilter = ({
|
|
|
4473
4668
|
});
|
|
4474
4669
|
onSetQuery({ ...query, ...value });
|
|
4475
4670
|
};
|
|
4476
|
-
const memoizedSelectOptions = (0,
|
|
4671
|
+
const memoizedSelectOptions = (0, import_react50.useMemo)(() => {
|
|
4477
4672
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4478
4673
|
return [];
|
|
4479
4674
|
}
|
|
@@ -4483,7 +4678,7 @@ var ObjectSearchFilter = ({
|
|
|
4483
4678
|
];
|
|
4484
4679
|
}, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
|
|
4485
4680
|
const shouldRenderSelect = memoizedSelectOptions.length > 0;
|
|
4486
|
-
return /* @__PURE__ */ (0,
|
|
4681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4487
4682
|
"fieldset",
|
|
4488
4683
|
{
|
|
4489
4684
|
css: [
|
|
@@ -4491,8 +4686,8 @@ var ObjectSearchFilter = ({
|
|
|
4491
4686
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
4492
4687
|
],
|
|
4493
4688
|
children: [
|
|
4494
|
-
memoizedSelectOptions.length ? /* @__PURE__ */ (0,
|
|
4495
|
-
|
|
4689
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4690
|
+
import_design_system25.InputSelect,
|
|
4496
4691
|
{
|
|
4497
4692
|
label: selectLabel,
|
|
4498
4693
|
showLabel: false,
|
|
@@ -4501,8 +4696,8 @@ var ObjectSearchFilter = ({
|
|
|
4501
4696
|
value: query.contentType
|
|
4502
4697
|
}
|
|
4503
4698
|
) : null,
|
|
4504
|
-
/* @__PURE__ */ (0,
|
|
4505
|
-
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4700
|
+
import_design_system25.DebouncedInputKeywordSearch,
|
|
4506
4701
|
{
|
|
4507
4702
|
inputFieldName: searchInputName,
|
|
4508
4703
|
placeholder: searchInputPlaceholderText,
|
|
@@ -4518,27 +4713,27 @@ var ObjectSearchFilter = ({
|
|
|
4518
4713
|
};
|
|
4519
4714
|
|
|
4520
4715
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
4521
|
-
var
|
|
4716
|
+
var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
|
|
4522
4717
|
var ObjectSearchFilterContainer2 = ({ children }) => {
|
|
4523
|
-
return /* @__PURE__ */ (0,
|
|
4718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { css: ObjectSearchFilterContainer, children }) });
|
|
4524
4719
|
};
|
|
4525
4720
|
|
|
4526
4721
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4527
|
-
var
|
|
4722
|
+
var import_design_system27 = require("@uniformdev/design-system");
|
|
4528
4723
|
var import_timeago = require("timeago.js");
|
|
4529
4724
|
|
|
4530
4725
|
// src/components/Image/Image.tsx
|
|
4531
|
-
var
|
|
4726
|
+
var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
|
|
4532
4727
|
function Image({ src, alt, className }) {
|
|
4533
4728
|
const CompImage = src && typeof src !== "string" ? src : null;
|
|
4534
|
-
return CompImage ? /* @__PURE__ */ (0,
|
|
4729
|
+
return CompImage ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CompImage, { className }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src, alt, className });
|
|
4535
4730
|
}
|
|
4536
4731
|
|
|
4537
4732
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
4538
|
-
var
|
|
4539
|
-
var
|
|
4540
|
-
var ButtonStyles =
|
|
4541
|
-
${
|
|
4733
|
+
var import_react51 = require("@emotion/react");
|
|
4734
|
+
var import_design_system26 = require("@uniformdev/design-system");
|
|
4735
|
+
var ButtonStyles = import_react51.css`
|
|
4736
|
+
${import_design_system26.button}
|
|
4542
4737
|
background: transparent;
|
|
4543
4738
|
border: 1px solid var(--typography-base);
|
|
4544
4739
|
color: var(--typography-base);
|
|
@@ -4565,20 +4760,20 @@ var ButtonStyles = import_react48.css`
|
|
|
4565
4760
|
text-decoration: none;
|
|
4566
4761
|
}
|
|
4567
4762
|
`;
|
|
4568
|
-
var ButtonIcon =
|
|
4763
|
+
var ButtonIcon = import_react51.css`
|
|
4569
4764
|
width: 1rem;
|
|
4570
4765
|
height: 1rem;
|
|
4571
4766
|
`;
|
|
4572
4767
|
|
|
4573
4768
|
// src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
|
|
4574
|
-
var
|
|
4769
|
+
var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
|
|
4575
4770
|
var ObjectSearchResultItemButton = ({
|
|
4576
4771
|
text,
|
|
4577
4772
|
icon,
|
|
4578
4773
|
...props
|
|
4579
4774
|
}) => {
|
|
4580
|
-
return /* @__PURE__ */ (0,
|
|
4581
|
-
!icon ? null : /* @__PURE__ */ (0,
|
|
4775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4776
|
+
!icon ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Image, { src: icon, css: ButtonIcon }),
|
|
4582
4777
|
text
|
|
4583
4778
|
] });
|
|
4584
4779
|
};
|
|
@@ -4587,15 +4782,15 @@ var LinkButton = ({
|
|
|
4587
4782
|
icon,
|
|
4588
4783
|
...props
|
|
4589
4784
|
}) => {
|
|
4590
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
-
!icon ? null : /* @__PURE__ */ (0,
|
|
4785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4786
|
+
!icon ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Image, { src: icon, css: ButtonIcon }),
|
|
4592
4787
|
text
|
|
4593
4788
|
] });
|
|
4594
4789
|
};
|
|
4595
4790
|
|
|
4596
4791
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
4597
|
-
var
|
|
4598
|
-
var ObjectSearchResultItemContainer =
|
|
4792
|
+
var import_react52 = require("@emotion/react");
|
|
4793
|
+
var ObjectSearchResultItemContainer = import_react52.css`
|
|
4599
4794
|
align-items: center;
|
|
4600
4795
|
border: 1px solid var(--gray-300);
|
|
4601
4796
|
border-radius: var(--rounded-base);
|
|
@@ -4611,7 +4806,7 @@ var ObjectSearchResultItemContainer = import_react49.css`
|
|
|
4611
4806
|
}
|
|
4612
4807
|
}
|
|
4613
4808
|
`;
|
|
4614
|
-
var ObjectSearchDragHandle =
|
|
4809
|
+
var ObjectSearchDragHandle = import_react52.css`
|
|
4615
4810
|
border-left: 2px dotted var(--gray-300);
|
|
4616
4811
|
border-right: 2px dotted var(--gray-300);
|
|
4617
4812
|
position: absolute;
|
|
@@ -4620,47 +4815,47 @@ var ObjectSearchDragHandle = import_react49.css`
|
|
|
4620
4815
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4621
4816
|
opacity: 0;
|
|
4622
4817
|
`;
|
|
4623
|
-
var ObjectSearchResultItemSubtitle =
|
|
4818
|
+
var ObjectSearchResultItemSubtitle = import_react52.css`
|
|
4624
4819
|
color: var(--gray-500);
|
|
4625
4820
|
display: block;
|
|
4626
4821
|
font-size: var(--fs-xs);
|
|
4627
4822
|
line-height: 1;
|
|
4628
4823
|
`;
|
|
4629
|
-
var ObjectSearchResultItemTitle =
|
|
4824
|
+
var ObjectSearchResultItemTitle = import_react52.css`
|
|
4630
4825
|
align-items: center;
|
|
4631
4826
|
color: var(--typography-base);
|
|
4632
4827
|
display: flex;
|
|
4633
4828
|
gap: var(--spacing-xs);
|
|
4634
4829
|
`;
|
|
4635
|
-
var ObjectSearchResultItemTimeStamp =
|
|
4830
|
+
var ObjectSearchResultItemTimeStamp = import_react52.css`
|
|
4636
4831
|
color: var(--gray-500);
|
|
4637
4832
|
font-size: var(--fs-xs);
|
|
4638
4833
|
`;
|
|
4639
|
-
var ObjectSearchResultItemTitleLink =
|
|
4834
|
+
var ObjectSearchResultItemTitleLink = import_react52.css`
|
|
4640
4835
|
text-decoration: none;
|
|
4641
4836
|
color: var(--primary-action-default);
|
|
4642
4837
|
font-size: var(--fs-sm);
|
|
4643
4838
|
`;
|
|
4644
|
-
var ObjectSearchAuthorStateGroup =
|
|
4839
|
+
var ObjectSearchAuthorStateGroup = import_react52.css`
|
|
4645
4840
|
align-items: center;
|
|
4646
4841
|
display: flex;
|
|
4647
4842
|
gap: var(--spacing-sm);
|
|
4648
4843
|
`;
|
|
4649
|
-
var ObjectSearchUpdateGroup =
|
|
4844
|
+
var ObjectSearchUpdateGroup = import_react52.css`
|
|
4650
4845
|
display: grid;
|
|
4651
4846
|
`;
|
|
4652
|
-
var ObjectSearchContentContainer =
|
|
4847
|
+
var ObjectSearchContentContainer = import_react52.css`
|
|
4653
4848
|
display: flex;
|
|
4654
4849
|
gap: var(--spacing-base);
|
|
4655
4850
|
`;
|
|
4656
|
-
var ObjectSearchImage =
|
|
4851
|
+
var ObjectSearchImage = import_react52.css`
|
|
4657
4852
|
width: 56px;
|
|
4658
4853
|
height: 56px;
|
|
4659
4854
|
object-fit: cover;
|
|
4660
4855
|
`;
|
|
4661
4856
|
|
|
4662
4857
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4663
|
-
var
|
|
4858
|
+
var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
|
|
4664
4859
|
var ObjectSearchResultItem = ({
|
|
4665
4860
|
id,
|
|
4666
4861
|
title,
|
|
@@ -4684,10 +4879,10 @@ var ObjectSearchResultItem = ({
|
|
|
4684
4879
|
onSelectItem({ id, title: id });
|
|
4685
4880
|
onRemove == null ? void 0 : onRemove();
|
|
4686
4881
|
};
|
|
4687
|
-
return /* @__PURE__ */ (0,
|
|
4688
|
-
disableDnD ? null : /* @__PURE__ */ (0,
|
|
4689
|
-
/* @__PURE__ */ (0,
|
|
4690
|
-
!imageUrl ? null : /* @__PURE__ */ (0,
|
|
4882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
|
|
4883
|
+
disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
|
|
4884
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchContentContainer, children: [
|
|
4885
|
+
!imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4691
4886
|
"img",
|
|
4692
4887
|
{
|
|
4693
4888
|
src: imageUrl,
|
|
@@ -4696,11 +4891,11 @@ var ObjectSearchResultItem = ({
|
|
|
4696
4891
|
loading: "lazy"
|
|
4697
4892
|
}
|
|
4698
4893
|
),
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4700
|
-
/* @__PURE__ */ (0,
|
|
4701
|
-
/* @__PURE__ */ (0,
|
|
4702
|
-
onClick ? /* @__PURE__ */ (0,
|
|
4703
|
-
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
4895
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4896
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4897
|
+
onClick ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4898
|
+
import_design_system27.Link,
|
|
4704
4899
|
{
|
|
4705
4900
|
onClick: (e) => {
|
|
4706
4901
|
e.preventDefault();
|
|
@@ -4711,28 +4906,28 @@ var ObjectSearchResultItem = ({
|
|
|
4711
4906
|
text: title != null ? title : name,
|
|
4712
4907
|
css: ObjectSearchResultItemTitleLink
|
|
4713
4908
|
}
|
|
4714
|
-
) : /* @__PURE__ */ (0,
|
|
4715
|
-
!popoverData ? null : /* @__PURE__ */ (0,
|
|
4909
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: title != null ? title : name }),
|
|
4910
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system27.Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4716
4911
|
] }),
|
|
4717
|
-
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0,
|
|
4718
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0,
|
|
4719
|
-
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0,
|
|
4720
|
-
!createdAt ? null : /* @__PURE__ */ (0,
|
|
4721
|
-
/* @__PURE__ */ (0,
|
|
4912
|
+
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4913
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system27.Chip, { theme: legacyThemeMapper(publishStatus.theme), text: publishStatus.text, size: "xs" }),
|
|
4914
|
+
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
|
|
4915
|
+
!createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4916
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("strong", { children: "Last updated: " }),
|
|
4722
4917
|
(0, import_timeago.format)(createdAt)
|
|
4723
4918
|
] }),
|
|
4724
|
-
!publishedAt ? null : /* @__PURE__ */ (0,
|
|
4725
|
-
/* @__PURE__ */ (0,
|
|
4919
|
+
!publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4920
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("strong", { children: "Last published: " }),
|
|
4726
4921
|
(0, import_timeago.format)(publishedAt)
|
|
4727
4922
|
] })
|
|
4728
4923
|
] })
|
|
4729
4924
|
] }),
|
|
4730
|
-
/* @__PURE__ */ (0,
|
|
4925
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children })
|
|
4731
4926
|
] })
|
|
4732
4927
|
] }) }),
|
|
4733
|
-
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0,
|
|
4734
|
-
!editLink ? null : /* @__PURE__ */ (0,
|
|
4735
|
-
hideRemoveButton ? null : /* @__PURE__ */ (0,
|
|
4928
|
+
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4929
|
+
!editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4930
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system27.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4736
4931
|
] })
|
|
4737
4932
|
] });
|
|
4738
4933
|
};
|
|
@@ -4753,35 +4948,35 @@ function legacyThemeMapper(theme) {
|
|
|
4753
4948
|
|
|
4754
4949
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4755
4950
|
var import_dnd3 = require("@hello-pangea/dnd");
|
|
4756
|
-
var
|
|
4951
|
+
var import_design_system28 = require("@uniformdev/design-system");
|
|
4757
4952
|
|
|
4758
4953
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4759
|
-
var
|
|
4760
|
-
var ObjectSearchResultListContainer =
|
|
4954
|
+
var import_react53 = require("@emotion/react");
|
|
4955
|
+
var ObjectSearchResultListContainer = import_react53.css`
|
|
4761
4956
|
align-items: center;
|
|
4762
4957
|
display: flex;
|
|
4763
4958
|
gap: var(--spacing-sm);
|
|
4764
4959
|
justify-content: space-between;
|
|
4765
4960
|
`;
|
|
4766
|
-
var ObjectSearchDragContainer =
|
|
4961
|
+
var ObjectSearchDragContainer = import_react53.css`
|
|
4767
4962
|
margin: 0 0 var(--spacing-sm);
|
|
4768
4963
|
`;
|
|
4769
|
-
var ObjectSearchContainerDragging =
|
|
4964
|
+
var ObjectSearchContainerDragging = import_react53.css`
|
|
4770
4965
|
box-shadow: var(--shadow-base);
|
|
4771
4966
|
opacity: var(--opacity-50);
|
|
4772
4967
|
`;
|
|
4773
|
-
var ObjectSearchResultListCounterContainer =
|
|
4968
|
+
var ObjectSearchResultListCounterContainer = import_react53.css`
|
|
4774
4969
|
align-items: center;
|
|
4775
4970
|
display: flex;
|
|
4776
4971
|
gap: var(--spacing-sm);
|
|
4777
4972
|
`;
|
|
4778
|
-
var ObjectSearchResultListTitle =
|
|
4973
|
+
var ObjectSearchResultListTitle = import_react53.css`
|
|
4779
4974
|
font-weight: var(--fw-bold);
|
|
4780
4975
|
line-height: 1;
|
|
4781
4976
|
`;
|
|
4782
4977
|
|
|
4783
4978
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4784
|
-
var
|
|
4979
|
+
var import_jsx_runtime57 = require("@emotion/react/jsx-runtime");
|
|
4785
4980
|
var DroppableHack2 = import_dnd3.Droppable;
|
|
4786
4981
|
var DraggableHack2 = import_dnd3.Draggable;
|
|
4787
4982
|
function ObjectSearchResultList({
|
|
@@ -4791,7 +4986,7 @@ function ObjectSearchResultList({
|
|
|
4791
4986
|
hideRemoveButton = false,
|
|
4792
4987
|
resultLabelOverride,
|
|
4793
4988
|
additionalButtons,
|
|
4794
|
-
renderResultComponent = (value) => /* @__PURE__ */ (0,
|
|
4989
|
+
renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ObjectSearchResultItem, { ...value }),
|
|
4795
4990
|
multiSelectId,
|
|
4796
4991
|
disableDnD = false,
|
|
4797
4992
|
getContainerForDnDReparenting,
|
|
@@ -4818,7 +5013,7 @@ function ObjectSearchResultList({
|
|
|
4818
5013
|
...item,
|
|
4819
5014
|
disableDnD: selectedListItems.length === 1 || disableDnD
|
|
4820
5015
|
});
|
|
4821
|
-
return /* @__PURE__ */ (0,
|
|
5016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4822
5017
|
"div",
|
|
4823
5018
|
{
|
|
4824
5019
|
css: [
|
|
@@ -4833,17 +5028,17 @@ function ObjectSearchResultList({
|
|
|
4833
5028
|
}
|
|
4834
5029
|
);
|
|
4835
5030
|
};
|
|
4836
|
-
return /* @__PURE__ */ (0,
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4838
|
-
!resultLabelOverride ? /* @__PURE__ */ (0,
|
|
4839
|
-
/* @__PURE__ */ (0,
|
|
5031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
5033
|
+
!resultLabelOverride ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
5034
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
4840
5035
|
" ",
|
|
4841
|
-
!selectedListItems.length ? null : /* @__PURE__ */ (0,
|
|
5036
|
+
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system28.Counter, { count: selectedListItems.length })
|
|
4842
5037
|
] }) : resultLabelOverride,
|
|
4843
|
-
/* @__PURE__ */ (0,
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
4844
5039
|
additionalButtons,
|
|
4845
|
-
hideRemoveButton ? null : /* @__PURE__ */ (0,
|
|
4846
|
-
|
|
5040
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5041
|
+
import_design_system28.Button,
|
|
4847
5042
|
{
|
|
4848
5043
|
buttonType: "ghostDestructive",
|
|
4849
5044
|
size: "xs",
|
|
@@ -4854,15 +5049,15 @@ function ObjectSearchResultList({
|
|
|
4854
5049
|
)
|
|
4855
5050
|
] })
|
|
4856
5051
|
] }),
|
|
4857
|
-
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0,
|
|
5052
|
+
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4858
5053
|
DroppableHack2,
|
|
4859
5054
|
{
|
|
4860
5055
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
4861
5056
|
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
4862
5057
|
getContainerForClone: getContainerForDnDReparenting,
|
|
4863
|
-
children: (provided) => /* @__PURE__ */ (0,
|
|
5058
|
+
children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4864
5059
|
selectedListItems.map((item, i) => {
|
|
4865
|
-
return /* @__PURE__ */ (0,
|
|
5060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4866
5061
|
DraggableHack2,
|
|
4867
5062
|
{
|
|
4868
5063
|
draggableId: item.id,
|
|
@@ -4881,9 +5076,9 @@ function ObjectSearchResultList({
|
|
|
4881
5076
|
}
|
|
4882
5077
|
|
|
4883
5078
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
4884
|
-
var
|
|
4885
|
-
var
|
|
4886
|
-
var
|
|
5079
|
+
var import_design_system29 = require("@uniformdev/design-system");
|
|
5080
|
+
var import_react54 = require("react");
|
|
5081
|
+
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
4887
5082
|
var QueryFilter = ({
|
|
4888
5083
|
requireContentType,
|
|
4889
5084
|
queryFilterTitle = "Configure Query",
|
|
@@ -4911,7 +5106,7 @@ var QueryFilter = ({
|
|
|
4911
5106
|
}) => {
|
|
4912
5107
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4913
5108
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4914
|
-
const [queryState, setQueryState] = (0,
|
|
5109
|
+
const [queryState, setQueryState] = (0, import_react54.useState)({
|
|
4915
5110
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4916
5111
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
4917
5112
|
count: (_c = query.count) != null ? _c : 5,
|
|
@@ -4922,13 +5117,13 @@ var QueryFilter = ({
|
|
|
4922
5117
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4923
5118
|
onSetQuery({ ...query, ...value });
|
|
4924
5119
|
};
|
|
4925
|
-
(0,
|
|
5120
|
+
(0, import_react54.useEffect)(() => {
|
|
4926
5121
|
onSetQuery(queryState);
|
|
4927
5122
|
}, []);
|
|
4928
|
-
return /* @__PURE__ */ (0,
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
4931
|
-
/* @__PURE__ */ (0,
|
|
5123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("fieldset", { children: [
|
|
5124
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
5125
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_design_system29.VerticalRhythm, { children: [
|
|
5126
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4932
5127
|
InputVariables,
|
|
4933
5128
|
{
|
|
4934
5129
|
label: searchInputLabel,
|
|
@@ -4936,8 +5131,8 @@ var QueryFilter = ({
|
|
|
4936
5131
|
onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
|
|
4937
5132
|
disableInlineMenu: true,
|
|
4938
5133
|
id: "qf_searchText",
|
|
4939
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
4940
|
-
|
|
5134
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5135
|
+
import_design_system29.DebouncedInputKeywordSearch,
|
|
4941
5136
|
{
|
|
4942
5137
|
id: "qf_searchText",
|
|
4943
5138
|
inputFieldName: searchInputName,
|
|
@@ -4950,8 +5145,8 @@ var QueryFilter = ({
|
|
|
4950
5145
|
)
|
|
4951
5146
|
}
|
|
4952
5147
|
),
|
|
4953
|
-
/* @__PURE__ */ (0,
|
|
4954
|
-
/* @__PURE__ */ (0,
|
|
5148
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
|
|
5149
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4955
5150
|
InputVariables,
|
|
4956
5151
|
{
|
|
4957
5152
|
label: contentTypeLabel,
|
|
@@ -4959,8 +5154,8 @@ var QueryFilter = ({
|
|
|
4959
5154
|
value: (_g = queryState.contentType) != null ? _g : "",
|
|
4960
5155
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
4961
5156
|
disableInlineMenu: true,
|
|
4962
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
4963
|
-
|
|
5157
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5158
|
+
import_design_system29.InputSelect,
|
|
4964
5159
|
{
|
|
4965
5160
|
id: "qf_contentType",
|
|
4966
5161
|
label: contentTypeLabel,
|
|
@@ -4973,7 +5168,7 @@ var QueryFilter = ({
|
|
|
4973
5168
|
)
|
|
4974
5169
|
}
|
|
4975
5170
|
),
|
|
4976
|
-
/* @__PURE__ */ (0,
|
|
5171
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4977
5172
|
InputVariables,
|
|
4978
5173
|
{
|
|
4979
5174
|
label: countLabel,
|
|
@@ -4982,8 +5177,8 @@ var QueryFilter = ({
|
|
|
4982
5177
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
4983
5178
|
disableInlineMenu: true,
|
|
4984
5179
|
valueToResetTo: "5",
|
|
4985
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
4986
|
-
|
|
5180
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5181
|
+
import_design_system29.Input,
|
|
4987
5182
|
{
|
|
4988
5183
|
id: "qf_count",
|
|
4989
5184
|
label: countLabel,
|
|
@@ -4997,8 +5192,8 @@ var QueryFilter = ({
|
|
|
4997
5192
|
}
|
|
4998
5193
|
)
|
|
4999
5194
|
] }),
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
5001
|
-
/* @__PURE__ */ (0,
|
|
5195
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
|
|
5196
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5002
5197
|
InputVariables,
|
|
5003
5198
|
{
|
|
5004
5199
|
id: "qf_sortBy",
|
|
@@ -5006,8 +5201,8 @@ var QueryFilter = ({
|
|
|
5006
5201
|
value: queryState.sortBy,
|
|
5007
5202
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
5008
5203
|
disableInlineMenu: true,
|
|
5009
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
5010
|
-
|
|
5204
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5205
|
+
import_design_system29.InputSelect,
|
|
5011
5206
|
{
|
|
5012
5207
|
label: sortLabel,
|
|
5013
5208
|
id: "qf_sortBy",
|
|
@@ -5020,7 +5215,7 @@ var QueryFilter = ({
|
|
|
5020
5215
|
)
|
|
5021
5216
|
}
|
|
5022
5217
|
),
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5218
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5024
5219
|
InputVariables,
|
|
5025
5220
|
{
|
|
5026
5221
|
label: sortOrderLabel,
|
|
@@ -5028,8 +5223,8 @@ var QueryFilter = ({
|
|
|
5028
5223
|
value: queryState.sortOrder,
|
|
5029
5224
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
5030
5225
|
disableInlineMenu: true,
|
|
5031
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
5032
|
-
|
|
5226
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5227
|
+
import_design_system29.InputSelect,
|
|
5033
5228
|
{
|
|
5034
5229
|
label: sortOrderLabel,
|
|
5035
5230
|
id: "qf_sortOrder",
|
|
@@ -5048,8 +5243,8 @@ var QueryFilter = ({
|
|
|
5048
5243
|
};
|
|
5049
5244
|
|
|
5050
5245
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
5051
|
-
var
|
|
5052
|
-
var
|
|
5246
|
+
var import_react55 = require("react");
|
|
5247
|
+
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
5053
5248
|
function ParamTypeDynamicDataProvider(props) {
|
|
5054
5249
|
const { children } = props;
|
|
5055
5250
|
const {
|
|
@@ -5057,11 +5252,11 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
5057
5252
|
} = useMeshLocation("paramType");
|
|
5058
5253
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5059
5254
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
5060
|
-
const variables = (0,
|
|
5255
|
+
const variables = (0, import_react55.useMemo)(
|
|
5061
5256
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
5062
5257
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
5063
5258
|
);
|
|
5064
|
-
return /* @__PURE__ */ (0,
|
|
5259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(VariablesProvider, { value: variables, onChange: () => {
|
|
5065
5260
|
}, editVariableComponent: JsonMeshVariableEditor, children });
|
|
5066
5261
|
}
|
|
5067
5262
|
var JsonMeshVariableEditor = ({
|
|
@@ -5070,9 +5265,9 @@ var JsonMeshVariableEditor = ({
|
|
|
5070
5265
|
variable,
|
|
5071
5266
|
context
|
|
5072
5267
|
}) => {
|
|
5073
|
-
const sillyRef = (0,
|
|
5268
|
+
const sillyRef = (0, import_react55.useRef)(false);
|
|
5074
5269
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
5075
|
-
(0,
|
|
5270
|
+
(0, import_react55.useEffect)(() => {
|
|
5076
5271
|
if (sillyRef.current) {
|
|
5077
5272
|
return;
|
|
5078
5273
|
}
|
|
@@ -5508,6 +5703,12 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5508
5703
|
editorType: "multiChoice",
|
|
5509
5704
|
expectedValueType: "array"
|
|
5510
5705
|
},
|
|
5706
|
+
{
|
|
5707
|
+
label: "is all of...",
|
|
5708
|
+
value: "all",
|
|
5709
|
+
editorType: "multiChoice",
|
|
5710
|
+
expectedValueType: "array"
|
|
5711
|
+
},
|
|
5511
5712
|
{
|
|
5512
5713
|
label: "is empty",
|
|
5513
5714
|
value: "ndef",
|
|
@@ -5535,10 +5736,10 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5535
5736
|
];
|
|
5536
5737
|
|
|
5537
5738
|
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
5538
|
-
var
|
|
5539
|
-
var
|
|
5739
|
+
var import_design_system30 = require("@uniformdev/design-system");
|
|
5740
|
+
var import_react56 = require("react");
|
|
5540
5741
|
var import_react_use2 = require("react-use");
|
|
5541
|
-
var
|
|
5742
|
+
var import_jsx_runtime60 = require("@emotion/react/jsx-runtime");
|
|
5542
5743
|
var DateEditor = ({
|
|
5543
5744
|
onChange,
|
|
5544
5745
|
ariaLabel,
|
|
@@ -5547,10 +5748,10 @@ var DateEditor = ({
|
|
|
5547
5748
|
readOnly,
|
|
5548
5749
|
valueTestId
|
|
5549
5750
|
}) => {
|
|
5550
|
-
const [innerValue, setInnerValue] = (0,
|
|
5751
|
+
const [innerValue, setInnerValue] = (0, import_react56.useState)(value != null ? value : "");
|
|
5551
5752
|
(0, import_react_use2.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
5552
|
-
return /* @__PURE__ */ (0,
|
|
5553
|
-
|
|
5753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5754
|
+
import_design_system30.Input,
|
|
5554
5755
|
{
|
|
5555
5756
|
type: "date",
|
|
5556
5757
|
label: ariaLabel,
|
|
@@ -5565,22 +5766,22 @@ var DateEditor = ({
|
|
|
5565
5766
|
};
|
|
5566
5767
|
|
|
5567
5768
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5568
|
-
var
|
|
5569
|
-
var
|
|
5769
|
+
var import_design_system32 = require("@uniformdev/design-system");
|
|
5770
|
+
var import_react57 = require("react");
|
|
5570
5771
|
var import_react_use3 = require("react-use");
|
|
5571
5772
|
|
|
5572
5773
|
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
5573
|
-
var
|
|
5574
|
-
var
|
|
5774
|
+
var import_design_system31 = require("@uniformdev/design-system");
|
|
5775
|
+
var import_jsx_runtime61 = require("@emotion/react/jsx-runtime");
|
|
5575
5776
|
var ErrorContainer = ({ errorMessage }) => {
|
|
5576
|
-
return /* @__PURE__ */ (0,
|
|
5777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5577
5778
|
"div",
|
|
5578
5779
|
{
|
|
5579
5780
|
css: {
|
|
5580
5781
|
gridColumn: "span 6",
|
|
5581
5782
|
order: 6
|
|
5582
5783
|
},
|
|
5583
|
-
children: /* @__PURE__ */ (0,
|
|
5784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system31.FieldMessage, { errorMessage })
|
|
5584
5785
|
}
|
|
5585
5786
|
);
|
|
5586
5787
|
};
|
|
@@ -5593,7 +5794,7 @@ var twoColumnGrid = {
|
|
|
5593
5794
|
};
|
|
5594
5795
|
|
|
5595
5796
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5596
|
-
var
|
|
5797
|
+
var import_jsx_runtime62 = require("@emotion/react/jsx-runtime");
|
|
5597
5798
|
var DateRangeEditor = ({
|
|
5598
5799
|
ariaLabel,
|
|
5599
5800
|
onChange,
|
|
@@ -5602,9 +5803,9 @@ var DateRangeEditor = ({
|
|
|
5602
5803
|
readOnly,
|
|
5603
5804
|
valueTestId
|
|
5604
5805
|
}) => {
|
|
5605
|
-
const [minDateValue, setMinDateValue] = (0,
|
|
5606
|
-
const [maxDateValue, setMaxDateValue] = (0,
|
|
5607
|
-
const [error, setError] = (0,
|
|
5806
|
+
const [minDateValue, setMinDateValue] = (0, import_react57.useState)(value ? value[0] : "");
|
|
5807
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react57.useState)(value ? value[1] : "");
|
|
5808
|
+
const [error, setError] = (0, import_react57.useState)("");
|
|
5608
5809
|
(0, import_react_use3.useDebounce)(
|
|
5609
5810
|
() => {
|
|
5610
5811
|
if (minDateValue && maxDateValue && !error) {
|
|
@@ -5616,7 +5817,7 @@ var DateRangeEditor = ({
|
|
|
5616
5817
|
500,
|
|
5617
5818
|
[minDateValue, maxDateValue]
|
|
5618
5819
|
);
|
|
5619
|
-
(0,
|
|
5820
|
+
(0, import_react57.useEffect)(() => {
|
|
5620
5821
|
if (!minDateValue || !maxDateValue) {
|
|
5621
5822
|
return;
|
|
5622
5823
|
}
|
|
@@ -5651,10 +5852,10 @@ var DateRangeEditor = ({
|
|
|
5651
5852
|
setMaxDateValue("");
|
|
5652
5853
|
}
|
|
5653
5854
|
}, [minDateValue, maxDateValue, setError]);
|
|
5654
|
-
return /* @__PURE__ */ (0,
|
|
5655
|
-
/* @__PURE__ */ (0,
|
|
5656
|
-
/* @__PURE__ */ (0,
|
|
5657
|
-
|
|
5855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
5856
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5858
|
+
import_design_system32.Input,
|
|
5658
5859
|
{
|
|
5659
5860
|
label: `${ariaLabel}-min-date`,
|
|
5660
5861
|
type: "date",
|
|
@@ -5667,8 +5868,8 @@ var DateRangeEditor = ({
|
|
|
5667
5868
|
"data-testid": "value-low"
|
|
5668
5869
|
}
|
|
5669
5870
|
),
|
|
5670
|
-
/* @__PURE__ */ (0,
|
|
5671
|
-
|
|
5871
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5872
|
+
import_design_system32.Input,
|
|
5672
5873
|
{
|
|
5673
5874
|
label: `${ariaLabel}-max-date`,
|
|
5674
5875
|
type: "date",
|
|
@@ -5682,13 +5883,13 @@ var DateRangeEditor = ({
|
|
|
5682
5883
|
}
|
|
5683
5884
|
)
|
|
5684
5885
|
] }),
|
|
5685
|
-
/* @__PURE__ */ (0,
|
|
5886
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ErrorContainer, { errorMessage: error })
|
|
5686
5887
|
] });
|
|
5687
5888
|
};
|
|
5688
5889
|
|
|
5689
5890
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5690
|
-
var
|
|
5691
|
-
var
|
|
5891
|
+
var import_design_system33 = require("@uniformdev/design-system");
|
|
5892
|
+
var import_react58 = require("react");
|
|
5692
5893
|
|
|
5693
5894
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5694
5895
|
var readOnlyAttributes = {
|
|
@@ -5698,7 +5899,7 @@ var readOnlyAttributes = {
|
|
|
5698
5899
|
};
|
|
5699
5900
|
|
|
5700
5901
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5701
|
-
var
|
|
5902
|
+
var import_jsx_runtime63 = require("@emotion/react/jsx-runtime");
|
|
5702
5903
|
var FilterMultiChoiceEditor = ({
|
|
5703
5904
|
value,
|
|
5704
5905
|
options,
|
|
@@ -5709,12 +5910,12 @@ var FilterMultiChoiceEditor = ({
|
|
|
5709
5910
|
}) => {
|
|
5710
5911
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5711
5912
|
const isClearable = !readOnly || !disabled;
|
|
5712
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5713
|
-
() => (0,
|
|
5913
|
+
const { groupedOptions, selectedOptions } = (0, import_react58.useMemo)(
|
|
5914
|
+
() => (0, import_design_system33.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5714
5915
|
[options, value]
|
|
5715
5916
|
);
|
|
5716
|
-
return /* @__PURE__ */ (0,
|
|
5717
|
-
|
|
5917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5918
|
+
import_design_system33.InputComboBox,
|
|
5718
5919
|
{
|
|
5719
5920
|
...props,
|
|
5720
5921
|
placeholder: "Type to search...",
|
|
@@ -5723,7 +5924,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
5723
5924
|
isClearable,
|
|
5724
5925
|
isDisabled: disabled,
|
|
5725
5926
|
onChange: (e) => {
|
|
5726
|
-
const selectedValues = (0,
|
|
5927
|
+
const selectedValues = (0, import_design_system33.getComboBoxSelectedSelectableGroups)(e);
|
|
5727
5928
|
return props.onChange([...selectedValues]);
|
|
5728
5929
|
},
|
|
5729
5930
|
value: selectedOptions,
|
|
@@ -5742,9 +5943,9 @@ var FilterMultiChoiceEditor = ({
|
|
|
5742
5943
|
};
|
|
5743
5944
|
|
|
5744
5945
|
// src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
|
|
5745
|
-
var
|
|
5746
|
-
var
|
|
5747
|
-
var
|
|
5946
|
+
var import_design_system34 = require("@uniformdev/design-system");
|
|
5947
|
+
var import_react59 = require("react");
|
|
5948
|
+
var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
|
|
5748
5949
|
var FilterSingleChoiceEditor = ({
|
|
5749
5950
|
options,
|
|
5750
5951
|
value,
|
|
@@ -5754,16 +5955,16 @@ var FilterSingleChoiceEditor = ({
|
|
|
5754
5955
|
valueTestId
|
|
5755
5956
|
}) => {
|
|
5756
5957
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5757
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5758
|
-
() => (0,
|
|
5958
|
+
const { groupedOptions, selectedOptions } = (0, import_react59.useMemo)(
|
|
5959
|
+
() => (0, import_design_system34.convertComboBoxGroupsToSelectableGroups)({
|
|
5759
5960
|
options: options != null ? options : [],
|
|
5760
5961
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
5761
5962
|
selectionMode: "single"
|
|
5762
5963
|
}),
|
|
5763
5964
|
[options, value]
|
|
5764
5965
|
);
|
|
5765
|
-
return /* @__PURE__ */ (0,
|
|
5766
|
-
|
|
5966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5967
|
+
import_design_system34.InputComboBox,
|
|
5767
5968
|
{
|
|
5768
5969
|
placeholder: "Type to search...",
|
|
5769
5970
|
options: groupedOptions,
|
|
@@ -5791,10 +5992,10 @@ var FilterSingleChoiceEditor = ({
|
|
|
5791
5992
|
};
|
|
5792
5993
|
|
|
5793
5994
|
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
5794
|
-
var
|
|
5795
|
-
var
|
|
5995
|
+
var import_design_system35 = require("@uniformdev/design-system");
|
|
5996
|
+
var import_react60 = require("react");
|
|
5796
5997
|
var import_react_use4 = require("react-use");
|
|
5797
|
-
var
|
|
5998
|
+
var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
|
|
5798
5999
|
var NumberEditor = ({
|
|
5799
6000
|
ariaLabel,
|
|
5800
6001
|
onChange,
|
|
@@ -5803,10 +6004,10 @@ var NumberEditor = ({
|
|
|
5803
6004
|
readOnly,
|
|
5804
6005
|
valueTestId
|
|
5805
6006
|
}) => {
|
|
5806
|
-
const [innerValue, setInnerValue] = (0,
|
|
6007
|
+
const [innerValue, setInnerValue] = (0, import_react60.useState)(value != null ? value : "");
|
|
5807
6008
|
(0, import_react_use4.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
5808
|
-
return /* @__PURE__ */ (0,
|
|
5809
|
-
|
|
6009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6010
|
+
import_design_system35.Input,
|
|
5810
6011
|
{
|
|
5811
6012
|
label: ariaLabel,
|
|
5812
6013
|
type: "number",
|
|
@@ -5822,10 +6023,10 @@ var NumberEditor = ({
|
|
|
5822
6023
|
};
|
|
5823
6024
|
|
|
5824
6025
|
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
5825
|
-
var
|
|
5826
|
-
var
|
|
6026
|
+
var import_design_system36 = require("@uniformdev/design-system");
|
|
6027
|
+
var import_react61 = require("react");
|
|
5827
6028
|
var import_react_use5 = require("react-use");
|
|
5828
|
-
var
|
|
6029
|
+
var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
|
|
5829
6030
|
var NumberRangeEditor = ({
|
|
5830
6031
|
onChange,
|
|
5831
6032
|
disabled,
|
|
@@ -5834,9 +6035,9 @@ var NumberRangeEditor = ({
|
|
|
5834
6035
|
readOnly,
|
|
5835
6036
|
valueTestId
|
|
5836
6037
|
}) => {
|
|
5837
|
-
const [minValue, setMinValue] = (0,
|
|
5838
|
-
const [maxValue, setMaxValue] = (0,
|
|
5839
|
-
const [error, setError] = (0,
|
|
6038
|
+
const [minValue, setMinValue] = (0, import_react61.useState)("");
|
|
6039
|
+
const [maxValue, setMaxValue] = (0, import_react61.useState)("");
|
|
6040
|
+
const [error, setError] = (0, import_react61.useState)("");
|
|
5840
6041
|
(0, import_react_use5.useDebounce)(
|
|
5841
6042
|
() => {
|
|
5842
6043
|
if (minValue && maxValue && !error) {
|
|
@@ -5848,7 +6049,7 @@ var NumberRangeEditor = ({
|
|
|
5848
6049
|
500,
|
|
5849
6050
|
[minValue, maxValue]
|
|
5850
6051
|
);
|
|
5851
|
-
(0,
|
|
6052
|
+
(0, import_react61.useEffect)(() => {
|
|
5852
6053
|
if (!maxValue && !minValue) {
|
|
5853
6054
|
return;
|
|
5854
6055
|
}
|
|
@@ -5870,10 +6071,10 @@ var NumberRangeEditor = ({
|
|
|
5870
6071
|
setMaxValue(maxValue);
|
|
5871
6072
|
}
|
|
5872
6073
|
}, [maxValue, minValue, setError]);
|
|
5873
|
-
return /* @__PURE__ */ (0,
|
|
5874
|
-
/* @__PURE__ */ (0,
|
|
5875
|
-
/* @__PURE__ */ (0,
|
|
5876
|
-
|
|
6074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
6076
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6077
|
+
import_design_system36.Input,
|
|
5877
6078
|
{
|
|
5878
6079
|
label: `${ariaLabel}-min`,
|
|
5879
6080
|
type: "number",
|
|
@@ -5888,8 +6089,8 @@ var NumberRangeEditor = ({
|
|
|
5888
6089
|
"data-testid": "value-low"
|
|
5889
6090
|
}
|
|
5890
6091
|
),
|
|
5891
|
-
/* @__PURE__ */ (0,
|
|
5892
|
-
|
|
6092
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6093
|
+
import_design_system36.Input,
|
|
5893
6094
|
{
|
|
5894
6095
|
type: "number",
|
|
5895
6096
|
label: `${ariaLabel}-max`,
|
|
@@ -5905,20 +6106,20 @@ var NumberRangeEditor = ({
|
|
|
5905
6106
|
}
|
|
5906
6107
|
)
|
|
5907
6108
|
] }),
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
6109
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ErrorContainer, { errorMessage: error })
|
|
5909
6110
|
] });
|
|
5910
6111
|
};
|
|
5911
6112
|
|
|
5912
6113
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
5913
|
-
var
|
|
5914
|
-
var
|
|
6114
|
+
var import_design_system38 = require("@uniformdev/design-system");
|
|
6115
|
+
var import_react62 = require("react");
|
|
5915
6116
|
|
|
5916
6117
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
5917
|
-
var
|
|
5918
|
-
var
|
|
6118
|
+
var import_design_system37 = require("@uniformdev/design-system");
|
|
6119
|
+
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
5919
6120
|
var CustomOptions = ({ label, value }) => {
|
|
5920
|
-
return /* @__PURE__ */ (0,
|
|
5921
|
-
|
|
6121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6122
|
+
import_design_system37.StatusBullet,
|
|
5922
6123
|
{
|
|
5923
6124
|
status: label,
|
|
5924
6125
|
message: Array.isArray(value) ? value.join(",") : value
|
|
@@ -5927,7 +6128,7 @@ var CustomOptions = ({ label, value }) => {
|
|
|
5927
6128
|
};
|
|
5928
6129
|
|
|
5929
6130
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
5930
|
-
var
|
|
6131
|
+
var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
|
|
5931
6132
|
var StatusMultiEditor = ({
|
|
5932
6133
|
options,
|
|
5933
6134
|
value,
|
|
@@ -5937,17 +6138,17 @@ var StatusMultiEditor = ({
|
|
|
5937
6138
|
valueTestId
|
|
5938
6139
|
}) => {
|
|
5939
6140
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5940
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5941
|
-
() => (0,
|
|
6141
|
+
const { groupedOptions, selectedOptions } = (0, import_react62.useMemo)(
|
|
6142
|
+
() => (0, import_design_system38.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5942
6143
|
[options, value]
|
|
5943
6144
|
);
|
|
5944
|
-
return /* @__PURE__ */ (0,
|
|
5945
|
-
|
|
6145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6146
|
+
import_design_system38.InputComboBox,
|
|
5946
6147
|
{
|
|
5947
6148
|
options: groupedOptions != null ? groupedOptions : [],
|
|
5948
6149
|
isMulti: true,
|
|
5949
6150
|
onChange: (e) => {
|
|
5950
|
-
const selectedValues = (0,
|
|
6151
|
+
const selectedValues = (0, import_design_system38.getComboBoxSelectedSelectableGroups)(e);
|
|
5951
6152
|
return onChange([...selectedValues]);
|
|
5952
6153
|
},
|
|
5953
6154
|
formatOptionLabel: CustomOptions,
|
|
@@ -5968,9 +6169,9 @@ var StatusMultiEditor = ({
|
|
|
5968
6169
|
};
|
|
5969
6170
|
|
|
5970
6171
|
// src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
|
|
5971
|
-
var
|
|
5972
|
-
var
|
|
5973
|
-
var
|
|
6172
|
+
var import_design_system39 = require("@uniformdev/design-system");
|
|
6173
|
+
var import_react63 = require("react");
|
|
6174
|
+
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
5974
6175
|
var StatusSingleEditor = ({
|
|
5975
6176
|
options,
|
|
5976
6177
|
value,
|
|
@@ -5980,16 +6181,16 @@ var StatusSingleEditor = ({
|
|
|
5980
6181
|
valueTestId
|
|
5981
6182
|
}) => {
|
|
5982
6183
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5983
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5984
|
-
() => (0,
|
|
6184
|
+
const { groupedOptions, selectedOptions } = (0, import_react63.useMemo)(
|
|
6185
|
+
() => (0, import_design_system39.convertComboBoxGroupsToSelectableGroups)({
|
|
5985
6186
|
options: options != null ? options : [],
|
|
5986
6187
|
selectedItems: new Set(value ? [value] : void 0),
|
|
5987
6188
|
selectionMode: "single"
|
|
5988
6189
|
}),
|
|
5989
6190
|
[options, value]
|
|
5990
6191
|
);
|
|
5991
|
-
return /* @__PURE__ */ (0,
|
|
5992
|
-
|
|
6192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6193
|
+
import_design_system39.InputComboBox,
|
|
5993
6194
|
{
|
|
5994
6195
|
options: groupedOptions,
|
|
5995
6196
|
onChange: (e) => {
|
|
@@ -6016,10 +6217,10 @@ var StatusSingleEditor = ({
|
|
|
6016
6217
|
};
|
|
6017
6218
|
|
|
6018
6219
|
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
6019
|
-
var
|
|
6020
|
-
var
|
|
6220
|
+
var import_design_system40 = require("@uniformdev/design-system");
|
|
6221
|
+
var import_react64 = require("react");
|
|
6021
6222
|
var import_react_use6 = require("react-use");
|
|
6022
|
-
var
|
|
6223
|
+
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
6023
6224
|
var TextEditor = ({
|
|
6024
6225
|
onChange,
|
|
6025
6226
|
ariaLabel,
|
|
@@ -6027,10 +6228,10 @@ var TextEditor = ({
|
|
|
6027
6228
|
readOnly,
|
|
6028
6229
|
valueTestId
|
|
6029
6230
|
}) => {
|
|
6030
|
-
const [innerValue, setInnerValue] = (0,
|
|
6231
|
+
const [innerValue, setInnerValue] = (0, import_react64.useState)(value != null ? value : "");
|
|
6031
6232
|
(0, import_react_use6.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
6032
|
-
return /* @__PURE__ */ (0,
|
|
6033
|
-
|
|
6233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6234
|
+
import_design_system40.Input,
|
|
6034
6235
|
{
|
|
6035
6236
|
showLabel: false,
|
|
6036
6237
|
label: ariaLabel,
|
|
@@ -6044,9 +6245,9 @@ var TextEditor = ({
|
|
|
6044
6245
|
};
|
|
6045
6246
|
|
|
6046
6247
|
// src/components/SearchAndFilter/editors/TextMultiChoiceEditor.tsx
|
|
6047
|
-
var
|
|
6048
|
-
var
|
|
6049
|
-
var
|
|
6248
|
+
var import_design_system41 = require("@uniformdev/design-system");
|
|
6249
|
+
var import_react65 = require("react");
|
|
6250
|
+
var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
|
|
6050
6251
|
var TextMultiChoiceEditor = ({
|
|
6051
6252
|
value,
|
|
6052
6253
|
disabled,
|
|
@@ -6056,14 +6257,14 @@ var TextMultiChoiceEditor = ({
|
|
|
6056
6257
|
}) => {
|
|
6057
6258
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6058
6259
|
const isClearable = !readOnly || !disabled;
|
|
6059
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6260
|
+
const { groupedOptions, selectedOptions } = (0, import_react65.useMemo)(() => {
|
|
6060
6261
|
var _a;
|
|
6061
6262
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
6062
6263
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
6063
|
-
return (0,
|
|
6264
|
+
return (0, import_design_system41.convertComboBoxGroupsToSelectableGroups)({ options, selectedItems: new Set(value) });
|
|
6064
6265
|
}, [value]);
|
|
6065
|
-
return /* @__PURE__ */ (0,
|
|
6066
|
-
|
|
6266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6267
|
+
import_design_system41.InputCreatableComboBox,
|
|
6067
6268
|
{
|
|
6068
6269
|
...props,
|
|
6069
6270
|
placeholder: "Type a value\u2026",
|
|
@@ -6073,7 +6274,7 @@ var TextMultiChoiceEditor = ({
|
|
|
6073
6274
|
isClearable,
|
|
6074
6275
|
isDisabled: disabled,
|
|
6075
6276
|
onChange: (e) => {
|
|
6076
|
-
const selectedValues = (0,
|
|
6277
|
+
const selectedValues = (0, import_design_system41.getComboBoxSelectedSelectableGroups)(e);
|
|
6077
6278
|
return props.onChange([...selectedValues]);
|
|
6078
6279
|
},
|
|
6079
6280
|
value: selectedOptions,
|
|
@@ -6092,31 +6293,31 @@ var TextMultiChoiceEditor = ({
|
|
|
6092
6293
|
};
|
|
6093
6294
|
|
|
6094
6295
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
6095
|
-
var
|
|
6296
|
+
var import_design_system43 = require("@uniformdev/design-system");
|
|
6096
6297
|
|
|
6097
6298
|
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
6098
|
-
var
|
|
6099
|
-
var
|
|
6100
|
-
var SearchAndFilterControlsWrapper = (gridColumns) =>
|
|
6299
|
+
var import_react66 = require("@emotion/react");
|
|
6300
|
+
var import_design_system42 = require("@uniformdev/design-system");
|
|
6301
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => import_react66.css`
|
|
6101
6302
|
align-items: stretch;
|
|
6102
6303
|
display: grid;
|
|
6103
6304
|
grid-template-columns: ${gridColumns};
|
|
6104
6305
|
gap: var(--spacing-sm);
|
|
6105
6306
|
`;
|
|
6106
|
-
var SearchAndFilterOutterControlWrapper = (gridColumns) =>
|
|
6307
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react66.css`
|
|
6107
6308
|
align-items: stretch;
|
|
6108
6309
|
display: grid;
|
|
6109
6310
|
grid-template-columns: ${gridColumns};
|
|
6110
6311
|
gap: var(--spacing-sm);
|
|
6111
6312
|
`;
|
|
6112
|
-
var ConditionalFilterRow =
|
|
6313
|
+
var ConditionalFilterRow = import_react66.css`
|
|
6113
6314
|
align-items: baseline;
|
|
6114
6315
|
display: grid;
|
|
6115
6316
|
grid-template-columns: 35px 1fr;
|
|
6116
6317
|
gap: var(--spacing-sm);
|
|
6117
6318
|
margin-left: var(--spacing-base);
|
|
6118
6319
|
|
|
6119
|
-
${(0,
|
|
6320
|
+
${(0, import_design_system42.cq)("380px")} {
|
|
6120
6321
|
&:after {
|
|
6121
6322
|
content: '';
|
|
6122
6323
|
display: block;
|
|
@@ -6135,22 +6336,22 @@ var ConditionalFilterRow = import_react63.css`
|
|
|
6135
6336
|
grid-template-columns: 50px 1fr;
|
|
6136
6337
|
}
|
|
6137
6338
|
|
|
6138
|
-
${(0,
|
|
6339
|
+
${(0, import_design_system42.cq)("580px")} {
|
|
6139
6340
|
&:after {
|
|
6140
6341
|
display: none;
|
|
6141
6342
|
}
|
|
6142
6343
|
}
|
|
6143
6344
|
|
|
6144
6345
|
@media (prefers-reduced-motion: no-preference) {
|
|
6145
|
-
animation: ${
|
|
6346
|
+
animation: ${import_design_system42.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
6146
6347
|
}
|
|
6147
6348
|
`;
|
|
6148
|
-
var ConditionalInputRow =
|
|
6349
|
+
var ConditionalInputRow = import_react66.css`
|
|
6149
6350
|
display: flex;
|
|
6150
6351
|
gap: var(--spacing-sm);
|
|
6151
6352
|
flex-wrap: wrap;
|
|
6152
6353
|
|
|
6153
|
-
${(0,
|
|
6354
|
+
${(0, import_design_system42.cq)("380px")} {
|
|
6154
6355
|
& > div:nth-child(-n + 2) {
|
|
6155
6356
|
width: calc(50% - var(--spacing-sm));
|
|
6156
6357
|
}
|
|
@@ -6159,7 +6360,7 @@ var ConditionalInputRow = import_react63.css`
|
|
|
6159
6360
|
width: calc(100% - 48px);
|
|
6160
6361
|
}
|
|
6161
6362
|
}
|
|
6162
|
-
${(0,
|
|
6363
|
+
${(0, import_design_system42.cq)("764px")} {
|
|
6163
6364
|
align-items: flex-start;
|
|
6164
6365
|
display: grid;
|
|
6165
6366
|
grid-template-columns: 250px 160px 1fr 32px;
|
|
@@ -6169,16 +6370,16 @@ var ConditionalInputRow = import_react63.css`
|
|
|
6169
6370
|
}
|
|
6170
6371
|
}
|
|
6171
6372
|
`;
|
|
6172
|
-
var ConditionalInputRowEmpty =
|
|
6373
|
+
var ConditionalInputRowEmpty = import_react66.css`
|
|
6173
6374
|
flex-wrap: nowrap;
|
|
6174
6375
|
`;
|
|
6175
|
-
var SearchInput =
|
|
6376
|
+
var SearchInput = import_react66.css`
|
|
6176
6377
|
&& {
|
|
6177
6378
|
max-height: 40px;
|
|
6178
6379
|
min-height: unset;
|
|
6179
6380
|
}
|
|
6180
6381
|
`;
|
|
6181
|
-
var BindableKeywordSearchInputStyles =
|
|
6382
|
+
var BindableKeywordSearchInputStyles = import_react66.css`
|
|
6182
6383
|
position: relative;
|
|
6183
6384
|
width: 100%;
|
|
6184
6385
|
|
|
@@ -6193,19 +6394,19 @@ var BindableKeywordSearchInputStyles = import_react63.css`
|
|
|
6193
6394
|
white-space: nowrap;
|
|
6194
6395
|
}
|
|
6195
6396
|
`;
|
|
6196
|
-
var ClearSearchButtonContainer =
|
|
6397
|
+
var ClearSearchButtonContainer = import_react66.css`
|
|
6197
6398
|
align-items: center;
|
|
6198
6399
|
display: flex;
|
|
6199
6400
|
position: absolute;
|
|
6200
6401
|
inset: 0 var(--spacing-lg) 0 auto;
|
|
6201
6402
|
`;
|
|
6202
|
-
var ClearSearchButtonStyles =
|
|
6403
|
+
var ClearSearchButtonStyles = import_react66.css`
|
|
6203
6404
|
background: none;
|
|
6204
6405
|
border: none;
|
|
6205
6406
|
padding: 0;
|
|
6206
6407
|
pointer-events: all;
|
|
6207
6408
|
`;
|
|
6208
|
-
var FilterButton =
|
|
6409
|
+
var FilterButton = import_react66.css`
|
|
6209
6410
|
align-items: center;
|
|
6210
6411
|
background: var(--white);
|
|
6211
6412
|
border: 1px solid var(--gray-300);
|
|
@@ -6242,13 +6443,13 @@ var FilterButton = import_react63.css`
|
|
|
6242
6443
|
opacity: var(--opacity-50);
|
|
6243
6444
|
}
|
|
6244
6445
|
`;
|
|
6245
|
-
var FilterButtonText =
|
|
6446
|
+
var FilterButtonText = import_react66.css`
|
|
6246
6447
|
overflow: hidden;
|
|
6247
6448
|
text-overflow: ellipsis;
|
|
6248
6449
|
white-space: nowrap;
|
|
6249
6450
|
max-width: 14ch;
|
|
6250
6451
|
`;
|
|
6251
|
-
var FilterButtonSelected =
|
|
6452
|
+
var FilterButtonSelected = import_react66.css`
|
|
6252
6453
|
background: var(--gray-100);
|
|
6253
6454
|
border-color: var(--gray-300);
|
|
6254
6455
|
|
|
@@ -6256,7 +6457,7 @@ var FilterButtonSelected = import_react63.css`
|
|
|
6256
6457
|
color: var(--accent-dark);
|
|
6257
6458
|
}
|
|
6258
6459
|
`;
|
|
6259
|
-
var FilterButtonWithOptions =
|
|
6460
|
+
var FilterButtonWithOptions = import_react66.css`
|
|
6260
6461
|
:where([aria-expanded='true']) {
|
|
6261
6462
|
background: var(--purple-rain-100);
|
|
6262
6463
|
border-color: var(--accent-light);
|
|
@@ -6268,14 +6469,14 @@ var FilterButtonWithOptions = import_react63.css`
|
|
|
6268
6469
|
}
|
|
6269
6470
|
}
|
|
6270
6471
|
`;
|
|
6271
|
-
var SearchIcon =
|
|
6472
|
+
var SearchIcon = import_react66.css`
|
|
6272
6473
|
color: var(--icon-color);
|
|
6273
6474
|
position: absolute;
|
|
6274
6475
|
inset: 0 var(--spacing-base) 0 auto;
|
|
6275
6476
|
margin: auto;
|
|
6276
6477
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
6277
6478
|
`;
|
|
6278
|
-
var AddConditionalBtn =
|
|
6479
|
+
var AddConditionalBtn = import_react66.css`
|
|
6279
6480
|
align-items: center;
|
|
6280
6481
|
background: transparent;
|
|
6281
6482
|
border: none;
|
|
@@ -6294,14 +6495,14 @@ var AddConditionalBtn = import_react63.css`
|
|
|
6294
6495
|
color: var(--gray-400);
|
|
6295
6496
|
}
|
|
6296
6497
|
`;
|
|
6297
|
-
var Title =
|
|
6498
|
+
var Title = import_react66.css`
|
|
6298
6499
|
color: var(--typography-light);
|
|
6299
6500
|
|
|
6300
6501
|
&:focus {
|
|
6301
6502
|
outline: none;
|
|
6302
6503
|
}
|
|
6303
6504
|
`;
|
|
6304
|
-
var ResetConditionsBtn =
|
|
6505
|
+
var ResetConditionsBtn = import_react66.css`
|
|
6305
6506
|
background: transparent;
|
|
6306
6507
|
border: none;
|
|
6307
6508
|
color: var(--action-destructive-default);
|
|
@@ -6316,13 +6517,13 @@ var ResetConditionsBtn = import_react63.css`
|
|
|
6316
6517
|
color: var(--gray-400);
|
|
6317
6518
|
}
|
|
6318
6519
|
`;
|
|
6319
|
-
var IconBtn =
|
|
6520
|
+
var IconBtn = import_react66.css`
|
|
6320
6521
|
align-self: center;
|
|
6321
6522
|
background: transparent;
|
|
6322
6523
|
border: none;
|
|
6323
6524
|
padding: var(--spacing-sm);
|
|
6324
6525
|
`;
|
|
6325
|
-
var SearchAndFilterOptionsContainer =
|
|
6526
|
+
var SearchAndFilterOptionsContainer = import_react66.css`
|
|
6326
6527
|
background: var(--gray-50);
|
|
6327
6528
|
border: 1px solid var(--gray-300);
|
|
6328
6529
|
border-radius: var(--rounded-base);
|
|
@@ -6333,17 +6534,17 @@ var SearchAndFilterOptionsContainer = import_react63.css`
|
|
|
6333
6534
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6334
6535
|
will-change: height;
|
|
6335
6536
|
`;
|
|
6336
|
-
var SearchAndFilterOptionsInnerContainer =
|
|
6537
|
+
var SearchAndFilterOptionsInnerContainer = import_react66.css`
|
|
6337
6538
|
display: flex;
|
|
6338
6539
|
flex-direction: column;
|
|
6339
6540
|
gap: var(--spacing-sm);
|
|
6340
6541
|
padding-inline: var(--spacing-md);
|
|
6341
6542
|
`;
|
|
6342
|
-
var SearchAndFilterButtonGroup =
|
|
6543
|
+
var SearchAndFilterButtonGroup = import_react66.css`
|
|
6343
6544
|
margin-top: var(--spacing-xs);
|
|
6344
6545
|
margin-left: calc(56px + var(--spacing-md));
|
|
6345
6546
|
`;
|
|
6346
|
-
var SearchAndFilterAdditionalContainer =
|
|
6547
|
+
var SearchAndFilterAdditionalContainer = import_react66.css`
|
|
6347
6548
|
align-items: center;
|
|
6348
6549
|
border-top: 1px solid var(--gray-300);
|
|
6349
6550
|
display: flex;
|
|
@@ -6353,17 +6554,17 @@ var SearchAndFilterAdditionalContainer = import_react63.css`
|
|
|
6353
6554
|
`;
|
|
6354
6555
|
|
|
6355
6556
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
6356
|
-
var
|
|
6557
|
+
var import_jsx_runtime72 = require("@emotion/react/jsx-runtime");
|
|
6357
6558
|
var FilterButton2 = ({
|
|
6358
6559
|
text = "Filters",
|
|
6359
|
-
icon =
|
|
6560
|
+
icon = import_design_system43.customIcons["filter-add"],
|
|
6360
6561
|
filterCount,
|
|
6361
6562
|
hasSelectedValue,
|
|
6362
6563
|
dataTestId,
|
|
6363
6564
|
showDropdownIcon,
|
|
6364
6565
|
...props
|
|
6365
6566
|
}) => {
|
|
6366
|
-
return /* @__PURE__ */ (0,
|
|
6567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
6367
6568
|
"button",
|
|
6368
6569
|
{
|
|
6369
6570
|
type: "button",
|
|
@@ -6375,10 +6576,10 @@ var FilterButton2 = ({
|
|
|
6375
6576
|
...props,
|
|
6376
6577
|
"data-testid": dataTestId,
|
|
6377
6578
|
children: [
|
|
6378
|
-
/* @__PURE__ */ (0,
|
|
6379
|
-
/* @__PURE__ */ (0,
|
|
6380
|
-
filterCount ? /* @__PURE__ */ (0,
|
|
6381
|
-
showDropdownIcon ? /* @__PURE__ */ (0,
|
|
6579
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system43.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
6580
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { css: FilterButtonText, children: text }),
|
|
6581
|
+
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system43.Counter, { count: filterCount, bgColor: "var(--white)" }) : null,
|
|
6582
|
+
showDropdownIcon ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system43.Icon, { icon: "chevron-down", iconColor: "currentColor", size: "1rem" }) : null
|
|
6382
6583
|
]
|
|
6383
6584
|
}
|
|
6384
6585
|
);
|
|
@@ -6387,25 +6588,25 @@ var FilterButton2 = ({
|
|
|
6387
6588
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
6388
6589
|
var import_CgClose = require("@react-icons/all-files/cg/CgClose");
|
|
6389
6590
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
6390
|
-
var
|
|
6591
|
+
var import_design_system45 = require("@uniformdev/design-system");
|
|
6391
6592
|
var import_lexical11 = require("lexical");
|
|
6392
|
-
var
|
|
6593
|
+
var import_react68 = require("react");
|
|
6393
6594
|
var import_react_use7 = require("react-use");
|
|
6394
6595
|
var import_uuid2 = require("uuid");
|
|
6395
6596
|
|
|
6396
6597
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6397
|
-
var
|
|
6398
|
-
var
|
|
6598
|
+
var import_design_system44 = require("@uniformdev/design-system");
|
|
6599
|
+
var import_react67 = require("react");
|
|
6399
6600
|
|
|
6400
6601
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
6401
|
-
var
|
|
6602
|
+
var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
|
|
6402
6603
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
6403
6604
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
6404
6605
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
6405
6606
|
if (!Editor || editorType === "empty") {
|
|
6406
|
-
return /* @__PURE__ */ (0,
|
|
6607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", {});
|
|
6407
6608
|
}
|
|
6408
|
-
return /* @__PURE__ */ (0,
|
|
6609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Editor, { ...props });
|
|
6409
6610
|
};
|
|
6410
6611
|
var filterMapper = {
|
|
6411
6612
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -6423,9 +6624,9 @@ var filterMapper = {
|
|
|
6423
6624
|
function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
6424
6625
|
const WithInputVariables = (props) => {
|
|
6425
6626
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
6426
|
-
return /* @__PURE__ */ (0,
|
|
6627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props });
|
|
6427
6628
|
}
|
|
6428
|
-
return /* @__PURE__ */ (0,
|
|
6629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6429
6630
|
InputVariables,
|
|
6430
6631
|
{
|
|
6431
6632
|
"data-testid": "filter-value",
|
|
@@ -6434,7 +6635,7 @@ function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
|
6434
6635
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
6435
6636
|
value: props.value,
|
|
6436
6637
|
disabled: props.disabled,
|
|
6437
|
-
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ (0,
|
|
6638
|
+
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props })
|
|
6438
6639
|
}
|
|
6439
6640
|
);
|
|
6440
6641
|
};
|
|
@@ -6444,9 +6645,9 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6444
6645
|
const WithInputVariables = (props) => {
|
|
6445
6646
|
var _a;
|
|
6446
6647
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
6447
|
-
return /* @__PURE__ */ (0,
|
|
6648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props });
|
|
6448
6649
|
}
|
|
6449
|
-
return /* @__PURE__ */ (0,
|
|
6650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6450
6651
|
InputVariables,
|
|
6451
6652
|
{
|
|
6452
6653
|
"data-testid": "filter-value",
|
|
@@ -6454,7 +6655,7 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6454
6655
|
showMenuPosition: "inline-right",
|
|
6455
6656
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
6456
6657
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
6457
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
6658
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props })
|
|
6458
6659
|
}
|
|
6459
6660
|
);
|
|
6460
6661
|
};
|
|
@@ -6470,8 +6671,8 @@ var bindableFiltersMapper = {
|
|
|
6470
6671
|
};
|
|
6471
6672
|
|
|
6472
6673
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6473
|
-
var
|
|
6474
|
-
var SearchAndFilterContext = (0,
|
|
6674
|
+
var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
|
|
6675
|
+
var SearchAndFilterContext = (0, import_react67.createContext)({
|
|
6475
6676
|
searchTerm: "",
|
|
6476
6677
|
setSearchTerm: () => {
|
|
6477
6678
|
},
|
|
@@ -6491,6 +6692,7 @@ var SearchAndFilterContext = (0, import_react64.createContext)({
|
|
|
6491
6692
|
validFilterQuery: [],
|
|
6492
6693
|
filterMapper: {},
|
|
6493
6694
|
totalResults: 0,
|
|
6695
|
+
isLoading: false,
|
|
6494
6696
|
allowBindingSearchTerm: false
|
|
6495
6697
|
});
|
|
6496
6698
|
var SearchAndFilterProvider = ({
|
|
@@ -6504,21 +6706,22 @@ var SearchAndFilterProvider = ({
|
|
|
6504
6706
|
resetFilterValues = [{ field: "", operator: "", value: "" }],
|
|
6505
6707
|
onResetFilterValues,
|
|
6506
6708
|
totalResults,
|
|
6709
|
+
isLoading,
|
|
6507
6710
|
filterMapper: filterMapper2 = filterMapper,
|
|
6508
6711
|
children,
|
|
6509
6712
|
allowBindingSearchTerm
|
|
6510
6713
|
}) => {
|
|
6511
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
6512
|
-
const deferredSearchTerm = (0,
|
|
6513
|
-
const [filterVisibility, setFilterVisibility] = (0,
|
|
6514
|
-
const handleSearchTerm = (0,
|
|
6714
|
+
const [searchTerm, setSearchTerm] = (0, import_react67.useState)(defaultSearchTerm);
|
|
6715
|
+
const deferredSearchTerm = (0, import_react67.useDeferredValue)(searchTerm);
|
|
6716
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react67.useState)(alwaysVisible || filterVisible);
|
|
6717
|
+
const handleSearchTerm = (0, import_react67.useCallback)(
|
|
6515
6718
|
(term) => {
|
|
6516
6719
|
setSearchTerm(term);
|
|
6517
6720
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
6518
6721
|
},
|
|
6519
6722
|
[setSearchTerm, onSearchChange]
|
|
6520
6723
|
);
|
|
6521
|
-
const handleToggleFilterVisibility = (0,
|
|
6724
|
+
const handleToggleFilterVisibility = (0, import_react67.useCallback)(
|
|
6522
6725
|
(visible) => {
|
|
6523
6726
|
if (alwaysVisible) {
|
|
6524
6727
|
return;
|
|
@@ -6527,30 +6730,30 @@ var SearchAndFilterProvider = ({
|
|
|
6527
6730
|
},
|
|
6528
6731
|
[alwaysVisible]
|
|
6529
6732
|
);
|
|
6530
|
-
const handleAddFilter = (0,
|
|
6733
|
+
const handleAddFilter = (0, import_react67.useCallback)(() => {
|
|
6531
6734
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6532
6735
|
}, [filters, onChange]);
|
|
6533
|
-
const handleResetFilters = (0,
|
|
6736
|
+
const handleResetFilters = (0, import_react67.useCallback)(() => {
|
|
6534
6737
|
if (onResetFilterValues) {
|
|
6535
6738
|
return onResetFilterValues();
|
|
6536
6739
|
}
|
|
6537
6740
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6538
6741
|
onChange(resetFilterValues);
|
|
6539
6742
|
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6540
|
-
const handleDeleteFilter = (0,
|
|
6743
|
+
const handleDeleteFilter = (0, import_react67.useCallback)(
|
|
6541
6744
|
(index) => {
|
|
6542
6745
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
6543
6746
|
onChange(remainingFilters);
|
|
6544
6747
|
},
|
|
6545
6748
|
[filters, onChange]
|
|
6546
6749
|
);
|
|
6547
|
-
const validFilterQuery = (0,
|
|
6750
|
+
const validFilterQuery = (0, import_react67.useMemo)(() => {
|
|
6548
6751
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6549
6752
|
if (hasValidFilters) {
|
|
6550
6753
|
return filters;
|
|
6551
6754
|
}
|
|
6552
6755
|
}, [filters]);
|
|
6553
|
-
(0,
|
|
6756
|
+
(0, import_react67.useEffect)(() => {
|
|
6554
6757
|
if (filterVisibility) {
|
|
6555
6758
|
const handleEscKeyFilterClose = (e) => {
|
|
6556
6759
|
if (e.key === "Escape") {
|
|
@@ -6563,7 +6766,7 @@ var SearchAndFilterProvider = ({
|
|
|
6563
6766
|
};
|
|
6564
6767
|
}
|
|
6565
6768
|
}, [filterVisibility, handleToggleFilterVisibility]);
|
|
6566
|
-
return /* @__PURE__ */ (0,
|
|
6769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6567
6770
|
SearchAndFilterContext.Provider,
|
|
6568
6771
|
{
|
|
6569
6772
|
value: {
|
|
@@ -6579,20 +6782,21 @@ var SearchAndFilterProvider = ({
|
|
|
6579
6782
|
filterOptions,
|
|
6580
6783
|
validFilterQuery,
|
|
6581
6784
|
totalResults,
|
|
6785
|
+
isLoading,
|
|
6582
6786
|
filterMapper: filterMapper2,
|
|
6583
6787
|
allowBindingSearchTerm
|
|
6584
6788
|
},
|
|
6585
|
-
children: /* @__PURE__ */ (0,
|
|
6789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_design_system44.VerticalRhythm, { children })
|
|
6586
6790
|
}
|
|
6587
6791
|
);
|
|
6588
6792
|
};
|
|
6589
6793
|
var useSearchAndFilter = () => {
|
|
6590
|
-
const value = (0,
|
|
6794
|
+
const value = (0, import_react67.useContext)(SearchAndFilterContext);
|
|
6591
6795
|
return { ...value };
|
|
6592
6796
|
};
|
|
6593
6797
|
|
|
6594
6798
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
6595
|
-
var
|
|
6799
|
+
var import_jsx_runtime75 = require("@emotion/react/jsx-runtime");
|
|
6596
6800
|
var FilterControls = ({
|
|
6597
6801
|
children,
|
|
6598
6802
|
hideSearchInput
|
|
@@ -6605,10 +6809,10 @@ var FilterControls = ({
|
|
|
6605
6809
|
searchTerm,
|
|
6606
6810
|
allowBindingSearchTerm
|
|
6607
6811
|
} = useSearchAndFilter();
|
|
6608
|
-
const editorRef = (0,
|
|
6812
|
+
const editorRef = (0, import_react68.useRef)(null);
|
|
6609
6813
|
const variableRefernceCountInSearchTerm = (0, import_canvas10.hasReferencedVariables)(searchTerm);
|
|
6610
|
-
const [idToResetInputVariables, setIdToResetInputVariables] = (0,
|
|
6611
|
-
const [localSearchTerm, setLocalSearchTerm] = (0,
|
|
6814
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react68.useState)("data-resource-search-term-input");
|
|
6815
|
+
const [localSearchTerm, setLocalSearchTerm] = (0, import_react68.useState)(searchTerm);
|
|
6612
6816
|
(0, import_react_use7.useDebounce)(
|
|
6613
6817
|
() => {
|
|
6614
6818
|
setSearchTerm(localSearchTerm);
|
|
@@ -6616,14 +6820,14 @@ var FilterControls = ({
|
|
|
6616
6820
|
300,
|
|
6617
6821
|
[localSearchTerm]
|
|
6618
6822
|
);
|
|
6619
|
-
(0,
|
|
6823
|
+
(0, import_react68.useEffect)(() => {
|
|
6620
6824
|
if (searchTerm === "") {
|
|
6621
6825
|
setLocalSearchTerm("");
|
|
6622
6826
|
setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid2.v4)()}`);
|
|
6623
6827
|
}
|
|
6624
6828
|
}, [searchTerm]);
|
|
6625
|
-
return /* @__PURE__ */ (0,
|
|
6626
|
-
/* @__PURE__ */ (0,
|
|
6829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6830
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6627
6831
|
FilterButton2,
|
|
6628
6832
|
{
|
|
6629
6833
|
"aria-controls": "search-and-filter-options",
|
|
@@ -6636,8 +6840,8 @@ var FilterControls = ({
|
|
|
6636
6840
|
dataTestId: "filters-button"
|
|
6637
6841
|
}
|
|
6638
6842
|
),
|
|
6639
|
-
hideSearchInput ? null : /* @__PURE__ */ (0,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6843
|
+
hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { css: BindableKeywordSearchInputStyles, "data-testid": "search-container", children: [
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6641
6845
|
InputVariables,
|
|
6642
6846
|
{
|
|
6643
6847
|
label: "",
|
|
@@ -6647,8 +6851,8 @@ var FilterControls = ({
|
|
|
6647
6851
|
value: localSearchTerm,
|
|
6648
6852
|
onChange: (value) => setLocalSearchTerm(value != null ? value : ""),
|
|
6649
6853
|
disableVariables: !allowBindingSearchTerm,
|
|
6650
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
6651
|
-
|
|
6854
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6855
|
+
import_design_system45.InputKeywordSearch,
|
|
6652
6856
|
{
|
|
6653
6857
|
placeholder: "Search...",
|
|
6654
6858
|
onSearchTextChanged: (e) => setLocalSearchTerm(e),
|
|
@@ -6666,7 +6870,7 @@ var FilterControls = ({
|
|
|
6666
6870
|
)
|
|
6667
6871
|
}
|
|
6668
6872
|
),
|
|
6669
|
-
variableRefernceCountInSearchTerm ? /* @__PURE__ */ (0,
|
|
6873
|
+
variableRefernceCountInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6670
6874
|
"button",
|
|
6671
6875
|
{
|
|
6672
6876
|
css: ClearSearchButtonStyles,
|
|
@@ -6680,7 +6884,7 @@ var FilterControls = ({
|
|
|
6680
6884
|
},
|
|
6681
6885
|
type: "button",
|
|
6682
6886
|
"data-testid": "keyword-search-clear-button",
|
|
6683
|
-
children: /* @__PURE__ */ (0,
|
|
6887
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system45.Icon, { icon: import_CgClose.CgClose, iconColor: "red", size: "1rem" })
|
|
6684
6888
|
}
|
|
6685
6889
|
) }) : null
|
|
6686
6890
|
] }),
|
|
@@ -6690,8 +6894,8 @@ var FilterControls = ({
|
|
|
6690
6894
|
|
|
6691
6895
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6692
6896
|
var import_CgTrash2 = require("@react-icons/all-files/cg/CgTrash");
|
|
6693
|
-
var
|
|
6694
|
-
var
|
|
6897
|
+
var import_design_system46 = require("@uniformdev/design-system");
|
|
6898
|
+
var import_react69 = require("react");
|
|
6695
6899
|
|
|
6696
6900
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
6697
6901
|
function isFilterBindable(filter, operator) {
|
|
@@ -6700,7 +6904,7 @@ function isFilterBindable(filter, operator) {
|
|
|
6700
6904
|
}
|
|
6701
6905
|
|
|
6702
6906
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6703
|
-
var
|
|
6907
|
+
var import_jsx_runtime76 = require("@emotion/react/jsx-runtime");
|
|
6704
6908
|
var FilterItem = ({
|
|
6705
6909
|
index,
|
|
6706
6910
|
operatorOptions,
|
|
@@ -6718,7 +6922,7 @@ var FilterItem = ({
|
|
|
6718
6922
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
6719
6923
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
6720
6924
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
6721
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0,
|
|
6925
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react69.useMemo)(() => {
|
|
6722
6926
|
var _a2;
|
|
6723
6927
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
6724
6928
|
var _a3;
|
|
@@ -6748,10 +6952,10 @@ var FilterItem = ({
|
|
|
6748
6952
|
} : {};
|
|
6749
6953
|
const CustomLeftHandComponent = selectedFieldValue == null ? void 0 : selectedFieldValue.leftHandSideComponentWhenSelected;
|
|
6750
6954
|
const isEmptyOperator = metaDataPossibleOptions === "empty";
|
|
6751
|
-
return /* @__PURE__ */ (0,
|
|
6752
|
-
/* @__PURE__ */ (0,
|
|
6753
|
-
/* @__PURE__ */ (0,
|
|
6754
|
-
CustomLeftHandComponent ? /* @__PURE__ */ (0,
|
|
6955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
6956
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { children: index === 0 ? initialCriteriaTitle : criteriaGroupOperator }),
|
|
6957
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { css: [ConditionalInputRow, isEmptyOperator ? ConditionalInputRowEmpty : null], children: [
|
|
6958
|
+
CustomLeftHandComponent ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6755
6959
|
CustomLeftHandComponent,
|
|
6756
6960
|
{
|
|
6757
6961
|
filterOption: selectedFieldValue,
|
|
@@ -6761,8 +6965,8 @@ var FilterItem = ({
|
|
|
6761
6965
|
onFilterOptionChange("");
|
|
6762
6966
|
}
|
|
6763
6967
|
}
|
|
6764
|
-
) : /* @__PURE__ */ (0,
|
|
6765
|
-
|
|
6968
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6969
|
+
import_design_system46.InputComboBox,
|
|
6766
6970
|
{
|
|
6767
6971
|
"aria-label": label,
|
|
6768
6972
|
options: filterOptions,
|
|
@@ -6788,8 +6992,8 @@ var FilterItem = ({
|
|
|
6788
6992
|
name: `filter-field-${index}`
|
|
6789
6993
|
}
|
|
6790
6994
|
),
|
|
6791
|
-
/* @__PURE__ */ (0,
|
|
6792
|
-
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6996
|
+
import_design_system46.InputComboBox,
|
|
6793
6997
|
{
|
|
6794
6998
|
"aria-label": operatorLabel,
|
|
6795
6999
|
options: operatorOptions,
|
|
@@ -6812,7 +7016,7 @@ var FilterItem = ({
|
|
|
6812
7016
|
name: `filter-operator-${index}`
|
|
6813
7017
|
}
|
|
6814
7018
|
),
|
|
6815
|
-
/* @__PURE__ */ (0,
|
|
7019
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6816
7020
|
FilterEditorRenderer,
|
|
6817
7021
|
{
|
|
6818
7022
|
"aria-label": metaDataLabel,
|
|
@@ -6827,7 +7031,7 @@ var FilterItem = ({
|
|
|
6827
7031
|
filterFieldName: filters[index].field
|
|
6828
7032
|
}
|
|
6829
7033
|
),
|
|
6830
|
-
readOnly ? null : /* @__PURE__ */ (0,
|
|
7034
|
+
readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6831
7035
|
"button",
|
|
6832
7036
|
{
|
|
6833
7037
|
type: "button",
|
|
@@ -6836,7 +7040,7 @@ var FilterItem = ({
|
|
|
6836
7040
|
css: IconBtn,
|
|
6837
7041
|
"data-testid": "delete-filter",
|
|
6838
7042
|
disabled: filters.length === 1,
|
|
6839
|
-
children: /* @__PURE__ */ (0,
|
|
7043
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_design_system46.Icon, { icon: import_CgTrash2.CgTrash, iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
|
|
6840
7044
|
}
|
|
6841
7045
|
)
|
|
6842
7046
|
] })
|
|
@@ -6845,21 +7049,21 @@ var FilterItem = ({
|
|
|
6845
7049
|
|
|
6846
7050
|
// src/components/SearchAndFilter/FilterItems.tsx
|
|
6847
7051
|
var import_CgMathPlus = require("@react-icons/all-files/cg/CgMathPlus");
|
|
6848
|
-
var
|
|
7052
|
+
var import_design_system48 = require("@uniformdev/design-system");
|
|
6849
7053
|
|
|
6850
7054
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
6851
|
-
var
|
|
6852
|
-
var
|
|
6853
|
-
var
|
|
7055
|
+
var import_design_system47 = require("@uniformdev/design-system");
|
|
7056
|
+
var import_react70 = __toESM(require("react"));
|
|
7057
|
+
var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
|
|
6854
7058
|
var SearchAndFilterOptionsContainer2 = ({
|
|
6855
7059
|
buttonRow,
|
|
6856
7060
|
additionalFiltersContainer,
|
|
6857
7061
|
children
|
|
6858
7062
|
}) => {
|
|
6859
|
-
return /* @__PURE__ */ (0,
|
|
6860
|
-
/* @__PURE__ */ (0,
|
|
6861
|
-
buttonRow ? /* @__PURE__ */ (0,
|
|
6862
|
-
|
|
7063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
7064
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
7065
|
+
buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
7066
|
+
import_design_system47.HorizontalRhythm,
|
|
6863
7067
|
{
|
|
6864
7068
|
css: SearchAndFilterButtonGroup,
|
|
6865
7069
|
gap: "sm",
|
|
@@ -6868,7 +7072,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
6868
7072
|
children: buttonRow
|
|
6869
7073
|
}
|
|
6870
7074
|
) : null,
|
|
6871
|
-
additionalFiltersContainer ? /* @__PURE__ */ (0,
|
|
7075
|
+
additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { css: SearchAndFilterAdditionalContainer, children: additionalFiltersContainer }) : null
|
|
6872
7076
|
] });
|
|
6873
7077
|
};
|
|
6874
7078
|
var FilterMenu = ({
|
|
@@ -6881,22 +7085,22 @@ var FilterMenu = ({
|
|
|
6881
7085
|
resetButtonText = "reset"
|
|
6882
7086
|
}) => {
|
|
6883
7087
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
6884
|
-
const innerMenuRef =
|
|
6885
|
-
(0,
|
|
7088
|
+
const innerMenuRef = import_react70.default.useRef(null);
|
|
7089
|
+
(0, import_react70.useEffect)(() => {
|
|
6886
7090
|
var _a;
|
|
6887
7091
|
if (filterVisibility) {
|
|
6888
7092
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
6889
7093
|
}
|
|
6890
7094
|
}, [filterVisibility]);
|
|
6891
|
-
return /* @__PURE__ */ (0,
|
|
7095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_design_system47.VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
6892
7096
|
SearchAndFilterOptionsContainer2,
|
|
6893
7097
|
{
|
|
6894
7098
|
buttonRow: menuControls,
|
|
6895
7099
|
additionalFiltersContainer,
|
|
6896
7100
|
children: [
|
|
6897
|
-
/* @__PURE__ */ (0,
|
|
6898
|
-
filterTitle ? /* @__PURE__ */ (0,
|
|
6899
|
-
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ (0,
|
|
7101
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_design_system47.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
7102
|
+
filterTitle ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
|
|
7103
|
+
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6900
7104
|
"button",
|
|
6901
7105
|
{
|
|
6902
7106
|
type: "button",
|
|
@@ -7007,7 +7211,7 @@ function hasBindings(currentValue) {
|
|
|
7007
7211
|
}
|
|
7008
7212
|
|
|
7009
7213
|
// src/components/SearchAndFilter/FilterItems.tsx
|
|
7010
|
-
var
|
|
7214
|
+
var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
|
|
7011
7215
|
var FilterItems = ({
|
|
7012
7216
|
addButtonText = "add condition",
|
|
7013
7217
|
additionalFiltersContainer,
|
|
@@ -7023,7 +7227,7 @@ var FilterItems = ({
|
|
|
7023
7227
|
next[index] = { ...next[index], [prop]: value };
|
|
7024
7228
|
if (prop === "operator") {
|
|
7025
7229
|
const newOperatorId = value;
|
|
7026
|
-
const currentFilter =
|
|
7230
|
+
const currentFilter = filters[index];
|
|
7027
7231
|
if (!newOperatorId) {
|
|
7028
7232
|
throw new Error("you bad");
|
|
7029
7233
|
}
|
|
@@ -7044,12 +7248,12 @@ var FilterItems = ({
|
|
|
7044
7248
|
}
|
|
7045
7249
|
setFilters(next);
|
|
7046
7250
|
};
|
|
7047
|
-
return /* @__PURE__ */ (0,
|
|
7251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7048
7252
|
FilterMenu,
|
|
7049
7253
|
{
|
|
7050
7254
|
id: "search-and-filter-options",
|
|
7051
7255
|
dataTestId: "search-and-filter-options",
|
|
7052
|
-
menuControls: /* @__PURE__ */ (0,
|
|
7256
|
+
menuControls: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7053
7257
|
"button",
|
|
7054
7258
|
{
|
|
7055
7259
|
type: "button",
|
|
@@ -7057,7 +7261,7 @@ var FilterItems = ({
|
|
|
7057
7261
|
onClick: handleAddFilter,
|
|
7058
7262
|
"data-testid": "add-filter",
|
|
7059
7263
|
children: [
|
|
7060
|
-
/* @__PURE__ */ (0,
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_design_system48.Icon, { icon: import_CgMathPlus.CgMathPlus, iconColor: "currentColor", size: "1rem" }),
|
|
7061
7265
|
addButtonText
|
|
7062
7266
|
]
|
|
7063
7267
|
}
|
|
@@ -7073,7 +7277,7 @@ var FilterItems = ({
|
|
|
7073
7277
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
7074
7278
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
7075
7279
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
7076
|
-
return /* @__PURE__ */ (0,
|
|
7280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7077
7281
|
FilterItem,
|
|
7078
7282
|
{
|
|
7079
7283
|
index: i,
|
|
@@ -7094,11 +7298,11 @@ var FilterItems = ({
|
|
|
7094
7298
|
};
|
|
7095
7299
|
|
|
7096
7300
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
7097
|
-
var
|
|
7301
|
+
var import_design_system50 = require("@uniformdev/design-system");
|
|
7098
7302
|
|
|
7099
7303
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
7100
|
-
var
|
|
7101
|
-
var
|
|
7304
|
+
var import_design_system49 = require("@uniformdev/design-system");
|
|
7305
|
+
var import_jsx_runtime79 = require("@emotion/react/jsx-runtime");
|
|
7102
7306
|
var SearchAndFilterResultContainer = ({
|
|
7103
7307
|
buttonText,
|
|
7104
7308
|
clearButtonLabel = "clear",
|
|
@@ -7107,7 +7311,7 @@ var SearchAndFilterResultContainer = ({
|
|
|
7107
7311
|
onHandleClear,
|
|
7108
7312
|
hideClearButton
|
|
7109
7313
|
}) => {
|
|
7110
|
-
const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm } = useSearchAndFilter();
|
|
7314
|
+
const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm, isLoading } = useSearchAndFilter();
|
|
7111
7315
|
const emptyFilters = filters.length === 0 || filters.every((filter) => !filter.value);
|
|
7112
7316
|
const getTextValue = ({
|
|
7113
7317
|
defaultPropText,
|
|
@@ -7138,7 +7342,7 @@ var SearchAndFilterResultContainer = ({
|
|
|
7138
7342
|
filterText: "No results match the selected filters",
|
|
7139
7343
|
fallbackText: "No matching results found"
|
|
7140
7344
|
});
|
|
7141
|
-
if (totalResults
|
|
7345
|
+
if (isLoading || totalResults === void 0 || totalResults > 0) {
|
|
7142
7346
|
return null;
|
|
7143
7347
|
}
|
|
7144
7348
|
const handleClearSearch = () => {
|
|
@@ -7149,19 +7353,19 @@ var SearchAndFilterResultContainer = ({
|
|
|
7149
7353
|
handleResetFilters();
|
|
7150
7354
|
}
|
|
7151
7355
|
};
|
|
7152
|
-
return /* @__PURE__ */ (0,
|
|
7153
|
-
/* @__PURE__ */ (0,
|
|
7154
|
-
/* @__PURE__ */ (0,
|
|
7356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7357
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_design_system49.HorizontalRhythm, { children: [
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { children: [
|
|
7155
7359
|
totalResults,
|
|
7156
7360
|
" results ",
|
|
7157
7361
|
searchTerm ? `for "${searchTerm}"` : null
|
|
7158
7362
|
] }),
|
|
7159
|
-
!searchTerm || hideClearButton ? null : /* @__PURE__ */ (0,
|
|
7363
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system49.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
|
|
7160
7364
|
] }),
|
|
7161
|
-
totalResults === 0 ? /* @__PURE__ */ (0,
|
|
7162
|
-
calloutText ? /* @__PURE__ */ (0,
|
|
7163
|
-
hideClearButton ? null : /* @__PURE__ */ (0,
|
|
7164
|
-
|
|
7365
|
+
totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_design_system49.Callout, { title: automateCalloutTitle, type: "note", children: [
|
|
7366
|
+
calloutText ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system49.Paragraph, { children: calloutText }) : null,
|
|
7367
|
+
hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7368
|
+
import_design_system49.Button,
|
|
7165
7369
|
{
|
|
7166
7370
|
buttonType: "tertiaryOutline",
|
|
7167
7371
|
size: "xs",
|
|
@@ -7175,25 +7379,26 @@ var SearchAndFilterResultContainer = ({
|
|
|
7175
7379
|
};
|
|
7176
7380
|
|
|
7177
7381
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
7178
|
-
var
|
|
7382
|
+
var import_jsx_runtime80 = require("@emotion/react/jsx-runtime");
|
|
7179
7383
|
var SearchAndFilter = ({
|
|
7180
7384
|
filters,
|
|
7181
7385
|
filterOptions,
|
|
7182
7386
|
filterVisible,
|
|
7183
7387
|
filterControls,
|
|
7184
7388
|
viewSwitchControls,
|
|
7185
|
-
resultsContainerView = /* @__PURE__ */ (0,
|
|
7389
|
+
resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(SearchAndFilterResultContainer, {}),
|
|
7186
7390
|
filterMapper: filterMapper2 = filterMapper,
|
|
7187
7391
|
additionalFiltersContainer,
|
|
7188
7392
|
onChange,
|
|
7189
7393
|
defaultSearchTerm,
|
|
7190
7394
|
onSearchChange,
|
|
7191
7395
|
totalResults,
|
|
7396
|
+
isLoading,
|
|
7192
7397
|
allowBindingSearchTerm = false,
|
|
7193
7398
|
resetFilterValues = [],
|
|
7194
7399
|
onResetFilterValues
|
|
7195
7400
|
}) => {
|
|
7196
|
-
return /* @__PURE__ */ (0,
|
|
7401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7197
7402
|
SearchAndFilterProvider,
|
|
7198
7403
|
{
|
|
7199
7404
|
filters,
|
|
@@ -7203,22 +7408,23 @@ var SearchAndFilter = ({
|
|
|
7203
7408
|
defaultSearchTerm,
|
|
7204
7409
|
onSearchChange,
|
|
7205
7410
|
totalResults,
|
|
7411
|
+
isLoading,
|
|
7206
7412
|
resetFilterValues,
|
|
7207
7413
|
filterMapper: filterMapper2,
|
|
7208
7414
|
allowBindingSearchTerm,
|
|
7209
7415
|
onResetFilterValues,
|
|
7210
|
-
children: /* @__PURE__ */ (0,
|
|
7211
|
-
/* @__PURE__ */ (0,
|
|
7212
|
-
/* @__PURE__ */ (0,
|
|
7416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_design_system50.VerticalRhythm, { "data-testid": "search-and-filter", children: [
|
|
7417
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7418
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7213
7419
|
"div",
|
|
7214
7420
|
{
|
|
7215
7421
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
7216
|
-
children: !filterControls ? /* @__PURE__ */ (0,
|
|
7422
|
+
children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
7217
7423
|
}
|
|
7218
7424
|
),
|
|
7219
7425
|
viewSwitchControls
|
|
7220
7426
|
] }),
|
|
7221
|
-
/* @__PURE__ */ (0,
|
|
7427
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FilterItems, { additionalFiltersContainer }),
|
|
7222
7428
|
resultsContainerView
|
|
7223
7429
|
] })
|
|
7224
7430
|
}
|
|
@@ -7226,18 +7432,18 @@ var SearchAndFilter = ({
|
|
|
7226
7432
|
};
|
|
7227
7433
|
|
|
7228
7434
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
7229
|
-
var
|
|
7230
|
-
var
|
|
7435
|
+
var import_design_system51 = require("@uniformdev/design-system");
|
|
7436
|
+
var import_react71 = require("react");
|
|
7231
7437
|
var import_react_use8 = require("react-use");
|
|
7232
|
-
var
|
|
7233
|
-
var SearchOnlyContext = (0,
|
|
7438
|
+
var import_jsx_runtime81 = require("@emotion/react/jsx-runtime");
|
|
7439
|
+
var SearchOnlyContext = (0, import_react71.createContext)({
|
|
7234
7440
|
searchTerm: "",
|
|
7235
7441
|
setSearchTerm: () => {
|
|
7236
7442
|
}
|
|
7237
7443
|
});
|
|
7238
7444
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
7239
7445
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
7240
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
7446
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react71.useState)("");
|
|
7241
7447
|
(0, import_react_use8.useDebounce)(
|
|
7242
7448
|
() => {
|
|
7243
7449
|
setSearchTerm(localeSearchTerm);
|
|
@@ -7246,15 +7452,15 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7246
7452
|
300,
|
|
7247
7453
|
[localeSearchTerm]
|
|
7248
7454
|
);
|
|
7249
|
-
return /* @__PURE__ */ (0,
|
|
7455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7250
7456
|
SearchOnlyContext.Provider,
|
|
7251
7457
|
{
|
|
7252
7458
|
value: {
|
|
7253
7459
|
searchTerm,
|
|
7254
7460
|
setSearchTerm: setLocaleSearchTerm
|
|
7255
7461
|
},
|
|
7256
|
-
children: /* @__PURE__ */ (0,
|
|
7257
|
-
|
|
7462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7463
|
+
import_design_system51.InputKeywordSearch,
|
|
7258
7464
|
{
|
|
7259
7465
|
placeholder: "Search...",
|
|
7260
7466
|
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
@@ -7268,18 +7474,18 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7268
7474
|
};
|
|
7269
7475
|
|
|
7270
7476
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
7271
|
-
var
|
|
7477
|
+
var import_design_system53 = require("@uniformdev/design-system");
|
|
7272
7478
|
|
|
7273
7479
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
7274
|
-
var
|
|
7275
|
-
var
|
|
7276
|
-
var ConditionalFilterRow2 =
|
|
7480
|
+
var import_react72 = require("@emotion/react");
|
|
7481
|
+
var import_design_system52 = require("@uniformdev/design-system");
|
|
7482
|
+
var ConditionalFilterRow2 = import_react72.css`
|
|
7277
7483
|
display: grid;
|
|
7278
7484
|
grid-template-columns: 35px 1fr;
|
|
7279
7485
|
gap: var(--spacing-sm);
|
|
7280
7486
|
margin-left: var(--spacing-base);
|
|
7281
7487
|
|
|
7282
|
-
${(0,
|
|
7488
|
+
${(0, import_design_system52.cq)("380px")} {
|
|
7283
7489
|
align-items: center;
|
|
7284
7490
|
|
|
7285
7491
|
&:after {
|
|
@@ -7300,22 +7506,22 @@ var ConditionalFilterRow2 = import_react69.css`
|
|
|
7300
7506
|
grid-template-columns: 50px 1fr;
|
|
7301
7507
|
}
|
|
7302
7508
|
|
|
7303
|
-
${(0,
|
|
7509
|
+
${(0, import_design_system52.cq)("580px")} {
|
|
7304
7510
|
&:after {
|
|
7305
7511
|
display: none;
|
|
7306
7512
|
}
|
|
7307
7513
|
}
|
|
7308
7514
|
|
|
7309
7515
|
@media (prefers-reduced-motion: no-preference) {
|
|
7310
|
-
animation: ${
|
|
7516
|
+
animation: ${import_design_system52.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
7311
7517
|
}
|
|
7312
7518
|
`;
|
|
7313
|
-
var ConditionalInputRow2 =
|
|
7519
|
+
var ConditionalInputRow2 = import_react72.css`
|
|
7314
7520
|
display: flex;
|
|
7315
7521
|
gap: var(--spacing-sm);
|
|
7316
7522
|
flex-wrap: wrap;
|
|
7317
7523
|
|
|
7318
|
-
${(0,
|
|
7524
|
+
${(0, import_design_system52.cq)("380px")} {
|
|
7319
7525
|
& > div:nth-child(-n + 2) {
|
|
7320
7526
|
width: calc(50% - var(--spacing-sm));
|
|
7321
7527
|
}
|
|
@@ -7324,7 +7530,7 @@ var ConditionalInputRow2 = import_react69.css`
|
|
|
7324
7530
|
width: calc(100% - 48px);
|
|
7325
7531
|
}
|
|
7326
7532
|
}
|
|
7327
|
-
${(0,
|
|
7533
|
+
${(0, import_design_system52.cq)("580px")} {
|
|
7328
7534
|
display: grid;
|
|
7329
7535
|
grid-template-columns: 200px 160px 1fr 32px;
|
|
7330
7536
|
|
|
@@ -7333,13 +7539,13 @@ var ConditionalInputRow2 = import_react69.css`
|
|
|
7333
7539
|
}
|
|
7334
7540
|
}
|
|
7335
7541
|
`;
|
|
7336
|
-
var SearchInput2 =
|
|
7542
|
+
var SearchInput2 = import_react72.css`
|
|
7337
7543
|
&& {
|
|
7338
7544
|
max-height: 40px;
|
|
7339
7545
|
min-height: unset;
|
|
7340
7546
|
}
|
|
7341
7547
|
`;
|
|
7342
|
-
var FilterButton3 =
|
|
7548
|
+
var FilterButton3 = import_react72.css`
|
|
7343
7549
|
align-items: center;
|
|
7344
7550
|
background: var(--white);
|
|
7345
7551
|
border: 1px solid var(--gray-300);
|
|
@@ -7376,13 +7582,13 @@ var FilterButton3 = import_react69.css`
|
|
|
7376
7582
|
opacity: var(--opacity-50);
|
|
7377
7583
|
}
|
|
7378
7584
|
`;
|
|
7379
|
-
var FilterButtonText2 =
|
|
7585
|
+
var FilterButtonText2 = import_react72.css`
|
|
7380
7586
|
overflow: hidden;
|
|
7381
7587
|
text-overflow: ellipsis;
|
|
7382
7588
|
white-space: nowrap;
|
|
7383
7589
|
max-width: 14ch;
|
|
7384
7590
|
`;
|
|
7385
|
-
var FilterButtonSelected2 =
|
|
7591
|
+
var FilterButtonSelected2 = import_react72.css`
|
|
7386
7592
|
background: var(--gray-100);
|
|
7387
7593
|
border-color: var(--gray-300);
|
|
7388
7594
|
|
|
@@ -7390,7 +7596,7 @@ var FilterButtonSelected2 = import_react69.css`
|
|
|
7390
7596
|
color: var(--accent-dark);
|
|
7391
7597
|
}
|
|
7392
7598
|
`;
|
|
7393
|
-
var FilterButtonWithOptions2 =
|
|
7599
|
+
var FilterButtonWithOptions2 = import_react72.css`
|
|
7394
7600
|
:where([aria-expanded='true']) {
|
|
7395
7601
|
background: var(--purple-rain-100);
|
|
7396
7602
|
border-color: var(--accent-light);
|
|
@@ -7402,14 +7608,14 @@ var FilterButtonWithOptions2 = import_react69.css`
|
|
|
7402
7608
|
}
|
|
7403
7609
|
}
|
|
7404
7610
|
`;
|
|
7405
|
-
var SearchIcon2 =
|
|
7611
|
+
var SearchIcon2 = import_react72.css`
|
|
7406
7612
|
color: var(--icon-color);
|
|
7407
7613
|
position: absolute;
|
|
7408
7614
|
inset: 0 var(--spacing-base) 0 auto;
|
|
7409
7615
|
margin: auto;
|
|
7410
7616
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7411
7617
|
`;
|
|
7412
|
-
var AddConditionalBtn2 =
|
|
7618
|
+
var AddConditionalBtn2 = import_react72.css`
|
|
7413
7619
|
align-items: center;
|
|
7414
7620
|
background: transparent;
|
|
7415
7621
|
border: none;
|
|
@@ -7428,14 +7634,14 @@ var AddConditionalBtn2 = import_react69.css`
|
|
|
7428
7634
|
color: var(--gray-400);
|
|
7429
7635
|
}
|
|
7430
7636
|
`;
|
|
7431
|
-
var Title2 =
|
|
7637
|
+
var Title2 = import_react72.css`
|
|
7432
7638
|
color: var(--typography-light);
|
|
7433
7639
|
|
|
7434
7640
|
&:focus {
|
|
7435
7641
|
outline: none;
|
|
7436
7642
|
}
|
|
7437
7643
|
`;
|
|
7438
|
-
var ResetConditionsBtn2 =
|
|
7644
|
+
var ResetConditionsBtn2 = import_react72.css`
|
|
7439
7645
|
background: transparent;
|
|
7440
7646
|
border: none;
|
|
7441
7647
|
color: var(--action-destructive-default);
|
|
@@ -7447,12 +7653,12 @@ var ResetConditionsBtn2 = import_react69.css`
|
|
|
7447
7653
|
color: var(--action-destructive-hover);
|
|
7448
7654
|
}
|
|
7449
7655
|
`;
|
|
7450
|
-
var IconBtn2 =
|
|
7656
|
+
var IconBtn2 = import_react72.css`
|
|
7451
7657
|
background: transparent;
|
|
7452
7658
|
border: none;
|
|
7453
7659
|
padding: var(--spacing-sm);
|
|
7454
7660
|
`;
|
|
7455
|
-
var SearchAndFilterOptionsContainer3 =
|
|
7661
|
+
var SearchAndFilterOptionsContainer3 = import_react72.css`
|
|
7456
7662
|
background: var(--gray-50);
|
|
7457
7663
|
border: 1px solid var(--gray-300);
|
|
7458
7664
|
border-radius: var(--rounded-base);
|
|
@@ -7465,34 +7671,34 @@ var SearchAndFilterOptionsContainer3 = import_react69.css`
|
|
|
7465
7671
|
position: relative;
|
|
7466
7672
|
z-index: 1;
|
|
7467
7673
|
`;
|
|
7468
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
7674
|
+
var SearchAndFilterOptionsInnerContainer2 = import_react72.css`
|
|
7469
7675
|
display: flex;
|
|
7470
7676
|
flex-direction: column;
|
|
7471
7677
|
gap: var(--spacing-sm);
|
|
7472
7678
|
padding-inline: var(--spacing-md);
|
|
7473
7679
|
`;
|
|
7474
|
-
var SearchAndFilterButtonGroup2 =
|
|
7680
|
+
var SearchAndFilterButtonGroup2 = import_react72.css`
|
|
7475
7681
|
margin-top: var(--spacing-xs);
|
|
7476
7682
|
margin-left: calc(56px + var(--spacing-md));
|
|
7477
7683
|
`;
|
|
7478
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
7684
|
+
var SortFilterWrapper = (hiddenLocaleInput) => import_react72.css`
|
|
7479
7685
|
align-items: center;
|
|
7480
7686
|
display: flex;
|
|
7481
7687
|
gap: var(--spacing-base);
|
|
7482
7688
|
flex-grow: 1;
|
|
7483
7689
|
|
|
7484
|
-
${(0,
|
|
7690
|
+
${(0, import_design_system52.cq)("420px")} {
|
|
7485
7691
|
display: grid;
|
|
7486
7692
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
7487
7693
|
}
|
|
7488
7694
|
`;
|
|
7489
|
-
var SortFilterInputRow =
|
|
7695
|
+
var SortFilterInputRow = import_react72.css`
|
|
7490
7696
|
align-items: center;
|
|
7491
7697
|
display: grid;
|
|
7492
7698
|
grid-template-columns: 1fr auto;
|
|
7493
7699
|
gap: var(--spacing-base);
|
|
7494
7700
|
`;
|
|
7495
|
-
var InputVariableWrapper =
|
|
7701
|
+
var InputVariableWrapper = import_react72.css`
|
|
7496
7702
|
flex-grow: 1;
|
|
7497
7703
|
|
|
7498
7704
|
// we need to override label styles nested within the input variable
|
|
@@ -7503,7 +7709,7 @@ var InputVariableWrapper = import_react69.css`
|
|
|
7503
7709
|
`;
|
|
7504
7710
|
|
|
7505
7711
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
7506
|
-
var
|
|
7712
|
+
var import_jsx_runtime82 = require("@emotion/react/jsx-runtime");
|
|
7507
7713
|
var SortItems = ({
|
|
7508
7714
|
sortByLabel = "Sort by",
|
|
7509
7715
|
localeLabel = "Show locale",
|
|
@@ -7525,11 +7731,11 @@ var SortItems = ({
|
|
|
7525
7731
|
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
7526
7732
|
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
7527
7733
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
7528
|
-
return /* @__PURE__ */ (0,
|
|
7529
|
-
/* @__PURE__ */ (0,
|
|
7530
|
-
/* @__PURE__ */ (0,
|
|
7531
|
-
/* @__PURE__ */ (0,
|
|
7532
|
-
/* @__PURE__ */ (0,
|
|
7734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
7735
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_design_system53.VerticalRhythm, { gap: "xs", children: [
|
|
7736
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { css: Title2, children: sortByLabel }),
|
|
7737
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { css: SortFilterInputRow, children: [
|
|
7738
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7533
7739
|
InputVariables,
|
|
7534
7740
|
{
|
|
7535
7741
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7537,8 +7743,8 @@ var SortItems = ({
|
|
|
7537
7743
|
value: sortField,
|
|
7538
7744
|
valueToResetTo: "created_at",
|
|
7539
7745
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
7540
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
7541
|
-
|
|
7746
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7747
|
+
import_design_system53.InputComboBox,
|
|
7542
7748
|
{
|
|
7543
7749
|
id: "sort-by-field",
|
|
7544
7750
|
"aria-label": "Sort by",
|
|
@@ -7560,7 +7766,7 @@ var SortItems = ({
|
|
|
7560
7766
|
)
|
|
7561
7767
|
}
|
|
7562
7768
|
),
|
|
7563
|
-
/* @__PURE__ */ (0,
|
|
7769
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7564
7770
|
InputVariables,
|
|
7565
7771
|
{
|
|
7566
7772
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7568,8 +7774,8 @@ var SortItems = ({
|
|
|
7568
7774
|
valueToResetTo: "DESC",
|
|
7569
7775
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
7570
7776
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
7571
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
7572
|
-
|
|
7777
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7778
|
+
import_design_system53.SegmentedControl,
|
|
7573
7779
|
{
|
|
7574
7780
|
noCheckmark: true,
|
|
7575
7781
|
name: "sortBy",
|
|
@@ -7600,15 +7806,15 @@ var SortItems = ({
|
|
|
7600
7806
|
)
|
|
7601
7807
|
] })
|
|
7602
7808
|
] }),
|
|
7603
|
-
hideLocaleOptions ? null : /* @__PURE__ */ (0,
|
|
7809
|
+
hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system53.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7604
7810
|
InputVariables,
|
|
7605
7811
|
{
|
|
7606
7812
|
label: localeLabelValue,
|
|
7607
7813
|
value: localeValue,
|
|
7608
7814
|
showMenuPosition: "inline-right",
|
|
7609
7815
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
7610
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
7611
|
-
|
|
7816
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7817
|
+
import_design_system53.InputSelect,
|
|
7612
7818
|
{
|
|
7613
7819
|
name: "localeReturned",
|
|
7614
7820
|
"aria-label": localeLabelValue,
|
|
@@ -7638,7 +7844,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7638
7844
|
|
|
7639
7845
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7640
7846
|
var import_canvas12 = require("@uniformdev/canvas");
|
|
7641
|
-
var
|
|
7847
|
+
var import_react73 = require("react");
|
|
7642
7848
|
function useContentDataResourceLocaleInfo({
|
|
7643
7849
|
locale,
|
|
7644
7850
|
defaultLocale,
|
|
@@ -7646,12 +7852,12 @@ function useContentDataResourceLocaleInfo({
|
|
|
7646
7852
|
dynamicInputs
|
|
7647
7853
|
}) {
|
|
7648
7854
|
var _a;
|
|
7649
|
-
const setLocaleRef = (0,
|
|
7855
|
+
const setLocaleRef = (0, import_react73.useRef)(setLocale);
|
|
7650
7856
|
setLocaleRef.current = setLocale;
|
|
7651
7857
|
const { flatVariables } = useVariables();
|
|
7652
7858
|
const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas12.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas12.createVariableReference)(import_canvas12.LOCALE_DYNAMIC_INPUT_NAME) : defaultLocale != null ? defaultLocale : "";
|
|
7653
7859
|
const boundLocale = (_a = (0, import_canvas12.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7654
|
-
(0,
|
|
7860
|
+
(0, import_react73.useEffect)(() => {
|
|
7655
7861
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7656
7862
|
setLocaleRef.current(effectiveLocale);
|
|
7657
7863
|
}
|
|
@@ -7660,7 +7866,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
7660
7866
|
}
|
|
7661
7867
|
|
|
7662
7868
|
// src/index.ts
|
|
7663
|
-
var
|
|
7869
|
+
var import_design_system54 = require("@uniformdev/design-system");
|
|
7664
7870
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
7665
7871
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7666
7872
|
0 && (module.exports = {
|
|
@@ -7682,6 +7888,9 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7682
7888
|
DataTypeEditor,
|
|
7683
7889
|
DateEditor,
|
|
7684
7890
|
DateRangeEditor,
|
|
7891
|
+
DelegationContext,
|
|
7892
|
+
DelegationGate,
|
|
7893
|
+
DelegationProvider,
|
|
7685
7894
|
DrawerContent,
|
|
7686
7895
|
EDIT_VARIABLE_COMMAND,
|
|
7687
7896
|
FilterButton,
|
|
@@ -7794,6 +8003,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7794
8003
|
urlEncodeRequestUrl,
|
|
7795
8004
|
useConnectedDataAsVariables,
|
|
7796
8005
|
useContentDataResourceLocaleInfo,
|
|
8006
|
+
useDelegation,
|
|
7797
8007
|
useDynamicInputsAsVariables,
|
|
7798
8008
|
useMeshLocation,
|
|
7799
8009
|
useObjectSearchContext,
|