@maily-to/core 0.3.0 → 0.3.2

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
@@ -6855,7 +6855,7 @@ function VariableIcon(props) {
6855
6855
  "div",
6856
6856
  {
6857
6857
  className: cn(
6858
- "mly-flex mly-size-5 mly-items-center mly-justify-center mly-rounded-md mly-border",
6858
+ "mly-flex mly-size-5 mly-items-center mly-justify-center mly-rounded-md mly-border mly-border-gray-200",
6859
6859
  className
6860
6860
  ),
6861
6861
  children
@@ -6870,12 +6870,16 @@ var import_react27 = require("react");
6870
6870
  var import_jsx_runtime34 = require("react/jsx-runtime");
6871
6871
  function VariableView(props) {
6872
6872
  const { node, updateAttributes: updateAttributes2, editor } = props;
6873
- const { id, fallback, required } = node.attrs;
6873
+ const { id, fallback, required, hideDefaultValue = false } = node.attrs;
6874
6874
  const renderVariable = (0, import_react27.useMemo)(() => {
6875
6875
  var _a, _b;
6876
6876
  const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
6877
6877
  return variableRender;
6878
6878
  }, [editor]);
6879
+ const disableInput = (0, import_react27.useMemo)(() => {
6880
+ var _a, _b;
6881
+ return (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.disableInput) != null ? _b : false;
6882
+ }, [editor]);
6879
6883
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6880
6884
  import_react26.NodeViewWrapper,
6881
6885
  {
@@ -6909,6 +6913,7 @@ function VariableView(props) {
6909
6913
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6910
6914
  "input",
6911
6915
  __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6916
+ disabled: disableInput,
6912
6917
  value: id != null ? id : "",
6913
6918
  onChange: (e) => {
6914
6919
  updateAttributes2({
@@ -6916,27 +6921,29 @@ function VariableView(props) {
6916
6921
  });
6917
6922
  },
6918
6923
  placeholder: "ie. name...",
6919
- className: "mly-h-7 mly-w-36 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
6924
+ className: "mly-h-7 mly-w-36 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none disabled:mly-cursor-not-allowed"
6920
6925
  })
6921
6926
  )
6922
6927
  ] }),
6923
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Divider, { className: "mly-mx-1.5" }),
6924
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "mly-relative", children: [
6925
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
6926
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6927
- "input",
6928
- __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6929
- value: fallback != null ? fallback : "",
6930
- onChange: (e) => {
6931
- updateAttributes2({
6932
- fallback: e.target.value
6933
- });
6934
- },
6935
- placeholder: "ie. John Doe...",
6936
- className: "mly-h-7 mly-w-32 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
6937
- })
6938
- ),
6939
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
6928
+ !hideDefaultValue && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
6929
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Divider, { className: "mly-mx-1.5" }),
6930
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "mly-relative", children: [
6931
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
6932
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6933
+ "input",
6934
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6935
+ value: fallback != null ? fallback : "",
6936
+ onChange: (e) => {
6937
+ updateAttributes2({
6938
+ fallback: e.target.value
6939
+ });
6940
+ },
6941
+ placeholder: "ie. John Doe...",
6942
+ className: "mly-h-7 mly-w-32 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
6943
+ })
6944
+ ),
6945
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
6946
+ ] })
6940
6947
  ] })
6941
6948
  ] }) })
6942
6949
  }
@@ -7007,6 +7014,7 @@ var VariableExtension = import_core7.Node.create({
7007
7014
  variables: DEFAULT_VARIABLES,
7008
7015
  variableSuggestionsPopover: DEFAULT_VARIABLE_SUGGESTION_POPOVER,
7009
7016
  renderVariable: DEFAULT_RENDER_VARIABLE_FUNCTION,
7017
+ disableInput: false,
7010
7018
  renderLabel(props) {
7011
7019
  var _a;
7012
7020
  const { node } = props;
@@ -7090,6 +7098,9 @@ var VariableExtension = import_core7.Node.create({
7090
7098
  "data-required": (_a = attributes == null ? void 0 : attributes.required) != null ? _a : true
7091
7099
  };
7092
7100
  }
7101
+ },
7102
+ hideDefaultValue: {
7103
+ default: false
7093
7104
  }
7094
7105
  };
7095
7106
  },
@@ -10718,10 +10729,11 @@ var VariableList = (0, import_react59.forwardRef)((props, ref) => {
10718
10729
  {
10719
10730
  items,
10720
10731
  onSelectItem: (value) => {
10721
- var _a2;
10732
+ var _a2, _b;
10722
10733
  props.command({
10723
10734
  id: value.name,
10724
- required: (_a2 = value.required) != null ? _a2 : true
10735
+ required: (_a2 = value.required) != null ? _a2 : true,
10736
+ hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false
10725
10737
  });
10726
10738
  },
10727
10739
  ref: popoverRef