@uniformdev/mesh-sdk-react 19.61.1-alpha.10 → 19.61.1-alpha.18

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
@@ -437,6 +437,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
437
437
  type: TLocationType;
438
438
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
439
439
  type: TLocationType;
440
+ }> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
441
+ type: TLocationType;
440
442
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
441
443
  type: TLocationType;
442
444
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
@@ -454,6 +456,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
454
456
  type: TLocationType;
455
457
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
456
458
  type: TLocationType;
459
+ }> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
460
+ type: TLocationType;
457
461
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
458
462
  type: TLocationType;
459
463
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
@@ -470,6 +474,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
470
474
  type: TLocationType;
471
475
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
472
476
  type: TLocationType;
477
+ }> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
478
+ type: TLocationType;
473
479
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
474
480
  type: TLocationType;
475
481
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
@@ -592,6 +598,10 @@ type MeshDataVariableDefinition = Omit<DataVariableDefinition, 'default'> & {
592
598
  * If not passed, defaults to helpText.
593
599
  */
594
600
  tooltip?: string;
601
+ /**
602
+ If true the variable will be shown only in menus.
603
+ */
604
+ system?: boolean;
595
605
  };
596
606
  /**
597
607
  * Provides information for an undefined variable that might be referenced in data,
@@ -801,6 +811,8 @@ type InputVariablesProps<TEditorContext = unknown> = {
801
811
  warningMessage?: string;
802
812
  /** (optional) sets and shows the the info message value */
803
813
  infoMessage?: string;
814
+ /** (optional) sets placeholder when there is no value */
815
+ placeholder?: string;
804
816
  /** (optional) sets caption text value */
805
817
  caption?: string;
806
818
  /** Disables editing the value of the input, editing variables, and adding variables */
package/dist/index.d.ts CHANGED
@@ -437,6 +437,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
437
437
  type: TLocationType;
438
438
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
439
439
  type: TLocationType;
440
+ }> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
441
+ type: TLocationType;
440
442
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
441
443
  type: TLocationType;
442
444
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
@@ -454,6 +456,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
454
456
  type: TLocationType;
455
457
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
456
458
  type: TLocationType;
459
+ }> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
460
+ type: TLocationType;
457
461
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
458
462
  type: TLocationType;
459
463
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
@@ -470,6 +474,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
470
474
  type: TLocationType;
471
475
  }> | Extract<_uniformdev_mesh_sdk.DataResourceLocation, {
472
476
  type: TLocationType;
477
+ }> | Extract<_uniformdev_mesh_sdk.AIPromptMetadataLocation, {
478
+ type: TLocationType;
473
479
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeLocation<TLocationValue, unknown, TLocationSetValue, unknown>, {
474
480
  type: TLocationType;
475
481
  }> | Extract<_uniformdev_mesh_sdk.ParamTypeConfigLocation<TLocationValue, unknown>, {
@@ -592,6 +598,10 @@ type MeshDataVariableDefinition = Omit<DataVariableDefinition, 'default'> & {
592
598
  * If not passed, defaults to helpText.
593
599
  */
594
600
  tooltip?: string;
601
+ /**
602
+ If true the variable will be shown only in menus.
603
+ */
604
+ system?: boolean;
595
605
  };
596
606
  /**
597
607
  * Provides information for an undefined variable that might be referenced in data,
@@ -801,6 +811,8 @@ type InputVariablesProps<TEditorContext = unknown> = {
801
811
  warningMessage?: string;
802
812
  /** (optional) sets and shows the the info message value */
803
813
  infoMessage?: string;
814
+ /** (optional) sets placeholder when there is no value */
815
+ placeholder?: string;
804
816
  /** (optional) sets caption text value */
805
817
  caption?: string;
806
818
  /** Disables editing the value of the input, editing variables, and adding variables */
package/dist/index.esm.js CHANGED
@@ -3002,7 +3002,7 @@ import {
3002
3002
  import { mergeRegister } from "@lexical/utils";
3003
3003
  import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
3004
3004
  import { createVariableReference } from "@uniformdev/canvas";
3005
- import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItem as MenuItem2, MenuItemSeparator } from "@uniformdev/design-system";
3005
+ import { HorizontalRhythm as HorizontalRhythm2, MenuGroup, MenuItemInner, MenuItemSeparator } from "@uniformdev/design-system";
3006
3006
  import { dequal as dequal2 } from "dequal/lite";
3007
3007
  import {
3008
3008
  $createTextNode,
@@ -3766,7 +3766,7 @@ function VariablesPlugin({
3766
3766
  currentCumulativeMenuIndex++;
3767
3767
  const myCumulativeIndex = currentCumulativeMenuIndex;
3768
3768
  return /* @__PURE__ */ jsx32(
3769
- MenuItem2,
3769
+ MenuItemInner,
3770
3770
  {
3771
3771
  active: selectedIndex === myCumulativeIndex,
3772
3772
  onClick: () => {
@@ -4083,6 +4083,18 @@ var inputCompact = css21`
4083
4083
  padding-block: var(--spacing-sm);
4084
4084
  font-size: var(--fs-sm);
4085
4085
  `;
4086
+ var placeholderCaption = css21`
4087
+ position: absolute;
4088
+ color: var(--gray-400);
4089
+ inset: var(--spacing-base) var(--spacing-lg) var(--spacing-base) var(--spacing-base);
4090
+ overflow: hidden;
4091
+ text-overflow: ellipsis;
4092
+ white-space: nowrap;
4093
+ pointer-events: none;
4094
+ `;
4095
+ var placeholderCompact = css21`
4096
+ inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
4097
+ `;
4086
4098
 
4087
4099
  // src/components/Variables/toolbox/InputVariablesProvider.tsx
4088
4100
  import * as React10 from "react";
@@ -4201,7 +4213,7 @@ import { CLEAR_EDITOR_COMMAND } from "lexical";
4201
4213
  // src/components/Variables/toolbox/SelectVariableMenu.tsx
4202
4214
  import { BsFillPlusCircleFill } from "@react-icons/all-files/bs/BsFillPlusCircleFill";
4203
4215
  import { CgUsbC } from "@react-icons/all-files/cg/CgUsbC";
4204
- import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem3, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
4216
+ import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem2, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
4205
4217
  import { useRef as useRef11 } from "react";
4206
4218
  import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
4207
4219
  function SelectVariableMenu({
@@ -4244,7 +4256,7 @@ function SelectVariableMenu({
4244
4256
  menuLabel: menuTooltip,
4245
4257
  children: [
4246
4258
  showAddVariableMenuOptionForReals ? /* @__PURE__ */ jsx34(
4247
- MenuItem3,
4259
+ MenuItem2,
4248
4260
  {
4249
4261
  onClick: async () => {
4250
4262
  const result = await editVariable("", getEditorContext == null ? void 0 : getEditorContext());
@@ -4266,7 +4278,7 @@ function SelectVariableMenu({
4266
4278
  return /* @__PURE__ */ jsx34(MenuGroup2, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
4267
4279
  const { name, displayName, helpText } = variable;
4268
4280
  return /* @__PURE__ */ jsxs19(
4269
- MenuItem3,
4281
+ MenuItem2,
4270
4282
  {
4271
4283
  id: name,
4272
4284
  css: menuItemTextGroup,
@@ -4281,7 +4293,7 @@ function SelectVariableMenu({
4281
4293
  }) }, group.name);
4282
4294
  }),
4283
4295
  menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ jsx34(MenuItemSeparator2, {}) : null,
4284
- onResetVariables ? /* @__PURE__ */ jsx34(MenuItem3, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
4296
+ onResetVariables ? /* @__PURE__ */ jsx34(MenuItem2, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
4285
4297
  tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ jsx34(MenuItemSeparator2, {}) : null,
4286
4298
  tip ? /* @__PURE__ */ jsx34("i", { css: variablesTipText, children: tip }) : null
4287
4299
  ]
@@ -4491,14 +4503,18 @@ import {
4491
4503
  PASTE_COMMAND as PASTE_COMMAND2
4492
4504
  } from "lexical";
4493
4505
  import { useEffect as useEffect13 } from "react";
4494
- import { jsx as jsx38, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
4495
- function VariablesComposerInput({ css: css37, ...contentEditableProps }) {
4506
+ import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
4507
+ function VariablesComposerInput({
4508
+ css: css37,
4509
+ placeholder,
4510
+ ...contentEditableProps
4511
+ }) {
4496
4512
  return /* @__PURE__ */ jsxs22("div", { children: [
4497
4513
  /* @__PURE__ */ jsx38(
4498
4514
  PlainTextPlugin,
4499
4515
  {
4500
4516
  contentEditable: /* @__PURE__ */ jsx38(ContentEditable, { ...contentEditableProps }),
4501
- placeholder: null,
4517
+ placeholder: placeholder ? /* @__PURE__ */ jsx38(Fragment9, { children: placeholder }) : null,
4502
4518
  ErrorBoundary: LexicalErrorBoundary
4503
4519
  }
4504
4520
  ),
@@ -4583,7 +4599,7 @@ function RichishCopyAndPastePlugin() {
4583
4599
  }
4584
4600
 
4585
4601
  // src/components/Variables/InputVariables.tsx
4586
- import { Fragment as Fragment9, jsx as jsx39, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
4602
+ import { Fragment as Fragment10, jsx as jsx39, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
4587
4603
  function InputVariables(props) {
4588
4604
  const {
4589
4605
  id,
@@ -4596,6 +4612,7 @@ function InputVariables(props) {
4596
4612
  transformPaste,
4597
4613
  showAddVariableMenuOption,
4598
4614
  inputWhenNoVariables,
4615
+ placeholder,
4599
4616
  caption,
4600
4617
  errorMessage,
4601
4618
  warningMessage,
@@ -4636,7 +4653,17 @@ function InputVariables(props) {
4636
4653
  "aria-label": ariaLabel,
4637
4654
  "data-testid": dataTestId ? dataTestId : "input-container",
4638
4655
  "data-text-value": value,
4639
- css: [input, styleVariant === "compact" ? inputCompact : null]
4656
+ css: [input, styleVariant === "compact" ? inputCompact : null],
4657
+ placeholder: placeholder ? /* @__PURE__ */ jsx39(
4658
+ Caption,
4659
+ {
4660
+ css: [
4661
+ placeholderCaption,
4662
+ styleVariant === "compact" ? placeholderCompact : null
4663
+ ],
4664
+ children: placeholder
4665
+ }
4666
+ ) : void 0
4640
4667
  }
4641
4668
  )
4642
4669
  }
@@ -4695,7 +4722,7 @@ function InputVariablesOverlayMenu({
4695
4722
  ...props
4696
4723
  }) {
4697
4724
  if (disabled) {
4698
- return /* @__PURE__ */ jsx39(Fragment9, { children });
4725
+ return /* @__PURE__ */ jsx39(Fragment10, { children });
4699
4726
  }
4700
4727
  return /* @__PURE__ */ jsxs23("div", { css: menuContainer, children: [
4701
4728
  children,
@@ -4718,6 +4745,7 @@ import { useMemo as useMemo11 } from "react";
4718
4745
 
4719
4746
  // src/components/Variables/styles/ParameterVariables.styles.ts
4720
4747
  import { css as css23 } from "@emotion/react";
4748
+ import { scrollbarStyles as scrollbarStyles3 } from "@uniformdev/design-system";
4721
4749
  var variableBindButton2 = css23`
4722
4750
  align-items: center;
4723
4751
  border: none;
@@ -4797,8 +4825,10 @@ var input2 = css23`
4797
4825
  }
4798
4826
  `;
4799
4827
  var inputMultiLine = (lines) => css23`
4800
- // 1.5 = line height, spacing-md = top and bottom padding
4801
- height: calc(${lines * 1.5}em + var(--spacing-md));
4828
+ ${scrollbarStyles3}
4829
+ // 1.5 = line height, spacing-sm = top and bottom padding + spacing-xs to give a slight increase in height
4830
+ // as the text looked to close to the bottom of the input
4831
+ height: calc(${lines * 1.5}em + var(--spacing-sm) + var(--spacing-xs));
4802
4832
  resize: vertical;
4803
4833
  overflow: auto;
4804
4834
  `;
@@ -5020,7 +5050,7 @@ function ParameterVariables(props) {
5020
5050
  "data-text-value": value,
5021
5051
  css: [
5022
5052
  input2,
5023
- typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(4) : css24``,
5053
+ typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(2) : css24``,
5024
5054
  inputCss != null ? inputCss : css24``
5025
5055
  ]
5026
5056
  }
@@ -5118,10 +5148,10 @@ var variableValue = css25`
5118
5148
  `;
5119
5149
 
5120
5150
  // src/components/Variables/VariablesList.tsx
5121
- import { Fragment as Fragment10, jsx as jsx43, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
5151
+ import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
5122
5152
  function VariablesList() {
5123
5153
  const { variables, dispatch } = useVariables();
5124
- const sorted = variablesToList(variables);
5154
+ const sorted = variablesToList(variables).filter((variable) => !variable.system);
5125
5155
  const onDragEnd = (res) => {
5126
5156
  var _a, _b;
5127
5157
  if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
@@ -5139,7 +5169,7 @@ function VariablesList() {
5139
5169
  return result;
5140
5170
  }
5141
5171
  };
5142
- return /* @__PURE__ */ jsxs27(Fragment10, { children: [
5172
+ return /* @__PURE__ */ jsxs27(Fragment11, { children: [
5143
5173
  /* @__PURE__ */ jsx43(DragDropContext2, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx43(Droppable2, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ jsxs27(Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
5144
5174
  /* @__PURE__ */ jsx43(TableHead, { children: /* @__PURE__ */ jsxs27(TableRow, { children: [
5145
5175
  /* @__PURE__ */ jsx43(TableCellHead, { children: "Name" }),
@@ -5767,7 +5797,7 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
5767
5797
  }
5768
5798
 
5769
5799
  // src/components/Request/RequestUrl.tsx
5770
- import { Fragment as Fragment11, jsx as jsx52, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
5800
+ import { Fragment as Fragment12, jsx as jsx52, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
5771
5801
  function RequestUrl() {
5772
5802
  var _a, _b;
5773
5803
  const { variables } = useVariables();
@@ -5791,7 +5821,7 @@ function RequestUrl() {
5791
5821
  request.baseRequest ? /* @__PURE__ */ jsx52("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
5792
5822
  /* @__PURE__ */ jsxs31("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
5793
5823
  urlEncodeRequestUrl(request.relativeUrl, variables),
5794
- mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(Fragment11, { children: [
5824
+ mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(Fragment12, { children: [
5795
5825
  "?",
5796
5826
  mergedParameters.map((param, index) => {
5797
5827
  const encoded = urlEncodeRequestParameter(param, variables);
@@ -6746,7 +6776,7 @@ var ObjectSearchResultListTitle = css36`
6746
6776
  `;
6747
6777
 
6748
6778
  // src/components/ObjectSearch/ObjectSearchResultList.tsx
6749
- import { Fragment as Fragment12, jsx as jsx65, jsxs as jsxs40 } from "@emotion/react/jsx-runtime";
6779
+ import { Fragment as Fragment13, jsx as jsx65, jsxs as jsxs40 } from "@emotion/react/jsx-runtime";
6750
6780
  function ObjectSearchResultList({
6751
6781
  resultLabelText = "Selected",
6752
6782
  removeButtonText = "Remove all",
@@ -6773,7 +6803,7 @@ function ObjectSearchResultList({
6773
6803
  return result;
6774
6804
  }
6775
6805
  };
6776
- return /* @__PURE__ */ jsxs40(Fragment12, { children: [
6806
+ return /* @__PURE__ */ jsxs40(Fragment13, { children: [
6777
6807
  /* @__PURE__ */ jsxs40("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6778
6808
  /* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6779
6809
  /* @__PURE__ */ jsx65("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
@@ -7091,7 +7121,7 @@ import {
7091
7121
  LoadingIndicator as LoadingIndicator5,
7092
7122
  LoadingOverlay as LoadingOverlay2,
7093
7123
  Menu as Menu4,
7094
- MenuItem as MenuItem4,
7124
+ MenuItem as MenuItem3,
7095
7125
  ParameterGroup,
7096
7126
  ParameterImage,
7097
7127
  ParameterImageInner,
@@ -7147,7 +7177,7 @@ export {
7147
7177
  LoadingIndicator5 as LoadingIndicator,
7148
7178
  LoadingOverlay2 as LoadingOverlay,
7149
7179
  Menu4 as Menu,
7150
- MenuItem4 as MenuItem,
7180
+ MenuItem3 as MenuItem,
7151
7181
  MeshApp,
7152
7182
  OPEN_INSERT_VARIABLE_COMMAND,
7153
7183
  ObjectSearchContainer,