@meowdown/react 0.82.1 → 0.82.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +185 -68
- package/dist/style.css +9 -0
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -692,10 +692,16 @@ const CodeBlockLanguagePickerMemo = /* @__PURE__ */ memo(CodeBlockLanguagePicker
|
|
|
692
692
|
function defineCodeBlockView(component = CodeBlockView) {
|
|
693
693
|
return union(defineReactNodeView({
|
|
694
694
|
name: "codeBlock",
|
|
695
|
+
as: createCodeBlockRoot,
|
|
695
696
|
contentAs: "code",
|
|
696
697
|
component
|
|
697
698
|
}), defineCodeBlockPreviewPlugin());
|
|
698
699
|
}
|
|
700
|
+
function createCodeBlockRoot() {
|
|
701
|
+
const element = document.createElement("div");
|
|
702
|
+
element.dataset.codeBlock = "";
|
|
703
|
+
return element;
|
|
704
|
+
}
|
|
699
705
|
|
|
700
706
|
// src/components/block-handle.module.css
|
|
701
707
|
var block_handle_module_default = {
|
|
@@ -3299,9 +3305,102 @@ function TableMenuDeleteTable(t0) {
|
|
|
3299
3305
|
} else t2 = $[5];
|
|
3300
3306
|
return t2;
|
|
3301
3307
|
}
|
|
3308
|
+
function TableColumnMenuItems(t0) {
|
|
3309
|
+
const $ = c(2);
|
|
3310
|
+
const { editor } = t0;
|
|
3311
|
+
let t1;
|
|
3312
|
+
if ($[0] !== editor) {
|
|
3313
|
+
t1 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3314
|
+
/* @__PURE__ */ jsx(TableMenuInsertLeft, { editor }),
|
|
3315
|
+
/* @__PURE__ */ jsx(TableMenuInsertRight, { editor }),
|
|
3316
|
+
/* @__PURE__ */ jsx(TableMenuAlign, { editor }),
|
|
3317
|
+
/* @__PURE__ */ jsx(TableMenuClearContents, {
|
|
3318
|
+
editor,
|
|
3319
|
+
testId: "table-clear-column"
|
|
3320
|
+
}),
|
|
3321
|
+
/* @__PURE__ */ jsx(TableMenuDeleteColumn, { editor }),
|
|
3322
|
+
/* @__PURE__ */ jsx(TableMenuDeleteTable, {
|
|
3323
|
+
editor,
|
|
3324
|
+
testId: "table-delete-table-column"
|
|
3325
|
+
})
|
|
3326
|
+
] });
|
|
3327
|
+
$[0] = editor;
|
|
3328
|
+
$[1] = t1;
|
|
3329
|
+
} else t1 = $[1];
|
|
3330
|
+
return t1;
|
|
3331
|
+
}
|
|
3332
|
+
function TableRowMenuItems(t0) {
|
|
3333
|
+
const $ = c(2);
|
|
3334
|
+
const { editor } = t0;
|
|
3335
|
+
let t1;
|
|
3336
|
+
if ($[0] !== editor) {
|
|
3337
|
+
t1 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3338
|
+
/* @__PURE__ */ jsx(TableMenuInsertAbove, { editor }),
|
|
3339
|
+
/* @__PURE__ */ jsx(TableMenuInsertBelow, { editor }),
|
|
3340
|
+
/* @__PURE__ */ jsx(TableMenuClearContents, {
|
|
3341
|
+
editor,
|
|
3342
|
+
testId: "table-clear-row"
|
|
3343
|
+
}),
|
|
3344
|
+
/* @__PURE__ */ jsx(TableMenuDeleteRow, { editor }),
|
|
3345
|
+
/* @__PURE__ */ jsx(TableMenuDeleteTable, {
|
|
3346
|
+
editor,
|
|
3347
|
+
testId: "table-delete-table-row"
|
|
3348
|
+
})
|
|
3349
|
+
] });
|
|
3350
|
+
$[0] = editor;
|
|
3351
|
+
$[1] = t1;
|
|
3352
|
+
} else t1 = $[1];
|
|
3353
|
+
return t1;
|
|
3354
|
+
}
|
|
3355
|
+
/**
|
|
3356
|
+
* Mounts a menu's items only while the menu is shown, so a closed menu holds no
|
|
3357
|
+
* editor subscriptions. Opening is canceled and replayed through `open`, so the
|
|
3358
|
+
* items mount in the same commit that opens the menu. Closing keeps the items
|
|
3359
|
+
* until the close animation finishes.
|
|
3360
|
+
*/
|
|
3361
|
+
function useLazyMenu() {
|
|
3362
|
+
const $ = c(5);
|
|
3363
|
+
const [open, setOpen] = useState(false);
|
|
3364
|
+
const [mounted, setMounted] = useState(false);
|
|
3365
|
+
let t0;
|
|
3366
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3367
|
+
t0 = (event) => {
|
|
3368
|
+
if (event.detail) {
|
|
3369
|
+
event.preventDefault();
|
|
3370
|
+
setMounted(true);
|
|
3371
|
+
}
|
|
3372
|
+
setOpen(event.detail);
|
|
3373
|
+
};
|
|
3374
|
+
$[0] = t0;
|
|
3375
|
+
} else t0 = $[0];
|
|
3376
|
+
const onOpenChange = t0;
|
|
3377
|
+
let t1;
|
|
3378
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3379
|
+
t1 = (event_0) => {
|
|
3380
|
+
if (!event_0.detail) setMounted(false);
|
|
3381
|
+
};
|
|
3382
|
+
$[1] = t1;
|
|
3383
|
+
} else t1 = $[1];
|
|
3384
|
+
const onOpenChangeComplete = t1;
|
|
3385
|
+
let t2;
|
|
3386
|
+
if ($[2] !== mounted || $[3] !== open) {
|
|
3387
|
+
t2 = {
|
|
3388
|
+
open,
|
|
3389
|
+
mounted,
|
|
3390
|
+
onOpenChange,
|
|
3391
|
+
onOpenChangeComplete
|
|
3392
|
+
};
|
|
3393
|
+
$[2] = mounted;
|
|
3394
|
+
$[3] = open;
|
|
3395
|
+
$[4] = t2;
|
|
3396
|
+
} else t2 = $[4];
|
|
3397
|
+
return t2;
|
|
3398
|
+
}
|
|
3302
3399
|
function TableHandle() {
|
|
3303
|
-
const $ = c(
|
|
3400
|
+
const $ = c(27);
|
|
3304
3401
|
const editor = useEditor$1();
|
|
3402
|
+
const columnMenu = useLazyMenu();
|
|
3403
|
+
const rowMenu = useLazyMenu();
|
|
3305
3404
|
let t0;
|
|
3306
3405
|
let t1;
|
|
3307
3406
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -3323,90 +3422,107 @@ function TableHandle() {
|
|
|
3323
3422
|
$[2] = t2;
|
|
3324
3423
|
} else t2 = $[2];
|
|
3325
3424
|
let t3;
|
|
3326
|
-
if ($[3] !== editor) {
|
|
3327
|
-
t3 = /* @__PURE__ */ jsx(
|
|
3425
|
+
if ($[3] !== columnMenu.mounted || $[4] !== editor) {
|
|
3426
|
+
t3 = columnMenu.mounted && /* @__PURE__ */ jsx(TableColumnMenuItems, { editor });
|
|
3427
|
+
$[3] = columnMenu.mounted;
|
|
3428
|
+
$[4] = editor;
|
|
3429
|
+
$[5] = t3;
|
|
3430
|
+
} else t3 = $[5];
|
|
3431
|
+
let t4;
|
|
3432
|
+
if ($[6] !== t3) {
|
|
3433
|
+
t4 = /* @__PURE__ */ jsx(MenuPositioner, {
|
|
3434
|
+
className: table_handle_module_default.MenuPositioner,
|
|
3435
|
+
children: /* @__PURE__ */ jsx(MenuPopup, {
|
|
3436
|
+
className: table_handle_module_default.MenuPopup,
|
|
3437
|
+
"data-testid": "table-handle-column-menu",
|
|
3438
|
+
children: t3
|
|
3439
|
+
})
|
|
3440
|
+
});
|
|
3441
|
+
$[6] = t3;
|
|
3442
|
+
$[7] = t4;
|
|
3443
|
+
} else t4 = $[7];
|
|
3444
|
+
let t5;
|
|
3445
|
+
if ($[8] !== columnMenu.onOpenChange || $[9] !== columnMenu.onOpenChangeComplete || $[10] !== columnMenu.open || $[11] !== t4) {
|
|
3446
|
+
t5 = /* @__PURE__ */ jsx(TableHandleColumnPositioner, {
|
|
3328
3447
|
className: table_handle_module_default.Positioner,
|
|
3329
3448
|
children: /* @__PURE__ */ jsx(TableHandleColumnPopup, {
|
|
3330
3449
|
className: table_handle_module_default.ColumnPopup,
|
|
3331
|
-
children: /* @__PURE__ */ jsxs(TableHandleColumnMenuRoot, {
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
/* @__PURE__ */ jsx(TableMenuInsertLeft, { editor }),
|
|
3338
|
-
/* @__PURE__ */ jsx(TableMenuInsertRight, { editor }),
|
|
3339
|
-
/* @__PURE__ */ jsx(TableMenuAlign, { editor }),
|
|
3340
|
-
/* @__PURE__ */ jsx(TableMenuClearContents, {
|
|
3341
|
-
editor,
|
|
3342
|
-
testId: "table-clear-column"
|
|
3343
|
-
}),
|
|
3344
|
-
/* @__PURE__ */ jsx(TableMenuDeleteColumn, { editor }),
|
|
3345
|
-
/* @__PURE__ */ jsx(TableMenuDeleteTable, {
|
|
3346
|
-
editor,
|
|
3347
|
-
testId: "table-delete-table-column"
|
|
3348
|
-
})
|
|
3349
|
-
]
|
|
3350
|
-
})
|
|
3351
|
-
})] })
|
|
3450
|
+
children: /* @__PURE__ */ jsxs(TableHandleColumnMenuRoot, {
|
|
3451
|
+
open: columnMenu.open,
|
|
3452
|
+
onOpenChange: columnMenu.onOpenChange,
|
|
3453
|
+
onOpenChangeComplete: columnMenu.onOpenChangeComplete,
|
|
3454
|
+
children: [t2, t4]
|
|
3455
|
+
})
|
|
3352
3456
|
})
|
|
3353
3457
|
});
|
|
3354
|
-
$[
|
|
3355
|
-
$[
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3458
|
+
$[8] = columnMenu.onOpenChange;
|
|
3459
|
+
$[9] = columnMenu.onOpenChangeComplete;
|
|
3460
|
+
$[10] = columnMenu.open;
|
|
3461
|
+
$[11] = t4;
|
|
3462
|
+
$[12] = t5;
|
|
3463
|
+
} else t5 = $[12];
|
|
3464
|
+
let t6;
|
|
3465
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3466
|
+
t6 = /* @__PURE__ */ jsx(TableHandleRowMenuTrigger, {
|
|
3360
3467
|
className: table_handle_module_default.Trigger,
|
|
3361
3468
|
"data-testid": "table-handle-row",
|
|
3362
3469
|
children: /* @__PURE__ */ jsx(GripVerticalIcon, {})
|
|
3363
3470
|
});
|
|
3364
|
-
$[
|
|
3365
|
-
} else
|
|
3366
|
-
let
|
|
3367
|
-
if ($[
|
|
3368
|
-
|
|
3471
|
+
$[13] = t6;
|
|
3472
|
+
} else t6 = $[13];
|
|
3473
|
+
let t7;
|
|
3474
|
+
if ($[14] !== editor || $[15] !== rowMenu.mounted) {
|
|
3475
|
+
t7 = rowMenu.mounted && /* @__PURE__ */ jsx(TableRowMenuItems, { editor });
|
|
3476
|
+
$[14] = editor;
|
|
3477
|
+
$[15] = rowMenu.mounted;
|
|
3478
|
+
$[16] = t7;
|
|
3479
|
+
} else t7 = $[16];
|
|
3480
|
+
let t8;
|
|
3481
|
+
if ($[17] !== t7) {
|
|
3482
|
+
t8 = /* @__PURE__ */ jsx(MenuPositioner, {
|
|
3483
|
+
className: table_handle_module_default.MenuPositioner,
|
|
3484
|
+
children: /* @__PURE__ */ jsx(MenuPopup, {
|
|
3485
|
+
className: table_handle_module_default.MenuPopup,
|
|
3486
|
+
"data-testid": "table-handle-row-menu",
|
|
3487
|
+
children: t7
|
|
3488
|
+
})
|
|
3489
|
+
});
|
|
3490
|
+
$[17] = t7;
|
|
3491
|
+
$[18] = t8;
|
|
3492
|
+
} else t8 = $[18];
|
|
3493
|
+
let t9;
|
|
3494
|
+
if ($[19] !== rowMenu.onOpenChange || $[20] !== rowMenu.onOpenChangeComplete || $[21] !== rowMenu.open || $[22] !== t8) {
|
|
3495
|
+
t9 = /* @__PURE__ */ jsx(TableHandleRowPositioner, {
|
|
3369
3496
|
className: table_handle_module_default.Positioner,
|
|
3370
3497
|
children: /* @__PURE__ */ jsx(TableHandleRowPopup, {
|
|
3371
3498
|
className: table_handle_module_default.RowPopup,
|
|
3372
|
-
children: /* @__PURE__ */ jsxs(TableHandleRowMenuRoot, {
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
/* @__PURE__ */ jsx(TableMenuInsertAbove, { editor }),
|
|
3379
|
-
/* @__PURE__ */ jsx(TableMenuInsertBelow, { editor }),
|
|
3380
|
-
/* @__PURE__ */ jsx(TableMenuClearContents, {
|
|
3381
|
-
editor,
|
|
3382
|
-
testId: "table-clear-row"
|
|
3383
|
-
}),
|
|
3384
|
-
/* @__PURE__ */ jsx(TableMenuDeleteRow, { editor }),
|
|
3385
|
-
/* @__PURE__ */ jsx(TableMenuDeleteTable, {
|
|
3386
|
-
editor,
|
|
3387
|
-
testId: "table-delete-table-row"
|
|
3388
|
-
})
|
|
3389
|
-
]
|
|
3390
|
-
})
|
|
3391
|
-
})] })
|
|
3499
|
+
children: /* @__PURE__ */ jsxs(TableHandleRowMenuRoot, {
|
|
3500
|
+
open: rowMenu.open,
|
|
3501
|
+
onOpenChange: rowMenu.onOpenChange,
|
|
3502
|
+
onOpenChangeComplete: rowMenu.onOpenChangeComplete,
|
|
3503
|
+
children: [t6, t8]
|
|
3504
|
+
})
|
|
3392
3505
|
})
|
|
3393
3506
|
});
|
|
3394
|
-
$[
|
|
3395
|
-
$[
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3507
|
+
$[19] = rowMenu.onOpenChange;
|
|
3508
|
+
$[20] = rowMenu.onOpenChangeComplete;
|
|
3509
|
+
$[21] = rowMenu.open;
|
|
3510
|
+
$[22] = t8;
|
|
3511
|
+
$[23] = t9;
|
|
3512
|
+
} else t9 = $[23];
|
|
3513
|
+
let t10;
|
|
3514
|
+
if ($[24] !== t5 || $[25] !== t9) {
|
|
3515
|
+
t10 = /* @__PURE__ */ jsxs(TableHandleRoot, { children: [
|
|
3400
3516
|
t0,
|
|
3401
3517
|
t1,
|
|
3402
|
-
|
|
3403
|
-
|
|
3518
|
+
t5,
|
|
3519
|
+
t9
|
|
3404
3520
|
] });
|
|
3405
|
-
$[
|
|
3406
|
-
$[
|
|
3407
|
-
$[
|
|
3408
|
-
} else
|
|
3409
|
-
return
|
|
3521
|
+
$[24] = t5;
|
|
3522
|
+
$[25] = t9;
|
|
3523
|
+
$[26] = t10;
|
|
3524
|
+
} else t10 = $[26];
|
|
3525
|
+
return t10;
|
|
3410
3526
|
}
|
|
3411
3527
|
|
|
3412
3528
|
// src/utils/returns-true.ts
|
|
@@ -5093,6 +5209,7 @@ function CodeBlock(t0) {
|
|
|
5093
5209
|
let t5;
|
|
5094
5210
|
if ($[8] !== t2 || $[9] !== t4) {
|
|
5095
5211
|
t5 = /* @__PURE__ */ jsx("pre", {
|
|
5212
|
+
"data-code-block": "",
|
|
5096
5213
|
"data-language": t2,
|
|
5097
5214
|
children: t4
|
|
5098
5215
|
});
|
package/dist/style.css
CHANGED
|
@@ -854,9 +854,12 @@
|
|
|
854
854
|
}
|
|
855
855
|
.meow_Positioner_Dqll0G {
|
|
856
856
|
z-index: 50;
|
|
857
|
+
border: 0;
|
|
857
858
|
flex-direction: column;
|
|
858
859
|
width: min(24rem, 100vw - 1rem);
|
|
859
860
|
height: min-content;
|
|
861
|
+
margin: 0;
|
|
862
|
+
padding: 0;
|
|
860
863
|
display: flex;
|
|
861
864
|
overflow: visible;
|
|
862
865
|
}
|
|
@@ -927,6 +930,12 @@
|
|
|
927
930
|
font-size: .8125rem;
|
|
928
931
|
overflow: hidden;
|
|
929
932
|
}
|
|
933
|
+
.meow_MenuPositioner_hpZLgq {
|
|
934
|
+
border: 0;
|
|
935
|
+
margin: 0;
|
|
936
|
+
padding: 0;
|
|
937
|
+
}
|
|
938
|
+
|
|
930
939
|
.meow_Positioner_hpZLgq, .meow_MenuPositioner_hpZLgq {
|
|
931
940
|
z-index: 50;
|
|
932
941
|
width: min-content;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.82.
|
|
4
|
+
"version": "0.82.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@base-ui/react": "^1.9.0",
|
|
25
|
-
"@meowdown/core": "0.
|
|
25
|
+
"@meowdown/core": "0.83.0",
|
|
26
26
|
"@meowdown/embed": "0.3.1",
|
|
27
|
-
"@meowdown/markdown": "0.
|
|
27
|
+
"@meowdown/markdown": "0.78.0",
|
|
28
28
|
"@ocavue/utils": "^1.9.0",
|
|
29
29
|
"@post-embed/types": "^0.5.0",
|
|
30
|
-
"@prosekit/core": "^0.13.
|
|
31
|
-
"@prosekit/pm": "^0.1.
|
|
32
|
-
"@prosekit/react": "^0.
|
|
33
|
-
"@prosekit/web": "^0.
|
|
30
|
+
"@prosekit/core": "^0.13.4",
|
|
31
|
+
"@prosekit/pm": "^0.1.21",
|
|
32
|
+
"@prosekit/react": "^0.9.0",
|
|
33
|
+
"@prosekit/web": "^0.10.0",
|
|
34
34
|
"beautiful-mermaid": "^1.1.3",
|
|
35
35
|
"clsx": "^2.1.1",
|
|
36
36
|
"github-slugger": "^2.0.0",
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
"@css-modules-kit/codegen": "^1.4.0",
|
|
54
54
|
"@meowdown/vitest": "0.0.0",
|
|
55
55
|
"@ocavue/tsconfig": "^0.7.1",
|
|
56
|
-
"@tsdown/css": "^0.23.
|
|
56
|
+
"@tsdown/css": "^0.23.3",
|
|
57
57
|
"@types/react": "^19.3.0",
|
|
58
58
|
"@types/react-dom": "^19.3.0",
|
|
59
59
|
"@vitejs/plugin-react": "^6.1.2",
|
|
60
60
|
"@vitest/browser-playwright": "^5.0.5",
|
|
61
61
|
"dedent": "^1.7.2",
|
|
62
|
-
"oxc-transform-react": "^0.
|
|
63
|
-
"react": "^19.3.
|
|
64
|
-
"react-dom": "^19.3.
|
|
65
|
-
"tsdown": "^0.23.
|
|
62
|
+
"oxc-transform-react": "^0.156.0",
|
|
63
|
+
"react": "^19.3.1",
|
|
64
|
+
"react-dom": "^19.3.1",
|
|
65
|
+
"tsdown": "^0.23.3",
|
|
66
66
|
"vitest": "^5.0.5",
|
|
67
67
|
"vitest-browser-commands": "^0.5.0",
|
|
68
68
|
"vitest-browser-react": "^2.3.0"
|