@maily-to/core 0.0.16 → 0.0.18

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.js CHANGED
@@ -87,21 +87,21 @@ function styleInject(css, { insertAt } = {}) {
87
87
  }
88
88
 
89
89
  // src/styles/index.css
90
- styleInject(':root {\n --placeholder-color: #adb5bd;\n --bg-color: #ffffff;\n --variable-icon-size: 12px;\n --variable-icon-gap: 4px;\n}\n.mly-editor .mly-prose p:where([class~=text-sm]) {\n font-size: 16px;\n}\n.mly-editor .mly-prose h1,\n.mly-editor .mly-prose h2,\n.mly-editor .mly-prose h3 {\n margin-top: 0;\n margin-bottom: 12px;\n}\n.mly-editor .mly-prose h1 {\n font-size: 36px;\n}\n.mly-editor .mly-prose h2 {\n font-size: 30px;\n}\n.mly-editor .mly-prose h3 {\n font-size: 24px;\n}\n.mly-editor .mly-prose p {\n font-size: 15px;\n margin-bottom: 20px;\n}\n.mly-editor .mly-prose h1 + p,\n.mly-editor .mly-prose h2 + p,\n.mly-editor .mly-prose h3 + p,\n.mly-editor .mly-prose hr + p,\n.mly-editor .mly-prose table + p {\n margin-top: 0;\n}\n.mly-editor .mly-prose ol,\n.mly-editor .mly-prose ul {\n margin-top: 0;\n margin-bottom: 20px;\n}\n.mly-editor .mly-prose li:not(:last-child) {\n margin-bottom: 8px;\n}\n.mly-editor .mly-prose li > p {\n margin: 0;\n}\n.mly-editor .mly-prose img,\n.mly-editor .mly-prose .node-logo {\n margin-top: 0;\n margin-bottom: 32px;\n}\n.mly-editor .mly-prose hr {\n margin-block: 32px;\n}\n.mly-editor .mly-prose .footer {\n display: block;\n font-size: 13px;\n margin-bottom: 20px;\n color: rgb(100, 116, 139);\n}\n.mly-editor .mly-prose .spacer + * {\n margin-top: 0;\n}\n.mly-editor .mly-prose p + .spacer {\n margin-top: -20px;\n}\n.mly-editor .mly-prose blockquote + .spacer {\n margin-top: -16px;\n}\n.mly-editor .mly-prose h1 + .spacer,\n.mly-editor .mly-prose h2 + .spacer,\n.mly-editor .mly-prose h3 + .spacer {\n margin-top: -12px;\n}\n.mly-editor .mly-prose ol + .spacer,\n.mly-editor .mly-prose ul + .spacer {\n margin-top: -20px;\n}\n.mly-editor .mly-prose img + .spacer,\n.mly-editor .mly-prose .node-logo + .spacer {\n margin-top: -32px;\n}\n.mly-editor .mly-prose .node-button + .spacer,\n.mly-editor .mly-prose .node-linkCard + .spacer,\n.mly-editor .mly-prose footer + .spacer {\n margin-top: -20px;\n}\n.mly-editor .mly-prose .node-button,\n.mly-editor .mly-prose .node-linkCard {\n margin-top: 0;\n margin-bottom: 20px;\n}\n.mly-editor .mly-prose .node-image {\n line-height: 0;\n margin-top: 0;\n margin-bottom: 32px;\n outline: none;\n}\n.mly-editor .mly-prose .node-image + .spacer {\n margin-top: -32px;\n}\n.mly-editor .mly-prose code::before,\n.mly-editor .mly-prose code::after {\n content: none;\n}\n.mly-no-scrollbar::-webkit-scrollbar {\n display: none;\n}\n.mly-no-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n.mly-editor .react-colorful__alpha {\n border-radius: 0;\n}\n.mly-editor .react-colorful__saturation,\n.mly-editor .react-colorful__hue,\n.mly-editor .react-colorful__alpha {\n border-radius: 8px;\n}\n.mly-editor .react-colorful__hue,\n.mly-editor .react-colorful__alpha {\n height: 16px;\n}\n.mly-editor .react-colorful__pointer {\n width: 16px;\n height: 16px;\n}\n.ProseMirror-selectednode {\n outline: 3px solid #555;\n}\n.mly-prose {\n strong {\n color: currentColor;\n }\n}\n.mly-editor {\n select:not([size]) {\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtY2hldnJvbi1kb3duIj48cGF0aCBkPSJtNiA5IDYgNiA2LTYiLz48L3N2Zz4=);\n background-position: right 8px center;\n background-repeat: no-repeat;\n background-size: 0.75em 0.75em;\n padding-right: 24px;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n}\n.ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0;\n &:focus {\n outline: none;\n }\n p {\n margin-top: 0;\n }\n h1 {\n --variable-icon-size: 28px;\n }\n h2 {\n --variable-icon-size: 24px;\n }\n h3 {\n --variable-icon-size: 20px;\n }\n h1,\n h2,\n h3 {\n --variable-icon-gap: 8px;\n }\n .is-editor-empty:first-child:not([data-type=columns], [data-type=section], ul, li, ol)::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--placeholder-color);\n pointer-events: none;\n height: 0;\n }\n .is-empty:not([data-type=columns], [data-type=section], ol, ul, li)::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--placeholder-color);\n pointer-events: none;\n height: 0;\n }\n [data-type=columns] .is-empty::before,\n [data-type=section] .is-empty::before {\n --l-threshold: 0.66;\n --diff: calc(var(--l-threshold) - l);\n color: oklch(from var(--bg-color) clamp(0.05, max(min(var(--diff) * infinity, 1), 0), 0.95) c h) !important;\n opacity: 0.6;\n }\n [data-type=columns] {\n display: flex;\n margin: 0;\n padding: 0;\n &.has-focus [data-type=column],\n &:hover [data-type=column] {\n outline: 1.5px solid #e9ecef;\n outline-style: dashed;\n }\n [data-type=column].has-focus {\n outline-style: solid;\n }\n }\n [data-type=column] {\n display: table-cell;\n flex-basis: 0;\n flex-grow: 1;\n overflow: auto;\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n [data-type=section] {\n margin: 0;\n padding: 0;\n [data-type=section-cell] {\n padding: 0;\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n }\n [data-type=for] {\n [data-node-view-content] > div {\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n }\n .node-for.has-focus [data-repeat-indicator] {\n opacity: 1;\n }\n [data-type=show] {\n [data-node-view-content] > div {\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n }\n *:has(+ .ProseMirror-gapcursor) {\n margin-bottom: 0 !important;\n }\n .ProseMirror-gapcursor {\n &::after {\n border: 1.5px solid gray;\n width: 24px;\n }\n & + * {\n margin-top: 0 !important;\n }\n }\n}\n.hide-number-controls {\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &[type=number] {\n -moz-appearance: textfield;\n }\n}\n.hide-scrollbars {\n scrollbar-width: none;\n -ms-overflow-style: none;\n &::-webkit-scrollbar {\n display: none;\n }\n}\n');
90
+ styleInject(':root {\n --placeholder-color: #adb5bd;\n --bg-color: #ffffff;\n --variable-icon-size: 12px;\n --variable-icon-gap: 4px;\n}\n.mly-editor .mly-prose p:where([class~=text-sm]) {\n font-size: 16px;\n}\n.mly-editor .mly-prose h1,\n.mly-editor .mly-prose h2,\n.mly-editor .mly-prose h3 {\n margin-top: 0;\n margin-bottom: 12px;\n}\n.mly-editor .mly-prose h1 {\n font-size: 36px;\n}\n.mly-editor .mly-prose h2 {\n font-size: 30px;\n}\n.mly-editor .mly-prose h3 {\n font-size: 24px;\n}\n.mly-editor .mly-prose p {\n font-size: 15px;\n margin-bottom: 20px;\n}\n.mly-editor .mly-prose h1 + p,\n.mly-editor .mly-prose h2 + p,\n.mly-editor .mly-prose h3 + p,\n.mly-editor .mly-prose hr + p,\n.mly-editor .mly-prose table + p {\n margin-top: 0;\n}\n.mly-editor .mly-prose ol,\n.mly-editor .mly-prose ul {\n margin-top: 0;\n margin-bottom: 20px;\n}\n.mly-editor .mly-prose li:not(:last-child) {\n margin-bottom: 8px;\n}\n.mly-editor .mly-prose li > p {\n margin: 0;\n}\n.mly-editor .mly-prose img,\n.mly-editor .mly-prose .node-logo {\n margin-top: 0;\n margin-bottom: 32px;\n}\n.mly-editor .mly-prose hr {\n margin-block: 32px;\n}\n.mly-editor .mly-prose .footer {\n display: block;\n font-size: 13px;\n margin-bottom: 20px;\n color: rgb(100, 116, 139);\n}\n.mly-editor .mly-prose .spacer + * {\n margin-top: 0;\n}\n.mly-editor .mly-prose p + .spacer {\n margin-top: -20px;\n}\n.mly-editor .mly-prose blockquote + .spacer {\n margin-top: -16px;\n}\n.mly-editor .mly-prose h1 + .spacer,\n.mly-editor .mly-prose h2 + .spacer,\n.mly-editor .mly-prose h3 + .spacer {\n margin-top: -12px;\n}\n.mly-editor .mly-prose ol + .spacer,\n.mly-editor .mly-prose ul + .spacer {\n margin-top: -20px;\n}\n.mly-editor .mly-prose img + .spacer,\n.mly-editor .mly-prose .node-logo + .spacer {\n margin-top: -32px;\n}\n.mly-editor .mly-prose .node-button + .spacer,\n.mly-editor .mly-prose .node-linkCard + .spacer,\n.mly-editor .mly-prose footer + .spacer {\n margin-top: -20px;\n}\n.mly-editor .mly-prose .node-button,\n.mly-editor .mly-prose .node-linkCard {\n margin-top: 0;\n margin-bottom: 20px;\n}\n.mly-editor .mly-prose .node-image {\n line-height: 0;\n margin-top: 0;\n margin-bottom: 32px;\n outline: none;\n}\n.mly-editor .mly-prose .node-image + .spacer {\n margin-top: -32px;\n}\n.mly-editor .mly-prose code::before,\n.mly-editor .mly-prose code::after {\n content: none;\n}\n.mly-no-scrollbar::-webkit-scrollbar {\n display: none;\n}\n.mly-no-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n.mly-editor .react-colorful__alpha {\n border-radius: 0;\n}\n.mly-editor .react-colorful__saturation,\n.mly-editor .react-colorful__hue,\n.mly-editor .react-colorful__alpha {\n border-radius: 8px;\n}\n.mly-editor .react-colorful__hue,\n.mly-editor .react-colorful__alpha {\n height: 16px;\n}\n.mly-editor .react-colorful__pointer {\n width: 16px;\n height: 16px;\n}\n.ProseMirror-selectednode::after {\n content: "";\n position: absolute;\n inset: -2px;\n pointer-events: none;\n border-radius: 6px;\n background: rgba(35, 131, 226, 0.14);\n}\n.mly-prose {\n strong {\n color: currentColor;\n }\n}\n.ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0;\n &:focus {\n outline: none;\n }\n p {\n margin-top: 0;\n }\n h1 {\n --variable-icon-size: 28px;\n }\n h2 {\n --variable-icon-size: 24px;\n }\n h3 {\n --variable-icon-size: 20px;\n }\n h1,\n h2,\n h3 {\n --variable-icon-gap: 8px;\n }\n .is-editor-empty:first-child:not([data-type=columns], [data-type=section], ul, li, ol)::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--placeholder-color);\n pointer-events: none;\n height: 0;\n }\n .is-empty:not([data-type=columns], [data-type=section], ol, ul, li)::before {\n content: attr(data-placeholder);\n float: left;\n color: var(--placeholder-color);\n pointer-events: none;\n height: 0;\n }\n [data-type=columns] .is-empty::before,\n [data-type=section] .is-empty::before {\n --l-threshold: 0.66;\n --diff: calc(var(--l-threshold) - l);\n color: oklch(from var(--bg-color) clamp(0.05, max(min(var(--diff) * infinity, 1), 0), 0.95) c h) !important;\n opacity: 0.6;\n }\n [data-type=columns] {\n display: flex;\n margin: 0;\n padding: 0;\n &.has-focus [data-type=column],\n &:hover [data-type=column] {\n outline: 1.5px solid #e9ecef;\n outline-style: dashed;\n }\n [data-type=column].has-focus {\n outline-style: solid;\n }\n }\n [data-type=column] {\n display: table-cell;\n flex-basis: 0;\n flex-grow: 1;\n overflow: auto;\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n [data-type=section] {\n margin: 0;\n padding: 0;\n [data-type=section-cell] {\n padding: 0;\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n }\n [data-type=for] {\n [data-node-view-content] > div {\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n }\n .node-for.has-focus [data-repeat-indicator] {\n opacity: 1;\n }\n [data-type=show] {\n [data-node-view-content] > div {\n & > *:first-child {\n margin-top: 0;\n }\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n }\n *:has(+ .ProseMirror-gapcursor) {\n margin-bottom: 0 !important;\n }\n .ProseMirror-gapcursor {\n &::after {\n border: 1.5px solid gray;\n width: 24px;\n }\n & + * {\n margin-top: 0 !important;\n }\n }\n}\n.hide-number-controls {\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &[type=number] {\n -moz-appearance: textfield;\n }\n}\n.hide-scrollbars {\n scrollbar-width: none;\n -ms-overflow-style: none;\n &::-webkit-scrollbar {\n display: none;\n }\n}\n');
91
91
 
92
92
  // src/styles/preflight.css
93
93
  styleInject(':where(.mly-editor),\n:where(.mly-editor) ::before,\n:where(.mly-editor) ::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: #e5e7eb;\n}\n:where(.mly-editor) ::before,\n:where(.mly-editor) ::after {\n --tw-content: "";\n}\n:where(.mly-editor) html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n:where(.mly-editor) body {\n margin: 0;\n line-height: inherit;\n}\n:where(.mly-editor) hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n:where(.mly-editor) abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n:where(.mly-editor) h1,\n:where(.mly-editor) h2,\n:where(.mly-editor) h3,\n:where(.mly-editor) h4,\n:where(.mly-editor) h5,\n:where(.mly-editor) h6 {\n font-size: inherit;\n font-weight: inherit;\n}\n:where(.mly-editor) a {\n color: inherit;\n text-decoration: inherit;\n}\n:where(.mly-editor) b,\n:where(.mly-editor) strong {\n font-weight: bolder;\n}\n:where(.mly-editor) code,\n:where(.mly-editor) kbd,\n:where(.mly-editor) samp,\n:where(.mly-editor) pre {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n font-size: 1em;\n}\n:where(.mly-editor) small {\n font-size: 80%;\n}\n:where(.mly-editor) sub,\n:where(.mly-editor) sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n:where(.mly-editor) sub {\n bottom: -0.25em;\n}\n:where(.mly-editor) sup {\n top: -0.5em;\n}\n:where(.mly-editor) table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) input,\n:where(.mly-editor) optgroup,\n:where(.mly-editor) select,\n:where(.mly-editor) textarea {\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) select {\n text-transform: none;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) [type=button],\n:where(.mly-editor) [type=reset],\n:where(.mly-editor) [type=submit] {\n -webkit-appearance: button;\n background-image: none;\n}\n:where(.mly-editor) :-moz-focusring {\n outline: auto;\n}\n:where(.mly-editor) :-moz-ui-invalid {\n box-shadow: none;\n}\n:where(.mly-editor) progress {\n vertical-align: baseline;\n}\n:where(.mly-editor) ::-webkit-inner-spin-button,\n:where(.mly-editor) ::-webkit-outer-spin-button {\n height: auto;\n}\n:where(.mly-editor) [type=search] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n:where(.mly-editor) ::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n:where(.mly-editor) ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n:where(.mly-editor) summary {\n display: list-item;\n}\n:where(.mly-editor) blockquote,\n:where(.mly-editor) dl,\n:where(.mly-editor) dd,\n:where(.mly-editor) h1,\n:where(.mly-editor) h2,\n:where(.mly-editor) h3,\n:where(.mly-editor) h4,\n:where(.mly-editor) h5,\n:where(.mly-editor) h6,\n:where(.mly-editor) hr,\n:where(.mly-editor) figure,\n:where(.mly-editor) p,\n:where(.mly-editor) pre {\n margin: 0;\n}\n:where(.mly-editor) fieldset {\n margin: 0;\n padding: 0;\n}\n:where(.mly-editor) legend {\n padding: 0;\n}\n:where(.mly-editor) ol,\n:where(.mly-editor) ul,\n:where(.mly-editor) menu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n:where(.mly-editor) dialog {\n padding: 0;\n}\n:where(.mly-editor) textarea {\n resize: vertical;\n}\n:where(.mly-editor) input::-moz-placeholder,\n:where(.mly-editor) textarea::-moz-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.mly-editor) input::placeholder,\n:where(.mly-editor) textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) [role=button] {\n cursor: pointer;\n}\n:where(.mly-editor) :disabled {\n cursor: default;\n}\n:where(.mly-editor) img,\n:where(.mly-editor) svg,\n:where(.mly-editor) video,\n:where(.mly-editor) canvas,\n:where(.mly-editor) audio,\n:where(.mly-editor) iframe,\n:where(.mly-editor) embed,\n:where(.mly-editor) object {\n display: block;\n vertical-align: middle;\n}\n:where(.mly-editor) img,\n:where(.mly-editor) video {\n max-width: 100%;\n height: auto;\n}\n:where(.mly-editor) [hidden] {\n display: none;\n}\n');
94
94
 
95
95
  // src/styles/tailwind.css
96
- styleInject('*,\n::before,\n::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n.mly-prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.mly-prose :where(p):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.mly-prose :where(a):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.mly-prose :where(strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.mly-prose :where(a strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(ol):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: decimal;\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-alpha;\n}\n.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-alpha;\n}\n.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-alpha;\n}\n.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-alpha;\n}\n.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-roman;\n}\n.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-roman;\n}\n.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-roman;\n}\n.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-roman;\n}\n.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: decimal;\n}\n.mly-prose :where(ul):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: disc;\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(ol > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.mly-prose :where(ul > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.mly-prose :where(dt):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.25em;\n}\n.mly-prose :where(hr):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.mly-prose :where(blockquote):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-inline-start-width: 0.25rem;\n border-inline-start-color: var(--tw-prose-quote-borders);\n quotes: "\\201c""\\201d""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-inline-start: 1em;\n}\n.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: open-quote;\n}\n.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: close-quote;\n}\n.mly-prose :where(h1):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 900;\n color: inherit;\n}\n.mly-prose :where(h2):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 800;\n color: inherit;\n}\n.mly-prose :where(h3):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 700;\n color: inherit;\n}\n.mly-prose :where(h4):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 700;\n color: inherit;\n}\n.mly-prose :where(img):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(picture):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n display: block;\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(video):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(kbd):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 500;\n font-family: inherit;\n color: var(--tw-prose-kbd);\n box-shadow: 0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);\n font-size: 0.875em;\n border-radius: 0.3125rem;\n padding-top: 0.1875em;\n padding-inline-end: 0.375em;\n padding-bottom: 0.1875em;\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: "`";\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: "`";\n}\n.mly-prose :where(a code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(h1 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(h2 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n font-size: 0.875em;\n}\n.mly-prose :where(h3 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n font-size: 0.9em;\n}\n.mly-prose :where(h4 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(thead th code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(pre):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-inline-end: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-inline-start: 1.1428571em;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: none;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: none;\n}\n.mly-prose :where(table):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n width: 100%;\n table-layout: auto;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.mly-prose :where(thead):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.mly-prose :where(thead th):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-inline-end: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-inline-start: 0.5714286em;\n}\n.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 0;\n}\n.mly-prose :where(tbody td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n vertical-align: baseline;\n}\n.mly-prose :where(tfoot):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-top-width: 1px;\n border-top-color: var(--tw-prose-th-borders);\n}\n.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n vertical-align: top;\n}\n.mly-prose :where(th, td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n text-align: start;\n}\n.mly-prose :where(figure > *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.mly-prose :where(figcaption):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.mly-prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-kbd: #111827;\n --tw-prose-kbd-shadows: 17 24 39;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-kbd: #fff;\n --tw-prose-invert-kbd-shadows: 255 255 255;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.mly-prose :where(picture > img):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.mly-prose :where(li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.mly-prose :where(ol > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(ul > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(.mly-prose > ul > li p):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.mly-prose :where(.mly-prose > ul > li > p:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n}\n.mly-prose :where(.mly-prose > ul > li > p:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 1.25em;\n}\n.mly-prose :where(.mly-prose > ol > li > p:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n}\n.mly-prose :where(.mly-prose > ol > li > p:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 1.25em;\n}\n.mly-prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.mly-prose :where(dl):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.mly-prose :where(dd):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.5em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(hr + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h2 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h3 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h4 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0;\n}\n.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-end: 0;\n}\n.mly-prose :where(tbody td, tfoot td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-top: 0.5714286em;\n padding-inline-end: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-inline-start: 0.5714286em;\n}\n.mly-prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0;\n}\n.mly-prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-end: 0;\n}\n.mly-prose :where(figure):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(.mly-prose > :first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(.mly-prose > :last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 0;\n}\n.mly-pointer-events-none {\n pointer-events: none;\n}\n.mly-absolute {\n position: absolute;\n}\n.mly-relative {\n position: relative;\n}\n.mly-inset-y-0 {\n top: 0px;\n bottom: 0px;\n}\n.mly-left-0 {\n left: 0px;\n}\n.mly-left-1\\.5 {\n left: 0.375rem;\n}\n.mly-left-2 {\n left: 0.5rem;\n}\n.mly-right-0 {\n right: 0px;\n}\n.mly-right-1 {\n right: 0.25rem;\n}\n.mly-top-0 {\n top: 0px;\n}\n.mly-top-8 {\n top: 2rem;\n}\n.mly-z-0 {\n z-index: 0;\n}\n.mly-z-10 {\n z-index: 10;\n}\n.mly-z-50 {\n z-index: 50;\n}\n.mly-z-\\[1\\] {\n z-index: 1;\n}\n.mly-z-\\[9999\\] {\n z-index: 9999;\n}\n.\\!mly-my-0 {\n margin-top: 0px !important;\n margin-bottom: 0px !important;\n}\n.mly--mx-1 {\n margin-left: -0.25rem;\n margin-right: -0.25rem;\n}\n.mly-mx-0\\.5 {\n margin-left: 0.125rem;\n margin-right: 0.125rem;\n}\n.mly-mx-1\\.5 {\n margin-left: 0.375rem;\n margin-right: 0.375rem;\n}\n.mly-my-0\\.5 {\n margin-top: 0.125rem;\n margin-bottom: 0.125rem;\n}\n.mly-my-1 {\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n}\n.\\!mly-mb-0 {\n margin-bottom: 0px !important;\n}\n.\\!mly-mb-1\\.5 {\n margin-bottom: 0.375rem !important;\n}\n.mly-mb-1\\.5 {\n margin-bottom: 0.375rem;\n}\n.mly-mb-4 {\n margin-bottom: 1rem;\n}\n.mly-ml-1 {\n margin-left: 0.25rem;\n}\n.mly-ml-auto {\n margin-left: auto;\n}\n.mly-mt-4 {\n margin-top: 1rem;\n}\n.mly-block {\n display: block;\n}\n.mly-inline-block {\n display: inline-block;\n}\n.mly-flex {\n display: flex;\n}\n.mly-inline-flex {\n display: inline-flex;\n}\n.mly-grid {\n display: grid;\n}\n.mly-aspect-square {\n aspect-ratio: 1 / 1;\n}\n.\\!mly-size-7 {\n width: 1.75rem !important;\n height: 1.75rem !important;\n}\n.mly-size-3 {\n width: 0.75rem;\n height: 0.75rem;\n}\n.mly-size-3\\.5 {\n width: 0.875rem;\n height: 0.875rem;\n}\n.mly-size-4 {\n width: 1rem;\n height: 1rem;\n}\n.mly-size-5 {\n width: 1.25rem;\n height: 1.25rem;\n}\n.mly-size-7 {\n width: 1.75rem;\n height: 1.75rem;\n}\n.mly-size-\\[15px\\] {\n width: 15px;\n height: 15px;\n}\n.mly-size-\\[var\\(--variable-icon-size\\)\\] {\n width: var(--variable-icon-size);\n height: var(--variable-icon-size);\n}\n.\\!mly-h-7 {\n height: 1.75rem !important;\n}\n.mly-h-10 {\n height: 2.5rem;\n}\n.mly-h-11 {\n height: 2.75rem;\n}\n.mly-h-3 {\n height: 0.75rem;\n}\n.mly-h-4 {\n height: 1rem;\n}\n.mly-h-6 {\n height: 1.5rem;\n}\n.mly-h-7 {\n height: 1.75rem;\n}\n.mly-h-9 {\n height: 2.25rem;\n}\n.mly-h-\\[28px\\] {\n height: 28px;\n}\n.mly-h-\\[2px\\] {\n height: 2px;\n}\n.mly-h-auto {\n height: auto;\n}\n.mly-h-full {\n height: 100%;\n}\n.mly-h-px {\n height: 1px;\n}\n.mly-max-h-\\[330px\\] {\n max-height: 330px;\n}\n.mly-min-h-24 {\n min-height: 6rem;\n}\n.mly-min-h-7 {\n min-height: 1.75rem;\n}\n.\\!mly-w-full {\n width: 100% !important;\n}\n.mly-w-10 {\n width: 2.5rem;\n}\n.mly-w-3 {\n width: 0.75rem;\n}\n.mly-w-32 {\n width: 8rem;\n}\n.mly-w-36 {\n width: 9rem;\n}\n.mly-w-4 {\n width: 1rem;\n}\n.mly-w-40 {\n width: 10rem;\n}\n.mly-w-52 {\n width: 13rem;\n}\n.mly-w-6 {\n width: 1.5rem;\n}\n.mly-w-7 {\n width: 1.75rem;\n}\n.mly-w-72 {\n width: 18rem;\n}\n.mly-w-96 {\n width: 24rem;\n}\n.mly-w-\\[1\\.5px\\] {\n width: 1.5px;\n}\n.mly-w-\\[28px\\] {\n width: 28px;\n}\n.mly-w-\\[300px\\] {\n width: 300px;\n}\n.mly-w-full {\n width: 100%;\n}\n.mly-w-max {\n width: -moz-max-content;\n width: max-content;\n}\n.mly-w-px {\n width: 1px;\n}\n.mly-min-w-0 {\n min-width: 0px;\n}\n.mly-min-w-28 {\n min-width: 7rem;\n}\n.mly-min-w-\\[240px\\] {\n min-width: 240px;\n}\n.mly-min-w-\\[260px\\] {\n min-width: 260px;\n}\n.mly-min-w-\\[8rem\\] {\n min-width: 8rem;\n}\n.mly-max-w-12 {\n max-width: 3rem;\n}\n.mly-max-w-20 {\n max-width: 5rem;\n}\n.mly-max-w-28 {\n max-width: 7rem;\n}\n.mly-max-w-max {\n max-width: -moz-max-content;\n max-width: max-content;\n}\n.mly-shrink-0 {\n flex-shrink: 0;\n}\n.mly-grow {\n flex-grow: 1;\n}\n.mly-border-separate {\n border-collapse: separate;\n}\n.mly-translate-x-full {\n --tw-translate-x: 100%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.mly-transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes mly-spin {\n to {\n transform: rotate(360deg);\n }\n}\n.mly-animate-spin {\n animation: mly-spin 1s linear infinite;\n}\n.mly-cursor-default {\n cursor: default;\n}\n.mly-cursor-grab {\n cursor: grab;\n}\n.mly-select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.mly-appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.mly-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.mly-flex-col {\n flex-direction: column;\n}\n.mly-items-center {\n align-items: center;\n}\n.mly-items-stretch {\n align-items: stretch;\n}\n.mly-justify-start {\n justify-content: flex-start;\n}\n.mly-justify-center {\n justify-content: center;\n}\n.mly-justify-between {\n justify-content: space-between;\n}\n.mly-gap-0\\.5 {\n gap: 0.125rem;\n}\n.mly-gap-1 {\n gap: 0.25rem;\n}\n.mly-gap-1\\.5 {\n gap: 0.375rem;\n}\n.mly-gap-2 {\n gap: 0.5rem;\n}\n.mly-gap-3 {\n gap: 0.75rem;\n}\n.mly-gap-4 {\n gap: 1rem;\n}\n.mly-gap-\\[1px\\] {\n gap: 1px;\n}\n.mly-gap-\\[var\\(--variable-icon-gap\\)\\] {\n gap: var(--variable-icon-gap);\n}\n.mly-space-x-0\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.125rem * var(--tw-space-x-reverse));\n margin-left: calc(0.125rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.mly-space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.mly-space-y-1 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));\n}\n.mly-overflow-hidden {\n overflow: hidden;\n}\n.mly-overflow-y-auto {\n overflow-y: auto;\n}\n.mly-scroll-smooth {\n scroll-behavior: smooth;\n}\n.mly-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.\\!mly-rounded {\n border-radius: 0.25rem !important;\n}\n.\\!mly-rounded-full {\n border-radius: 9999px !important;\n}\n.\\!mly-rounded-md {\n border-radius: 0.375rem !important;\n}\n.\\!mly-rounded-none {\n border-radius: 0px !important;\n}\n.mly-rounded {\n border-radius: 0.25rem;\n}\n.mly-rounded-full {\n border-radius: 9999px;\n}\n.mly-rounded-lg {\n border-radius: 0.5rem;\n}\n.mly-rounded-md {\n border-radius: 0.375rem;\n}\n.mly-rounded-none {\n border-radius: 0px;\n}\n.mly-rounded-sm {\n border-radius: 0.125rem;\n}\n.mly-rounded-xl {\n border-radius: 0.75rem;\n}\n.mly-rounded-t-lg {\n border-top-left-radius: 0.5rem;\n border-top-right-radius: 0.5rem;\n}\n.mly-border {\n border-width: 1px;\n}\n.mly-border-0 {\n border-width: 0px;\n}\n.mly-border-2 {\n border-width: 2px;\n}\n.mly-border-\\[1\\.5px\\] {\n border-width: 1.5px;\n}\n.mly-border-b {\n border-bottom-width: 1px;\n}\n.mly-border-l-4 {\n border-left-width: 4px;\n}\n.mly-border-t {\n border-top-width: 1px;\n}\n.mly-border-none {\n border-style: none;\n}\n.mly-border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity));\n}\n.mly-border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity));\n}\n.mly-border-gray-700 {\n --tw-border-opacity: 1;\n border-color: rgb(55 65 81 / var(--tw-border-opacity));\n}\n.mly-border-rose-400 {\n --tw-border-opacity: 1;\n border-color: rgb(251 113 133 / var(--tw-border-opacity));\n}\n.mly-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity));\n}\n.mly-border-white {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity));\n}\n.\\!mly-bg-transparent {\n background-color: transparent !important;\n}\n.mly-bg-\\[\\#efefef\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(239 239 239 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(17 24 39 / var(--tw-bg-opacity));\n}\n.mly-bg-red-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 226 226 / var(--tw-bg-opacity));\n}\n.mly-bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(253 164 175 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(255 241 242 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(244 63 94 / var(--tw-bg-opacity));\n}\n.mly-bg-soft-gray {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.mly-bg-soft-gray\\/40 {\n background-color: rgb(244 245 246 / 0.4);\n}\n.mly-bg-soft-gray\\/60 {\n background-color: rgb(244 245 246 / 0.6);\n}\n.mly-bg-transparent {\n background-color: transparent;\n}\n.mly-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n.mly-bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity));\n}\n.mly-stroke-midnight-gray {\n stroke: #333333;\n}\n.mly-stroke-\\[1\\.2\\] {\n stroke-width: 1.2;\n}\n.mly-stroke-\\[1\\] {\n stroke-width: 1;\n}\n.mly-stroke-\\[2\\.5\\] {\n stroke-width: 2.5;\n}\n.\\!mly-p-0 {\n padding: 0px !important;\n}\n.\\!mly-p-0\\.5 {\n padding: 0.125rem !important;\n}\n.mly-p-0 {\n padding: 0px;\n}\n.mly-p-0\\.5 {\n padding: 0.125rem;\n}\n.mly-p-1 {\n padding: 0.25rem;\n}\n.mly-p-3 {\n padding: 0.75rem;\n}\n.mly-p-4 {\n padding: 1rem;\n}\n.mly-px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n.mly-px-1\\.5 {\n padding-left: 0.375rem;\n padding-right: 0.375rem;\n}\n.mly-px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.mly-px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n}\n.mly-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.mly-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.mly-px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.mly-px-\\[26px\\] {\n padding-left: 26px;\n padding-right: 26px;\n}\n.mly-px-\\[32px\\] {\n padding-left: 32px;\n padding-right: 32px;\n}\n.mly-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n.mly-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.mly-py-1\\.5 {\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n}\n.mly-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.mly-py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.mly-py-\\[20px\\] {\n padding-top: 20px;\n padding-bottom: 20px;\n}\n.mly-pl-1 {\n padding-left: 0.25rem;\n}\n.mly-pl-4 {\n padding-left: 1rem;\n}\n.mly-pl-7 {\n padding-left: 1.75rem;\n}\n.mly-pl-8 {\n padding-left: 2rem;\n}\n.mly-pl-\\[26px\\] {\n padding-left: 26px;\n}\n.mly-pr-1\\.5 {\n padding-right: 0.375rem;\n}\n.mly-pr-6 {\n padding-right: 1.5rem;\n}\n.mly-text-left {\n text-align: left;\n}\n.mly-text-center {\n text-align: center;\n}\n.mly-font-mono {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n}\n.\\!mly-text-base {\n font-size: 1rem !important;\n line-height: 1.5rem !important;\n}\n.\\!mly-text-lg {\n font-size: 1.125rem !important;\n line-height: 1.75rem !important;\n}\n.mly-text-\\[10px\\] {\n font-size: 10px;\n}\n.mly-text-\\[13px\\] {\n font-size: 13px;\n}\n.mly-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.mly-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.mly-font-medium {\n font-weight: 500;\n}\n.mly-font-normal {\n font-weight: 400;\n}\n.mly-font-semibold {\n font-weight: 600;\n}\n.mly-uppercase {\n text-transform: uppercase;\n}\n.mly-capitalize {\n text-transform: capitalize;\n}\n.mly-tabular-nums {\n --tw-numeric-spacing: tabular-nums;\n font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);\n}\n.mly-leading-none {\n line-height: 1;\n}\n.mly-tracking-normal {\n letter-spacing: 0em;\n}\n.mly-tracking-widest {\n letter-spacing: 0.1em;\n}\n.mly-text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n.mly-text-gray-50 {\n --tw-text-opacity: 1;\n color: rgb(249 250 251 / var(--tw-text-opacity));\n}\n.mly-text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.mly-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.mly-text-gray-950 {\n --tw-text-opacity: 1;\n color: rgb(3 7 18 / var(--tw-text-opacity));\n}\n.mly-text-midnight-gray {\n --tw-text-opacity: 1;\n color: rgb(51 51 51 / var(--tw-text-opacity));\n}\n.mly-text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity));\n}\n.mly-text-red-600 {\n --tw-text-opacity: 1;\n color: rgb(220 38 38 / var(--tw-text-opacity));\n}\n.mly-text-rose-600 {\n --tw-text-opacity: 1;\n color: rgb(225 29 72 / var(--tw-text-opacity));\n}\n.mly-text-rose-800 {\n --tw-text-opacity: 1;\n color: rgb(159 18 57 / var(--tw-text-opacity));\n}\n.mly-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity));\n}\n.mly-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity));\n}\n.mly-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity));\n}\n.mly-text-slate-700 {\n --tw-text-opacity: 1;\n color: rgb(51 65 85 / var(--tw-text-opacity));\n}\n.mly-no-underline {\n text-decoration-line: none;\n}\n.mly-underline-offset-4 {\n text-underline-offset: 4px;\n}\n.mly-antialiased {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.mly-opacity-60 {\n opacity: 0.6;\n}\n.mly-shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.mly-ring-offset-white {\n --tw-ring-offset-color: #fff;\n}\n.mly-drop-shadow-md {\n --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.mly-transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.mly-transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.mly-ease-out {\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n.mly-animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n.mly-fade-in-0 {\n --tw-enter-opacity: 0;\n}\n.mly-zoom-in-95 {\n --tw-enter-scale: .95;\n}\n.mly-ease-out {\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n}\n.\\[text-align\\:revert-layer\\] {\n text-align: revert-layer;\n}\n.file\\:mly-border-0::file-selector-button {\n border-width: 0px;\n}\n.file\\:mly-bg-transparent::file-selector-button {\n background-color: transparent;\n}\n.file\\:mly-text-sm::file-selector-button {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.file\\:mly-font-medium::file-selector-button {\n font-weight: 500;\n}\n.placeholder\\:mly-text-gray-500::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.placeholder\\:mly-text-gray-500::placeholder {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.hover\\:mly-bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-gray-100\\/80:hover {\n background-color: rgb(243 244 246 / 0.8);\n}\n.hover\\:mly-bg-red-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-red-500\\/90:hover {\n background-color: rgb(239 68 68 / 0.9);\n}\n.hover\\:mly-bg-rose-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-soft-gray:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-soft-gray\\/60:hover {\n background-color: rgb(244 245 246 / 0.6);\n}\n.hover\\:mly-text-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n.hover\\:mly-text-gray-900:hover {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.hover\\:mly-text-midnight-gray:hover {\n --tw-text-opacity: 1;\n color: rgb(51 51 51 / var(--tw-text-opacity));\n}\n.hover\\:mly-underline:hover {\n text-decoration-line: underline;\n}\n.focus\\:mly-bg-gray-100:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.focus\\:mly-bg-red-200:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n.focus\\:mly-bg-soft-gray:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.focus\\:mly-outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus\\:mly-ring-1:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus\\:mly-ring-midnight-gray\\/50:focus {\n --tw-ring-color: rgb(51 51 51 / 0.5);\n}\n.focus-visible\\:mly-border-gray-400:focus-visible {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity));\n}\n.focus-visible\\:mly-outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus-visible\\:mly-ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:mly-ring-gray-400:focus-visible {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity));\n}\n.focus-visible\\:mly-ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n.active\\:mly-bg-soft-gray:active {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.disabled\\:mly-pointer-events-none:disabled {\n pointer-events: none;\n}\n.disabled\\:mly-cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n.disabled\\:mly-opacity-50:disabled {\n opacity: 0.5;\n}\n.aria-selected\\:mly-bg-soft-gray[aria-selected=true] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[disabled\\]\\:mly-pointer-events-none[data-disabled] {\n pointer-events: none;\n}\n.data-\\[state\\=open\\]\\:mly-bg-rose-100[data-state=open] {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=open\\]\\:mly-bg-soft-gray[data-state=open] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=true\\]\\:mly-bg-soft-gray[data-state=true] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true] {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.data-\\[disabled\\]\\:mly-opacity-50[data-disabled] {\n opacity: 0.5;\n}\n.\\[\\&_svg\\]\\:mly-pointer-events-none svg {\n pointer-events: none;\n}\n');
96
+ styleInject('*,\n::before,\n::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n* {\n scrollbar-color: initial;\n scrollbar-width: initial;\n}\n.mly-prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.mly-prose :where(p):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.mly-prose :where(a):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.mly-prose :where(strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.mly-prose :where(a strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(ol):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: decimal;\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-alpha;\n}\n.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-alpha;\n}\n.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-alpha;\n}\n.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-alpha;\n}\n.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-roman;\n}\n.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-roman;\n}\n.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-roman;\n}\n.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-roman;\n}\n.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: decimal;\n}\n.mly-prose :where(ul):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: disc;\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(ol > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.mly-prose :where(ul > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.mly-prose :where(dt):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.25em;\n}\n.mly-prose :where(hr):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.mly-prose :where(blockquote):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-inline-start-width: 0.25rem;\n border-inline-start-color: var(--tw-prose-quote-borders);\n quotes: "\\201c""\\201d""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-inline-start: 1em;\n}\n.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: open-quote;\n}\n.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: close-quote;\n}\n.mly-prose :where(h1):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 900;\n color: inherit;\n}\n.mly-prose :where(h2):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 800;\n color: inherit;\n}\n.mly-prose :where(h3):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 700;\n color: inherit;\n}\n.mly-prose :where(h4):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 700;\n color: inherit;\n}\n.mly-prose :where(img):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(picture):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n display: block;\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(video):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(kbd):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 500;\n font-family: inherit;\n color: var(--tw-prose-kbd);\n box-shadow: 0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);\n font-size: 0.875em;\n border-radius: 0.3125rem;\n padding-top: 0.1875em;\n padding-inline-end: 0.375em;\n padding-bottom: 0.1875em;\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: "`";\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: "`";\n}\n.mly-prose :where(a code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(h1 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(h2 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n font-size: 0.875em;\n}\n.mly-prose :where(h3 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n font-size: 0.9em;\n}\n.mly-prose :where(h4 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(thead th code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(pre):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-inline-end: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-inline-start: 1.1428571em;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: none;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: none;\n}\n.mly-prose :where(table):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n width: 100%;\n table-layout: auto;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.mly-prose :where(thead):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.mly-prose :where(thead th):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-inline-end: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-inline-start: 0.5714286em;\n}\n.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 0;\n}\n.mly-prose :where(tbody td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n vertical-align: baseline;\n}\n.mly-prose :where(tfoot):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-top-width: 1px;\n border-top-color: var(--tw-prose-th-borders);\n}\n.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n vertical-align: top;\n}\n.mly-prose :where(th, td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n text-align: start;\n}\n.mly-prose :where(figure > *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.mly-prose :where(figcaption):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.mly-prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-kbd: #111827;\n --tw-prose-kbd-shadows: 17 24 39;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-kbd: #fff;\n --tw-prose-invert-kbd-shadows: 255 255 255;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.mly-prose :where(picture > img):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.mly-prose :where(li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.mly-prose :where(ol > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(ul > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(.mly-prose > ul > li p):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.mly-prose :where(.mly-prose > ul > li > p:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n}\n.mly-prose :where(.mly-prose > ul > li > p:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 1.25em;\n}\n.mly-prose :where(.mly-prose > ol > li > p:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n}\n.mly-prose :where(.mly-prose > ol > li > p:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 1.25em;\n}\n.mly-prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.mly-prose :where(dl):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.mly-prose :where(dd):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.5em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(hr + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h2 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h3 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h4 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0;\n}\n.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-end: 0;\n}\n.mly-prose :where(tbody td, tfoot td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-top: 0.5714286em;\n padding-inline-end: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-inline-start: 0.5714286em;\n}\n.mly-prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0;\n}\n.mly-prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-end: 0;\n}\n.mly-prose :where(figure):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(.mly-prose > :first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(.mly-prose > :last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 0;\n}\n.mly-pointer-events-none {\n pointer-events: none;\n}\n.mly-absolute {\n position: absolute;\n}\n.mly-relative {\n position: relative;\n}\n.mly-inset-y-0 {\n top: 0px;\n bottom: 0px;\n}\n.mly-left-0 {\n left: 0px;\n}\n.mly-left-1\\.5 {\n left: 0.375rem;\n}\n.mly-left-2 {\n left: 0.5rem;\n}\n.mly-right-0 {\n right: 0px;\n}\n.mly-right-1 {\n right: 0.25rem;\n}\n.mly-right-1\\.5 {\n right: 0.375rem;\n}\n.mly-top-0 {\n top: 0px;\n}\n.mly-top-8 {\n top: 2rem;\n}\n.mly-isolate {\n isolation: isolate;\n}\n.mly-z-0 {\n z-index: 0;\n}\n.mly-z-10 {\n z-index: 10;\n}\n.mly-z-20 {\n z-index: 20;\n}\n.mly-z-50 {\n z-index: 50;\n}\n.mly-z-\\[1\\] {\n z-index: 1;\n}\n.mly-z-\\[9999\\] {\n z-index: 9999;\n}\n.\\!mly-my-0 {\n margin-top: 0px !important;\n margin-bottom: 0px !important;\n}\n.mly--mx-1 {\n margin-left: -0.25rem;\n margin-right: -0.25rem;\n}\n.mly-mx-0\\.5 {\n margin-left: 0.125rem;\n margin-right: 0.125rem;\n}\n.mly-mx-1\\.5 {\n margin-left: 0.375rem;\n margin-right: 0.375rem;\n}\n.mly-my-0\\.5 {\n margin-top: 0.125rem;\n margin-bottom: 0.125rem;\n}\n.mly-my-1 {\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n}\n.\\!mly-mb-0 {\n margin-bottom: 0px !important;\n}\n.\\!mly-mb-1\\.5 {\n margin-bottom: 0.375rem !important;\n}\n.-mly-ms-px {\n margin-inline-start: -1px;\n}\n.mly-mb-1\\.5 {\n margin-bottom: 0.375rem;\n}\n.mly-mb-4 {\n margin-bottom: 1rem;\n}\n.mly-ml-1 {\n margin-left: 0.25rem;\n}\n.mly-ml-auto {\n margin-left: auto;\n}\n.mly-mt-4 {\n margin-top: 1rem;\n}\n.mly-block {\n display: block;\n}\n.mly-inline-block {\n display: inline-block;\n}\n.mly-flex {\n display: flex;\n}\n.mly-inline-flex {\n display: inline-flex;\n}\n.mly-grid {\n display: grid;\n}\n.mly-inline-grid {\n display: inline-grid;\n}\n.mly-aspect-square {\n aspect-ratio: 1 / 1;\n}\n.\\!mly-size-5 {\n width: 1.25rem !important;\n height: 1.25rem !important;\n}\n.\\!mly-size-7 {\n width: 1.75rem !important;\n height: 1.75rem !important;\n}\n.mly-size-3 {\n width: 0.75rem;\n height: 0.75rem;\n}\n.mly-size-3\\.5 {\n width: 0.875rem;\n height: 0.875rem;\n}\n.mly-size-4 {\n width: 1rem;\n height: 1rem;\n}\n.mly-size-5 {\n width: 1.25rem;\n height: 1.25rem;\n}\n.mly-size-7 {\n width: 1.75rem;\n height: 1.75rem;\n}\n.mly-size-\\[15px\\] {\n width: 15px;\n height: 15px;\n}\n.mly-size-\\[var\\(--variable-icon-size\\)\\] {\n width: var(--variable-icon-size);\n height: var(--variable-icon-size);\n}\n.\\!mly-h-7 {\n height: 1.75rem !important;\n}\n.mly-h-10 {\n height: 2.5rem;\n}\n.mly-h-11 {\n height: 2.75rem;\n}\n.mly-h-3 {\n height: 0.75rem;\n}\n.mly-h-4 {\n height: 1rem;\n}\n.mly-h-5 {\n height: 1.25rem;\n}\n.mly-h-6 {\n height: 1.5rem;\n}\n.mly-h-7 {\n height: 1.75rem;\n}\n.mly-h-8 {\n height: 2rem;\n}\n.mly-h-9 {\n height: 2.25rem;\n}\n.mly-h-\\[2px\\] {\n height: 2px;\n}\n.mly-h-auto {\n height: auto;\n}\n.mly-h-full {\n height: 100%;\n}\n.mly-h-px {\n height: 1px;\n}\n.mly-max-h-52 {\n max-height: 13rem;\n}\n.mly-max-h-\\[330px\\] {\n max-height: 330px;\n}\n.mly-min-h-24 {\n min-height: 6rem;\n}\n.mly-min-h-7 {\n min-height: 1.75rem;\n}\n.\\!mly-w-full {\n width: 100% !important;\n}\n.mly-w-10 {\n width: 2.5rem;\n}\n.mly-w-3 {\n width: 0.75rem;\n}\n.mly-w-32 {\n width: 8rem;\n}\n.mly-w-36 {\n width: 9rem;\n}\n.mly-w-4 {\n width: 1rem;\n}\n.mly-w-40 {\n width: 10rem;\n}\n.mly-w-5 {\n width: 1.25rem;\n}\n.mly-w-52 {\n width: 13rem;\n}\n.mly-w-6 {\n width: 1.5rem;\n}\n.mly-w-64 {\n width: 16rem;\n}\n.mly-w-7 {\n width: 1.75rem;\n}\n.mly-w-72 {\n width: 18rem;\n}\n.mly-w-9 {\n width: 2.25rem;\n}\n.mly-w-96 {\n width: 24rem;\n}\n.mly-w-\\[1\\.5px\\] {\n width: 1.5px;\n}\n.mly-w-\\[300px\\] {\n width: 300px;\n}\n.mly-w-full {\n width: 100%;\n}\n.mly-w-max {\n width: -moz-max-content;\n width: max-content;\n}\n.mly-w-px {\n width: 1px;\n}\n.mly-min-w-0 {\n min-width: 0px;\n}\n.mly-min-w-28 {\n min-width: 7rem;\n}\n.mly-min-w-\\[260px\\] {\n min-width: 260px;\n}\n.mly-min-w-\\[8rem\\] {\n min-width: 8rem;\n}\n.mly-max-w-12 {\n max-width: 3rem;\n}\n.mly-max-w-20 {\n max-width: 5rem;\n}\n.mly-max-w-28 {\n max-width: 7rem;\n}\n.mly-max-w-max {\n max-width: -moz-max-content;\n max-width: max-content;\n}\n.mly-max-w-xs {\n max-width: 20rem;\n}\n.mly-shrink-0 {\n flex-shrink: 0;\n}\n.mly-grow {\n flex-grow: 1;\n}\n.mly-border-separate {\n border-collapse: separate;\n}\n.mly-translate-x-full {\n --tw-translate-x: 100%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.mly-transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes mly-spin {\n to {\n transform: rotate(360deg);\n }\n}\n.mly-animate-spin {\n animation: mly-spin 1s linear infinite;\n}\n.mly-cursor-default {\n cursor: default;\n}\n.mly-cursor-grab {\n cursor: grab;\n}\n.mly-cursor-pointer {\n cursor: pointer;\n}\n.mly-select-none {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.mly-appearance-none {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.mly-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.mly-grid-cols-\\[12px_1fr\\] {\n grid-template-columns: 12px 1fr;\n}\n.mly-flex-col {\n flex-direction: column;\n}\n.mly-items-center {\n align-items: center;\n}\n.mly-items-stretch {\n align-items: stretch;\n}\n.mly-justify-start {\n justify-content: flex-start;\n}\n.mly-justify-center {\n justify-content: center;\n}\n.mly-justify-between {\n justify-content: space-between;\n}\n.mly-gap-0\\.5 {\n gap: 0.125rem;\n}\n.mly-gap-1 {\n gap: 0.25rem;\n}\n.mly-gap-1\\.5 {\n gap: 0.375rem;\n}\n.mly-gap-2 {\n gap: 0.5rem;\n}\n.mly-gap-3 {\n gap: 0.75rem;\n}\n.mly-gap-4 {\n gap: 1rem;\n}\n.mly-gap-\\[1px\\] {\n gap: 1px;\n}\n.mly-gap-\\[var\\(--variable-icon-gap\\)\\] {\n gap: var(--variable-icon-gap);\n}\n.mly-space-x-0\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.125rem * var(--tw-space-x-reverse));\n margin-left: calc(0.125rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.mly-space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.mly-space-y-1 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));\n}\n.mly-overflow-hidden {\n overflow: hidden;\n}\n.mly-overflow-y-auto {\n overflow-y: auto;\n}\n.mly-scroll-smooth {\n scroll-behavior: smooth;\n}\n.mly-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.\\!mly-rounded {\n border-radius: 0.25rem !important;\n}\n.\\!mly-rounded-full {\n border-radius: 9999px !important;\n}\n.\\!mly-rounded-md {\n border-radius: 0.375rem !important;\n}\n.\\!mly-rounded-none {\n border-radius: 0px !important;\n}\n.mly-rounded {\n border-radius: 0.25rem;\n}\n.mly-rounded-full {\n border-radius: 9999px;\n}\n.mly-rounded-lg {\n border-radius: 0.5rem;\n}\n.mly-rounded-md {\n border-radius: 0.375rem;\n}\n.mly-rounded-none {\n border-radius: 0px;\n}\n.mly-rounded-sm {\n border-radius: 0.125rem;\n}\n.mly-rounded-xl {\n border-radius: 0.75rem;\n}\n.mly-rounded-s-lg {\n border-start-start-radius: 0.5rem;\n border-end-start-radius: 0.5rem;\n}\n.mly-rounded-s-none {\n border-start-start-radius: 0px;\n border-end-start-radius: 0px;\n}\n.mly-rounded-t-lg {\n border-top-left-radius: 0.5rem;\n border-top-right-radius: 0.5rem;\n}\n.mly-border {\n border-width: 1px;\n}\n.mly-border-0 {\n border-width: 0px;\n}\n.mly-border-2 {\n border-width: 2px;\n}\n.mly-border-\\[1\\.5px\\] {\n border-width: 1.5px;\n}\n.mly-border-b {\n border-bottom-width: 1px;\n}\n.mly-border-l-4 {\n border-left-width: 4px;\n}\n.mly-border-t {\n border-top-width: 1px;\n}\n.mly-border-none {\n border-style: none;\n}\n.mly-border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity));\n}\n.mly-border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity));\n}\n.mly-border-gray-700 {\n --tw-border-opacity: 1;\n border-color: rgb(55 65 81 / var(--tw-border-opacity));\n}\n.mly-border-rose-400 {\n --tw-border-opacity: 1;\n border-color: rgb(251 113 133 / var(--tw-border-opacity));\n}\n.mly-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity));\n}\n.mly-border-white {\n --tw-border-opacity: 1;\n border-color: rgb(255 255 255 / var(--tw-border-opacity));\n}\n.\\!mly-bg-transparent {\n background-color: transparent !important;\n}\n.mly-bg-\\[\\#efefef\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(239 239 239 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity));\n}\n.mly-bg-gray-900 {\n --tw-bg-opacity: 1;\n background-color: rgb(17 24 39 / var(--tw-bg-opacity));\n}\n.mly-bg-red-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 226 226 / var(--tw-bg-opacity));\n}\n.mly-bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(253 164 175 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(255 241 242 / var(--tw-bg-opacity));\n}\n.mly-bg-rose-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(244 63 94 / var(--tw-bg-opacity));\n}\n.mly-bg-soft-gray {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.mly-bg-soft-gray\\/40 {\n background-color: rgb(244 245 246 / 0.4);\n}\n.mly-bg-soft-gray\\/60 {\n background-color: rgb(244 245 246 / 0.6);\n}\n.mly-bg-transparent {\n background-color: transparent;\n}\n.mly-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n.mly-bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity));\n}\n.mly-stroke-midnight-gray {\n stroke: #333333;\n}\n.mly-stroke-\\[1\\.2\\] {\n stroke-width: 1.2;\n}\n.mly-stroke-\\[1\\] {\n stroke-width: 1;\n}\n.mly-stroke-\\[2\\.5\\] {\n stroke-width: 2.5;\n}\n.\\!mly-p-0 {\n padding: 0px !important;\n}\n.\\!mly-p-0\\.5 {\n padding: 0.125rem !important;\n}\n.mly-p-0 {\n padding: 0px;\n}\n.mly-p-0\\.5 {\n padding: 0.125rem;\n}\n.mly-p-1 {\n padding: 0.25rem;\n}\n.mly-p-3 {\n padding: 0.75rem;\n}\n.mly-p-4 {\n padding: 1rem;\n}\n.mly-px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n.mly-px-1\\.5 {\n padding-left: 0.375rem;\n padding-right: 0.375rem;\n}\n.mly-px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.mly-px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n}\n.mly-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.mly-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.mly-px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.mly-px-\\[26px\\] {\n padding-left: 26px;\n padding-right: 26px;\n}\n.mly-px-\\[32px\\] {\n padding-left: 32px;\n padding-right: 32px;\n}\n.mly-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n.mly-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.mly-py-1\\.5 {\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n}\n.mly-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.mly-py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.mly-py-\\[20px\\] {\n padding-top: 20px;\n padding-bottom: 20px;\n}\n.mly-pe-8 {\n padding-inline-end: 2rem;\n}\n.mly-pl-1 {\n padding-left: 0.25rem;\n}\n.mly-pl-4 {\n padding-left: 1rem;\n}\n.mly-pl-7 {\n padding-left: 1.75rem;\n}\n.mly-pl-8 {\n padding-left: 2rem;\n}\n.mly-pl-\\[26px\\] {\n padding-left: 26px;\n}\n.mly-pr-1\\.5 {\n padding-right: 0.375rem;\n}\n.mly-pr-6 {\n padding-right: 1.5rem;\n}\n.mly-pr-7 {\n padding-right: 1.75rem;\n}\n.mly-ps-3 {\n padding-inline-start: 0.75rem;\n}\n.mly-text-left {\n text-align: left;\n}\n.mly-text-center {\n text-align: center;\n}\n.mly-font-mono {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n}\n.\\!mly-text-base {\n font-size: 1rem !important;\n line-height: 1.5rem !important;\n}\n.\\!mly-text-lg {\n font-size: 1.125rem !important;\n line-height: 1.75rem !important;\n}\n.mly-text-\\[10px\\] {\n font-size: 10px;\n}\n.mly-text-\\[13px\\] {\n font-size: 13px;\n}\n.mly-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.mly-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.mly-font-medium {\n font-weight: 500;\n}\n.mly-font-normal {\n font-weight: 400;\n}\n.mly-font-semibold {\n font-weight: 600;\n}\n.mly-uppercase {\n text-transform: uppercase;\n}\n.mly-capitalize {\n text-transform: capitalize;\n}\n.mly-tabular-nums {\n --tw-numeric-spacing: tabular-nums;\n font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);\n}\n.mly-leading-none {\n line-height: 1;\n}\n.mly-tracking-normal {\n letter-spacing: 0em;\n}\n.mly-tracking-widest {\n letter-spacing: 0.1em;\n}\n.mly-text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n.mly-text-gray-50 {\n --tw-text-opacity: 1;\n color: rgb(249 250 251 / var(--tw-text-opacity));\n}\n.mly-text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.mly-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity));\n}\n.mly-text-gray-700 {\n --tw-text-opacity: 1;\n color: rgb(55 65 81 / var(--tw-text-opacity));\n}\n.mly-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.mly-text-gray-950 {\n --tw-text-opacity: 1;\n color: rgb(3 7 18 / var(--tw-text-opacity));\n}\n.mly-text-midnight-gray {\n --tw-text-opacity: 1;\n color: rgb(51 51 51 / var(--tw-text-opacity));\n}\n.mly-text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity));\n}\n.mly-text-red-600 {\n --tw-text-opacity: 1;\n color: rgb(220 38 38 / var(--tw-text-opacity));\n}\n.mly-text-rose-600 {\n --tw-text-opacity: 1;\n color: rgb(225 29 72 / var(--tw-text-opacity));\n}\n.mly-text-rose-800 {\n --tw-text-opacity: 1;\n color: rgb(159 18 57 / var(--tw-text-opacity));\n}\n.mly-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity));\n}\n.mly-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity));\n}\n.mly-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity));\n}\n.mly-text-slate-700 {\n --tw-text-opacity: 1;\n color: rgb(51 65 85 / var(--tw-text-opacity));\n}\n.mly-no-underline {\n text-decoration-line: none;\n}\n.mly-underline-offset-4 {\n text-underline-offset: 4px;\n}\n.mly-antialiased {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.mly-opacity-60 {\n opacity: 0.6;\n}\n.mly-shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.mly-outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.mly-ring-offset-white {\n --tw-ring-offset-color: #fff;\n}\n.mly-drop-shadow-md {\n --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.mly-transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.mly-transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.mly-transition-shadow {\n transition-property: box-shadow;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.mly-ease-out {\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n.mly-animate-in {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n.mly-fade-in-0 {\n --tw-enter-opacity: 0;\n}\n.mly-zoom-in-95 {\n --tw-enter-scale: .95;\n}\n.mly-ease-out {\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n}\n.mly-scrollbar-thin::-webkit-scrollbar-track {\n background-color: var(--scrollbar-track);\n border-radius: var(--scrollbar-track-radius);\n}\n.mly-scrollbar-thin::-webkit-scrollbar-track:hover {\n background-color: var(--scrollbar-track-hover, var(--scrollbar-track));\n}\n.mly-scrollbar-thin::-webkit-scrollbar-track:active {\n background-color: var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)));\n}\n.mly-scrollbar-thin::-webkit-scrollbar-thumb {\n background-color: var(--scrollbar-thumb);\n border-radius: var(--scrollbar-thumb-radius);\n}\n.mly-scrollbar-thin::-webkit-scrollbar-thumb:hover {\n background-color: var(--scrollbar-thumb-hover, var(--scrollbar-thumb));\n}\n.mly-scrollbar-thin::-webkit-scrollbar-thumb:active {\n background-color: var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)));\n}\n.mly-scrollbar-thin::-webkit-scrollbar-corner {\n background-color: var(--scrollbar-corner);\n border-radius: var(--scrollbar-corner-radius);\n}\n.mly-scrollbar-thin::-webkit-scrollbar-corner:hover {\n background-color: var(--scrollbar-corner-hover, var(--scrollbar-corner));\n}\n.mly-scrollbar-thin::-webkit-scrollbar-corner:active {\n background-color: var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)));\n}\n.mly-scrollbar-thin {\n scrollbar-width: thin;\n scrollbar-color: var(--scrollbar-thumb, initial) var(--scrollbar-track, initial);\n}\n.mly-scrollbar-thin::-webkit-scrollbar {\n display: block;\n width: 8px;\n height: 8px;\n}\n.mly-scrollbar-track-transparent {\n --scrollbar-track: transparent !important;\n}\n.mly-scrollbar-thumb-gray-200 {\n --scrollbar-thumb: #e5e7eb !important;\n}\n.\\[text-align\\:revert-layer\\] {\n text-align: revert-layer;\n}\n.file\\:mly-border-0::file-selector-button {\n border-width: 0px;\n}\n.file\\:mly-bg-transparent::file-selector-button {\n background-color: transparent;\n}\n.file\\:mly-text-sm::file-selector-button {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.file\\:mly-font-medium::file-selector-button {\n font-weight: 500;\n}\n.placeholder\\:mly-text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n.placeholder\\:mly-text-gray-400::placeholder {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity));\n}\n.placeholder\\:mly-text-gray-500::-moz-placeholder {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.placeholder\\:mly-text-gray-500::placeholder {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.mly-peer:disabled ~ .peer-disabled\\:mly-opacity-50 {\n opacity: 0.5;\n}\n.aria-selected\\:mly-bg-soft-gray[aria-selected=true] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[disabled\\]\\:mly-pointer-events-none[data-disabled] {\n pointer-events: none;\n}\n.data-\\[state\\=open\\]\\:mly-bg-rose-100[data-state=open] {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=open\\]\\:mly-bg-soft-gray[data-state=open] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=true\\]\\:mly-bg-soft-gray[data-state=true] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true] {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.data-\\[disabled\\]\\:mly-opacity-50[data-disabled] {\n opacity: 0.5;\n}\n.hover\\:mly-bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-gray-100\\/80:hover {\n background-color: rgb(243 244 246 / 0.8);\n}\n.hover\\:mly-bg-red-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-red-500\\/90:hover {\n background-color: rgb(239 68 68 / 0.9);\n}\n.hover\\:mly-bg-rose-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-soft-gray:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-soft-gray\\/60:hover {\n background-color: rgb(244 245 246 / 0.6);\n}\n.hover\\:mly-text-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n.hover\\:mly-text-gray-900:hover {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.hover\\:mly-text-midnight-gray:hover {\n --tw-text-opacity: 1;\n color: rgb(51 51 51 / var(--tw-text-opacity));\n}\n.hover\\:mly-underline:hover {\n text-decoration-line: underline;\n}\n.focus\\:mly-z-10:focus {\n z-index: 10;\n}\n.focus\\:mly-bg-gray-100:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.focus\\:mly-bg-red-200:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n.focus\\:mly-bg-soft-gray:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.focus\\:mly-outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus\\:mly-ring-1:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus\\:mly-ring-midnight-gray\\/50:focus {\n --tw-ring-color: rgb(51 51 51 / 0.5);\n}\n.focus-visible\\:mly-relative:focus-visible {\n position: relative;\n}\n.focus-visible\\:mly-z-10:focus-visible {\n z-index: 10;\n}\n.focus-visible\\:mly-border-gray-400:focus-visible {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity));\n}\n.focus-visible\\:mly-outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus-visible\\:mly-ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:mly-ring-gray-400:focus-visible {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity));\n}\n.focus-visible\\:mly-ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n.active\\:mly-bg-soft-gray:active {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.disabled\\:mly-pointer-events-none:disabled {\n pointer-events: none;\n}\n.disabled\\:mly-cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n.disabled\\:mly-opacity-50:disabled {\n opacity: 0.5;\n}\n.\\[\\&_svg\\]\\:mly-pointer-events-none svg {\n pointer-events: none;\n}\n');
97
97
 
98
98
  // src/editor/index.tsx
99
- var import_react44 = require("@tiptap/react");
100
- var import_react45 = require("react");
99
+ var import_react49 = require("@tiptap/react");
100
+ var import_react50 = require("react");
101
101
 
102
102
  // src/editor/components/column-menu/columns-bubble-menu.tsx
103
- var import_react4 = require("@tiptap/react");
104
- var import_react5 = require("react");
103
+ var import_react10 = require("@tiptap/react");
104
+ var import_react11 = require("react");
105
105
 
106
106
  // src/editor/utils/get-render-container.ts
107
107
  function getRenderContainer(editor, nodeType) {
@@ -194,7 +194,7 @@ var import_core2 = require("@tiptap/core");
194
194
  var import_uuid = require("uuid");
195
195
  var DEFAULT_COLUMN_WIDTH = "auto";
196
196
  var DEFAULT_COLUMN_VERTICAL_ALIGN = "top";
197
- var Column = import_core2.Node.create({
197
+ var ColumnExtension = import_core2.Node.create({
198
198
  name: "column",
199
199
  content: "block+",
200
200
  isolating: true,
@@ -517,7 +517,7 @@ var BaseButton = React2.forwardRef(
517
517
  "asChild"
518
518
  ]);
519
519
  const Comp = asChild ? import_react_slot.Slot : "button";
520
- const baseClass = "mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-opacity-50";
520
+ const baseClass = "mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 focus-visible:mly-relative focus-visible:mly-z-10 disabled:mly-opacity-50 ";
521
521
  const variantClasses = {
522
522
  default: "mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-soft-gray",
523
523
  destructive: "mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",
@@ -629,7 +629,7 @@ function VerticalAlignmentSwitch(props) {
629
629
  }
630
630
 
631
631
  // src/editor/components/show-popover.tsx
632
- var import_lucide_react2 = require("lucide-react");
632
+ var import_lucide_react8 = require("lucide-react");
633
633
 
634
634
  // src/editor/components/popover.tsx
635
635
  var React3 = __toESM(require("react"));
@@ -656,1065 +656,1127 @@ var PopoverContent = React3.forwardRef((_a, ref) => {
656
656
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
657
657
 
658
658
  // src/editor/components/show-popover.tsx
659
- var import_react2 = require("react");
660
- var import_jsx_runtime7 = require("react/jsx-runtime");
661
- function ShowPopover(props) {
662
- const { showIfKey, onShowIfKeyValueChange } = props;
663
- const [isUpdatingKey, setIsUpdatingKey] = (0, import_react2.useState)(false);
664
- const inputRef = (0, import_react2.useRef)(null);
665
- const isValidWhenKey = showIfKey !== void 0 && showIfKey !== "";
666
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
667
- Popover,
668
- {
669
- onOpenChange: (open) => {
670
- if (open) {
671
- return;
672
- }
673
- setIsUpdatingKey(false);
674
- },
675
- children: [
676
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
677
- PopoverTrigger,
678
- {
679
- className: cn(
680
- "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm hover:mly-bg-soft-gray data-[state=open]:mly-bg-soft-gray",
681
- showIfKey && "mly-bg-rose-100 mly-text-rose-800 hover:mly-bg-rose-100 data-[state=open]:mly-bg-rose-100"
682
- ),
683
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
684
- }
685
- ),
686
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
687
- PopoverContent,
688
- {
689
- className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
690
- side: "top",
691
- sideOffset: 8,
692
- align: "end",
693
- onOpenAutoFocus: (e) => {
694
- e.preventDefault();
695
- },
696
- onCloseAutoFocus: (e) => {
697
- e.preventDefault();
698
- },
699
- children: [
700
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "Show if" }),
701
- !isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
702
- "button",
703
- {
704
- className: cn(
705
- "mly-flex mly-h-7 mly-min-w-28 mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-px-2 mly-font-mono mly-text-sm hover:mly-bg-soft-gray",
706
- !isValidWhenKey && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
707
- ),
708
- onClick: () => {
709
- setIsUpdatingKey(true);
710
- setTimeout(() => {
711
- var _a;
712
- (_a = inputRef.current) == null ? void 0 : _a.focus();
713
- }, 0);
714
- },
715
- children: [
716
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Braces, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
717
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: showIfKey })
718
- ]
719
- }
720
- ),
721
- isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
722
- "form",
723
- {
724
- onSubmit: (e) => {
725
- e.preventDefault();
726
- setIsUpdatingKey(false);
727
- },
728
- onKeyDown: (e) => {
729
- if (e.key === "Escape") {
730
- setIsUpdatingKey(false);
731
- }
732
- },
733
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "mly-relative", children: [
734
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
735
- "input",
736
- {
737
- value: showIfKey || "",
738
- onChange: (e) => {
739
- onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(e.target.value);
740
- },
741
- onBlur: () => {
742
- setIsUpdatingKey(false);
743
- },
744
- ref: inputRef,
745
- type: "text",
746
- placeholder: "e.g. key",
747
- className: "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none"
748
- }
749
- ),
750
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
751
- ] })
752
- }
753
- )
754
- ]
755
- }
756
- )
757
- ]
758
- }
759
- );
760
- }
659
+ var import_react6 = require("react");
761
660
 
762
- // src/editor/components/column-menu/columns-width-config.tsx
763
- var import_lucide_react3 = require("lucide-react");
764
- var import_jsx_runtime8 = require("react/jsx-runtime");
765
- function ColumnsWidthConfig(props) {
766
- const {
767
- columnsCount = 2,
768
- onColumnsCountChange,
769
- columnWidths,
770
- onColumnWidthChange
771
- } = props;
772
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Popover, { children: [
773
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopoverTrigger, { className: "mly-flex mly-size-7 mly-items-center mly-justify-center mly-gap-1 mly-rounded-md mly-text-sm hover:mly-bg-soft-gray data-[state=open]:mly-bg-soft-gray", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.SlidersVertical, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" }) }),
774
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
775
- PopoverContent,
776
- {
777
- className: "mly-w-[300px] mly-rounded-lg !mly-p-0.5",
778
- side: "top",
779
- sideOffset: 8,
780
- align: "center",
781
- onOpenAutoFocus: (e) => {
782
- e.preventDefault();
783
- },
784
- onCloseAutoFocus: (e) => {
785
- e.preventDefault();
786
- },
787
- children: [
788
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mly-grid mly-grid-cols-2 mly-gap-1", children: [
789
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
790
- SwitchButton,
791
- {
792
- onClick: () => onColumnsCountChange(2),
793
- isActive: columnsCount === 2,
794
- children: [
795
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.Columns2, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
796
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "2 Columns" })
797
- ]
798
- }
799
- ),
800
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
801
- SwitchButton,
802
- {
803
- onClick: () => onColumnsCountChange(3),
804
- isActive: columnsCount === 3,
805
- children: [
806
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.Columns3, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
807
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "3 Columns" })
808
- ]
809
- }
810
- )
811
- ] }),
812
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", { className: "mly-my-0.5 mly-border-gray-200" }),
813
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
814
- "div",
815
- {
816
- className: "mly-grid mly-gap-1 mly-p-1",
817
- style: { gridTemplateColumns: `repeat(${columnsCount}, 1fr)` },
818
- children: Array.from({ length: columnsCount }).map((_, index) => {
819
- const value = columnWidths[index] === "auto" ? "" : columnWidths[index];
820
- const label = columnsCount === 2 ? index === 0 ? "Left" : "Right" : index === 0 ? "Left" : index === 1 ? "Middle" : "Right";
821
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mly-flex mly-flex-col mly-gap-1", children: [
822
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mly-text-xs mly-text-gray-400", children: label }),
823
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "mly-relative", children: [
824
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
825
- "input",
826
- {
827
- placeholder: "auto",
828
- min: 1,
829
- max: 90,
830
- type: "number",
831
- className: "hide-number-controls mly-w-full mly-appearance-none mly-rounded-md mly-bg-soft-gray mly-px-1.5 mly-py-1 mly-pr-6 mly-text-sm mly-tabular-nums mly-outline-none focus:mly-bg-soft-gray focus:mly-outline-none focus:mly-ring-1 focus:mly-ring-midnight-gray/50",
832
- value,
833
- onChange: (e) => {
834
- const value2 = e.target.value;
835
- onColumnWidthChange == null ? void 0 : onColumnWidthChange(index, value2);
836
- }
837
- }
838
- ),
839
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "mly-absolute mly-inset-y-0 mly-right-0 mly-flex mly-aspect-square mly-items-center mly-justify-center mly-text-xs mly-tabular-nums mly-text-gray-500", children: "%" })
840
- ] })
841
- ] }, index);
842
- })
843
- }
844
- )
845
- ]
661
+ // src/editor/utils/use-outside-click.ts
662
+ var import_react2 = require("react");
663
+ var import_react3 = require("react");
664
+ function useOutsideClick(ref, callback) {
665
+ const handleClick = (0, import_react2.useCallback)(
666
+ (e) => {
667
+ if (ref.current && !ref.current.contains(e.target)) {
668
+ callback();
846
669
  }
847
- )
848
- ] });
849
- }
850
- function SwitchButton(props) {
851
- const { onClick, isActive = false, children } = props;
852
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
853
- "button",
854
- {
855
- className: cn(
856
- "mly-flex mly-h-7 mly-items-center mly-gap-1 mly-rounded-md mly-px-2 mly-text-sm mly-text-gray-500 hover:mly-bg-soft-gray hover:mly-text-midnight-gray",
857
- isActive && "mly-bg-soft-gray mly-text-midnight-gray"
858
- ),
859
- onClick,
860
- children
861
- }
670
+ },
671
+ [ref, callback]
862
672
  );
673
+ (0, import_react3.useEffect)(() => {
674
+ document.addEventListener("mousedown", handleClick);
675
+ document.addEventListener("touchstart", handleClick);
676
+ return () => {
677
+ document.removeEventListener("mousedown", handleClick);
678
+ document.removeEventListener("touchstart", handleClick);
679
+ };
680
+ }, [handleClick]);
863
681
  }
864
682
 
865
- // src/editor/components/ui/select.tsx
866
- var import_react3 = require("react");
867
- var import_jsx_runtime9 = require("react/jsx-runtime");
868
- function Select(props) {
869
- const {
870
- label,
871
- options,
872
- value,
683
+ // src/editor/components/ui/input-autocomplete.tsx
684
+ var import_lucide_react2 = require("lucide-react");
685
+ var import_react4 = require("react");
686
+ var import_jsx_runtime7 = require("react/jsx-runtime");
687
+ var InputAutocomplete = (0, import_react4.forwardRef)((props, ref) => {
688
+ const _a = props, {
689
+ value = "",
873
690
  onValueChange,
874
- tooltip,
875
691
  className,
876
- icon: Icon,
877
- iconClassName
878
- } = props;
879
- const selectId = `mly${(0, import_react3.useId)()}`;
880
- const content = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
881
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: selectId, className: "sr-only", children: label }),
882
- Icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-left-2 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: cn("mly-size-3", iconClassName) }) }),
883
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
884
- "select",
692
+ onOutsideClick,
693
+ onSelectOption,
694
+ autoCompleteOptions = []
695
+ } = _a, inputProps = __objRest(_a, [
696
+ "value",
697
+ "onValueChange",
698
+ "className",
699
+ "onOutsideClick",
700
+ "onSelectOption",
701
+ "autoCompleteOptions"
702
+ ]);
703
+ const containerRef = (0, import_react4.useRef)(null);
704
+ const [selectedIndex, setSelectedIndex] = (0, import_react4.useState)(0);
705
+ useOutsideClick(containerRef, () => {
706
+ onOutsideClick == null ? void 0 : onOutsideClick();
707
+ });
708
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("mly-relative", className), ref: containerRef, children: [
709
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "mly-relative", children: [
710
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
711
+ "input",
712
+ __spreadProps(__spreadValues({}, inputProps), {
713
+ ref,
714
+ value,
715
+ onChange: (e) => {
716
+ setSelectedIndex(0);
717
+ onValueChange(e.target.value);
718
+ },
719
+ type: "text",
720
+ placeholder: "e.g. items",
721
+ className: "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
722
+ onKeyDown: (e) => {
723
+ if (e.key === "ArrowDown") {
724
+ e.preventDefault();
725
+ setSelectedIndex(
726
+ (prev) => Math.min(prev + 1, autoCompleteOptions.length - 1)
727
+ );
728
+ } else if (e.key === "ArrowUp") {
729
+ e.preventDefault();
730
+ setSelectedIndex((prev) => Math.max(prev - 1, 0));
731
+ } else if (e.key === "Enter") {
732
+ e.preventDefault();
733
+ const _value = autoCompleteOptions[selectedIndex];
734
+ onValueChange(_value);
735
+ onSelectOption == null ? void 0 : onSelectOption(_value);
736
+ }
737
+ }
738
+ })
739
+ ),
740
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
741
+ ] }),
742
+ autoCompleteOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mly-absolute mly-left-0 mly-top-8 mly-z-10 mly-w-full mly-rounded-lg mly-bg-white mly-p-0.5 mly-shadow-md", children: autoCompleteOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
743
+ "button",
885
744
  {
886
- id: selectId,
887
- className: cn(
888
- "mly-flex mly-min-h-7 mly-max-w-max mly-appearance-none mly-items-center mly-rounded-md mly-px-1.5 mly-py-0.5 mly-text-sm mly-text-midnight-gray mly-ring-offset-white mly-transition-colors hover:mly-bg-soft-gray focus:mly-outline-none focus-visible:mly-outline-none active:mly-bg-soft-gray",
889
- !!Icon && "mly-pl-7",
890
- className
891
- ),
892
- value,
893
- onChange: (event) => onValueChange(event.target.value),
894
- children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: option.value, children: option.label }, option.value))
895
- }
896
- )
897
- ] });
898
- if (!tooltip) {
899
- return content;
900
- }
901
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Tooltip, { children: [
902
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipTrigger, { asChild: true, children: content }),
903
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
745
+ type: "button",
746
+ className: "mly-w-full mly-truncate mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-midnight-gray aria-selected:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
747
+ onClick: () => {
748
+ onValueChange(option);
749
+ onSelectOption == null ? void 0 : onSelectOption(option);
750
+ },
751
+ onMouseEnter: () => setSelectedIndex(index),
752
+ "aria-selected": selectedIndex === index,
753
+ children: option
754
+ },
755
+ option
756
+ )) })
904
757
  ] });
905
- }
758
+ });
759
+ InputAutocomplete.displayName = "InputAutocomplete";
906
760
 
907
- // src/editor/components/column-menu/columns-bubble-menu-content.tsx
908
- var import_lucide_react4 = require("lucide-react");
761
+ // src/editor/provider.tsx
762
+ var import_react5 = require("react");
909
763
 
910
- // src/editor/utils/delete-node.ts
911
- var import_core4 = require("@tiptap/core");
912
- function deleteNode(editor, nodeType) {
913
- const { state } = editor.view;
914
- const associatedNode = (0, import_core4.findParentNode)((node) => node.type.name === nodeType)(
915
- state.selection
916
- );
917
- if (!associatedNode) {
918
- return;
764
+ // src/blocks/button.tsx
765
+ var import_lucide_react3 = require("lucide-react");
766
+ var import_jsx_runtime8 = require("react/jsx-runtime");
767
+ var button = {
768
+ title: "Button",
769
+ description: "Add a call to action button to email.",
770
+ searchTerms: ["link", "button", "cta"],
771
+ icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.MousePointer, { className: "mly-h-4 mly-w-4" }),
772
+ command: ({ editor, range }) => {
773
+ editor.chain().focus().deleteRange(range).setButton().run();
919
774
  }
920
- const from = associatedNode.pos;
921
- const to = from + associatedNode.node.nodeSize;
922
- const { tr } = state;
923
- const transaction = tr.delete(from, to);
924
- editor.view.dispatch(transaction);
925
- }
775
+ };
776
+ var linkCard = {
777
+ title: "Link Card",
778
+ description: "Add a link card to email.",
779
+ searchTerms: ["link", "button", "image"],
780
+ icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
781
+ command: ({ editor, range }) => {
782
+ editor.chain().focus().deleteRange(range).setLinkCard().run();
783
+ }
784
+ };
926
785
 
927
- // src/editor/components/column-menu/columns-bubble-menu-content.tsx
786
+ // src/blocks/image.tsx
787
+ var import_lucide_react4 = require("lucide-react");
788
+ var import_jsx_runtime9 = require("react/jsx-runtime");
789
+ var image = {
790
+ title: "Image",
791
+ description: "Full width image",
792
+ searchTerms: ["image"],
793
+ icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ImageIcon, { className: "mly-h-4 mly-w-4" }),
794
+ command: ({ editor, range }) => {
795
+ editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
796
+ }
797
+ };
798
+ var logo = {
799
+ title: "Logo",
800
+ description: "Add your brand logo",
801
+ searchTerms: ["image", "logo"],
802
+ icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ImageIcon, { className: "mly-h-4 mly-w-4" }),
803
+ command: ({ editor, range }) => {
804
+ editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
805
+ }
806
+ };
807
+
808
+ // src/blocks/layout.tsx
809
+ var import_lucide_react5 = require("lucide-react");
928
810
  var import_jsx_runtime10 = require("react/jsx-runtime");
929
- function ColumnsBubbleMenuContent(props) {
930
- const { editor } = props;
931
- if (!editor) {
932
- return null;
811
+ var columns = {
812
+ title: "Columns",
813
+ description: "Add columns to email.",
814
+ searchTerms: ["layout", "columns"],
815
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
816
+ shouldBeHidden: (editor) => {
817
+ return editor.isActive("columns");
818
+ },
819
+ command: ({ editor, range }) => {
820
+ editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
933
821
  }
934
- const state = useColumnsState(editor);
935
- const currentColumnCount = state.columnsCount;
936
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mly-flex mly-items-stretch", children: [
937
- state.isColumnActive && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
938
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
939
- ColumnsWidthConfig,
940
- {
941
- columnsCount: currentColumnCount,
942
- columnWidths: state.columnWidths,
943
- onColumnsCountChange: (count) => {
944
- if (count > currentColumnCount) {
945
- addColumnByIndex(editor);
946
- } else {
947
- removeColumnByIndex(editor);
948
- }
949
- },
950
- onColumnWidthChange: (index, width) => {
951
- updateColumnWidth(editor, index, width);
952
- }
953
- }
954
- ),
955
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {})
956
- ] }),
957
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
958
- VerticalAlignmentSwitch,
959
- {
960
- alignment: state.currentVerticalAlignment,
961
- onAlignmentChange: (value) => {
962
- editor.commands.updateColumn({
963
- verticalAlign: value
964
- });
965
- }
966
- }
967
- ),
968
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {}),
969
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
970
- Select,
971
- {
972
- icon: import_lucide_react4.Space,
973
- label: "Columns Gap",
974
- value: state.currentColumnsGap,
975
- options: [
976
- { value: "0", label: "None" },
977
- { value: "4", label: "Small" },
978
- { value: "8", label: "Medium" },
979
- { value: "12", label: "Large" },
980
- { value: "16", label: "Extra Large" }
981
- ],
982
- onValueChange: (value) => {
983
- editor.commands.updateColumns({
984
- gap: +value
985
- });
986
- },
987
- tooltip: "Columns Gap"
988
- }
989
- ),
990
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {}),
991
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
992
- BubbleMenuButton,
993
- {
994
- icon: import_lucide_react4.Trash,
995
- tooltip: "Delete Columns",
996
- command: () => {
997
- deleteNode(editor, "columns");
998
- }
999
- }
1000
- ),
1001
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Divider, {}),
1002
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1003
- ShowPopover,
1004
- {
1005
- showIfKey: state.currentShowIfKey,
1006
- onShowIfKeyValueChange: (value) => {
1007
- editor.commands.updateColumns({
1008
- showIfKey: value
1009
- });
1010
- }
1011
- }
1012
- )
1013
- ] }) });
1014
- }
822
+ };
823
+ var section = {
824
+ title: "Section",
825
+ description: "Add a section to email.",
826
+ searchTerms: ["layout", "section"],
827
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
828
+ command: ({ editor, range }) => {
829
+ editor.chain().focus().deleteRange(range).setSection().run();
830
+ }
831
+ };
832
+ var forLoop = {
833
+ title: "For",
834
+ description: "Loop over an array of items.",
835
+ searchTerms: ["for", "loop"],
836
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.Repeat2, { className: "mly-h-4 mly-w-4" }),
837
+ shouldBeHidden: (editor) => {
838
+ return editor.isActive("for");
839
+ },
840
+ command: ({ editor, range }) => {
841
+ editor.chain().focus().deleteRange(range).setFor().run();
842
+ }
843
+ };
844
+ var spacer = {
845
+ title: "Spacer",
846
+ description: "Add space between blocks.",
847
+ searchTerms: ["space", "gap", "divider"],
848
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.MoveVertical, { className: "mly-h-4 mly-w-4" }),
849
+ command: ({ editor, range }) => {
850
+ editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
851
+ }
852
+ };
853
+ var divider = {
854
+ title: "Divider",
855
+ description: "Add a horizontal divider.",
856
+ searchTerms: ["divider", "line"],
857
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.Minus, { className: "mly-h-4 mly-w-4" }),
858
+ command: ({ editor, range }) => {
859
+ editor.chain().focus().deleteRange(range).setHorizontalRule().run();
860
+ }
861
+ };
1015
862
 
1016
- // src/editor/components/column-menu/columns-bubble-menu.tsx
863
+ // src/blocks/list.tsx
864
+ var import_lucide_react6 = require("lucide-react");
1017
865
  var import_jsx_runtime11 = require("react/jsx-runtime");
1018
- function ColumnsBubbleMenu(props) {
1019
- const { appendTo, editor } = props;
1020
- if (!editor) {
1021
- return null;
866
+ var bulletList = {
867
+ title: "Bullet List",
868
+ description: "Create a simple bullet list.",
869
+ searchTerms: ["unordered", "point"],
870
+ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.List, { className: "mly-h-4 mly-w-4" }),
871
+ command: ({ editor, range }) => {
872
+ editor.chain().focus().deleteRange(range).toggleBulletList().run();
1022
873
  }
1023
- const getReferenceClientRect = (0, import_react5.useCallback)(() => {
1024
- const renderContainer = getRenderContainer(editor, "columns");
1025
- const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
1026
- return rect;
1027
- }, [editor]);
1028
- const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
1029
- shouldShow: ({ editor: editor2 }) => {
1030
- if (isTextSelected(editor2) || editor2.isActive("section") || editor2.isActive("for")) {
1031
- return false;
1032
- }
1033
- return editor2.isActive("columns");
1034
- },
1035
- tippyOptions: {
1036
- offset: [0, 8],
1037
- popperOptions: {
1038
- modifiers: [{ name: "flip", enabled: false }]
1039
- },
1040
- getReferenceClientRect,
1041
- appendTo: () => appendTo == null ? void 0 : appendTo.current,
1042
- plugins: [import_tippy.sticky],
1043
- sticky: "popper",
1044
- maxWidth: "auto"
1045
- },
1046
- pluginKey: "columnsBubbleMenu"
1047
- });
1048
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1049
- import_react4.BubbleMenu,
1050
- __spreadProps(__spreadValues({}, bubbleMenuProps), {
1051
- className: "mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
1052
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColumnsBubbleMenuContent, { editor })
1053
- })
1054
- );
1055
- }
1056
-
1057
- // src/editor/components/content-menu.tsx
1058
- var import_react7 = require("react");
1059
- var import_lucide_react5 = require("lucide-react");
874
+ };
875
+ var orderedList = {
876
+ title: "Numbered List",
877
+ description: "Create a list with numbering.",
878
+ searchTerms: ["ordered"],
879
+ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.ListOrdered, { className: "mly-h-4 mly-w-4" }),
880
+ command: ({ editor, range }) => {
881
+ editor.chain().focus().deleteRange(range).toggleOrderedList().run();
882
+ }
883
+ };
1060
884
 
1061
- // src/editor/components/drag-handle.tsx
1062
- var import_react6 = require("react");
1063
- var import_echo_drag_handle_plugin = require("echo-drag-handle-plugin");
885
+ // src/blocks/typography.tsx
886
+ var import_lucide_react7 = require("lucide-react");
1064
887
  var import_jsx_runtime12 = require("react/jsx-runtime");
1065
- function DragHandle(props) {
1066
- const {
1067
- className = "drag-handle",
1068
- children,
1069
- editor,
1070
- pluginKey = import_echo_drag_handle_plugin.dragHandlePluginDefaultKey,
1071
- onNodeChange,
1072
- tippyOptions = {}
1073
- } = props;
1074
- const [element, setElement] = (0, import_react6.useState)(null);
1075
- const pluginRef = (0, import_react6.useRef)(null);
1076
- (0, import_react6.useEffect)(() => {
1077
- if (!element) {
1078
- return () => {
1079
- pluginRef.current = null;
1080
- };
1081
- }
1082
- if (editor.isDestroyed) {
1083
- return () => {
1084
- pluginRef.current = null;
1085
- };
1086
- }
1087
- if (!pluginRef.current) {
1088
- pluginRef.current = (0, import_echo_drag_handle_plugin.DragHandlePlugin)({
1089
- editor,
1090
- element,
1091
- pluginKey,
1092
- tippyOptions,
1093
- onNodeChange
1094
- });
1095
- editor.registerPlugin(pluginRef.current);
1096
- }
1097
- return () => {
1098
- editor.unregisterPlugin(pluginKey);
1099
- pluginRef.current = null;
1100
- };
1101
- }, [element, editor, onNodeChange, pluginKey]);
1102
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className, ref: setElement, children });
1103
- }
888
+ var text = {
889
+ title: "Text",
890
+ description: "Just start typing with plain text.",
891
+ searchTerms: ["p", "paragraph"],
892
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Text, { className: "mly-h-4 mly-w-4" }),
893
+ command: ({ editor, range }) => {
894
+ editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
895
+ }
896
+ };
897
+ var heading1 = {
898
+ title: "Heading 1",
899
+ description: "Big heading.",
900
+ searchTerms: ["title", "big", "large"],
901
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Heading1, { className: "mly-h-4 mly-w-4" }),
902
+ command: ({ editor, range }) => {
903
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
904
+ }
905
+ };
906
+ var heading2 = {
907
+ title: "Heading 2",
908
+ description: "Medium heading.",
909
+ searchTerms: ["subtitle", "medium"],
910
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Heading2, { className: "mly-h-4 mly-w-4" }),
911
+ command: ({ editor, range }) => {
912
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
913
+ }
914
+ };
915
+ var heading3 = {
916
+ title: "Heading 3",
917
+ description: "Small heading.",
918
+ searchTerms: ["subtitle", "small"],
919
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Heading3, { className: "mly-h-4 mly-w-4" }),
920
+ command: ({ editor, range }) => {
921
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
922
+ }
923
+ };
924
+ var hardBreak = {
925
+ title: "Hard Break",
926
+ description: "Add a break between lines.",
927
+ searchTerms: ["break", "line"],
928
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.DivideIcon, { className: "mly-h-4 mly-w-4" }),
929
+ command: ({ editor, range }) => {
930
+ editor.chain().focus().deleteRange(range).setHardBreak().run();
931
+ }
932
+ };
933
+ var blockquote = {
934
+ title: "Blockquote",
935
+ description: "Add blockquote.",
936
+ searchTerms: ["quote", "blockquote"],
937
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.TextQuote, { className: "mly-h-4 mly-w-4" }),
938
+ command: ({ editor, range }) => {
939
+ editor.chain().focus().deleteRange(range).toggleBlockquote().run();
940
+ }
941
+ };
942
+ var footer = {
943
+ title: "Footer",
944
+ description: "Add a footer text to email.",
945
+ searchTerms: ["footer", "text"],
946
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
947
+ command: ({ editor, range }) => {
948
+ editor.chain().focus().deleteRange(range).setFooter().run();
949
+ }
950
+ };
951
+ var clearLine = {
952
+ title: "Clear Line",
953
+ description: "Clear the current line.",
954
+ searchTerms: ["clear", "line"],
955
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.EraserIcon, { className: "mly-h-4 mly-w-4" }),
956
+ command: ({ editor, range }) => {
957
+ editor.chain().focus().selectParentNode().deleteSelection().run();
958
+ }
959
+ };
1104
960
 
1105
- // src/editor/components/content-menu.tsx
961
+ // src/editor/extensions/slash-command/default-slash-commands.ts
962
+ var DEFAULT_SLASH_COMMANDS = [
963
+ text,
964
+ heading1,
965
+ heading2,
966
+ heading3,
967
+ bulletList,
968
+ orderedList,
969
+ image,
970
+ logo,
971
+ columns,
972
+ section,
973
+ forLoop,
974
+ divider,
975
+ spacer,
976
+ button,
977
+ linkCard,
978
+ hardBreak,
979
+ blockquote,
980
+ footer,
981
+ clearLine
982
+ ];
983
+
984
+ // src/editor/provider.tsx
1106
985
  var import_jsx_runtime13 = require("react/jsx-runtime");
1107
- function ContentMenu(props) {
1108
- const { editor } = props;
1109
- const [menuOpen, setMenuOpen] = (0, import_react7.useState)(false);
1110
- const [currentNode, setCurrentNode] = (0, import_react7.useState)(null);
1111
- const [currentNodePos, setCurrentNodePos] = (0, import_react7.useState)(-1);
1112
- const handleNodeChange = (0, import_react7.useCallback)(
1113
- (data) => {
1114
- if (data.node) {
1115
- setCurrentNode(data.node);
1116
- }
1117
- setCurrentNodePos(data.pos);
1118
- },
1119
- [setCurrentNodePos, setCurrentNode]
1120
- );
1121
- function duplicateNode() {
1122
- editor.commands.setNodeSelection(currentNodePos);
1123
- const { $anchor } = editor.state.selection;
1124
- const selectedNode = $anchor.node(1) || editor.state.selection.node;
1125
- editor.chain().setMeta("hideDragHandle", true).insertContentAt(
1126
- currentNodePos + ((currentNode == null ? void 0 : currentNode.nodeSize) || 0),
1127
- selectedNode.toJSON()
1128
- ).run();
1129
- setMenuOpen(false);
986
+ var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
987
+ var DEFAULT_VARIABLES = [];
988
+ var MailyContext = (0, import_react5.createContext)({
989
+ variableTriggerCharacter: DEFAULT_VARIABLE_TRIGGER_CHAR,
990
+ variables: DEFAULT_VARIABLES,
991
+ blocks: DEFAULT_SLASH_COMMANDS
992
+ });
993
+ function MailyProvider(props) {
994
+ const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
995
+ if (defaultValues.variableTriggerCharacter === "") {
996
+ throw new Error("variableTriggerCharacter cannot be an empty string");
1130
997
  }
1131
- function deleteCurrentNode() {
1132
- editor.chain().setMeta("hideDragHandle", true).setNodeSelection(currentNodePos).deleteSelection().run();
1133
- setMenuOpen(false);
998
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MailyContext.Provider, { value: defaultValues, children });
999
+ }
1000
+ function useMailyContext() {
1001
+ const values = (0, import_react5.useContext)(MailyContext);
1002
+ if (!values) {
1003
+ throw new Error("Missing MailyContext.Provider in the component tree");
1134
1004
  }
1135
- function handleAddNewNode() {
1136
- var _a;
1137
- if (currentNodePos !== -1) {
1138
- const currentNodeSize = (currentNode == null ? void 0 : currentNode.nodeSize) || 0;
1139
- const insertPos = currentNodePos + currentNodeSize;
1140
- const currentNodeIsEmptyParagraph = (currentNode == null ? void 0 : currentNode.type.name) === "paragraph" && ((_a = currentNode == null ? void 0 : currentNode.content) == null ? void 0 : _a.size) === 0;
1141
- const focusPos = currentNodeIsEmptyParagraph ? currentNodePos + 2 : insertPos + 2;
1142
- editor.chain().command(({ dispatch, tr, state }) => {
1143
- if (dispatch) {
1144
- if (currentNodeIsEmptyParagraph) {
1145
- tr.insertText("/", currentNodePos, currentNodePos + 1);
1146
- } else {
1147
- tr.insert(
1148
- insertPos,
1149
- state.schema.nodes.paragraph.create(null, [
1150
- state.schema.text("/")
1151
- ])
1152
- );
1153
- }
1154
- return dispatch(tr);
1155
- }
1156
- return true;
1157
- }).focus(focusPos).run();
1005
+ return values;
1006
+ }
1007
+
1008
+ // src/editor/components/show-popover.tsx
1009
+ var import_react7 = require("react");
1010
+ var import_react8 = require("react");
1011
+
1012
+ // src/editor/utils/variable.ts
1013
+ function processVariables(variables, options) {
1014
+ const { query } = options;
1015
+ const queryLower = query.toLowerCase();
1016
+ let filteredVariables = [];
1017
+ if (Array.isArray(variables)) {
1018
+ filteredVariables = variables.filter(
1019
+ (variable) => variable.name.toLowerCase().startsWith(queryLower)
1020
+ );
1021
+ if (query.length > 0 && !filteredVariables.some((variable) => variable.name === query)) {
1022
+ filteredVariables.push({ name: query, required: true });
1158
1023
  }
1024
+ return filteredVariables;
1025
+ } else if (typeof variables === "function") {
1026
+ return variables(options);
1027
+ } else {
1028
+ throw new Error(`Invalid variables type. Expected 'Array' or 'Function', but received '${typeof variables}'.
1029
+
1030
+ You can check out the documentation for more information: https://github.com/arikchakma/maily.to/blob/main/packages/core/readme.md`);
1159
1031
  }
1160
- (0, import_react7.useEffect)(() => {
1161
- if (menuOpen) {
1162
- editor.commands.setMeta("lockDragHandle", true);
1163
- } else {
1164
- editor.commands.setMeta("lockDragHandle", false);
1165
- }
1166
- return () => {
1167
- editor.commands.setMeta("lockDragHandle", false);
1168
- };
1169
- }, [editor, menuOpen]);
1170
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1171
- DragHandle,
1032
+ }
1033
+
1034
+ // src/editor/components/show-popover.tsx
1035
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1036
+ function _ShowPopover(props) {
1037
+ const { showIfKey = "", onShowIfKeyValueChange, editor } = props;
1038
+ const { variables = [] } = useMailyContext();
1039
+ const [isUpdatingKey, setIsUpdatingKey] = (0, import_react6.useState)(false);
1040
+ const inputRef = (0, import_react6.useRef)(null);
1041
+ const autoCompleteOptions = (0, import_react7.useMemo)(() => {
1042
+ return processVariables(variables, {
1043
+ query: showIfKey || "",
1044
+ from: "variable",
1045
+ editor
1046
+ }).map((variable) => variable.name).slice(0, 5);
1047
+ }, [variables, showIfKey, editor]);
1048
+ const isValidWhenKey = showIfKey || autoCompleteOptions.includes(showIfKey);
1049
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1050
+ Popover,
1172
1051
  {
1173
- pluginKey: "ContentMenu",
1174
- editor,
1175
- tippyOptions: {
1176
- offset: [-2, 0],
1177
- zIndex: 99
1052
+ onOpenChange: (open) => {
1053
+ if (open) {
1054
+ return;
1055
+ }
1056
+ setIsUpdatingKey(false);
1178
1057
  },
1179
- onNodeChange: handleNodeChange,
1180
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mly-flex mly-items-center mly-gap-0.5 mly-pr-1.5", children: [
1181
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tooltip, { children: [
1182
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1183
- BaseButton,
1184
- {
1185
- variant: "ghost",
1186
- size: "icon",
1187
- className: "!mly-size-7 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
1188
- onClick: handleAddNewNode,
1189
- type: "button",
1190
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.Plus, { className: "mly-size-4 mly-shrink-0" })
1191
- }
1192
- ) }),
1193
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipContent, { sideOffset: 8, children: "Add new node" })
1194
- ] }),
1195
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Popover, { open: menuOpen, onOpenChange: setMenuOpen, children: [
1196
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mly-relative mly-flex mly-flex-col", children: [
1197
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tooltip, { children: [
1198
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1199
- BaseButton,
1058
+ children: [
1059
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1060
+ PopoverTrigger,
1061
+ {
1062
+ className: cn(
1063
+ "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray focus-visible:mly-relative focus-visible:mly-z-10 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2",
1064
+ showIfKey && "mly-bg-rose-100 mly-text-rose-800 data-[state=open]:mly-bg-rose-100 hover:mly-bg-rose-100"
1065
+ ),
1066
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
1067
+ }
1068
+ ),
1069
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1070
+ PopoverContent,
1071
+ {
1072
+ className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
1073
+ side: "top",
1074
+ sideOffset: 8,
1075
+ align: "end",
1076
+ onOpenAutoFocus: (e) => {
1077
+ e.preventDefault();
1078
+ },
1079
+ onCloseAutoFocus: (e) => {
1080
+ e.preventDefault();
1081
+ },
1082
+ children: [
1083
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "Show if" }),
1084
+ !isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1085
+ "button",
1200
1086
  {
1201
- variant: "ghost",
1202
- size: "icon",
1203
- className: "mly-relative mly-z-[1] !mly-size-7 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
1204
- onClick: (e) => {
1087
+ className: cn(
1088
+ "mly-flex mly-h-7 mly-min-w-28 mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-px-2 mly-font-mono mly-text-sm hover:mly-bg-soft-gray",
1089
+ !isValidWhenKey && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
1090
+ ),
1091
+ onClick: () => {
1092
+ setIsUpdatingKey(true);
1093
+ setTimeout(() => {
1094
+ var _a;
1095
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
1096
+ }, 0);
1097
+ },
1098
+ children: [
1099
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Braces, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
1100
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: showIfKey })
1101
+ ]
1102
+ }
1103
+ ),
1104
+ isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1105
+ "form",
1106
+ {
1107
+ onSubmit: (e) => {
1205
1108
  e.preventDefault();
1206
- setMenuOpen(true);
1109
+ setIsUpdatingKey(false);
1207
1110
  },
1208
- type: "button",
1209
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.GripVertical, { className: "mly-size-4 mly-shrink-0" })
1111
+ onKeyDown: (e) => {
1112
+ if (e.key === "Escape") {
1113
+ setIsUpdatingKey(false);
1114
+ }
1115
+ },
1116
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1117
+ InputAutocomplete,
1118
+ {
1119
+ value: showIfKey || "",
1120
+ onValueChange: (value) => {
1121
+ onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(value);
1122
+ },
1123
+ onOutsideClick: () => {
1124
+ setIsUpdatingKey(false);
1125
+ },
1126
+ onSelectOption: () => {
1127
+ setIsUpdatingKey(false);
1128
+ },
1129
+ autoCompleteOptions,
1130
+ ref: inputRef
1131
+ }
1132
+ )
1210
1133
  }
1211
- ) }),
1212
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipContent, { sideOffset: 8, children: "Node actions" })
1213
- ] }),
1214
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverTrigger, { className: "mly-absolute mly-left-0 mly-top-0 mly-z-0 mly-h-[28px] mly-w-[28px]" })
1215
- ] }),
1216
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1217
- PopoverContent,
1218
- {
1219
- align: "start",
1220
- side: "bottom",
1221
- sideOffset: 8,
1222
- className: "mly-flex mly-w-max mly-flex-col mly-rounded-md mly-p-1",
1223
- children: [
1224
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1225
- BaseButton,
1226
- {
1227
- variant: "ghost",
1228
- onClick: duplicateNode,
1229
- className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-px-2 mly-py-1 mly-text-sm mly-font-normal",
1230
- children: [
1231
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.Copy, { className: "mly-size-[15px] mly-shrink-0" }),
1232
- "Duplicate"
1233
- ]
1234
- }
1235
- ),
1236
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Divider, { type: "horizontal" }),
1237
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1238
- BaseButton,
1239
- {
1240
- onClick: deleteCurrentNode,
1241
- className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-bg-red-100 mly-px-2 mly-py-1 mly-text-sm mly-font-normal mly-text-red-600 hover:mly-bg-red-200 focus:mly-bg-red-200",
1242
- children: [
1243
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.Trash2, { className: "mly-size-[15px] mly-shrink-0" }),
1244
- "Delete"
1245
- ]
1246
- }
1247
- )
1248
- ]
1249
- }
1250
- )
1251
- ] })
1252
- ] }) })
1134
+ )
1135
+ ]
1136
+ }
1137
+ )
1138
+ ]
1253
1139
  }
1254
1140
  );
1255
1141
  }
1142
+ var ShowPopover = (0, import_react8.memo)(_ShowPopover);
1256
1143
 
1257
- // src/editor/components/editor-menu-bar.tsx
1258
- var import_react8 = require("react");
1259
- var import_lucide_react6 = require("lucide-react");
1260
- var import_jsx_runtime14 = require("react/jsx-runtime");
1261
- var EditorMenuBar = (props) => {
1262
- const { editor, config } = props;
1263
- const items = (0, import_react8.useMemo)(
1264
- () => [
1265
- {
1266
- name: "bold",
1267
- command: () => editor.chain().focus().toggleBold().run(),
1268
- isActive: () => editor.isActive("bold"),
1269
- group: "mark",
1270
- icon: import_lucide_react6.BoldIcon
1271
- },
1272
- {
1273
- name: "italic",
1274
- command: () => editor.chain().focus().toggleItalic().run(),
1275
- isActive: () => editor.isActive("italic"),
1276
- group: "mark",
1277
- icon: import_lucide_react6.ItalicIcon
1278
- },
1279
- {
1280
- name: "underline",
1281
- command: () => editor.chain().focus().toggleUnderline().run(),
1282
- isActive: () => editor.isActive("underline"),
1283
- group: "mark",
1284
- icon: import_lucide_react6.UnderlineIcon
1285
- },
1286
- {
1287
- name: "strike",
1288
- command: () => editor.chain().focus().toggleStrike().run(),
1289
- isActive: () => editor.isActive("strike"),
1290
- group: "mark",
1291
- icon: import_lucide_react6.StrikethroughIcon
1292
- },
1293
- {
1294
- name: "delete-line",
1295
- command: () => editor.chain().focus().selectParentNode().deleteSelection().run(),
1296
- isActive: () => false,
1297
- group: "mark",
1298
- icon: import_lucide_react6.EraserIcon
1299
- },
1300
- {
1301
- name: "divider",
1302
- command: () => editor.chain().focus().setHorizontalRule().run(),
1303
- isActive: () => editor.isActive("horizontalRule"),
1304
- group: "custom",
1305
- icon: import_lucide_react6.SeparatorHorizontal
1306
- },
1144
+ // src/editor/components/column-menu/columns-width-config.tsx
1145
+ var import_lucide_react9 = require("lucide-react");
1146
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1147
+ function ColumnsWidthConfig(props) {
1148
+ const {
1149
+ columnsCount = 2,
1150
+ onColumnsCountChange,
1151
+ columnWidths,
1152
+ onColumnWidthChange
1153
+ } = props;
1154
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Popover, { children: [
1155
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverTrigger, { className: "mly-flex mly-size-7 mly-items-center mly-justify-center mly-gap-1 mly-rounded-md mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react9.SlidersVertical, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" }) }),
1156
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1157
+ PopoverContent,
1307
1158
  {
1308
- name: "link",
1309
- command: () => {
1310
- const previousUrl = editor.getAttributes("link").href;
1311
- const url = window.prompt("URL", previousUrl);
1312
- if (url === null) return;
1313
- if (url === "") {
1314
- editor.chain().focus().extendMarkRange("link").unsetLink().run();
1315
- return;
1316
- }
1317
- editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
1159
+ className: "mly-w-[300px] mly-rounded-lg !mly-p-0.5",
1160
+ side: "top",
1161
+ sideOffset: 8,
1162
+ align: "center",
1163
+ onOpenAutoFocus: (e) => {
1164
+ e.preventDefault();
1318
1165
  },
1319
- isActive: () => editor.isActive("link"),
1320
- group: "custom",
1321
- icon: import_lucide_react6.LinkIcon
1322
- },
1323
- {
1324
- name: "left",
1325
- command: () => editor.chain().focus().setTextAlign("left").run(),
1326
- isActive: () => editor.isActive({ textAlign: "left" }),
1327
- group: "alignment",
1328
- icon: import_lucide_react6.AlignLeft
1329
- },
1330
- {
1331
- name: "center",
1332
- command: () => editor.chain().focus().setTextAlign("center").run(),
1333
- isActive: () => editor.isActive({ textAlign: "center" }),
1334
- group: "alignment",
1335
- icon: import_lucide_react6.AlignCenter
1336
- },
1337
- {
1338
- name: "right",
1339
- command: () => editor.chain().focus().setTextAlign("right").run(),
1340
- isActive: () => editor.isActive({ textAlign: "right" }),
1341
- group: "alignment",
1342
- icon: import_lucide_react6.AlignRight
1343
- }
1344
- ],
1345
- [editor]
1346
- );
1347
- const groups = (0, import_react8.useMemo)(
1348
- () => items.reduce((acc, item) => {
1349
- if (!acc.includes(item.group)) {
1350
- acc.push(item.group);
1166
+ onCloseAutoFocus: (e) => {
1167
+ e.preventDefault();
1168
+ },
1169
+ children: [
1170
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mly-grid mly-grid-cols-2 mly-gap-1", children: [
1171
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1172
+ SwitchButton,
1173
+ {
1174
+ onClick: () => onColumnsCountChange(2),
1175
+ isActive: columnsCount === 2,
1176
+ children: [
1177
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react9.Columns2, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
1178
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "2 Columns" })
1179
+ ]
1180
+ }
1181
+ ),
1182
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1183
+ SwitchButton,
1184
+ {
1185
+ onClick: () => onColumnsCountChange(3),
1186
+ isActive: columnsCount === 3,
1187
+ children: [
1188
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react9.Columns3, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
1189
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "3 Columns" })
1190
+ ]
1191
+ }
1192
+ )
1193
+ ] }),
1194
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("hr", { className: "mly-my-0.5 mly-border-gray-200" }),
1195
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1196
+ "div",
1197
+ {
1198
+ className: "mly-grid mly-gap-1 mly-p-1",
1199
+ style: { gridTemplateColumns: `repeat(${columnsCount}, 1fr)` },
1200
+ children: Array.from({ length: columnsCount }).map((_, index) => {
1201
+ const value = columnWidths[index] === "auto" ? "" : columnWidths[index];
1202
+ const label = columnsCount === 2 ? index === 0 ? "Left" : "Right" : index === 0 ? "Left" : index === 1 ? "Middle" : "Right";
1203
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mly-flex mly-flex-col mly-gap-1", children: [
1204
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "mly-text-xs mly-text-gray-400", children: label }),
1205
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "mly-relative", children: [
1206
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1207
+ "input",
1208
+ {
1209
+ placeholder: "auto",
1210
+ min: 1,
1211
+ max: 90,
1212
+ type: "number",
1213
+ className: "hide-number-controls mly-w-full mly-appearance-none mly-rounded-md mly-bg-soft-gray mly-px-1.5 mly-py-1 mly-pr-6 mly-text-sm mly-tabular-nums mly-outline-none focus:mly-bg-soft-gray focus:mly-outline-none focus:mly-ring-1 focus:mly-ring-midnight-gray/50",
1214
+ value,
1215
+ onChange: (e) => {
1216
+ const value2 = e.target.value;
1217
+ onColumnWidthChange == null ? void 0 : onColumnWidthChange(index, value2);
1218
+ }
1219
+ }
1220
+ ),
1221
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "mly-absolute mly-inset-y-0 mly-right-0 mly-flex mly-aspect-square mly-items-center mly-justify-center mly-text-xs mly-tabular-nums mly-text-gray-500", children: "%" })
1222
+ ] })
1223
+ ] }, index);
1224
+ })
1225
+ }
1226
+ )
1227
+ ]
1351
1228
  }
1352
- return acc;
1353
- }, []),
1354
- [items]
1355
- );
1356
- if (!editor) {
1357
- return null;
1358
- }
1359
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1360
- "div",
1229
+ )
1230
+ ] });
1231
+ }
1232
+ function SwitchButton(props) {
1233
+ const { onClick, isActive = false, children } = props;
1234
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1235
+ "button",
1361
1236
  {
1362
- className: `mly-flex mly-items-center mly-gap-3 ${config == null ? void 0 : config.toolbarClassName}`,
1363
- children: groups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1364
- "div",
1365
- {
1366
- className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",
1367
- children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BubbleMenuButton, __spreadValues({}, item), index2))
1368
- },
1369
- index
1370
- ))
1237
+ className: cn(
1238
+ "mly-flex mly-h-7 mly-items-center mly-gap-1 mly-rounded-md mly-px-2 mly-text-sm mly-text-gray-500 hover:mly-bg-soft-gray hover:mly-text-midnight-gray",
1239
+ isActive && "mly-bg-soft-gray mly-text-midnight-gray"
1240
+ ),
1241
+ onClick,
1242
+ children
1371
1243
  }
1372
1244
  );
1373
- };
1245
+ }
1374
1246
 
1375
- // src/editor/provider.tsx
1247
+ // src/editor/components/ui/select.tsx
1376
1248
  var import_react9 = require("react");
1377
-
1378
- // src/blocks/button.tsx
1379
- var import_lucide_react7 = require("lucide-react");
1380
- var import_jsx_runtime15 = require("react/jsx-runtime");
1381
- var button = {
1382
- title: "Button",
1383
- description: "Add a call to action button to email.",
1384
- searchTerms: ["link", "button", "cta"],
1385
- icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react7.MousePointer, { className: "mly-h-4 mly-w-4" }),
1386
- command: ({ editor, range }) => {
1387
- editor.chain().focus().deleteRange(range).setButton().run();
1388
- }
1389
- };
1390
- var linkCard = {
1391
- title: "Link Card",
1392
- description: "Add a link card to email.",
1393
- searchTerms: ["link", "button", "image"],
1394
- icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react7.ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
1395
- command: ({ editor, range }) => {
1396
- editor.chain().focus().deleteRange(range).setLinkCard().run();
1249
+ var import_lucide_react10 = require("lucide-react");
1250
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1251
+ function Select(props) {
1252
+ const {
1253
+ label,
1254
+ options,
1255
+ value,
1256
+ onValueChange,
1257
+ tooltip,
1258
+ className,
1259
+ icon: Icon,
1260
+ iconClassName
1261
+ } = props;
1262
+ const selectId = `mly${(0, import_react9.useId)()}`;
1263
+ const content = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative", children: [
1264
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: selectId, className: "sr-only", children: label }),
1265
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-left-2 mly-z-20 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { className: cn("mly-size-3", iconClassName) }) }),
1266
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1267
+ "select",
1268
+ {
1269
+ id: selectId,
1270
+ className: cn(
1271
+ "mly-flex mly-min-h-7 mly-max-w-max mly-appearance-none mly-items-center mly-rounded-md mly-px-1.5 mly-py-0.5 mly-pr-7 mly-text-sm mly-text-midnight-gray mly-ring-offset-white mly-transition-colors hover:mly-bg-soft-gray focus-visible:mly-relative focus-visible:mly-z-10 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 active:mly-bg-soft-gray",
1272
+ !!Icon && "mly-pl-7",
1273
+ className
1274
+ ),
1275
+ value,
1276
+ onChange: (event) => onValueChange(event.target.value),
1277
+ children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: option.value, children: option.label }, option.value))
1278
+ }
1279
+ ),
1280
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-7 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1281
+ import_lucide_react10.ChevronDownIcon,
1282
+ {
1283
+ size: 16,
1284
+ strokeWidth: 2,
1285
+ "aria-hidden": "true",
1286
+ role: "img"
1287
+ }
1288
+ ) })
1289
+ ] });
1290
+ if (!tooltip) {
1291
+ return content;
1397
1292
  }
1398
- };
1293
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Tooltip, { children: [
1294
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipTrigger, { asChild: true, children: content }),
1295
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
1296
+ ] });
1297
+ }
1399
1298
 
1400
- // src/blocks/image.tsx
1401
- var import_lucide_react8 = require("lucide-react");
1402
- var import_jsx_runtime16 = require("react/jsx-runtime");
1403
- var image = {
1404
- title: "Image",
1405
- description: "Full width image",
1406
- searchTerms: ["image"],
1407
- icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.ImageIcon, { className: "mly-h-4 mly-w-4" }),
1408
- command: ({ editor, range }) => {
1409
- editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
1410
- }
1411
- };
1412
- var logo = {
1413
- title: "Logo",
1414
- description: "Add your brand logo",
1415
- searchTerms: ["image", "logo"],
1416
- icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.ImageIcon, { className: "mly-h-4 mly-w-4" }),
1417
- command: ({ editor, range }) => {
1418
- editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
1299
+ // src/editor/components/column-menu/columns-bubble-menu-content.tsx
1300
+ var import_lucide_react11 = require("lucide-react");
1301
+
1302
+ // src/editor/utils/delete-node.ts
1303
+ var import_core4 = require("@tiptap/core");
1304
+ function deleteNode(editor, nodeType) {
1305
+ const { state } = editor.view;
1306
+ const associatedNode = (0, import_core4.findParentNode)((node) => node.type.name === nodeType)(
1307
+ state.selection
1308
+ );
1309
+ if (!associatedNode) {
1310
+ return;
1419
1311
  }
1420
- };
1312
+ const from = associatedNode.pos;
1313
+ const to = from + associatedNode.node.nodeSize;
1314
+ const { tr } = state;
1315
+ const transaction = tr.delete(from, to);
1316
+ editor.view.dispatch(transaction);
1317
+ }
1421
1318
 
1422
- // src/blocks/layout.tsx
1423
- var import_lucide_react9 = require("lucide-react");
1319
+ // src/editor/components/column-menu/columns-bubble-menu-content.tsx
1424
1320
  var import_jsx_runtime17 = require("react/jsx-runtime");
1425
- var columns = {
1426
- title: "Columns",
1427
- description: "Add columns to email.",
1428
- searchTerms: ["layout", "columns"],
1429
- icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
1430
- shouldBeHidden: (editor) => {
1431
- return editor.isActive("columns");
1432
- },
1433
- command: ({ editor, range }) => {
1434
- editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
1435
- }
1436
- };
1437
- var section = {
1438
- title: "Section",
1439
- description: "Add a section to email.",
1440
- searchTerms: ["layout", "section"],
1441
- icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
1442
- command: ({ editor, range }) => {
1443
- editor.chain().focus().deleteRange(range).setSection().run();
1444
- }
1445
- };
1446
- var forLoop = {
1447
- title: "For",
1448
- description: "Loop over an array of items.",
1449
- searchTerms: ["for", "loop"],
1450
- icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Repeat2, { className: "mly-h-4 mly-w-4" }),
1451
- shouldBeHidden: (editor) => {
1452
- return editor.isActive("for");
1453
- },
1454
- command: ({ editor, range }) => {
1455
- editor.chain().focus().deleteRange(range).setFor().run();
1456
- }
1457
- };
1458
- var spacer = {
1459
- title: "Spacer",
1460
- description: "Add space between blocks.",
1461
- searchTerms: ["space", "gap", "divider"],
1462
- icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.MoveVertical, { className: "mly-h-4 mly-w-4" }),
1463
- command: ({ editor, range }) => {
1464
- editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
1465
- }
1466
- };
1467
- var divider = {
1468
- title: "Divider",
1469
- description: "Add a horizontal divider.",
1470
- searchTerms: ["divider", "line"],
1471
- icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Minus, { className: "mly-h-4 mly-w-4" }),
1472
- command: ({ editor, range }) => {
1473
- editor.chain().focus().deleteRange(range).setHorizontalRule().run();
1321
+ function ColumnsBubbleMenuContent(props) {
1322
+ const { editor } = props;
1323
+ if (!editor) {
1324
+ return null;
1474
1325
  }
1475
- };
1326
+ const state = useColumnsState(editor);
1327
+ const currentColumnCount = state.columnsCount;
1328
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mly-flex mly-items-stretch", children: [
1329
+ state.isColumnActive && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
1330
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1331
+ ColumnsWidthConfig,
1332
+ {
1333
+ columnsCount: currentColumnCount,
1334
+ columnWidths: state.columnWidths,
1335
+ onColumnsCountChange: (count) => {
1336
+ if (count > currentColumnCount) {
1337
+ addColumnByIndex(editor);
1338
+ } else {
1339
+ removeColumnByIndex(editor);
1340
+ }
1341
+ },
1342
+ onColumnWidthChange: (index, width) => {
1343
+ updateColumnWidth(editor, index, width);
1344
+ }
1345
+ }
1346
+ ),
1347
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Divider, {})
1348
+ ] }),
1349
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1350
+ VerticalAlignmentSwitch,
1351
+ {
1352
+ alignment: state.currentVerticalAlignment,
1353
+ onAlignmentChange: (value) => {
1354
+ editor.commands.updateColumn({
1355
+ verticalAlign: value
1356
+ });
1357
+ }
1358
+ }
1359
+ ),
1360
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Divider, {}),
1361
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1362
+ Select,
1363
+ {
1364
+ icon: import_lucide_react11.Space,
1365
+ label: "Columns Gap",
1366
+ value: state.currentColumnsGap,
1367
+ options: [
1368
+ { value: "0", label: "None" },
1369
+ { value: "4", label: "Small" },
1370
+ { value: "8", label: "Medium" },
1371
+ { value: "16", label: "Large" },
1372
+ { value: "24", label: "Extra Large" }
1373
+ ],
1374
+ onValueChange: (value) => {
1375
+ editor.commands.updateColumns({
1376
+ gap: +value
1377
+ });
1378
+ },
1379
+ tooltip: "Columns Gap"
1380
+ }
1381
+ ),
1382
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Divider, {}),
1383
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1384
+ BubbleMenuButton,
1385
+ {
1386
+ icon: import_lucide_react11.Trash,
1387
+ tooltip: "Delete Columns",
1388
+ command: () => {
1389
+ deleteNode(editor, "columns");
1390
+ }
1391
+ }
1392
+ ),
1393
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Divider, {}),
1394
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1395
+ ShowPopover,
1396
+ {
1397
+ showIfKey: state.currentShowIfKey,
1398
+ onShowIfKeyValueChange: (value) => {
1399
+ editor.commands.updateColumns({
1400
+ showIfKey: value
1401
+ });
1402
+ },
1403
+ editor
1404
+ }
1405
+ )
1406
+ ] }) });
1407
+ }
1476
1408
 
1477
- // src/blocks/list.tsx
1478
- var import_lucide_react10 = require("lucide-react");
1409
+ // src/editor/components/column-menu/columns-bubble-menu.tsx
1479
1410
  var import_jsx_runtime18 = require("react/jsx-runtime");
1480
- var bulletList = {
1481
- title: "Bullet List",
1482
- description: "Create a simple bullet list.",
1483
- searchTerms: ["unordered", "point"],
1484
- icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.List, { className: "mly-h-4 mly-w-4" }),
1485
- command: ({ editor, range }) => {
1486
- editor.chain().focus().deleteRange(range).toggleBulletList().run();
1487
- }
1488
- };
1489
- var orderedList = {
1490
- title: "Numbered List",
1491
- description: "Create a list with numbering.",
1492
- searchTerms: ["ordered"],
1493
- icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.ListOrdered, { className: "mly-h-4 mly-w-4" }),
1494
- command: ({ editor, range }) => {
1495
- editor.chain().focus().deleteRange(range).toggleOrderedList().run();
1411
+ function ColumnsBubbleMenu(props) {
1412
+ const { appendTo, editor } = props;
1413
+ if (!editor) {
1414
+ return null;
1496
1415
  }
1497
- };
1416
+ const getReferenceClientRect = (0, import_react11.useCallback)(() => {
1417
+ const renderContainer = getRenderContainer(editor, "columns");
1418
+ const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
1419
+ return rect;
1420
+ }, [editor]);
1421
+ const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
1422
+ shouldShow: ({ editor: editor2 }) => {
1423
+ if (isTextSelected(editor2) || editor2.isActive("section") || editor2.isActive("for")) {
1424
+ return false;
1425
+ }
1426
+ return editor2.isActive("columns");
1427
+ },
1428
+ tippyOptions: {
1429
+ offset: [0, 8],
1430
+ popperOptions: {
1431
+ modifiers: [{ name: "flip", enabled: false }]
1432
+ },
1433
+ getReferenceClientRect,
1434
+ appendTo: () => appendTo == null ? void 0 : appendTo.current,
1435
+ plugins: [import_tippy.sticky],
1436
+ sticky: "popper",
1437
+ maxWidth: "auto"
1438
+ },
1439
+ pluginKey: "columnsBubbleMenu"
1440
+ });
1441
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1442
+ import_react10.BubbleMenu,
1443
+ __spreadProps(__spreadValues({}, bubbleMenuProps), {
1444
+ className: "mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
1445
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ColumnsBubbleMenuContent, { editor })
1446
+ })
1447
+ );
1448
+ }
1498
1449
 
1499
- // src/blocks/typography.tsx
1500
- var import_lucide_react11 = require("lucide-react");
1501
- var import_jsx_runtime19 = require("react/jsx-runtime");
1502
- var text = {
1503
- title: "Text",
1504
- description: "Just start typing with plain text.",
1505
- searchTerms: ["p", "paragraph"],
1506
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.Text, { className: "mly-h-4 mly-w-4" }),
1507
- command: ({ editor, range }) => {
1508
- editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
1509
- }
1510
- };
1511
- var heading1 = {
1512
- title: "Heading 1",
1513
- description: "Big heading.",
1514
- searchTerms: ["title", "big", "large"],
1515
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.Heading1, { className: "mly-h-4 mly-w-4" }),
1516
- command: ({ editor, range }) => {
1517
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
1518
- }
1519
- };
1520
- var heading2 = {
1521
- title: "Heading 2",
1522
- description: "Medium heading.",
1523
- searchTerms: ["subtitle", "medium"],
1524
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.Heading2, { className: "mly-h-4 mly-w-4" }),
1525
- command: ({ editor, range }) => {
1526
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
1527
- }
1528
- };
1529
- var heading3 = {
1530
- title: "Heading 3",
1531
- description: "Small heading.",
1532
- searchTerms: ["subtitle", "small"],
1533
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.Heading3, { className: "mly-h-4 mly-w-4" }),
1534
- command: ({ editor, range }) => {
1535
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
1536
- }
1537
- };
1538
- var hardBreak = {
1539
- title: "Hard Break",
1540
- description: "Add a break between lines.",
1541
- searchTerms: ["break", "line"],
1542
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.DivideIcon, { className: "mly-h-4 mly-w-4" }),
1543
- command: ({ editor, range }) => {
1544
- editor.chain().focus().deleteRange(range).setHardBreak().run();
1545
- }
1546
- };
1547
- var blockquote = {
1548
- title: "Blockquote",
1549
- description: "Add blockquote.",
1550
- searchTerms: ["quote", "blockquote"],
1551
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.TextQuote, { className: "mly-h-4 mly-w-4" }),
1552
- command: ({ editor, range }) => {
1553
- editor.chain().focus().deleteRange(range).toggleBlockquote().run();
1554
- }
1555
- };
1556
- var footer = {
1557
- title: "Footer",
1558
- description: "Add a footer text to email.",
1559
- searchTerms: ["footer", "text"],
1560
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
1561
- command: ({ editor, range }) => {
1562
- editor.chain().focus().deleteRange(range).setFooter().run();
1563
- }
1564
- };
1565
- var clearLine = {
1566
- title: "Clear Line",
1567
- description: "Clear the current line.",
1568
- searchTerms: ["clear", "line"],
1569
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.EraserIcon, { className: "mly-h-4 mly-w-4" }),
1570
- command: ({ editor, range }) => {
1571
- editor.chain().focus().selectParentNode().deleteSelection().run();
1572
- }
1573
- };
1450
+ // src/editor/components/content-menu.tsx
1451
+ var import_react13 = require("react");
1452
+ var import_lucide_react12 = require("lucide-react");
1574
1453
 
1575
- // src/editor/extensions/slash-command/default-slash-commands.ts
1576
- var DEFAULT_SLASH_COMMANDS = [
1577
- text,
1578
- heading1,
1579
- heading2,
1580
- heading3,
1581
- bulletList,
1582
- orderedList,
1583
- image,
1584
- logo,
1585
- columns,
1586
- section,
1587
- forLoop,
1588
- divider,
1589
- spacer,
1590
- button,
1591
- linkCard,
1592
- hardBreak,
1593
- blockquote,
1594
- footer,
1595
- clearLine
1596
- ];
1454
+ // src/editor/components/drag-handle.tsx
1455
+ var import_react12 = require("react");
1456
+ var import_echo_drag_handle_plugin = require("echo-drag-handle-plugin");
1457
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1458
+ function DragHandle(props) {
1459
+ const {
1460
+ className = "drag-handle",
1461
+ children,
1462
+ editor,
1463
+ pluginKey = import_echo_drag_handle_plugin.dragHandlePluginDefaultKey,
1464
+ onNodeChange,
1465
+ tippyOptions = {}
1466
+ } = props;
1467
+ const [element, setElement] = (0, import_react12.useState)(null);
1468
+ const pluginRef = (0, import_react12.useRef)(null);
1469
+ (0, import_react12.useEffect)(() => {
1470
+ if (!element) {
1471
+ return () => {
1472
+ pluginRef.current = null;
1473
+ };
1474
+ }
1475
+ if (editor.isDestroyed) {
1476
+ return () => {
1477
+ pluginRef.current = null;
1478
+ };
1479
+ }
1480
+ if (!pluginRef.current) {
1481
+ pluginRef.current = (0, import_echo_drag_handle_plugin.DragHandlePlugin)({
1482
+ editor,
1483
+ element,
1484
+ pluginKey,
1485
+ tippyOptions,
1486
+ onNodeChange
1487
+ });
1488
+ editor.registerPlugin(pluginRef.current);
1489
+ }
1490
+ return () => {
1491
+ editor.unregisterPlugin(pluginKey);
1492
+ pluginRef.current = null;
1493
+ };
1494
+ }, [element, editor, onNodeChange, pluginKey]);
1495
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className, ref: setElement, children });
1496
+ }
1597
1497
 
1598
- // src/editor/provider.tsx
1498
+ // src/editor/components/content-menu.tsx
1599
1499
  var import_jsx_runtime20 = require("react/jsx-runtime");
1600
- var DEFAULT_TRIGGER_SUGGESTION_CHAR = "@";
1601
- var MailyContext = (0, import_react9.createContext)({
1602
- triggerSuggestionCharacter: DEFAULT_TRIGGER_SUGGESTION_CHAR,
1603
- variables: [],
1604
- blocks: DEFAULT_SLASH_COMMANDS
1605
- });
1606
- function MailyProvider(props) {
1607
- const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
1608
- if (defaultValues.triggerSuggestionCharacter === "") {
1609
- throw new Error("triggerSuggestionCharacter cannot be an empty string");
1500
+ function ContentMenu(props) {
1501
+ const { editor } = props;
1502
+ const [menuOpen, setMenuOpen] = (0, import_react13.useState)(false);
1503
+ const [currentNode, setCurrentNode] = (0, import_react13.useState)(null);
1504
+ const [currentNodePos, setCurrentNodePos] = (0, import_react13.useState)(-1);
1505
+ const handleNodeChange = (0, import_react13.useCallback)(
1506
+ (data) => {
1507
+ if (data.node) {
1508
+ setCurrentNode(data.node);
1509
+ }
1510
+ setCurrentNodePos(data.pos);
1511
+ },
1512
+ [setCurrentNodePos, setCurrentNode]
1513
+ );
1514
+ function duplicateNode() {
1515
+ editor.commands.setNodeSelection(currentNodePos);
1516
+ const { $anchor } = editor.state.selection;
1517
+ const selectedNode = $anchor.node(1) || editor.state.selection.node;
1518
+ editor.chain().setMeta("hideDragHandle", true).insertContentAt(
1519
+ currentNodePos + ((currentNode == null ? void 0 : currentNode.nodeSize) || 0),
1520
+ selectedNode.toJSON()
1521
+ ).run();
1522
+ setMenuOpen(false);
1610
1523
  }
1611
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MailyContext.Provider, { value: defaultValues, children });
1612
- }
1613
- function useMailyContext() {
1614
- const values = (0, import_react9.useContext)(MailyContext);
1615
- if (!values) {
1616
- throw new Error("Missing MailyContext.Provider in the component tree");
1524
+ function deleteCurrentNode() {
1525
+ editor.chain().setMeta("hideDragHandle", true).setNodeSelection(currentNodePos).deleteSelection().run();
1526
+ setMenuOpen(false);
1617
1527
  }
1618
- return values;
1528
+ function handleAddNewNode() {
1529
+ var _a;
1530
+ if (currentNodePos !== -1) {
1531
+ const currentNodeSize = (currentNode == null ? void 0 : currentNode.nodeSize) || 0;
1532
+ const insertPos = currentNodePos + currentNodeSize;
1533
+ const currentNodeIsEmptyParagraph = (currentNode == null ? void 0 : currentNode.type.name) === "paragraph" && ((_a = currentNode == null ? void 0 : currentNode.content) == null ? void 0 : _a.size) === 0;
1534
+ const focusPos = currentNodeIsEmptyParagraph ? currentNodePos + 2 : insertPos + 2;
1535
+ editor.chain().command(({ dispatch, tr, state }) => {
1536
+ if (dispatch) {
1537
+ if (currentNodeIsEmptyParagraph) {
1538
+ tr.insertText("/", currentNodePos, currentNodePos + 1);
1539
+ } else {
1540
+ tr.insert(
1541
+ insertPos,
1542
+ state.schema.nodes.paragraph.create(null, [
1543
+ state.schema.text("/")
1544
+ ])
1545
+ );
1546
+ }
1547
+ return dispatch(tr);
1548
+ }
1549
+ return true;
1550
+ }).focus(focusPos).run();
1551
+ }
1552
+ }
1553
+ (0, import_react13.useEffect)(() => {
1554
+ if (menuOpen) {
1555
+ editor.commands.setMeta("lockDragHandle", true);
1556
+ } else {
1557
+ editor.commands.setMeta("lockDragHandle", false);
1558
+ }
1559
+ return () => {
1560
+ editor.commands.setMeta("lockDragHandle", false);
1561
+ };
1562
+ }, [editor, menuOpen]);
1563
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1564
+ DragHandle,
1565
+ {
1566
+ pluginKey: "ContentMenu",
1567
+ editor,
1568
+ tippyOptions: {
1569
+ offset: [2, 0],
1570
+ zIndex: 99
1571
+ },
1572
+ onNodeChange: handleNodeChange,
1573
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mly-flex mly-items-center mly-pr-1.5", children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
1575
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1576
+ BaseButton,
1577
+ {
1578
+ variant: "ghost",
1579
+ size: "icon",
1580
+ className: "!mly-size-5 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
1581
+ onClick: handleAddNewNode,
1582
+ type: "button",
1583
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Plus, { className: "mly-size-3.5 mly-shrink-0" })
1584
+ }
1585
+ ) }),
1586
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { sideOffset: 8, children: "Add new node" })
1587
+ ] }),
1588
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Popover, { open: menuOpen, onOpenChange: setMenuOpen, children: [
1589
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mly-relative mly-flex mly-flex-col", children: [
1590
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
1591
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1592
+ BaseButton,
1593
+ {
1594
+ variant: "ghost",
1595
+ size: "icon",
1596
+ className: "mly-relative mly-z-[1] !mly-size-5 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
1597
+ onClick: (e) => {
1598
+ e.preventDefault();
1599
+ setMenuOpen(true);
1600
+ editor.commands.setNodeSelection(currentNodePos);
1601
+ },
1602
+ type: "button",
1603
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.GripVertical, { className: "mly-size-3.5 mly-shrink-0" })
1604
+ }
1605
+ ) }),
1606
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { sideOffset: 8, children: "Node actions" })
1607
+ ] }),
1608
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PopoverTrigger, { className: "mly-absolute mly-left-0 mly-top-0 mly-z-0 mly-h-5 mly-w-5" })
1609
+ ] }),
1610
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1611
+ PopoverContent,
1612
+ {
1613
+ align: "start",
1614
+ side: "bottom",
1615
+ sideOffset: 8,
1616
+ className: "mly-flex mly-w-max mly-flex-col mly-rounded-md mly-p-1",
1617
+ children: [
1618
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1619
+ BaseButton,
1620
+ {
1621
+ variant: "ghost",
1622
+ onClick: duplicateNode,
1623
+ className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-px-2 mly-py-1 mly-text-sm mly-font-normal",
1624
+ children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Copy, { className: "mly-size-[15px] mly-shrink-0" }),
1626
+ "Duplicate"
1627
+ ]
1628
+ }
1629
+ ),
1630
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Divider, { type: "horizontal" }),
1631
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1632
+ BaseButton,
1633
+ {
1634
+ onClick: deleteCurrentNode,
1635
+ className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-bg-red-100 mly-px-2 mly-py-1 mly-text-sm mly-font-normal mly-text-red-600 hover:mly-bg-red-200 focus:mly-bg-red-200",
1636
+ children: [
1637
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Trash2, { className: "mly-size-[15px] mly-shrink-0" }),
1638
+ "Delete"
1639
+ ]
1640
+ }
1641
+ )
1642
+ ]
1643
+ }
1644
+ )
1645
+ ] })
1646
+ ] }) })
1647
+ }
1648
+ );
1619
1649
  }
1620
1650
 
1621
- // src/editor/components/for-menu/for-bubble-menu.tsx
1622
- var import_react12 = require("@tiptap/react");
1651
+ // src/editor/components/editor-menu-bar.tsx
1652
+ var import_react14 = require("react");
1623
1653
  var import_lucide_react13 = require("lucide-react");
1624
- var import_react13 = require("react");
1625
- var import_tippy2 = require("tippy.js");
1626
-
1627
- // src/editor/components/ui/input-autocomplete.tsx
1628
- var import_lucide_react12 = require("lucide-react");
1629
- var import_react10 = require("react");
1630
1654
  var import_jsx_runtime21 = require("react/jsx-runtime");
1631
- function InputAutocomplete(props) {
1632
- const _a = props, {
1633
- value = "",
1634
- onValueChange,
1635
- className,
1636
- onBlur: onInputBlur,
1637
- onSelectOption,
1638
- autoCompleteOptions = []
1639
- } = _a, inputProps = __objRest(_a, [
1640
- "value",
1641
- "onValueChange",
1642
- "className",
1643
- "onBlur",
1644
- "onSelectOption",
1645
- "autoCompleteOptions"
1646
- ]);
1647
- const [selectedIndex, setSelectedIndex] = (0, import_react10.useState)(0);
1648
- const inputRef = (0, import_react10.useRef)(null);
1649
- const filteredAutoCompleteOptions = (0, import_react10.useMemo)(() => {
1650
- const filteredOptions = autoCompleteOptions.filter((option) => option.toLowerCase().startsWith(value.toLowerCase())).slice(0, 4);
1651
- if (value.length > 0 && !filteredOptions.includes(value)) {
1652
- filteredOptions.push(value);
1653
- }
1654
- return filteredOptions;
1655
- }, [autoCompleteOptions, value]);
1656
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("mly-relative", className), children: [
1657
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "mly-relative", children: [
1658
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1659
- "input",
1660
- __spreadProps(__spreadValues({}, inputProps), {
1661
- value,
1662
- onChange: (e) => {
1663
- setSelectedIndex(0);
1664
- onValueChange(e.target.value);
1665
- },
1666
- onBlur: onInputBlur,
1667
- ref: inputRef,
1668
- type: "text",
1669
- placeholder: "e.g. items",
1670
- className: "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
1671
- onKeyDown: (e) => {
1672
- var _a2;
1673
- if (e.key === "ArrowDown") {
1674
- e.preventDefault();
1675
- setSelectedIndex(
1676
- (prev) => Math.min(prev + 1, filteredAutoCompleteOptions.length - 1)
1677
- );
1678
- } else if (e.key === "ArrowUp") {
1679
- e.preventDefault();
1680
- setSelectedIndex((prev) => Math.max(prev - 1, 0));
1681
- } else if (e.key === "Enter") {
1682
- e.preventDefault();
1683
- const _value = filteredAutoCompleteOptions[selectedIndex];
1684
- onValueChange(_value);
1685
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
1686
- onSelectOption == null ? void 0 : onSelectOption(_value);
1687
- }
1688
- }
1689
- })
1690
- ),
1691
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react12.CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
1692
- ] }),
1693
- filteredAutoCompleteOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "mly-absolute mly-left-0 mly-top-8 mly-z-10 mly-w-full mly-rounded-lg mly-bg-white mly-p-0.5 mly-shadow-md", children: filteredAutoCompleteOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1694
- "button",
1655
+ var EditorMenuBar = (props) => {
1656
+ const { editor, config } = props;
1657
+ const items = (0, import_react14.useMemo)(
1658
+ () => [
1695
1659
  {
1696
- type: "button",
1697
- className: "mly-w-full mly-truncate mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none aria-selected:mly-bg-soft-gray",
1698
- onClick: () => {
1699
- var _a2;
1700
- onValueChange(option);
1701
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
1702
- onSelectOption == null ? void 0 : onSelectOption(option);
1660
+ name: "bold",
1661
+ command: () => editor.chain().focus().toggleBold().run(),
1662
+ isActive: () => editor.isActive("bold"),
1663
+ group: "mark",
1664
+ icon: import_lucide_react13.BoldIcon
1665
+ },
1666
+ {
1667
+ name: "italic",
1668
+ command: () => editor.chain().focus().toggleItalic().run(),
1669
+ isActive: () => editor.isActive("italic"),
1670
+ group: "mark",
1671
+ icon: import_lucide_react13.ItalicIcon
1672
+ },
1673
+ {
1674
+ name: "underline",
1675
+ command: () => editor.chain().focus().toggleUnderline().run(),
1676
+ isActive: () => editor.isActive("underline"),
1677
+ group: "mark",
1678
+ icon: import_lucide_react13.UnderlineIcon
1679
+ },
1680
+ {
1681
+ name: "strike",
1682
+ command: () => editor.chain().focus().toggleStrike().run(),
1683
+ isActive: () => editor.isActive("strike"),
1684
+ group: "mark",
1685
+ icon: import_lucide_react13.StrikethroughIcon
1686
+ },
1687
+ {
1688
+ name: "delete-line",
1689
+ command: () => editor.chain().focus().selectParentNode().deleteSelection().run(),
1690
+ isActive: () => false,
1691
+ group: "mark",
1692
+ icon: import_lucide_react13.EraserIcon
1693
+ },
1694
+ {
1695
+ name: "divider",
1696
+ command: () => editor.chain().focus().setHorizontalRule().run(),
1697
+ isActive: () => editor.isActive("horizontalRule"),
1698
+ group: "custom",
1699
+ icon: import_lucide_react13.SeparatorHorizontal
1700
+ },
1701
+ {
1702
+ name: "link",
1703
+ command: () => {
1704
+ const previousUrl = editor.getAttributes("link").href;
1705
+ const url = window.prompt("URL", previousUrl);
1706
+ if (url === null) return;
1707
+ if (url === "") {
1708
+ editor.chain().focus().extendMarkRange("link").unsetLink().run();
1709
+ return;
1710
+ }
1711
+ editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
1703
1712
  },
1704
- onMouseEnter: () => setSelectedIndex(index),
1705
- "aria-selected": selectedIndex === index,
1706
- children: option
1713
+ isActive: () => editor.isActive("link"),
1714
+ group: "custom",
1715
+ icon: import_lucide_react13.LinkIcon
1707
1716
  },
1708
- option
1709
- )) })
1710
- ] });
1711
- }
1717
+ {
1718
+ name: "left",
1719
+ command: () => editor.chain().focus().setTextAlign("left").run(),
1720
+ isActive: () => editor.isActive({ textAlign: "left" }),
1721
+ group: "alignment",
1722
+ icon: import_lucide_react13.AlignLeft
1723
+ },
1724
+ {
1725
+ name: "center",
1726
+ command: () => editor.chain().focus().setTextAlign("center").run(),
1727
+ isActive: () => editor.isActive({ textAlign: "center" }),
1728
+ group: "alignment",
1729
+ icon: import_lucide_react13.AlignCenter
1730
+ },
1731
+ {
1732
+ name: "right",
1733
+ command: () => editor.chain().focus().setTextAlign("right").run(),
1734
+ isActive: () => editor.isActive({ textAlign: "right" }),
1735
+ group: "alignment",
1736
+ icon: import_lucide_react13.AlignRight
1737
+ }
1738
+ ],
1739
+ [editor]
1740
+ );
1741
+ const groups = (0, import_react14.useMemo)(
1742
+ () => items.reduce((acc, item) => {
1743
+ if (!acc.includes(item.group)) {
1744
+ acc.push(item.group);
1745
+ }
1746
+ return acc;
1747
+ }, []),
1748
+ [items]
1749
+ );
1750
+ if (!editor) {
1751
+ return null;
1752
+ }
1753
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1754
+ "div",
1755
+ {
1756
+ className: `mly-flex mly-items-center mly-gap-3 ${config == null ? void 0 : config.toolbarClassName}`,
1757
+ children: groups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1758
+ "div",
1759
+ {
1760
+ className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",
1761
+ children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(BubbleMenuButton, __spreadValues({}, item), index2))
1762
+ },
1763
+ index
1764
+ ))
1765
+ }
1766
+ );
1767
+ };
1768
+
1769
+ // src/editor/components/for-menu/for-bubble-menu.tsx
1770
+ var import_react16 = require("@tiptap/react");
1771
+ var import_lucide_react14 = require("lucide-react");
1772
+ var import_react17 = require("react");
1773
+ var import_tippy2 = require("tippy.js");
1712
1774
 
1713
1775
  // src/editor/components/for-menu/use-for-state.ts
1714
- var import_react11 = require("@tiptap/react");
1776
+ var import_react15 = require("@tiptap/react");
1715
1777
  var import_fast_deep_equal2 = __toESM(require("fast-deep-equal"));
1716
1778
  var useForState = (editor) => {
1717
- const states = (0, import_react11.useEditorState)({
1779
+ const states = (0, import_react15.useEditorState)({
1718
1780
  editor,
1719
1781
  selector: (ctx) => {
1720
1782
  var _a, _b;
@@ -1737,14 +1799,20 @@ function ForBubbleMenu(props) {
1737
1799
  return null;
1738
1800
  }
1739
1801
  const state = useForState(editor);
1740
- const getReferenceClientRect = (0, import_react13.useCallback)(() => {
1802
+ const getReferenceClientRect = (0, import_react17.useCallback)(() => {
1741
1803
  const renderContainer = getRenderContainer(editor, "for");
1742
1804
  const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
1743
1805
  return rect;
1744
1806
  }, [editor]);
1745
1807
  const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
1746
1808
  shouldShow: ({ editor: editor2 }) => {
1747
- if (isTextSelected(editor2)) {
1809
+ var _a;
1810
+ const activeForNode = getClosestNodeByName(editor2, "for");
1811
+ const sectionNodeChildren = activeForNode ? (_a = (0, import_react16.findChildren)(activeForNode == null ? void 0 : activeForNode.node, (node) => {
1812
+ return node.type.name === "section";
1813
+ })) == null ? void 0 : _a[0] : null;
1814
+ const hasActiveSectionNodeChildren = sectionNodeChildren && editor2.isActive("section");
1815
+ if (isTextSelected(editor2) || hasActiveSectionNodeChildren) {
1748
1816
  return false;
1749
1817
  }
1750
1818
  return editor2.isActive("for");
@@ -1763,14 +1831,19 @@ function ForBubbleMenu(props) {
1763
1831
  pluginKey: "forBubbleMenu"
1764
1832
  });
1765
1833
  const { variables = [] } = useMailyContext();
1766
- const inputRef = (0, import_react13.useRef)(null);
1767
- const [isUpdatingKey, setIsUpdatingKey] = (0, import_react13.useState)(false);
1768
- const isValidEachKey = (state == null ? void 0 : state.each) !== void 0 && (state == null ? void 0 : state.each) !== "";
1769
- const autoCompleteOptions = (0, import_react13.useMemo)(() => {
1770
- return variables == null ? void 0 : variables.filter((variable) => variable.iterable).map((variable) => variable.name);
1771
- }, [variables]);
1834
+ const inputRef = (0, import_react17.useRef)(null);
1835
+ const [isUpdatingKey, setIsUpdatingKey] = (0, import_react17.useState)(false);
1836
+ const eachKey = (state == null ? void 0 : state.each) || "";
1837
+ const autoCompleteOptions = (0, import_react17.useMemo)(() => {
1838
+ return processVariables(variables, {
1839
+ query: eachKey || "",
1840
+ editor,
1841
+ from: "for"
1842
+ }).map((variable) => variable.name).slice(0, 5);
1843
+ }, [variables, eachKey, editor]);
1844
+ const isValidEachKey = eachKey || autoCompleteOptions.includes(eachKey);
1772
1845
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1773
- import_react12.BubbleMenu,
1846
+ import_react16.BubbleMenu,
1774
1847
  __spreadProps(__spreadValues({}, bubbleMenuProps), {
1775
1848
  className: "mly-flex mly-items-stretch mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
1776
1849
  children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(TooltipProvider, { children: [
@@ -1779,7 +1852,7 @@ function ForBubbleMenu(props) {
1779
1852
  "button",
1780
1853
  {
1781
1854
  className: cn(
1782
- "mly-flex mly-h-7 mly-min-w-28 mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-px-2 mly-font-mono mly-text-sm hover:mly-bg-soft-gray",
1855
+ "mly-inline-grid mly-h-7 mly-min-w-28 mly-max-w-xs mly-grid-cols-[12px_1fr] mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-px-2 mly-font-mono mly-text-sm hover:mly-bg-soft-gray",
1783
1856
  !isValidEachKey && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
1784
1857
  ),
1785
1858
  onClick: () => {
@@ -1790,8 +1863,8 @@ function ForBubbleMenu(props) {
1790
1863
  }, 0);
1791
1864
  },
1792
1865
  children: [
1793
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react13.Braces, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
1794
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: state == null ? void 0 : state.each })
1866
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
1867
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: state == null ? void 0 : state.each })
1795
1868
  ]
1796
1869
  }
1797
1870
  ),
@@ -1816,13 +1889,14 @@ function ForBubbleMenu(props) {
1816
1889
  each: value
1817
1890
  });
1818
1891
  },
1819
- onBlur: () => {
1892
+ onOutsideClick: () => {
1820
1893
  setIsUpdatingKey(false);
1821
1894
  },
1822
1895
  onSelectOption: () => {
1823
1896
  setIsUpdatingKey(false);
1824
1897
  },
1825
- autoCompleteOptions
1898
+ autoCompleteOptions,
1899
+ ref: inputRef
1826
1900
  }
1827
1901
  )
1828
1902
  }
@@ -1836,7 +1910,8 @@ function ForBubbleMenu(props) {
1836
1910
  editor.commands.updateFor({
1837
1911
  showIfKey: value
1838
1912
  });
1839
- }
1913
+ },
1914
+ editor
1840
1915
  }
1841
1916
  )
1842
1917
  ] })
@@ -1845,31 +1920,31 @@ function ForBubbleMenu(props) {
1845
1920
  }
1846
1921
 
1847
1922
  // src/editor/components/image-menu/image-bubble-menu.tsx
1848
- var import_react23 = require("@tiptap/react");
1849
- var import_lucide_react17 = require("lucide-react");
1923
+ var import_react27 = require("@tiptap/react");
1924
+ var import_lucide_react18 = require("lucide-react");
1850
1925
 
1851
1926
  // src/editor/components/alignment-switch.tsx
1852
- var import_lucide_react14 = require("lucide-react");
1927
+ var import_lucide_react15 = require("lucide-react");
1853
1928
  var import_jsx_runtime23 = require("react/jsx-runtime");
1854
1929
  function AlignmentSwitch(props) {
1855
1930
  const { alignment = "left", onAlignmentChange } = props;
1856
1931
  const activeAlignment = {
1857
1932
  left: {
1858
- icon: import_lucide_react14.AlignLeft,
1933
+ icon: import_lucide_react15.AlignLeft,
1859
1934
  tooltip: "Align Left",
1860
1935
  onClick: () => {
1861
1936
  onAlignmentChange("center");
1862
1937
  }
1863
1938
  },
1864
1939
  center: {
1865
- icon: import_lucide_react14.AlignCenter,
1940
+ icon: import_lucide_react15.AlignCenter,
1866
1941
  tooltip: "Align Center",
1867
1942
  onClick: () => {
1868
1943
  onAlignmentChange("right");
1869
1944
  }
1870
1945
  },
1871
1946
  right: {
1872
- icon: import_lucide_react14.AlignRight,
1947
+ icon: import_lucide_react15.AlignRight,
1873
1948
  tooltip: "Align Right",
1874
1949
  onClick: () => {
1875
1950
  onAlignmentChange("left");
@@ -1887,18 +1962,20 @@ function AlignmentSwitch(props) {
1887
1962
  }
1888
1963
 
1889
1964
  // src/editor/components/ui/link-input-popover.tsx
1890
- var import_lucide_react15 = require("lucide-react");
1891
- var import_react14 = require("react");
1965
+ var import_lucide_react16 = require("lucide-react");
1966
+ var import_react18 = require("react");
1892
1967
  var import_jsx_runtime24 = require("react/jsx-runtime");
1893
1968
  function LinkInputPopover(props) {
1894
1969
  const {
1895
1970
  defaultValue = "",
1896
1971
  onValueChange,
1897
1972
  tooltip,
1898
- icon: Icon = import_lucide_react15.Link
1973
+ icon: Icon = import_lucide_react16.Link
1899
1974
  } = props;
1900
- const [isOpen, setIsOpen] = (0, import_react14.useState)(false);
1901
- const linkInputRef = (0, import_react14.useRef)(null);
1975
+ const [isOpen, setIsOpen] = (0, import_react18.useState)(false);
1976
+ const [protocol, setProtocol] = (0, import_react18.useState)("https://");
1977
+ const linkInputRef = (0, import_react18.useRef)(null);
1978
+ const defaultUrlWithoutProtocol = defaultValue.replace(/https?:\/\//, "");
1902
1979
  const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1903
1980
  BaseButton,
1904
1981
  {
@@ -1906,10 +1983,14 @@ function LinkInputPopover(props) {
1906
1983
  size: "sm",
1907
1984
  type: "button",
1908
1985
  className: "mly-size-7",
1909
- "data-state": !!defaultValue,
1986
+ "data-state": !!defaultUrlWithoutProtocol,
1910
1987
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
1911
1988
  }
1912
1989
  ) });
1990
+ const normalizeProtocol = (value, p = protocol) => {
1991
+ value = value.replace(/https?:\/\//, "");
1992
+ return p + value;
1993
+ };
1913
1994
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
1914
1995
  tooltip ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Tooltip, { children: [
1915
1996
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
@@ -1920,7 +2001,7 @@ function LinkInputPopover(props) {
1920
2001
  {
1921
2002
  align: "end",
1922
2003
  side: "top",
1923
- className: "mly-w-max mly-rounded-lg !mly-p-0.5",
2004
+ className: "mly-w-max mly-rounded-none mly-border-none mly-bg-transparent !mly-p-0 mly-shadow-none",
1924
2005
  sideOffset: 8,
1925
2006
  onCloseAutoFocus: (e) => e.preventDefault(),
1926
2007
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
@@ -1932,23 +2013,68 @@ function LinkInputPopover(props) {
1932
2013
  if (!input) {
1933
2014
  return;
1934
2015
  }
1935
- onValueChange == null ? void 0 : onValueChange(input.value);
2016
+ let value = normalizeProtocol(input.value);
2017
+ onValueChange == null ? void 0 : onValueChange(value);
1936
2018
  setIsOpen(false);
1937
2019
  },
1938
2020
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "relative", children: [
1939
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1940
- "input",
2021
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
2022
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mly-relative", children: [
2023
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2024
+ "select",
2025
+ {
2026
+ className: "hover:text-accent-foreground mly-peer mly-inline-flex mly-h-full mly-appearance-none mly-items-center mly-rounded-none mly-rounded-s-lg mly-border mly-border-gray-300 mly-bg-gray-50 mly-pe-8 mly-ps-3 mly-text-sm mly-text-gray-700 mly-transition-shadow hover:mly-bg-gray-100 focus:mly-z-10 focus-visible:mly-outline-none disabled:mly-pointer-events-none disabled:mly-cursor-not-allowed disabled:mly-opacity-50",
2027
+ "aria-label": "Protocol",
2028
+ value: protocol,
2029
+ onChange: (e) => {
2030
+ var _a;
2031
+ const protocol2 = e.target.value;
2032
+ setProtocol(protocol2);
2033
+ const newValue = normalizeProtocol(
2034
+ ((_a = linkInputRef.current) == null ? void 0 : _a.value) || "",
2035
+ protocol2
2036
+ );
2037
+ onValueChange == null ? void 0 : onValueChange(newValue);
2038
+ },
2039
+ children: [
2040
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "https://", children: "https://" }),
2041
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "http://", children: "http://" })
2042
+ ]
2043
+ }
2044
+ ),
2045
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-9 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2046
+ import_lucide_react16.ChevronDownIcon,
2047
+ {
2048
+ size: 16,
2049
+ strokeWidth: 2,
2050
+ "aria-hidden": "true",
2051
+ role: "img"
2052
+ }
2053
+ ) })
2054
+ ] }),
2055
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2056
+ "input",
2057
+ {
2058
+ value: defaultUrlWithoutProtocol,
2059
+ onChange: (e) => {
2060
+ let value = normalizeProtocol(e.target.value);
2061
+ onValueChange == null ? void 0 : onValueChange(value);
2062
+ },
2063
+ ref: linkInputRef,
2064
+ type: "text",
2065
+ className: "-mly-ms-px mly-block mly-h-8 mly-w-52 mly-rounded-lg mly-rounded-s-none mly-border mly-border-gray-300 mly-px-2 mly-py-1.5 mly-pr-6 mly-text-sm mly-shadow-sm mly-outline-none placeholder:mly-text-gray-400",
2066
+ placeholder: "maily.to/"
2067
+ }
2068
+ )
2069
+ ] }),
2070
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-1.5 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2071
+ import_lucide_react16.CornerDownLeft,
1941
2072
  {
1942
- value: defaultValue,
1943
- onChange: (e) => {
1944
- onValueChange == null ? void 0 : onValueChange(e.target.value);
1945
- },
1946
- ref: linkInputRef,
1947
- type: "url",
1948
- className: "mly-h-7 mly-w-52 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none"
2073
+ className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray",
2074
+ "aria-hidden": "true",
2075
+ role: "img"
1949
2076
  }
1950
- ),
1951
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react15.CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
2077
+ ) })
1952
2078
  ] })
1953
2079
  }
1954
2080
  )
@@ -1978,7 +2104,7 @@ function ImageSize(props) {
1978
2104
 
1979
2105
  // src/editor/nodes/logo/logo.ts
1980
2106
  var import_extension_image = __toESM(require("@tiptap/extension-image"));
1981
- var import_react21 = require("@tiptap/react");
2107
+ var import_react25 = require("@tiptap/react");
1982
2108
 
1983
2109
  // src/editor/nodes/section/section.ts
1984
2110
  var import_core5 = require("@tiptap/core");
@@ -2243,7 +2369,7 @@ var SectionExtension = import_core5.Node.create({
2243
2369
  border: 0,
2244
2370
  cellpadding: 0,
2245
2371
  cellspacing: 0,
2246
- class: "mly-w-full mly-border-separate",
2372
+ class: "mly-w-full mly-border-separate mly-relative",
2247
2373
  style: `margin-top: ${marginTop}px; margin-right: ${marginRight}px; margin-bottom: ${marginBottom}px; margin-left: ${marginLeft}px;`
2248
2374
  },
2249
2375
  [
@@ -2279,18 +2405,18 @@ var SectionExtension = import_core5.Node.create({
2279
2405
  });
2280
2406
 
2281
2407
  // src/editor/nodes/logo/logo-view.tsx
2282
- var import_react18 = require("@tiptap/react");
2283
- var import_react19 = require("react");
2284
- var import_react20 = require("react");
2408
+ var import_react22 = require("@tiptap/react");
2409
+ var import_react23 = require("react");
2410
+ var import_react24 = require("react");
2285
2411
 
2286
2412
  // src/editor/utils/use-event.ts
2287
- var import_react15 = require("react");
2413
+ var import_react19 = require("react");
2288
2414
  var useEvent = (handler) => {
2289
- const handlerRef = (0, import_react15.useRef)(null);
2290
- (0, import_react15.useLayoutEffect)(() => {
2415
+ const handlerRef = (0, import_react19.useRef)(null);
2416
+ (0, import_react19.useLayoutEffect)(() => {
2291
2417
  handlerRef.current = handler;
2292
2418
  }, [handler]);
2293
- return (0, import_react15.useCallback)((...args) => {
2419
+ return (0, import_react19.useCallback)((...args) => {
2294
2420
  if (handlerRef.current === null) {
2295
2421
  throw new Error("Handler is not assigned");
2296
2422
  }
@@ -2299,17 +2425,18 @@ var useEvent = (handler) => {
2299
2425
  };
2300
2426
 
2301
2427
  // src/editor/nodes/image/image-view.tsx
2302
- var import_react16 = require("@tiptap/react");
2303
- var import_lucide_react16 = require("lucide-react");
2304
- var import_react17 = require("react");
2428
+ var import_react20 = require("@tiptap/react");
2429
+ var import_lucide_react17 = require("lucide-react");
2430
+ var import_react21 = require("react");
2305
2431
  var import_jsx_runtime26 = require("react/jsx-runtime");
2306
2432
  var MIN_WIDTH = 20;
2307
2433
  var MAX_WIDTH = 600;
2308
2434
  function ImageView(props) {
2309
2435
  const { node, updateAttributes: updateAttributes2, selected } = props;
2310
- const [status, setStatus] = (0, import_react17.useState)("idle");
2311
- const imgRef = (0, import_react17.useRef)(null);
2312
- const [resizingStyle, setResizingStyle] = (0, import_react17.useState)();
2436
+ const [status, setStatus] = (0, import_react21.useState)("idle");
2437
+ const wrapperRef = (0, import_react21.useRef)(null);
2438
+ const imgRef = (0, import_react21.useRef)(null);
2439
+ const [resizingStyle, setResizingStyle] = (0, import_react21.useState)();
2313
2440
  const handleMouseDown = useEvent(
2314
2441
  (event) => {
2315
2442
  const imageParent = document.querySelector(
@@ -2373,7 +2500,7 @@ function ImageView(props) {
2373
2500
  let { alignment = "center", width, height, src } = node.attrs || {};
2374
2501
  const _a = node.attrs || {}, { externalLink, showIfKey } = _a, attrs = __objRest(_a, ["externalLink", "showIfKey"]);
2375
2502
  const hasImageSrc = !!attrs.src;
2376
- (0, import_react17.useEffect)(() => {
2503
+ (0, import_react21.useEffect)(() => {
2377
2504
  if (!src) {
2378
2505
  return;
2379
2506
  }
@@ -2382,6 +2509,21 @@ function ImageView(props) {
2382
2509
  img.src = src;
2383
2510
  img.onload = () => {
2384
2511
  setStatus("loaded");
2512
+ const { naturalWidth, naturalHeight } = img;
2513
+ const wrapper = wrapperRef == null ? void 0 : wrapperRef.current;
2514
+ if (!wrapper || width !== "auto" || !naturalWidth) {
2515
+ return;
2516
+ }
2517
+ const wrapperWidth = wrapper.offsetWidth;
2518
+ const aspectRatio = naturalWidth / naturalHeight;
2519
+ const calculatedHeight = Math.min(
2520
+ wrapperWidth / aspectRatio,
2521
+ naturalHeight
2522
+ );
2523
+ updateAttributes2({
2524
+ width: Math.min(wrapperWidth, naturalWidth),
2525
+ height: Math.min(calculatedHeight, naturalHeight)
2526
+ });
2385
2527
  };
2386
2528
  img.onerror = () => {
2387
2529
  setStatus("error");
@@ -2393,7 +2535,7 @@ function ImageView(props) {
2393
2535
  };
2394
2536
  }, [src]);
2395
2537
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2396
- import_react16.NodeViewWrapper,
2538
+ import_react20.NodeViewWrapper,
2397
2539
  {
2398
2540
  as: "div",
2399
2541
  draggable: true,
@@ -2412,6 +2554,7 @@ function ImageView(props) {
2412
2554
  left: { marginRight: "auto" },
2413
2555
  right: { marginLeft: "auto" }
2414
2556
  }[alignment] || {}),
2557
+ ref: wrapperRef,
2415
2558
  children: [
2416
2559
  !hasImageSrc && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ImageStatusLabel, { status: "idle" }),
2417
2560
  hasImageSrc && status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ImageStatusLabel, { status: "loading" }),
@@ -2467,15 +2610,15 @@ function ImageStatusLabel(props) {
2467
2610
  ),
2468
2611
  children: [
2469
2612
  status === "idle" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2470
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.ImageOffIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
2613
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react17.ImageOffIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
2471
2614
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "No image selected" })
2472
2615
  ] }),
2473
2616
  status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2474
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.Loader2, { className: "mly-size-4 mly-animate-spin mly-stroke-[2.5]" }),
2617
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react17.Loader2, { className: "mly-size-4 mly-animate-spin mly-stroke-[2.5]" }),
2475
2618
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Loading image..." })
2476
2619
  ] }),
2477
2620
  status === "error" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2478
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react16.Ban, { className: "mly-size-4 mly-stroke-[2.5]" }),
2621
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react17.Ban, { className: "mly-size-4 mly-stroke-[2.5]" }),
2479
2622
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Error loading image" })
2480
2623
  ] })
2481
2624
  ]
@@ -2487,14 +2630,14 @@ function ImageStatusLabel(props) {
2487
2630
  var import_jsx_runtime27 = require("react/jsx-runtime");
2488
2631
  function LogoView(props) {
2489
2632
  const { node } = props;
2490
- const [status, setStatus] = (0, import_react20.useState)("idle");
2633
+ const [status, setStatus] = (0, import_react24.useState)("idle");
2491
2634
  let {
2492
2635
  alignment = "center",
2493
2636
  src: logoSrc,
2494
2637
  size = "sm"
2495
2638
  } = node.attrs || {};
2496
2639
  const hasImageSrc = !!logoSrc;
2497
- (0, import_react19.useEffect)(() => {
2640
+ (0, import_react23.useEffect)(() => {
2498
2641
  if (!logoSrc) {
2499
2642
  return;
2500
2643
  }
@@ -2515,7 +2658,7 @@ function LogoView(props) {
2515
2658
  }, [logoSrc]);
2516
2659
  const logoSize = logoSizes[size];
2517
2660
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2518
- import_react18.NodeViewWrapper,
2661
+ import_react22.NodeViewWrapper,
2519
2662
  {
2520
2663
  as: "div",
2521
2664
  draggable: true,
@@ -2632,15 +2775,17 @@ var LogoExtension = import_extension_image.default.extend({
2632
2775
  ];
2633
2776
  },
2634
2777
  addNodeView() {
2635
- return (0, import_react21.ReactNodeViewRenderer)(LogoView);
2778
+ return (0, import_react25.ReactNodeViewRenderer)(LogoView, {
2779
+ className: "mly-relative"
2780
+ });
2636
2781
  }
2637
2782
  });
2638
2783
 
2639
2784
  // src/editor/components/image-menu/use-image-state.tsx
2640
- var import_react22 = require("@tiptap/react");
2785
+ var import_react26 = require("@tiptap/react");
2641
2786
  var import_fast_deep_equal3 = __toESM(require("fast-deep-equal"));
2642
2787
  var useImageState = (editor) => {
2643
- const states = (0, import_react22.useEditorState)({
2788
+ const states = (0, import_react26.useEditorState)({
2644
2789
  editor,
2645
2790
  selector: (ctx) => {
2646
2791
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -2685,7 +2830,7 @@ function ImageBubbleMenu(props) {
2685
2830
  }
2686
2831
  });
2687
2832
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2688
- import_react23.BubbleMenu,
2833
+ import_react27.BubbleMenu,
2689
2834
  __spreadProps(__spreadValues({}, bubbleMenuProps), {
2690
2835
  className: "mly-flex mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
2691
2836
  children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TooltipProvider, { children: [
@@ -2734,7 +2879,7 @@ function ImageBubbleMenu(props) {
2734
2879
  }
2735
2880
  },
2736
2881
  tooltip: "Source URL",
2737
- icon: import_lucide_react17.ImageDown
2882
+ icon: import_lucide_react18.ImageDown
2738
2883
  }
2739
2884
  ),
2740
2885
  state.isImageActive && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
@@ -2782,7 +2927,8 @@ function ImageBubbleMenu(props) {
2782
2927
  editor == null ? void 0 : editor.chain().updateAttributes(state.isLogoActive ? "logo" : "image", {
2783
2928
  showIfKey: value
2784
2929
  }).run();
2785
- }
2930
+ },
2931
+ editor
2786
2932
  }
2787
2933
  )
2788
2934
  ] })
@@ -2791,123 +2937,16 @@ function ImageBubbleMenu(props) {
2791
2937
  }
2792
2938
 
2793
2939
  // src/editor/components/section-menu/section-bubble-menu.tsx
2794
- var import_react25 = require("@tiptap/react");
2795
- var import_react26 = require("react");
2940
+ var import_react29 = require("@tiptap/react");
2941
+ var import_lucide_react19 = require("lucide-react");
2942
+ var import_react30 = require("react");
2796
2943
  var import_tippy4 = require("tippy.js");
2797
2944
 
2798
- // src/editor/components/section-menu/use-section-state.tsx
2799
- var import_react24 = require("@tiptap/react");
2800
- var import_fast_deep_equal4 = __toESM(require("fast-deep-equal"));
2801
- var useSectionState = (editor) => {
2802
- const states = (0, import_react24.useEditorState)({
2803
- editor,
2804
- selector: (ctx) => {
2805
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
2806
- return {
2807
- currentAlignment: ((_a = ctx.editor.getAttributes("section")) == null ? void 0 : _a.align) || "left",
2808
- currentBorderRadius: Number((_b = ctx.editor.getAttributes("section")) == null ? void 0 : _b.borderRadius) || 0,
2809
- currentBackgroundColor: ((_c = ctx.editor.getAttributes("section")) == null ? void 0 : _c.backgroundColor) || DEFAULT_SECTION_BACKGROUND_COLOR,
2810
- currentBorderColor: ((_d = ctx.editor.getAttributes("section")) == null ? void 0 : _d.borderColor) || DEFAULT_SECTION_BORDER_COLOR,
2811
- currentBorderWidth: Number((_e = ctx.editor.getAttributes("section")) == null ? void 0 : _e.borderWidth) || 0,
2812
- currentMarginTop: Number((_f = ctx.editor.getAttributes("section")) == null ? void 0 : _f.marginTop) || 0,
2813
- currentMarginRight: Number((_g = ctx.editor.getAttributes("section")) == null ? void 0 : _g.marginRight) || 0,
2814
- currentMarginBottom: Number((_h = ctx.editor.getAttributes("section")) == null ? void 0 : _h.marginBottom) || 0,
2815
- currentMarginLeft: Number((_i = ctx.editor.getAttributes("section")) == null ? void 0 : _i.marginLeft) || 0,
2816
- currentPaddingTop: Number((_j = ctx.editor.getAttributes("section")) == null ? void 0 : _j.paddingTop) || 0,
2817
- currentPaddingRight: Number((_k = ctx.editor.getAttributes("section")) == null ? void 0 : _k.paddingRight) || 0,
2818
- currentPaddingBottom: Number((_l = ctx.editor.getAttributes("section")) == null ? void 0 : _l.paddingBottom) || 0,
2819
- currentPaddingLeft: Number((_m = ctx.editor.getAttributes("section")) == null ? void 0 : _m.paddingLeft) || 0,
2820
- isColumnsActive: ctx.editor.isActive("columns"),
2821
- currentShowIfKey: ((_n = ctx.editor.getAttributes("section")) == null ? void 0 : _n.showIfKey) || ""
2822
- };
2823
- },
2824
- equalityFn: import_fast_deep_equal4.default
2825
- });
2826
- return states;
2827
- };
2828
-
2829
- // src/editor/components/section-menu/section-bubble-menu.tsx
2830
- var import_lucide_react18 = require("lucide-react");
2831
-
2832
- // src/editor/components/ui/color-picker.tsx
2833
- var import_react_colorful = require("react-colorful");
2834
- var import_jsx_runtime29 = require("react/jsx-runtime");
2835
- function ColorPicker(props) {
2836
- const {
2837
- color,
2838
- onColorChange,
2839
- borderColor,
2840
- backgroundColor,
2841
- tooltip,
2842
- className,
2843
- children
2844
- } = props;
2845
- const handleColorChange = (color2) => {
2846
- queueMicrotask(() => {
2847
- onColorChange(color2);
2848
- });
2849
- };
2850
- const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2851
- BaseButton,
2852
- {
2853
- variant: "ghost",
2854
- className: "!mly-size-7 mly-shrink-0",
2855
- size: "sm",
2856
- type: "button",
2857
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2858
- "div",
2859
- {
2860
- className: cn(
2861
- "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded mly-border-2 mly-border-gray-700",
2862
- className
2863
- ),
2864
- style: __spreadProps(__spreadValues({}, borderColor ? { borderColor } : {}), {
2865
- backgroundColor: backgroundColor || "transparent"
2866
- })
2867
- }
2868
- )
2869
- }
2870
- ) });
2871
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Popover, { children: [
2872
- tooltip ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip, { children: [
2873
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
2874
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
2875
- ] }) : popoverButton,
2876
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2877
- PopoverContent,
2878
- {
2879
- className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
2880
- sideOffset: 8,
2881
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
2882
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2883
- import_react_colorful.HexColorPicker,
2884
- {
2885
- color,
2886
- onChange: handleColorChange,
2887
- className: "mly-flex !mly-w-full mly-flex-col mly-gap-4"
2888
- }
2889
- ),
2890
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2891
- import_react_colorful.HexColorInput,
2892
- {
2893
- alpha: true,
2894
- color,
2895
- onChange: handleColorChange,
2896
- className: "mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",
2897
- prefixed: true
2898
- }
2899
- )
2900
- ] })
2901
- }
2902
- )
2903
- ] });
2904
- }
2905
-
2906
2945
  // src/editor/components/icons/border-color.tsx
2907
- var import_jsx_runtime30 = require("react/jsx-runtime");
2946
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2908
2947
  function BorderColor(props) {
2909
2948
  const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
2910
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2949
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2911
2950
  "svg",
2912
2951
  __spreadProps(__spreadValues({
2913
2952
  width: 11,
@@ -2917,8 +2956,8 @@ function BorderColor(props) {
2917
2956
  xmlns: "http://www.w3.org/2000/svg"
2918
2957
  }, rest), {
2919
2958
  children: [
2920
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
2921
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2959
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
2960
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2922
2961
  "path",
2923
2962
  {
2924
2963
  d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
@@ -2932,9 +2971,9 @@ function BorderColor(props) {
2932
2971
  }
2933
2972
 
2934
2973
  // src/editor/components/icons/margin-icon.tsx
2935
- var import_jsx_runtime31 = require("react/jsx-runtime");
2974
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2936
2975
  function MarginIcon(props) {
2937
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2976
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2938
2977
  "svg",
2939
2978
  __spreadProps(__spreadValues({
2940
2979
  width: 12,
@@ -2943,7 +2982,7 @@ function MarginIcon(props) {
2943
2982
  fill: "none",
2944
2983
  xmlns: "http://www.w3.org/2000/svg"
2945
2984
  }, props), {
2946
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2985
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2947
2986
  "path",
2948
2987
  {
2949
2988
  d: "M10.5 10.499V1.49902M1.5 10.499V1.49902M4.5 5.99902C4.5 5.53308 4.5 5.30011 4.57612 5.11634C4.67761 4.87131 4.87229 4.67664 5.11732 4.57514C5.30109 4.49902 5.53406 4.49902 6 4.49902C6.46594 4.49902 6.69891 4.49902 6.88268 4.57514C7.12771 4.67664 7.32239 4.87131 7.42388 5.11634C7.5 5.30011 7.5 5.53308 7.5 5.99902C7.5 6.46496 7.5 6.69794 7.42388 6.88171C7.32239 7.12673 7.12771 7.32141 6.88268 7.4229C6.69891 7.49902 6.46594 7.49902 6 7.49902C5.53406 7.49902 5.30109 7.49902 5.11732 7.4229C4.87229 7.32141 4.67761 7.12673 4.57612 6.88171C4.5 6.69794 4.5 6.46496 4.5 5.99902Z",
@@ -2957,9 +2996,9 @@ function MarginIcon(props) {
2957
2996
  }
2958
2997
 
2959
2998
  // src/editor/components/icons/padding-icon.tsx
2960
- var import_jsx_runtime32 = require("react/jsx-runtime");
2999
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2961
3000
  function PaddingIcon(props) {
2962
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3001
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2963
3002
  "svg",
2964
3003
  __spreadProps(__spreadValues({
2965
3004
  width: 10,
@@ -2968,7 +3007,7 @@ function PaddingIcon(props) {
2968
3007
  fill: "none",
2969
3008
  xmlns: "http://www.w3.org/2000/svg"
2970
3009
  }, props), {
2971
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3010
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2972
3011
  "path",
2973
3012
  {
2974
3013
  d: "M9.50244 0.501526L9.10244 0.501526C8.54239 0.501526 8.26236 0.501526 8.04845 0.610519C7.86029 0.706392 7.70731 0.859373 7.61144 1.04754C7.50244 1.26145 7.50244 1.54147 7.50244 2.10153V7.90153C7.50244 8.46158 7.50244 8.74161 7.61144 8.95552C7.70731 9.14368 7.86029 9.29666 8.04845 9.39253C8.26236 9.50153 8.54239 9.50153 9.10244 9.50153H9.50244M0.502441 0.501527L0.902441 0.501527C1.46249 0.501527 1.74252 0.501527 1.95643 0.61052C2.14459 0.706393 2.29757 0.859374 2.39345 1.04754C2.50244 1.26145 2.50244 1.54147 2.50244 2.10153L2.50244 7.90153C2.50244 8.46158 2.50244 8.74161 2.39345 8.95552C2.29757 9.14368 2.14459 9.29666 1.95643 9.39253C1.74252 9.50153 1.46249 9.50153 0.902442 9.50153H0.502442M4.99994 7.99903V1.99903",
@@ -2981,6 +3020,111 @@ function PaddingIcon(props) {
2981
3020
  );
2982
3021
  }
2983
3022
 
3023
+ // src/editor/components/ui/color-picker.tsx
3024
+ var import_react_colorful = require("react-colorful");
3025
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3026
+ function ColorPicker(props) {
3027
+ const {
3028
+ color,
3029
+ onColorChange,
3030
+ borderColor,
3031
+ backgroundColor,
3032
+ tooltip,
3033
+ className,
3034
+ children
3035
+ } = props;
3036
+ const handleColorChange = (color2) => {
3037
+ queueMicrotask(() => {
3038
+ onColorChange(color2);
3039
+ });
3040
+ };
3041
+ const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3042
+ BaseButton,
3043
+ {
3044
+ variant: "ghost",
3045
+ className: "!mly-size-7 mly-shrink-0",
3046
+ size: "sm",
3047
+ type: "button",
3048
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3049
+ "div",
3050
+ {
3051
+ className: cn(
3052
+ "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded mly-border-2 mly-border-gray-700",
3053
+ className
3054
+ ),
3055
+ style: __spreadProps(__spreadValues({}, borderColor ? { borderColor } : {}), {
3056
+ backgroundColor: backgroundColor || "transparent"
3057
+ })
3058
+ }
3059
+ )
3060
+ }
3061
+ ) });
3062
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Popover, { children: [
3063
+ tooltip ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
3064
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
3065
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
3066
+ ] }) : popoverButton,
3067
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3068
+ PopoverContent,
3069
+ {
3070
+ className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
3071
+ sideOffset: 8,
3072
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
3073
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3074
+ import_react_colorful.HexColorPicker,
3075
+ {
3076
+ color,
3077
+ onChange: handleColorChange,
3078
+ className: "mly-flex !mly-w-full mly-flex-col mly-gap-4"
3079
+ }
3080
+ ),
3081
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3082
+ import_react_colorful.HexColorInput,
3083
+ {
3084
+ alpha: true,
3085
+ color,
3086
+ onChange: handleColorChange,
3087
+ className: "mly-mt-4 mly-w-full mly-min-w-0 mly-rounded-lg mly-border mly-px-2 mly-py-1.5 mly-text-sm mly-uppercase focus-visible:mly-border-gray-400 focus-visible:mly-outline-none",
3088
+ prefixed: true
3089
+ }
3090
+ )
3091
+ ] })
3092
+ }
3093
+ )
3094
+ ] });
3095
+ }
3096
+
3097
+ // src/editor/components/section-menu/use-section-state.tsx
3098
+ var import_react28 = require("@tiptap/react");
3099
+ var import_fast_deep_equal4 = __toESM(require("fast-deep-equal"));
3100
+ var useSectionState = (editor) => {
3101
+ const states = (0, import_react28.useEditorState)({
3102
+ editor,
3103
+ selector: (ctx) => {
3104
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
3105
+ return {
3106
+ currentAlignment: ((_a = ctx.editor.getAttributes("section")) == null ? void 0 : _a.align) || "left",
3107
+ currentBorderRadius: Number((_b = ctx.editor.getAttributes("section")) == null ? void 0 : _b.borderRadius) || 0,
3108
+ currentBackgroundColor: ((_c = ctx.editor.getAttributes("section")) == null ? void 0 : _c.backgroundColor) || DEFAULT_SECTION_BACKGROUND_COLOR,
3109
+ currentBorderColor: ((_d = ctx.editor.getAttributes("section")) == null ? void 0 : _d.borderColor) || DEFAULT_SECTION_BORDER_COLOR,
3110
+ currentBorderWidth: Number((_e = ctx.editor.getAttributes("section")) == null ? void 0 : _e.borderWidth) || 0,
3111
+ currentMarginTop: Number((_f = ctx.editor.getAttributes("section")) == null ? void 0 : _f.marginTop) || 0,
3112
+ currentMarginRight: Number((_g = ctx.editor.getAttributes("section")) == null ? void 0 : _g.marginRight) || 0,
3113
+ currentMarginBottom: Number((_h = ctx.editor.getAttributes("section")) == null ? void 0 : _h.marginBottom) || 0,
3114
+ currentMarginLeft: Number((_i = ctx.editor.getAttributes("section")) == null ? void 0 : _i.marginLeft) || 0,
3115
+ currentPaddingTop: Number((_j = ctx.editor.getAttributes("section")) == null ? void 0 : _j.paddingTop) || 0,
3116
+ currentPaddingRight: Number((_k = ctx.editor.getAttributes("section")) == null ? void 0 : _k.paddingRight) || 0,
3117
+ currentPaddingBottom: Number((_l = ctx.editor.getAttributes("section")) == null ? void 0 : _l.paddingBottom) || 0,
3118
+ currentPaddingLeft: Number((_m = ctx.editor.getAttributes("section")) == null ? void 0 : _m.paddingLeft) || 0,
3119
+ isColumnsActive: ctx.editor.isActive("columns"),
3120
+ currentShowIfKey: ((_n = ctx.editor.getAttributes("section")) == null ? void 0 : _n.showIfKey) || ""
3121
+ };
3122
+ },
3123
+ equalityFn: import_fast_deep_equal4.default
3124
+ });
3125
+ return states;
3126
+ };
3127
+
2984
3128
  // src/editor/components/section-menu/section-bubble-menu.tsx
2985
3129
  var import_jsx_runtime33 = require("react/jsx-runtime");
2986
3130
  function SectionBubbleMenu(props) {
@@ -2988,14 +3132,20 @@ function SectionBubbleMenu(props) {
2988
3132
  if (!editor) {
2989
3133
  return null;
2990
3134
  }
2991
- const getReferenceClientRect = (0, import_react26.useCallback)(() => {
3135
+ const getReferenceClientRect = (0, import_react30.useCallback)(() => {
2992
3136
  const renderContainer = getRenderContainer(editor, "section");
2993
3137
  const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
2994
3138
  return rect;
2995
3139
  }, [editor]);
2996
3140
  const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
2997
3141
  shouldShow: ({ editor: editor2 }) => {
2998
- if (isTextSelected(editor2) || editor2.isActive("for")) {
3142
+ var _a;
3143
+ const activeSectionNode = getClosestNodeByName(editor2, "section");
3144
+ const forNodeChildren = activeSectionNode ? (_a = (0, import_react29.findChildren)(activeSectionNode == null ? void 0 : activeSectionNode.node, (node) => {
3145
+ return node.type.name === "for";
3146
+ })) == null ? void 0 : _a[0] : null;
3147
+ const hasActiveForNodeChildren = forNodeChildren && editor2.isActive("for");
3148
+ if (isTextSelected(editor2) || hasActiveForNodeChildren) {
2999
3149
  return false;
3000
3150
  }
3001
3151
  return editor2.isActive("section");
@@ -3020,7 +3170,7 @@ function SectionBubbleMenu(props) {
3020
3170
  { value: "9999", label: "Round" }
3021
3171
  ];
3022
3172
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3023
- import_react25.BubbleMenu,
3173
+ import_react29.BubbleMenu,
3024
3174
  __spreadProps(__spreadValues({}, bubbleMenuProps), {
3025
3175
  className: "mly-flex mly-items-stretch mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
3026
3176
  children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(TooltipProvider, { children: [
@@ -3186,7 +3336,7 @@ function SectionBubbleMenu(props) {
3186
3336
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3187
3337
  BubbleMenuButton,
3188
3338
  {
3189
- icon: import_lucide_react18.Trash,
3339
+ icon: import_lucide_react19.Trash,
3190
3340
  tooltip: "Delete Section",
3191
3341
  command: () => {
3192
3342
  deleteNode(editor, "section");
@@ -3202,15 +3352,16 @@ function SectionBubbleMenu(props) {
3202
3352
  editor.commands.updateSection({
3203
3353
  showIfKey: value
3204
3354
  });
3205
- }
3355
+ },
3356
+ editor
3206
3357
  }
3207
3358
  ),
3208
3359
  state.isColumnsActive && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
3209
3360
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Divider, {}),
3210
3361
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Popover, { children: [
3211
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(PopoverTrigger, { className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm hover:mly-bg-soft-gray data-[state=open]:mly-bg-soft-gray", children: [
3362
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(PopoverTrigger, { className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray", children: [
3212
3363
  "Column",
3213
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react18.ChevronUp, { className: "mly-h-3 mly-w-3" })
3364
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.ChevronUp, { className: "mly-h-3 mly-w-3" })
3214
3365
  ] }),
3215
3366
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3216
3367
  PopoverContent,
@@ -3236,7 +3387,7 @@ function SectionBubbleMenu(props) {
3236
3387
  }
3237
3388
 
3238
3389
  // src/editor/components/spacer-menu/spacer-bubble-menu.tsx
3239
- var import_react28 = require("@tiptap/react");
3390
+ var import_react32 = require("@tiptap/react");
3240
3391
 
3241
3392
  // src/editor/nodes/spacer.ts
3242
3393
  var import_core6 = require("@tiptap/core");
@@ -3314,7 +3465,7 @@ var Spacer = import_core6.Node.create({
3314
3465
  this.options.HTMLAttributes,
3315
3466
  HTMLAttributes2,
3316
3467
  {
3317
- class: "spacer relative z-50",
3468
+ class: "spacer mly-relative mly-z-50",
3318
3469
  contenteditable: false
3319
3470
  }
3320
3471
  )
@@ -3326,10 +3477,10 @@ var Spacer = import_core6.Node.create({
3326
3477
  });
3327
3478
 
3328
3479
  // src/editor/components/spacer-menu/use-spacer-state.ts
3329
- var import_react27 = require("@tiptap/react");
3480
+ var import_react31 = require("@tiptap/react");
3330
3481
  var import_fast_deep_equal5 = __toESM(require("fast-deep-equal"));
3331
3482
  var useSpacerState = (editor) => {
3332
- const states = (0, import_react27.useEditorState)({
3483
+ const states = (0, import_react31.useEditorState)({
3333
3484
  editor,
3334
3485
  selector: (ctx) => {
3335
3486
  var _a;
@@ -3365,7 +3516,7 @@ function SpacerBubbleMenu(props) {
3365
3516
  });
3366
3517
  const state = useSpacerState(editor);
3367
3518
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3368
- import_react28.BubbleMenu,
3519
+ import_react32.BubbleMenu,
3369
3520
  __spreadProps(__spreadValues({}, bubbleMenuProps), {
3370
3521
  className: "mly-flex mly-gap-0.5 mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
3371
3522
  children: [
@@ -3385,7 +3536,8 @@ function SpacerBubbleMenu(props) {
3385
3536
  showIfKey: state.currentShowIfKey,
3386
3537
  onShowIfKeyValueChange: (value) => {
3387
3538
  editor.commands.setSpacerShowIfKey(value);
3388
- }
3539
+ },
3540
+ editor
3389
3541
  }
3390
3542
  )
3391
3543
  ]
@@ -3394,15 +3546,15 @@ function SpacerBubbleMenu(props) {
3394
3546
  }
3395
3547
 
3396
3548
  // src/editor/components/text-menu/text-bubble-menu.tsx
3397
- var import_react37 = require("@tiptap/react");
3398
- var import_lucide_react21 = require("lucide-react");
3549
+ var import_react44 = require("@tiptap/react");
3550
+ var import_lucide_react23 = require("lucide-react");
3399
3551
 
3400
3552
  // src/editor/components/text-menu/use-text-menu-state.tsx
3401
- var import_react29 = require("@tiptap/react");
3553
+ var import_react33 = require("@tiptap/react");
3402
3554
  var import_fast_deep_equal6 = __toESM(require("fast-deep-equal"));
3403
3555
  var DEFAULT_TEXT_COLOR = "#374151";
3404
3556
  var useTextMenuState = (editor) => {
3405
- const states = (0, import_react29.useEditorState)({
3557
+ const states = (0, import_react33.useEditorState)({
3406
3558
  editor,
3407
3559
  selector: (ctx) => {
3408
3560
  var _a, _b, _c, _d, _e;
@@ -3438,6 +3590,13 @@ var HorizontalRule = import_extension_horizontal_rule.HorizontalRule.extend({
3438
3590
  }
3439
3591
  })
3440
3592
  ];
3593
+ },
3594
+ addOptions() {
3595
+ return {
3596
+ HTMLAttributes: {
3597
+ class: "mly-relative"
3598
+ }
3599
+ };
3441
3600
  }
3442
3601
  });
3443
3602
 
@@ -3446,10 +3605,10 @@ var import_extension_image3 = __toESM(require("@tiptap/extension-image"));
3446
3605
 
3447
3606
  // src/editor/extensions/link-card.ts
3448
3607
  var import_core8 = require("@tiptap/core");
3449
- var import_react31 = require("@tiptap/react");
3608
+ var import_react35 = require("@tiptap/react");
3450
3609
 
3451
3610
  // src/editor/nodes/link-card.tsx
3452
- var import_react30 = require("@tiptap/react");
3611
+ var import_react34 = require("@tiptap/react");
3453
3612
 
3454
3613
  // src/editor/components/input.tsx
3455
3614
  var React5 = __toESM(require("react"));
@@ -3500,7 +3659,7 @@ function LinkCardComponent(props) {
3500
3659
  const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
3501
3660
  const { getPos, editor } = props;
3502
3661
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3503
- import_react30.NodeViewWrapper,
3662
+ import_react34.NodeViewWrapper,
3504
3663
  {
3505
3664
  className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
3506
3665
  draggable: "true",
@@ -3732,17 +3891,19 @@ var LinkCardExtension = import_core8.Node.create({
3732
3891
  };
3733
3892
  },
3734
3893
  addNodeView() {
3735
- return (0, import_react31.ReactNodeViewRenderer)(LinkCardComponent);
3894
+ return (0, import_react35.ReactNodeViewRenderer)(LinkCardComponent, {
3895
+ className: "mly-relative"
3896
+ });
3736
3897
  }
3737
3898
  });
3738
3899
 
3739
3900
  // src/editor/nodes/button/button.tsx
3740
3901
  var import_core9 = require("@tiptap/core");
3741
- var import_react33 = require("@tiptap/react");
3902
+ var import_react37 = require("@tiptap/react");
3742
3903
 
3743
3904
  // src/editor/nodes/button/button-view.tsx
3744
- var import_react32 = require("@tiptap/react");
3745
- var import_lucide_react19 = require("lucide-react");
3905
+ var import_react36 = require("@tiptap/react");
3906
+ var import_lucide_react20 = require("lucide-react");
3746
3907
  var import_jsx_runtime38 = require("react/jsx-runtime");
3747
3908
  function ButtonView(props) {
3748
3909
  const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
@@ -3757,7 +3918,7 @@ function ButtonView(props) {
3757
3918
  showIfKey = ""
3758
3919
  } = node.attrs;
3759
3920
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3760
- import_react32.NodeViewWrapper,
3921
+ import_react36.NodeViewWrapper,
3761
3922
  {
3762
3923
  draggable: "true",
3763
3924
  "data-drag-handle": "",
@@ -3818,7 +3979,7 @@ function ButtonView(props) {
3818
3979
  className: "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none"
3819
3980
  }
3820
3981
  ),
3821
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react19.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
3982
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
3822
3983
  ] }),
3823
3984
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Divider, {}),
3824
3985
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
@@ -3920,7 +4081,8 @@ function ButtonView(props) {
3920
4081
  updateAttributes2({
3921
4082
  showIfKey: value
3922
4083
  });
3923
- }
4084
+ },
4085
+ editor
3924
4086
  }
3925
4087
  )
3926
4088
  ] }) })
@@ -4121,8 +4283,9 @@ var ButtonExtension = import_core9.Node.create({
4121
4283
  };
4122
4284
  },
4123
4285
  addNodeView() {
4124
- return (0, import_react33.ReactNodeViewRenderer)(ButtonView, {
4125
- contentDOMElementTag: "div"
4286
+ return (0, import_react37.ReactNodeViewRenderer)(ButtonView, {
4287
+ contentDOMElementTag: "div",
4288
+ className: "mly-relative"
4126
4289
  });
4127
4290
  }
4128
4291
  });
@@ -4130,21 +4293,31 @@ var ButtonExtension = import_core9.Node.create({
4130
4293
  // src/editor/nodes/variable/variable.ts
4131
4294
  var import_core10 = require("@tiptap/core");
4132
4295
  var import_state2 = require("@tiptap/pm/state");
4133
- var import_react35 = require("@tiptap/react");
4296
+ var import_react40 = require("@tiptap/react");
4134
4297
  var import_suggestion = __toESM(require("@tiptap/suggestion"));
4135
4298
 
4136
4299
  // src/editor/nodes/variable/variable-view.tsx
4137
- var import_react34 = require("@tiptap/react");
4138
- var import_lucide_react20 = require("lucide-react");
4300
+ var import_react38 = require("@tiptap/react");
4301
+ var import_lucide_react21 = require("lucide-react");
4302
+ var import_react39 = require("react");
4139
4303
  var import_jsx_runtime39 = require("react/jsx-runtime");
4140
4304
  function VariableView(props) {
4141
- var _a, _b;
4305
+ var _a;
4142
4306
  const { node, selected, updateAttributes: updateAttributes2, editor } = props;
4143
4307
  const { id, fallback, showIfKey = "" } = node.attrs;
4144
4308
  const { variables = [] } = useMailyContext();
4145
- const isRequired = (_b = (_a = variables.find((variable) => variable.name === id)) == null ? void 0 : _a.required) != null ? _b : true;
4309
+ const eachKey = ((_a = editor == null ? void 0 : editor.getAttributes("for")) == null ? void 0 : _a.each) || "";
4310
+ const isRequired = (0, import_react39.useMemo)(() => {
4311
+ var _a2;
4312
+ const variable = processVariables(variables, {
4313
+ query: "",
4314
+ from: "variable",
4315
+ editor
4316
+ }).find((variable2) => variable2.name === id);
4317
+ return (_a2 = variable == null ? void 0 : variable.required) != null ? _a2 : true;
4318
+ }, [variables, id, editor, eachKey]);
4146
4319
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4147
- import_react34.NodeViewWrapper,
4320
+ import_react38.NodeViewWrapper,
4148
4321
  {
4149
4322
  className: cn(
4150
4323
  "react-component",
@@ -4159,9 +4332,9 @@ function VariableView(props) {
4159
4332
  tabIndex: -1,
4160
4333
  className: "mly-inline-flex mly-items-center mly-gap-[var(--variable-icon-gap)] mly-rounded-full mly-border mly-px-1.5 mly-py-0.5 mly-leading-none",
4161
4334
  children: [
4162
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
4335
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
4163
4336
  id,
4164
- isRequired && !fallback && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
4337
+ isRequired && !fallback && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
4165
4338
  ]
4166
4339
  }
4167
4340
  ) }),
@@ -4207,7 +4380,7 @@ function VariableView(props) {
4207
4380
  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"
4208
4381
  }
4209
4382
  ),
4210
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
4383
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
4211
4384
  ] }),
4212
4385
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Divider, {}),
4213
4386
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
@@ -4218,7 +4391,8 @@ function VariableView(props) {
4218
4391
  updateAttributes2({
4219
4392
  showIfKey: value
4220
4393
  });
4221
- }
4394
+ },
4395
+ editor
4222
4396
  }
4223
4397
  )
4224
4398
  ] }) })
@@ -4388,13 +4562,15 @@ var VariableExtension = import_core10.Node.create({
4388
4562
  ];
4389
4563
  },
4390
4564
  addNodeView() {
4391
- return (0, import_react35.ReactNodeViewRenderer)(VariableView);
4565
+ return (0, import_react40.ReactNodeViewRenderer)(VariableView, {
4566
+ className: "mly-relative"
4567
+ });
4392
4568
  }
4393
4569
  });
4394
4570
 
4395
4571
  // src/editor/nodes/image/image.ts
4396
4572
  var import_extension_image2 = __toESM(require("@tiptap/extension-image"));
4397
- var import_react36 = require("@tiptap/react");
4573
+ var import_react41 = require("@tiptap/react");
4398
4574
  var ImageExtension = import_extension_image2.default.extend({
4399
4575
  addAttributes() {
4400
4576
  var _a;
@@ -4452,7 +4628,9 @@ var ImageExtension = import_extension_image2.default.extend({
4452
4628
  });
4453
4629
  },
4454
4630
  addNodeView() {
4455
- return (0, import_react36.ReactNodeViewRenderer)(ImageView);
4631
+ return (0, import_react41.ReactNodeViewRenderer)(ImageView, {
4632
+ className: "mly-relative"
4633
+ });
4456
4634
  }
4457
4635
  });
4458
4636
 
@@ -4463,243 +4641,20 @@ var isCustomNodeSelected = (editor, node) => {
4463
4641
  import_extension_image3.default.name,
4464
4642
  Spacer.name,
4465
4643
  ImageExtension.name,
4466
- VariableExtension.name,
4467
- LinkCardExtension.name,
4468
- LogoExtension.name,
4469
- ButtonExtension.name
4470
- ];
4471
- return customNodes.some((type) => editor.isActive(type));
4472
- };
4473
-
4474
- // src/editor/components/text-menu/text-bubble-menu.tsx
4475
- var import_jsx_runtime40 = require("react/jsx-runtime");
4476
- function TextBubbleMenu(props) {
4477
- var _a;
4478
- const { editor, appendTo } = props;
4479
- if (!editor) {
4480
- return null;
4481
- }
4482
- const items = [
4483
- {
4484
- name: "bold",
4485
- isActive: () => editor == null ? void 0 : editor.isActive("bold"),
4486
- command: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
4487
- icon: import_lucide_react21.BoldIcon,
4488
- tooltip: "Bold"
4489
- },
4490
- {
4491
- name: "italic",
4492
- isActive: () => editor == null ? void 0 : editor.isActive("italic"),
4493
- command: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
4494
- icon: import_lucide_react21.ItalicIcon,
4495
- tooltip: "Italic"
4496
- },
4497
- {
4498
- name: "underline",
4499
- isActive: () => editor == null ? void 0 : editor.isActive("underline"),
4500
- command: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run(),
4501
- icon: import_lucide_react21.UnderlineIcon,
4502
- tooltip: "Underline"
4503
- },
4504
- {
4505
- name: "strike",
4506
- isActive: () => editor == null ? void 0 : editor.isActive("strike"),
4507
- command: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
4508
- icon: import_lucide_react21.StrikethroughIcon,
4509
- tooltip: "Strikethrough"
4510
- },
4511
- {
4512
- name: "code",
4513
- isActive: () => editor == null ? void 0 : editor.isActive("code"),
4514
- command: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
4515
- icon: import_lucide_react21.CodeIcon,
4516
- tooltip: "Code"
4517
- }
4518
- ];
4519
- const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
4520
- pluginKey: "textMenu",
4521
- shouldShow: ({ editor: editor2, state: state2, from, to, view }) => {
4522
- if (!view || editor2.view.dragging) {
4523
- return false;
4524
- }
4525
- const domAtPos = view.domAtPos(from || 0).node;
4526
- const nodeDOM = view.nodeDOM(from || 0);
4527
- const node = nodeDOM || domAtPos;
4528
- if (isCustomNodeSelected(editor2, node)) {
4529
- return false;
4530
- }
4531
- return isTextSelected(editor2);
4532
- },
4533
- tippyOptions: {
4534
- popperOptions: {
4535
- placement: "top-start",
4536
- modifiers: [
4537
- {
4538
- name: "preventOverflow",
4539
- options: {
4540
- boundary: "viewport",
4541
- padding: 8
4542
- }
4543
- },
4544
- {
4545
- name: "flip",
4546
- options: {
4547
- fallbackPlacements: ["bottom-start", "top-end", "bottom-end"]
4548
- }
4549
- }
4550
- ]
4551
- },
4552
- maxWidth: "100%"
4553
- }
4554
- });
4555
- const state = useTextMenuState(editor);
4556
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4557
- import_react37.BubbleMenu,
4558
- __spreadProps(__spreadValues({}, bubbleMenuProps), {
4559
- className: "mly-flex mly-gap-1 mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
4560
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(TooltipProvider, { children: [
4561
- items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(BubbleMenuButton, __spreadValues({}, item), index)),
4562
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4563
- AlignmentSwitch,
4564
- {
4565
- alignment: state.textAlign,
4566
- onAlignmentChange: (alignment) => {
4567
- editor == null ? void 0 : editor.chain().focus().setTextAlign(alignment).run();
4568
- }
4569
- }
4570
- ),
4571
- !state.isListActive && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
4572
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4573
- BubbleMenuButton,
4574
- {
4575
- icon: import_lucide_react21.List,
4576
- command: () => {
4577
- editor.chain().focus().toggleBulletList().run();
4578
- },
4579
- tooltip: "Bullet List"
4580
- }
4581
- ),
4582
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4583
- BubbleMenuButton,
4584
- {
4585
- icon: import_lucide_react21.ListOrdered,
4586
- command: () => {
4587
- editor.chain().focus().toggleOrderedList().run();
4588
- },
4589
- tooltip: "Ordered List"
4590
- }
4591
- )
4592
- ] }),
4593
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4594
- LinkInputPopover,
4595
- {
4596
- defaultValue: (_a = state == null ? void 0 : state.linkUrl) != null ? _a : "",
4597
- onValueChange: (value) => {
4598
- if (!value) {
4599
- editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").unsetLink().run();
4600
- return;
4601
- }
4602
- editor == null ? void 0 : editor.chain().extendMarkRange("link").setLink({ href: value }).run();
4603
- },
4604
- tooltip: "External URL"
4605
- }
4606
- ),
4607
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Divider, {}),
4608
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4609
- ColorPicker,
4610
- {
4611
- color: state.currentTextColor,
4612
- onColorChange: (color) => {
4613
- editor == null ? void 0 : editor.chain().setColor(color).run();
4614
- },
4615
- tooltip: "Text Color",
4616
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4617
- BaseButton,
4618
- {
4619
- variant: "ghost",
4620
- size: "sm",
4621
- type: "button",
4622
- className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
4623
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
4624
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700", children: "A" }),
4625
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4626
- "div",
4627
- {
4628
- className: "mly-h-[2px] mly-w-3",
4629
- style: { backgroundColor: state.currentTextColor }
4630
- }
4631
- )
4632
- ] })
4633
- }
4634
- )
4635
- }
4636
- )
4637
- ] })
4638
- })
4639
- );
4640
- }
4641
-
4642
- // src/editor/extensions/index.ts
4643
- var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
4644
- var import_extension_color = require("@tiptap/extension-color");
4645
- var import_extension_link = __toESM(require("@tiptap/extension-link"));
4646
- var import_extension_list_item = __toESM(require("@tiptap/extension-list-item"));
4647
- var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"));
4648
- var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
4649
- var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
4650
- var import_extension_text_style = __toESM(require("@tiptap/extension-text-style"));
4651
- var import_extension_heading = __toESM(require("@tiptap/extension-heading"));
4652
- var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
4653
- var import_extension_document = __toESM(require("@tiptap/extension-document"));
4654
- var import_extension_focus = __toESM(require("@tiptap/extension-focus"));
4655
- var import_extension_dropcursor = __toESM(require("@tiptap/extension-dropcursor"));
4656
-
4657
- // src/editor/nodes/footer.ts
4658
- var import_core11 = require("@tiptap/core");
4659
- var Footer = import_core11.Node.create({
4660
- name: "footer",
4661
- group: "block",
4662
- content: "inline*",
4663
- addAttributes() {
4664
- return {
4665
- "maily-component": {
4666
- default: "footer",
4667
- renderHTML: (attributes) => {
4668
- return {
4669
- "data-maily-component": attributes["maily-component"]
4670
- };
4671
- },
4672
- parseHTML: (element) => element == null ? void 0 : element.getAttribute("data-maily-component")
4673
- }
4674
- };
4675
- },
4676
- addCommands() {
4677
- return {
4678
- setFooter: () => ({ commands }) => {
4679
- return commands.setNode(this.name);
4680
- }
4681
- };
4682
- },
4683
- parseHTML() {
4684
- return [{ tag: 'small[data-maily-component="footer"]' }];
4685
- },
4686
- renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
4687
- return [
4688
- "small",
4689
- (0, import_core11.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes2, {
4690
- class: "footer mly-block mly-text-[13px] mly-text-slate-500"
4691
- }),
4692
- 0
4693
- ];
4694
- }
4695
- });
4644
+ VariableExtension.name,
4645
+ LinkCardExtension.name,
4646
+ LogoExtension.name,
4647
+ ButtonExtension.name
4648
+ ];
4649
+ return customNodes.some((type) => editor.isActive(type));
4650
+ };
4696
4651
 
4697
4652
  // src/editor/nodes/columns/columns.ts
4653
+ var import_core11 = require("@tiptap/core");
4698
4654
  var import_core12 = require("@tiptap/core");
4699
- var import_core13 = require("@tiptap/core");
4700
4655
  var import_uuid3 = require("uuid");
4701
4656
  var DEFAULT_COLUMNS_GAP = 8;
4702
- var Columns = import_core13.Node.create({
4657
+ var ColumnsExtension = import_core12.Node.create({
4703
4658
  name: "columns",
4704
4659
  group: "columns",
4705
4660
  content: "column+",
@@ -4775,8 +4730,9 @@ var Columns = import_core13.Node.create({
4775
4730
  renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
4776
4731
  return [
4777
4732
  "div",
4778
- (0, import_core12.mergeAttributes)(HTMLAttributes2, {
4779
- "data-type": "columns"
4733
+ (0, import_core11.mergeAttributes)(HTMLAttributes2, {
4734
+ "data-type": "columns",
4735
+ class: "mly-relative"
4780
4736
  }),
4781
4737
  0
4782
4738
  ];
@@ -4801,32 +4757,37 @@ var Columns = import_core13.Node.create({
4801
4757
  });
4802
4758
 
4803
4759
  // src/editor/nodes/for/for.ts
4804
- var import_core14 = require("@tiptap/core");
4805
- var import_react39 = require("@tiptap/react");
4760
+ var import_core13 = require("@tiptap/core");
4761
+ var import_react43 = require("@tiptap/react");
4806
4762
 
4807
4763
  // src/editor/nodes/for/for-view.tsx
4808
- var import_react38 = require("@tiptap/react");
4764
+ var import_react42 = require("@tiptap/react");
4809
4765
  var import_lucide_react22 = require("lucide-react");
4810
- var import_jsx_runtime41 = require("react/jsx-runtime");
4811
- function ForView(_) {
4812
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
4813
- import_react38.NodeViewWrapper,
4766
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4767
+ function ForView(props) {
4768
+ const { editor, getPos } = props;
4769
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4770
+ import_react42.NodeViewWrapper,
4814
4771
  {
4815
4772
  draggable: "true",
4816
4773
  "data-drag-handle": "",
4817
4774
  "data-type": "for",
4818
4775
  className: "mly-relative",
4819
4776
  children: [
4820
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react38.NodeViewContent, { className: "is-editable" }),
4821
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
4777
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react42.NodeViewContent, { className: "is-editable" }),
4778
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4822
4779
  "div",
4823
4780
  {
4781
+ role: "button",
4824
4782
  "data-repeat-indicator": "",
4825
- className: "mly-absolute mly-inset-y-0 mly-right-0 mly-flex mly-translate-x-full mly-flex-col mly-items-center mly-gap-1 mly-opacity-60",
4783
+ className: "mly-absolute mly-inset-y-0 mly-right-0 mly-flex mly-translate-x-full mly-cursor-pointer mly-flex-col mly-items-center mly-gap-1 mly-opacity-60",
4826
4784
  contentEditable: false,
4785
+ onClick: () => {
4786
+ editor.commands.setNodeSelection(getPos());
4787
+ },
4827
4788
  children: [
4828
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Repeat2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
4829
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
4789
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.Repeat2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
4790
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
4830
4791
  ]
4831
4792
  }
4832
4793
  )
@@ -4836,7 +4797,7 @@ function ForView(_) {
4836
4797
  }
4837
4798
 
4838
4799
  // src/editor/nodes/for/for.ts
4839
- var ForExtension = import_core14.Node.create({
4800
+ var ForExtension = import_core13.Node.create({
4840
4801
  name: "for",
4841
4802
  group: "block",
4842
4803
  content: "(block|columns)+",
@@ -4887,7 +4848,7 @@ var ForExtension = import_core14.Node.create({
4887
4848
  renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
4888
4849
  return [
4889
4850
  "div",
4890
- (0, import_core14.mergeAttributes)(HTMLAttributes2, {
4851
+ (0, import_core13.mergeAttributes)(HTMLAttributes2, {
4891
4852
  "data-type": this.name
4892
4853
  }),
4893
4854
  0
@@ -4910,21 +4871,259 @@ var ForExtension = import_core14.Node.create({
4910
4871
  };
4911
4872
  },
4912
4873
  addNodeView() {
4913
- return (0, import_react39.ReactNodeViewRenderer)(ForView, {
4914
- contentDOMElementTag: "div"
4874
+ return (0, import_react43.ReactNodeViewRenderer)(ForView, {
4875
+ contentDOMElementTag: "div",
4876
+ className: "mly-relative"
4915
4877
  });
4916
4878
  }
4917
4879
  });
4918
4880
 
4881
+ // src/editor/components/text-menu/text-bubble-menu.tsx
4882
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4883
+ function TextBubbleMenu(props) {
4884
+ var _a;
4885
+ const { editor, appendTo } = props;
4886
+ if (!editor) {
4887
+ return null;
4888
+ }
4889
+ const items = [
4890
+ {
4891
+ name: "bold",
4892
+ isActive: () => editor == null ? void 0 : editor.isActive("bold"),
4893
+ command: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
4894
+ icon: import_lucide_react23.BoldIcon,
4895
+ tooltip: "Bold"
4896
+ },
4897
+ {
4898
+ name: "italic",
4899
+ isActive: () => editor == null ? void 0 : editor.isActive("italic"),
4900
+ command: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
4901
+ icon: import_lucide_react23.ItalicIcon,
4902
+ tooltip: "Italic"
4903
+ },
4904
+ {
4905
+ name: "underline",
4906
+ isActive: () => editor == null ? void 0 : editor.isActive("underline"),
4907
+ command: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run(),
4908
+ icon: import_lucide_react23.UnderlineIcon,
4909
+ tooltip: "Underline"
4910
+ },
4911
+ {
4912
+ name: "strike",
4913
+ isActive: () => editor == null ? void 0 : editor.isActive("strike"),
4914
+ command: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
4915
+ icon: import_lucide_react23.StrikethroughIcon,
4916
+ tooltip: "Strikethrough"
4917
+ },
4918
+ {
4919
+ name: "code",
4920
+ isActive: () => editor == null ? void 0 : editor.isActive("code"),
4921
+ command: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
4922
+ icon: import_lucide_react23.CodeIcon,
4923
+ tooltip: "Code"
4924
+ }
4925
+ ];
4926
+ const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
4927
+ pluginKey: "textMenu",
4928
+ shouldShow: ({ editor: editor2, from, view }) => {
4929
+ var _a2;
4930
+ if (!view || editor2.view.dragging) {
4931
+ return false;
4932
+ }
4933
+ const domAtPos = view.domAtPos(from || 0).node;
4934
+ const nodeDOM = view.nodeDOM(from || 0);
4935
+ const node = nodeDOM || domAtPos;
4936
+ if (isCustomNodeSelected(editor2, node)) {
4937
+ return false;
4938
+ }
4939
+ const nestedNodes = [
4940
+ ForExtension.name,
4941
+ SectionExtension.name,
4942
+ ColumnsExtension.name,
4943
+ ColumnExtension.name
4944
+ ];
4945
+ const isNestedNodeSelected = nestedNodes.some((name) => editor2.isActive(name)) && ((_a2 = node == null ? void 0 : node.classList) == null ? void 0 : _a2.contains("ProseMirror-selectednode"));
4946
+ return isTextSelected(editor2) && !isNestedNodeSelected;
4947
+ },
4948
+ tippyOptions: {
4949
+ popperOptions: {
4950
+ placement: "top-start",
4951
+ modifiers: [
4952
+ {
4953
+ name: "preventOverflow",
4954
+ options: {
4955
+ boundary: "viewport",
4956
+ padding: 8
4957
+ }
4958
+ },
4959
+ {
4960
+ name: "flip",
4961
+ options: {
4962
+ fallbackPlacements: ["bottom-start", "top-end", "bottom-end"]
4963
+ }
4964
+ }
4965
+ ]
4966
+ },
4967
+ maxWidth: "100%"
4968
+ }
4969
+ });
4970
+ const state = useTextMenuState(editor);
4971
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4972
+ import_react44.BubbleMenu,
4973
+ __spreadProps(__spreadValues({}, bubbleMenuProps), {
4974
+ className: "mly-flex mly-gap-1 mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
4975
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(TooltipProvider, { children: [
4976
+ items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(BubbleMenuButton, __spreadValues({}, item), index)),
4977
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4978
+ AlignmentSwitch,
4979
+ {
4980
+ alignment: state.textAlign,
4981
+ onAlignmentChange: (alignment) => {
4982
+ editor == null ? void 0 : editor.chain().focus().setTextAlign(alignment).run();
4983
+ }
4984
+ }
4985
+ ),
4986
+ !state.isListActive && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
4987
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4988
+ BubbleMenuButton,
4989
+ {
4990
+ icon: import_lucide_react23.List,
4991
+ command: () => {
4992
+ editor.chain().focus().toggleBulletList().run();
4993
+ },
4994
+ tooltip: "Bullet List"
4995
+ }
4996
+ ),
4997
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4998
+ BubbleMenuButton,
4999
+ {
5000
+ icon: import_lucide_react23.ListOrdered,
5001
+ command: () => {
5002
+ editor.chain().focus().toggleOrderedList().run();
5003
+ },
5004
+ tooltip: "Ordered List"
5005
+ }
5006
+ )
5007
+ ] }),
5008
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5009
+ LinkInputPopover,
5010
+ {
5011
+ defaultValue: (_a = state == null ? void 0 : state.linkUrl) != null ? _a : "",
5012
+ onValueChange: (value) => {
5013
+ const defaultValueWithoutProtocol = value.replace(
5014
+ /https?:\/\//,
5015
+ ""
5016
+ );
5017
+ if (!defaultValueWithoutProtocol) {
5018
+ editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").unsetLink().unsetUnderline().run();
5019
+ return;
5020
+ }
5021
+ editor == null ? void 0 : editor.chain().extendMarkRange("link").setLink({ href: value }).setUnderline().run();
5022
+ },
5023
+ tooltip: "External URL"
5024
+ }
5025
+ ),
5026
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Divider, {}),
5027
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5028
+ ColorPicker,
5029
+ {
5030
+ color: state.currentTextColor,
5031
+ onColorChange: (color) => {
5032
+ editor == null ? void 0 : editor.chain().setColor(color).run();
5033
+ },
5034
+ tooltip: "Text Color",
5035
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5036
+ BaseButton,
5037
+ {
5038
+ variant: "ghost",
5039
+ size: "sm",
5040
+ type: "button",
5041
+ className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
5042
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
5043
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700", children: "A" }),
5044
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5045
+ "div",
5046
+ {
5047
+ className: "mly-h-[2px] mly-w-3",
5048
+ style: { backgroundColor: state.currentTextColor }
5049
+ }
5050
+ )
5051
+ ] })
5052
+ }
5053
+ )
5054
+ }
5055
+ )
5056
+ ] })
5057
+ })
5058
+ );
5059
+ }
5060
+
5061
+ // src/editor/extensions/index.ts
5062
+ var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
5063
+ var import_extension_color = require("@tiptap/extension-color");
5064
+ var import_extension_link = __toESM(require("@tiptap/extension-link"));
5065
+ var import_extension_list_item = __toESM(require("@tiptap/extension-list-item"));
5066
+ var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"));
5067
+ var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
5068
+ var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
5069
+ var import_extension_text_style = __toESM(require("@tiptap/extension-text-style"));
5070
+ var import_extension_heading = __toESM(require("@tiptap/extension-heading"));
5071
+ var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
5072
+ var import_extension_document = __toESM(require("@tiptap/extension-document"));
5073
+ var import_extension_focus = __toESM(require("@tiptap/extension-focus"));
5074
+ var import_extension_dropcursor = __toESM(require("@tiptap/extension-dropcursor"));
5075
+
5076
+ // src/editor/nodes/footer.ts
5077
+ var import_core14 = require("@tiptap/core");
5078
+ var Footer = import_core14.Node.create({
5079
+ name: "footer",
5080
+ group: "block",
5081
+ content: "inline*",
5082
+ addAttributes() {
5083
+ return {
5084
+ "maily-component": {
5085
+ default: "footer",
5086
+ renderHTML: (attributes) => {
5087
+ return {
5088
+ "data-maily-component": attributes["maily-component"]
5089
+ };
5090
+ },
5091
+ parseHTML: (element) => element == null ? void 0 : element.getAttribute("data-maily-component")
5092
+ }
5093
+ };
5094
+ },
5095
+ addCommands() {
5096
+ return {
5097
+ setFooter: () => ({ commands }) => {
5098
+ return commands.setNode(this.name);
5099
+ }
5100
+ };
5101
+ },
5102
+ parseHTML() {
5103
+ return [{ tag: 'small[data-maily-component="footer"]' }];
5104
+ },
5105
+ renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
5106
+ return [
5107
+ "small",
5108
+ (0, import_core14.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes2, {
5109
+ class: "footer mly-block mly-text-[13px] mly-text-slate-500 mly-relative"
5110
+ }),
5111
+ 0
5112
+ ];
5113
+ }
5114
+ });
5115
+
4919
5116
  // src/editor/nodes/variable/variable-suggestions.tsx
4920
- var import_react40 = require("@tiptap/react");
4921
- var import_lucide_react23 = require("lucide-react");
4922
- var import_react41 = require("react");
5117
+ var import_react45 = require("@tiptap/react");
5118
+ var import_lucide_react24 = require("lucide-react");
5119
+ var import_react46 = require("react");
4923
5120
  var import_tippy5 = __toESM(require("tippy.js"));
4924
5121
  var import_jsx_runtime42 = require("react/jsx-runtime");
4925
- var VariableList = (0, import_react41.forwardRef)((props, ref) => {
4926
- var _a, _b;
4927
- const [selectedIndex, setSelectedIndex] = (0, import_react41.useState)(0);
5122
+ var VariableList = (0, import_react46.forwardRef)((props, ref) => {
5123
+ const { items = [] } = props;
5124
+ const [selectedIndex, setSelectedIndex] = (0, import_react46.useState)(0);
5125
+ const scrollContainerRef = (0, import_react46.useRef)(null);
5126
+ const itemRefs = (0, import_react46.useRef)([]);
4928
5127
  const selectItem = (index) => {
4929
5128
  const item = props.items[index];
4930
5129
  if (!item) {
@@ -4932,19 +5131,41 @@ var VariableList = (0, import_react41.forwardRef)((props, ref) => {
4932
5131
  }
4933
5132
  props.command({ id: item });
4934
5133
  };
4935
- (0, import_react41.useEffect)(() => {
5134
+ const scrollSelectedIntoView = (index) => {
5135
+ const container = scrollContainerRef.current;
5136
+ const selectedItem = itemRefs.current[index];
5137
+ if (!container || !selectedItem) {
5138
+ return;
5139
+ }
5140
+ const containerRect = container.getBoundingClientRect();
5141
+ const itemRect = selectedItem.getBoundingClientRect();
5142
+ const padding = 4;
5143
+ if (itemRect.bottom > containerRect.bottom) {
5144
+ container.scrollTop += itemRect.bottom - containerRect.bottom + padding;
5145
+ } else if (itemRect.top < containerRect.top) {
5146
+ container.scrollTop += itemRect.top - containerRect.top - padding;
5147
+ }
5148
+ };
5149
+ (0, import_react46.useEffect)(() => {
4936
5150
  setSelectedIndex(0);
5151
+ if (scrollContainerRef.current) {
5152
+ scrollContainerRef.current.scrollTop = 0;
5153
+ }
5154
+ itemRefs.current = props.items.map(() => null);
4937
5155
  }, [props.items]);
4938
- (0, import_react41.useImperativeHandle)(ref, () => ({
5156
+ (0, import_react46.useEffect)(() => {
5157
+ scrollSelectedIntoView(selectedIndex);
5158
+ }, [selectedIndex]);
5159
+ (0, import_react46.useImperativeHandle)(ref, () => ({
4939
5160
  onKeyDown: ({ event }) => {
4940
5161
  if (event.key === "ArrowUp") {
4941
- setSelectedIndex(
4942
- (selectedIndex + props.items.length - 1) % props.items.length
4943
- );
5162
+ event.preventDefault();
5163
+ setSelectedIndex((selectedIndex + items.length - 1) % items.length);
4944
5164
  return true;
4945
5165
  }
4946
5166
  if (event.key === "ArrowDown") {
4947
- setSelectedIndex((selectedIndex + 1) % props.items.length);
5167
+ event.preventDefault();
5168
+ setSelectedIndex((selectedIndex + 1) % items.length);
4948
5169
  return true;
4949
5170
  }
4950
5171
  if (event.key === "Enter") {
@@ -4954,36 +5175,45 @@ var VariableList = (0, import_react41.forwardRef)((props, ref) => {
4954
5175
  return false;
4955
5176
  }
4956
5177
  }));
4957
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-z-50 mly-h-auto mly-min-w-[240px] mly-overflow-hidden mly-rounded-lg mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
5178
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-z-50 mly-w-64 mly-rounded-lg mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
4958
5179
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-b mly-border-gray-200 mly-bg-soft-gray/40 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
4959
5180
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
4960
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Braces, { className: "mly-size-3 mly-stroke-[2.5]" }) })
5181
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.Braces, { className: "mly-size-3 mly-stroke-[2.5]" }) })
4961
5182
  ] }),
4962
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-flex mly-flex-col mly-gap-0.5 mly-p-1", children: ((_a = props == null ? void 0 : props.items) == null ? void 0 : _a.length) ? (_b = props == null ? void 0 : props.items) == null ? void 0 : _b.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4963
- "button",
5183
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5184
+ "div",
4964
5185
  {
4965
- onClick: () => selectItem(index),
4966
- className: cn(
4967
- "mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-sm mly-text-gray-900 hover:mly-bg-soft-gray",
4968
- index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
4969
- ),
4970
- children: [
4971
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Braces, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
4972
- item
4973
- ]
4974
- },
4975
- index
4976
- )) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-sm mly-text-gray-900 hover:mly-bg-soft-gray", children: "No result" }) }),
5186
+ ref: scrollContainerRef,
5187
+ className: "mly-max-h-52 mly-overflow-y-auto mly-scrollbar-thin mly-scrollbar-track-transparent mly-scrollbar-thumb-gray-200",
5188
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-flex mly-flex-col mly-gap-0.5 mly-p-1", children: (items == null ? void 0 : items.length) ? items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
5189
+ "button",
5190
+ {
5191
+ ref: (el) => itemRefs.current[index] = el,
5192
+ onClick: () => selectItem(index),
5193
+ className: cn(
5194
+ "mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-sm mly-text-gray-900 hover:mly-bg-soft-gray",
5195
+ index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
5196
+ ),
5197
+ children: [
5198
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.Braces, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
5199
+ item
5200
+ ]
5201
+ },
5202
+ index
5203
+ )) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-flex mly-h-7 mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-[13px] mly-text-gray-900 hover:mly-bg-soft-gray", children: "No result" }) })
5204
+ }
5205
+ ),
4977
5206
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-t mly-border-gray-200 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
4978
5207
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
4979
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.ArrowDown, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
4980
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.ArrowUp, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
5208
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.ArrowDown, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
5209
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.ArrowUp, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
4981
5210
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
4982
5211
  ] }),
4983
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.CornerDownLeft, { className: "mly-size-3 mly-stroke-[2.5]" }) })
5212
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.CornerDownLeft, { className: "mly-size-3 mly-stroke-[2.5]" }) })
4984
5213
  ] })
4985
5214
  ] });
4986
5215
  });
5216
+ VariableList.displayName = "VariableList";
4987
5217
  function VariableIcon(props) {
4988
5218
  const { className, children } = props;
4989
5219
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
@@ -4998,30 +5228,22 @@ function VariableIcon(props) {
4998
5228
  );
4999
5229
  }
5000
5230
  VariableList.displayName = "VariableList";
5001
- function getVariableSuggestions(variables = [], char = DEFAULT_TRIGGER_SUGGESTION_CHAR) {
5002
- const defaultVariables = variables.filter((v) => !v.iterable).map((variable) => variable.name);
5231
+ function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VARIABLE_TRIGGER_CHAR) {
5003
5232
  return {
5004
5233
  char,
5005
5234
  items: ({ query, editor }) => {
5006
- var _a, _b;
5007
- const queryLower = query.toLowerCase();
5008
- const eachKey = ((_a = editor.getAttributes("for")) == null ? void 0 : _a.each) || "";
5009
- const associatedVariableKeys = ((_b = variables.find((v) => v.name === eachKey)) == null ? void 0 : _b.keys) || [];
5010
- const filteredVariableKeys = defaultVariables.filter(
5011
- (name) => name.toLowerCase().startsWith(queryLower)
5012
- );
5013
- const combinedKeys = [...associatedVariableKeys, ...filteredVariableKeys];
5014
- if (query.length > 0 && !filteredVariableKeys.includes(query)) {
5015
- combinedKeys.push(query);
5016
- }
5017
- return combinedKeys.slice(0, 5);
5235
+ return processVariables(variables, {
5236
+ query,
5237
+ editor,
5238
+ from: "variable"
5239
+ }).map((variable) => variable.name);
5018
5240
  },
5019
5241
  render: () => {
5020
5242
  let component;
5021
5243
  let popup = null;
5022
5244
  return {
5023
5245
  onStart: (props) => {
5024
- component = new import_react40.ReactRenderer(VariableList, {
5246
+ component = new import_react45.ReactRenderer(VariableList, {
5025
5247
  props,
5026
5248
  editor: props.editor
5027
5249
  });
@@ -5110,14 +5332,14 @@ var updateScrollView = (container, item) => {
5110
5332
  };
5111
5333
 
5112
5334
  // src/editor/extensions/slash-command/slash-command-view.tsx
5113
- var import_react42 = require("@tiptap/react");
5114
- var import_react43 = require("react");
5335
+ var import_react47 = require("@tiptap/react");
5336
+ var import_react48 = require("react");
5115
5337
  var import_tippy6 = __toESM(require("tippy.js"));
5116
5338
  var import_jsx_runtime43 = require("react/jsx-runtime");
5117
5339
  function CommandList(props) {
5118
5340
  const { items, command, editor } = props;
5119
- const [selectedIndex, setSelectedIndex] = (0, import_react43.useState)(0);
5120
- const selectItem = (0, import_react43.useCallback)(
5341
+ const [selectedIndex, setSelectedIndex] = (0, import_react48.useState)(0);
5342
+ const selectItem = (0, import_react48.useCallback)(
5121
5343
  (index) => {
5122
5344
  const item = items[index];
5123
5345
  if (item) {
@@ -5127,7 +5349,7 @@ function CommandList(props) {
5127
5349
  // eslint-disable-next-line react-hooks/exhaustive-deps
5128
5350
  [command, editor, items]
5129
5351
  );
5130
- (0, import_react43.useEffect)(() => {
5352
+ (0, import_react48.useEffect)(() => {
5131
5353
  const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];
5132
5354
  const onKeyDown = (e) => {
5133
5355
  if (navigationKeys.includes(e.key)) {
@@ -5152,11 +5374,11 @@ function CommandList(props) {
5152
5374
  document.removeEventListener("keydown", onKeyDown);
5153
5375
  };
5154
5376
  }, [items, selectedIndex, setSelectedIndex, selectItem]);
5155
- (0, import_react43.useEffect)(() => {
5377
+ (0, import_react48.useEffect)(() => {
5156
5378
  setSelectedIndex(0);
5157
5379
  }, [items]);
5158
- const commandListContainer = (0, import_react43.useRef)(null);
5159
- (0, import_react43.useLayoutEffect)(() => {
5380
+ const commandListContainer = (0, import_react48.useRef)(null);
5381
+ (0, import_react48.useLayoutEffect)(() => {
5160
5382
  const container = commandListContainer == null ? void 0 : commandListContainer.current;
5161
5383
  const item = container == null ? void 0 : container.children[selectedIndex];
5162
5384
  if (item && container) {
@@ -5229,7 +5451,7 @@ function getSlashCommandSuggestions(commands = []) {
5229
5451
  let popup = null;
5230
5452
  return {
5231
5453
  onStart: (props) => {
5232
- component = new import_react42.ReactRenderer(CommandList, {
5454
+ component = new import_react47.ReactRenderer(CommandList, {
5233
5455
  props,
5234
5456
  editor: props.editor
5235
5457
  });
@@ -5270,25 +5492,43 @@ function getSlashCommandSuggestions(commands = []) {
5270
5492
 
5271
5493
  // src/editor/extensions/index.ts
5272
5494
  function extensions(props) {
5273
- const { variables, blocks, triggerSuggestionCharacter } = props;
5495
+ const { variables, blocks, variableTriggerCharacter } = props;
5274
5496
  return [
5275
5497
  import_extension_document.default.extend({
5276
5498
  content: "(block|columns)+"
5277
5499
  }),
5278
- Columns,
5279
- Column,
5500
+ ColumnsExtension,
5501
+ ColumnExtension,
5280
5502
  import_starter_kit.default.configure({
5281
5503
  heading: {
5282
- levels: [1, 2, 3]
5504
+ levels: [1, 2, 3],
5505
+ HTMLAttributes: {
5506
+ class: "mly-relative"
5507
+ }
5283
5508
  },
5284
5509
  code: {
5285
5510
  HTMLAttributes: {
5286
- class: "mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"
5511
+ class: "mly-px-1 mly-relative mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"
5287
5512
  }
5288
5513
  },
5289
5514
  blockquote: {
5290
5515
  HTMLAttributes: {
5291
- class: "mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"
5516
+ class: "mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4 mly-relative"
5517
+ }
5518
+ },
5519
+ paragraph: {
5520
+ HTMLAttributes: {
5521
+ class: "mly-relative"
5522
+ }
5523
+ },
5524
+ bulletList: {
5525
+ HTMLAttributes: {
5526
+ class: "mly-relative"
5527
+ }
5528
+ },
5529
+ orderedList: {
5530
+ HTMLAttributes: {
5531
+ class: "mly-relative"
5292
5532
  }
5293
5533
  },
5294
5534
  horizontalRule: false,
@@ -5305,9 +5545,14 @@ function extensions(props) {
5305
5545
  placeholder: ({ node }) => {
5306
5546
  if (node.type.name === "heading") {
5307
5547
  return `Heading ${node.attrs.level}`;
5308
- } else if (["columns", "column", "section", "for", "show"].includes(
5309
- node.type.name
5310
- )) {
5548
+ } else if ([
5549
+ "columns",
5550
+ "column",
5551
+ "section",
5552
+ "for",
5553
+ "show",
5554
+ "blockquote"
5555
+ ].includes(node.type.name)) {
5311
5556
  return "";
5312
5557
  }
5313
5558
  return "Write something or / to see commands";
@@ -5322,7 +5567,8 @@ function extensions(props) {
5322
5567
  import_extension_link.default.configure({
5323
5568
  HTMLAttributes: {
5324
5569
  target: "_blank",
5325
- rel: "noopener noreferrer nofollow"
5570
+ rel: "noopener noreferrer nofollow",
5571
+ class: "mly-no-underline"
5326
5572
  },
5327
5573
  openOnClick: false
5328
5574
  }),
@@ -5338,7 +5584,7 @@ function extensions(props) {
5338
5584
  }),
5339
5585
  ButtonExtension,
5340
5586
  VariableExtension.configure({
5341
- suggestion: getVariableSuggestions(variables, triggerSuggestionCharacter)
5587
+ suggestion: getVariableSuggestions(variables, variableTriggerCharacter)
5342
5588
  })
5343
5589
  ];
5344
5590
  }
@@ -5361,9 +5607,9 @@ function Editor8(props) {
5361
5607
  extensions: extensions2,
5362
5608
  contentHtml,
5363
5609
  contentJson,
5364
- variables,
5610
+ variables = DEFAULT_VARIABLES,
5365
5611
  blocks = DEFAULT_SLASH_COMMANDS,
5366
- triggerSuggestionCharacter = DEFAULT_TRIGGER_SUGGESTION_CHAR
5612
+ variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR
5367
5613
  } = props;
5368
5614
  let formattedContent = null;
5369
5615
  if (contentJson) {
@@ -5384,8 +5630,8 @@ function Editor8(props) {
5384
5630
  ]
5385
5631
  };
5386
5632
  }
5387
- const menuContainerRef = (0, import_react45.useRef)(null);
5388
- const editor = (0, import_react44.useEditor)({
5633
+ const menuContainerRef = (0, import_react50.useRef)(null);
5634
+ const editor = (0, import_react49.useEditor)({
5389
5635
  editorProps: {
5390
5636
  attributes: {
5391
5637
  class: cn(`mly-prose mly-w-full`, contentClassName),
@@ -5413,7 +5659,7 @@ function Editor8(props) {
5413
5659
  ...extensions({
5414
5660
  variables,
5415
5661
  blocks,
5416
- triggerSuggestionCharacter
5662
+ variableTriggerCharacter
5417
5663
  }),
5418
5664
  ...extensions2 || []
5419
5665
  ],
@@ -5428,7 +5674,7 @@ function Editor8(props) {
5428
5674
  {
5429
5675
  variables,
5430
5676
  blocks,
5431
- triggerSuggestionCharacter,
5677
+ variableTriggerCharacter,
5432
5678
  children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5433
5679
  "div",
5434
5680
  {
@@ -5447,7 +5693,7 @@ function Editor8(props) {
5447
5693
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
5448
5694
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
5449
5695
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
5450
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react44.EditorContent, { editor }),
5696
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react49.EditorContent, { editor }),
5451
5697
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
5452
5698
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
5453
5699
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ContentMenu, { editor }),