@maily-to/core 0.3.3 → 0.3.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.
@@ -330,6 +330,7 @@ type Variable = {
330
330
  required?: boolean;
331
331
  valid?: boolean;
332
332
  hideDefaultValue?: boolean;
333
+ label?: string;
333
334
  };
334
335
  type VariableFunctionOptions = {
335
336
  query: string;
@@ -388,6 +389,7 @@ type VariableListProps = {
388
389
  id: string;
389
390
  required: boolean;
390
391
  hideDefaultValue: boolean;
392
+ label?: string;
391
393
  }) => void;
392
394
  items: Variable[];
393
395
  } & SuggestionOptions;
@@ -396,6 +398,7 @@ declare const VariableList: react.ForwardRefExoticComponent<{
396
398
  id: string;
397
399
  required: boolean;
398
400
  hideDefaultValue: boolean;
401
+ label?: string;
399
402
  }) => void;
400
403
  items: Variable[];
401
404
  } & SuggestionOptions<any, any> & react.RefAttributes<unknown>>;
@@ -330,6 +330,7 @@ type Variable = {
330
330
  required?: boolean;
331
331
  valid?: boolean;
332
332
  hideDefaultValue?: boolean;
333
+ label?: string;
333
334
  };
334
335
  type VariableFunctionOptions = {
335
336
  query: string;
@@ -388,6 +389,7 @@ type VariableListProps = {
388
389
  id: string;
389
390
  required: boolean;
390
391
  hideDefaultValue: boolean;
392
+ label?: string;
391
393
  }) => void;
392
394
  items: Variable[];
393
395
  } & SuggestionOptions;
@@ -396,6 +398,7 @@ declare const VariableList: react.ForwardRefExoticComponent<{
396
398
  id: string;
397
399
  required: boolean;
398
400
  hideDefaultValue: boolean;
401
+ label?: string;
399
402
  }) => void;
400
403
  items: Variable[];
401
404
  } & SuggestionOptions<any, any> & react.RefAttributes<unknown>>;
@@ -5470,7 +5470,7 @@ function ColorPicker(props) {
5470
5470
  BaseButton,
5471
5471
  {
5472
5472
  variant: "ghost",
5473
- className: "!mly:size-7 mly:shrink-0",
5473
+ className: "mly:h-7 mly:w-7 mly:shrink-0",
5474
5474
  size: "sm",
5475
5475
  type: "button",
5476
5476
  children: /* @__PURE__ */ jsx13(
@@ -6601,7 +6601,7 @@ var VariableSuggestionsPopover = forwardRef7((props, ref) => {
6601
6601
  ),
6602
6602
  children: [
6603
6603
  /* @__PURE__ */ jsx28(Braces, { className: "mly:size-3 mly:stroke-[2.5] mly:text-rose-600" }),
6604
- item.name
6604
+ (item == null ? void 0 : item.label) || item.name
6605
6605
  ]
6606
6606
  },
6607
6607
  index
@@ -6639,7 +6639,13 @@ import { useMemo as useMemo4 } from "react";
6639
6639
  import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
6640
6640
  function VariableView(props) {
6641
6641
  const { node, updateAttributes: updateAttributes2, editor } = props;
6642
- const { id, fallback, required, hideDefaultValue = false } = node.attrs;
6642
+ const {
6643
+ id,
6644
+ fallback,
6645
+ required,
6646
+ hideDefaultValue = false,
6647
+ label
6648
+ } = node.attrs;
6643
6649
  const renderVariable = useMemo4(() => {
6644
6650
  var _a, _b;
6645
6651
  const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
@@ -6658,7 +6664,12 @@ function VariableView(props) {
6658
6664
  },
6659
6665
  children: [
6660
6666
  /* @__PURE__ */ jsx29(PopoverTrigger, { children: renderVariable({
6661
- variable: { name: id, required, valid: true },
6667
+ variable: {
6668
+ name: id,
6669
+ required,
6670
+ valid: true,
6671
+ label
6672
+ },
6662
6673
  fallback,
6663
6674
  editor,
6664
6675
  from: "content-variable"
@@ -6720,11 +6731,12 @@ function VariableView(props) {
6720
6731
  }
6721
6732
  var DefaultRenderVariable = (props) => {
6722
6733
  const { variable, fallback, from } = props;
6723
- const { name, required, valid } = variable;
6734
+ const { name, required, valid, label } = variable;
6735
+ const variableLabel = label || name;
6724
6736
  if (from === "button-variable") {
6725
6737
  return /* @__PURE__ */ jsxs13("div", { className: "mly:inline-grid mly:max-w-xs mly:grid-cols-[12px_1fr] mly:items-center mly:gap-1.5 mly:rounded-md mly:border mly:border-(--button-var-border-color) mly:px-2 mly:py-px mly:font-mono mly:text-xs", children: [
6726
6738
  /* @__PURE__ */ jsx29(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
6727
- /* @__PURE__ */ jsx29("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: name })
6739
+ /* @__PURE__ */ jsx29("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
6728
6740
  ] });
6729
6741
  }
6730
6742
  if (from === "bubble-variable") {
@@ -6737,7 +6749,7 @@ var DefaultRenderVariable = (props) => {
6737
6749
  ),
6738
6750
  children: [
6739
6751
  /* @__PURE__ */ jsx29(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
6740
- /* @__PURE__ */ jsx29("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: name })
6752
+ /* @__PURE__ */ jsx29("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
6741
6753
  ]
6742
6754
  }
6743
6755
  );
@@ -6749,7 +6761,7 @@ var DefaultRenderVariable = (props) => {
6749
6761
  className: "mly:inline-flex mly:items-center mly:gap-(--variable-icon-gap) mly:rounded-full mly:border mly:border-gray-200 mly:px-1.5 mly:py-0.5 mly:leading-none",
6750
6762
  children: [
6751
6763
  /* @__PURE__ */ jsx29(Braces2, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
6752
- name,
6764
+ variableLabel,
6753
6765
  required && !fallback && /* @__PURE__ */ jsx29(AlertTriangle, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]" })
6754
6766
  ]
6755
6767
  }
@@ -8665,7 +8677,8 @@ var VariableList = forwardRef9((props, ref) => {
8665
8677
  props.command({
8666
8678
  id: value.name,
8667
8679
  required: (_a2 = value.required) != null ? _a2 : true,
8668
- hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false
8680
+ hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false,
8681
+ label: value == null ? void 0 : value.label
8669
8682
  });
8670
8683
  },
8671
8684
  ref: popoverRef