@maily-to/core 0.1.0 → 0.1.1

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.
@@ -2332,6 +2332,7 @@ var DEFAULT_SLASH_COMMANDS = [
2332
2332
  description: "Add pre-designed headers block",
2333
2333
  searchTerms: ["header", "headers"],
2334
2334
  icon: /* @__PURE__ */ jsx22(Heading12, { className: "mly-h-4 mly-w-4" }),
2335
+ preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
2335
2336
  commands: [
2336
2337
  headerLogoWithTextVertical,
2337
2338
  headerLogoWithTextHorizontal,
@@ -4660,7 +4661,7 @@ var CommandList = forwardRef8(function CommandList2(props, ref) {
4660
4661
  commandListContainer,
4661
4662
  activeCommandRef
4662
4663
  ]);
4663
- return groups.length > 0 ? /* @__PURE__ */ jsxs19("div", { className: "mly-z-50 mly-w-72 mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
4664
+ return groups.length > 0 ? /* @__PURE__ */ jsx35(TooltipProvider, { children: /* @__PURE__ */ jsxs19("div", { className: "mly-z-50 mly-w-72 mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
4664
4665
  /* @__PURE__ */ jsx35(
4665
4666
  "div",
4666
4667
  {
@@ -4678,7 +4679,7 @@ var CommandList = forwardRef8(function CommandList2(props, ref) {
4678
4679
  children: group.title
4679
4680
  }
4680
4681
  ),
4681
- /* @__PURE__ */ jsx35("div", { className: "mly-p-1", children: group.commands.map((item, commandIndex) => {
4682
+ /* @__PURE__ */ jsx35("div", { className: "mly-space-y-0.5 mly-p-1", children: group.commands.map((item, commandIndex) => {
4682
4683
  var _a;
4683
4684
  const isActive = groupIndex === selectedGroupIndex && commandIndex === selectedCommandIndex;
4684
4685
  const isSubCommand = "commands" in item;
@@ -4695,20 +4696,41 @@ var CommandList = forwardRef8(function CommandList2(props, ref) {
4695
4696
  if (renderFunctionValue !== null && renderFunctionValue !== true) {
4696
4697
  value = renderFunctionValue;
4697
4698
  }
4698
- return /* @__PURE__ */ jsx35(
4699
- "button",
4700
- {
4701
- className: cn(
4702
- "mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",
4703
- isActive ? "mly-bg-gray-100 mly-text-gray-900" : "mly-bg-transparent"
4704
- ),
4705
- onClick: () => selectItem(groupIndex, commandIndex),
4706
- type: "button",
4707
- ref: isActive ? activeCommandRef : null,
4708
- children: value
4709
- },
4710
- commandIndex
4711
- );
4699
+ const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && isActive;
4700
+ return /* @__PURE__ */ jsxs19(Tooltip, { open: shouldOpenTooltip, children: [
4701
+ /* @__PURE__ */ jsx35(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx35(
4702
+ "button",
4703
+ {
4704
+ className: cn(
4705
+ "mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",
4706
+ isActive ? "mly-bg-gray-100 mly-text-gray-900" : "mly-bg-transparent"
4707
+ ),
4708
+ onClick: () => selectItem(groupIndex, commandIndex),
4709
+ type: "button",
4710
+ ref: isActive ? activeCommandRef : null,
4711
+ children: value
4712
+ }
4713
+ ) }),
4714
+ /* @__PURE__ */ jsx35(
4715
+ TooltipContent,
4716
+ {
4717
+ side: "right",
4718
+ sideOffset: 10,
4719
+ className: "mly-w-52 mly-rounded-lg mly-border-none mly-p-1 mly-shadow",
4720
+ children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
4721
+ /* @__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(
4722
+ "img",
4723
+ {
4724
+ src: item == null ? void 0 : item.preview,
4725
+ alt: item == null ? void 0 : item.title,
4726
+ className: "mly-absolute mly-inset-0 mly-h-full mly-w-full mly-object-cover"
4727
+ }
4728
+ ) }),
4729
+ /* @__PURE__ */ jsx35("p", { className: "mly-mt-2 mly-px-0.5 mly-text-gray-500", children: item.description })
4730
+ ] })
4731
+ }
4732
+ )
4733
+ ] }, commandIndex);
4712
4734
  }) })
4713
4735
  ] }, groupIndex))
4714
4736
  }
@@ -4727,7 +4749,7 @@ var CommandList = forwardRef8(function CommandList2(props, ref) {
4727
4749
  "to select"
4728
4750
  ] })
4729
4751
  ] }) })
4730
- ] }) : null;
4752
+ ] }) }) : null;
4731
4753
  });
4732
4754
  function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
4733
4755
  return {