@maily-to/core 0.0.18 → 0.0.20
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 +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1105 -846
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1006 -747
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -93,15 +93,15 @@ styleInject(':root {\n --placeholder-color: #adb5bd;\n --bg-color: #ffffff;\n
|
|
|
93
93
|
styleInject(':where(.mly-editor),\n:where(.mly-editor) ::before,\n:where(.mly-editor) ::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: #e5e7eb;\n}\n:where(.mly-editor) ::before,\n:where(.mly-editor) ::after {\n --tw-content: "";\n}\n:where(.mly-editor) html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n:where(.mly-editor) body {\n margin: 0;\n line-height: inherit;\n}\n:where(.mly-editor) hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n:where(.mly-editor) abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n:where(.mly-editor) h1,\n:where(.mly-editor) h2,\n:where(.mly-editor) h3,\n:where(.mly-editor) h4,\n:where(.mly-editor) h5,\n:where(.mly-editor) h6 {\n font-size: inherit;\n font-weight: inherit;\n}\n:where(.mly-editor) a {\n color: inherit;\n text-decoration: inherit;\n}\n:where(.mly-editor) b,\n:where(.mly-editor) strong {\n font-weight: bolder;\n}\n:where(.mly-editor) code,\n:where(.mly-editor) kbd,\n:where(.mly-editor) samp,\n:where(.mly-editor) pre {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n font-size: 1em;\n}\n:where(.mly-editor) small {\n font-size: 80%;\n}\n:where(.mly-editor) sub,\n:where(.mly-editor) sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n:where(.mly-editor) sub {\n bottom: -0.25em;\n}\n:where(.mly-editor) sup {\n top: -0.5em;\n}\n:where(.mly-editor) table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) input,\n:where(.mly-editor) optgroup,\n:where(.mly-editor) select,\n:where(.mly-editor) textarea {\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) select {\n text-transform: none;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) [type=button],\n:where(.mly-editor) [type=reset],\n:where(.mly-editor) [type=submit] {\n -webkit-appearance: button;\n background-image: none;\n}\n:where(.mly-editor) :-moz-focusring {\n outline: auto;\n}\n:where(.mly-editor) :-moz-ui-invalid {\n box-shadow: none;\n}\n:where(.mly-editor) progress {\n vertical-align: baseline;\n}\n:where(.mly-editor) ::-webkit-inner-spin-button,\n:where(.mly-editor) ::-webkit-outer-spin-button {\n height: auto;\n}\n:where(.mly-editor) [type=search] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n:where(.mly-editor) ::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n:where(.mly-editor) ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n:where(.mly-editor) summary {\n display: list-item;\n}\n:where(.mly-editor) blockquote,\n:where(.mly-editor) dl,\n:where(.mly-editor) dd,\n:where(.mly-editor) h1,\n:where(.mly-editor) h2,\n:where(.mly-editor) h3,\n:where(.mly-editor) h4,\n:where(.mly-editor) h5,\n:where(.mly-editor) h6,\n:where(.mly-editor) hr,\n:where(.mly-editor) figure,\n:where(.mly-editor) p,\n:where(.mly-editor) pre {\n margin: 0;\n}\n:where(.mly-editor) fieldset {\n margin: 0;\n padding: 0;\n}\n:where(.mly-editor) legend {\n padding: 0;\n}\n:where(.mly-editor) ol,\n:where(.mly-editor) ul,\n:where(.mly-editor) menu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n:where(.mly-editor) dialog {\n padding: 0;\n}\n:where(.mly-editor) textarea {\n resize: vertical;\n}\n:where(.mly-editor) input::-moz-placeholder,\n:where(.mly-editor) textarea::-moz-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.mly-editor) input::placeholder,\n:where(.mly-editor) textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.mly-editor) button,\n:where(.mly-editor) [role=button] {\n cursor: pointer;\n}\n:where(.mly-editor) :disabled {\n cursor: default;\n}\n:where(.mly-editor) img,\n:where(.mly-editor) svg,\n:where(.mly-editor) video,\n:where(.mly-editor) canvas,\n:where(.mly-editor) audio,\n:where(.mly-editor) iframe,\n:where(.mly-editor) embed,\n:where(.mly-editor) object {\n display: block;\n vertical-align: middle;\n}\n:where(.mly-editor) img,\n:where(.mly-editor) video {\n max-width: 100%;\n height: auto;\n}\n:where(.mly-editor) [hidden] {\n display: none;\n}\n');
|
|
94
94
|
|
|
95
95
|
// src/styles/tailwind.css
|
|
96
|
-
styleInject('*,\n::before,\n::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n* {\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');
|
|
96
|
+
styleInject('*,\n::before,\n::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n* {\n scrollbar-color: initial;\n scrollbar-width: initial;\n}\n.mly-prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.mly-prose :where(p):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.mly-prose :where(a):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.mly-prose :where(strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.mly-prose :where(a strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(ol):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: decimal;\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-alpha;\n}\n.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-alpha;\n}\n.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-alpha;\n}\n.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-alpha;\n}\n.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-roman;\n}\n.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-roman;\n}\n.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: upper-roman;\n}\n.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: lower-roman;\n}\n.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: decimal;\n}\n.mly-prose :where(ul):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n list-style-type: disc;\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(ol > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.mly-prose :where(ul > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.mly-prose :where(dt):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.25em;\n}\n.mly-prose :where(hr):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.mly-prose :where(blockquote):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-inline-start-width: 0.25rem;\n border-inline-start-color: var(--tw-prose-quote-borders);\n quotes: "\\201c""\\201d""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-inline-start: 1em;\n}\n.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: open-quote;\n}\n.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: close-quote;\n}\n.mly-prose :where(h1):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 900;\n color: inherit;\n}\n.mly-prose :where(h2):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 800;\n color: inherit;\n}\n.mly-prose :where(h3):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 700;\n color: inherit;\n}\n.mly-prose :where(h4):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 700;\n color: inherit;\n}\n.mly-prose :where(img):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(picture):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n display: block;\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(video):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(kbd):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n font-weight: 500;\n font-family: inherit;\n color: var(--tw-prose-kbd);\n box-shadow: 0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);\n font-size: 0.875em;\n border-radius: 0.3125rem;\n padding-top: 0.1875em;\n padding-inline-end: 0.375em;\n padding-bottom: 0.1875em;\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: "`";\n}\n.mly-prose :where(code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: "`";\n}\n.mly-prose :where(a code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(h1 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(h2 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n font-size: 0.875em;\n}\n.mly-prose :where(h3 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n font-size: 0.9em;\n}\n.mly-prose :where(h4 code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(thead th code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: inherit;\n}\n.mly-prose :where(pre):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-inline-end: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-inline-start: 1.1428571em;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::before {\n content: none;\n}\n.mly-prose :where(pre code):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *))::after {\n content: none;\n}\n.mly-prose :where(table):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n width: 100%;\n table-layout: auto;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.mly-prose :where(thead):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.mly-prose :where(thead th):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-inline-end: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-inline-start: 0.5714286em;\n}\n.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-bottom-width: 0;\n}\n.mly-prose :where(tbody td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n vertical-align: baseline;\n}\n.mly-prose :where(tfoot):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n border-top-width: 1px;\n border-top-color: var(--tw-prose-th-borders);\n}\n.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n vertical-align: top;\n}\n.mly-prose :where(th, td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n text-align: start;\n}\n.mly-prose :where(figure > *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.mly-prose :where(figcaption):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.mly-prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-kbd: #111827;\n --tw-prose-kbd-shadows: 17 24 39;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-kbd: #fff;\n --tw-prose-invert-kbd-shadows: 255 255 255;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.mly-prose :where(picture > img):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.mly-prose :where(li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.mly-prose :where(ol > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(ul > li):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0.375em;\n}\n.mly-prose :where(.mly-prose > ul > li p):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.mly-prose :where(.mly-prose > ul > li > p:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n}\n.mly-prose :where(.mly-prose > ul > li > p:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 1.25em;\n}\n.mly-prose :where(.mly-prose > ol > li > p:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n}\n.mly-prose :where(.mly-prose > ol > li > p:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 1.25em;\n}\n.mly-prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.mly-prose :where(dl):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.mly-prose :where(dd):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0.5em;\n padding-inline-start: 1.625em;\n}\n.mly-prose :where(hr + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h2 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h3 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(h4 + *):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0;\n}\n.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-end: 0;\n}\n.mly-prose :where(tbody td, tfoot td):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-top: 0.5714286em;\n padding-inline-end: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-inline-start: 0.5714286em;\n}\n.mly-prose :where(tbody td:first-child, tfoot td:first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-start: 0;\n}\n.mly-prose :where(tbody td:last-child, tfoot td:last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n padding-inline-end: 0;\n}\n.mly-prose :where(figure):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.mly-prose :where(.mly-prose > :first-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-top: 0;\n}\n.mly-prose :where(.mly-prose > :last-child):not(:where([class~=mly-not-prose], [class~=mly-not-prose] *)) {\n margin-bottom: 0;\n}\n.mly-pointer-events-none {\n pointer-events: none;\n}\n.mly-absolute {\n position: absolute;\n}\n.mly-relative {\n position: relative;\n}\n.mly-inset-y-0 {\n top: 0px;\n bottom: 0px;\n}\n.mly-left-0 {\n left: 0px;\n}\n.mly-left-1\\.5 {\n left: 0.375rem;\n}\n.mly-left-2 {\n left: 0.5rem;\n}\n.mly-right-0 {\n right: 0px;\n}\n.mly-right-1 {\n right: 0.25rem;\n}\n.mly-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-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-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-table-fixed {\n table-layout: fixed;\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-0\\.5 {\n padding-left: 0.125rem;\n padding-right: 0.125rem;\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.data-\\[disabled\\]\\:mly-pointer-events-none[data-disabled] {\n pointer-events: none;\n}\n.data-\\[state\\=open\\]\\:mly-bg-rose-100[data-state=open] {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=open\\]\\:mly-bg-soft-gray[data-state=open] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=true\\]\\:mly-bg-soft-gray[data-state=true] {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true] {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.data-\\[disabled\\]\\:mly-opacity-50[data-disabled] {\n opacity: 0.5;\n}\n.hover\\:mly-bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-gray-100\\/80:hover {\n background-color: rgb(243 244 246 / 0.8);\n}\n.hover\\:mly-bg-red-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-red-500\\/90:hover {\n background-color: rgb(239 68 68 / 0.9);\n}\n.hover\\:mly-bg-rose-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(255 228 230 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-soft-gray:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.hover\\:mly-bg-soft-gray\\/60:hover {\n background-color: rgb(244 245 246 / 0.6);\n}\n.hover\\:mly-text-black:hover {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n.hover\\:mly-text-gray-900:hover {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity));\n}\n.hover\\:mly-text-midnight-gray:hover {\n --tw-text-opacity: 1;\n color: rgb(51 51 51 / var(--tw-text-opacity));\n}\n.hover\\:mly-underline:hover {\n text-decoration-line: underline;\n}\n.focus\\:mly-z-10:focus {\n z-index: 10;\n}\n.focus\\:mly-bg-gray-100:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity));\n}\n.focus\\:mly-bg-red-200:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n.focus\\:mly-bg-soft-gray:focus {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.focus\\:mly-outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus\\:mly-ring-1:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus\\:mly-ring-midnight-gray\\/50:focus {\n --tw-ring-color: rgb(51 51 51 / 0.5);\n}\n.focus-visible\\:mly-relative:focus-visible {\n position: relative;\n}\n.focus-visible\\:mly-z-10:focus-visible {\n z-index: 10;\n}\n.focus-visible\\:mly-border-gray-400:focus-visible {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity));\n}\n.focus-visible\\:mly-outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus-visible\\:mly-ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:mly-ring-gray-400:focus-visible {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity));\n}\n.focus-visible\\:mly-ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n.active\\:mly-bg-soft-gray:active {\n --tw-bg-opacity: 1;\n background-color: rgb(244 245 246 / var(--tw-bg-opacity));\n}\n.disabled\\:mly-pointer-events-none:disabled {\n pointer-events: none;\n}\n.disabled\\:mly-cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n.disabled\\:mly-opacity-50:disabled {\n opacity: 0.5;\n}\n.\\[\\&_svg\\]\\:mly-pointer-events-none svg {\n pointer-events: none;\n}\n');
|
|
97
97
|
|
|
98
98
|
// src/editor/index.tsx
|
|
99
|
-
var
|
|
100
|
-
var
|
|
99
|
+
var import_react54 = require("@tiptap/react");
|
|
100
|
+
var import_react55 = require("react");
|
|
101
101
|
|
|
102
102
|
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
103
|
-
var
|
|
104
|
-
var
|
|
103
|
+
var import_react12 = require("@tiptap/react");
|
|
104
|
+
var import_react13 = require("react");
|
|
105
105
|
|
|
106
106
|
// src/editor/utils/get-render-container.ts
|
|
107
107
|
function getRenderContainer(editor, nodeType) {
|
|
@@ -629,7 +629,7 @@ function VerticalAlignmentSwitch(props) {
|
|
|
629
629
|
}
|
|
630
630
|
|
|
631
631
|
// src/editor/components/show-popover.tsx
|
|
632
|
-
var
|
|
632
|
+
var import_lucide_react10 = require("lucide-react");
|
|
633
633
|
|
|
634
634
|
// src/editor/components/popover.tsx
|
|
635
635
|
var React3 = __toESM(require("react"));
|
|
@@ -656,13 +656,114 @@ var PopoverContent = React3.forwardRef((_a, ref) => {
|
|
|
656
656
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
657
657
|
|
|
658
658
|
// src/editor/components/show-popover.tsx
|
|
659
|
-
var
|
|
659
|
+
var import_react8 = require("react");
|
|
660
660
|
|
|
661
|
-
// src/editor/
|
|
661
|
+
// src/editor/nodes/variable/variable-popover.tsx
|
|
662
|
+
var import_lucide_react2 = require("lucide-react");
|
|
662
663
|
var import_react2 = require("react");
|
|
664
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
665
|
+
var VariablePopover = (0, import_react2.forwardRef)((props, ref) => {
|
|
666
|
+
const { items, onSelectItem } = props;
|
|
667
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react2.useState)(0);
|
|
668
|
+
const scrollContainerRef = (0, import_react2.useRef)(null);
|
|
669
|
+
const itemRefs = (0, import_react2.useRef)([]);
|
|
670
|
+
const scrollSelectedIntoView = (index) => {
|
|
671
|
+
const container = scrollContainerRef.current;
|
|
672
|
+
const selectedItem = itemRefs.current[index];
|
|
673
|
+
if (!container || !selectedItem) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const containerRect = container.getBoundingClientRect();
|
|
677
|
+
const itemRect = selectedItem.getBoundingClientRect();
|
|
678
|
+
const padding = 4;
|
|
679
|
+
if (itemRect.bottom > containerRect.bottom) {
|
|
680
|
+
container.scrollTop += itemRect.bottom - containerRect.bottom + padding;
|
|
681
|
+
} else if (itemRect.top < containerRect.top) {
|
|
682
|
+
container.scrollTop += itemRect.top - containerRect.top - padding;
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
(0, import_react2.useEffect)(() => {
|
|
686
|
+
setSelectedIndex(0);
|
|
687
|
+
if (scrollContainerRef.current) {
|
|
688
|
+
scrollContainerRef.current.scrollTop = 0;
|
|
689
|
+
}
|
|
690
|
+
itemRefs.current = items.map(() => null);
|
|
691
|
+
}, [items]);
|
|
692
|
+
(0, import_react2.useEffect)(() => {
|
|
693
|
+
scrollSelectedIntoView(selectedIndex);
|
|
694
|
+
}, [selectedIndex]);
|
|
695
|
+
(0, import_react2.useImperativeHandle)(ref, () => ({
|
|
696
|
+
moveUp: () => {
|
|
697
|
+
setSelectedIndex((selectedIndex + items.length - 1) % items.length);
|
|
698
|
+
},
|
|
699
|
+
moveDown: () => {
|
|
700
|
+
setSelectedIndex((selectedIndex + 1) % items.length);
|
|
701
|
+
},
|
|
702
|
+
select: () => {
|
|
703
|
+
const item = items[selectedIndex];
|
|
704
|
+
if (!item) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
onSelectItem(item);
|
|
708
|
+
}
|
|
709
|
+
}));
|
|
710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mly-z-50 mly-w-64 mly-rounded-lg mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
|
|
711
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-b mly-border-gray-200 mly-bg-soft-gray/40 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
|
|
712
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
|
|
713
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Braces, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
714
|
+
] }),
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
716
|
+
"div",
|
|
717
|
+
{
|
|
718
|
+
ref: scrollContainerRef,
|
|
719
|
+
className: "mly-max-h-52 mly-overflow-y-auto mly-scrollbar-thin mly-scrollbar-track-transparent mly-scrollbar-thumb-gray-200",
|
|
720
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mly-flex mly-flex-col mly-gap-0.5 mly-p-1", children: (items == null ? void 0 : items.length) ? items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
721
|
+
"button",
|
|
722
|
+
{
|
|
723
|
+
ref: (el) => itemRefs.current[index] = el,
|
|
724
|
+
onClick: () => onSelectItem(item),
|
|
725
|
+
className: cn(
|
|
726
|
+
"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",
|
|
727
|
+
index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
|
|
728
|
+
),
|
|
729
|
+
children: [
|
|
730
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Braces, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
731
|
+
item.name
|
|
732
|
+
]
|
|
733
|
+
},
|
|
734
|
+
index
|
|
735
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mly-flex mly-h-7 mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-[13px] mly-text-gray-900 hover:mly-bg-soft-gray", children: "No result" }) })
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-t mly-border-gray-200 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
|
|
739
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
|
|
740
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.ArrowDownIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.ArrowUpIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
|
|
743
|
+
] }),
|
|
744
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.CornerDownLeftIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
745
|
+
] })
|
|
746
|
+
] });
|
|
747
|
+
});
|
|
748
|
+
function VariableIcon(props) {
|
|
749
|
+
const { className, children } = props;
|
|
750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
751
|
+
"div",
|
|
752
|
+
{
|
|
753
|
+
className: cn(
|
|
754
|
+
"mly-flex mly-size-5 mly-items-center mly-justify-center mly-rounded-md mly-border",
|
|
755
|
+
className
|
|
756
|
+
),
|
|
757
|
+
children
|
|
758
|
+
}
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// src/editor/utils/use-outside-click.ts
|
|
663
763
|
var import_react3 = require("react");
|
|
764
|
+
var import_react4 = require("react");
|
|
664
765
|
function useOutsideClick(ref, callback) {
|
|
665
|
-
const handleClick = (0,
|
|
766
|
+
const handleClick = (0, import_react3.useCallback)(
|
|
666
767
|
(e) => {
|
|
667
768
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
668
769
|
callback();
|
|
@@ -670,7 +771,7 @@ function useOutsideClick(ref, callback) {
|
|
|
670
771
|
},
|
|
671
772
|
[ref, callback]
|
|
672
773
|
);
|
|
673
|
-
(0,
|
|
774
|
+
(0, import_react4.useEffect)(() => {
|
|
674
775
|
document.addEventListener("mousedown", handleClick);
|
|
675
776
|
document.addEventListener("touchstart", handleClick);
|
|
676
777
|
return () => {
|
|
@@ -681,94 +782,99 @@ function useOutsideClick(ref, callback) {
|
|
|
681
782
|
}
|
|
682
783
|
|
|
683
784
|
// src/editor/components/ui/input-autocomplete.tsx
|
|
684
|
-
var
|
|
685
|
-
var
|
|
686
|
-
var
|
|
687
|
-
var InputAutocomplete = (0,
|
|
785
|
+
var import_lucide_react3 = require("lucide-react");
|
|
786
|
+
var import_react5 = require("react");
|
|
787
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
788
|
+
var InputAutocomplete = (0, import_react5.forwardRef)((props, ref) => {
|
|
688
789
|
const _a = props, {
|
|
689
790
|
value = "",
|
|
690
791
|
onValueChange,
|
|
691
792
|
className,
|
|
692
793
|
onOutsideClick,
|
|
693
794
|
onSelectOption,
|
|
694
|
-
autoCompleteOptions = []
|
|
795
|
+
autoCompleteOptions = [],
|
|
796
|
+
triggerChar = ""
|
|
695
797
|
} = _a, inputProps = __objRest(_a, [
|
|
696
798
|
"value",
|
|
697
799
|
"onValueChange",
|
|
698
800
|
"className",
|
|
699
801
|
"onOutsideClick",
|
|
700
802
|
"onSelectOption",
|
|
701
|
-
"autoCompleteOptions"
|
|
803
|
+
"autoCompleteOptions",
|
|
804
|
+
"triggerChar"
|
|
702
805
|
]);
|
|
703
|
-
const containerRef = (0,
|
|
704
|
-
const
|
|
806
|
+
const containerRef = (0, import_react5.useRef)(null);
|
|
807
|
+
const popoverRef = (0, import_react5.useRef)(null);
|
|
705
808
|
useOutsideClick(containerRef, () => {
|
|
706
809
|
onOutsideClick == null ? void 0 : onOutsideClick();
|
|
707
810
|
});
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
811
|
+
const isTriggeringVariable = value.startsWith(triggerChar);
|
|
812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("mly-relative"), ref: containerRef, children: [
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "mly-relative", children: [
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
711
815
|
"input",
|
|
712
|
-
__spreadProps(__spreadValues({
|
|
816
|
+
__spreadProps(__spreadValues({
|
|
817
|
+
placeholder: "e.g. items",
|
|
818
|
+
type: "text"
|
|
819
|
+
}, inputProps), {
|
|
713
820
|
ref,
|
|
714
821
|
value,
|
|
715
822
|
onChange: (e) => {
|
|
716
|
-
setSelectedIndex(0);
|
|
717
823
|
onValueChange(e.target.value);
|
|
718
824
|
},
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
825
|
+
className: cn(
|
|
826
|
+
"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",
|
|
827
|
+
className
|
|
828
|
+
),
|
|
722
829
|
onKeyDown: (e) => {
|
|
830
|
+
if (!popoverRef.current || !isTriggeringVariable) {
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
const { moveUp, moveDown, select } = popoverRef.current;
|
|
723
834
|
if (e.key === "ArrowDown") {
|
|
724
835
|
e.preventDefault();
|
|
725
|
-
|
|
726
|
-
(prev) => Math.min(prev + 1, autoCompleteOptions.length - 1)
|
|
727
|
-
);
|
|
836
|
+
moveDown();
|
|
728
837
|
} else if (e.key === "ArrowUp") {
|
|
729
838
|
e.preventDefault();
|
|
730
|
-
|
|
839
|
+
moveUp();
|
|
731
840
|
} else if (e.key === "Enter") {
|
|
732
841
|
e.preventDefault();
|
|
733
|
-
|
|
734
|
-
onValueChange(_value);
|
|
735
|
-
onSelectOption == null ? void 0 : onSelectOption(_value);
|
|
842
|
+
select();
|
|
736
843
|
}
|
|
737
844
|
}
|
|
738
845
|
})
|
|
739
846
|
),
|
|
740
|
-
/* @__PURE__ */ (0,
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
741
848
|
] }),
|
|
742
|
-
|
|
743
|
-
|
|
849
|
+
isTriggeringVariable && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
850
|
+
VariablePopover,
|
|
744
851
|
{
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
852
|
+
items: autoCompleteOptions.map((option) => {
|
|
853
|
+
return {
|
|
854
|
+
name: option
|
|
855
|
+
};
|
|
856
|
+
}),
|
|
857
|
+
onSelectItem: (item) => {
|
|
858
|
+
onSelectOption == null ? void 0 : onSelectOption(item.name);
|
|
750
859
|
},
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
},
|
|
755
|
-
option
|
|
756
|
-
)) })
|
|
860
|
+
ref: popoverRef
|
|
861
|
+
}
|
|
862
|
+
) })
|
|
757
863
|
] });
|
|
758
864
|
});
|
|
759
865
|
InputAutocomplete.displayName = "InputAutocomplete";
|
|
760
866
|
|
|
761
867
|
// src/editor/provider.tsx
|
|
762
|
-
var
|
|
868
|
+
var import_react7 = require("react");
|
|
763
869
|
|
|
764
870
|
// src/blocks/button.tsx
|
|
765
|
-
var
|
|
766
|
-
var
|
|
871
|
+
var import_lucide_react4 = require("lucide-react");
|
|
872
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
767
873
|
var button = {
|
|
768
874
|
title: "Button",
|
|
769
875
|
description: "Add a call to action button to email.",
|
|
770
876
|
searchTerms: ["link", "button", "cta"],
|
|
771
|
-
icon: /* @__PURE__ */ (0,
|
|
877
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.MousePointer, { className: "mly-h-4 mly-w-4" }),
|
|
772
878
|
command: ({ editor, range }) => {
|
|
773
879
|
editor.chain().focus().deleteRange(range).setButton().run();
|
|
774
880
|
}
|
|
@@ -777,20 +883,20 @@ var linkCard = {
|
|
|
777
883
|
title: "Link Card",
|
|
778
884
|
description: "Add a link card to email.",
|
|
779
885
|
searchTerms: ["link", "button", "image"],
|
|
780
|
-
icon: /* @__PURE__ */ (0,
|
|
886
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
|
|
781
887
|
command: ({ editor, range }) => {
|
|
782
888
|
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
783
889
|
}
|
|
784
890
|
};
|
|
785
891
|
|
|
786
892
|
// src/blocks/image.tsx
|
|
787
|
-
var
|
|
788
|
-
var
|
|
893
|
+
var import_lucide_react5 = require("lucide-react");
|
|
894
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
789
895
|
var image = {
|
|
790
896
|
title: "Image",
|
|
791
897
|
description: "Full width image",
|
|
792
898
|
searchTerms: ["image"],
|
|
793
|
-
icon: /* @__PURE__ */ (0,
|
|
899
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
794
900
|
command: ({ editor, range }) => {
|
|
795
901
|
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
796
902
|
}
|
|
@@ -799,20 +905,20 @@ var logo = {
|
|
|
799
905
|
title: "Logo",
|
|
800
906
|
description: "Add your brand logo",
|
|
801
907
|
searchTerms: ["image", "logo"],
|
|
802
|
-
icon: /* @__PURE__ */ (0,
|
|
908
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
803
909
|
command: ({ editor, range }) => {
|
|
804
910
|
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
805
911
|
}
|
|
806
912
|
};
|
|
807
913
|
|
|
808
914
|
// src/blocks/layout.tsx
|
|
809
|
-
var
|
|
810
|
-
var
|
|
915
|
+
var import_lucide_react6 = require("lucide-react");
|
|
916
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
811
917
|
var columns = {
|
|
812
918
|
title: "Columns",
|
|
813
919
|
description: "Add columns to email.",
|
|
814
920
|
searchTerms: ["layout", "columns"],
|
|
815
|
-
icon: /* @__PURE__ */ (0,
|
|
921
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
816
922
|
shouldBeHidden: (editor) => {
|
|
817
923
|
return editor.isActive("columns");
|
|
818
924
|
},
|
|
@@ -824,7 +930,7 @@ var section = {
|
|
|
824
930
|
title: "Section",
|
|
825
931
|
description: "Add a section to email.",
|
|
826
932
|
searchTerms: ["layout", "section"],
|
|
827
|
-
icon: /* @__PURE__ */ (0,
|
|
933
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
|
|
828
934
|
command: ({ editor, range }) => {
|
|
829
935
|
editor.chain().focus().deleteRange(range).setSection().run();
|
|
830
936
|
}
|
|
@@ -833,7 +939,7 @@ var forLoop = {
|
|
|
833
939
|
title: "For",
|
|
834
940
|
description: "Loop over an array of items.",
|
|
835
941
|
searchTerms: ["for", "loop"],
|
|
836
|
-
icon: /* @__PURE__ */ (0,
|
|
942
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.Repeat2, { className: "mly-h-4 mly-w-4" }),
|
|
837
943
|
shouldBeHidden: (editor) => {
|
|
838
944
|
return editor.isActive("for");
|
|
839
945
|
},
|
|
@@ -845,7 +951,7 @@ var spacer = {
|
|
|
845
951
|
title: "Spacer",
|
|
846
952
|
description: "Add space between blocks.",
|
|
847
953
|
searchTerms: ["space", "gap", "divider"],
|
|
848
|
-
icon: /* @__PURE__ */ (0,
|
|
954
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.MoveVertical, { className: "mly-h-4 mly-w-4" }),
|
|
849
955
|
command: ({ editor, range }) => {
|
|
850
956
|
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
851
957
|
}
|
|
@@ -854,20 +960,20 @@ var divider = {
|
|
|
854
960
|
title: "Divider",
|
|
855
961
|
description: "Add a horizontal divider.",
|
|
856
962
|
searchTerms: ["divider", "line"],
|
|
857
|
-
icon: /* @__PURE__ */ (0,
|
|
963
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react6.Minus, { className: "mly-h-4 mly-w-4" }),
|
|
858
964
|
command: ({ editor, range }) => {
|
|
859
965
|
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
860
966
|
}
|
|
861
967
|
};
|
|
862
968
|
|
|
863
969
|
// src/blocks/list.tsx
|
|
864
|
-
var
|
|
865
|
-
var
|
|
970
|
+
var import_lucide_react7 = require("lucide-react");
|
|
971
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
866
972
|
var bulletList = {
|
|
867
973
|
title: "Bullet List",
|
|
868
974
|
description: "Create a simple bullet list.",
|
|
869
975
|
searchTerms: ["unordered", "point"],
|
|
870
|
-
icon: /* @__PURE__ */ (0,
|
|
976
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.List, { className: "mly-h-4 mly-w-4" }),
|
|
871
977
|
command: ({ editor, range }) => {
|
|
872
978
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
873
979
|
}
|
|
@@ -876,20 +982,20 @@ var orderedList = {
|
|
|
876
982
|
title: "Numbered List",
|
|
877
983
|
description: "Create a list with numbering.",
|
|
878
984
|
searchTerms: ["ordered"],
|
|
879
|
-
icon: /* @__PURE__ */ (0,
|
|
985
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.ListOrdered, { className: "mly-h-4 mly-w-4" }),
|
|
880
986
|
command: ({ editor, range }) => {
|
|
881
987
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
882
988
|
}
|
|
883
989
|
};
|
|
884
990
|
|
|
885
991
|
// src/blocks/typography.tsx
|
|
886
|
-
var
|
|
887
|
-
var
|
|
992
|
+
var import_lucide_react8 = require("lucide-react");
|
|
993
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
888
994
|
var text = {
|
|
889
995
|
title: "Text",
|
|
890
996
|
description: "Just start typing with plain text.",
|
|
891
997
|
searchTerms: ["p", "paragraph"],
|
|
892
|
-
icon: /* @__PURE__ */ (0,
|
|
998
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.Text, { className: "mly-h-4 mly-w-4" }),
|
|
893
999
|
command: ({ editor, range }) => {
|
|
894
1000
|
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
895
1001
|
}
|
|
@@ -898,7 +1004,7 @@ var heading1 = {
|
|
|
898
1004
|
title: "Heading 1",
|
|
899
1005
|
description: "Big heading.",
|
|
900
1006
|
searchTerms: ["title", "big", "large"],
|
|
901
|
-
icon: /* @__PURE__ */ (0,
|
|
1007
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.Heading1, { className: "mly-h-4 mly-w-4" }),
|
|
902
1008
|
command: ({ editor, range }) => {
|
|
903
1009
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
904
1010
|
}
|
|
@@ -907,7 +1013,7 @@ var heading2 = {
|
|
|
907
1013
|
title: "Heading 2",
|
|
908
1014
|
description: "Medium heading.",
|
|
909
1015
|
searchTerms: ["subtitle", "medium"],
|
|
910
|
-
icon: /* @__PURE__ */ (0,
|
|
1016
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.Heading2, { className: "mly-h-4 mly-w-4" }),
|
|
911
1017
|
command: ({ editor, range }) => {
|
|
912
1018
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
913
1019
|
}
|
|
@@ -916,7 +1022,7 @@ var heading3 = {
|
|
|
916
1022
|
title: "Heading 3",
|
|
917
1023
|
description: "Small heading.",
|
|
918
1024
|
searchTerms: ["subtitle", "small"],
|
|
919
|
-
icon: /* @__PURE__ */ (0,
|
|
1025
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.Heading3, { className: "mly-h-4 mly-w-4" }),
|
|
920
1026
|
command: ({ editor, range }) => {
|
|
921
1027
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
922
1028
|
}
|
|
@@ -925,7 +1031,7 @@ var hardBreak = {
|
|
|
925
1031
|
title: "Hard Break",
|
|
926
1032
|
description: "Add a break between lines.",
|
|
927
1033
|
searchTerms: ["break", "line"],
|
|
928
|
-
icon: /* @__PURE__ */ (0,
|
|
1034
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.DivideIcon, { className: "mly-h-4 mly-w-4" }),
|
|
929
1035
|
command: ({ editor, range }) => {
|
|
930
1036
|
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
931
1037
|
}
|
|
@@ -934,7 +1040,7 @@ var blockquote = {
|
|
|
934
1040
|
title: "Blockquote",
|
|
935
1041
|
description: "Add blockquote.",
|
|
936
1042
|
searchTerms: ["quote", "blockquote"],
|
|
937
|
-
icon: /* @__PURE__ */ (0,
|
|
1043
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.TextQuote, { className: "mly-h-4 mly-w-4" }),
|
|
938
1044
|
command: ({ editor, range }) => {
|
|
939
1045
|
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
940
1046
|
}
|
|
@@ -943,7 +1049,7 @@ var footer = {
|
|
|
943
1049
|
title: "Footer",
|
|
944
1050
|
description: "Add a footer text to email.",
|
|
945
1051
|
searchTerms: ["footer", "text"],
|
|
946
|
-
icon: /* @__PURE__ */ (0,
|
|
1052
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
947
1053
|
command: ({ editor, range }) => {
|
|
948
1054
|
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
949
1055
|
}
|
|
@@ -952,7 +1058,7 @@ var clearLine = {
|
|
|
952
1058
|
title: "Clear Line",
|
|
953
1059
|
description: "Clear the current line.",
|
|
954
1060
|
searchTerms: ["clear", "line"],
|
|
955
|
-
icon: /* @__PURE__ */ (0,
|
|
1061
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.EraserIcon, { className: "mly-h-4 mly-w-4" }),
|
|
956
1062
|
command: ({ editor, range }) => {
|
|
957
1063
|
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
958
1064
|
}
|
|
@@ -981,24 +1087,94 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
981
1087
|
clearLine
|
|
982
1088
|
];
|
|
983
1089
|
|
|
1090
|
+
// src/editor/nodes/variable/variable-view.tsx
|
|
1091
|
+
var import_react6 = require("@tiptap/react");
|
|
1092
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1093
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1094
|
+
function VariableView(props) {
|
|
1095
|
+
const { node, updateAttributes: updateAttributes2, editor } = props;
|
|
1096
|
+
const { id, fallback, required } = node.attrs;
|
|
1097
|
+
const { renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION } = useMailyContext();
|
|
1098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1099
|
+
import_react6.NodeViewWrapper,
|
|
1100
|
+
{
|
|
1101
|
+
className: "react-component mly-inline-block mly-leading-none",
|
|
1102
|
+
draggable: "false",
|
|
1103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Popover, { children: [
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PopoverTrigger, { children: renderVariable({
|
|
1105
|
+
variable: { name: id, required },
|
|
1106
|
+
fallback,
|
|
1107
|
+
editor
|
|
1108
|
+
}) }),
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1110
|
+
PopoverContent,
|
|
1111
|
+
{
|
|
1112
|
+
align: "start",
|
|
1113
|
+
side: "bottom",
|
|
1114
|
+
className: "mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
1115
|
+
sideOffset: 8,
|
|
1116
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1117
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
1118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "mly-relative", children: [
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
|
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1121
|
+
"input",
|
|
1122
|
+
{
|
|
1123
|
+
value: fallback != null ? fallback : "",
|
|
1124
|
+
onChange: (e) => {
|
|
1125
|
+
updateAttributes2({
|
|
1126
|
+
fallback: e.target.value
|
|
1127
|
+
});
|
|
1128
|
+
},
|
|
1129
|
+
placeholder: "ie. John Doe...",
|
|
1130
|
+
className: "mly-h-7 mly-w-32 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
|
|
1131
|
+
}
|
|
1132
|
+
),
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
1134
|
+
] }) }) })
|
|
1135
|
+
}
|
|
1136
|
+
)
|
|
1137
|
+
] })
|
|
1138
|
+
}
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
var DefaultRenderVariable = (props) => {
|
|
1142
|
+
const { variable, fallback } = props;
|
|
1143
|
+
const { name, required } = variable;
|
|
1144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1145
|
+
"span",
|
|
1146
|
+
{
|
|
1147
|
+
tabIndex: -1,
|
|
1148
|
+
className: "mly-inline-flex mly-items-center mly-gap-[var(--variable-icon-gap)] mly-rounded-full mly-border mly-px-1.5 mly-py-0.5 mly-leading-none",
|
|
1149
|
+
children: [
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
1151
|
+
name,
|
|
1152
|
+
required && !fallback && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
|
|
1153
|
+
]
|
|
1154
|
+
}
|
|
1155
|
+
);
|
|
1156
|
+
};
|
|
1157
|
+
|
|
984
1158
|
// src/editor/provider.tsx
|
|
985
|
-
var
|
|
1159
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
986
1160
|
var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
|
|
987
1161
|
var DEFAULT_VARIABLES = [];
|
|
988
|
-
var
|
|
1162
|
+
var DEFAULT_RENDER_VARIABLE_FUNCTION = DefaultRenderVariable;
|
|
1163
|
+
var MailyContext = (0, import_react7.createContext)({
|
|
989
1164
|
variableTriggerCharacter: DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
990
1165
|
variables: DEFAULT_VARIABLES,
|
|
991
|
-
blocks: DEFAULT_SLASH_COMMANDS
|
|
1166
|
+
blocks: DEFAULT_SLASH_COMMANDS,
|
|
1167
|
+
renderVariable: DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
992
1168
|
});
|
|
993
1169
|
function MailyProvider(props) {
|
|
994
1170
|
const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
|
|
995
1171
|
if (defaultValues.variableTriggerCharacter === "") {
|
|
996
1172
|
throw new Error("variableTriggerCharacter cannot be an empty string");
|
|
997
1173
|
}
|
|
998
|
-
return /* @__PURE__ */ (0,
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MailyContext.Provider, { value: defaultValues, children });
|
|
999
1175
|
}
|
|
1000
1176
|
function useMailyContext() {
|
|
1001
|
-
const values = (0,
|
|
1177
|
+
const values = (0, import_react7.useContext)(MailyContext);
|
|
1002
1178
|
if (!values) {
|
|
1003
1179
|
throw new Error("Missing MailyContext.Provider in the component tree");
|
|
1004
1180
|
}
|
|
@@ -1006,8 +1182,8 @@ function useMailyContext() {
|
|
|
1006
1182
|
}
|
|
1007
1183
|
|
|
1008
1184
|
// src/editor/components/show-popover.tsx
|
|
1009
|
-
var
|
|
1010
|
-
var
|
|
1185
|
+
var import_react9 = require("react");
|
|
1186
|
+
var import_react10 = require("react");
|
|
1011
1187
|
|
|
1012
1188
|
// src/editor/utils/variable.ts
|
|
1013
1189
|
function processVariables(variables, options) {
|
|
@@ -1032,21 +1208,21 @@ You can check out the documentation for more information: https://github.com/ari
|
|
|
1032
1208
|
}
|
|
1033
1209
|
|
|
1034
1210
|
// src/editor/components/show-popover.tsx
|
|
1035
|
-
var
|
|
1211
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1036
1212
|
function _ShowPopover(props) {
|
|
1037
1213
|
const { showIfKey = "", onShowIfKeyValueChange, editor } = props;
|
|
1038
1214
|
const { variables = [] } = useMailyContext();
|
|
1039
|
-
const [isUpdatingKey, setIsUpdatingKey] = (0,
|
|
1040
|
-
const inputRef = (0,
|
|
1041
|
-
const autoCompleteOptions = (0,
|
|
1215
|
+
const [isUpdatingKey, setIsUpdatingKey] = (0, import_react8.useState)(false);
|
|
1216
|
+
const inputRef = (0, import_react8.useRef)(null);
|
|
1217
|
+
const autoCompleteOptions = (0, import_react9.useMemo)(() => {
|
|
1042
1218
|
return processVariables(variables, {
|
|
1043
1219
|
query: showIfKey || "",
|
|
1044
|
-
from: "variable",
|
|
1220
|
+
from: "bubble-variable",
|
|
1045
1221
|
editor
|
|
1046
|
-
}).map((variable) => variable.name)
|
|
1222
|
+
}).map((variable) => variable.name);
|
|
1047
1223
|
}, [variables, showIfKey, editor]);
|
|
1048
1224
|
const isValidWhenKey = showIfKey || autoCompleteOptions.includes(showIfKey);
|
|
1049
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1050
1226
|
Popover,
|
|
1051
1227
|
{
|
|
1052
1228
|
onOpenChange: (open) => {
|
|
@@ -1056,17 +1232,17 @@ function _ShowPopover(props) {
|
|
|
1056
1232
|
setIsUpdatingKey(false);
|
|
1057
1233
|
},
|
|
1058
1234
|
children: [
|
|
1059
|
-
/* @__PURE__ */ (0,
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1060
1236
|
PopoverTrigger,
|
|
1061
1237
|
{
|
|
1062
1238
|
className: cn(
|
|
1063
1239
|
"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray focus-visible:mly-relative focus-visible:mly-z-10 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2",
|
|
1064
1240
|
showIfKey && "mly-bg-rose-100 mly-text-rose-800 data-[state=open]:mly-bg-rose-100 hover:mly-bg-rose-100"
|
|
1065
1241
|
),
|
|
1066
|
-
children: /* @__PURE__ */ (0,
|
|
1242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
|
|
1067
1243
|
}
|
|
1068
1244
|
),
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1070
1246
|
PopoverContent,
|
|
1071
1247
|
{
|
|
1072
1248
|
className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
@@ -1080,8 +1256,8 @@ function _ShowPopover(props) {
|
|
|
1080
1256
|
e.preventDefault();
|
|
1081
1257
|
},
|
|
1082
1258
|
children: [
|
|
1083
|
-
/* @__PURE__ */ (0,
|
|
1084
|
-
!isUpdatingKey && /* @__PURE__ */ (0,
|
|
1259
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "Show if" }),
|
|
1260
|
+
!isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1085
1261
|
"button",
|
|
1086
1262
|
{
|
|
1087
1263
|
className: cn(
|
|
@@ -1096,12 +1272,12 @@ function _ShowPopover(props) {
|
|
|
1096
1272
|
}, 0);
|
|
1097
1273
|
},
|
|
1098
1274
|
children: [
|
|
1099
|
-
/* @__PURE__ */ (0,
|
|
1100
|
-
/* @__PURE__ */ (0,
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react10.Braces, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: showIfKey })
|
|
1101
1277
|
]
|
|
1102
1278
|
}
|
|
1103
1279
|
),
|
|
1104
|
-
isUpdatingKey && /* @__PURE__ */ (0,
|
|
1280
|
+
isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1105
1281
|
"form",
|
|
1106
1282
|
{
|
|
1107
1283
|
onSubmit: (e) => {
|
|
@@ -1113,7 +1289,7 @@ function _ShowPopover(props) {
|
|
|
1113
1289
|
setIsUpdatingKey(false);
|
|
1114
1290
|
}
|
|
1115
1291
|
},
|
|
1116
|
-
children: /* @__PURE__ */ (0,
|
|
1292
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1117
1293
|
InputAutocomplete,
|
|
1118
1294
|
{
|
|
1119
1295
|
value: showIfKey || "",
|
|
@@ -1123,7 +1299,8 @@ function _ShowPopover(props) {
|
|
|
1123
1299
|
onOutsideClick: () => {
|
|
1124
1300
|
setIsUpdatingKey(false);
|
|
1125
1301
|
},
|
|
1126
|
-
onSelectOption: () => {
|
|
1302
|
+
onSelectOption: (value) => {
|
|
1303
|
+
onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(value);
|
|
1127
1304
|
setIsUpdatingKey(false);
|
|
1128
1305
|
},
|
|
1129
1306
|
autoCompleteOptions,
|
|
@@ -1139,11 +1316,11 @@ function _ShowPopover(props) {
|
|
|
1139
1316
|
}
|
|
1140
1317
|
);
|
|
1141
1318
|
}
|
|
1142
|
-
var ShowPopover = (0,
|
|
1319
|
+
var ShowPopover = (0, import_react10.memo)(_ShowPopover);
|
|
1143
1320
|
|
|
1144
1321
|
// src/editor/components/column-menu/columns-width-config.tsx
|
|
1145
|
-
var
|
|
1146
|
-
var
|
|
1322
|
+
var import_lucide_react11 = require("lucide-react");
|
|
1323
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1147
1324
|
function ColumnsWidthConfig(props) {
|
|
1148
1325
|
const {
|
|
1149
1326
|
columnsCount = 2,
|
|
@@ -1151,9 +1328,9 @@ function ColumnsWidthConfig(props) {
|
|
|
1151
1328
|
columnWidths,
|
|
1152
1329
|
onColumnWidthChange
|
|
1153
1330
|
} = props;
|
|
1154
|
-
return /* @__PURE__ */ (0,
|
|
1155
|
-
/* @__PURE__ */ (0,
|
|
1156
|
-
/* @__PURE__ */ (0,
|
|
1331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Popover, { children: [
|
|
1332
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverTrigger, { className: "mly-flex mly-size-7 mly-items-center mly-justify-center mly-gap-1 mly-rounded-md mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.SlidersVertical, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" }) }),
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1157
1334
|
PopoverContent,
|
|
1158
1335
|
{
|
|
1159
1336
|
className: "mly-w-[300px] mly-rounded-lg !mly-p-0.5",
|
|
@@ -1167,32 +1344,32 @@ function ColumnsWidthConfig(props) {
|
|
|
1167
1344
|
e.preventDefault();
|
|
1168
1345
|
},
|
|
1169
1346
|
children: [
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mly-grid mly-grid-cols-2 mly-gap-1", children: [
|
|
1348
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1172
1349
|
SwitchButton,
|
|
1173
1350
|
{
|
|
1174
1351
|
onClick: () => onColumnsCountChange(2),
|
|
1175
1352
|
isActive: columnsCount === 2,
|
|
1176
1353
|
children: [
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1178
|
-
/* @__PURE__ */ (0,
|
|
1354
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Columns2, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
|
|
1355
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "2 Columns" })
|
|
1179
1356
|
]
|
|
1180
1357
|
}
|
|
1181
1358
|
),
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1183
1360
|
SwitchButton,
|
|
1184
1361
|
{
|
|
1185
1362
|
onClick: () => onColumnsCountChange(3),
|
|
1186
1363
|
isActive: columnsCount === 3,
|
|
1187
1364
|
children: [
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1189
|
-
/* @__PURE__ */ (0,
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Columns3, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" }),
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "3 Columns" })
|
|
1190
1367
|
]
|
|
1191
1368
|
}
|
|
1192
1369
|
)
|
|
1193
1370
|
] }),
|
|
1194
|
-
/* @__PURE__ */ (0,
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", { className: "mly-my-0.5 mly-border-gray-200" }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1196
1373
|
"div",
|
|
1197
1374
|
{
|
|
1198
1375
|
className: "mly-grid mly-gap-1 mly-p-1",
|
|
@@ -1200,10 +1377,10 @@ function ColumnsWidthConfig(props) {
|
|
|
1200
1377
|
children: Array.from({ length: columnsCount }).map((_, index) => {
|
|
1201
1378
|
const value = columnWidths[index] === "auto" ? "" : columnWidths[index];
|
|
1202
1379
|
const label = columnsCount === 2 ? index === 0 ? "Left" : "Right" : index === 0 ? "Left" : index === 1 ? "Middle" : "Right";
|
|
1203
|
-
return /* @__PURE__ */ (0,
|
|
1204
|
-
/* @__PURE__ */ (0,
|
|
1205
|
-
/* @__PURE__ */ (0,
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mly-flex mly-flex-col mly-gap-1", children: [
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "mly-text-xs mly-text-gray-400", children: label }),
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "mly-relative", children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1207
1384
|
"input",
|
|
1208
1385
|
{
|
|
1209
1386
|
placeholder: "auto",
|
|
@@ -1218,7 +1395,7 @@ function ColumnsWidthConfig(props) {
|
|
|
1218
1395
|
}
|
|
1219
1396
|
}
|
|
1220
1397
|
),
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "mly-absolute mly-inset-y-0 mly-right-0 mly-flex mly-aspect-square mly-items-center mly-justify-center mly-text-xs mly-tabular-nums mly-text-gray-500", children: "%" })
|
|
1222
1399
|
] })
|
|
1223
1400
|
] }, index);
|
|
1224
1401
|
})
|
|
@@ -1231,7 +1408,7 @@ function ColumnsWidthConfig(props) {
|
|
|
1231
1408
|
}
|
|
1232
1409
|
function SwitchButton(props) {
|
|
1233
1410
|
const { onClick, isActive = false, children } = props;
|
|
1234
|
-
return /* @__PURE__ */ (0,
|
|
1411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1235
1412
|
"button",
|
|
1236
1413
|
{
|
|
1237
1414
|
className: cn(
|
|
@@ -1245,9 +1422,9 @@ function SwitchButton(props) {
|
|
|
1245
1422
|
}
|
|
1246
1423
|
|
|
1247
1424
|
// src/editor/components/ui/select.tsx
|
|
1248
|
-
var
|
|
1249
|
-
var
|
|
1250
|
-
var
|
|
1425
|
+
var import_react11 = require("react");
|
|
1426
|
+
var import_lucide_react12 = require("lucide-react");
|
|
1427
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1251
1428
|
function Select(props) {
|
|
1252
1429
|
const {
|
|
1253
1430
|
label,
|
|
@@ -1259,11 +1436,11 @@ function Select(props) {
|
|
|
1259
1436
|
icon: Icon,
|
|
1260
1437
|
iconClassName
|
|
1261
1438
|
} = props;
|
|
1262
|
-
const selectId = `mly${(0,
|
|
1263
|
-
const content = /* @__PURE__ */ (0,
|
|
1264
|
-
/* @__PURE__ */ (0,
|
|
1265
|
-
Icon && /* @__PURE__ */ (0,
|
|
1266
|
-
/* @__PURE__ */ (0,
|
|
1439
|
+
const selectId = `mly${(0, import_react11.useId)()}`;
|
|
1440
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative", children: [
|
|
1441
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: selectId, className: "sr-only", children: label }),
|
|
1442
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-left-2 mly-z-20 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: cn("mly-size-3", iconClassName) }) }),
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1267
1444
|
"select",
|
|
1268
1445
|
{
|
|
1269
1446
|
id: selectId,
|
|
@@ -1274,11 +1451,11 @@ function Select(props) {
|
|
|
1274
1451
|
),
|
|
1275
1452
|
value,
|
|
1276
1453
|
onChange: (event) => onValueChange(event.target.value),
|
|
1277
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
1454
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: option.value, children: option.label }, option.value))
|
|
1278
1455
|
}
|
|
1279
1456
|
),
|
|
1280
|
-
/* @__PURE__ */ (0,
|
|
1281
|
-
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-7 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1458
|
+
import_lucide_react12.ChevronDownIcon,
|
|
1282
1459
|
{
|
|
1283
1460
|
size: 16,
|
|
1284
1461
|
strokeWidth: 2,
|
|
@@ -1290,14 +1467,14 @@ function Select(props) {
|
|
|
1290
1467
|
if (!tooltip) {
|
|
1291
1468
|
return content;
|
|
1292
1469
|
}
|
|
1293
|
-
return /* @__PURE__ */ (0,
|
|
1294
|
-
/* @__PURE__ */ (0,
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: content }),
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
1296
1473
|
] });
|
|
1297
1474
|
}
|
|
1298
1475
|
|
|
1299
1476
|
// src/editor/components/column-menu/columns-bubble-menu-content.tsx
|
|
1300
|
-
var
|
|
1477
|
+
var import_lucide_react13 = require("lucide-react");
|
|
1301
1478
|
|
|
1302
1479
|
// src/editor/utils/delete-node.ts
|
|
1303
1480
|
var import_core4 = require("@tiptap/core");
|
|
@@ -1317,7 +1494,7 @@ function deleteNode(editor, nodeType) {
|
|
|
1317
1494
|
}
|
|
1318
1495
|
|
|
1319
1496
|
// src/editor/components/column-menu/columns-bubble-menu-content.tsx
|
|
1320
|
-
var
|
|
1497
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1321
1498
|
function ColumnsBubbleMenuContent(props) {
|
|
1322
1499
|
const { editor } = props;
|
|
1323
1500
|
if (!editor) {
|
|
@@ -1325,9 +1502,9 @@ function ColumnsBubbleMenuContent(props) {
|
|
|
1325
1502
|
}
|
|
1326
1503
|
const state = useColumnsState(editor);
|
|
1327
1504
|
const currentColumnCount = state.columnsCount;
|
|
1328
|
-
return /* @__PURE__ */ (0,
|
|
1329
|
-
state.isColumnActive && /* @__PURE__ */ (0,
|
|
1330
|
-
/* @__PURE__ */ (0,
|
|
1505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mly-flex mly-items-stretch", children: [
|
|
1506
|
+
state.isColumnActive && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1331
1508
|
ColumnsWidthConfig,
|
|
1332
1509
|
{
|
|
1333
1510
|
columnsCount: currentColumnCount,
|
|
@@ -1344,9 +1521,9 @@ function ColumnsBubbleMenuContent(props) {
|
|
|
1344
1521
|
}
|
|
1345
1522
|
}
|
|
1346
1523
|
),
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Divider, {})
|
|
1348
1525
|
] }),
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1526
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1350
1527
|
VerticalAlignmentSwitch,
|
|
1351
1528
|
{
|
|
1352
1529
|
alignment: state.currentVerticalAlignment,
|
|
@@ -1357,11 +1534,11 @@ function ColumnsBubbleMenuContent(props) {
|
|
|
1357
1534
|
}
|
|
1358
1535
|
}
|
|
1359
1536
|
),
|
|
1360
|
-
/* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Divider, {}),
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1362
1539
|
Select,
|
|
1363
1540
|
{
|
|
1364
|
-
icon:
|
|
1541
|
+
icon: import_lucide_react13.Space,
|
|
1365
1542
|
label: "Columns Gap",
|
|
1366
1543
|
value: state.currentColumnsGap,
|
|
1367
1544
|
options: [
|
|
@@ -1379,19 +1556,19 @@ function ColumnsBubbleMenuContent(props) {
|
|
|
1379
1556
|
tooltip: "Columns Gap"
|
|
1380
1557
|
}
|
|
1381
1558
|
),
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1383
|
-
/* @__PURE__ */ (0,
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Divider, {}),
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1384
1561
|
BubbleMenuButton,
|
|
1385
1562
|
{
|
|
1386
|
-
icon:
|
|
1563
|
+
icon: import_lucide_react13.Trash,
|
|
1387
1564
|
tooltip: "Delete Columns",
|
|
1388
1565
|
command: () => {
|
|
1389
1566
|
deleteNode(editor, "columns");
|
|
1390
1567
|
}
|
|
1391
1568
|
}
|
|
1392
1569
|
),
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1394
|
-
/* @__PURE__ */ (0,
|
|
1570
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Divider, {}),
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1395
1572
|
ShowPopover,
|
|
1396
1573
|
{
|
|
1397
1574
|
showIfKey: state.currentShowIfKey,
|
|
@@ -1407,13 +1584,13 @@ function ColumnsBubbleMenuContent(props) {
|
|
|
1407
1584
|
}
|
|
1408
1585
|
|
|
1409
1586
|
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
1410
|
-
var
|
|
1587
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1411
1588
|
function ColumnsBubbleMenu(props) {
|
|
1412
1589
|
const { appendTo, editor } = props;
|
|
1413
1590
|
if (!editor) {
|
|
1414
1591
|
return null;
|
|
1415
1592
|
}
|
|
1416
|
-
const getReferenceClientRect = (0,
|
|
1593
|
+
const getReferenceClientRect = (0, import_react13.useCallback)(() => {
|
|
1417
1594
|
const renderContainer = getRenderContainer(editor, "columns");
|
|
1418
1595
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
1419
1596
|
return rect;
|
|
@@ -1438,23 +1615,23 @@ function ColumnsBubbleMenu(props) {
|
|
|
1438
1615
|
},
|
|
1439
1616
|
pluginKey: "columnsBubbleMenu"
|
|
1440
1617
|
});
|
|
1441
|
-
return /* @__PURE__ */ (0,
|
|
1442
|
-
|
|
1618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1619
|
+
import_react12.BubbleMenu,
|
|
1443
1620
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
1444
1621
|
className: "mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
1445
|
-
children: /* @__PURE__ */ (0,
|
|
1622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ColumnsBubbleMenuContent, { editor })
|
|
1446
1623
|
})
|
|
1447
1624
|
);
|
|
1448
1625
|
}
|
|
1449
1626
|
|
|
1450
1627
|
// src/editor/components/content-menu.tsx
|
|
1451
|
-
var
|
|
1452
|
-
var
|
|
1628
|
+
var import_react15 = require("react");
|
|
1629
|
+
var import_lucide_react14 = require("lucide-react");
|
|
1453
1630
|
|
|
1454
1631
|
// src/editor/components/drag-handle.tsx
|
|
1455
|
-
var
|
|
1632
|
+
var import_react14 = require("react");
|
|
1456
1633
|
var import_echo_drag_handle_plugin = require("echo-drag-handle-plugin");
|
|
1457
|
-
var
|
|
1634
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1458
1635
|
function DragHandle(props) {
|
|
1459
1636
|
const {
|
|
1460
1637
|
className = "drag-handle",
|
|
@@ -1464,9 +1641,9 @@ function DragHandle(props) {
|
|
|
1464
1641
|
onNodeChange,
|
|
1465
1642
|
tippyOptions = {}
|
|
1466
1643
|
} = props;
|
|
1467
|
-
const [element, setElement] = (0,
|
|
1468
|
-
const pluginRef = (0,
|
|
1469
|
-
(0,
|
|
1644
|
+
const [element, setElement] = (0, import_react14.useState)(null);
|
|
1645
|
+
const pluginRef = (0, import_react14.useRef)(null);
|
|
1646
|
+
(0, import_react14.useEffect)(() => {
|
|
1470
1647
|
if (!element) {
|
|
1471
1648
|
return () => {
|
|
1472
1649
|
pluginRef.current = null;
|
|
@@ -1492,17 +1669,17 @@ function DragHandle(props) {
|
|
|
1492
1669
|
pluginRef.current = null;
|
|
1493
1670
|
};
|
|
1494
1671
|
}, [element, editor, onNodeChange, pluginKey]);
|
|
1495
|
-
return /* @__PURE__ */ (0,
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className, ref: setElement, children });
|
|
1496
1673
|
}
|
|
1497
1674
|
|
|
1498
1675
|
// src/editor/components/content-menu.tsx
|
|
1499
|
-
var
|
|
1676
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1500
1677
|
function ContentMenu(props) {
|
|
1501
1678
|
const { editor } = props;
|
|
1502
|
-
const [menuOpen, setMenuOpen] = (0,
|
|
1503
|
-
const [currentNode, setCurrentNode] = (0,
|
|
1504
|
-
const [currentNodePos, setCurrentNodePos] = (0,
|
|
1505
|
-
const handleNodeChange = (0,
|
|
1679
|
+
const [menuOpen, setMenuOpen] = (0, import_react15.useState)(false);
|
|
1680
|
+
const [currentNode, setCurrentNode] = (0, import_react15.useState)(null);
|
|
1681
|
+
const [currentNodePos, setCurrentNodePos] = (0, import_react15.useState)(-1);
|
|
1682
|
+
const handleNodeChange = (0, import_react15.useCallback)(
|
|
1506
1683
|
(data) => {
|
|
1507
1684
|
if (data.node) {
|
|
1508
1685
|
setCurrentNode(data.node);
|
|
@@ -1550,7 +1727,7 @@ function ContentMenu(props) {
|
|
|
1550
1727
|
}).focus(focusPos).run();
|
|
1551
1728
|
}
|
|
1552
1729
|
}
|
|
1553
|
-
(0,
|
|
1730
|
+
(0, import_react15.useEffect)(() => {
|
|
1554
1731
|
if (menuOpen) {
|
|
1555
1732
|
editor.commands.setMeta("lockDragHandle", true);
|
|
1556
1733
|
} else {
|
|
@@ -1560,7 +1737,7 @@ function ContentMenu(props) {
|
|
|
1560
1737
|
editor.commands.setMeta("lockDragHandle", false);
|
|
1561
1738
|
};
|
|
1562
1739
|
}, [editor, menuOpen]);
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1564
1741
|
DragHandle,
|
|
1565
1742
|
{
|
|
1566
1743
|
pluginKey: "ContentMenu",
|
|
@@ -1570,9 +1747,9 @@ function ContentMenu(props) {
|
|
|
1570
1747
|
zIndex: 99
|
|
1571
1748
|
},
|
|
1572
1749
|
onNodeChange: handleNodeChange,
|
|
1573
|
-
children: /* @__PURE__ */ (0,
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1575
|
-
/* @__PURE__ */ (0,
|
|
1750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "mly-flex mly-items-center mly-pr-1.5", children: [
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1576
1753
|
BaseButton,
|
|
1577
1754
|
{
|
|
1578
1755
|
variant: "ghost",
|
|
@@ -1580,15 +1757,15 @@ function ContentMenu(props) {
|
|
|
1580
1757
|
className: "!mly-size-5 mly-cursor-grab mly-text-gray-500 hover:mly-text-black",
|
|
1581
1758
|
onClick: handleAddNewNode,
|
|
1582
1759
|
type: "button",
|
|
1583
|
-
children: /* @__PURE__ */ (0,
|
|
1760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Plus, { className: "mly-size-3.5 mly-shrink-0" })
|
|
1584
1761
|
}
|
|
1585
1762
|
) }),
|
|
1586
|
-
/* @__PURE__ */ (0,
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { sideOffset: 8, children: "Add new node" })
|
|
1587
1764
|
] }),
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1590
|
-
/* @__PURE__ */ (0,
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Popover, { open: menuOpen, onOpenChange: setMenuOpen, children: [
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "mly-relative mly-flex mly-flex-col", children: [
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1592
1769
|
BaseButton,
|
|
1593
1770
|
{
|
|
1594
1771
|
variant: "ghost",
|
|
@@ -1600,14 +1777,14 @@ function ContentMenu(props) {
|
|
|
1600
1777
|
editor.commands.setNodeSelection(currentNodePos);
|
|
1601
1778
|
},
|
|
1602
1779
|
type: "button",
|
|
1603
|
-
children: /* @__PURE__ */ (0,
|
|
1780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.GripVertical, { className: "mly-size-3.5 mly-shrink-0" })
|
|
1604
1781
|
}
|
|
1605
1782
|
) }),
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { sideOffset: 8, children: "Node actions" })
|
|
1607
1784
|
] }),
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PopoverTrigger, { className: "mly-absolute mly-left-0 mly-top-0 mly-z-0 mly-h-5 mly-w-5" })
|
|
1609
1786
|
] }),
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1611
1788
|
PopoverContent,
|
|
1612
1789
|
{
|
|
1613
1790
|
align: "start",
|
|
@@ -1615,26 +1792,26 @@ function ContentMenu(props) {
|
|
|
1615
1792
|
sideOffset: 8,
|
|
1616
1793
|
className: "mly-flex mly-w-max mly-flex-col mly-rounded-md mly-p-1",
|
|
1617
1794
|
children: [
|
|
1618
|
-
/* @__PURE__ */ (0,
|
|
1795
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1619
1796
|
BaseButton,
|
|
1620
1797
|
{
|
|
1621
1798
|
variant: "ghost",
|
|
1622
1799
|
onClick: duplicateNode,
|
|
1623
1800
|
className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-px-2 mly-py-1 mly-text-sm mly-font-normal",
|
|
1624
1801
|
children: [
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1802
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Copy, { className: "mly-size-[15px] mly-shrink-0" }),
|
|
1626
1803
|
"Duplicate"
|
|
1627
1804
|
]
|
|
1628
1805
|
}
|
|
1629
1806
|
),
|
|
1630
|
-
/* @__PURE__ */ (0,
|
|
1631
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Divider, { type: "horizontal" }),
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1632
1809
|
BaseButton,
|
|
1633
1810
|
{
|
|
1634
1811
|
onClick: deleteCurrentNode,
|
|
1635
1812
|
className: "mly-h-auto mly-justify-start mly-gap-2 !mly-rounded mly-bg-red-100 mly-px-2 mly-py-1 mly-text-sm mly-font-normal mly-text-red-600 hover:mly-bg-red-200 focus:mly-bg-red-200",
|
|
1636
1813
|
children: [
|
|
1637
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Trash2, { className: "mly-size-[15px] mly-shrink-0" }),
|
|
1638
1815
|
"Delete"
|
|
1639
1816
|
]
|
|
1640
1817
|
}
|
|
@@ -1649,54 +1826,54 @@ function ContentMenu(props) {
|
|
|
1649
1826
|
}
|
|
1650
1827
|
|
|
1651
1828
|
// src/editor/components/editor-menu-bar.tsx
|
|
1652
|
-
var
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1829
|
+
var import_react16 = require("react");
|
|
1830
|
+
var import_lucide_react15 = require("lucide-react");
|
|
1831
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1655
1832
|
var EditorMenuBar = (props) => {
|
|
1656
1833
|
const { editor, config } = props;
|
|
1657
|
-
const items = (0,
|
|
1834
|
+
const items = (0, import_react16.useMemo)(
|
|
1658
1835
|
() => [
|
|
1659
1836
|
{
|
|
1660
1837
|
name: "bold",
|
|
1661
1838
|
command: () => editor.chain().focus().toggleBold().run(),
|
|
1662
1839
|
isActive: () => editor.isActive("bold"),
|
|
1663
1840
|
group: "mark",
|
|
1664
|
-
icon:
|
|
1841
|
+
icon: import_lucide_react15.BoldIcon
|
|
1665
1842
|
},
|
|
1666
1843
|
{
|
|
1667
1844
|
name: "italic",
|
|
1668
1845
|
command: () => editor.chain().focus().toggleItalic().run(),
|
|
1669
1846
|
isActive: () => editor.isActive("italic"),
|
|
1670
1847
|
group: "mark",
|
|
1671
|
-
icon:
|
|
1848
|
+
icon: import_lucide_react15.ItalicIcon
|
|
1672
1849
|
},
|
|
1673
1850
|
{
|
|
1674
1851
|
name: "underline",
|
|
1675
1852
|
command: () => editor.chain().focus().toggleUnderline().run(),
|
|
1676
1853
|
isActive: () => editor.isActive("underline"),
|
|
1677
1854
|
group: "mark",
|
|
1678
|
-
icon:
|
|
1855
|
+
icon: import_lucide_react15.UnderlineIcon
|
|
1679
1856
|
},
|
|
1680
1857
|
{
|
|
1681
1858
|
name: "strike",
|
|
1682
1859
|
command: () => editor.chain().focus().toggleStrike().run(),
|
|
1683
1860
|
isActive: () => editor.isActive("strike"),
|
|
1684
1861
|
group: "mark",
|
|
1685
|
-
icon:
|
|
1862
|
+
icon: import_lucide_react15.StrikethroughIcon
|
|
1686
1863
|
},
|
|
1687
1864
|
{
|
|
1688
1865
|
name: "delete-line",
|
|
1689
1866
|
command: () => editor.chain().focus().selectParentNode().deleteSelection().run(),
|
|
1690
1867
|
isActive: () => false,
|
|
1691
1868
|
group: "mark",
|
|
1692
|
-
icon:
|
|
1869
|
+
icon: import_lucide_react15.EraserIcon
|
|
1693
1870
|
},
|
|
1694
1871
|
{
|
|
1695
1872
|
name: "divider",
|
|
1696
1873
|
command: () => editor.chain().focus().setHorizontalRule().run(),
|
|
1697
1874
|
isActive: () => editor.isActive("horizontalRule"),
|
|
1698
1875
|
group: "custom",
|
|
1699
|
-
icon:
|
|
1876
|
+
icon: import_lucide_react15.SeparatorHorizontal
|
|
1700
1877
|
},
|
|
1701
1878
|
{
|
|
1702
1879
|
name: "link",
|
|
@@ -1712,33 +1889,33 @@ var EditorMenuBar = (props) => {
|
|
|
1712
1889
|
},
|
|
1713
1890
|
isActive: () => editor.isActive("link"),
|
|
1714
1891
|
group: "custom",
|
|
1715
|
-
icon:
|
|
1892
|
+
icon: import_lucide_react15.LinkIcon
|
|
1716
1893
|
},
|
|
1717
1894
|
{
|
|
1718
1895
|
name: "left",
|
|
1719
1896
|
command: () => editor.chain().focus().setTextAlign("left").run(),
|
|
1720
1897
|
isActive: () => editor.isActive({ textAlign: "left" }),
|
|
1721
1898
|
group: "alignment",
|
|
1722
|
-
icon:
|
|
1899
|
+
icon: import_lucide_react15.AlignLeft
|
|
1723
1900
|
},
|
|
1724
1901
|
{
|
|
1725
1902
|
name: "center",
|
|
1726
1903
|
command: () => editor.chain().focus().setTextAlign("center").run(),
|
|
1727
1904
|
isActive: () => editor.isActive({ textAlign: "center" }),
|
|
1728
1905
|
group: "alignment",
|
|
1729
|
-
icon:
|
|
1906
|
+
icon: import_lucide_react15.AlignCenter
|
|
1730
1907
|
},
|
|
1731
1908
|
{
|
|
1732
1909
|
name: "right",
|
|
1733
1910
|
command: () => editor.chain().focus().setTextAlign("right").run(),
|
|
1734
1911
|
isActive: () => editor.isActive({ textAlign: "right" }),
|
|
1735
1912
|
group: "alignment",
|
|
1736
|
-
icon:
|
|
1913
|
+
icon: import_lucide_react15.AlignRight
|
|
1737
1914
|
}
|
|
1738
1915
|
],
|
|
1739
1916
|
[editor]
|
|
1740
1917
|
);
|
|
1741
|
-
const groups = (0,
|
|
1918
|
+
const groups = (0, import_react16.useMemo)(
|
|
1742
1919
|
() => items.reduce((acc, item) => {
|
|
1743
1920
|
if (!acc.includes(item.group)) {
|
|
1744
1921
|
acc.push(item.group);
|
|
@@ -1750,15 +1927,15 @@ var EditorMenuBar = (props) => {
|
|
|
1750
1927
|
if (!editor) {
|
|
1751
1928
|
return null;
|
|
1752
1929
|
}
|
|
1753
|
-
return /* @__PURE__ */ (0,
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1754
1931
|
"div",
|
|
1755
1932
|
{
|
|
1756
1933
|
className: `mly-flex mly-items-center mly-gap-3 ${config == null ? void 0 : config.toolbarClassName}`,
|
|
1757
|
-
children: groups.map((group, index) => /* @__PURE__ */ (0,
|
|
1934
|
+
children: groups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1758
1935
|
"div",
|
|
1759
1936
|
{
|
|
1760
1937
|
className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",
|
|
1761
|
-
children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */ (0,
|
|
1938
|
+
children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BubbleMenuButton, __spreadValues({}, item), index2))
|
|
1762
1939
|
},
|
|
1763
1940
|
index
|
|
1764
1941
|
))
|
|
@@ -1767,16 +1944,16 @@ var EditorMenuBar = (props) => {
|
|
|
1767
1944
|
};
|
|
1768
1945
|
|
|
1769
1946
|
// src/editor/components/for-menu/for-bubble-menu.tsx
|
|
1770
|
-
var
|
|
1771
|
-
var
|
|
1772
|
-
var
|
|
1947
|
+
var import_react18 = require("@tiptap/react");
|
|
1948
|
+
var import_lucide_react16 = require("lucide-react");
|
|
1949
|
+
var import_react19 = require("react");
|
|
1773
1950
|
var import_tippy2 = require("tippy.js");
|
|
1774
1951
|
|
|
1775
1952
|
// src/editor/components/for-menu/use-for-state.ts
|
|
1776
|
-
var
|
|
1953
|
+
var import_react17 = require("@tiptap/react");
|
|
1777
1954
|
var import_fast_deep_equal2 = __toESM(require("fast-deep-equal"));
|
|
1778
1955
|
var useForState = (editor) => {
|
|
1779
|
-
const states = (0,
|
|
1956
|
+
const states = (0, import_react17.useEditorState)({
|
|
1780
1957
|
editor,
|
|
1781
1958
|
selector: (ctx) => {
|
|
1782
1959
|
var _a, _b;
|
|
@@ -1792,14 +1969,14 @@ var useForState = (editor) => {
|
|
|
1792
1969
|
};
|
|
1793
1970
|
|
|
1794
1971
|
// src/editor/components/for-menu/for-bubble-menu.tsx
|
|
1795
|
-
var
|
|
1972
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1796
1973
|
function ForBubbleMenu(props) {
|
|
1797
1974
|
const { appendTo, editor } = props;
|
|
1798
1975
|
if (!editor) {
|
|
1799
1976
|
return null;
|
|
1800
1977
|
}
|
|
1801
1978
|
const state = useForState(editor);
|
|
1802
|
-
const getReferenceClientRect = (0,
|
|
1979
|
+
const getReferenceClientRect = (0, import_react19.useCallback)(() => {
|
|
1803
1980
|
const renderContainer = getRenderContainer(editor, "for");
|
|
1804
1981
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
1805
1982
|
return rect;
|
|
@@ -1808,7 +1985,7 @@ function ForBubbleMenu(props) {
|
|
|
1808
1985
|
shouldShow: ({ editor: editor2 }) => {
|
|
1809
1986
|
var _a;
|
|
1810
1987
|
const activeForNode = getClosestNodeByName(editor2, "for");
|
|
1811
|
-
const sectionNodeChildren = activeForNode ? (_a = (0,
|
|
1988
|
+
const sectionNodeChildren = activeForNode ? (_a = (0, import_react18.findChildren)(activeForNode == null ? void 0 : activeForNode.node, (node) => {
|
|
1812
1989
|
return node.type.name === "section";
|
|
1813
1990
|
})) == null ? void 0 : _a[0] : null;
|
|
1814
1991
|
const hasActiveSectionNodeChildren = sectionNodeChildren && editor2.isActive("section");
|
|
@@ -1831,24 +2008,24 @@ function ForBubbleMenu(props) {
|
|
|
1831
2008
|
pluginKey: "forBubbleMenu"
|
|
1832
2009
|
});
|
|
1833
2010
|
const { variables = [] } = useMailyContext();
|
|
1834
|
-
const inputRef = (0,
|
|
1835
|
-
const [isUpdatingKey, setIsUpdatingKey] = (0,
|
|
2011
|
+
const inputRef = (0, import_react19.useRef)(null);
|
|
2012
|
+
const [isUpdatingKey, setIsUpdatingKey] = (0, import_react19.useState)(false);
|
|
1836
2013
|
const eachKey = (state == null ? void 0 : state.each) || "";
|
|
1837
|
-
const autoCompleteOptions = (0,
|
|
2014
|
+
const autoCompleteOptions = (0, import_react19.useMemo)(() => {
|
|
1838
2015
|
return processVariables(variables, {
|
|
1839
2016
|
query: eachKey || "",
|
|
1840
2017
|
editor,
|
|
1841
|
-
from: "for"
|
|
1842
|
-
}).map((variable) => variable.name)
|
|
2018
|
+
from: "for-variable"
|
|
2019
|
+
}).map((variable) => variable.name);
|
|
1843
2020
|
}, [variables, eachKey, editor]);
|
|
1844
2021
|
const isValidEachKey = eachKey || autoCompleteOptions.includes(eachKey);
|
|
1845
|
-
return /* @__PURE__ */ (0,
|
|
1846
|
-
|
|
2022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2023
|
+
import_react18.BubbleMenu,
|
|
1847
2024
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
1848
2025
|
className: "mly-flex mly-items-stretch mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
1849
|
-
children: /* @__PURE__ */ (0,
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
1851
|
-
!isUpdatingKey && /* @__PURE__ */ (0,
|
|
2026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(TooltipProvider, { children: [
|
|
2027
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "For" }),
|
|
2028
|
+
!isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1852
2029
|
"button",
|
|
1853
2030
|
{
|
|
1854
2031
|
className: cn(
|
|
@@ -1863,12 +2040,12 @@ function ForBubbleMenu(props) {
|
|
|
1863
2040
|
}, 0);
|
|
1864
2041
|
},
|
|
1865
2042
|
children: [
|
|
1866
|
-
/* @__PURE__ */ (0,
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: state == null ? void 0 : state.each })
|
|
1868
2045
|
]
|
|
1869
2046
|
}
|
|
1870
2047
|
),
|
|
1871
|
-
isUpdatingKey && /* @__PURE__ */ (0,
|
|
2048
|
+
isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1872
2049
|
"form",
|
|
1873
2050
|
{
|
|
1874
2051
|
onSubmit: (e) => {
|
|
@@ -1880,7 +2057,7 @@ function ForBubbleMenu(props) {
|
|
|
1880
2057
|
setIsUpdatingKey(false);
|
|
1881
2058
|
}
|
|
1882
2059
|
},
|
|
1883
|
-
children: /* @__PURE__ */ (0,
|
|
2060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1884
2061
|
InputAutocomplete,
|
|
1885
2062
|
{
|
|
1886
2063
|
value: (state == null ? void 0 : state.each) || "",
|
|
@@ -1892,7 +2069,10 @@ function ForBubbleMenu(props) {
|
|
|
1892
2069
|
onOutsideClick: () => {
|
|
1893
2070
|
setIsUpdatingKey(false);
|
|
1894
2071
|
},
|
|
1895
|
-
onSelectOption: () => {
|
|
2072
|
+
onSelectOption: (value) => {
|
|
2073
|
+
editor.commands.updateFor({
|
|
2074
|
+
each: value
|
|
2075
|
+
});
|
|
1896
2076
|
setIsUpdatingKey(false);
|
|
1897
2077
|
},
|
|
1898
2078
|
autoCompleteOptions,
|
|
@@ -1901,8 +2081,8 @@ function ForBubbleMenu(props) {
|
|
|
1901
2081
|
)
|
|
1902
2082
|
}
|
|
1903
2083
|
),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Divider, {}),
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1906
2086
|
ShowPopover,
|
|
1907
2087
|
{
|
|
1908
2088
|
showIfKey: state.currentShowIfKey,
|
|
@@ -1920,38 +2100,38 @@ function ForBubbleMenu(props) {
|
|
|
1920
2100
|
}
|
|
1921
2101
|
|
|
1922
2102
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
1923
|
-
var
|
|
1924
|
-
var
|
|
2103
|
+
var import_react30 = require("@tiptap/react");
|
|
2104
|
+
var import_lucide_react20 = require("lucide-react");
|
|
1925
2105
|
|
|
1926
2106
|
// src/editor/components/alignment-switch.tsx
|
|
1927
|
-
var
|
|
1928
|
-
var
|
|
2107
|
+
var import_lucide_react17 = require("lucide-react");
|
|
2108
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1929
2109
|
function AlignmentSwitch(props) {
|
|
1930
2110
|
const { alignment = "left", onAlignmentChange } = props;
|
|
1931
2111
|
const activeAlignment = {
|
|
1932
2112
|
left: {
|
|
1933
|
-
icon:
|
|
2113
|
+
icon: import_lucide_react17.AlignLeft,
|
|
1934
2114
|
tooltip: "Align Left",
|
|
1935
2115
|
onClick: () => {
|
|
1936
2116
|
onAlignmentChange("center");
|
|
1937
2117
|
}
|
|
1938
2118
|
},
|
|
1939
2119
|
center: {
|
|
1940
|
-
icon:
|
|
2120
|
+
icon: import_lucide_react17.AlignCenter,
|
|
1941
2121
|
tooltip: "Align Center",
|
|
1942
2122
|
onClick: () => {
|
|
1943
2123
|
onAlignmentChange("right");
|
|
1944
2124
|
}
|
|
1945
2125
|
},
|
|
1946
2126
|
right: {
|
|
1947
|
-
icon:
|
|
2127
|
+
icon: import_lucide_react17.AlignRight,
|
|
1948
2128
|
tooltip: "Align Right",
|
|
1949
2129
|
onClick: () => {
|
|
1950
2130
|
onAlignmentChange("left");
|
|
1951
2131
|
}
|
|
1952
2132
|
}
|
|
1953
2133
|
}[alignment];
|
|
1954
|
-
return /* @__PURE__ */ (0,
|
|
2134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1955
2135
|
BubbleMenuButton,
|
|
1956
2136
|
{
|
|
1957
2137
|
icon: activeAlignment.icon,
|
|
@@ -1962,21 +2142,46 @@ function AlignmentSwitch(props) {
|
|
|
1962
2142
|
}
|
|
1963
2143
|
|
|
1964
2144
|
// src/editor/components/ui/link-input-popover.tsx
|
|
1965
|
-
var
|
|
1966
|
-
var
|
|
1967
|
-
var
|
|
2145
|
+
var import_lucide_react18 = require("lucide-react");
|
|
2146
|
+
var import_react20 = require("react");
|
|
2147
|
+
var import_react21 = require("react");
|
|
2148
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2149
|
+
var LINK_PROTOCOL_REGEX = /https?:\/\//;
|
|
1968
2150
|
function LinkInputPopover(props) {
|
|
2151
|
+
var _a;
|
|
1969
2152
|
const {
|
|
1970
2153
|
defaultValue = "",
|
|
1971
2154
|
onValueChange,
|
|
1972
2155
|
tooltip,
|
|
1973
|
-
icon: Icon =
|
|
2156
|
+
icon: Icon = import_lucide_react18.Link,
|
|
2157
|
+
editor,
|
|
2158
|
+
isVariable
|
|
1974
2159
|
} = props;
|
|
1975
|
-
const
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2160
|
+
const defaultProtocol = (_a = defaultValue.match(LINK_PROTOCOL_REGEX)) == null ? void 0 : _a[0];
|
|
2161
|
+
const defaultUrlWithoutProtocol = defaultValue.replace(
|
|
2162
|
+
LINK_PROTOCOL_REGEX,
|
|
2163
|
+
""
|
|
2164
|
+
);
|
|
2165
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
2166
|
+
const [protocol, setProtocol] = (0, import_react20.useState)(defaultProtocol || "https://");
|
|
2167
|
+
const [isEditing, setIsEditing] = (0, import_react20.useState)(!isVariable);
|
|
2168
|
+
const linkInputRef = (0, import_react20.useRef)(null);
|
|
2169
|
+
const {
|
|
2170
|
+
variables = [],
|
|
2171
|
+
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR
|
|
2172
|
+
} = useMailyContext();
|
|
2173
|
+
const autoCompleteOptions = (0, import_react21.useMemo)(() => {
|
|
2174
|
+
const withoutTrigger = defaultUrlWithoutProtocol.replace(
|
|
2175
|
+
new RegExp(variableTriggerCharacter, "g"),
|
|
2176
|
+
""
|
|
2177
|
+
);
|
|
2178
|
+
return processVariables(variables, {
|
|
2179
|
+
query: withoutTrigger || "",
|
|
2180
|
+
from: "bubble-variable",
|
|
2181
|
+
editor
|
|
2182
|
+
}).map((variable) => variable.name);
|
|
2183
|
+
}, [variables, defaultUrlWithoutProtocol, editor]);
|
|
2184
|
+
const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1980
2185
|
BaseButton,
|
|
1981
2186
|
{
|
|
1982
2187
|
variant: "ghost",
|
|
@@ -1984,19 +2189,19 @@ function LinkInputPopover(props) {
|
|
|
1984
2189
|
type: "button",
|
|
1985
2190
|
className: "mly-size-7",
|
|
1986
2191
|
"data-state": !!defaultUrlWithoutProtocol,
|
|
1987
|
-
children: /* @__PURE__ */ (0,
|
|
2192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
|
|
1988
2193
|
}
|
|
1989
2194
|
) });
|
|
1990
2195
|
const normalizeProtocol = (value, p = protocol) => {
|
|
1991
|
-
value = value.replace(
|
|
2196
|
+
value = value == null ? void 0 : value.replace(LINK_PROTOCOL_REGEX, "");
|
|
1992
2197
|
return p + value;
|
|
1993
2198
|
};
|
|
1994
|
-
return /* @__PURE__ */ (0,
|
|
1995
|
-
tooltip ? /* @__PURE__ */ (0,
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
2200
|
+
tooltip ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
1998
2203
|
] }) : popoverButton,
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2204
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2000
2205
|
PopoverContent,
|
|
2001
2206
|
{
|
|
2002
2207
|
align: "end",
|
|
@@ -2004,7 +2209,7 @@ function LinkInputPopover(props) {
|
|
|
2004
2209
|
className: "mly-w-max mly-rounded-none mly-border-none mly-bg-transparent !mly-p-0 mly-shadow-none",
|
|
2005
2210
|
sideOffset: 8,
|
|
2006
2211
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
2007
|
-
children: /* @__PURE__ */ (0,
|
|
2212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2008
2213
|
"form",
|
|
2009
2214
|
{
|
|
2010
2215
|
onSubmit: (e) => {
|
|
@@ -2017,33 +2222,50 @@ function LinkInputPopover(props) {
|
|
|
2017
2222
|
onValueChange == null ? void 0 : onValueChange(value);
|
|
2018
2223
|
setIsOpen(false);
|
|
2019
2224
|
},
|
|
2020
|
-
children: /* @__PURE__ */ (0,
|
|
2021
|
-
/* @__PURE__ */ (0,
|
|
2022
|
-
|
|
2023
|
-
|
|
2225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
|
|
2226
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mly-flex mly-h-8 mly-items-center mly-rounded-lg mly-border mly-border-gray-300 mly-bg-white mly-px-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2227
|
+
"button",
|
|
2228
|
+
{
|
|
2229
|
+
className: "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",
|
|
2230
|
+
onClick: () => {
|
|
2231
|
+
setIsEditing(true);
|
|
2232
|
+
setTimeout(() => {
|
|
2233
|
+
var _a2;
|
|
2234
|
+
(_a2 = linkInputRef.current) == null ? void 0 : _a2.focus();
|
|
2235
|
+
}, 0);
|
|
2236
|
+
},
|
|
2237
|
+
children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react18.BracesIcon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: defaultUrlWithoutProtocol })
|
|
2240
|
+
]
|
|
2241
|
+
}
|
|
2242
|
+
) }),
|
|
2243
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mly-relative", children: [
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2024
2246
|
"select",
|
|
2025
2247
|
{
|
|
2026
2248
|
className: "hover:text-accent-foreground mly-peer mly-inline-flex mly-h-full mly-appearance-none mly-items-center mly-rounded-none mly-rounded-s-lg mly-border mly-border-gray-300 mly-bg-gray-50 mly-pe-8 mly-ps-3 mly-text-sm mly-text-gray-700 mly-transition-shadow hover:mly-bg-gray-100 focus:mly-z-10 focus-visible:mly-outline-none disabled:mly-pointer-events-none disabled:mly-cursor-not-allowed disabled:mly-opacity-50",
|
|
2027
2249
|
"aria-label": "Protocol",
|
|
2028
2250
|
value: protocol,
|
|
2029
2251
|
onChange: (e) => {
|
|
2030
|
-
var
|
|
2252
|
+
var _a2;
|
|
2031
2253
|
const protocol2 = e.target.value;
|
|
2032
2254
|
setProtocol(protocol2);
|
|
2033
2255
|
const newValue = normalizeProtocol(
|
|
2034
|
-
((
|
|
2256
|
+
((_a2 = linkInputRef.current) == null ? void 0 : _a2.value) || "",
|
|
2035
2257
|
protocol2
|
|
2036
2258
|
);
|
|
2037
2259
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
2038
2260
|
},
|
|
2039
2261
|
children: [
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "https://", children: "https://" }),
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "http://", children: "http://" })
|
|
2042
2264
|
]
|
|
2043
2265
|
}
|
|
2044
2266
|
),
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2046
|
-
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-9 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2268
|
+
import_lucide_react18.ChevronDownIcon,
|
|
2047
2269
|
{
|
|
2048
2270
|
size: 16,
|
|
2049
2271
|
strokeWidth: 2,
|
|
@@ -2052,29 +2274,33 @@ function LinkInputPopover(props) {
|
|
|
2052
2274
|
}
|
|
2053
2275
|
) })
|
|
2054
2276
|
] }),
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2056
|
-
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2278
|
+
InputAutocomplete,
|
|
2057
2279
|
{
|
|
2058
2280
|
value: defaultUrlWithoutProtocol,
|
|
2059
|
-
|
|
2060
|
-
let
|
|
2061
|
-
onValueChange == null ? void 0 : onValueChange(
|
|
2281
|
+
onValueChange: (value) => {
|
|
2282
|
+
let newValue = normalizeProtocol(value);
|
|
2283
|
+
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
2062
2284
|
},
|
|
2285
|
+
autoCompleteOptions,
|
|
2063
2286
|
ref: linkInputRef,
|
|
2064
|
-
|
|
2287
|
+
placeholder: "maily.to/",
|
|
2065
2288
|
className: "-mly-ms-px mly-block mly-h-8 mly-w-52 mly-rounded-lg mly-rounded-s-none mly-border mly-border-gray-300 mly-px-2 mly-py-1.5 mly-pr-6 mly-text-sm mly-shadow-sm mly-outline-none placeholder:mly-text-gray-400",
|
|
2066
|
-
|
|
2289
|
+
triggerChar: variableTriggerCharacter,
|
|
2290
|
+
onSelectOption: (value) => {
|
|
2291
|
+
var _a2;
|
|
2292
|
+
const isVariable2 = (_a2 = autoCompleteOptions.includes(value)) != null ? _a2 : false;
|
|
2293
|
+
if (isVariable2) {
|
|
2294
|
+
setIsEditing(false);
|
|
2295
|
+
} else {
|
|
2296
|
+
value = normalizeProtocol(value);
|
|
2297
|
+
}
|
|
2298
|
+
onValueChange == null ? void 0 : onValueChange(value, isVariable2);
|
|
2299
|
+
setIsOpen(false);
|
|
2300
|
+
}
|
|
2067
2301
|
}
|
|
2068
2302
|
)
|
|
2069
|
-
] })
|
|
2070
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-1.5 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2071
|
-
import_lucide_react16.CornerDownLeft,
|
|
2072
|
-
{
|
|
2073
|
-
className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray",
|
|
2074
|
-
"aria-hidden": "true",
|
|
2075
|
-
role: "img"
|
|
2076
|
-
}
|
|
2077
|
-
) })
|
|
2303
|
+
] })
|
|
2078
2304
|
] })
|
|
2079
2305
|
}
|
|
2080
2306
|
)
|
|
@@ -2084,12 +2310,12 @@ function LinkInputPopover(props) {
|
|
|
2084
2310
|
}
|
|
2085
2311
|
|
|
2086
2312
|
// src/editor/components/image-menu/image-size.tsx
|
|
2087
|
-
var
|
|
2313
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2088
2314
|
function ImageSize(props) {
|
|
2089
2315
|
const { value, onValueChange, dimension } = props;
|
|
2090
|
-
return /* @__PURE__ */ (0,
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "mly-relative mly-flex mly-items-center", children: [
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "mly-absolute mly-inset-y-0 mly-left-2 mly-flex mly-items-center mly-text-xs mly-leading-none mly-text-gray-400", children: dimension === "width" ? "W" : "H" }),
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2093
2319
|
"input",
|
|
2094
2320
|
{
|
|
2095
2321
|
className: "hide-number-controls mly-h-auto mly-max-w-20 mly-appearance-none mly-border-0 mly-border-none mly-p-1 mly-px-[26px] mly-text-sm mly-uppercase mly-tabular-nums mly-outline-none focus-visible:mly-outline-none",
|
|
@@ -2098,13 +2324,13 @@ function ImageSize(props) {
|
|
|
2098
2324
|
onChange: (e) => onValueChange(e.target.value)
|
|
2099
2325
|
}
|
|
2100
2326
|
),
|
|
2101
|
-
/* @__PURE__ */ (0,
|
|
2327
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center mly-text-xs mly-leading-none mly-text-gray-400", children: "PX" })
|
|
2102
2328
|
] });
|
|
2103
2329
|
}
|
|
2104
2330
|
|
|
2105
2331
|
// src/editor/nodes/logo/logo.ts
|
|
2106
2332
|
var import_extension_image = __toESM(require("@tiptap/extension-image"));
|
|
2107
|
-
var
|
|
2333
|
+
var import_react28 = require("@tiptap/react");
|
|
2108
2334
|
|
|
2109
2335
|
// src/editor/nodes/section/section.ts
|
|
2110
2336
|
var import_core5 = require("@tiptap/core");
|
|
@@ -2369,7 +2595,7 @@ var SectionExtension = import_core5.Node.create({
|
|
|
2369
2595
|
border: 0,
|
|
2370
2596
|
cellpadding: 0,
|
|
2371
2597
|
cellspacing: 0,
|
|
2372
|
-
class: "mly-w-full mly-border-separate mly-relative",
|
|
2598
|
+
class: "mly-w-full mly-border-separate mly-relative mly-table-fixed",
|
|
2373
2599
|
style: `margin-top: ${marginTop}px; margin-right: ${marginRight}px; margin-bottom: ${marginBottom}px; margin-left: ${marginLeft}px;`
|
|
2374
2600
|
},
|
|
2375
2601
|
[
|
|
@@ -2405,18 +2631,18 @@ var SectionExtension = import_core5.Node.create({
|
|
|
2405
2631
|
});
|
|
2406
2632
|
|
|
2407
2633
|
// src/editor/nodes/logo/logo-view.tsx
|
|
2408
|
-
var
|
|
2409
|
-
var
|
|
2410
|
-
var
|
|
2634
|
+
var import_react25 = require("@tiptap/react");
|
|
2635
|
+
var import_react26 = require("react");
|
|
2636
|
+
var import_react27 = require("react");
|
|
2411
2637
|
|
|
2412
2638
|
// src/editor/utils/use-event.ts
|
|
2413
|
-
var
|
|
2639
|
+
var import_react22 = require("react");
|
|
2414
2640
|
var useEvent = (handler) => {
|
|
2415
|
-
const handlerRef = (0,
|
|
2416
|
-
(0,
|
|
2641
|
+
const handlerRef = (0, import_react22.useRef)(null);
|
|
2642
|
+
(0, import_react22.useLayoutEffect)(() => {
|
|
2417
2643
|
handlerRef.current = handler;
|
|
2418
2644
|
}, [handler]);
|
|
2419
|
-
return (0,
|
|
2645
|
+
return (0, import_react22.useCallback)((...args) => {
|
|
2420
2646
|
if (handlerRef.current === null) {
|
|
2421
2647
|
throw new Error("Handler is not assigned");
|
|
2422
2648
|
}
|
|
@@ -2425,18 +2651,18 @@ var useEvent = (handler) => {
|
|
|
2425
2651
|
};
|
|
2426
2652
|
|
|
2427
2653
|
// src/editor/nodes/image/image-view.tsx
|
|
2428
|
-
var
|
|
2429
|
-
var
|
|
2430
|
-
var
|
|
2431
|
-
var
|
|
2654
|
+
var import_react23 = require("@tiptap/react");
|
|
2655
|
+
var import_lucide_react19 = require("lucide-react");
|
|
2656
|
+
var import_react24 = require("react");
|
|
2657
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2432
2658
|
var MIN_WIDTH = 20;
|
|
2433
2659
|
var MAX_WIDTH = 600;
|
|
2434
2660
|
function ImageView(props) {
|
|
2435
2661
|
const { node, updateAttributes: updateAttributes2, selected } = props;
|
|
2436
|
-
const [status, setStatus] = (0,
|
|
2437
|
-
const wrapperRef = (0,
|
|
2438
|
-
const imgRef = (0,
|
|
2439
|
-
const [resizingStyle, setResizingStyle] = (0,
|
|
2662
|
+
const [status, setStatus] = (0, import_react24.useState)("idle");
|
|
2663
|
+
const wrapperRef = (0, import_react24.useRef)(null);
|
|
2664
|
+
const imgRef = (0, import_react24.useRef)(null);
|
|
2665
|
+
const [resizingStyle, setResizingStyle] = (0, import_react24.useState)();
|
|
2440
2666
|
const handleMouseDown = useEvent(
|
|
2441
2667
|
(event) => {
|
|
2442
2668
|
const imageParent = document.querySelector(
|
|
@@ -2479,7 +2705,7 @@ function ImageView(props) {
|
|
|
2479
2705
|
}
|
|
2480
2706
|
);
|
|
2481
2707
|
function dragCornerButton(direction) {
|
|
2482
|
-
return /* @__PURE__ */ (0,
|
|
2708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2483
2709
|
"div",
|
|
2484
2710
|
{
|
|
2485
2711
|
role: "button",
|
|
@@ -2498,9 +2724,19 @@ function ImageView(props) {
|
|
|
2498
2724
|
);
|
|
2499
2725
|
}
|
|
2500
2726
|
let { alignment = "center", width, height, src } = node.attrs || {};
|
|
2501
|
-
const _a = node.attrs || {}, {
|
|
2727
|
+
const _a = node.attrs || {}, {
|
|
2728
|
+
externalLink,
|
|
2729
|
+
isExternalLinkVariable,
|
|
2730
|
+
isSrcVariable,
|
|
2731
|
+
showIfKey
|
|
2732
|
+
} = _a, attrs = __objRest(_a, [
|
|
2733
|
+
"externalLink",
|
|
2734
|
+
"isExternalLinkVariable",
|
|
2735
|
+
"isSrcVariable",
|
|
2736
|
+
"showIfKey"
|
|
2737
|
+
]);
|
|
2502
2738
|
const hasImageSrc = !!attrs.src;
|
|
2503
|
-
(0,
|
|
2739
|
+
(0, import_react24.useEffect)(() => {
|
|
2504
2740
|
if (!src) {
|
|
2505
2741
|
return;
|
|
2506
2742
|
}
|
|
@@ -2534,8 +2770,8 @@ function ImageView(props) {
|
|
|
2534
2770
|
img.onerror = null;
|
|
2535
2771
|
};
|
|
2536
2772
|
}, [src]);
|
|
2537
|
-
return /* @__PURE__ */ (0,
|
|
2538
|
-
|
|
2773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2774
|
+
import_react23.NodeViewWrapper,
|
|
2539
2775
|
{
|
|
2540
2776
|
as: "div",
|
|
2541
2777
|
draggable: true,
|
|
@@ -2556,11 +2792,12 @@ function ImageView(props) {
|
|
|
2556
2792
|
}[alignment] || {}),
|
|
2557
2793
|
ref: wrapperRef,
|
|
2558
2794
|
children: [
|
|
2559
|
-
!hasImageSrc && /* @__PURE__ */ (0,
|
|
2560
|
-
hasImageSrc &&
|
|
2561
|
-
hasImageSrc && status === "
|
|
2562
|
-
hasImageSrc && status === "
|
|
2563
|
-
|
|
2795
|
+
!hasImageSrc && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageStatusLabel, { status: "idle" }),
|
|
2796
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageStatusLabel, { status: "variable" }),
|
|
2797
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageStatusLabel, { status: "loading" }),
|
|
2798
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageStatusLabel, { status: "error" }),
|
|
2799
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2564
2801
|
"img",
|
|
2565
2802
|
__spreadProps(__spreadValues({}, attrs), {
|
|
2566
2803
|
ref: imgRef,
|
|
@@ -2570,13 +2807,13 @@ function ImageView(props) {
|
|
|
2570
2807
|
})
|
|
2571
2808
|
})
|
|
2572
2809
|
),
|
|
2573
|
-
selected && /* @__PURE__ */ (0,
|
|
2810
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2574
2811
|
[
|
|
2575
2812
|
{ left: 0, top: 0, height: "100%", width: "1px" },
|
|
2576
2813
|
{ right: 0, top: 0, height: "100%", width: "1px" },
|
|
2577
2814
|
{ top: 0, left: 0, width: "100%", height: "1px" },
|
|
2578
2815
|
{ bottom: 0, left: 0, width: "100%", height: "1px" }
|
|
2579
|
-
].map((style, i) => /* @__PURE__ */ (0,
|
|
2816
|
+
].map((style, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2580
2817
|
"div",
|
|
2581
2818
|
{
|
|
2582
2819
|
className: "mly-bg-rose-500",
|
|
@@ -2598,7 +2835,7 @@ function ImageView(props) {
|
|
|
2598
2835
|
}
|
|
2599
2836
|
function ImageStatusLabel(props) {
|
|
2600
2837
|
const { status } = props;
|
|
2601
|
-
return /* @__PURE__ */ (0,
|
|
2838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2602
2839
|
"div",
|
|
2603
2840
|
{
|
|
2604
2841
|
className: cn(
|
|
@@ -2609,17 +2846,21 @@ function ImageStatusLabel(props) {
|
|
|
2609
2846
|
}
|
|
2610
2847
|
),
|
|
2611
2848
|
children: [
|
|
2612
|
-
status === "idle" && /* @__PURE__ */ (0,
|
|
2613
|
-
/* @__PURE__ */ (0,
|
|
2614
|
-
/* @__PURE__ */ (0,
|
|
2849
|
+
status === "idle" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react19.ImageOffIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "No image selected" })
|
|
2615
2852
|
] }),
|
|
2616
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
2617
|
-
/* @__PURE__ */ (0,
|
|
2618
|
-
/* @__PURE__ */ (0,
|
|
2853
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react19.Loader2, { className: "mly-size-4 mly-animate-spin mly-stroke-[2.5]" }),
|
|
2855
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Loading image..." })
|
|
2619
2856
|
] }),
|
|
2620
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2621
|
-
/* @__PURE__ */ (0,
|
|
2622
|
-
/* @__PURE__ */ (0,
|
|
2857
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2858
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react19.Ban, { className: "mly-size-4 mly-stroke-[2.5]" }),
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Error loading image" })
|
|
2860
|
+
] }),
|
|
2861
|
+
status === "variable" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react19.BracesIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Variable Image URL" })
|
|
2623
2864
|
] })
|
|
2624
2865
|
]
|
|
2625
2866
|
}
|
|
@@ -2627,17 +2868,18 @@ function ImageStatusLabel(props) {
|
|
|
2627
2868
|
}
|
|
2628
2869
|
|
|
2629
2870
|
// src/editor/nodes/logo/logo-view.tsx
|
|
2630
|
-
var
|
|
2871
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2631
2872
|
function LogoView(props) {
|
|
2632
2873
|
const { node } = props;
|
|
2633
|
-
const [status, setStatus] = (0,
|
|
2874
|
+
const [status, setStatus] = (0, import_react27.useState)("idle");
|
|
2634
2875
|
let {
|
|
2635
2876
|
alignment = "center",
|
|
2636
2877
|
src: logoSrc,
|
|
2878
|
+
isSrcVariable,
|
|
2637
2879
|
size = "sm"
|
|
2638
2880
|
} = node.attrs || {};
|
|
2639
2881
|
const hasImageSrc = !!logoSrc;
|
|
2640
|
-
(0,
|
|
2882
|
+
(0, import_react26.useEffect)(() => {
|
|
2641
2883
|
if (!logoSrc) {
|
|
2642
2884
|
return;
|
|
2643
2885
|
}
|
|
@@ -2657,8 +2899,8 @@ function LogoView(props) {
|
|
|
2657
2899
|
};
|
|
2658
2900
|
}, [logoSrc]);
|
|
2659
2901
|
const logoSize = logoSizes[size];
|
|
2660
|
-
return /* @__PURE__ */ (0,
|
|
2661
|
-
|
|
2902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2903
|
+
import_react25.NodeViewWrapper,
|
|
2662
2904
|
{
|
|
2663
2905
|
as: "div",
|
|
2664
2906
|
draggable: true,
|
|
@@ -2671,10 +2913,11 @@ function LogoView(props) {
|
|
|
2671
2913
|
display: "block"
|
|
2672
2914
|
},
|
|
2673
2915
|
children: [
|
|
2674
|
-
!hasImageSrc && /* @__PURE__ */ (0,
|
|
2675
|
-
hasImageSrc &&
|
|
2676
|
-
hasImageSrc && status === "
|
|
2677
|
-
hasImageSrc && status === "
|
|
2916
|
+
!hasImageSrc && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageStatusLabel, { status: "idle" }),
|
|
2917
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageStatusLabel, { status: "variable" }),
|
|
2918
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageStatusLabel, { status: "loading" }),
|
|
2919
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageStatusLabel, { status: "error" }),
|
|
2920
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2678
2921
|
"img",
|
|
2679
2922
|
{
|
|
2680
2923
|
src: logoSrc,
|
|
@@ -2751,6 +2994,23 @@ var LogoExtension = import_extension_image.default.extend({
|
|
|
2751
2994
|
"data-show-if-key": attributes.showIfKey
|
|
2752
2995
|
};
|
|
2753
2996
|
}
|
|
2997
|
+
},
|
|
2998
|
+
// Later we will remove this attribute
|
|
2999
|
+
// and use the `src` attribute instead when implement
|
|
3000
|
+
// the URL variable feature
|
|
3001
|
+
isSrcVariable: {
|
|
3002
|
+
default: false,
|
|
3003
|
+
parseHTML: (element) => {
|
|
3004
|
+
return element.getAttribute("data-is-src-variable") === "true";
|
|
3005
|
+
},
|
|
3006
|
+
renderHTML: (attributes) => {
|
|
3007
|
+
if (!attributes.isSrcVariable) {
|
|
3008
|
+
return {};
|
|
3009
|
+
}
|
|
3010
|
+
return {
|
|
3011
|
+
"data-is-src-variable": "true"
|
|
3012
|
+
};
|
|
3013
|
+
}
|
|
2754
3014
|
}
|
|
2755
3015
|
});
|
|
2756
3016
|
},
|
|
@@ -2775,30 +3035,32 @@ var LogoExtension = import_extension_image.default.extend({
|
|
|
2775
3035
|
];
|
|
2776
3036
|
},
|
|
2777
3037
|
addNodeView() {
|
|
2778
|
-
return (0,
|
|
3038
|
+
return (0, import_react28.ReactNodeViewRenderer)(LogoView, {
|
|
2779
3039
|
className: "mly-relative"
|
|
2780
3040
|
});
|
|
2781
3041
|
}
|
|
2782
3042
|
});
|
|
2783
3043
|
|
|
2784
3044
|
// src/editor/components/image-menu/use-image-state.tsx
|
|
2785
|
-
var
|
|
3045
|
+
var import_react29 = require("@tiptap/react");
|
|
2786
3046
|
var import_fast_deep_equal3 = __toESM(require("fast-deep-equal"));
|
|
2787
3047
|
var useImageState = (editor) => {
|
|
2788
|
-
const states = (0,
|
|
3048
|
+
const states = (0, import_react29.useEditorState)({
|
|
2789
3049
|
editor,
|
|
2790
|
-
selector: (
|
|
2791
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3050
|
+
selector: ({ editor: editor2 }) => {
|
|
3051
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2792
3052
|
return {
|
|
2793
|
-
width:
|
|
2794
|
-
height:
|
|
2795
|
-
isImageActive:
|
|
2796
|
-
isLogoActive:
|
|
2797
|
-
alignment: ((_a =
|
|
2798
|
-
logoSize: ((_c =
|
|
2799
|
-
imageSrc: ((_d =
|
|
2800
|
-
|
|
2801
|
-
|
|
3053
|
+
width: editor2.getAttributes("image").width,
|
|
3054
|
+
height: editor2.getAttributes("image").height,
|
|
3055
|
+
isImageActive: editor2.isActive("image"),
|
|
3056
|
+
isLogoActive: editor2.isActive("logo"),
|
|
3057
|
+
alignment: ((_a = editor2.getAttributes("image")) == null ? void 0 : _a.alignment) || ((_b = editor2.getAttributes("logo")) == null ? void 0 : _b.alignment),
|
|
3058
|
+
logoSize: ((_c = editor2.getAttributes("logo")) == null ? void 0 : _c.size) || DEFAULT_LOGO_SIZE,
|
|
3059
|
+
imageSrc: ((_d = editor2.getAttributes("image")) == null ? void 0 : _d.src) || ((_e = editor2.getAttributes("logo")) == null ? void 0 : _e.src) || "",
|
|
3060
|
+
isSrcVariable: (_i = (_h = (_f = editor2.getAttributes("image")) == null ? void 0 : _f.isSrcVariable) != null ? _h : (_g = editor2.getAttributes("logo")) == null ? void 0 : _g.isSrcVariable) != null ? _i : false,
|
|
3061
|
+
imageExternalLink: ((_j = editor2.getAttributes("image")) == null ? void 0 : _j.externalLink) || "",
|
|
3062
|
+
isExternalLinkVariable: (_k = editor2.getAttributes("image")) == null ? void 0 : _k.isExternalLinkVariable,
|
|
3063
|
+
currentShowIfKey: ((_l = editor2.getAttributes("image")) == null ? void 0 : _l.showIfKey) || ((_m = editor2.getAttributes("logo")) == null ? void 0 : _m.showIfKey) || ""
|
|
2802
3064
|
};
|
|
2803
3065
|
},
|
|
2804
3066
|
equalityFn: import_fast_deep_equal3.default
|
|
@@ -2808,7 +3070,7 @@ var useImageState = (editor) => {
|
|
|
2808
3070
|
|
|
2809
3071
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
2810
3072
|
var import_tippy3 = require("tippy.js");
|
|
2811
|
-
var
|
|
3073
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2812
3074
|
function ImageBubbleMenu(props) {
|
|
2813
3075
|
var _a, _b, _c, _d;
|
|
2814
3076
|
const { editor, appendTo } = props;
|
|
@@ -2829,13 +3091,13 @@ function ImageBubbleMenu(props) {
|
|
|
2829
3091
|
maxWidth: "100%"
|
|
2830
3092
|
}
|
|
2831
3093
|
});
|
|
2832
|
-
return /* @__PURE__ */ (0,
|
|
2833
|
-
|
|
3094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3095
|
+
import_react30.BubbleMenu,
|
|
2834
3096
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
2835
3097
|
className: "mly-flex mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
2836
|
-
children: /* @__PURE__ */ (0,
|
|
2837
|
-
state.isLogoActive && state.imageSrc && /* @__PURE__ */ (0,
|
|
2838
|
-
/* @__PURE__ */ (0,
|
|
3098
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(TooltipProvider, { children: [
|
|
3099
|
+
state.isLogoActive && state.imageSrc && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2839
3101
|
Select,
|
|
2840
3102
|
{
|
|
2841
3103
|
label: "Size",
|
|
@@ -2850,10 +3112,10 @@ function ImageBubbleMenu(props) {
|
|
|
2850
3112
|
}
|
|
2851
3113
|
}
|
|
2852
3114
|
),
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Divider, {})
|
|
2854
3116
|
] }),
|
|
2855
|
-
/* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
3117
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2857
3119
|
AlignmentSwitch,
|
|
2858
3120
|
{
|
|
2859
3121
|
alignment: state.alignment,
|
|
@@ -2867,36 +3129,49 @@ function ImageBubbleMenu(props) {
|
|
|
2867
3129
|
}
|
|
2868
3130
|
}
|
|
2869
3131
|
),
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
3132
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2871
3133
|
LinkInputPopover,
|
|
2872
3134
|
{
|
|
2873
3135
|
defaultValue: (_a = state == null ? void 0 : state.imageSrc) != null ? _a : "",
|
|
2874
|
-
onValueChange: (value) => {
|
|
3136
|
+
onValueChange: (value, isVariable) => {
|
|
2875
3137
|
if (state.isLogoActive) {
|
|
2876
|
-
editor == null ? void 0 : editor.chain().setLogoAttributes({
|
|
3138
|
+
editor == null ? void 0 : editor.chain().setLogoAttributes({
|
|
3139
|
+
src: value,
|
|
3140
|
+
isSrcVariable: isVariable != null ? isVariable : false
|
|
3141
|
+
}).run();
|
|
2877
3142
|
} else {
|
|
2878
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
3143
|
+
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
3144
|
+
src: value,
|
|
3145
|
+
isSrcVariable: isVariable != null ? isVariable : false
|
|
3146
|
+
}).run();
|
|
2879
3147
|
}
|
|
2880
3148
|
},
|
|
2881
3149
|
tooltip: "Source URL",
|
|
2882
|
-
icon:
|
|
3150
|
+
icon: import_lucide_react20.ImageDown,
|
|
3151
|
+
editor,
|
|
3152
|
+
isVariable: state.isSrcVariable
|
|
2883
3153
|
}
|
|
2884
3154
|
),
|
|
2885
|
-
state.isImageActive && /* @__PURE__ */ (0,
|
|
3155
|
+
state.isImageActive && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2886
3156
|
LinkInputPopover,
|
|
2887
3157
|
{
|
|
2888
3158
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
2889
|
-
onValueChange: (value) => {
|
|
2890
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
3159
|
+
onValueChange: (value, isVariable) => {
|
|
3160
|
+
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
3161
|
+
externalLink: value,
|
|
3162
|
+
isExternalLinkVariable: isVariable != null ? isVariable : false
|
|
3163
|
+
}).run();
|
|
2891
3164
|
},
|
|
2892
|
-
tooltip: "External URL"
|
|
3165
|
+
tooltip: "External URL",
|
|
3166
|
+
editor,
|
|
3167
|
+
isVariable: state.isExternalLinkVariable
|
|
2893
3168
|
}
|
|
2894
3169
|
)
|
|
2895
3170
|
] }),
|
|
2896
|
-
state.isImageActive && state.imageSrc && /* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
3171
|
+
state.isImageActive && state.imageSrc && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Divider, {}),
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2900
3175
|
ImageSize,
|
|
2901
3176
|
{
|
|
2902
3177
|
dimension: "width",
|
|
@@ -2906,7 +3181,7 @@ function ImageBubbleMenu(props) {
|
|
|
2906
3181
|
}
|
|
2907
3182
|
}
|
|
2908
3183
|
),
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2910
3185
|
ImageSize,
|
|
2911
3186
|
{
|
|
2912
3187
|
dimension: "height",
|
|
@@ -2918,8 +3193,8 @@ function ImageBubbleMenu(props) {
|
|
|
2918
3193
|
)
|
|
2919
3194
|
] })
|
|
2920
3195
|
] }),
|
|
2921
|
-
/* @__PURE__ */ (0,
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
3196
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Divider, {}),
|
|
3197
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2923
3198
|
ShowPopover,
|
|
2924
3199
|
{
|
|
2925
3200
|
showIfKey: state.currentShowIfKey,
|
|
@@ -2937,16 +3212,16 @@ function ImageBubbleMenu(props) {
|
|
|
2937
3212
|
}
|
|
2938
3213
|
|
|
2939
3214
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
2940
|
-
var
|
|
2941
|
-
var
|
|
2942
|
-
var
|
|
3215
|
+
var import_react32 = require("@tiptap/react");
|
|
3216
|
+
var import_lucide_react21 = require("lucide-react");
|
|
3217
|
+
var import_react33 = require("react");
|
|
2943
3218
|
var import_tippy4 = require("tippy.js");
|
|
2944
3219
|
|
|
2945
3220
|
// src/editor/components/icons/border-color.tsx
|
|
2946
|
-
var
|
|
3221
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2947
3222
|
function BorderColor(props) {
|
|
2948
3223
|
const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
|
|
2949
|
-
return /* @__PURE__ */ (0,
|
|
3224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2950
3225
|
"svg",
|
|
2951
3226
|
__spreadProps(__spreadValues({
|
|
2952
3227
|
width: 11,
|
|
@@ -2956,8 +3231,8 @@ function BorderColor(props) {
|
|
|
2956
3231
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2957
3232
|
}, rest), {
|
|
2958
3233
|
children: [
|
|
2959
|
-
/* @__PURE__ */ (0,
|
|
2960
|
-
/* @__PURE__ */ (0,
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2961
3236
|
"path",
|
|
2962
3237
|
{
|
|
2963
3238
|
d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
|
|
@@ -2971,9 +3246,9 @@ function BorderColor(props) {
|
|
|
2971
3246
|
}
|
|
2972
3247
|
|
|
2973
3248
|
// src/editor/components/icons/margin-icon.tsx
|
|
2974
|
-
var
|
|
3249
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2975
3250
|
function MarginIcon(props) {
|
|
2976
|
-
return /* @__PURE__ */ (0,
|
|
3251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2977
3252
|
"svg",
|
|
2978
3253
|
__spreadProps(__spreadValues({
|
|
2979
3254
|
width: 12,
|
|
@@ -2982,7 +3257,7 @@ function MarginIcon(props) {
|
|
|
2982
3257
|
fill: "none",
|
|
2983
3258
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2984
3259
|
}, props), {
|
|
2985
|
-
children: /* @__PURE__ */ (0,
|
|
3260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2986
3261
|
"path",
|
|
2987
3262
|
{
|
|
2988
3263
|
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",
|
|
@@ -2996,9 +3271,9 @@ function MarginIcon(props) {
|
|
|
2996
3271
|
}
|
|
2997
3272
|
|
|
2998
3273
|
// src/editor/components/icons/padding-icon.tsx
|
|
2999
|
-
var
|
|
3274
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3000
3275
|
function PaddingIcon(props) {
|
|
3001
|
-
return /* @__PURE__ */ (0,
|
|
3276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3002
3277
|
"svg",
|
|
3003
3278
|
__spreadProps(__spreadValues({
|
|
3004
3279
|
width: 10,
|
|
@@ -3007,7 +3282,7 @@ function PaddingIcon(props) {
|
|
|
3007
3282
|
fill: "none",
|
|
3008
3283
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3009
3284
|
}, props), {
|
|
3010
|
-
children: /* @__PURE__ */ (0,
|
|
3285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3011
3286
|
"path",
|
|
3012
3287
|
{
|
|
3013
3288
|
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",
|
|
@@ -3022,7 +3297,7 @@ function PaddingIcon(props) {
|
|
|
3022
3297
|
|
|
3023
3298
|
// src/editor/components/ui/color-picker.tsx
|
|
3024
3299
|
var import_react_colorful = require("react-colorful");
|
|
3025
|
-
var
|
|
3300
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3026
3301
|
function ColorPicker(props) {
|
|
3027
3302
|
const {
|
|
3028
3303
|
color,
|
|
@@ -3038,14 +3313,14 @@ function ColorPicker(props) {
|
|
|
3038
3313
|
onColorChange(color2);
|
|
3039
3314
|
});
|
|
3040
3315
|
};
|
|
3041
|
-
const popoverButton = /* @__PURE__ */ (0,
|
|
3316
|
+
const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3042
3317
|
BaseButton,
|
|
3043
3318
|
{
|
|
3044
3319
|
variant: "ghost",
|
|
3045
3320
|
className: "!mly-size-7 mly-shrink-0",
|
|
3046
3321
|
size: "sm",
|
|
3047
3322
|
type: "button",
|
|
3048
|
-
children: /* @__PURE__ */ (0,
|
|
3323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3049
3324
|
"div",
|
|
3050
3325
|
{
|
|
3051
3326
|
className: cn(
|
|
@@ -3059,18 +3334,18 @@ function ColorPicker(props) {
|
|
|
3059
3334
|
)
|
|
3060
3335
|
}
|
|
3061
3336
|
) });
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3063
|
-
tooltip ? /* @__PURE__ */ (0,
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Popover, { children: [
|
|
3338
|
+
tooltip ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tooltip, { children: [
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
3340
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
3066
3341
|
] }) : popoverButton,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3342
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3068
3343
|
PopoverContent,
|
|
3069
3344
|
{
|
|
3070
3345
|
className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
|
|
3071
3346
|
sideOffset: 8,
|
|
3072
|
-
children: /* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3074
3349
|
import_react_colorful.HexColorPicker,
|
|
3075
3350
|
{
|
|
3076
3351
|
color,
|
|
@@ -3078,7 +3353,7 @@ function ColorPicker(props) {
|
|
|
3078
3353
|
className: "mly-flex !mly-w-full mly-flex-col mly-gap-4"
|
|
3079
3354
|
}
|
|
3080
3355
|
),
|
|
3081
|
-
/* @__PURE__ */ (0,
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3082
3357
|
import_react_colorful.HexColorInput,
|
|
3083
3358
|
{
|
|
3084
3359
|
alpha: true,
|
|
@@ -3095,10 +3370,10 @@ function ColorPicker(props) {
|
|
|
3095
3370
|
}
|
|
3096
3371
|
|
|
3097
3372
|
// src/editor/components/section-menu/use-section-state.tsx
|
|
3098
|
-
var
|
|
3373
|
+
var import_react31 = require("@tiptap/react");
|
|
3099
3374
|
var import_fast_deep_equal4 = __toESM(require("fast-deep-equal"));
|
|
3100
3375
|
var useSectionState = (editor) => {
|
|
3101
|
-
const states = (0,
|
|
3376
|
+
const states = (0, import_react31.useEditorState)({
|
|
3102
3377
|
editor,
|
|
3103
3378
|
selector: (ctx) => {
|
|
3104
3379
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
@@ -3126,13 +3401,13 @@ var useSectionState = (editor) => {
|
|
|
3126
3401
|
};
|
|
3127
3402
|
|
|
3128
3403
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
3129
|
-
var
|
|
3404
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3130
3405
|
function SectionBubbleMenu(props) {
|
|
3131
3406
|
const { appendTo, editor } = props;
|
|
3132
3407
|
if (!editor) {
|
|
3133
3408
|
return null;
|
|
3134
3409
|
}
|
|
3135
|
-
const getReferenceClientRect = (0,
|
|
3410
|
+
const getReferenceClientRect = (0, import_react33.useCallback)(() => {
|
|
3136
3411
|
const renderContainer = getRenderContainer(editor, "section");
|
|
3137
3412
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
3138
3413
|
return rect;
|
|
@@ -3141,7 +3416,7 @@ function SectionBubbleMenu(props) {
|
|
|
3141
3416
|
shouldShow: ({ editor: editor2 }) => {
|
|
3142
3417
|
var _a;
|
|
3143
3418
|
const activeSectionNode = getClosestNodeByName(editor2, "section");
|
|
3144
|
-
const forNodeChildren = activeSectionNode ? (_a = (0,
|
|
3419
|
+
const forNodeChildren = activeSectionNode ? (_a = (0, import_react32.findChildren)(activeSectionNode == null ? void 0 : activeSectionNode.node, (node) => {
|
|
3145
3420
|
return node.type.name === "for";
|
|
3146
3421
|
})) == null ? void 0 : _a[0] : null;
|
|
3147
3422
|
const hasActiveForNodeChildren = forNodeChildren && editor2.isActive("for");
|
|
@@ -3169,12 +3444,12 @@ function SectionBubbleMenu(props) {
|
|
|
3169
3444
|
{ value: "6", label: "Smooth" },
|
|
3170
3445
|
{ value: "9999", label: "Round" }
|
|
3171
3446
|
];
|
|
3172
|
-
return /* @__PURE__ */ (0,
|
|
3173
|
-
|
|
3447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3448
|
+
import_react32.BubbleMenu,
|
|
3174
3449
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
3175
3450
|
className: "mly-flex mly-items-stretch mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
3176
|
-
children: /* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(TooltipProvider, { children: [
|
|
3452
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3178
3453
|
AlignmentSwitch,
|
|
3179
3454
|
{
|
|
3180
3455
|
alignment: state.currentAlignment,
|
|
@@ -3186,9 +3461,9 @@ function SectionBubbleMenu(props) {
|
|
|
3186
3461
|
}
|
|
3187
3462
|
}
|
|
3188
3463
|
),
|
|
3189
|
-
/* @__PURE__ */ (0,
|
|
3190
|
-
/* @__PURE__ */ (0,
|
|
3191
|
-
/* @__PURE__ */ (0,
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3192
3467
|
Select,
|
|
3193
3468
|
{
|
|
3194
3469
|
label: "Border Radius",
|
|
@@ -3204,7 +3479,7 @@ function SectionBubbleMenu(props) {
|
|
|
3204
3479
|
className: "mly-capitalize"
|
|
3205
3480
|
}
|
|
3206
3481
|
),
|
|
3207
|
-
/* @__PURE__ */ (0,
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3208
3483
|
Select,
|
|
3209
3484
|
{
|
|
3210
3485
|
label: "Border Width",
|
|
@@ -3226,8 +3501,8 @@ function SectionBubbleMenu(props) {
|
|
|
3226
3501
|
}
|
|
3227
3502
|
)
|
|
3228
3503
|
] }),
|
|
3229
|
-
/* @__PURE__ */ (0,
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3504
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3505
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3231
3506
|
Select,
|
|
3232
3507
|
{
|
|
3233
3508
|
icon: MarginIcon,
|
|
@@ -3254,8 +3529,8 @@ function SectionBubbleMenu(props) {
|
|
|
3254
3529
|
className: "mly-capitalize"
|
|
3255
3530
|
}
|
|
3256
3531
|
),
|
|
3257
|
-
/* @__PURE__ */ (0,
|
|
3258
|
-
/* @__PURE__ */ (0,
|
|
3532
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3533
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3259
3534
|
Select,
|
|
3260
3535
|
{
|
|
3261
3536
|
icon: PaddingIcon,
|
|
@@ -3282,9 +3557,9 @@ function SectionBubbleMenu(props) {
|
|
|
3282
3557
|
className: "mly-capitalize"
|
|
3283
3558
|
}
|
|
3284
3559
|
),
|
|
3285
|
-
/* @__PURE__ */ (0,
|
|
3286
|
-
/* @__PURE__ */ (0,
|
|
3287
|
-
/* @__PURE__ */ (0,
|
|
3560
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
3562
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3288
3563
|
ColorPicker,
|
|
3289
3564
|
{
|
|
3290
3565
|
color: state.currentBorderColor,
|
|
@@ -3295,14 +3570,14 @@ function SectionBubbleMenu(props) {
|
|
|
3295
3570
|
});
|
|
3296
3571
|
},
|
|
3297
3572
|
tooltip: "Border Color",
|
|
3298
|
-
children: /* @__PURE__ */ (0,
|
|
3573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3299
3574
|
BaseButton,
|
|
3300
3575
|
{
|
|
3301
3576
|
variant: "ghost",
|
|
3302
3577
|
className: "!mly-size-7 mly-shrink-0",
|
|
3303
3578
|
size: "sm",
|
|
3304
3579
|
type: "button",
|
|
3305
|
-
children: /* @__PURE__ */ (0,
|
|
3580
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3306
3581
|
BorderColor,
|
|
3307
3582
|
{
|
|
3308
3583
|
className: "mly-size-3 mly-shrink-0",
|
|
@@ -3316,7 +3591,7 @@ function SectionBubbleMenu(props) {
|
|
|
3316
3591
|
)
|
|
3317
3592
|
}
|
|
3318
3593
|
),
|
|
3319
|
-
/* @__PURE__ */ (0,
|
|
3594
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3320
3595
|
ColorPicker,
|
|
3321
3596
|
{
|
|
3322
3597
|
color: state.currentBackgroundColor,
|
|
@@ -3332,19 +3607,19 @@ function SectionBubbleMenu(props) {
|
|
|
3332
3607
|
}
|
|
3333
3608
|
)
|
|
3334
3609
|
] }),
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3610
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3611
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3337
3612
|
BubbleMenuButton,
|
|
3338
3613
|
{
|
|
3339
|
-
icon:
|
|
3614
|
+
icon: import_lucide_react21.Trash,
|
|
3340
3615
|
tooltip: "Delete Section",
|
|
3341
3616
|
command: () => {
|
|
3342
3617
|
deleteNode(editor, "section");
|
|
3343
3618
|
}
|
|
3344
3619
|
}
|
|
3345
3620
|
),
|
|
3346
|
-
/* @__PURE__ */ (0,
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3348
3623
|
ShowPopover,
|
|
3349
3624
|
{
|
|
3350
3625
|
showIfKey: state.currentShowIfKey,
|
|
@@ -3356,14 +3631,14 @@ function SectionBubbleMenu(props) {
|
|
|
3356
3631
|
editor
|
|
3357
3632
|
}
|
|
3358
3633
|
),
|
|
3359
|
-
state.isColumnsActive && /* @__PURE__ */ (0,
|
|
3360
|
-
/* @__PURE__ */ (0,
|
|
3361
|
-
/* @__PURE__ */ (0,
|
|
3362
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
state.isColumnsActive && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3635
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
3636
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Popover, { children: [
|
|
3637
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(PopoverTrigger, { className: "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray", children: [
|
|
3363
3638
|
"Column",
|
|
3364
|
-
/* @__PURE__ */ (0,
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react21.ChevronUp, { className: "mly-h-3 mly-w-3" })
|
|
3365
3640
|
] }),
|
|
3366
|
-
/* @__PURE__ */ (0,
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3367
3642
|
PopoverContent,
|
|
3368
3643
|
{
|
|
3369
3644
|
className: "mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
@@ -3376,7 +3651,7 @@ function SectionBubbleMenu(props) {
|
|
|
3376
3651
|
onCloseAutoFocus: (e) => {
|
|
3377
3652
|
e.preventDefault();
|
|
3378
3653
|
},
|
|
3379
|
-
children: /* @__PURE__ */ (0,
|
|
3654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ColumnsBubbleMenuContent, { editor })
|
|
3380
3655
|
}
|
|
3381
3656
|
)
|
|
3382
3657
|
] })
|
|
@@ -3387,7 +3662,7 @@ function SectionBubbleMenu(props) {
|
|
|
3387
3662
|
}
|
|
3388
3663
|
|
|
3389
3664
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
3390
|
-
var
|
|
3665
|
+
var import_react35 = require("@tiptap/react");
|
|
3391
3666
|
|
|
3392
3667
|
// src/editor/nodes/spacer.ts
|
|
3393
3668
|
var import_core6 = require("@tiptap/core");
|
|
@@ -3477,10 +3752,10 @@ var Spacer = import_core6.Node.create({
|
|
|
3477
3752
|
});
|
|
3478
3753
|
|
|
3479
3754
|
// src/editor/components/spacer-menu/use-spacer-state.ts
|
|
3480
|
-
var
|
|
3755
|
+
var import_react34 = require("@tiptap/react");
|
|
3481
3756
|
var import_fast_deep_equal5 = __toESM(require("fast-deep-equal"));
|
|
3482
3757
|
var useSpacerState = (editor) => {
|
|
3483
|
-
const states = (0,
|
|
3758
|
+
const states = (0, import_react34.useEditorState)({
|
|
3484
3759
|
editor,
|
|
3485
3760
|
selector: (ctx) => {
|
|
3486
3761
|
var _a;
|
|
@@ -3494,7 +3769,7 @@ var useSpacerState = (editor) => {
|
|
|
3494
3769
|
};
|
|
3495
3770
|
|
|
3496
3771
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
3497
|
-
var
|
|
3772
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3498
3773
|
function SpacerBubbleMenu(props) {
|
|
3499
3774
|
const { editor, appendTo } = props;
|
|
3500
3775
|
if (!editor) {
|
|
@@ -3515,12 +3790,12 @@ function SpacerBubbleMenu(props) {
|
|
|
3515
3790
|
}
|
|
3516
3791
|
});
|
|
3517
3792
|
const state = useSpacerState(editor);
|
|
3518
|
-
return /* @__PURE__ */ (0,
|
|
3519
|
-
|
|
3793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3794
|
+
import_react35.BubbleMenu,
|
|
3520
3795
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
3521
3796
|
className: "mly-flex mly-gap-0.5 mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
3522
3797
|
children: [
|
|
3523
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
3798
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3524
3799
|
BubbleMenuButton,
|
|
3525
3800
|
__spreadValues({
|
|
3526
3801
|
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
@@ -3529,8 +3804,8 @@ function SpacerBubbleMenu(props) {
|
|
|
3529
3804
|
}, item),
|
|
3530
3805
|
index
|
|
3531
3806
|
)),
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3807
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Divider, {}),
|
|
3808
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3534
3809
|
ShowPopover,
|
|
3535
3810
|
{
|
|
3536
3811
|
showIfKey: state.currentShowIfKey,
|
|
@@ -3546,23 +3821,24 @@ function SpacerBubbleMenu(props) {
|
|
|
3546
3821
|
}
|
|
3547
3822
|
|
|
3548
3823
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
3549
|
-
var
|
|
3550
|
-
var
|
|
3824
|
+
var import_react48 = require("@tiptap/react");
|
|
3825
|
+
var import_lucide_react24 = require("lucide-react");
|
|
3551
3826
|
|
|
3552
3827
|
// src/editor/components/text-menu/use-text-menu-state.tsx
|
|
3553
|
-
var
|
|
3828
|
+
var import_react36 = require("@tiptap/react");
|
|
3554
3829
|
var import_fast_deep_equal6 = __toESM(require("fast-deep-equal"));
|
|
3555
3830
|
var DEFAULT_TEXT_COLOR = "#374151";
|
|
3556
3831
|
var useTextMenuState = (editor) => {
|
|
3557
|
-
const states = (0,
|
|
3832
|
+
const states = (0, import_react36.useEditorState)({
|
|
3558
3833
|
editor,
|
|
3559
3834
|
selector: (ctx) => {
|
|
3560
|
-
var _a, _b, _c, _d, _e;
|
|
3835
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3561
3836
|
return {
|
|
3562
3837
|
currentTextColor: ctx.editor.getAttributes("textStyle").color || DEFAULT_TEXT_COLOR,
|
|
3563
3838
|
linkUrl: (_a = ctx.editor) == null ? void 0 : _a.getAttributes("link").href,
|
|
3564
3839
|
textAlign: ((_b = ctx.editor) == null ? void 0 : _b.isActive({ textAlign: "left" })) ? "left" : ((_c = ctx.editor) == null ? void 0 : _c.isActive({ textAlign: "center" })) ? "center" : ((_d = ctx.editor) == null ? void 0 : _d.isActive({ textAlign: "right" })) ? "right" : ((_e = ctx.editor) == null ? void 0 : _e.isActive({ textAlign: "justify" })) ? "justify" : "left",
|
|
3565
|
-
isListActive: ctx.editor.isActive("bulletList") || ctx.editor.isActive("orderedList")
|
|
3840
|
+
isListActive: ctx.editor.isActive("bulletList") || ctx.editor.isActive("orderedList"),
|
|
3841
|
+
isUrlVariable: (_f = ctx.editor.getAttributes("link").isUrlVariable) != null ? _f : false
|
|
3566
3842
|
};
|
|
3567
3843
|
},
|
|
3568
3844
|
equalityFn: import_fast_deep_equal6.default
|
|
@@ -3605,18 +3881,18 @@ var import_extension_image3 = __toESM(require("@tiptap/extension-image"));
|
|
|
3605
3881
|
|
|
3606
3882
|
// src/editor/extensions/link-card.ts
|
|
3607
3883
|
var import_core8 = require("@tiptap/core");
|
|
3608
|
-
var
|
|
3884
|
+
var import_react38 = require("@tiptap/react");
|
|
3609
3885
|
|
|
3610
3886
|
// src/editor/nodes/link-card.tsx
|
|
3611
|
-
var
|
|
3887
|
+
var import_react37 = require("@tiptap/react");
|
|
3612
3888
|
|
|
3613
3889
|
// src/editor/components/input.tsx
|
|
3614
3890
|
var React5 = __toESM(require("react"));
|
|
3615
|
-
var
|
|
3891
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3616
3892
|
var Input = React5.forwardRef(
|
|
3617
3893
|
(_a, ref) => {
|
|
3618
3894
|
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
3619
|
-
return /* @__PURE__ */ (0,
|
|
3895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3620
3896
|
"input",
|
|
3621
3897
|
__spreadValues({
|
|
3622
3898
|
type,
|
|
@@ -3634,11 +3910,11 @@ Input.displayName = "Input";
|
|
|
3634
3910
|
|
|
3635
3911
|
// src/editor/components/textarea.tsx
|
|
3636
3912
|
var React6 = __toESM(require("react"));
|
|
3637
|
-
var
|
|
3913
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3638
3914
|
var Textarea = React6.forwardRef(
|
|
3639
3915
|
(_a, ref) => {
|
|
3640
3916
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3641
|
-
return /* @__PURE__ */ (0,
|
|
3917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3642
3918
|
"textarea",
|
|
3643
3919
|
__spreadValues({
|
|
3644
3920
|
className: cn(
|
|
@@ -3654,18 +3930,18 @@ var Textarea = React6.forwardRef(
|
|
|
3654
3930
|
Textarea.displayName = "Textarea";
|
|
3655
3931
|
|
|
3656
3932
|
// src/editor/nodes/link-card.tsx
|
|
3657
|
-
var
|
|
3933
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3658
3934
|
function LinkCardComponent(props) {
|
|
3659
3935
|
const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
|
|
3660
3936
|
const { getPos, editor } = props;
|
|
3661
|
-
return /* @__PURE__ */ (0,
|
|
3662
|
-
|
|
3937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3938
|
+
import_react37.NodeViewWrapper,
|
|
3663
3939
|
{
|
|
3664
3940
|
className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
|
|
3665
3941
|
draggable: "true",
|
|
3666
3942
|
"data-drag-handle": "",
|
|
3667
|
-
children: /* @__PURE__ */ (0,
|
|
3668
|
-
/* @__PURE__ */ (0,
|
|
3943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Popover, { open: props.selected, children: [
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3669
3945
|
"div",
|
|
3670
3946
|
{
|
|
3671
3947
|
tabIndex: -1,
|
|
@@ -3674,8 +3950,8 @@ function LinkCardComponent(props) {
|
|
|
3674
3950
|
const pos = getPos();
|
|
3675
3951
|
editor.commands.setNodeSelection(pos);
|
|
3676
3952
|
},
|
|
3677
|
-
children: /* @__PURE__ */ (0,
|
|
3678
|
-
image2 && /* @__PURE__ */ (0,
|
|
3953
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mly-no-prose mly-flex mly-flex-col mly-rounded-lg mly-border mly-border-gray-300", children: [
|
|
3954
|
+
image2 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mly-relative mly-mb-1.5 mly-w-full mly-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3679
3955
|
"img",
|
|
3680
3956
|
{
|
|
3681
3957
|
src: image2,
|
|
@@ -3683,23 +3959,23 @@ function LinkCardComponent(props) {
|
|
|
3683
3959
|
className: "mly-no-prose !mly-mb-0 mly-h-full mly-w-full mly-rounded-t-lg"
|
|
3684
3960
|
}
|
|
3685
3961
|
) }),
|
|
3686
|
-
/* @__PURE__ */ (0,
|
|
3687
|
-
/* @__PURE__ */ (0,
|
|
3688
|
-
/* @__PURE__ */ (0,
|
|
3689
|
-
badgeText && /* @__PURE__ */ (0,
|
|
3962
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mly-flex mly-items-stretch mly-p-3", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("mly-flex mly-flex-col"), children: [
|
|
3963
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "!mly-mb-1.5 mly-flex mly-items-center mly-gap-1.5", children: [
|
|
3964
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h2", { className: "!mly-mb-0 !mly-text-lg mly-font-semibold", children: title }),
|
|
3965
|
+
badgeText && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "!mly-font-base text-xs mly-rounded-md mly-bg-yellow-200 mly-px-2 mly-py-1 mly-font-semibold mly-leading-none", children: badgeText }),
|
|
3690
3966
|
" ",
|
|
3691
|
-
subTitle && !badgeText && /* @__PURE__ */ (0,
|
|
3967
|
+
subTitle && !badgeText && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "!mly-font-base text-xs mly-font-regular mly-rounded-md mly-leading-none mly-text-gray-400", children: subTitle })
|
|
3692
3968
|
] }),
|
|
3693
|
-
/* @__PURE__ */ (0,
|
|
3969
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "!mly-my-0 !mly-text-base mly-text-gray-500", children: [
|
|
3694
3970
|
description,
|
|
3695
3971
|
" ",
|
|
3696
|
-
linkTitle ? /* @__PURE__ */ (0,
|
|
3972
|
+
linkTitle ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("a", { href: link, className: "mly-font-semibold", children: linkTitle }) : null
|
|
3697
3973
|
] })
|
|
3698
3974
|
] }) })
|
|
3699
3975
|
] })
|
|
3700
3976
|
}
|
|
3701
3977
|
) }),
|
|
3702
|
-
/* @__PURE__ */ (0,
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3703
3979
|
PopoverContent,
|
|
3704
3980
|
{
|
|
3705
3981
|
align: "end",
|
|
@@ -3708,9 +3984,9 @@ function LinkCardComponent(props) {
|
|
|
3708
3984
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3709
3985
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
3710
3986
|
children: [
|
|
3711
|
-
/* @__PURE__ */ (0,
|
|
3712
|
-
/* @__PURE__ */ (0,
|
|
3713
|
-
/* @__PURE__ */ (0,
|
|
3987
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
3988
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Image" }),
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3714
3990
|
Input,
|
|
3715
3991
|
{
|
|
3716
3992
|
placeholder: "Add Image",
|
|
@@ -3724,9 +4000,9 @@ function LinkCardComponent(props) {
|
|
|
3724
4000
|
}
|
|
3725
4001
|
)
|
|
3726
4002
|
] }),
|
|
3727
|
-
/* @__PURE__ */ (0,
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4004
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Title" }),
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3730
4006
|
Input,
|
|
3731
4007
|
{
|
|
3732
4008
|
placeholder: "Add title",
|
|
@@ -3739,9 +4015,9 @@ function LinkCardComponent(props) {
|
|
|
3739
4015
|
}
|
|
3740
4016
|
)
|
|
3741
4017
|
] }),
|
|
3742
|
-
/* @__PURE__ */ (0,
|
|
3743
|
-
/* @__PURE__ */ (0,
|
|
3744
|
-
/* @__PURE__ */ (0,
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Description" }),
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3745
4021
|
Textarea,
|
|
3746
4022
|
{
|
|
3747
4023
|
placeholder: "Add description here",
|
|
@@ -3754,10 +4030,10 @@ function LinkCardComponent(props) {
|
|
|
3754
4030
|
}
|
|
3755
4031
|
)
|
|
3756
4032
|
] }),
|
|
3757
|
-
/* @__PURE__ */ (0,
|
|
3758
|
-
/* @__PURE__ */ (0,
|
|
3759
|
-
/* @__PURE__ */ (0,
|
|
3760
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mly-grid mly-grid-cols-2 mly-gap-2", children: [
|
|
4034
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4035
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Link Title" }),
|
|
4036
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3761
4037
|
Input,
|
|
3762
4038
|
{
|
|
3763
4039
|
placeholder: "Add link title here",
|
|
@@ -3770,9 +4046,9 @@ function LinkCardComponent(props) {
|
|
|
3770
4046
|
}
|
|
3771
4047
|
)
|
|
3772
4048
|
] }),
|
|
3773
|
-
/* @__PURE__ */ (0,
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
4049
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Link" }),
|
|
4051
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3776
4052
|
Input,
|
|
3777
4053
|
{
|
|
3778
4054
|
placeholder: "Add link here",
|
|
@@ -3786,10 +4062,10 @@ function LinkCardComponent(props) {
|
|
|
3786
4062
|
)
|
|
3787
4063
|
] })
|
|
3788
4064
|
] }),
|
|
3789
|
-
/* @__PURE__ */ (0,
|
|
3790
|
-
/* @__PURE__ */ (0,
|
|
3791
|
-
/* @__PURE__ */ (0,
|
|
3792
|
-
/* @__PURE__ */ (0,
|
|
4065
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mly-grid mly-grid-cols-2 mly-gap-2", children: [
|
|
4066
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Badge Text" }),
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3793
4069
|
Input,
|
|
3794
4070
|
{
|
|
3795
4071
|
placeholder: "Add badge text here",
|
|
@@ -3802,9 +4078,9 @@ function LinkCardComponent(props) {
|
|
|
3802
4078
|
}
|
|
3803
4079
|
)
|
|
3804
4080
|
] }),
|
|
3805
|
-
/* @__PURE__ */ (0,
|
|
3806
|
-
/* @__PURE__ */ (0,
|
|
3807
|
-
/* @__PURE__ */ (0,
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Sub Title" }),
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3808
4084
|
Input,
|
|
3809
4085
|
{
|
|
3810
4086
|
placeholder: "Add sub title here",
|
|
@@ -3891,7 +4167,7 @@ var LinkCardExtension = import_core8.Node.create({
|
|
|
3891
4167
|
};
|
|
3892
4168
|
},
|
|
3893
4169
|
addNodeView() {
|
|
3894
|
-
return (0,
|
|
4170
|
+
return (0, import_react38.ReactNodeViewRenderer)(LinkCardComponent, {
|
|
3895
4171
|
className: "mly-relative"
|
|
3896
4172
|
});
|
|
3897
4173
|
}
|
|
@@ -3899,26 +4175,97 @@ var LinkCardExtension = import_core8.Node.create({
|
|
|
3899
4175
|
|
|
3900
4176
|
// src/editor/nodes/button/button.tsx
|
|
3901
4177
|
var import_core9 = require("@tiptap/core");
|
|
3902
|
-
var
|
|
4178
|
+
var import_react43 = require("@tiptap/react");
|
|
3903
4179
|
|
|
3904
4180
|
// src/editor/nodes/button/button-view.tsx
|
|
3905
|
-
var
|
|
3906
|
-
|
|
3907
|
-
|
|
4181
|
+
var import_react42 = require("@tiptap/react");
|
|
4182
|
+
|
|
4183
|
+
// src/editor/nodes/button/button-label-input.tsx
|
|
4184
|
+
var import_lucide_react22 = require("lucide-react");
|
|
4185
|
+
var import_react39 = require("react");
|
|
4186
|
+
var import_react40 = require("react");
|
|
4187
|
+
var import_react41 = require("react");
|
|
4188
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4189
|
+
function ButtonLabelInput(props) {
|
|
4190
|
+
const { value, onValueChange, isVariable, editor } = props;
|
|
4191
|
+
const linkInputRef = (0, import_react41.useRef)(null);
|
|
4192
|
+
const [isEditing, setIsEditing] = (0, import_react40.useState)(!isVariable);
|
|
4193
|
+
const {
|
|
4194
|
+
variables = [],
|
|
4195
|
+
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR
|
|
4196
|
+
} = useMailyContext();
|
|
4197
|
+
const autoCompleteOptions = (0, import_react39.useMemo)(() => {
|
|
4198
|
+
const withoutTrigger = value.replace(
|
|
4199
|
+
new RegExp(variableTriggerCharacter, "g"),
|
|
4200
|
+
""
|
|
4201
|
+
);
|
|
4202
|
+
return processVariables(variables, {
|
|
4203
|
+
query: withoutTrigger || "",
|
|
4204
|
+
from: "bubble-variable",
|
|
4205
|
+
editor
|
|
4206
|
+
}).map((variable) => variable.name);
|
|
4207
|
+
}, [variables, value, editor]);
|
|
4208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
|
|
4209
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4210
|
+
"button",
|
|
4211
|
+
{
|
|
4212
|
+
className: "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",
|
|
4213
|
+
onClick: () => {
|
|
4214
|
+
setIsEditing(true);
|
|
4215
|
+
setTimeout(() => {
|
|
4216
|
+
var _a;
|
|
4217
|
+
(_a = linkInputRef.current) == null ? void 0 : _a.focus();
|
|
4218
|
+
}, 0);
|
|
4219
|
+
},
|
|
4220
|
+
children: [
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react22.BracesIcon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: value })
|
|
4223
|
+
]
|
|
4224
|
+
}
|
|
4225
|
+
),
|
|
4226
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4227
|
+
InputAutocomplete,
|
|
4228
|
+
{
|
|
4229
|
+
value,
|
|
4230
|
+
onValueChange: (value2) => {
|
|
4231
|
+
onValueChange == null ? void 0 : onValueChange(value2);
|
|
4232
|
+
},
|
|
4233
|
+
autoCompleteOptions,
|
|
4234
|
+
ref: linkInputRef,
|
|
4235
|
+
placeholder: "maily.to/",
|
|
4236
|
+
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",
|
|
4237
|
+
triggerChar: variableTriggerCharacter,
|
|
4238
|
+
onSelectOption: (value2) => {
|
|
4239
|
+
var _a;
|
|
4240
|
+
const isVariable2 = (_a = autoCompleteOptions.includes(value2)) != null ? _a : false;
|
|
4241
|
+
if (isVariable2) {
|
|
4242
|
+
setIsEditing(false);
|
|
4243
|
+
}
|
|
4244
|
+
onValueChange == null ? void 0 : onValueChange(value2, isVariable2);
|
|
4245
|
+
}
|
|
4246
|
+
}
|
|
4247
|
+
)
|
|
4248
|
+
] });
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4251
|
+
// src/editor/nodes/button/button-view.tsx
|
|
4252
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3908
4253
|
function ButtonView(props) {
|
|
3909
4254
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
3910
4255
|
const {
|
|
3911
4256
|
text: text2,
|
|
4257
|
+
isTextVariable,
|
|
3912
4258
|
alignment,
|
|
3913
4259
|
variant,
|
|
3914
4260
|
borderRadius: _radius,
|
|
3915
4261
|
buttonColor,
|
|
3916
4262
|
textColor,
|
|
3917
4263
|
url: externalLink,
|
|
3918
|
-
showIfKey = ""
|
|
4264
|
+
showIfKey = "",
|
|
4265
|
+
isUrlVariable
|
|
3919
4266
|
} = node.attrs;
|
|
3920
|
-
return /* @__PURE__ */ (0,
|
|
3921
|
-
|
|
4267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4268
|
+
import_react42.NodeViewWrapper,
|
|
3922
4269
|
{
|
|
3923
4270
|
draggable: "true",
|
|
3924
4271
|
"data-drag-handle": "",
|
|
@@ -3926,8 +4273,8 @@ function ButtonView(props) {
|
|
|
3926
4273
|
style: {
|
|
3927
4274
|
textAlign: alignment
|
|
3928
4275
|
},
|
|
3929
|
-
children: /* @__PURE__ */ (0,
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
4276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Popover, { open: props.selected, children: [
|
|
4277
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3931
4278
|
"button",
|
|
3932
4279
|
{
|
|
3933
4280
|
className: cn(
|
|
@@ -3956,7 +4303,7 @@ function ButtonView(props) {
|
|
|
3956
4303
|
children: text2
|
|
3957
4304
|
}
|
|
3958
4305
|
) }) }),
|
|
3959
|
-
/* @__PURE__ */ (0,
|
|
4306
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3960
4307
|
PopoverContent,
|
|
3961
4308
|
{
|
|
3962
4309
|
align: "end",
|
|
@@ -3965,25 +4312,24 @@ function ButtonView(props) {
|
|
|
3965
4312
|
sideOffset: 8,
|
|
3966
4313
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3967
4314
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
3968
|
-
children: /* @__PURE__ */ (0,
|
|
3969
|
-
/* @__PURE__ */ (0,
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
/* @__PURE__ */ (0,
|
|
3985
|
-
|
|
3986
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4317
|
+
ButtonLabelInput,
|
|
4318
|
+
{
|
|
4319
|
+
value: text2,
|
|
4320
|
+
onValueChange: (value, isVariable) => {
|
|
4321
|
+
updateAttributes2({
|
|
4322
|
+
text: value,
|
|
4323
|
+
isTextVariable: isVariable != null ? isVariable : false
|
|
4324
|
+
});
|
|
4325
|
+
},
|
|
4326
|
+
isVariable: isTextVariable,
|
|
4327
|
+
editor
|
|
4328
|
+
}
|
|
4329
|
+
),
|
|
4330
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Divider, {}),
|
|
4331
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4332
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3987
4333
|
Select,
|
|
3988
4334
|
{
|
|
3989
4335
|
label: "Border Radius",
|
|
@@ -4001,7 +4347,7 @@ function ButtonView(props) {
|
|
|
4001
4347
|
className: "mly-capitalize"
|
|
4002
4348
|
}
|
|
4003
4349
|
),
|
|
4004
|
-
/* @__PURE__ */ (0,
|
|
4350
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4005
4351
|
Select,
|
|
4006
4352
|
{
|
|
4007
4353
|
label: "Style",
|
|
@@ -4020,9 +4366,9 @@ function ButtonView(props) {
|
|
|
4020
4366
|
}
|
|
4021
4367
|
)
|
|
4022
4368
|
] }),
|
|
4023
|
-
/* @__PURE__ */ (0,
|
|
4024
|
-
/* @__PURE__ */ (0,
|
|
4025
|
-
/* @__PURE__ */ (0,
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Divider, {}),
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4026
4372
|
AlignmentSwitch,
|
|
4027
4373
|
{
|
|
4028
4374
|
alignment,
|
|
@@ -4033,22 +4379,25 @@ function ButtonView(props) {
|
|
|
4033
4379
|
}
|
|
4034
4380
|
}
|
|
4035
4381
|
),
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4037
4383
|
LinkInputPopover,
|
|
4038
4384
|
{
|
|
4039
4385
|
defaultValue: externalLink || "",
|
|
4040
|
-
onValueChange: (value) => {
|
|
4386
|
+
onValueChange: (value, isVariable) => {
|
|
4041
4387
|
updateAttributes2({
|
|
4042
|
-
url: value
|
|
4388
|
+
url: value,
|
|
4389
|
+
isUrlVariable: isVariable != null ? isVariable : false
|
|
4043
4390
|
});
|
|
4044
4391
|
},
|
|
4045
|
-
tooltip: "Update External Link"
|
|
4392
|
+
tooltip: "Update External Link",
|
|
4393
|
+
editor,
|
|
4394
|
+
isVariable: isUrlVariable
|
|
4046
4395
|
}
|
|
4047
4396
|
)
|
|
4048
4397
|
] }),
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
4050
|
-
/* @__PURE__ */ (0,
|
|
4051
|
-
/* @__PURE__ */ (0,
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Divider, {}),
|
|
4399
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4400
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4052
4401
|
BackgroundColorPickerPopup,
|
|
4053
4402
|
{
|
|
4054
4403
|
variant,
|
|
@@ -4060,7 +4409,7 @@ function ButtonView(props) {
|
|
|
4060
4409
|
}
|
|
4061
4410
|
}
|
|
4062
4411
|
),
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4412
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4064
4413
|
TextColorPickerPopup,
|
|
4065
4414
|
{
|
|
4066
4415
|
color: textColor,
|
|
@@ -4072,8 +4421,8 @@ function ButtonView(props) {
|
|
|
4072
4421
|
}
|
|
4073
4422
|
)
|
|
4074
4423
|
] }),
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
4076
|
-
/* @__PURE__ */ (0,
|
|
4424
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Divider, {}),
|
|
4425
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4077
4426
|
ShowPopover,
|
|
4078
4427
|
{
|
|
4079
4428
|
showIfKey,
|
|
@@ -4094,20 +4443,20 @@ function ButtonView(props) {
|
|
|
4094
4443
|
}
|
|
4095
4444
|
function BackgroundColorPickerPopup(props) {
|
|
4096
4445
|
const { color, onChange, variant } = props;
|
|
4097
|
-
return /* @__PURE__ */ (0,
|
|
4446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4098
4447
|
ColorPicker,
|
|
4099
4448
|
{
|
|
4100
4449
|
color,
|
|
4101
4450
|
onColorChange: onChange,
|
|
4102
4451
|
tooltip: "Background Color",
|
|
4103
|
-
children: /* @__PURE__ */ (0,
|
|
4452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4104
4453
|
BaseButton,
|
|
4105
4454
|
{
|
|
4106
4455
|
variant: "ghost",
|
|
4107
4456
|
size: "sm",
|
|
4108
4457
|
type: "button",
|
|
4109
4458
|
className: "mly-size-7",
|
|
4110
|
-
children: /* @__PURE__ */ (0,
|
|
4459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4111
4460
|
"div",
|
|
4112
4461
|
{
|
|
4113
4462
|
className: "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded-full mly-shadow",
|
|
@@ -4126,16 +4475,16 @@ function BackgroundColorPickerPopup(props) {
|
|
|
4126
4475
|
}
|
|
4127
4476
|
function TextColorPickerPopup(props) {
|
|
4128
4477
|
const { color, onChange } = props;
|
|
4129
|
-
return /* @__PURE__ */ (0,
|
|
4478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4130
4479
|
BaseButton,
|
|
4131
4480
|
{
|
|
4132
4481
|
variant: "ghost",
|
|
4133
4482
|
size: "sm",
|
|
4134
4483
|
type: "button",
|
|
4135
4484
|
className: "mly-size-7",
|
|
4136
|
-
children: /* @__PURE__ */ (0,
|
|
4137
|
-
/* @__PURE__ */ (0,
|
|
4138
|
-
/* @__PURE__ */ (0,
|
|
4485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
4486
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-midnight-gray", children: "A" }),
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4139
4488
|
"div",
|
|
4140
4489
|
{
|
|
4141
4490
|
className: "mly-h-[2px] mly-w-3 mly-shrink-0 mly-rounded-md mly-shadow",
|
|
@@ -4173,6 +4522,20 @@ var ButtonExtension = import_core9.Node.create({
|
|
|
4173
4522
|
};
|
|
4174
4523
|
}
|
|
4175
4524
|
},
|
|
4525
|
+
isTextVariable: {
|
|
4526
|
+
default: false,
|
|
4527
|
+
parseHTML: (element) => {
|
|
4528
|
+
return element.getAttribute("data-is-text-variable") === "true";
|
|
4529
|
+
},
|
|
4530
|
+
renderHTML: (attributes) => {
|
|
4531
|
+
if (!attributes.isTextVariable) {
|
|
4532
|
+
return {};
|
|
4533
|
+
}
|
|
4534
|
+
return {
|
|
4535
|
+
"data-is-text-variable": "true"
|
|
4536
|
+
};
|
|
4537
|
+
}
|
|
4538
|
+
},
|
|
4176
4539
|
url: {
|
|
4177
4540
|
default: "",
|
|
4178
4541
|
parseHTML: (element) => {
|
|
@@ -4184,6 +4547,23 @@ var ButtonExtension = import_core9.Node.create({
|
|
|
4184
4547
|
};
|
|
4185
4548
|
}
|
|
4186
4549
|
},
|
|
4550
|
+
// Later we will remove this attribute
|
|
4551
|
+
// and use the `url` attribute instead when implement
|
|
4552
|
+
// the URL variable feature
|
|
4553
|
+
isUrlVariable: {
|
|
4554
|
+
default: false,
|
|
4555
|
+
parseHTML: (element) => {
|
|
4556
|
+
return element.getAttribute("data-is-url-variable") === "true";
|
|
4557
|
+
},
|
|
4558
|
+
renderHTML: (attributes) => {
|
|
4559
|
+
if (!attributes.isUrlVariable) {
|
|
4560
|
+
return {};
|
|
4561
|
+
}
|
|
4562
|
+
return {
|
|
4563
|
+
"data-is-url-variable": "true"
|
|
4564
|
+
};
|
|
4565
|
+
}
|
|
4566
|
+
},
|
|
4187
4567
|
alignment: {
|
|
4188
4568
|
default: DEFAULT_BUTTON_ALIGNMENT,
|
|
4189
4569
|
parseHTML: (element) => {
|
|
@@ -4283,7 +4663,7 @@ var ButtonExtension = import_core9.Node.create({
|
|
|
4283
4663
|
};
|
|
4284
4664
|
},
|
|
4285
4665
|
addNodeView() {
|
|
4286
|
-
return (0,
|
|
4666
|
+
return (0, import_react43.ReactNodeViewRenderer)(ButtonView, {
|
|
4287
4667
|
contentDOMElementTag: "div",
|
|
4288
4668
|
className: "mly-relative"
|
|
4289
4669
|
});
|
|
@@ -4293,117 +4673,8 @@ var ButtonExtension = import_core9.Node.create({
|
|
|
4293
4673
|
// src/editor/nodes/variable/variable.ts
|
|
4294
4674
|
var import_core10 = require("@tiptap/core");
|
|
4295
4675
|
var import_state2 = require("@tiptap/pm/state");
|
|
4296
|
-
var
|
|
4676
|
+
var import_react44 = require("@tiptap/react");
|
|
4297
4677
|
var import_suggestion = __toESM(require("@tiptap/suggestion"));
|
|
4298
|
-
|
|
4299
|
-
// src/editor/nodes/variable/variable-view.tsx
|
|
4300
|
-
var import_react38 = require("@tiptap/react");
|
|
4301
|
-
var import_lucide_react21 = require("lucide-react");
|
|
4302
|
-
var import_react39 = require("react");
|
|
4303
|
-
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4304
|
-
function VariableView(props) {
|
|
4305
|
-
var _a;
|
|
4306
|
-
const { node, selected, updateAttributes: updateAttributes2, editor } = props;
|
|
4307
|
-
const { id, fallback, showIfKey = "" } = node.attrs;
|
|
4308
|
-
const { variables = [] } = useMailyContext();
|
|
4309
|
-
const eachKey = ((_a = editor == null ? void 0 : editor.getAttributes("for")) == null ? void 0 : _a.each) || "";
|
|
4310
|
-
const isRequired = (0, import_react39.useMemo)(() => {
|
|
4311
|
-
var _a2;
|
|
4312
|
-
const variable = processVariables(variables, {
|
|
4313
|
-
query: "",
|
|
4314
|
-
from: "variable",
|
|
4315
|
-
editor
|
|
4316
|
-
}).find((variable2) => variable2.name === id);
|
|
4317
|
-
return (_a2 = variable == null ? void 0 : variable.required) != null ? _a2 : true;
|
|
4318
|
-
}, [variables, id, editor, eachKey]);
|
|
4319
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4320
|
-
import_react38.NodeViewWrapper,
|
|
4321
|
-
{
|
|
4322
|
-
className: cn(
|
|
4323
|
-
"react-component",
|
|
4324
|
-
selected && "ProseMirror-selectednode",
|
|
4325
|
-
"mly-inline-block mly-leading-none"
|
|
4326
|
-
),
|
|
4327
|
-
draggable: "false",
|
|
4328
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Popover, { children: [
|
|
4329
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
4330
|
-
"span",
|
|
4331
|
-
{
|
|
4332
|
-
tabIndex: -1,
|
|
4333
|
-
className: "mly-inline-flex mly-items-center mly-gap-[var(--variable-icon-gap)] mly-rounded-full mly-border mly-px-1.5 mly-py-0.5 mly-leading-none",
|
|
4334
|
-
children: [
|
|
4335
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
4336
|
-
id,
|
|
4337
|
-
isRequired && !fallback && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
|
|
4338
|
-
]
|
|
4339
|
-
}
|
|
4340
|
-
) }),
|
|
4341
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4342
|
-
PopoverContent,
|
|
4343
|
-
{
|
|
4344
|
-
align: "start",
|
|
4345
|
-
side: "bottom",
|
|
4346
|
-
className: "mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
4347
|
-
sideOffset: 8,
|
|
4348
|
-
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
4349
|
-
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
4350
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
|
|
4351
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-relative", children: [
|
|
4352
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-inline-block mly-px-2 mly-text-xs mly-text-midnight-gray", children: "Variable" }),
|
|
4353
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4354
|
-
"input",
|
|
4355
|
-
{
|
|
4356
|
-
value: id != null ? id : "",
|
|
4357
|
-
onChange: (e) => {
|
|
4358
|
-
updateAttributes2({
|
|
4359
|
-
id: e.target.value
|
|
4360
|
-
});
|
|
4361
|
-
},
|
|
4362
|
-
placeholder: "ie. name...",
|
|
4363
|
-
className: "mly-h-7 mly-w-36 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
|
|
4364
|
-
}
|
|
4365
|
-
)
|
|
4366
|
-
] }),
|
|
4367
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Divider, { className: "mly-mx-1.5" }),
|
|
4368
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "mly-relative", children: [
|
|
4369
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
|
|
4370
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4371
|
-
"input",
|
|
4372
|
-
{
|
|
4373
|
-
value: fallback != null ? fallback : "",
|
|
4374
|
-
onChange: (e) => {
|
|
4375
|
-
updateAttributes2({
|
|
4376
|
-
fallback: e.target.value
|
|
4377
|
-
});
|
|
4378
|
-
},
|
|
4379
|
-
placeholder: "ie. John Doe...",
|
|
4380
|
-
className: "mly-h-7 mly-w-32 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
|
|
4381
|
-
}
|
|
4382
|
-
),
|
|
4383
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
4384
|
-
] }),
|
|
4385
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Divider, {}),
|
|
4386
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4387
|
-
ShowPopover,
|
|
4388
|
-
{
|
|
4389
|
-
showIfKey,
|
|
4390
|
-
onShowIfKeyValueChange: (value) => {
|
|
4391
|
-
updateAttributes2({
|
|
4392
|
-
showIfKey: value
|
|
4393
|
-
});
|
|
4394
|
-
},
|
|
4395
|
-
editor
|
|
4396
|
-
}
|
|
4397
|
-
)
|
|
4398
|
-
] }) })
|
|
4399
|
-
}
|
|
4400
|
-
)
|
|
4401
|
-
] })
|
|
4402
|
-
}
|
|
4403
|
-
);
|
|
4404
|
-
}
|
|
4405
|
-
|
|
4406
|
-
// src/editor/nodes/variable/variable.ts
|
|
4407
4678
|
var VariablePluginKey = new import_state2.PluginKey("variable");
|
|
4408
4679
|
var VariableExtension = import_core10.Node.create({
|
|
4409
4680
|
name: "variable",
|
|
@@ -4487,17 +4758,13 @@ var VariableExtension = import_core10.Node.create({
|
|
|
4487
4758
|
};
|
|
4488
4759
|
}
|
|
4489
4760
|
},
|
|
4490
|
-
|
|
4491
|
-
default:
|
|
4492
|
-
parseHTML: (element) =>
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
renderHTML(attributes) {
|
|
4496
|
-
if (!attributes.showIfKey) {
|
|
4497
|
-
return {};
|
|
4498
|
-
}
|
|
4761
|
+
required: {
|
|
4762
|
+
default: true,
|
|
4763
|
+
parseHTML: (element) => element.hasAttribute("data-required"),
|
|
4764
|
+
renderHTML: (attributes) => {
|
|
4765
|
+
var _a;
|
|
4499
4766
|
return {
|
|
4500
|
-
"data-
|
|
4767
|
+
"data-required": (_a = attributes == null ? void 0 : attributes.required) != null ? _a : true
|
|
4501
4768
|
};
|
|
4502
4769
|
}
|
|
4503
4770
|
}
|
|
@@ -4506,13 +4773,13 @@ var VariableExtension = import_core10.Node.create({
|
|
|
4506
4773
|
parseHTML() {
|
|
4507
4774
|
return [
|
|
4508
4775
|
{
|
|
4509
|
-
tag: `
|
|
4776
|
+
tag: `div[data-type="${this.name}"]`
|
|
4510
4777
|
}
|
|
4511
4778
|
];
|
|
4512
4779
|
},
|
|
4513
4780
|
renderHTML({ node, HTMLAttributes: HTMLAttributes2 }) {
|
|
4514
4781
|
return [
|
|
4515
|
-
"
|
|
4782
|
+
"div",
|
|
4516
4783
|
(0, import_core10.mergeAttributes)(
|
|
4517
4784
|
{ "data-type": this.name },
|
|
4518
4785
|
this.options.HTMLAttributes,
|
|
@@ -4562,15 +4829,16 @@ var VariableExtension = import_core10.Node.create({
|
|
|
4562
4829
|
];
|
|
4563
4830
|
},
|
|
4564
4831
|
addNodeView() {
|
|
4565
|
-
return (0,
|
|
4566
|
-
className: "mly-relative"
|
|
4832
|
+
return (0, import_react44.ReactNodeViewRenderer)(VariableView, {
|
|
4833
|
+
className: "mly-relative mly-inline-block",
|
|
4834
|
+
as: "div"
|
|
4567
4835
|
});
|
|
4568
4836
|
}
|
|
4569
4837
|
});
|
|
4570
4838
|
|
|
4571
4839
|
// src/editor/nodes/image/image.ts
|
|
4572
4840
|
var import_extension_image2 = __toESM(require("@tiptap/extension-image"));
|
|
4573
|
-
var
|
|
4841
|
+
var import_react45 = require("@tiptap/react");
|
|
4574
4842
|
var ImageExtension = import_extension_image2.default.extend({
|
|
4575
4843
|
addAttributes() {
|
|
4576
4844
|
var _a;
|
|
@@ -4611,6 +4879,40 @@ var ImageExtension = import_extension_image2.default.extend({
|
|
|
4611
4879
|
return externalLink ? { externalLink } : null;
|
|
4612
4880
|
}
|
|
4613
4881
|
},
|
|
4882
|
+
// Later we will remove this attribute
|
|
4883
|
+
// and use the `externalLink` attribute instead
|
|
4884
|
+
// when implement the URL variable feature
|
|
4885
|
+
isExternalLinkVariable: {
|
|
4886
|
+
default: false,
|
|
4887
|
+
parseHTML: (element) => {
|
|
4888
|
+
return element.getAttribute("data-is-external-link-variable") === "true";
|
|
4889
|
+
},
|
|
4890
|
+
renderHTML: (attributes) => {
|
|
4891
|
+
if (!attributes.isExternalLinkVariable) {
|
|
4892
|
+
return {};
|
|
4893
|
+
}
|
|
4894
|
+
return {
|
|
4895
|
+
"data-is-external-link-variable": "true"
|
|
4896
|
+
};
|
|
4897
|
+
}
|
|
4898
|
+
},
|
|
4899
|
+
// Later we will remove this attribute
|
|
4900
|
+
// and use the `src` attribute instead when implement
|
|
4901
|
+
// the URL variable feature
|
|
4902
|
+
isSrcVariable: {
|
|
4903
|
+
default: false,
|
|
4904
|
+
parseHTML: (element) => {
|
|
4905
|
+
return element.getAttribute("data-is-src-variable") === "true";
|
|
4906
|
+
},
|
|
4907
|
+
renderHTML: (attributes) => {
|
|
4908
|
+
if (!attributes.isSrcVariable) {
|
|
4909
|
+
return {};
|
|
4910
|
+
}
|
|
4911
|
+
return {
|
|
4912
|
+
"data-is-src-variable": "true"
|
|
4913
|
+
};
|
|
4914
|
+
}
|
|
4915
|
+
},
|
|
4614
4916
|
showIfKey: {
|
|
4615
4917
|
default: DEFAULT_SECTION_SHOW_IF_KEY,
|
|
4616
4918
|
parseHTML: (element) => {
|
|
@@ -4628,7 +4930,7 @@ var ImageExtension = import_extension_image2.default.extend({
|
|
|
4628
4930
|
});
|
|
4629
4931
|
},
|
|
4630
4932
|
addNodeView() {
|
|
4631
|
-
return (0,
|
|
4933
|
+
return (0, import_react45.ReactNodeViewRenderer)(ImageView, {
|
|
4632
4934
|
className: "mly-relative"
|
|
4633
4935
|
});
|
|
4634
4936
|
}
|
|
@@ -4758,24 +5060,24 @@ var ColumnsExtension = import_core12.Node.create({
|
|
|
4758
5060
|
|
|
4759
5061
|
// src/editor/nodes/for/for.ts
|
|
4760
5062
|
var import_core13 = require("@tiptap/core");
|
|
4761
|
-
var
|
|
5063
|
+
var import_react47 = require("@tiptap/react");
|
|
4762
5064
|
|
|
4763
5065
|
// src/editor/nodes/for/for-view.tsx
|
|
4764
|
-
var
|
|
4765
|
-
var
|
|
4766
|
-
var
|
|
5066
|
+
var import_react46 = require("@tiptap/react");
|
|
5067
|
+
var import_lucide_react23 = require("lucide-react");
|
|
5068
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4767
5069
|
function ForView(props) {
|
|
4768
5070
|
const { editor, getPos } = props;
|
|
4769
|
-
return /* @__PURE__ */ (0,
|
|
4770
|
-
|
|
5071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5072
|
+
import_react46.NodeViewWrapper,
|
|
4771
5073
|
{
|
|
4772
5074
|
draggable: "true",
|
|
4773
5075
|
"data-drag-handle": "",
|
|
4774
5076
|
"data-type": "for",
|
|
4775
5077
|
className: "mly-relative",
|
|
4776
5078
|
children: [
|
|
4777
|
-
/* @__PURE__ */ (0,
|
|
4778
|
-
/* @__PURE__ */ (0,
|
|
5079
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react46.NodeViewContent, { className: "is-editable" }),
|
|
5080
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4779
5081
|
"div",
|
|
4780
5082
|
{
|
|
4781
5083
|
role: "button",
|
|
@@ -4786,8 +5088,8 @@ function ForView(props) {
|
|
|
4786
5088
|
editor.commands.setNodeSelection(getPos());
|
|
4787
5089
|
},
|
|
4788
5090
|
children: [
|
|
4789
|
-
/* @__PURE__ */ (0,
|
|
4790
|
-
/* @__PURE__ */ (0,
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Repeat2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
|
|
4791
5093
|
]
|
|
4792
5094
|
}
|
|
4793
5095
|
)
|
|
@@ -4871,7 +5173,7 @@ var ForExtension = import_core13.Node.create({
|
|
|
4871
5173
|
};
|
|
4872
5174
|
},
|
|
4873
5175
|
addNodeView() {
|
|
4874
|
-
return (0,
|
|
5176
|
+
return (0, import_react47.ReactNodeViewRenderer)(ForView, {
|
|
4875
5177
|
contentDOMElementTag: "div",
|
|
4876
5178
|
className: "mly-relative"
|
|
4877
5179
|
});
|
|
@@ -4879,7 +5181,7 @@ var ForExtension = import_core13.Node.create({
|
|
|
4879
5181
|
});
|
|
4880
5182
|
|
|
4881
5183
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
4882
|
-
var
|
|
5184
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4883
5185
|
function TextBubbleMenu(props) {
|
|
4884
5186
|
var _a;
|
|
4885
5187
|
const { editor, appendTo } = props;
|
|
@@ -4891,35 +5193,35 @@ function TextBubbleMenu(props) {
|
|
|
4891
5193
|
name: "bold",
|
|
4892
5194
|
isActive: () => editor == null ? void 0 : editor.isActive("bold"),
|
|
4893
5195
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
|
|
4894
|
-
icon:
|
|
5196
|
+
icon: import_lucide_react24.BoldIcon,
|
|
4895
5197
|
tooltip: "Bold"
|
|
4896
5198
|
},
|
|
4897
5199
|
{
|
|
4898
5200
|
name: "italic",
|
|
4899
5201
|
isActive: () => editor == null ? void 0 : editor.isActive("italic"),
|
|
4900
5202
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
|
|
4901
|
-
icon:
|
|
5203
|
+
icon: import_lucide_react24.ItalicIcon,
|
|
4902
5204
|
tooltip: "Italic"
|
|
4903
5205
|
},
|
|
4904
5206
|
{
|
|
4905
5207
|
name: "underline",
|
|
4906
5208
|
isActive: () => editor == null ? void 0 : editor.isActive("underline"),
|
|
4907
5209
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run(),
|
|
4908
|
-
icon:
|
|
5210
|
+
icon: import_lucide_react24.UnderlineIcon,
|
|
4909
5211
|
tooltip: "Underline"
|
|
4910
5212
|
},
|
|
4911
5213
|
{
|
|
4912
5214
|
name: "strike",
|
|
4913
5215
|
isActive: () => editor == null ? void 0 : editor.isActive("strike"),
|
|
4914
5216
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
|
|
4915
|
-
icon:
|
|
5217
|
+
icon: import_lucide_react24.StrikethroughIcon,
|
|
4916
5218
|
tooltip: "Strikethrough"
|
|
4917
5219
|
},
|
|
4918
5220
|
{
|
|
4919
5221
|
name: "code",
|
|
4920
5222
|
isActive: () => editor == null ? void 0 : editor.isActive("code"),
|
|
4921
5223
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
|
|
4922
|
-
icon:
|
|
5224
|
+
icon: import_lucide_react24.CodeIcon,
|
|
4923
5225
|
tooltip: "Code"
|
|
4924
5226
|
}
|
|
4925
5227
|
];
|
|
@@ -4968,13 +5270,13 @@ function TextBubbleMenu(props) {
|
|
|
4968
5270
|
}
|
|
4969
5271
|
});
|
|
4970
5272
|
const state = useTextMenuState(editor);
|
|
4971
|
-
return /* @__PURE__ */ (0,
|
|
4972
|
-
|
|
5273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5274
|
+
import_react48.BubbleMenu,
|
|
4973
5275
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
4974
5276
|
className: "mly-flex mly-gap-1 mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
4975
|
-
children: /* @__PURE__ */ (0,
|
|
4976
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
4977
|
-
/* @__PURE__ */ (0,
|
|
5277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(TooltipProvider, { children: [
|
|
5278
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
5279
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4978
5280
|
AlignmentSwitch,
|
|
4979
5281
|
{
|
|
4980
5282
|
alignment: state.textAlign,
|
|
@@ -4983,21 +5285,21 @@ function TextBubbleMenu(props) {
|
|
|
4983
5285
|
}
|
|
4984
5286
|
}
|
|
4985
5287
|
),
|
|
4986
|
-
!state.isListActive && /* @__PURE__ */ (0,
|
|
4987
|
-
/* @__PURE__ */ (0,
|
|
5288
|
+
!state.isListActive && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
5289
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4988
5290
|
BubbleMenuButton,
|
|
4989
5291
|
{
|
|
4990
|
-
icon:
|
|
5292
|
+
icon: import_lucide_react24.List,
|
|
4991
5293
|
command: () => {
|
|
4992
5294
|
editor.chain().focus().toggleBulletList().run();
|
|
4993
5295
|
},
|
|
4994
5296
|
tooltip: "Bullet List"
|
|
4995
5297
|
}
|
|
4996
5298
|
),
|
|
4997
|
-
/* @__PURE__ */ (0,
|
|
5299
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4998
5300
|
BubbleMenuButton,
|
|
4999
5301
|
{
|
|
5000
|
-
icon:
|
|
5302
|
+
icon: import_lucide_react24.ListOrdered,
|
|
5001
5303
|
command: () => {
|
|
5002
5304
|
editor.chain().focus().toggleOrderedList().run();
|
|
5003
5305
|
},
|
|
@@ -5005,11 +5307,11 @@ function TextBubbleMenu(props) {
|
|
|
5005
5307
|
}
|
|
5006
5308
|
)
|
|
5007
5309
|
] }),
|
|
5008
|
-
/* @__PURE__ */ (0,
|
|
5310
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5009
5311
|
LinkInputPopover,
|
|
5010
5312
|
{
|
|
5011
5313
|
defaultValue: (_a = state == null ? void 0 : state.linkUrl) != null ? _a : "",
|
|
5012
|
-
onValueChange: (value) => {
|
|
5314
|
+
onValueChange: (value, isVariable) => {
|
|
5013
5315
|
const defaultValueWithoutProtocol = value.replace(
|
|
5014
5316
|
/https?:\/\//,
|
|
5015
5317
|
""
|
|
@@ -5018,13 +5320,15 @@ function TextBubbleMenu(props) {
|
|
|
5018
5320
|
editor == null ? void 0 : editor.chain().focus().extendMarkRange("link").unsetLink().unsetUnderline().run();
|
|
5019
5321
|
return;
|
|
5020
5322
|
}
|
|
5021
|
-
editor == null ? void 0 : editor.chain().extendMarkRange("link").setLink({ href: value }).setUnderline().run();
|
|
5323
|
+
editor == null ? void 0 : editor.chain().extendMarkRange("link").setLink({ href: value }).setIsUrlVariable(isVariable != null ? isVariable : false).setUnderline().run();
|
|
5022
5324
|
},
|
|
5023
|
-
tooltip: "External URL"
|
|
5325
|
+
tooltip: "External URL",
|
|
5326
|
+
editor,
|
|
5327
|
+
isVariable: state.isUrlVariable
|
|
5024
5328
|
}
|
|
5025
5329
|
),
|
|
5026
|
-
/* @__PURE__ */ (0,
|
|
5027
|
-
/* @__PURE__ */ (0,
|
|
5330
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
5331
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5028
5332
|
ColorPicker,
|
|
5029
5333
|
{
|
|
5030
5334
|
color: state.currentTextColor,
|
|
@@ -5032,16 +5336,16 @@ function TextBubbleMenu(props) {
|
|
|
5032
5336
|
editor == null ? void 0 : editor.chain().setColor(color).run();
|
|
5033
5337
|
},
|
|
5034
5338
|
tooltip: "Text Color",
|
|
5035
|
-
children: /* @__PURE__ */ (0,
|
|
5339
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5036
5340
|
BaseButton,
|
|
5037
5341
|
{
|
|
5038
5342
|
variant: "ghost",
|
|
5039
5343
|
size: "sm",
|
|
5040
5344
|
type: "button",
|
|
5041
5345
|
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
5042
|
-
children: /* @__PURE__ */ (0,
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
5347
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700", children: "A" }),
|
|
5348
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5045
5349
|
"div",
|
|
5046
5350
|
{
|
|
5047
5351
|
className: "mly-h-[2px] mly-w-3",
|
|
@@ -5061,7 +5365,6 @@ function TextBubbleMenu(props) {
|
|
|
5061
5365
|
// src/editor/extensions/index.ts
|
|
5062
5366
|
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
5063
5367
|
var import_extension_color = require("@tiptap/extension-color");
|
|
5064
|
-
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
5065
5368
|
var import_extension_list_item = __toESM(require("@tiptap/extension-list-item"));
|
|
5066
5369
|
var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"));
|
|
5067
5370
|
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
@@ -5114,119 +5417,52 @@ var Footer = import_core14.Node.create({
|
|
|
5114
5417
|
});
|
|
5115
5418
|
|
|
5116
5419
|
// src/editor/nodes/variable/variable-suggestions.tsx
|
|
5117
|
-
var
|
|
5118
|
-
var
|
|
5119
|
-
var import_react46 = require("react");
|
|
5420
|
+
var import_react49 = require("@tiptap/react");
|
|
5421
|
+
var import_react50 = require("react");
|
|
5120
5422
|
var import_tippy5 = __toESM(require("tippy.js"));
|
|
5121
|
-
var
|
|
5122
|
-
var
|
|
5423
|
+
var import_react51 = require("react");
|
|
5424
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5425
|
+
var VariableList = (0, import_react50.forwardRef)((props, ref) => {
|
|
5123
5426
|
const { items = [] } = props;
|
|
5124
|
-
const
|
|
5125
|
-
|
|
5126
|
-
const itemRefs = (0, import_react46.useRef)([]);
|
|
5127
|
-
const selectItem = (index) => {
|
|
5128
|
-
const item = props.items[index];
|
|
5129
|
-
if (!item) {
|
|
5130
|
-
return;
|
|
5131
|
-
}
|
|
5132
|
-
props.command({ id: item });
|
|
5133
|
-
};
|
|
5134
|
-
const scrollSelectedIntoView = (index) => {
|
|
5135
|
-
const container = scrollContainerRef.current;
|
|
5136
|
-
const selectedItem = itemRefs.current[index];
|
|
5137
|
-
if (!container || !selectedItem) {
|
|
5138
|
-
return;
|
|
5139
|
-
}
|
|
5140
|
-
const containerRect = container.getBoundingClientRect();
|
|
5141
|
-
const itemRect = selectedItem.getBoundingClientRect();
|
|
5142
|
-
const padding = 4;
|
|
5143
|
-
if (itemRect.bottom > containerRect.bottom) {
|
|
5144
|
-
container.scrollTop += itemRect.bottom - containerRect.bottom + padding;
|
|
5145
|
-
} else if (itemRect.top < containerRect.top) {
|
|
5146
|
-
container.scrollTop += itemRect.top - containerRect.top - padding;
|
|
5147
|
-
}
|
|
5148
|
-
};
|
|
5149
|
-
(0, import_react46.useEffect)(() => {
|
|
5150
|
-
setSelectedIndex(0);
|
|
5151
|
-
if (scrollContainerRef.current) {
|
|
5152
|
-
scrollContainerRef.current.scrollTop = 0;
|
|
5153
|
-
}
|
|
5154
|
-
itemRefs.current = props.items.map(() => null);
|
|
5155
|
-
}, [props.items]);
|
|
5156
|
-
(0, import_react46.useEffect)(() => {
|
|
5157
|
-
scrollSelectedIntoView(selectedIndex);
|
|
5158
|
-
}, [selectedIndex]);
|
|
5159
|
-
(0, import_react46.useImperativeHandle)(ref, () => ({
|
|
5427
|
+
const popoverRef = (0, import_react51.useRef)(null);
|
|
5428
|
+
(0, import_react50.useImperativeHandle)(ref, () => ({
|
|
5160
5429
|
onKeyDown: ({ event }) => {
|
|
5430
|
+
if (!popoverRef.current) {
|
|
5431
|
+
return false;
|
|
5432
|
+
}
|
|
5433
|
+
const { moveUp, moveDown, select } = popoverRef.current || {};
|
|
5161
5434
|
if (event.key === "ArrowUp") {
|
|
5162
5435
|
event.preventDefault();
|
|
5163
|
-
|
|
5436
|
+
moveUp();
|
|
5164
5437
|
return true;
|
|
5165
5438
|
}
|
|
5166
5439
|
if (event.key === "ArrowDown") {
|
|
5167
5440
|
event.preventDefault();
|
|
5168
|
-
|
|
5441
|
+
moveDown();
|
|
5169
5442
|
return true;
|
|
5170
5443
|
}
|
|
5171
5444
|
if (event.key === "Enter") {
|
|
5172
|
-
|
|
5445
|
+
select();
|
|
5173
5446
|
return true;
|
|
5174
5447
|
}
|
|
5175
5448
|
return false;
|
|
5176
5449
|
}
|
|
5177
5450
|
}));
|
|
5178
|
-
return /* @__PURE__ */ (0,
|
|
5179
|
-
|
|
5180
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
|
|
5181
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.Braces, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
5182
|
-
] }),
|
|
5183
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5184
|
-
"div",
|
|
5185
|
-
{
|
|
5186
|
-
ref: scrollContainerRef,
|
|
5187
|
-
className: "mly-max-h-52 mly-overflow-y-auto mly-scrollbar-thin mly-scrollbar-track-transparent mly-scrollbar-thumb-gray-200",
|
|
5188
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-flex mly-flex-col mly-gap-0.5 mly-p-1", children: (items == null ? void 0 : items.length) ? items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5189
|
-
"button",
|
|
5190
|
-
{
|
|
5191
|
-
ref: (el) => itemRefs.current[index] = el,
|
|
5192
|
-
onClick: () => selectItem(index),
|
|
5193
|
-
className: cn(
|
|
5194
|
-
"mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-sm mly-text-gray-900 hover:mly-bg-soft-gray",
|
|
5195
|
-
index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
|
|
5196
|
-
),
|
|
5197
|
-
children: [
|
|
5198
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.Braces, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
5199
|
-
item
|
|
5200
|
-
]
|
|
5201
|
-
},
|
|
5202
|
-
index
|
|
5203
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly-flex mly-h-7 mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-[13px] mly-text-gray-900 hover:mly-bg-soft-gray", children: "No result" }) })
|
|
5204
|
-
}
|
|
5205
|
-
),
|
|
5206
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-t mly-border-gray-200 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
|
|
5207
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
|
|
5208
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.ArrowDown, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
5209
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.ArrowUp, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
5210
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
|
|
5211
|
-
] }),
|
|
5212
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react24.CornerDownLeft, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
5213
|
-
] })
|
|
5214
|
-
] });
|
|
5215
|
-
});
|
|
5216
|
-
VariableList.displayName = "VariableList";
|
|
5217
|
-
function VariableIcon(props) {
|
|
5218
|
-
const { className, children } = props;
|
|
5219
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5220
|
-
"div",
|
|
5451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5452
|
+
VariablePopover,
|
|
5221
5453
|
{
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5454
|
+
items,
|
|
5455
|
+
onSelectItem: (value) => {
|
|
5456
|
+
var _a;
|
|
5457
|
+
props.command({
|
|
5458
|
+
id: value.name,
|
|
5459
|
+
required: (_a = value.required) != null ? _a : true
|
|
5460
|
+
});
|
|
5461
|
+
},
|
|
5462
|
+
ref: popoverRef
|
|
5227
5463
|
}
|
|
5228
5464
|
);
|
|
5229
|
-
}
|
|
5465
|
+
});
|
|
5230
5466
|
VariableList.displayName = "VariableList";
|
|
5231
5467
|
function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VARIABLE_TRIGGER_CHAR) {
|
|
5232
5468
|
return {
|
|
@@ -5235,15 +5471,15 @@ function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VA
|
|
|
5235
5471
|
return processVariables(variables, {
|
|
5236
5472
|
query,
|
|
5237
5473
|
editor,
|
|
5238
|
-
from: "variable"
|
|
5239
|
-
})
|
|
5474
|
+
from: "content-variable"
|
|
5475
|
+
});
|
|
5240
5476
|
},
|
|
5241
5477
|
render: () => {
|
|
5242
5478
|
let component;
|
|
5243
5479
|
let popup = null;
|
|
5244
5480
|
return {
|
|
5245
5481
|
onStart: (props) => {
|
|
5246
|
-
component = new
|
|
5482
|
+
component = new import_react49.ReactRenderer(VariableList, {
|
|
5247
5483
|
props,
|
|
5248
5484
|
editor: props.editor
|
|
5249
5485
|
});
|
|
@@ -5332,14 +5568,14 @@ var updateScrollView = (container, item) => {
|
|
|
5332
5568
|
};
|
|
5333
5569
|
|
|
5334
5570
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
5335
|
-
var
|
|
5336
|
-
var
|
|
5571
|
+
var import_react52 = require("@tiptap/react");
|
|
5572
|
+
var import_react53 = require("react");
|
|
5337
5573
|
var import_tippy6 = __toESM(require("tippy.js"));
|
|
5338
|
-
var
|
|
5574
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5339
5575
|
function CommandList(props) {
|
|
5340
5576
|
const { items, command, editor } = props;
|
|
5341
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5342
|
-
const selectItem = (0,
|
|
5577
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react53.useState)(0);
|
|
5578
|
+
const selectItem = (0, import_react53.useCallback)(
|
|
5343
5579
|
(index) => {
|
|
5344
5580
|
const item = items[index];
|
|
5345
5581
|
if (item) {
|
|
@@ -5349,7 +5585,7 @@ function CommandList(props) {
|
|
|
5349
5585
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5350
5586
|
[command, editor, items]
|
|
5351
5587
|
);
|
|
5352
|
-
(0,
|
|
5588
|
+
(0, import_react53.useEffect)(() => {
|
|
5353
5589
|
const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];
|
|
5354
5590
|
const onKeyDown = (e) => {
|
|
5355
5591
|
if (navigationKeys.includes(e.key)) {
|
|
@@ -5374,26 +5610,26 @@ function CommandList(props) {
|
|
|
5374
5610
|
document.removeEventListener("keydown", onKeyDown);
|
|
5375
5611
|
};
|
|
5376
5612
|
}, [items, selectedIndex, setSelectedIndex, selectItem]);
|
|
5377
|
-
(0,
|
|
5613
|
+
(0, import_react53.useEffect)(() => {
|
|
5378
5614
|
setSelectedIndex(0);
|
|
5379
5615
|
}, [items]);
|
|
5380
|
-
const commandListContainer = (0,
|
|
5381
|
-
(0,
|
|
5616
|
+
const commandListContainer = (0, import_react53.useRef)(null);
|
|
5617
|
+
(0, import_react53.useLayoutEffect)(() => {
|
|
5382
5618
|
const container = commandListContainer == null ? void 0 : commandListContainer.current;
|
|
5383
5619
|
const item = container == null ? void 0 : container.children[selectedIndex];
|
|
5384
5620
|
if (item && container) {
|
|
5385
5621
|
updateScrollView(container, item);
|
|
5386
5622
|
}
|
|
5387
5623
|
}, [selectedIndex]);
|
|
5388
|
-
return items.length > 0 ? /* @__PURE__ */ (0,
|
|
5389
|
-
/* @__PURE__ */ (0,
|
|
5624
|
+
return items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
|
|
5625
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5390
5626
|
"div",
|
|
5391
5627
|
{
|
|
5392
5628
|
id: "slash-command",
|
|
5393
5629
|
ref: commandListContainer,
|
|
5394
5630
|
className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-p-1",
|
|
5395
5631
|
children: items.map((item, index) => {
|
|
5396
|
-
return /* @__PURE__ */ (0,
|
|
5632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5397
5633
|
"button",
|
|
5398
5634
|
{
|
|
5399
5635
|
className: cn(
|
|
@@ -5403,10 +5639,10 @@ function CommandList(props) {
|
|
|
5403
5639
|
onClick: () => selectItem(index),
|
|
5404
5640
|
type: "button",
|
|
5405
5641
|
children: [
|
|
5406
|
-
/* @__PURE__ */ (0,
|
|
5407
|
-
/* @__PURE__ */ (0,
|
|
5408
|
-
/* @__PURE__ */ (0,
|
|
5409
|
-
/* @__PURE__ */ (0,
|
|
5642
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
|
|
5643
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mly-font-medium", children: item.title }),
|
|
5645
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mly-text-xs mly-text-gray-400", children: item.description })
|
|
5410
5646
|
] })
|
|
5411
5647
|
]
|
|
5412
5648
|
},
|
|
@@ -5415,16 +5651,16 @@ function CommandList(props) {
|
|
|
5415
5651
|
})
|
|
5416
5652
|
}
|
|
5417
5653
|
),
|
|
5418
|
-
/* @__PURE__ */ (0,
|
|
5419
|
-
/* @__PURE__ */ (0,
|
|
5420
|
-
/* @__PURE__ */ (0,
|
|
5421
|
-
/* @__PURE__ */ (0,
|
|
5654
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "mly-flex mly-items-center", children: [
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
|
|
5656
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2191" }),
|
|
5657
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("kbd", { className: "mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2193" }),
|
|
5422
5658
|
" ",
|
|
5423
5659
|
"to navigate"
|
|
5424
5660
|
] }),
|
|
5425
|
-
/* @__PURE__ */ (0,
|
|
5426
|
-
/* @__PURE__ */ (0,
|
|
5427
|
-
/* @__PURE__ */ (0,
|
|
5661
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", className: "mly-select-none mly-px-1", children: "\xB7" }),
|
|
5662
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
|
|
5663
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium", children: "Enter" }),
|
|
5428
5664
|
" ",
|
|
5429
5665
|
"to select"
|
|
5430
5666
|
] })
|
|
@@ -5451,7 +5687,7 @@ function getSlashCommandSuggestions(commands = []) {
|
|
|
5451
5687
|
let popup = null;
|
|
5452
5688
|
return {
|
|
5453
5689
|
onStart: (props) => {
|
|
5454
|
-
component = new
|
|
5690
|
+
component = new import_react52.ReactRenderer(CommandList, {
|
|
5455
5691
|
props,
|
|
5456
5692
|
editor: props.editor
|
|
5457
5693
|
});
|
|
@@ -5490,6 +5726,27 @@ function getSlashCommandSuggestions(commands = []) {
|
|
|
5490
5726
|
};
|
|
5491
5727
|
}
|
|
5492
5728
|
|
|
5729
|
+
// src/editor/nodes/link.ts
|
|
5730
|
+
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
5731
|
+
var LinkExtension = import_extension_link.default.extend({
|
|
5732
|
+
addAttributes() {
|
|
5733
|
+
var _a;
|
|
5734
|
+
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
5735
|
+
isUrlVariable: {
|
|
5736
|
+
default: false
|
|
5737
|
+
}
|
|
5738
|
+
});
|
|
5739
|
+
},
|
|
5740
|
+
addCommands() {
|
|
5741
|
+
var _a;
|
|
5742
|
+
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
5743
|
+
setIsUrlVariable: (isUrlVariable) => ({ chain }) => {
|
|
5744
|
+
return chain().setMark("link", { isUrlVariable }).run();
|
|
5745
|
+
}
|
|
5746
|
+
});
|
|
5747
|
+
}
|
|
5748
|
+
});
|
|
5749
|
+
|
|
5493
5750
|
// src/editor/extensions/index.ts
|
|
5494
5751
|
function extensions(props) {
|
|
5495
5752
|
const { variables, blocks, variableTriggerCharacter } = props;
|
|
@@ -5564,7 +5821,7 @@ function extensions(props) {
|
|
|
5564
5821
|
SlashCommand.configure({
|
|
5565
5822
|
suggestion: getSlashCommandSuggestions(blocks)
|
|
5566
5823
|
}),
|
|
5567
|
-
|
|
5824
|
+
LinkExtension.configure({
|
|
5568
5825
|
HTMLAttributes: {
|
|
5569
5826
|
target: "_blank",
|
|
5570
5827
|
rel: "noopener noreferrer nofollow",
|
|
@@ -5590,7 +5847,7 @@ function extensions(props) {
|
|
|
5590
5847
|
}
|
|
5591
5848
|
|
|
5592
5849
|
// src/editor/index.tsx
|
|
5593
|
-
var
|
|
5850
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5594
5851
|
function Editor8(props) {
|
|
5595
5852
|
const {
|
|
5596
5853
|
config: {
|
|
@@ -5609,7 +5866,8 @@ function Editor8(props) {
|
|
|
5609
5866
|
contentJson,
|
|
5610
5867
|
variables = DEFAULT_VARIABLES,
|
|
5611
5868
|
blocks = DEFAULT_SLASH_COMMANDS,
|
|
5612
|
-
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR
|
|
5869
|
+
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
5870
|
+
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
5613
5871
|
} = props;
|
|
5614
5872
|
let formattedContent = null;
|
|
5615
5873
|
if (contentJson) {
|
|
@@ -5630,8 +5888,8 @@ function Editor8(props) {
|
|
|
5630
5888
|
]
|
|
5631
5889
|
};
|
|
5632
5890
|
}
|
|
5633
|
-
const menuContainerRef = (0,
|
|
5634
|
-
const editor = (0,
|
|
5891
|
+
const menuContainerRef = (0, import_react55.useRef)(null);
|
|
5892
|
+
const editor = (0, import_react54.useEditor)({
|
|
5635
5893
|
editorProps: {
|
|
5636
5894
|
attributes: {
|
|
5637
5895
|
class: cn(`mly-prose mly-w-full`, contentClassName),
|
|
@@ -5669,20 +5927,21 @@ function Editor8(props) {
|
|
|
5669
5927
|
if (!editor) {
|
|
5670
5928
|
return null;
|
|
5671
5929
|
}
|
|
5672
|
-
return /* @__PURE__ */ (0,
|
|
5930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5673
5931
|
MailyProvider,
|
|
5674
5932
|
{
|
|
5675
5933
|
variables,
|
|
5676
5934
|
blocks,
|
|
5677
5935
|
variableTriggerCharacter,
|
|
5678
|
-
|
|
5936
|
+
renderVariable,
|
|
5937
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5679
5938
|
"div",
|
|
5680
5939
|
{
|
|
5681
5940
|
className: cn("mly-editor mly-antialiased", wrapClassName),
|
|
5682
5941
|
ref: menuContainerRef,
|
|
5683
5942
|
children: [
|
|
5684
|
-
hasMenuBar && /* @__PURE__ */ (0,
|
|
5685
|
-
/* @__PURE__ */ (0,
|
|
5943
|
+
hasMenuBar && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EditorMenuBar, { config: props.config, editor }),
|
|
5944
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5686
5945
|
"div",
|
|
5687
5946
|
{
|
|
5688
5947
|
className: cn(
|
|
@@ -5690,14 +5949,14 @@ function Editor8(props) {
|
|
|
5690
5949
|
bodyClassName
|
|
5691
5950
|
),
|
|
5692
5951
|
children: [
|
|
5693
|
-
/* @__PURE__ */ (0,
|
|
5694
|
-
/* @__PURE__ */ (0,
|
|
5695
|
-
/* @__PURE__ */ (0,
|
|
5696
|
-
/* @__PURE__ */ (0,
|
|
5697
|
-
/* @__PURE__ */ (0,
|
|
5698
|
-
/* @__PURE__ */ (0,
|
|
5699
|
-
/* @__PURE__ */ (0,
|
|
5700
|
-
/* @__PURE__ */ (0,
|
|
5952
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
5953
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
5954
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
5955
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react54.EditorContent, { editor }),
|
|
5956
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
5957
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
5958
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ContentMenu, { editor }),
|
|
5959
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ForBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
5701
5960
|
]
|
|
5702
5961
|
}
|
|
5703
5962
|
)
|