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

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,67 +33,71 @@ var src_exports = {};
33
33
  __export(src_exports, {
34
34
  $createVariableNode: () => $createVariableNode,
35
35
  $isVariableNode: () => $isVariableNode,
36
- AddListButton: () => import_design_system43.AddListButton,
37
- Button: () => import_design_system43.Button,
38
- Callout: () => import_design_system43.Callout,
36
+ AddListButton: () => import_design_system44.AddListButton,
37
+ Button: () => import_design_system44.Button,
38
+ Callout: () => import_design_system44.Callout,
39
+ ControlledObjectSearchProvider: () => ControlledObjectSearchProvider,
39
40
  ControlledValuePlugin: () => ControlledValuePlugin,
40
41
  DISCONNECT_VARIABLE_COMMAND: () => DISCONNECT_VARIABLE_COMMAND,
41
42
  DamSelectedItem: () => DamSelectedItem,
42
43
  DataRefreshButton: () => DataRefreshButton,
43
44
  DataResourceDynamicInputProvider: () => DataResourceDynamicInputProvider,
45
+ DataResourceInputContext: () => DataResourceInputContext,
44
46
  DataResourceVariablesList: () => DataResourceVariablesList,
45
47
  DataResourceVariablesListExplicit: () => DataResourceVariablesListExplicit,
46
48
  DataSourceEditor: () => DataSourceEditor,
47
49
  DataTypeEditor: () => DataTypeEditor,
48
50
  DefaultSearchRow: () => DefaultSearchRow,
49
51
  DefaultSelectedItem: () => DefaultSelectedItem,
50
- DrawerContent: () => import_design_system43.DrawerContent,
52
+ DrawerContent: () => import_design_system44.DrawerContent,
51
53
  EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
52
54
  EntrySearch: () => EntrySearch,
53
- Heading: () => import_design_system43.Heading,
55
+ Heading: () => import_design_system44.Heading,
54
56
  INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
55
57
  Icons: () => icons_exports,
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,
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,
61
63
  InputVariables: () => InputVariables,
62
- Label: () => import_design_system43.Label,
64
+ Label: () => import_design_system44.Label,
63
65
  LinkButton: () => LinkButton,
64
- LoadingIndicator: () => import_design_system43.LoadingIndicator,
65
- LoadingOverlay: () => import_design_system43.LoadingOverlay,
66
- Menu: () => import_design_system43.Menu,
67
- MenuItem: () => import_design_system43.MenuItem,
66
+ LoadingIndicator: () => import_design_system44.LoadingIndicator,
67
+ LoadingOverlay: () => import_design_system44.LoadingOverlay,
68
+ Menu: () => import_design_system44.Menu,
69
+ MenuItem: () => import_design_system44.MenuItem,
68
70
  MeshApp: () => MeshApp,
69
71
  OPEN_INSERT_VARIABLE_COMMAND: () => OPEN_INSERT_VARIABLE_COMMAND,
70
72
  ObjectSearchContainer: () => ObjectSearchContainer,
73
+ ObjectSearchContext: () => ObjectSearchContext,
71
74
  ObjectSearchFilter: () => ObjectSearchFilter,
72
75
  ObjectSearchFilterContainer: () => ObjectSearchFilterContainer2,
73
76
  ObjectSearchListItem: () => ObjectSearchListItem,
74
77
  ObjectSearchListItemLoadingSkeleton: () => ObjectSearchListItemLoadingSkeleton,
78
+ ObjectSearchListOfSearchResults: () => ObjectSearchListOfSearchResults,
75
79
  ObjectSearchProvider: () => ObjectSearchProvider,
76
80
  ObjectSearchResultItem: () => ObjectSearchResultItem,
77
81
  ObjectSearchResultItemButton: () => ObjectSearchResultItemButton,
78
82
  ObjectSearchResultList: () => ObjectSearchResultList,
79
83
  ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
80
84
  ParameterConnectionIndicator: () => ParameterConnectionIndicator,
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,
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,
88
92
  ParameterOrSingleVariable: () => ParameterOrSingleVariable,
89
- ParameterSelect: () => import_design_system43.ParameterSelect,
90
- ParameterSelectInner: () => import_design_system43.ParameterSelectInner,
91
- ParameterShell: () => import_design_system43.ParameterShell,
93
+ ParameterSelect: () => import_design_system44.ParameterSelect,
94
+ ParameterSelectInner: () => import_design_system44.ParameterSelectInner,
95
+ ParameterShell: () => import_design_system44.ParameterShell,
92
96
  ParameterShellContext: () => import_design_system14.ParameterShellContext,
93
- ParameterTextarea: () => import_design_system43.ParameterTextarea,
94
- ParameterTextareaInner: () => import_design_system43.ParameterTextareaInner,
95
- ParameterToggle: () => import_design_system43.ParameterToggle,
96
- ParameterToggleInner: () => import_design_system43.ParameterToggleInner,
97
+ ParameterTextarea: () => import_design_system44.ParameterTextarea,
98
+ ParameterTextareaInner: () => import_design_system44.ParameterTextareaInner,
99
+ ParameterToggle: () => import_design_system44.ParameterToggle,
100
+ ParameterToggleInner: () => import_design_system44.ParameterToggleInner,
97
101
  ParameterVariables: () => ParameterVariables,
98
102
  ProductPreviewList: () => ProductPreviewList,
99
103
  ProductQuery: () => ProductQuery,
@@ -112,19 +116,20 @@ __export(src_exports, {
112
116
  RequestUrl: () => RequestUrl,
113
117
  RequestUrlInput: () => RequestUrlInput,
114
118
  ResolvableLoadingValue: () => ResolvableLoadingValue,
115
- ScrollableList: () => import_design_system43.ScrollableList,
116
- ScrollableListItem: () => import_design_system43.ScrollableListItem,
119
+ ScrollableList: () => import_design_system44.ScrollableList,
120
+ ScrollableListItem: () => import_design_system44.ScrollableListItem,
117
121
  SelectionField: () => SelectionField,
118
- Switch: () => import_design_system43.Switch,
122
+ Switch: () => import_design_system44.Switch,
119
123
  TextVariableRenderer: () => TextVariableRenderer,
120
- Textarea: () => import_design_system43.Textarea,
121
- Theme: () => import_design_system43.Theme,
124
+ Textarea: () => import_design_system44.Textarea,
125
+ Theme: () => import_design_system44.Theme,
122
126
  VariableEditor: () => VariableEditor,
123
127
  VariableNode: () => VariableNode,
124
128
  VariablesList: () => VariablesList,
125
129
  VariablesPlugin: () => VariablesPlugin,
126
130
  VariablesProvider: () => VariablesProvider,
127
131
  badgeIcon: () => badgeIcon,
132
+ bindQuery: () => bindQuery,
128
133
  bindableFiltersMapper: () => bindableFiltersMapper,
129
134
  convertConnectedDataToVariable: () => convertConnectedDataToVariable,
130
135
  createLocationValidator: () => createLocationValidator,
@@ -197,6 +202,7 @@ __export(src_exports, {
197
202
  urlEncodeRequestUrl: () => urlEncodeRequestUrl,
198
203
  useConnectedDataAsVariables: () => useConnectedDataAsVariables,
199
204
  useContentDataResourceLocaleInfo: () => useContentDataResourceLocaleInfo,
205
+ useDataResourceDynamicInputs: () => useDataResourceDynamicInputs,
200
206
  useDynamicInputsAsVariables: () => useDynamicInputsAsVariables,
201
207
  useMeshLocation: () => useMeshLocation,
202
208
  useObjectSearchContext: () => useObjectSearchContext,
@@ -2856,6 +2862,9 @@ function DefaultDamItemRenderer({ item }) {
2856
2862
  ] }) : null;
2857
2863
  }
2858
2864
 
2865
+ // src/components/DataResourceDynamicInputProvider.tsx
2866
+ var import_react59 = require("react");
2867
+
2859
2868
  // src/hooks/useConnectedDataAsVariables.tsx
2860
2869
  var import_react26 = require("react");
2861
2870
  function useConnectedDataAsVariables(connectedData) {
@@ -5523,6 +5532,10 @@ function VariablesList() {
5523
5532
 
5524
5533
  // src/components/DataResourceDynamicInputProvider.tsx
5525
5534
  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
+ };
5526
5539
  function DataResourceDynamicInputProvider(props) {
5527
5540
  const { children, dynamicInputs } = props;
5528
5541
  if (dynamicInputs) {
@@ -5541,7 +5554,7 @@ function DataResourceDynamicInputProviderRenderer({
5541
5554
  dynamicInputs
5542
5555
  }) {
5543
5556
  const variables = useDynamicInputsAsVariables(dynamicInputs);
5544
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(VariablesProvider, { value: variables, readOnly: true, children });
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 }) });
5545
5558
  }
5546
5559
 
5547
5560
  // src/components/DataResourceVariablesList.tsx
@@ -5618,9 +5631,9 @@ function TextVariableRenderer({ definition, value, setValue }) {
5618
5631
  }
5619
5632
 
5620
5633
  // src/components/Request/RequestBody.tsx
5621
- var import_react60 = require("@emotion/react");
5634
+ var import_react61 = require("@emotion/react");
5622
5635
  var import_design_system27 = require("@uniformdev/design-system");
5623
- var import_react61 = require("react");
5636
+ var import_react62 = require("react");
5624
5637
 
5625
5638
  // src/components/Request/RequestProvider.tsx
5626
5639
  var React11 = __toESM(require("react"));
@@ -5704,11 +5717,11 @@ function useRequest() {
5704
5717
  }
5705
5718
 
5706
5719
  // src/components/Request/styles/Request.styles.ts
5707
- var import_react59 = require("@emotion/react");
5708
- var innerContentStyles = import_react59.css`
5720
+ var import_react60 = require("@emotion/react");
5721
+ var innerContentStyles = import_react60.css`
5709
5722
  background: var(--white);
5710
5723
  `;
5711
- var requestTypeContainer = (bgColor) => import_react59.css`
5724
+ var requestTypeContainer = (bgColor) => import_react60.css`
5712
5725
  align-items: start;
5713
5726
  background: ${bgColor};
5714
5727
  display: grid;
@@ -5746,11 +5759,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
5746
5759
  };
5747
5760
  function RequestBody() {
5748
5761
  const { request, dispatch } = useRequest();
5749
- const [language, setLanguage] = (0, import_react61.useState)("json");
5762
+ const [language, setLanguage] = (0, import_react62.useState)("json");
5750
5763
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5751
5764
  "div",
5752
5765
  {
5753
- css: import_react60.css`
5766
+ css: import_react61.css`
5754
5767
  background: var(--white);
5755
5768
  `,
5756
5769
  children: [
@@ -5758,7 +5771,7 @@ function RequestBody() {
5758
5771
  RequestTypeContainer,
5759
5772
  {
5760
5773
  bgColor: "var(--gray-100)",
5761
- css: import_react60.css`
5774
+ css: import_react61.css`
5762
5775
  padding: var(--spacing-sm) var(--spacing-base);
5763
5776
  `,
5764
5777
  children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
@@ -6029,8 +6042,8 @@ function RequestParameters({
6029
6042
  }
6030
6043
 
6031
6044
  // src/components/Request/RequestUrl.tsx
6032
- var import_react62 = require("@emotion/react");
6033
- var import_react63 = require("react");
6045
+ var import_react63 = require("@emotion/react");
6046
+ var import_react64 = require("react");
6034
6047
 
6035
6048
  // src/components/Request/urlEncodeRequestParameter.ts
6036
6049
  function urlEncodeRequestUrl(url, varValues) {
@@ -6056,7 +6069,7 @@ function RequestUrl() {
6056
6069
  var _a, _b;
6057
6070
  const { variables } = useVariables();
6058
6071
  const { request } = useRequest();
6059
- const mergedParameters = (0, import_react63.useMemo)(() => {
6072
+ const mergedParameters = (0, import_react64.useMemo)(() => {
6060
6073
  var _a2;
6061
6074
  if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
6062
6075
  return request.parameters;
@@ -6066,7 +6079,7 @@ function RequestUrl() {
6066
6079
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6067
6080
  "small",
6068
6081
  {
6069
- css: import_react62.css`
6082
+ css: import_react63.css`
6070
6083
  display: inline-block;
6071
6084
  margin-bottom: var(--spacing-xs);
6072
6085
  word-break: break-word;
@@ -6304,12 +6317,12 @@ var import_design_system31 = require("@uniformdev/design-system");
6304
6317
 
6305
6318
  // src/hooks/useInitializeUniformMeshSdk.ts
6306
6319
  var import_mesh_sdk = require("@uniformdev/mesh-sdk");
6307
- var import_react64 = require("react");
6320
+ var import_react65 = require("react");
6308
6321
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
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)(
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)(
6313
6326
  () => {
6314
6327
  if (typeof window === "undefined" || sdk) {
6315
6328
  return;
@@ -6367,7 +6380,7 @@ var MeshApp = ({
6367
6380
  };
6368
6381
 
6369
6382
  // src/components/ObjectSearch/DataRefreshButton.tsx
6370
- var import_react65 = require("@emotion/react");
6383
+ var import_react66 = require("@emotion/react");
6371
6384
  var import_design_system32 = require("@uniformdev/design-system");
6372
6385
  var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
6373
6386
  var DataRefreshButton = ({
@@ -6380,7 +6393,7 @@ var DataRefreshButton = ({
6380
6393
  !isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
6381
6394
  import_design_system32.LoadingIndicator,
6382
6395
  {
6383
- css: import_react65.css`
6396
+ css: import_react66.css`
6384
6397
  ${isLoading ? "opacity: 0.2;" : void 0}
6385
6398
  `
6386
6399
  }
@@ -6390,15 +6403,16 @@ var DataRefreshButton = ({
6390
6403
  };
6391
6404
 
6392
6405
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
6393
- var import_react68 = require("@emotion/react");
6406
+ var import_react72 = require("@emotion/react");
6394
6407
  var import_canvas9 = require("@uniformdev/canvas");
6395
- var import_design_system35 = require("@uniformdev/design-system");
6408
+ var import_design_system38 = require("@uniformdev/design-system");
6409
+ var import_react73 = __toESM(require("react"));
6396
6410
 
6397
6411
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
6398
6412
  var import_canvas8 = require("@uniformdev/canvas");
6399
- var import_react66 = require("react");
6413
+ var import_react67 = require("react");
6400
6414
  var import_jsx_runtime59 = require("@emotion/react/jsx-runtime");
6401
- var ObjectSearchContext = (0, import_react66.createContext)({
6415
+ var ObjectSearchContext = (0, import_react67.createContext)({
6402
6416
  onSetQuery: () => {
6403
6417
  },
6404
6418
  onSelectItem: () => {
@@ -6406,8 +6420,6 @@ var ObjectSearchContext = (0, import_react66.createContext)({
6406
6420
  query: {},
6407
6421
  boundQuery: {},
6408
6422
  list: {},
6409
- onSetList: () => {
6410
- },
6411
6423
  selectedListItems: [],
6412
6424
  onRemoveAllSelectedItems: () => {
6413
6425
  },
@@ -6419,16 +6431,16 @@ var ObjectSearchProvider = ({
6419
6431
  children,
6420
6432
  defaultQuery
6421
6433
  }) => {
6422
- const [query, setQuery] = (0, import_react66.useState)({
6434
+ const [query, setQuery] = (0, import_react67.useState)({
6423
6435
  contentType: "",
6424
6436
  keyword: "",
6425
6437
  ...defaultQuery
6426
6438
  });
6427
6439
  const { flatVariables } = useVariables(true);
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)(
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)(
6432
6444
  (value2) => {
6433
6445
  if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
6434
6446
  return setQuery({
@@ -6440,7 +6452,7 @@ var ObjectSearchProvider = ({
6440
6452
  },
6441
6453
  [setQuery]
6442
6454
  );
6443
- const onSelectItem = (0, import_react66.useCallback)(
6455
+ const onSelectItem = (0, import_react67.useCallback)(
6444
6456
  (selectedResult) => {
6445
6457
  if (Array.isArray(selectedResult)) {
6446
6458
  setSelectedItems(selectedResult);
@@ -6454,17 +6466,17 @@ var ObjectSearchProvider = ({
6454
6466
  },
6455
6467
  [setSelectedItems, selectedItems]
6456
6468
  );
6457
- const onRemoveAllSelectedItems = (0, import_react66.useCallback)(() => {
6469
+ const onRemoveAllSelectedItems = (0, import_react67.useCallback)(() => {
6458
6470
  setSelectedItems([]);
6459
6471
  }, [setSelectedItems]);
6460
- const onSetList = (0, import_react66.useCallback)(
6472
+ const onSetList = (0, import_react67.useCallback)(
6461
6473
  (value2) => {
6462
6474
  setList(value2);
6463
6475
  },
6464
6476
  [setList]
6465
6477
  );
6466
- const boundQuery = (0, import_react66.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
6467
- const value = (0, import_react66.useMemo)(
6478
+ const boundQuery = (0, import_react67.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
6479
+ const value = (0, import_react67.useMemo)(
6468
6480
  () => ({
6469
6481
  boundQuery,
6470
6482
  onSetQuery,
@@ -6491,7 +6503,7 @@ var ObjectSearchProvider = ({
6491
6503
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ObjectSearchContext.Provider, { value, children });
6492
6504
  };
6493
6505
  function useObjectSearchContext() {
6494
- return (0, import_react66.useContext)(ObjectSearchContext);
6506
+ return (0, import_react67.useContext)(ObjectSearchContext);
6495
6507
  }
6496
6508
  function bindQuery(query, inputs) {
6497
6509
  const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
@@ -6509,9 +6521,9 @@ function bindQuery(query, inputs) {
6509
6521
  var import_design_system34 = require("@uniformdev/design-system");
6510
6522
 
6511
6523
  // src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
6512
- var import_react67 = require("@emotion/react");
6524
+ var import_react68 = require("@emotion/react");
6513
6525
  var import_design_system33 = require("@uniformdev/design-system");
6514
- var ObjectListItemContainer = import_react67.css`
6526
+ var ObjectListItemContainer = import_react68.css`
6515
6527
  align-items: center;
6516
6528
  border: 1px solid var(--gray-300);
6517
6529
  border-radius: var(--rounded-base);
@@ -6520,11 +6532,11 @@ var ObjectListItemContainer = import_react67.css`
6520
6532
  grid-template-columns: 1fr auto;
6521
6533
  padding: var(--spacing-sm);
6522
6534
  `;
6523
- var ObjectListItemContainerDisabled = import_react67.css`
6535
+ var ObjectListItemContainerDisabled = import_react68.css`
6524
6536
  opacity: var(--opacity-50);
6525
6537
  pointer-events: none;
6526
6538
  `;
6527
- var ObjectListItemLoading = import_react67.css`
6539
+ var ObjectListItemLoading = import_react68.css`
6528
6540
  animation: ${import_design_system33.skeletonLoading} 1s linear infinite alternate;
6529
6541
  border-color: transparent;
6530
6542
  min-height: 42px;
@@ -6548,36 +6560,36 @@ var ObjectListItemLoading = import_react67.css`
6548
6560
  width: 1rem;
6549
6561
  }
6550
6562
  `;
6551
- var ObjectListItemHeadingGroup = import_react67.css`
6563
+ var ObjectListItemHeadingGroup = import_react68.css`
6552
6564
  align-items: center;
6553
6565
  display: grid;
6554
6566
  `;
6555
- var ObjectListItemThumbnail = import_react67.css`
6567
+ var ObjectListItemThumbnail = import_react68.css`
6556
6568
  width: 30px;
6557
6569
  object-fit: contain;
6558
6570
  `;
6559
- var ObjectListItemTitle = import_react67.css`
6571
+ var ObjectListItemTitle = import_react68.css`
6560
6572
  color: var(--typography-base);
6561
6573
  display: block;
6562
6574
  font-size: var(--fs-sm);
6563
6575
  `;
6564
- var ObjectListItemSubtitle = import_react67.css`
6576
+ var ObjectListItemSubtitle = import_react68.css`
6565
6577
  color: var(--gray-500);
6566
6578
  display: block;
6567
6579
  font-size: var(--fs-xs);
6568
6580
  line-height: 1;
6569
6581
  `;
6570
- var ObjectListItemInfoContainer = import_react67.css`
6582
+ var ObjectListItemInfoContainer = import_react68.css`
6571
6583
  align-items: center;
6572
6584
  display: flex;
6573
6585
  gap: var(--spacing-sm);
6574
6586
  justify-content: center;
6575
6587
  `;
6576
- var ObjectListItemControlledContent = import_react67.css`
6588
+ var ObjectListItemControlledContent = import_react68.css`
6577
6589
  display: flex;
6578
6590
  gap: var(--spacing-sm);
6579
6591
  `;
6580
- var ObjectListItemUnControlledContent = import_react67.css`
6592
+ var ObjectListItemUnControlledContent = import_react68.css`
6581
6593
  margin-top: var(--spacing-sm);
6582
6594
  grid-column: 1 / -1;
6583
6595
  `;
@@ -6647,202 +6659,19 @@ var ObjectSearchListItemLoadingSkeleton = () => {
6647
6659
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
6648
6660
  };
6649
6661
 
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
- };
6737
-
6738
- // src/components/ObjectSearch/ObjectSearchFilter.tsx
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
- };
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");
6836
6665
 
6837
6666
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6838
- var import_design_system38 = require("@uniformdev/design-system");
6667
+ var import_design_system36 = require("@uniformdev/design-system");
6839
6668
  var import_timeago3 = require("timeago.js");
6840
6669
 
6841
6670
  // src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
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}
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}
6846
6675
  background: transparent;
6847
6676
  border: 1px solid var(--typography-base);
6848
6677
  color: var(--typography-base);
@@ -6868,20 +6697,20 @@ var ButtonStyles = import_react71.css`
6868
6697
  text-decoration: none;
6869
6698
  }
6870
6699
  `;
6871
- var ButtonIcon = import_react71.css`
6700
+ var ButtonIcon = import_react69.css`
6872
6701
  width: 1rem;
6873
6702
  height: 1rem;
6874
6703
  `;
6875
6704
 
6876
6705
  // src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
6877
- var import_jsx_runtime64 = require("@emotion/react/jsx-runtime");
6706
+ var import_jsx_runtime61 = require("@emotion/react/jsx-runtime");
6878
6707
  var ObjectSearchResultItemButton = ({
6879
6708
  text,
6880
6709
  icon,
6881
6710
  ...props
6882
6711
  }) => {
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 }),
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 }),
6885
6714
  text
6886
6715
  ] });
6887
6716
  };
@@ -6890,15 +6719,15 @@ var LinkButton = ({
6890
6719
  icon,
6891
6720
  ...props
6892
6721
  }) => {
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 }),
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 }),
6895
6724
  text
6896
6725
  ] });
6897
6726
  };
6898
6727
 
6899
6728
  // src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
6900
- var import_react72 = require("@emotion/react");
6901
- var ObjectSearchResultItemContainer = import_react72.css`
6729
+ var import_react70 = require("@emotion/react");
6730
+ var ObjectSearchResultItemContainer = import_react70.css`
6902
6731
  align-items: center;
6903
6732
  border: 1px solid var(--gray-300);
6904
6733
  border-radius: var(--rounded-base);
@@ -6914,7 +6743,7 @@ var ObjectSearchResultItemContainer = import_react72.css`
6914
6743
  }
6915
6744
  }
6916
6745
  `;
6917
- var ObjectSearchDragHandle = import_react72.css`
6746
+ var ObjectSearchDragHandle = import_react70.css`
6918
6747
  border-left: 2px dotted var(--gray-300);
6919
6748
  border-right: 2px dotted var(--gray-300);
6920
6749
  position: absolute;
@@ -6923,41 +6752,41 @@ var ObjectSearchDragHandle = import_react72.css`
6923
6752
  transition: opacity var(--duration-fast) var(--timing-ease-out);
6924
6753
  opacity: 0;
6925
6754
  `;
6926
- var ObjectSearchResultItemSubtitle = import_react72.css`
6755
+ var ObjectSearchResultItemSubtitle = import_react70.css`
6927
6756
  color: var(--gray-500);
6928
6757
  display: block;
6929
6758
  font-size: var(--fs-xs);
6930
6759
  line-height: 1;
6931
6760
  `;
6932
- var ObjectSearchResultItemTitle = import_react72.css`
6761
+ var ObjectSearchResultItemTitle = import_react70.css`
6933
6762
  align-items: center;
6934
6763
  color: var(--typography-base);
6935
6764
  display: flex;
6936
6765
  gap: var(--spacing-xs);
6937
6766
  `;
6938
- var ObjectSearchResultItemTimeStamp = import_react72.css`
6767
+ var ObjectSearchResultItemTimeStamp = import_react70.css`
6939
6768
  color: var(--gray-500);
6940
6769
  font-size: var(--fs-xs);
6941
6770
  `;
6942
- var ObjectSearchAuthorStateGroup = import_react72.css`
6771
+ var ObjectSearchAuthorStateGroup = import_react70.css`
6943
6772
  align-items: center;
6944
6773
  display: flex;
6945
6774
  gap: var(--spacing-sm);
6946
6775
  `;
6947
- var ObjectSearchUpdateGroup = import_react72.css`
6776
+ var ObjectSearchUpdateGroup = import_react70.css`
6948
6777
  display: grid;
6949
6778
  `;
6950
- var ObjectSearchContentContainer = import_react72.css`
6779
+ var ObjectSearchContentContainer = import_react70.css`
6951
6780
  display: flex;
6952
6781
  gap: var(--spacing-base);
6953
6782
  `;
6954
- var ObjectSearchImage = import_react72.css`
6783
+ var ObjectSearchImage = import_react70.css`
6955
6784
  width: 56px;
6956
6785
  object-fit: contain;
6957
6786
  `;
6958
6787
 
6959
6788
  // src/components/ObjectSearch/ObjectSearchResultItem.tsx
6960
- var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
6789
+ var import_jsx_runtime62 = require("@emotion/react/jsx-runtime");
6961
6790
  var ObjectSearchResultItem = ({
6962
6791
  id,
6963
6792
  title,
@@ -6981,70 +6810,66 @@ var ObjectSearchResultItem = ({
6981
6810
  onSelectItem({ id, title: id });
6982
6811
  onRemove == null ? void 0 : onRemove();
6983
6812
  };
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: [
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: [
6991
6820
  title != null ? title : name,
6992
- !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_design_system38.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6821
+ !popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_design_system36.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
6993
6822
  ] }),
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: " }),
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: " }),
6999
6828
  (0, import_timeago3.format)(createdAt)
7000
6829
  ] }),
7001
- !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
7002
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("strong", { children: "Last published: " }),
6830
+ !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
6831
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("strong", { children: "Last published: " }),
7003
6832
  (0, import_timeago3.format)(publishedAt)
7004
6833
  ] })
7005
6834
  ] })
7006
6835
  ] }),
7007
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { children })
6836
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { children })
7008
6837
  ] })
7009
6838
  ] }) }),
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" })
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" })
7013
6842
  ] })
7014
6843
  ] });
7015
6844
  };
7016
6845
 
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
-
7021
6846
  // src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
7022
- var import_react73 = require("@emotion/react");
7023
- var ObjectSearchResultListContainer = import_react73.css`
6847
+ var import_react71 = require("@emotion/react");
6848
+ var ObjectSearchResultListContainer = import_react71.css`
7024
6849
  align-items: center;
7025
6850
  display: flex;
7026
6851
  gap: var(--spacing-sm);
7027
6852
  justify-content: space-between;
7028
6853
  `;
7029
- var ObjectSearchDragContainer = import_react73.css`
6854
+ var ObjectSearchDragContainer = import_react71.css`
7030
6855
  margin: 0 0 var(--spacing-sm);
7031
6856
  `;
7032
- var ObjectSearchContainerDragging = import_react73.css`
6857
+ var ObjectSearchContainerDragging = import_react71.css`
7033
6858
  box-shadow: var(--shadow-base);
7034
6859
  opacity: var(--opacity-50);
7035
6860
  `;
7036
- var ObjectSearchResultListCounterContainer = import_react73.css`
6861
+ var ObjectSearchResultListCounterContainer = import_react71.css`
7037
6862
  align-items: center;
7038
6863
  display: flex;
7039
6864
  gap: var(--spacing-sm);
7040
6865
  `;
7041
- var ObjectSearchResultListTitle = import_react73.css`
6866
+ var ObjectSearchResultListTitle = import_react71.css`
7042
6867
  font-weight: var(--fw-bold);
7043
6868
  line-height: 1;
7044
6869
  `;
7045
6870
 
7046
6871
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
7047
- var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
6872
+ var import_jsx_runtime63 = require("@emotion/react/jsx-runtime");
7048
6873
  function ObjectSearchResultList({
7049
6874
  resultLabelText = "Selected",
7050
6875
  removeButtonText = "Remove all",
@@ -7052,7 +6877,7 @@ function ObjectSearchResultList({
7052
6877
  hideRemoveButton = false,
7053
6878
  resultLabelOverride,
7054
6879
  additionalButtons,
7055
- renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ObjectSearchResultItem, { ...value }),
6880
+ renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ObjectSearchResultItem, { ...value }),
7056
6881
  multiSelectId,
7057
6882
  disableDnD = false,
7058
6883
  getContainerForDnDReparenting,
@@ -7079,7 +6904,7 @@ function ObjectSearchResultList({
7079
6904
  ...item,
7080
6905
  disableDnD: selectedListItems.length === 1 || disableDnD
7081
6906
  });
7082
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6907
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
7083
6908
  "div",
7084
6909
  {
7085
6910
  css: [
@@ -7094,17 +6919,17 @@ function ObjectSearchResultList({
7094
6919
  }
7095
6920
  );
7096
6921
  };
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 }),
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 }),
7101
6926
  " ",
7102
- !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_design_system39.Counter, { count: selectedListItems.length })
6927
+ !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_design_system37.Counter, { count: selectedListItems.length })
7103
6928
  ] }) : resultLabelOverride,
7104
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
6929
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
7105
6930
  additionalButtons,
7106
- hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
7107
- import_design_system39.Button,
6931
+ hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6932
+ import_design_system37.Button,
7108
6933
  {
7109
6934
  buttonType: "ghostDestructive",
7110
6935
  size: "xs",
@@ -7115,15 +6940,15 @@ function ObjectSearchResultList({
7115
6940
  )
7116
6941
  ] })
7117
6942
  ] }),
7118
- !selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6943
+ !selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
7119
6944
  import_react_beautiful_dnd4.Droppable,
7120
6945
  {
7121
6946
  droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
7122
6947
  renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
7123
6948
  getContainerForClone: getContainerForDnDReparenting,
7124
- children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
6949
+ children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
7125
6950
  selectedListItems.map((item, i) => {
7126
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6951
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
7127
6952
  import_react_beautiful_dnd4.Draggable,
7128
6953
  {
7129
6954
  draggableId: item.id,
@@ -7141,9 +6966,273 @@ function ObjectSearchResultList({
7141
6966
  ] });
7142
6967
  }
7143
6968
 
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
+
7144
7233
  // src/components/ObjectSearch/QueryFilter.tsx
7145
7234
  var import_design_system40 = require("@uniformdev/design-system");
7146
- var import_react74 = require("react");
7235
+ var import_react77 = require("react");
7147
7236
  var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
7148
7237
  var QueryFilter = ({
7149
7238
  requireContentType,
@@ -7173,7 +7262,7 @@ var QueryFilter = ({
7173
7262
  }) => {
7174
7263
  var _a, _b, _c, _d, _e, _f, _g;
7175
7264
  const { query, onSetQuery } = useObjectSearchContext();
7176
- const [queryState, setQueryState] = (0, import_react74.useState)({
7265
+ const [queryState, setQueryState] = (0, import_react77.useState)({
7177
7266
  contentType: (_a = query.contentType) != null ? _a : "",
7178
7267
  keyword: (_b = query.keyword) != null ? _b : "",
7179
7268
  count: (_c = query.count) != null ? _c : countValue,
@@ -7184,7 +7273,7 @@ var QueryFilter = ({
7184
7273
  setQueryState((prev) => ({ ...prev, ...value }));
7185
7274
  onSetQuery({ ...query, ...value });
7186
7275
  };
7187
- (0, import_react74.useEffect)(() => {
7276
+ (0, import_react77.useEffect)(() => {
7188
7277
  onSetQuery(queryState);
7189
7278
  }, []);
7190
7279
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("fieldset", { children: [
@@ -7309,9 +7398,108 @@ var QueryFilter = ({
7309
7398
  ] });
7310
7399
  };
7311
7400
 
7312
- // src/components/ParamTypeDynamicDataProvider.tsx
7313
- var import_react75 = require("react");
7401
+ // src/components/ObjectSearch/ObjectSearchListOfSearchResults.tsx
7402
+ var import_design_system41 = require("@uniformdev/design-system");
7314
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
+ // src/components/ParamTypeDynamicDataProvider.tsx
7501
+ var import_react79 = require("react");
7502
+ var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
7315
7503
  function ParamTypeDynamicDataProvider(props) {
7316
7504
  const { children } = props;
7317
7505
  const {
@@ -7319,11 +7507,11 @@ function ParamTypeDynamicDataProvider(props) {
7319
7507
  } = useMeshLocation("paramType");
7320
7508
  const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
7321
7509
  const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
7322
- const variables = (0, import_react75.useMemo)(
7510
+ const variables = (0, import_react79.useMemo)(
7323
7511
  () => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
7324
7512
  [dynamicInputsAsVariables, connectedDataAsVariables]
7325
7513
  );
7326
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(VariablesProvider, { value: variables, onChange: () => {
7514
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(VariablesProvider, { value: variables, onChange: () => {
7327
7515
  }, editVariableComponent: JsonMeshVariableEditor, children });
7328
7516
  }
7329
7517
  var JsonMeshVariableEditor = ({
@@ -7332,9 +7520,9 @@ var JsonMeshVariableEditor = ({
7332
7520
  variable,
7333
7521
  context
7334
7522
  }) => {
7335
- const sillyRef = (0, import_react75.useRef)(false);
7523
+ const sillyRef = (0, import_react79.useRef)(false);
7336
7524
  const { editConnectedData } = useMeshLocation("paramType");
7337
- (0, import_react75.useEffect)(() => {
7525
+ (0, import_react79.useEffect)(() => {
7338
7526
  if (sillyRef.current) {
7339
7527
  return;
7340
7528
  }
@@ -7363,15 +7551,15 @@ var JsonMeshVariableEditor = ({
7363
7551
  };
7364
7552
 
7365
7553
  // src/components/SearchAndFilter/filtersMapper.tsx
7366
- var import_design_system41 = require("@uniformdev/design-system");
7367
7554
  var import_design_system42 = require("@uniformdev/design-system");
7368
- var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
7555
+ var import_design_system43 = require("@uniformdev/design-system");
7556
+ var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
7369
7557
  function withInputVariables(WrappedComponent) {
7370
7558
  const WithInputVariables = (props) => {
7371
7559
  if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
7372
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props });
7560
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props });
7373
7561
  }
7374
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7562
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
7375
7563
  InputVariables,
7376
7564
  {
7377
7565
  disableInlineMenu: true,
@@ -7379,7 +7567,7 @@ function withInputVariables(WrappedComponent) {
7379
7567
  onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
7380
7568
  value: props.value,
7381
7569
  disabled: props.disabled,
7382
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props })
7570
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props })
7383
7571
  }
7384
7572
  );
7385
7573
  };
@@ -7389,62 +7577,32 @@ function withInputVariablesForMultiValue(WrappedComponent) {
7389
7577
  const WithInputVariables = (props) => {
7390
7578
  var _a;
7391
7579
  if (!props.bindable || props.disabled || props.readOnly) {
7392
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props });
7580
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props });
7393
7581
  }
7394
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7582
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
7395
7583
  InputVariables,
7396
7584
  {
7397
7585
  disableInlineMenu: true,
7398
7586
  showMenuPosition: "inline-right",
7399
7587
  onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
7400
7588
  value: (_a = props.value) == null ? void 0 : _a[0],
7401
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(WrappedComponent, { ...props })
7589
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WrappedComponent, { ...props })
7402
7590
  }
7403
7591
  );
7404
7592
  };
7405
7593
  return WithInputVariables;
7406
7594
  }
7407
7595
  var bindableFiltersMapper = {
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)
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)
7414
7602
  };
7415
7603
 
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
-
7446
7604
  // src/index.ts
7447
- var import_design_system43 = require("@uniformdev/design-system");
7605
+ var import_design_system44 = require("@uniformdev/design-system");
7448
7606
  __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7449
7607
  // Annotate the CommonJS export names for ESM import in node:
7450
7608
  0 && (module.exports = {
@@ -7453,11 +7611,13 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7453
7611
  AddListButton,
7454
7612
  Button,
7455
7613
  Callout,
7614
+ ControlledObjectSearchProvider,
7456
7615
  ControlledValuePlugin,
7457
7616
  DISCONNECT_VARIABLE_COMMAND,
7458
7617
  DamSelectedItem,
7459
7618
  DataRefreshButton,
7460
7619
  DataResourceDynamicInputProvider,
7620
+ DataResourceInputContext,
7461
7621
  DataResourceVariablesList,
7462
7622
  DataResourceVariablesListExplicit,
7463
7623
  DataSourceEditor,
@@ -7485,10 +7645,12 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7485
7645
  MeshApp,
7486
7646
  OPEN_INSERT_VARIABLE_COMMAND,
7487
7647
  ObjectSearchContainer,
7648
+ ObjectSearchContext,
7488
7649
  ObjectSearchFilter,
7489
7650
  ObjectSearchFilterContainer,
7490
7651
  ObjectSearchListItem,
7491
7652
  ObjectSearchListItemLoadingSkeleton,
7653
+ ObjectSearchListOfSearchResults,
7492
7654
  ObjectSearchProvider,
7493
7655
  ObjectSearchResultItem,
7494
7656
  ObjectSearchResultItemButton,
@@ -7542,6 +7704,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7542
7704
  VariablesPlugin,
7543
7705
  VariablesProvider,
7544
7706
  badgeIcon,
7707
+ bindQuery,
7545
7708
  bindableFiltersMapper,
7546
7709
  convertConnectedDataToVariable,
7547
7710
  createLocationValidator,
@@ -7614,6 +7777,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
7614
7777
  urlEncodeRequestUrl,
7615
7778
  useConnectedDataAsVariables,
7616
7779
  useContentDataResourceLocaleInfo,
7780
+ useDataResourceDynamicInputs,
7617
7781
  useDynamicInputsAsVariables,
7618
7782
  useMeshLocation,
7619
7783
  useObjectSearchContext,