@maily-to/core 0.3.1 → 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.
@@ -329,6 +329,7 @@ type Variable = {
329
329
  name: string;
330
330
  required?: boolean;
331
331
  valid?: boolean;
332
+ hideDefaultValue?: boolean;
332
333
  };
333
334
  type VariableFunctionOptions = {
334
335
  query: string;
@@ -386,6 +387,7 @@ type VariableListProps = {
386
387
  command: (params: {
387
388
  id: string;
388
389
  required: boolean;
390
+ hideDefaultValue: boolean;
389
391
  }) => void;
390
392
  items: Variable[];
391
393
  } & SuggestionOptions;
@@ -393,6 +395,7 @@ declare const VariableList: react.ForwardRefExoticComponent<{
393
395
  command: (params: {
394
396
  id: string;
395
397
  required: boolean;
398
+ hideDefaultValue: boolean;
396
399
  }) => void;
397
400
  items: Variable[];
398
401
  } & SuggestionOptions<any, any> & react.RefAttributes<unknown>>;
@@ -329,6 +329,7 @@ type Variable = {
329
329
  name: string;
330
330
  required?: boolean;
331
331
  valid?: boolean;
332
+ hideDefaultValue?: boolean;
332
333
  };
333
334
  type VariableFunctionOptions = {
334
335
  query: string;
@@ -386,6 +387,7 @@ type VariableListProps = {
386
387
  command: (params: {
387
388
  id: string;
388
389
  required: boolean;
390
+ hideDefaultValue: boolean;
389
391
  }) => void;
390
392
  items: Variable[];
391
393
  } & SuggestionOptions;
@@ -393,6 +395,7 @@ declare const VariableList: react.ForwardRefExoticComponent<{
393
395
  command: (params: {
394
396
  id: string;
395
397
  required: boolean;
398
+ hideDefaultValue: boolean;
396
399
  }) => void;
397
400
  items: Variable[];
398
401
  } & SuggestionOptions<any, any> & react.RefAttributes<unknown>>;
@@ -6132,10 +6132,10 @@ function VariableIcon(props) {
6132
6132
  import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
6133
6133
  import { AlertTriangle, Braces as Braces2, Pencil } from "lucide-react";
6134
6134
  import { useMemo as useMemo4 } from "react";
6135
- import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
6135
+ import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
6136
6136
  function VariableView(props) {
6137
6137
  const { node, updateAttributes: updateAttributes2, editor } = props;
6138
- const { id, fallback, required } = node.attrs;
6138
+ const { id, fallback, required, hideDefaultValue = false } = node.attrs;
6139
6139
  const renderVariable = useMemo4(() => {
6140
6140
  var _a, _b;
6141
6141
  const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
@@ -6190,23 +6190,25 @@ function VariableView(props) {
6190
6190
  })
6191
6191
  )
6192
6192
  ] }),
6193
- /* @__PURE__ */ jsx29(Divider, { className: "mly-mx-1.5" }),
6194
- /* @__PURE__ */ jsxs13("label", { className: "mly-relative", children: [
6195
- /* @__PURE__ */ jsx29("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
6196
- /* @__PURE__ */ jsx29(
6197
- "input",
6198
- __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6199
- value: fallback != null ? fallback : "",
6200
- onChange: (e) => {
6201
- updateAttributes2({
6202
- fallback: e.target.value
6203
- });
6204
- },
6205
- placeholder: "ie. John Doe...",
6206
- 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"
6207
- })
6208
- ),
6209
- /* @__PURE__ */ jsx29("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx29(Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
6193
+ !hideDefaultValue && /* @__PURE__ */ jsxs13(Fragment3, { children: [
6194
+ /* @__PURE__ */ jsx29(Divider, { className: "mly-mx-1.5" }),
6195
+ /* @__PURE__ */ jsxs13("label", { className: "mly-relative", children: [
6196
+ /* @__PURE__ */ jsx29("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
6197
+ /* @__PURE__ */ jsx29(
6198
+ "input",
6199
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
6200
+ value: fallback != null ? fallback : "",
6201
+ onChange: (e) => {
6202
+ updateAttributes2({
6203
+ fallback: e.target.value
6204
+ });
6205
+ },
6206
+ placeholder: "ie. John Doe...",
6207
+ 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"
6208
+ })
6209
+ ),
6210
+ /* @__PURE__ */ jsx29("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx29(Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
6211
+ ] })
6210
6212
  ] })
6211
6213
  ] }) })
6212
6214
  }
@@ -6361,6 +6363,9 @@ var VariableExtension = Node8.create({
6361
6363
  "data-required": (_a = attributes == null ? void 0 : attributes.required) != null ? _a : true
6362
6364
  };
6363
6365
  }
6366
+ },
6367
+ hideDefaultValue: {
6368
+ default: false
6364
6369
  }
6365
6370
  };
6366
6371
  },
@@ -7663,7 +7668,7 @@ var SlashCommandExtension = Extension3.create({
7663
7668
  import { ReactRenderer } from "@tiptap/react";
7664
7669
  import {
7665
7670
  forwardRef as forwardRef8,
7666
- Fragment as Fragment4,
7671
+ Fragment as Fragment5,
7667
7672
  useCallback as useCallback6,
7668
7673
  useEffect as useEffect6,
7669
7674
  useImperativeHandle as useImperativeHandle2,
@@ -7676,7 +7681,7 @@ import tippy from "tippy.js";
7676
7681
  // src/editor/extensions/slash-command/slash-command-item.tsx
7677
7682
  import { ChevronRightIcon } from "lucide-react";
7678
7683
  import { useCallback as useCallback5, useState as useState7, useRef as useRef8, useEffect as useEffect5 } from "react";
7679
- import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
7684
+ import { Fragment as Fragment4, jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
7680
7685
  function SlashCommandItem(props) {
7681
7686
  var _a;
7682
7687
  const {
@@ -7699,7 +7704,7 @@ function SlashCommandItem(props) {
7699
7704
  const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && (isHovered || isActive && !hoveredItemKey);
7700
7705
  const hasRenderFunction = typeof item.render === "function";
7701
7706
  const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
7702
- let value = /* @__PURE__ */ jsxs19(Fragment3, { children: [
7707
+ let value = /* @__PURE__ */ jsxs19(Fragment4, { children: [
7703
7708
  /* @__PURE__ */ jsx35("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
7704
7709
  /* @__PURE__ */ jsxs19("div", { className: "mly-grow", children: [
7705
7710
  /* @__PURE__ */ jsx35("p", { className: "mly-font-medium", children: item.title }),
@@ -7758,7 +7763,7 @@ function SlashCommandItem(props) {
7758
7763
  side: "right",
7759
7764
  sideOffset: 10,
7760
7765
  className: "mly-w-52 mly-rounded-lg mly-border-none mly-p-1 mly-shadow",
7761
- children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs19(Fragment3, { children: [
7766
+ children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs19(Fragment4, { children: [
7762
7767
  /* @__PURE__ */ jsx35("figure", { className: "mly-relative mly-aspect-[2.5] mly-w-full mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200", children: /* @__PURE__ */ jsx35(
7763
7768
  "img",
7764
7769
  {
@@ -8001,7 +8006,7 @@ var CommandList = forwardRef8((props, ref) => {
8001
8006
  id: "slash-command",
8002
8007
  ref: commandListContainer,
8003
8008
  className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto",
8004
- children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs20(Fragment4, { children: [
8009
+ children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs20(Fragment5, { children: [
8005
8010
  /* @__PURE__ */ jsx36(
8006
8011
  "span",
8007
8012
  {
@@ -8157,10 +8162,11 @@ var VariableList = forwardRef9((props, ref) => {
8157
8162
  {
8158
8163
  items,
8159
8164
  onSelectItem: (value) => {
8160
- var _a2;
8165
+ var _a2, _b;
8161
8166
  props.command({
8162
8167
  id: value.name,
8163
- required: (_a2 = value.required) != null ? _a2 : true
8168
+ required: (_a2 = value.required) != null ? _a2 : true,
8169
+ hideDefaultValue: (_b = value == null ? void 0 : value.hideDefaultValue) != null ? _b : false
8164
8170
  });
8165
8171
  },
8166
8172
  ref: popoverRef