@uniformdev/mesh-sdk-react 19.88.1-alpha.7 → 19.89.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.d.mts CHANGED
@@ -1177,7 +1177,10 @@ type ObjectSearchContainerProps = {
1177
1177
  enableDynamicInputToResultId?: boolean;
1178
1178
  /** a child node that places components within the search location */
1179
1179
  searchFilters: ReactNode;
1180
- /** a child node that places components within a scrollable list location */
1180
+ /**
1181
+ * a child node that places components within a scrollable list location
1182
+ * set to `null` expl
1183
+ */
1181
1184
  resultList?: ReactNode;
1182
1185
  /** allows any child element */
1183
1186
  children?: ReactNode;
@@ -1239,6 +1242,8 @@ type SearchQueryProps<TExtraFilters = unknown> = {
1239
1242
  contentType?: string;
1240
1243
  /** sets the keyword search in the search context */
1241
1244
  keyword?: string;
1245
+ /** sets the locale in the search context */
1246
+ locale?: string;
1242
1247
  } & TExtraFilters;
1243
1248
  type SelectedItemProps<TExtraProps = unknown> = {
1244
1249
  /** sets the id value */
@@ -1316,8 +1321,9 @@ type ObjectSearchProviderProps = {
1316
1321
  children: ReactNode;
1317
1322
  currentlySelectedItems?: Array<SelectedItemProps>;
1318
1323
  isMulti?: boolean;
1324
+ defaultQuery?: SearchQueryProps;
1319
1325
  };
1320
- declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1326
+ declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, defaultQuery, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1321
1327
  declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
1322
1328
 
1323
1329
  type ObjectSearchListItemProps = SelectedItemProps & {
package/dist/index.d.ts CHANGED
@@ -1177,7 +1177,10 @@ type ObjectSearchContainerProps = {
1177
1177
  enableDynamicInputToResultId?: boolean;
1178
1178
  /** a child node that places components within the search location */
1179
1179
  searchFilters: ReactNode;
1180
- /** a child node that places components within a scrollable list location */
1180
+ /**
1181
+ * a child node that places components within a scrollable list location
1182
+ * set to `null` expl
1183
+ */
1181
1184
  resultList?: ReactNode;
1182
1185
  /** allows any child element */
1183
1186
  children?: ReactNode;
@@ -1239,6 +1242,8 @@ type SearchQueryProps<TExtraFilters = unknown> = {
1239
1242
  contentType?: string;
1240
1243
  /** sets the keyword search in the search context */
1241
1244
  keyword?: string;
1245
+ /** sets the locale in the search context */
1246
+ locale?: string;
1242
1247
  } & TExtraFilters;
1243
1248
  type SelectedItemProps<TExtraProps = unknown> = {
1244
1249
  /** sets the id value */
@@ -1316,8 +1321,9 @@ type ObjectSearchProviderProps = {
1316
1321
  children: ReactNode;
1317
1322
  currentlySelectedItems?: Array<SelectedItemProps>;
1318
1323
  isMulti?: boolean;
1324
+ defaultQuery?: SearchQueryProps;
1319
1325
  };
1320
- declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1326
+ declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, defaultQuery, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1321
1327
  declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
1322
1328
 
1323
1329
  type ObjectSearchListItemProps = SelectedItemProps & {
package/dist/index.esm.js CHANGED
@@ -6177,11 +6177,13 @@ var ObjectSearchContext = createContext5({
6177
6177
  var ObjectSearchProvider = ({
6178
6178
  currentlySelectedItems,
6179
6179
  isMulti = false,
6180
- children
6180
+ children,
6181
+ defaultQuery
6181
6182
  }) => {
6182
6183
  const [query, setQuery] = useState15({
6183
6184
  contentType: "",
6184
- keyword: ""
6185
+ keyword: "",
6186
+ ...defaultQuery
6185
6187
  });
6186
6188
  const { flatVariables } = useVariables(true);
6187
6189
  const querySearchDeferred = useDeferredValue(query);
@@ -6417,22 +6419,22 @@ var ObjectSearchContainer = ({
6417
6419
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6418
6420
  const { flatVariables } = useVariables(true);
6419
6421
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6420
- const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(DefaultResultList, {});
6422
+ const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(
6423
+ ScrollableList,
6424
+ {
6425
+ role: "list",
6426
+ css: css32`
6427
+ > div {
6428
+ transition: max-height var(--duration-slow) var(--timing-ease-out);
6429
+ max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6430
+ }
6431
+ `,
6432
+ children: /* @__PURE__ */ jsx60(DefaultResultList, {})
6433
+ }
6434
+ );
6421
6435
  const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
6422
6436
  searchFilters,
6423
- /* @__PURE__ */ jsx60(
6424
- ScrollableList,
6425
- {
6426
- role: "list",
6427
- css: css32`
6428
- > div {
6429
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6430
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6431
- }
6432
- `,
6433
- children: listItems
6434
- }
6435
- )
6437
+ listItems
6436
6438
  ] });
6437
6439
  const handleSelectedVariableChange = (selectedValue) => {
6438
6440
  var _a2;
@@ -6526,10 +6528,11 @@ var ObjectSearchFilter = ({
6526
6528
  selectLabel = "Content Type Select",
6527
6529
  selectOptions
6528
6530
  }) => {
6531
+ var _a, _b;
6529
6532
  const { query, onSetQuery } = useObjectSearchContext();
6530
6533
  const [searchState, setSearchState] = useState16({
6531
- contentType: "",
6532
- keyword: ""
6534
+ contentType: (_a = query.contentType) != null ? _a : "",
6535
+ keyword: (_b = query.keyword) != null ? _b : ""
6533
6536
  });
6534
6537
  const handleFilterChange = (value) => {
6535
6538
  setSearchState((prev) => {
@@ -6544,8 +6547,8 @@ var ObjectSearchFilter = ({
6544
6547
  return [
6545
6548
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6546
6549
  ...selectOptions ? selectOptions.map((option) => {
6547
- var _a;
6548
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6550
+ var _a2;
6551
+ return { name: option == null ? void 0 : option.name, label: (_a2 = option.label) != null ? _a2 : option == null ? void 0 : option.name, id: option.id };
6549
6552
  }) : []
6550
6553
  ];
6551
6554
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
@@ -6916,14 +6919,14 @@ var QueryFilter = ({
6916
6919
  ],
6917
6920
  children
6918
6921
  }) => {
6919
- var _a, _b, _c, _d;
6922
+ var _a, _b, _c, _d, _e, _f;
6920
6923
  const { query, onSetQuery } = useObjectSearchContext();
6921
6924
  const [queryState, setQueryState] = useState17({
6922
- contentType: "",
6923
- keyword: "",
6925
+ contentType: (_a = query.contentType) != null ? _a : "",
6926
+ keyword: (_b = query.contentType) != null ? _b : "",
6924
6927
  count: countValue != null ? countValue : 5,
6925
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
6926
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
6928
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6929
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6927
6930
  });
6928
6931
  const handleFilterChange = (value) => {
6929
6932
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6939,7 +6942,7 @@ var QueryFilter = ({
6939
6942
  InputVariables,
6940
6943
  {
6941
6944
  label: searchInputLabel,
6942
- value: (_c = queryState.keyword) != null ? _c : "",
6945
+ value: (_e = queryState.keyword) != null ? _e : "",
6943
6946
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6944
6947
  disableInlineMenu: true,
6945
6948
  id: "qf_searchText",
@@ -6963,7 +6966,7 @@ var QueryFilter = ({
6963
6966
  {
6964
6967
  label: contentTypeLabel,
6965
6968
  id: "qf_contentType",
6966
- value: (_d = queryState.contentType) != null ? _d : "",
6969
+ value: (_f = queryState.contentType) != null ? _f : "",
6967
6970
  onChange: (newType) => handleFilterChange({ contentType: newType }),
6968
6971
  disableInlineMenu: true,
6969
6972
  inputWhenNoVariables: /* @__PURE__ */ jsx66(
package/dist/index.js CHANGED
@@ -6308,11 +6308,13 @@ var ObjectSearchContext = (0, import_react64.createContext)({
6308
6308
  var ObjectSearchProvider = ({
6309
6309
  currentlySelectedItems,
6310
6310
  isMulti = false,
6311
- children
6311
+ children,
6312
+ defaultQuery
6312
6313
  }) => {
6313
6314
  const [query, setQuery] = (0, import_react64.useState)({
6314
6315
  contentType: "",
6315
- keyword: ""
6316
+ keyword: "",
6317
+ ...defaultQuery
6316
6318
  });
6317
6319
  const { flatVariables } = useVariables(true);
6318
6320
  const querySearchDeferred = (0, import_react64.useDeferredValue)(query);
@@ -6548,22 +6550,22 @@ var ObjectSearchContainer = ({
6548
6550
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6549
6551
  const { flatVariables } = useVariables(true);
6550
6552
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6551
- const listItems = resultList != null ? resultList : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DefaultResultList, {});
6553
+ const listItems = resultList != null ? resultList : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6554
+ import_design_system35.ScrollableList,
6555
+ {
6556
+ role: "list",
6557
+ css: import_react66.css`
6558
+ > div {
6559
+ transition: max-height var(--duration-slow) var(--timing-ease-out);
6560
+ max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6561
+ }
6562
+ `,
6563
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DefaultResultList, {})
6564
+ }
6565
+ );
6552
6566
  const body = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_design_system35.VerticalRhythm, { children: [
6553
6567
  searchFilters,
6554
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6555
- import_design_system35.ScrollableList,
6556
- {
6557
- role: "list",
6558
- css: import_react66.css`
6559
- > div {
6560
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6561
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6562
- }
6563
- `,
6564
- children: listItems
6565
- }
6566
- )
6568
+ listItems
6567
6569
  ] });
6568
6570
  const handleSelectedVariableChange = (selectedValue) => {
6569
6571
  var _a2;
@@ -6657,10 +6659,11 @@ var ObjectSearchFilter = ({
6657
6659
  selectLabel = "Content Type Select",
6658
6660
  selectOptions
6659
6661
  }) => {
6662
+ var _a, _b;
6660
6663
  const { query, onSetQuery } = useObjectSearchContext();
6661
6664
  const [searchState, setSearchState] = (0, import_react68.useState)({
6662
- contentType: "",
6663
- keyword: ""
6665
+ contentType: (_a = query.contentType) != null ? _a : "",
6666
+ keyword: (_b = query.keyword) != null ? _b : ""
6664
6667
  });
6665
6668
  const handleFilterChange = (value) => {
6666
6669
  setSearchState((prev) => {
@@ -6675,8 +6678,8 @@ var ObjectSearchFilter = ({
6675
6678
  return [
6676
6679
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6677
6680
  ...selectOptions ? selectOptions.map((option) => {
6678
- var _a;
6679
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6681
+ var _a2;
6682
+ return { name: option == null ? void 0 : option.name, label: (_a2 = option.label) != null ? _a2 : option == null ? void 0 : option.name, id: option.id };
6680
6683
  }) : []
6681
6684
  ];
6682
6685
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
@@ -7047,14 +7050,14 @@ var QueryFilter = ({
7047
7050
  ],
7048
7051
  children
7049
7052
  }) => {
7050
- var _a, _b, _c, _d;
7053
+ var _a, _b, _c, _d, _e, _f;
7051
7054
  const { query, onSetQuery } = useObjectSearchContext();
7052
7055
  const [queryState, setQueryState] = (0, import_react72.useState)({
7053
- contentType: "",
7054
- keyword: "",
7056
+ contentType: (_a = query.contentType) != null ? _a : "",
7057
+ keyword: (_b = query.contentType) != null ? _b : "",
7055
7058
  count: countValue != null ? countValue : 5,
7056
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
7057
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
7059
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
7060
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
7058
7061
  });
7059
7062
  const handleFilterChange = (value) => {
7060
7063
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -7070,7 +7073,7 @@ var QueryFilter = ({
7070
7073
  InputVariables,
7071
7074
  {
7072
7075
  label: searchInputLabel,
7073
- value: (_c = queryState.keyword) != null ? _c : "",
7076
+ value: (_e = queryState.keyword) != null ? _e : "",
7074
7077
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
7075
7078
  disableInlineMenu: true,
7076
7079
  id: "qf_searchText",
@@ -7094,7 +7097,7 @@ var QueryFilter = ({
7094
7097
  {
7095
7098
  label: contentTypeLabel,
7096
7099
  id: "qf_contentType",
7097
- value: (_d = queryState.contentType) != null ? _d : "",
7100
+ value: (_f = queryState.contentType) != null ? _f : "",
7098
7101
  onChange: (newType) => handleFilterChange({ contentType: newType }),
7099
7102
  disableInlineMenu: true,
7100
7103
  inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
package/dist/index.mjs CHANGED
@@ -6177,11 +6177,13 @@ var ObjectSearchContext = createContext5({
6177
6177
  var ObjectSearchProvider = ({
6178
6178
  currentlySelectedItems,
6179
6179
  isMulti = false,
6180
- children
6180
+ children,
6181
+ defaultQuery
6181
6182
  }) => {
6182
6183
  const [query, setQuery] = useState15({
6183
6184
  contentType: "",
6184
- keyword: ""
6185
+ keyword: "",
6186
+ ...defaultQuery
6185
6187
  });
6186
6188
  const { flatVariables } = useVariables(true);
6187
6189
  const querySearchDeferred = useDeferredValue(query);
@@ -6417,22 +6419,22 @@ var ObjectSearchContainer = ({
6417
6419
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6418
6420
  const { flatVariables } = useVariables(true);
6419
6421
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6420
- const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(DefaultResultList, {});
6422
+ const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(
6423
+ ScrollableList,
6424
+ {
6425
+ role: "list",
6426
+ css: css32`
6427
+ > div {
6428
+ transition: max-height var(--duration-slow) var(--timing-ease-out);
6429
+ max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6430
+ }
6431
+ `,
6432
+ children: /* @__PURE__ */ jsx60(DefaultResultList, {})
6433
+ }
6434
+ );
6421
6435
  const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
6422
6436
  searchFilters,
6423
- /* @__PURE__ */ jsx60(
6424
- ScrollableList,
6425
- {
6426
- role: "list",
6427
- css: css32`
6428
- > div {
6429
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6430
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6431
- }
6432
- `,
6433
- children: listItems
6434
- }
6435
- )
6437
+ listItems
6436
6438
  ] });
6437
6439
  const handleSelectedVariableChange = (selectedValue) => {
6438
6440
  var _a2;
@@ -6526,10 +6528,11 @@ var ObjectSearchFilter = ({
6526
6528
  selectLabel = "Content Type Select",
6527
6529
  selectOptions
6528
6530
  }) => {
6531
+ var _a, _b;
6529
6532
  const { query, onSetQuery } = useObjectSearchContext();
6530
6533
  const [searchState, setSearchState] = useState16({
6531
- contentType: "",
6532
- keyword: ""
6534
+ contentType: (_a = query.contentType) != null ? _a : "",
6535
+ keyword: (_b = query.keyword) != null ? _b : ""
6533
6536
  });
6534
6537
  const handleFilterChange = (value) => {
6535
6538
  setSearchState((prev) => {
@@ -6544,8 +6547,8 @@ var ObjectSearchFilter = ({
6544
6547
  return [
6545
6548
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6546
6549
  ...selectOptions ? selectOptions.map((option) => {
6547
- var _a;
6548
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6550
+ var _a2;
6551
+ return { name: option == null ? void 0 : option.name, label: (_a2 = option.label) != null ? _a2 : option == null ? void 0 : option.name, id: option.id };
6549
6552
  }) : []
6550
6553
  ];
6551
6554
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
@@ -6916,14 +6919,14 @@ var QueryFilter = ({
6916
6919
  ],
6917
6920
  children
6918
6921
  }) => {
6919
- var _a, _b, _c, _d;
6922
+ var _a, _b, _c, _d, _e, _f;
6920
6923
  const { query, onSetQuery } = useObjectSearchContext();
6921
6924
  const [queryState, setQueryState] = useState17({
6922
- contentType: "",
6923
- keyword: "",
6925
+ contentType: (_a = query.contentType) != null ? _a : "",
6926
+ keyword: (_b = query.contentType) != null ? _b : "",
6924
6927
  count: countValue != null ? countValue : 5,
6925
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
6926
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
6928
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6929
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6927
6930
  });
6928
6931
  const handleFilterChange = (value) => {
6929
6932
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6939,7 +6942,7 @@ var QueryFilter = ({
6939
6942
  InputVariables,
6940
6943
  {
6941
6944
  label: searchInputLabel,
6942
- value: (_c = queryState.keyword) != null ? _c : "",
6945
+ value: (_e = queryState.keyword) != null ? _e : "",
6943
6946
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6944
6947
  disableInlineMenu: true,
6945
6948
  id: "qf_searchText",
@@ -6963,7 +6966,7 @@ var QueryFilter = ({
6963
6966
  {
6964
6967
  label: contentTypeLabel,
6965
6968
  id: "qf_contentType",
6966
- value: (_d = queryState.contentType) != null ? _d : "",
6969
+ value: (_f = queryState.contentType) != null ? _f : "",
6967
6970
  onChange: (newType) => handleFilterChange({ contentType: newType }),
6968
6971
  disableInlineMenu: true,
6969
6972
  inputWhenNoVariables: /* @__PURE__ */ jsx66(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "19.88.1-alpha.7+69b3ccba4",
3
+ "version": "19.89.0",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -50,9 +50,9 @@
50
50
  "@lexical/selection": "^0.12.0",
51
51
  "@lexical/utils": "^0.12.0",
52
52
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.10.1/react-icons-all-files-4.10.1.tgz",
53
- "@uniformdev/canvas": "19.88.1-alpha.7+69b3ccba4",
54
- "@uniformdev/design-system": "19.88.1-alpha.7+69b3ccba4",
55
- "@uniformdev/mesh-sdk": "19.88.1-alpha.7+69b3ccba4",
53
+ "@uniformdev/canvas": "19.89.0",
54
+ "@uniformdev/design-system": "19.89.0",
55
+ "@uniformdev/mesh-sdk": "19.89.0",
56
56
  "dequal": "^2.0.3",
57
57
  "lexical": "^0.12.0",
58
58
  "mitt": "^3.0.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "69b3ccba4050c4ff412c4f226f54a36d74cf9a39"
89
+ "gitHead": "247189fb1039d0f81498949534646baaffb8bca7"
90
90
  }