@uniformdev/mesh-sdk-react 19.80.1-alpha.149 → 19.80.1-alpha.192

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;
@@ -1203,6 +1206,7 @@ type ObjectSearchFilterProps = {
1203
1206
  id: string;
1204
1207
  name?: string;
1205
1208
  label: string;
1209
+ value?: string;
1206
1210
  }>;
1207
1211
  /** sets the search input name value
1208
1212
  * @default 'searchText'
@@ -1239,6 +1243,8 @@ type SearchQueryProps<TExtraFilters = unknown> = {
1239
1243
  contentType?: string;
1240
1244
  /** sets the keyword search in the search context */
1241
1245
  keyword?: string;
1246
+ /** sets the locale in the search context */
1247
+ locale?: string;
1242
1248
  } & TExtraFilters;
1243
1249
  type SelectedItemProps<TExtraProps = unknown> = {
1244
1250
  /** sets the id value */
@@ -1316,8 +1322,9 @@ type ObjectSearchProviderProps = {
1316
1322
  children: ReactNode;
1317
1323
  currentlySelectedItems?: Array<SelectedItemProps>;
1318
1324
  isMulti?: boolean;
1325
+ defaultQuery?: SearchQueryProps;
1319
1326
  };
1320
- declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1327
+ declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, defaultQuery, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1321
1328
  declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
1322
1329
 
1323
1330
  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;
@@ -1203,6 +1206,7 @@ type ObjectSearchFilterProps = {
1203
1206
  id: string;
1204
1207
  name?: string;
1205
1208
  label: string;
1209
+ value?: string;
1206
1210
  }>;
1207
1211
  /** sets the search input name value
1208
1212
  * @default 'searchText'
@@ -1239,6 +1243,8 @@ type SearchQueryProps<TExtraFilters = unknown> = {
1239
1243
  contentType?: string;
1240
1244
  /** sets the keyword search in the search context */
1241
1245
  keyword?: string;
1246
+ /** sets the locale in the search context */
1247
+ locale?: string;
1242
1248
  } & TExtraFilters;
1243
1249
  type SelectedItemProps<TExtraProps = unknown> = {
1244
1250
  /** sets the id value */
@@ -1316,8 +1322,9 @@ type ObjectSearchProviderProps = {
1316
1322
  children: ReactNode;
1317
1323
  currentlySelectedItems?: Array<SelectedItemProps>;
1318
1324
  isMulti?: boolean;
1325
+ defaultQuery?: SearchQueryProps;
1319
1326
  };
1320
- declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1327
+ declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, defaultQuery, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1321
1328
  declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
1322
1329
 
1323
1330
  type ObjectSearchListItemProps = SelectedItemProps & {
package/dist/index.esm.js CHANGED
@@ -2654,13 +2654,14 @@ function useConnectedDataAsVariables(connectedData) {
2654
2654
  }
2655
2655
 
2656
2656
  // src/hooks/useDynamicInputsAsVariables.tsx
2657
+ import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
2657
2658
  import { useMemo as useMemo4 } from "react";
2658
2659
  import { Fragment as Fragment4, jsx as jsx26 } from "@emotion/react/jsx-runtime";
2659
2660
  function useDynamicInputsAsVariables(dynamicInputs) {
2660
2661
  return useMemo4(() => {
2661
2662
  const result = Object.entries(dynamicInputs).reduce(
2662
2663
  (acc, [name, input3]) => {
2663
- const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
2664
+ const source = `from ${name === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
2664
2665
  acc[name] = {
2665
2666
  readOnly: true,
2666
2667
  type: input3.type,
@@ -2944,6 +2945,7 @@ function VariableChip({
2944
2945
  tooltip,
2945
2946
  reference,
2946
2947
  onClick,
2948
+ clickToEdit,
2947
2949
  isFresh,
2948
2950
  selected,
2949
2951
  disabled
@@ -2951,7 +2953,7 @@ function VariableChip({
2951
2953
  const hasClickEvent = !!onClick;
2952
2954
  const referenceIsValidFr = isFresh ? true : referenceIsValid;
2953
2955
  const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? Fragment5 : UndefinedVariableReference;
2954
- const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
2956
+ const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
2955
2957
  return /* @__PURE__ */ jsx29(
2956
2958
  MultilineChip,
2957
2959
  {
@@ -3968,6 +3970,7 @@ function VariableNodeComponent({
3968
3970
  displayName: state.isLoading ? /* @__PURE__ */ jsx33(LoadingIndicator2, { size: "sm" }) : state.displayName,
3969
3971
  selected: isSelected,
3970
3972
  disabled: readOnly,
3973
+ clickToEdit: state.hasClickEvent,
3971
3974
  onClick: state.hasClickEvent ? () => {
3972
3975
  setSelected(!isSelected);
3973
3976
  editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
@@ -4459,6 +4462,7 @@ function VariablesComposer(props) {
4459
4462
  /* @__PURE__ */ jsx37(
4460
4463
  OnChangePlugin,
4461
4464
  {
4465
+ ignoreSelectionChange: true,
4462
4466
  onChange: (state) => {
4463
4467
  editorState.current = state;
4464
4468
  if (updateTimeout.current) {
@@ -6173,11 +6177,13 @@ var ObjectSearchContext = createContext5({
6173
6177
  var ObjectSearchProvider = ({
6174
6178
  currentlySelectedItems,
6175
6179
  isMulti = false,
6176
- children
6180
+ children,
6181
+ defaultQuery
6177
6182
  }) => {
6178
6183
  const [query, setQuery] = useState15({
6179
6184
  contentType: "",
6180
- keyword: ""
6185
+ keyword: "",
6186
+ ...defaultQuery
6181
6187
  });
6182
6188
  const { flatVariables } = useVariables(true);
6183
6189
  const querySearchDeferred = useDeferredValue(query);
@@ -6413,22 +6419,22 @@ var ObjectSearchContainer = ({
6413
6419
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6414
6420
  const { flatVariables } = useVariables(true);
6415
6421
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6416
- 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
+ );
6417
6435
  const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
6418
6436
  searchFilters,
6419
- /* @__PURE__ */ jsx60(
6420
- ScrollableList,
6421
- {
6422
- role: "list",
6423
- css: css32`
6424
- > div {
6425
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6426
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6427
- }
6428
- `,
6429
- children: listItems
6430
- }
6431
- )
6437
+ listItems
6432
6438
  ] });
6433
6439
  const handleSelectedVariableChange = (selectedValue) => {
6434
6440
  var _a2;
@@ -6522,10 +6528,11 @@ var ObjectSearchFilter = ({
6522
6528
  selectLabel = "Content Type Select",
6523
6529
  selectOptions
6524
6530
  }) => {
6531
+ var _a, _b;
6525
6532
  const { query, onSetQuery } = useObjectSearchContext();
6526
6533
  const [searchState, setSearchState] = useState16({
6527
- contentType: "",
6528
- keyword: ""
6534
+ contentType: (_a = query.contentType) != null ? _a : "",
6535
+ keyword: (_b = query.keyword) != null ? _b : ""
6529
6536
  });
6530
6537
  const handleFilterChange = (value) => {
6531
6538
  setSearchState((prev) => {
@@ -6539,10 +6546,7 @@ var ObjectSearchFilter = ({
6539
6546
  }
6540
6547
  return [
6541
6548
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6542
- ...selectOptions ? selectOptions.map((option) => {
6543
- var _a;
6544
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6545
- }) : []
6549
+ ...selectOptions != null ? selectOptions : []
6546
6550
  ];
6547
6551
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6548
6552
  const shouldRenderSelect = memoizedSelectOptions.length > 0;
@@ -6912,14 +6916,14 @@ var QueryFilter = ({
6912
6916
  ],
6913
6917
  children
6914
6918
  }) => {
6915
- var _a, _b, _c, _d;
6919
+ var _a, _b, _c, _d, _e, _f;
6916
6920
  const { query, onSetQuery } = useObjectSearchContext();
6917
6921
  const [queryState, setQueryState] = useState17({
6918
- contentType: "",
6919
- keyword: "",
6922
+ contentType: (_a = query.contentType) != null ? _a : "",
6923
+ keyword: (_b = query.contentType) != null ? _b : "",
6920
6924
  count: countValue != null ? countValue : 5,
6921
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
6922
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
6925
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6926
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6923
6927
  });
6924
6928
  const handleFilterChange = (value) => {
6925
6929
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6935,7 +6939,7 @@ var QueryFilter = ({
6935
6939
  InputVariables,
6936
6940
  {
6937
6941
  label: searchInputLabel,
6938
- value: (_c = queryState.keyword) != null ? _c : "",
6942
+ value: (_e = queryState.keyword) != null ? _e : "",
6939
6943
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6940
6944
  disableInlineMenu: true,
6941
6945
  id: "qf_searchText",
@@ -6959,7 +6963,7 @@ var QueryFilter = ({
6959
6963
  {
6960
6964
  label: contentTypeLabel,
6961
6965
  id: "qf_contentType",
6962
- value: (_d = queryState.contentType) != null ? _d : "",
6966
+ value: (_f = queryState.contentType) != null ? _f : "",
6963
6967
  onChange: (newType) => handleFilterChange({ contentType: newType }),
6964
6968
  disableInlineMenu: true,
6965
6969
  inputWhenNoVariables: /* @__PURE__ */ jsx66(
package/dist/index.js CHANGED
@@ -2856,13 +2856,14 @@ function useConnectedDataAsVariables(connectedData) {
2856
2856
  }
2857
2857
 
2858
2858
  // src/hooks/useDynamicInputsAsVariables.tsx
2859
+ var import_canvas = require("@uniformdev/canvas");
2859
2860
  var import_react26 = require("react");
2860
2861
  var import_jsx_runtime26 = require("@emotion/react/jsx-runtime");
2861
2862
  function useDynamicInputsAsVariables(dynamicInputs) {
2862
2863
  return (0, import_react26.useMemo)(() => {
2863
2864
  const result = Object.entries(dynamicInputs).reduce(
2864
2865
  (acc, [name, input3]) => {
2865
- const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
2866
+ const source = `from ${name === import_canvas.LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
2866
2867
  acc[name] = {
2867
2868
  readOnly: true,
2868
2869
  type: input3.type,
@@ -2981,11 +2982,11 @@ var import_lite = require("dequal/lite");
2981
2982
  var import_react30 = require("react");
2982
2983
 
2983
2984
  // src/components/Variables/util/deserializeVariablesEditorState.ts
2984
- var import_canvas = require("@uniformdev/canvas");
2985
+ var import_canvas2 = require("@uniformdev/canvas");
2985
2986
  var import_lexical = require("lexical");
2986
2987
  function deserializeVariablesEditorState(serialized) {
2987
2988
  const result = [];
2988
- (0, import_canvas.parseVariableExpression)(serialized != null ? serialized : "", (token, type) => {
2989
+ (0, import_canvas2.parseVariableExpression)(serialized != null ? serialized : "", (token, type) => {
2989
2990
  if (type === "text") {
2990
2991
  const node = {
2991
2992
  type: import_lexical.TextNode.getType(),
@@ -3112,7 +3113,7 @@ var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerCont
3112
3113
  var import_useLexicalNodeSelection = require("@lexical/react/useLexicalNodeSelection");
3113
3114
  var import_selection = require("@lexical/selection");
3114
3115
  var import_utils2 = require("@lexical/utils");
3115
- var import_canvas3 = require("@uniformdev/canvas");
3116
+ var import_canvas4 = require("@uniformdev/canvas");
3116
3117
  var import_design_system18 = require("@uniformdev/design-system");
3117
3118
  var import_lexical4 = require("lexical");
3118
3119
  var import_react39 = require("react");
@@ -3132,6 +3133,7 @@ function VariableChip({
3132
3133
  tooltip,
3133
3134
  reference,
3134
3135
  onClick,
3136
+ clickToEdit,
3135
3137
  isFresh,
3136
3138
  selected,
3137
3139
  disabled
@@ -3139,7 +3141,7 @@ function VariableChip({
3139
3141
  const hasClickEvent = !!onClick;
3140
3142
  const referenceIsValidFr = isFresh ? true : referenceIsValid;
3141
3143
  const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? import_react31.Fragment : UndefinedVariableReference;
3142
- const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
3144
+ const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
3143
3145
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3144
3146
  import_design_system15.MultilineChip,
3145
3147
  {
@@ -3186,7 +3188,7 @@ var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerCont
3186
3188
  var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
3187
3189
  var import_utils = require("@lexical/utils");
3188
3190
  var import_AiFillPlusCircle = require("@react-icons/all-files/ai/AiFillPlusCircle");
3189
- var import_canvas2 = require("@uniformdev/canvas");
3191
+ var import_canvas3 = require("@uniformdev/canvas");
3190
3192
  var import_design_system17 = require("@uniformdev/design-system");
3191
3193
  var import_lite2 = require("dequal/lite");
3192
3194
  var import_lexical3 = require("lexical");
@@ -3660,7 +3662,7 @@ function useVariablesMenu({
3660
3662
  var _a;
3661
3663
  const targetVariable = variables[value];
3662
3664
  if (overwriteExistingValue) {
3663
- setVariablesEditorValue(editor, (0, import_canvas2.createVariableReference)(value));
3665
+ setVariablesEditorValue(editor, (0, import_canvas3.createVariableReference)(value));
3664
3666
  return true;
3665
3667
  }
3666
3668
  const variableNode = $createVariableNode(value, {
@@ -3830,7 +3832,7 @@ function VariablesPlugin({
3830
3832
  if (!disableVariables) {
3831
3833
  const targetVariable = variablesRef.current.variables[reference];
3832
3834
  if (overwriteExistingValue) {
3833
- setVariablesEditorValue(editor, (0, import_canvas2.createVariableReference)(reference));
3835
+ setVariablesEditorValue(editor, (0, import_canvas3.createVariableReference)(reference));
3834
3836
  return true;
3835
3837
  }
3836
3838
  const variableNode = $createVariableNode(reference, {
@@ -4030,7 +4032,7 @@ var VariableNode = class _VariableNode extends import_lexical4.DecoratorNode {
4030
4032
  * (albeit it won't get the fancy chip-node)
4031
4033
  */
4032
4034
  getTextContent() {
4033
- return (0, import_canvas3.createVariableReference)(this.reference);
4035
+ return (0, import_canvas4.createVariableReference)(this.reference);
4034
4036
  }
4035
4037
  /** Creates the DOM wrapper that hosts the node */
4036
4038
  createDOM() {
@@ -4146,6 +4148,7 @@ function VariableNodeComponent({
4146
4148
  displayName: state.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system18.LoadingIndicator, { size: "sm" }) : state.displayName,
4147
4149
  selected: isSelected,
4148
4150
  disabled: readOnly,
4151
+ clickToEdit: state.hasClickEvent,
4149
4152
  onClick: state.hasClickEvent ? () => {
4150
4153
  setSelected(!isSelected);
4151
4154
  editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
@@ -4283,10 +4286,10 @@ var React10 = __toESM(require("react"));
4283
4286
  var import_react42 = require("react");
4284
4287
 
4285
4288
  // src/components/Variables/util/hasReferencedVariables.ts
4286
- var import_canvas4 = require("@uniformdev/canvas");
4289
+ var import_canvas5 = require("@uniformdev/canvas");
4287
4290
  function hasReferencedVariables(value) {
4288
4291
  let result = false;
4289
- (0, import_canvas4.parseVariableExpression)(value, (token, type) => {
4292
+ (0, import_canvas5.parseVariableExpression)(value, (token, type) => {
4290
4293
  if (type === "variable") {
4291
4294
  result = true;
4292
4295
  return false;
@@ -4572,7 +4575,7 @@ function SingleLineTextPlugin() {
4572
4575
  }
4573
4576
 
4574
4577
  // src/components/Variables/util/serializeVariablesEditorState.ts
4575
- var import_canvas5 = require("@uniformdev/canvas");
4578
+ var import_canvas6 = require("@uniformdev/canvas");
4576
4579
  var import_lexical8 = require("lexical");
4577
4580
 
4578
4581
  // src/components/Variables/util/variableExpression.ts
@@ -4591,7 +4594,7 @@ function serializeRecursive(node, buffer) {
4591
4594
  buffer.push(node.text.replace(variablePrefix, "\\${"));
4592
4595
  }
4593
4596
  if (node.type === VariableNode.getType()) {
4594
- buffer.push((0, import_canvas5.createVariableReference)(node.reference));
4597
+ buffer.push((0, import_canvas6.createVariableReference)(node.reference));
4595
4598
  }
4596
4599
  if (node.type === import_lexical8.LineBreakNode.getType()) {
4597
4600
  buffer.push("\n");
@@ -4637,6 +4640,7 @@ function VariablesComposer(props) {
4637
4640
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4638
4641
  import_LexicalOnChangePlugin.OnChangePlugin,
4639
4642
  {
4643
+ ignoreSelectionChange: true,
4640
4644
  onChange: (state) => {
4641
4645
  editorState.current = state;
4642
4646
  if (updateTimeout.current) {
@@ -4910,7 +4914,7 @@ function InputVariablesOverlayMenu({
4910
4914
 
4911
4915
  // src/components/Variables/ParameterConnectionIndicator.tsx
4912
4916
  var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
4913
- var import_canvas6 = require("@uniformdev/canvas");
4917
+ var import_canvas7 = require("@uniformdev/canvas");
4914
4918
  var import_design_system22 = require("@uniformdev/design-system");
4915
4919
  var import_react51 = require("react");
4916
4920
 
@@ -5015,7 +5019,7 @@ function ParameterConnectionIndicator({
5015
5019
  }) {
5016
5020
  const hasVariablesInValue = (0, import_react51.useMemo)(() => {
5017
5021
  let result = false;
5018
- (0, import_canvas6.bindVariablesToObject)({
5022
+ (0, import_canvas7.bindVariablesToObject)({
5019
5023
  value,
5020
5024
  variables: {},
5021
5025
  handleBinding: () => {
@@ -6279,11 +6283,11 @@ var DataRefreshButton = ({
6279
6283
 
6280
6284
  // src/components/ObjectSearch/ObjectSearchContainer.tsx
6281
6285
  var import_react66 = require("@emotion/react");
6282
- var import_canvas8 = require("@uniformdev/canvas");
6286
+ var import_canvas9 = require("@uniformdev/canvas");
6283
6287
  var import_design_system35 = require("@uniformdev/design-system");
6284
6288
 
6285
6289
  // src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
6286
- var import_canvas7 = require("@uniformdev/canvas");
6290
+ var import_canvas8 = require("@uniformdev/canvas");
6287
6291
  var import_react64 = require("react");
6288
6292
  var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
6289
6293
  var ObjectSearchContext = (0, import_react64.createContext)({
@@ -6304,11 +6308,13 @@ var ObjectSearchContext = (0, import_react64.createContext)({
6304
6308
  var ObjectSearchProvider = ({
6305
6309
  currentlySelectedItems,
6306
6310
  isMulti = false,
6307
- children
6311
+ children,
6312
+ defaultQuery
6308
6313
  }) => {
6309
6314
  const [query, setQuery] = (0, import_react64.useState)({
6310
6315
  contentType: "",
6311
- keyword: ""
6316
+ keyword: "",
6317
+ ...defaultQuery
6312
6318
  });
6313
6319
  const { flatVariables } = useVariables(true);
6314
6320
  const querySearchDeferred = (0, import_react64.useDeferredValue)(query);
@@ -6380,7 +6386,7 @@ function useObjectSearchContext() {
6380
6386
  return (0, import_react64.useContext)(ObjectSearchContext);
6381
6387
  }
6382
6388
  function bindQuery(query, inputs) {
6383
- const { result, errors } = (0, import_canvas7.bindVariablesToObject)({
6389
+ const { result, errors } = (0, import_canvas8.bindVariablesToObject)({
6384
6390
  value: query,
6385
6391
  variables: inputs,
6386
6392
  errorPrefix: "Dynamic input"
@@ -6544,22 +6550,22 @@ var ObjectSearchContainer = ({
6544
6550
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6545
6551
  const { flatVariables } = useVariables(true);
6546
6552
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6547
- 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
+ );
6548
6566
  const body = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_design_system35.VerticalRhythm, { children: [
6549
6567
  searchFilters,
6550
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6551
- import_design_system35.ScrollableList,
6552
- {
6553
- role: "list",
6554
- css: import_react66.css`
6555
- > div {
6556
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6557
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6558
- }
6559
- `,
6560
- children: listItems
6561
- }
6562
- )
6568
+ listItems
6563
6569
  ] });
6564
6570
  const handleSelectedVariableChange = (selectedValue) => {
6565
6571
  var _a2;
@@ -6567,7 +6573,7 @@ var ObjectSearchContainer = ({
6567
6573
  onSelectItem([]);
6568
6574
  return;
6569
6575
  }
6570
- const { result, errors } = (0, import_canvas8.bindVariables)({
6576
+ const { result, errors } = (0, import_canvas9.bindVariables)({
6571
6577
  value: selectedValue,
6572
6578
  variables: flatVariables,
6573
6579
  errorPrefix: "Dynamic input"
@@ -6653,10 +6659,11 @@ var ObjectSearchFilter = ({
6653
6659
  selectLabel = "Content Type Select",
6654
6660
  selectOptions
6655
6661
  }) => {
6662
+ var _a, _b;
6656
6663
  const { query, onSetQuery } = useObjectSearchContext();
6657
6664
  const [searchState, setSearchState] = (0, import_react68.useState)({
6658
- contentType: "",
6659
- keyword: ""
6665
+ contentType: (_a = query.contentType) != null ? _a : "",
6666
+ keyword: (_b = query.keyword) != null ? _b : ""
6660
6667
  });
6661
6668
  const handleFilterChange = (value) => {
6662
6669
  setSearchState((prev) => {
@@ -6670,10 +6677,7 @@ var ObjectSearchFilter = ({
6670
6677
  }
6671
6678
  return [
6672
6679
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6673
- ...selectOptions ? selectOptions.map((option) => {
6674
- var _a;
6675
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6676
- }) : []
6680
+ ...selectOptions != null ? selectOptions : []
6677
6681
  ];
6678
6682
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6679
6683
  const shouldRenderSelect = memoizedSelectOptions.length > 0;
@@ -7043,14 +7047,14 @@ var QueryFilter = ({
7043
7047
  ],
7044
7048
  children
7045
7049
  }) => {
7046
- var _a, _b, _c, _d;
7050
+ var _a, _b, _c, _d, _e, _f;
7047
7051
  const { query, onSetQuery } = useObjectSearchContext();
7048
7052
  const [queryState, setQueryState] = (0, import_react72.useState)({
7049
- contentType: "",
7050
- keyword: "",
7053
+ contentType: (_a = query.contentType) != null ? _a : "",
7054
+ keyword: (_b = query.contentType) != null ? _b : "",
7051
7055
  count: countValue != null ? countValue : 5,
7052
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
7053
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
7056
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
7057
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
7054
7058
  });
7055
7059
  const handleFilterChange = (value) => {
7056
7060
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -7066,7 +7070,7 @@ var QueryFilter = ({
7066
7070
  InputVariables,
7067
7071
  {
7068
7072
  label: searchInputLabel,
7069
- value: (_c = queryState.keyword) != null ? _c : "",
7073
+ value: (_e = queryState.keyword) != null ? _e : "",
7070
7074
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
7071
7075
  disableInlineMenu: true,
7072
7076
  id: "qf_searchText",
@@ -7090,7 +7094,7 @@ var QueryFilter = ({
7090
7094
  {
7091
7095
  label: contentTypeLabel,
7092
7096
  id: "qf_contentType",
7093
- value: (_d = queryState.contentType) != null ? _d : "",
7097
+ value: (_f = queryState.contentType) != null ? _f : "",
7094
7098
  onChange: (newType) => handleFilterChange({ contentType: newType }),
7095
7099
  disableInlineMenu: true,
7096
7100
  inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
package/dist/index.mjs CHANGED
@@ -2654,13 +2654,14 @@ function useConnectedDataAsVariables(connectedData) {
2654
2654
  }
2655
2655
 
2656
2656
  // src/hooks/useDynamicInputsAsVariables.tsx
2657
+ import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
2657
2658
  import { useMemo as useMemo4 } from "react";
2658
2659
  import { Fragment as Fragment4, jsx as jsx26 } from "@emotion/react/jsx-runtime";
2659
2660
  function useDynamicInputsAsVariables(dynamicInputs) {
2660
2661
  return useMemo4(() => {
2661
2662
  const result = Object.entries(dynamicInputs).reduce(
2662
2663
  (acc, [name, input3]) => {
2663
- const source = `from ${input3.type === "path" ? "URL path" : "query string"}`;
2664
+ const source = `from ${name === LOCALE_DYNAMIC_INPUT_NAME ? "current locale" : input3.type === "path" ? "URL path" : "query string"}`;
2664
2665
  acc[name] = {
2665
2666
  readOnly: true,
2666
2667
  type: input3.type,
@@ -2944,6 +2945,7 @@ function VariableChip({
2944
2945
  tooltip,
2945
2946
  reference,
2946
2947
  onClick,
2948
+ clickToEdit,
2947
2949
  isFresh,
2948
2950
  selected,
2949
2951
  disabled
@@ -2951,7 +2953,7 @@ function VariableChip({
2951
2953
  const hasClickEvent = !!onClick;
2952
2954
  const referenceIsValidFr = isFresh ? true : referenceIsValid;
2953
2955
  const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? Fragment5 : UndefinedVariableReference;
2954
- const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent ? "Click to edit" : void 0;
2956
+ const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
2955
2957
  return /* @__PURE__ */ jsx29(
2956
2958
  MultilineChip,
2957
2959
  {
@@ -3968,6 +3970,7 @@ function VariableNodeComponent({
3968
3970
  displayName: state.isLoading ? /* @__PURE__ */ jsx33(LoadingIndicator2, { size: "sm" }) : state.displayName,
3969
3971
  selected: isSelected,
3970
3972
  disabled: readOnly,
3973
+ clickToEdit: state.hasClickEvent,
3971
3974
  onClick: state.hasClickEvent ? () => {
3972
3975
  setSelected(!isSelected);
3973
3976
  editor.dispatchCommand(EDIT_VARIABLE_COMMAND, {
@@ -4459,6 +4462,7 @@ function VariablesComposer(props) {
4459
4462
  /* @__PURE__ */ jsx37(
4460
4463
  OnChangePlugin,
4461
4464
  {
4465
+ ignoreSelectionChange: true,
4462
4466
  onChange: (state) => {
4463
4467
  editorState.current = state;
4464
4468
  if (updateTimeout.current) {
@@ -6173,11 +6177,13 @@ var ObjectSearchContext = createContext5({
6173
6177
  var ObjectSearchProvider = ({
6174
6178
  currentlySelectedItems,
6175
6179
  isMulti = false,
6176
- children
6180
+ children,
6181
+ defaultQuery
6177
6182
  }) => {
6178
6183
  const [query, setQuery] = useState15({
6179
6184
  contentType: "",
6180
- keyword: ""
6185
+ keyword: "",
6186
+ ...defaultQuery
6181
6187
  });
6182
6188
  const { flatVariables } = useVariables(true);
6183
6189
  const querySearchDeferred = useDeferredValue(query);
@@ -6413,22 +6419,22 @@ var ObjectSearchContainer = ({
6413
6419
  const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
6414
6420
  const { flatVariables } = useVariables(true);
6415
6421
  const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
6416
- 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
+ );
6417
6435
  const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
6418
6436
  searchFilters,
6419
- /* @__PURE__ */ jsx60(
6420
- ScrollableList,
6421
- {
6422
- role: "list",
6423
- css: css32`
6424
- > div {
6425
- transition: max-height var(--duration-slow) var(--timing-ease-out);
6426
- max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
6427
- }
6428
- `,
6429
- children: listItems
6430
- }
6431
- )
6437
+ listItems
6432
6438
  ] });
6433
6439
  const handleSelectedVariableChange = (selectedValue) => {
6434
6440
  var _a2;
@@ -6522,10 +6528,11 @@ var ObjectSearchFilter = ({
6522
6528
  selectLabel = "Content Type Select",
6523
6529
  selectOptions
6524
6530
  }) => {
6531
+ var _a, _b;
6525
6532
  const { query, onSetQuery } = useObjectSearchContext();
6526
6533
  const [searchState, setSearchState] = useState16({
6527
- contentType: "",
6528
- keyword: ""
6534
+ contentType: (_a = query.contentType) != null ? _a : "",
6535
+ keyword: (_b = query.keyword) != null ? _b : ""
6529
6536
  });
6530
6537
  const handleFilterChange = (value) => {
6531
6538
  setSearchState((prev) => {
@@ -6539,10 +6546,7 @@ var ObjectSearchFilter = ({
6539
6546
  }
6540
6547
  return [
6541
6548
  ...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
6542
- ...selectOptions ? selectOptions.map((option) => {
6543
- var _a;
6544
- return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
6545
- }) : []
6549
+ ...selectOptions != null ? selectOptions : []
6546
6550
  ];
6547
6551
  }, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
6548
6552
  const shouldRenderSelect = memoizedSelectOptions.length > 0;
@@ -6912,14 +6916,14 @@ var QueryFilter = ({
6912
6916
  ],
6913
6917
  children
6914
6918
  }) => {
6915
- var _a, _b, _c, _d;
6919
+ var _a, _b, _c, _d, _e, _f;
6916
6920
  const { query, onSetQuery } = useObjectSearchContext();
6917
6921
  const [queryState, setQueryState] = useState17({
6918
- contentType: "",
6919
- keyword: "",
6922
+ contentType: (_a = query.contentType) != null ? _a : "",
6923
+ keyword: (_b = query.contentType) != null ? _b : "",
6920
6924
  count: countValue != null ? countValue : 5,
6921
- sortBy: (_a = sortOptions[0].id) != null ? _a : "",
6922
- sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
6925
+ sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6926
+ sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6923
6927
  });
6924
6928
  const handleFilterChange = (value) => {
6925
6929
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6935,7 +6939,7 @@ var QueryFilter = ({
6935
6939
  InputVariables,
6936
6940
  {
6937
6941
  label: searchInputLabel,
6938
- value: (_c = queryState.keyword) != null ? _c : "",
6942
+ value: (_e = queryState.keyword) != null ? _e : "",
6939
6943
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6940
6944
  disableInlineMenu: true,
6941
6945
  id: "qf_searchText",
@@ -6959,7 +6963,7 @@ var QueryFilter = ({
6959
6963
  {
6960
6964
  label: contentTypeLabel,
6961
6965
  id: "qf_contentType",
6962
- value: (_d = queryState.contentType) != null ? _d : "",
6966
+ value: (_f = queryState.contentType) != null ? _f : "",
6963
6967
  onChange: (newType) => handleFilterChange({ contentType: newType }),
6964
6968
  disableInlineMenu: true,
6965
6969
  inputWhenNoVariables: /* @__PURE__ */ jsx66(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "19.80.1-alpha.149+7f4e45fecc",
3
+ "version": "19.80.1-alpha.192+a267dfba25",
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.80.1-alpha.149+7f4e45fecc",
54
- "@uniformdev/design-system": "19.80.1-alpha.149+7f4e45fecc",
55
- "@uniformdev/mesh-sdk": "19.80.1-alpha.149+7f4e45fecc",
53
+ "@uniformdev/canvas": "19.80.1-alpha.192+a267dfba25",
54
+ "@uniformdev/design-system": "19.80.1-alpha.192+a267dfba25",
55
+ "@uniformdev/mesh-sdk": "19.80.1-alpha.192+a267dfba25",
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": "7f4e45fecc013dc224fbd0a2975f6d208382b05e"
89
+ "gitHead": "a267dfba252cb26b79bc51681d526f2fbb8d5af3"
90
90
  }