@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.
@@ -6178,7 +6178,7 @@ function VariableIcon(props) {
6178
6178
  "div",
6179
6179
  {
6180
6180
  className: cn(
6181
- "mly-flex mly-size-5 mly-items-center mly-justify-center mly-rounded-md mly-border",
6181
+ "mly-flex mly-size-5 mly-items-center mly-justify-center mly-rounded-md mly-border mly-border-gray-200",
6182
6182
  className
6183
6183
  ),
6184
6184
  children
@@ -6193,12 +6193,16 @@ var import_react19 = require("react");
6193
6193
  var import_jsx_runtime29 = require("react/jsx-runtime");
6194
6194
  function VariableView(props) {
6195
6195
  const { node, updateAttributes: updateAttributes2, editor } = props;
6196
- const { id, fallback, required } = node.attrs;
6196
+ const { id, fallback, required, hideDefaultValue = false } = node.attrs;
6197
6197
  const renderVariable = (0, import_react19.useMemo)(() => {
6198
6198
  var _a, _b;
6199
6199
  const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
6200
6200
  return variableRender;
6201
6201
  }, [editor]);
6202
+ const disableInput = (0, import_react19.useMemo)(() => {
6203
+ var _a, _b;
6204
+ return (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.disableInput) != null ? _b : false;
6205
+ }, [editor]);
6202
6206
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6203
6207
  import_react18.NodeViewWrapper,
6204
6208
  {
@@ -6232,6 +6236,7 @@ function VariableView(props) {
6232
6236
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6233
6237
  "input",
6234
6238
  __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6239
+ disabled: disableInput,
6235
6240
  value: id != null ? id : "",
6236
6241
  onChange: (e) => {
6237
6242
  updateAttributes2({
@@ -6239,27 +6244,29 @@ function VariableView(props) {
6239
6244
  });
6240
6245
  },
6241
6246
  placeholder: "ie. name...",
6242
- 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"
6247
+ 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"
6243
6248
  })
6244
6249
  )
6245
6250
  ] }),
6246
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Divider, { className: "mly-mx-1.5" }),
6247
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "mly-relative", children: [
6248
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
6249
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6250
- "input",
6251
- __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6252
- value: fallback != null ? fallback : "",
6253
- onChange: (e) => {
6254
- updateAttributes2({
6255
- fallback: e.target.value
6256
- });
6257
- },
6258
- placeholder: "ie. John Doe...",
6259
- 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"
6260
- })
6261
- ),
6262
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
6251
+ !hideDefaultValue && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
6252
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Divider, { className: "mly-mx-1.5" }),
6253
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "mly-relative", children: [
6254
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
6255
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6256
+ "input",
6257
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6258
+ value: fallback != null ? fallback : "",
6259
+ onChange: (e) => {
6260
+ updateAttributes2({
6261
+ fallback: e.target.value
6262
+ });
6263
+ },
6264
+ placeholder: "ie. John Doe...",
6265
+ 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"
6266
+ })
6267
+ ),
6268
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react14.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
6269
+ ] })
6263
6270
  ] })
6264
6271
  ] }) })
6265
6272
  }
@@ -6330,6 +6337,7 @@ var VariableExtension = import_core11.Node.create({
6330
6337
  variables: DEFAULT_VARIABLES,
6331
6338
  variableSuggestionsPopover: DEFAULT_VARIABLE_SUGGESTION_POPOVER,
6332
6339
  renderVariable: DEFAULT_RENDER_VARIABLE_FUNCTION,
6340
+ disableInput: false,
6333
6341
  renderLabel(props) {
6334
6342
  var _a;
6335
6343
  const { node } = props;
@@ -6413,6 +6421,9 @@ var VariableExtension = import_core11.Node.create({
6413
6421
  "data-required": (_a = attributes == null ? void 0 : attributes.required) != null ? _a : true
6414
6422
  };
6415
6423
  }
6424
+ },
6425
+ hideDefaultValue: {
6426
+ default: false
6416
6427
  }
6417
6428
  };
6418
6429
  },
@@ -8200,10 +8211,11 @@ var VariableList = (0, import_react35.forwardRef)((props, ref) => {
8200
8211
  {
8201
8212
  items,
8202
8213
  onSelectItem: (value) => {
8203
- var _a2;
8214
+ var _a2, _b;
8204
8215
  props.command({
8205
8216
  id: value.name,
8206
- required: (_a2 = value.required) != null ? _a2 : true
8217
+ required: (_a2 = value.required) != null ? _a2 : true,
8218
+ hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false
8207
8219
  });
8208
8220
  },
8209
8221
  ref: popoverRef