@daisychainapp/maily-to-core 0.4.0 → 0.4.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.
@@ -4388,7 +4388,14 @@ function BubbleMenuButton(item) {
4388
4388
  if (tooltip) {
4389
4389
  return /* @__PURE__ */ jsxs2(Tooltip, { children: [
4390
4390
  /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: content }),
4391
- /* @__PURE__ */ jsx7(TooltipContent, { sideOffset: 8, children: tooltip })
4391
+ /* @__PURE__ */ jsx7(
4392
+ TooltipContent,
4393
+ {
4394
+ sideOffset: 8,
4395
+ className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
4396
+ children: /* @__PURE__ */ jsx7("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
4397
+ }
4398
+ )
4392
4399
  ] });
4393
4400
  }
4394
4401
  return content;
@@ -5132,7 +5139,14 @@ function AlignmentSwitch(props) {
5132
5139
  children: /* @__PURE__ */ jsx10(activeAlignment.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
5133
5140
  }
5134
5141
  ) }),
5135
- /* @__PURE__ */ jsx10(TooltipContent, { sideOffset: 8, children: "Alignment" })
5142
+ /* @__PURE__ */ jsx10(
5143
+ TooltipContent,
5144
+ {
5145
+ sideOffset: 8,
5146
+ className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
5147
+ children: /* @__PURE__ */ jsx10("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Alignment" })
5148
+ }
5149
+ )
5136
5150
  ] }),
5137
5151
  /* @__PURE__ */ jsx10(
5138
5152
  PopoverContent,
@@ -5216,7 +5230,14 @@ function ColorPicker(props) {
5216
5230
  children: [
5217
5231
  tooltip ? /* @__PURE__ */ jsxs6(Tooltip, { children: [
5218
5232
  /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: popoverButton }),
5219
- /* @__PURE__ */ jsx11(TooltipContent, { sideOffset: 8, children: tooltip })
5233
+ /* @__PURE__ */ jsx11(
5234
+ TooltipContent,
5235
+ {
5236
+ sideOffset: 8,
5237
+ className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
5238
+ children: /* @__PURE__ */ jsx11("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
5239
+ }
5240
+ )
5220
5241
  ] }) : popoverButton,
5221
5242
  /* @__PURE__ */ jsx11(
5222
5243
  PopoverContent,
@@ -6870,7 +6891,14 @@ function LinkInputPopover(props) {
6870
6891
  children: [
6871
6892
  tooltip ? /* @__PURE__ */ jsxs13(Tooltip, { children: [
6872
6893
  /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: popoverButton }),
6873
- /* @__PURE__ */ jsx29(TooltipContent, { sideOffset: 8, children: tooltip })
6894
+ /* @__PURE__ */ jsx29(
6895
+ TooltipContent,
6896
+ {
6897
+ sideOffset: 8,
6898
+ className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
6899
+ children: /* @__PURE__ */ jsx29("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
6900
+ }
6901
+ )
6874
6902
  ] }) : popoverButton,
6875
6903
  /* @__PURE__ */ jsx29(
6876
6904
  PopoverContent,
@@ -7003,7 +7031,14 @@ function Select(props) {
7003
7031
  }
7004
7032
  return /* @__PURE__ */ jsxs14(Tooltip, { children: [
7005
7033
  /* @__PURE__ */ jsx30(TooltipTrigger, { asChild: true, children: content }),
7006
- /* @__PURE__ */ jsx30(TooltipContent, { sideOffset: 8, children: tooltip })
7034
+ /* @__PURE__ */ jsx30(
7035
+ TooltipContent,
7036
+ {
7037
+ sideOffset: 8,
7038
+ className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
7039
+ children: /* @__PURE__ */ jsx30("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
7040
+ }
7041
+ )
7007
7042
  ] });
7008
7043
  }
7009
7044
 
@@ -8617,83 +8652,24 @@ import { createLowlight, common } from "lowlight";
8617
8652
 
8618
8653
  // src/editor/nodes/html/html-view.tsx
8619
8654
  import { NodeViewContent as NodeViewContent2, NodeViewWrapper as NodeViewWrapper7 } from "@tiptap/react";
8620
- import { useMemo as useMemo7 } from "react";
8621
- import { jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
8655
+ import { jsx as jsx37 } from "react/jsx-runtime";
8622
8656
  function HTMLCodeBlockView(props) {
8623
- const { node, updateAttributes: updateAttributes2 } = props;
8624
- let { language, activeTab = "code" } = node.attrs;
8625
- activeTab || (activeTab = "code");
8657
+ const { node } = props;
8658
+ const { language } = node.attrs;
8626
8659
  const languageClass = language ? `language-${language}` : "";
8627
- const html2 = useMemo7(() => {
8628
- const text2 = node.content.content.reduce((acc, cur) => {
8629
- if (cur.type.name === "text") {
8630
- return acc + cur.text;
8631
- } else if (cur.type.name === "variable") {
8632
- const { id: variable, fallback } = (cur == null ? void 0 : cur.attrs) || {};
8633
- const formattedVariable = fallback ? `{{${variable},fallback=${fallback}}}` : `{{${variable}}}`;
8634
- return acc + formattedVariable;
8635
- }
8636
- return acc;
8637
- }, "");
8638
- const htmlParser = new DOMParser();
8639
- const htmlDoc = htmlParser.parseFromString(text2, "text/html");
8640
- const style = htmlDoc.querySelectorAll("style");
8641
- const body = htmlDoc.body;
8642
- const combinedStyle = Array.from(style).map((s) => s.innerHTML).join("\n");
8643
- return `<style>${combinedStyle}</style>${body.innerHTML}`;
8644
- }, [activeTab]);
8645
- const isEmpty = html2 === "";
8646
- return /* @__PURE__ */ jsxs20(
8660
+ return /* @__PURE__ */ jsx37(
8647
8661
  NodeViewWrapper7,
8648
8662
  {
8649
8663
  draggable: false,
8650
8664
  "data-drag-handle": false,
8651
8665
  "data-type": "htmlCodeBlock",
8652
- children: [
8653
- activeTab === "code" && /* @__PURE__ */ jsx37("pre", { className: "mly:my-0 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-2 mly:text-black", children: /* @__PURE__ */ jsx37(
8654
- NodeViewContent2,
8655
- {
8656
- as: "code",
8657
- className: cn("is-editable", languageClass)
8658
- }
8659
- ) }),
8660
- activeTab === "preview" && /* @__PURE__ */ jsx37(
8661
- "div",
8662
- {
8663
- className: cn(
8664
- "mly:not-prose mly:rounded-lg mly:border mly:border-gray-200 mly:p-2",
8665
- isEmpty && "mly:min-h-[42px]"
8666
- ),
8667
- ref: (node2) => {
8668
- if (!node2 || (node2 == null ? void 0 : node2.shadowRoot)) {
8669
- return;
8670
- }
8671
- const shadow = node2.attachShadow({ mode: "open" });
8672
- const sheet = new CSSStyleSheet();
8673
- sheet.replaceSync(`
8674
- * { font-family: 'Inter', sans-serif; }
8675
- blockquote, h1, h2, h3, img, li, ol, p, ul {
8676
- margin-top: 0;
8677
- margin-bottom: 0;
8678
- }
8679
- `);
8680
- shadow.adoptedStyleSheets = [sheet];
8681
- const container = document.createElement("div");
8682
- container.innerHTML = html2;
8683
- shadow.appendChild(container);
8684
- },
8685
- contentEditable: false,
8686
- onClick: () => {
8687
- if (!isEmpty) {
8688
- return;
8689
- }
8690
- updateAttributes2({
8691
- activeTab: "code"
8692
- });
8693
- }
8694
- }
8695
- )
8696
- ]
8666
+ children: /* @__PURE__ */ jsx37("pre", { className: "mly-html-code-pre", children: /* @__PURE__ */ jsx37(
8667
+ NodeViewContent2,
8668
+ {
8669
+ as: "code",
8670
+ className: cn("is-editable", languageClass)
8671
+ }
8672
+ ) })
8697
8673
  }
8698
8674
  );
8699
8675
  }