@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.
package/dist/index.cjs CHANGED
@@ -7336,7 +7336,7 @@ var VariableSuggestionsPopover = (0, import_react25.forwardRef)((props, ref) =>
7336
7336
  ),
7337
7337
  children: [
7338
7338
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react20.Braces, { className: "mly:size-3 mly:stroke-[2.5] mly:text-rose-600" }),
7339
- item.name
7339
+ (item == null ? void 0 : item.label) || item.name
7340
7340
  ]
7341
7341
  },
7342
7342
  index
@@ -7374,7 +7374,13 @@ var import_react27 = require("react");
7374
7374
  var import_jsx_runtime34 = require("react/jsx-runtime");
7375
7375
  function VariableView(props) {
7376
7376
  const { node, updateAttributes: updateAttributes2, editor } = props;
7377
- const { id, fallback, required, hideDefaultValue = false } = node.attrs;
7377
+ const {
7378
+ id,
7379
+ fallback,
7380
+ required,
7381
+ hideDefaultValue = false,
7382
+ label
7383
+ } = node.attrs;
7378
7384
  const renderVariable = (0, import_react27.useMemo)(() => {
7379
7385
  var _a, _b;
7380
7386
  const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
@@ -7393,7 +7399,12 @@ function VariableView(props) {
7393
7399
  },
7394
7400
  children: [
7395
7401
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverTrigger, { children: renderVariable({
7396
- variable: { name: id, required, valid: true },
7402
+ variable: {
7403
+ name: id,
7404
+ required,
7405
+ valid: true,
7406
+ label
7407
+ },
7397
7408
  fallback,
7398
7409
  editor,
7399
7410
  from: "content-variable"
@@ -7455,11 +7466,12 @@ function VariableView(props) {
7455
7466
  }
7456
7467
  var DefaultRenderVariable = (props) => {
7457
7468
  const { variable, fallback, from } = props;
7458
- const { name, required, valid } = variable;
7469
+ const { name, required, valid, label } = variable;
7470
+ const variableLabel = label || name;
7459
7471
  if (from === "button-variable") {
7460
7472
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("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: [
7461
7473
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.Braces, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
7462
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: name })
7474
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
7463
7475
  ] });
7464
7476
  }
7465
7477
  if (from === "bubble-variable") {
@@ -7472,7 +7484,7 @@ var DefaultRenderVariable = (props) => {
7472
7484
  ),
7473
7485
  children: [
7474
7486
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.Braces, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
7475
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: name })
7487
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
7476
7488
  ]
7477
7489
  }
7478
7490
  );
@@ -7484,7 +7496,7 @@ var DefaultRenderVariable = (props) => {
7484
7496
  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",
7485
7497
  children: [
7486
7498
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.Braces, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
7487
- name,
7499
+ variableLabel,
7488
7500
  required && !fallback && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.AlertTriangle, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]" })
7489
7501
  ]
7490
7502
  }
@@ -8562,7 +8574,7 @@ function ColorPicker(props) {
8562
8574
  BaseButton,
8563
8575
  {
8564
8576
  variant: "ghost",
8565
- className: "!mly:size-7 mly:shrink-0",
8577
+ className: "mly:h-7 mly:w-7 mly:shrink-0",
8566
8578
  size: "sm",
8567
8579
  type: "button",
8568
8580
  children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
@@ -8859,7 +8871,7 @@ function SectionBubbleMenu(props) {
8859
8871
  BaseButton,
8860
8872
  {
8861
8873
  variant: "ghost",
8862
- className: "!mly:size-7 mly:shrink-0",
8874
+ className: "mly:h-7 mly:w-7 mly:shrink-0",
8863
8875
  size: "sm",
8864
8876
  type: "button",
8865
8877
  children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
@@ -11232,7 +11244,8 @@ var VariableList = (0, import_react59.forwardRef)((props, ref) => {
11232
11244
  props.command({
11233
11245
  id: value.name,
11234
11246
  required: (_a2 = value.required) != null ? _a2 : true,
11235
- hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false
11247
+ hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false,
11248
+ label: value == null ? void 0 : value.label
11236
11249
  });
11237
11250
  },
11238
11251
  ref: popoverRef