@daisychainapp/maily-to-core 0.2.10 → 0.2.12
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/extensions/index.cjs +460 -614
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.mjs +403 -557
- package/dist/extensions/index.mjs.map +1 -1
- package/dist/index.cjs +92 -182
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +121 -211
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2146,302 +2146,9 @@ function AlignmentSwitch(props) {
|
|
|
2146
2146
|
] });
|
|
2147
2147
|
}
|
|
2148
2148
|
|
|
2149
|
-
// src/editor/components/show-popover.tsx
|
|
2150
|
-
import { Eye, InfoIcon } from "lucide-react";
|
|
2151
|
-
import { memo, useMemo as useMemo3, useRef as useRef4, useState as useState3 } from "react";
|
|
2152
|
-
|
|
2153
|
-
// src/editor/utils/node-options.ts
|
|
2154
|
-
import { useMemo as useMemo2 } from "react";
|
|
2155
|
-
function getNodeOptions(editor, name) {
|
|
2156
|
-
const node = editor.extensionManager.extensions.find(
|
|
2157
|
-
(extension) => extension.name === name
|
|
2158
|
-
);
|
|
2159
|
-
if (!node) {
|
|
2160
|
-
throw new Error(`Node ${name} not found`);
|
|
2161
|
-
}
|
|
2162
|
-
return node.options;
|
|
2163
|
-
}
|
|
2164
|
-
function getVariableOptions(editor) {
|
|
2165
|
-
return getNodeOptions(editor, "variable");
|
|
2166
|
-
}
|
|
2167
|
-
function useVariableOptions(editor) {
|
|
2168
|
-
return useMemo2(() => {
|
|
2169
|
-
return getVariableOptions(editor);
|
|
2170
|
-
}, [editor]);
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
// src/editor/utils/variable.ts
|
|
2174
|
-
function processVariables(variables, options) {
|
|
2175
|
-
const { query } = options;
|
|
2176
|
-
const queryLower = query.toLowerCase();
|
|
2177
|
-
let filteredVariables = [];
|
|
2178
|
-
if (Array.isArray(variables)) {
|
|
2179
|
-
filteredVariables = variables.filter(
|
|
2180
|
-
(variable) => variable.name.toLowerCase().startsWith(queryLower)
|
|
2181
|
-
);
|
|
2182
|
-
if (query.length > 0 && !filteredVariables.some((variable) => variable.name === query)) {
|
|
2183
|
-
filteredVariables.push({ name: query, required: true });
|
|
2184
|
-
}
|
|
2185
|
-
return filteredVariables;
|
|
2186
|
-
} else if (typeof variables === "function") {
|
|
2187
|
-
return variables(options);
|
|
2188
|
-
} else {
|
|
2189
|
-
throw new Error(`Invalid variables type. Expected 'Array' or 'Function', but received '${typeof variables}'.
|
|
2190
|
-
|
|
2191
|
-
You can check out the documentation for more information: https://github.com/arikchakma/maily.to/blob/main/packages/core/readme.md`);
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
// src/editor/utils/use-outside-click.ts
|
|
2196
|
-
import { useCallback as useCallback4 } from "react";
|
|
2197
|
-
import { useEffect as useEffect3 } from "react";
|
|
2198
|
-
function useOutsideClick(ref, callback) {
|
|
2199
|
-
const handleClick = useCallback4(
|
|
2200
|
-
(e) => {
|
|
2201
|
-
if (ref.current && !ref.current.contains(e.target)) {
|
|
2202
|
-
callback();
|
|
2203
|
-
}
|
|
2204
|
-
},
|
|
2205
|
-
[ref, callback]
|
|
2206
|
-
);
|
|
2207
|
-
useEffect3(() => {
|
|
2208
|
-
document.addEventListener("mousedown", handleClick);
|
|
2209
|
-
document.addEventListener("touchstart", handleClick);
|
|
2210
|
-
return () => {
|
|
2211
|
-
document.removeEventListener("mousedown", handleClick);
|
|
2212
|
-
document.removeEventListener("touchstart", handleClick);
|
|
2213
|
-
};
|
|
2214
|
-
}, [handleClick]);
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
// src/editor/components/ui/input-autocomplete.tsx
|
|
2218
|
-
import { CornerDownLeft } from "lucide-react";
|
|
2219
|
-
import { forwardRef as forwardRef6, useRef as useRef3 } from "react";
|
|
2220
|
-
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2221
|
-
var InputAutocomplete = forwardRef6((props, ref) => {
|
|
2222
|
-
var _b;
|
|
2223
|
-
const _a = props, {
|
|
2224
|
-
value = "",
|
|
2225
|
-
onValueChange,
|
|
2226
|
-
className,
|
|
2227
|
-
onOutsideClick,
|
|
2228
|
-
onSelectOption,
|
|
2229
|
-
autoCompleteOptions = [],
|
|
2230
|
-
triggerChar = "",
|
|
2231
|
-
editor
|
|
2232
|
-
} = _a, inputProps = __objRest(_a, [
|
|
2233
|
-
"value",
|
|
2234
|
-
"onValueChange",
|
|
2235
|
-
"className",
|
|
2236
|
-
"onOutsideClick",
|
|
2237
|
-
"onSelectOption",
|
|
2238
|
-
"autoCompleteOptions",
|
|
2239
|
-
"triggerChar",
|
|
2240
|
-
"editor"
|
|
2241
|
-
]);
|
|
2242
|
-
const containerRef = useRef3(null);
|
|
2243
|
-
const popoverRef = useRef3(null);
|
|
2244
|
-
const VariableSuggestionPopoverComponent = (_b = useVariableOptions(editor)) == null ? void 0 : _b.variableSuggestionsPopover;
|
|
2245
|
-
useOutsideClick(containerRef, () => {
|
|
2246
|
-
onOutsideClick == null ? void 0 : onOutsideClick();
|
|
2247
|
-
});
|
|
2248
|
-
const isTriggeringVariable = value.startsWith(triggerChar);
|
|
2249
|
-
return /* @__PURE__ */ jsxs6("div", { className: cn("mly-relative"), ref: containerRef, children: [
|
|
2250
|
-
/* @__PURE__ */ jsxs6("label", { className: "mly-relative", children: [
|
|
2251
|
-
/* @__PURE__ */ jsx11(
|
|
2252
|
-
"input",
|
|
2253
|
-
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
2254
|
-
placeholder: "e.g. items",
|
|
2255
|
-
type: "text"
|
|
2256
|
-
}), inputProps), {
|
|
2257
|
-
ref,
|
|
2258
|
-
value,
|
|
2259
|
-
onChange: (e) => {
|
|
2260
|
-
onValueChange(e.target.value);
|
|
2261
|
-
},
|
|
2262
|
-
className: cn(
|
|
2263
|
-
"mly-h-7 mly-w-40 mly-rounded-md mly-bg-white 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",
|
|
2264
|
-
className
|
|
2265
|
-
),
|
|
2266
|
-
onKeyDown: (e) => {
|
|
2267
|
-
if (!popoverRef.current || !isTriggeringVariable) {
|
|
2268
|
-
return;
|
|
2269
|
-
}
|
|
2270
|
-
const { moveUp, moveDown, select } = popoverRef.current;
|
|
2271
|
-
if (e.key === "ArrowDown") {
|
|
2272
|
-
e.preventDefault();
|
|
2273
|
-
moveDown();
|
|
2274
|
-
} else if (e.key === "ArrowUp") {
|
|
2275
|
-
e.preventDefault();
|
|
2276
|
-
moveUp();
|
|
2277
|
-
} else if (e.key === "Enter") {
|
|
2278
|
-
e.preventDefault();
|
|
2279
|
-
select();
|
|
2280
|
-
}
|
|
2281
|
-
},
|
|
2282
|
-
spellCheck: false
|
|
2283
|
-
})
|
|
2284
|
-
),
|
|
2285
|
-
/* @__PURE__ */ jsx11("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx11(CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
2286
|
-
] }),
|
|
2287
|
-
isTriggeringVariable && /* @__PURE__ */ jsx11("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ jsx11(
|
|
2288
|
-
VariableSuggestionPopoverComponent,
|
|
2289
|
-
{
|
|
2290
|
-
items: autoCompleteOptions.map((option) => {
|
|
2291
|
-
return {
|
|
2292
|
-
name: option
|
|
2293
|
-
};
|
|
2294
|
-
}),
|
|
2295
|
-
onSelectItem: (item) => {
|
|
2296
|
-
onSelectOption == null ? void 0 : onSelectOption(item.name);
|
|
2297
|
-
},
|
|
2298
|
-
ref: popoverRef
|
|
2299
|
-
}
|
|
2300
|
-
) })
|
|
2301
|
-
] });
|
|
2302
|
-
});
|
|
2303
|
-
InputAutocomplete.displayName = "InputAutocomplete";
|
|
2304
|
-
|
|
2305
|
-
// src/editor/components/show-popover.tsx
|
|
2306
|
-
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2307
|
-
function _ShowPopover(props) {
|
|
2308
|
-
const { showIfKey = "", onShowIfKeyValueChange, editor } = props;
|
|
2309
|
-
const opts = useVariableOptions(editor);
|
|
2310
|
-
const variables = opts == null ? void 0 : opts.variables;
|
|
2311
|
-
const renderVariable = opts == null ? void 0 : opts.renderVariable;
|
|
2312
|
-
const [isUpdatingKey, setIsUpdatingKey] = useState3(false);
|
|
2313
|
-
const inputRef = useRef4(null);
|
|
2314
|
-
const autoCompleteOptions = useMemo3(() => {
|
|
2315
|
-
return processVariables(variables, {
|
|
2316
|
-
query: showIfKey || "",
|
|
2317
|
-
from: "bubble-variable",
|
|
2318
|
-
editor
|
|
2319
|
-
}).map((variable) => variable.name);
|
|
2320
|
-
}, [variables, showIfKey, editor]);
|
|
2321
|
-
const isValidWhenKey = showIfKey || autoCompleteOptions.includes(showIfKey);
|
|
2322
|
-
return /* @__PURE__ */ jsxs7(
|
|
2323
|
-
Popover,
|
|
2324
|
-
{
|
|
2325
|
-
onOpenChange: (open) => {
|
|
2326
|
-
if (open) {
|
|
2327
|
-
return;
|
|
2328
|
-
}
|
|
2329
|
-
setIsUpdatingKey(false);
|
|
2330
|
-
},
|
|
2331
|
-
children: [
|
|
2332
|
-
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
2333
|
-
/* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(
|
|
2334
|
-
PopoverTrigger,
|
|
2335
|
-
{
|
|
2336
|
-
className: cn(
|
|
2337
|
-
"mly-flex mly-size-7 mly-items-center mly-justify-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",
|
|
2338
|
-
showIfKey && "mly-bg-rose-100 mly-text-rose-800 data-[state=open]:mly-bg-rose-100 hover:mly-bg-rose-100"
|
|
2339
|
-
),
|
|
2340
|
-
children: /* @__PURE__ */ jsx12(Eye, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" })
|
|
2341
|
-
}
|
|
2342
|
-
) }),
|
|
2343
|
-
/* @__PURE__ */ jsx12(TooltipContent, { sideOffset: 8, children: "Show block conditionally" })
|
|
2344
|
-
] }),
|
|
2345
|
-
/* @__PURE__ */ jsxs7(
|
|
2346
|
-
PopoverContent,
|
|
2347
|
-
{
|
|
2348
|
-
className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
|
|
2349
|
-
side: "top",
|
|
2350
|
-
sideOffset: 8,
|
|
2351
|
-
align: "end",
|
|
2352
|
-
onOpenAutoFocus: (e) => {
|
|
2353
|
-
e.preventDefault();
|
|
2354
|
-
},
|
|
2355
|
-
onCloseAutoFocus: (e) => {
|
|
2356
|
-
e.preventDefault();
|
|
2357
|
-
},
|
|
2358
|
-
children: [
|
|
2359
|
-
/* @__PURE__ */ jsxs7("div", { className: "mly-flex mly-items-center mly-gap-1.5 mly-px-1.5 mly-text-sm mly-leading-none", children: [
|
|
2360
|
-
"Show if",
|
|
2361
|
-
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
2362
|
-
/* @__PURE__ */ jsx12(TooltipTrigger, { children: /* @__PURE__ */ jsx12(
|
|
2363
|
-
InfoIcon,
|
|
2364
|
-
{
|
|
2365
|
-
className: cn("mly-size-3 mly-stroke-[2.5] mly-text-gray-500")
|
|
2366
|
-
}
|
|
2367
|
-
) }),
|
|
2368
|
-
/* @__PURE__ */ jsx12(
|
|
2369
|
-
TooltipContent,
|
|
2370
|
-
{
|
|
2371
|
-
sideOffset: 14,
|
|
2372
|
-
className: "mly-max-w-[285px]",
|
|
2373
|
-
align: "start",
|
|
2374
|
-
children: "Show the block if the selected variable is true."
|
|
2375
|
-
}
|
|
2376
|
-
)
|
|
2377
|
-
] })
|
|
2378
|
-
] }),
|
|
2379
|
-
!isUpdatingKey && /* @__PURE__ */ jsx12(
|
|
2380
|
-
"button",
|
|
2381
|
-
{
|
|
2382
|
-
onClick: () => {
|
|
2383
|
-
setIsUpdatingKey(true);
|
|
2384
|
-
setTimeout(() => {
|
|
2385
|
-
var _a;
|
|
2386
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2387
|
-
}, 0);
|
|
2388
|
-
},
|
|
2389
|
-
children: renderVariable({
|
|
2390
|
-
variable: {
|
|
2391
|
-
name: showIfKey,
|
|
2392
|
-
valid: !!isValidWhenKey
|
|
2393
|
-
},
|
|
2394
|
-
fallback: "",
|
|
2395
|
-
from: "bubble-variable",
|
|
2396
|
-
editor
|
|
2397
|
-
})
|
|
2398
|
-
}
|
|
2399
|
-
),
|
|
2400
|
-
isUpdatingKey && /* @__PURE__ */ jsx12(
|
|
2401
|
-
"form",
|
|
2402
|
-
{
|
|
2403
|
-
onSubmit: (e) => {
|
|
2404
|
-
e.preventDefault();
|
|
2405
|
-
setIsUpdatingKey(false);
|
|
2406
|
-
},
|
|
2407
|
-
onKeyDown: (e) => {
|
|
2408
|
-
if (e.key === "Escape") {
|
|
2409
|
-
setIsUpdatingKey(false);
|
|
2410
|
-
}
|
|
2411
|
-
},
|
|
2412
|
-
children: /* @__PURE__ */ jsx12(
|
|
2413
|
-
InputAutocomplete,
|
|
2414
|
-
{
|
|
2415
|
-
editor,
|
|
2416
|
-
value: showIfKey || "",
|
|
2417
|
-
onValueChange: (value) => {
|
|
2418
|
-
onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(value);
|
|
2419
|
-
},
|
|
2420
|
-
onOutsideClick: () => {
|
|
2421
|
-
setIsUpdatingKey(false);
|
|
2422
|
-
},
|
|
2423
|
-
onSelectOption: (value) => {
|
|
2424
|
-
onShowIfKeyValueChange == null ? void 0 : onShowIfKeyValueChange(value);
|
|
2425
|
-
setIsUpdatingKey(false);
|
|
2426
|
-
},
|
|
2427
|
-
autoCompleteOptions,
|
|
2428
|
-
ref: inputRef
|
|
2429
|
-
}
|
|
2430
|
-
)
|
|
2431
|
-
}
|
|
2432
|
-
)
|
|
2433
|
-
]
|
|
2434
|
-
}
|
|
2435
|
-
)
|
|
2436
|
-
]
|
|
2437
|
-
}
|
|
2438
|
-
);
|
|
2439
|
-
}
|
|
2440
|
-
var ShowPopover = memo(_ShowPopover);
|
|
2441
|
-
|
|
2442
2149
|
// src/editor/components/ui/color-picker.tsx
|
|
2443
2150
|
import { HexColorPicker, HexColorInput } from "react-colorful";
|
|
2444
|
-
import { jsx as
|
|
2151
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2445
2152
|
function ColorPicker(props) {
|
|
2446
2153
|
const {
|
|
2447
2154
|
color,
|
|
@@ -2459,14 +2166,14 @@ function ColorPicker(props) {
|
|
|
2459
2166
|
onColorChange(color2);
|
|
2460
2167
|
});
|
|
2461
2168
|
};
|
|
2462
|
-
const popoverButton = /* @__PURE__ */
|
|
2169
|
+
const popoverButton = /* @__PURE__ */ jsx11(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ jsx11(
|
|
2463
2170
|
BaseButton,
|
|
2464
2171
|
{
|
|
2465
2172
|
variant: "ghost",
|
|
2466
2173
|
className: "!mly-size-7 mly-shrink-0",
|
|
2467
2174
|
size: "sm",
|
|
2468
2175
|
type: "button",
|
|
2469
|
-
children: /* @__PURE__ */
|
|
2176
|
+
children: /* @__PURE__ */ jsx11(
|
|
2470
2177
|
"div",
|
|
2471
2178
|
{
|
|
2472
2179
|
className: cn(
|
|
@@ -2480,7 +2187,7 @@ function ColorPicker(props) {
|
|
|
2480
2187
|
)
|
|
2481
2188
|
}
|
|
2482
2189
|
) });
|
|
2483
|
-
return /* @__PURE__ */
|
|
2190
|
+
return /* @__PURE__ */ jsxs6(
|
|
2484
2191
|
Popover,
|
|
2485
2192
|
{
|
|
2486
2193
|
onOpenChange: (open) => {
|
|
@@ -2489,17 +2196,17 @@ function ColorPicker(props) {
|
|
|
2489
2196
|
}
|
|
2490
2197
|
},
|
|
2491
2198
|
children: [
|
|
2492
|
-
tooltip ? /* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2199
|
+
tooltip ? /* @__PURE__ */ jsxs6(Tooltip, { children: [
|
|
2200
|
+
/* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
2201
|
+
/* @__PURE__ */ jsx11(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
2495
2202
|
] }) : popoverButton,
|
|
2496
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ jsx11(
|
|
2497
2204
|
PopoverContent,
|
|
2498
2205
|
{
|
|
2499
2206
|
className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
|
|
2500
2207
|
sideOffset: 8,
|
|
2501
|
-
children: /* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2208
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-border-gray-200 mly-bg-white mly-p-4", children: [
|
|
2209
|
+
/* @__PURE__ */ jsx11(
|
|
2503
2210
|
HexColorPicker,
|
|
2504
2211
|
{
|
|
2505
2212
|
color,
|
|
@@ -2507,7 +2214,7 @@ function ColorPicker(props) {
|
|
|
2507
2214
|
className: "mly-flex !mly-w-full mly-flex-col mly-gap-4"
|
|
2508
2215
|
}
|
|
2509
2216
|
),
|
|
2510
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx11(
|
|
2511
2218
|
HexColorInput,
|
|
2512
2219
|
{
|
|
2513
2220
|
alpha: true,
|
|
@@ -2517,10 +2224,10 @@ function ColorPicker(props) {
|
|
|
2517
2224
|
prefixed: true
|
|
2518
2225
|
}
|
|
2519
2226
|
),
|
|
2520
|
-
suggestedColors.length > 0 && /* @__PURE__ */
|
|
2521
|
-
/* @__PURE__ */
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2227
|
+
suggestedColors.length > 0 && /* @__PURE__ */ jsxs6("div", { children: [
|
|
2228
|
+
/* @__PURE__ */ jsx11("div", { className: "-mly-mx-4 mly-my-4 mly-h-px mly-bg-gray-200" }),
|
|
2229
|
+
/* @__PURE__ */ jsx11("h2", { className: "mly-text-xs mly-text-gray-500", children: "Recently used" }),
|
|
2230
|
+
/* @__PURE__ */ jsx11("div", { className: "mly-mt-2 mly-flex mly-flex-wrap mly-gap-0.5", children: suggestedColors.map((suggestedColor) => /* @__PURE__ */ jsx11(
|
|
2524
2231
|
BaseButton,
|
|
2525
2232
|
{
|
|
2526
2233
|
variant: "ghost",
|
|
@@ -2528,7 +2235,7 @@ function ColorPicker(props) {
|
|
|
2528
2235
|
className: "!mly-size-7 mly-shrink-0",
|
|
2529
2236
|
type: "button",
|
|
2530
2237
|
onClick: () => handleColorChange(suggestedColor),
|
|
2531
|
-
children: /* @__PURE__ */
|
|
2238
|
+
children: /* @__PURE__ */ jsx11(
|
|
2532
2239
|
"div",
|
|
2533
2240
|
{
|
|
2534
2241
|
className: "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded",
|
|
@@ -2550,10 +2257,10 @@ function ColorPicker(props) {
|
|
|
2550
2257
|
}
|
|
2551
2258
|
|
|
2552
2259
|
// src/editor/components/ui/divider.tsx
|
|
2553
|
-
import { jsx as
|
|
2260
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2554
2261
|
function Divider(props) {
|
|
2555
2262
|
const { type = "vertical", className } = props;
|
|
2556
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ jsx12(
|
|
2557
2264
|
"div",
|
|
2558
2265
|
{
|
|
2559
2266
|
className: cn(
|
|
@@ -2567,7 +2274,7 @@ function Divider(props) {
|
|
|
2567
2274
|
|
|
2568
2275
|
// src/editor/components/ui/link-input-popover.tsx
|
|
2569
2276
|
import { Link, LinkIcon } from "lucide-react";
|
|
2570
|
-
import { useRef as
|
|
2277
|
+
import { useRef as useRef5, useState as useState4 } from "react";
|
|
2571
2278
|
|
|
2572
2279
|
// src/editor/provider.tsx
|
|
2573
2280
|
import { createContext, useContext } from "react";
|
|
@@ -2577,12 +2284,12 @@ import { FootprintsIcon as FootprintsIcon2, Heading1 as Heading12 } from "lucide
|
|
|
2577
2284
|
|
|
2578
2285
|
// src/blocks/button.tsx
|
|
2579
2286
|
import { MousePointer, ArrowUpRightSquare } from "lucide-react";
|
|
2580
|
-
import { jsx as
|
|
2287
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2581
2288
|
var button = {
|
|
2582
2289
|
title: "Button",
|
|
2583
2290
|
description: "Add a call to action button to email.",
|
|
2584
2291
|
searchTerms: ["link", "button", "cta"],
|
|
2585
|
-
icon: /* @__PURE__ */
|
|
2292
|
+
icon: /* @__PURE__ */ jsx13(MousePointer, { className: "mly-h-4 mly-w-4" }),
|
|
2586
2293
|
command: ({ editor, range }) => {
|
|
2587
2294
|
editor.chain().focus().deleteRange(range).setButton().run();
|
|
2588
2295
|
}
|
|
@@ -2591,7 +2298,7 @@ var linkCard = {
|
|
|
2591
2298
|
title: "Link Card",
|
|
2592
2299
|
description: "Add a link card to email.",
|
|
2593
2300
|
searchTerms: ["link", "button", "image"],
|
|
2594
|
-
icon: /* @__PURE__ */
|
|
2301
|
+
icon: /* @__PURE__ */ jsx13(ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
|
|
2595
2302
|
command: ({ editor, range }) => {
|
|
2596
2303
|
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
2597
2304
|
},
|
|
@@ -2604,12 +2311,12 @@ var linkCard = {
|
|
|
2604
2311
|
|
|
2605
2312
|
// src/blocks/code.tsx
|
|
2606
2313
|
import { CodeXmlIcon } from "lucide-react";
|
|
2607
|
-
import { jsx as
|
|
2314
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2608
2315
|
var htmlCodeBlock = {
|
|
2609
2316
|
title: "Custom HTML",
|
|
2610
2317
|
description: "Insert a custom HTML block",
|
|
2611
2318
|
searchTerms: ["html", "code", "custom"],
|
|
2612
|
-
icon: /* @__PURE__ */
|
|
2319
|
+
icon: /* @__PURE__ */ jsx14(CodeXmlIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2613
2320
|
command: ({ editor, range }) => {
|
|
2614
2321
|
editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
|
|
2615
2322
|
}
|
|
@@ -2618,12 +2325,12 @@ var htmlCodeBlock = {
|
|
|
2618
2325
|
// src/blocks/image.tsx
|
|
2619
2326
|
import { TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
2620
2327
|
import { ImageIcon } from "lucide-react";
|
|
2621
|
-
import { jsx as
|
|
2328
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2622
2329
|
var image = {
|
|
2623
2330
|
title: "Image",
|
|
2624
2331
|
description: "Full width image",
|
|
2625
2332
|
searchTerms: ["image"],
|
|
2626
|
-
icon: /* @__PURE__ */
|
|
2333
|
+
icon: /* @__PURE__ */ jsx15(ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2627
2334
|
command: ({ editor, range }) => {
|
|
2628
2335
|
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
2629
2336
|
}
|
|
@@ -2632,7 +2339,7 @@ var logo = {
|
|
|
2632
2339
|
title: "Logo",
|
|
2633
2340
|
description: "Add your brand logo",
|
|
2634
2341
|
searchTerms: ["image", "logo"],
|
|
2635
|
-
icon: /* @__PURE__ */
|
|
2342
|
+
icon: /* @__PURE__ */ jsx15(ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2636
2343
|
command: ({ editor, range }) => {
|
|
2637
2344
|
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
2638
2345
|
}
|
|
@@ -2641,7 +2348,7 @@ var inlineImage = {
|
|
|
2641
2348
|
title: "Inline Image",
|
|
2642
2349
|
description: "Inline image",
|
|
2643
2350
|
searchTerms: ["image", "inline"],
|
|
2644
|
-
icon: /* @__PURE__ */
|
|
2351
|
+
icon: /* @__PURE__ */ jsx15(ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2645
2352
|
command: ({ editor, range }) => {
|
|
2646
2353
|
editor.chain().focus().deleteRange(range).setInlineImage({
|
|
2647
2354
|
src: "https://maily.to/brand/logo.png"
|
|
@@ -2671,12 +2378,12 @@ import {
|
|
|
2671
2378
|
RectangleHorizontal,
|
|
2672
2379
|
Minus
|
|
2673
2380
|
} from "lucide-react";
|
|
2674
|
-
import { jsx as
|
|
2381
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2675
2382
|
var columns = {
|
|
2676
2383
|
title: "Columns",
|
|
2677
2384
|
description: "Add columns to email.",
|
|
2678
2385
|
searchTerms: ["layout", "columns"],
|
|
2679
|
-
icon: /* @__PURE__ */
|
|
2386
|
+
icon: /* @__PURE__ */ jsx16(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2680
2387
|
command: ({ editor, range }) => {
|
|
2681
2388
|
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
2682
2389
|
}
|
|
@@ -2685,7 +2392,7 @@ var section = {
|
|
|
2685
2392
|
title: "Section",
|
|
2686
2393
|
description: "Add a section to email.",
|
|
2687
2394
|
searchTerms: ["layout", "section"],
|
|
2688
|
-
icon: /* @__PURE__ */
|
|
2395
|
+
icon: /* @__PURE__ */ jsx16(RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
|
|
2689
2396
|
command: ({ editor, range }) => {
|
|
2690
2397
|
editor.chain().focus().deleteRange(range).setSection().run();
|
|
2691
2398
|
}
|
|
@@ -2694,7 +2401,7 @@ var repeat = {
|
|
|
2694
2401
|
title: "Repeat",
|
|
2695
2402
|
description: "Loop over an array of items.",
|
|
2696
2403
|
searchTerms: ["repeat", "for", "loop"],
|
|
2697
|
-
icon: /* @__PURE__ */
|
|
2404
|
+
icon: /* @__PURE__ */ jsx16(Repeat2, { className: "mly-h-4 mly-w-4" }),
|
|
2698
2405
|
command: ({ editor, range }) => {
|
|
2699
2406
|
editor.chain().focus().deleteRange(range).setRepeat().run();
|
|
2700
2407
|
}
|
|
@@ -2703,7 +2410,7 @@ var spacer = {
|
|
|
2703
2410
|
title: "Spacer",
|
|
2704
2411
|
description: "Add space between blocks.",
|
|
2705
2412
|
searchTerms: ["space", "gap", "divider"],
|
|
2706
|
-
icon: /* @__PURE__ */
|
|
2413
|
+
icon: /* @__PURE__ */ jsx16(MoveVertical, { className: "mly-h-4 mly-w-4" }),
|
|
2707
2414
|
command: ({ editor, range }) => {
|
|
2708
2415
|
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
2709
2416
|
}
|
|
@@ -2712,7 +2419,7 @@ var divider = {
|
|
|
2712
2419
|
title: "Divider",
|
|
2713
2420
|
description: "Add a horizontal divider.",
|
|
2714
2421
|
searchTerms: ["divider", "line"],
|
|
2715
|
-
icon: /* @__PURE__ */
|
|
2422
|
+
icon: /* @__PURE__ */ jsx16(Minus, { className: "mly-h-4 mly-w-4" }),
|
|
2716
2423
|
command: ({ editor, range }) => {
|
|
2717
2424
|
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
2718
2425
|
}
|
|
@@ -2720,12 +2427,12 @@ var divider = {
|
|
|
2720
2427
|
|
|
2721
2428
|
// src/blocks/list.tsx
|
|
2722
2429
|
import { List, ListOrdered } from "lucide-react";
|
|
2723
|
-
import { jsx as
|
|
2430
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2724
2431
|
var bulletList = {
|
|
2725
2432
|
title: "Bullet List",
|
|
2726
2433
|
description: "Create a simple bullet list.",
|
|
2727
2434
|
searchTerms: ["unordered", "point"],
|
|
2728
|
-
icon: /* @__PURE__ */
|
|
2435
|
+
icon: /* @__PURE__ */ jsx17(List, { className: "mly-h-4 mly-w-4" }),
|
|
2729
2436
|
command: ({ editor, range }) => {
|
|
2730
2437
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
2731
2438
|
}
|
|
@@ -2734,7 +2441,7 @@ var orderedList = {
|
|
|
2734
2441
|
title: "Numbered List",
|
|
2735
2442
|
description: "Create a list with numbering.",
|
|
2736
2443
|
searchTerms: ["ordered"],
|
|
2737
|
-
icon: /* @__PURE__ */
|
|
2444
|
+
icon: /* @__PURE__ */ jsx17(ListOrdered, { className: "mly-h-4 mly-w-4" }),
|
|
2738
2445
|
command: ({ editor, range }) => {
|
|
2739
2446
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
2740
2447
|
}
|
|
@@ -2751,12 +2458,12 @@ import {
|
|
|
2751
2458
|
FootprintsIcon,
|
|
2752
2459
|
EraserIcon
|
|
2753
2460
|
} from "lucide-react";
|
|
2754
|
-
import { jsx as
|
|
2461
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2755
2462
|
var text = {
|
|
2756
2463
|
title: "Text",
|
|
2757
2464
|
description: "Just start typing with plain text.",
|
|
2758
2465
|
searchTerms: ["p", "paragraph"],
|
|
2759
|
-
icon: /* @__PURE__ */
|
|
2466
|
+
icon: /* @__PURE__ */ jsx18(Text, { className: "mly-h-4 mly-w-4" }),
|
|
2760
2467
|
command: ({ editor, range }) => {
|
|
2761
2468
|
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
2762
2469
|
}
|
|
@@ -2765,7 +2472,7 @@ var heading1 = {
|
|
|
2765
2472
|
title: "Heading 1",
|
|
2766
2473
|
description: "Big heading.",
|
|
2767
2474
|
searchTerms: ["h1", "title", "big", "large"],
|
|
2768
|
-
icon: /* @__PURE__ */
|
|
2475
|
+
icon: /* @__PURE__ */ jsx18(Heading1, { className: "mly-h-4 mly-w-4" }),
|
|
2769
2476
|
command: ({ editor, range }) => {
|
|
2770
2477
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
2771
2478
|
}
|
|
@@ -2774,7 +2481,7 @@ var heading2 = {
|
|
|
2774
2481
|
title: "Heading 2",
|
|
2775
2482
|
description: "Medium heading.",
|
|
2776
2483
|
searchTerms: ["h2", "subtitle", "medium"],
|
|
2777
|
-
icon: /* @__PURE__ */
|
|
2484
|
+
icon: /* @__PURE__ */ jsx18(Heading2, { className: "mly-h-4 mly-w-4" }),
|
|
2778
2485
|
command: ({ editor, range }) => {
|
|
2779
2486
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
2780
2487
|
}
|
|
@@ -2783,7 +2490,7 @@ var heading3 = {
|
|
|
2783
2490
|
title: "Heading 3",
|
|
2784
2491
|
description: "Small heading.",
|
|
2785
2492
|
searchTerms: ["h3", "subtitle", "small"],
|
|
2786
|
-
icon: /* @__PURE__ */
|
|
2493
|
+
icon: /* @__PURE__ */ jsx18(Heading3, { className: "mly-h-4 mly-w-4" }),
|
|
2787
2494
|
command: ({ editor, range }) => {
|
|
2788
2495
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
2789
2496
|
}
|
|
@@ -2792,7 +2499,7 @@ var hardBreak = {
|
|
|
2792
2499
|
title: "Hard Break",
|
|
2793
2500
|
description: "Add a break between lines.",
|
|
2794
2501
|
searchTerms: ["break", "line"],
|
|
2795
|
-
icon: /* @__PURE__ */
|
|
2502
|
+
icon: /* @__PURE__ */ jsx18(DivideIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2796
2503
|
command: ({ editor, range }) => {
|
|
2797
2504
|
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
2798
2505
|
}
|
|
@@ -2801,7 +2508,7 @@ var blockquote = {
|
|
|
2801
2508
|
title: "Blockquote",
|
|
2802
2509
|
description: "Add blockquote.",
|
|
2803
2510
|
searchTerms: ["quote", "blockquote"],
|
|
2804
|
-
icon: /* @__PURE__ */
|
|
2511
|
+
icon: /* @__PURE__ */ jsx18(TextQuote, { className: "mly-h-4 mly-w-4" }),
|
|
2805
2512
|
command: ({ editor, range }) => {
|
|
2806
2513
|
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
2807
2514
|
}
|
|
@@ -2810,7 +2517,7 @@ var footer = {
|
|
|
2810
2517
|
title: "Footer",
|
|
2811
2518
|
description: "Add a footer text to email.",
|
|
2812
2519
|
searchTerms: ["footer", "text"],
|
|
2813
|
-
icon: /* @__PURE__ */
|
|
2520
|
+
icon: /* @__PURE__ */ jsx18(FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2814
2521
|
command: ({ editor, range }) => {
|
|
2815
2522
|
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
2816
2523
|
}
|
|
@@ -2819,16 +2526,16 @@ var clearLine = {
|
|
|
2819
2526
|
title: "Clear Line",
|
|
2820
2527
|
description: "Clear the current line.",
|
|
2821
2528
|
searchTerms: ["clear", "line"],
|
|
2822
|
-
icon: /* @__PURE__ */
|
|
2529
|
+
icon: /* @__PURE__ */ jsx18(EraserIcon, { className: "mly-h-4 mly-w-4" }),
|
|
2823
2530
|
command: ({ editor, range }) => {
|
|
2824
2531
|
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
2825
2532
|
}
|
|
2826
2533
|
};
|
|
2827
2534
|
|
|
2828
2535
|
// src/editor/components/icons/logo-with-cover-image.tsx
|
|
2829
|
-
import { jsx as
|
|
2536
|
+
import { jsx as jsx19, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2830
2537
|
function LogoWithCoverImageIcon(props) {
|
|
2831
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ jsxs7(
|
|
2832
2539
|
"svg",
|
|
2833
2540
|
__spreadProps(__spreadValues({
|
|
2834
2541
|
width: "14",
|
|
@@ -2838,7 +2545,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
2838
2545
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2839
2546
|
}, props), {
|
|
2840
2547
|
children: [
|
|
2841
|
-
/* @__PURE__ */
|
|
2548
|
+
/* @__PURE__ */ jsx19(
|
|
2842
2549
|
"path",
|
|
2843
2550
|
{
|
|
2844
2551
|
fillRule: "evenodd",
|
|
@@ -2847,7 +2554,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
2847
2554
|
fill: "currentColor"
|
|
2848
2555
|
}
|
|
2849
2556
|
),
|
|
2850
|
-
/* @__PURE__ */
|
|
2557
|
+
/* @__PURE__ */ jsx19(
|
|
2851
2558
|
"path",
|
|
2852
2559
|
{
|
|
2853
2560
|
fillRule: "evenodd",
|
|
@@ -2856,7 +2563,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
2856
2563
|
fill: "currentColor"
|
|
2857
2564
|
}
|
|
2858
2565
|
),
|
|
2859
|
-
/* @__PURE__ */
|
|
2566
|
+
/* @__PURE__ */ jsx19(
|
|
2860
2567
|
"path",
|
|
2861
2568
|
{
|
|
2862
2569
|
fillRule: "evenodd",
|
|
@@ -2865,8 +2572,8 @@ function LogoWithCoverImageIcon(props) {
|
|
|
2865
2572
|
fill: "currentColor"
|
|
2866
2573
|
}
|
|
2867
2574
|
),
|
|
2868
|
-
/* @__PURE__ */
|
|
2869
|
-
/* @__PURE__ */
|
|
2575
|
+
/* @__PURE__ */ jsx19("mask", { id: "path-4-inside-1_1046_19527", fill: "white", children: /* @__PURE__ */ jsx19("rect", { x: "3", y: "4", width: "8", height: "3", rx: "0.5" }) }),
|
|
2576
|
+
/* @__PURE__ */ jsx19(
|
|
2870
2577
|
"rect",
|
|
2871
2578
|
{
|
|
2872
2579
|
x: "3",
|
|
@@ -2879,7 +2586,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
2879
2586
|
mask: "url(#path-4-inside-1_1046_19527)"
|
|
2880
2587
|
}
|
|
2881
2588
|
),
|
|
2882
|
-
/* @__PURE__ */
|
|
2589
|
+
/* @__PURE__ */ jsx19(
|
|
2883
2590
|
"rect",
|
|
2884
2591
|
{
|
|
2885
2592
|
x: "6.25",
|
|
@@ -2891,16 +2598,16 @@ function LogoWithCoverImageIcon(props) {
|
|
|
2891
2598
|
strokeWidth: "0.5"
|
|
2892
2599
|
}
|
|
2893
2600
|
),
|
|
2894
|
-
/* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ jsx19("rect", { x: "3", y: "8", width: "2", height: "1", rx: "0.5", fill: "currentColor" })
|
|
2895
2602
|
]
|
|
2896
2603
|
})
|
|
2897
2604
|
);
|
|
2898
2605
|
}
|
|
2899
2606
|
|
|
2900
2607
|
// src/editor/components/icons/logo-with-text-horizon.tsx
|
|
2901
|
-
import { jsx as
|
|
2608
|
+
import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2902
2609
|
function LogoWithTextHorizonIcon(props) {
|
|
2903
|
-
return /* @__PURE__ */
|
|
2610
|
+
return /* @__PURE__ */ jsxs8(
|
|
2904
2611
|
"svg",
|
|
2905
2612
|
__spreadProps(__spreadValues({
|
|
2906
2613
|
width: "14",
|
|
@@ -2910,7 +2617,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
2910
2617
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2911
2618
|
}, props), {
|
|
2912
2619
|
children: [
|
|
2913
|
-
/* @__PURE__ */
|
|
2620
|
+
/* @__PURE__ */ jsx20(
|
|
2914
2621
|
"path",
|
|
2915
2622
|
{
|
|
2916
2623
|
fillRule: "evenodd",
|
|
@@ -2919,7 +2626,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
2919
2626
|
fill: "currentColor"
|
|
2920
2627
|
}
|
|
2921
2628
|
),
|
|
2922
|
-
/* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ jsx20(
|
|
2923
2630
|
"rect",
|
|
2924
2631
|
{
|
|
2925
2632
|
x: "6.25",
|
|
@@ -2931,8 +2638,8 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
2931
2638
|
strokeWidth: "0.5"
|
|
2932
2639
|
}
|
|
2933
2640
|
),
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsx20("rect", { x: "3", y: "6.5", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
2642
|
+
/* @__PURE__ */ jsx20(
|
|
2936
2643
|
"path",
|
|
2937
2644
|
{
|
|
2938
2645
|
fillRule: "evenodd",
|
|
@@ -2941,7 +2648,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
2941
2648
|
fill: "currentColor"
|
|
2942
2649
|
}
|
|
2943
2650
|
),
|
|
2944
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ jsx20(
|
|
2945
2652
|
"path",
|
|
2946
2653
|
{
|
|
2947
2654
|
fillRule: "evenodd",
|
|
@@ -2956,9 +2663,9 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
2956
2663
|
}
|
|
2957
2664
|
|
|
2958
2665
|
// src/editor/components/icons/logo-with-text-vertical.tsx
|
|
2959
|
-
import { jsx as
|
|
2666
|
+
import { jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2960
2667
|
function LogoWithTextVerticalIcon(props) {
|
|
2961
|
-
return /* @__PURE__ */
|
|
2668
|
+
return /* @__PURE__ */ jsxs9(
|
|
2962
2669
|
"svg",
|
|
2963
2670
|
__spreadProps(__spreadValues({
|
|
2964
2671
|
width: "14",
|
|
@@ -2968,7 +2675,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
2968
2675
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2969
2676
|
}, props), {
|
|
2970
2677
|
children: [
|
|
2971
|
-
/* @__PURE__ */
|
|
2678
|
+
/* @__PURE__ */ jsx21(
|
|
2972
2679
|
"path",
|
|
2973
2680
|
{
|
|
2974
2681
|
fillRule: "evenodd",
|
|
@@ -2977,7 +2684,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
2977
2684
|
fill: "currentColor"
|
|
2978
2685
|
}
|
|
2979
2686
|
),
|
|
2980
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx21(
|
|
2981
2688
|
"rect",
|
|
2982
2689
|
{
|
|
2983
2690
|
x: "4.25",
|
|
@@ -2989,8 +2696,8 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
2989
2696
|
strokeWidth: "0.5"
|
|
2990
2697
|
}
|
|
2991
2698
|
),
|
|
2992
|
-
/* @__PURE__ */
|
|
2993
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ jsx21("rect", { x: "6", y: "6", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
2700
|
+
/* @__PURE__ */ jsx21(
|
|
2994
2701
|
"path",
|
|
2995
2702
|
{
|
|
2996
2703
|
fillRule: "evenodd",
|
|
@@ -2999,7 +2706,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
2999
2706
|
fill: "currentColor"
|
|
3000
2707
|
}
|
|
3001
2708
|
),
|
|
3002
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ jsx21(
|
|
3003
2710
|
"path",
|
|
3004
2711
|
{
|
|
3005
2712
|
fillRule: "evenodd",
|
|
@@ -3014,12 +2721,12 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
3014
2721
|
}
|
|
3015
2722
|
|
|
3016
2723
|
// src/blocks/headers.tsx
|
|
3017
|
-
import { jsx as
|
|
2724
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3018
2725
|
var headerLogoWithTextHorizontal = {
|
|
3019
2726
|
title: "Logo with Text (Horizontal)",
|
|
3020
2727
|
description: "Logo and a text horizontally",
|
|
3021
2728
|
searchTerms: ["logo", "text"],
|
|
3022
|
-
icon: /* @__PURE__ */
|
|
2729
|
+
icon: /* @__PURE__ */ jsx22(LogoWithTextHorizonIcon, { className: "mly-h-4 mly-w-4" }),
|
|
3023
2730
|
command: ({ editor, range }) => {
|
|
3024
2731
|
editor.chain().deleteRange(range).insertContent({
|
|
3025
2732
|
type: "columns",
|
|
@@ -3083,7 +2790,7 @@ var headerLogoWithTextVertical = {
|
|
|
3083
2790
|
title: "Logo with Text (Vertical)",
|
|
3084
2791
|
description: "Logo and a text vertically",
|
|
3085
2792
|
searchTerms: ["logo", "text"],
|
|
3086
|
-
icon: /* @__PURE__ */
|
|
2793
|
+
icon: /* @__PURE__ */ jsx22(LogoWithTextVerticalIcon, { className: "mly-h-4 mly-w-4" }),
|
|
3087
2794
|
command: ({ editor, range }) => {
|
|
3088
2795
|
editor.chain().deleteRange(range).insertContent([
|
|
3089
2796
|
{
|
|
@@ -3114,7 +2821,7 @@ var headerLogoWithCoverImage = {
|
|
|
3114
2821
|
title: "Logo with Cover Image",
|
|
3115
2822
|
description: "Logo and a cover image",
|
|
3116
2823
|
searchTerms: ["logo", "cover", "image"],
|
|
3117
|
-
icon: /* @__PURE__ */
|
|
2824
|
+
icon: /* @__PURE__ */ jsx22(LogoWithCoverImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
3118
2825
|
command: ({ editor, range }) => {
|
|
3119
2826
|
const todayFormatted = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
3120
2827
|
year: "numeric",
|
|
@@ -3207,12 +2914,12 @@ import {
|
|
|
3207
2914
|
LayoutTemplateIcon,
|
|
3208
2915
|
RectangleHorizontalIcon
|
|
3209
2916
|
} from "lucide-react";
|
|
3210
|
-
import { jsx as
|
|
2917
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3211
2918
|
var footerCopyrightText = {
|
|
3212
2919
|
title: "Footer Copyright",
|
|
3213
2920
|
description: "Copyright text for the footer.",
|
|
3214
2921
|
searchTerms: ["footer", "copyright"],
|
|
3215
|
-
icon: /* @__PURE__ */
|
|
2922
|
+
icon: /* @__PURE__ */ jsx23(CopyrightIcon, { className: "mly-h-4 mly-w-4" }),
|
|
3216
2923
|
command: ({ editor, range }) => {
|
|
3217
2924
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
3218
2925
|
editor.chain().focus().deleteRange(range).insertContent({
|
|
@@ -3232,7 +2939,7 @@ var footerCommunityFeedbackCta = {
|
|
|
3232
2939
|
title: "Footer Community Feedback CTA",
|
|
3233
2940
|
description: "Community feedback CTA for the footer.",
|
|
3234
2941
|
searchTerms: ["footer", "community", "feedback", "cta"],
|
|
3235
|
-
icon: /* @__PURE__ */
|
|
2942
|
+
icon: /* @__PURE__ */ jsx23(RectangleHorizontalIcon, { className: "mly-h-4 mly-w-4" }),
|
|
3236
2943
|
command: ({ editor, range }) => {
|
|
3237
2944
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
3238
2945
|
{
|
|
@@ -3275,7 +2982,7 @@ var footerCompanySignature = {
|
|
|
3275
2982
|
title: "Footer Company Signature",
|
|
3276
2983
|
description: "Company signature for the footer.",
|
|
3277
2984
|
searchTerms: ["footer", "company", "signature"],
|
|
3278
|
-
icon: /* @__PURE__ */
|
|
2985
|
+
icon: /* @__PURE__ */ jsx23(LayoutTemplateIcon, { className: "mly-h-4 mly-w-4" }),
|
|
3279
2986
|
command: ({ editor, range }) => {
|
|
3280
2987
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
3281
2988
|
{ type: "horizontalRule" },
|
|
@@ -3429,7 +3136,7 @@ var footerCompanySignature = {
|
|
|
3429
3136
|
};
|
|
3430
3137
|
|
|
3431
3138
|
// src/editor/extensions/slash-command/default-slash-commands.tsx
|
|
3432
|
-
import { jsx as
|
|
3139
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3433
3140
|
var DEFAULT_SLASH_COMMANDS = [
|
|
3434
3141
|
{
|
|
3435
3142
|
title: "Blocks",
|
|
@@ -3464,7 +3171,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
3464
3171
|
title: "Headers",
|
|
3465
3172
|
description: "Add pre-designed headers block",
|
|
3466
3173
|
searchTerms: ["header", "headers"],
|
|
3467
|
-
icon: /* @__PURE__ */
|
|
3174
|
+
icon: /* @__PURE__ */ jsx24(Heading12, { className: "mly-h-4 mly-w-4" }),
|
|
3468
3175
|
preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
|
|
3469
3176
|
commands: [
|
|
3470
3177
|
headerLogoWithTextVertical,
|
|
@@ -3477,7 +3184,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
3477
3184
|
title: "Footers",
|
|
3478
3185
|
description: "Add pre-designed footers block",
|
|
3479
3186
|
searchTerms: ["footers"],
|
|
3480
|
-
icon: /* @__PURE__ */
|
|
3187
|
+
icon: /* @__PURE__ */ jsx24(FootprintsIcon2, { className: "mly-h-4 mly-w-4" }),
|
|
3481
3188
|
commands: [
|
|
3482
3189
|
footerCopyrightText,
|
|
3483
3190
|
footerCommunityFeedbackCta,
|
|
@@ -3490,7 +3197,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
3490
3197
|
];
|
|
3491
3198
|
|
|
3492
3199
|
// src/editor/provider.tsx
|
|
3493
|
-
import { jsx as
|
|
3200
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3494
3201
|
var DEFAULT_PLACEHOLDER_URL = "https://maily.to/";
|
|
3495
3202
|
var MailyContext = createContext({
|
|
3496
3203
|
placeholderUrl: DEFAULT_PLACEHOLDER_URL,
|
|
@@ -3504,8 +3211,160 @@ function useMailyContext() {
|
|
|
3504
3211
|
return values;
|
|
3505
3212
|
}
|
|
3506
3213
|
|
|
3214
|
+
// src/editor/utils/node-options.ts
|
|
3215
|
+
import { useMemo as useMemo2 } from "react";
|
|
3216
|
+
function getNodeOptions(editor, name) {
|
|
3217
|
+
const node = editor.extensionManager.extensions.find(
|
|
3218
|
+
(extension) => extension.name === name
|
|
3219
|
+
);
|
|
3220
|
+
if (!node) {
|
|
3221
|
+
throw new Error(`Node ${name} not found`);
|
|
3222
|
+
}
|
|
3223
|
+
return node.options;
|
|
3224
|
+
}
|
|
3225
|
+
function getVariableOptions(editor) {
|
|
3226
|
+
return getNodeOptions(editor, "variable");
|
|
3227
|
+
}
|
|
3228
|
+
function useVariableOptions(editor) {
|
|
3229
|
+
return useMemo2(() => {
|
|
3230
|
+
return getVariableOptions(editor);
|
|
3231
|
+
}, [editor]);
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
// src/editor/utils/use-outside-click.ts
|
|
3235
|
+
import { useCallback as useCallback4 } from "react";
|
|
3236
|
+
import { useEffect as useEffect3 } from "react";
|
|
3237
|
+
function useOutsideClick(ref, callback) {
|
|
3238
|
+
const handleClick = useCallback4(
|
|
3239
|
+
(e) => {
|
|
3240
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
3241
|
+
callback();
|
|
3242
|
+
}
|
|
3243
|
+
},
|
|
3244
|
+
[ref, callback]
|
|
3245
|
+
);
|
|
3246
|
+
useEffect3(() => {
|
|
3247
|
+
document.addEventListener("mousedown", handleClick);
|
|
3248
|
+
document.addEventListener("touchstart", handleClick);
|
|
3249
|
+
return () => {
|
|
3250
|
+
document.removeEventListener("mousedown", handleClick);
|
|
3251
|
+
document.removeEventListener("touchstart", handleClick);
|
|
3252
|
+
};
|
|
3253
|
+
}, [handleClick]);
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
// src/editor/components/ui/input-autocomplete.tsx
|
|
3257
|
+
import { CornerDownLeft } from "lucide-react";
|
|
3258
|
+
import { forwardRef as forwardRef6, useRef as useRef3 } from "react";
|
|
3259
|
+
import { jsx as jsx26, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3260
|
+
var InputAutocomplete = forwardRef6((props, ref) => {
|
|
3261
|
+
var _b;
|
|
3262
|
+
const _a = props, {
|
|
3263
|
+
value = "",
|
|
3264
|
+
onValueChange,
|
|
3265
|
+
className,
|
|
3266
|
+
onOutsideClick,
|
|
3267
|
+
onSelectOption,
|
|
3268
|
+
autoCompleteOptions = [],
|
|
3269
|
+
triggerChar = "",
|
|
3270
|
+
editor
|
|
3271
|
+
} = _a, inputProps = __objRest(_a, [
|
|
3272
|
+
"value",
|
|
3273
|
+
"onValueChange",
|
|
3274
|
+
"className",
|
|
3275
|
+
"onOutsideClick",
|
|
3276
|
+
"onSelectOption",
|
|
3277
|
+
"autoCompleteOptions",
|
|
3278
|
+
"triggerChar",
|
|
3279
|
+
"editor"
|
|
3280
|
+
]);
|
|
3281
|
+
const containerRef = useRef3(null);
|
|
3282
|
+
const popoverRef = useRef3(null);
|
|
3283
|
+
const VariableSuggestionPopoverComponent = (_b = useVariableOptions(editor)) == null ? void 0 : _b.variableSuggestionsPopover;
|
|
3284
|
+
useOutsideClick(containerRef, () => {
|
|
3285
|
+
onOutsideClick == null ? void 0 : onOutsideClick();
|
|
3286
|
+
});
|
|
3287
|
+
const isTriggeringVariable = value.startsWith(triggerChar);
|
|
3288
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("mly-relative"), ref: containerRef, children: [
|
|
3289
|
+
/* @__PURE__ */ jsxs10("label", { className: "mly-relative", children: [
|
|
3290
|
+
/* @__PURE__ */ jsx26(
|
|
3291
|
+
"input",
|
|
3292
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
3293
|
+
placeholder: "e.g. items",
|
|
3294
|
+
type: "text"
|
|
3295
|
+
}), inputProps), {
|
|
3296
|
+
ref,
|
|
3297
|
+
value,
|
|
3298
|
+
onChange: (e) => {
|
|
3299
|
+
onValueChange(e.target.value);
|
|
3300
|
+
},
|
|
3301
|
+
className: cn(
|
|
3302
|
+
"mly-h-7 mly-w-40 mly-rounded-md mly-bg-white 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",
|
|
3303
|
+
className
|
|
3304
|
+
),
|
|
3305
|
+
onKeyDown: (e) => {
|
|
3306
|
+
if (!popoverRef.current || !isTriggeringVariable) {
|
|
3307
|
+
return;
|
|
3308
|
+
}
|
|
3309
|
+
const { moveUp, moveDown, select } = popoverRef.current;
|
|
3310
|
+
if (e.key === "ArrowDown") {
|
|
3311
|
+
e.preventDefault();
|
|
3312
|
+
moveDown();
|
|
3313
|
+
} else if (e.key === "ArrowUp") {
|
|
3314
|
+
e.preventDefault();
|
|
3315
|
+
moveUp();
|
|
3316
|
+
} else if (e.key === "Enter") {
|
|
3317
|
+
e.preventDefault();
|
|
3318
|
+
select();
|
|
3319
|
+
}
|
|
3320
|
+
},
|
|
3321
|
+
spellCheck: false
|
|
3322
|
+
})
|
|
3323
|
+
),
|
|
3324
|
+
/* @__PURE__ */ jsx26("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx26(CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
3325
|
+
] }),
|
|
3326
|
+
isTriggeringVariable && /* @__PURE__ */ jsx26("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ jsx26(
|
|
3327
|
+
VariableSuggestionPopoverComponent,
|
|
3328
|
+
{
|
|
3329
|
+
items: autoCompleteOptions.map((option) => {
|
|
3330
|
+
return {
|
|
3331
|
+
name: option
|
|
3332
|
+
};
|
|
3333
|
+
}),
|
|
3334
|
+
onSelectItem: (item) => {
|
|
3335
|
+
onSelectOption == null ? void 0 : onSelectOption(item.name);
|
|
3336
|
+
},
|
|
3337
|
+
ref: popoverRef
|
|
3338
|
+
}
|
|
3339
|
+
) })
|
|
3340
|
+
] });
|
|
3341
|
+
});
|
|
3342
|
+
InputAutocomplete.displayName = "InputAutocomplete";
|
|
3343
|
+
|
|
3344
|
+
// src/editor/utils/variable.ts
|
|
3345
|
+
function processVariables(variables, options) {
|
|
3346
|
+
const { query } = options;
|
|
3347
|
+
const queryLower = query.toLowerCase();
|
|
3348
|
+
let filteredVariables = [];
|
|
3349
|
+
if (Array.isArray(variables)) {
|
|
3350
|
+
filteredVariables = variables.filter(
|
|
3351
|
+
(variable) => variable.name.toLowerCase().startsWith(queryLower)
|
|
3352
|
+
);
|
|
3353
|
+
if (query.length > 0 && !filteredVariables.some((variable) => variable.name === query)) {
|
|
3354
|
+
filteredVariables.push({ name: query, required: true });
|
|
3355
|
+
}
|
|
3356
|
+
return filteredVariables;
|
|
3357
|
+
} else if (typeof variables === "function") {
|
|
3358
|
+
return variables(options);
|
|
3359
|
+
} else {
|
|
3360
|
+
throw new Error(`Invalid variables type. Expected 'Array' or 'Function', but received '${typeof variables}'.
|
|
3361
|
+
|
|
3362
|
+
You can check out the documentation for more information: https://github.com/arikchakma/maily.to/blob/main/packages/core/readme.md`);
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3507
3366
|
// src/editor/components/ui/link-input-popover.tsx
|
|
3508
|
-
import { useMemo as
|
|
3367
|
+
import { useMemo as useMemo4 } from "react";
|
|
3509
3368
|
|
|
3510
3369
|
// src/editor/nodes/variable/variable.ts
|
|
3511
3370
|
import { mergeAttributes as mergeAttributes7, Node as Node8 } from "@tiptap/core";
|
|
@@ -3524,15 +3383,15 @@ import {
|
|
|
3524
3383
|
forwardRef as forwardRef7,
|
|
3525
3384
|
useEffect as useEffect4,
|
|
3526
3385
|
useImperativeHandle,
|
|
3527
|
-
useRef as
|
|
3528
|
-
useState as
|
|
3386
|
+
useRef as useRef4,
|
|
3387
|
+
useState as useState3
|
|
3529
3388
|
} from "react";
|
|
3530
|
-
import { jsx as
|
|
3389
|
+
import { jsx as jsx27, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3531
3390
|
var VariableSuggestionsPopover = forwardRef7((props, ref) => {
|
|
3532
3391
|
const { items, onSelectItem } = props;
|
|
3533
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3534
|
-
const scrollContainerRef =
|
|
3535
|
-
const itemRefs =
|
|
3392
|
+
const [selectedIndex, setSelectedIndex] = useState3(0);
|
|
3393
|
+
const scrollContainerRef = useRef4(null);
|
|
3394
|
+
const itemRefs = useRef4([]);
|
|
3536
3395
|
const scrollSelectedIntoView = (index) => {
|
|
3537
3396
|
const container = scrollContainerRef.current;
|
|
3538
3397
|
const selectedItem = itemRefs.current[index];
|
|
@@ -3573,17 +3432,17 @@ var VariableSuggestionsPopover = forwardRef7((props, ref) => {
|
|
|
3573
3432
|
onSelectItem(item);
|
|
3574
3433
|
}
|
|
3575
3434
|
}));
|
|
3576
|
-
return /* @__PURE__ */
|
|
3577
|
-
/* @__PURE__ */
|
|
3578
|
-
/* @__PURE__ */
|
|
3579
|
-
/* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ jsxs11("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: [
|
|
3436
|
+
/* @__PURE__ */ jsxs11("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: [
|
|
3437
|
+
/* @__PURE__ */ jsx27("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
|
|
3438
|
+
/* @__PURE__ */ jsx27(VariableIcon, { children: /* @__PURE__ */ jsx27(Braces, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
3580
3439
|
] }),
|
|
3581
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ jsx27(
|
|
3582
3441
|
"div",
|
|
3583
3442
|
{
|
|
3584
3443
|
ref: scrollContainerRef,
|
|
3585
3444
|
className: "mly-max-h-52 mly-overflow-y-auto mly-scrollbar-thin mly-scrollbar-track-transparent mly-scrollbar-thumb-gray-200",
|
|
3586
|
-
children: /* @__PURE__ */
|
|
3445
|
+
children: /* @__PURE__ */ jsx27("div", { className: "mly-flex mly-w-fit mly-min-w-full 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__ */ jsxs11(
|
|
3587
3446
|
"button",
|
|
3588
3447
|
{
|
|
3589
3448
|
ref: (el) => itemRefs.current[index] = el,
|
|
@@ -3593,27 +3452,27 @@ var VariableSuggestionsPopover = forwardRef7((props, ref) => {
|
|
|
3593
3452
|
index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
|
|
3594
3453
|
),
|
|
3595
3454
|
children: [
|
|
3596
|
-
/* @__PURE__ */
|
|
3455
|
+
/* @__PURE__ */ jsx27(Braces, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
3597
3456
|
item.name
|
|
3598
3457
|
]
|
|
3599
3458
|
},
|
|
3600
3459
|
index
|
|
3601
|
-
)) : /* @__PURE__ */
|
|
3460
|
+
)) : /* @__PURE__ */ jsx27("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" }) })
|
|
3602
3461
|
}
|
|
3603
3462
|
),
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3606
|
-
/* @__PURE__ */
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3463
|
+
/* @__PURE__ */ jsxs11("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: [
|
|
3464
|
+
/* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
|
|
3465
|
+
/* @__PURE__ */ jsx27(VariableIcon, { children: /* @__PURE__ */ jsx27(ArrowDownIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
3466
|
+
/* @__PURE__ */ jsx27(VariableIcon, { children: /* @__PURE__ */ jsx27(ArrowUpIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
|
|
3467
|
+
/* @__PURE__ */ jsx27("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
|
|
3609
3468
|
] }),
|
|
3610
|
-
/* @__PURE__ */
|
|
3469
|
+
/* @__PURE__ */ jsx27(VariableIcon, { children: /* @__PURE__ */ jsx27(CornerDownLeftIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) })
|
|
3611
3470
|
] })
|
|
3612
3471
|
] });
|
|
3613
3472
|
});
|
|
3614
3473
|
function VariableIcon(props) {
|
|
3615
3474
|
const { className, children } = props;
|
|
3616
|
-
return /* @__PURE__ */
|
|
3475
|
+
return /* @__PURE__ */ jsx27(
|
|
3617
3476
|
"div",
|
|
3618
3477
|
{
|
|
3619
3478
|
className: cn(
|
|
@@ -3628,35 +3487,35 @@ function VariableIcon(props) {
|
|
|
3628
3487
|
// src/editor/nodes/variable/variable-view.tsx
|
|
3629
3488
|
import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
|
|
3630
3489
|
import { AlertTriangle, Braces as Braces2, Pencil } from "lucide-react";
|
|
3631
|
-
import { useMemo as
|
|
3632
|
-
import { jsx as
|
|
3490
|
+
import { useMemo as useMemo3 } from "react";
|
|
3491
|
+
import { jsx as jsx28, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3633
3492
|
function VariableView(props) {
|
|
3634
3493
|
const { node, updateAttributes: updateAttributes2, editor } = props;
|
|
3635
3494
|
const { id, fallback, required } = node.attrs;
|
|
3636
|
-
const renderVariable =
|
|
3495
|
+
const renderVariable = useMemo3(() => {
|
|
3637
3496
|
var _a, _b;
|
|
3638
3497
|
const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
|
|
3639
3498
|
return variableRender;
|
|
3640
3499
|
}, [editor]);
|
|
3641
|
-
return /* @__PURE__ */
|
|
3500
|
+
return /* @__PURE__ */ jsx28(
|
|
3642
3501
|
NodeViewWrapper4,
|
|
3643
3502
|
{
|
|
3644
3503
|
className: "react-component mly-inline-block mly-leading-none",
|
|
3645
3504
|
draggable: "false",
|
|
3646
|
-
children: /* @__PURE__ */
|
|
3505
|
+
children: /* @__PURE__ */ jsxs12(
|
|
3647
3506
|
Popover,
|
|
3648
3507
|
{
|
|
3649
3508
|
onOpenChange: (open) => {
|
|
3650
3509
|
editor.storage.variable.popover = open;
|
|
3651
3510
|
},
|
|
3652
3511
|
children: [
|
|
3653
|
-
/* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ jsx28(PopoverTrigger, { children: renderVariable({
|
|
3654
3513
|
variable: { name: id, required, valid: true },
|
|
3655
3514
|
fallback,
|
|
3656
3515
|
editor,
|
|
3657
3516
|
from: "content-variable"
|
|
3658
3517
|
}) }),
|
|
3659
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ jsx28(
|
|
3660
3519
|
PopoverContent,
|
|
3661
3520
|
{
|
|
3662
3521
|
align: "start",
|
|
@@ -3665,10 +3524,10 @@ function VariableView(props) {
|
|
|
3665
3524
|
sideOffset: 8,
|
|
3666
3525
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3667
3526
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
3668
|
-
children: /* @__PURE__ */
|
|
3669
|
-
/* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3671
|
-
/* @__PURE__ */
|
|
3527
|
+
children: /* @__PURE__ */ jsx28(TooltipProvider, { children: /* @__PURE__ */ jsxs12("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
|
|
3528
|
+
/* @__PURE__ */ jsxs12("label", { className: "mly-relative", children: [
|
|
3529
|
+
/* @__PURE__ */ jsx28("span", { className: "mly-inline-block mly-px-2 mly-text-xs mly-text-midnight-gray", children: "Variable" }),
|
|
3530
|
+
/* @__PURE__ */ jsx28(
|
|
3672
3531
|
"input",
|
|
3673
3532
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
3674
3533
|
value: id != null ? id : "",
|
|
@@ -3682,10 +3541,10 @@ function VariableView(props) {
|
|
|
3682
3541
|
})
|
|
3683
3542
|
)
|
|
3684
3543
|
] }),
|
|
3685
|
-
/* @__PURE__ */
|
|
3686
|
-
/* @__PURE__ */
|
|
3687
|
-
/* @__PURE__ */
|
|
3688
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsx28(Divider, { className: "mly-mx-1.5" }),
|
|
3545
|
+
/* @__PURE__ */ jsxs12("label", { className: "mly-relative", children: [
|
|
3546
|
+
/* @__PURE__ */ jsx28("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
|
|
3547
|
+
/* @__PURE__ */ jsx28(
|
|
3689
3548
|
"input",
|
|
3690
3549
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
3691
3550
|
value: fallback != null ? fallback : "",
|
|
@@ -3698,7 +3557,7 @@ function VariableView(props) {
|
|
|
3698
3557
|
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"
|
|
3699
3558
|
})
|
|
3700
3559
|
),
|
|
3701
|
-
/* @__PURE__ */
|
|
3560
|
+
/* @__PURE__ */ jsx28("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx28(Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
|
|
3702
3561
|
] })
|
|
3703
3562
|
] }) })
|
|
3704
3563
|
}
|
|
@@ -3713,13 +3572,13 @@ var DefaultRenderVariable = (props) => {
|
|
|
3713
3572
|
const { variable, fallback, from } = props;
|
|
3714
3573
|
const { name, required, valid } = variable;
|
|
3715
3574
|
if (from === "button-variable") {
|
|
3716
|
-
return /* @__PURE__ */
|
|
3717
|
-
/* @__PURE__ */
|
|
3718
|
-
/* @__PURE__ */
|
|
3575
|
+
return /* @__PURE__ */ jsxs12("div", { className: "mly-inline-grid mly-h-7 mly-max-w-xs mly-grid-cols-[12px_1fr] mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-border-[var(--button-var-border-color)] mly-px-2 mly-font-mono mly-text-sm", children: [
|
|
3576
|
+
/* @__PURE__ */ jsx28(Braces2, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]" }),
|
|
3577
|
+
/* @__PURE__ */ jsx28("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
|
|
3719
3578
|
] });
|
|
3720
3579
|
}
|
|
3721
3580
|
if (from === "bubble-variable") {
|
|
3722
|
-
return /* @__PURE__ */
|
|
3581
|
+
return /* @__PURE__ */ jsxs12(
|
|
3723
3582
|
"div",
|
|
3724
3583
|
{
|
|
3725
3584
|
className: cn(
|
|
@@ -3727,21 +3586,21 @@ var DefaultRenderVariable = (props) => {
|
|
|
3727
3586
|
!valid && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
|
|
3728
3587
|
),
|
|
3729
3588
|
children: [
|
|
3730
|
-
/* @__PURE__ */
|
|
3731
|
-
/* @__PURE__ */
|
|
3589
|
+
/* @__PURE__ */ jsx28(Braces2, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
3590
|
+
/* @__PURE__ */ jsx28("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
|
|
3732
3591
|
]
|
|
3733
3592
|
}
|
|
3734
3593
|
);
|
|
3735
3594
|
}
|
|
3736
|
-
return /* @__PURE__ */
|
|
3595
|
+
return /* @__PURE__ */ jsxs12(
|
|
3737
3596
|
"span",
|
|
3738
3597
|
{
|
|
3739
3598
|
tabIndex: -1,
|
|
3740
3599
|
className: "mly-inline-flex mly-items-center mly-gap-[var(--variable-icon-gap)] mly-rounded-full mly-border mly-border-gray-200 mly-px-1.5 mly-py-0.5 mly-leading-none",
|
|
3741
3600
|
children: [
|
|
3742
|
-
/* @__PURE__ */
|
|
3601
|
+
/* @__PURE__ */ jsx28(Braces2, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
|
|
3743
3602
|
name,
|
|
3744
|
-
required && !fallback && /* @__PURE__ */
|
|
3603
|
+
required && !fallback && /* @__PURE__ */ jsx28(AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
|
|
3745
3604
|
]
|
|
3746
3605
|
}
|
|
3747
3606
|
);
|
|
@@ -3918,7 +3777,7 @@ var VariableExtension = Node8.create({
|
|
|
3918
3777
|
});
|
|
3919
3778
|
|
|
3920
3779
|
// src/editor/components/ui/link-input-popover.tsx
|
|
3921
|
-
import { jsx as
|
|
3780
|
+
import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3922
3781
|
function LinkInputPopover(props) {
|
|
3923
3782
|
var _a, _b;
|
|
3924
3783
|
const {
|
|
@@ -3929,15 +3788,15 @@ function LinkInputPopover(props) {
|
|
|
3929
3788
|
editor,
|
|
3930
3789
|
isVariable
|
|
3931
3790
|
} = props;
|
|
3932
|
-
const [isOpen, setIsOpen] =
|
|
3933
|
-
const [isEditing, setIsEditing] =
|
|
3934
|
-
const linkInputRef =
|
|
3791
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
3792
|
+
const [isEditing, setIsEditing] = useState4(!isVariable);
|
|
3793
|
+
const linkInputRef = useRef5(null);
|
|
3935
3794
|
const { placeholderUrl = DEFAULT_PLACEHOLDER_URL } = useMailyContext();
|
|
3936
3795
|
const options = useVariableOptions(editor);
|
|
3937
3796
|
const renderVariable = options == null ? void 0 : options.renderVariable;
|
|
3938
3797
|
const variables = options == null ? void 0 : options.variables;
|
|
3939
3798
|
const variableTriggerCharacter = (_b = (_a = options == null ? void 0 : options.suggestion) == null ? void 0 : _a.char) != null ? _b : DEFAULT_VARIABLE_TRIGGER_CHAR;
|
|
3940
|
-
const autoCompleteOptions =
|
|
3799
|
+
const autoCompleteOptions = useMemo4(() => {
|
|
3941
3800
|
const withoutTrigger = defaultValue.replace(
|
|
3942
3801
|
new RegExp(variableTriggerCharacter, "g"),
|
|
3943
3802
|
""
|
|
@@ -3948,7 +3807,7 @@ function LinkInputPopover(props) {
|
|
|
3948
3807
|
editor
|
|
3949
3808
|
}).map((variable) => variable.name);
|
|
3950
3809
|
}, [variables, variableTriggerCharacter, defaultValue, editor]);
|
|
3951
|
-
const popoverButton = /* @__PURE__ */
|
|
3810
|
+
const popoverButton = /* @__PURE__ */ jsx29(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
|
|
3952
3811
|
BaseButton,
|
|
3953
3812
|
{
|
|
3954
3813
|
variant: "ghost",
|
|
@@ -3956,10 +3815,10 @@ function LinkInputPopover(props) {
|
|
|
3956
3815
|
type: "button",
|
|
3957
3816
|
className: "!mly-size-7",
|
|
3958
3817
|
"data-state": !!defaultValue,
|
|
3959
|
-
children: /* @__PURE__ */
|
|
3818
|
+
children: /* @__PURE__ */ jsx29(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
|
|
3960
3819
|
}
|
|
3961
3820
|
) });
|
|
3962
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ jsxs13(
|
|
3963
3822
|
Popover,
|
|
3964
3823
|
{
|
|
3965
3824
|
open: isOpen,
|
|
@@ -3973,11 +3832,11 @@ function LinkInputPopover(props) {
|
|
|
3973
3832
|
}
|
|
3974
3833
|
},
|
|
3975
3834
|
children: [
|
|
3976
|
-
tooltip ? /* @__PURE__ */
|
|
3977
|
-
/* @__PURE__ */
|
|
3978
|
-
/* @__PURE__ */
|
|
3835
|
+
tooltip ? /* @__PURE__ */ jsxs13(Tooltip, { children: [
|
|
3836
|
+
/* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
3837
|
+
/* @__PURE__ */ jsx29(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
3979
3838
|
] }) : popoverButton,
|
|
3980
|
-
/* @__PURE__ */
|
|
3839
|
+
/* @__PURE__ */ jsx29(
|
|
3981
3840
|
PopoverContent,
|
|
3982
3841
|
{
|
|
3983
3842
|
align: "end",
|
|
@@ -3985,7 +3844,7 @@ function LinkInputPopover(props) {
|
|
|
3985
3844
|
className: "mly-w-max mly-rounded-none mly-border-none mly-bg-transparent !mly-p-0 mly-shadow-none",
|
|
3986
3845
|
sideOffset: 8,
|
|
3987
3846
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
3988
|
-
children: /* @__PURE__ */
|
|
3847
|
+
children: /* @__PURE__ */ jsx29(
|
|
3989
3848
|
"form",
|
|
3990
3849
|
{
|
|
3991
3850
|
onSubmit: (e) => {
|
|
@@ -3997,8 +3856,8 @@ function LinkInputPopover(props) {
|
|
|
3997
3856
|
onValueChange == null ? void 0 : onValueChange(input.value);
|
|
3998
3857
|
setIsOpen(false);
|
|
3999
3858
|
},
|
|
4000
|
-
children: /* @__PURE__ */
|
|
4001
|
-
!isEditing && /* @__PURE__ */
|
|
3859
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
|
|
3860
|
+
!isEditing && /* @__PURE__ */ jsx29("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__ */ jsx29(
|
|
4002
3861
|
"button",
|
|
4003
3862
|
{
|
|
4004
3863
|
onClick: () => {
|
|
@@ -4019,9 +3878,9 @@ function LinkInputPopover(props) {
|
|
|
4019
3878
|
})
|
|
4020
3879
|
}
|
|
4021
3880
|
) }),
|
|
4022
|
-
isEditing && /* @__PURE__ */
|
|
4023
|
-
/* @__PURE__ */
|
|
4024
|
-
/* @__PURE__ */
|
|
3881
|
+
isEditing && /* @__PURE__ */ jsxs13("div", { className: "mly-relative", children: [
|
|
3882
|
+
/* @__PURE__ */ jsx29("div", { className: "mly-absolute mly-inset-y-0 mly-left-1.5 mly-z-10 mly-flex mly-items-center", children: /* @__PURE__ */ jsx29(LinkIcon, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) }),
|
|
3883
|
+
/* @__PURE__ */ jsx29(
|
|
4025
3884
|
InputAutocomplete,
|
|
4026
3885
|
{
|
|
4027
3886
|
editor,
|
|
@@ -4059,7 +3918,7 @@ function LinkInputPopover(props) {
|
|
|
4059
3918
|
// src/editor/components/ui/select.tsx
|
|
4060
3919
|
import { useId } from "react";
|
|
4061
3920
|
import { ChevronDownIcon } from "lucide-react";
|
|
4062
|
-
import { jsx as
|
|
3921
|
+
import { jsx as jsx30, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4063
3922
|
function Select(props) {
|
|
4064
3923
|
const {
|
|
4065
3924
|
label,
|
|
@@ -4072,10 +3931,10 @@ function Select(props) {
|
|
|
4072
3931
|
iconClassName
|
|
4073
3932
|
} = props;
|
|
4074
3933
|
const selectId = `mly${useId()}`;
|
|
4075
|
-
const content = /* @__PURE__ */
|
|
4076
|
-
/* @__PURE__ */
|
|
4077
|
-
Icon && /* @__PURE__ */
|
|
4078
|
-
/* @__PURE__ */
|
|
3934
|
+
const content = /* @__PURE__ */ jsxs14("div", { className: "mly-relative", children: [
|
|
3935
|
+
/* @__PURE__ */ jsx30("label", { htmlFor: selectId, className: "mly-sr-only", children: label }),
|
|
3936
|
+
Icon && /* @__PURE__ */ jsx30("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__ */ jsx30(Icon, { className: cn("mly-size-3", iconClassName) }) }),
|
|
3937
|
+
/* @__PURE__ */ jsx30(
|
|
4079
3938
|
"select",
|
|
4080
3939
|
{
|
|
4081
3940
|
id: selectId,
|
|
@@ -4086,10 +3945,10 @@ function Select(props) {
|
|
|
4086
3945
|
),
|
|
4087
3946
|
value,
|
|
4088
3947
|
onChange: (event) => onValueChange(event.target.value),
|
|
4089
|
-
children: options.map((option) => /* @__PURE__ */
|
|
3948
|
+
children: options.map((option) => /* @__PURE__ */ jsx30("option", { value: option.value, children: option.label }, option.value))
|
|
4090
3949
|
}
|
|
4091
3950
|
),
|
|
4092
|
-
/* @__PURE__ */
|
|
3951
|
+
/* @__PURE__ */ jsx30("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__ */ jsx30(
|
|
4093
3952
|
ChevronDownIcon,
|
|
4094
3953
|
{
|
|
4095
3954
|
size: 16,
|
|
@@ -4102,30 +3961,30 @@ function Select(props) {
|
|
|
4102
3961
|
if (!tooltip) {
|
|
4103
3962
|
return content;
|
|
4104
3963
|
}
|
|
4105
|
-
return /* @__PURE__ */
|
|
4106
|
-
/* @__PURE__ */
|
|
4107
|
-
/* @__PURE__ */
|
|
3964
|
+
return /* @__PURE__ */ jsxs14(Tooltip, { children: [
|
|
3965
|
+
/* @__PURE__ */ jsx30(TooltipTrigger, { asChild: true, children: content }),
|
|
3966
|
+
/* @__PURE__ */ jsx30(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
4108
3967
|
] });
|
|
4109
3968
|
}
|
|
4110
3969
|
|
|
4111
3970
|
// src/editor/nodes/button/button-view.tsx
|
|
4112
3971
|
import { NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
4113
|
-
import { useMemo as
|
|
3972
|
+
import { useMemo as useMemo6 } from "react";
|
|
4114
3973
|
|
|
4115
3974
|
// src/editor/nodes/button/button-label-input.tsx
|
|
4116
|
-
import { useMemo as
|
|
4117
|
-
import { jsx as
|
|
3975
|
+
import { useMemo as useMemo5, useRef as useRef6, useState as useState5 } from "react";
|
|
3976
|
+
import { jsx as jsx31, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4118
3977
|
function ButtonLabelInput(props) {
|
|
4119
3978
|
var _a, _b;
|
|
4120
3979
|
const { value, onValueChange, isVariable, editor } = props;
|
|
4121
|
-
const linkInputRef =
|
|
4122
|
-
const [isEditing, setIsEditing] =
|
|
3980
|
+
const linkInputRef = useRef6(null);
|
|
3981
|
+
const [isEditing, setIsEditing] = useState5(!isVariable);
|
|
4123
3982
|
const { placeholderUrl = DEFAULT_PLACEHOLDER_URL } = useMailyContext();
|
|
4124
3983
|
const otps = useVariableOptions(editor);
|
|
4125
3984
|
const variables = otps == null ? void 0 : otps.variables;
|
|
4126
3985
|
const variableTriggerCharacter = (_b = (_a = otps == null ? void 0 : otps.suggestion) == null ? void 0 : _a.char) != null ? _b : DEFAULT_VARIABLE_TRIGGER_CHAR;
|
|
4127
3986
|
const renderVariable = otps == null ? void 0 : otps.renderVariable;
|
|
4128
|
-
const autoCompleteOptions =
|
|
3987
|
+
const autoCompleteOptions = useMemo5(() => {
|
|
4129
3988
|
const withoutTrigger = value.replace(
|
|
4130
3989
|
new RegExp(variableTriggerCharacter, "g"),
|
|
4131
3990
|
""
|
|
@@ -4136,8 +3995,8 @@ function ButtonLabelInput(props) {
|
|
|
4136
3995
|
editor
|
|
4137
3996
|
}).map((variable) => variable.name);
|
|
4138
3997
|
}, [variables, value, editor]);
|
|
4139
|
-
return /* @__PURE__ */
|
|
4140
|
-
!isEditing && /* @__PURE__ */
|
|
3998
|
+
return /* @__PURE__ */ jsxs15("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
|
|
3999
|
+
!isEditing && /* @__PURE__ */ jsx31(
|
|
4141
4000
|
"button",
|
|
4142
4001
|
{
|
|
4143
4002
|
onClick: () => {
|
|
@@ -4158,7 +4017,7 @@ function ButtonLabelInput(props) {
|
|
|
4158
4017
|
})
|
|
4159
4018
|
}
|
|
4160
4019
|
),
|
|
4161
|
-
isEditing && /* @__PURE__ */
|
|
4020
|
+
isEditing && /* @__PURE__ */ jsx31(
|
|
4162
4021
|
InputAutocomplete,
|
|
4163
4022
|
{
|
|
4164
4023
|
editor,
|
|
@@ -4185,7 +4044,7 @@ function ButtonLabelInput(props) {
|
|
|
4185
4044
|
}
|
|
4186
4045
|
|
|
4187
4046
|
// src/editor/nodes/button/button-view.tsx
|
|
4188
|
-
import { jsx as
|
|
4047
|
+
import { jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4189
4048
|
function ButtonView(props) {
|
|
4190
4049
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
4191
4050
|
const {
|
|
@@ -4206,7 +4065,7 @@ function ButtonView(props) {
|
|
|
4206
4065
|
} = node.attrs;
|
|
4207
4066
|
const opts = useVariableOptions(editor);
|
|
4208
4067
|
const renderVariable = opts == null ? void 0 : opts.renderVariable;
|
|
4209
|
-
const sizes =
|
|
4068
|
+
const sizes = useMemo6(
|
|
4210
4069
|
() => ({
|
|
4211
4070
|
small: {
|
|
4212
4071
|
paddingX: 24,
|
|
@@ -4223,13 +4082,13 @@ function ButtonView(props) {
|
|
|
4223
4082
|
}),
|
|
4224
4083
|
[]
|
|
4225
4084
|
);
|
|
4226
|
-
const size =
|
|
4085
|
+
const size = useMemo6(() => {
|
|
4227
4086
|
var _a;
|
|
4228
4087
|
return (_a = Object.entries(sizes).find(
|
|
4229
4088
|
([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
|
|
4230
4089
|
)) == null ? void 0 : _a[0];
|
|
4231
4090
|
}, [paddingRight, paddingTop, sizes]);
|
|
4232
|
-
return /* @__PURE__ */
|
|
4091
|
+
return /* @__PURE__ */ jsx32(
|
|
4233
4092
|
NodeViewWrapper5,
|
|
4234
4093
|
{
|
|
4235
4094
|
draggable: editor.isEditable,
|
|
@@ -4238,8 +4097,8 @@ function ButtonView(props) {
|
|
|
4238
4097
|
style: {
|
|
4239
4098
|
textAlign: alignment
|
|
4240
4099
|
},
|
|
4241
|
-
children: /* @__PURE__ */
|
|
4242
|
-
/* @__PURE__ */
|
|
4100
|
+
children: /* @__PURE__ */ jsxs16(Popover, { open: props.selected && editor.isEditable, children: [
|
|
4101
|
+
/* @__PURE__ */ jsx32(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx32("div", { children: /* @__PURE__ */ jsx32(
|
|
4243
4102
|
"button",
|
|
4244
4103
|
{
|
|
4245
4104
|
className: cn(
|
|
@@ -4282,7 +4141,7 @@ function ButtonView(props) {
|
|
|
4282
4141
|
}) : text2
|
|
4283
4142
|
}
|
|
4284
4143
|
) }) }),
|
|
4285
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ jsx32(
|
|
4286
4145
|
PopoverContent,
|
|
4287
4146
|
{
|
|
4288
4147
|
align: "end",
|
|
@@ -4291,8 +4150,8 @@ function ButtonView(props) {
|
|
|
4291
4150
|
sideOffset: 8,
|
|
4292
4151
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
4293
4152
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
4294
|
-
children: /* @__PURE__ */
|
|
4295
|
-
/* @__PURE__ */
|
|
4153
|
+
children: /* @__PURE__ */ jsx32(TooltipProvider, { children: /* @__PURE__ */ jsxs16("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
|
|
4154
|
+
/* @__PURE__ */ jsx32(
|
|
4296
4155
|
ButtonLabelInput,
|
|
4297
4156
|
{
|
|
4298
4157
|
value: text2,
|
|
@@ -4306,9 +4165,9 @@ function ButtonView(props) {
|
|
|
4306
4165
|
editor
|
|
4307
4166
|
}
|
|
4308
4167
|
),
|
|
4309
|
-
/* @__PURE__ */
|
|
4310
|
-
/* @__PURE__ */
|
|
4311
|
-
/* @__PURE__ */
|
|
4168
|
+
/* @__PURE__ */ jsx32(Divider, {}),
|
|
4169
|
+
/* @__PURE__ */ jsxs16("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4170
|
+
/* @__PURE__ */ jsx32(
|
|
4312
4171
|
Select,
|
|
4313
4172
|
{
|
|
4314
4173
|
label: "Border Radius",
|
|
@@ -4326,7 +4185,7 @@ function ButtonView(props) {
|
|
|
4326
4185
|
className: "mly-capitalize"
|
|
4327
4186
|
}
|
|
4328
4187
|
),
|
|
4329
|
-
/* @__PURE__ */
|
|
4188
|
+
/* @__PURE__ */ jsx32(
|
|
4330
4189
|
Select,
|
|
4331
4190
|
{
|
|
4332
4191
|
label: "Style",
|
|
@@ -4344,7 +4203,7 @@ function ButtonView(props) {
|
|
|
4344
4203
|
className: "mly-capitalize"
|
|
4345
4204
|
}
|
|
4346
4205
|
),
|
|
4347
|
-
/* @__PURE__ */
|
|
4206
|
+
/* @__PURE__ */ jsx32(
|
|
4348
4207
|
Select,
|
|
4349
4208
|
{
|
|
4350
4209
|
label: "Size",
|
|
@@ -4367,9 +4226,9 @@ function ButtonView(props) {
|
|
|
4367
4226
|
}
|
|
4368
4227
|
)
|
|
4369
4228
|
] }),
|
|
4370
|
-
/* @__PURE__ */
|
|
4371
|
-
/* @__PURE__ */
|
|
4372
|
-
/* @__PURE__ */
|
|
4229
|
+
/* @__PURE__ */ jsx32(Divider, {}),
|
|
4230
|
+
/* @__PURE__ */ jsxs16("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4231
|
+
/* @__PURE__ */ jsx32(
|
|
4373
4232
|
AlignmentSwitch,
|
|
4374
4233
|
{
|
|
4375
4234
|
alignment,
|
|
@@ -4380,7 +4239,7 @@ function ButtonView(props) {
|
|
|
4380
4239
|
}
|
|
4381
4240
|
}
|
|
4382
4241
|
),
|
|
4383
|
-
/* @__PURE__ */
|
|
4242
|
+
/* @__PURE__ */ jsx32(
|
|
4384
4243
|
LinkInputPopover,
|
|
4385
4244
|
{
|
|
4386
4245
|
defaultValue: externalLink || "",
|
|
@@ -4396,9 +4255,9 @@ function ButtonView(props) {
|
|
|
4396
4255
|
}
|
|
4397
4256
|
)
|
|
4398
4257
|
] }),
|
|
4399
|
-
/* @__PURE__ */
|
|
4400
|
-
/* @__PURE__ */
|
|
4401
|
-
/* @__PURE__ */
|
|
4258
|
+
/* @__PURE__ */ jsx32(Divider, {}),
|
|
4259
|
+
/* @__PURE__ */ jsxs16("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4260
|
+
/* @__PURE__ */ jsx32(
|
|
4402
4261
|
BackgroundColorPickerPopup,
|
|
4403
4262
|
{
|
|
4404
4263
|
variant,
|
|
@@ -4410,7 +4269,7 @@ function ButtonView(props) {
|
|
|
4410
4269
|
}
|
|
4411
4270
|
}
|
|
4412
4271
|
),
|
|
4413
|
-
/* @__PURE__ */
|
|
4272
|
+
/* @__PURE__ */ jsx32(
|
|
4414
4273
|
TextColorPickerPopup,
|
|
4415
4274
|
{
|
|
4416
4275
|
color: textColor,
|
|
@@ -4421,20 +4280,7 @@ function ButtonView(props) {
|
|
|
4421
4280
|
}
|
|
4422
4281
|
}
|
|
4423
4282
|
)
|
|
4424
|
-
] })
|
|
4425
|
-
/* @__PURE__ */ jsx33(Divider, {}),
|
|
4426
|
-
/* @__PURE__ */ jsx33(
|
|
4427
|
-
ShowPopover,
|
|
4428
|
-
{
|
|
4429
|
-
showIfKey,
|
|
4430
|
-
onShowIfKeyValueChange: (value) => {
|
|
4431
|
-
updateAttributes2({
|
|
4432
|
-
showIfKey: value
|
|
4433
|
-
});
|
|
4434
|
-
},
|
|
4435
|
-
editor
|
|
4436
|
-
}
|
|
4437
|
-
)
|
|
4283
|
+
] })
|
|
4438
4284
|
] }) })
|
|
4439
4285
|
}
|
|
4440
4286
|
)
|
|
@@ -4444,20 +4290,20 @@ function ButtonView(props) {
|
|
|
4444
4290
|
}
|
|
4445
4291
|
function BackgroundColorPickerPopup(props) {
|
|
4446
4292
|
const { color, onChange, variant } = props;
|
|
4447
|
-
return /* @__PURE__ */
|
|
4293
|
+
return /* @__PURE__ */ jsx32(
|
|
4448
4294
|
ColorPicker,
|
|
4449
4295
|
{
|
|
4450
4296
|
color,
|
|
4451
4297
|
onColorChange: onChange,
|
|
4452
4298
|
tooltip: "Background Color",
|
|
4453
|
-
children: /* @__PURE__ */
|
|
4299
|
+
children: /* @__PURE__ */ jsx32(
|
|
4454
4300
|
BaseButton,
|
|
4455
4301
|
{
|
|
4456
4302
|
variant: "ghost",
|
|
4457
4303
|
size: "sm",
|
|
4458
4304
|
type: "button",
|
|
4459
4305
|
className: "mly-size-7",
|
|
4460
|
-
children: /* @__PURE__ */
|
|
4306
|
+
children: /* @__PURE__ */ jsx32(
|
|
4461
4307
|
"div",
|
|
4462
4308
|
{
|
|
4463
4309
|
className: "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded-full mly-shadow",
|
|
@@ -4476,16 +4322,16 @@ function BackgroundColorPickerPopup(props) {
|
|
|
4476
4322
|
}
|
|
4477
4323
|
function TextColorPickerPopup(props) {
|
|
4478
4324
|
const { color, onChange } = props;
|
|
4479
|
-
return /* @__PURE__ */
|
|
4325
|
+
return /* @__PURE__ */ jsx32(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx32(
|
|
4480
4326
|
BaseButton,
|
|
4481
4327
|
{
|
|
4482
4328
|
variant: "ghost",
|
|
4483
4329
|
size: "sm",
|
|
4484
4330
|
type: "button",
|
|
4485
4331
|
className: "mly-size-7",
|
|
4486
|
-
children: /* @__PURE__ */
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
4332
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
4333
|
+
/* @__PURE__ */ jsx32("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-midnight-gray", children: "A" }),
|
|
4334
|
+
/* @__PURE__ */ jsx32(
|
|
4489
4335
|
"div",
|
|
4490
4336
|
{
|
|
4491
4337
|
className: "mly-h-[2px] mly-w-3 mly-shrink-0 mly-rounded-md mly-shadow",
|
|
@@ -4953,10 +4799,10 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
|
4953
4799
|
// src/editor/nodes/repeat/repeat-view.tsx
|
|
4954
4800
|
import { NodeViewWrapper as NodeViewWrapper6, NodeViewContent } from "@tiptap/react";
|
|
4955
4801
|
import { Repeat2 as Repeat22 } from "lucide-react";
|
|
4956
|
-
import { jsx as
|
|
4802
|
+
import { jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4957
4803
|
function RepeatView(props) {
|
|
4958
4804
|
const { editor, getPos } = props;
|
|
4959
|
-
return /* @__PURE__ */
|
|
4805
|
+
return /* @__PURE__ */ jsxs17(
|
|
4960
4806
|
NodeViewWrapper6,
|
|
4961
4807
|
{
|
|
4962
4808
|
"data-type": "repeat",
|
|
@@ -4964,8 +4810,8 @@ function RepeatView(props) {
|
|
|
4964
4810
|
"data-drag-handle": editor.isEditable,
|
|
4965
4811
|
className: "mly-relative",
|
|
4966
4812
|
children: [
|
|
4967
|
-
/* @__PURE__ */
|
|
4968
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ jsx33(NodeViewContent, { className: "is-editable" }),
|
|
4814
|
+
/* @__PURE__ */ jsxs17(
|
|
4969
4815
|
"div",
|
|
4970
4816
|
{
|
|
4971
4817
|
role: "button",
|
|
@@ -4976,8 +4822,8 @@ function RepeatView(props) {
|
|
|
4976
4822
|
editor.commands.setNodeSelection(getPos());
|
|
4977
4823
|
},
|
|
4978
4824
|
children: [
|
|
4979
|
-
/* @__PURE__ */
|
|
4980
|
-
/* @__PURE__ */
|
|
4825
|
+
/* @__PURE__ */ jsx33(Repeat22, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
|
|
4826
|
+
/* @__PURE__ */ jsx33("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
|
|
4981
4827
|
]
|
|
4982
4828
|
}
|
|
4983
4829
|
)
|
|
@@ -5226,15 +5072,15 @@ import {
|
|
|
5226
5072
|
useEffect as useEffect6,
|
|
5227
5073
|
useImperativeHandle as useImperativeHandle2,
|
|
5228
5074
|
useLayoutEffect as useLayoutEffect2,
|
|
5229
|
-
useRef as
|
|
5230
|
-
useState as
|
|
5075
|
+
useRef as useRef8,
|
|
5076
|
+
useState as useState7
|
|
5231
5077
|
} from "react";
|
|
5232
5078
|
import tippy from "tippy.js";
|
|
5233
5079
|
|
|
5234
5080
|
// src/editor/extensions/slash-command/slash-command-item.tsx
|
|
5235
5081
|
import { ChevronRightIcon } from "lucide-react";
|
|
5236
|
-
import { useCallback as useCallback5, useState as
|
|
5237
|
-
import { Fragment as Fragment3, jsx as
|
|
5082
|
+
import { useCallback as useCallback5, useState as useState6, useRef as useRef7, useEffect as useEffect5 } from "react";
|
|
5083
|
+
import { Fragment as Fragment3, jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5238
5084
|
function SlashCommandItem(props) {
|
|
5239
5085
|
var _a;
|
|
5240
5086
|
const {
|
|
@@ -5249,7 +5095,7 @@ function SlashCommandItem(props) {
|
|
|
5249
5095
|
hoveredItemKey,
|
|
5250
5096
|
onHover
|
|
5251
5097
|
} = props;
|
|
5252
|
-
const [open, setOpen] =
|
|
5098
|
+
const [open, setOpen] = useState6(false);
|
|
5253
5099
|
const isActive = groupIndex === selectedGroupIndex && commandIndex === selectedCommandIndex;
|
|
5254
5100
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
5255
5101
|
const isHovered = hoveredItemKey === itemKey;
|
|
@@ -5257,18 +5103,18 @@ function SlashCommandItem(props) {
|
|
|
5257
5103
|
const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && (isHovered || isActive && !hoveredItemKey);
|
|
5258
5104
|
const hasRenderFunction = typeof item.render === "function";
|
|
5259
5105
|
const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
|
|
5260
|
-
let value = /* @__PURE__ */
|
|
5261
|
-
/* @__PURE__ */
|
|
5262
|
-
/* @__PURE__ */
|
|
5263
|
-
/* @__PURE__ */
|
|
5264
|
-
/* @__PURE__ */
|
|
5106
|
+
let value = /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
5107
|
+
/* @__PURE__ */ jsx34("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
|
|
5108
|
+
/* @__PURE__ */ jsxs18("div", { className: "mly-grow", children: [
|
|
5109
|
+
/* @__PURE__ */ jsx34("p", { className: "mly-font-medium", children: item.title }),
|
|
5110
|
+
/* @__PURE__ */ jsx34("p", { className: "mly-text-xs mly-text-gray-400", children: item.description })
|
|
5265
5111
|
] }),
|
|
5266
|
-
isSubCommand2 && /* @__PURE__ */
|
|
5112
|
+
isSubCommand2 && /* @__PURE__ */ jsx34("span", { className: "mly-block mly-px-1 mly-text-gray-400", children: /* @__PURE__ */ jsx34(ChevronRightIcon, { className: "mly-size-3.5 mly-stroke-[2.5]" }) })
|
|
5267
5113
|
] });
|
|
5268
5114
|
if (renderFunctionValue !== null && renderFunctionValue !== true) {
|
|
5269
5115
|
value = renderFunctionValue;
|
|
5270
5116
|
}
|
|
5271
|
-
const openTimerRef =
|
|
5117
|
+
const openTimerRef = useRef7(0);
|
|
5272
5118
|
const handleDelayedOpen = useCallback5(() => {
|
|
5273
5119
|
window.clearTimeout(openTimerRef.current);
|
|
5274
5120
|
const delay = 200;
|
|
@@ -5294,8 +5140,8 @@ function SlashCommandItem(props) {
|
|
|
5294
5140
|
}
|
|
5295
5141
|
};
|
|
5296
5142
|
}, []);
|
|
5297
|
-
return /* @__PURE__ */
|
|
5298
|
-
/* @__PURE__ */
|
|
5143
|
+
return /* @__PURE__ */ jsxs18(Tooltip, { open, children: [
|
|
5144
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
5299
5145
|
"button",
|
|
5300
5146
|
{
|
|
5301
5147
|
className: cn(
|
|
@@ -5310,14 +5156,14 @@ function SlashCommandItem(props) {
|
|
|
5310
5156
|
children: value
|
|
5311
5157
|
}
|
|
5312
5158
|
) }),
|
|
5313
|
-
/* @__PURE__ */
|
|
5159
|
+
/* @__PURE__ */ jsx34(
|
|
5314
5160
|
TooltipContent,
|
|
5315
5161
|
{
|
|
5316
5162
|
side: "right",
|
|
5317
5163
|
sideOffset: 10,
|
|
5318
5164
|
className: "mly-w-52 mly-rounded-lg mly-border-none mly-p-1 mly-shadow",
|
|
5319
|
-
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */
|
|
5320
|
-
/* @__PURE__ */
|
|
5165
|
+
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
5166
|
+
/* @__PURE__ */ jsx34("figure", { className: "mly-relative mly-aspect-[2.5] mly-w-full mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200", children: /* @__PURE__ */ jsx34(
|
|
5321
5167
|
"img",
|
|
5322
5168
|
{
|
|
5323
5169
|
src: item == null ? void 0 : item.preview,
|
|
@@ -5325,7 +5171,7 @@ function SlashCommandItem(props) {
|
|
|
5325
5171
|
className: "mly-absolute mly-inset-0 mly-h-full mly-w-full mly-object-cover"
|
|
5326
5172
|
}
|
|
5327
5173
|
) }),
|
|
5328
|
-
/* @__PURE__ */
|
|
5174
|
+
/* @__PURE__ */ jsx34("p", { className: "mly-mt-2 mly-px-0.5 mly-text-gray-500", children: item.description })
|
|
5329
5175
|
] })
|
|
5330
5176
|
}
|
|
5331
5177
|
)
|
|
@@ -5414,15 +5260,15 @@ function processCommand(options) {
|
|
|
5414
5260
|
}
|
|
5415
5261
|
|
|
5416
5262
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
5417
|
-
import { jsx as
|
|
5263
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5418
5264
|
var CommandList = forwardRef8((props, ref) => {
|
|
5419
5265
|
const { items: groups, command, editor, range, query } = props;
|
|
5420
|
-
const [selectedGroupIndex, setSelectedGroupIndex] =
|
|
5421
|
-
const [selectedCommandIndex, setSelectedCommandIndex] =
|
|
5422
|
-
const [hoveredItemKey, setHoveredItemKey] =
|
|
5423
|
-
const prevQuery =
|
|
5424
|
-
const prevSelectedGroupIndex =
|
|
5425
|
-
const prevSelectedCommandIndex =
|
|
5266
|
+
const [selectedGroupIndex, setSelectedGroupIndex] = useState7(0);
|
|
5267
|
+
const [selectedCommandIndex, setSelectedCommandIndex] = useState7(0);
|
|
5268
|
+
const [hoveredItemKey, setHoveredItemKey] = useState7(null);
|
|
5269
|
+
const prevQuery = useRef8("");
|
|
5270
|
+
const prevSelectedGroupIndex = useRef8(0);
|
|
5271
|
+
const prevSelectedCommandIndex = useRef8(0);
|
|
5426
5272
|
const selectItem = useCallback6(
|
|
5427
5273
|
(groupIndex, commandIndex) => {
|
|
5428
5274
|
const item = groups[groupIndex].commands[commandIndex];
|
|
@@ -5521,8 +5367,8 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
5521
5367
|
}
|
|
5522
5368
|
}
|
|
5523
5369
|
}));
|
|
5524
|
-
const commandListContainer =
|
|
5525
|
-
const activeCommandRef =
|
|
5370
|
+
const commandListContainer = useRef8(null);
|
|
5371
|
+
const activeCommandRef = useRef8(null);
|
|
5526
5372
|
useLayoutEffect2(() => {
|
|
5527
5373
|
const container = commandListContainer == null ? void 0 : commandListContainer.current;
|
|
5528
5374
|
const activeCommandContainer = activeCommandRef == null ? void 0 : activeCommandRef.current;
|
|
@@ -5552,15 +5398,15 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
5552
5398
|
if (!groups || groups.length === 0) {
|
|
5553
5399
|
return null;
|
|
5554
5400
|
}
|
|
5555
|
-
return /* @__PURE__ */
|
|
5556
|
-
/* @__PURE__ */
|
|
5401
|
+
return /* @__PURE__ */ jsx35(TooltipProvider, { children: /* @__PURE__ */ jsxs19("div", { className: "mly-z-50 mly-w-72 mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
|
|
5402
|
+
/* @__PURE__ */ jsx35(
|
|
5557
5403
|
"div",
|
|
5558
5404
|
{
|
|
5559
5405
|
id: "slash-command",
|
|
5560
5406
|
ref: commandListContainer,
|
|
5561
5407
|
className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto",
|
|
5562
|
-
children: groups.map((group, groupIndex) => /* @__PURE__ */
|
|
5563
|
-
/* @__PURE__ */
|
|
5408
|
+
children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs19(Fragment4, { children: [
|
|
5409
|
+
/* @__PURE__ */ jsx35(
|
|
5564
5410
|
"span",
|
|
5565
5411
|
{
|
|
5566
5412
|
className: cn(
|
|
@@ -5570,9 +5416,9 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
5570
5416
|
children: group.title
|
|
5571
5417
|
}
|
|
5572
5418
|
),
|
|
5573
|
-
/* @__PURE__ */
|
|
5419
|
+
/* @__PURE__ */ jsx35("div", { className: "mly-space-y-0.5 mly-p-1", children: group.commands.map((item, commandIndex) => {
|
|
5574
5420
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
5575
|
-
return /* @__PURE__ */
|
|
5421
|
+
return /* @__PURE__ */ jsx35(
|
|
5576
5422
|
SlashCommandItem,
|
|
5577
5423
|
{
|
|
5578
5424
|
item,
|
|
@@ -5592,16 +5438,16 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
5592
5438
|
] }, groupIndex))
|
|
5593
5439
|
}
|
|
5594
5440
|
),
|
|
5595
|
-
/* @__PURE__ */
|
|
5596
|
-
/* @__PURE__ */
|
|
5597
|
-
/* @__PURE__ */
|
|
5598
|
-
/* @__PURE__ */
|
|
5441
|
+
/* @__PURE__ */ jsx35("div", { className: "mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4", children: /* @__PURE__ */ jsxs19("div", { className: "mly-flex mly-items-center", children: [
|
|
5442
|
+
/* @__PURE__ */ jsxs19("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
|
|
5443
|
+
/* @__PURE__ */ jsx35("kbd", { className: "mly-rounded mly-border mly-border-gray-200 mly-p-1 mly-px-2 mly-font-medium", children: "\u2191" }),
|
|
5444
|
+
/* @__PURE__ */ jsx35("kbd", { className: "mly-ml-1 mly-rounded mly-border mly-border-gray-200 mly-p-1 mly-px-2 mly-font-medium", children: "\u2193" }),
|
|
5599
5445
|
" ",
|
|
5600
5446
|
"to navigate"
|
|
5601
5447
|
] }),
|
|
5602
|
-
/* @__PURE__ */
|
|
5603
|
-
/* @__PURE__ */
|
|
5604
|
-
/* @__PURE__ */
|
|
5448
|
+
/* @__PURE__ */ jsx35("span", { "aria-hidden": "true", className: "mly-select-none mly-px-1", children: "\xB7" }),
|
|
5449
|
+
/* @__PURE__ */ jsxs19("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
|
|
5450
|
+
/* @__PURE__ */ jsx35("kbd", { className: "mly-rounded mly-border mly-border-gray-200 mly-p-1 mly-px-1.5 mly-font-medium", children: "Enter" }),
|
|
5605
5451
|
" ",
|
|
5606
5452
|
"to select"
|
|
5607
5453
|
] })
|
|
@@ -5679,13 +5525,13 @@ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
|
|
|
5679
5525
|
|
|
5680
5526
|
// src/editor/nodes/variable/variable-suggestions.tsx
|
|
5681
5527
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
5682
|
-
import { forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3, useRef as
|
|
5528
|
+
import { forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3, useRef as useRef9 } from "react";
|
|
5683
5529
|
import tippy2 from "tippy.js";
|
|
5684
|
-
import { jsx as
|
|
5530
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5685
5531
|
var VariableList = forwardRef9((props, ref) => {
|
|
5686
5532
|
var _a;
|
|
5687
5533
|
const { items = [], editor } = props;
|
|
5688
|
-
const popoverRef =
|
|
5534
|
+
const popoverRef = useRef9(null);
|
|
5689
5535
|
const VariableSuggestionPopoverComponent = (_a = useVariableOptions(editor)) == null ? void 0 : _a.variableSuggestionsPopover;
|
|
5690
5536
|
useImperativeHandle3(ref, () => ({
|
|
5691
5537
|
onKeyDown: ({ event }) => {
|
|
@@ -5710,7 +5556,7 @@ var VariableList = forwardRef9((props, ref) => {
|
|
|
5710
5556
|
return false;
|
|
5711
5557
|
}
|
|
5712
5558
|
}));
|
|
5713
|
-
return /* @__PURE__ */
|
|
5559
|
+
return /* @__PURE__ */ jsx36(
|
|
5714
5560
|
VariableSuggestionPopoverComponent,
|
|
5715
5561
|
{
|
|
5716
5562
|
items,
|
|
@@ -5801,14 +5647,14 @@ import { createLowlight, common } from "lowlight";
|
|
|
5801
5647
|
|
|
5802
5648
|
// src/editor/nodes/html/html-view.tsx
|
|
5803
5649
|
import { NodeViewContent as NodeViewContent2, NodeViewWrapper as NodeViewWrapper7 } from "@tiptap/react";
|
|
5804
|
-
import { useMemo as
|
|
5805
|
-
import { jsx as
|
|
5650
|
+
import { useMemo as useMemo7 } from "react";
|
|
5651
|
+
import { jsx as jsx37, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5806
5652
|
function HTMLCodeBlockView(props) {
|
|
5807
5653
|
const { node, updateAttributes: updateAttributes2 } = props;
|
|
5808
5654
|
let { language, activeTab = "code" } = node.attrs;
|
|
5809
5655
|
activeTab || (activeTab = "code");
|
|
5810
5656
|
const languageClass = language ? `language-${language}` : "";
|
|
5811
|
-
const html2 =
|
|
5657
|
+
const html2 = useMemo7(() => {
|
|
5812
5658
|
const text2 = node.content.content.reduce((acc, cur) => {
|
|
5813
5659
|
if (cur.type.name === "text") {
|
|
5814
5660
|
return acc + cur.text;
|
|
@@ -5827,21 +5673,21 @@ function HTMLCodeBlockView(props) {
|
|
|
5827
5673
|
return `<style>${combinedStyle}</style>${body.innerHTML}`;
|
|
5828
5674
|
}, [activeTab]);
|
|
5829
5675
|
const isEmpty = html2 === "";
|
|
5830
|
-
return /* @__PURE__ */
|
|
5676
|
+
return /* @__PURE__ */ jsxs20(
|
|
5831
5677
|
NodeViewWrapper7,
|
|
5832
5678
|
{
|
|
5833
5679
|
draggable: false,
|
|
5834
5680
|
"data-drag-handle": false,
|
|
5835
5681
|
"data-type": "htmlCodeBlock",
|
|
5836
5682
|
children: [
|
|
5837
|
-
activeTab === "code" && /* @__PURE__ */
|
|
5683
|
+
activeTab === "code" && /* @__PURE__ */ jsx37("pre", { className: "mly-my-0 mly-rounded-lg mly-border mly-border-gray-200 mly-bg-white mly-p-2 mly-text-black", children: /* @__PURE__ */ jsx37(
|
|
5838
5684
|
NodeViewContent2,
|
|
5839
5685
|
{
|
|
5840
5686
|
as: "code",
|
|
5841
5687
|
className: cn("is-editable", languageClass)
|
|
5842
5688
|
}
|
|
5843
5689
|
) }),
|
|
5844
|
-
activeTab === "preview" && /* @__PURE__ */
|
|
5690
|
+
activeTab === "preview" && /* @__PURE__ */ jsx37(
|
|
5845
5691
|
"div",
|
|
5846
5692
|
{
|
|
5847
5693
|
className: cn(
|