rme 0.3.0-beta.30 → 0.3.0-beta.32
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.mjs +72 -108
- package/dist/index.mjs.map +3 -3
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -567,10 +567,10 @@ var FlatListStyles = css`
|
|
|
567
567
|
counter-increment: prosemirror-flat-list-counter;
|
|
568
568
|
|
|
569
569
|
/*
|
|
570
|
-
Reset the counter for the first list node in the sequence
|
|
570
|
+
Reset the counter for the first list node in the sequence or when
|
|
571
|
+
the previous sibling is not a list (paragraph break).
|
|
571
572
|
*/
|
|
572
|
-
&:first-child
|
|
573
|
-
:not(&) + & {
|
|
573
|
+
&:first-child {
|
|
574
574
|
counter-reset: prosemirror-flat-list-counter;
|
|
575
575
|
|
|
576
576
|
/*
|
|
@@ -620,6 +620,24 @@ var FlatListStyles = css`
|
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
+
|
|
624
|
+
/*
|
|
625
|
+
Reset counter when an ordered list follows a non-list element.
|
|
626
|
+
This handles the case where there's a paragraph break (e.g., h3) between lists.
|
|
627
|
+
*/
|
|
628
|
+
:not(.prosemirror-flat-list) + .prosemirror-flat-list[data-list-kind='ordered'] {
|
|
629
|
+
counter-reset: prosemirror-flat-list-counter;
|
|
630
|
+
|
|
631
|
+
&[data-list-order] {
|
|
632
|
+
@supports (counter-set: prosemirror-flat-list-counter 1) {
|
|
633
|
+
counter-set: prosemirror-flat-list-counter var(--prosemirror-flat-list-order);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
@supports not (counter-set: prosemirror-flat-list-counter 1) {
|
|
637
|
+
counter-increment: prosemirror-flat-list-counter var(--prosemirror-flat-list-order);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
623
641
|
`;
|
|
624
642
|
|
|
625
643
|
// src/editor/theme/WysiwygThemeWrapper.tsx
|
|
@@ -2253,7 +2271,7 @@ function computeChange(oldVal, newVal) {
|
|
|
2253
2271
|
|
|
2254
2272
|
// src/editor/components/Editor.tsx
|
|
2255
2273
|
import { prosemirrorNodeToHtml } from "@rme-sdk/main";
|
|
2256
|
-
import { forwardRef as forwardRef2, memo as memo9, useImperativeHandle as useImperativeHandle2, useMemo as useMemo7, useState as
|
|
2274
|
+
import { forwardRef as forwardRef2, memo as memo9, useImperativeHandle as useImperativeHandle2, useMemo as useMemo7, useState as useState8 } from "react";
|
|
2257
2275
|
|
|
2258
2276
|
// src/editor/components/SourceEditor/index.tsx
|
|
2259
2277
|
import { ProsemirrorDevTools } from "@rme-sdk/dev";
|
|
@@ -12557,123 +12575,69 @@ import { PositionerPortal, useCommands as useCommands3, useMultiPositioner } fro
|
|
|
12557
12575
|
import { useEffect as useEffect9 } from "react";
|
|
12558
12576
|
|
|
12559
12577
|
// src/editor/toolbar/TableToolbar/ActiveCellMenu.tsx
|
|
12560
|
-
import {
|
|
12561
|
-
ClickAwayListener,
|
|
12562
|
-
Grow,
|
|
12563
|
-
ListItemText,
|
|
12564
|
-
MenuItem as MenuItem2,
|
|
12565
|
-
MenuList,
|
|
12566
|
-
Paper,
|
|
12567
|
-
Popper
|
|
12568
|
-
} from "@mui/material";
|
|
12569
12578
|
import { useCommands } from "@rme-sdk/react";
|
|
12570
|
-
import {
|
|
12579
|
+
import { Dropdown } from "antd";
|
|
12571
12580
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
12572
|
-
import
|
|
12573
|
-
import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
12574
|
-
var Container5 = styled12.div`
|
|
12575
|
-
position: absolute;
|
|
12576
|
-
|
|
12577
|
-
.MuiList-padding {
|
|
12578
|
-
padding: 0;
|
|
12579
|
-
}
|
|
12580
|
-
`;
|
|
12581
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
12581
12582
|
var ActiveCellMenu = (props) => {
|
|
12582
12583
|
const { positioner } = props;
|
|
12583
12584
|
const commands = useCommands();
|
|
12584
|
-
const [open, setOpen] = useState8(false);
|
|
12585
|
-
const anchorRef = useRef9(null);
|
|
12586
12585
|
const { t: t19 } = useTranslation2();
|
|
12587
|
-
const
|
|
12586
|
+
const menuItems = [
|
|
12588
12587
|
{
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12588
|
+
key: "insertColumnBefore",
|
|
12589
|
+
label: t19("table.insertColumnBefore"),
|
|
12590
|
+
onClick: commands.addTableColumnBefore
|
|
12592
12591
|
},
|
|
12593
12592
|
{
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12593
|
+
key: "insertColumnAfter",
|
|
12594
|
+
label: t19("table.insertColumnAfter"),
|
|
12595
|
+
onClick: commands.addTableColumnAfter
|
|
12597
12596
|
},
|
|
12598
12597
|
{
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12598
|
+
key: "insertRowBefore",
|
|
12599
|
+
label: t19("table.insertRowBefore"),
|
|
12600
|
+
onClick: commands.addTableRowBefore
|
|
12602
12601
|
},
|
|
12603
12602
|
{
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12603
|
+
key: "insertRowAfter",
|
|
12604
|
+
label: t19("table.insertRowAfter"),
|
|
12605
|
+
onClick: commands.addTableRowAfter
|
|
12607
12606
|
},
|
|
12608
12607
|
{
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12608
|
+
key: "deleteColumn",
|
|
12609
|
+
label: t19("table.deleteColumn"),
|
|
12610
|
+
onClick: commands.deleteTableColumn
|
|
12612
12611
|
},
|
|
12613
12612
|
{
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
-
|
|
12613
|
+
key: "deleteRow",
|
|
12614
|
+
label: t19("table.deleteRow"),
|
|
12615
|
+
onClick: commands.deleteTableRow
|
|
12617
12616
|
}
|
|
12618
12617
|
];
|
|
12619
|
-
const handleClose = (event) => {
|
|
12620
|
-
if (anchorRef.current && anchorRef.current.contains(event.target)) {
|
|
12621
|
-
return;
|
|
12622
|
-
}
|
|
12623
|
-
setOpen(false);
|
|
12624
|
-
};
|
|
12625
12618
|
const { ref, key: key2, x, y } = positioner;
|
|
12626
|
-
return /* @__PURE__ */
|
|
12627
|
-
|
|
12619
|
+
return /* @__PURE__ */ jsx20(
|
|
12620
|
+
"div",
|
|
12628
12621
|
{
|
|
12629
12622
|
ref,
|
|
12630
12623
|
style: {
|
|
12624
|
+
position: "absolute",
|
|
12631
12625
|
left: x,
|
|
12632
12626
|
top: y,
|
|
12633
12627
|
width: 20,
|
|
12634
12628
|
height: 20,
|
|
12635
12629
|
zIndex: 1
|
|
12636
12630
|
},
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
zIndex: 1
|
|
12648
|
-
},
|
|
12649
|
-
open,
|
|
12650
|
-
anchorEl: anchorRef.current,
|
|
12651
|
-
role: void 0,
|
|
12652
|
-
transition: true,
|
|
12653
|
-
disablePortal: true,
|
|
12654
|
-
children: ({ TransitionProps, placement }) => /* @__PURE__ */ jsx20(
|
|
12655
|
-
Grow,
|
|
12656
|
-
{
|
|
12657
|
-
...TransitionProps,
|
|
12658
|
-
style: {
|
|
12659
|
-
transformOrigin: placement === "bottom" ? "center top" : "center bottom"
|
|
12660
|
-
},
|
|
12661
|
-
children: /* @__PURE__ */ jsx20(Paper, { children: /* @__PURE__ */ jsx20(ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsx20(MenuList, { dense: true, autoFocusItem: true, children: options.map((option) => /* @__PURE__ */ jsx20(
|
|
12662
|
-
MenuItem2,
|
|
12663
|
-
{
|
|
12664
|
-
onClick: () => {
|
|
12665
|
-
option.handler();
|
|
12666
|
-
setOpen(false);
|
|
12667
|
-
},
|
|
12668
|
-
children: /* @__PURE__ */ jsx20(ListItemText, { children: t19(option.i18nKey) })
|
|
12669
|
-
},
|
|
12670
|
-
option.label
|
|
12671
|
-
)) }) }) })
|
|
12672
|
-
}
|
|
12673
|
-
)
|
|
12674
|
-
}
|
|
12675
|
-
)
|
|
12676
|
-
]
|
|
12631
|
+
children: /* @__PURE__ */ jsx20(Dropdown, { menu: { items: menuItems }, trigger: ["click"], children: /* @__PURE__ */ jsx20(
|
|
12632
|
+
"div",
|
|
12633
|
+
{
|
|
12634
|
+
onMouseDown: (e) => {
|
|
12635
|
+
e.preventDefault();
|
|
12636
|
+
},
|
|
12637
|
+
style: { cursor: "pointer" },
|
|
12638
|
+
children: /* @__PURE__ */ jsx20("i", { className: "ri-equalizer-line" })
|
|
12639
|
+
}
|
|
12640
|
+
) })
|
|
12677
12641
|
},
|
|
12678
12642
|
key2
|
|
12679
12643
|
);
|
|
@@ -12682,10 +12646,10 @@ var ActiveCellMenu_default = ActiveCellMenu;
|
|
|
12682
12646
|
|
|
12683
12647
|
// src/editor/toolbar/TableToolbar/TableBar.tsx
|
|
12684
12648
|
import { useCommands as useCommands2 } from "@rme-sdk/react";
|
|
12685
|
-
import
|
|
12649
|
+
import styled12 from "styled-components";
|
|
12686
12650
|
import { Tooltip } from "zens";
|
|
12687
12651
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
12688
|
-
var
|
|
12652
|
+
var Container5 = styled12.div`
|
|
12689
12653
|
position: absolute;
|
|
12690
12654
|
color: ${(props) => props.theme.dangerColor};
|
|
12691
12655
|
`;
|
|
@@ -12694,7 +12658,7 @@ function TableBar(props) {
|
|
|
12694
12658
|
const commands = useCommands2();
|
|
12695
12659
|
const { ref, key: key2, x, y } = positioner;
|
|
12696
12660
|
return /* @__PURE__ */ jsx21(
|
|
12697
|
-
|
|
12661
|
+
Container5,
|
|
12698
12662
|
{
|
|
12699
12663
|
ref,
|
|
12700
12664
|
style: {
|
|
@@ -12820,7 +12784,7 @@ var TableToolbar_default = TableToolbar;
|
|
|
12820
12784
|
// src/editor/toolbar/toolbar/command-btns/command-button.tsx
|
|
12821
12785
|
import { isString as isString4 } from "@rme-sdk/core";
|
|
12822
12786
|
import { useCallback as useCallback6 } from "react";
|
|
12823
|
-
import
|
|
12787
|
+
import styled13 from "styled-components";
|
|
12824
12788
|
import { Ariakit, Tooltip as Tooltip2 } from "zens";
|
|
12825
12789
|
|
|
12826
12790
|
// src/editor/toolbar/toolbar/use-command-option-values.ts
|
|
@@ -12906,7 +12870,7 @@ var CommandButton = ({
|
|
|
12906
12870
|
const tooltipText = label ?? labelText;
|
|
12907
12871
|
const shortcutText = displayShortcut && commandOptions.shortcut ? ` (${commandOptions.shortcut})` : "";
|
|
12908
12872
|
return /* @__PURE__ */ jsx24(Tooltip2, { title: `${tooltipText}${shortcutText}`, children: /* @__PURE__ */ jsx24(
|
|
12909
|
-
|
|
12873
|
+
Container6,
|
|
12910
12874
|
{
|
|
12911
12875
|
"aria-label": labelText,
|
|
12912
12876
|
disabled: !enabled,
|
|
@@ -12917,7 +12881,7 @@ var CommandButton = ({
|
|
|
12917
12881
|
}
|
|
12918
12882
|
) });
|
|
12919
12883
|
};
|
|
12920
|
-
var
|
|
12884
|
+
var Container6 = styled13(Ariakit.ToolbarItem)`
|
|
12921
12885
|
display: flex;
|
|
12922
12886
|
flex-direction: column;
|
|
12923
12887
|
align-items: center;
|
|
@@ -12935,7 +12899,7 @@ var Container7 = styled14(Ariakit.ToolbarItem)`
|
|
|
12935
12899
|
`;
|
|
12936
12900
|
|
|
12937
12901
|
// src/editor/toolbar/toolbar/wysiwyg-toolbar.tsx
|
|
12938
|
-
import
|
|
12902
|
+
import styled14 from "styled-components";
|
|
12939
12903
|
import { Ariakit as Ariakit2 } from "zens";
|
|
12940
12904
|
|
|
12941
12905
|
// src/editor/toolbar/toolbar/command-btns/insert-separator-button.tsx
|
|
@@ -13282,10 +13246,10 @@ var UndoButton = (props) => {
|
|
|
13282
13246
|
};
|
|
13283
13247
|
|
|
13284
13248
|
// src/editor/toolbar/toolbar/wysiwyg-toolbar.tsx
|
|
13285
|
-
import { jsx as jsx37, jsxs as
|
|
13249
|
+
import { jsx as jsx37, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
13286
13250
|
var WysiwygToolbar = (props) => {
|
|
13287
13251
|
const { prevActions = null, nextActions = null } = props;
|
|
13288
|
-
return /* @__PURE__ */
|
|
13252
|
+
return /* @__PURE__ */ jsxs9(ToolBar, { className: props.className, style: props.style, children: [
|
|
13289
13253
|
prevActions,
|
|
13290
13254
|
/* @__PURE__ */ jsx37(UndoButton, {}),
|
|
13291
13255
|
/* @__PURE__ */ jsx37(RedoButton, {}),
|
|
@@ -13304,7 +13268,7 @@ var WysiwygToolbar = (props) => {
|
|
|
13304
13268
|
nextActions
|
|
13305
13269
|
] });
|
|
13306
13270
|
};
|
|
13307
|
-
var ToolBar =
|
|
13271
|
+
var ToolBar = styled14(Ariakit2.Toolbar)`
|
|
13308
13272
|
display: flex;
|
|
13309
13273
|
flex-wrap: wrap;
|
|
13310
13274
|
max-width: 100%;
|
|
@@ -13315,7 +13279,7 @@ var ToolBar = styled15(Ariakit2.Toolbar)`
|
|
|
13315
13279
|
color: ${(props) => props.theme.primaryFontColor};
|
|
13316
13280
|
background-color: ${(props) => props.theme.editorToolbarBgColor};
|
|
13317
13281
|
`;
|
|
13318
|
-
var ToolbarSeparator =
|
|
13282
|
+
var ToolbarSeparator = styled14(Ariakit2.ToolbarSeparator)`
|
|
13319
13283
|
height: 0.5em;
|
|
13320
13284
|
margin: 0 0.25em;
|
|
13321
13285
|
border-right-width: 1px;
|
|
@@ -13417,7 +13381,7 @@ var createWysiwygDelegate = (options = {}) => {
|
|
|
13417
13381
|
};
|
|
13418
13382
|
|
|
13419
13383
|
// src/editor/components/WysiwygEditor/index.tsx
|
|
13420
|
-
import { jsx as jsx39, jsxs as
|
|
13384
|
+
import { jsx as jsx39, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
13421
13385
|
var WysiwygEditor = (props) => {
|
|
13422
13386
|
const {
|
|
13423
13387
|
content,
|
|
@@ -13458,7 +13422,7 @@ var WysiwygEditor = (props) => {
|
|
|
13458
13422
|
} catch (error) {
|
|
13459
13423
|
return /* @__PURE__ */ jsx39(ErrorBoundary_default, { hasError: true, error, ...props.errorHandler || {} });
|
|
13460
13424
|
}
|
|
13461
|
-
return /* @__PURE__ */ jsx39(ErrorBoundary_default, { ...props.errorHandler || {}, children: /* @__PURE__ */ jsx39(WysiwygThemeWrapper, { ...styleToken, children: /* @__PURE__ */
|
|
13425
|
+
return /* @__PURE__ */ jsx39(ErrorBoundary_default, { ...props.errorHandler || {}, children: /* @__PURE__ */ jsx39(WysiwygThemeWrapper, { ...styleToken, children: /* @__PURE__ */ jsxs10(
|
|
13462
13426
|
Remirror2,
|
|
13463
13427
|
{
|
|
13464
13428
|
manager: editorDelegate.manager,
|
|
@@ -13492,7 +13456,7 @@ var Editor = memo9(
|
|
|
13492
13456
|
onContextMounted,
|
|
13493
13457
|
...otherProps
|
|
13494
13458
|
} = props;
|
|
13495
|
-
const [type, setType] =
|
|
13459
|
+
const [type, setType] = useState8(initialType);
|
|
13496
13460
|
useImperativeHandle2(ref, () => ({
|
|
13497
13461
|
getType: () => type,
|
|
13498
13462
|
toggleType: (targetType) => {
|
|
@@ -13659,7 +13623,7 @@ var ThemeProvider = memo10(({ theme, i18n, children }) => {
|
|
|
13659
13623
|
});
|
|
13660
13624
|
|
|
13661
13625
|
// src/editor/components/Preview/preview.tsx
|
|
13662
|
-
import { useEffect as useEffect12, useState as
|
|
13626
|
+
import { useEffect as useEffect12, useState as useState9 } from "react";
|
|
13663
13627
|
import { Icon } from "zens";
|
|
13664
13628
|
|
|
13665
13629
|
// src/editor/utils/prosemirrorNodeToHtml.ts
|
|
@@ -13784,7 +13748,7 @@ var rmeProsemirrorNodeToHtml = async (doc, delegateOptions) => {
|
|
|
13784
13748
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
13785
13749
|
var Preview = (props) => {
|
|
13786
13750
|
const { doc, delegateOptions } = props;
|
|
13787
|
-
const [processedHtml, setProcessedHtml] =
|
|
13751
|
+
const [processedHtml, setProcessedHtml] = useState9("");
|
|
13788
13752
|
let targetDoc = doc;
|
|
13789
13753
|
if (typeof targetDoc === "string") {
|
|
13790
13754
|
targetDoc = createWysiwygDelegate(delegateOptions).stringToDoc(targetDoc);
|