@uniformdev/mesh-sdk-react 19.136.1-alpha.4 → 19.138.0

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.js CHANGED
@@ -33,71 +33,67 @@ var src_exports = {};
33
33
  __export(src_exports, {
34
34
  $createVariableNode: () => $createVariableNode,
35
35
  $isVariableNode: () => $isVariableNode,
36
- AddListButton: () => import_design_system44.AddListButton,
37
- Button: () => import_design_system44.Button,
38
- Callout: () => import_design_system44.Callout,
39
- ControlledObjectSearchProvider: () => ControlledObjectSearchProvider,
36
+ AddListButton: () => import_design_system43.AddListButton,
37
+ Button: () => import_design_system43.Button,
38
+ Callout: () => import_design_system43.Callout,
40
39
  ControlledValuePlugin: () => ControlledValuePlugin,
41
40
  DISCONNECT_VARIABLE_COMMAND: () => DISCONNECT_VARIABLE_COMMAND,
42
41
  DamSelectedItem: () => DamSelectedItem,
43
42
  DataRefreshButton: () => DataRefreshButton,
44
43
  DataResourceDynamicInputProvider: () => DataResourceDynamicInputProvider,
45
- DataResourceInputContext: () => DataResourceInputContext,
46
44
  DataResourceVariablesList: () => DataResourceVariablesList,
47
45
  DataResourceVariablesListExplicit: () => DataResourceVariablesListExplicit,
48
46
  DataSourceEditor: () => DataSourceEditor,
49
47
  DataTypeEditor: () => DataTypeEditor,
50
48
  DefaultSearchRow: () => DefaultSearchRow,
51
49
  DefaultSelectedItem: () => DefaultSelectedItem,
52
- DrawerContent: () => import_design_system44.DrawerContent,
50
+ DrawerContent: () => import_design_system43.DrawerContent,
53
51
  EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
54
52
  EntrySearch: () => EntrySearch,
55
- Heading: () => import_design_system44.Heading,
53
+ Heading: () => import_design_system43.Heading,
56
54
  INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
57
55
  Icons: () => icons_exports,
58
- Input: () => import_design_system44.Input,
59
- InputComboBox: () => import_design_system44.InputComboBox,
60
- InputKeywordSearch: () => import_design_system44.InputKeywordSearch,
61
- InputSelect: () => import_design_system44.InputSelect,
62
- InputToggle: () => import_design_system44.InputToggle,
56
+ Input: () => import_design_system43.Input,
57
+ InputComboBox: () => import_design_system43.InputComboBox,
58
+ InputKeywordSearch: () => import_design_system43.InputKeywordSearch,
59
+ InputSelect: () => import_design_system43.InputSelect,
60
+ InputToggle: () => import_design_system43.InputToggle,
63
61
  InputVariables: () => InputVariables,
64
- Label: () => import_design_system44.Label,
62
+ Label: () => import_design_system43.Label,
65
63
  LinkButton: () => LinkButton,
66
- LoadingIndicator: () => import_design_system44.LoadingIndicator,
67
- LoadingOverlay: () => import_design_system44.LoadingOverlay,
68
- Menu: () => import_design_system44.Menu,
69
- MenuItem: () => import_design_system44.MenuItem,
64
+ LoadingIndicator: () => import_design_system43.LoadingIndicator,
65
+ LoadingOverlay: () => import_design_system43.LoadingOverlay,
66
+ Menu: () => import_design_system43.Menu,
67
+ MenuItem: () => import_design_system43.MenuItem,
70
68
  MeshApp: () => MeshApp,
71
69
  OPEN_INSERT_VARIABLE_COMMAND: () => OPEN_INSERT_VARIABLE_COMMAND,
72
70
  ObjectSearchContainer: () => ObjectSearchContainer,
73
- ObjectSearchContext: () => ObjectSearchContext,
74
71
  ObjectSearchFilter: () => ObjectSearchFilter,
75
72
  ObjectSearchFilterContainer: () => ObjectSearchFilterContainer2,
76
73
  ObjectSearchListItem: () => ObjectSearchListItem,
77
74
  ObjectSearchListItemLoadingSkeleton: () => ObjectSearchListItemLoadingSkeleton,
78
- ObjectSearchListOfSearchResults: () => ObjectSearchListOfSearchResults,
79
75
  ObjectSearchProvider: () => ObjectSearchProvider,
80
76
  ObjectSearchResultItem: () => ObjectSearchResultItem,
81
77
  ObjectSearchResultItemButton: () => ObjectSearchResultItemButton,
82
78
  ObjectSearchResultList: () => ObjectSearchResultList,
83
79
  ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
84
80
  ParameterConnectionIndicator: () => ParameterConnectionIndicator,
85
- ParameterGroup: () => import_design_system44.ParameterGroup,
86
- ParameterImage: () => import_design_system44.ParameterImage,
87
- ParameterImageInner: () => import_design_system44.ParameterImageInner,
88
- ParameterInput: () => import_design_system44.ParameterInput,
89
- ParameterInputInner: () => import_design_system44.ParameterInputInner,
90
- ParameterLabel: () => import_design_system44.ParameterLabel,
91
- ParameterMenuButton: () => import_design_system44.ParameterMenuButton,
81
+ ParameterGroup: () => import_design_system43.ParameterGroup,
82
+ ParameterImage: () => import_design_system43.ParameterImage,
83
+ ParameterImageInner: () => import_design_system43.ParameterImageInner,
84
+ ParameterInput: () => import_design_system43.ParameterInput,
85
+ ParameterInputInner: () => import_design_system43.ParameterInputInner,
86
+ ParameterLabel: () => import_design_system43.ParameterLabel,
87
+ ParameterMenuButton: () => import_design_system43.ParameterMenuButton,
92
88
  ParameterOrSingleVariable: () => ParameterOrSingleVariable,
93
- ParameterSelect: () => import_design_system44.ParameterSelect,
94
- ParameterSelectInner: () => import_design_system44.ParameterSelectInner,
95
- ParameterShell: () => import_design_system44.ParameterShell,
89
+ ParameterSelect: () => import_design_system43.ParameterSelect,
90
+ ParameterSelectInner: () => import_design_system43.ParameterSelectInner,
91
+ ParameterShell: () => import_design_system43.ParameterShell,
96
92
  ParameterShellContext: () => import_design_system14.ParameterShellContext,
97
- ParameterTextarea: () => import_design_system44.ParameterTextarea,
98
- ParameterTextareaInner: () => import_design_system44.ParameterTextareaInner,
99
- ParameterToggle: () => import_design_system44.ParameterToggle,
100
- ParameterToggleInner: () => import_design_system44.ParameterToggleInner,
93
+ ParameterTextarea: () => import_design_system43.ParameterTextarea,
94
+ ParameterTextareaInner: () => import_design_system43.ParameterTextareaInner,
95
+ ParameterToggle: () => import_design_system43.ParameterToggle,
96
+ ParameterToggleInner: () => import_design_system43.ParameterToggleInner,
101
97
  ParameterVariables: () => ParameterVariables,
102
98
  ProductPreviewList: () => ProductPreviewList,
103
99
  ProductQuery: () => ProductQuery,
@@ -116,20 +112,19 @@ __export(src_exports, {
116
112
  RequestUrl: () => RequestUrl,
117
113
  RequestUrlInput: () => RequestUrlInput,
118
114
  ResolvableLoadingValue: () => ResolvableLoadingValue,
119
- ScrollableList: () => import_design_system44.ScrollableList,
120
- ScrollableListItem: () => import_design_system44.ScrollableListItem,
115
+ ScrollableList: () => import_design_system43.ScrollableList,
116
+ ScrollableListItem: () => import_design_system43.ScrollableListItem,
121
117
  SelectionField: () => SelectionField,
122
- Switch: () => import_design_system44.Switch,
118
+ Switch: () => import_design_system43.Switch,
123
119
  TextVariableRenderer: () => TextVariableRenderer,
124
- Textarea: () => import_design_system44.Textarea,
125
- Theme: () => import_design_system44.Theme,
120
+ Textarea: () => import_design_system43.Textarea,
121
+ Theme: () => import_design_system43.Theme,
126
122
  VariableEditor: () => VariableEditor,
127
123
  VariableNode: () => VariableNode,
128
124
  VariablesList: () => VariablesList,
129
125
  VariablesPlugin: () => VariablesPlugin,
130
126
  VariablesProvider: () => VariablesProvider,
131
127
  badgeIcon: () => badgeIcon,
132
- bindQuery: () => bindQuery,
133
128
  bindableFiltersMapper: () => bindableFiltersMapper,
134
129
  convertConnectedDataToVariable: () => convertConnectedDataToVariable,
135
130
  createLocationValidator: () => createLocationValidator,
@@ -202,7 +197,6 @@ __export(src_exports, {
202
197
  urlEncodeRequestUrl: () => urlEncodeRequestUrl,
203
198
  useConnectedDataAsVariables: () => useConnectedDataAsVariables,
204
199
  useContentDataResourceLocaleInfo: () => useContentDataResourceLocaleInfo,
205
- useDataResourceDynamicInputs: () => useDataResourceDynamicInputs,
206
200
  useDynamicInputsAsVariables: () => useDynamicInputsAsVariables,
207
201
  useMeshLocation: () => useMeshLocation,
208
202
  useObjectSearchContext: () => useObjectSearchContext,
@@ -2862,9 +2856,6 @@ function DefaultDamItemRenderer({ item }) {
2862
2856
  ] }) : null;
2863
2857
  }
2864
2858
 
2865
- // src/components/DataResourceDynamicInputProvider.tsx
2866
- var import_react59 = require("react");
2867
-
2868
2859
  // src/hooks/useConnectedDataAsVariables.tsx
2869
2860
  var import_react26 = require("react");
2870
2861
  function useConnectedDataAsVariables(connectedData) {
@@ -5069,7 +5060,7 @@ function InputVariables(props) {
5069
5060
  },
5070
5061
  id: finalId,
5071
5062
  isActive: hadVariablesInValue,
5072
- disableVariables: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === true || disableInlineMenu === "by-label",
5063
+ disableVariables: disableVariablesForReals || showMenuPosition && showMenuPosition !== "label" || disableInlineMenu === "by-label",
5073
5064
  children: input3
5074
5065
  }
5075
5066
  );
@@ -5532,10 +5523,6 @@ function VariablesList() {
5532
5523
 
5533
5524
  // src/components/DataResourceDynamicInputProvider.tsx
5534
5525
  var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
5535
- var DataResourceInputContext = (0, import_react59.createContext)(void 0);
5536
- var useDataResourceDynamicInputs = () => {
5537
- return (0, import_react59.useContext)(DataResourceInputContext);
5538
- };
5539
5526
  function DataResourceDynamicInputProvider(props) {
5540
5527
  const { children, dynamicInputs } = props;
5541
5528
  if (dynamicInputs) {
@@ -5554,7 +5541,7 @@ function DataResourceDynamicInputProviderRenderer({
5554
5541
  dynamicInputs
5555
5542
  }) {
5556
5543
  const variables = useDynamicInputsAsVariables(dynamicInputs);
5557
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DataResourceInputContext.Provider, { value: dynamicInputs, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(VariablesProvider, { value: variables, readOnly: true, children }) });
5544
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(VariablesProvider, { value: variables, readOnly: true, children });
5558
5545
  }
5559
5546
 
5560
5547
  // src/components/DataResourceVariablesList.tsx
@@ -5631,9 +5618,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
5631
5618
  }
5632
5619
 
5633
5620
  // src/components/Request/RequestBody.tsx
5634
- var import_react61 = require("@emotion/react");
5621
+ var import_react60 = require("@emotion/react");
5635
5622
  var import_design_system27 = require("@uniformdev/design-system");
5636
- var import_react62 = require("react");
5623
+ var import_react61 = require("react");
5637
5624
 
5638
5625
  // src/components/Request/RequestProvider.tsx
5639
5626
  var React11 = __toESM(require("react"));
@@ -5717,11 +5704,11 @@ function useRequest() {
5717
5704
  }
5718
5705
 
5719
5706
  // src/components/Request/styles/Request.styles.ts
5720
- var import_react60 = require("@emotion/react");
5721
- var innerContentStyles = import_react60.css`
5707
+ var import_react59 = require("@emotion/react");
5708
+ var innerContentStyles = import_react59.css`
5722
5709
  background: var(--white);
5723
5710
  `;
5724
- var requestTypeContainer = (bgColor) => import_react60.css`
5711
+ var requestTypeContainer = (bgColor) => import_react59.css`
5725
5712
  align-items: start;
5726
5713
  background: ${bgColor};
5727
5714
  display: grid;
@@ -5759,11 +5746,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
5759
5746
  };
5760
5747
  function RequestBody() {
5761
5748
  const { request, dispatch } = useRequest();
5762
- const [language, setLanguage] = (0, import_react62.useState)("json");
5749
+ const [language, setLanguage] = (0, import_react61.useState)("json");
5763
5750
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5764
5751
  "div",
5765
5752
  {
5766
- css: import_react61.css`
5753
+ css: import_react60.css`
5767
5754
  background: var(--white);
5768
5755
  `,
5769
5756
  children: [
@@ -5771,7 +5758,7 @@ function RequestBody() {
5771
5758
  RequestTypeContainer,
5772
5759
  {
5773
5760
  bgColor: "var(--gray-100)",
5774
- css: import_react61.css`
5761
+ css: import_react60.css`
5775
5762
  padding: var(--spacing-sm) var(--spacing-base);
5776
5763
  `,
5777
5764
  children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
@@ -6042,8 +6029,8 @@ function RequestParameters({
6042
6029
  }
6043
6030
 
6044
6031
  // src/components/Request/RequestUrl.tsx
6045
- var import_react63 = require("@emotion/react");
6046
- var import_react64 = require("react");
6032
+ var import_react62 = require("@emotion/react");
6033
+ var import_react63 = require("react");
6047
6034
 
6048
6035
  // src/components/Request/urlEncodeRequestParameter.ts
6049
6036
  function urlEncodeRequestUrl(url, varValues) {
@@ -6069,7 +6056,7 @@ function RequestUrl() {
6069
6056
  var _a, _b;
6070
6057
  const { variables } = useVariables();
6071
6058
  const { request } = useRequest();
6072
- const mergedParameters = (0, import_react64.useMemo)(() => {
6059
+ const mergedParameters = (0, import_react63.useMemo)(() => {
6073
6060
  var _a2;
6074
6061
  if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
6075
6062
  return request.parameters;
@@ -6079,7 +6066,7 @@ function RequestUrl() {
6079
6066
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6080
6067
  "small",
6081
6068
  {
6082
- css: import_react63.css`
6069
+ css: import_react62.css`
6083
6070
  display: inline-block;
6084
6071
  margin-bottom: var(--spacing-xs);
6085
6072
  word-break: break-word;
@@ -6317,12 +6304,12 @@ var import_design_system31 = require("@uniformdev/design-system");
6317
6304
 
6318
6305
  // src/hooks/useInitializeUniformMeshSdk.ts
6319
6306
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
6320
- var import_react65 = require("react");
6307
+ var import_react64 = require("react");
6321
6308
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
6322
- const [error, setError] = (0, import_react65.useState)();
6323
- const [sdk, setSdk] = (0, import_react65.useState)();
6324
- const initializationInProgress = (0, import_react65.useRef)(false);
6325
- (0, import_react65.useEffect)(
6309
+ const [error, setError] = (0, import_react64.useState)();
6310
+ const [sdk, setSdk] = (0, import_react64.useState)();
6311
+ const initializationInProgress = (0, import_react64.useRef)(false);
6312
+ (0, import_react64.useEffect)(
6326
6313
  () => {
6327
6314
  if (typeof window === "undefined" || sdk) {
6328
6315
  return;
@@ -6380,7 +6367,7 @@ var MeshApp = ({
6380
6367
  };
6381
6368
 
6382
6369
  // src/components/ObjectSearch/DataRefreshButton.tsx
6383
- var import_react66 = require("@emotion/react");
6370
+ var import_react65 = require("@emotion/react");
6384
6371
  var import_design_system32 = require("@uniformdev/design-system");
6385
6372
  var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
6386
6373
  var DataRefreshButton = ({
@@ -6393,7 +6380,7 @@ var DataRefreshButton = ({
6393
6380
  !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
6394
6381
  import_design_system32.LoadingIndicator,
6395
6382
  {
6396
- css: import_react66.css`
6383
+ css: import_react65.css`
6397
6384
  ${isLoading ? "opacity: 0.2;" : void 0}
6398
6385
  `
6399
6386
  }
@@ -6403,16 +6390,15 @@ var DataRefreshButton = ({
6403
6390
  };
6404
6391
 
6405
6392
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
6406
- var import_react72 = require("@emotion/react");
6393
+ var import_react68 = require("@emotion/react");
6407
6394
  var import_canvas9 = require("@uniformdev/canvas");
6408
- var import_design_system38 = require("@uniformdev/design-system");
6409
- var import_react73 = __toESM(require("react"));
6395
+ var import_design_system35 = require("@uniformdev/design-system");
6410
6396
 
6411
6397
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
6412
6398
  var import_canvas8 = require("@uniformdev/canvas");
6413
- var import_react67 = require("react");
6399
+ var import_react66 = require("react");
6414
6400
  var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
6415
- var ObjectSearchContext = (0, import_react67.createContext)({
6401
+ var ObjectSearchContext = (0, import_react66.createContext)({
6416
6402
  onSetQuery: () => {
6417
6403
  },
6418
6404
  onSelectItem: () => {
@@ -6420,6 +6406,8 @@ var ObjectSearchContext = (0, import_react67.createContext)({
6420
6406
  query: {},
6421
6407
  boundQuery: {},
6422
6408
  list: {},
6409
+ onSetList: () => {
6410
+ },
6423
6411
  selectedListItems: [],
6424
6412
  onRemoveAllSelectedItems: () => {
6425
6413
  },
@@ -6431,16 +6419,16 @@ var ObjectSearchProvider = ({
6431
6419
  children,
6432
6420
  defaultQuery
6433
6421
  }) => {
6434
- const [query, setQuery] = (0, import_react67.useState)({
6422
+ const [query, setQuery] = (0, import_react66.useState)({
6435
6423
  contentType: "",
6436
6424
  keyword: "",
6437
6425
  ...defaultQuery
6438
6426
  });
6439
6427
  const { flatVariables } = useVariables(true);
6440
- const querySearchDeferred = (0, import_react67.useDeferredValue)(query);
6441
- const [selectedItems, setSelectedItems] = (0, import_react67.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
6442
- const [list, setList] = (0, import_react67.useState)({});
6443
- const onSetQuery = (0, import_react67.useCallback)(
6428
+ const querySearchDeferred = (0, import_react66.useDeferredValue)(query);
6429
+ const [selectedItems, setSelectedItems] = (0, import_react66.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
6430
+ const [list, setList] = (0, import_react66.useState)({});
6431
+ const onSetQuery = (0, import_react66.useCallback)(
6444
6432
  (value2) => {
6445
6433
  if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
6446
6434
  return setQuery({
@@ -6452,7 +6440,7 @@ var ObjectSearchProvider = ({
6452
6440
  },
6453
6441
  [setQuery]
6454
6442
  );
6455
- const onSelectItem = (0, import_react67.useCallback)(
6443
+ const onSelectItem = (0, import_react66.useCallback)(
6456
6444
  (selectedResult) => {
6457
6445
  if (Array.isArray(selectedResult)) {
6458
6446
  setSelectedItems(selectedResult);
@@ -6466,17 +6454,17 @@ var ObjectSearchProvider = ({
6466
6454
  },
6467
6455
  [setSelectedItems, selectedItems]
6468
6456
  );
6469
- const onRemoveAllSelectedItems = (0, import_react67.useCallback)(() => {
6457
+ const onRemoveAllSelectedItems = (0, import_react66.useCallback)(() => {
6470
6458
  setSelectedItems([]);
6471
6459
  }, [setSelectedItems]);
6472
- const onSetList = (0, import_react67.useCallback)(
6460
+ const onSetList = (0, import_react66.useCallback)(
6473
6461
  (value2) => {
6474
6462
  setList(value2);
6475
6463
  },
6476
6464
  [setList]
6477
6465
  );
6478
- const boundQuery = (0, import_react67.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
6479
- const value = (0, import_react67.useMemo)(
6466
+ const boundQuery = (0, import_react66.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
6467
+ const value = (0, import_react66.useMemo)(
6480
6468
  () => ({
6481
6469
  boundQuery,
6482
6470
  onSetQuery,
@@ -6503,7 +6491,7 @@ var ObjectSearchProvider = ({
6503
6491
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ObjectSearchContext.Provider, { value, children });
6504
6492
  };
6505
6493
  function useObjectSearchContext() {
6506
- return (0, import_react67.useContext)(ObjectSearchContext);
6494
+ return (0, import_react66.useContext)(ObjectSearchContext);
6507
6495
  }
6508
6496
  function bindQuery(query, inputs) {
6509
6497
  const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
@@ -6521,9 +6509,9 @@ function bindQuery(query, inputs) {
6521
6509
  var import_design_system34 = require("@uniformdev/design-system");
6522
6510
 
6523
6511
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
6524
- var import_react68 = require("@emotion/react");
6512
+ var import_react67 = require("@emotion/react");
6525
6513
  var import_design_system33 = require("@uniformdev/design-system");
6526
- var ObjectListItemContainer = import_react68.css`
6514
+ var ObjectListItemContainer = import_react67.css`
6527
6515
  align-items: center;
6528
6516
  border: 1px solid var(--gray-300);
6529
6517
  border-radius: var(--rounded-base);
@@ -6532,11 +6520,11 @@ var ObjectListItemContainer = import_react68.css`
6532
6520
  grid-template-columns: 1fr auto;
6533
6521
  padding: var(--spacing-sm);
6534
6522
  `;
6535
- var ObjectListItemContainerDisabled = import_react68.css`
6523
+ var ObjectListItemContainerDisabled = import_react67.css`
6536
6524
  opacity: var(--opacity-50);
6537
6525
  pointer-events: none;
6538
6526
  `;
6539
- var ObjectListItemLoading = import_react68.css`
6527
+ var ObjectListItemLoading = import_react67.css`
6540
6528
  animation: ${import_design_system33.skeletonLoading} 1s linear infinite alternate;
6541
6529
  border-color: transparent;
6542
6530
  min-height: 42px;
@@ -6560,36 +6548,36 @@ var ObjectListItemLoading = import_react68.css`
6560
6548
  width: 1rem;
6561
6549
  }
6562
6550
  `;
6563
- var ObjectListItemHeadingGroup = import_react68.css`
6551
+ var ObjectListItemHeadingGroup = import_react67.css`
6564
6552
  align-items: center;
6565
6553
  display: grid;
6566
6554
  `;
6567
- var ObjectListItemThumbnail = import_react68.css`
6555
+ var ObjectListItemThumbnail = import_react67.css`
6568
6556
  width: 30px;
6569
6557
  object-fit: contain;
6570
6558
  `;
6571
- var ObjectListItemTitle = import_react68.css`
6559
+ var ObjectListItemTitle = import_react67.css`
6572
6560
  color: var(--typography-base);
6573
6561
  display: block;
6574
6562
  font-size: var(--fs-sm);
6575
6563
  `;
6576
- var ObjectListItemSubtitle = import_react68.css`
6564
+ var ObjectListItemSubtitle = import_react67.css`
6577
6565
  color: var(--gray-500);
6578
6566
  display: block;
6579
6567
  font-size: var(--fs-xs);
6580
6568
  line-height: 1;
6581
6569
  `;
6582
- var ObjectListItemInfoContainer = import_react68.css`
6570
+ var ObjectListItemInfoContainer = import_react67.css`
6583
6571
  align-items: center;
6584
6572
  display: flex;
6585
6573
  gap: var(--spacing-sm);
6586
6574
  justify-content: center;
6587
6575
  `;
6588
- var ObjectListItemControlledContent = import_react68.css`
6576
+ var ObjectListItemControlledContent = import_react67.css`
6589
6577
  display: flex;
6590
6578
  gap: var(--spacing-sm);
6591
6579
  `;
6592
- var ObjectListItemUnControlledContent = import_react68.css`
6580
+ var ObjectListItemUnControlledContent = import_react67.css`
6593
6581
  margin-top: var(--spacing-sm);
6594
6582
  grid-column: 1 / -1;
6595
6583
  `;
@@ -6659,19 +6647,202 @@ var ObjectSearchListItemLoadingSkeleton = () => {
6659
6647
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
6660
6648
  };
6661
6649
 
6662
- // src/components/ObjectSearch/ObjectSearchResultList.tsx
6663
- var import_design_system37 = require("@uniformdev/design-system");
6664
- var import_react_beautiful_dnd4 = require("react-beautiful-dnd");
6650
+ // src/components/ObjectSearch/ObjectSearchContainer.tsx
6651
+ var import_jsx_runtime61 = require("@emotion/react/jsx-runtime");
6652
+ var ObjectSearchContainer = ({
6653
+ label,
6654
+ enableDynamicInputToResultId,
6655
+ searchFilters,
6656
+ resultList,
6657
+ children
6658
+ }) => {
6659
+ var _a, _b;
6660
+ const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6661
+ const { flatVariables } = useVariables(true);
6662
+ const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6663
+ const listItems = resultList != null ? resultList : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6664
+ import_design_system35.ScrollableList,
6665
+ {
6666
+ role: "list",
6667
+ css: import_react68.css`
6668
+ > div {
6669
+ transition: max-height var(--duration-slow) var(--timing-ease-out);
6670
+ max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6671
+ }
6672
+ `,
6673
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DefaultResultList, {})
6674
+ }
6675
+ );
6676
+ const body = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_design_system35.VerticalRhythm, { children: [
6677
+ searchFilters,
6678
+ listItems
6679
+ ] });
6680
+ const handleSelectedVariableChange = (selectedValue) => {
6681
+ var _a2;
6682
+ if (!selectedValue) {
6683
+ onSelectItem([]);
6684
+ return;
6685
+ }
6686
+ const { result, errors } = (0, import_canvas9.bindVariables)({
6687
+ value: selectedValue,
6688
+ variables: flatVariables,
6689
+ errorPrefix: "Dynamic input"
6690
+ });
6691
+ if (!result) {
6692
+ onSelectItem([]);
6693
+ return;
6694
+ }
6695
+ const item = (_a2 = list.items) == null ? void 0 : _a2.find((i) => i.id === result);
6696
+ onSelectItem([
6697
+ {
6698
+ title: selectedValue,
6699
+ contentType: (errors == null ? void 0 : errors.length) ? errors[0] instanceof Error ? errors[0].message : errors[0] : `Current dynamic value "${result}" is not an ID in the options`,
6700
+ // spread any matched list item, overriding the above default props
6701
+ ...item,
6702
+ // we want to make sure the ID is our dynamic value
6703
+ id: selectedValue
6704
+ }
6705
+ ]);
6706
+ };
6707
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system35.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_design_system35.VerticalRhythm, { children: [
6708
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system35.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6709
+ InputVariables,
6710
+ {
6711
+ label,
6712
+ value: inputValue,
6713
+ onChange: (value) => {
6714
+ if (value === inputValue) {
6715
+ return;
6716
+ }
6717
+ handleSelectedVariableChange(value);
6718
+ },
6719
+ inputWhenNoVariables: body,
6720
+ disableVariables: !enableDynamicInputToResultId
6721
+ }
6722
+ ) : body }),
6723
+ children
6724
+ ] }) });
6725
+ };
6726
+ var DefaultResultList = () => {
6727
+ var _a;
6728
+ const { list } = useObjectSearchContext();
6729
+ if (!list.items) {
6730
+ return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ObjectSearchListItemLoadingSkeleton, {}, i));
6731
+ }
6732
+ if (list.items.length === 0) {
6733
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_design_system35.Callout, { type: "info", children: "No results were found" });
6734
+ }
6735
+ return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ObjectSearchListItem, { ...item }, item.id));
6736
+ };
6665
6737
 
6666
- // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6738
+ // src/components/ObjectSearch/ObjectSearchFilter.tsx
6667
6739
  var import_design_system36 = require("@uniformdev/design-system");
6740
+ var import_react70 = require("react");
6741
+
6742
+ // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
6743
+ var import_react69 = require("@emotion/react");
6744
+ var ObjectSearchFilterContainerLabel = import_react69.css`
6745
+ align-items: center;
6746
+ display: flex;
6747
+ font-size: var(--fs-sm);
6748
+ font-weight: var(--fw-bold);
6749
+ line-height: 1rem;
6750
+ margin-bottom: var(--spacing-sm);
6751
+ `;
6752
+ var ObjectSearchFilterContainer = import_react69.css`
6753
+ display: grid;
6754
+ gap: var(--spacing-base);
6755
+ `;
6756
+ var ObjectSearchFilterGrid = (gridColumns) => import_react69.css`
6757
+ display: grid;
6758
+ grid-template-columns: ${gridColumns};
6759
+ gap: var(--spacing-base);
6760
+ `;
6761
+
6762
+ // src/components/ObjectSearch/ObjectSearchFilter.tsx
6763
+ var import_jsx_runtime62 = require("@emotion/react/jsx-runtime");
6764
+ var ObjectSearchFilter = ({
6765
+ requireContentType,
6766
+ typeSelectorAllTypesOptionText = "All content types",
6767
+ searchInputName = "searchText",
6768
+ searchInputPlaceholderText = "Enter keyword to narrow your results",
6769
+ selectLabel = "Content Type Select",
6770
+ selectOptions
6771
+ }) => {
6772
+ var _a, _b;
6773
+ const { query, onSetQuery } = useObjectSearchContext();
6774
+ const [searchState, setSearchState] = (0, import_react70.useState)({
6775
+ contentType: (_a = query.contentType) != null ? _a : "",
6776
+ keyword: (_b = query.keyword) != null ? _b : ""
6777
+ });
6778
+ const handleFilterChange = (value) => {
6779
+ setSearchState((prev) => {
6780
+ return { ...prev, ...value };
6781
+ });
6782
+ onSetQuery({ ...query, ...value });
6783
+ };
6784
+ const memoizedSelectOptions = (0, import_react70.useMemo)(() => {
6785
+ if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
6786
+ return [];
6787
+ }
6788
+ return [
6789
+ ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6790
+ ...selectOptions != null ? selectOptions : []
6791
+ ];
6792
+ }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6793
+ const shouldRenderSelect = memoizedSelectOptions.length > 0;
6794
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
6795
+ "fieldset",
6796
+ {
6797
+ css: [
6798
+ ObjectSearchFilterContainer,
6799
+ ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
6800
+ ],
6801
+ children: [
6802
+ memoizedSelectOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6803
+ import_design_system36.InputSelect,
6804
+ {
6805
+ label: selectLabel,
6806
+ showLabel: false,
6807
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
6808
+ options: memoizedSelectOptions,
6809
+ value: query.contentType
6810
+ }
6811
+ ) : null,
6812
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6813
+ import_design_system36.DebouncedInputKeywordSearch,
6814
+ {
6815
+ inputFieldName: searchInputName,
6816
+ placeholder: searchInputPlaceholderText,
6817
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
6818
+ disabledFieldSubmission: true,
6819
+ defaultValue: searchState.keyword,
6820
+ delay: 300
6821
+ }
6822
+ )
6823
+ ]
6824
+ }
6825
+ );
6826
+ };
6827
+
6828
+ // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
6829
+ var import_jsx_runtime63 = require("@emotion/react/jsx-runtime");
6830
+ var ObjectSearchFilterContainer2 = ({ label, children }) => {
6831
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { children: [
6832
+ label ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
6833
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { css: ObjectSearchFilterContainer, children })
6834
+ ] });
6835
+ };
6836
+
6837
+ // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6838
+ var import_design_system38 = require("@uniformdev/design-system");
6668
6839
  var import_timeago3 = require("timeago.js");
6669
6840
 
6670
6841
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
6671
- var import_react69 = require("@emotion/react");
6672
- var import_design_system35 = require("@uniformdev/design-system");
6673
- var ButtonStyles = import_react69.css`
6674
- ${import_design_system35.button}
6842
+ var import_react71 = require("@emotion/react");
6843
+ var import_design_system37 = require("@uniformdev/design-system");
6844
+ var ButtonStyles = import_react71.css`
6845
+ ${import_design_system37.button}
6675
6846
  background: transparent;
6676
6847
  border: 1px solid var(--typography-base);
6677
6848
  color: var(--typography-base);
@@ -6697,20 +6868,20 @@ var ButtonStyles = import_react69.css`
6697
6868
  text-decoration: none;
6698
6869
  }
6699
6870
  `;
6700
- var ButtonIcon = import_react69.css`
6871
+ var ButtonIcon = import_react71.css`
6701
6872
  width: 1rem;
6702
6873
  height: 1rem;
6703
6874
  `;
6704
6875
 
6705
6876
  // src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
6706
- var import_jsx_runtime61 = require("@emotion/react/jsx-runtime");
6877
+ var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
6707
6878
  var ObjectSearchResultItemButton = ({
6708
6879
  text,
6709
6880
  icon,
6710
6881
  ...props
6711
6882
  }) => {
6712
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
6713
- !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Image, { src: icon, css: ButtonIcon }),
6883
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
6884
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Image, { src: icon, css: ButtonIcon }),
6714
6885
  text
6715
6886
  ] });
6716
6887
  };
@@ -6719,15 +6890,15 @@ var LinkButton = ({
6719
6890
  icon,
6720
6891
  ...props
6721
6892
  }) => {
6722
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
6723
- !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Image, { src: icon, css: ButtonIcon }),
6893
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
6894
+ !icon ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Image, { src: icon, css: ButtonIcon }),
6724
6895
  text
6725
6896
  ] });
6726
6897
  };
6727
6898
 
6728
6899
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
6729
- var import_react70 = require("@emotion/react");
6730
- var ObjectSearchResultItemContainer = import_react70.css`
6900
+ var import_react72 = require("@emotion/react");
6901
+ var ObjectSearchResultItemContainer = import_react72.css`
6731
6902
  align-items: center;
6732
6903
  border: 1px solid var(--gray-300);
6733
6904
  border-radius: var(--rounded-base);
@@ -6743,7 +6914,7 @@ var ObjectSearchResultItemContainer = import_react70.css`
6743
6914
  }
6744
6915
  }
6745
6916
  `;
6746
- var ObjectSearchDragHandle = import_react70.css`
6917
+ var ObjectSearchDragHandle = import_react72.css`
6747
6918
  border-left: 2px dotted var(--gray-300);
6748
6919
  border-right: 2px dotted var(--gray-300);
6749
6920
  position: absolute;
@@ -6752,41 +6923,41 @@ var ObjectSearchDragHandle = import_react70.css`
6752
6923
  transition: opacity var(--duration-fast) var(--timing-ease-out);
6753
6924
  opacity: 0;
6754
6925
  `;
6755
- var ObjectSearchResultItemSubtitle = import_react70.css`
6926
+ var ObjectSearchResultItemSubtitle = import_react72.css`
6756
6927
  color: var(--gray-500);
6757
6928
  display: block;
6758
6929
  font-size: var(--fs-xs);
6759
6930
  line-height: 1;
6760
6931
  `;
6761
- var ObjectSearchResultItemTitle = import_react70.css`
6932
+ var ObjectSearchResultItemTitle = import_react72.css`
6762
6933
  align-items: center;
6763
6934
  color: var(--typography-base);
6764
6935
  display: flex;
6765
6936
  gap: var(--spacing-xs);
6766
6937
  `;
6767
- var ObjectSearchResultItemTimeStamp = import_react70.css`
6938
+ var ObjectSearchResultItemTimeStamp = import_react72.css`
6768
6939
  color: var(--gray-500);
6769
6940
  font-size: var(--fs-xs);
6770
6941
  `;
6771
- var ObjectSearchAuthorStateGroup = import_react70.css`
6942
+ var ObjectSearchAuthorStateGroup = import_react72.css`
6772
6943
  align-items: center;
6773
6944
  display: flex;
6774
6945
  gap: var(--spacing-sm);
6775
6946
  `;
6776
- var ObjectSearchUpdateGroup = import_react70.css`
6947
+ var ObjectSearchUpdateGroup = import_react72.css`
6777
6948
  display: grid;
6778
6949
  `;
6779
- var ObjectSearchContentContainer = import_react70.css`
6950
+ var ObjectSearchContentContainer = import_react72.css`
6780
6951
  display: flex;
6781
6952
  gap: var(--spacing-base);
6782
6953
  `;
6783
- var ObjectSearchImage = import_react70.css`
6954
+ var ObjectSearchImage = import_react72.css`
6784
6955
  width: 56px;
6785
6956
  object-fit: contain;
6786
6957
  `;
6787
6958
 
6788
6959
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6789
- var import_jsx_runtime62 = require("@emotion/react/jsx-runtime");
6960
+ var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
6790
6961
  var ObjectSearchResultItem = ({
6791
6962
  id,
6792
6963
  title,
@@ -6810,66 +6981,70 @@ var ObjectSearchResultItem = ({
6810
6981
  onSelectItem({ id, title: id });
6811
6982
  onRemove == null ? void 0 : onRemove();
6812
6983
  };
6813
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
6814
- disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6815
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectSearchContentContainer, children: [
6816
- !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6817
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { children: [
6818
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
6819
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
6984
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
6985
+ disableDnD ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
6986
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchContentContainer, children: [
6987
+ !imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
6988
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { children: [
6989
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
6990
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
6820
6991
  title != null ? title : name,
6821
- !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_design_system36.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6992
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_design_system38.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6822
6993
  ] }),
6823
- !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6824
- !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_design_system36.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
6825
- !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
6826
- !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6827
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("strong", { children: "Last updated: " }),
6994
+ !createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6995
+ !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_design_system38.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
6996
+ !createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
6997
+ !createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6998
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("strong", { children: "Last updated: " }),
6828
6999
  (0, import_timeago3.format)(createdAt)
6829
7000
  ] }),
6830
- !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6831
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("strong", { children: "Last published: " }),
7001
+ !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
7002
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("strong", { children: "Last published: " }),
6832
7003
  (0, import_timeago3.format)(publishedAt)
6833
7004
  ] })
6834
7005
  ] })
6835
7006
  ] }),
6836
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { children })
7007
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { children })
6837
7008
  ] })
6838
7009
  ] }) }),
6839
- !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
6840
- !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
6841
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_design_system36.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
7010
+ !editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
7011
+ !editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
7012
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_design_system38.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
6842
7013
  ] })
6843
7014
  ] });
6844
7015
  };
6845
7016
 
7017
+ // src/components/ObjectSearch/ObjectSearchResultList.tsx
7018
+ var import_design_system39 = require("@uniformdev/design-system");
7019
+ var import_react_beautiful_dnd4 = require("react-beautiful-dnd");
7020
+
6846
7021
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
6847
- var import_react71 = require("@emotion/react");
6848
- var ObjectSearchResultListContainer = import_react71.css`
7022
+ var import_react73 = require("@emotion/react");
7023
+ var ObjectSearchResultListContainer = import_react73.css`
6849
7024
  align-items: center;
6850
7025
  display: flex;
6851
7026
  gap: var(--spacing-sm);
6852
7027
  justify-content: space-between;
6853
7028
  `;
6854
- var ObjectSearchDragContainer = import_react71.css`
7029
+ var ObjectSearchDragContainer = import_react73.css`
6855
7030
  margin: 0 0 var(--spacing-sm);
6856
7031
  `;
6857
- var ObjectSearchContainerDragging = import_react71.css`
7032
+ var ObjectSearchContainerDragging = import_react73.css`
6858
7033
  box-shadow: var(--shadow-base);
6859
7034
  opacity: var(--opacity-50);
6860
7035
  `;
6861
- var ObjectSearchResultListCounterContainer = import_react71.css`
7036
+ var ObjectSearchResultListCounterContainer = import_react73.css`
6862
7037
  align-items: center;
6863
7038
  display: flex;
6864
7039
  gap: var(--spacing-sm);
6865
7040
  `;
6866
- var ObjectSearchResultListTitle = import_react71.css`
7041
+ var ObjectSearchResultListTitle = import_react73.css`
6867
7042
  font-weight: var(--fw-bold);
6868
7043
  line-height: 1;
6869
7044
  `;
6870
7045
 
6871
7046
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
6872
- var import_jsx_runtime63 = require("@emotion/react/jsx-runtime");
7047
+ var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
6873
7048
  function ObjectSearchResultList({
6874
7049
  resultLabelText = "Selected",
6875
7050
  removeButtonText = "Remove all",
@@ -6877,7 +7052,7 @@ function ObjectSearchResultList({
6877
7052
  hideRemoveButton = false,
6878
7053
  resultLabelOverride,
6879
7054
  additionalButtons,
6880
- renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ObjectSearchResultItem, { ...value }),
7055
+ renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ObjectSearchResultItem, { ...value }),
6881
7056
  multiSelectId,
6882
7057
  disableDnD = false,
6883
7058
  getContainerForDnDReparenting,
@@ -6904,7 +7079,7 @@ function ObjectSearchResultList({
6904
7079
  ...item,
6905
7080
  disableDnD: selectedListItems.length === 1 || disableDnD
6906
7081
  });
6907
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
7082
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6908
7083
  "div",
6909
7084
  {
6910
7085
  css: [
@@ -6919,17 +7094,17 @@ function ObjectSearchResultList({
6919
7094
  }
6920
7095
  );
6921
7096
  };
6922
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
6923
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6924
- !resultLabelOverride ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6925
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
7097
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
7098
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
7099
+ !resultLabelOverride ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
7100
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
6926
7101
  " ",
6927
- !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_design_system37.Counter, { count: selectedListItems.length })
7102
+ !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_design_system39.Counter, { count: selectedListItems.length })
6928
7103
  ] }) : resultLabelOverride,
6929
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
7104
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
6930
7105
  additionalButtons,
6931
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6932
- import_design_system37.Button,
7106
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
7107
+ import_design_system39.Button,
6933
7108
  {
6934
7109
  buttonType: "ghostDestructive",
6935
7110
  size: "xs",
@@ -6940,15 +7115,15 @@ function ObjectSearchResultList({
6940
7115
  )
6941
7116
  ] })
6942
7117
  ] }),
6943
- !selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
7118
+ !selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6944
7119
  import_react_beautiful_dnd4.Droppable,
6945
7120
  {
6946
7121
  droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
6947
7122
  renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
6948
7123
  getContainerForClone: getContainerForDnDReparenting,
6949
- children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
7124
+ children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
6950
7125
  selectedListItems.map((item, i) => {
6951
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
7126
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6952
7127
  import_react_beautiful_dnd4.Draggable,
6953
7128
  {
6954
7129
  draggableId: item.id,
@@ -6966,273 +7141,9 @@ function ObjectSearchResultList({
6966
7141
  ] });
6967
7142
  }
6968
7143
 
6969
- // src/components/ObjectSearch/ObjectSearchContainer.tsx
6970
- var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
6971
- var ObjectSearchContainer = ({
6972
- label,
6973
- enableDynamicInputToResultId,
6974
- searchFilters,
6975
- resultList,
6976
- children = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ObjectSearchResultList, {})
6977
- }) => {
6978
- var _a, _b;
6979
- const { onSelectItem, selectedListItems, list, dynamicEntryId, onSetQuery, query } = useObjectSearchContext();
6980
- const { flatVariables } = useVariables(true);
6981
- const inputValue = (_b = dynamicEntryId != null ? dynamicEntryId : (_a = selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6982
- const isDynamicEntryIdAvailable = import_react73.default.useMemo(
6983
- () => Boolean(inputValue && hasReferencedVariables(inputValue)),
6984
- [inputValue]
6985
- );
6986
- const listItems = resultList != null ? resultList : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
6987
- import_design_system38.ScrollableList,
6988
- {
6989
- role: "list",
6990
- css: import_react72.css`
6991
- > div {
6992
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6993
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6994
- }
6995
- `,
6996
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DefaultResultList, {})
6997
- }
6998
- );
6999
- const handleSelectedVariableChange = (selectedValue) => {
7000
- var _a2;
7001
- if (!selectedValue) {
7002
- onSelectItem([]);
7003
- return;
7004
- }
7005
- const { result, errors } = (0, import_canvas9.bindVariables)({
7006
- value: selectedValue,
7007
- variables: flatVariables,
7008
- errorPrefix: "Dynamic input"
7009
- });
7010
- if (!result) {
7011
- onSelectItem([]);
7012
- return;
7013
- }
7014
- const item = (_a2 = list.items) == null ? void 0 : _a2.find((i) => i.id === result);
7015
- onSelectItem([
7016
- {
7017
- title: selectedValue,
7018
- contentType: (errors == null ? void 0 : errors.length) ? errors[0] instanceof Error ? errors[0].message : errors[0] : `Current dynamic value "${result}" is not an ID in the options`,
7019
- // spread any matched list item, overriding the above default props
7020
- ...item,
7021
- // we want to make sure the ID is our dynamic value
7022
- id: selectedValue
7023
- }
7024
- ]);
7025
- if (hasReferencedVariables(selectedValue)) {
7026
- onSetQuery({ ...query, dynamicEntryId: selectedValue });
7027
- }
7028
- };
7029
- const showSearchList = !label || !isDynamicEntryIdAvailable || !enableDynamicInputToResultId;
7030
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_design_system38.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_design_system38.VerticalRhythm, { children: [
7031
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_design_system38.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_design_system38.VerticalRhythm, { children: [
7032
- label ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
7033
- InputVariables,
7034
- {
7035
- id: "entryId",
7036
- label,
7037
- value: inputValue,
7038
- onChange: (value) => {
7039
- if (value === inputValue) {
7040
- return;
7041
- }
7042
- handleSelectedVariableChange(value);
7043
- },
7044
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: searchFilters }),
7045
- disableVariables: !enableDynamicInputToResultId
7046
- }
7047
- ) : searchFilters,
7048
- showSearchList ? listItems : null
7049
- ] }) }),
7050
- children
7051
- ] }) });
7052
- };
7053
- var DefaultResultList = () => {
7054
- var _a, _b;
7055
- const { list, isListLoading } = useObjectSearchContext();
7056
- if (isListLoading || !list.items) {
7057
- return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ObjectSearchListItemLoadingSkeleton, {}, i));
7058
- }
7059
- if (((_a = list.items) == null ? void 0 : _a.length) === 0) {
7060
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_design_system38.Callout, { type: "info", children: "No results were found" });
7061
- }
7062
- return (_b = list.items) == null ? void 0 : _b.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ObjectSearchListItem, { ...item }, item.id));
7063
- };
7064
-
7065
- // src/components/ObjectSearch/ObjectSearchFilter.tsx
7066
- var import_design_system39 = require("@uniformdev/design-system");
7067
- var import_react76 = require("react");
7068
- var import_react_use5 = require("react-use");
7069
-
7070
- // src/utils/createLocationValidator.ts
7071
- function createLocationValidator(setValue, validate) {
7072
- return (dispatch) => setValue((previous) => {
7073
- const { newValue, options } = dispatch(previous);
7074
- return { newValue, options: validate(newValue, options) };
7075
- });
7076
- }
7077
-
7078
- // src/utils/useContentDataResourceLocaleInfo.ts
7079
- var import_canvas10 = require("@uniformdev/canvas");
7080
- var import_react74 = require("react");
7081
- function useContentDataResourceLocaleInfo({
7082
- locale,
7083
- setLocale,
7084
- dynamicInputs
7085
- }) {
7086
- var _a;
7087
- const setLocaleRef = (0, import_react74.useRef)(setLocale);
7088
- setLocaleRef.current = setLocale;
7089
- const { flatVariables } = useVariables();
7090
- const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
7091
- const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
7092
- (0, import_react74.useEffect)(() => {
7093
- if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
7094
- setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
7095
- }
7096
- }, [locale, effectiveLocale]);
7097
- return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
7098
- }
7099
-
7100
- // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
7101
- var import_react75 = require("@emotion/react");
7102
- var ObjectSearchFilterContainerLabel = import_react75.css`
7103
- align-items: center;
7104
- display: flex;
7105
- font-size: var(--fs-sm);
7106
- font-weight: var(--fw-bold);
7107
- line-height: 1rem;
7108
- margin-bottom: var(--spacing-sm);
7109
- `;
7110
- var ObjectSearchFilterContainer = import_react75.css`
7111
- display: grid;
7112
- gap: var(--spacing-base);
7113
- `;
7114
- var ObjectSearchFilterGrid = (gridColumns) => import_react75.css`
7115
- display: grid;
7116
- grid-template-columns: ${gridColumns};
7117
- gap: var(--spacing-base);
7118
- `;
7119
-
7120
- // src/components/ObjectSearch/ObjectSearchFilter.tsx
7121
- var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
7122
- var ObjectSearchFilter = ({
7123
- requireContentType,
7124
- typeSelectorAllTypesOptionText = "All content types",
7125
- searchInputName = "searchText",
7126
- searchInputPlaceholderText = "Enter keyword to narrow your results",
7127
- selectLabel = "Content Type Select",
7128
- localeFilterLabel = "Filter by locale",
7129
- selectOptions
7130
- }) => {
7131
- var _a, _b, _c;
7132
- const { query, onSetQuery, localeOptions, enableFilterByLocale } = useObjectSearchContext();
7133
- const dynamicInputs = useDataResourceDynamicInputs();
7134
- const { boundLocale = "", effectiveLocale } = useContentDataResourceLocaleInfo({
7135
- locale: query.locale,
7136
- dynamicInputs: dynamicInputs != null ? dynamicInputs : {},
7137
- setLocale: (newLocale) => handleFilterChange({ locale: newLocale != null ? newLocale : "" })
7138
- });
7139
- const [searchState, setSearchState] = (0, import_react76.useState)({
7140
- keyword: (_a = query.keyword) != null ? _a : "",
7141
- contentType: (_b = query.contentType) != null ? _b : "",
7142
- locale: (_c = query.locale) != null ? _c : ""
7143
- });
7144
- const handleFilterChange = (value) => {
7145
- setSearchState((prev) => {
7146
- return { ...prev, ...value };
7147
- });
7148
- };
7149
- (0, import_react_use5.useDebounce)(
7150
- () => {
7151
- onSetQuery({ ...query, ...searchState });
7152
- },
7153
- 500,
7154
- [searchState]
7155
- );
7156
- const memoizedSelectOptions = (0, import_react76.useMemo)(() => {
7157
- if (!requireContentType && !(selectOptions == null ? void 0 : selectOptions.length)) {
7158
- return [];
7159
- }
7160
- return [
7161
- ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
7162
- ...selectOptions != null ? selectOptions : []
7163
- ];
7164
- }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
7165
- const shouldRenderSelect = memoizedSelectOptions.length > 0;
7166
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_design_system39.VerticalRhythm, { gap: "base", children: [
7167
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
7168
- "fieldset",
7169
- {
7170
- css: [
7171
- ObjectSearchFilterContainer,
7172
- ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
7173
- ],
7174
- children: [
7175
- memoizedSelectOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7176
- import_design_system39.InputSelect,
7177
- {
7178
- label: selectLabel,
7179
- showLabel: false,
7180
- onChange: (e) => handleFilterChange({ contentType: e.target.value }),
7181
- options: memoizedSelectOptions,
7182
- value: query.contentType,
7183
- "data-testid": "select-entry"
7184
- }
7185
- ) : null,
7186
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7187
- import_design_system39.DebouncedInputKeywordSearch,
7188
- {
7189
- inputFieldName: searchInputName,
7190
- placeholder: searchInputPlaceholderText,
7191
- onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
7192
- disabledFieldSubmission: true,
7193
- defaultValue: searchState.keyword,
7194
- delay: 300
7195
- }
7196
- )
7197
- ]
7198
- }
7199
- ),
7200
- enableFilterByLocale && (localeOptions == null ? void 0 : localeOptions.length) && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7201
- InputVariables,
7202
- {
7203
- label: localeFilterLabel,
7204
- id: "locale",
7205
- value: effectiveLocale,
7206
- onChange: (newLocale) => handleFilterChange({ locale: newLocale != null ? newLocale : "" }),
7207
- disableInlineMenu: true,
7208
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7209
- import_design_system39.InputSelect,
7210
- {
7211
- id: "locale",
7212
- options: localeOptions,
7213
- name: "locale",
7214
- label: "",
7215
- value: boundLocale,
7216
- onChange: (e) => handleFilterChange({ locale: e.target.value })
7217
- }
7218
- )
7219
- }
7220
- )
7221
- ] });
7222
- };
7223
-
7224
- // src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
7225
- var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
7226
- var ObjectSearchFilterContainer2 = ({ label, children }) => {
7227
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { children: [
7228
- label ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
7229
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { css: ObjectSearchFilterContainer, children })
7230
- ] });
7231
- };
7232
-
7233
7144
  // src/components/ObjectSearch/QueryFilter.tsx
7234
7145
  var import_design_system40 = require("@uniformdev/design-system");
7235
- var import_react77 = require("react");
7146
+ var import_react74 = require("react");
7236
7147
  var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
7237
7148
  var QueryFilter = ({
7238
7149
  requireContentType,
@@ -7262,7 +7173,7 @@ var QueryFilter = ({
7262
7173
  }) => {
7263
7174
  var _a, _b, _c, _d, _e, _f, _g;
7264
7175
  const { query, onSetQuery } = useObjectSearchContext();
7265
- const [queryState, setQueryState] = (0, import_react77.useState)({
7176
+ const [queryState, setQueryState] = (0, import_react74.useState)({
7266
7177
  contentType: (_a = query.contentType) != null ? _a : "",
7267
7178
  keyword: (_b = query.keyword) != null ? _b : "",
7268
7179
  count: (_c = query.count) != null ? _c : countValue,
@@ -7273,7 +7184,7 @@ var QueryFilter = ({
7273
7184
  setQueryState((prev) => ({ ...prev, ...value }));
7274
7185
  onSetQuery({ ...query, ...value });
7275
7186
  };
7276
- (0, import_react77.useEffect)(() => {
7187
+ (0, import_react74.useEffect)(() => {
7277
7188
  onSetQuery(queryState);
7278
7189
  }, []);
7279
7190
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("fieldset", { children: [
@@ -7398,108 +7309,9 @@ var QueryFilter = ({
7398
7309
  ] });
7399
7310
  };
7400
7311
 
7401
- // src/components/ObjectSearch/ObjectSearchListOfSearchResults.tsx
7402
- var import_design_system41 = require("@uniformdev/design-system");
7403
- var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
7404
- function ObjectSearchListOfSearchResults() {
7405
- var _a, _b;
7406
- const { list, isListLoading } = useObjectSearchContext();
7407
- if (isListLoading) {
7408
- return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ObjectSearchListItemLoadingSkeleton, {}, i));
7409
- }
7410
- if (((_a = list.items) == null ? void 0 : _a.length) === 0) {
7411
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_design_system41.Callout, { type: "info", children: "No results were found" });
7412
- }
7413
- return (_b = list.items) == null ? void 0 : _b.map((item) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ObjectSearchListItem, { ...item }, item.id));
7414
- }
7415
-
7416
- // src/components/ObjectSearch/hooks/ControlledObjectSearchProvider.tsx
7417
- var import_react78 = require("react");
7418
- var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
7419
- var ControlledObjectSearchProvider = ({
7420
- selectedItems,
7421
- searchResultItems,
7422
- selectedItemsLoading,
7423
- searchResultListLoading,
7424
- searchResultItemsLoading,
7425
- onQueryChange,
7426
- onSelectItemsChange,
7427
- isMulti = false,
7428
- children,
7429
- query,
7430
- enableFilterByLocale,
7431
- localeOptions,
7432
- dynamicEntryId
7433
- }) => {
7434
- const { flatVariables } = useVariables(true);
7435
- const querySearchDeferred = (0, import_react78.useDeferredValue)(query);
7436
- const onSetQuery = (0, import_react78.useCallback)(
7437
- (value2) => {
7438
- const newQuery = { ...query, ...value2 };
7439
- onQueryChange(newQuery);
7440
- },
7441
- // eslint-disable-next-line react-hooks/exhaustive-deps
7442
- [onQueryChange]
7443
- );
7444
- const onSelectItem = (0, import_react78.useCallback)(
7445
- (selectedResult) => {
7446
- if (Array.isArray(selectedResult)) {
7447
- onSelectItemsChange(selectedResult);
7448
- } else {
7449
- if (selectedItems == null ? void 0 : selectedItems.some((item) => item.id === selectedResult.id)) {
7450
- onSelectItemsChange(selectedItems.filter((item) => item.id !== selectedResult.id));
7451
- } else {
7452
- onSelectItemsChange([...selectedItems != null ? selectedItems : [], selectedResult]);
7453
- }
7454
- }
7455
- },
7456
- [onSelectItemsChange, selectedItems]
7457
- );
7458
- const onRemoveAllSelectedItems = (0, import_react78.useCallback)(() => {
7459
- onSelectItemsChange([]);
7460
- }, [onSelectItemsChange]);
7461
- const list = (0, import_react78.useMemo)(() => ({ items: searchResultItems }), [searchResultItems]);
7462
- const boundQuery = (0, import_react78.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
7463
- const value = (0, import_react78.useMemo)(
7464
- () => ({
7465
- boundQuery,
7466
- onSetQuery,
7467
- query: querySearchDeferred,
7468
- onSelectItem,
7469
- selectedListItems: selectedItems != null ? selectedItems : [],
7470
- onRemoveAllSelectedItems,
7471
- list,
7472
- selectedItemsLoading,
7473
- searchResultItemsLoading,
7474
- searchResultListLoading,
7475
- isMulti,
7476
- localeOptions,
7477
- enableFilterByLocale,
7478
- dynamicEntryId
7479
- }),
7480
- [
7481
- boundQuery,
7482
- onSetQuery,
7483
- querySearchDeferred,
7484
- onSelectItem,
7485
- selectedItems,
7486
- selectedItemsLoading,
7487
- searchResultItemsLoading,
7488
- onRemoveAllSelectedItems,
7489
- searchResultListLoading,
7490
- list,
7491
- isMulti,
7492
- localeOptions,
7493
- enableFilterByLocale,
7494
- dynamicEntryId
7495
- ]
7496
- );
7497
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ObjectSearchContext.Provider, { value, children });
7498
- };
7499
-
7500
7312
  // src/components/ParamTypeDynamicDataProvider.tsx
7501
- var import_react79 = require("react");
7502
- var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
7313
+ var import_react75 = require("react");
7314
+ var import_jsx_runtime68 = require("@emotion/react/jsx-runtime");
7503
7315
  function ParamTypeDynamicDataProvider(props) {
7504
7316
  const { children } = props;
7505
7317
  const {
@@ -7507,11 +7319,11 @@ function ParamTypeDynamicDataProvider(props) {
7507
7319
  } = useMeshLocation("paramType");
7508
7320
  const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
7509
7321
  const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
7510
- const variables = (0, import_react79.useMemo)(
7322
+ const variables = (0, import_react75.useMemo)(
7511
7323
  () => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
7512
7324
  [dynamicInputsAsVariables, connectedDataAsVariables]
7513
7325
  );
7514
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(VariablesProvider, { value: variables, onChange: () => {
7326
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(VariablesProvider, { value: variables, onChange: () => {
7515
7327
  }, editVariableComponent: JsonMeshVariableEditor, children });
7516
7328
  }
7517
7329
  var JsonMeshVariableEditor = ({
@@ -7520,9 +7332,9 @@ var JsonMeshVariableEditor = ({
7520
7332
  variable,
7521
7333
  context
7522
7334
  }) => {
7523
- const sillyRef = (0, import_react79.useRef)(false);
7335
+ const sillyRef = (0, import_react75.useRef)(false);
7524
7336
  const { editConnectedData } = useMeshLocation("paramType");
7525
- (0, import_react79.useEffect)(() => {
7337
+ (0, import_react75.useEffect)(() => {
7526
7338
  if (sillyRef.current) {
7527
7339
  return;
7528
7340
  }
@@ -7551,15 +7363,15 @@ var JsonMeshVariableEditor = ({
7551
7363
  };
7552
7364
 
7553
7365
  // src/components/SearchAndFilter/filtersMapper.tsx
7366
+ var import_design_system41 = require("@uniformdev/design-system");
7554
7367
  var import_design_system42 = require("@uniformdev/design-system");
7555
- var import_design_system43 = require("@uniformdev/design-system");
7556
- var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
7368
+ var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
7557
7369
  function withInputVariables(WrappedComponent) {
7558
7370
  const WithInputVariables = (props) => {
7559
7371
  if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
7560
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props });
7372
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props });
7561
7373
  }
7562
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
7374
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7563
7375
  InputVariables,
7564
7376
  {
7565
7377
  disableInlineMenu: true,
@@ -7567,7 +7379,7 @@ function withInputVariables(WrappedComponent) {
7567
7379
  onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
7568
7380
  value: props.value,
7569
7381
  disabled: props.disabled,
7570
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props })
7382
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props })
7571
7383
  }
7572
7384
  );
7573
7385
  };
@@ -7577,32 +7389,62 @@ function withInputVariablesForMultiValue(WrappedComponent) {
7577
7389
  const WithInputVariables = (props) => {
7578
7390
  var _a;
7579
7391
  if (!props.bindable || props.disabled || props.readOnly) {
7580
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props });
7392
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props });
7581
7393
  }
7582
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
7394
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7583
7395
  InputVariables,
7584
7396
  {
7585
7397
  disableInlineMenu: true,
7586
7398
  showMenuPosition: "inline-right",
7587
7399
  onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
7588
7400
  value: (_a = props.value) == null ? void 0 : _a[0],
7589
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props })
7401
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props })
7590
7402
  }
7591
7403
  );
7592
7404
  };
7593
7405
  return WithInputVariables;
7594
7406
  }
7595
7407
  var bindableFiltersMapper = {
7596
- ...import_design_system42.filterMapper,
7597
- multiChoice: withInputVariablesForMultiValue(import_design_system42.FilterMultiChoiceEditor),
7598
- singleChoice: withInputVariables(import_design_system43.FilterSingleChoiceEditor),
7599
- date: withInputVariables(import_design_system43.DateEditor),
7600
- text: withInputVariables(import_design_system43.TextEditor),
7601
- number: withInputVariables(import_design_system43.NumberEditor)
7408
+ ...import_design_system41.filterMapper,
7409
+ multiChoice: withInputVariablesForMultiValue(import_design_system41.FilterMultiChoiceEditor),
7410
+ singleChoice: withInputVariables(import_design_system42.FilterSingleChoiceEditor),
7411
+ date: withInputVariables(import_design_system42.DateEditor),
7412
+ text: withInputVariables(import_design_system42.TextEditor),
7413
+ number: withInputVariables(import_design_system42.NumberEditor)
7602
7414
  };
7603
7415
 
7416
+ // src/utils/createLocationValidator.ts
7417
+ function createLocationValidator(setValue, validate) {
7418
+ return (dispatch) => setValue((previous) => {
7419
+ const { newValue, options } = dispatch(previous);
7420
+ return { newValue, options: validate(newValue, options) };
7421
+ });
7422
+ }
7423
+
7424
+ // src/utils/useContentDataResourceLocaleInfo.ts
7425
+ var import_canvas10 = require("@uniformdev/canvas");
7426
+ var import_react76 = require("react");
7427
+ function useContentDataResourceLocaleInfo({
7428
+ locale,
7429
+ setLocale,
7430
+ dynamicInputs
7431
+ }) {
7432
+ var _a;
7433
+ const setLocaleRef = (0, import_react76.useRef)(setLocale);
7434
+ setLocaleRef.current = setLocale;
7435
+ const { flatVariables } = useVariables();
7436
+ const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
7437
+ const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
7438
+ (0, import_react76.useEffect)(() => {
7439
+ if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
7440
+ setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
7441
+ }
7442
+ }, [locale, effectiveLocale]);
7443
+ return { effectiveLocale, boundLocale: boundLocale ? boundLocale : void 0 };
7444
+ }
7445
+
7604
7446
  // src/index.ts
7605
- var import_design_system44 = require("@uniformdev/design-system");
7447
+ var import_design_system43 = require("@uniformdev/design-system");
7606
7448
  __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7607
7449
  // Annotate the CommonJS export names for ESM import in node:
7608
7450
  0 && (module.exports = {
@@ -7611,13 +7453,11 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7611
7453
  AddListButton,
7612
7454
  Button,
7613
7455
  Callout,
7614
- ControlledObjectSearchProvider,
7615
7456
  ControlledValuePlugin,
7616
7457
  DISCONNECT_VARIABLE_COMMAND,
7617
7458
  DamSelectedItem,
7618
7459
  DataRefreshButton,
7619
7460
  DataResourceDynamicInputProvider,
7620
- DataResourceInputContext,
7621
7461
  DataResourceVariablesList,
7622
7462
  DataResourceVariablesListExplicit,
7623
7463
  DataSourceEditor,
@@ -7645,12 +7485,10 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7645
7485
  MeshApp,
7646
7486
  OPEN_INSERT_VARIABLE_COMMAND,
7647
7487
  ObjectSearchContainer,
7648
- ObjectSearchContext,
7649
7488
  ObjectSearchFilter,
7650
7489
  ObjectSearchFilterContainer,
7651
7490
  ObjectSearchListItem,
7652
7491
  ObjectSearchListItemLoadingSkeleton,
7653
- ObjectSearchListOfSearchResults,
7654
7492
  ObjectSearchProvider,
7655
7493
  ObjectSearchResultItem,
7656
7494
  ObjectSearchResultItemButton,
@@ -7704,7 +7542,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7704
7542
  VariablesPlugin,
7705
7543
  VariablesProvider,
7706
7544
  badgeIcon,
7707
- bindQuery,
7708
7545
  bindableFiltersMapper,
7709
7546
  convertConnectedDataToVariable,
7710
7547
  createLocationValidator,
@@ -7777,7 +7614,6 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7777
7614
  urlEncodeRequestUrl,
7778
7615
  useConnectedDataAsVariables,
7779
7616
  useContentDataResourceLocaleInfo,
7780
- useDataResourceDynamicInputs,
7781
7617
  useDynamicInputsAsVariables,
7782
7618
  useMeshLocation,
7783
7619
  useObjectSearchContext,