rme 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -241,6 +241,11 @@ type Props = {
241
241
  };
242
242
  declare const ThemeProvider: React.FC<Props>;
243
243
 
244
+ interface PreviewProps {
245
+ doc: Node;
246
+ }
247
+ declare const Preview: React.FC<PreviewProps>;
248
+
244
249
  interface WarpperProps$1 {
245
250
  codeEditor?: boolean;
246
251
  dark?: boolean;
@@ -425,4 +430,4 @@ declare const lightTheme: {
425
430
  };
426
431
  };
427
432
 
428
- export { type CreateWysiwygDelegateOptions, type DocToString, Editor, type EditorChangeEventParams, type EditorChangeHandler, type EditorContext, type EditorDelegate, extensions as EditorExtensions, type EditorProps, type EditorRef, type EditorState, type EditorViewType, type Note, SourceCodeThemeWrapper, _default$1 as SourceEditor, type StringToDoc, ThemeProvider, _default as WysiwygEditor, WysiwygThemeWrapper, buildMarkdownParser, buildMarkdownSerializer, changeTheme, common, computeChange, createSourceCodeDelegate, createSourceCodeManager, createWysiwygDelegate, darkTheme, getLanguageMap, lightTheme, loadLanguage, tableSelectorSize, wysiwygTransformer };
433
+ export { type CreateWysiwygDelegateOptions, type DocToString, Editor, type EditorChangeEventParams, type EditorChangeHandler, type EditorContext, type EditorDelegate, extensions as EditorExtensions, type EditorProps, type EditorRef, type EditorState, type EditorViewType, type Note, Preview, SourceCodeThemeWrapper, _default$1 as SourceEditor, type StringToDoc, ThemeProvider, _default as WysiwygEditor, WysiwygThemeWrapper, buildMarkdownParser, buildMarkdownSerializer, changeTheme, common, computeChange, createSourceCodeDelegate, createSourceCodeManager, createWysiwygDelegate, darkTheme, getLanguageMap, lightTheme, loadLanguage, tableSelectorSize, wysiwygTransformer };
package/dist/index.mjs CHANGED
@@ -4376,14 +4376,10 @@ import { memo as memo5, useCallback as useCallback5, useMemo as useMemo4 } from
4376
4376
 
4377
4377
  // src/editor/components/Text/index.tsx
4378
4378
  import { useRemirrorContext } from "@remirror/react";
4379
- import styled from "styled-components";
4380
4379
  import { jsx } from "react/jsx-runtime";
4381
- var Container = styled.div`
4382
-
4383
- `;
4384
4380
  var Text = ({ children, ...props }) => {
4385
4381
  const { getRootProps } = useRemirrorContext();
4386
- return /* @__PURE__ */ jsx(Container, { ...props, ...getRootProps(), children });
4382
+ return /* @__PURE__ */ jsx("div", { ...props, ...getRootProps(), children });
4387
4383
  };
4388
4384
  var Text_default = Text;
4389
4385
 
@@ -7296,8 +7292,8 @@ var styledLightTheme = {
7296
7292
  };
7297
7293
 
7298
7294
  // src/editor/theme/WysiwygThemeWrapper.tsx
7299
- import styled2, { css as css2 } from "styled-components";
7300
- var WysiwygThemeWrapper = styled2.div.attrs((p) => p)`
7295
+ import styled, { css } from "styled-components";
7296
+ var WysiwygThemeWrapper = styled.div.attrs((p) => p)`
7301
7297
  width: 100%;
7302
7298
  position: relative;
7303
7299
  white-space: pre-wrap;
@@ -8137,14 +8133,14 @@ var WysiwygThemeWrapper = styled2.div.attrs((p) => p)`
8137
8133
  }
8138
8134
  }
8139
8135
 
8140
- ${(props) => props.dark && css2`
8136
+ ${(props) => props.dark && css`
8141
8137
  color-scheme: dark;
8142
8138
  `}
8143
8139
  `;
8144
8140
 
8145
8141
  // src/editor/theme/SourceCodeThemeWrapper.tsx
8146
- import styled3, { css as css3 } from "styled-components";
8147
- var SourceCodeThemeWrapper = styled3.div.attrs((p) => p)`
8142
+ import styled2, { css as css2 } from "styled-components";
8143
+ var SourceCodeThemeWrapper = styled2.div.attrs((p) => p)`
8148
8144
  width: 100%;
8149
8145
  position: relative;
8150
8146
  white-space: pre-wrap;
@@ -8199,7 +8195,7 @@ var SourceCodeThemeWrapper = styled3.div.attrs((p) => p)`
8199
8195
  }
8200
8196
  }
8201
8197
 
8202
- ${(props) => props.dark && css3`
8198
+ ${(props) => props.dark && css2`
8203
8199
  color-scheme: dark;
8204
8200
  `}
8205
8201
  `;
@@ -13741,7 +13737,7 @@ var cssLanguage = /* @__PURE__ */ LRLanguage.define({
13741
13737
  wordChars: "-"
13742
13738
  }
13743
13739
  });
13744
- function css4() {
13740
+ function css3() {
13745
13741
  return new LanguageSupport(cssLanguage, cssLanguage.data.of({ autocomplete: cssCompletionSource }));
13746
13742
  }
13747
13743
 
@@ -14934,7 +14930,7 @@ function html(config = {}) {
14934
14930
  htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),
14935
14931
  config.autoCloseTags !== false ? autoCloseTags2 : [],
14936
14932
  javascript().support,
14937
- css4().support
14933
+ css3().support
14938
14934
  ]);
14939
14935
  }
14940
14936
  var selfClosers2 = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));
@@ -15297,7 +15293,7 @@ var ImageToolTips = (props) => {
15297
15293
  };
15298
15294
 
15299
15295
  // src/editor/components/Resizable/Resizable.tsx
15300
- import styled5 from "styled-components";
15296
+ import styled4 from "styled-components";
15301
15297
  import { useRef, useEffect, useCallback, memo, useState as useState2 } from "react";
15302
15298
 
15303
15299
  // node_modules/@remirror/core-helpers/dist/remirror-core-helpers.js
@@ -15479,9 +15475,9 @@ var errorMessageMap = {
15479
15475
  };
15480
15476
 
15481
15477
  // src/editor/components/Resizable/ResizableHandle.tsx
15482
- import styled4, { css as css5 } from "styled-components";
15478
+ import styled3, { css as css4 } from "styled-components";
15483
15479
  import { jsx as jsx4 } from "react/jsx-runtime";
15484
- var ResizableHandleContainer = styled4.span`
15480
+ var ResizableHandleContainer = styled3.span`
15485
15481
  position: absolute;
15486
15482
  border-radius: 12px;
15487
15483
  border: 2px solid #fff;
@@ -15493,11 +15489,11 @@ var ResizableHandleContainer = styled4.span`
15493
15489
 
15494
15490
  ${(props) => {
15495
15491
  if (props.visible) {
15496
- return css5`
15492
+ return css4`
15497
15493
  opacity: 1;
15498
15494
  `;
15499
15495
  } else {
15500
- return css5`
15496
+ return css4`
15501
15497
  opacity: 0;
15502
15498
  `;
15503
15499
  }
@@ -15506,31 +15502,31 @@ var ResizableHandleContainer = styled4.span`
15506
15502
  ${(props) => {
15507
15503
  switch (props.handleType) {
15508
15504
  case 7 /* BottomLeft */:
15509
- return css5`
15505
+ return css4`
15510
15506
  left: -6px;
15511
15507
  bottom: -10px;
15512
15508
  cursor: sw-resize;
15513
15509
  `;
15514
15510
  case 6 /* BottomRight */:
15515
- return css5`
15511
+ return css4`
15516
15512
  right: -6px;
15517
15513
  bottom: -10px;
15518
15514
  cursor: se-resize;
15519
15515
  `;
15520
15516
  case 5 /* TopLeft */:
15521
- return css5`
15517
+ return css4`
15522
15518
  left: -6px;
15523
15519
  top: -6px;
15524
15520
  cursor: nw-resize;
15525
15521
  `;
15526
15522
  case 4 /* TopRight */:
15527
- return css5`
15523
+ return css4`
15528
15524
  right: -6px;
15529
15525
  top: -6px;
15530
15526
  cursor: ne-resize;
15531
15527
  `;
15532
15528
  case 1 /* Left */:
15533
- return css5`
15529
+ return css4`
15534
15530
  left: 6px;
15535
15531
  top: calc(50% - 20px);
15536
15532
  height: 30px;
@@ -15538,7 +15534,7 @@ var ResizableHandleContainer = styled4.span`
15538
15534
  cursor: col-resize;
15539
15535
  `;
15540
15536
  case 0 /* Right */:
15541
- return css5`
15537
+ return css4`
15542
15538
  right: 6px;
15543
15539
  top: calc(50% - 20px);
15544
15540
  height: 30px;
@@ -15546,7 +15542,7 @@ var ResizableHandleContainer = styled4.span`
15546
15542
  cursor: col-resize;
15547
15543
  `;
15548
15544
  case 2 /* Top */:
15549
- return css5`
15545
+ return css4`
15550
15546
  left: calc(50% - 20px);
15551
15547
  top: 6px;
15552
15548
  height: 6px;
@@ -15554,7 +15550,7 @@ var ResizableHandleContainer = styled4.span`
15554
15550
  cursor: row-resize;
15555
15551
  `;
15556
15552
  case 3 /* Bottom */:
15557
- return css5`
15553
+ return css4`
15558
15554
  right: calc(50% - 20px);
15559
15555
  bottom: 6px;
15560
15556
  height: 6px;
@@ -15585,7 +15581,7 @@ var ResizableHandle = (props) => {
15585
15581
 
15586
15582
  // src/editor/components/Resizable/Resizable.tsx
15587
15583
  import { jsx as jsx5, jsxs } from "react/jsx-runtime";
15588
- var ResizableContainer = styled5.div`
15584
+ var ResizableContainer = styled4.div`
15589
15585
  display: inline-block;
15590
15586
  position: relative;
15591
15587
  max-width: 100%;
@@ -16600,7 +16596,6 @@ import { memo as memo4, useMemo as useMemo3, useCallback as useCallback4 } from
16600
16596
  // src/editor/components/WysiwygEditor/delegate.ts
16601
16597
  import { createReactManager } from "@remirror/react";
16602
16598
  import { isExtension } from "@remirror/core";
16603
- import "prosemirror-flat-list/dist/style.css";
16604
16599
  function isMarkdownNodeExtension(extension9) {
16605
16600
  return !!(isExtension(extension9) && extension9.fromMarkdown && extension9.toMarkdown);
16606
16601
  }
@@ -16663,10 +16658,10 @@ import {
16663
16658
  MenuList
16664
16659
  } from "@mui/material";
16665
16660
  import { useCommands } from "@remirror/react";
16666
- import styled6 from "styled-components";
16661
+ import styled5 from "styled-components";
16667
16662
  import { useTranslation } from "react-i18next";
16668
16663
  import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
16669
- var Container2 = styled6.div`
16664
+ var Container = styled5.div`
16670
16665
  position: absolute;
16671
16666
 
16672
16667
  .MuiList-padding {
@@ -16719,7 +16714,7 @@ var ActiveCellMenu = (props) => {
16719
16714
  };
16720
16715
  const { ref, key, x, y } = positioner;
16721
16716
  return /* @__PURE__ */ jsxs2(
16722
- Container2,
16717
+ Container,
16723
16718
  {
16724
16719
  ref,
16725
16720
  style: {
@@ -16777,10 +16772,10 @@ var ActiveCellMenu_default = ActiveCellMenu;
16777
16772
 
16778
16773
  // src/editor/toolbar/TableToolbar/TableBar.tsx
16779
16774
  import { useCommands as useCommands2 } from "@remirror/react";
16780
- import styled7 from "styled-components";
16775
+ import styled6 from "styled-components";
16781
16776
  import { Tooltip as Tooltip2 } from "zens";
16782
16777
  import { jsx as jsx11 } from "react/jsx-runtime";
16783
- var Container3 = styled7.div`
16778
+ var Container2 = styled6.div`
16784
16779
  position: absolute;
16785
16780
  color: ${(props) => props.theme.dangerColor};
16786
16781
  `;
@@ -16789,7 +16784,7 @@ function TableBar(props) {
16789
16784
  const commands = useCommands2();
16790
16785
  const { ref, key, x, y } = positioner;
16791
16786
  return /* @__PURE__ */ jsx11(
16792
- Container3,
16787
+ Container2,
16793
16788
  {
16794
16789
  ref,
16795
16790
  style: {
@@ -16918,9 +16913,9 @@ import { ProsemirrorDevTools } from "@remirror/dev";
16918
16913
 
16919
16914
  // src/editor/components/ErrorBoundary.tsx
16920
16915
  import React from "react";
16921
- import styled8 from "styled-components";
16916
+ import styled7 from "styled-components";
16922
16917
  import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs3 } from "react/jsx-runtime";
16923
- var Title = styled8.h1`
16918
+ var Title = styled7.h1`
16924
16919
  color: ${({ theme }) => theme.dangerColor};
16925
16920
  `;
16926
16921
  var ErrorBoundary = class extends React.Component {
@@ -16953,13 +16948,13 @@ import { usePopper } from "react-popper";
16953
16948
 
16954
16949
  // src/editor/toolbar/SlashMenu/styles.tsx
16955
16950
  import { memo as memo3, useCallback as useCallback2, useEffect as useEffect4, useMemo, useRef as useRef5, useState as useState6 } from "react";
16956
- import styled10, { css as css6 } from "styled-components";
16951
+ import styled9, { css as css5 } from "styled-components";
16957
16952
 
16958
16953
  // src/editor/toolbar/SlashMenu/TablePanel.tsx
16959
16954
  import { forwardRef, useState as useState5, useImperativeHandle, memo as memo2 } from "react";
16960
- import styled9 from "styled-components";
16955
+ import styled8 from "styled-components";
16961
16956
  import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
16962
- var TablePanelCell = styled9.div.attrs((p) => p)`
16957
+ var TablePanelCell = styled8.div.attrs((p) => p)`
16963
16958
  border: 1px solid ${(props) => props.theme.borderColor};
16964
16959
  margin-right: 1px;
16965
16960
  margin-bottom: 1px;
@@ -17228,7 +17223,7 @@ var SlashMenuRoot = memo3(
17228
17223
  ] });
17229
17224
  }
17230
17225
  );
17231
- var MenuPanel = styled10.div.attrs((p) => p)`
17226
+ var MenuPanel = styled9.div.attrs((p) => p)`
17232
17227
  display: flex;
17233
17228
  min-width: 130px;
17234
17229
  flex-direction: column;
@@ -17246,7 +17241,7 @@ var MenuPanel = styled10.div.attrs((p) => p)`
17246
17241
  outline: none;
17247
17242
  overflow: visible;
17248
17243
  `;
17249
- var MenuItem2 = styled10.li.attrs((props) => ({
17244
+ var MenuItem2 = styled9.li.attrs((props) => ({
17250
17245
  ...props
17251
17246
  }))`
17252
17247
  display: flex;
@@ -17263,7 +17258,7 @@ var MenuItem2 = styled10.li.attrs((props) => ({
17263
17258
 
17264
17259
  ${(p) => {
17265
17260
  if (p.selected) {
17266
- return css6`
17261
+ return css5`
17267
17262
  background-color: ${(props) => props.theme.contextMenuBgColorHover};
17268
17263
  color: hsl(204 20% 100%);
17269
17264
  `;
@@ -17931,8 +17926,8 @@ function isTableElement(element) {
17931
17926
  }
17932
17927
  function isContainingBlock(element) {
17933
17928
  const webkit = isWebKit();
17934
- const css7 = getComputedStyle(element);
17935
- return css7.transform !== "none" || css7.perspective !== "none" || (css7.containerType ? css7.containerType !== "normal" : false) || !webkit && (css7.backdropFilter ? css7.backdropFilter !== "none" : false) || !webkit && (css7.filter ? css7.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css7.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css7.contain || "").includes(value));
17929
+ const css6 = getComputedStyle(element);
17930
+ return css6.transform !== "none" || css6.perspective !== "none" || (css6.containerType ? css6.containerType !== "normal" : false) || !webkit && (css6.backdropFilter ? css6.backdropFilter !== "none" : false) || !webkit && (css6.filter ? css6.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css6.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css6.contain || "").includes(value));
17936
17931
  }
17937
17932
  function getContainingBlock(element) {
17938
17933
  let currentNode = getParentNode(element);
@@ -18010,9 +18005,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
18010
18005
 
18011
18006
  // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
18012
18007
  function getCssDimensions(element) {
18013
- const css7 = getComputedStyle(element);
18014
- let width = parseFloat(css7.width) || 0;
18015
- let height = parseFloat(css7.height) || 0;
18008
+ const css6 = getComputedStyle(element);
18009
+ let width = parseFloat(css6.width) || 0;
18010
+ let height = parseFloat(css6.height) || 0;
18016
18011
  const hasOffset = isHTMLElement(element);
18017
18012
  const offsetWidth = hasOffset ? element.offsetWidth : width;
18018
18013
  const offsetHeight = hasOffset ? element.offsetHeight : height;
@@ -18106,9 +18101,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
18106
18101
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
18107
18102
  const iframeScale = getScale(currentIFrame);
18108
18103
  const iframeRect = currentIFrame.getBoundingClientRect();
18109
- const css7 = getComputedStyle(currentIFrame);
18110
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css7.paddingLeft)) * iframeScale.x;
18111
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css7.paddingTop)) * iframeScale.y;
18104
+ const css6 = getComputedStyle(currentIFrame);
18105
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css6.paddingLeft)) * iframeScale.x;
18106
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css6.paddingTop)) * iframeScale.y;
18112
18107
  x *= iframeScale.x;
18113
18108
  y *= iframeScale.y;
18114
18109
  width *= iframeScale.x;
@@ -18890,6 +18885,7 @@ var useContextMounted = (onContextMounted) => {
18890
18885
  };
18891
18886
 
18892
18887
  // src/editor/components/Editor.tsx
18888
+ import "prosemirror-flat-list/dist/style.css";
18893
18889
  import { jsx as jsx19 } from "react/jsx-runtime";
18894
18890
  var Editor = memo6(
18895
18891
  forwardRef2((props, ref) => {
@@ -18970,9 +18966,19 @@ var ThemeProvider = ({ theme, i18n, children }) => {
18970
18966
  }, [mode, theme?.codemirrorTheme, changeTheme]);
18971
18967
  return /* @__PURE__ */ jsx20(ScThemeProvider, { theme: themeToken, children });
18972
18968
  };
18969
+
18970
+ // src/editor/components/Preview/preview.tsx
18971
+ import { prosemirrorNodeToHtml } from "remirror";
18972
+ import { jsx as jsx21 } from "react/jsx-runtime";
18973
+ var Preview = (props) => {
18974
+ const { doc } = props;
18975
+ const html2 = prosemirrorNodeToHtml(doc);
18976
+ return /* @__PURE__ */ jsx21(WysiwygThemeWrapper, { dangerouslySetInnerHTML: { __html: html2 } });
18977
+ };
18973
18978
  export {
18974
18979
  Editor,
18975
18980
  extensions_default as EditorExtensions,
18981
+ Preview,
18976
18982
  SourceCodeThemeWrapper,
18977
18983
  SourceEditor_default as SourceEditor,
18978
18984
  ThemeProvider,