rme 0.2.0 → 0.2.1
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 +117 -112
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -22396,7 +22396,8 @@ import { Input as Input2, Space as Space2 } from "zens";
|
|
|
22396
22396
|
import Color from "color";
|
|
22397
22397
|
var darken = (color, amount) => Color(color).darken(amount).string();
|
|
22398
22398
|
|
|
22399
|
-
// src/editor/utils/getOS.
|
|
22399
|
+
// src/editor/utils/getOS.tsx
|
|
22400
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
22400
22401
|
function getOS() {
|
|
22401
22402
|
const userAgent = window.navigator.userAgent;
|
|
22402
22403
|
const platform2 = window.navigator.platform;
|
|
@@ -22408,15 +22409,19 @@ function getOS() {
|
|
|
22408
22409
|
return "Unknown";
|
|
22409
22410
|
}
|
|
22410
22411
|
}
|
|
22411
|
-
function
|
|
22412
|
+
function getModKeyIconName() {
|
|
22412
22413
|
const os = getOS();
|
|
22413
|
-
return os === "macOS" ? "
|
|
22414
|
+
return os === "macOS" ? /* @__PURE__ */ jsx14("i", { className: "ri-command-line" }) : "Ctrl";
|
|
22415
|
+
}
|
|
22416
|
+
function getModEventKey() {
|
|
22417
|
+
const os = getOS();
|
|
22418
|
+
return os === "macOS" ? "metaKey" : "ctrlKey";
|
|
22414
22419
|
}
|
|
22415
22420
|
|
|
22416
22421
|
// src/editor/toolbar/SlashMenu/TablePanel.tsx
|
|
22417
22422
|
import { forwardRef, useState as useState5, useImperativeHandle, memo as memo4 } from "react";
|
|
22418
22423
|
import styled7 from "styled-components";
|
|
22419
|
-
import { jsx as
|
|
22424
|
+
import { jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
22420
22425
|
var TablePanelCell = styled7.div.attrs((p) => p)`
|
|
22421
22426
|
border: 1px solid ${(props) => props.theme.borderColor};
|
|
22422
22427
|
margin-right: 1px;
|
|
@@ -22479,9 +22484,9 @@ var TablePanel = memo4(
|
|
|
22479
22484
|
columnsCount
|
|
22480
22485
|
] }),
|
|
22481
22486
|
Array.from({ length: displayRows }).map((_, i) => {
|
|
22482
|
-
return /* @__PURE__ */
|
|
22487
|
+
return /* @__PURE__ */ jsx15("div", { style: { display: "flex" }, children: Array.from({ length: displayCols }).map((_2, j) => {
|
|
22483
22488
|
const inScope = i < rowsCount && j < columnsCount;
|
|
22484
|
-
return /* @__PURE__ */
|
|
22489
|
+
return /* @__PURE__ */ jsx15(
|
|
22485
22490
|
TablePanelCell,
|
|
22486
22491
|
{
|
|
22487
22492
|
inScope,
|
|
@@ -22504,7 +22509,7 @@ var TablePanel = memo4(
|
|
|
22504
22509
|
var TablePanel_default = TablePanel;
|
|
22505
22510
|
|
|
22506
22511
|
// src/editor/toolbar/SlashMenu/SlashMenuRoot.tsx
|
|
22507
|
-
import { Fragment as Fragment5, jsx as
|
|
22512
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
22508
22513
|
var SlashMenuRoot = memo5(
|
|
22509
22514
|
({ rootRef, commands, closeMenu }) => {
|
|
22510
22515
|
const componentRefMap = useRef5({});
|
|
@@ -22536,7 +22541,7 @@ var SlashMenuRoot = memo5(
|
|
|
22536
22541
|
},
|
|
22537
22542
|
Renderer: {
|
|
22538
22543
|
id: "table",
|
|
22539
|
-
Component: /* @__PURE__ */
|
|
22544
|
+
Component: /* @__PURE__ */ jsx16(
|
|
22540
22545
|
TablePanel_default,
|
|
22541
22546
|
{
|
|
22542
22547
|
ref: (el) => componentRefMap.current.table = el,
|
|
@@ -22678,7 +22683,7 @@ var SlashMenuRoot = memo5(
|
|
|
22678
22683
|
if (event.key === "Escape") {
|
|
22679
22684
|
return closeMenu();
|
|
22680
22685
|
}
|
|
22681
|
-
if (searchText && event
|
|
22686
|
+
if (searchText && event[getModEventKey()] === false) {
|
|
22682
22687
|
return;
|
|
22683
22688
|
}
|
|
22684
22689
|
if (activeItemId) {
|
|
@@ -22732,7 +22737,7 @@ var SlashMenuRoot = memo5(
|
|
|
22732
22737
|
searchText
|
|
22733
22738
|
]);
|
|
22734
22739
|
return /* @__PURE__ */ jsxs6("div", { ref: rootRef, style: { display: "flex", flexDirection: "column" }, children: [
|
|
22735
|
-
/* @__PURE__ */
|
|
22740
|
+
/* @__PURE__ */ jsx16(SearchContainer, { children: /* @__PURE__ */ jsx16(
|
|
22736
22741
|
Input2,
|
|
22737
22742
|
{
|
|
22738
22743
|
type: "text",
|
|
@@ -22765,13 +22770,13 @@ var SlashMenuRoot = memo5(
|
|
|
22765
22770
|
/* @__PURE__ */ jsxs6(MenuPanel, { active: true, location: "left", children: [
|
|
22766
22771
|
filteredMenuItems.map((item) => {
|
|
22767
22772
|
const selected = item.id === activeGroupId;
|
|
22768
|
-
return /* @__PURE__ */
|
|
22773
|
+
return /* @__PURE__ */ jsx16(
|
|
22769
22774
|
MenuItem,
|
|
22770
22775
|
{
|
|
22771
22776
|
onClick: () => setActiveGroupId(item.id),
|
|
22772
22777
|
selected,
|
|
22773
22778
|
children: /* @__PURE__ */ jsxs6(Space2, { size: 4, children: [
|
|
22774
|
-
/* @__PURE__ */
|
|
22779
|
+
/* @__PURE__ */ jsx16("i", { className: item.iconName }),
|
|
22775
22780
|
" ",
|
|
22776
22781
|
item.title
|
|
22777
22782
|
] })
|
|
@@ -22779,11 +22784,11 @@ var SlashMenuRoot = memo5(
|
|
|
22779
22784
|
item.id
|
|
22780
22785
|
);
|
|
22781
22786
|
}),
|
|
22782
|
-
filteredMenuItems.length === 0 && /* @__PURE__ */
|
|
22787
|
+
filteredMenuItems.length === 0 && /* @__PURE__ */ jsx16("div", { children: /* @__PURE__ */ jsx16("span", { children: t18("slashMenu.noResults") }) })
|
|
22783
22788
|
] }),
|
|
22784
|
-
currentMenuItem?.children || currentMenuItem?.Renderer?.Component ? /* @__PURE__ */
|
|
22789
|
+
currentMenuItem?.children || currentMenuItem?.Renderer?.Component ? /* @__PURE__ */ jsx16(MenuPanel, { active: !!activeItemId, location: "right", children: currentMenuItem?.Renderer ? currentMenuItem.Renderer.Component : currentMenuItem?.children?.map((item) => {
|
|
22785
22790
|
const selected = item.id === activeItemId;
|
|
22786
|
-
return /* @__PURE__ */
|
|
22791
|
+
return /* @__PURE__ */ jsx16(
|
|
22787
22792
|
MenuItem,
|
|
22788
22793
|
{
|
|
22789
22794
|
selected,
|
|
@@ -22801,10 +22806,10 @@ var SlashMenuRoot = memo5(
|
|
|
22801
22806
|
/* @__PURE__ */ jsxs6(SlashMenuFooter, { children: [
|
|
22802
22807
|
/* @__PURE__ */ jsxs6(Shortcut, { children: [
|
|
22803
22808
|
searchText ? /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
22804
|
-
/* @__PURE__ */
|
|
22805
|
-
/* @__PURE__ */
|
|
22809
|
+
/* @__PURE__ */ jsx16("kbd", { children: getModKeyIconName() }),
|
|
22810
|
+
/* @__PURE__ */ jsx16("span", { children: " + " })
|
|
22806
22811
|
] }) : null,
|
|
22807
|
-
/* @__PURE__ */
|
|
22812
|
+
/* @__PURE__ */ jsx16("kbd", { "aria-label": "Up Arrow", children: /* @__PURE__ */ jsxs6(
|
|
22808
22813
|
"svg",
|
|
22809
22814
|
{
|
|
22810
22815
|
width: "14",
|
|
@@ -22816,12 +22821,12 @@ var SlashMenuRoot = memo5(
|
|
|
22816
22821
|
"stroke-linecap": "round",
|
|
22817
22822
|
"stroke-linejoin": "round",
|
|
22818
22823
|
children: [
|
|
22819
|
-
/* @__PURE__ */
|
|
22820
|
-
/* @__PURE__ */
|
|
22824
|
+
/* @__PURE__ */ jsx16("path", { d: "m5 12 7-7 7 7" }),
|
|
22825
|
+
/* @__PURE__ */ jsx16("path", { d: "M12 19V5" })
|
|
22821
22826
|
]
|
|
22822
22827
|
}
|
|
22823
22828
|
) }),
|
|
22824
|
-
/* @__PURE__ */
|
|
22829
|
+
/* @__PURE__ */ jsx16("kbd", { "aria-label": "Down Arrow", children: /* @__PURE__ */ jsxs6(
|
|
22825
22830
|
"svg",
|
|
22826
22831
|
{
|
|
22827
22832
|
width: "14",
|
|
@@ -22833,13 +22838,13 @@ var SlashMenuRoot = memo5(
|
|
|
22833
22838
|
"stroke-linecap": "round",
|
|
22834
22839
|
"stroke-linejoin": "round",
|
|
22835
22840
|
children: [
|
|
22836
|
-
/* @__PURE__ */
|
|
22837
|
-
/* @__PURE__ */
|
|
22841
|
+
/* @__PURE__ */ jsx16("path", { d: "M12 5v14" }),
|
|
22842
|
+
/* @__PURE__ */ jsx16("path", { d: "m19 12-7 7-7-7" })
|
|
22838
22843
|
]
|
|
22839
22844
|
}
|
|
22840
22845
|
) }),
|
|
22841
22846
|
currentMenuItem?.children || currentMenuItem?.Renderer ? /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
22842
|
-
/* @__PURE__ */
|
|
22847
|
+
/* @__PURE__ */ jsx16("kbd", { "aria-label": "Left Arrow", children: /* @__PURE__ */ jsxs6(
|
|
22843
22848
|
"svg",
|
|
22844
22849
|
{
|
|
22845
22850
|
width: "14",
|
|
@@ -22851,12 +22856,12 @@ var SlashMenuRoot = memo5(
|
|
|
22851
22856
|
"stroke-linecap": "round",
|
|
22852
22857
|
"stroke-linejoin": "round",
|
|
22853
22858
|
children: [
|
|
22854
|
-
/* @__PURE__ */
|
|
22855
|
-
/* @__PURE__ */
|
|
22859
|
+
/* @__PURE__ */ jsx16("path", { d: "m12 19-7-7 7-7" }),
|
|
22860
|
+
/* @__PURE__ */ jsx16("path", { d: "M19 12H5" })
|
|
22856
22861
|
]
|
|
22857
22862
|
}
|
|
22858
22863
|
) }),
|
|
22859
|
-
/* @__PURE__ */
|
|
22864
|
+
/* @__PURE__ */ jsx16("kbd", { "aria-label": "Right Arrow", children: /* @__PURE__ */ jsxs6(
|
|
22860
22865
|
"svg",
|
|
22861
22866
|
{
|
|
22862
22867
|
width: "14",
|
|
@@ -22868,8 +22873,8 @@ var SlashMenuRoot = memo5(
|
|
|
22868
22873
|
"stroke-linecap": "round",
|
|
22869
22874
|
"stroke-linejoin": "round",
|
|
22870
22875
|
children: [
|
|
22871
|
-
/* @__PURE__ */
|
|
22872
|
-
/* @__PURE__ */
|
|
22876
|
+
/* @__PURE__ */ jsx16("path", { d: "M5 12h14" }),
|
|
22877
|
+
/* @__PURE__ */ jsx16("path", { d: "m12 5 7 7-7 7" })
|
|
22873
22878
|
]
|
|
22874
22879
|
}
|
|
22875
22880
|
) })
|
|
@@ -22878,10 +22883,10 @@ var SlashMenuRoot = memo5(
|
|
|
22878
22883
|
] }),
|
|
22879
22884
|
/* @__PURE__ */ jsxs6(Shortcut, { children: [
|
|
22880
22885
|
searchText ? /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
22881
|
-
/* @__PURE__ */
|
|
22882
|
-
/* @__PURE__ */
|
|
22886
|
+
/* @__PURE__ */ jsx16("kbd", { children: getModKeyIconName() }),
|
|
22887
|
+
/* @__PURE__ */ jsx16("span", { children: " + " })
|
|
22883
22888
|
] }) : null,
|
|
22884
|
-
/* @__PURE__ */
|
|
22889
|
+
/* @__PURE__ */ jsx16("kbd", { "aria-label": "Enter", children: /* @__PURE__ */ jsxs6(
|
|
22885
22890
|
"svg",
|
|
22886
22891
|
{
|
|
22887
22892
|
width: "14",
|
|
@@ -22893,8 +22898,8 @@ var SlashMenuRoot = memo5(
|
|
|
22893
22898
|
"stroke-linecap": "round",
|
|
22894
22899
|
"stroke-linejoin": "round",
|
|
22895
22900
|
children: [
|
|
22896
|
-
/* @__PURE__ */
|
|
22897
|
-
/* @__PURE__ */
|
|
22901
|
+
/* @__PURE__ */ jsx16("polyline", { points: "9 10 4 15 9 20" }),
|
|
22902
|
+
/* @__PURE__ */ jsx16("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" })
|
|
22898
22903
|
]
|
|
22899
22904
|
}
|
|
22900
22905
|
) }),
|
|
@@ -22923,7 +22928,7 @@ var Shortcut = styled8.div`
|
|
|
22923
22928
|
display: flex;
|
|
22924
22929
|
justify-content: center;
|
|
22925
22930
|
align-items: center;
|
|
22926
|
-
font-size:
|
|
22931
|
+
font-size: 12px;
|
|
22927
22932
|
}
|
|
22928
22933
|
`;
|
|
22929
22934
|
var MenuPanel = styled8.div.attrs((p) => p)`
|
|
@@ -22975,7 +22980,7 @@ var MenuContainer = styled8.div`
|
|
|
22975
22980
|
`;
|
|
22976
22981
|
|
|
22977
22982
|
// src/editor/toolbar/SlashMenu/index.tsx
|
|
22978
|
-
import { Fragment as Fragment6, jsx as
|
|
22983
|
+
import { Fragment as Fragment6, jsx as jsx17 } from "react/jsx-runtime";
|
|
22979
22984
|
var SlashMenu = () => {
|
|
22980
22985
|
const { view: editorView, getState, commands } = useRemirrorContext3({ autoUpdate: true });
|
|
22981
22986
|
if (!editorView) {
|
|
@@ -23055,7 +23060,7 @@ var SlashMenu = () => {
|
|
|
23055
23060
|
editorView.focus();
|
|
23056
23061
|
}
|
|
23057
23062
|
}, [editorView, menuState.open, slashMenuExtension.pluginKey]);
|
|
23058
|
-
return /* @__PURE__ */
|
|
23063
|
+
return /* @__PURE__ */ jsx17(Fragment6, { children: menuState.open ? /* @__PURE__ */ jsx17(
|
|
23059
23064
|
Container2,
|
|
23060
23065
|
{
|
|
23061
23066
|
ref: setPopperElement,
|
|
@@ -23063,7 +23068,7 @@ var SlashMenu = () => {
|
|
|
23063
23068
|
...styles.popper
|
|
23064
23069
|
},
|
|
23065
23070
|
...attributes.popper,
|
|
23066
|
-
children: /* @__PURE__ */
|
|
23071
|
+
children: /* @__PURE__ */ jsx17(SlashMenuRoot, { rootRef, commands, closeMenu })
|
|
23067
23072
|
}
|
|
23068
23073
|
) : null });
|
|
23069
23074
|
};
|
|
@@ -23091,7 +23096,7 @@ import {
|
|
|
23091
23096
|
import { useCommands } from "@remirror/react";
|
|
23092
23097
|
import styled10 from "styled-components";
|
|
23093
23098
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
23094
|
-
import { jsx as
|
|
23099
|
+
import { jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
23095
23100
|
var Container3 = styled10.div`
|
|
23096
23101
|
position: absolute;
|
|
23097
23102
|
|
|
@@ -23160,8 +23165,8 @@ var ActiveCellMenu = (props) => {
|
|
|
23160
23165
|
setOpen(true);
|
|
23161
23166
|
},
|
|
23162
23167
|
children: [
|
|
23163
|
-
/* @__PURE__ */
|
|
23164
|
-
/* @__PURE__ */
|
|
23168
|
+
/* @__PURE__ */ jsx18("div", { ref: anchorRef, children: /* @__PURE__ */ jsx18("i", { className: "ri-equalizer-line" }) }),
|
|
23169
|
+
/* @__PURE__ */ jsx18(
|
|
23165
23170
|
Popper,
|
|
23166
23171
|
{
|
|
23167
23172
|
sx: {
|
|
@@ -23172,21 +23177,21 @@ var ActiveCellMenu = (props) => {
|
|
|
23172
23177
|
role: void 0,
|
|
23173
23178
|
transition: true,
|
|
23174
23179
|
disablePortal: true,
|
|
23175
|
-
children: ({ TransitionProps, placement }) => /* @__PURE__ */
|
|
23180
|
+
children: ({ TransitionProps, placement }) => /* @__PURE__ */ jsx18(
|
|
23176
23181
|
Grow,
|
|
23177
23182
|
{
|
|
23178
23183
|
...TransitionProps,
|
|
23179
23184
|
style: {
|
|
23180
23185
|
transformOrigin: placement === "bottom" ? "center top" : "center bottom"
|
|
23181
23186
|
},
|
|
23182
|
-
children: /* @__PURE__ */
|
|
23187
|
+
children: /* @__PURE__ */ jsx18(Paper, { children: /* @__PURE__ */ jsx18(ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsx18(MenuList, { dense: true, autoFocusItem: true, children: options.map((option) => /* @__PURE__ */ jsx18(
|
|
23183
23188
|
MenuItem2,
|
|
23184
23189
|
{
|
|
23185
23190
|
onClick: () => {
|
|
23186
23191
|
option.handler();
|
|
23187
23192
|
setOpen(false);
|
|
23188
23193
|
},
|
|
23189
|
-
children: /* @__PURE__ */
|
|
23194
|
+
children: /* @__PURE__ */ jsx18(ListItemText, { children: t18(option.i18nKey) })
|
|
23190
23195
|
},
|
|
23191
23196
|
option.label
|
|
23192
23197
|
)) }) }) })
|
|
@@ -23205,7 +23210,7 @@ var ActiveCellMenu_default = ActiveCellMenu;
|
|
|
23205
23210
|
import { useCommands as useCommands2 } from "@remirror/react";
|
|
23206
23211
|
import styled11 from "styled-components";
|
|
23207
23212
|
import { Tooltip as Tooltip2 } from "zens";
|
|
23208
|
-
import { jsx as
|
|
23213
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
23209
23214
|
var Container4 = styled11.div`
|
|
23210
23215
|
position: absolute;
|
|
23211
23216
|
color: ${(props) => props.theme.dangerColor};
|
|
@@ -23214,7 +23219,7 @@ function TableBar(props) {
|
|
|
23214
23219
|
const { positioner } = props;
|
|
23215
23220
|
const commands = useCommands2();
|
|
23216
23221
|
const { ref, key: key2, x, y } = positioner;
|
|
23217
|
-
return /* @__PURE__ */
|
|
23222
|
+
return /* @__PURE__ */ jsx19(
|
|
23218
23223
|
Container4,
|
|
23219
23224
|
{
|
|
23220
23225
|
ref,
|
|
@@ -23229,7 +23234,7 @@ function TableBar(props) {
|
|
|
23229
23234
|
e.preventDefault();
|
|
23230
23235
|
commands.deleteTable();
|
|
23231
23236
|
},
|
|
23232
|
-
children: /* @__PURE__ */
|
|
23237
|
+
children: /* @__PURE__ */ jsx19(Tooltip2, { title: "delete", children: /* @__PURE__ */ jsx19("i", { className: "ri-delete-bin-line" }) })
|
|
23233
23238
|
},
|
|
23234
23239
|
key2
|
|
23235
23240
|
);
|
|
@@ -23319,7 +23324,7 @@ var activeCellColumnAndRowPositioner = Positioner.create({
|
|
|
23319
23324
|
});
|
|
23320
23325
|
|
|
23321
23326
|
// src/editor/toolbar/TableToolbar/index.tsx
|
|
23322
|
-
import { Fragment as Fragment7, jsx as
|
|
23327
|
+
import { Fragment as Fragment7, jsx as jsx20 } from "react/jsx-runtime";
|
|
23323
23328
|
var MultiPositionerIllustration = ({ positioner }) => {
|
|
23324
23329
|
const positioners = useMultiPositioner(positioner, []);
|
|
23325
23330
|
const { forceUpdatePositioners } = useCommands3();
|
|
@@ -23328,13 +23333,13 @@ var MultiPositionerIllustration = ({ positioner }) => {
|
|
|
23328
23333
|
}, [forceUpdatePositioners]);
|
|
23329
23334
|
if (positioners.length === 0) return null;
|
|
23330
23335
|
const positionersRender = [TableBar_default, ActiveCellMenu_default];
|
|
23331
|
-
return /* @__PURE__ */
|
|
23336
|
+
return /* @__PURE__ */ jsx20(Fragment7, { children: positioners.map((pos, i) => {
|
|
23332
23337
|
const Component = positionersRender[i];
|
|
23333
|
-
return /* @__PURE__ */
|
|
23338
|
+
return /* @__PURE__ */ jsx20(Component, { positioner: pos }, pos.key);
|
|
23334
23339
|
}) });
|
|
23335
23340
|
};
|
|
23336
23341
|
var TableToolbar = () => {
|
|
23337
|
-
return /* @__PURE__ */
|
|
23342
|
+
return /* @__PURE__ */ jsx20(Fragment7, { children: /* @__PURE__ */ jsx20(PositionerPortal, { children: /* @__PURE__ */ jsx20(MultiPositionerIllustration, { positioner: activeCellColumnAndRowPositioner }) }) });
|
|
23338
23343
|
};
|
|
23339
23344
|
var TableToolbar_default = TableToolbar;
|
|
23340
23345
|
|
|
@@ -23388,16 +23393,16 @@ var useCommandOptionValues = ({
|
|
|
23388
23393
|
|
|
23389
23394
|
// src/editor/toolbar/toolbar/command-btns/command-button-icon.tsx
|
|
23390
23395
|
import { isString as isString4 } from "@remirror/core";
|
|
23391
|
-
import { jsx as
|
|
23396
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
23392
23397
|
var CommandButtonIcon = ({ icon }) => {
|
|
23393
23398
|
if (isString4(icon)) {
|
|
23394
|
-
return /* @__PURE__ */
|
|
23399
|
+
return /* @__PURE__ */ jsx21("i", { className: icon });
|
|
23395
23400
|
}
|
|
23396
23401
|
return icon;
|
|
23397
23402
|
};
|
|
23398
23403
|
|
|
23399
23404
|
// src/editor/toolbar/toolbar/command-btns/command-button.tsx
|
|
23400
|
-
import { jsx as
|
|
23405
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
23401
23406
|
var CommandButton = ({
|
|
23402
23407
|
commandName,
|
|
23403
23408
|
active = false,
|
|
@@ -23426,7 +23431,7 @@ var CommandButton = ({
|
|
|
23426
23431
|
const labelText = ariaLabel ?? commandOptions.label ?? "";
|
|
23427
23432
|
const tooltipText = label ?? labelText;
|
|
23428
23433
|
const shortcutText = displayShortcut && commandOptions.shortcut ? ` (${commandOptions.shortcut})` : "";
|
|
23429
|
-
return /* @__PURE__ */
|
|
23434
|
+
return /* @__PURE__ */ jsx22(Tooltip3, { title: `${tooltipText}${shortcutText}`, children: /* @__PURE__ */ jsx22(
|
|
23430
23435
|
Container5,
|
|
23431
23436
|
{
|
|
23432
23437
|
"aria-label": labelText,
|
|
@@ -23434,7 +23439,7 @@ var CommandButton = ({
|
|
|
23434
23439
|
...rest,
|
|
23435
23440
|
value: commandName,
|
|
23436
23441
|
onClick: handleChange,
|
|
23437
|
-
children: /* @__PURE__ */
|
|
23442
|
+
children: /* @__PURE__ */ jsx22(CommandButtonIcon, { icon: icon ?? fallbackIcon })
|
|
23438
23443
|
}
|
|
23439
23444
|
) });
|
|
23440
23445
|
};
|
|
@@ -23463,7 +23468,7 @@ import { Ariakit as Ariakit2 } from "zens";
|
|
|
23463
23468
|
import { useActive, useCommands as useCommands4 } from "@remirror/react-core";
|
|
23464
23469
|
import { useCallback as useCallback6 } from "react";
|
|
23465
23470
|
import { t as t6 } from "i18next";
|
|
23466
|
-
import { jsx as
|
|
23471
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
23467
23472
|
var InsertSeparatorButton = ({ attrs = {}, ...rest }) => {
|
|
23468
23473
|
const { insertHorizontalRule } = useCommands4();
|
|
23469
23474
|
const handleSelect = useCallback6(() => {
|
|
@@ -23473,7 +23478,7 @@ var InsertSeparatorButton = ({ attrs = {}, ...rest }) => {
|
|
|
23473
23478
|
}, [insertHorizontalRule, attrs]);
|
|
23474
23479
|
const active = useActive().codeMirror();
|
|
23475
23480
|
const enabled = insertHorizontalRule.enabled(attrs);
|
|
23476
|
-
return /* @__PURE__ */
|
|
23481
|
+
return /* @__PURE__ */ jsx23(
|
|
23477
23482
|
CommandButton,
|
|
23478
23483
|
{
|
|
23479
23484
|
...rest,
|
|
@@ -23492,7 +23497,7 @@ var InsertSeparatorButton = ({ attrs = {}, ...rest }) => {
|
|
|
23492
23497
|
import { useCommands as useCommands5, useHelpers as useHelpers2 } from "@remirror/react-core";
|
|
23493
23498
|
import { t as t7 } from "i18next";
|
|
23494
23499
|
import { useCallback as useCallback7 } from "react";
|
|
23495
|
-
import { jsx as
|
|
23500
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
23496
23501
|
var RedoButton = (props) => {
|
|
23497
23502
|
const { redo: redo3 } = useCommands5();
|
|
23498
23503
|
const { redoDepth: redoDepth2 } = useHelpers2(true);
|
|
@@ -23502,7 +23507,7 @@ var RedoButton = (props) => {
|
|
|
23502
23507
|
}
|
|
23503
23508
|
}, [redo3]);
|
|
23504
23509
|
const enabled = redoDepth2() > 0;
|
|
23505
|
-
return /* @__PURE__ */
|
|
23510
|
+
return /* @__PURE__ */ jsx24(
|
|
23506
23511
|
CommandButton,
|
|
23507
23512
|
{
|
|
23508
23513
|
...props,
|
|
@@ -23520,7 +23525,7 @@ var RedoButton = (props) => {
|
|
|
23520
23525
|
import { useActive as useActive2, useCommands as useCommands6 } from "@remirror/react-core";
|
|
23521
23526
|
import { useCallback as useCallback8 } from "react";
|
|
23522
23527
|
import { t as t8 } from "i18next";
|
|
23523
|
-
import { jsx as
|
|
23528
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
23524
23529
|
var ToggleBlockquoteButton = ({ ...rest }) => {
|
|
23525
23530
|
const { toggleBlockquote } = useCommands6();
|
|
23526
23531
|
const handleSelect = useCallback8(() => {
|
|
@@ -23530,7 +23535,7 @@ var ToggleBlockquoteButton = ({ ...rest }) => {
|
|
|
23530
23535
|
}, [toggleBlockquote]);
|
|
23531
23536
|
const active = useActive2().blockquote();
|
|
23532
23537
|
const enabled = toggleBlockquote.enabled();
|
|
23533
|
-
return /* @__PURE__ */
|
|
23538
|
+
return /* @__PURE__ */ jsx25(
|
|
23534
23539
|
CommandButton,
|
|
23535
23540
|
{
|
|
23536
23541
|
...rest,
|
|
@@ -23548,7 +23553,7 @@ var ToggleBlockquoteButton = ({ ...rest }) => {
|
|
|
23548
23553
|
import { useActive as useActive3, useCommands as useCommands7 } from "@remirror/react-core";
|
|
23549
23554
|
import { useCallback as useCallback9 } from "react";
|
|
23550
23555
|
import { t as t9 } from "i18next";
|
|
23551
|
-
import { jsx as
|
|
23556
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
23552
23557
|
var ToggleBoldButton = (props) => {
|
|
23553
23558
|
const { toggleStrong } = useCommands7();
|
|
23554
23559
|
const handleSelect = useCallback9(() => {
|
|
@@ -23558,7 +23563,7 @@ var ToggleBoldButton = (props) => {
|
|
|
23558
23563
|
}, [toggleStrong]);
|
|
23559
23564
|
const active = useActive3().mdStrong();
|
|
23560
23565
|
const enabled = toggleStrong.enabled();
|
|
23561
|
-
return /* @__PURE__ */
|
|
23566
|
+
return /* @__PURE__ */ jsx26(
|
|
23562
23567
|
CommandButton,
|
|
23563
23568
|
{
|
|
23564
23569
|
...props,
|
|
@@ -23576,7 +23581,7 @@ var ToggleBoldButton = (props) => {
|
|
|
23576
23581
|
import { useActive as useActive4, useCommands as useCommands8 } from "@remirror/react-core";
|
|
23577
23582
|
import { useCallback as useCallback10 } from "react";
|
|
23578
23583
|
import { t as t10 } from "i18next";
|
|
23579
|
-
import { jsx as
|
|
23584
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
23580
23585
|
var ToggleBulletListButton = (props) => {
|
|
23581
23586
|
const { toggleList } = useCommands8();
|
|
23582
23587
|
const handleSelect = useCallback10(() => {
|
|
@@ -23586,7 +23591,7 @@ var ToggleBulletListButton = (props) => {
|
|
|
23586
23591
|
}, [toggleList]);
|
|
23587
23592
|
const active = useActive4().list();
|
|
23588
23593
|
const enabled = true;
|
|
23589
|
-
return /* @__PURE__ */
|
|
23594
|
+
return /* @__PURE__ */ jsx27(
|
|
23590
23595
|
CommandButton,
|
|
23591
23596
|
{
|
|
23592
23597
|
...props,
|
|
@@ -23604,7 +23609,7 @@ var ToggleBulletListButton = (props) => {
|
|
|
23604
23609
|
import { useActive as useActive5, useCommands as useCommands9 } from "@remirror/react-core";
|
|
23605
23610
|
import { useCallback as useCallback11 } from "react";
|
|
23606
23611
|
import { t as t11 } from "i18next";
|
|
23607
|
-
import { jsx as
|
|
23612
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
23608
23613
|
var ToggleCodeBlockButton = ({ attrs = {}, ...rest }) => {
|
|
23609
23614
|
const { createCodeMirror } = useCommands9();
|
|
23610
23615
|
const handleSelect = useCallback11(() => {
|
|
@@ -23614,7 +23619,7 @@ var ToggleCodeBlockButton = ({ attrs = {}, ...rest }) => {
|
|
|
23614
23619
|
}, [createCodeMirror, attrs]);
|
|
23615
23620
|
const active = useActive5().codeMirror();
|
|
23616
23621
|
const enabled = createCodeMirror.enabled(attrs);
|
|
23617
|
-
return /* @__PURE__ */
|
|
23622
|
+
return /* @__PURE__ */ jsx28(
|
|
23618
23623
|
CommandButton,
|
|
23619
23624
|
{
|
|
23620
23625
|
...rest,
|
|
@@ -23633,7 +23638,7 @@ var ToggleCodeBlockButton = ({ attrs = {}, ...rest }) => {
|
|
|
23633
23638
|
import { useActive as useActive6, useCommands as useCommands10 } from "@remirror/react-core";
|
|
23634
23639
|
import { useCallback as useCallback12 } from "react";
|
|
23635
23640
|
import { t as t12 } from "i18next";
|
|
23636
|
-
import { jsx as
|
|
23641
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
23637
23642
|
var ToggleCodeButton = (props) => {
|
|
23638
23643
|
const { toggleCodeText } = useCommands10();
|
|
23639
23644
|
const handleSelect = useCallback12(() => {
|
|
@@ -23643,7 +23648,7 @@ var ToggleCodeButton = (props) => {
|
|
|
23643
23648
|
}, [toggleCodeText]);
|
|
23644
23649
|
const active = useActive6().mdCodeText();
|
|
23645
23650
|
const enabled = toggleCodeText.enabled();
|
|
23646
|
-
return /* @__PURE__ */
|
|
23651
|
+
return /* @__PURE__ */ jsx29(
|
|
23647
23652
|
CommandButton,
|
|
23648
23653
|
{
|
|
23649
23654
|
...props,
|
|
@@ -23661,7 +23666,7 @@ var ToggleCodeButton = (props) => {
|
|
|
23661
23666
|
import { useActive as useActive7, useCommands as useCommands11 } from "@remirror/react-core";
|
|
23662
23667
|
import { useCallback as useCallback13 } from "react";
|
|
23663
23668
|
import { t as t13 } from "i18next";
|
|
23664
|
-
import { jsx as
|
|
23669
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
23665
23670
|
var ToggleHeadingButton = ({ attrs, ...rest }) => {
|
|
23666
23671
|
const { toggleHeading } = useCommands11();
|
|
23667
23672
|
const handleSelect = useCallback13(() => {
|
|
@@ -23671,7 +23676,7 @@ var ToggleHeadingButton = ({ attrs, ...rest }) => {
|
|
|
23671
23676
|
}, [toggleHeading, attrs]);
|
|
23672
23677
|
const active = useActive7().heading(attrs);
|
|
23673
23678
|
const enabled = toggleHeading.enabled(attrs);
|
|
23674
|
-
return /* @__PURE__ */
|
|
23679
|
+
return /* @__PURE__ */ jsx30(
|
|
23675
23680
|
CommandButton,
|
|
23676
23681
|
{
|
|
23677
23682
|
...rest,
|
|
@@ -23690,7 +23695,7 @@ var ToggleHeadingButton = ({ attrs, ...rest }) => {
|
|
|
23690
23695
|
import { useActive as useActive8, useCommands as useCommands12 } from "@remirror/react-core";
|
|
23691
23696
|
import { useCallback as useCallback14 } from "react";
|
|
23692
23697
|
import { t as t14 } from "i18next";
|
|
23693
|
-
import { jsx as
|
|
23698
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
23694
23699
|
var ToggleItalicButton = (props) => {
|
|
23695
23700
|
const { toggleEmphasis } = useCommands12();
|
|
23696
23701
|
const handleSelect = useCallback14(() => {
|
|
@@ -23700,7 +23705,7 @@ var ToggleItalicButton = (props) => {
|
|
|
23700
23705
|
}, [toggleEmphasis]);
|
|
23701
23706
|
const active = useActive8().mdEm();
|
|
23702
23707
|
const enabled = toggleEmphasis.enabled();
|
|
23703
|
-
return /* @__PURE__ */
|
|
23708
|
+
return /* @__PURE__ */ jsx31(
|
|
23704
23709
|
CommandButton,
|
|
23705
23710
|
{
|
|
23706
23711
|
...props,
|
|
@@ -23718,7 +23723,7 @@ var ToggleItalicButton = (props) => {
|
|
|
23718
23723
|
import { useActive as useActive9, useCommands as useCommands13 } from "@remirror/react-core";
|
|
23719
23724
|
import { useCallback as useCallback15 } from "react";
|
|
23720
23725
|
import { t as t15 } from "i18next";
|
|
23721
|
-
import { jsx as
|
|
23726
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
23722
23727
|
var ToggleOrderedListButton = (props) => {
|
|
23723
23728
|
const { toggleList } = useCommands13();
|
|
23724
23729
|
const handleSelect = useCallback15(() => {
|
|
@@ -23730,7 +23735,7 @@ var ToggleOrderedListButton = (props) => {
|
|
|
23730
23735
|
}, [toggleList]);
|
|
23731
23736
|
const active = useActive9().list();
|
|
23732
23737
|
const enabled = true;
|
|
23733
|
-
return /* @__PURE__ */
|
|
23738
|
+
return /* @__PURE__ */ jsx32(
|
|
23734
23739
|
CommandButton,
|
|
23735
23740
|
{
|
|
23736
23741
|
...props,
|
|
@@ -23748,7 +23753,7 @@ var ToggleOrderedListButton = (props) => {
|
|
|
23748
23753
|
import { useActive as useActive10, useCommands as useCommands14 } from "@remirror/react-core";
|
|
23749
23754
|
import { useCallback as useCallback16 } from "react";
|
|
23750
23755
|
import { t as t16 } from "i18next";
|
|
23751
|
-
import { jsx as
|
|
23756
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
23752
23757
|
var ToggleTaskListButton = (props) => {
|
|
23753
23758
|
const { toggleList } = useCommands14();
|
|
23754
23759
|
const handleSelect = useCallback16(() => {
|
|
@@ -23760,7 +23765,7 @@ var ToggleTaskListButton = (props) => {
|
|
|
23760
23765
|
}, [toggleList]);
|
|
23761
23766
|
const active = useActive10().list();
|
|
23762
23767
|
const enabled = true;
|
|
23763
|
-
return /* @__PURE__ */
|
|
23768
|
+
return /* @__PURE__ */ jsx33(
|
|
23764
23769
|
CommandButton,
|
|
23765
23770
|
{
|
|
23766
23771
|
...props,
|
|
@@ -23778,7 +23783,7 @@ var ToggleTaskListButton = (props) => {
|
|
|
23778
23783
|
import { useCommands as useCommands15, useHelpers as useHelpers3 } from "@remirror/react-core";
|
|
23779
23784
|
import { t as t17 } from "i18next";
|
|
23780
23785
|
import { useCallback as useCallback17 } from "react";
|
|
23781
|
-
import { jsx as
|
|
23786
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
23782
23787
|
var UndoButton = (props) => {
|
|
23783
23788
|
const { undo: undo3 } = useCommands15();
|
|
23784
23789
|
const { undoDepth: undoDepth2 } = useHelpers3(true);
|
|
@@ -23788,7 +23793,7 @@ var UndoButton = (props) => {
|
|
|
23788
23793
|
}
|
|
23789
23794
|
}, [undo3]);
|
|
23790
23795
|
const enabled = undoDepth2() > 0;
|
|
23791
|
-
return /* @__PURE__ */
|
|
23796
|
+
return /* @__PURE__ */ jsx34(
|
|
23792
23797
|
CommandButton,
|
|
23793
23798
|
{
|
|
23794
23799
|
...props,
|
|
@@ -23803,25 +23808,25 @@ var UndoButton = (props) => {
|
|
|
23803
23808
|
};
|
|
23804
23809
|
|
|
23805
23810
|
// src/editor/toolbar/toolbar/wysiwyg-toolbar.tsx
|
|
23806
|
-
import { jsx as
|
|
23811
|
+
import { jsx as jsx35, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
23807
23812
|
var WysiwygToolbar = (props) => {
|
|
23808
23813
|
const { prevActions = null, nextActions = null } = props;
|
|
23809
23814
|
return /* @__PURE__ */ jsxs8(ToolBar, { className: props.className, style: props.style, children: [
|
|
23810
23815
|
prevActions,
|
|
23811
|
-
/* @__PURE__ */
|
|
23812
|
-
/* @__PURE__ */
|
|
23813
|
-
/* @__PURE__ */
|
|
23814
|
-
/* @__PURE__ */
|
|
23815
|
-
/* @__PURE__ */
|
|
23816
|
-
/* @__PURE__ */
|
|
23817
|
-
/* @__PURE__ */
|
|
23818
|
-
/* @__PURE__ */
|
|
23819
|
-
/* @__PURE__ */
|
|
23820
|
-
/* @__PURE__ */
|
|
23821
|
-
/* @__PURE__ */
|
|
23822
|
-
/* @__PURE__ */
|
|
23823
|
-
/* @__PURE__ */
|
|
23824
|
-
/* @__PURE__ */
|
|
23816
|
+
/* @__PURE__ */ jsx35(UndoButton, {}),
|
|
23817
|
+
/* @__PURE__ */ jsx35(RedoButton, {}),
|
|
23818
|
+
/* @__PURE__ */ jsx35(ToolbarSeparator, { render: /* @__PURE__ */ jsx35("div", {}) }),
|
|
23819
|
+
/* @__PURE__ */ jsx35(ToggleHeadingButton, {}),
|
|
23820
|
+
/* @__PURE__ */ jsx35(ToggleBoldButton, {}),
|
|
23821
|
+
/* @__PURE__ */ jsx35(ToggleItalicButton, {}),
|
|
23822
|
+
/* @__PURE__ */ jsx35(ToggleBlockquoteButton, {}),
|
|
23823
|
+
/* @__PURE__ */ jsx35(ToggleCodeBlockButton, {}),
|
|
23824
|
+
/* @__PURE__ */ jsx35(ToggleCodeButton, {}),
|
|
23825
|
+
/* @__PURE__ */ jsx35(InsertSeparatorButton, {}),
|
|
23826
|
+
/* @__PURE__ */ jsx35(ToolbarSeparator, { render: /* @__PURE__ */ jsx35("div", {}) }),
|
|
23827
|
+
/* @__PURE__ */ jsx35(ToggleBulletListButton, {}),
|
|
23828
|
+
/* @__PURE__ */ jsx35(ToggleOrderedListButton, {}),
|
|
23829
|
+
/* @__PURE__ */ jsx35(ToggleTaskListButton, {}),
|
|
23825
23830
|
nextActions
|
|
23826
23831
|
] });
|
|
23827
23832
|
};
|
|
@@ -23891,7 +23896,7 @@ var createWysiwygDelegate = (options = {}) => {
|
|
|
23891
23896
|
};
|
|
23892
23897
|
|
|
23893
23898
|
// src/editor/components/WysiwygEditor/index.tsx
|
|
23894
|
-
import { jsx as
|
|
23899
|
+
import { jsx as jsx36, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
23895
23900
|
var WysiwygEditor = (props) => {
|
|
23896
23901
|
const {
|
|
23897
23902
|
content,
|
|
@@ -23929,9 +23934,9 @@ var WysiwygEditor = (props) => {
|
|
|
23929
23934
|
try {
|
|
23930
23935
|
initialContent = editorDelegate.stringToDoc(content);
|
|
23931
23936
|
} catch (error) {
|
|
23932
|
-
return /* @__PURE__ */
|
|
23937
|
+
return /* @__PURE__ */ jsx36(ErrorBoundary_default, { hasError: true, error, ...props.errorHandler || {} });
|
|
23933
23938
|
}
|
|
23934
|
-
return /* @__PURE__ */
|
|
23939
|
+
return /* @__PURE__ */ jsx36(ErrorBoundary_default, { ...props.errorHandler || {}, children: /* @__PURE__ */ jsx36(WysiwygThemeWrapper, { ...styleToken, children: /* @__PURE__ */ jsxs9(
|
|
23935
23940
|
Remirror2,
|
|
23936
23941
|
{
|
|
23937
23942
|
manager: editorDelegate.manager,
|
|
@@ -23940,12 +23945,12 @@ var WysiwygEditor = (props) => {
|
|
|
23940
23945
|
editable,
|
|
23941
23946
|
onChange: handleChange,
|
|
23942
23947
|
children: [
|
|
23943
|
-
wysiwygToolBarOptions?.enable ? /* @__PURE__ */
|
|
23944
|
-
/* @__PURE__ */
|
|
23945
|
-
/* @__PURE__ */
|
|
23946
|
-
/* @__PURE__ */
|
|
23948
|
+
wysiwygToolBarOptions?.enable ? /* @__PURE__ */ jsx36(WysiwygToolbar, { ...wysiwygToolBarOptions?.compProps }) : null,
|
|
23949
|
+
/* @__PURE__ */ jsx36(Text_default, {}),
|
|
23950
|
+
/* @__PURE__ */ jsx36(TableToolbar_default, {}),
|
|
23951
|
+
/* @__PURE__ */ jsx36(SlashMenu, {}),
|
|
23947
23952
|
wysiwygToolBar || null,
|
|
23948
|
-
isTesting ? /* @__PURE__ */
|
|
23953
|
+
isTesting ? /* @__PURE__ */ jsx36(ProsemirrorDevTools2, {}) : null
|
|
23949
23954
|
]
|
|
23950
23955
|
}
|
|
23951
23956
|
) }) });
|
|
@@ -23955,7 +23960,7 @@ var WysiwygEditor_default = memo6(WysiwygEditor);
|
|
|
23955
23960
|
// src/editor/components/Editor.tsx
|
|
23956
23961
|
import HTML2 from "html-parse-stringify";
|
|
23957
23962
|
import { nanoid as nanoid3 } from "nanoid";
|
|
23958
|
-
import { jsx as
|
|
23963
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
23959
23964
|
var Editor = memo7(
|
|
23960
23965
|
forwardRef2((props, ref) => {
|
|
23961
23966
|
const {
|
|
@@ -24015,9 +24020,9 @@ var Editor = memo7(
|
|
|
24015
24020
|
return [() => useContextMounted(onContextMounted), ...hooks];
|
|
24016
24021
|
}, [hooks, onContextMounted]);
|
|
24017
24022
|
if (type === "preview") {
|
|
24018
|
-
return /* @__PURE__ */
|
|
24023
|
+
return /* @__PURE__ */ jsx37(Preview, { doc: otherProps.content, delegateOptions: otherProps.delegateOptions });
|
|
24019
24024
|
}
|
|
24020
|
-
return type === "sourceCode" ? /* @__PURE__ */
|
|
24025
|
+
return type === "sourceCode" ? /* @__PURE__ */ jsx37(SourceEditor_default, { ...otherProps, hooks: editorHooks }) : /* @__PURE__ */ jsx37(WysiwygEditor_default, { ...otherProps, hooks: editorHooks });
|
|
24021
24026
|
})
|
|
24022
24027
|
);
|
|
24023
24028
|
var defaultStyleToken = {
|
|
@@ -24104,7 +24109,7 @@ function changeLng(lng) {
|
|
|
24104
24109
|
|
|
24105
24110
|
// src/editor/components/ThemeProvider.tsx
|
|
24106
24111
|
import mermaid2 from "mermaid";
|
|
24107
|
-
import { jsx as
|
|
24112
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
24108
24113
|
var ThemeProvider = memo8(({ theme, i18n, children }) => {
|
|
24109
24114
|
const mode = theme?.mode || "light";
|
|
24110
24115
|
const defaultThemeToken = mode === "dark" ? darkTheme.styledConstants : lightTheme.styledConstants;
|
|
@@ -24126,7 +24131,7 @@ var ThemeProvider = memo8(({ theme, i18n, children }) => {
|
|
|
24126
24131
|
});
|
|
24127
24132
|
eventBus.emit("change-theme");
|
|
24128
24133
|
}, [mode, theme?.codemirrorTheme, changeTheme]);
|
|
24129
|
-
return /* @__PURE__ */
|
|
24134
|
+
return /* @__PURE__ */ jsx38(ScThemeProvider, { theme: themeToken, children });
|
|
24130
24135
|
});
|
|
24131
24136
|
|
|
24132
24137
|
// src/editor/components/Preview/preview.tsx
|
|
@@ -24210,7 +24215,7 @@ var rmeProsemirrorNodeToHtml = async (doc, delegateOptions) => {
|
|
|
24210
24215
|
};
|
|
24211
24216
|
|
|
24212
24217
|
// src/editor/components/Preview/preview.tsx
|
|
24213
|
-
import { jsx as
|
|
24218
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
24214
24219
|
var Preview = (props) => {
|
|
24215
24220
|
const { doc, delegateOptions } = props;
|
|
24216
24221
|
const [processedHtml, setProcessedHtml] = useState10("");
|
|
@@ -24227,7 +24232,7 @@ var Preview = (props) => {
|
|
|
24227
24232
|
});
|
|
24228
24233
|
}, [props.onError]);
|
|
24229
24234
|
if (!processedHtml) {
|
|
24230
|
-
return /* @__PURE__ */
|
|
24235
|
+
return /* @__PURE__ */ jsx39(
|
|
24231
24236
|
"div",
|
|
24232
24237
|
{
|
|
24233
24238
|
style: {
|
|
@@ -24237,11 +24242,11 @@ var Preview = (props) => {
|
|
|
24237
24242
|
justifyContent: "center",
|
|
24238
24243
|
alignItems: "center"
|
|
24239
24244
|
},
|
|
24240
|
-
children: /* @__PURE__ */
|
|
24245
|
+
children: /* @__PURE__ */ jsx39(Icon.Loading3QuartersOutlined, { spin: true, size: 40 })
|
|
24241
24246
|
}
|
|
24242
24247
|
);
|
|
24243
24248
|
}
|
|
24244
|
-
return /* @__PURE__ */
|
|
24249
|
+
return /* @__PURE__ */ jsx39(WysiwygThemeWrapper, { dangerouslySetInnerHTML: { __html: processedHtml } });
|
|
24245
24250
|
};
|
|
24246
24251
|
|
|
24247
24252
|
// src/editor/hooks/index.ts
|