@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.d.mts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +1798 -1552
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1760 -1502
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/readme.md +52 -22
package/dist/index.mjs
CHANGED
|
@@ -54,21 +54,21 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/styles/index.css
|
|
57
|
-
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
|
|
57
|
+
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');
|
|
58
58
|
|
|
59
59
|
// src/styles/preflight.css
|
|
60
60
|
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');
|
|
61
61
|
|
|
62
62
|
// src/styles/tailwind.css
|
|
63
|
-
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');
|
|
63
|
+
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');
|
|
64
64
|
|
|
65
65
|
// src/editor/index.tsx
|
|
66
66
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
67
|
-
import { useRef as
|
|
67
|
+
import { useRef as useRef10 } from "react";
|
|
68
68
|
|
|
69
69
|
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
70
70
|
import { BubbleMenu } from "@tiptap/react";
|
|
71
|
-
import { useCallback } from "react";
|
|
71
|
+
import { useCallback as useCallback2 } from "react";
|
|
72
72
|
|
|
73
73
|
// src/editor/utils/get-render-container.ts
|
|
74
74
|
function getRenderContainer(editor, nodeType) {
|
|
@@ -161,7 +161,7 @@ import { Node, mergeAttributes } from "@tiptap/core";
|
|
|
161
161
|
import { v4 as uuid } from "uuid";
|
|
162
162
|
var DEFAULT_COLUMN_WIDTH = "auto";
|
|
163
163
|
var DEFAULT_COLUMN_VERTICAL_ALIGN = "top";
|
|
164
|
-
var
|
|
164
|
+
var ColumnExtension = Node.create({
|
|
165
165
|
name: "column",
|
|
166
166
|
content: "block+",
|
|
167
167
|
isolating: true,
|
|
@@ -488,7 +488,7 @@ var BaseButton = React2.forwardRef(
|
|
|
488
488
|
"asChild"
|
|
489
489
|
]);
|
|
490
490
|
const Comp = asChild ? Slot : "button";
|
|
491
|
-
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";
|
|
491
|
+
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 ";
|
|
492
492
|
const variantClasses = {
|
|
493
493
|
default: "mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-soft-gray",
|
|
494
494
|
destructive: "mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",
|
|
@@ -600,7 +600,7 @@ function VerticalAlignmentSwitch(props) {
|
|
|
600
600
|
}
|
|
601
601
|
|
|
602
602
|
// src/editor/components/show-popover.tsx
|
|
603
|
-
import { Braces,
|
|
603
|
+
import { Braces, Eye } from "lucide-react";
|
|
604
604
|
|
|
605
605
|
// src/editor/components/popover.tsx
|
|
606
606
|
import * as React3 from "react";
|
|
@@ -627,1088 +627,1150 @@ var PopoverContent = React3.forwardRef((_a, ref) => {
|
|
|
627
627
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
628
628
|
|
|
629
629
|
// src/editor/components/show-popover.tsx
|
|
630
|
-
import { useRef, useState } from "react";
|
|
631
|
-
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
632
|
-
function ShowPopover(props) {
|
|
633
|
-
const { showIfKey, onShowIfKeyValueChange } = props;
|
|
634
|
-
const [isUpdatingKey, setIsUpdatingKey] = useState(false);
|
|
635
|
-
const inputRef = useRef(null);
|
|
636
|
-
const isValidWhenKey = showIfKey !== void 0 && showIfKey !== "";
|
|
637
|
-
return /* @__PURE__ */ jsxs2(
|
|
638
|
-
Popover,
|
|
639
|
-
{
|
|
640
|
-
onOpenChange: (open) => {
|
|
641
|
-
if (open) {
|
|
642
|
-
return;
|
|
643
|
-
}
|
|
644
|
-
setIsUpdatingKey(false);
|
|
645
|
-
},
|
|
646
|
-
children: [
|
|
647
|
-
/* @__PURE__ */ jsx7(
|
|
648
|
-
PopoverTrigger,
|
|
649
|
-
{
|
|
650
|
-
className: cn(
|
|
651
|
-
"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",
|
|
652
|
-
showIfKey && "mly-bg-rose-100 mly-text-rose-800 hover:mly-bg-rose-100 data-[state=open]:mly-bg-rose-100"
|
|
653
|
-
),
|
|
654
|
-
children: /* @__PURE__ */ jsx7(Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
|
|
655
|
-
}
|
|
656
|
-
),
|
|
657
|
-
/* @__PURE__ */ jsxs2(
|
|
658
|
-
PopoverContent,
|
|
659
|
-
{
|
|
660
|
-
className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
661
|
-
side: "top",
|
|
662
|
-
sideOffset: 8,
|
|
663
|
-
align: "end",
|
|
664
|
-
onOpenAutoFocus: (e) => {
|
|
665
|
-
e.preventDefault();
|
|
666
|
-
},
|
|
667
|
-
onCloseAutoFocus: (e) => {
|
|
668
|
-
e.preventDefault();
|
|
669
|
-
},
|
|
670
|
-
children: [
|
|
671
|
-
/* @__PURE__ */ jsx7("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "Show if" }),
|
|
672
|
-
!isUpdatingKey && /* @__PURE__ */ jsxs2(
|
|
673
|
-
"button",
|
|
674
|
-
{
|
|
675
|
-
className: cn(
|
|
676
|
-
"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",
|
|
677
|
-
!isValidWhenKey && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
|
|
678
|
-
),
|
|
679
|
-
onClick: () => {
|
|
680
|
-
setIsUpdatingKey(true);
|
|
681
|
-
setTimeout(() => {
|
|
682
|
-
var _a;
|
|
683
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
684
|
-
}, 0);
|
|
685
|
-
},
|
|
686
|
-
children: [
|
|
687
|
-
/* @__PURE__ */ jsx7(Braces, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
688
|
-
/* @__PURE__ */ jsx7("span", { children: showIfKey })
|
|
689
|
-
]
|
|
690
|
-
}
|
|
691
|
-
),
|
|
692
|
-
isUpdatingKey && /* @__PURE__ */ jsx7(
|
|
693
|
-
"form",
|
|
694
|
-
{
|
|
695
|
-
onSubmit: (e) => {
|
|
696
|
-
e.preventDefault();
|
|
697
|
-
setIsUpdatingKey(false);
|
|
698
|
-
},
|
|
699
|
-
onKeyDown: (e) => {
|
|
700
|
-
if (e.key === "Escape") {
|
|
701
|
-
setIsUpdatingKey(false);
|
|
702
|
-
}
|
|
703
|
-
},
|
|
704
|
-
children: /* @__PURE__ */ jsxs2("label", { className: "mly-relative", children: [
|
|
705
|
-
/* @__PURE__ */ jsx7(
|
|
706
|
-
"input",
|
|
707
|
-
{
|
|
708
|
-
value: showIfKey || "",
|
|
709
|
-
onChange: (e) => {
|
|
710
|
-
onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(e.target.value);
|
|
711
|
-
},
|
|
712
|
-
onBlur: () => {
|
|
713
|
-
setIsUpdatingKey(false);
|
|
714
|
-
},
|
|
715
|
-
ref: inputRef,
|
|
716
|
-
type: "text",
|
|
717
|
-
placeholder: "e.g. key",
|
|
718
|
-
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"
|
|
719
|
-
}
|
|
720
|
-
),
|
|
721
|
-
/* @__PURE__ */ jsx7("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx7(CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
722
|
-
] })
|
|
723
|
-
}
|
|
724
|
-
)
|
|
725
|
-
]
|
|
726
|
-
}
|
|
727
|
-
)
|
|
728
|
-
]
|
|
729
|
-
}
|
|
730
|
-
);
|
|
731
|
-
}
|
|
630
|
+
import { useRef as useRef2, useState as useState2 } from "react";
|
|
732
631
|
|
|
733
|
-
// src/editor/
|
|
734
|
-
import {
|
|
735
|
-
import {
|
|
736
|
-
function
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
onColumnWidthChange
|
|
742
|
-
} = props;
|
|
743
|
-
return /* @__PURE__ */ jsxs3(Popover, { children: [
|
|
744
|
-
/* @__PURE__ */ jsx8(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__ */ jsx8(SlidersVertical, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" }) }),
|
|
745
|
-
/* @__PURE__ */ jsxs3(
|
|
746
|
-
PopoverContent,
|
|
747
|
-
{
|
|
748
|
-
className: "mly-w-[300px] mly-rounded-lg !mly-p-0.5",
|
|
749
|
-
side: "top",
|
|
750
|
-
sideOffset: 8,
|
|
751
|
-
align: "center",
|
|
752
|
-
onOpenAutoFocus: (e) => {
|
|
753
|
-
e.preventDefault();
|
|
754
|
-
},
|
|
755
|
-
onCloseAutoFocus: (e) => {
|
|
756
|
-
e.preventDefault();
|
|
757
|
-
},
|
|
758
|
-
children: [
|
|
759
|
-
/* @__PURE__ */ jsxs3("div", { className: "mly-grid mly-grid-cols-2 mly-gap-1", children: [
|
|
760
|
-
/* @__PURE__ */ jsxs3(
|
|
761
|
-
SwitchButton,
|
|
762
|
-
{
|
|
763
|
-
onClick: () => onColumnsCountChange(2),
|
|
764
|
-
isActive: columnsCount === 2,
|
|
765
|
-
children: [
|
|
766
|
-
/* @__PURE__ */ jsx8(Columns2, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
|
|
767
|
-
/* @__PURE__ */ jsx8("span", { children: "2 Columns" })
|
|
768
|
-
]
|
|
769
|
-
}
|
|
770
|
-
),
|
|
771
|
-
/* @__PURE__ */ jsxs3(
|
|
772
|
-
SwitchButton,
|
|
773
|
-
{
|
|
774
|
-
onClick: () => onColumnsCountChange(3),
|
|
775
|
-
isActive: columnsCount === 3,
|
|
776
|
-
children: [
|
|
777
|
-
/* @__PURE__ */ jsx8(Columns3, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
|
|
778
|
-
/* @__PURE__ */ jsx8("span", { children: "3 Columns" })
|
|
779
|
-
]
|
|
780
|
-
}
|
|
781
|
-
)
|
|
782
|
-
] }),
|
|
783
|
-
/* @__PURE__ */ jsx8("hr", { className: "mly-my-0.5 mly-border-gray-200" }),
|
|
784
|
-
/* @__PURE__ */ jsx8(
|
|
785
|
-
"div",
|
|
786
|
-
{
|
|
787
|
-
className: "mly-grid mly-gap-1 mly-p-1",
|
|
788
|
-
style: { gridTemplateColumns: `repeat(${columnsCount}, 1fr)` },
|
|
789
|
-
children: Array.from({ length: columnsCount }).map((_, index) => {
|
|
790
|
-
const value = columnWidths[index] === "auto" ? "" : columnWidths[index];
|
|
791
|
-
const label = columnsCount === 2 ? index === 0 ? "Left" : "Right" : index === 0 ? "Left" : index === 1 ? "Middle" : "Right";
|
|
792
|
-
return /* @__PURE__ */ jsxs3("div", { className: "mly-flex mly-flex-col mly-gap-1", children: [
|
|
793
|
-
/* @__PURE__ */ jsx8("span", { className: "mly-text-xs mly-text-gray-400", children: label }),
|
|
794
|
-
/* @__PURE__ */ jsxs3("label", { className: "mly-relative", children: [
|
|
795
|
-
/* @__PURE__ */ jsx8(
|
|
796
|
-
"input",
|
|
797
|
-
{
|
|
798
|
-
placeholder: "auto",
|
|
799
|
-
min: 1,
|
|
800
|
-
max: 90,
|
|
801
|
-
type: "number",
|
|
802
|
-
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",
|
|
803
|
-
value,
|
|
804
|
-
onChange: (e) => {
|
|
805
|
-
const value2 = e.target.value;
|
|
806
|
-
onColumnWidthChange == null ? void 0 : onColumnWidthChange(index, value2);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
),
|
|
810
|
-
/* @__PURE__ */ jsx8("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: "%" })
|
|
811
|
-
] })
|
|
812
|
-
] }, index);
|
|
813
|
-
})
|
|
814
|
-
}
|
|
815
|
-
)
|
|
816
|
-
]
|
|
632
|
+
// src/editor/utils/use-outside-click.ts
|
|
633
|
+
import { useCallback } from "react";
|
|
634
|
+
import { useEffect } from "react";
|
|
635
|
+
function useOutsideClick(ref, callback) {
|
|
636
|
+
const handleClick = useCallback(
|
|
637
|
+
(e) => {
|
|
638
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
639
|
+
callback();
|
|
817
640
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}
|
|
821
|
-
function SwitchButton(props) {
|
|
822
|
-
const { onClick, isActive = false, children } = props;
|
|
823
|
-
return /* @__PURE__ */ jsx8(
|
|
824
|
-
"button",
|
|
825
|
-
{
|
|
826
|
-
className: cn(
|
|
827
|
-
"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",
|
|
828
|
-
isActive && "mly-bg-soft-gray mly-text-midnight-gray"
|
|
829
|
-
),
|
|
830
|
-
onClick,
|
|
831
|
-
children
|
|
832
|
-
}
|
|
641
|
+
},
|
|
642
|
+
[ref, callback]
|
|
833
643
|
);
|
|
644
|
+
useEffect(() => {
|
|
645
|
+
document.addEventListener("mousedown", handleClick);
|
|
646
|
+
document.addEventListener("touchstart", handleClick);
|
|
647
|
+
return () => {
|
|
648
|
+
document.removeEventListener("mousedown", handleClick);
|
|
649
|
+
document.removeEventListener("touchstart", handleClick);
|
|
650
|
+
};
|
|
651
|
+
}, [handleClick]);
|
|
834
652
|
}
|
|
835
653
|
|
|
836
|
-
// src/editor/components/ui/
|
|
837
|
-
import {
|
|
838
|
-
import {
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
value,
|
|
654
|
+
// src/editor/components/ui/input-autocomplete.tsx
|
|
655
|
+
import { CornerDownLeft } from "lucide-react";
|
|
656
|
+
import { forwardRef as forwardRef4, useState, useRef } from "react";
|
|
657
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
658
|
+
var InputAutocomplete = forwardRef4((props, ref) => {
|
|
659
|
+
const _a = props, {
|
|
660
|
+
value = "",
|
|
844
661
|
onValueChange,
|
|
845
|
-
tooltip,
|
|
846
662
|
className,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
663
|
+
onOutsideClick,
|
|
664
|
+
onSelectOption,
|
|
665
|
+
autoCompleteOptions = []
|
|
666
|
+
} = _a, inputProps = __objRest(_a, [
|
|
667
|
+
"value",
|
|
668
|
+
"onValueChange",
|
|
669
|
+
"className",
|
|
670
|
+
"onOutsideClick",
|
|
671
|
+
"onSelectOption",
|
|
672
|
+
"autoCompleteOptions"
|
|
673
|
+
]);
|
|
674
|
+
const containerRef = useRef(null);
|
|
675
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
676
|
+
useOutsideClick(containerRef, () => {
|
|
677
|
+
onOutsideClick == null ? void 0 : onOutsideClick();
|
|
678
|
+
});
|
|
679
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("mly-relative", className), ref: containerRef, children: [
|
|
680
|
+
/* @__PURE__ */ jsxs2("label", { className: "mly-relative", children: [
|
|
681
|
+
/* @__PURE__ */ jsx7(
|
|
682
|
+
"input",
|
|
683
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
684
|
+
ref,
|
|
685
|
+
value,
|
|
686
|
+
onChange: (e) => {
|
|
687
|
+
setSelectedIndex(0);
|
|
688
|
+
onValueChange(e.target.value);
|
|
689
|
+
},
|
|
690
|
+
type: "text",
|
|
691
|
+
placeholder: "e.g. items",
|
|
692
|
+
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",
|
|
693
|
+
onKeyDown: (e) => {
|
|
694
|
+
if (e.key === "ArrowDown") {
|
|
695
|
+
e.preventDefault();
|
|
696
|
+
setSelectedIndex(
|
|
697
|
+
(prev) => Math.min(prev + 1, autoCompleteOptions.length - 1)
|
|
698
|
+
);
|
|
699
|
+
} else if (e.key === "ArrowUp") {
|
|
700
|
+
e.preventDefault();
|
|
701
|
+
setSelectedIndex((prev) => Math.max(prev - 1, 0));
|
|
702
|
+
} else if (e.key === "Enter") {
|
|
703
|
+
e.preventDefault();
|
|
704
|
+
const _value = autoCompleteOptions[selectedIndex];
|
|
705
|
+
onValueChange(_value);
|
|
706
|
+
onSelectOption == null ? void 0 : onSelectOption(_value);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
})
|
|
710
|
+
),
|
|
711
|
+
/* @__PURE__ */ jsx7("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx7(CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
712
|
+
] }),
|
|
713
|
+
autoCompleteOptions.length > 0 && /* @__PURE__ */ jsx7("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__ */ jsx7(
|
|
714
|
+
"button",
|
|
856
715
|
{
|
|
857
|
-
|
|
858
|
-
className:
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
children:
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
if (!tooltip) {
|
|
870
|
-
return content;
|
|
871
|
-
}
|
|
872
|
-
return /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
873
|
-
/* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: content }),
|
|
874
|
-
/* @__PURE__ */ jsx9(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
716
|
+
type: "button",
|
|
717
|
+
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",
|
|
718
|
+
onClick: () => {
|
|
719
|
+
onValueChange(option);
|
|
720
|
+
onSelectOption == null ? void 0 : onSelectOption(option);
|
|
721
|
+
},
|
|
722
|
+
onMouseEnter: () => setSelectedIndex(index),
|
|
723
|
+
"aria-selected": selectedIndex === index,
|
|
724
|
+
children: option
|
|
725
|
+
},
|
|
726
|
+
option
|
|
727
|
+
)) })
|
|
875
728
|
] });
|
|
876
|
-
}
|
|
729
|
+
});
|
|
730
|
+
InputAutocomplete.displayName = "InputAutocomplete";
|
|
877
731
|
|
|
878
|
-
// src/editor/
|
|
879
|
-
import {
|
|
732
|
+
// src/editor/provider.tsx
|
|
733
|
+
import { createContext, useContext } from "react";
|
|
880
734
|
|
|
881
|
-
// src/
|
|
882
|
-
import {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
735
|
+
// src/blocks/button.tsx
|
|
736
|
+
import { MousePointer, ArrowUpRightSquare } from "lucide-react";
|
|
737
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
738
|
+
var button = {
|
|
739
|
+
title: "Button",
|
|
740
|
+
description: "Add a call to action button to email.",
|
|
741
|
+
searchTerms: ["link", "button", "cta"],
|
|
742
|
+
icon: /* @__PURE__ */ jsx8(MousePointer, { className: "mly-h-4 mly-w-4" }),
|
|
743
|
+
command: ({ editor, range }) => {
|
|
744
|
+
editor.chain().focus().deleteRange(range).setButton().run();
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
var linkCard = {
|
|
748
|
+
title: "Link Card",
|
|
749
|
+
description: "Add a link card to email.",
|
|
750
|
+
searchTerms: ["link", "button", "image"],
|
|
751
|
+
icon: /* @__PURE__ */ jsx8(ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
|
|
752
|
+
command: ({ editor, range }) => {
|
|
753
|
+
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
754
|
+
}
|
|
755
|
+
};
|
|
897
756
|
|
|
898
|
-
// src/
|
|
899
|
-
import {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
757
|
+
// src/blocks/image.tsx
|
|
758
|
+
import { ImageIcon } from "lucide-react";
|
|
759
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
760
|
+
var image = {
|
|
761
|
+
title: "Image",
|
|
762
|
+
description: "Full width image",
|
|
763
|
+
searchTerms: ["image"],
|
|
764
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
765
|
+
command: ({ editor, range }) => {
|
|
766
|
+
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
904
767
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if (count > currentColumnCount) {
|
|
916
|
-
addColumnByIndex(editor);
|
|
917
|
-
} else {
|
|
918
|
-
removeColumnByIndex(editor);
|
|
919
|
-
}
|
|
920
|
-
},
|
|
921
|
-
onColumnWidthChange: (index, width) => {
|
|
922
|
-
updateColumnWidth(editor, index, width);
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
),
|
|
926
|
-
/* @__PURE__ */ jsx10(Divider, {})
|
|
927
|
-
] }),
|
|
928
|
-
/* @__PURE__ */ jsx10(
|
|
929
|
-
VerticalAlignmentSwitch,
|
|
930
|
-
{
|
|
931
|
-
alignment: state.currentVerticalAlignment,
|
|
932
|
-
onAlignmentChange: (value) => {
|
|
933
|
-
editor.commands.updateColumn({
|
|
934
|
-
verticalAlign: value
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
),
|
|
939
|
-
/* @__PURE__ */ jsx10(Divider, {}),
|
|
940
|
-
/* @__PURE__ */ jsx10(
|
|
941
|
-
Select,
|
|
942
|
-
{
|
|
943
|
-
icon: Space,
|
|
944
|
-
label: "Columns Gap",
|
|
945
|
-
value: state.currentColumnsGap,
|
|
946
|
-
options: [
|
|
947
|
-
{ value: "0", label: "None" },
|
|
948
|
-
{ value: "4", label: "Small" },
|
|
949
|
-
{ value: "8", label: "Medium" },
|
|
950
|
-
{ value: "12", label: "Large" },
|
|
951
|
-
{ value: "16", label: "Extra Large" }
|
|
952
|
-
],
|
|
953
|
-
onValueChange: (value) => {
|
|
954
|
-
editor.commands.updateColumns({
|
|
955
|
-
gap: +value
|
|
956
|
-
});
|
|
957
|
-
},
|
|
958
|
-
tooltip: "Columns Gap"
|
|
959
|
-
}
|
|
960
|
-
),
|
|
961
|
-
/* @__PURE__ */ jsx10(Divider, {}),
|
|
962
|
-
/* @__PURE__ */ jsx10(
|
|
963
|
-
BubbleMenuButton,
|
|
964
|
-
{
|
|
965
|
-
icon: Trash,
|
|
966
|
-
tooltip: "Delete Columns",
|
|
967
|
-
command: () => {
|
|
968
|
-
deleteNode(editor, "columns");
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
),
|
|
972
|
-
/* @__PURE__ */ jsx10(Divider, {}),
|
|
973
|
-
/* @__PURE__ */ jsx10(
|
|
974
|
-
ShowPopover,
|
|
975
|
-
{
|
|
976
|
-
showIfKey: state.currentShowIfKey,
|
|
977
|
-
onShowIfKeyValueChange: (value) => {
|
|
978
|
-
editor.commands.updateColumns({
|
|
979
|
-
showIfKey: value
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
)
|
|
984
|
-
] }) });
|
|
985
|
-
}
|
|
768
|
+
};
|
|
769
|
+
var logo = {
|
|
770
|
+
title: "Logo",
|
|
771
|
+
description: "Add your brand logo",
|
|
772
|
+
searchTerms: ["image", "logo"],
|
|
773
|
+
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
774
|
+
command: ({ editor, range }) => {
|
|
775
|
+
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
776
|
+
}
|
|
777
|
+
};
|
|
986
778
|
|
|
987
|
-
// src/
|
|
988
|
-
import {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
779
|
+
// src/blocks/layout.tsx
|
|
780
|
+
import {
|
|
781
|
+
ColumnsIcon,
|
|
782
|
+
Repeat2,
|
|
783
|
+
MoveVertical,
|
|
784
|
+
RectangleHorizontal,
|
|
785
|
+
Minus
|
|
786
|
+
} from "lucide-react";
|
|
787
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
788
|
+
var columns = {
|
|
789
|
+
title: "Columns",
|
|
790
|
+
description: "Add columns to email.",
|
|
791
|
+
searchTerms: ["layout", "columns"],
|
|
792
|
+
icon: /* @__PURE__ */ jsx10(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
793
|
+
shouldBeHidden: (editor) => {
|
|
794
|
+
return editor.isActive("columns");
|
|
795
|
+
},
|
|
796
|
+
command: ({ editor, range }) => {
|
|
797
|
+
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
993
798
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
799
|
+
};
|
|
800
|
+
var section = {
|
|
801
|
+
title: "Section",
|
|
802
|
+
description: "Add a section to email.",
|
|
803
|
+
searchTerms: ["layout", "section"],
|
|
804
|
+
icon: /* @__PURE__ */ jsx10(RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
|
|
805
|
+
command: ({ editor, range }) => {
|
|
806
|
+
editor.chain().focus().deleteRange(range).setSection().run();
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
var forLoop = {
|
|
810
|
+
title: "For",
|
|
811
|
+
description: "Loop over an array of items.",
|
|
812
|
+
searchTerms: ["for", "loop"],
|
|
813
|
+
icon: /* @__PURE__ */ jsx10(Repeat2, { className: "mly-h-4 mly-w-4" }),
|
|
814
|
+
shouldBeHidden: (editor) => {
|
|
815
|
+
return editor.isActive("for");
|
|
816
|
+
},
|
|
817
|
+
command: ({ editor, range }) => {
|
|
818
|
+
editor.chain().focus().deleteRange(range).setFor().run();
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
var spacer = {
|
|
822
|
+
title: "Spacer",
|
|
823
|
+
description: "Add space between blocks.",
|
|
824
|
+
searchTerms: ["space", "gap", "divider"],
|
|
825
|
+
icon: /* @__PURE__ */ jsx10(MoveVertical, { className: "mly-h-4 mly-w-4" }),
|
|
826
|
+
command: ({ editor, range }) => {
|
|
827
|
+
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
var divider = {
|
|
831
|
+
title: "Divider",
|
|
832
|
+
description: "Add a horizontal divider.",
|
|
833
|
+
searchTerms: ["divider", "line"],
|
|
834
|
+
icon: /* @__PURE__ */ jsx10(Minus, { className: "mly-h-4 mly-w-4" }),
|
|
835
|
+
command: ({ editor, range }) => {
|
|
836
|
+
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
837
|
+
}
|
|
838
|
+
};
|
|
1027
839
|
|
|
1028
|
-
// src/
|
|
1029
|
-
import {
|
|
1030
|
-
import {
|
|
840
|
+
// src/blocks/list.tsx
|
|
841
|
+
import { List, ListOrdered } from "lucide-react";
|
|
842
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
843
|
+
var bulletList = {
|
|
844
|
+
title: "Bullet List",
|
|
845
|
+
description: "Create a simple bullet list.",
|
|
846
|
+
searchTerms: ["unordered", "point"],
|
|
847
|
+
icon: /* @__PURE__ */ jsx11(List, { className: "mly-h-4 mly-w-4" }),
|
|
848
|
+
command: ({ editor, range }) => {
|
|
849
|
+
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
var orderedList = {
|
|
853
|
+
title: "Numbered List",
|
|
854
|
+
description: "Create a list with numbering.",
|
|
855
|
+
searchTerms: ["ordered"],
|
|
856
|
+
icon: /* @__PURE__ */ jsx11(ListOrdered, { className: "mly-h-4 mly-w-4" }),
|
|
857
|
+
command: ({ editor, range }) => {
|
|
858
|
+
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
859
|
+
}
|
|
860
|
+
};
|
|
1031
861
|
|
|
1032
|
-
// src/
|
|
1033
|
-
import { useState as useState2, useRef as useRef2, useEffect } from "react";
|
|
862
|
+
// src/blocks/typography.tsx
|
|
1034
863
|
import {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
864
|
+
Text,
|
|
865
|
+
Heading1,
|
|
866
|
+
Heading2,
|
|
867
|
+
Heading3,
|
|
868
|
+
DivideIcon,
|
|
869
|
+
TextQuote,
|
|
870
|
+
FootprintsIcon,
|
|
871
|
+
EraserIcon
|
|
872
|
+
} from "lucide-react";
|
|
1038
873
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
874
|
+
var text = {
|
|
875
|
+
title: "Text",
|
|
876
|
+
description: "Just start typing with plain text.",
|
|
877
|
+
searchTerms: ["p", "paragraph"],
|
|
878
|
+
icon: /* @__PURE__ */ jsx12(Text, { className: "mly-h-4 mly-w-4" }),
|
|
879
|
+
command: ({ editor, range }) => {
|
|
880
|
+
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
var heading1 = {
|
|
884
|
+
title: "Heading 1",
|
|
885
|
+
description: "Big heading.",
|
|
886
|
+
searchTerms: ["title", "big", "large"],
|
|
887
|
+
icon: /* @__PURE__ */ jsx12(Heading1, { className: "mly-h-4 mly-w-4" }),
|
|
888
|
+
command: ({ editor, range }) => {
|
|
889
|
+
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
var heading2 = {
|
|
893
|
+
title: "Heading 2",
|
|
894
|
+
description: "Medium heading.",
|
|
895
|
+
searchTerms: ["subtitle", "medium"],
|
|
896
|
+
icon: /* @__PURE__ */ jsx12(Heading2, { className: "mly-h-4 mly-w-4" }),
|
|
897
|
+
command: ({ editor, range }) => {
|
|
898
|
+
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
var heading3 = {
|
|
902
|
+
title: "Heading 3",
|
|
903
|
+
description: "Small heading.",
|
|
904
|
+
searchTerms: ["subtitle", "small"],
|
|
905
|
+
icon: /* @__PURE__ */ jsx12(Heading3, { className: "mly-h-4 mly-w-4" }),
|
|
906
|
+
command: ({ editor, range }) => {
|
|
907
|
+
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
var hardBreak = {
|
|
911
|
+
title: "Hard Break",
|
|
912
|
+
description: "Add a break between lines.",
|
|
913
|
+
searchTerms: ["break", "line"],
|
|
914
|
+
icon: /* @__PURE__ */ jsx12(DivideIcon, { className: "mly-h-4 mly-w-4" }),
|
|
915
|
+
command: ({ editor, range }) => {
|
|
916
|
+
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
var blockquote = {
|
|
920
|
+
title: "Blockquote",
|
|
921
|
+
description: "Add blockquote.",
|
|
922
|
+
searchTerms: ["quote", "blockquote"],
|
|
923
|
+
icon: /* @__PURE__ */ jsx12(TextQuote, { className: "mly-h-4 mly-w-4" }),
|
|
924
|
+
command: ({ editor, range }) => {
|
|
925
|
+
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
var footer = {
|
|
929
|
+
title: "Footer",
|
|
930
|
+
description: "Add a footer text to email.",
|
|
931
|
+
searchTerms: ["footer", "text"],
|
|
932
|
+
icon: /* @__PURE__ */ jsx12(FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
933
|
+
command: ({ editor, range }) => {
|
|
934
|
+
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
var clearLine = {
|
|
938
|
+
title: "Clear Line",
|
|
939
|
+
description: "Clear the current line.",
|
|
940
|
+
searchTerms: ["clear", "line"],
|
|
941
|
+
icon: /* @__PURE__ */ jsx12(EraserIcon, { className: "mly-h-4 mly-w-4" }),
|
|
942
|
+
command: ({ editor, range }) => {
|
|
943
|
+
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
944
|
+
}
|
|
945
|
+
};
|
|
1078
946
|
|
|
1079
|
-
// src/editor/
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
947
|
+
// src/editor/extensions/slash-command/default-slash-commands.ts
|
|
948
|
+
var DEFAULT_SLASH_COMMANDS = [
|
|
949
|
+
text,
|
|
950
|
+
heading1,
|
|
951
|
+
heading2,
|
|
952
|
+
heading3,
|
|
953
|
+
bulletList,
|
|
954
|
+
orderedList,
|
|
955
|
+
image,
|
|
956
|
+
logo,
|
|
957
|
+
columns,
|
|
958
|
+
section,
|
|
959
|
+
forLoop,
|
|
960
|
+
divider,
|
|
961
|
+
spacer,
|
|
962
|
+
button,
|
|
963
|
+
linkCard,
|
|
964
|
+
hardBreak,
|
|
965
|
+
blockquote,
|
|
966
|
+
footer,
|
|
967
|
+
clearLine
|
|
968
|
+
];
|
|
969
|
+
|
|
970
|
+
// src/editor/provider.tsx
|
|
971
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
972
|
+
var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
|
|
973
|
+
var DEFAULT_VARIABLES = [];
|
|
974
|
+
var MailyContext = createContext({
|
|
975
|
+
variableTriggerCharacter: DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
976
|
+
variables: DEFAULT_VARIABLES,
|
|
977
|
+
blocks: DEFAULT_SLASH_COMMANDS
|
|
978
|
+
});
|
|
979
|
+
function MailyProvider(props) {
|
|
980
|
+
const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
|
|
981
|
+
if (defaultValues.variableTriggerCharacter === "") {
|
|
982
|
+
throw new Error("variableTriggerCharacter cannot be an empty string");
|
|
1104
983
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
984
|
+
return /* @__PURE__ */ jsx13(MailyContext.Provider, { value: defaultValues, children });
|
|
985
|
+
}
|
|
986
|
+
function useMailyContext() {
|
|
987
|
+
const values = useContext(MailyContext);
|
|
988
|
+
if (!values) {
|
|
989
|
+
throw new Error("Missing MailyContext.Provider in the component tree");
|
|
1108
990
|
}
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1128
|
-
return dispatch(tr);
|
|
1129
|
-
}
|
|
1130
|
-
return true;
|
|
1131
|
-
}).focus(focusPos).run();
|
|
991
|
+
return values;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// src/editor/components/show-popover.tsx
|
|
995
|
+
import { useMemo as useMemo2 } from "react";
|
|
996
|
+
import { memo } from "react";
|
|
997
|
+
|
|
998
|
+
// src/editor/utils/variable.ts
|
|
999
|
+
function processVariables(variables, options) {
|
|
1000
|
+
const { query } = options;
|
|
1001
|
+
const queryLower = query.toLowerCase();
|
|
1002
|
+
let filteredVariables = [];
|
|
1003
|
+
if (Array.isArray(variables)) {
|
|
1004
|
+
filteredVariables = variables.filter(
|
|
1005
|
+
(variable) => variable.name.toLowerCase().startsWith(queryLower)
|
|
1006
|
+
);
|
|
1007
|
+
if (query.length > 0 && !filteredVariables.some((variable) => variable.name === query)) {
|
|
1008
|
+
filteredVariables.push({ name: query, required: true });
|
|
1132
1009
|
}
|
|
1010
|
+
return filteredVariables;
|
|
1011
|
+
} else if (typeof variables === "function") {
|
|
1012
|
+
return variables(options);
|
|
1013
|
+
} else {
|
|
1014
|
+
throw new Error(`Invalid variables type. Expected 'Array' or 'Function', but received '${typeof variables}'.
|
|
1015
|
+
|
|
1016
|
+
You can check out the documentation for more information: https://github.com/arikchakma/maily.to/blob/main/packages/core/readme.md`);
|
|
1133
1017
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// src/editor/components/show-popover.tsx
|
|
1021
|
+
import { jsx as jsx14, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1022
|
+
function _ShowPopover(props) {
|
|
1023
|
+
const { showIfKey = "", onShowIfKeyValueChange, editor } = props;
|
|
1024
|
+
const { variables = [] } = useMailyContext();
|
|
1025
|
+
const [isUpdatingKey, setIsUpdatingKey] = useState2(false);
|
|
1026
|
+
const inputRef = useRef2(null);
|
|
1027
|
+
const autoCompleteOptions = useMemo2(() => {
|
|
1028
|
+
return processVariables(variables, {
|
|
1029
|
+
query: showIfKey || "",
|
|
1030
|
+
from: "variable",
|
|
1031
|
+
editor
|
|
1032
|
+
}).map((variable) => variable.name).slice(0, 5);
|
|
1033
|
+
}, [variables, showIfKey, editor]);
|
|
1034
|
+
const isValidWhenKey = showIfKey || autoCompleteOptions.includes(showIfKey);
|
|
1035
|
+
return /* @__PURE__ */ jsxs3(
|
|
1036
|
+
Popover,
|
|
1146
1037
|
{
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1038
|
+
onOpenChange: (open) => {
|
|
1039
|
+
if (open) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
setIsUpdatingKey(false);
|
|
1152
1043
|
},
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1044
|
+
children: [
|
|
1045
|
+
/* @__PURE__ */ jsx14(
|
|
1046
|
+
PopoverTrigger,
|
|
1047
|
+
{
|
|
1048
|
+
className: cn(
|
|
1049
|
+
"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",
|
|
1050
|
+
showIfKey && "mly-bg-rose-100 mly-text-rose-800 data-[state=open]:mly-bg-rose-100 hover:mly-bg-rose-100"
|
|
1051
|
+
),
|
|
1052
|
+
children: /* @__PURE__ */ jsx14(Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
|
|
1053
|
+
}
|
|
1054
|
+
),
|
|
1055
|
+
/* @__PURE__ */ jsxs3(
|
|
1056
|
+
PopoverContent,
|
|
1057
|
+
{
|
|
1058
|
+
className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
1059
|
+
side: "top",
|
|
1060
|
+
sideOffset: 8,
|
|
1061
|
+
align: "end",
|
|
1062
|
+
onOpenAutoFocus: (e) => {
|
|
1063
|
+
e.preventDefault();
|
|
1064
|
+
},
|
|
1065
|
+
onCloseAutoFocus: (e) => {
|
|
1066
|
+
e.preventDefault();
|
|
1067
|
+
},
|
|
1068
|
+
children: [
|
|
1069
|
+
/* @__PURE__ */ jsx14("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "Show if" }),
|
|
1070
|
+
!isUpdatingKey && /* @__PURE__ */ jsxs3(
|
|
1071
|
+
"button",
|
|
1174
1072
|
{
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1073
|
+
className: cn(
|
|
1074
|
+
"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",
|
|
1075
|
+
!isValidWhenKey && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
|
|
1076
|
+
),
|
|
1077
|
+
onClick: () => {
|
|
1078
|
+
setIsUpdatingKey(true);
|
|
1079
|
+
setTimeout(() => {
|
|
1080
|
+
var _a;
|
|
1081
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
1082
|
+
}, 0);
|
|
1083
|
+
},
|
|
1084
|
+
children: [
|
|
1085
|
+
/* @__PURE__ */ jsx14(Braces, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
1086
|
+
/* @__PURE__ */ jsx14("span", { children: showIfKey })
|
|
1087
|
+
]
|
|
1088
|
+
}
|
|
1089
|
+
),
|
|
1090
|
+
isUpdatingKey && /* @__PURE__ */ jsx14(
|
|
1091
|
+
"form",
|
|
1092
|
+
{
|
|
1093
|
+
onSubmit: (e) => {
|
|
1179
1094
|
e.preventDefault();
|
|
1180
|
-
|
|
1095
|
+
setIsUpdatingKey(false);
|
|
1181
1096
|
},
|
|
1182
|
-
|
|
1183
|
-
|
|
1097
|
+
onKeyDown: (e) => {
|
|
1098
|
+
if (e.key === "Escape") {
|
|
1099
|
+
setIsUpdatingKey(false);
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
children: /* @__PURE__ */ jsx14(
|
|
1103
|
+
InputAutocomplete,
|
|
1104
|
+
{
|
|
1105
|
+
value: showIfKey || "",
|
|
1106
|
+
onValueChange: (value) => {
|
|
1107
|
+
onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(value);
|
|
1108
|
+
},
|
|
1109
|
+
onOutsideClick: () => {
|
|
1110
|
+
setIsUpdatingKey(false);
|
|
1111
|
+
},
|
|
1112
|
+
onSelectOption: () => {
|
|
1113
|
+
setIsUpdatingKey(false);
|
|
1114
|
+
},
|
|
1115
|
+
autoCompleteOptions,
|
|
1116
|
+
ref: inputRef
|
|
1117
|
+
}
|
|
1118
|
+
)
|
|
1184
1119
|
}
|
|
1185
|
-
)
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1120
|
+
)
|
|
1121
|
+
]
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1124
|
+
]
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
var ShowPopover = memo(_ShowPopover);
|
|
1129
|
+
|
|
1130
|
+
// src/editor/components/column-menu/columns-width-config.tsx
|
|
1131
|
+
import { Columns2, SlidersVertical, Columns3 } from "lucide-react";
|
|
1132
|
+
import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1133
|
+
function ColumnsWidthConfig(props) {
|
|
1134
|
+
const {
|
|
1135
|
+
columnsCount = 2,
|
|
1136
|
+
onColumnsCountChange,
|
|
1137
|
+
columnWidths,
|
|
1138
|
+
onColumnWidthChange
|
|
1139
|
+
} = props;
|
|
1140
|
+
return /* @__PURE__ */ jsxs4(Popover, { children: [
|
|
1141
|
+
/* @__PURE__ */ jsx15(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__ */ jsx15(SlidersVertical, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" }) }),
|
|
1142
|
+
/* @__PURE__ */ jsxs4(
|
|
1143
|
+
PopoverContent,
|
|
1144
|
+
{
|
|
1145
|
+
className: "mly-w-[300px] mly-rounded-lg !mly-p-0.5",
|
|
1146
|
+
side: "top",
|
|
1147
|
+
sideOffset: 8,
|
|
1148
|
+
align: "center",
|
|
1149
|
+
onOpenAutoFocus: (e) => {
|
|
1150
|
+
e.preventDefault();
|
|
1151
|
+
},
|
|
1152
|
+
onCloseAutoFocus: (e) => {
|
|
1153
|
+
e.preventDefault();
|
|
1154
|
+
},
|
|
1155
|
+
children: [
|
|
1156
|
+
/* @__PURE__ */ jsxs4("div", { className: "mly-grid mly-grid-cols-2 mly-gap-1", children: [
|
|
1157
|
+
/* @__PURE__ */ jsxs4(
|
|
1158
|
+
SwitchButton,
|
|
1159
|
+
{
|
|
1160
|
+
onClick: () => onColumnsCountChange(2),
|
|
1161
|
+
isActive: columnsCount === 2,
|
|
1162
|
+
children: [
|
|
1163
|
+
/* @__PURE__ */ jsx15(Columns2, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
|
|
1164
|
+
/* @__PURE__ */ jsx15("span", { children: "2 Columns" })
|
|
1165
|
+
]
|
|
1166
|
+
}
|
|
1167
|
+
),
|
|
1168
|
+
/* @__PURE__ */ jsxs4(
|
|
1169
|
+
SwitchButton,
|
|
1170
|
+
{
|
|
1171
|
+
onClick: () => onColumnsCountChange(3),
|
|
1172
|
+
isActive: columnsCount === 3,
|
|
1173
|
+
children: [
|
|
1174
|
+
/* @__PURE__ */ jsx15(Columns3, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
|
|
1175
|
+
/* @__PURE__ */ jsx15("span", { children: "3 Columns" })
|
|
1176
|
+
]
|
|
1177
|
+
}
|
|
1178
|
+
)
|
|
1189
1179
|
] }),
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
|
|
1180
|
+
/* @__PURE__ */ jsx15("hr", { className: "mly-my-0.5 mly-border-gray-200" }),
|
|
1181
|
+
/* @__PURE__ */ jsx15(
|
|
1182
|
+
"div",
|
|
1192
1183
|
{
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
|
|
1200
|
-
{
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
children:
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
}
|
|
1221
|
-
)
|
|
1222
|
-
]
|
|
1184
|
+
className: "mly-grid mly-gap-1 mly-p-1",
|
|
1185
|
+
style: { gridTemplateColumns: `repeat(${columnsCount}, 1fr)` },
|
|
1186
|
+
children: Array.from({ length: columnsCount }).map((_, index) => {
|
|
1187
|
+
const value = columnWidths[index] === "auto" ? "" : columnWidths[index];
|
|
1188
|
+
const label = columnsCount === 2 ? index === 0 ? "Left" : "Right" : index === 0 ? "Left" : index === 1 ? "Middle" : "Right";
|
|
1189
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mly-flex mly-flex-col mly-gap-1", children: [
|
|
1190
|
+
/* @__PURE__ */ jsx15("span", { className: "mly-text-xs mly-text-gray-400", children: label }),
|
|
1191
|
+
/* @__PURE__ */ jsxs4("label", { className: "mly-relative", children: [
|
|
1192
|
+
/* @__PURE__ */ jsx15(
|
|
1193
|
+
"input",
|
|
1194
|
+
{
|
|
1195
|
+
placeholder: "auto",
|
|
1196
|
+
min: 1,
|
|
1197
|
+
max: 90,
|
|
1198
|
+
type: "number",
|
|
1199
|
+
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",
|
|
1200
|
+
value,
|
|
1201
|
+
onChange: (e) => {
|
|
1202
|
+
const value2 = e.target.value;
|
|
1203
|
+
onColumnWidthChange == null ? void 0 : onColumnWidthChange(index, value2);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ jsx15("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: "%" })
|
|
1208
|
+
] })
|
|
1209
|
+
] }, index);
|
|
1210
|
+
})
|
|
1223
1211
|
}
|
|
1224
1212
|
)
|
|
1225
|
-
]
|
|
1226
|
-
|
|
1213
|
+
]
|
|
1214
|
+
}
|
|
1215
|
+
)
|
|
1216
|
+
] });
|
|
1217
|
+
}
|
|
1218
|
+
function SwitchButton(props) {
|
|
1219
|
+
const { onClick, isActive = false, children } = props;
|
|
1220
|
+
return /* @__PURE__ */ jsx15(
|
|
1221
|
+
"button",
|
|
1222
|
+
{
|
|
1223
|
+
className: cn(
|
|
1224
|
+
"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",
|
|
1225
|
+
isActive && "mly-bg-soft-gray mly-text-midnight-gray"
|
|
1226
|
+
),
|
|
1227
|
+
onClick,
|
|
1228
|
+
children
|
|
1227
1229
|
}
|
|
1228
1230
|
);
|
|
1229
1231
|
}
|
|
1230
1232
|
|
|
1231
|
-
// src/editor/components/
|
|
1232
|
-
import {
|
|
1233
|
-
import {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
()
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
command: () => editor.chain().focus().toggleBold().run(),
|
|
1253
|
-
isActive: () => editor.isActive("bold"),
|
|
1254
|
-
group: "mark",
|
|
1255
|
-
icon: BoldIcon
|
|
1256
|
-
},
|
|
1257
|
-
{
|
|
1258
|
-
name: "italic",
|
|
1259
|
-
command: () => editor.chain().focus().toggleItalic().run(),
|
|
1260
|
-
isActive: () => editor.isActive("italic"),
|
|
1261
|
-
group: "mark",
|
|
1262
|
-
icon: ItalicIcon
|
|
1263
|
-
},
|
|
1264
|
-
{
|
|
1265
|
-
name: "underline",
|
|
1266
|
-
command: () => editor.chain().focus().toggleUnderline().run(),
|
|
1267
|
-
isActive: () => editor.isActive("underline"),
|
|
1268
|
-
group: "mark",
|
|
1269
|
-
icon: UnderlineIcon
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
name: "strike",
|
|
1273
|
-
command: () => editor.chain().focus().toggleStrike().run(),
|
|
1274
|
-
isActive: () => editor.isActive("strike"),
|
|
1275
|
-
group: "mark",
|
|
1276
|
-
icon: StrikethroughIcon
|
|
1277
|
-
},
|
|
1278
|
-
{
|
|
1279
|
-
name: "delete-line",
|
|
1280
|
-
command: () => editor.chain().focus().selectParentNode().deleteSelection().run(),
|
|
1281
|
-
isActive: () => false,
|
|
1282
|
-
group: "mark",
|
|
1283
|
-
icon: EraserIcon
|
|
1284
|
-
},
|
|
1285
|
-
{
|
|
1286
|
-
name: "divider",
|
|
1287
|
-
command: () => editor.chain().focus().setHorizontalRule().run(),
|
|
1288
|
-
isActive: () => editor.isActive("horizontalRule"),
|
|
1289
|
-
group: "custom",
|
|
1290
|
-
icon: SeparatorHorizontal
|
|
1291
|
-
},
|
|
1292
|
-
{
|
|
1293
|
-
name: "link",
|
|
1294
|
-
command: () => {
|
|
1295
|
-
const previousUrl = editor.getAttributes("link").href;
|
|
1296
|
-
const url = window.prompt("URL", previousUrl);
|
|
1297
|
-
if (url === null) return;
|
|
1298
|
-
if (url === "") {
|
|
1299
|
-
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
1300
|
-
return;
|
|
1301
|
-
}
|
|
1302
|
-
editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
1303
|
-
},
|
|
1304
|
-
isActive: () => editor.isActive("link"),
|
|
1305
|
-
group: "custom",
|
|
1306
|
-
icon: LinkIcon
|
|
1307
|
-
},
|
|
1308
|
-
{
|
|
1309
|
-
name: "left",
|
|
1310
|
-
command: () => editor.chain().focus().setTextAlign("left").run(),
|
|
1311
|
-
isActive: () => editor.isActive({ textAlign: "left" }),
|
|
1312
|
-
group: "alignment",
|
|
1313
|
-
icon: AlignLeft
|
|
1314
|
-
},
|
|
1315
|
-
{
|
|
1316
|
-
name: "center",
|
|
1317
|
-
command: () => editor.chain().focus().setTextAlign("center").run(),
|
|
1318
|
-
isActive: () => editor.isActive({ textAlign: "center" }),
|
|
1319
|
-
group: "alignment",
|
|
1320
|
-
icon: AlignCenter
|
|
1321
|
-
},
|
|
1233
|
+
// src/editor/components/ui/select.tsx
|
|
1234
|
+
import { useId } from "react";
|
|
1235
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
1236
|
+
import { jsx as jsx16, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1237
|
+
function Select(props) {
|
|
1238
|
+
const {
|
|
1239
|
+
label,
|
|
1240
|
+
options,
|
|
1241
|
+
value,
|
|
1242
|
+
onValueChange,
|
|
1243
|
+
tooltip,
|
|
1244
|
+
className,
|
|
1245
|
+
icon: Icon,
|
|
1246
|
+
iconClassName
|
|
1247
|
+
} = props;
|
|
1248
|
+
const selectId = `mly${useId()}`;
|
|
1249
|
+
const content = /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
1250
|
+
/* @__PURE__ */ jsx16("label", { htmlFor: selectId, className: "sr-only", children: label }),
|
|
1251
|
+
Icon && /* @__PURE__ */ jsx16("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__ */ jsx16(Icon, { className: cn("mly-size-3", iconClassName) }) }),
|
|
1252
|
+
/* @__PURE__ */ jsx16(
|
|
1253
|
+
"select",
|
|
1322
1254
|
{
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1255
|
+
id: selectId,
|
|
1256
|
+
className: cn(
|
|
1257
|
+
"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",
|
|
1258
|
+
!!Icon && "mly-pl-7",
|
|
1259
|
+
className
|
|
1260
|
+
),
|
|
1261
|
+
value,
|
|
1262
|
+
onChange: (event) => onValueChange(event.target.value),
|
|
1263
|
+
children: options.map((option) => /* @__PURE__ */ jsx16("option", { value: option.value, children: option.label }, option.value))
|
|
1328
1264
|
}
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1265
|
+
),
|
|
1266
|
+
/* @__PURE__ */ jsx16("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__ */ jsx16(
|
|
1267
|
+
ChevronDownIcon,
|
|
1268
|
+
{
|
|
1269
|
+
size: 16,
|
|
1270
|
+
strokeWidth: 2,
|
|
1271
|
+
"aria-hidden": "true",
|
|
1272
|
+
role: "img"
|
|
1336
1273
|
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
if (!editor) {
|
|
1342
|
-
return null;
|
|
1274
|
+
) })
|
|
1275
|
+
] });
|
|
1276
|
+
if (!tooltip) {
|
|
1277
|
+
return content;
|
|
1343
1278
|
}
|
|
1344
|
-
return /* @__PURE__ */
|
|
1345
|
-
|
|
1346
|
-
{
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
"div",
|
|
1350
|
-
{
|
|
1351
|
-
className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",
|
|
1352
|
-
children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */ jsx14(BubbleMenuButton, __spreadValues({}, item), index2))
|
|
1353
|
-
},
|
|
1354
|
-
index
|
|
1355
|
-
))
|
|
1356
|
-
}
|
|
1357
|
-
);
|
|
1358
|
-
};
|
|
1359
|
-
|
|
1360
|
-
// src/editor/provider.tsx
|
|
1361
|
-
import { createContext, useContext } from "react";
|
|
1279
|
+
return /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
1280
|
+
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: content }),
|
|
1281
|
+
/* @__PURE__ */ jsx16(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
1282
|
+
] });
|
|
1283
|
+
}
|
|
1362
1284
|
|
|
1363
|
-
// src/
|
|
1364
|
-
import {
|
|
1365
|
-
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1366
|
-
var button = {
|
|
1367
|
-
title: "Button",
|
|
1368
|
-
description: "Add a call to action button to email.",
|
|
1369
|
-
searchTerms: ["link", "button", "cta"],
|
|
1370
|
-
icon: /* @__PURE__ */ jsx15(MousePointer, { className: "mly-h-4 mly-w-4" }),
|
|
1371
|
-
command: ({ editor, range }) => {
|
|
1372
|
-
editor.chain().focus().deleteRange(range).setButton().run();
|
|
1373
|
-
}
|
|
1374
|
-
};
|
|
1375
|
-
var linkCard = {
|
|
1376
|
-
title: "Link Card",
|
|
1377
|
-
description: "Add a link card to email.",
|
|
1378
|
-
searchTerms: ["link", "button", "image"],
|
|
1379
|
-
icon: /* @__PURE__ */ jsx15(ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
|
|
1380
|
-
command: ({ editor, range }) => {
|
|
1381
|
-
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
1382
|
-
}
|
|
1383
|
-
};
|
|
1285
|
+
// src/editor/components/column-menu/columns-bubble-menu-content.tsx
|
|
1286
|
+
import { Space, Trash } from "lucide-react";
|
|
1384
1287
|
|
|
1385
|
-
// src/
|
|
1386
|
-
import {
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
1395
|
-
}
|
|
1396
|
-
};
|
|
1397
|
-
var logo = {
|
|
1398
|
-
title: "Logo",
|
|
1399
|
-
description: "Add your brand logo",
|
|
1400
|
-
searchTerms: ["image", "logo"],
|
|
1401
|
-
icon: /* @__PURE__ */ jsx16(ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
1402
|
-
command: ({ editor, range }) => {
|
|
1403
|
-
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
1288
|
+
// src/editor/utils/delete-node.ts
|
|
1289
|
+
import { findParentNode as findParentNode2 } from "@tiptap/core";
|
|
1290
|
+
function deleteNode(editor, nodeType) {
|
|
1291
|
+
const { state } = editor.view;
|
|
1292
|
+
const associatedNode = findParentNode2((node) => node.type.name === nodeType)(
|
|
1293
|
+
state.selection
|
|
1294
|
+
);
|
|
1295
|
+
if (!associatedNode) {
|
|
1296
|
+
return;
|
|
1404
1297
|
}
|
|
1405
|
-
|
|
1298
|
+
const from = associatedNode.pos;
|
|
1299
|
+
const to = from + associatedNode.node.nodeSize;
|
|
1300
|
+
const { tr } = state;
|
|
1301
|
+
const transaction = tr.delete(from, to);
|
|
1302
|
+
editor.view.dispatch(transaction);
|
|
1303
|
+
}
|
|
1406
1304
|
|
|
1407
|
-
// src/
|
|
1408
|
-
import {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
Minus
|
|
1414
|
-
} from "lucide-react";
|
|
1415
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1416
|
-
var columns = {
|
|
1417
|
-
title: "Columns",
|
|
1418
|
-
description: "Add columns to email.",
|
|
1419
|
-
searchTerms: ["layout", "columns"],
|
|
1420
|
-
icon: /* @__PURE__ */ jsx17(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
1421
|
-
shouldBeHidden: (editor) => {
|
|
1422
|
-
return editor.isActive("columns");
|
|
1423
|
-
},
|
|
1424
|
-
command: ({ editor, range }) => {
|
|
1425
|
-
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
1426
|
-
}
|
|
1427
|
-
};
|
|
1428
|
-
var section = {
|
|
1429
|
-
title: "Section",
|
|
1430
|
-
description: "Add a section to email.",
|
|
1431
|
-
searchTerms: ["layout", "section"],
|
|
1432
|
-
icon: /* @__PURE__ */ jsx17(RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
|
|
1433
|
-
command: ({ editor, range }) => {
|
|
1434
|
-
editor.chain().focus().deleteRange(range).setSection().run();
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
var forLoop = {
|
|
1438
|
-
title: "For",
|
|
1439
|
-
description: "Loop over an array of items.",
|
|
1440
|
-
searchTerms: ["for", "loop"],
|
|
1441
|
-
icon: /* @__PURE__ */ jsx17(Repeat2, { className: "mly-h-4 mly-w-4" }),
|
|
1442
|
-
shouldBeHidden: (editor) => {
|
|
1443
|
-
return editor.isActive("for");
|
|
1444
|
-
},
|
|
1445
|
-
command: ({ editor, range }) => {
|
|
1446
|
-
editor.chain().focus().deleteRange(range).setFor().run();
|
|
1447
|
-
}
|
|
1448
|
-
};
|
|
1449
|
-
var spacer = {
|
|
1450
|
-
title: "Spacer",
|
|
1451
|
-
description: "Add space between blocks.",
|
|
1452
|
-
searchTerms: ["space", "gap", "divider"],
|
|
1453
|
-
icon: /* @__PURE__ */ jsx17(MoveVertical, { className: "mly-h-4 mly-w-4" }),
|
|
1454
|
-
command: ({ editor, range }) => {
|
|
1455
|
-
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
1456
|
-
}
|
|
1457
|
-
};
|
|
1458
|
-
var divider = {
|
|
1459
|
-
title: "Divider",
|
|
1460
|
-
description: "Add a horizontal divider.",
|
|
1461
|
-
searchTerms: ["divider", "line"],
|
|
1462
|
-
icon: /* @__PURE__ */ jsx17(Minus, { className: "mly-h-4 mly-w-4" }),
|
|
1463
|
-
command: ({ editor, range }) => {
|
|
1464
|
-
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
1305
|
+
// src/editor/components/column-menu/columns-bubble-menu-content.tsx
|
|
1306
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1307
|
+
function ColumnsBubbleMenuContent(props) {
|
|
1308
|
+
const { editor } = props;
|
|
1309
|
+
if (!editor) {
|
|
1310
|
+
return null;
|
|
1465
1311
|
}
|
|
1466
|
-
|
|
1312
|
+
const state = useColumnsState(editor);
|
|
1313
|
+
const currentColumnCount = state.columnsCount;
|
|
1314
|
+
return /* @__PURE__ */ jsx17(TooltipProvider, { children: /* @__PURE__ */ jsxs6("div", { className: "mly-flex mly-items-stretch", children: [
|
|
1315
|
+
state.isColumnActive && /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1316
|
+
/* @__PURE__ */ jsx17(
|
|
1317
|
+
ColumnsWidthConfig,
|
|
1318
|
+
{
|
|
1319
|
+
columnsCount: currentColumnCount,
|
|
1320
|
+
columnWidths: state.columnWidths,
|
|
1321
|
+
onColumnsCountChange: (count) => {
|
|
1322
|
+
if (count > currentColumnCount) {
|
|
1323
|
+
addColumnByIndex(editor);
|
|
1324
|
+
} else {
|
|
1325
|
+
removeColumnByIndex(editor);
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1328
|
+
onColumnWidthChange: (index, width) => {
|
|
1329
|
+
updateColumnWidth(editor, index, width);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
),
|
|
1333
|
+
/* @__PURE__ */ jsx17(Divider, {})
|
|
1334
|
+
] }),
|
|
1335
|
+
/* @__PURE__ */ jsx17(
|
|
1336
|
+
VerticalAlignmentSwitch,
|
|
1337
|
+
{
|
|
1338
|
+
alignment: state.currentVerticalAlignment,
|
|
1339
|
+
onAlignmentChange: (value) => {
|
|
1340
|
+
editor.commands.updateColumn({
|
|
1341
|
+
verticalAlign: value
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
),
|
|
1346
|
+
/* @__PURE__ */ jsx17(Divider, {}),
|
|
1347
|
+
/* @__PURE__ */ jsx17(
|
|
1348
|
+
Select,
|
|
1349
|
+
{
|
|
1350
|
+
icon: Space,
|
|
1351
|
+
label: "Columns Gap",
|
|
1352
|
+
value: state.currentColumnsGap,
|
|
1353
|
+
options: [
|
|
1354
|
+
{ value: "0", label: "None" },
|
|
1355
|
+
{ value: "4", label: "Small" },
|
|
1356
|
+
{ value: "8", label: "Medium" },
|
|
1357
|
+
{ value: "16", label: "Large" },
|
|
1358
|
+
{ value: "24", label: "Extra Large" }
|
|
1359
|
+
],
|
|
1360
|
+
onValueChange: (value) => {
|
|
1361
|
+
editor.commands.updateColumns({
|
|
1362
|
+
gap: +value
|
|
1363
|
+
});
|
|
1364
|
+
},
|
|
1365
|
+
tooltip: "Columns Gap"
|
|
1366
|
+
}
|
|
1367
|
+
),
|
|
1368
|
+
/* @__PURE__ */ jsx17(Divider, {}),
|
|
1369
|
+
/* @__PURE__ */ jsx17(
|
|
1370
|
+
BubbleMenuButton,
|
|
1371
|
+
{
|
|
1372
|
+
icon: Trash,
|
|
1373
|
+
tooltip: "Delete Columns",
|
|
1374
|
+
command: () => {
|
|
1375
|
+
deleteNode(editor, "columns");
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
),
|
|
1379
|
+
/* @__PURE__ */ jsx17(Divider, {}),
|
|
1380
|
+
/* @__PURE__ */ jsx17(
|
|
1381
|
+
ShowPopover,
|
|
1382
|
+
{
|
|
1383
|
+
showIfKey: state.currentShowIfKey,
|
|
1384
|
+
onShowIfKeyValueChange: (value) => {
|
|
1385
|
+
editor.commands.updateColumns({
|
|
1386
|
+
showIfKey: value
|
|
1387
|
+
});
|
|
1388
|
+
},
|
|
1389
|
+
editor
|
|
1390
|
+
}
|
|
1391
|
+
)
|
|
1392
|
+
] }) });
|
|
1393
|
+
}
|
|
1467
1394
|
|
|
1468
|
-
// src/
|
|
1469
|
-
import { List, ListOrdered } from "lucide-react";
|
|
1395
|
+
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
1470
1396
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
icon: /* @__PURE__ */ jsx18(List, { className: "mly-h-4 mly-w-4" }),
|
|
1476
|
-
command: ({ editor, range }) => {
|
|
1477
|
-
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
1478
|
-
}
|
|
1479
|
-
};
|
|
1480
|
-
var orderedList = {
|
|
1481
|
-
title: "Numbered List",
|
|
1482
|
-
description: "Create a list with numbering.",
|
|
1483
|
-
searchTerms: ["ordered"],
|
|
1484
|
-
icon: /* @__PURE__ */ jsx18(ListOrdered, { className: "mly-h-4 mly-w-4" }),
|
|
1485
|
-
command: ({ editor, range }) => {
|
|
1486
|
-
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
1397
|
+
function ColumnsBubbleMenu(props) {
|
|
1398
|
+
const { appendTo, editor } = props;
|
|
1399
|
+
if (!editor) {
|
|
1400
|
+
return null;
|
|
1487
1401
|
}
|
|
1488
|
-
|
|
1402
|
+
const getReferenceClientRect = useCallback2(() => {
|
|
1403
|
+
const renderContainer = getRenderContainer(editor, "columns");
|
|
1404
|
+
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
1405
|
+
return rect;
|
|
1406
|
+
}, [editor]);
|
|
1407
|
+
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
1408
|
+
shouldShow: ({ editor: editor2 }) => {
|
|
1409
|
+
if (isTextSelected(editor2) || editor2.isActive("section") || editor2.isActive("for")) {
|
|
1410
|
+
return false;
|
|
1411
|
+
}
|
|
1412
|
+
return editor2.isActive("columns");
|
|
1413
|
+
},
|
|
1414
|
+
tippyOptions: {
|
|
1415
|
+
offset: [0, 8],
|
|
1416
|
+
popperOptions: {
|
|
1417
|
+
modifiers: [{ name: "flip", enabled: false }]
|
|
1418
|
+
},
|
|
1419
|
+
getReferenceClientRect,
|
|
1420
|
+
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
1421
|
+
plugins: [sticky],
|
|
1422
|
+
sticky: "popper",
|
|
1423
|
+
maxWidth: "auto"
|
|
1424
|
+
},
|
|
1425
|
+
pluginKey: "columnsBubbleMenu"
|
|
1426
|
+
});
|
|
1427
|
+
return /* @__PURE__ */ jsx18(
|
|
1428
|
+
BubbleMenu,
|
|
1429
|
+
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
1430
|
+
className: "mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
1431
|
+
children: /* @__PURE__ */ jsx18(ColumnsBubbleMenuContent, { editor })
|
|
1432
|
+
})
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1489
1435
|
|
|
1490
|
-
// src/
|
|
1436
|
+
// src/editor/components/content-menu.tsx
|
|
1437
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useState as useState4 } from "react";
|
|
1438
|
+
import { Copy, GripVertical, Plus, Trash2 } from "lucide-react";
|
|
1439
|
+
|
|
1440
|
+
// src/editor/components/drag-handle.tsx
|
|
1441
|
+
import { useState as useState3, useRef as useRef3, useEffect as useEffect2 } from "react";
|
|
1491
1442
|
import {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
Heading3,
|
|
1496
|
-
DivideIcon,
|
|
1497
|
-
TextQuote,
|
|
1498
|
-
FootprintsIcon,
|
|
1499
|
-
EraserIcon as EraserIcon2
|
|
1500
|
-
} from "lucide-react";
|
|
1443
|
+
DragHandlePlugin,
|
|
1444
|
+
dragHandlePluginDefaultKey
|
|
1445
|
+
} from "echo-drag-handle-plugin";
|
|
1501
1446
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
};
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
};
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
searchTerms: ["break", "line"],
|
|
1542
|
-
icon: /* @__PURE__ */ jsx19(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__ */ jsx19(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__ */ jsx19(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__ */ jsx19(EraserIcon2, { className: "mly-h-4 mly-w-4" }),
|
|
1570
|
-
command: ({ editor, range }) => {
|
|
1571
|
-
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
1572
|
-
}
|
|
1573
|
-
};
|
|
1574
|
-
|
|
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
|
-
];
|
|
1447
|
+
function DragHandle(props) {
|
|
1448
|
+
const {
|
|
1449
|
+
className = "drag-handle",
|
|
1450
|
+
children,
|
|
1451
|
+
editor,
|
|
1452
|
+
pluginKey = dragHandlePluginDefaultKey,
|
|
1453
|
+
onNodeChange,
|
|
1454
|
+
tippyOptions = {}
|
|
1455
|
+
} = props;
|
|
1456
|
+
const [element, setElement] = useState3(null);
|
|
1457
|
+
const pluginRef = useRef3(null);
|
|
1458
|
+
useEffect2(() => {
|
|
1459
|
+
if (!element) {
|
|
1460
|
+
return () => {
|
|
1461
|
+
pluginRef.current = null;
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
if (editor.isDestroyed) {
|
|
1465
|
+
return () => {
|
|
1466
|
+
pluginRef.current = null;
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
if (!pluginRef.current) {
|
|
1470
|
+
pluginRef.current = DragHandlePlugin({
|
|
1471
|
+
editor,
|
|
1472
|
+
element,
|
|
1473
|
+
pluginKey,
|
|
1474
|
+
tippyOptions,
|
|
1475
|
+
onNodeChange
|
|
1476
|
+
});
|
|
1477
|
+
editor.registerPlugin(pluginRef.current);
|
|
1478
|
+
}
|
|
1479
|
+
return () => {
|
|
1480
|
+
editor.unregisterPlugin(pluginKey);
|
|
1481
|
+
pluginRef.current = null;
|
|
1482
|
+
};
|
|
1483
|
+
}, [element, editor, onNodeChange, pluginKey]);
|
|
1484
|
+
return /* @__PURE__ */ jsx19("div", { className, ref: setElement, children });
|
|
1485
|
+
}
|
|
1597
1486
|
|
|
1598
|
-
// src/editor/
|
|
1599
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1487
|
+
// src/editor/components/content-menu.tsx
|
|
1488
|
+
import { jsx as jsx20, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1489
|
+
function ContentMenu(props) {
|
|
1490
|
+
const { editor } = props;
|
|
1491
|
+
const [menuOpen, setMenuOpen] = useState4(false);
|
|
1492
|
+
const [currentNode, setCurrentNode] = useState4(null);
|
|
1493
|
+
const [currentNodePos, setCurrentNodePos] = useState4(-1);
|
|
1494
|
+
const handleNodeChange = useCallback3(
|
|
1495
|
+
(data) => {
|
|
1496
|
+
if (data.node) {
|
|
1497
|
+
setCurrentNode(data.node);
|
|
1498
|
+
}
|
|
1499
|
+
setCurrentNodePos(data.pos);
|
|
1500
|
+
},
|
|
1501
|
+
[setCurrentNodePos, setCurrentNode]
|
|
1502
|
+
);
|
|
1503
|
+
function duplicateNode() {
|
|
1504
|
+
editor.commands.setNodeSelection(currentNodePos);
|
|
1505
|
+
const { $anchor } = editor.state.selection;
|
|
1506
|
+
const selectedNode = $anchor.node(1) || editor.state.selection.node;
|
|
1507
|
+
editor.chain().setMeta("hideDragHandle", true).insertContentAt(
|
|
1508
|
+
currentNodePos + ((currentNode == null ? void 0 : currentNode.nodeSize) || 0),
|
|
1509
|
+
selectedNode.toJSON()
|
|
1510
|
+
).run();
|
|
1511
|
+
setMenuOpen(false);
|
|
1610
1512
|
}
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
const values = useContext(MailyContext);
|
|
1615
|
-
if (!values) {
|
|
1616
|
-
throw new Error("Missing MailyContext.Provider in the component tree");
|
|
1513
|
+
function deleteCurrentNode() {
|
|
1514
|
+
editor.chain().setMeta("hideDragHandle", true).setNodeSelection(currentNodePos).deleteSelection().run();
|
|
1515
|
+
setMenuOpen(false);
|
|
1617
1516
|
}
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
"onValueChange",
|
|
1642
|
-
"className",
|
|
1643
|
-
"onBlur",
|
|
1644
|
-
"onSelectOption",
|
|
1645
|
-
"autoCompleteOptions"
|
|
1646
|
-
]);
|
|
1647
|
-
const [selectedIndex, setSelectedIndex] = useState4(0);
|
|
1648
|
-
const inputRef = useRef3(null);
|
|
1649
|
-
const filteredAutoCompleteOptions = useMemo2(() => {
|
|
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);
|
|
1517
|
+
function handleAddNewNode() {
|
|
1518
|
+
var _a;
|
|
1519
|
+
if (currentNodePos !== -1) {
|
|
1520
|
+
const currentNodeSize = (currentNode == null ? void 0 : currentNode.nodeSize) || 0;
|
|
1521
|
+
const insertPos = currentNodePos + currentNodeSize;
|
|
1522
|
+
const currentNodeIsEmptyParagraph = (currentNode == null ? void 0 : currentNode.type.name) === "paragraph" && ((_a = currentNode == null ? void 0 : currentNode.content) == null ? void 0 : _a.size) === 0;
|
|
1523
|
+
const focusPos = currentNodeIsEmptyParagraph ? currentNodePos + 2 : insertPos + 2;
|
|
1524
|
+
editor.chain().command(({ dispatch, tr, state }) => {
|
|
1525
|
+
if (dispatch) {
|
|
1526
|
+
if (currentNodeIsEmptyParagraph) {
|
|
1527
|
+
tr.insertText("/", currentNodePos, currentNodePos + 1);
|
|
1528
|
+
} else {
|
|
1529
|
+
tr.insert(
|
|
1530
|
+
insertPos,
|
|
1531
|
+
state.schema.nodes.paragraph.create(null, [
|
|
1532
|
+
state.schema.text("/")
|
|
1533
|
+
])
|
|
1534
|
+
);
|
|
1535
|
+
}
|
|
1536
|
+
return dispatch(tr);
|
|
1537
|
+
}
|
|
1538
|
+
return true;
|
|
1539
|
+
}).focus(focusPos).run();
|
|
1653
1540
|
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
onSelectOption == null ? void 0 : onSelectOption(_value);
|
|
1541
|
+
}
|
|
1542
|
+
useEffect3(() => {
|
|
1543
|
+
if (menuOpen) {
|
|
1544
|
+
editor.commands.setMeta("lockDragHandle", true);
|
|
1545
|
+
} else {
|
|
1546
|
+
editor.commands.setMeta("lockDragHandle", false);
|
|
1547
|
+
}
|
|
1548
|
+
return () => {
|
|
1549
|
+
editor.commands.setMeta("lockDragHandle", false);
|
|
1550
|
+
};
|
|
1551
|
+
}, [editor, menuOpen]);
|
|
1552
|
+
return /* @__PURE__ */ jsx20(
|
|
1553
|
+
DragHandle,
|
|
1554
|
+
{
|
|
1555
|
+
pluginKey: "ContentMenu",
|
|
1556
|
+
editor,
|
|
1557
|
+
tippyOptions: {
|
|
1558
|
+
offset: [2, 0],
|
|
1559
|
+
zIndex: 99
|
|
1560
|
+
},
|
|
1561
|
+
onNodeChange: handleNodeChange,
|
|
1562
|
+
children: /* @__PURE__ */ jsx20(TooltipProvider, { children: /* @__PURE__ */ jsxs7("div", { className: "mly-flex mly-items-center mly-pr-1.5", children: [
|
|
1563
|
+
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
1564
|
+
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
1565
|
+
BaseButton,
|
|
1566
|
+
{
|
|
1567
|
+
variant: "ghost",
|
|
1568
|
+
size: "icon",
|
|
1569
|
+
className: "!mly-size-5 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
|
|
1570
|
+
onClick: handleAddNewNode,
|
|
1571
|
+
type: "button",
|
|
1572
|
+
children: /* @__PURE__ */ jsx20(Plus, { className: "mly-size-3.5 mly-shrink-0" })
|
|
1687
1573
|
}
|
|
1574
|
+
) }),
|
|
1575
|
+
/* @__PURE__ */ jsx20(TooltipContent, { sideOffset: 8, children: "Add new node" })
|
|
1576
|
+
] }),
|
|
1577
|
+
/* @__PURE__ */ jsxs7(Popover, { open: menuOpen, onOpenChange: setMenuOpen, children: [
|
|
1578
|
+
/* @__PURE__ */ jsxs7("div", { className: "mly-relative mly-flex mly-flex-col", children: [
|
|
1579
|
+
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
1580
|
+
/* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
1581
|
+
BaseButton,
|
|
1582
|
+
{
|
|
1583
|
+
variant: "ghost",
|
|
1584
|
+
size: "icon",
|
|
1585
|
+
className: "mly-relative mly-z-[1] !mly-size-5 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
|
|
1586
|
+
onClick: (e) => {
|
|
1587
|
+
e.preventDefault();
|
|
1588
|
+
setMenuOpen(true);
|
|
1589
|
+
editor.commands.setNodeSelection(currentNodePos);
|
|
1590
|
+
},
|
|
1591
|
+
type: "button",
|
|
1592
|
+
children: /* @__PURE__ */ jsx20(GripVertical, { className: "mly-size-3.5 mly-shrink-0" })
|
|
1593
|
+
}
|
|
1594
|
+
) }),
|
|
1595
|
+
/* @__PURE__ */ jsx20(TooltipContent, { sideOffset: 8, children: "Node actions" })
|
|
1596
|
+
] }),
|
|
1597
|
+
/* @__PURE__ */ jsx20(PopoverTrigger, { className: "mly-absolute mly-left-0 mly-top-0 mly-z-0 mly-h-5 mly-w-5" })
|
|
1598
|
+
] }),
|
|
1599
|
+
/* @__PURE__ */ jsxs7(
|
|
1600
|
+
PopoverContent,
|
|
1601
|
+
{
|
|
1602
|
+
align: "start",
|
|
1603
|
+
side: "bottom",
|
|
1604
|
+
sideOffset: 8,
|
|
1605
|
+
className: "mly-flex mly-w-max mly-flex-col mly-rounded-md mly-p-1",
|
|
1606
|
+
children: [
|
|
1607
|
+
/* @__PURE__ */ jsxs7(
|
|
1608
|
+
BaseButton,
|
|
1609
|
+
{
|
|
1610
|
+
variant: "ghost",
|
|
1611
|
+
onClick: duplicateNode,
|
|
1612
|
+
className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-px-2 mly-py-1 mly-text-sm mly-font-normal",
|
|
1613
|
+
children: [
|
|
1614
|
+
/* @__PURE__ */ jsx20(Copy, { className: "mly-size-[15px] mly-shrink-0" }),
|
|
1615
|
+
"Duplicate"
|
|
1616
|
+
]
|
|
1617
|
+
}
|
|
1618
|
+
),
|
|
1619
|
+
/* @__PURE__ */ jsx20(Divider, { type: "horizontal" }),
|
|
1620
|
+
/* @__PURE__ */ jsxs7(
|
|
1621
|
+
BaseButton,
|
|
1622
|
+
{
|
|
1623
|
+
onClick: deleteCurrentNode,
|
|
1624
|
+
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",
|
|
1625
|
+
children: [
|
|
1626
|
+
/* @__PURE__ */ jsx20(Trash2, { className: "mly-size-[15px] mly-shrink-0" }),
|
|
1627
|
+
"Delete"
|
|
1628
|
+
]
|
|
1629
|
+
}
|
|
1630
|
+
)
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
)
|
|
1634
|
+
] })
|
|
1635
|
+
] }) })
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// src/editor/components/editor-menu-bar.tsx
|
|
1641
|
+
import { useMemo as useMemo3 } from "react";
|
|
1642
|
+
import {
|
|
1643
|
+
AlignCenter,
|
|
1644
|
+
AlignLeft,
|
|
1645
|
+
AlignRight,
|
|
1646
|
+
BoldIcon,
|
|
1647
|
+
EraserIcon as EraserIcon2,
|
|
1648
|
+
ItalicIcon,
|
|
1649
|
+
LinkIcon,
|
|
1650
|
+
SeparatorHorizontal,
|
|
1651
|
+
StrikethroughIcon,
|
|
1652
|
+
UnderlineIcon
|
|
1653
|
+
} from "lucide-react";
|
|
1654
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1655
|
+
var EditorMenuBar = (props) => {
|
|
1656
|
+
const { editor, config } = props;
|
|
1657
|
+
const items = useMemo3(
|
|
1658
|
+
() => [
|
|
1659
|
+
{
|
|
1660
|
+
name: "bold",
|
|
1661
|
+
command: () => editor.chain().focus().toggleBold().run(),
|
|
1662
|
+
isActive: () => editor.isActive("bold"),
|
|
1663
|
+
group: "mark",
|
|
1664
|
+
icon: BoldIcon
|
|
1665
|
+
},
|
|
1666
|
+
{
|
|
1667
|
+
name: "italic",
|
|
1668
|
+
command: () => editor.chain().focus().toggleItalic().run(),
|
|
1669
|
+
isActive: () => editor.isActive("italic"),
|
|
1670
|
+
group: "mark",
|
|
1671
|
+
icon: ItalicIcon
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
name: "underline",
|
|
1675
|
+
command: () => editor.chain().focus().toggleUnderline().run(),
|
|
1676
|
+
isActive: () => editor.isActive("underline"),
|
|
1677
|
+
group: "mark",
|
|
1678
|
+
icon: UnderlineIcon
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
name: "strike",
|
|
1682
|
+
command: () => editor.chain().focus().toggleStrike().run(),
|
|
1683
|
+
isActive: () => editor.isActive("strike"),
|
|
1684
|
+
group: "mark",
|
|
1685
|
+
icon: StrikethroughIcon
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
name: "delete-line",
|
|
1689
|
+
command: () => editor.chain().focus().selectParentNode().deleteSelection().run(),
|
|
1690
|
+
isActive: () => false,
|
|
1691
|
+
group: "mark",
|
|
1692
|
+
icon: EraserIcon2
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
name: "divider",
|
|
1696
|
+
command: () => editor.chain().focus().setHorizontalRule().run(),
|
|
1697
|
+
isActive: () => editor.isActive("horizontalRule"),
|
|
1698
|
+
group: "custom",
|
|
1699
|
+
icon: 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;
|
|
1688
1710
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1711
|
+
editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
1712
|
+
},
|
|
1713
|
+
isActive: () => editor.isActive("link"),
|
|
1714
|
+
group: "custom",
|
|
1715
|
+
icon: LinkIcon
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
name: "left",
|
|
1719
|
+
command: () => editor.chain().focus().setTextAlign("left").run(),
|
|
1720
|
+
isActive: () => editor.isActive({ textAlign: "left" }),
|
|
1721
|
+
group: "alignment",
|
|
1722
|
+
icon: AlignLeft
|
|
1723
|
+
},
|
|
1695
1724
|
{
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1702
|
-
onSelectOption == null ? void 0 : onSelectOption(option);
|
|
1703
|
-
},
|
|
1704
|
-
onMouseEnter: () => setSelectedIndex(index),
|
|
1705
|
-
"aria-selected": selectedIndex === index,
|
|
1706
|
-
children: option
|
|
1725
|
+
name: "center",
|
|
1726
|
+
command: () => editor.chain().focus().setTextAlign("center").run(),
|
|
1727
|
+
isActive: () => editor.isActive({ textAlign: "center" }),
|
|
1728
|
+
group: "alignment",
|
|
1729
|
+
icon: AlignCenter
|
|
1707
1730
|
},
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
}
|
|
1731
|
+
{
|
|
1732
|
+
name: "right",
|
|
1733
|
+
command: () => editor.chain().focus().setTextAlign("right").run(),
|
|
1734
|
+
isActive: () => editor.isActive({ textAlign: "right" }),
|
|
1735
|
+
group: "alignment",
|
|
1736
|
+
icon: AlignRight
|
|
1737
|
+
}
|
|
1738
|
+
],
|
|
1739
|
+
[editor]
|
|
1740
|
+
);
|
|
1741
|
+
const groups = useMemo3(
|
|
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__ */ jsx21(
|
|
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__ */ jsx21(
|
|
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__ */ jsx21(BubbleMenuButton, __spreadValues({}, item), index2))
|
|
1762
|
+
},
|
|
1763
|
+
index
|
|
1764
|
+
))
|
|
1765
|
+
}
|
|
1766
|
+
);
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
// src/editor/components/for-menu/for-bubble-menu.tsx
|
|
1770
|
+
import { BubbleMenu as BubbleMenu2, findChildren } from "@tiptap/react";
|
|
1771
|
+
import { Braces as Braces2 } from "lucide-react";
|
|
1772
|
+
import { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef4, useState as useState5 } from "react";
|
|
1773
|
+
import { sticky as sticky2 } from "tippy.js";
|
|
1712
1774
|
|
|
1713
1775
|
// src/editor/components/for-menu/use-for-state.ts
|
|
1714
1776
|
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
@@ -1737,14 +1799,20 @@ function ForBubbleMenu(props) {
|
|
|
1737
1799
|
return null;
|
|
1738
1800
|
}
|
|
1739
1801
|
const state = useForState(editor);
|
|
1740
|
-
const getReferenceClientRect =
|
|
1802
|
+
const getReferenceClientRect = useCallback4(() => {
|
|
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
|
-
|
|
1809
|
+
var _a;
|
|
1810
|
+
const activeForNode = getClosestNodeByName(editor2, "for");
|
|
1811
|
+
const sectionNodeChildren = activeForNode ? (_a = 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");
|
|
@@ -1765,10 +1833,15 @@ function ForBubbleMenu(props) {
|
|
|
1765
1833
|
const { variables = [] } = useMailyContext();
|
|
1766
1834
|
const inputRef = useRef4(null);
|
|
1767
1835
|
const [isUpdatingKey, setIsUpdatingKey] = useState5(false);
|
|
1768
|
-
const
|
|
1769
|
-
const autoCompleteOptions =
|
|
1770
|
-
return variables
|
|
1771
|
-
|
|
1836
|
+
const eachKey = (state == null ? void 0 : state.each) || "";
|
|
1837
|
+
const autoCompleteOptions = useMemo4(() => {
|
|
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__ */ jsx22(
|
|
1773
1846
|
BubbleMenu2,
|
|
1774
1847
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
@@ -1779,7 +1852,7 @@ function ForBubbleMenu(props) {
|
|
|
1779
1852
|
"button",
|
|
1780
1853
|
{
|
|
1781
1854
|
className: cn(
|
|
1782
|
-
"mly-
|
|
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__ */ jsx22(Braces2, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
1794
|
-
/* @__PURE__ */ jsx22("span", { children: state == null ? void 0 : state.each })
|
|
1866
|
+
/* @__PURE__ */ jsx22(Braces2, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
1867
|
+
/* @__PURE__ */ jsx22("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
|
-
|
|
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
|
] })
|
|
@@ -1887,7 +1962,11 @@ function AlignmentSwitch(props) {
|
|
|
1887
1962
|
}
|
|
1888
1963
|
|
|
1889
1964
|
// src/editor/components/ui/link-input-popover.tsx
|
|
1890
|
-
import {
|
|
1965
|
+
import {
|
|
1966
|
+
ChevronDownIcon as ChevronDownIcon2,
|
|
1967
|
+
CornerDownLeft as CornerDownLeft3,
|
|
1968
|
+
Link
|
|
1969
|
+
} from "lucide-react";
|
|
1891
1970
|
import { useRef as useRef5, useState as useState6 } from "react";
|
|
1892
1971
|
import { jsx as jsx24, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1893
1972
|
function LinkInputPopover(props) {
|
|
@@ -1898,7 +1977,9 @@ function LinkInputPopover(props) {
|
|
|
1898
1977
|
icon: Icon = Link
|
|
1899
1978
|
} = props;
|
|
1900
1979
|
const [isOpen, setIsOpen] = useState6(false);
|
|
1980
|
+
const [protocol, setProtocol] = useState6("https://");
|
|
1901
1981
|
const linkInputRef = useRef5(null);
|
|
1982
|
+
const defaultUrlWithoutProtocol = defaultValue.replace(/https?:\/\//, "");
|
|
1902
1983
|
const popoverButton = /* @__PURE__ */ jsx24(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(
|
|
1903
1984
|
BaseButton,
|
|
1904
1985
|
{
|
|
@@ -1906,10 +1987,14 @@ function LinkInputPopover(props) {
|
|
|
1906
1987
|
size: "sm",
|
|
1907
1988
|
type: "button",
|
|
1908
1989
|
className: "mly-size-7",
|
|
1909
|
-
"data-state": !!
|
|
1990
|
+
"data-state": !!defaultUrlWithoutProtocol,
|
|
1910
1991
|
children: /* @__PURE__ */ jsx24(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
|
|
1911
1992
|
}
|
|
1912
1993
|
) });
|
|
1994
|
+
const normalizeProtocol = (value, p = protocol) => {
|
|
1995
|
+
value = value.replace(/https?:\/\//, "");
|
|
1996
|
+
return p + value;
|
|
1997
|
+
};
|
|
1913
1998
|
return /* @__PURE__ */ jsxs9(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
1914
1999
|
tooltip ? /* @__PURE__ */ jsxs9(Tooltip, { children: [
|
|
1915
2000
|
/* @__PURE__ */ jsx24(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
@@ -1920,7 +2005,7 @@ function LinkInputPopover(props) {
|
|
|
1920
2005
|
{
|
|
1921
2006
|
align: "end",
|
|
1922
2007
|
side: "top",
|
|
1923
|
-
className: "mly-w-max mly-rounded-
|
|
2008
|
+
className: "mly-w-max mly-rounded-none mly-border-none mly-bg-transparent !mly-p-0 mly-shadow-none",
|
|
1924
2009
|
sideOffset: 8,
|
|
1925
2010
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
1926
2011
|
children: /* @__PURE__ */ jsx24(
|
|
@@ -1932,23 +2017,68 @@ function LinkInputPopover(props) {
|
|
|
1932
2017
|
if (!input) {
|
|
1933
2018
|
return;
|
|
1934
2019
|
}
|
|
1935
|
-
|
|
2020
|
+
let value = normalizeProtocol(input.value);
|
|
2021
|
+
onValueChange == null ? void 0 : onValueChange(value);
|
|
1936
2022
|
setIsOpen(false);
|
|
1937
2023
|
},
|
|
1938
2024
|
children: /* @__PURE__ */ jsxs9("label", { className: "relative", children: [
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
"
|
|
2025
|
+
/* @__PURE__ */ jsxs9("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
|
|
2026
|
+
/* @__PURE__ */ jsxs9("div", { className: "mly-relative", children: [
|
|
2027
|
+
/* @__PURE__ */ jsxs9(
|
|
2028
|
+
"select",
|
|
2029
|
+
{
|
|
2030
|
+
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",
|
|
2031
|
+
"aria-label": "Protocol",
|
|
2032
|
+
value: protocol,
|
|
2033
|
+
onChange: (e) => {
|
|
2034
|
+
var _a;
|
|
2035
|
+
const protocol2 = e.target.value;
|
|
2036
|
+
setProtocol(protocol2);
|
|
2037
|
+
const newValue = normalizeProtocol(
|
|
2038
|
+
((_a = linkInputRef.current) == null ? void 0 : _a.value) || "",
|
|
2039
|
+
protocol2
|
|
2040
|
+
);
|
|
2041
|
+
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
2042
|
+
},
|
|
2043
|
+
children: [
|
|
2044
|
+
/* @__PURE__ */ jsx24("option", { value: "https://", children: "https://" }),
|
|
2045
|
+
/* @__PURE__ */ jsx24("option", { value: "http://", children: "http://" })
|
|
2046
|
+
]
|
|
2047
|
+
}
|
|
2048
|
+
),
|
|
2049
|
+
/* @__PURE__ */ jsx24("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__ */ jsx24(
|
|
2050
|
+
ChevronDownIcon2,
|
|
2051
|
+
{
|
|
2052
|
+
size: 16,
|
|
2053
|
+
strokeWidth: 2,
|
|
2054
|
+
"aria-hidden": "true",
|
|
2055
|
+
role: "img"
|
|
2056
|
+
}
|
|
2057
|
+
) })
|
|
2058
|
+
] }),
|
|
2059
|
+
/* @__PURE__ */ jsx24(
|
|
2060
|
+
"input",
|
|
2061
|
+
{
|
|
2062
|
+
value: defaultUrlWithoutProtocol,
|
|
2063
|
+
onChange: (e) => {
|
|
2064
|
+
let value = normalizeProtocol(e.target.value);
|
|
2065
|
+
onValueChange == null ? void 0 : onValueChange(value);
|
|
2066
|
+
},
|
|
2067
|
+
ref: linkInputRef,
|
|
2068
|
+
type: "text",
|
|
2069
|
+
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",
|
|
2070
|
+
placeholder: "maily.to/"
|
|
2071
|
+
}
|
|
2072
|
+
)
|
|
2073
|
+
] }),
|
|
2074
|
+
/* @__PURE__ */ jsx24("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-1.5 mly-flex mly-items-center", children: /* @__PURE__ */ jsx24(
|
|
2075
|
+
CornerDownLeft3,
|
|
1941
2076
|
{
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
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"
|
|
2077
|
+
className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray",
|
|
2078
|
+
"aria-hidden": "true",
|
|
2079
|
+
role: "img"
|
|
1949
2080
|
}
|
|
1950
|
-
)
|
|
1951
|
-
/* @__PURE__ */ jsx24("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx24(CornerDownLeft3, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
2081
|
+
) })
|
|
1952
2082
|
] })
|
|
1953
2083
|
}
|
|
1954
2084
|
)
|
|
@@ -2243,7 +2373,7 @@ var SectionExtension = Node3.create({
|
|
|
2243
2373
|
border: 0,
|
|
2244
2374
|
cellpadding: 0,
|
|
2245
2375
|
cellspacing: 0,
|
|
2246
|
-
class: "mly-w-full mly-border-separate",
|
|
2376
|
+
class: "mly-w-full mly-border-separate mly-relative",
|
|
2247
2377
|
style: `margin-top: ${marginTop}px; margin-right: ${marginRight}px; margin-bottom: ${marginBottom}px; margin-left: ${marginLeft}px;`
|
|
2248
2378
|
},
|
|
2249
2379
|
[
|
|
@@ -2280,17 +2410,17 @@ var SectionExtension = Node3.create({
|
|
|
2280
2410
|
|
|
2281
2411
|
// src/editor/nodes/logo/logo-view.tsx
|
|
2282
2412
|
import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
2283
|
-
import { useEffect as
|
|
2413
|
+
import { useEffect as useEffect5 } from "react";
|
|
2284
2414
|
import { useState as useState8 } from "react";
|
|
2285
2415
|
|
|
2286
2416
|
// src/editor/utils/use-event.ts
|
|
2287
|
-
import { useCallback as
|
|
2417
|
+
import { useCallback as useCallback5, useLayoutEffect, useRef as useRef6 } from "react";
|
|
2288
2418
|
var useEvent = (handler) => {
|
|
2289
2419
|
const handlerRef = useRef6(null);
|
|
2290
2420
|
useLayoutEffect(() => {
|
|
2291
2421
|
handlerRef.current = handler;
|
|
2292
2422
|
}, [handler]);
|
|
2293
|
-
return
|
|
2423
|
+
return useCallback5((...args) => {
|
|
2294
2424
|
if (handlerRef.current === null) {
|
|
2295
2425
|
throw new Error("Handler is not assigned");
|
|
2296
2426
|
}
|
|
@@ -2301,13 +2431,14 @@ var useEvent = (handler) => {
|
|
|
2301
2431
|
// src/editor/nodes/image/image-view.tsx
|
|
2302
2432
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
2303
2433
|
import { Ban, ImageOffIcon, Loader2 } from "lucide-react";
|
|
2304
|
-
import { useEffect as
|
|
2434
|
+
import { useEffect as useEffect4, useRef as useRef7, useState as useState7 } from "react";
|
|
2305
2435
|
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2306
2436
|
var MIN_WIDTH = 20;
|
|
2307
2437
|
var MAX_WIDTH = 600;
|
|
2308
2438
|
function ImageView(props) {
|
|
2309
2439
|
const { node, updateAttributes: updateAttributes2, selected } = props;
|
|
2310
2440
|
const [status, setStatus] = useState7("idle");
|
|
2441
|
+
const wrapperRef = useRef7(null);
|
|
2311
2442
|
const imgRef = useRef7(null);
|
|
2312
2443
|
const [resizingStyle, setResizingStyle] = useState7();
|
|
2313
2444
|
const handleMouseDown = useEvent(
|
|
@@ -2373,7 +2504,7 @@ function ImageView(props) {
|
|
|
2373
2504
|
let { alignment = "center", width, height, src } = node.attrs || {};
|
|
2374
2505
|
const _a = node.attrs || {}, { externalLink, showIfKey } = _a, attrs = __objRest(_a, ["externalLink", "showIfKey"]);
|
|
2375
2506
|
const hasImageSrc = !!attrs.src;
|
|
2376
|
-
|
|
2507
|
+
useEffect4(() => {
|
|
2377
2508
|
if (!src) {
|
|
2378
2509
|
return;
|
|
2379
2510
|
}
|
|
@@ -2382,6 +2513,21 @@ function ImageView(props) {
|
|
|
2382
2513
|
img.src = src;
|
|
2383
2514
|
img.onload = () => {
|
|
2384
2515
|
setStatus("loaded");
|
|
2516
|
+
const { naturalWidth, naturalHeight } = img;
|
|
2517
|
+
const wrapper = wrapperRef == null ? void 0 : wrapperRef.current;
|
|
2518
|
+
if (!wrapper || width !== "auto" || !naturalWidth) {
|
|
2519
|
+
return;
|
|
2520
|
+
}
|
|
2521
|
+
const wrapperWidth = wrapper.offsetWidth;
|
|
2522
|
+
const aspectRatio = naturalWidth / naturalHeight;
|
|
2523
|
+
const calculatedHeight = Math.min(
|
|
2524
|
+
wrapperWidth / aspectRatio,
|
|
2525
|
+
naturalHeight
|
|
2526
|
+
);
|
|
2527
|
+
updateAttributes2({
|
|
2528
|
+
width: Math.min(wrapperWidth, naturalWidth),
|
|
2529
|
+
height: Math.min(calculatedHeight, naturalHeight)
|
|
2530
|
+
});
|
|
2385
2531
|
};
|
|
2386
2532
|
img.onerror = () => {
|
|
2387
2533
|
setStatus("error");
|
|
@@ -2412,6 +2558,7 @@ function ImageView(props) {
|
|
|
2412
2558
|
left: { marginRight: "auto" },
|
|
2413
2559
|
right: { marginLeft: "auto" }
|
|
2414
2560
|
}[alignment] || {}),
|
|
2561
|
+
ref: wrapperRef,
|
|
2415
2562
|
children: [
|
|
2416
2563
|
!hasImageSrc && /* @__PURE__ */ jsx26(ImageStatusLabel, { status: "idle" }),
|
|
2417
2564
|
hasImageSrc && status === "loading" && /* @__PURE__ */ jsx26(ImageStatusLabel, { status: "loading" }),
|
|
@@ -2494,7 +2641,7 @@ function LogoView(props) {
|
|
|
2494
2641
|
size = "sm"
|
|
2495
2642
|
} = node.attrs || {};
|
|
2496
2643
|
const hasImageSrc = !!logoSrc;
|
|
2497
|
-
|
|
2644
|
+
useEffect5(() => {
|
|
2498
2645
|
if (!logoSrc) {
|
|
2499
2646
|
return;
|
|
2500
2647
|
}
|
|
@@ -2632,7 +2779,9 @@ var LogoExtension = TiptapImage.extend({
|
|
|
2632
2779
|
];
|
|
2633
2780
|
},
|
|
2634
2781
|
addNodeView() {
|
|
2635
|
-
return ReactNodeViewRenderer(LogoView
|
|
2782
|
+
return ReactNodeViewRenderer(LogoView, {
|
|
2783
|
+
className: "mly-relative"
|
|
2784
|
+
});
|
|
2636
2785
|
}
|
|
2637
2786
|
});
|
|
2638
2787
|
|
|
@@ -2782,7 +2931,8 @@ function ImageBubbleMenu(props) {
|
|
|
2782
2931
|
editor == null ? void 0 : editor.chain().updateAttributes(state.isLogoActive ? "logo" : "image", {
|
|
2783
2932
|
showIfKey: value
|
|
2784
2933
|
}).run();
|
|
2785
|
-
}
|
|
2934
|
+
},
|
|
2935
|
+
editor
|
|
2786
2936
|
}
|
|
2787
2937
|
)
|
|
2788
2938
|
] })
|
|
@@ -2791,126 +2941,16 @@ function ImageBubbleMenu(props) {
|
|
|
2791
2941
|
}
|
|
2792
2942
|
|
|
2793
2943
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
2794
|
-
import { BubbleMenu as BubbleMenu4 } from "@tiptap/react";
|
|
2795
|
-
import {
|
|
2944
|
+
import { BubbleMenu as BubbleMenu4, findChildren as findChildren2 } from "@tiptap/react";
|
|
2945
|
+
import { ChevronUp as ChevronUp2, Trash as Trash3 } from "lucide-react";
|
|
2946
|
+
import { useCallback as useCallback6 } from "react";
|
|
2796
2947
|
import { sticky as sticky4 } from "tippy.js";
|
|
2797
2948
|
|
|
2798
|
-
// src/editor/components/section-menu/use-section-state.tsx
|
|
2799
|
-
import { useEditorState as useEditorState4 } from "@tiptap/react";
|
|
2800
|
-
import deepEql4 from "fast-deep-equal";
|
|
2801
|
-
var useSectionState = (editor) => {
|
|
2802
|
-
const states = useEditorState4({
|
|
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: deepEql4
|
|
2825
|
-
});
|
|
2826
|
-
return states;
|
|
2827
|
-
};
|
|
2828
|
-
|
|
2829
|
-
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
2830
|
-
import {
|
|
2831
|
-
ChevronUp as ChevronUp2,
|
|
2832
|
-
Trash as Trash3
|
|
2833
|
-
} from "lucide-react";
|
|
2834
|
-
|
|
2835
|
-
// src/editor/components/ui/color-picker.tsx
|
|
2836
|
-
import { HexColorPicker, HexColorInput } from "react-colorful";
|
|
2837
|
-
import { jsx as jsx29, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2838
|
-
function ColorPicker(props) {
|
|
2839
|
-
const {
|
|
2840
|
-
color,
|
|
2841
|
-
onColorChange,
|
|
2842
|
-
borderColor,
|
|
2843
|
-
backgroundColor,
|
|
2844
|
-
tooltip,
|
|
2845
|
-
className,
|
|
2846
|
-
children
|
|
2847
|
-
} = props;
|
|
2848
|
-
const handleColorChange = (color2) => {
|
|
2849
|
-
queueMicrotask(() => {
|
|
2850
|
-
onColorChange(color2);
|
|
2851
|
-
});
|
|
2852
|
-
};
|
|
2853
|
-
const popoverButton = /* @__PURE__ */ jsx29(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ jsx29(
|
|
2854
|
-
BaseButton,
|
|
2855
|
-
{
|
|
2856
|
-
variant: "ghost",
|
|
2857
|
-
className: "!mly-size-7 mly-shrink-0",
|
|
2858
|
-
size: "sm",
|
|
2859
|
-
type: "button",
|
|
2860
|
-
children: /* @__PURE__ */ jsx29(
|
|
2861
|
-
"div",
|
|
2862
|
-
{
|
|
2863
|
-
className: cn(
|
|
2864
|
-
"mly-h-4 mly-w-4 mly-shrink-0 mly-rounded mly-border-2 mly-border-gray-700",
|
|
2865
|
-
className
|
|
2866
|
-
),
|
|
2867
|
-
style: __spreadProps(__spreadValues({}, borderColor ? { borderColor } : {}), {
|
|
2868
|
-
backgroundColor: backgroundColor || "transparent"
|
|
2869
|
-
})
|
|
2870
|
-
}
|
|
2871
|
-
)
|
|
2872
|
-
}
|
|
2873
|
-
) });
|
|
2874
|
-
return /* @__PURE__ */ jsxs14(Popover, { children: [
|
|
2875
|
-
tooltip ? /* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
2876
|
-
/* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
2877
|
-
/* @__PURE__ */ jsx29(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
2878
|
-
] }) : popoverButton,
|
|
2879
|
-
/* @__PURE__ */ jsx29(
|
|
2880
|
-
PopoverContent,
|
|
2881
|
-
{
|
|
2882
|
-
className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
|
|
2883
|
-
sideOffset: 8,
|
|
2884
|
-
children: /* @__PURE__ */ jsxs14("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
|
|
2885
|
-
/* @__PURE__ */ jsx29(
|
|
2886
|
-
HexColorPicker,
|
|
2887
|
-
{
|
|
2888
|
-
color,
|
|
2889
|
-
onChange: handleColorChange,
|
|
2890
|
-
className: "mly-flex !mly-w-full mly-flex-col mly-gap-4"
|
|
2891
|
-
}
|
|
2892
|
-
),
|
|
2893
|
-
/* @__PURE__ */ jsx29(
|
|
2894
|
-
HexColorInput,
|
|
2895
|
-
{
|
|
2896
|
-
alpha: true,
|
|
2897
|
-
color,
|
|
2898
|
-
onChange: handleColorChange,
|
|
2899
|
-
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",
|
|
2900
|
-
prefixed: true
|
|
2901
|
-
}
|
|
2902
|
-
)
|
|
2903
|
-
] })
|
|
2904
|
-
}
|
|
2905
|
-
)
|
|
2906
|
-
] });
|
|
2907
|
-
}
|
|
2908
|
-
|
|
2909
2949
|
// src/editor/components/icons/border-color.tsx
|
|
2910
|
-
import { jsx as
|
|
2950
|
+
import { jsx as jsx29, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2911
2951
|
function BorderColor(props) {
|
|
2912
2952
|
const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
|
|
2913
|
-
return /* @__PURE__ */
|
|
2953
|
+
return /* @__PURE__ */ jsxs14(
|
|
2914
2954
|
"svg",
|
|
2915
2955
|
__spreadProps(__spreadValues({
|
|
2916
2956
|
width: 11,
|
|
@@ -2920,8 +2960,8 @@ function BorderColor(props) {
|
|
|
2920
2960
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2921
2961
|
}, rest), {
|
|
2922
2962
|
children: [
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx29("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2964
|
+
/* @__PURE__ */ jsx29(
|
|
2925
2965
|
"path",
|
|
2926
2966
|
{
|
|
2927
2967
|
d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
|
|
@@ -2935,9 +2975,9 @@ function BorderColor(props) {
|
|
|
2935
2975
|
}
|
|
2936
2976
|
|
|
2937
2977
|
// src/editor/components/icons/margin-icon.tsx
|
|
2938
|
-
import { jsx as
|
|
2978
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2939
2979
|
function MarginIcon(props) {
|
|
2940
|
-
return /* @__PURE__ */
|
|
2980
|
+
return /* @__PURE__ */ jsx30(
|
|
2941
2981
|
"svg",
|
|
2942
2982
|
__spreadProps(__spreadValues({
|
|
2943
2983
|
width: 12,
|
|
@@ -2946,7 +2986,7 @@ function MarginIcon(props) {
|
|
|
2946
2986
|
fill: "none",
|
|
2947
2987
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2948
2988
|
}, props), {
|
|
2949
|
-
children: /* @__PURE__ */
|
|
2989
|
+
children: /* @__PURE__ */ jsx30(
|
|
2950
2990
|
"path",
|
|
2951
2991
|
{
|
|
2952
2992
|
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",
|
|
@@ -2960,9 +3000,9 @@ function MarginIcon(props) {
|
|
|
2960
3000
|
}
|
|
2961
3001
|
|
|
2962
3002
|
// src/editor/components/icons/padding-icon.tsx
|
|
2963
|
-
import { jsx as
|
|
3003
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2964
3004
|
function PaddingIcon(props) {
|
|
2965
|
-
return /* @__PURE__ */
|
|
3005
|
+
return /* @__PURE__ */ jsx31(
|
|
2966
3006
|
"svg",
|
|
2967
3007
|
__spreadProps(__spreadValues({
|
|
2968
3008
|
width: 10,
|
|
@@ -2971,7 +3011,7 @@ function PaddingIcon(props) {
|
|
|
2971
3011
|
fill: "none",
|
|
2972
3012
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2973
3013
|
}, props), {
|
|
2974
|
-
children: /* @__PURE__ */
|
|
3014
|
+
children: /* @__PURE__ */ jsx31(
|
|
2975
3015
|
"path",
|
|
2976
3016
|
{
|
|
2977
3017
|
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",
|
|
@@ -2984,6 +3024,111 @@ function PaddingIcon(props) {
|
|
|
2984
3024
|
);
|
|
2985
3025
|
}
|
|
2986
3026
|
|
|
3027
|
+
// src/editor/components/ui/color-picker.tsx
|
|
3028
|
+
import { HexColorPicker, HexColorInput } from "react-colorful";
|
|
3029
|
+
import { jsx as jsx32, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3030
|
+
function ColorPicker(props) {
|
|
3031
|
+
const {
|
|
3032
|
+
color,
|
|
3033
|
+
onColorChange,
|
|
3034
|
+
borderColor,
|
|
3035
|
+
backgroundColor,
|
|
3036
|
+
tooltip,
|
|
3037
|
+
className,
|
|
3038
|
+
children
|
|
3039
|
+
} = props;
|
|
3040
|
+
const handleColorChange = (color2) => {
|
|
3041
|
+
queueMicrotask(() => {
|
|
3042
|
+
onColorChange(color2);
|
|
3043
|
+
});
|
|
3044
|
+
};
|
|
3045
|
+
const popoverButton = /* @__PURE__ */ jsx32(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ jsx32(
|
|
3046
|
+
BaseButton,
|
|
3047
|
+
{
|
|
3048
|
+
variant: "ghost",
|
|
3049
|
+
className: "!mly-size-7 mly-shrink-0",
|
|
3050
|
+
size: "sm",
|
|
3051
|
+
type: "button",
|
|
3052
|
+
children: /* @__PURE__ */ jsx32(
|
|
3053
|
+
"div",
|
|
3054
|
+
{
|
|
3055
|
+
className: cn(
|
|
3056
|
+
"mly-h-4 mly-w-4 mly-shrink-0 mly-rounded mly-border-2 mly-border-gray-700",
|
|
3057
|
+
className
|
|
3058
|
+
),
|
|
3059
|
+
style: __spreadProps(__spreadValues({}, borderColor ? { borderColor } : {}), {
|
|
3060
|
+
backgroundColor: backgroundColor || "transparent"
|
|
3061
|
+
})
|
|
3062
|
+
}
|
|
3063
|
+
)
|
|
3064
|
+
}
|
|
3065
|
+
) });
|
|
3066
|
+
return /* @__PURE__ */ jsxs15(Popover, { children: [
|
|
3067
|
+
tooltip ? /* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
3068
|
+
/* @__PURE__ */ jsx32(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
3069
|
+
/* @__PURE__ */ jsx32(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
3070
|
+
] }) : popoverButton,
|
|
3071
|
+
/* @__PURE__ */ jsx32(
|
|
3072
|
+
PopoverContent,
|
|
3073
|
+
{
|
|
3074
|
+
className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
|
|
3075
|
+
sideOffset: 8,
|
|
3076
|
+
children: /* @__PURE__ */ jsxs15("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
|
|
3077
|
+
/* @__PURE__ */ jsx32(
|
|
3078
|
+
HexColorPicker,
|
|
3079
|
+
{
|
|
3080
|
+
color,
|
|
3081
|
+
onChange: handleColorChange,
|
|
3082
|
+
className: "mly-flex !mly-w-full mly-flex-col mly-gap-4"
|
|
3083
|
+
}
|
|
3084
|
+
),
|
|
3085
|
+
/* @__PURE__ */ jsx32(
|
|
3086
|
+
HexColorInput,
|
|
3087
|
+
{
|
|
3088
|
+
alpha: true,
|
|
3089
|
+
color,
|
|
3090
|
+
onChange: handleColorChange,
|
|
3091
|
+
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",
|
|
3092
|
+
prefixed: true
|
|
3093
|
+
}
|
|
3094
|
+
)
|
|
3095
|
+
] })
|
|
3096
|
+
}
|
|
3097
|
+
)
|
|
3098
|
+
] });
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3101
|
+
// src/editor/components/section-menu/use-section-state.tsx
|
|
3102
|
+
import { useEditorState as useEditorState4 } from "@tiptap/react";
|
|
3103
|
+
import deepEql4 from "fast-deep-equal";
|
|
3104
|
+
var useSectionState = (editor) => {
|
|
3105
|
+
const states = useEditorState4({
|
|
3106
|
+
editor,
|
|
3107
|
+
selector: (ctx) => {
|
|
3108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
3109
|
+
return {
|
|
3110
|
+
currentAlignment: ((_a = ctx.editor.getAttributes("section")) == null ? void 0 : _a.align) || "left",
|
|
3111
|
+
currentBorderRadius: Number((_b = ctx.editor.getAttributes("section")) == null ? void 0 : _b.borderRadius) || 0,
|
|
3112
|
+
currentBackgroundColor: ((_c = ctx.editor.getAttributes("section")) == null ? void 0 : _c.backgroundColor) || DEFAULT_SECTION_BACKGROUND_COLOR,
|
|
3113
|
+
currentBorderColor: ((_d = ctx.editor.getAttributes("section")) == null ? void 0 : _d.borderColor) || DEFAULT_SECTION_BORDER_COLOR,
|
|
3114
|
+
currentBorderWidth: Number((_e = ctx.editor.getAttributes("section")) == null ? void 0 : _e.borderWidth) || 0,
|
|
3115
|
+
currentMarginTop: Number((_f = ctx.editor.getAttributes("section")) == null ? void 0 : _f.marginTop) || 0,
|
|
3116
|
+
currentMarginRight: Number((_g = ctx.editor.getAttributes("section")) == null ? void 0 : _g.marginRight) || 0,
|
|
3117
|
+
currentMarginBottom: Number((_h = ctx.editor.getAttributes("section")) == null ? void 0 : _h.marginBottom) || 0,
|
|
3118
|
+
currentMarginLeft: Number((_i = ctx.editor.getAttributes("section")) == null ? void 0 : _i.marginLeft) || 0,
|
|
3119
|
+
currentPaddingTop: Number((_j = ctx.editor.getAttributes("section")) == null ? void 0 : _j.paddingTop) || 0,
|
|
3120
|
+
currentPaddingRight: Number((_k = ctx.editor.getAttributes("section")) == null ? void 0 : _k.paddingRight) || 0,
|
|
3121
|
+
currentPaddingBottom: Number((_l = ctx.editor.getAttributes("section")) == null ? void 0 : _l.paddingBottom) || 0,
|
|
3122
|
+
currentPaddingLeft: Number((_m = ctx.editor.getAttributes("section")) == null ? void 0 : _m.paddingLeft) || 0,
|
|
3123
|
+
isColumnsActive: ctx.editor.isActive("columns"),
|
|
3124
|
+
currentShowIfKey: ((_n = ctx.editor.getAttributes("section")) == null ? void 0 : _n.showIfKey) || ""
|
|
3125
|
+
};
|
|
3126
|
+
},
|
|
3127
|
+
equalityFn: deepEql4
|
|
3128
|
+
});
|
|
3129
|
+
return states;
|
|
3130
|
+
};
|
|
3131
|
+
|
|
2987
3132
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
2988
3133
|
import { Fragment as Fragment5, jsx as jsx33, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2989
3134
|
function SectionBubbleMenu(props) {
|
|
@@ -2991,14 +3136,20 @@ function SectionBubbleMenu(props) {
|
|
|
2991
3136
|
if (!editor) {
|
|
2992
3137
|
return null;
|
|
2993
3138
|
}
|
|
2994
|
-
const getReferenceClientRect =
|
|
3139
|
+
const getReferenceClientRect = useCallback6(() => {
|
|
2995
3140
|
const renderContainer = getRenderContainer(editor, "section");
|
|
2996
3141
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
2997
3142
|
return rect;
|
|
2998
3143
|
}, [editor]);
|
|
2999
3144
|
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
3000
3145
|
shouldShow: ({ editor: editor2 }) => {
|
|
3001
|
-
|
|
3146
|
+
var _a;
|
|
3147
|
+
const activeSectionNode = getClosestNodeByName(editor2, "section");
|
|
3148
|
+
const forNodeChildren = activeSectionNode ? (_a = findChildren2(activeSectionNode == null ? void 0 : activeSectionNode.node, (node) => {
|
|
3149
|
+
return node.type.name === "for";
|
|
3150
|
+
})) == null ? void 0 : _a[0] : null;
|
|
3151
|
+
const hasActiveForNodeChildren = forNodeChildren && editor2.isActive("for");
|
|
3152
|
+
if (isTextSelected(editor2) || hasActiveForNodeChildren) {
|
|
3002
3153
|
return false;
|
|
3003
3154
|
}
|
|
3004
3155
|
return editor2.isActive("section");
|
|
@@ -3205,13 +3356,14 @@ function SectionBubbleMenu(props) {
|
|
|
3205
3356
|
editor.commands.updateSection({
|
|
3206
3357
|
showIfKey: value
|
|
3207
3358
|
});
|
|
3208
|
-
}
|
|
3359
|
+
},
|
|
3360
|
+
editor
|
|
3209
3361
|
}
|
|
3210
3362
|
),
|
|
3211
3363
|
state.isColumnsActive && /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
3212
3364
|
/* @__PURE__ */ jsx33(Divider, {}),
|
|
3213
3365
|
/* @__PURE__ */ jsxs16(Popover, { children: [
|
|
3214
|
-
/* @__PURE__ */ jsxs16(PopoverTrigger, { className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm
|
|
3366
|
+
/* @__PURE__ */ jsxs16(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: [
|
|
3215
3367
|
"Column",
|
|
3216
3368
|
/* @__PURE__ */ jsx33(ChevronUp2, { className: "mly-h-3 mly-w-3" })
|
|
3217
3369
|
] }),
|
|
@@ -3317,7 +3469,7 @@ var Spacer = Node4.create({
|
|
|
3317
3469
|
this.options.HTMLAttributes,
|
|
3318
3470
|
HTMLAttributes2,
|
|
3319
3471
|
{
|
|
3320
|
-
class: "spacer relative z-50",
|
|
3472
|
+
class: "spacer mly-relative mly-z-50",
|
|
3321
3473
|
contenteditable: false
|
|
3322
3474
|
}
|
|
3323
3475
|
)
|
|
@@ -3388,7 +3540,8 @@ function SpacerBubbleMenu(props) {
|
|
|
3388
3540
|
showIfKey: state.currentShowIfKey,
|
|
3389
3541
|
onShowIfKeyValueChange: (value) => {
|
|
3390
3542
|
editor.commands.setSpacerShowIfKey(value);
|
|
3391
|
-
}
|
|
3543
|
+
},
|
|
3544
|
+
editor
|
|
3392
3545
|
}
|
|
3393
3546
|
)
|
|
3394
3547
|
]
|
|
@@ -3449,6 +3602,13 @@ var HorizontalRule = TipTapHorizontalRule.extend({
|
|
|
3449
3602
|
}
|
|
3450
3603
|
})
|
|
3451
3604
|
];
|
|
3605
|
+
},
|
|
3606
|
+
addOptions() {
|
|
3607
|
+
return {
|
|
3608
|
+
HTMLAttributes: {
|
|
3609
|
+
class: "mly-relative"
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3452
3612
|
}
|
|
3453
3613
|
});
|
|
3454
3614
|
|
|
@@ -3743,7 +3903,9 @@ var LinkCardExtension = Node5.create({
|
|
|
3743
3903
|
};
|
|
3744
3904
|
},
|
|
3745
3905
|
addNodeView() {
|
|
3746
|
-
return ReactNodeViewRenderer2(LinkCardComponent
|
|
3906
|
+
return ReactNodeViewRenderer2(LinkCardComponent, {
|
|
3907
|
+
className: "mly-relative"
|
|
3908
|
+
});
|
|
3747
3909
|
}
|
|
3748
3910
|
});
|
|
3749
3911
|
|
|
@@ -3931,7 +4093,8 @@ function ButtonView(props) {
|
|
|
3931
4093
|
updateAttributes2({
|
|
3932
4094
|
showIfKey: value
|
|
3933
4095
|
});
|
|
3934
|
-
}
|
|
4096
|
+
},
|
|
4097
|
+
editor
|
|
3935
4098
|
}
|
|
3936
4099
|
)
|
|
3937
4100
|
] }) })
|
|
@@ -4133,7 +4296,8 @@ var ButtonExtension = Node6.create({
|
|
|
4133
4296
|
},
|
|
4134
4297
|
addNodeView() {
|
|
4135
4298
|
return ReactNodeViewRenderer3(ButtonView, {
|
|
4136
|
-
contentDOMElementTag: "div"
|
|
4299
|
+
contentDOMElementTag: "div",
|
|
4300
|
+
className: "mly-relative"
|
|
4137
4301
|
});
|
|
4138
4302
|
}
|
|
4139
4303
|
});
|
|
@@ -4147,13 +4311,23 @@ import Suggestion from "@tiptap/suggestion";
|
|
|
4147
4311
|
// src/editor/nodes/variable/variable-view.tsx
|
|
4148
4312
|
import { NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
4149
4313
|
import { AlertTriangle, Braces as Braces3, Pencil as Pencil2 } from "lucide-react";
|
|
4314
|
+
import { useMemo as useMemo5 } from "react";
|
|
4150
4315
|
import { jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4151
4316
|
function VariableView(props) {
|
|
4152
|
-
var _a
|
|
4317
|
+
var _a;
|
|
4153
4318
|
const { node, selected, updateAttributes: updateAttributes2, editor } = props;
|
|
4154
4319
|
const { id, fallback, showIfKey = "" } = node.attrs;
|
|
4155
4320
|
const { variables = [] } = useMailyContext();
|
|
4156
|
-
const
|
|
4321
|
+
const eachKey = ((_a = editor == null ? void 0 : editor.getAttributes("for")) == null ? void 0 : _a.each) || "";
|
|
4322
|
+
const isRequired = useMemo5(() => {
|
|
4323
|
+
var _a2;
|
|
4324
|
+
const variable = processVariables(variables, {
|
|
4325
|
+
query: "",
|
|
4326
|
+
from: "variable",
|
|
4327
|
+
editor
|
|
4328
|
+
}).find((variable2) => variable2.name === id);
|
|
4329
|
+
return (_a2 = variable == null ? void 0 : variable.required) != null ? _a2 : true;
|
|
4330
|
+
}, [variables, id, editor, eachKey]);
|
|
4157
4331
|
return /* @__PURE__ */ jsx39(
|
|
4158
4332
|
NodeViewWrapper5,
|
|
4159
4333
|
{
|
|
@@ -4229,7 +4403,8 @@ function VariableView(props) {
|
|
|
4229
4403
|
updateAttributes2({
|
|
4230
4404
|
showIfKey: value
|
|
4231
4405
|
});
|
|
4232
|
-
}
|
|
4406
|
+
},
|
|
4407
|
+
editor
|
|
4233
4408
|
}
|
|
4234
4409
|
)
|
|
4235
4410
|
] }) })
|
|
@@ -4399,7 +4574,9 @@ var VariableExtension = Node7.create({
|
|
|
4399
4574
|
];
|
|
4400
4575
|
},
|
|
4401
4576
|
addNodeView() {
|
|
4402
|
-
return ReactNodeViewRenderer4(VariableView
|
|
4577
|
+
return ReactNodeViewRenderer4(VariableView, {
|
|
4578
|
+
className: "mly-relative"
|
|
4579
|
+
});
|
|
4403
4580
|
}
|
|
4404
4581
|
});
|
|
4405
4582
|
|
|
@@ -4463,7 +4640,9 @@ var ImageExtension = TiptapImage2.extend({
|
|
|
4463
4640
|
});
|
|
4464
4641
|
},
|
|
4465
4642
|
addNodeView() {
|
|
4466
|
-
return ReactNodeViewRenderer5(ImageView
|
|
4643
|
+
return ReactNodeViewRenderer5(ImageView, {
|
|
4644
|
+
className: "mly-relative"
|
|
4645
|
+
});
|
|
4467
4646
|
}
|
|
4468
4647
|
});
|
|
4469
4648
|
|
|
@@ -4482,235 +4661,12 @@ var isCustomNodeSelected = (editor, node) => {
|
|
|
4482
4661
|
return customNodes.some((type) => editor.isActive(type));
|
|
4483
4662
|
};
|
|
4484
4663
|
|
|
4485
|
-
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
4486
|
-
import { Fragment as Fragment6, jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4487
|
-
function TextBubbleMenu(props) {
|
|
4488
|
-
var _a;
|
|
4489
|
-
const { editor, appendTo } = props;
|
|
4490
|
-
if (!editor) {
|
|
4491
|
-
return null;
|
|
4492
|
-
}
|
|
4493
|
-
const items = [
|
|
4494
|
-
{
|
|
4495
|
-
name: "bold",
|
|
4496
|
-
isActive: () => editor == null ? void 0 : editor.isActive("bold"),
|
|
4497
|
-
command: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
|
|
4498
|
-
icon: BoldIcon2,
|
|
4499
|
-
tooltip: "Bold"
|
|
4500
|
-
},
|
|
4501
|
-
{
|
|
4502
|
-
name: "italic",
|
|
4503
|
-
isActive: () => editor == null ? void 0 : editor.isActive("italic"),
|
|
4504
|
-
command: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
|
|
4505
|
-
icon: ItalicIcon2,
|
|
4506
|
-
tooltip: "Italic"
|
|
4507
|
-
},
|
|
4508
|
-
{
|
|
4509
|
-
name: "underline",
|
|
4510
|
-
isActive: () => editor == null ? void 0 : editor.isActive("underline"),
|
|
4511
|
-
command: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run(),
|
|
4512
|
-
icon: UnderlineIcon2,
|
|
4513
|
-
tooltip: "Underline"
|
|
4514
|
-
},
|
|
4515
|
-
{
|
|
4516
|
-
name: "strike",
|
|
4517
|
-
isActive: () => editor == null ? void 0 : editor.isActive("strike"),
|
|
4518
|
-
command: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
|
|
4519
|
-
icon: StrikethroughIcon2,
|
|
4520
|
-
tooltip: "Strikethrough"
|
|
4521
|
-
},
|
|
4522
|
-
{
|
|
4523
|
-
name: "code",
|
|
4524
|
-
isActive: () => editor == null ? void 0 : editor.isActive("code"),
|
|
4525
|
-
command: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
|
|
4526
|
-
icon: CodeIcon,
|
|
4527
|
-
tooltip: "Code"
|
|
4528
|
-
}
|
|
4529
|
-
];
|
|
4530
|
-
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
4531
|
-
pluginKey: "textMenu",
|
|
4532
|
-
shouldShow: ({ editor: editor2, state: state2, from, to, view }) => {
|
|
4533
|
-
if (!view || editor2.view.dragging) {
|
|
4534
|
-
return false;
|
|
4535
|
-
}
|
|
4536
|
-
const domAtPos = view.domAtPos(from || 0).node;
|
|
4537
|
-
const nodeDOM = view.nodeDOM(from || 0);
|
|
4538
|
-
const node = nodeDOM || domAtPos;
|
|
4539
|
-
if (isCustomNodeSelected(editor2, node)) {
|
|
4540
|
-
return false;
|
|
4541
|
-
}
|
|
4542
|
-
return isTextSelected(editor2);
|
|
4543
|
-
},
|
|
4544
|
-
tippyOptions: {
|
|
4545
|
-
popperOptions: {
|
|
4546
|
-
placement: "top-start",
|
|
4547
|
-
modifiers: [
|
|
4548
|
-
{
|
|
4549
|
-
name: "preventOverflow",
|
|
4550
|
-
options: {
|
|
4551
|
-
boundary: "viewport",
|
|
4552
|
-
padding: 8
|
|
4553
|
-
}
|
|
4554
|
-
},
|
|
4555
|
-
{
|
|
4556
|
-
name: "flip",
|
|
4557
|
-
options: {
|
|
4558
|
-
fallbackPlacements: ["bottom-start", "top-end", "bottom-end"]
|
|
4559
|
-
}
|
|
4560
|
-
}
|
|
4561
|
-
]
|
|
4562
|
-
},
|
|
4563
|
-
maxWidth: "100%"
|
|
4564
|
-
}
|
|
4565
|
-
});
|
|
4566
|
-
const state = useTextMenuState(editor);
|
|
4567
|
-
return /* @__PURE__ */ jsx40(
|
|
4568
|
-
BubbleMenu6,
|
|
4569
|
-
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
4570
|
-
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",
|
|
4571
|
-
children: /* @__PURE__ */ jsxs21(TooltipProvider, { children: [
|
|
4572
|
-
items.map((item, index) => /* @__PURE__ */ jsx40(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
4573
|
-
/* @__PURE__ */ jsx40(
|
|
4574
|
-
AlignmentSwitch,
|
|
4575
|
-
{
|
|
4576
|
-
alignment: state.textAlign,
|
|
4577
|
-
onAlignmentChange: (alignment) => {
|
|
4578
|
-
editor == null ? void 0 : editor.chain().focus().setTextAlign(alignment).run();
|
|
4579
|
-
}
|
|
4580
|
-
}
|
|
4581
|
-
),
|
|
4582
|
-
!state.isListActive && /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
4583
|
-
/* @__PURE__ */ jsx40(
|
|
4584
|
-
BubbleMenuButton,
|
|
4585
|
-
{
|
|
4586
|
-
icon: List2,
|
|
4587
|
-
command: () => {
|
|
4588
|
-
editor.chain().focus().toggleBulletList().run();
|
|
4589
|
-
},
|
|
4590
|
-
tooltip: "Bullet List"
|
|
4591
|
-
}
|
|
4592
|
-
),
|
|
4593
|
-
/* @__PURE__ */ jsx40(
|
|
4594
|
-
BubbleMenuButton,
|
|
4595
|
-
{
|
|
4596
|
-
icon: ListOrdered2,
|
|
4597
|
-
command: () => {
|
|
4598
|
-
editor.chain().focus().toggleOrderedList().run();
|
|
4599
|
-
},
|
|
4600
|
-
tooltip: "Ordered List"
|
|
4601
|
-
}
|
|
4602
|
-
)
|
|
4603
|
-
] }),
|
|
4604
|
-
/* @__PURE__ */ jsx40(
|
|
4605
|
-
LinkInputPopover,
|
|
4606
|
-
{
|
|
4607
|
-
defaultValue: (_a = state == null ? void 0 : state.linkUrl) != null ? _a : "",
|
|
4608
|
-
onValueChange: (value) => {
|
|
4609
|
-
if (!value) {
|
|
4610
|
-
editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
4611
|
-
return;
|
|
4612
|
-
}
|
|
4613
|
-
editor == null ? void 0 : editor.chain().extendMarkRange("link").setLink({ href: value }).run();
|
|
4614
|
-
},
|
|
4615
|
-
tooltip: "External URL"
|
|
4616
|
-
}
|
|
4617
|
-
),
|
|
4618
|
-
/* @__PURE__ */ jsx40(Divider, {}),
|
|
4619
|
-
/* @__PURE__ */ jsx40(
|
|
4620
|
-
ColorPicker,
|
|
4621
|
-
{
|
|
4622
|
-
color: state.currentTextColor,
|
|
4623
|
-
onColorChange: (color) => {
|
|
4624
|
-
editor == null ? void 0 : editor.chain().setColor(color).run();
|
|
4625
|
-
},
|
|
4626
|
-
tooltip: "Text Color",
|
|
4627
|
-
children: /* @__PURE__ */ jsx40(
|
|
4628
|
-
BaseButton,
|
|
4629
|
-
{
|
|
4630
|
-
variant: "ghost",
|
|
4631
|
-
size: "sm",
|
|
4632
|
-
type: "button",
|
|
4633
|
-
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
4634
|
-
children: /* @__PURE__ */ jsxs21("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
4635
|
-
/* @__PURE__ */ jsx40("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700", children: "A" }),
|
|
4636
|
-
/* @__PURE__ */ jsx40(
|
|
4637
|
-
"div",
|
|
4638
|
-
{
|
|
4639
|
-
className: "mly-h-[2px] mly-w-3",
|
|
4640
|
-
style: { backgroundColor: state.currentTextColor }
|
|
4641
|
-
}
|
|
4642
|
-
)
|
|
4643
|
-
] })
|
|
4644
|
-
}
|
|
4645
|
-
)
|
|
4646
|
-
}
|
|
4647
|
-
)
|
|
4648
|
-
] })
|
|
4649
|
-
})
|
|
4650
|
-
);
|
|
4651
|
-
}
|
|
4652
|
-
|
|
4653
|
-
// src/editor/extensions/index.ts
|
|
4654
|
-
import StarterKit from "@tiptap/starter-kit";
|
|
4655
|
-
import { Color } from "@tiptap/extension-color";
|
|
4656
|
-
import TiptapLink from "@tiptap/extension-link";
|
|
4657
|
-
import ListItem from "@tiptap/extension-list-item";
|
|
4658
|
-
import Paragraph from "@tiptap/extension-paragraph";
|
|
4659
|
-
import Placeholder from "@tiptap/extension-placeholder";
|
|
4660
|
-
import TextAlign from "@tiptap/extension-text-align";
|
|
4661
|
-
import TextStyle from "@tiptap/extension-text-style";
|
|
4662
|
-
import Heading from "@tiptap/extension-heading";
|
|
4663
|
-
import Underline from "@tiptap/extension-underline";
|
|
4664
|
-
import Document from "@tiptap/extension-document";
|
|
4665
|
-
import Focus from "@tiptap/extension-focus";
|
|
4666
|
-
import Dropcursor from "@tiptap/extension-dropcursor";
|
|
4667
|
-
|
|
4668
|
-
// src/editor/nodes/footer.ts
|
|
4669
|
-
import { mergeAttributes as mergeAttributes7, Node as Node8 } from "@tiptap/core";
|
|
4670
|
-
var Footer = Node8.create({
|
|
4671
|
-
name: "footer",
|
|
4672
|
-
group: "block",
|
|
4673
|
-
content: "inline*",
|
|
4674
|
-
addAttributes() {
|
|
4675
|
-
return {
|
|
4676
|
-
"maily-component": {
|
|
4677
|
-
default: "footer",
|
|
4678
|
-
renderHTML: (attributes) => {
|
|
4679
|
-
return {
|
|
4680
|
-
"data-maily-component": attributes["maily-component"]
|
|
4681
|
-
};
|
|
4682
|
-
},
|
|
4683
|
-
parseHTML: (element) => element == null ? void 0 : element.getAttribute("data-maily-component")
|
|
4684
|
-
}
|
|
4685
|
-
};
|
|
4686
|
-
},
|
|
4687
|
-
addCommands() {
|
|
4688
|
-
return {
|
|
4689
|
-
setFooter: () => ({ commands }) => {
|
|
4690
|
-
return commands.setNode(this.name);
|
|
4691
|
-
}
|
|
4692
|
-
};
|
|
4693
|
-
},
|
|
4694
|
-
parseHTML() {
|
|
4695
|
-
return [{ tag: 'small[data-maily-component="footer"]' }];
|
|
4696
|
-
},
|
|
4697
|
-
renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
|
|
4698
|
-
return [
|
|
4699
|
-
"small",
|
|
4700
|
-
mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes2, {
|
|
4701
|
-
class: "footer mly-block mly-text-[13px] mly-text-slate-500"
|
|
4702
|
-
}),
|
|
4703
|
-
0
|
|
4704
|
-
];
|
|
4705
|
-
}
|
|
4706
|
-
});
|
|
4707
|
-
|
|
4708
4664
|
// src/editor/nodes/columns/columns.ts
|
|
4709
|
-
import { mergeAttributes as
|
|
4710
|
-
import { Node as
|
|
4665
|
+
import { mergeAttributes as mergeAttributes7 } from "@tiptap/core";
|
|
4666
|
+
import { Node as Node8 } from "@tiptap/core";
|
|
4711
4667
|
import { v4 as uuid3 } from "uuid";
|
|
4712
4668
|
var DEFAULT_COLUMNS_GAP = 8;
|
|
4713
|
-
var
|
|
4669
|
+
var ColumnsExtension = Node8.create({
|
|
4714
4670
|
name: "columns",
|
|
4715
4671
|
group: "columns",
|
|
4716
4672
|
content: "column+",
|
|
@@ -4786,8 +4742,9 @@ var Columns = Node9.create({
|
|
|
4786
4742
|
renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
|
|
4787
4743
|
return [
|
|
4788
4744
|
"div",
|
|
4789
|
-
|
|
4790
|
-
"data-type": "columns"
|
|
4745
|
+
mergeAttributes7(HTMLAttributes2, {
|
|
4746
|
+
"data-type": "columns",
|
|
4747
|
+
class: "mly-relative"
|
|
4791
4748
|
}),
|
|
4792
4749
|
0
|
|
4793
4750
|
];
|
|
@@ -4812,15 +4769,16 @@ var Columns = Node9.create({
|
|
|
4812
4769
|
});
|
|
4813
4770
|
|
|
4814
4771
|
// src/editor/nodes/for/for.ts
|
|
4815
|
-
import { mergeAttributes as
|
|
4772
|
+
import { mergeAttributes as mergeAttributes8, Node as Node9 } from "@tiptap/core";
|
|
4816
4773
|
import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
4817
4774
|
|
|
4818
4775
|
// src/editor/nodes/for/for-view.tsx
|
|
4819
4776
|
import { NodeViewWrapper as NodeViewWrapper6, NodeViewContent } from "@tiptap/react";
|
|
4820
4777
|
import { Repeat2 as Repeat22 } from "lucide-react";
|
|
4821
|
-
import { jsx as
|
|
4822
|
-
function ForView(
|
|
4823
|
-
|
|
4778
|
+
import { jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4779
|
+
function ForView(props) {
|
|
4780
|
+
const { editor, getPos } = props;
|
|
4781
|
+
return /* @__PURE__ */ jsxs21(
|
|
4824
4782
|
NodeViewWrapper6,
|
|
4825
4783
|
{
|
|
4826
4784
|
draggable: "true",
|
|
@@ -4828,16 +4786,20 @@ function ForView(_) {
|
|
|
4828
4786
|
"data-type": "for",
|
|
4829
4787
|
className: "mly-relative",
|
|
4830
4788
|
children: [
|
|
4831
|
-
/* @__PURE__ */
|
|
4832
|
-
/* @__PURE__ */
|
|
4789
|
+
/* @__PURE__ */ jsx40(NodeViewContent, { className: "is-editable" }),
|
|
4790
|
+
/* @__PURE__ */ jsxs21(
|
|
4833
4791
|
"div",
|
|
4834
4792
|
{
|
|
4793
|
+
role: "button",
|
|
4835
4794
|
"data-repeat-indicator": "",
|
|
4836
|
-
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",
|
|
4795
|
+
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",
|
|
4837
4796
|
contentEditable: false,
|
|
4797
|
+
onClick: () => {
|
|
4798
|
+
editor.commands.setNodeSelection(getPos());
|
|
4799
|
+
},
|
|
4838
4800
|
children: [
|
|
4839
|
-
/* @__PURE__ */
|
|
4840
|
-
/* @__PURE__ */
|
|
4801
|
+
/* @__PURE__ */ jsx40(Repeat22, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
|
|
4802
|
+
/* @__PURE__ */ jsx40("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
|
|
4841
4803
|
]
|
|
4842
4804
|
}
|
|
4843
4805
|
)
|
|
@@ -4847,7 +4809,7 @@ function ForView(_) {
|
|
|
4847
4809
|
}
|
|
4848
4810
|
|
|
4849
4811
|
// src/editor/nodes/for/for.ts
|
|
4850
|
-
var ForExtension =
|
|
4812
|
+
var ForExtension = Node9.create({
|
|
4851
4813
|
name: "for",
|
|
4852
4814
|
group: "block",
|
|
4853
4815
|
content: "(block|columns)+",
|
|
@@ -4898,7 +4860,7 @@ var ForExtension = Node10.create({
|
|
|
4898
4860
|
renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
|
|
4899
4861
|
return [
|
|
4900
4862
|
"div",
|
|
4901
|
-
|
|
4863
|
+
mergeAttributes8(HTMLAttributes2, {
|
|
4902
4864
|
"data-type": this.name
|
|
4903
4865
|
}),
|
|
4904
4866
|
0
|
|
@@ -4922,20 +4884,269 @@ var ForExtension = Node10.create({
|
|
|
4922
4884
|
},
|
|
4923
4885
|
addNodeView() {
|
|
4924
4886
|
return ReactNodeViewRenderer6(ForView, {
|
|
4925
|
-
contentDOMElementTag: "div"
|
|
4887
|
+
contentDOMElementTag: "div",
|
|
4888
|
+
className: "mly-relative"
|
|
4926
4889
|
});
|
|
4927
4890
|
}
|
|
4928
4891
|
});
|
|
4929
4892
|
|
|
4893
|
+
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
4894
|
+
import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4895
|
+
function TextBubbleMenu(props) {
|
|
4896
|
+
var _a;
|
|
4897
|
+
const { editor, appendTo } = props;
|
|
4898
|
+
if (!editor) {
|
|
4899
|
+
return null;
|
|
4900
|
+
}
|
|
4901
|
+
const items = [
|
|
4902
|
+
{
|
|
4903
|
+
name: "bold",
|
|
4904
|
+
isActive: () => editor == null ? void 0 : editor.isActive("bold"),
|
|
4905
|
+
command: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
|
|
4906
|
+
icon: BoldIcon2,
|
|
4907
|
+
tooltip: "Bold"
|
|
4908
|
+
},
|
|
4909
|
+
{
|
|
4910
|
+
name: "italic",
|
|
4911
|
+
isActive: () => editor == null ? void 0 : editor.isActive("italic"),
|
|
4912
|
+
command: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
|
|
4913
|
+
icon: ItalicIcon2,
|
|
4914
|
+
tooltip: "Italic"
|
|
4915
|
+
},
|
|
4916
|
+
{
|
|
4917
|
+
name: "underline",
|
|
4918
|
+
isActive: () => editor == null ? void 0 : editor.isActive("underline"),
|
|
4919
|
+
command: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run(),
|
|
4920
|
+
icon: UnderlineIcon2,
|
|
4921
|
+
tooltip: "Underline"
|
|
4922
|
+
},
|
|
4923
|
+
{
|
|
4924
|
+
name: "strike",
|
|
4925
|
+
isActive: () => editor == null ? void 0 : editor.isActive("strike"),
|
|
4926
|
+
command: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
|
|
4927
|
+
icon: StrikethroughIcon2,
|
|
4928
|
+
tooltip: "Strikethrough"
|
|
4929
|
+
},
|
|
4930
|
+
{
|
|
4931
|
+
name: "code",
|
|
4932
|
+
isActive: () => editor == null ? void 0 : editor.isActive("code"),
|
|
4933
|
+
command: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
|
|
4934
|
+
icon: CodeIcon,
|
|
4935
|
+
tooltip: "Code"
|
|
4936
|
+
}
|
|
4937
|
+
];
|
|
4938
|
+
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
4939
|
+
pluginKey: "textMenu",
|
|
4940
|
+
shouldShow: ({ editor: editor2, from, view }) => {
|
|
4941
|
+
var _a2;
|
|
4942
|
+
if (!view || editor2.view.dragging) {
|
|
4943
|
+
return false;
|
|
4944
|
+
}
|
|
4945
|
+
const domAtPos = view.domAtPos(from || 0).node;
|
|
4946
|
+
const nodeDOM = view.nodeDOM(from || 0);
|
|
4947
|
+
const node = nodeDOM || domAtPos;
|
|
4948
|
+
if (isCustomNodeSelected(editor2, node)) {
|
|
4949
|
+
return false;
|
|
4950
|
+
}
|
|
4951
|
+
const nestedNodes = [
|
|
4952
|
+
ForExtension.name,
|
|
4953
|
+
SectionExtension.name,
|
|
4954
|
+
ColumnsExtension.name,
|
|
4955
|
+
ColumnExtension.name
|
|
4956
|
+
];
|
|
4957
|
+
const isNestedNodeSelected = nestedNodes.some((name) => editor2.isActive(name)) && ((_a2 = node == null ? void 0 : node.classList) == null ? void 0 : _a2.contains("ProseMirror-selectednode"));
|
|
4958
|
+
return isTextSelected(editor2) && !isNestedNodeSelected;
|
|
4959
|
+
},
|
|
4960
|
+
tippyOptions: {
|
|
4961
|
+
popperOptions: {
|
|
4962
|
+
placement: "top-start",
|
|
4963
|
+
modifiers: [
|
|
4964
|
+
{
|
|
4965
|
+
name: "preventOverflow",
|
|
4966
|
+
options: {
|
|
4967
|
+
boundary: "viewport",
|
|
4968
|
+
padding: 8
|
|
4969
|
+
}
|
|
4970
|
+
},
|
|
4971
|
+
{
|
|
4972
|
+
name: "flip",
|
|
4973
|
+
options: {
|
|
4974
|
+
fallbackPlacements: ["bottom-start", "top-end", "bottom-end"]
|
|
4975
|
+
}
|
|
4976
|
+
}
|
|
4977
|
+
]
|
|
4978
|
+
},
|
|
4979
|
+
maxWidth: "100%"
|
|
4980
|
+
}
|
|
4981
|
+
});
|
|
4982
|
+
const state = useTextMenuState(editor);
|
|
4983
|
+
return /* @__PURE__ */ jsx41(
|
|
4984
|
+
BubbleMenu6,
|
|
4985
|
+
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
4986
|
+
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",
|
|
4987
|
+
children: /* @__PURE__ */ jsxs22(TooltipProvider, { children: [
|
|
4988
|
+
items.map((item, index) => /* @__PURE__ */ jsx41(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
4989
|
+
/* @__PURE__ */ jsx41(
|
|
4990
|
+
AlignmentSwitch,
|
|
4991
|
+
{
|
|
4992
|
+
alignment: state.textAlign,
|
|
4993
|
+
onAlignmentChange: (alignment) => {
|
|
4994
|
+
editor == null ? void 0 : editor.chain().focus().setTextAlign(alignment).run();
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
),
|
|
4998
|
+
!state.isListActive && /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
4999
|
+
/* @__PURE__ */ jsx41(
|
|
5000
|
+
BubbleMenuButton,
|
|
5001
|
+
{
|
|
5002
|
+
icon: List2,
|
|
5003
|
+
command: () => {
|
|
5004
|
+
editor.chain().focus().toggleBulletList().run();
|
|
5005
|
+
},
|
|
5006
|
+
tooltip: "Bullet List"
|
|
5007
|
+
}
|
|
5008
|
+
),
|
|
5009
|
+
/* @__PURE__ */ jsx41(
|
|
5010
|
+
BubbleMenuButton,
|
|
5011
|
+
{
|
|
5012
|
+
icon: ListOrdered2,
|
|
5013
|
+
command: () => {
|
|
5014
|
+
editor.chain().focus().toggleOrderedList().run();
|
|
5015
|
+
},
|
|
5016
|
+
tooltip: "Ordered List"
|
|
5017
|
+
}
|
|
5018
|
+
)
|
|
5019
|
+
] }),
|
|
5020
|
+
/* @__PURE__ */ jsx41(
|
|
5021
|
+
LinkInputPopover,
|
|
5022
|
+
{
|
|
5023
|
+
defaultValue: (_a = state == null ? void 0 : state.linkUrl) != null ? _a : "",
|
|
5024
|
+
onValueChange: (value) => {
|
|
5025
|
+
const defaultValueWithoutProtocol = value.replace(
|
|
5026
|
+
/https?:\/\//,
|
|
5027
|
+
""
|
|
5028
|
+
);
|
|
5029
|
+
if (!defaultValueWithoutProtocol) {
|
|
5030
|
+
editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").unsetLink().unsetUnderline().run();
|
|
5031
|
+
return;
|
|
5032
|
+
}
|
|
5033
|
+
editor == null ? void 0 : editor.chain().extendMarkRange("link").setLink({ href: value }).setUnderline().run();
|
|
5034
|
+
},
|
|
5035
|
+
tooltip: "External URL"
|
|
5036
|
+
}
|
|
5037
|
+
),
|
|
5038
|
+
/* @__PURE__ */ jsx41(Divider, {}),
|
|
5039
|
+
/* @__PURE__ */ jsx41(
|
|
5040
|
+
ColorPicker,
|
|
5041
|
+
{
|
|
5042
|
+
color: state.currentTextColor,
|
|
5043
|
+
onColorChange: (color) => {
|
|
5044
|
+
editor == null ? void 0 : editor.chain().setColor(color).run();
|
|
5045
|
+
},
|
|
5046
|
+
tooltip: "Text Color",
|
|
5047
|
+
children: /* @__PURE__ */ jsx41(
|
|
5048
|
+
BaseButton,
|
|
5049
|
+
{
|
|
5050
|
+
variant: "ghost",
|
|
5051
|
+
size: "sm",
|
|
5052
|
+
type: "button",
|
|
5053
|
+
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
5054
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
5055
|
+
/* @__PURE__ */ jsx41("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700", children: "A" }),
|
|
5056
|
+
/* @__PURE__ */ jsx41(
|
|
5057
|
+
"div",
|
|
5058
|
+
{
|
|
5059
|
+
className: "mly-h-[2px] mly-w-3",
|
|
5060
|
+
style: { backgroundColor: state.currentTextColor }
|
|
5061
|
+
}
|
|
5062
|
+
)
|
|
5063
|
+
] })
|
|
5064
|
+
}
|
|
5065
|
+
)
|
|
5066
|
+
}
|
|
5067
|
+
)
|
|
5068
|
+
] })
|
|
5069
|
+
})
|
|
5070
|
+
);
|
|
5071
|
+
}
|
|
5072
|
+
|
|
5073
|
+
// src/editor/extensions/index.ts
|
|
5074
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
5075
|
+
import { Color } from "@tiptap/extension-color";
|
|
5076
|
+
import TiptapLink from "@tiptap/extension-link";
|
|
5077
|
+
import ListItem from "@tiptap/extension-list-item";
|
|
5078
|
+
import Paragraph from "@tiptap/extension-paragraph";
|
|
5079
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
5080
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
5081
|
+
import TextStyle from "@tiptap/extension-text-style";
|
|
5082
|
+
import Heading from "@tiptap/extension-heading";
|
|
5083
|
+
import Underline from "@tiptap/extension-underline";
|
|
5084
|
+
import Document from "@tiptap/extension-document";
|
|
5085
|
+
import Focus from "@tiptap/extension-focus";
|
|
5086
|
+
import Dropcursor from "@tiptap/extension-dropcursor";
|
|
5087
|
+
|
|
5088
|
+
// src/editor/nodes/footer.ts
|
|
5089
|
+
import { mergeAttributes as mergeAttributes9, Node as Node10 } from "@tiptap/core";
|
|
5090
|
+
var Footer = Node10.create({
|
|
5091
|
+
name: "footer",
|
|
5092
|
+
group: "block",
|
|
5093
|
+
content: "inline*",
|
|
5094
|
+
addAttributes() {
|
|
5095
|
+
return {
|
|
5096
|
+
"maily-component": {
|
|
5097
|
+
default: "footer",
|
|
5098
|
+
renderHTML: (attributes) => {
|
|
5099
|
+
return {
|
|
5100
|
+
"data-maily-component": attributes["maily-component"]
|
|
5101
|
+
};
|
|
5102
|
+
},
|
|
5103
|
+
parseHTML: (element) => element == null ? void 0 : element.getAttribute("data-maily-component")
|
|
5104
|
+
}
|
|
5105
|
+
};
|
|
5106
|
+
},
|
|
5107
|
+
addCommands() {
|
|
5108
|
+
return {
|
|
5109
|
+
setFooter: () => ({ commands }) => {
|
|
5110
|
+
return commands.setNode(this.name);
|
|
5111
|
+
}
|
|
5112
|
+
};
|
|
5113
|
+
},
|
|
5114
|
+
parseHTML() {
|
|
5115
|
+
return [{ tag: 'small[data-maily-component="footer"]' }];
|
|
5116
|
+
},
|
|
5117
|
+
renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
|
|
5118
|
+
return [
|
|
5119
|
+
"small",
|
|
5120
|
+
mergeAttributes9(this.options.HTMLAttributes, HTMLAttributes2, {
|
|
5121
|
+
class: "footer mly-block mly-text-[13px] mly-text-slate-500 mly-relative"
|
|
5122
|
+
}),
|
|
5123
|
+
0
|
|
5124
|
+
];
|
|
5125
|
+
}
|
|
5126
|
+
});
|
|
5127
|
+
|
|
4930
5128
|
// src/editor/nodes/variable/variable-suggestions.tsx
|
|
4931
5129
|
import { ReactRenderer } from "@tiptap/react";
|
|
4932
|
-
import {
|
|
4933
|
-
|
|
5130
|
+
import {
|
|
5131
|
+
ArrowDown,
|
|
5132
|
+
ArrowUp,
|
|
5133
|
+
Braces as Braces4,
|
|
5134
|
+
CornerDownLeft as CornerDownLeft4
|
|
5135
|
+
} from "lucide-react";
|
|
5136
|
+
import {
|
|
5137
|
+
forwardRef as forwardRef7,
|
|
5138
|
+
useEffect as useEffect6,
|
|
5139
|
+
useImperativeHandle,
|
|
5140
|
+
useState as useState9,
|
|
5141
|
+
useRef as useRef8
|
|
5142
|
+
} from "react";
|
|
4934
5143
|
import tippy from "tippy.js";
|
|
4935
5144
|
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4936
|
-
var VariableList =
|
|
4937
|
-
|
|
5145
|
+
var VariableList = forwardRef7((props, ref) => {
|
|
5146
|
+
const { items = [] } = props;
|
|
4938
5147
|
const [selectedIndex, setSelectedIndex] = useState9(0);
|
|
5148
|
+
const scrollContainerRef = useRef8(null);
|
|
5149
|
+
const itemRefs = useRef8([]);
|
|
4939
5150
|
const selectItem = (index) => {
|
|
4940
5151
|
const item = props.items[index];
|
|
4941
5152
|
if (!item) {
|
|
@@ -4943,19 +5154,41 @@ var VariableList = forwardRef6((props, ref) => {
|
|
|
4943
5154
|
}
|
|
4944
5155
|
props.command({ id: item });
|
|
4945
5156
|
};
|
|
4946
|
-
|
|
5157
|
+
const scrollSelectedIntoView = (index) => {
|
|
5158
|
+
const container = scrollContainerRef.current;
|
|
5159
|
+
const selectedItem = itemRefs.current[index];
|
|
5160
|
+
if (!container || !selectedItem) {
|
|
5161
|
+
return;
|
|
5162
|
+
}
|
|
5163
|
+
const containerRect = container.getBoundingClientRect();
|
|
5164
|
+
const itemRect = selectedItem.getBoundingClientRect();
|
|
5165
|
+
const padding = 4;
|
|
5166
|
+
if (itemRect.bottom > containerRect.bottom) {
|
|
5167
|
+
container.scrollTop += itemRect.bottom - containerRect.bottom + padding;
|
|
5168
|
+
} else if (itemRect.top < containerRect.top) {
|
|
5169
|
+
container.scrollTop += itemRect.top - containerRect.top - padding;
|
|
5170
|
+
}
|
|
5171
|
+
};
|
|
5172
|
+
useEffect6(() => {
|
|
4947
5173
|
setSelectedIndex(0);
|
|
5174
|
+
if (scrollContainerRef.current) {
|
|
5175
|
+
scrollContainerRef.current.scrollTop = 0;
|
|
5176
|
+
}
|
|
5177
|
+
itemRefs.current = props.items.map(() => null);
|
|
4948
5178
|
}, [props.items]);
|
|
5179
|
+
useEffect6(() => {
|
|
5180
|
+
scrollSelectedIntoView(selectedIndex);
|
|
5181
|
+
}, [selectedIndex]);
|
|
4949
5182
|
useImperativeHandle(ref, () => ({
|
|
4950
5183
|
onKeyDown: ({ event }) => {
|
|
4951
5184
|
if (event.key === "ArrowUp") {
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
);
|
|
5185
|
+
event.preventDefault();
|
|
5186
|
+
setSelectedIndex((selectedIndex + items.length - 1) % items.length);
|
|
4955
5187
|
return true;
|
|
4956
5188
|
}
|
|
4957
5189
|
if (event.key === "ArrowDown") {
|
|
4958
|
-
|
|
5190
|
+
event.preventDefault();
|
|
5191
|
+
setSelectedIndex((selectedIndex + 1) % items.length);
|
|
4959
5192
|
return true;
|
|
4960
5193
|
}
|
|
4961
5194
|
if (event.key === "Enter") {
|
|
@@ -4965,26 +5198,34 @@ var VariableList = forwardRef6((props, ref) => {
|
|
|
4965
5198
|
return false;
|
|
4966
5199
|
}
|
|
4967
5200
|
}));
|
|
4968
|
-
return /* @__PURE__ */ jsxs23("div", { className: "mly-z-50 mly-
|
|
5201
|
+
return /* @__PURE__ */ jsxs23("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: [
|
|
4969
5202
|
/* @__PURE__ */ jsxs23("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: [
|
|
4970
5203
|
/* @__PURE__ */ jsx42("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
|
|
4971
5204
|
/* @__PURE__ */ jsx42(VariableIcon, { children: /* @__PURE__ */ jsx42(Braces4, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
4972
5205
|
] }),
|
|
4973
|
-
/* @__PURE__ */ jsx42(
|
|
4974
|
-
"
|
|
5206
|
+
/* @__PURE__ */ jsx42(
|
|
5207
|
+
"div",
|
|
4975
5208
|
{
|
|
4976
|
-
|
|
4977
|
-
className:
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
5209
|
+
ref: scrollContainerRef,
|
|
5210
|
+
className: "mly-max-h-52 mly-overflow-y-auto mly-scrollbar-thin mly-scrollbar-track-transparent mly-scrollbar-thumb-gray-200",
|
|
5211
|
+
children: /* @__PURE__ */ jsx42("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__ */ jsxs23(
|
|
5212
|
+
"button",
|
|
5213
|
+
{
|
|
5214
|
+
ref: (el) => itemRefs.current[index] = el,
|
|
5215
|
+
onClick: () => selectItem(index),
|
|
5216
|
+
className: cn(
|
|
5217
|
+
"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",
|
|
5218
|
+
index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
|
|
5219
|
+
),
|
|
5220
|
+
children: [
|
|
5221
|
+
/* @__PURE__ */ jsx42(Braces4, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
5222
|
+
item
|
|
5223
|
+
]
|
|
5224
|
+
},
|
|
5225
|
+
index
|
|
5226
|
+
)) : /* @__PURE__ */ jsx42("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" }) })
|
|
5227
|
+
}
|
|
5228
|
+
),
|
|
4988
5229
|
/* @__PURE__ */ jsxs23("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: [
|
|
4989
5230
|
/* @__PURE__ */ jsxs23("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
|
|
4990
5231
|
/* @__PURE__ */ jsx42(VariableIcon, { children: /* @__PURE__ */ jsx42(ArrowDown, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
@@ -4995,6 +5236,7 @@ var VariableList = forwardRef6((props, ref) => {
|
|
|
4995
5236
|
] })
|
|
4996
5237
|
] });
|
|
4997
5238
|
});
|
|
5239
|
+
VariableList.displayName = "VariableList";
|
|
4998
5240
|
function VariableIcon(props) {
|
|
4999
5241
|
const { className, children } = props;
|
|
5000
5242
|
return /* @__PURE__ */ jsx42(
|
|
@@ -5009,23 +5251,15 @@ function VariableIcon(props) {
|
|
|
5009
5251
|
);
|
|
5010
5252
|
}
|
|
5011
5253
|
VariableList.displayName = "VariableList";
|
|
5012
|
-
function getVariableSuggestions(variables =
|
|
5013
|
-
const defaultVariables = variables.filter((v) => !v.iterable).map((variable) => variable.name);
|
|
5254
|
+
function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VARIABLE_TRIGGER_CHAR) {
|
|
5014
5255
|
return {
|
|
5015
5256
|
char,
|
|
5016
5257
|
items: ({ query, editor }) => {
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
(name) => name.toLowerCase().startsWith(queryLower)
|
|
5023
|
-
);
|
|
5024
|
-
const combinedKeys = [...associatedVariableKeys, ...filteredVariableKeys];
|
|
5025
|
-
if (query.length > 0 && !filteredVariableKeys.includes(query)) {
|
|
5026
|
-
combinedKeys.push(query);
|
|
5027
|
-
}
|
|
5028
|
-
return combinedKeys.slice(0, 5);
|
|
5258
|
+
return processVariables(variables, {
|
|
5259
|
+
query,
|
|
5260
|
+
editor,
|
|
5261
|
+
from: "variable"
|
|
5262
|
+
}).map((variable) => variable.name);
|
|
5029
5263
|
},
|
|
5030
5264
|
render: () => {
|
|
5031
5265
|
let component;
|
|
@@ -5123,10 +5357,10 @@ var updateScrollView = (container, item) => {
|
|
|
5123
5357
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
5124
5358
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
5125
5359
|
import {
|
|
5126
|
-
useCallback as
|
|
5127
|
-
useEffect as
|
|
5360
|
+
useCallback as useCallback7,
|
|
5361
|
+
useEffect as useEffect7,
|
|
5128
5362
|
useLayoutEffect as useLayoutEffect2,
|
|
5129
|
-
useRef as
|
|
5363
|
+
useRef as useRef9,
|
|
5130
5364
|
useState as useState10
|
|
5131
5365
|
} from "react";
|
|
5132
5366
|
import tippy2 from "tippy.js";
|
|
@@ -5134,7 +5368,7 @@ import { jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
|
5134
5368
|
function CommandList(props) {
|
|
5135
5369
|
const { items, command, editor } = props;
|
|
5136
5370
|
const [selectedIndex, setSelectedIndex] = useState10(0);
|
|
5137
|
-
const selectItem =
|
|
5371
|
+
const selectItem = useCallback7(
|
|
5138
5372
|
(index) => {
|
|
5139
5373
|
const item = items[index];
|
|
5140
5374
|
if (item) {
|
|
@@ -5144,7 +5378,7 @@ function CommandList(props) {
|
|
|
5144
5378
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5145
5379
|
[command, editor, items]
|
|
5146
5380
|
);
|
|
5147
|
-
|
|
5381
|
+
useEffect7(() => {
|
|
5148
5382
|
const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];
|
|
5149
5383
|
const onKeyDown = (e) => {
|
|
5150
5384
|
if (navigationKeys.includes(e.key)) {
|
|
@@ -5169,10 +5403,10 @@ function CommandList(props) {
|
|
|
5169
5403
|
document.removeEventListener("keydown", onKeyDown);
|
|
5170
5404
|
};
|
|
5171
5405
|
}, [items, selectedIndex, setSelectedIndex, selectItem]);
|
|
5172
|
-
|
|
5406
|
+
useEffect7(() => {
|
|
5173
5407
|
setSelectedIndex(0);
|
|
5174
5408
|
}, [items]);
|
|
5175
|
-
const commandListContainer =
|
|
5409
|
+
const commandListContainer = useRef9(null);
|
|
5176
5410
|
useLayoutEffect2(() => {
|
|
5177
5411
|
const container = commandListContainer == null ? void 0 : commandListContainer.current;
|
|
5178
5412
|
const item = container == null ? void 0 : container.children[selectedIndex];
|
|
@@ -5287,25 +5521,43 @@ function getSlashCommandSuggestions(commands = []) {
|
|
|
5287
5521
|
|
|
5288
5522
|
// src/editor/extensions/index.ts
|
|
5289
5523
|
function extensions(props) {
|
|
5290
|
-
const { variables, blocks,
|
|
5524
|
+
const { variables, blocks, variableTriggerCharacter } = props;
|
|
5291
5525
|
return [
|
|
5292
5526
|
Document.extend({
|
|
5293
5527
|
content: "(block|columns)+"
|
|
5294
5528
|
}),
|
|
5295
|
-
|
|
5296
|
-
|
|
5529
|
+
ColumnsExtension,
|
|
5530
|
+
ColumnExtension,
|
|
5297
5531
|
StarterKit.configure({
|
|
5298
5532
|
heading: {
|
|
5299
|
-
levels: [1, 2, 3]
|
|
5533
|
+
levels: [1, 2, 3],
|
|
5534
|
+
HTMLAttributes: {
|
|
5535
|
+
class: "mly-relative"
|
|
5536
|
+
}
|
|
5300
5537
|
},
|
|
5301
5538
|
code: {
|
|
5302
5539
|
HTMLAttributes: {
|
|
5303
|
-
class: "mly-px-1 mly-py-0.5 mly-bg-[#efefef] mly-text-sm mly-rounded-md mly-tracking-normal mly-font-normal"
|
|
5540
|
+
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"
|
|
5304
5541
|
}
|
|
5305
5542
|
},
|
|
5306
5543
|
blockquote: {
|
|
5307
5544
|
HTMLAttributes: {
|
|
5308
|
-
class: "mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4"
|
|
5545
|
+
class: "mly-not-prose mly-border-l-4 mly-border-gray-300 mly-pl-4 mly-mt-4 mly-mb-4 mly-relative"
|
|
5546
|
+
}
|
|
5547
|
+
},
|
|
5548
|
+
paragraph: {
|
|
5549
|
+
HTMLAttributes: {
|
|
5550
|
+
class: "mly-relative"
|
|
5551
|
+
}
|
|
5552
|
+
},
|
|
5553
|
+
bulletList: {
|
|
5554
|
+
HTMLAttributes: {
|
|
5555
|
+
class: "mly-relative"
|
|
5556
|
+
}
|
|
5557
|
+
},
|
|
5558
|
+
orderedList: {
|
|
5559
|
+
HTMLAttributes: {
|
|
5560
|
+
class: "mly-relative"
|
|
5309
5561
|
}
|
|
5310
5562
|
},
|
|
5311
5563
|
horizontalRule: false,
|
|
@@ -5322,9 +5574,14 @@ function extensions(props) {
|
|
|
5322
5574
|
placeholder: ({ node }) => {
|
|
5323
5575
|
if (node.type.name === "heading") {
|
|
5324
5576
|
return `Heading ${node.attrs.level}`;
|
|
5325
|
-
} else if ([
|
|
5326
|
-
|
|
5327
|
-
|
|
5577
|
+
} else if ([
|
|
5578
|
+
"columns",
|
|
5579
|
+
"column",
|
|
5580
|
+
"section",
|
|
5581
|
+
"for",
|
|
5582
|
+
"show",
|
|
5583
|
+
"blockquote"
|
|
5584
|
+
].includes(node.type.name)) {
|
|
5328
5585
|
return "";
|
|
5329
5586
|
}
|
|
5330
5587
|
return "Write something or / to see commands";
|
|
@@ -5339,7 +5596,8 @@ function extensions(props) {
|
|
|
5339
5596
|
TiptapLink.configure({
|
|
5340
5597
|
HTMLAttributes: {
|
|
5341
5598
|
target: "_blank",
|
|
5342
|
-
rel: "noopener noreferrer nofollow"
|
|
5599
|
+
rel: "noopener noreferrer nofollow",
|
|
5600
|
+
class: "mly-no-underline"
|
|
5343
5601
|
},
|
|
5344
5602
|
openOnClick: false
|
|
5345
5603
|
}),
|
|
@@ -5355,7 +5613,7 @@ function extensions(props) {
|
|
|
5355
5613
|
}),
|
|
5356
5614
|
ButtonExtension,
|
|
5357
5615
|
VariableExtension.configure({
|
|
5358
|
-
suggestion: getVariableSuggestions(variables,
|
|
5616
|
+
suggestion: getVariableSuggestions(variables, variableTriggerCharacter)
|
|
5359
5617
|
})
|
|
5360
5618
|
];
|
|
5361
5619
|
}
|
|
@@ -5378,9 +5636,9 @@ function Editor8(props) {
|
|
|
5378
5636
|
extensions: extensions2,
|
|
5379
5637
|
contentHtml,
|
|
5380
5638
|
contentJson,
|
|
5381
|
-
variables,
|
|
5639
|
+
variables = DEFAULT_VARIABLES,
|
|
5382
5640
|
blocks = DEFAULT_SLASH_COMMANDS,
|
|
5383
|
-
|
|
5641
|
+
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR
|
|
5384
5642
|
} = props;
|
|
5385
5643
|
let formattedContent = null;
|
|
5386
5644
|
if (contentJson) {
|
|
@@ -5401,7 +5659,7 @@ function Editor8(props) {
|
|
|
5401
5659
|
]
|
|
5402
5660
|
};
|
|
5403
5661
|
}
|
|
5404
|
-
const menuContainerRef =
|
|
5662
|
+
const menuContainerRef = useRef10(null);
|
|
5405
5663
|
const editor = useEditor({
|
|
5406
5664
|
editorProps: {
|
|
5407
5665
|
attributes: {
|
|
@@ -5430,7 +5688,7 @@ function Editor8(props) {
|
|
|
5430
5688
|
...extensions({
|
|
5431
5689
|
variables,
|
|
5432
5690
|
blocks,
|
|
5433
|
-
|
|
5691
|
+
variableTriggerCharacter
|
|
5434
5692
|
}),
|
|
5435
5693
|
...extensions2 || []
|
|
5436
5694
|
],
|
|
@@ -5445,7 +5703,7 @@ function Editor8(props) {
|
|
|
5445
5703
|
{
|
|
5446
5704
|
variables,
|
|
5447
5705
|
blocks,
|
|
5448
|
-
|
|
5706
|
+
variableTriggerCharacter,
|
|
5449
5707
|
children: /* @__PURE__ */ jsxs25(
|
|
5450
5708
|
"div",
|
|
5451
5709
|
{
|