@uniformdev/mesh-sdk-react 20.72.3-alpha.2 → 20.72.3-alpha.5
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 +104 -2
- package/dist/index.d.ts +104 -2
- package/dist/index.esm.js +549 -360
- package/dist/index.js +833 -640
- package/dist/index.mjs +549 -360
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -34,10 +34,10 @@ var index_exports = {};
|
|
|
34
34
|
__export(index_exports, {
|
|
35
35
|
$createVariableNode: () => $createVariableNode,
|
|
36
36
|
$isVariableNode: () => $isVariableNode,
|
|
37
|
-
AddListButton: () =>
|
|
38
|
-
Button: () =>
|
|
37
|
+
AddListButton: () => import_design_system54.AddListButton,
|
|
38
|
+
Button: () => import_design_system54.Button,
|
|
39
39
|
CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
|
|
40
|
-
Callout: () =>
|
|
40
|
+
Callout: () => import_design_system54.Callout,
|
|
41
41
|
ControlledValuePlugin: () => ControlledValuePlugin,
|
|
42
42
|
DATE_OPERATORS: () => DATE_OPERATORS,
|
|
43
43
|
DATE_TIME_OPERATORS: () => DATE_TIME_OPERATORS,
|
|
@@ -50,7 +50,10 @@ __export(index_exports, {
|
|
|
50
50
|
DataTypeEditor: () => DataTypeEditor,
|
|
51
51
|
DateEditor: () => DateEditor,
|
|
52
52
|
DateRangeEditor: () => DateRangeEditor,
|
|
53
|
-
|
|
53
|
+
DelegationContext: () => DelegationContext,
|
|
54
|
+
DelegationGate: () => DelegationGate,
|
|
55
|
+
DelegationProvider: () => DelegationProvider,
|
|
56
|
+
DrawerContent: () => import_design_system54.DrawerContent,
|
|
54
57
|
EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
|
|
55
58
|
FilterButton: () => FilterButton2,
|
|
56
59
|
FilterControls: () => FilterControls,
|
|
@@ -60,22 +63,22 @@ __export(index_exports, {
|
|
|
60
63
|
FilterMenu: () => FilterMenu,
|
|
61
64
|
FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
|
|
62
65
|
FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
|
|
63
|
-
Heading: () =>
|
|
66
|
+
Heading: () => import_design_system54.Heading,
|
|
64
67
|
INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
|
|
65
68
|
Icons: () => icons_exports,
|
|
66
|
-
Input: () =>
|
|
67
|
-
InputComboBox: () =>
|
|
68
|
-
InputKeywordSearch: () =>
|
|
69
|
-
InputSelect: () =>
|
|
70
|
-
InputToggle: () =>
|
|
69
|
+
Input: () => import_design_system54.Input,
|
|
70
|
+
InputComboBox: () => import_design_system54.InputComboBox,
|
|
71
|
+
InputKeywordSearch: () => import_design_system54.InputKeywordSearch,
|
|
72
|
+
InputSelect: () => import_design_system54.InputSelect,
|
|
73
|
+
InputToggle: () => import_design_system54.InputToggle,
|
|
71
74
|
InputVariables: () => InputVariables,
|
|
72
|
-
Label: () =>
|
|
75
|
+
Label: () => import_design_system54.Label,
|
|
73
76
|
LinkButton: () => LinkButton,
|
|
74
|
-
LoadingIndicator: () =>
|
|
75
|
-
LoadingOverlay: () =>
|
|
77
|
+
LoadingIndicator: () => import_design_system54.LoadingIndicator,
|
|
78
|
+
LoadingOverlay: () => import_design_system54.LoadingOverlay,
|
|
76
79
|
MULTI_SELECT_OPERATORS: () => MULTI_SELECT_OPERATORS,
|
|
77
|
-
Menu: () =>
|
|
78
|
-
MenuItem: () =>
|
|
80
|
+
Menu: () => import_design_system54.Menu,
|
|
81
|
+
MenuItem: () => import_design_system54.MenuItem,
|
|
79
82
|
MeshApp: () => MeshApp,
|
|
80
83
|
NUMBER_OPERATORS: () => NUMBER_OPERATORS,
|
|
81
84
|
NumberEditor: () => NumberEditor,
|
|
@@ -94,22 +97,22 @@ __export(index_exports, {
|
|
|
94
97
|
PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
|
|
95
98
|
ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
|
|
96
99
|
ParameterConnectionIndicator: () => ParameterConnectionIndicator,
|
|
97
|
-
ParameterGroup: () =>
|
|
98
|
-
ParameterImage: () =>
|
|
99
|
-
ParameterImageInner: () =>
|
|
100
|
-
ParameterInput: () =>
|
|
101
|
-
ParameterInputInner: () =>
|
|
102
|
-
ParameterLabel: () =>
|
|
103
|
-
ParameterMenuButton: () =>
|
|
100
|
+
ParameterGroup: () => import_design_system54.ParameterGroup,
|
|
101
|
+
ParameterImage: () => import_design_system54.ParameterImage,
|
|
102
|
+
ParameterImageInner: () => import_design_system54.ParameterImageInner,
|
|
103
|
+
ParameterInput: () => import_design_system54.ParameterInput,
|
|
104
|
+
ParameterInputInner: () => import_design_system54.ParameterInputInner,
|
|
105
|
+
ParameterLabel: () => import_design_system54.ParameterLabel,
|
|
106
|
+
ParameterMenuButton: () => import_design_system54.ParameterMenuButton,
|
|
104
107
|
ParameterOrSingleVariable: () => ParameterOrSingleVariable,
|
|
105
|
-
ParameterSelect: () =>
|
|
106
|
-
ParameterSelectInner: () =>
|
|
107
|
-
ParameterShell: () =>
|
|
108
|
+
ParameterSelect: () => import_design_system54.ParameterSelect,
|
|
109
|
+
ParameterSelectInner: () => import_design_system54.ParameterSelectInner,
|
|
110
|
+
ParameterShell: () => import_design_system54.ParameterShell,
|
|
108
111
|
ParameterShellContext: () => import_design_system2.ParameterShellContext,
|
|
109
|
-
ParameterTextarea: () =>
|
|
110
|
-
ParameterTextareaInner: () =>
|
|
111
|
-
ParameterToggle: () =>
|
|
112
|
-
ParameterToggleInner: () =>
|
|
112
|
+
ParameterTextarea: () => import_design_system54.ParameterTextarea,
|
|
113
|
+
ParameterTextareaInner: () => import_design_system54.ParameterTextareaInner,
|
|
114
|
+
ParameterToggle: () => import_design_system54.ParameterToggle,
|
|
115
|
+
ParameterToggleInner: () => import_design_system54.ParameterToggleInner,
|
|
113
116
|
ParameterVariables: () => ParameterVariables,
|
|
114
117
|
QueryFilter: () => QueryFilter,
|
|
115
118
|
RICHTEXT_OPERATORS: () => RICHTEXT_OPERATORS,
|
|
@@ -123,8 +126,8 @@ __export(index_exports, {
|
|
|
123
126
|
RequestUrlInput: () => RequestUrlInput,
|
|
124
127
|
SELECT_OPERATORS: () => SELECT_OPERATORS,
|
|
125
128
|
SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
|
|
126
|
-
ScrollableList: () =>
|
|
127
|
-
ScrollableListItem: () =>
|
|
129
|
+
ScrollableList: () => import_design_system54.ScrollableList,
|
|
130
|
+
ScrollableListItem: () => import_design_system54.ScrollableListItem,
|
|
128
131
|
SearchAndFilter: () => SearchAndFilter,
|
|
129
132
|
SearchAndFilterContext: () => SearchAndFilterContext,
|
|
130
133
|
SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
|
|
@@ -135,13 +138,13 @@ __export(index_exports, {
|
|
|
135
138
|
SortItems: () => SortItems,
|
|
136
139
|
StatusMultiEditor: () => StatusMultiEditor,
|
|
137
140
|
StatusSingleEditor: () => StatusSingleEditor,
|
|
138
|
-
Switch: () =>
|
|
141
|
+
Switch: () => import_design_system54.Switch,
|
|
139
142
|
TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
|
|
140
143
|
TextEditor: () => TextEditor,
|
|
141
144
|
TextMultiChoiceEditor: () => TextMultiChoiceEditor,
|
|
142
145
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
143
|
-
Textarea: () =>
|
|
144
|
-
Theme: () =>
|
|
146
|
+
Textarea: () => import_design_system54.Textarea,
|
|
147
|
+
Theme: () => import_design_system54.Theme,
|
|
145
148
|
USER_OPERATORS: () => USER_OPERATORS,
|
|
146
149
|
VariableChip: () => VariableChip,
|
|
147
150
|
VariableEditor: () => VariableEditor,
|
|
@@ -162,6 +165,7 @@ __export(index_exports, {
|
|
|
162
165
|
urlEncodeRequestUrl: () => urlEncodeRequestUrl,
|
|
163
166
|
useConnectedDataAsVariables: () => useConnectedDataAsVariables,
|
|
164
167
|
useContentDataResourceLocaleInfo: () => useContentDataResourceLocaleInfo,
|
|
168
|
+
useDelegation: () => useDelegation,
|
|
165
169
|
useDynamicInputsAsVariables: () => useDynamicInputsAsVariables,
|
|
166
170
|
useMeshLocation: () => useMeshLocation,
|
|
167
171
|
useObjectSearchContext: () => useObjectSearchContext,
|
|
@@ -174,7 +178,7 @@ __export(index_exports, {
|
|
|
174
178
|
useVariableEditor: () => useVariableEditor,
|
|
175
179
|
useVariables: () => useVariables,
|
|
176
180
|
useVariablesMenu: () => useVariablesMenu,
|
|
177
|
-
utilityColors: () =>
|
|
181
|
+
utilityColors: () => import_design_system54.utilityColors,
|
|
178
182
|
variableDefaultTextValue: () => variableDefaultTextValue,
|
|
179
183
|
variablePrefix: () => variablePrefix,
|
|
180
184
|
variableSuffix: () => variableSuffix,
|
|
@@ -445,12 +449,28 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
445
449
|
);
|
|
446
450
|
}
|
|
447
451
|
|
|
452
|
+
// src/hooks/useDelegation.ts
|
|
453
|
+
var import_react4 = require("react");
|
|
454
|
+
|
|
455
|
+
// src/components/Delegation/DelegationContext.ts
|
|
456
|
+
var import_react3 = require("react");
|
|
457
|
+
var DelegationContext = (0, import_react3.createContext)(null);
|
|
458
|
+
|
|
459
|
+
// src/hooks/useDelegation.ts
|
|
460
|
+
function useDelegation() {
|
|
461
|
+
const ctx = (0, import_react4.useContext)(DelegationContext);
|
|
462
|
+
if (!ctx) {
|
|
463
|
+
throw new Error("useDelegation must be used within a <DelegationProvider>");
|
|
464
|
+
}
|
|
465
|
+
return ctx;
|
|
466
|
+
}
|
|
467
|
+
|
|
448
468
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
449
469
|
var import_canvas = require("@uniformdev/canvas");
|
|
450
|
-
var
|
|
470
|
+
var import_react5 = require("react");
|
|
451
471
|
var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
|
|
452
472
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
453
|
-
return (0,
|
|
473
|
+
return (0, import_react5.useMemo)(() => {
|
|
454
474
|
const result = Object.entries(dynamicInputs).reduce(
|
|
455
475
|
(acc, [name2, input3]) => {
|
|
456
476
|
const source = `from ${name2 === import_canvas.LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
|
|
@@ -485,18 +505,18 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
485
505
|
}
|
|
486
506
|
|
|
487
507
|
// src/hooks/useMeshLocation.ts
|
|
488
|
-
var
|
|
508
|
+
var import_react8 = require("react");
|
|
489
509
|
|
|
490
510
|
// src/components/UniformMeshLocationContext.tsx
|
|
491
|
-
var
|
|
511
|
+
var import_react7 = require("react");
|
|
492
512
|
|
|
493
513
|
// src/components/UniformMeshSdkContext.tsx
|
|
494
514
|
var import_design_system = require("@uniformdev/design-system");
|
|
495
|
-
var
|
|
515
|
+
var import_react6 = require("react");
|
|
496
516
|
var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
|
|
497
|
-
var UniformMeshSdkContext = (0,
|
|
517
|
+
var UniformMeshSdkContext = (0, import_react6.createContext)(void 0);
|
|
498
518
|
var useUniformMeshSdkContext = () => {
|
|
499
|
-
const context = (0,
|
|
519
|
+
const context = (0, import_react6.useContext)(UniformMeshSdkContext);
|
|
500
520
|
if (!context) {
|
|
501
521
|
throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");
|
|
502
522
|
}
|
|
@@ -511,13 +531,13 @@ function useUniformMeshSdk() {
|
|
|
511
531
|
|
|
512
532
|
// src/components/UniformMeshLocationContext.tsx
|
|
513
533
|
var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
|
|
514
|
-
var UniformMeshLocationContext = (0,
|
|
534
|
+
var UniformMeshLocationContext = (0, import_react7.createContext)(void 0);
|
|
515
535
|
var UniformMeshLocationContextProvider = ({
|
|
516
536
|
children
|
|
517
537
|
}) => {
|
|
518
538
|
const sdk = useUniformMeshSdk();
|
|
519
|
-
const [location, setLocation] = (0,
|
|
520
|
-
(0,
|
|
539
|
+
const [location, setLocation] = (0, import_react7.useState)(sdk.getCurrentLocation());
|
|
540
|
+
(0, import_react7.useMemo)(() => {
|
|
521
541
|
const valueChangeListener = (event) => {
|
|
522
542
|
setLocation((old) => ({ ...old, value: event.newValue }));
|
|
523
543
|
};
|
|
@@ -534,7 +554,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
534
554
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(UniformMeshLocationContext.Provider, { value: { location }, children });
|
|
535
555
|
};
|
|
536
556
|
var useUniformMeshLocationContext = () => {
|
|
537
|
-
const context = (0,
|
|
557
|
+
const context = (0, import_react7.useContext)(UniformMeshLocationContext);
|
|
538
558
|
if (!context) {
|
|
539
559
|
throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");
|
|
540
560
|
}
|
|
@@ -547,9 +567,9 @@ function useMeshLocation(expectedLocation) {
|
|
|
547
567
|
if (expectedLocation && location.type !== expectedLocation) {
|
|
548
568
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
549
569
|
}
|
|
550
|
-
const backdoorLocation = (0,
|
|
570
|
+
const backdoorLocation = (0, import_react8.useRef)(location);
|
|
551
571
|
backdoorLocation.current = location;
|
|
552
|
-
const stabilizedSetValueProxy = (0,
|
|
572
|
+
const stabilizedSetValueProxy = (0, import_react8.useMemo)(
|
|
553
573
|
() => (dispatch) => {
|
|
554
574
|
const { newValue, options } = dispatch(backdoorLocation.current.value);
|
|
555
575
|
backdoorLocation.current.setValue(newValue, options);
|
|
@@ -568,7 +588,7 @@ var import_design_system2 = require("@uniformdev/design-system");
|
|
|
568
588
|
|
|
569
589
|
// src/components/Variables/composer/ControlledValuePlugin.tsx
|
|
570
590
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
571
|
-
var
|
|
591
|
+
var import_react9 = require("react");
|
|
572
592
|
|
|
573
593
|
// src/components/Variables/util/serializeVariablesEditorState.ts
|
|
574
594
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
@@ -712,7 +732,7 @@ function ControlledValuePlugin({
|
|
|
712
732
|
extraDependencies
|
|
713
733
|
}) {
|
|
714
734
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
715
|
-
(0,
|
|
735
|
+
(0, import_react9.useEffect)(() => {
|
|
716
736
|
var _a, _b;
|
|
717
737
|
if (!enabled) {
|
|
718
738
|
return;
|
|
@@ -733,7 +753,7 @@ function ControlledValuePlugin({
|
|
|
733
753
|
|
|
734
754
|
// src/components/Variables/composer/VariableChip.tsx
|
|
735
755
|
var import_design_system3 = require("@uniformdev/design-system");
|
|
736
|
-
var
|
|
756
|
+
var import_react10 = require("react");
|
|
737
757
|
var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
|
|
738
758
|
function VariableChip({
|
|
739
759
|
displayName,
|
|
@@ -749,7 +769,7 @@ function VariableChip({
|
|
|
749
769
|
}) {
|
|
750
770
|
const hasClickEvent = !!onClick;
|
|
751
771
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
752
|
-
const Wrapper = referenceIsValidFr === "warning" ? WarningVariableReference : referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ?
|
|
772
|
+
const Wrapper = referenceIsValidFr === "warning" ? WarningVariableReference : referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? import_react10.Fragment : UndefinedVariableReference;
|
|
753
773
|
const extraTitle = !referenceIsValidFr ? errorMessage : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
754
774
|
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 }) });
|
|
755
775
|
if (tooltip) {
|
|
@@ -815,7 +835,7 @@ var import_utils2 = require("@lexical/utils");
|
|
|
815
835
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
816
836
|
var import_design_system6 = require("@uniformdev/design-system");
|
|
817
837
|
var import_lexical5 = require("lexical");
|
|
818
|
-
var
|
|
838
|
+
var import_react18 = require("react");
|
|
819
839
|
|
|
820
840
|
// src/components/Variables/util/prettifyBindExpression.tsx
|
|
821
841
|
function prettifyBindExpression(bindExpression) {
|
|
@@ -824,7 +844,7 @@ function prettifyBindExpression(bindExpression) {
|
|
|
824
844
|
}
|
|
825
845
|
|
|
826
846
|
// src/components/Variables/composer/VariablesPlugin.tsx
|
|
827
|
-
var
|
|
847
|
+
var import_react16 = require("@emotion/react");
|
|
828
848
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
829
849
|
var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
|
|
830
850
|
var import_utils = require("@lexical/utils");
|
|
@@ -833,12 +853,12 @@ var import_canvas4 = require("@uniformdev/canvas");
|
|
|
833
853
|
var import_design_system5 = require("@uniformdev/design-system");
|
|
834
854
|
var import_lite = require("dequal/lite");
|
|
835
855
|
var import_lexical4 = require("lexical");
|
|
836
|
-
var
|
|
856
|
+
var import_react17 = require("react");
|
|
837
857
|
var import_react_dom = require("react-dom");
|
|
838
858
|
|
|
839
859
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
840
|
-
var
|
|
841
|
-
var menuBtn =
|
|
860
|
+
var import_react11 = require("@emotion/react");
|
|
861
|
+
var menuBtn = import_react11.css`
|
|
842
862
|
background: none;
|
|
843
863
|
border: none;
|
|
844
864
|
color: var(--gray-500);
|
|
@@ -848,18 +868,18 @@ var menuBtn = import_react9.css`
|
|
|
848
868
|
outline: none;
|
|
849
869
|
}
|
|
850
870
|
`;
|
|
851
|
-
var menuItemTextGroup =
|
|
871
|
+
var menuItemTextGroup = import_react11.css`
|
|
852
872
|
align-items: flex-start;
|
|
853
873
|
display: flex;
|
|
854
874
|
flex-direction: column;
|
|
855
875
|
gap: 0;
|
|
856
876
|
line-height: 1em;
|
|
857
877
|
`;
|
|
858
|
-
var smallText =
|
|
878
|
+
var smallText = import_react11.css`
|
|
859
879
|
font-size: var(--fs-xs);
|
|
860
880
|
color: var(--gray-500);
|
|
861
881
|
`;
|
|
862
|
-
var variablesTipText =
|
|
882
|
+
var variablesTipText = import_react11.css`
|
|
863
883
|
${smallText}
|
|
864
884
|
color: var(--gray-500);
|
|
865
885
|
padding: 0 var(--spacing-sm);
|
|
@@ -867,18 +887,18 @@ var variablesTipText = import_react9.css`
|
|
|
867
887
|
|
|
868
888
|
// src/components/Variables/VariablesProvider.tsx
|
|
869
889
|
var import_mitt = __toESM(require("mitt"));
|
|
870
|
-
var
|
|
890
|
+
var import_react15 = require("react");
|
|
871
891
|
|
|
872
892
|
// src/components/Variables/util/useVariableEditTransaction.ts
|
|
873
|
-
var
|
|
893
|
+
var import_react12 = require("react");
|
|
874
894
|
function useVariableEditTransaction({
|
|
875
895
|
events,
|
|
876
896
|
dispatch,
|
|
877
897
|
isEditing,
|
|
878
898
|
variables
|
|
879
899
|
}) {
|
|
880
|
-
const [isEditingBinding, setIsEditingBinding] = (0,
|
|
881
|
-
(0,
|
|
900
|
+
const [isEditingBinding, setIsEditingBinding] = (0, import_react12.useState)();
|
|
901
|
+
(0, import_react12.useEffect)(() => {
|
|
882
902
|
if (!isEditingBinding) {
|
|
883
903
|
return;
|
|
884
904
|
}
|
|
@@ -889,7 +909,7 @@ function useVariableEditTransaction({
|
|
|
889
909
|
events.on("editCompleted", fn);
|
|
890
910
|
return () => events.off("editCompleted", fn);
|
|
891
911
|
}, [events, isEditingBinding, variables]);
|
|
892
|
-
(0,
|
|
912
|
+
(0, import_react12.useEffect)(() => {
|
|
893
913
|
if (!isEditing) {
|
|
894
914
|
if (isEditingBinding) {
|
|
895
915
|
isEditingBinding.resolve({ canceled: true });
|
|
@@ -897,7 +917,7 @@ function useVariableEditTransaction({
|
|
|
897
917
|
setIsEditingBinding(void 0);
|
|
898
918
|
}
|
|
899
919
|
}, [isEditing, isEditingBinding]);
|
|
900
|
-
return (0,
|
|
920
|
+
return (0, import_react12.useCallback)(
|
|
901
921
|
async function editVariableTxn(variable, context) {
|
|
902
922
|
if (isEditingBinding) {
|
|
903
923
|
dispatch({ type: "cancelEdit" });
|
|
@@ -919,13 +939,13 @@ function useVariableEditTransaction({
|
|
|
919
939
|
// src/components/Variables/VariableEditor.tsx
|
|
920
940
|
var import_standard_schema = require("@hookform/resolvers/standard-schema");
|
|
921
941
|
var import_design_system4 = require("@uniformdev/design-system");
|
|
922
|
-
var
|
|
942
|
+
var import_react14 = require("react");
|
|
923
943
|
var import_react_hook_form = require("react-hook-form");
|
|
924
944
|
var z = __toESM(require("zod"));
|
|
925
945
|
|
|
926
946
|
// src/components/Variables/styles/VariableEditor.styles.ts
|
|
927
|
-
var
|
|
928
|
-
var variablesFormContainer =
|
|
947
|
+
var import_react13 = require("@emotion/react");
|
|
948
|
+
var variablesFormContainer = import_react13.css`
|
|
929
949
|
> * {
|
|
930
950
|
margin: var(--spacing-base) 0 0;
|
|
931
951
|
}
|
|
@@ -978,9 +998,9 @@ function VariableEditor({
|
|
|
978
998
|
},
|
|
979
999
|
activeWhenEditing: true
|
|
980
1000
|
});
|
|
981
|
-
const nameRef = (0,
|
|
1001
|
+
const nameRef = (0, import_react14.useRef)(null);
|
|
982
1002
|
const { ref, ...nameRegister } = register("name");
|
|
983
|
-
(0,
|
|
1003
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
984
1004
|
if (nameRef.current && !nameRef.current.value) {
|
|
985
1005
|
nameRef.current.focus();
|
|
986
1006
|
}
|
|
@@ -1056,7 +1076,7 @@ function VariableEditor({
|
|
|
1056
1076
|
|
|
1057
1077
|
// src/components/Variables/VariablesProvider.tsx
|
|
1058
1078
|
var import_jsx_runtime19 = require("@emotion/react/jsx-runtime");
|
|
1059
|
-
var VariablesContext = (0,
|
|
1079
|
+
var VariablesContext = (0, import_react15.createContext)(null);
|
|
1060
1080
|
function VariablesProvider({
|
|
1061
1081
|
value,
|
|
1062
1082
|
onChange,
|
|
@@ -1067,9 +1087,9 @@ function VariablesProvider({
|
|
|
1067
1087
|
knownUndefinedValues = {},
|
|
1068
1088
|
onChangeKnownUndefinedValue
|
|
1069
1089
|
}) {
|
|
1070
|
-
const [editing, setEditing] = (0,
|
|
1071
|
-
const [editingContext, setEditingContext] = (0,
|
|
1072
|
-
const events = (0,
|
|
1090
|
+
const [editing, setEditing] = (0, import_react15.useState)();
|
|
1091
|
+
const [editingContext, setEditingContext] = (0, import_react15.useState)();
|
|
1092
|
+
const events = (0, import_react15.useMemo)(
|
|
1073
1093
|
() => (0, import_mitt.default)(),
|
|
1074
1094
|
[]
|
|
1075
1095
|
);
|
|
@@ -1077,7 +1097,7 @@ function VariablesProvider({
|
|
|
1077
1097
|
throw new Error("onChange must be provided when readOnly is false");
|
|
1078
1098
|
}
|
|
1079
1099
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
1080
|
-
const valueBasedContextValue = (0,
|
|
1100
|
+
const valueBasedContextValue = (0, import_react15.useMemo)(
|
|
1081
1101
|
() => ({
|
|
1082
1102
|
flatVariables: flattenVariables(value),
|
|
1083
1103
|
dispatch: (event) => {
|
|
@@ -1121,7 +1141,7 @@ function VariablesProvider({
|
|
|
1121
1141
|
isEditing: typeof editing !== "undefined",
|
|
1122
1142
|
variables: value
|
|
1123
1143
|
});
|
|
1124
|
-
const contextValue = (0,
|
|
1144
|
+
const contextValue = (0, import_react15.useMemo)(() => {
|
|
1125
1145
|
return {
|
|
1126
1146
|
...valueBasedContextValue,
|
|
1127
1147
|
editVariableTxn,
|
|
@@ -1132,7 +1152,7 @@ function VariablesProvider({
|
|
|
1132
1152
|
isLoading: !!isLoading
|
|
1133
1153
|
};
|
|
1134
1154
|
}, [valueBasedContextValue, editVariableTxn, editing, events, knownUndefinedValues, isLoading]);
|
|
1135
|
-
(0,
|
|
1155
|
+
(0, import_react15.useEffect)(() => {
|
|
1136
1156
|
if (editing === void 0) {
|
|
1137
1157
|
return;
|
|
1138
1158
|
}
|
|
@@ -1181,7 +1201,7 @@ function VariablesProvider({
|
|
|
1181
1201
|
] });
|
|
1182
1202
|
}
|
|
1183
1203
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
1184
|
-
const context = (0,
|
|
1204
|
+
const context = (0, import_react15.useContext)(VariablesContext);
|
|
1185
1205
|
if (!context) {
|
|
1186
1206
|
if (returnEmptyWithoutProvider) {
|
|
1187
1207
|
return {
|
|
@@ -1321,7 +1341,7 @@ function useVariablesMenu({
|
|
|
1321
1341
|
getEditorContext
|
|
1322
1342
|
}) {
|
|
1323
1343
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
1324
|
-
const canEditVariable = (0,
|
|
1344
|
+
const canEditVariable = (0, import_react17.useCallback)(
|
|
1325
1345
|
(name2, variable) => (
|
|
1326
1346
|
// name === '' means new var. Add var perms computed by menu options.
|
|
1327
1347
|
name2 === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -1329,7 +1349,7 @@ function useVariablesMenu({
|
|
|
1329
1349
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1330
1350
|
);
|
|
1331
1351
|
const canAddVariable = canDispatch && showAddVariableMenuOption && !readOnly;
|
|
1332
|
-
const { groupedVariables, menuOptions } = (0,
|
|
1352
|
+
const { groupedVariables, menuOptions } = (0, import_react17.useMemo)(() => {
|
|
1333
1353
|
const groupedVariables2 = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
1334
1354
|
if (canAddVariable) {
|
|
1335
1355
|
groupedVariables2.unshift({
|
|
@@ -1351,7 +1371,7 @@ function useVariablesMenu({
|
|
|
1351
1371
|
);
|
|
1352
1372
|
return { menuOptions: menuOptions2, groupedVariables: groupedVariables2 };
|
|
1353
1373
|
}, [variables, filterVariable, getEditorContext, canAddVariable, showAddVariableMenuOption]);
|
|
1354
|
-
const onSelect = (0,
|
|
1374
|
+
const onSelect = (0, import_react17.useCallback)(
|
|
1355
1375
|
({ queryString, value, nodeToReplace, editor, overwriteExistingValue }) => {
|
|
1356
1376
|
if (value === ADD_VARIABLE_OPTION) {
|
|
1357
1377
|
editor.update(() => {
|
|
@@ -1400,9 +1420,9 @@ function VariablesPlugin({
|
|
|
1400
1420
|
}) {
|
|
1401
1421
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
1402
1422
|
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
1403
|
-
const variablesRef = (0,
|
|
1423
|
+
const variablesRef = (0, import_react17.useRef)({ variables, knownUndefinedValues, isLoading });
|
|
1404
1424
|
variablesRef.current = { variables, knownUndefinedValues, isLoading };
|
|
1405
|
-
const canEditVariable = (0,
|
|
1425
|
+
const canEditVariable = (0, import_react17.useCallback)(
|
|
1406
1426
|
(name2, variable) => (
|
|
1407
1427
|
// name === '' means new var. Add var perms computed by menu options.
|
|
1408
1428
|
name2 === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -1410,13 +1430,13 @@ function VariablesPlugin({
|
|
|
1410
1430
|
[canDispatch, enableEditingVariables, readOnly]
|
|
1411
1431
|
);
|
|
1412
1432
|
const { editVariable } = useVariableEditor();
|
|
1413
|
-
const [queryString, setQueryString] = (0,
|
|
1433
|
+
const [queryString, setQueryString] = (0, import_react17.useState)(null);
|
|
1414
1434
|
const { groupedVariables, menuOptions, onSelect } = useVariablesMenu({
|
|
1415
1435
|
showAddVariableMenuOption,
|
|
1416
1436
|
filterVariable,
|
|
1417
1437
|
getEditorContext
|
|
1418
1438
|
});
|
|
1419
|
-
const { filteredGroupedVariables, filteredMenuOptions } = (0,
|
|
1439
|
+
const { filteredGroupedVariables, filteredMenuOptions } = (0, import_react17.useMemo)(() => {
|
|
1420
1440
|
if (!queryString) {
|
|
1421
1441
|
return {
|
|
1422
1442
|
filteredGroupedVariables: groupedVariables,
|
|
@@ -1439,7 +1459,7 @@ function VariablesPlugin({
|
|
|
1439
1459
|
)
|
|
1440
1460
|
};
|
|
1441
1461
|
}, [queryString, groupedVariables, menuOptions]);
|
|
1442
|
-
const onSelectOption = (0,
|
|
1462
|
+
const onSelectOption = (0, import_react17.useCallback)(
|
|
1443
1463
|
(selectedOption, nodeToReplace, closeMenu) => {
|
|
1444
1464
|
onSelect({
|
|
1445
1465
|
queryString: queryString != null ? queryString : void 0,
|
|
@@ -1452,7 +1472,7 @@ function VariablesPlugin({
|
|
|
1452
1472
|
},
|
|
1453
1473
|
[editor, onSelect, queryString, replaceValueOnVariableInsert]
|
|
1454
1474
|
);
|
|
1455
|
-
(0,
|
|
1475
|
+
(0, import_react17.useEffect)(() => {
|
|
1456
1476
|
return (0, import_utils.mergeRegister)(
|
|
1457
1477
|
editor.registerCommand(
|
|
1458
1478
|
EDIT_VARIABLE_COMMAND,
|
|
@@ -1592,7 +1612,7 @@ function VariablesPlugin({
|
|
|
1592
1612
|
replaceValueOnVariableInsert,
|
|
1593
1613
|
disableVariableDisplayNames
|
|
1594
1614
|
]);
|
|
1595
|
-
const computeUpdatedVariableNodeState = (0,
|
|
1615
|
+
const computeUpdatedVariableNodeState = (0, import_react17.useCallback)(
|
|
1596
1616
|
(variableNode) => {
|
|
1597
1617
|
var _a, _b, _c, _d;
|
|
1598
1618
|
const targetVar = variablesRef.current.variables[variableNode.reference];
|
|
@@ -1617,7 +1637,7 @@ function VariablesPlugin({
|
|
|
1617
1637
|
},
|
|
1618
1638
|
[canEditVariable, disableVariableDisplayNames]
|
|
1619
1639
|
);
|
|
1620
|
-
const updateExistingNodeIfChanged = (0,
|
|
1640
|
+
const updateExistingNodeIfChanged = (0, import_react17.useCallback)(
|
|
1621
1641
|
(variableNode) => {
|
|
1622
1642
|
const newState = computeUpdatedVariableNodeState(variableNode);
|
|
1623
1643
|
if (newState) {
|
|
@@ -1626,7 +1646,7 @@ function VariablesPlugin({
|
|
|
1626
1646
|
},
|
|
1627
1647
|
[computeUpdatedVariableNodeState]
|
|
1628
1648
|
);
|
|
1629
|
-
(0,
|
|
1649
|
+
(0, import_react17.useEffect)(() => {
|
|
1630
1650
|
const pendingUpdates = [];
|
|
1631
1651
|
editor.read(() => {
|
|
1632
1652
|
(0, import_utils.$dfs)().forEach(({ node }) => {
|
|
@@ -1657,7 +1677,7 @@ function VariablesPlugin({
|
|
|
1657
1677
|
}
|
|
1658
1678
|
});
|
|
1659
1679
|
}, [editor, variables, knownUndefinedValues, computeUpdatedVariableNodeState]);
|
|
1660
|
-
(0,
|
|
1680
|
+
(0, import_react17.useEffect)(() => {
|
|
1661
1681
|
return editor.registerNodeTransform(VariableNode, (variableNode) => {
|
|
1662
1682
|
updateExistingNodeIfChanged(variableNode);
|
|
1663
1683
|
});
|
|
@@ -1682,7 +1702,7 @@ function VariablesPlugin({
|
|
|
1682
1702
|
"div",
|
|
1683
1703
|
{
|
|
1684
1704
|
"data-auto-resize-opt-in": true,
|
|
1685
|
-
css:
|
|
1705
|
+
css: import_react16.css`
|
|
1686
1706
|
box-shadow: var(--shadow-base);
|
|
1687
1707
|
border-radius: var(--rounded-base);
|
|
1688
1708
|
background: var(--gray-50);
|
|
@@ -1846,7 +1866,7 @@ function VariableNodeComponent({
|
|
|
1846
1866
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
1847
1867
|
const [isSelected, setSelected, clearSelection] = (0, import_useLexicalNodeSelection.useLexicalNodeSelection)(nodeKey);
|
|
1848
1868
|
const readOnly = !editor.isEditable();
|
|
1849
|
-
const onDelete = (0,
|
|
1869
|
+
const onDelete = (0, import_react18.useCallback)(
|
|
1850
1870
|
(event) => {
|
|
1851
1871
|
if (isSelected && (0, import_lexical5.$isNodeSelection)((0, import_lexical5.$getSelection)())) {
|
|
1852
1872
|
event.preventDefault();
|
|
@@ -1859,7 +1879,7 @@ function VariableNodeComponent({
|
|
|
1859
1879
|
},
|
|
1860
1880
|
[isSelected, nodeKey]
|
|
1861
1881
|
);
|
|
1862
|
-
(0,
|
|
1882
|
+
(0, import_react18.useEffect)(() => {
|
|
1863
1883
|
return (0, import_utils2.mergeRegister)(
|
|
1864
1884
|
editor.registerCommand(import_lexical5.KEY_DELETE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
|
|
1865
1885
|
editor.registerCommand(import_lexical5.KEY_BACKSPACE_COMMAND, onDelete, import_lexical5.COMMAND_PRIORITY_LOW),
|
|
@@ -1947,9 +1967,9 @@ function $isTargetWithinDecorator(target) {
|
|
|
1947
1967
|
}
|
|
1948
1968
|
|
|
1949
1969
|
// src/components/Variables/InputVariables.tsx
|
|
1950
|
-
var
|
|
1970
|
+
var import_react29 = require("@emotion/react");
|
|
1951
1971
|
var import_design_system9 = require("@uniformdev/design-system");
|
|
1952
|
-
var
|
|
1972
|
+
var import_react30 = require("react");
|
|
1953
1973
|
var import_uuid = require("uuid");
|
|
1954
1974
|
|
|
1955
1975
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -1970,10 +1990,10 @@ function EditorRefPlugin({
|
|
|
1970
1990
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
1971
1991
|
var import_utils3 = require("@lexical/utils");
|
|
1972
1992
|
var import_lexical6 = require("lexical");
|
|
1973
|
-
var
|
|
1993
|
+
var import_react19 = require("react");
|
|
1974
1994
|
function PasteTransformerPlugin({ transformPaste }) {
|
|
1975
1995
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
1976
|
-
(0,
|
|
1996
|
+
(0, import_react19.useEffect)(() => {
|
|
1977
1997
|
return (0, import_utils3.mergeRegister)(
|
|
1978
1998
|
editor.registerCommand(
|
|
1979
1999
|
import_lexical6.PASTE_COMMAND,
|
|
@@ -1998,17 +2018,17 @@ function PasteTransformerPlugin({ transformPaste }) {
|
|
|
1998
2018
|
}
|
|
1999
2019
|
|
|
2000
2020
|
// src/components/Variables/styles/InputVariables.styles.ts
|
|
2001
|
-
var
|
|
2002
|
-
var menuContainer =
|
|
2021
|
+
var import_react20 = require("@emotion/react");
|
|
2022
|
+
var menuContainer = import_react20.css`
|
|
2003
2023
|
position: relative;
|
|
2004
2024
|
`;
|
|
2005
|
-
var menuBtn2 =
|
|
2025
|
+
var menuBtn2 = import_react20.css`
|
|
2006
2026
|
position: absolute;
|
|
2007
2027
|
top: 50%;
|
|
2008
2028
|
right: var(--spacing-sm);
|
|
2009
2029
|
transform: translateY(-50%);
|
|
2010
2030
|
`;
|
|
2011
|
-
var input =
|
|
2031
|
+
var input = import_react20.css`
|
|
2012
2032
|
--input-padding: 12px var(--spacing-lg) 12px var(--spacing-sm);
|
|
2013
2033
|
appearance: none;
|
|
2014
2034
|
background-color: var(--white);
|
|
@@ -2053,7 +2073,7 @@ var input = import_react18.css`
|
|
|
2053
2073
|
margin: 0;
|
|
2054
2074
|
}
|
|
2055
2075
|
`;
|
|
2056
|
-
var inputCompact =
|
|
2076
|
+
var inputCompact = import_react20.css`
|
|
2057
2077
|
border: 1px solid var(--white);
|
|
2058
2078
|
padding-block: var(--spacing-sm);
|
|
2059
2079
|
font-size: var(--fs-sm);
|
|
@@ -2062,11 +2082,11 @@ var inputCompact = import_react18.css`
|
|
|
2062
2082
|
min-height: 39px;
|
|
2063
2083
|
}
|
|
2064
2084
|
`;
|
|
2065
|
-
var inputDisabled =
|
|
2085
|
+
var inputDisabled = import_react20.css`
|
|
2066
2086
|
cursor: not-allowed;
|
|
2067
2087
|
opacity: var(--opacity-50);
|
|
2068
2088
|
`;
|
|
2069
|
-
var placeholderCaption =
|
|
2089
|
+
var placeholderCaption = import_react20.css`
|
|
2070
2090
|
position: absolute;
|
|
2071
2091
|
color: var(--gray-400);
|
|
2072
2092
|
inset: 12px var(--spacing-base) 12px var(--spacing-sm);
|
|
@@ -2075,14 +2095,14 @@ var placeholderCaption = import_react18.css`
|
|
|
2075
2095
|
white-space: nowrap;
|
|
2076
2096
|
pointer-events: none;
|
|
2077
2097
|
`;
|
|
2078
|
-
var placeholderCompact =
|
|
2098
|
+
var placeholderCompact = import_react20.css`
|
|
2079
2099
|
inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
|
|
2080
2100
|
`;
|
|
2081
2101
|
|
|
2082
2102
|
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
2083
|
-
var
|
|
2103
|
+
var import_react21 = require("@emotion/react");
|
|
2084
2104
|
var import_design_system7 = require("@uniformdev/design-system");
|
|
2085
|
-
var variableBindButton =
|
|
2105
|
+
var variableBindButton = import_react21.css`
|
|
2086
2106
|
--hover-color: var(--accent-dark-hover);
|
|
2087
2107
|
--active-color: var(--accent-dark-active);
|
|
2088
2108
|
border: 1px solid transparent;
|
|
@@ -2125,7 +2145,7 @@ var variableBindButton = import_react19.css`
|
|
|
2125
2145
|
max-height: unset;
|
|
2126
2146
|
}
|
|
2127
2147
|
`;
|
|
2128
|
-
var input2 =
|
|
2148
|
+
var input2 = import_react21.css`
|
|
2129
2149
|
display: block;
|
|
2130
2150
|
appearance: none;
|
|
2131
2151
|
box-sizing: border-box;
|
|
@@ -2179,7 +2199,7 @@ var input2 = import_react19.css`
|
|
|
2179
2199
|
margin: 0;
|
|
2180
2200
|
}
|
|
2181
2201
|
`;
|
|
2182
|
-
var inputMultiLine = (lines) =>
|
|
2202
|
+
var inputMultiLine = (lines) => import_react21.css`
|
|
2183
2203
|
${import_design_system7.scrollbarStyles}
|
|
2184
2204
|
// 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
|
|
2185
2205
|
// as the text looked to close to the bottom of the input
|
|
@@ -2190,7 +2210,7 @@ var inputMultiLine = (lines) => import_react19.css`
|
|
|
2190
2210
|
|
|
2191
2211
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
2192
2212
|
var import_canvas6 = require("@uniformdev/canvas");
|
|
2193
|
-
var
|
|
2213
|
+
var import_react22 = require("react");
|
|
2194
2214
|
function useInputVariablesState({
|
|
2195
2215
|
value,
|
|
2196
2216
|
onChange,
|
|
@@ -2206,14 +2226,14 @@ function useInputVariablesState({
|
|
|
2206
2226
|
}) {
|
|
2207
2227
|
const { variables } = useVariables(true);
|
|
2208
2228
|
const variableReferenceCountInValue = (0, import_canvas6.hasReferencedVariables)(value != null ? value : "");
|
|
2209
|
-
const [lastKnownId, setLastKnownId] = (0,
|
|
2210
|
-
const [hadVariablesInValue, setHadVariablesInValue] = (0,
|
|
2211
|
-
(0,
|
|
2229
|
+
const [lastKnownId, setLastKnownId] = (0, import_react22.useState)(id);
|
|
2230
|
+
const [hadVariablesInValue, setHadVariablesInValue] = (0, import_react22.useState)(variableReferenceCountInValue > 0);
|
|
2231
|
+
(0, import_react22.useEffect)(() => {
|
|
2212
2232
|
if (variableReferenceCountInValue) {
|
|
2213
2233
|
setHadVariablesInValue(true);
|
|
2214
2234
|
}
|
|
2215
2235
|
}, [variableReferenceCountInValue]);
|
|
2216
|
-
(0,
|
|
2236
|
+
(0, import_react22.useEffect)(() => {
|
|
2217
2237
|
if (id !== lastKnownId) {
|
|
2218
2238
|
setLastKnownId(id);
|
|
2219
2239
|
setHadVariablesInValue(variableReferenceCountInValue > 0);
|
|
@@ -2222,7 +2242,7 @@ function useInputVariablesState({
|
|
|
2222
2242
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : variableReferenceCountInValue > 0;
|
|
2223
2243
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
2224
2244
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
2225
|
-
const sharedMenuProps = (0,
|
|
2245
|
+
const sharedMenuProps = (0, import_react22.useMemo)(
|
|
2226
2246
|
() => ({
|
|
2227
2247
|
menuTooltip,
|
|
2228
2248
|
showAddVariableMenuOption,
|
|
@@ -2255,8 +2275,8 @@ function useInputVariablesState({
|
|
|
2255
2275
|
}
|
|
2256
2276
|
|
|
2257
2277
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
2258
|
-
var
|
|
2259
|
-
var labelText =
|
|
2278
|
+
var import_react23 = require("@emotion/react");
|
|
2279
|
+
var labelText = import_react23.css`
|
|
2260
2280
|
align-items: center;
|
|
2261
2281
|
display: flex;
|
|
2262
2282
|
gap: var(--spacing-xs);
|
|
@@ -2272,7 +2292,7 @@ var import_lexical7 = require("lexical");
|
|
|
2272
2292
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
2273
2293
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
2274
2294
|
var import_design_system8 = require("@uniformdev/design-system");
|
|
2275
|
-
var
|
|
2295
|
+
var import_react24 = require("react");
|
|
2276
2296
|
var import_jsx_runtime22 = require("@emotion/react/jsx-runtime");
|
|
2277
2297
|
function SelectVariableMenu({
|
|
2278
2298
|
onSelectVariable,
|
|
@@ -2287,7 +2307,7 @@ function SelectVariableMenu({
|
|
|
2287
2307
|
filterVariable
|
|
2288
2308
|
}) {
|
|
2289
2309
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
2290
|
-
const btnRef = (0,
|
|
2310
|
+
const btnRef = (0, import_react24.useRef)(null);
|
|
2291
2311
|
const { editVariable } = useVariableEditor();
|
|
2292
2312
|
const variablesGroups = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
2293
2313
|
const showAddVariableMenuOptionForReals = showAddVariableMenuOption && canDispatch && !readOnly;
|
|
@@ -2420,14 +2440,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
2420
2440
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
2421
2441
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
2422
2442
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
2423
|
-
var
|
|
2443
|
+
var import_react27 = require("react");
|
|
2424
2444
|
|
|
2425
2445
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
2426
2446
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
2427
|
-
var
|
|
2447
|
+
var import_react25 = require("react");
|
|
2428
2448
|
function DisablePlugin({ disabled }) {
|
|
2429
2449
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
2430
|
-
(0,
|
|
2450
|
+
(0, import_react25.useEffect)(() => {
|
|
2431
2451
|
editor.setEditable(!disabled);
|
|
2432
2452
|
}, [editor, disabled]);
|
|
2433
2453
|
return null;
|
|
@@ -2436,10 +2456,10 @@ function DisablePlugin({ disabled }) {
|
|
|
2436
2456
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
2437
2457
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
2438
2458
|
var import_lexical8 = require("lexical");
|
|
2439
|
-
var
|
|
2459
|
+
var import_react26 = require("react");
|
|
2440
2460
|
function SingleLineTextPlugin() {
|
|
2441
2461
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
2442
|
-
(0,
|
|
2462
|
+
(0, import_react26.useEffect)(() => {
|
|
2443
2463
|
editor.registerNodeTransform(import_lexical8.LineBreakNode, (node) => {
|
|
2444
2464
|
node.remove();
|
|
2445
2465
|
});
|
|
@@ -2460,8 +2480,8 @@ function VariablesComposer(props) {
|
|
|
2460
2480
|
autoFocus,
|
|
2461
2481
|
...variablesPluginProps
|
|
2462
2482
|
} = props;
|
|
2463
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
2464
|
-
const editorConfig = (0,
|
|
2483
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react27.useState)(value);
|
|
2484
|
+
const editorConfig = (0, import_react27.useMemo)(
|
|
2465
2485
|
() => ({
|
|
2466
2486
|
namespace: "uniform",
|
|
2467
2487
|
onError(error) {
|
|
@@ -2473,8 +2493,8 @@ function VariablesComposer(props) {
|
|
|
2473
2493
|
// oxlint-disable-next-line react/exhaustive-deps
|
|
2474
2494
|
[]
|
|
2475
2495
|
);
|
|
2476
|
-
const editorState = (0,
|
|
2477
|
-
const updateTimeout = (0,
|
|
2496
|
+
const editorState = (0, import_react27.useRef)(void 0);
|
|
2497
|
+
const updateTimeout = (0, import_react27.useRef)(void 0);
|
|
2478
2498
|
if (typeof document === "undefined") return null;
|
|
2479
2499
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
2480
2500
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -2516,10 +2536,10 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
2516
2536
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
2517
2537
|
var import_utils4 = require("@lexical/utils");
|
|
2518
2538
|
var import_lexical9 = require("lexical");
|
|
2519
|
-
var
|
|
2539
|
+
var import_react28 = require("react");
|
|
2520
2540
|
var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
|
|
2521
2541
|
function VariablesComposerInput({
|
|
2522
|
-
css:
|
|
2542
|
+
css: css24,
|
|
2523
2543
|
placeholder,
|
|
2524
2544
|
...contentEditableProps
|
|
2525
2545
|
}) {
|
|
@@ -2538,7 +2558,7 @@ function VariablesComposerInput({
|
|
|
2538
2558
|
}
|
|
2539
2559
|
function RichishCopyAndPastePlugin() {
|
|
2540
2560
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
2541
|
-
(0,
|
|
2561
|
+
(0, import_react28.useEffect)(() => {
|
|
2542
2562
|
return (0, import_utils4.mergeRegister)(
|
|
2543
2563
|
editor.registerCommand(
|
|
2544
2564
|
import_lexical9.COPY_COMMAND,
|
|
@@ -2645,7 +2665,7 @@ function InputVariables(props) {
|
|
|
2645
2665
|
singleTokenMode,
|
|
2646
2666
|
disableVariableDisplayNames
|
|
2647
2667
|
} = props;
|
|
2648
|
-
const [finalId] = (0,
|
|
2668
|
+
const [finalId] = (0, import_react30.useState)(id != null ? id : (() => (0, import_uuid.v4)()));
|
|
2649
2669
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
2650
2670
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
2651
2671
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -2664,7 +2684,7 @@ function InputVariables(props) {
|
|
|
2664
2684
|
{
|
|
2665
2685
|
align: "center",
|
|
2666
2686
|
gap: "xs",
|
|
2667
|
-
css:
|
|
2687
|
+
css: import_react29.css`
|
|
2668
2688
|
position: relative;
|
|
2669
2689
|
& > div:first-of-type {
|
|
2670
2690
|
flex-grow: 1;
|
|
@@ -2793,7 +2813,7 @@ function InputVariablesOverlayMenu({
|
|
|
2793
2813
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
2794
2814
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
2795
2815
|
var import_design_system10 = require("@uniformdev/design-system");
|
|
2796
|
-
var
|
|
2816
|
+
var import_react31 = require("react");
|
|
2797
2817
|
var import_jsx_runtime28 = require("@emotion/react/jsx-runtime");
|
|
2798
2818
|
function ParameterConnectionIndicator({
|
|
2799
2819
|
children,
|
|
@@ -2804,7 +2824,7 @@ function ParameterConnectionIndicator({
|
|
|
2804
2824
|
overrideMenuButtonParentMargin,
|
|
2805
2825
|
renderMenuInPortal = false
|
|
2806
2826
|
}) {
|
|
2807
|
-
const hasVariablesInValue = (0,
|
|
2827
|
+
const hasVariablesInValue = (0, import_react31.useMemo)(() => {
|
|
2808
2828
|
let result = false;
|
|
2809
2829
|
(0, import_canvas7.bindVariablesToObject)({
|
|
2810
2830
|
value,
|
|
@@ -2849,21 +2869,21 @@ function ParameterConnectionIndicator({
|
|
|
2849
2869
|
|
|
2850
2870
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
2851
2871
|
var import_design_system11 = require("@uniformdev/design-system");
|
|
2852
|
-
var
|
|
2872
|
+
var import_react33 = require("react");
|
|
2853
2873
|
|
|
2854
2874
|
// src/components/Variables/composer/OnDisconnectPlugin.tsx
|
|
2855
2875
|
var import_LexicalComposerContext10 = require("@lexical/react/LexicalComposerContext");
|
|
2856
2876
|
var import_utils5 = require("@lexical/utils");
|
|
2857
2877
|
var import_lexical10 = require("lexical");
|
|
2858
|
-
var
|
|
2878
|
+
var import_react32 = require("react");
|
|
2859
2879
|
function OnDisconnectPlugin({
|
|
2860
2880
|
onDisconnect
|
|
2861
2881
|
}) {
|
|
2862
2882
|
const [editor] = (0, import_LexicalComposerContext10.useLexicalComposerContext)();
|
|
2863
2883
|
const { variables } = useVariables(true);
|
|
2864
|
-
const variablesRef = (0,
|
|
2884
|
+
const variablesRef = (0, import_react32.useRef)(variables);
|
|
2865
2885
|
variablesRef.current = variables;
|
|
2866
|
-
(0,
|
|
2886
|
+
(0, import_react32.useEffect)(() => {
|
|
2867
2887
|
return (0, import_utils5.mergeRegister)(
|
|
2868
2888
|
editor.registerCommand(
|
|
2869
2889
|
DISCONNECT_VARIABLE_COMMAND,
|
|
@@ -2908,7 +2928,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2908
2928
|
hasVariablesInValue,
|
|
2909
2929
|
setHadVariablesInValue
|
|
2910
2930
|
} = useInputVariablesState(props);
|
|
2911
|
-
const handleDisconnect = (0,
|
|
2931
|
+
const handleDisconnect = (0, import_react33.useCallback)(
|
|
2912
2932
|
(variable) => {
|
|
2913
2933
|
setHadVariablesInValue(false);
|
|
2914
2934
|
if (onDisconnect) {
|
|
@@ -2961,7 +2981,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
2961
2981
|
}
|
|
2962
2982
|
|
|
2963
2983
|
// src/components/Variables/ParameterVariables.tsx
|
|
2964
|
-
var
|
|
2984
|
+
var import_react34 = require("@emotion/react");
|
|
2965
2985
|
var import_design_system12 = require("@uniformdev/design-system");
|
|
2966
2986
|
var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
|
|
2967
2987
|
function ParameterVariables(props) {
|
|
@@ -3018,8 +3038,8 @@ function ParameterVariables(props) {
|
|
|
3018
3038
|
"data-text-value": value,
|
|
3019
3039
|
css: [
|
|
3020
3040
|
input2,
|
|
3021
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) :
|
|
3022
|
-
inputCss != null ? inputCss :
|
|
3041
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : import_react34.css``,
|
|
3042
|
+
inputCss != null ? inputCss : import_react34.css``
|
|
3023
3043
|
]
|
|
3024
3044
|
}
|
|
3025
3045
|
)
|
|
@@ -3055,18 +3075,18 @@ ${prettifyBindExpression(bindExpression)}`
|
|
|
3055
3075
|
}
|
|
3056
3076
|
|
|
3057
3077
|
// src/components/Variables/VariablesList.tsx
|
|
3058
|
-
var
|
|
3078
|
+
var import_react37 = require("@emotion/react");
|
|
3059
3079
|
var import_dnd2 = require("@hello-pangea/dnd");
|
|
3060
3080
|
var import_CgTrash = require("@react-icons/all-files/cg/CgTrash");
|
|
3061
3081
|
var import_design_system13 = require("@uniformdev/design-system");
|
|
3062
3082
|
|
|
3063
3083
|
// src/components/DragDropContext.tsx
|
|
3064
3084
|
var import_dnd = require("@hello-pangea/dnd");
|
|
3065
|
-
var
|
|
3085
|
+
var import_react35 = require("react");
|
|
3066
3086
|
var import_react_use = require("react-use");
|
|
3067
3087
|
var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
|
|
3068
3088
|
function DragDropContext({ children, ...props }) {
|
|
3069
|
-
const [isReady, setIsReady] = (0,
|
|
3089
|
+
const [isReady, setIsReady] = (0, import_react35.useState)(false);
|
|
3070
3090
|
(0, import_react_use.useDebounce)(
|
|
3071
3091
|
() => {
|
|
3072
3092
|
setIsReady(true);
|
|
@@ -3078,8 +3098,8 @@ function DragDropContext({ children, ...props }) {
|
|
|
3078
3098
|
}
|
|
3079
3099
|
|
|
3080
3100
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
3081
|
-
var
|
|
3082
|
-
var tableRow = (isDragging) =>
|
|
3101
|
+
var import_react36 = require("@emotion/react");
|
|
3102
|
+
var tableRow = (isDragging) => import_react36.css`
|
|
3083
3103
|
position: relative;
|
|
3084
3104
|
${isDragging ? `
|
|
3085
3105
|
display: table;
|
|
@@ -3087,7 +3107,7 @@ var tableRow = (isDragging) => import_react34.css`
|
|
|
3087
3107
|
top: auto !important;
|
|
3088
3108
|
` : void 0}
|
|
3089
3109
|
`;
|
|
3090
|
-
var tableCellDragIcon =
|
|
3110
|
+
var tableCellDragIcon = import_react36.css`
|
|
3091
3111
|
&::after {
|
|
3092
3112
|
content: '';
|
|
3093
3113
|
display: block;
|
|
@@ -3105,7 +3125,7 @@ var tableCellDragIcon = import_react34.css`
|
|
|
3105
3125
|
opacity: 1;
|
|
3106
3126
|
}
|
|
3107
3127
|
`;
|
|
3108
|
-
var variableName =
|
|
3128
|
+
var variableName = import_react36.css`
|
|
3109
3129
|
border: none;
|
|
3110
3130
|
font-weight: var(--fw-medium);
|
|
3111
3131
|
padding: 0;
|
|
@@ -3115,7 +3135,7 @@ var variableName = import_react34.css`
|
|
|
3115
3135
|
white-space: nowrap;
|
|
3116
3136
|
max-width: 20ch;
|
|
3117
3137
|
`;
|
|
3118
|
-
var variableValue =
|
|
3138
|
+
var variableValue = import_react36.css`
|
|
3119
3139
|
overflow: hidden;
|
|
3120
3140
|
text-overflow: ellipsis;
|
|
3121
3141
|
white-space: nowrap;
|
|
@@ -3194,7 +3214,7 @@ function VariablesList() {
|
|
|
3194
3214
|
title: `delete ${text}`,
|
|
3195
3215
|
css: [
|
|
3196
3216
|
import_design_system13.button,
|
|
3197
|
-
|
|
3217
|
+
import_react37.css`
|
|
3198
3218
|
background: transparent;
|
|
3199
3219
|
`
|
|
3200
3220
|
],
|
|
@@ -3324,9 +3344,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3324
3344
|
}
|
|
3325
3345
|
|
|
3326
3346
|
// src/components/Request/RequestBody.tsx
|
|
3327
|
-
var
|
|
3347
|
+
var import_react39 = require("@emotion/react");
|
|
3328
3348
|
var import_design_system15 = require("@uniformdev/design-system");
|
|
3329
|
-
var
|
|
3349
|
+
var import_react40 = require("react");
|
|
3330
3350
|
|
|
3331
3351
|
// src/components/Request/RequestProvider.tsx
|
|
3332
3352
|
var React4 = __toESM(require("react"));
|
|
@@ -3414,11 +3434,11 @@ function useRequest() {
|
|
|
3414
3434
|
}
|
|
3415
3435
|
|
|
3416
3436
|
// src/components/Request/styles/Request.styles.ts
|
|
3417
|
-
var
|
|
3418
|
-
var innerContentStyles =
|
|
3437
|
+
var import_react38 = require("@emotion/react");
|
|
3438
|
+
var innerContentStyles = import_react38.css`
|
|
3419
3439
|
background: var(--white);
|
|
3420
3440
|
`;
|
|
3421
|
-
var requestTypeContainer = (bgColor) =>
|
|
3441
|
+
var requestTypeContainer = (bgColor) => import_react38.css`
|
|
3422
3442
|
align-items: start;
|
|
3423
3443
|
background: ${bgColor};
|
|
3424
3444
|
display: grid;
|
|
@@ -3456,11 +3476,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
3456
3476
|
};
|
|
3457
3477
|
function RequestBody() {
|
|
3458
3478
|
const { request, dispatch } = useRequest();
|
|
3459
|
-
const [language, setLanguage] = (0,
|
|
3479
|
+
const [language, setLanguage] = (0, import_react40.useState)("json");
|
|
3460
3480
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3461
3481
|
"div",
|
|
3462
3482
|
{
|
|
3463
|
-
css:
|
|
3483
|
+
css: import_react39.css`
|
|
3464
3484
|
background: var(--white);
|
|
3465
3485
|
`,
|
|
3466
3486
|
children: [
|
|
@@ -3468,7 +3488,7 @@ function RequestBody() {
|
|
|
3468
3488
|
RequestTypeContainer,
|
|
3469
3489
|
{
|
|
3470
3490
|
bgColor: "var(--gray-100)",
|
|
3471
|
-
css:
|
|
3491
|
+
css: import_react39.css`
|
|
3472
3492
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
3473
3493
|
`,
|
|
3474
3494
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
@@ -3745,8 +3765,8 @@ function RequestParameters({
|
|
|
3745
3765
|
}
|
|
3746
3766
|
|
|
3747
3767
|
// src/components/Request/RequestUrl.tsx
|
|
3748
|
-
var
|
|
3749
|
-
var
|
|
3768
|
+
var import_react41 = require("@emotion/react");
|
|
3769
|
+
var import_react42 = require("react");
|
|
3750
3770
|
|
|
3751
3771
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
3752
3772
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -3772,7 +3792,7 @@ function RequestUrl() {
|
|
|
3772
3792
|
var _a, _b;
|
|
3773
3793
|
const { variables } = useVariables();
|
|
3774
3794
|
const { request } = useRequest();
|
|
3775
|
-
const mergedParameters = (0,
|
|
3795
|
+
const mergedParameters = (0, import_react42.useMemo)(() => {
|
|
3776
3796
|
var _a2;
|
|
3777
3797
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
3778
3798
|
return request.parameters;
|
|
@@ -3782,7 +3802,7 @@ function RequestUrl() {
|
|
|
3782
3802
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3783
3803
|
"small",
|
|
3784
3804
|
{
|
|
3785
|
-
css:
|
|
3805
|
+
css: import_react41.css`
|
|
3786
3806
|
display: inline-block;
|
|
3787
3807
|
margin-bottom: var(--spacing-xs);
|
|
3788
3808
|
word-break: break-word;
|
|
@@ -4015,17 +4035,186 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
4015
4035
|
};
|
|
4016
4036
|
}
|
|
4017
4037
|
|
|
4018
|
-
// src/components/
|
|
4038
|
+
// src/components/Delegation/DelegationGate.tsx
|
|
4019
4039
|
var import_design_system19 = require("@uniformdev/design-system");
|
|
4040
|
+
var import_react44 = require("react");
|
|
4041
|
+
|
|
4042
|
+
// src/components/Delegation/styles/DelegationGate.style.ts
|
|
4043
|
+
var import_react43 = require("@emotion/react");
|
|
4044
|
+
var delegationGateStyle = import_react43.css`
|
|
4045
|
+
min-height: 12rem;
|
|
4046
|
+
width: 100%;
|
|
4047
|
+
`;
|
|
4048
|
+
|
|
4049
|
+
// src/components/Delegation/DelegationGate.tsx
|
|
4050
|
+
var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
|
|
4051
|
+
function DefaultDelegationLoading() {
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { css: delegationGateStyle, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.LoadingOverlay, { isActive: true, statusMessage: "Connecting to Uniform..." }) });
|
|
4053
|
+
}
|
|
4054
|
+
function DefaultDelegationDisabled() {
|
|
4055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.Callout, { type: "caution", title: "Feature unavailable", children: "This app requires permissions that are not currently enabled. Please contact your Uniform administrator to enable identity delegation for this integration." });
|
|
4056
|
+
}
|
|
4057
|
+
function DefaultDelegationError({ error }) {
|
|
4058
|
+
(0, import_react44.useEffect)(() => {
|
|
4059
|
+
console.error("Delegation connection failed", error);
|
|
4060
|
+
}, [error]);
|
|
4061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system19.Callout, { type: "error", title: "Connection error", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "Failed to connect to Uniform. Try again, or contact your administrator if the problem persists." }) });
|
|
4062
|
+
}
|
|
4063
|
+
function DelegationGate({
|
|
4064
|
+
children,
|
|
4065
|
+
loadingComponent,
|
|
4066
|
+
disabledComponent,
|
|
4067
|
+
errorComponent
|
|
4068
|
+
}) {
|
|
4069
|
+
const { status, error } = useDelegation();
|
|
4070
|
+
if (status === "active") {
|
|
4071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children });
|
|
4072
|
+
}
|
|
4073
|
+
if (status === "idle" || status === "acquiring") {
|
|
4074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: loadingComponent !== void 0 ? loadingComponent : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DefaultDelegationLoading, {}) });
|
|
4075
|
+
}
|
|
4076
|
+
if (status === "disabled") {
|
|
4077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: disabledComponent !== void 0 ? disabledComponent : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DefaultDelegationDisabled, {}) });
|
|
4078
|
+
}
|
|
4079
|
+
if (status === "error") {
|
|
4080
|
+
const resolvedError = error != null ? error : new Error("Unknown delegation error");
|
|
4081
|
+
if (errorComponent !== void 0) {
|
|
4082
|
+
if (typeof errorComponent === "function") {
|
|
4083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: errorComponent({ error: resolvedError }) });
|
|
4084
|
+
}
|
|
4085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: errorComponent });
|
|
4086
|
+
}
|
|
4087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DefaultDelegationError, { error: resolvedError });
|
|
4088
|
+
}
|
|
4089
|
+
return null;
|
|
4090
|
+
}
|
|
4091
|
+
|
|
4092
|
+
// src/components/Delegation/DelegationProvider.tsx
|
|
4093
|
+
var import_react45 = require("react");
|
|
4094
|
+
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
4095
|
+
var DEFAULT_REVALIDATE_AFTER_MS = 5 * 60 * 1e3;
|
|
4096
|
+
function DelegationProvider({
|
|
4097
|
+
sdk,
|
|
4098
|
+
onSessionToken,
|
|
4099
|
+
checkActive,
|
|
4100
|
+
revalidateOnFocus = true,
|
|
4101
|
+
revalidateAfterMs = DEFAULT_REVALIDATE_AFTER_MS,
|
|
4102
|
+
children
|
|
4103
|
+
}) {
|
|
4104
|
+
const [status, setStatus] = (0, import_react45.useState)("idle");
|
|
4105
|
+
const [error, setError] = (0, import_react45.useState)(null);
|
|
4106
|
+
const acquiringRef = (0, import_react45.useRef)(false);
|
|
4107
|
+
const mountedRef = (0, import_react45.useRef)(true);
|
|
4108
|
+
const statusRef = (0, import_react45.useRef)("idle");
|
|
4109
|
+
statusRef.current = status;
|
|
4110
|
+
const acquire = (0, import_react45.useCallback)(async () => {
|
|
4111
|
+
if (acquiringRef.current) {
|
|
4112
|
+
return;
|
|
4113
|
+
}
|
|
4114
|
+
acquiringRef.current = true;
|
|
4115
|
+
setStatus("acquiring");
|
|
4116
|
+
setError(null);
|
|
4117
|
+
try {
|
|
4118
|
+
const isActive = await checkActive();
|
|
4119
|
+
if (isActive) {
|
|
4120
|
+
if (mountedRef.current) {
|
|
4121
|
+
setStatus("active");
|
|
4122
|
+
}
|
|
4123
|
+
return;
|
|
4124
|
+
}
|
|
4125
|
+
if (!mountedRef.current) {
|
|
4126
|
+
return;
|
|
4127
|
+
}
|
|
4128
|
+
const sessionToken = await sdk.getSessionToken();
|
|
4129
|
+
if (!mountedRef.current) {
|
|
4130
|
+
return;
|
|
4131
|
+
}
|
|
4132
|
+
if (!sessionToken) {
|
|
4133
|
+
setStatus("disabled");
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
await onSessionToken(sessionToken);
|
|
4137
|
+
if (mountedRef.current) {
|
|
4138
|
+
setStatus("active");
|
|
4139
|
+
}
|
|
4140
|
+
} catch (err) {
|
|
4141
|
+
if (mountedRef.current) {
|
|
4142
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
4143
|
+
setStatus("error");
|
|
4144
|
+
}
|
|
4145
|
+
} finally {
|
|
4146
|
+
acquiringRef.current = false;
|
|
4147
|
+
}
|
|
4148
|
+
}, [sdk, onSessionToken, checkActive]);
|
|
4149
|
+
(0, import_react45.useEffect)(() => {
|
|
4150
|
+
mountedRef.current = true;
|
|
4151
|
+
void acquire();
|
|
4152
|
+
return () => {
|
|
4153
|
+
mountedRef.current = false;
|
|
4154
|
+
};
|
|
4155
|
+
}, [acquire]);
|
|
4156
|
+
const revalidate = (0, import_react45.useCallback)(async () => {
|
|
4157
|
+
if (acquiringRef.current) {
|
|
4158
|
+
return;
|
|
4159
|
+
}
|
|
4160
|
+
if (statusRef.current !== "active") {
|
|
4161
|
+
return;
|
|
4162
|
+
}
|
|
4163
|
+
try {
|
|
4164
|
+
const isActive = await checkActive();
|
|
4165
|
+
if (!mountedRef.current) {
|
|
4166
|
+
return;
|
|
4167
|
+
}
|
|
4168
|
+
if (!isActive) {
|
|
4169
|
+
void acquire();
|
|
4170
|
+
}
|
|
4171
|
+
} catch (e) {
|
|
4172
|
+
}
|
|
4173
|
+
}, [checkActive, acquire]);
|
|
4174
|
+
(0, import_react45.useEffect)(() => {
|
|
4175
|
+
if (!revalidateOnFocus) {
|
|
4176
|
+
return;
|
|
4177
|
+
}
|
|
4178
|
+
if (typeof document === "undefined") {
|
|
4179
|
+
return;
|
|
4180
|
+
}
|
|
4181
|
+
let hiddenAt = document.visibilityState === "hidden" ? Date.now() : null;
|
|
4182
|
+
const handleVisibilityChange = () => {
|
|
4183
|
+
if (document.visibilityState === "hidden") {
|
|
4184
|
+
hiddenAt = Date.now();
|
|
4185
|
+
return;
|
|
4186
|
+
}
|
|
4187
|
+
if (document.visibilityState === "visible") {
|
|
4188
|
+
const elapsed = hiddenAt === null ? 0 : Date.now() - hiddenAt;
|
|
4189
|
+
hiddenAt = null;
|
|
4190
|
+
if (elapsed >= revalidateAfterMs) {
|
|
4191
|
+
void revalidate();
|
|
4192
|
+
}
|
|
4193
|
+
}
|
|
4194
|
+
};
|
|
4195
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
4196
|
+
return () => {
|
|
4197
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
4198
|
+
};
|
|
4199
|
+
}, [revalidateOnFocus, revalidateAfterMs, revalidate]);
|
|
4200
|
+
const reacquire = (0, import_react45.useCallback)(() => {
|
|
4201
|
+
void acquire();
|
|
4202
|
+
}, [acquire]);
|
|
4203
|
+
const value = (0, import_react45.useMemo)(() => ({ status, error, reacquire }), [status, error, reacquire]);
|
|
4204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DelegationContext.Provider, { value, children });
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4207
|
+
// src/components/MeshApp.tsx
|
|
4208
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
4020
4209
|
|
|
4021
4210
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
4022
4211
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
4023
|
-
var
|
|
4212
|
+
var import_react46 = require("react");
|
|
4024
4213
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
4025
|
-
const [error, setError] = (0,
|
|
4026
|
-
const [sdk, setSdk] = (0,
|
|
4027
|
-
const initializationInProgress = (0,
|
|
4028
|
-
(0,
|
|
4214
|
+
const [error, setError] = (0, import_react46.useState)();
|
|
4215
|
+
const [sdk, setSdk] = (0, import_react46.useState)();
|
|
4216
|
+
const initializationInProgress = (0, import_react46.useRef)(false);
|
|
4217
|
+
(0, import_react46.useEffect)(
|
|
4029
4218
|
() => {
|
|
4030
4219
|
if (typeof window === "undefined" || sdk) {
|
|
4031
4220
|
return;
|
|
@@ -4058,7 +4247,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
4058
4247
|
};
|
|
4059
4248
|
|
|
4060
4249
|
// src/components/MeshApp.tsx
|
|
4061
|
-
var
|
|
4250
|
+
var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
|
|
4062
4251
|
var MeshApp = ({
|
|
4063
4252
|
children,
|
|
4064
4253
|
loadingComponent,
|
|
@@ -4067,36 +4256,36 @@ var MeshApp = ({
|
|
|
4067
4256
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
4068
4257
|
if (initializing || !sdk) {
|
|
4069
4258
|
const LoadingComponent = loadingComponent;
|
|
4070
|
-
return LoadingComponent ? /* @__PURE__ */ (0,
|
|
4259
|
+
return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system20.LoadingIndicator, {});
|
|
4071
4260
|
}
|
|
4072
4261
|
if (error) {
|
|
4073
4262
|
const ErrorComponent = errorComponent;
|
|
4074
4263
|
if (ErrorComponent) {
|
|
4075
|
-
return /* @__PURE__ */ (0,
|
|
4264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ErrorComponent, { error });
|
|
4076
4265
|
}
|
|
4077
4266
|
throw error;
|
|
4078
4267
|
}
|
|
4079
|
-
return /* @__PURE__ */ (0,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
4269
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system20.Theme, {}),
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_design_system20.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(UniformMeshLocationContextProvider, { children }) })
|
|
4082
4271
|
] });
|
|
4083
4272
|
};
|
|
4084
4273
|
|
|
4085
4274
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
4086
|
-
var
|
|
4087
|
-
var
|
|
4088
|
-
var
|
|
4275
|
+
var import_react47 = require("@emotion/react");
|
|
4276
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4277
|
+
var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
|
|
4089
4278
|
var DataRefreshButton = ({
|
|
4090
4279
|
buttonText,
|
|
4091
4280
|
isLoading,
|
|
4092
4281
|
onRefreshData,
|
|
4093
4282
|
...props
|
|
4094
4283
|
}) => {
|
|
4095
|
-
return /* @__PURE__ */ (0,
|
|
4096
|
-
!isLoading ? null : /* @__PURE__ */ (0,
|
|
4097
|
-
|
|
4284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_design_system21.Button, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
4285
|
+
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4286
|
+
import_design_system21.LoadingIndicator,
|
|
4098
4287
|
{
|
|
4099
|
-
css:
|
|
4288
|
+
css: import_react47.css`
|
|
4100
4289
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
4101
4290
|
`
|
|
4102
4291
|
}
|
|
@@ -4106,15 +4295,15 @@ var DataRefreshButton = ({
|
|
|
4106
4295
|
};
|
|
4107
4296
|
|
|
4108
4297
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4109
|
-
var
|
|
4298
|
+
var import_react50 = require("@emotion/react");
|
|
4110
4299
|
var import_canvas9 = require("@uniformdev/canvas");
|
|
4111
|
-
var
|
|
4300
|
+
var import_design_system24 = require("@uniformdev/design-system");
|
|
4112
4301
|
|
|
4113
4302
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
4114
4303
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
4115
|
-
var
|
|
4116
|
-
var
|
|
4117
|
-
var ObjectSearchContext = (0,
|
|
4304
|
+
var import_react48 = require("react");
|
|
4305
|
+
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
4306
|
+
var ObjectSearchContext = (0, import_react48.createContext)({
|
|
4118
4307
|
onSetQuery: () => {
|
|
4119
4308
|
},
|
|
4120
4309
|
onSelectItem: () => {
|
|
@@ -4135,16 +4324,16 @@ var ObjectSearchProvider = ({
|
|
|
4135
4324
|
children,
|
|
4136
4325
|
defaultQuery
|
|
4137
4326
|
}) => {
|
|
4138
|
-
const [query, setQuery] = (0,
|
|
4327
|
+
const [query, setQuery] = (0, import_react48.useState)({
|
|
4139
4328
|
contentType: "",
|
|
4140
4329
|
keyword: "",
|
|
4141
4330
|
...defaultQuery
|
|
4142
4331
|
});
|
|
4143
4332
|
const { flatVariables } = useVariables(true);
|
|
4144
|
-
const querySearchDeferred = (0,
|
|
4145
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
4146
|
-
const [list, setList] = (0,
|
|
4147
|
-
const onSetQuery = (0,
|
|
4333
|
+
const querySearchDeferred = (0, import_react48.useDeferredValue)(query);
|
|
4334
|
+
const [selectedItems, setSelectedItems] = (0, import_react48.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4335
|
+
const [list, setList] = (0, import_react48.useState)({});
|
|
4336
|
+
const onSetQuery = (0, import_react48.useCallback)(
|
|
4148
4337
|
(value2) => {
|
|
4149
4338
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
4150
4339
|
return setQuery({
|
|
@@ -4156,7 +4345,7 @@ var ObjectSearchProvider = ({
|
|
|
4156
4345
|
},
|
|
4157
4346
|
[setQuery]
|
|
4158
4347
|
);
|
|
4159
|
-
const onSelectItem = (0,
|
|
4348
|
+
const onSelectItem = (0, import_react48.useCallback)(
|
|
4160
4349
|
(selectedResult) => {
|
|
4161
4350
|
if (Array.isArray(selectedResult)) {
|
|
4162
4351
|
setSelectedItems(selectedResult);
|
|
@@ -4170,17 +4359,17 @@ var ObjectSearchProvider = ({
|
|
|
4170
4359
|
},
|
|
4171
4360
|
[setSelectedItems, selectedItems]
|
|
4172
4361
|
);
|
|
4173
|
-
const onRemoveAllSelectedItems = (0,
|
|
4362
|
+
const onRemoveAllSelectedItems = (0, import_react48.useCallback)(() => {
|
|
4174
4363
|
setSelectedItems([]);
|
|
4175
4364
|
}, [setSelectedItems]);
|
|
4176
|
-
const onSetList = (0,
|
|
4365
|
+
const onSetList = (0, import_react48.useCallback)(
|
|
4177
4366
|
(value2) => {
|
|
4178
4367
|
setList(value2);
|
|
4179
4368
|
},
|
|
4180
4369
|
[setList]
|
|
4181
4370
|
);
|
|
4182
|
-
const boundQuery = (0,
|
|
4183
|
-
const value = (0,
|
|
4371
|
+
const boundQuery = (0, import_react48.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
4372
|
+
const value = (0, import_react48.useMemo)(
|
|
4184
4373
|
() => ({
|
|
4185
4374
|
boundQuery,
|
|
4186
4375
|
onSetQuery,
|
|
@@ -4204,10 +4393,10 @@ var ObjectSearchProvider = ({
|
|
|
4204
4393
|
onSetList
|
|
4205
4394
|
]
|
|
4206
4395
|
);
|
|
4207
|
-
return /* @__PURE__ */ (0,
|
|
4396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
4208
4397
|
};
|
|
4209
4398
|
function useObjectSearchContext() {
|
|
4210
|
-
return (0,
|
|
4399
|
+
return (0, import_react48.useContext)(ObjectSearchContext);
|
|
4211
4400
|
}
|
|
4212
4401
|
function bindQuery(query, inputs) {
|
|
4213
4402
|
const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
|
|
@@ -4222,12 +4411,12 @@ function bindQuery(query, inputs) {
|
|
|
4222
4411
|
}
|
|
4223
4412
|
|
|
4224
4413
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
4225
|
-
var
|
|
4414
|
+
var import_design_system23 = require("@uniformdev/design-system");
|
|
4226
4415
|
|
|
4227
4416
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
4228
|
-
var
|
|
4229
|
-
var
|
|
4230
|
-
var ObjectListItemContainer =
|
|
4417
|
+
var import_react49 = require("@emotion/react");
|
|
4418
|
+
var import_design_system22 = require("@uniformdev/design-system");
|
|
4419
|
+
var ObjectListItemContainer = import_react49.css`
|
|
4231
4420
|
align-items: center;
|
|
4232
4421
|
border: 1px solid var(--gray-300);
|
|
4233
4422
|
border-radius: var(--rounded-base);
|
|
@@ -4236,12 +4425,12 @@ var ObjectListItemContainer = import_react44.css`
|
|
|
4236
4425
|
grid-template-columns: 1fr auto;
|
|
4237
4426
|
padding: var(--spacing-sm);
|
|
4238
4427
|
`;
|
|
4239
|
-
var ObjectListItemContainerDisabled =
|
|
4428
|
+
var ObjectListItemContainerDisabled = import_react49.css`
|
|
4240
4429
|
opacity: var(--opacity-50);
|
|
4241
4430
|
pointer-events: none;
|
|
4242
4431
|
`;
|
|
4243
|
-
var ObjectListItemLoading =
|
|
4244
|
-
animation: ${
|
|
4432
|
+
var ObjectListItemLoading = import_react49.css`
|
|
4433
|
+
animation: ${import_design_system22.skeletonLoading} 1s linear infinite alternate;
|
|
4245
4434
|
border-color: transparent;
|
|
4246
4435
|
min-height: 42px;
|
|
4247
4436
|
position: relative;
|
|
@@ -4264,43 +4453,43 @@ var ObjectListItemLoading = import_react44.css`
|
|
|
4264
4453
|
width: 1rem;
|
|
4265
4454
|
}
|
|
4266
4455
|
`;
|
|
4267
|
-
var ObjectListItemHeadingGroup =
|
|
4456
|
+
var ObjectListItemHeadingGroup = import_react49.css`
|
|
4268
4457
|
align-items: center;
|
|
4269
4458
|
display: grid;
|
|
4270
4459
|
`;
|
|
4271
|
-
var ObjectListItemThumbnail =
|
|
4460
|
+
var ObjectListItemThumbnail = import_react49.css`
|
|
4272
4461
|
width: 30px;
|
|
4273
4462
|
height: 30px;
|
|
4274
4463
|
object-fit: cover;
|
|
4275
4464
|
`;
|
|
4276
|
-
var ObjectListItemTitle =
|
|
4465
|
+
var ObjectListItemTitle = import_react49.css`
|
|
4277
4466
|
color: var(--typography-base);
|
|
4278
4467
|
display: block;
|
|
4279
4468
|
font-size: var(--fs-sm);
|
|
4280
4469
|
`;
|
|
4281
|
-
var ObjectListItemSubtitle =
|
|
4470
|
+
var ObjectListItemSubtitle = import_react49.css`
|
|
4282
4471
|
color: var(--gray-500);
|
|
4283
4472
|
display: block;
|
|
4284
4473
|
font-size: var(--fs-xs);
|
|
4285
4474
|
line-height: 1;
|
|
4286
4475
|
`;
|
|
4287
|
-
var ObjectListItemInfoContainer =
|
|
4476
|
+
var ObjectListItemInfoContainer = import_react49.css`
|
|
4288
4477
|
align-items: center;
|
|
4289
4478
|
display: flex;
|
|
4290
4479
|
gap: var(--spacing-sm);
|
|
4291
4480
|
justify-content: center;
|
|
4292
4481
|
`;
|
|
4293
|
-
var ObjectListItemControlledContent =
|
|
4482
|
+
var ObjectListItemControlledContent = import_react49.css`
|
|
4294
4483
|
display: flex;
|
|
4295
4484
|
gap: var(--spacing-sm);
|
|
4296
4485
|
`;
|
|
4297
|
-
var ObjectListItemUnControlledContent =
|
|
4486
|
+
var ObjectListItemUnControlledContent = import_react49.css`
|
|
4298
4487
|
margin-top: var(--spacing-sm);
|
|
4299
4488
|
grid-column: 1 / -1;
|
|
4300
4489
|
`;
|
|
4301
4490
|
|
|
4302
4491
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
4303
|
-
var
|
|
4492
|
+
var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
|
|
4304
4493
|
var ObjectSearchListItem = ({
|
|
4305
4494
|
id,
|
|
4306
4495
|
title,
|
|
@@ -4325,7 +4514,7 @@ var ObjectSearchListItem = ({
|
|
|
4325
4514
|
return onSelectItem([selectedItem]);
|
|
4326
4515
|
};
|
|
4327
4516
|
const selected = selectedListItems.some((item) => item.id === id);
|
|
4328
|
-
return /* @__PURE__ */ (0,
|
|
4517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4329
4518
|
"div",
|
|
4330
4519
|
{
|
|
4331
4520
|
role: "listitem",
|
|
@@ -4333,7 +4522,7 @@ var ObjectSearchListItem = ({
|
|
|
4333
4522
|
"data-testid": "list-item",
|
|
4334
4523
|
...props,
|
|
4335
4524
|
children: [
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
4337
4526
|
"div",
|
|
4338
4527
|
{
|
|
4339
4528
|
role: "button",
|
|
@@ -4341,7 +4530,7 @@ var ObjectSearchListItem = ({
|
|
|
4341
4530
|
css: ObjectListItemControlledContent,
|
|
4342
4531
|
"aria-disabled": disabled,
|
|
4343
4532
|
children: [
|
|
4344
|
-
imageUrl ? /* @__PURE__ */ (0,
|
|
4533
|
+
imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4345
4534
|
"img",
|
|
4346
4535
|
{
|
|
4347
4536
|
src: imageUrl,
|
|
@@ -4350,28 +4539,28 @@ var ObjectSearchListItem = ({
|
|
|
4350
4539
|
loading: "lazy"
|
|
4351
4540
|
}
|
|
4352
4541
|
) : null,
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4354
|
-
!contentType ? null : /* @__PURE__ */ (0,
|
|
4355
|
-
/* @__PURE__ */ (0,
|
|
4542
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
4543
|
+
!contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
4544
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
4356
4545
|
] })
|
|
4357
4546
|
]
|
|
4358
4547
|
}
|
|
4359
4548
|
),
|
|
4360
|
-
/* @__PURE__ */ (0,
|
|
4361
|
-
selected ? /* @__PURE__ */ (0,
|
|
4362
|
-
!popoverData ? null : /* @__PURE__ */ (0,
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: ObjectListItemInfoContainer, children: [
|
|
4550
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system23.Chip, { text: "selected", size: "xs" }) : null,
|
|
4551
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system23.Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4363
4552
|
] }),
|
|
4364
|
-
!children ? null : /* @__PURE__ */ (0,
|
|
4553
|
+
!children ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { css: ObjectListItemUnControlledContent, children })
|
|
4365
4554
|
]
|
|
4366
4555
|
}
|
|
4367
4556
|
);
|
|
4368
4557
|
};
|
|
4369
4558
|
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
4370
|
-
return /* @__PURE__ */ (0,
|
|
4559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
4371
4560
|
};
|
|
4372
4561
|
|
|
4373
4562
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
4374
|
-
var
|
|
4563
|
+
var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
|
|
4375
4564
|
var ObjectSearchContainer = ({
|
|
4376
4565
|
label,
|
|
4377
4566
|
enableDynamicInputToResultId,
|
|
@@ -4383,19 +4572,19 @@ var ObjectSearchContainer = ({
|
|
|
4383
4572
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
4384
4573
|
const { flatVariables } = useVariables(true);
|
|
4385
4574
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
4386
|
-
const listItems = resultList != null ? resultList : /* @__PURE__ */ (0,
|
|
4387
|
-
|
|
4575
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4576
|
+
import_design_system24.ScrollableList,
|
|
4388
4577
|
{
|
|
4389
4578
|
role: "list",
|
|
4390
|
-
css:
|
|
4579
|
+
css: import_react50.css`
|
|
4391
4580
|
> div {
|
|
4392
4581
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
4393
4582
|
}
|
|
4394
4583
|
`,
|
|
4395
|
-
children: /* @__PURE__ */ (0,
|
|
4584
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DefaultResultList, {})
|
|
4396
4585
|
}
|
|
4397
4586
|
);
|
|
4398
|
-
const body = /* @__PURE__ */ (0,
|
|
4587
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system24.VerticalRhythm, { children: [
|
|
4399
4588
|
searchFilters,
|
|
4400
4589
|
listItems
|
|
4401
4590
|
] });
|
|
@@ -4426,8 +4615,8 @@ var ObjectSearchContainer = ({
|
|
|
4426
4615
|
}
|
|
4427
4616
|
]);
|
|
4428
4617
|
};
|
|
4429
|
-
return /* @__PURE__ */ (0,
|
|
4430
|
-
/* @__PURE__ */ (0,
|
|
4618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system24.VerticalRhythm, { children: [
|
|
4619
|
+
/* @__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)(
|
|
4431
4620
|
InputVariables,
|
|
4432
4621
|
{
|
|
4433
4622
|
label,
|
|
@@ -4449,21 +4638,21 @@ var DefaultResultList = () => {
|
|
|
4449
4638
|
var _a;
|
|
4450
4639
|
const { list } = useObjectSearchContext();
|
|
4451
4640
|
if (!list.items) {
|
|
4452
|
-
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0,
|
|
4641
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
4453
4642
|
}
|
|
4454
4643
|
if (list.items.length === 0) {
|
|
4455
|
-
return /* @__PURE__ */ (0,
|
|
4644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system24.Callout, { type: "info", children: "No results were found" });
|
|
4456
4645
|
}
|
|
4457
|
-
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0,
|
|
4646
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ObjectSearchListItem, { ...item }, item.id));
|
|
4458
4647
|
};
|
|
4459
4648
|
|
|
4460
4649
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4461
|
-
var
|
|
4462
|
-
var
|
|
4650
|
+
var import_design_system25 = require("@uniformdev/design-system");
|
|
4651
|
+
var import_react52 = require("react");
|
|
4463
4652
|
|
|
4464
4653
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
4465
|
-
var
|
|
4466
|
-
var ObjectSearchFilterContainerLabel =
|
|
4654
|
+
var import_react51 = require("@emotion/react");
|
|
4655
|
+
var ObjectSearchFilterContainerLabel = import_react51.css`
|
|
4467
4656
|
align-items: center;
|
|
4468
4657
|
display: flex;
|
|
4469
4658
|
font-size: var(--fs-sm);
|
|
@@ -4471,18 +4660,18 @@ var ObjectSearchFilterContainerLabel = import_react46.css`
|
|
|
4471
4660
|
line-height: 1rem;
|
|
4472
4661
|
margin-bottom: var(--spacing-sm);
|
|
4473
4662
|
`;
|
|
4474
|
-
var ObjectSearchFilterContainer =
|
|
4663
|
+
var ObjectSearchFilterContainer = import_react51.css`
|
|
4475
4664
|
display: grid;
|
|
4476
4665
|
gap: var(--spacing-base);
|
|
4477
4666
|
`;
|
|
4478
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
4667
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react51.css`
|
|
4479
4668
|
display: grid;
|
|
4480
4669
|
grid-template-columns: ${gridColumns};
|
|
4481
4670
|
gap: var(--spacing-base);
|
|
4482
4671
|
`;
|
|
4483
4672
|
|
|
4484
4673
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
4485
|
-
var
|
|
4674
|
+
var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
|
|
4486
4675
|
var ObjectSearchFilter = ({
|
|
4487
4676
|
requireContentType,
|
|
4488
4677
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -4493,7 +4682,7 @@ var ObjectSearchFilter = ({
|
|
|
4493
4682
|
}) => {
|
|
4494
4683
|
var _a, _b;
|
|
4495
4684
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4496
|
-
const [searchState, setSearchState] = (0,
|
|
4685
|
+
const [searchState, setSearchState] = (0, import_react52.useState)({
|
|
4497
4686
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4498
4687
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
4499
4688
|
});
|
|
@@ -4503,7 +4692,7 @@ var ObjectSearchFilter = ({
|
|
|
4503
4692
|
});
|
|
4504
4693
|
onSetQuery({ ...query, ...value });
|
|
4505
4694
|
};
|
|
4506
|
-
const memoizedSelectOptions = (0,
|
|
4695
|
+
const memoizedSelectOptions = (0, import_react52.useMemo)(() => {
|
|
4507
4696
|
if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
|
|
4508
4697
|
return [];
|
|
4509
4698
|
}
|
|
@@ -4513,7 +4702,7 @@ var ObjectSearchFilter = ({
|
|
|
4513
4702
|
];
|
|
4514
4703
|
}, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
|
|
4515
4704
|
const shouldRenderSelect = memoizedSelectOptions.length > 0;
|
|
4516
|
-
return /* @__PURE__ */ (0,
|
|
4705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
4517
4706
|
"fieldset",
|
|
4518
4707
|
{
|
|
4519
4708
|
css: [
|
|
@@ -4521,8 +4710,8 @@ var ObjectSearchFilter = ({
|
|
|
4521
4710
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
4522
4711
|
],
|
|
4523
4712
|
children: [
|
|
4524
|
-
memoizedSelectOptions.length ? /* @__PURE__ */ (0,
|
|
4525
|
-
|
|
4713
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4714
|
+
import_design_system25.InputSelect,
|
|
4526
4715
|
{
|
|
4527
4716
|
label: selectLabel,
|
|
4528
4717
|
showLabel: false,
|
|
@@ -4531,8 +4720,8 @@ var ObjectSearchFilter = ({
|
|
|
4531
4720
|
value: query.contentType
|
|
4532
4721
|
}
|
|
4533
4722
|
) : null,
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4535
|
-
|
|
4723
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4724
|
+
import_design_system25.DebouncedInputKeywordSearch,
|
|
4536
4725
|
{
|
|
4537
4726
|
inputFieldName: searchInputName,
|
|
4538
4727
|
placeholder: searchInputPlaceholderText,
|
|
@@ -4548,27 +4737,27 @@ var ObjectSearchFilter = ({
|
|
|
4548
4737
|
};
|
|
4549
4738
|
|
|
4550
4739
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
4551
|
-
var
|
|
4740
|
+
var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
|
|
4552
4741
|
var ObjectSearchFilterContainer2 = ({ children }) => {
|
|
4553
|
-
return /* @__PURE__ */ (0,
|
|
4742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { css: ObjectSearchFilterContainer, children }) });
|
|
4554
4743
|
};
|
|
4555
4744
|
|
|
4556
4745
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4557
|
-
var
|
|
4746
|
+
var import_design_system27 = require("@uniformdev/design-system");
|
|
4558
4747
|
var import_timeago = require("timeago.js");
|
|
4559
4748
|
|
|
4560
4749
|
// src/components/Image/Image.tsx
|
|
4561
|
-
var
|
|
4750
|
+
var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
|
|
4562
4751
|
function Image({ src, alt, className }) {
|
|
4563
4752
|
const CompImage = src && typeof src !== "string" ? src : null;
|
|
4564
|
-
return CompImage ? /* @__PURE__ */ (0,
|
|
4753
|
+
return CompImage ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CompImage, { className }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src, alt, className });
|
|
4565
4754
|
}
|
|
4566
4755
|
|
|
4567
4756
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
4568
|
-
var
|
|
4569
|
-
var
|
|
4570
|
-
var ButtonStyles =
|
|
4571
|
-
${
|
|
4757
|
+
var import_react53 = require("@emotion/react");
|
|
4758
|
+
var import_design_system26 = require("@uniformdev/design-system");
|
|
4759
|
+
var ButtonStyles = import_react53.css`
|
|
4760
|
+
${import_design_system26.button}
|
|
4572
4761
|
background: transparent;
|
|
4573
4762
|
border: 1px solid var(--typography-base);
|
|
4574
4763
|
color: var(--typography-base);
|
|
@@ -4595,20 +4784,20 @@ var ButtonStyles = import_react48.css`
|
|
|
4595
4784
|
text-decoration: none;
|
|
4596
4785
|
}
|
|
4597
4786
|
`;
|
|
4598
|
-
var ButtonIcon =
|
|
4787
|
+
var ButtonIcon = import_react53.css`
|
|
4599
4788
|
width: 1rem;
|
|
4600
4789
|
height: 1rem;
|
|
4601
4790
|
`;
|
|
4602
4791
|
|
|
4603
4792
|
// src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
|
|
4604
|
-
var
|
|
4793
|
+
var import_jsx_runtime55 = require("@emotion/react/jsx-runtime");
|
|
4605
4794
|
var ObjectSearchResultItemButton = ({
|
|
4606
4795
|
text,
|
|
4607
4796
|
icon,
|
|
4608
4797
|
...props
|
|
4609
4798
|
}) => {
|
|
4610
|
-
return /* @__PURE__ */ (0,
|
|
4611
|
-
!icon ? null : /* @__PURE__ */ (0,
|
|
4799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4800
|
+
!icon ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Image, { src: icon, css: ButtonIcon }),
|
|
4612
4801
|
text
|
|
4613
4802
|
] });
|
|
4614
4803
|
};
|
|
@@ -4617,15 +4806,15 @@ var LinkButton = ({
|
|
|
4617
4806
|
icon,
|
|
4618
4807
|
...props
|
|
4619
4808
|
}) => {
|
|
4620
|
-
return /* @__PURE__ */ (0,
|
|
4621
|
-
!icon ? null : /* @__PURE__ */ (0,
|
|
4809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4810
|
+
!icon ? null : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Image, { src: icon, css: ButtonIcon }),
|
|
4622
4811
|
text
|
|
4623
4812
|
] });
|
|
4624
4813
|
};
|
|
4625
4814
|
|
|
4626
4815
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
4627
|
-
var
|
|
4628
|
-
var ObjectSearchResultItemContainer =
|
|
4816
|
+
var import_react54 = require("@emotion/react");
|
|
4817
|
+
var ObjectSearchResultItemContainer = import_react54.css`
|
|
4629
4818
|
align-items: center;
|
|
4630
4819
|
border: 1px solid var(--gray-300);
|
|
4631
4820
|
border-radius: var(--rounded-base);
|
|
@@ -4641,7 +4830,7 @@ var ObjectSearchResultItemContainer = import_react49.css`
|
|
|
4641
4830
|
}
|
|
4642
4831
|
}
|
|
4643
4832
|
`;
|
|
4644
|
-
var ObjectSearchDragHandle =
|
|
4833
|
+
var ObjectSearchDragHandle = import_react54.css`
|
|
4645
4834
|
border-left: 2px dotted var(--gray-300);
|
|
4646
4835
|
border-right: 2px dotted var(--gray-300);
|
|
4647
4836
|
position: absolute;
|
|
@@ -4650,47 +4839,47 @@ var ObjectSearchDragHandle = import_react49.css`
|
|
|
4650
4839
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4651
4840
|
opacity: 0;
|
|
4652
4841
|
`;
|
|
4653
|
-
var ObjectSearchResultItemSubtitle =
|
|
4842
|
+
var ObjectSearchResultItemSubtitle = import_react54.css`
|
|
4654
4843
|
color: var(--gray-500);
|
|
4655
4844
|
display: block;
|
|
4656
4845
|
font-size: var(--fs-xs);
|
|
4657
4846
|
line-height: 1;
|
|
4658
4847
|
`;
|
|
4659
|
-
var ObjectSearchResultItemTitle =
|
|
4848
|
+
var ObjectSearchResultItemTitle = import_react54.css`
|
|
4660
4849
|
align-items: center;
|
|
4661
4850
|
color: var(--typography-base);
|
|
4662
4851
|
display: flex;
|
|
4663
4852
|
gap: var(--spacing-xs);
|
|
4664
4853
|
`;
|
|
4665
|
-
var ObjectSearchResultItemTimeStamp =
|
|
4854
|
+
var ObjectSearchResultItemTimeStamp = import_react54.css`
|
|
4666
4855
|
color: var(--gray-500);
|
|
4667
4856
|
font-size: var(--fs-xs);
|
|
4668
4857
|
`;
|
|
4669
|
-
var ObjectSearchResultItemTitleLink =
|
|
4858
|
+
var ObjectSearchResultItemTitleLink = import_react54.css`
|
|
4670
4859
|
text-decoration: none;
|
|
4671
4860
|
color: var(--primary-action-default);
|
|
4672
4861
|
font-size: var(--fs-sm);
|
|
4673
4862
|
`;
|
|
4674
|
-
var ObjectSearchAuthorStateGroup =
|
|
4863
|
+
var ObjectSearchAuthorStateGroup = import_react54.css`
|
|
4675
4864
|
align-items: center;
|
|
4676
4865
|
display: flex;
|
|
4677
4866
|
gap: var(--spacing-sm);
|
|
4678
4867
|
`;
|
|
4679
|
-
var ObjectSearchUpdateGroup =
|
|
4868
|
+
var ObjectSearchUpdateGroup = import_react54.css`
|
|
4680
4869
|
display: grid;
|
|
4681
4870
|
`;
|
|
4682
|
-
var ObjectSearchContentContainer =
|
|
4871
|
+
var ObjectSearchContentContainer = import_react54.css`
|
|
4683
4872
|
display: flex;
|
|
4684
4873
|
gap: var(--spacing-base);
|
|
4685
4874
|
`;
|
|
4686
|
-
var ObjectSearchImage =
|
|
4875
|
+
var ObjectSearchImage = import_react54.css`
|
|
4687
4876
|
width: 56px;
|
|
4688
4877
|
height: 56px;
|
|
4689
4878
|
object-fit: cover;
|
|
4690
4879
|
`;
|
|
4691
4880
|
|
|
4692
4881
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4693
|
-
var
|
|
4882
|
+
var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
|
|
4694
4883
|
var ObjectSearchResultItem = ({
|
|
4695
4884
|
id,
|
|
4696
4885
|
title,
|
|
@@ -4714,10 +4903,10 @@ var ObjectSearchResultItem = ({
|
|
|
4714
4903
|
onSelectItem({ id, title: id });
|
|
4715
4904
|
onRemove == null ? void 0 : onRemove();
|
|
4716
4905
|
};
|
|
4717
|
-
return /* @__PURE__ */ (0,
|
|
4718
|
-
disableDnD ? null : /* @__PURE__ */ (0,
|
|
4719
|
-
/* @__PURE__ */ (0,
|
|
4720
|
-
!imageUrl ? null : /* @__PURE__ */ (0,
|
|
4906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
|
|
4907
|
+
disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
|
|
4908
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchContentContainer, children: [
|
|
4909
|
+
!imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4721
4910
|
"img",
|
|
4722
4911
|
{
|
|
4723
4912
|
src: imageUrl,
|
|
@@ -4726,11 +4915,11 @@ var ObjectSearchResultItem = ({
|
|
|
4726
4915
|
loading: "lazy"
|
|
4727
4916
|
}
|
|
4728
4917
|
),
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4730
|
-
/* @__PURE__ */ (0,
|
|
4731
|
-
/* @__PURE__ */ (0,
|
|
4732
|
-
onClick ? /* @__PURE__ */ (0,
|
|
4733
|
-
|
|
4918
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
4919
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4920
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4921
|
+
onClick ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4922
|
+
import_design_system27.Link,
|
|
4734
4923
|
{
|
|
4735
4924
|
onClick: (e) => {
|
|
4736
4925
|
e.preventDefault();
|
|
@@ -4741,28 +4930,28 @@ var ObjectSearchResultItem = ({
|
|
|
4741
4930
|
text: title != null ? title : name,
|
|
4742
4931
|
css: ObjectSearchResultItemTitleLink
|
|
4743
4932
|
}
|
|
4744
|
-
) : /* @__PURE__ */ (0,
|
|
4745
|
-
!popoverData ? null : /* @__PURE__ */ (0,
|
|
4933
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: title != null ? title : name }),
|
|
4934
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system27.Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4746
4935
|
] }),
|
|
4747
|
-
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0,
|
|
4748
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0,
|
|
4749
|
-
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0,
|
|
4750
|
-
!createdAt ? null : /* @__PURE__ */ (0,
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
4936
|
+
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4937
|
+
!(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" }),
|
|
4938
|
+
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
|
|
4939
|
+
!createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4940
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("strong", { children: "Last updated: " }),
|
|
4752
4941
|
(0, import_timeago.format)(createdAt)
|
|
4753
4942
|
] }),
|
|
4754
|
-
!publishedAt ? null : /* @__PURE__ */ (0,
|
|
4755
|
-
/* @__PURE__ */ (0,
|
|
4943
|
+
!publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
4944
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("strong", { children: "Last published: " }),
|
|
4756
4945
|
(0, import_timeago.format)(publishedAt)
|
|
4757
4946
|
] })
|
|
4758
4947
|
] })
|
|
4759
4948
|
] }),
|
|
4760
|
-
/* @__PURE__ */ (0,
|
|
4949
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children })
|
|
4761
4950
|
] })
|
|
4762
4951
|
] }) }),
|
|
4763
|
-
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0,
|
|
4764
|
-
!editLink ? null : /* @__PURE__ */ (0,
|
|
4765
|
-
hideRemoveButton ? null : /* @__PURE__ */ (0,
|
|
4952
|
+
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
4953
|
+
!editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4954
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system27.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4766
4955
|
] })
|
|
4767
4956
|
] });
|
|
4768
4957
|
};
|
|
@@ -4783,35 +4972,35 @@ function legacyThemeMapper(theme) {
|
|
|
4783
4972
|
|
|
4784
4973
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4785
4974
|
var import_dnd3 = require("@hello-pangea/dnd");
|
|
4786
|
-
var
|
|
4975
|
+
var import_design_system28 = require("@uniformdev/design-system");
|
|
4787
4976
|
|
|
4788
4977
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
4789
|
-
var
|
|
4790
|
-
var ObjectSearchResultListContainer =
|
|
4978
|
+
var import_react55 = require("@emotion/react");
|
|
4979
|
+
var ObjectSearchResultListContainer = import_react55.css`
|
|
4791
4980
|
align-items: center;
|
|
4792
4981
|
display: flex;
|
|
4793
4982
|
gap: var(--spacing-sm);
|
|
4794
4983
|
justify-content: space-between;
|
|
4795
4984
|
`;
|
|
4796
|
-
var ObjectSearchDragContainer =
|
|
4985
|
+
var ObjectSearchDragContainer = import_react55.css`
|
|
4797
4986
|
margin: 0 0 var(--spacing-sm);
|
|
4798
4987
|
`;
|
|
4799
|
-
var ObjectSearchContainerDragging =
|
|
4988
|
+
var ObjectSearchContainerDragging = import_react55.css`
|
|
4800
4989
|
box-shadow: var(--shadow-base);
|
|
4801
4990
|
opacity: var(--opacity-50);
|
|
4802
4991
|
`;
|
|
4803
|
-
var ObjectSearchResultListCounterContainer =
|
|
4992
|
+
var ObjectSearchResultListCounterContainer = import_react55.css`
|
|
4804
4993
|
align-items: center;
|
|
4805
4994
|
display: flex;
|
|
4806
4995
|
gap: var(--spacing-sm);
|
|
4807
4996
|
`;
|
|
4808
|
-
var ObjectSearchResultListTitle =
|
|
4997
|
+
var ObjectSearchResultListTitle = import_react55.css`
|
|
4809
4998
|
font-weight: var(--fw-bold);
|
|
4810
4999
|
line-height: 1;
|
|
4811
5000
|
`;
|
|
4812
5001
|
|
|
4813
5002
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
4814
|
-
var
|
|
5003
|
+
var import_jsx_runtime57 = require("@emotion/react/jsx-runtime");
|
|
4815
5004
|
var DroppableHack2 = import_dnd3.Droppable;
|
|
4816
5005
|
var DraggableHack2 = import_dnd3.Draggable;
|
|
4817
5006
|
function ObjectSearchResultList({
|
|
@@ -4821,7 +5010,7 @@ function ObjectSearchResultList({
|
|
|
4821
5010
|
hideRemoveButton = false,
|
|
4822
5011
|
resultLabelOverride,
|
|
4823
5012
|
additionalButtons,
|
|
4824
|
-
renderResultComponent = (value) => /* @__PURE__ */ (0,
|
|
5013
|
+
renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ObjectSearchResultItem, { ...value }),
|
|
4825
5014
|
multiSelectId,
|
|
4826
5015
|
disableDnD = false,
|
|
4827
5016
|
getContainerForDnDReparenting,
|
|
@@ -4848,7 +5037,7 @@ function ObjectSearchResultList({
|
|
|
4848
5037
|
...item,
|
|
4849
5038
|
disableDnD: selectedListItems.length === 1 || disableDnD
|
|
4850
5039
|
});
|
|
4851
|
-
return /* @__PURE__ */ (0,
|
|
5040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4852
5041
|
"div",
|
|
4853
5042
|
{
|
|
4854
5043
|
css: [
|
|
@@ -4863,17 +5052,17 @@ function ObjectSearchResultList({
|
|
|
4863
5052
|
}
|
|
4864
5053
|
);
|
|
4865
5054
|
};
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
!resultLabelOverride ? /* @__PURE__ */ (0,
|
|
4869
|
-
/* @__PURE__ */ (0,
|
|
5055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
5057
|
+
!resultLabelOverride ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
5058
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
4870
5059
|
" ",
|
|
4871
|
-
!selectedListItems.length ? null : /* @__PURE__ */ (0,
|
|
5060
|
+
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_design_system28.Counter, { count: selectedListItems.length })
|
|
4872
5061
|
] }) : resultLabelOverride,
|
|
4873
|
-
/* @__PURE__ */ (0,
|
|
5062
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
4874
5063
|
additionalButtons,
|
|
4875
|
-
hideRemoveButton ? null : /* @__PURE__ */ (0,
|
|
4876
|
-
|
|
5064
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5065
|
+
import_design_system28.Button,
|
|
4877
5066
|
{
|
|
4878
5067
|
buttonType: "ghostDestructive",
|
|
4879
5068
|
size: "xs",
|
|
@@ -4884,15 +5073,15 @@ function ObjectSearchResultList({
|
|
|
4884
5073
|
)
|
|
4885
5074
|
] })
|
|
4886
5075
|
] }),
|
|
4887
|
-
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0,
|
|
5076
|
+
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4888
5077
|
DroppableHack2,
|
|
4889
5078
|
{
|
|
4890
5079
|
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
4891
5080
|
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
4892
5081
|
getContainerForClone: getContainerForDnDReparenting,
|
|
4893
|
-
children: (provided) => /* @__PURE__ */ (0,
|
|
5082
|
+
children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4894
5083
|
selectedListItems.map((item, i) => {
|
|
4895
|
-
return /* @__PURE__ */ (0,
|
|
5084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4896
5085
|
DraggableHack2,
|
|
4897
5086
|
{
|
|
4898
5087
|
draggableId: item.id,
|
|
@@ -4911,9 +5100,9 @@ function ObjectSearchResultList({
|
|
|
4911
5100
|
}
|
|
4912
5101
|
|
|
4913
5102
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
4914
|
-
var
|
|
4915
|
-
var
|
|
4916
|
-
var
|
|
5103
|
+
var import_design_system29 = require("@uniformdev/design-system");
|
|
5104
|
+
var import_react56 = require("react");
|
|
5105
|
+
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
4917
5106
|
var QueryFilter = ({
|
|
4918
5107
|
requireContentType,
|
|
4919
5108
|
queryFilterTitle = "Configure Query",
|
|
@@ -4941,7 +5130,7 @@ var QueryFilter = ({
|
|
|
4941
5130
|
}) => {
|
|
4942
5131
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4943
5132
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
4944
|
-
const [queryState, setQueryState] = (0,
|
|
5133
|
+
const [queryState, setQueryState] = (0, import_react56.useState)({
|
|
4945
5134
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
4946
5135
|
keyword: (_b = query.keyword) != null ? _b : "",
|
|
4947
5136
|
count: (_c = query.count) != null ? _c : 5,
|
|
@@ -4952,13 +5141,13 @@ var QueryFilter = ({
|
|
|
4952
5141
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4953
5142
|
onSetQuery({ ...query, ...value });
|
|
4954
5143
|
};
|
|
4955
|
-
(0,
|
|
5144
|
+
(0, import_react56.useEffect)(() => {
|
|
4956
5145
|
onSetQuery(queryState);
|
|
4957
5146
|
}, []);
|
|
4958
|
-
return /* @__PURE__ */ (0,
|
|
4959
|
-
/* @__PURE__ */ (0,
|
|
4960
|
-
/* @__PURE__ */ (0,
|
|
4961
|
-
/* @__PURE__ */ (0,
|
|
5147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("fieldset", { children: [
|
|
5148
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
5149
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_design_system29.VerticalRhythm, { children: [
|
|
5150
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4962
5151
|
InputVariables,
|
|
4963
5152
|
{
|
|
4964
5153
|
label: searchInputLabel,
|
|
@@ -4966,8 +5155,8 @@ var QueryFilter = ({
|
|
|
4966
5155
|
onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
|
|
4967
5156
|
disableInlineMenu: true,
|
|
4968
5157
|
id: "qf_searchText",
|
|
4969
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
4970
|
-
|
|
5158
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5159
|
+
import_design_system29.DebouncedInputKeywordSearch,
|
|
4971
5160
|
{
|
|
4972
5161
|
id: "qf_searchText",
|
|
4973
5162
|
inputFieldName: searchInputName,
|
|
@@ -4980,8 +5169,8 @@ var QueryFilter = ({
|
|
|
4980
5169
|
)
|
|
4981
5170
|
}
|
|
4982
5171
|
),
|
|
4983
|
-
/* @__PURE__ */ (0,
|
|
4984
|
-
/* @__PURE__ */ (0,
|
|
5172
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4985
5174
|
InputVariables,
|
|
4986
5175
|
{
|
|
4987
5176
|
label: contentTypeLabel,
|
|
@@ -4989,8 +5178,8 @@ var QueryFilter = ({
|
|
|
4989
5178
|
value: (_g = queryState.contentType) != null ? _g : "",
|
|
4990
5179
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
4991
5180
|
disableInlineMenu: true,
|
|
4992
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
4993
|
-
|
|
5181
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5182
|
+
import_design_system29.InputSelect,
|
|
4994
5183
|
{
|
|
4995
5184
|
id: "qf_contentType",
|
|
4996
5185
|
label: contentTypeLabel,
|
|
@@ -5003,7 +5192,7 @@ var QueryFilter = ({
|
|
|
5003
5192
|
)
|
|
5004
5193
|
}
|
|
5005
5194
|
),
|
|
5006
|
-
/* @__PURE__ */ (0,
|
|
5195
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5007
5196
|
InputVariables,
|
|
5008
5197
|
{
|
|
5009
5198
|
label: countLabel,
|
|
@@ -5012,8 +5201,8 @@ var QueryFilter = ({
|
|
|
5012
5201
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
5013
5202
|
disableInlineMenu: true,
|
|
5014
5203
|
valueToResetTo: "5",
|
|
5015
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
5016
|
-
|
|
5204
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5205
|
+
import_design_system29.Input,
|
|
5017
5206
|
{
|
|
5018
5207
|
id: "qf_count",
|
|
5019
5208
|
label: countLabel,
|
|
@@ -5027,8 +5216,8 @@ var QueryFilter = ({
|
|
|
5027
5216
|
}
|
|
5028
5217
|
)
|
|
5029
5218
|
] }),
|
|
5030
|
-
/* @__PURE__ */ (0,
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
5219
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
|
|
5220
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5032
5221
|
InputVariables,
|
|
5033
5222
|
{
|
|
5034
5223
|
id: "qf_sortBy",
|
|
@@ -5036,8 +5225,8 @@ var QueryFilter = ({
|
|
|
5036
5225
|
value: queryState.sortBy,
|
|
5037
5226
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
5038
5227
|
disableInlineMenu: true,
|
|
5039
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
5040
|
-
|
|
5228
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5229
|
+
import_design_system29.InputSelect,
|
|
5041
5230
|
{
|
|
5042
5231
|
label: sortLabel,
|
|
5043
5232
|
id: "qf_sortBy",
|
|
@@ -5050,7 +5239,7 @@ var QueryFilter = ({
|
|
|
5050
5239
|
)
|
|
5051
5240
|
}
|
|
5052
5241
|
),
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5242
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5054
5243
|
InputVariables,
|
|
5055
5244
|
{
|
|
5056
5245
|
label: sortOrderLabel,
|
|
@@ -5058,8 +5247,8 @@ var QueryFilter = ({
|
|
|
5058
5247
|
value: queryState.sortOrder,
|
|
5059
5248
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
5060
5249
|
disableInlineMenu: true,
|
|
5061
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
5062
|
-
|
|
5250
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5251
|
+
import_design_system29.InputSelect,
|
|
5063
5252
|
{
|
|
5064
5253
|
label: sortOrderLabel,
|
|
5065
5254
|
id: "qf_sortOrder",
|
|
@@ -5078,8 +5267,8 @@ var QueryFilter = ({
|
|
|
5078
5267
|
};
|
|
5079
5268
|
|
|
5080
5269
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
5081
|
-
var
|
|
5082
|
-
var
|
|
5270
|
+
var import_react57 = require("react");
|
|
5271
|
+
var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
|
|
5083
5272
|
function ParamTypeDynamicDataProvider(props) {
|
|
5084
5273
|
const { children } = props;
|
|
5085
5274
|
const {
|
|
@@ -5087,11 +5276,11 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
5087
5276
|
} = useMeshLocation("paramType");
|
|
5088
5277
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5089
5278
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
5090
|
-
const variables = (0,
|
|
5279
|
+
const variables = (0, import_react57.useMemo)(
|
|
5091
5280
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
5092
5281
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
5093
5282
|
);
|
|
5094
|
-
return /* @__PURE__ */ (0,
|
|
5283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(VariablesProvider, { value: variables, onChange: () => {
|
|
5095
5284
|
}, editVariableComponent: JsonMeshVariableEditor, children });
|
|
5096
5285
|
}
|
|
5097
5286
|
var JsonMeshVariableEditor = ({
|
|
@@ -5100,9 +5289,9 @@ var JsonMeshVariableEditor = ({
|
|
|
5100
5289
|
variable,
|
|
5101
5290
|
context
|
|
5102
5291
|
}) => {
|
|
5103
|
-
const sillyRef = (0,
|
|
5292
|
+
const sillyRef = (0, import_react57.useRef)(false);
|
|
5104
5293
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
5105
|
-
(0,
|
|
5294
|
+
(0, import_react57.useEffect)(() => {
|
|
5106
5295
|
if (sillyRef.current) {
|
|
5107
5296
|
return;
|
|
5108
5297
|
}
|
|
@@ -5571,10 +5760,10 @@ var MULTI_SELECT_OPERATORS = [
|
|
|
5571
5760
|
];
|
|
5572
5761
|
|
|
5573
5762
|
// src/components/SearchAndFilter/editors/DateEditor.tsx
|
|
5574
|
-
var
|
|
5575
|
-
var
|
|
5763
|
+
var import_design_system30 = require("@uniformdev/design-system");
|
|
5764
|
+
var import_react58 = require("react");
|
|
5576
5765
|
var import_react_use2 = require("react-use");
|
|
5577
|
-
var
|
|
5766
|
+
var import_jsx_runtime60 = require("@emotion/react/jsx-runtime");
|
|
5578
5767
|
var DateEditor = ({
|
|
5579
5768
|
onChange,
|
|
5580
5769
|
ariaLabel,
|
|
@@ -5583,10 +5772,10 @@ var DateEditor = ({
|
|
|
5583
5772
|
readOnly,
|
|
5584
5773
|
valueTestId
|
|
5585
5774
|
}) => {
|
|
5586
|
-
const [innerValue, setInnerValue] = (0,
|
|
5775
|
+
const [innerValue, setInnerValue] = (0, import_react58.useState)(value != null ? value : "");
|
|
5587
5776
|
(0, import_react_use2.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
5588
|
-
return /* @__PURE__ */ (0,
|
|
5589
|
-
|
|
5777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5778
|
+
import_design_system30.Input,
|
|
5590
5779
|
{
|
|
5591
5780
|
type: "date",
|
|
5592
5781
|
label: ariaLabel,
|
|
@@ -5601,22 +5790,22 @@ var DateEditor = ({
|
|
|
5601
5790
|
};
|
|
5602
5791
|
|
|
5603
5792
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5604
|
-
var
|
|
5605
|
-
var
|
|
5793
|
+
var import_design_system32 = require("@uniformdev/design-system");
|
|
5794
|
+
var import_react59 = require("react");
|
|
5606
5795
|
var import_react_use3 = require("react-use");
|
|
5607
5796
|
|
|
5608
5797
|
// src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
|
|
5609
|
-
var
|
|
5610
|
-
var
|
|
5798
|
+
var import_design_system31 = require("@uniformdev/design-system");
|
|
5799
|
+
var import_jsx_runtime61 = require("@emotion/react/jsx-runtime");
|
|
5611
5800
|
var ErrorContainer = ({ errorMessage }) => {
|
|
5612
|
-
return /* @__PURE__ */ (0,
|
|
5801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5613
5802
|
"div",
|
|
5614
5803
|
{
|
|
5615
5804
|
css: {
|
|
5616
5805
|
gridColumn: "span 6",
|
|
5617
5806
|
order: 6
|
|
5618
5807
|
},
|
|
5619
|
-
children: /* @__PURE__ */ (0,
|
|
5808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system31.FieldMessage, { errorMessage })
|
|
5620
5809
|
}
|
|
5621
5810
|
);
|
|
5622
5811
|
};
|
|
@@ -5629,7 +5818,7 @@ var twoColumnGrid = {
|
|
|
5629
5818
|
};
|
|
5630
5819
|
|
|
5631
5820
|
// src/components/SearchAndFilter/editors/DateRangeEditor.tsx
|
|
5632
|
-
var
|
|
5821
|
+
var import_jsx_runtime62 = require("@emotion/react/jsx-runtime");
|
|
5633
5822
|
var DateRangeEditor = ({
|
|
5634
5823
|
ariaLabel,
|
|
5635
5824
|
onChange,
|
|
@@ -5638,9 +5827,9 @@ var DateRangeEditor = ({
|
|
|
5638
5827
|
readOnly,
|
|
5639
5828
|
valueTestId
|
|
5640
5829
|
}) => {
|
|
5641
|
-
const [minDateValue, setMinDateValue] = (0,
|
|
5642
|
-
const [maxDateValue, setMaxDateValue] = (0,
|
|
5643
|
-
const [error, setError] = (0,
|
|
5830
|
+
const [minDateValue, setMinDateValue] = (0, import_react59.useState)(value ? value[0] : "");
|
|
5831
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react59.useState)(value ? value[1] : "");
|
|
5832
|
+
const [error, setError] = (0, import_react59.useState)("");
|
|
5644
5833
|
(0, import_react_use3.useDebounce)(
|
|
5645
5834
|
() => {
|
|
5646
5835
|
if (minDateValue && maxDateValue && !error) {
|
|
@@ -5652,7 +5841,7 @@ var DateRangeEditor = ({
|
|
|
5652
5841
|
500,
|
|
5653
5842
|
[minDateValue, maxDateValue]
|
|
5654
5843
|
);
|
|
5655
|
-
(0,
|
|
5844
|
+
(0, import_react59.useEffect)(() => {
|
|
5656
5845
|
if (!minDateValue || !maxDateValue) {
|
|
5657
5846
|
return;
|
|
5658
5847
|
}
|
|
@@ -5687,10 +5876,10 @@ var DateRangeEditor = ({
|
|
|
5687
5876
|
setMaxDateValue("");
|
|
5688
5877
|
}
|
|
5689
5878
|
}, [minDateValue, maxDateValue, setError]);
|
|
5690
|
-
return /* @__PURE__ */ (0,
|
|
5691
|
-
/* @__PURE__ */ (0,
|
|
5692
|
-
/* @__PURE__ */ (0,
|
|
5693
|
-
|
|
5879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
5880
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
5881
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5882
|
+
import_design_system32.Input,
|
|
5694
5883
|
{
|
|
5695
5884
|
label: `${ariaLabel}-min-date`,
|
|
5696
5885
|
type: "date",
|
|
@@ -5703,8 +5892,8 @@ var DateRangeEditor = ({
|
|
|
5703
5892
|
"data-testid": "value-low"
|
|
5704
5893
|
}
|
|
5705
5894
|
),
|
|
5706
|
-
/* @__PURE__ */ (0,
|
|
5707
|
-
|
|
5895
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5896
|
+
import_design_system32.Input,
|
|
5708
5897
|
{
|
|
5709
5898
|
label: `${ariaLabel}-max-date`,
|
|
5710
5899
|
type: "date",
|
|
@@ -5718,13 +5907,13 @@ var DateRangeEditor = ({
|
|
|
5718
5907
|
}
|
|
5719
5908
|
)
|
|
5720
5909
|
] }),
|
|
5721
|
-
/* @__PURE__ */ (0,
|
|
5910
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ErrorContainer, { errorMessage: error })
|
|
5722
5911
|
] });
|
|
5723
5912
|
};
|
|
5724
5913
|
|
|
5725
5914
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5726
|
-
var
|
|
5727
|
-
var
|
|
5915
|
+
var import_design_system33 = require("@uniformdev/design-system");
|
|
5916
|
+
var import_react60 = require("react");
|
|
5728
5917
|
|
|
5729
5918
|
// src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
|
|
5730
5919
|
var readOnlyAttributes = {
|
|
@@ -5734,7 +5923,7 @@ var readOnlyAttributes = {
|
|
|
5734
5923
|
};
|
|
5735
5924
|
|
|
5736
5925
|
// src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
|
|
5737
|
-
var
|
|
5926
|
+
var import_jsx_runtime63 = require("@emotion/react/jsx-runtime");
|
|
5738
5927
|
var FilterMultiChoiceEditor = ({
|
|
5739
5928
|
value,
|
|
5740
5929
|
options,
|
|
@@ -5745,12 +5934,12 @@ var FilterMultiChoiceEditor = ({
|
|
|
5745
5934
|
}) => {
|
|
5746
5935
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5747
5936
|
const isClearable = !readOnly || !disabled;
|
|
5748
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5749
|
-
() => (0,
|
|
5937
|
+
const { groupedOptions, selectedOptions } = (0, import_react60.useMemo)(
|
|
5938
|
+
() => (0, import_design_system33.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5750
5939
|
[options, value]
|
|
5751
5940
|
);
|
|
5752
|
-
return /* @__PURE__ */ (0,
|
|
5753
|
-
|
|
5941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5942
|
+
import_design_system33.InputComboBox,
|
|
5754
5943
|
{
|
|
5755
5944
|
...props,
|
|
5756
5945
|
placeholder: "Type to search...",
|
|
@@ -5759,7 +5948,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
5759
5948
|
isClearable,
|
|
5760
5949
|
isDisabled: disabled,
|
|
5761
5950
|
onChange: (e) => {
|
|
5762
|
-
const selectedValues = (0,
|
|
5951
|
+
const selectedValues = (0, import_design_system33.getComboBoxSelectedSelectableGroups)(e);
|
|
5763
5952
|
return props.onChange([...selectedValues]);
|
|
5764
5953
|
},
|
|
5765
5954
|
value: selectedOptions,
|
|
@@ -5778,9 +5967,9 @@ var FilterMultiChoiceEditor = ({
|
|
|
5778
5967
|
};
|
|
5779
5968
|
|
|
5780
5969
|
// src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
|
|
5781
|
-
var
|
|
5782
|
-
var
|
|
5783
|
-
var
|
|
5970
|
+
var import_design_system34 = require("@uniformdev/design-system");
|
|
5971
|
+
var import_react61 = require("react");
|
|
5972
|
+
var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
|
|
5784
5973
|
var FilterSingleChoiceEditor = ({
|
|
5785
5974
|
options,
|
|
5786
5975
|
value,
|
|
@@ -5790,16 +5979,16 @@ var FilterSingleChoiceEditor = ({
|
|
|
5790
5979
|
valueTestId
|
|
5791
5980
|
}) => {
|
|
5792
5981
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5793
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5794
|
-
() => (0,
|
|
5982
|
+
const { groupedOptions, selectedOptions } = (0, import_react61.useMemo)(
|
|
5983
|
+
() => (0, import_design_system34.convertComboBoxGroupsToSelectableGroups)({
|
|
5795
5984
|
options: options != null ? options : [],
|
|
5796
5985
|
selectedItems: new Set(value ? [String(value)] : void 0),
|
|
5797
5986
|
selectionMode: "single"
|
|
5798
5987
|
}),
|
|
5799
5988
|
[options, value]
|
|
5800
5989
|
);
|
|
5801
|
-
return /* @__PURE__ */ (0,
|
|
5802
|
-
|
|
5990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5991
|
+
import_design_system34.InputComboBox,
|
|
5803
5992
|
{
|
|
5804
5993
|
placeholder: "Type to search...",
|
|
5805
5994
|
options: groupedOptions,
|
|
@@ -5827,10 +6016,10 @@ var FilterSingleChoiceEditor = ({
|
|
|
5827
6016
|
};
|
|
5828
6017
|
|
|
5829
6018
|
// src/components/SearchAndFilter/editors/NumberEditor.tsx
|
|
5830
|
-
var
|
|
5831
|
-
var
|
|
6019
|
+
var import_design_system35 = require("@uniformdev/design-system");
|
|
6020
|
+
var import_react62 = require("react");
|
|
5832
6021
|
var import_react_use4 = require("react-use");
|
|
5833
|
-
var
|
|
6022
|
+
var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
|
|
5834
6023
|
var NumberEditor = ({
|
|
5835
6024
|
ariaLabel,
|
|
5836
6025
|
onChange,
|
|
@@ -5839,10 +6028,10 @@ var NumberEditor = ({
|
|
|
5839
6028
|
readOnly,
|
|
5840
6029
|
valueTestId
|
|
5841
6030
|
}) => {
|
|
5842
|
-
const [innerValue, setInnerValue] = (0,
|
|
6031
|
+
const [innerValue, setInnerValue] = (0, import_react62.useState)(value != null ? value : "");
|
|
5843
6032
|
(0, import_react_use4.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
5844
|
-
return /* @__PURE__ */ (0,
|
|
5845
|
-
|
|
6033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6034
|
+
import_design_system35.Input,
|
|
5846
6035
|
{
|
|
5847
6036
|
label: ariaLabel,
|
|
5848
6037
|
type: "number",
|
|
@@ -5858,10 +6047,10 @@ var NumberEditor = ({
|
|
|
5858
6047
|
};
|
|
5859
6048
|
|
|
5860
6049
|
// src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
|
|
5861
|
-
var
|
|
5862
|
-
var
|
|
6050
|
+
var import_design_system36 = require("@uniformdev/design-system");
|
|
6051
|
+
var import_react63 = require("react");
|
|
5863
6052
|
var import_react_use5 = require("react-use");
|
|
5864
|
-
var
|
|
6053
|
+
var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
|
|
5865
6054
|
var NumberRangeEditor = ({
|
|
5866
6055
|
onChange,
|
|
5867
6056
|
disabled,
|
|
@@ -5870,9 +6059,9 @@ var NumberRangeEditor = ({
|
|
|
5870
6059
|
readOnly,
|
|
5871
6060
|
valueTestId
|
|
5872
6061
|
}) => {
|
|
5873
|
-
const [minValue, setMinValue] = (0,
|
|
5874
|
-
const [maxValue, setMaxValue] = (0,
|
|
5875
|
-
const [error, setError] = (0,
|
|
6062
|
+
const [minValue, setMinValue] = (0, import_react63.useState)("");
|
|
6063
|
+
const [maxValue, setMaxValue] = (0, import_react63.useState)("");
|
|
6064
|
+
const [error, setError] = (0, import_react63.useState)("");
|
|
5876
6065
|
(0, import_react_use5.useDebounce)(
|
|
5877
6066
|
() => {
|
|
5878
6067
|
if (minValue && maxValue && !error) {
|
|
@@ -5884,7 +6073,7 @@ var NumberRangeEditor = ({
|
|
|
5884
6073
|
500,
|
|
5885
6074
|
[minValue, maxValue]
|
|
5886
6075
|
);
|
|
5887
|
-
(0,
|
|
6076
|
+
(0, import_react63.useEffect)(() => {
|
|
5888
6077
|
if (!maxValue && !minValue) {
|
|
5889
6078
|
return;
|
|
5890
6079
|
}
|
|
@@ -5906,10 +6095,10 @@ var NumberRangeEditor = ({
|
|
|
5906
6095
|
setMaxValue(maxValue);
|
|
5907
6096
|
}
|
|
5908
6097
|
}, [maxValue, minValue, setError]);
|
|
5909
|
-
return /* @__PURE__ */ (0,
|
|
5910
|
-
/* @__PURE__ */ (0,
|
|
5911
|
-
/* @__PURE__ */ (0,
|
|
5912
|
-
|
|
6098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6101
|
+
import_design_system36.Input,
|
|
5913
6102
|
{
|
|
5914
6103
|
label: `${ariaLabel}-min`,
|
|
5915
6104
|
type: "number",
|
|
@@ -5924,8 +6113,8 @@ var NumberRangeEditor = ({
|
|
|
5924
6113
|
"data-testid": "value-low"
|
|
5925
6114
|
}
|
|
5926
6115
|
),
|
|
5927
|
-
/* @__PURE__ */ (0,
|
|
5928
|
-
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6117
|
+
import_design_system36.Input,
|
|
5929
6118
|
{
|
|
5930
6119
|
type: "number",
|
|
5931
6120
|
label: `${ariaLabel}-max`,
|
|
@@ -5941,20 +6130,20 @@ var NumberRangeEditor = ({
|
|
|
5941
6130
|
}
|
|
5942
6131
|
)
|
|
5943
6132
|
] }),
|
|
5944
|
-
/* @__PURE__ */ (0,
|
|
6133
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ErrorContainer, { errorMessage: error })
|
|
5945
6134
|
] });
|
|
5946
6135
|
};
|
|
5947
6136
|
|
|
5948
6137
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
5949
|
-
var
|
|
5950
|
-
var
|
|
6138
|
+
var import_design_system38 = require("@uniformdev/design-system");
|
|
6139
|
+
var import_react64 = require("react");
|
|
5951
6140
|
|
|
5952
6141
|
// src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
|
|
5953
|
-
var
|
|
5954
|
-
var
|
|
6142
|
+
var import_design_system37 = require("@uniformdev/design-system");
|
|
6143
|
+
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
5955
6144
|
var CustomOptions = ({ label, value }) => {
|
|
5956
|
-
return /* @__PURE__ */ (0,
|
|
5957
|
-
|
|
6145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6146
|
+
import_design_system37.StatusBullet,
|
|
5958
6147
|
{
|
|
5959
6148
|
status: label,
|
|
5960
6149
|
message: Array.isArray(value) ? value.join(",") : value
|
|
@@ -5963,7 +6152,7 @@ var CustomOptions = ({ label, value }) => {
|
|
|
5963
6152
|
};
|
|
5964
6153
|
|
|
5965
6154
|
// src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
|
|
5966
|
-
var
|
|
6155
|
+
var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
|
|
5967
6156
|
var StatusMultiEditor = ({
|
|
5968
6157
|
options,
|
|
5969
6158
|
value,
|
|
@@ -5973,17 +6162,17 @@ var StatusMultiEditor = ({
|
|
|
5973
6162
|
valueTestId
|
|
5974
6163
|
}) => {
|
|
5975
6164
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
5976
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
5977
|
-
() => (0,
|
|
6165
|
+
const { groupedOptions, selectedOptions } = (0, import_react64.useMemo)(
|
|
6166
|
+
() => (0, import_design_system38.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
|
|
5978
6167
|
[options, value]
|
|
5979
6168
|
);
|
|
5980
|
-
return /* @__PURE__ */ (0,
|
|
5981
|
-
|
|
6169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6170
|
+
import_design_system38.InputComboBox,
|
|
5982
6171
|
{
|
|
5983
6172
|
options: groupedOptions != null ? groupedOptions : [],
|
|
5984
6173
|
isMulti: true,
|
|
5985
6174
|
onChange: (e) => {
|
|
5986
|
-
const selectedValues = (0,
|
|
6175
|
+
const selectedValues = (0, import_design_system38.getComboBoxSelectedSelectableGroups)(e);
|
|
5987
6176
|
return onChange([...selectedValues]);
|
|
5988
6177
|
},
|
|
5989
6178
|
formatOptionLabel: CustomOptions,
|
|
@@ -6004,9 +6193,9 @@ var StatusMultiEditor = ({
|
|
|
6004
6193
|
};
|
|
6005
6194
|
|
|
6006
6195
|
// src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
|
|
6007
|
-
var
|
|
6008
|
-
var
|
|
6009
|
-
var
|
|
6196
|
+
var import_design_system39 = require("@uniformdev/design-system");
|
|
6197
|
+
var import_react65 = require("react");
|
|
6198
|
+
var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
|
|
6010
6199
|
var StatusSingleEditor = ({
|
|
6011
6200
|
options,
|
|
6012
6201
|
value,
|
|
@@ -6016,16 +6205,16 @@ var StatusSingleEditor = ({
|
|
|
6016
6205
|
valueTestId
|
|
6017
6206
|
}) => {
|
|
6018
6207
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6019
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6020
|
-
() => (0,
|
|
6208
|
+
const { groupedOptions, selectedOptions } = (0, import_react65.useMemo)(
|
|
6209
|
+
() => (0, import_design_system39.convertComboBoxGroupsToSelectableGroups)({
|
|
6021
6210
|
options: options != null ? options : [],
|
|
6022
6211
|
selectedItems: new Set(value ? [value] : void 0),
|
|
6023
6212
|
selectionMode: "single"
|
|
6024
6213
|
}),
|
|
6025
6214
|
[options, value]
|
|
6026
6215
|
);
|
|
6027
|
-
return /* @__PURE__ */ (0,
|
|
6028
|
-
|
|
6216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6217
|
+
import_design_system39.InputComboBox,
|
|
6029
6218
|
{
|
|
6030
6219
|
options: groupedOptions,
|
|
6031
6220
|
onChange: (e) => {
|
|
@@ -6052,10 +6241,10 @@ var StatusSingleEditor = ({
|
|
|
6052
6241
|
};
|
|
6053
6242
|
|
|
6054
6243
|
// src/components/SearchAndFilter/editors/TextEditor.tsx
|
|
6055
|
-
var
|
|
6056
|
-
var
|
|
6244
|
+
var import_design_system40 = require("@uniformdev/design-system");
|
|
6245
|
+
var import_react66 = require("react");
|
|
6057
6246
|
var import_react_use6 = require("react-use");
|
|
6058
|
-
var
|
|
6247
|
+
var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
|
|
6059
6248
|
var TextEditor = ({
|
|
6060
6249
|
onChange,
|
|
6061
6250
|
ariaLabel,
|
|
@@ -6063,10 +6252,10 @@ var TextEditor = ({
|
|
|
6063
6252
|
readOnly,
|
|
6064
6253
|
valueTestId
|
|
6065
6254
|
}) => {
|
|
6066
|
-
const [innerValue, setInnerValue] = (0,
|
|
6255
|
+
const [innerValue, setInnerValue] = (0, import_react66.useState)(value != null ? value : "");
|
|
6067
6256
|
(0, import_react_use6.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
|
|
6068
|
-
return /* @__PURE__ */ (0,
|
|
6069
|
-
|
|
6257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6258
|
+
import_design_system40.Input,
|
|
6070
6259
|
{
|
|
6071
6260
|
showLabel: false,
|
|
6072
6261
|
label: ariaLabel,
|
|
@@ -6080,9 +6269,9 @@ var TextEditor = ({
|
|
|
6080
6269
|
};
|
|
6081
6270
|
|
|
6082
6271
|
// src/components/SearchAndFilter/editors/TextMultiChoiceEditor.tsx
|
|
6083
|
-
var
|
|
6084
|
-
var
|
|
6085
|
-
var
|
|
6272
|
+
var import_design_system41 = require("@uniformdev/design-system");
|
|
6273
|
+
var import_react67 = require("react");
|
|
6274
|
+
var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
|
|
6086
6275
|
var TextMultiChoiceEditor = ({
|
|
6087
6276
|
value,
|
|
6088
6277
|
disabled,
|
|
@@ -6092,14 +6281,14 @@ var TextMultiChoiceEditor = ({
|
|
|
6092
6281
|
}) => {
|
|
6093
6282
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
6094
6283
|
const isClearable = !readOnly || !disabled;
|
|
6095
|
-
const { groupedOptions, selectedOptions } = (0,
|
|
6284
|
+
const { groupedOptions, selectedOptions } = (0, import_react67.useMemo)(() => {
|
|
6096
6285
|
var _a;
|
|
6097
6286
|
const coercedValue = typeof value === "string" ? [value] : value != null ? value : [];
|
|
6098
6287
|
const options = (_a = coercedValue.map((v) => ({ label: v, value: v }))) != null ? _a : [];
|
|
6099
|
-
return (0,
|
|
6288
|
+
return (0, import_design_system41.convertComboBoxGroupsToSelectableGroups)({ options, selectedItems: new Set(value) });
|
|
6100
6289
|
}, [value]);
|
|
6101
|
-
return /* @__PURE__ */ (0,
|
|
6102
|
-
|
|
6290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6291
|
+
import_design_system41.InputCreatableComboBox,
|
|
6103
6292
|
{
|
|
6104
6293
|
...props,
|
|
6105
6294
|
placeholder: "Type a value\u2026",
|
|
@@ -6109,7 +6298,7 @@ var TextMultiChoiceEditor = ({
|
|
|
6109
6298
|
isClearable,
|
|
6110
6299
|
isDisabled: disabled,
|
|
6111
6300
|
onChange: (e) => {
|
|
6112
|
-
const selectedValues = (0,
|
|
6301
|
+
const selectedValues = (0, import_design_system41.getComboBoxSelectedSelectableGroups)(e);
|
|
6113
6302
|
return props.onChange([...selectedValues]);
|
|
6114
6303
|
},
|
|
6115
6304
|
value: selectedOptions,
|
|
@@ -6128,31 +6317,31 @@ var TextMultiChoiceEditor = ({
|
|
|
6128
6317
|
};
|
|
6129
6318
|
|
|
6130
6319
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
6131
|
-
var
|
|
6320
|
+
var import_design_system43 = require("@uniformdev/design-system");
|
|
6132
6321
|
|
|
6133
6322
|
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
6134
|
-
var
|
|
6135
|
-
var
|
|
6136
|
-
var SearchAndFilterControlsWrapper = (gridColumns) =>
|
|
6323
|
+
var import_react68 = require("@emotion/react");
|
|
6324
|
+
var import_design_system42 = require("@uniformdev/design-system");
|
|
6325
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => import_react68.css`
|
|
6137
6326
|
align-items: stretch;
|
|
6138
6327
|
display: grid;
|
|
6139
6328
|
grid-template-columns: ${gridColumns};
|
|
6140
6329
|
gap: var(--spacing-sm);
|
|
6141
6330
|
`;
|
|
6142
|
-
var SearchAndFilterOutterControlWrapper = (gridColumns) =>
|
|
6331
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react68.css`
|
|
6143
6332
|
align-items: stretch;
|
|
6144
6333
|
display: grid;
|
|
6145
6334
|
grid-template-columns: ${gridColumns};
|
|
6146
6335
|
gap: var(--spacing-sm);
|
|
6147
6336
|
`;
|
|
6148
|
-
var ConditionalFilterRow =
|
|
6337
|
+
var ConditionalFilterRow = import_react68.css`
|
|
6149
6338
|
align-items: baseline;
|
|
6150
6339
|
display: grid;
|
|
6151
6340
|
grid-template-columns: 35px 1fr;
|
|
6152
6341
|
gap: var(--spacing-sm);
|
|
6153
6342
|
margin-left: var(--spacing-base);
|
|
6154
6343
|
|
|
6155
|
-
${(0,
|
|
6344
|
+
${(0, import_design_system42.cq)("380px")} {
|
|
6156
6345
|
&:after {
|
|
6157
6346
|
content: '';
|
|
6158
6347
|
display: block;
|
|
@@ -6171,22 +6360,22 @@ var ConditionalFilterRow = import_react63.css`
|
|
|
6171
6360
|
grid-template-columns: 50px 1fr;
|
|
6172
6361
|
}
|
|
6173
6362
|
|
|
6174
|
-
${(0,
|
|
6363
|
+
${(0, import_design_system42.cq)("580px")} {
|
|
6175
6364
|
&:after {
|
|
6176
6365
|
display: none;
|
|
6177
6366
|
}
|
|
6178
6367
|
}
|
|
6179
6368
|
|
|
6180
6369
|
@media (prefers-reduced-motion: no-preference) {
|
|
6181
|
-
animation: ${
|
|
6370
|
+
animation: ${import_design_system42.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
6182
6371
|
}
|
|
6183
6372
|
`;
|
|
6184
|
-
var ConditionalInputRow =
|
|
6373
|
+
var ConditionalInputRow = import_react68.css`
|
|
6185
6374
|
display: flex;
|
|
6186
6375
|
gap: var(--spacing-sm);
|
|
6187
6376
|
flex-wrap: wrap;
|
|
6188
6377
|
|
|
6189
|
-
${(0,
|
|
6378
|
+
${(0, import_design_system42.cq)("380px")} {
|
|
6190
6379
|
& > div:nth-child(-n + 2) {
|
|
6191
6380
|
width: calc(50% - var(--spacing-sm));
|
|
6192
6381
|
}
|
|
@@ -6195,7 +6384,7 @@ var ConditionalInputRow = import_react63.css`
|
|
|
6195
6384
|
width: calc(100% - 48px);
|
|
6196
6385
|
}
|
|
6197
6386
|
}
|
|
6198
|
-
${(0,
|
|
6387
|
+
${(0, import_design_system42.cq)("764px")} {
|
|
6199
6388
|
align-items: flex-start;
|
|
6200
6389
|
display: grid;
|
|
6201
6390
|
grid-template-columns: 250px 160px 1fr 32px;
|
|
@@ -6205,16 +6394,16 @@ var ConditionalInputRow = import_react63.css`
|
|
|
6205
6394
|
}
|
|
6206
6395
|
}
|
|
6207
6396
|
`;
|
|
6208
|
-
var ConditionalInputRowEmpty =
|
|
6397
|
+
var ConditionalInputRowEmpty = import_react68.css`
|
|
6209
6398
|
flex-wrap: nowrap;
|
|
6210
6399
|
`;
|
|
6211
|
-
var SearchInput =
|
|
6400
|
+
var SearchInput = import_react68.css`
|
|
6212
6401
|
&& {
|
|
6213
6402
|
max-height: 40px;
|
|
6214
6403
|
min-height: unset;
|
|
6215
6404
|
}
|
|
6216
6405
|
`;
|
|
6217
|
-
var BindableKeywordSearchInputStyles =
|
|
6406
|
+
var BindableKeywordSearchInputStyles = import_react68.css`
|
|
6218
6407
|
position: relative;
|
|
6219
6408
|
width: 100%;
|
|
6220
6409
|
|
|
@@ -6229,19 +6418,19 @@ var BindableKeywordSearchInputStyles = import_react63.css`
|
|
|
6229
6418
|
white-space: nowrap;
|
|
6230
6419
|
}
|
|
6231
6420
|
`;
|
|
6232
|
-
var ClearSearchButtonContainer =
|
|
6421
|
+
var ClearSearchButtonContainer = import_react68.css`
|
|
6233
6422
|
align-items: center;
|
|
6234
6423
|
display: flex;
|
|
6235
6424
|
position: absolute;
|
|
6236
6425
|
inset: 0 var(--spacing-lg) 0 auto;
|
|
6237
6426
|
`;
|
|
6238
|
-
var ClearSearchButtonStyles =
|
|
6427
|
+
var ClearSearchButtonStyles = import_react68.css`
|
|
6239
6428
|
background: none;
|
|
6240
6429
|
border: none;
|
|
6241
6430
|
padding: 0;
|
|
6242
6431
|
pointer-events: all;
|
|
6243
6432
|
`;
|
|
6244
|
-
var FilterButton =
|
|
6433
|
+
var FilterButton = import_react68.css`
|
|
6245
6434
|
align-items: center;
|
|
6246
6435
|
background: var(--white);
|
|
6247
6436
|
border: 1px solid var(--gray-300);
|
|
@@ -6278,13 +6467,13 @@ var FilterButton = import_react63.css`
|
|
|
6278
6467
|
opacity: var(--opacity-50);
|
|
6279
6468
|
}
|
|
6280
6469
|
`;
|
|
6281
|
-
var FilterButtonText =
|
|
6470
|
+
var FilterButtonText = import_react68.css`
|
|
6282
6471
|
overflow: hidden;
|
|
6283
6472
|
text-overflow: ellipsis;
|
|
6284
6473
|
white-space: nowrap;
|
|
6285
6474
|
max-width: 14ch;
|
|
6286
6475
|
`;
|
|
6287
|
-
var FilterButtonSelected =
|
|
6476
|
+
var FilterButtonSelected = import_react68.css`
|
|
6288
6477
|
background: var(--gray-100);
|
|
6289
6478
|
border-color: var(--gray-300);
|
|
6290
6479
|
|
|
@@ -6292,7 +6481,7 @@ var FilterButtonSelected = import_react63.css`
|
|
|
6292
6481
|
color: var(--accent-dark);
|
|
6293
6482
|
}
|
|
6294
6483
|
`;
|
|
6295
|
-
var FilterButtonWithOptions =
|
|
6484
|
+
var FilterButtonWithOptions = import_react68.css`
|
|
6296
6485
|
:where([aria-expanded='true']) {
|
|
6297
6486
|
background: var(--purple-rain-100);
|
|
6298
6487
|
border-color: var(--accent-light);
|
|
@@ -6304,14 +6493,14 @@ var FilterButtonWithOptions = import_react63.css`
|
|
|
6304
6493
|
}
|
|
6305
6494
|
}
|
|
6306
6495
|
`;
|
|
6307
|
-
var SearchIcon =
|
|
6496
|
+
var SearchIcon = import_react68.css`
|
|
6308
6497
|
color: var(--icon-color);
|
|
6309
6498
|
position: absolute;
|
|
6310
6499
|
inset: 0 var(--spacing-base) 0 auto;
|
|
6311
6500
|
margin: auto;
|
|
6312
6501
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
6313
6502
|
`;
|
|
6314
|
-
var AddConditionalBtn =
|
|
6503
|
+
var AddConditionalBtn = import_react68.css`
|
|
6315
6504
|
align-items: center;
|
|
6316
6505
|
background: transparent;
|
|
6317
6506
|
border: none;
|
|
@@ -6330,14 +6519,14 @@ var AddConditionalBtn = import_react63.css`
|
|
|
6330
6519
|
color: var(--gray-400);
|
|
6331
6520
|
}
|
|
6332
6521
|
`;
|
|
6333
|
-
var Title =
|
|
6522
|
+
var Title = import_react68.css`
|
|
6334
6523
|
color: var(--typography-light);
|
|
6335
6524
|
|
|
6336
6525
|
&:focus {
|
|
6337
6526
|
outline: none;
|
|
6338
6527
|
}
|
|
6339
6528
|
`;
|
|
6340
|
-
var ResetConditionsBtn =
|
|
6529
|
+
var ResetConditionsBtn = import_react68.css`
|
|
6341
6530
|
background: transparent;
|
|
6342
6531
|
border: none;
|
|
6343
6532
|
color: var(--action-destructive-default);
|
|
@@ -6352,7 +6541,7 @@ var ResetConditionsBtn = import_react63.css`
|
|
|
6352
6541
|
color: var(--gray-400);
|
|
6353
6542
|
}
|
|
6354
6543
|
`;
|
|
6355
|
-
var CriteriaGroupOperatorTrigger =
|
|
6544
|
+
var CriteriaGroupOperatorTrigger = import_react68.css`
|
|
6356
6545
|
&& {
|
|
6357
6546
|
padding: 0;
|
|
6358
6547
|
border-radius: var(--rounded-sm);
|
|
@@ -6371,13 +6560,13 @@ var CriteriaGroupOperatorTrigger = import_react63.css`
|
|
|
6371
6560
|
}
|
|
6372
6561
|
}
|
|
6373
6562
|
`;
|
|
6374
|
-
var IconBtn =
|
|
6563
|
+
var IconBtn = import_react68.css`
|
|
6375
6564
|
align-self: center;
|
|
6376
6565
|
background: transparent;
|
|
6377
6566
|
border: none;
|
|
6378
6567
|
padding: var(--spacing-sm);
|
|
6379
6568
|
`;
|
|
6380
|
-
var SearchAndFilterOptionsContainer =
|
|
6569
|
+
var SearchAndFilterOptionsContainer = import_react68.css`
|
|
6381
6570
|
background: var(--gray-50);
|
|
6382
6571
|
border: 1px solid var(--gray-300);
|
|
6383
6572
|
border-radius: var(--rounded-base);
|
|
@@ -6388,17 +6577,17 @@ var SearchAndFilterOptionsContainer = import_react63.css`
|
|
|
6388
6577
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6389
6578
|
will-change: height;
|
|
6390
6579
|
`;
|
|
6391
|
-
var SearchAndFilterOptionsInnerContainer =
|
|
6580
|
+
var SearchAndFilterOptionsInnerContainer = import_react68.css`
|
|
6392
6581
|
display: flex;
|
|
6393
6582
|
flex-direction: column;
|
|
6394
6583
|
gap: var(--spacing-sm);
|
|
6395
6584
|
padding-inline: var(--spacing-md);
|
|
6396
6585
|
`;
|
|
6397
|
-
var SearchAndFilterButtonGroup =
|
|
6586
|
+
var SearchAndFilterButtonGroup = import_react68.css`
|
|
6398
6587
|
margin-top: var(--spacing-xs);
|
|
6399
6588
|
margin-left: calc(56px + var(--spacing-md));
|
|
6400
6589
|
`;
|
|
6401
|
-
var SearchAndFilterAdditionalContainer =
|
|
6590
|
+
var SearchAndFilterAdditionalContainer = import_react68.css`
|
|
6402
6591
|
align-items: center;
|
|
6403
6592
|
border-top: 1px solid var(--gray-300);
|
|
6404
6593
|
display: flex;
|
|
@@ -6408,17 +6597,17 @@ var SearchAndFilterAdditionalContainer = import_react63.css`
|
|
|
6408
6597
|
`;
|
|
6409
6598
|
|
|
6410
6599
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
6411
|
-
var
|
|
6600
|
+
var import_jsx_runtime72 = require("@emotion/react/jsx-runtime");
|
|
6412
6601
|
var FilterButton2 = ({
|
|
6413
6602
|
text = "Filters",
|
|
6414
|
-
icon =
|
|
6603
|
+
icon = import_design_system43.customIcons["filter-add"],
|
|
6415
6604
|
filterCount,
|
|
6416
6605
|
hasSelectedValue,
|
|
6417
6606
|
dataTestId,
|
|
6418
6607
|
showDropdownIcon,
|
|
6419
6608
|
...props
|
|
6420
6609
|
}) => {
|
|
6421
|
-
return /* @__PURE__ */ (0,
|
|
6610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
6422
6611
|
"button",
|
|
6423
6612
|
{
|
|
6424
6613
|
type: "button",
|
|
@@ -6430,10 +6619,10 @@ var FilterButton2 = ({
|
|
|
6430
6619
|
...props,
|
|
6431
6620
|
"data-testid": dataTestId,
|
|
6432
6621
|
children: [
|
|
6433
|
-
/* @__PURE__ */ (0,
|
|
6434
|
-
/* @__PURE__ */ (0,
|
|
6435
|
-
filterCount ? /* @__PURE__ */ (0,
|
|
6436
|
-
showDropdownIcon ? /* @__PURE__ */ (0,
|
|
6622
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system43.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
6623
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { css: FilterButtonText, children: text }),
|
|
6624
|
+
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system43.Counter, { count: filterCount, bgColor: "var(--white)" }) : null,
|
|
6625
|
+
showDropdownIcon ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system43.Icon, { icon: "chevron-down", iconColor: "currentColor", size: "1rem" }) : null
|
|
6437
6626
|
]
|
|
6438
6627
|
}
|
|
6439
6628
|
);
|
|
@@ -6442,25 +6631,25 @@ var FilterButton2 = ({
|
|
|
6442
6631
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
6443
6632
|
var import_CgClose = require("@react-icons/all-files/cg/CgClose");
|
|
6444
6633
|
var import_canvas10 = require("@uniformdev/canvas");
|
|
6445
|
-
var
|
|
6634
|
+
var import_design_system45 = require("@uniformdev/design-system");
|
|
6446
6635
|
var import_lexical11 = require("lexical");
|
|
6447
|
-
var
|
|
6636
|
+
var import_react70 = require("react");
|
|
6448
6637
|
var import_react_use7 = require("react-use");
|
|
6449
6638
|
var import_uuid2 = require("uuid");
|
|
6450
6639
|
|
|
6451
6640
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6452
|
-
var
|
|
6453
|
-
var
|
|
6641
|
+
var import_design_system44 = require("@uniformdev/design-system");
|
|
6642
|
+
var import_react69 = require("react");
|
|
6454
6643
|
|
|
6455
6644
|
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
6456
|
-
var
|
|
6645
|
+
var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
|
|
6457
6646
|
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
6458
6647
|
const { filterMapper: contextFilterMapper } = useSearchAndFilter();
|
|
6459
6648
|
const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
|
|
6460
6649
|
if (!Editor || editorType === "empty") {
|
|
6461
|
-
return /* @__PURE__ */ (0,
|
|
6650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", {});
|
|
6462
6651
|
}
|
|
6463
|
-
return /* @__PURE__ */ (0,
|
|
6652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Editor, { ...props });
|
|
6464
6653
|
};
|
|
6465
6654
|
var filterMapper = {
|
|
6466
6655
|
multiChoice: FilterMultiChoiceEditor,
|
|
@@ -6478,9 +6667,9 @@ var filterMapper = {
|
|
|
6478
6667
|
function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
6479
6668
|
const WithInputVariables = (props) => {
|
|
6480
6669
|
if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
|
|
6481
|
-
return /* @__PURE__ */ (0,
|
|
6670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props });
|
|
6482
6671
|
}
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6484
6673
|
InputVariables,
|
|
6485
6674
|
{
|
|
6486
6675
|
"data-testid": "filter-value",
|
|
@@ -6489,7 +6678,7 @@ function withInputVariables(WrappedComponent, noSwapping = false) {
|
|
|
6489
6678
|
onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
|
|
6490
6679
|
value: props.value,
|
|
6491
6680
|
disabled: props.disabled,
|
|
6492
|
-
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ (0,
|
|
6681
|
+
inputWhenNoVariables: noSwapping ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props })
|
|
6493
6682
|
}
|
|
6494
6683
|
);
|
|
6495
6684
|
};
|
|
@@ -6499,9 +6688,9 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6499
6688
|
const WithInputVariables = (props) => {
|
|
6500
6689
|
var _a;
|
|
6501
6690
|
if (!props.bindable || props.disabled || props.readOnly) {
|
|
6502
|
-
return /* @__PURE__ */ (0,
|
|
6691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props });
|
|
6503
6692
|
}
|
|
6504
|
-
return /* @__PURE__ */ (0,
|
|
6693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6505
6694
|
InputVariables,
|
|
6506
6695
|
{
|
|
6507
6696
|
"data-testid": "filter-value",
|
|
@@ -6509,7 +6698,7 @@ function withInputVariablesForMultiValue(WrappedComponent) {
|
|
|
6509
6698
|
showMenuPosition: "inline-right",
|
|
6510
6699
|
onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
|
|
6511
6700
|
value: (_a = props.value) == null ? void 0 : _a[0],
|
|
6512
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
6701
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WrappedComponent, { ...props })
|
|
6513
6702
|
}
|
|
6514
6703
|
);
|
|
6515
6704
|
};
|
|
@@ -6525,8 +6714,8 @@ var bindableFiltersMapper = {
|
|
|
6525
6714
|
};
|
|
6526
6715
|
|
|
6527
6716
|
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
6528
|
-
var
|
|
6529
|
-
var SearchAndFilterContext = (0,
|
|
6717
|
+
var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
|
|
6718
|
+
var SearchAndFilterContext = (0, import_react69.createContext)({
|
|
6530
6719
|
searchTerm: "",
|
|
6531
6720
|
setSearchTerm: () => {
|
|
6532
6721
|
},
|
|
@@ -6565,17 +6754,17 @@ var SearchAndFilterProvider = ({
|
|
|
6565
6754
|
children,
|
|
6566
6755
|
allowBindingSearchTerm
|
|
6567
6756
|
}) => {
|
|
6568
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
6569
|
-
const deferredSearchTerm = (0,
|
|
6570
|
-
const [filterVisibility, setFilterVisibility] = (0,
|
|
6571
|
-
const handleSearchTerm = (0,
|
|
6757
|
+
const [searchTerm, setSearchTerm] = (0, import_react69.useState)(defaultSearchTerm);
|
|
6758
|
+
const deferredSearchTerm = (0, import_react69.useDeferredValue)(searchTerm);
|
|
6759
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react69.useState)(alwaysVisible || filterVisible);
|
|
6760
|
+
const handleSearchTerm = (0, import_react69.useCallback)(
|
|
6572
6761
|
(term) => {
|
|
6573
6762
|
setSearchTerm(term);
|
|
6574
6763
|
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
6575
6764
|
},
|
|
6576
6765
|
[setSearchTerm, onSearchChange]
|
|
6577
6766
|
);
|
|
6578
|
-
const handleToggleFilterVisibility = (0,
|
|
6767
|
+
const handleToggleFilterVisibility = (0, import_react69.useCallback)(
|
|
6579
6768
|
(visible) => {
|
|
6580
6769
|
if (alwaysVisible) {
|
|
6581
6770
|
return;
|
|
@@ -6584,10 +6773,10 @@ var SearchAndFilterProvider = ({
|
|
|
6584
6773
|
},
|
|
6585
6774
|
[alwaysVisible]
|
|
6586
6775
|
);
|
|
6587
|
-
const handleAddFilter = (0,
|
|
6776
|
+
const handleAddFilter = (0, import_react69.useCallback)(() => {
|
|
6588
6777
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6589
6778
|
}, [filters, onChange]);
|
|
6590
|
-
const handleResetFilters = (0,
|
|
6779
|
+
const handleResetFilters = (0, import_react69.useCallback)(() => {
|
|
6591
6780
|
setSearchTerm("");
|
|
6592
6781
|
if (onResetFilterValues) {
|
|
6593
6782
|
return onResetFilterValues();
|
|
@@ -6595,20 +6784,20 @@ var SearchAndFilterProvider = ({
|
|
|
6595
6784
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6596
6785
|
onChange(resetFilterValues);
|
|
6597
6786
|
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6598
|
-
const handleDeleteFilter = (0,
|
|
6787
|
+
const handleDeleteFilter = (0, import_react69.useCallback)(
|
|
6599
6788
|
(index) => {
|
|
6600
6789
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
6601
6790
|
onChange(remainingFilters);
|
|
6602
6791
|
},
|
|
6603
6792
|
[filters, onChange]
|
|
6604
6793
|
);
|
|
6605
|
-
const validFilterQuery = (0,
|
|
6794
|
+
const validFilterQuery = (0, import_react69.useMemo)(() => {
|
|
6606
6795
|
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
6607
6796
|
if (hasValidFilters) {
|
|
6608
6797
|
return filters;
|
|
6609
6798
|
}
|
|
6610
6799
|
}, [filters]);
|
|
6611
|
-
(0,
|
|
6800
|
+
(0, import_react69.useEffect)(() => {
|
|
6612
6801
|
if (filterVisibility) {
|
|
6613
6802
|
const handleEscKeyFilterClose = (e) => {
|
|
6614
6803
|
if (e.key === "Escape") {
|
|
@@ -6621,7 +6810,7 @@ var SearchAndFilterProvider = ({
|
|
|
6621
6810
|
};
|
|
6622
6811
|
}
|
|
6623
6812
|
}, [filterVisibility, handleToggleFilterVisibility]);
|
|
6624
|
-
return /* @__PURE__ */ (0,
|
|
6813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6625
6814
|
SearchAndFilterContext.Provider,
|
|
6626
6815
|
{
|
|
6627
6816
|
value: {
|
|
@@ -6641,17 +6830,17 @@ var SearchAndFilterProvider = ({
|
|
|
6641
6830
|
filterMapper: filterMapper2,
|
|
6642
6831
|
allowBindingSearchTerm
|
|
6643
6832
|
},
|
|
6644
|
-
children: /* @__PURE__ */ (0,
|
|
6833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_design_system44.VerticalRhythm, { children })
|
|
6645
6834
|
}
|
|
6646
6835
|
);
|
|
6647
6836
|
};
|
|
6648
6837
|
var useSearchAndFilter = () => {
|
|
6649
|
-
const value = (0,
|
|
6838
|
+
const value = (0, import_react69.useContext)(SearchAndFilterContext);
|
|
6650
6839
|
return { ...value };
|
|
6651
6840
|
};
|
|
6652
6841
|
|
|
6653
6842
|
// src/components/SearchAndFilter/FilterControls.tsx
|
|
6654
|
-
var
|
|
6843
|
+
var import_jsx_runtime75 = require("@emotion/react/jsx-runtime");
|
|
6655
6844
|
var FilterControls = ({
|
|
6656
6845
|
children,
|
|
6657
6846
|
hideSearchInput
|
|
@@ -6664,10 +6853,10 @@ var FilterControls = ({
|
|
|
6664
6853
|
searchTerm,
|
|
6665
6854
|
allowBindingSearchTerm
|
|
6666
6855
|
} = useSearchAndFilter();
|
|
6667
|
-
const editorRef = (0,
|
|
6856
|
+
const editorRef = (0, import_react70.useRef)(null);
|
|
6668
6857
|
const variableRefernceCountInSearchTerm = (0, import_canvas10.hasReferencedVariables)(searchTerm);
|
|
6669
|
-
const [idToResetInputVariables, setIdToResetInputVariables] = (0,
|
|
6670
|
-
const [localSearchTerm, setLocalSearchTerm] = (0,
|
|
6858
|
+
const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react70.useState)("data-resource-search-term-input");
|
|
6859
|
+
const [localSearchTerm, setLocalSearchTerm] = (0, import_react70.useState)(searchTerm);
|
|
6671
6860
|
(0, import_react_use7.useDebounce)(
|
|
6672
6861
|
() => {
|
|
6673
6862
|
if (localSearchTerm !== searchTerm) {
|
|
@@ -6677,14 +6866,14 @@ var FilterControls = ({
|
|
|
6677
6866
|
300,
|
|
6678
6867
|
[localSearchTerm]
|
|
6679
6868
|
);
|
|
6680
|
-
(0,
|
|
6869
|
+
(0, import_react70.useEffect)(() => {
|
|
6681
6870
|
if (searchTerm === "") {
|
|
6682
6871
|
setLocalSearchTerm("");
|
|
6683
6872
|
setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid2.v4)()}`);
|
|
6684
6873
|
}
|
|
6685
6874
|
}, [searchTerm]);
|
|
6686
|
-
return /* @__PURE__ */ (0,
|
|
6687
|
-
/* @__PURE__ */ (0,
|
|
6875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
6876
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6688
6877
|
FilterButton2,
|
|
6689
6878
|
{
|
|
6690
6879
|
"aria-controls": "search-and-filter-options",
|
|
@@ -6697,8 +6886,8 @@ var FilterControls = ({
|
|
|
6697
6886
|
dataTestId: "filters-button"
|
|
6698
6887
|
}
|
|
6699
6888
|
),
|
|
6700
|
-
hideSearchInput ? null : /* @__PURE__ */ (0,
|
|
6701
|
-
/* @__PURE__ */ (0,
|
|
6889
|
+
hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { css: BindableKeywordSearchInputStyles, "data-testid": "search-container", children: [
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6702
6891
|
InputVariables,
|
|
6703
6892
|
{
|
|
6704
6893
|
label: "",
|
|
@@ -6708,8 +6897,8 @@ var FilterControls = ({
|
|
|
6708
6897
|
value: localSearchTerm,
|
|
6709
6898
|
onChange: (value) => setLocalSearchTerm(value != null ? value : ""),
|
|
6710
6899
|
disableVariables: !allowBindingSearchTerm,
|
|
6711
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
6712
|
-
|
|
6900
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6901
|
+
import_design_system45.InputKeywordSearch,
|
|
6713
6902
|
{
|
|
6714
6903
|
placeholder: "Search...",
|
|
6715
6904
|
onSearchTextChanged: (e) => setLocalSearchTerm(e),
|
|
@@ -6727,7 +6916,7 @@ var FilterControls = ({
|
|
|
6727
6916
|
)
|
|
6728
6917
|
}
|
|
6729
6918
|
),
|
|
6730
|
-
variableRefernceCountInSearchTerm ? /* @__PURE__ */ (0,
|
|
6919
|
+
variableRefernceCountInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6731
6920
|
"button",
|
|
6732
6921
|
{
|
|
6733
6922
|
css: ClearSearchButtonStyles,
|
|
@@ -6741,7 +6930,7 @@ var FilterControls = ({
|
|
|
6741
6930
|
},
|
|
6742
6931
|
type: "button",
|
|
6743
6932
|
"data-testid": "keyword-search-clear-button",
|
|
6744
|
-
children: /* @__PURE__ */ (0,
|
|
6933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system45.Icon, { icon: import_CgClose.CgClose, iconColor: "red", size: "1rem" })
|
|
6745
6934
|
}
|
|
6746
6935
|
) }) : null
|
|
6747
6936
|
] }),
|
|
@@ -6751,8 +6940,8 @@ var FilterControls = ({
|
|
|
6751
6940
|
|
|
6752
6941
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6753
6942
|
var import_CgTrash2 = require("@react-icons/all-files/cg/CgTrash");
|
|
6754
|
-
var
|
|
6755
|
-
var
|
|
6943
|
+
var import_design_system46 = require("@uniformdev/design-system");
|
|
6944
|
+
var import_react71 = require("react");
|
|
6756
6945
|
|
|
6757
6946
|
// src/components/SearchAndFilter/util/isFilterBindable.ts
|
|
6758
6947
|
function isFilterBindable(filter, operator) {
|
|
@@ -6761,7 +6950,7 @@ function isFilterBindable(filter, operator) {
|
|
|
6761
6950
|
}
|
|
6762
6951
|
|
|
6763
6952
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
6764
|
-
var
|
|
6953
|
+
var import_jsx_runtime76 = require("@emotion/react/jsx-runtime");
|
|
6765
6954
|
var FilterItem = ({
|
|
6766
6955
|
index,
|
|
6767
6956
|
operatorOptions,
|
|
@@ -6780,7 +6969,7 @@ var FilterItem = ({
|
|
|
6780
6969
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
6781
6970
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
6782
6971
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
6783
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0,
|
|
6972
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react71.useMemo)(() => {
|
|
6784
6973
|
var _a2;
|
|
6785
6974
|
const currentSelectedFilterGroup = filterOptions.find((item) => {
|
|
6786
6975
|
var _a3;
|
|
@@ -6810,11 +6999,11 @@ var FilterItem = ({
|
|
|
6810
6999
|
} : {};
|
|
6811
7000
|
const CustomLeftHandComponent = selectedFieldValue == null ? void 0 : selectedFieldValue.leftHandSideComponentWhenSelected;
|
|
6812
7001
|
const isEmptyOperator = metaDataPossibleOptions === "empty";
|
|
6813
|
-
const joinLabel = index === 0 ? initialCriteriaTitle : index === 1 && onCriteriaGroupOperatorChange ? /* @__PURE__ */ (0,
|
|
6814
|
-
|
|
7002
|
+
const joinLabel = index === 0 ? initialCriteriaTitle : index === 1 && onCriteriaGroupOperatorChange ? /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
7003
|
+
import_design_system46.Menu,
|
|
6815
7004
|
{
|
|
6816
|
-
menuTrigger: /* @__PURE__ */ (0,
|
|
6817
|
-
|
|
7005
|
+
menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7006
|
+
import_design_system46.DropdownStyleMenuTrigger,
|
|
6818
7007
|
{
|
|
6819
7008
|
bgColor: "transparent",
|
|
6820
7009
|
css: CriteriaGroupOperatorTrigger,
|
|
@@ -6826,8 +7015,8 @@ var FilterItem = ({
|
|
|
6826
7015
|
size: "small",
|
|
6827
7016
|
placement: "bottom-start",
|
|
6828
7017
|
children: [
|
|
6829
|
-
/* @__PURE__ */ (0,
|
|
6830
|
-
|
|
7018
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7019
|
+
import_design_system46.SelectableMenuItem,
|
|
6831
7020
|
{
|
|
6832
7021
|
selected: criteriaGroupOperator === "and",
|
|
6833
7022
|
onClick: () => onCriteriaGroupOperatorChange("and"),
|
|
@@ -6835,8 +7024,8 @@ var FilterItem = ({
|
|
|
6835
7024
|
children: "and"
|
|
6836
7025
|
}
|
|
6837
7026
|
),
|
|
6838
|
-
/* @__PURE__ */ (0,
|
|
6839
|
-
|
|
7027
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7028
|
+
import_design_system46.SelectableMenuItem,
|
|
6840
7029
|
{
|
|
6841
7030
|
selected: criteriaGroupOperator === "or",
|
|
6842
7031
|
onClick: () => onCriteriaGroupOperatorChange("or"),
|
|
@@ -6847,10 +7036,10 @@ var FilterItem = ({
|
|
|
6847
7036
|
]
|
|
6848
7037
|
}
|
|
6849
7038
|
) : criteriaGroupOperator;
|
|
6850
|
-
return /* @__PURE__ */ (0,
|
|
6851
|
-
/* @__PURE__ */ (0,
|
|
6852
|
-
/* @__PURE__ */ (0,
|
|
6853
|
-
CustomLeftHandComponent ? /* @__PURE__ */ (0,
|
|
7039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
7040
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { children: joinLabel }),
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { css: [ConditionalInputRow, isEmptyOperator ? ConditionalInputRowEmpty : null], children: [
|
|
7042
|
+
CustomLeftHandComponent ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6854
7043
|
CustomLeftHandComponent,
|
|
6855
7044
|
{
|
|
6856
7045
|
filterOption: selectedFieldValue,
|
|
@@ -6860,8 +7049,8 @@ var FilterItem = ({
|
|
|
6860
7049
|
onFilterOptionChange("");
|
|
6861
7050
|
}
|
|
6862
7051
|
}
|
|
6863
|
-
) : /* @__PURE__ */ (0,
|
|
6864
|
-
|
|
7052
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7053
|
+
import_design_system46.InputComboBox,
|
|
6865
7054
|
{
|
|
6866
7055
|
"aria-label": label,
|
|
6867
7056
|
options: filterOptions,
|
|
@@ -6887,8 +7076,8 @@ var FilterItem = ({
|
|
|
6887
7076
|
name: `filter-field-${index}`
|
|
6888
7077
|
}
|
|
6889
7078
|
),
|
|
6890
|
-
/* @__PURE__ */ (0,
|
|
6891
|
-
|
|
7079
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7080
|
+
import_design_system46.InputComboBox,
|
|
6892
7081
|
{
|
|
6893
7082
|
"aria-label": operatorLabel,
|
|
6894
7083
|
options: operatorOptions,
|
|
@@ -6911,7 +7100,7 @@ var FilterItem = ({
|
|
|
6911
7100
|
name: `filter-operator-${index}`
|
|
6912
7101
|
}
|
|
6913
7102
|
),
|
|
6914
|
-
/* @__PURE__ */ (0,
|
|
7103
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6915
7104
|
FilterEditorRenderer,
|
|
6916
7105
|
{
|
|
6917
7106
|
"aria-label": metaDataLabel,
|
|
@@ -6926,7 +7115,7 @@ var FilterItem = ({
|
|
|
6926
7115
|
filterFieldName: filters[index].field
|
|
6927
7116
|
}
|
|
6928
7117
|
),
|
|
6929
|
-
readOnly ? null : /* @__PURE__ */ (0,
|
|
7118
|
+
readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6930
7119
|
"button",
|
|
6931
7120
|
{
|
|
6932
7121
|
type: "button",
|
|
@@ -6935,7 +7124,7 @@ var FilterItem = ({
|
|
|
6935
7124
|
css: IconBtn,
|
|
6936
7125
|
"data-testid": "delete-filter",
|
|
6937
7126
|
disabled: filters.length === 1,
|
|
6938
|
-
children: /* @__PURE__ */ (0,
|
|
7127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_design_system46.Icon, { icon: import_CgTrash2.CgTrash, iconColor: filters.length === 1 ? "gray" : "red", size: "1rem" })
|
|
6939
7128
|
}
|
|
6940
7129
|
)
|
|
6941
7130
|
] })
|
|
@@ -6944,21 +7133,21 @@ var FilterItem = ({
|
|
|
6944
7133
|
|
|
6945
7134
|
// src/components/SearchAndFilter/FilterItems.tsx
|
|
6946
7135
|
var import_CgMathPlus = require("@react-icons/all-files/cg/CgMathPlus");
|
|
6947
|
-
var
|
|
7136
|
+
var import_design_system48 = require("@uniformdev/design-system");
|
|
6948
7137
|
|
|
6949
7138
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
6950
|
-
var
|
|
6951
|
-
var
|
|
6952
|
-
var
|
|
7139
|
+
var import_design_system47 = require("@uniformdev/design-system");
|
|
7140
|
+
var import_react72 = __toESM(require("react"));
|
|
7141
|
+
var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
|
|
6953
7142
|
var SearchAndFilterOptionsContainer2 = ({
|
|
6954
7143
|
buttonRow,
|
|
6955
7144
|
additionalFiltersContainer,
|
|
6956
7145
|
children
|
|
6957
7146
|
}) => {
|
|
6958
|
-
return /* @__PURE__ */ (0,
|
|
6959
|
-
/* @__PURE__ */ (0,
|
|
6960
|
-
buttonRow ? /* @__PURE__ */ (0,
|
|
6961
|
-
|
|
7147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
7148
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
7149
|
+
buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
7150
|
+
import_design_system47.HorizontalRhythm,
|
|
6962
7151
|
{
|
|
6963
7152
|
css: SearchAndFilterButtonGroup,
|
|
6964
7153
|
gap: "sm",
|
|
@@ -6967,7 +7156,7 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
6967
7156
|
children: buttonRow
|
|
6968
7157
|
}
|
|
6969
7158
|
) : null,
|
|
6970
|
-
additionalFiltersContainer ? /* @__PURE__ */ (0,
|
|
7159
|
+
additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { css: SearchAndFilterAdditionalContainer, children: additionalFiltersContainer }) : null
|
|
6971
7160
|
] });
|
|
6972
7161
|
};
|
|
6973
7162
|
var FilterMenu = ({
|
|
@@ -6980,22 +7169,22 @@ var FilterMenu = ({
|
|
|
6980
7169
|
resetButtonText = "reset"
|
|
6981
7170
|
}) => {
|
|
6982
7171
|
const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
|
|
6983
|
-
const innerMenuRef =
|
|
6984
|
-
(0,
|
|
7172
|
+
const innerMenuRef = import_react72.default.useRef(null);
|
|
7173
|
+
(0, import_react72.useEffect)(() => {
|
|
6985
7174
|
var _a;
|
|
6986
7175
|
if (filterVisibility) {
|
|
6987
7176
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
6988
7177
|
}
|
|
6989
7178
|
}, [filterVisibility]);
|
|
6990
|
-
return /* @__PURE__ */ (0,
|
|
7179
|
+
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)(
|
|
6991
7180
|
SearchAndFilterOptionsContainer2,
|
|
6992
7181
|
{
|
|
6993
7182
|
buttonRow: menuControls,
|
|
6994
7183
|
additionalFiltersContainer,
|
|
6995
7184
|
children: [
|
|
6996
|
-
/* @__PURE__ */ (0,
|
|
6997
|
-
filterTitle ? /* @__PURE__ */ (0,
|
|
6998
|
-
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ (0,
|
|
7185
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_design_system47.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
7186
|
+
filterTitle ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }) : null,
|
|
7187
|
+
(filters == null ? void 0 : filters.length) && resetButtonText ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6999
7188
|
"button",
|
|
7000
7189
|
{
|
|
7001
7190
|
type: "button",
|
|
@@ -7106,7 +7295,7 @@ function hasBindings(currentValue) {
|
|
|
7106
7295
|
}
|
|
7107
7296
|
|
|
7108
7297
|
// src/components/SearchAndFilter/FilterItems.tsx
|
|
7109
|
-
var
|
|
7298
|
+
var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
|
|
7110
7299
|
var FilterItems = ({
|
|
7111
7300
|
addButtonText = "add condition",
|
|
7112
7301
|
additionalFiltersContainer,
|
|
@@ -7144,12 +7333,12 @@ var FilterItems = ({
|
|
|
7144
7333
|
}
|
|
7145
7334
|
setFilters(next);
|
|
7146
7335
|
};
|
|
7147
|
-
return /* @__PURE__ */ (0,
|
|
7336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7148
7337
|
FilterMenu,
|
|
7149
7338
|
{
|
|
7150
7339
|
id: "search-and-filter-options",
|
|
7151
7340
|
dataTestId: "search-and-filter-options",
|
|
7152
|
-
menuControls: /* @__PURE__ */ (0,
|
|
7341
|
+
menuControls: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7153
7342
|
"button",
|
|
7154
7343
|
{
|
|
7155
7344
|
type: "button",
|
|
@@ -7157,7 +7346,7 @@ var FilterItems = ({
|
|
|
7157
7346
|
onClick: handleAddFilter,
|
|
7158
7347
|
"data-testid": "add-filter",
|
|
7159
7348
|
children: [
|
|
7160
|
-
/* @__PURE__ */ (0,
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_design_system48.Icon, { icon: import_CgMathPlus.CgMathPlus, iconColor: "currentColor", size: "1rem" }),
|
|
7161
7350
|
addButtonText
|
|
7162
7351
|
]
|
|
7163
7352
|
}
|
|
@@ -7173,7 +7362,7 @@ var FilterItems = ({
|
|
|
7173
7362
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
7174
7363
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
7175
7364
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
7176
|
-
return /* @__PURE__ */ (0,
|
|
7365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7177
7366
|
FilterItem,
|
|
7178
7367
|
{
|
|
7179
7368
|
index: i,
|
|
@@ -7195,11 +7384,11 @@ var FilterItems = ({
|
|
|
7195
7384
|
};
|
|
7196
7385
|
|
|
7197
7386
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
7198
|
-
var
|
|
7387
|
+
var import_design_system50 = require("@uniformdev/design-system");
|
|
7199
7388
|
|
|
7200
7389
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
7201
|
-
var
|
|
7202
|
-
var
|
|
7390
|
+
var import_design_system49 = require("@uniformdev/design-system");
|
|
7391
|
+
var import_jsx_runtime79 = require("@emotion/react/jsx-runtime");
|
|
7203
7392
|
var SearchAndFilterResultContainer = ({
|
|
7204
7393
|
buttonText,
|
|
7205
7394
|
clearButtonLabel = "clear",
|
|
@@ -7250,19 +7439,19 @@ var SearchAndFilterResultContainer = ({
|
|
|
7250
7439
|
handleResetFilters();
|
|
7251
7440
|
}
|
|
7252
7441
|
};
|
|
7253
|
-
return /* @__PURE__ */ (0,
|
|
7254
|
-
/* @__PURE__ */ (0,
|
|
7255
|
-
/* @__PURE__ */ (0,
|
|
7442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7443
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_design_system49.HorizontalRhythm, { children: [
|
|
7444
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { children: [
|
|
7256
7445
|
totalResults,
|
|
7257
7446
|
" results ",
|
|
7258
7447
|
searchTerm ? `for "${searchTerm}"` : null
|
|
7259
7448
|
] }),
|
|
7260
|
-
!searchTerm || hideClearButton ? null : /* @__PURE__ */ (0,
|
|
7449
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system49.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
|
|
7261
7450
|
] }),
|
|
7262
|
-
totalResults === 0 ? /* @__PURE__ */ (0,
|
|
7263
|
-
calloutText ? /* @__PURE__ */ (0,
|
|
7264
|
-
hideClearButton ? null : /* @__PURE__ */ (0,
|
|
7265
|
-
|
|
7451
|
+
totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_design_system49.Callout, { title: automateCalloutTitle, type: "note", children: [
|
|
7452
|
+
calloutText ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_design_system49.Paragraph, { children: calloutText }) : null,
|
|
7453
|
+
hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7454
|
+
import_design_system49.Button,
|
|
7266
7455
|
{
|
|
7267
7456
|
buttonType: "tertiaryOutline",
|
|
7268
7457
|
size: "xs",
|
|
@@ -7276,14 +7465,14 @@ var SearchAndFilterResultContainer = ({
|
|
|
7276
7465
|
};
|
|
7277
7466
|
|
|
7278
7467
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
7279
|
-
var
|
|
7468
|
+
var import_jsx_runtime80 = require("@emotion/react/jsx-runtime");
|
|
7280
7469
|
var SearchAndFilter = ({
|
|
7281
7470
|
filters,
|
|
7282
7471
|
filterOptions,
|
|
7283
7472
|
filterVisible,
|
|
7284
7473
|
filterControls,
|
|
7285
7474
|
viewSwitchControls,
|
|
7286
|
-
resultsContainerView = /* @__PURE__ */ (0,
|
|
7475
|
+
resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(SearchAndFilterResultContainer, {}),
|
|
7287
7476
|
filterMapper: filterMapper2 = filterMapper,
|
|
7288
7477
|
additionalFiltersContainer,
|
|
7289
7478
|
onChange,
|
|
@@ -7295,7 +7484,7 @@ var SearchAndFilter = ({
|
|
|
7295
7484
|
resetFilterValues = [],
|
|
7296
7485
|
onResetFilterValues
|
|
7297
7486
|
}) => {
|
|
7298
|
-
return /* @__PURE__ */ (0,
|
|
7487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7299
7488
|
SearchAndFilterProvider,
|
|
7300
7489
|
{
|
|
7301
7490
|
filters,
|
|
@@ -7310,18 +7499,18 @@ var SearchAndFilter = ({
|
|
|
7310
7499
|
filterMapper: filterMapper2,
|
|
7311
7500
|
allowBindingSearchTerm,
|
|
7312
7501
|
onResetFilterValues,
|
|
7313
|
-
children: /* @__PURE__ */ (0,
|
|
7314
|
-
/* @__PURE__ */ (0,
|
|
7315
|
-
/* @__PURE__ */ (0,
|
|
7502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_design_system50.VerticalRhythm, { "data-testid": "search-and-filter", children: [
|
|
7503
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7504
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7316
7505
|
"div",
|
|
7317
7506
|
{
|
|
7318
7507
|
css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
|
|
7319
|
-
children: !filterControls ? /* @__PURE__ */ (0,
|
|
7508
|
+
children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
7320
7509
|
}
|
|
7321
7510
|
),
|
|
7322
7511
|
viewSwitchControls
|
|
7323
7512
|
] }),
|
|
7324
|
-
/* @__PURE__ */ (0,
|
|
7513
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FilterItems, { additionalFiltersContainer }),
|
|
7325
7514
|
resultsContainerView
|
|
7326
7515
|
] })
|
|
7327
7516
|
}
|
|
@@ -7329,18 +7518,18 @@ var SearchAndFilter = ({
|
|
|
7329
7518
|
};
|
|
7330
7519
|
|
|
7331
7520
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
7332
|
-
var
|
|
7333
|
-
var
|
|
7521
|
+
var import_design_system51 = require("@uniformdev/design-system");
|
|
7522
|
+
var import_react73 = require("react");
|
|
7334
7523
|
var import_react_use8 = require("react-use");
|
|
7335
|
-
var
|
|
7336
|
-
var SearchOnlyContext = (0,
|
|
7524
|
+
var import_jsx_runtime81 = require("@emotion/react/jsx-runtime");
|
|
7525
|
+
var SearchOnlyContext = (0, import_react73.createContext)({
|
|
7337
7526
|
searchTerm: "",
|
|
7338
7527
|
setSearchTerm: () => {
|
|
7339
7528
|
}
|
|
7340
7529
|
});
|
|
7341
7530
|
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
7342
7531
|
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
7343
|
-
const [localeSearchTerm, setLocaleSearchTerm] = (0,
|
|
7532
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react73.useState)("");
|
|
7344
7533
|
(0, import_react_use8.useDebounce)(
|
|
7345
7534
|
() => {
|
|
7346
7535
|
setSearchTerm(localeSearchTerm);
|
|
@@ -7349,15 +7538,15 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7349
7538
|
300,
|
|
7350
7539
|
[localeSearchTerm]
|
|
7351
7540
|
);
|
|
7352
|
-
return /* @__PURE__ */ (0,
|
|
7541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7353
7542
|
SearchOnlyContext.Provider,
|
|
7354
7543
|
{
|
|
7355
7544
|
value: {
|
|
7356
7545
|
searchTerm,
|
|
7357
7546
|
setSearchTerm: setLocaleSearchTerm
|
|
7358
7547
|
},
|
|
7359
|
-
children: /* @__PURE__ */ (0,
|
|
7360
|
-
|
|
7548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7549
|
+
import_design_system51.InputKeywordSearch,
|
|
7361
7550
|
{
|
|
7362
7551
|
placeholder: "Search...",
|
|
7363
7552
|
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
@@ -7371,18 +7560,18 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
7371
7560
|
};
|
|
7372
7561
|
|
|
7373
7562
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
7374
|
-
var
|
|
7563
|
+
var import_design_system53 = require("@uniformdev/design-system");
|
|
7375
7564
|
|
|
7376
7565
|
// src/components/SearchAndFilter/styles/SortItems.styles.ts
|
|
7377
|
-
var
|
|
7378
|
-
var
|
|
7379
|
-
var ConditionalFilterRow2 =
|
|
7566
|
+
var import_react74 = require("@emotion/react");
|
|
7567
|
+
var import_design_system52 = require("@uniformdev/design-system");
|
|
7568
|
+
var ConditionalFilterRow2 = import_react74.css`
|
|
7380
7569
|
display: grid;
|
|
7381
7570
|
grid-template-columns: 35px 1fr;
|
|
7382
7571
|
gap: var(--spacing-sm);
|
|
7383
7572
|
margin-left: var(--spacing-base);
|
|
7384
7573
|
|
|
7385
|
-
${(0,
|
|
7574
|
+
${(0, import_design_system52.cq)("380px")} {
|
|
7386
7575
|
align-items: center;
|
|
7387
7576
|
|
|
7388
7577
|
&:after {
|
|
@@ -7403,22 +7592,22 @@ var ConditionalFilterRow2 = import_react69.css`
|
|
|
7403
7592
|
grid-template-columns: 50px 1fr;
|
|
7404
7593
|
}
|
|
7405
7594
|
|
|
7406
|
-
${(0,
|
|
7595
|
+
${(0, import_design_system52.cq)("580px")} {
|
|
7407
7596
|
&:after {
|
|
7408
7597
|
display: none;
|
|
7409
7598
|
}
|
|
7410
7599
|
}
|
|
7411
7600
|
|
|
7412
7601
|
@media (prefers-reduced-motion: no-preference) {
|
|
7413
|
-
animation: ${
|
|
7602
|
+
animation: ${import_design_system52.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
7414
7603
|
}
|
|
7415
7604
|
`;
|
|
7416
|
-
var ConditionalInputRow2 =
|
|
7605
|
+
var ConditionalInputRow2 = import_react74.css`
|
|
7417
7606
|
display: flex;
|
|
7418
7607
|
gap: var(--spacing-sm);
|
|
7419
7608
|
flex-wrap: wrap;
|
|
7420
7609
|
|
|
7421
|
-
${(0,
|
|
7610
|
+
${(0, import_design_system52.cq)("380px")} {
|
|
7422
7611
|
& > div:nth-child(-n + 2) {
|
|
7423
7612
|
width: calc(50% - var(--spacing-sm));
|
|
7424
7613
|
}
|
|
@@ -7427,7 +7616,7 @@ var ConditionalInputRow2 = import_react69.css`
|
|
|
7427
7616
|
width: calc(100% - 48px);
|
|
7428
7617
|
}
|
|
7429
7618
|
}
|
|
7430
|
-
${(0,
|
|
7619
|
+
${(0, import_design_system52.cq)("580px")} {
|
|
7431
7620
|
display: grid;
|
|
7432
7621
|
grid-template-columns: 200px 160px 1fr 32px;
|
|
7433
7622
|
|
|
@@ -7436,13 +7625,13 @@ var ConditionalInputRow2 = import_react69.css`
|
|
|
7436
7625
|
}
|
|
7437
7626
|
}
|
|
7438
7627
|
`;
|
|
7439
|
-
var SearchInput2 =
|
|
7628
|
+
var SearchInput2 = import_react74.css`
|
|
7440
7629
|
&& {
|
|
7441
7630
|
max-height: 40px;
|
|
7442
7631
|
min-height: unset;
|
|
7443
7632
|
}
|
|
7444
7633
|
`;
|
|
7445
|
-
var FilterButton3 =
|
|
7634
|
+
var FilterButton3 = import_react74.css`
|
|
7446
7635
|
align-items: center;
|
|
7447
7636
|
background: var(--white);
|
|
7448
7637
|
border: 1px solid var(--gray-300);
|
|
@@ -7479,13 +7668,13 @@ var FilterButton3 = import_react69.css`
|
|
|
7479
7668
|
opacity: var(--opacity-50);
|
|
7480
7669
|
}
|
|
7481
7670
|
`;
|
|
7482
|
-
var FilterButtonText2 =
|
|
7671
|
+
var FilterButtonText2 = import_react74.css`
|
|
7483
7672
|
overflow: hidden;
|
|
7484
7673
|
text-overflow: ellipsis;
|
|
7485
7674
|
white-space: nowrap;
|
|
7486
7675
|
max-width: 14ch;
|
|
7487
7676
|
`;
|
|
7488
|
-
var FilterButtonSelected2 =
|
|
7677
|
+
var FilterButtonSelected2 = import_react74.css`
|
|
7489
7678
|
background: var(--gray-100);
|
|
7490
7679
|
border-color: var(--gray-300);
|
|
7491
7680
|
|
|
@@ -7493,7 +7682,7 @@ var FilterButtonSelected2 = import_react69.css`
|
|
|
7493
7682
|
color: var(--accent-dark);
|
|
7494
7683
|
}
|
|
7495
7684
|
`;
|
|
7496
|
-
var FilterButtonWithOptions2 =
|
|
7685
|
+
var FilterButtonWithOptions2 = import_react74.css`
|
|
7497
7686
|
:where([aria-expanded='true']) {
|
|
7498
7687
|
background: var(--purple-rain-100);
|
|
7499
7688
|
border-color: var(--accent-light);
|
|
@@ -7505,14 +7694,14 @@ var FilterButtonWithOptions2 = import_react69.css`
|
|
|
7505
7694
|
}
|
|
7506
7695
|
}
|
|
7507
7696
|
`;
|
|
7508
|
-
var SearchIcon2 =
|
|
7697
|
+
var SearchIcon2 = import_react74.css`
|
|
7509
7698
|
color: var(--icon-color);
|
|
7510
7699
|
position: absolute;
|
|
7511
7700
|
inset: 0 var(--spacing-base) 0 auto;
|
|
7512
7701
|
margin: auto;
|
|
7513
7702
|
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
7514
7703
|
`;
|
|
7515
|
-
var AddConditionalBtn2 =
|
|
7704
|
+
var AddConditionalBtn2 = import_react74.css`
|
|
7516
7705
|
align-items: center;
|
|
7517
7706
|
background: transparent;
|
|
7518
7707
|
border: none;
|
|
@@ -7531,14 +7720,14 @@ var AddConditionalBtn2 = import_react69.css`
|
|
|
7531
7720
|
color: var(--gray-400);
|
|
7532
7721
|
}
|
|
7533
7722
|
`;
|
|
7534
|
-
var Title2 =
|
|
7723
|
+
var Title2 = import_react74.css`
|
|
7535
7724
|
color: var(--typography-light);
|
|
7536
7725
|
|
|
7537
7726
|
&:focus {
|
|
7538
7727
|
outline: none;
|
|
7539
7728
|
}
|
|
7540
7729
|
`;
|
|
7541
|
-
var ResetConditionsBtn2 =
|
|
7730
|
+
var ResetConditionsBtn2 = import_react74.css`
|
|
7542
7731
|
background: transparent;
|
|
7543
7732
|
border: none;
|
|
7544
7733
|
color: var(--action-destructive-default);
|
|
@@ -7550,12 +7739,12 @@ var ResetConditionsBtn2 = import_react69.css`
|
|
|
7550
7739
|
color: var(--action-destructive-hover);
|
|
7551
7740
|
}
|
|
7552
7741
|
`;
|
|
7553
|
-
var IconBtn2 =
|
|
7742
|
+
var IconBtn2 = import_react74.css`
|
|
7554
7743
|
background: transparent;
|
|
7555
7744
|
border: none;
|
|
7556
7745
|
padding: var(--spacing-sm);
|
|
7557
7746
|
`;
|
|
7558
|
-
var SearchAndFilterOptionsContainer3 =
|
|
7747
|
+
var SearchAndFilterOptionsContainer3 = import_react74.css`
|
|
7559
7748
|
background: var(--gray-50);
|
|
7560
7749
|
border: 1px solid var(--gray-300);
|
|
7561
7750
|
border-radius: var(--rounded-base);
|
|
@@ -7568,34 +7757,34 @@ var SearchAndFilterOptionsContainer3 = import_react69.css`
|
|
|
7568
7757
|
position: relative;
|
|
7569
7758
|
z-index: 1;
|
|
7570
7759
|
`;
|
|
7571
|
-
var SearchAndFilterOptionsInnerContainer2 =
|
|
7760
|
+
var SearchAndFilterOptionsInnerContainer2 = import_react74.css`
|
|
7572
7761
|
display: flex;
|
|
7573
7762
|
flex-direction: column;
|
|
7574
7763
|
gap: var(--spacing-sm);
|
|
7575
7764
|
padding-inline: var(--spacing-md);
|
|
7576
7765
|
`;
|
|
7577
|
-
var SearchAndFilterButtonGroup2 =
|
|
7766
|
+
var SearchAndFilterButtonGroup2 = import_react74.css`
|
|
7578
7767
|
margin-top: var(--spacing-xs);
|
|
7579
7768
|
margin-left: calc(56px + var(--spacing-md));
|
|
7580
7769
|
`;
|
|
7581
|
-
var SortFilterWrapper = (hiddenLocaleInput) =>
|
|
7770
|
+
var SortFilterWrapper = (hiddenLocaleInput) => import_react74.css`
|
|
7582
7771
|
align-items: center;
|
|
7583
7772
|
display: flex;
|
|
7584
7773
|
gap: var(--spacing-base);
|
|
7585
7774
|
flex-grow: 1;
|
|
7586
7775
|
|
|
7587
|
-
${(0,
|
|
7776
|
+
${(0, import_design_system52.cq)("420px")} {
|
|
7588
7777
|
display: grid;
|
|
7589
7778
|
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
|
|
7590
7779
|
}
|
|
7591
7780
|
`;
|
|
7592
|
-
var SortFilterInputRow =
|
|
7781
|
+
var SortFilterInputRow = import_react74.css`
|
|
7593
7782
|
align-items: center;
|
|
7594
7783
|
display: grid;
|
|
7595
7784
|
grid-template-columns: 1fr auto;
|
|
7596
7785
|
gap: var(--spacing-base);
|
|
7597
7786
|
`;
|
|
7598
|
-
var InputVariableWrapper =
|
|
7787
|
+
var InputVariableWrapper = import_react74.css`
|
|
7599
7788
|
flex-grow: 1;
|
|
7600
7789
|
|
|
7601
7790
|
// we need to override label styles nested within the input variable
|
|
@@ -7606,7 +7795,7 @@ var InputVariableWrapper = import_react69.css`
|
|
|
7606
7795
|
`;
|
|
7607
7796
|
|
|
7608
7797
|
// src/components/SearchAndFilter/SortItems.tsx
|
|
7609
|
-
var
|
|
7798
|
+
var import_jsx_runtime82 = require("@emotion/react/jsx-runtime");
|
|
7610
7799
|
var SortItems = ({
|
|
7611
7800
|
sortByLabel = "Sort by",
|
|
7612
7801
|
localeLabel = "Show locale",
|
|
@@ -7628,11 +7817,11 @@ var SortItems = ({
|
|
|
7628
7817
|
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
7629
7818
|
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
7630
7819
|
const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
|
|
7631
|
-
return /* @__PURE__ */ (0,
|
|
7632
|
-
/* @__PURE__ */ (0,
|
|
7633
|
-
/* @__PURE__ */ (0,
|
|
7634
|
-
/* @__PURE__ */ (0,
|
|
7635
|
-
/* @__PURE__ */ (0,
|
|
7820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
7821
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_design_system53.VerticalRhythm, { gap: "xs", children: [
|
|
7822
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { css: Title2, children: sortByLabel }),
|
|
7823
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { css: SortFilterInputRow, children: [
|
|
7824
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7636
7825
|
InputVariables,
|
|
7637
7826
|
{
|
|
7638
7827
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7640,8 +7829,8 @@ var SortItems = ({
|
|
|
7640
7829
|
value: sortField,
|
|
7641
7830
|
valueToResetTo: "created_at",
|
|
7642
7831
|
onChange: (e) => onSortChange(`${e}_${sortDirection}`),
|
|
7643
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
7644
|
-
|
|
7832
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7833
|
+
import_design_system53.InputComboBox,
|
|
7645
7834
|
{
|
|
7646
7835
|
id: "sort-by-field",
|
|
7647
7836
|
"aria-label": "Sort by",
|
|
@@ -7663,7 +7852,7 @@ var SortItems = ({
|
|
|
7663
7852
|
)
|
|
7664
7853
|
}
|
|
7665
7854
|
),
|
|
7666
|
-
/* @__PURE__ */ (0,
|
|
7855
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7667
7856
|
InputVariables,
|
|
7668
7857
|
{
|
|
7669
7858
|
disableInlineMenu: disableSortBinding,
|
|
@@ -7671,8 +7860,8 @@ var SortItems = ({
|
|
|
7671
7860
|
valueToResetTo: "DESC",
|
|
7672
7861
|
showMenuPosition: disableSortBinding ? void 0 : "inline-right",
|
|
7673
7862
|
onChange: (e) => onSortChange(`${sortField}_${e}`),
|
|
7674
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
7675
|
-
|
|
7863
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7864
|
+
import_design_system53.SegmentedControl,
|
|
7676
7865
|
{
|
|
7677
7866
|
noCheckmark: true,
|
|
7678
7867
|
name: "sortBy",
|
|
@@ -7703,15 +7892,15 @@ var SortItems = ({
|
|
|
7703
7892
|
)
|
|
7704
7893
|
] })
|
|
7705
7894
|
] }),
|
|
7706
|
-
hideLocaleOptions ? null : /* @__PURE__ */ (0,
|
|
7895
|
+
hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system53.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7707
7896
|
InputVariables,
|
|
7708
7897
|
{
|
|
7709
7898
|
label: localeLabelValue,
|
|
7710
7899
|
value: localeValue,
|
|
7711
7900
|
showMenuPosition: "inline-right",
|
|
7712
7901
|
onChange: (e) => onLocaleChange(e != null ? e : ""),
|
|
7713
|
-
inputWhenNoVariables: /* @__PURE__ */ (0,
|
|
7714
|
-
|
|
7902
|
+
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7903
|
+
import_design_system53.InputSelect,
|
|
7715
7904
|
{
|
|
7716
7905
|
name: "localeReturned",
|
|
7717
7906
|
"aria-label": localeLabelValue,
|
|
@@ -7741,7 +7930,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7741
7930
|
|
|
7742
7931
|
// src/utils/useContentDataResourceLocaleInfo.ts
|
|
7743
7932
|
var import_canvas12 = require("@uniformdev/canvas");
|
|
7744
|
-
var
|
|
7933
|
+
var import_react75 = require("react");
|
|
7745
7934
|
function useContentDataResourceLocaleInfo({
|
|
7746
7935
|
locale,
|
|
7747
7936
|
defaultLocale,
|
|
@@ -7749,12 +7938,12 @@ function useContentDataResourceLocaleInfo({
|
|
|
7749
7938
|
dynamicInputs
|
|
7750
7939
|
}) {
|
|
7751
7940
|
var _a;
|
|
7752
|
-
const setLocaleRef = (0,
|
|
7941
|
+
const setLocaleRef = (0, import_react75.useRef)(setLocale);
|
|
7753
7942
|
setLocaleRef.current = setLocale;
|
|
7754
7943
|
const { flatVariables } = useVariables();
|
|
7755
7944
|
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 : "";
|
|
7756
7945
|
const boundLocale = (_a = (0, import_canvas12.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
|
|
7757
|
-
(0,
|
|
7946
|
+
(0, import_react75.useEffect)(() => {
|
|
7758
7947
|
if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
|
|
7759
7948
|
setLocaleRef.current(effectiveLocale);
|
|
7760
7949
|
}
|
|
@@ -7763,7 +7952,7 @@ function useContentDataResourceLocaleInfo({
|
|
|
7763
7952
|
}
|
|
7764
7953
|
|
|
7765
7954
|
// src/index.ts
|
|
7766
|
-
var
|
|
7955
|
+
var import_design_system54 = require("@uniformdev/design-system");
|
|
7767
7956
|
__reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
7768
7957
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7769
7958
|
0 && (module.exports = {
|
|
@@ -7785,6 +7974,9 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7785
7974
|
DataTypeEditor,
|
|
7786
7975
|
DateEditor,
|
|
7787
7976
|
DateRangeEditor,
|
|
7977
|
+
DelegationContext,
|
|
7978
|
+
DelegationGate,
|
|
7979
|
+
DelegationProvider,
|
|
7788
7980
|
DrawerContent,
|
|
7789
7981
|
EDIT_VARIABLE_COMMAND,
|
|
7790
7982
|
FilterButton,
|
|
@@ -7897,6 +8089,7 @@ __reExport(index_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
7897
8089
|
urlEncodeRequestUrl,
|
|
7898
8090
|
useConnectedDataAsVariables,
|
|
7899
8091
|
useContentDataResourceLocaleInfo,
|
|
8092
|
+
useDelegation,
|
|
7900
8093
|
useDynamicInputsAsVariables,
|
|
7901
8094
|
useMeshLocation,
|
|
7902
8095
|
useObjectSearchContext,
|