rme 0.1.6 → 0.1.8
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 +7 -2
- package/dist/index.mjs +18 -6
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -77,7 +77,11 @@ interface Note {
|
|
|
77
77
|
content: string;
|
|
78
78
|
deleted: boolean;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
declare enum EditorViewType {
|
|
81
|
+
WYSIWYG = "wysiwyg",
|
|
82
|
+
SOURCECODE = "sourceCode",
|
|
83
|
+
PREVIEW = "preview"
|
|
84
|
+
}
|
|
81
85
|
type BaseEditorState = {
|
|
82
86
|
mode: EditorViewType;
|
|
83
87
|
delegate?: EditorDelegate;
|
|
@@ -144,6 +148,7 @@ declare function computeChange(oldVal: string, newVal: string): {
|
|
|
144
148
|
} | null;
|
|
145
149
|
|
|
146
150
|
type CreateSourceCodeManagerOptions = {
|
|
151
|
+
language?: string;
|
|
147
152
|
onCodemirrorViewLoad: (cm: MfCodemirrorView) => void;
|
|
148
153
|
};
|
|
149
154
|
declare function createSourceCodeManager(options?: CreateSourceCodeManagerOptions): RemirrorManager$1<any>;
|
|
@@ -516,4 +521,4 @@ declare const lightTheme: {
|
|
|
516
521
|
};
|
|
517
522
|
};
|
|
518
523
|
|
|
519
|
-
export { type CreateCodemirrorOptions, type CreateWysiwygDelegateOptions, type DocToString, Editor, type EditorChangeEventParams, type EditorChangeHandler, type EditorContext, type EditorDelegate, extensions as EditorExtensions, type EditorProps, type EditorRef, type EditorState,
|
|
524
|
+
export { type CreateCodemirrorOptions, type CreateWysiwygDelegateOptions, type DocToString, Editor, type EditorChangeEventParams, type EditorChangeHandler, type EditorContext, type EditorDelegate, extensions as EditorExtensions, type EditorProps, type EditorRef, type EditorState, EditorViewType, type HTMLAstNode, MfCodemirrorView, type Note, Preview, SourceCodeThemeWrapper, _default$1 as SourceEditor, type StringToDoc, ThemeProvider, _default as WysiwygEditor, WysiwygThemeWrapper, buildMarkdownParser, buildMarkdownSerializer, changeTheme, common, computeChange, createSourceCodeDelegate, createSourceCodeManager, createWysiwygDelegate, darkTheme, defaultStyleToken, extractMatches, getLanguageMap, lightTheme, loadLanguage, tableSelectorSize };
|
package/dist/index.mjs
CHANGED
|
@@ -7176,7 +7176,7 @@ var styledDarkTheme = {
|
|
|
7176
7176
|
tableSelectorCellBgColor: "#224466",
|
|
7177
7177
|
tableSelectorCellBorderColor: "#003366",
|
|
7178
7178
|
codeBgColor: "#6e768166",
|
|
7179
|
-
preBgColor: "#
|
|
7179
|
+
preBgColor: "#252525",
|
|
7180
7180
|
// components
|
|
7181
7181
|
contextMenuBgColor: "#1E1F20",
|
|
7182
7182
|
contextMenuBgColorHover: "#1552B3",
|
|
@@ -7221,7 +7221,7 @@ var styledLightTheme = {
|
|
|
7221
7221
|
tableSelectorCellBgColor: "#d7ecf9",
|
|
7222
7222
|
tableSelectorCellBorderColor: "#1c7ed6",
|
|
7223
7223
|
codeBgColor: "#afb8c133",
|
|
7224
|
-
preBgColor: "#
|
|
7224
|
+
preBgColor: "#e7e7e7",
|
|
7225
7225
|
// components
|
|
7226
7226
|
contextMenuBgColor: "#f6f7f9",
|
|
7227
7227
|
contextMenuBgColorHover: "#1552B3",
|
|
@@ -17375,7 +17375,6 @@ var MermaidNodeView = class {
|
|
|
17375
17375
|
};
|
|
17376
17376
|
// == Rendering ===================================== //
|
|
17377
17377
|
this.changeTheme = () => {
|
|
17378
|
-
console.log("change theme");
|
|
17379
17378
|
this.renderHtml();
|
|
17380
17379
|
};
|
|
17381
17380
|
this._node = node;
|
|
@@ -17431,7 +17430,6 @@ var MermaidNodeView = class {
|
|
|
17431
17430
|
return true;
|
|
17432
17431
|
}
|
|
17433
17432
|
renderHtml() {
|
|
17434
|
-
console.log("render", this._node);
|
|
17435
17433
|
if (!this._htmlRenderElt) {
|
|
17436
17434
|
return;
|
|
17437
17435
|
}
|
|
@@ -19074,7 +19072,7 @@ var createSourceCodeDelegate = (options) => {
|
|
|
19074
19072
|
const manager = createSourceCodeManager(options);
|
|
19075
19073
|
const stringToDoc = (content) => {
|
|
19076
19074
|
const schema = manager.schema;
|
|
19077
|
-
const attrs = { language: "markdown" };
|
|
19075
|
+
const attrs = { language: options?.language || "markdown" };
|
|
19078
19076
|
const child = content ? schema.text(content) : void 0;
|
|
19079
19077
|
return schema.nodes.doc.create({}, schema.nodes.codeMirror.create(attrs, child));
|
|
19080
19078
|
};
|
|
@@ -19933,7 +19931,12 @@ import { nanoid as nanoid3 } from "nanoid";
|
|
|
19933
19931
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
19934
19932
|
var Editor = memo6(
|
|
19935
19933
|
forwardRef2((props, ref) => {
|
|
19936
|
-
const {
|
|
19934
|
+
const {
|
|
19935
|
+
initialType = "wysiwyg" /* WYSIWYG */,
|
|
19936
|
+
hooks = [],
|
|
19937
|
+
onContextMounted,
|
|
19938
|
+
...otherProps
|
|
19939
|
+
} = props;
|
|
19937
19940
|
const [type, setType] = useState8(initialType);
|
|
19938
19941
|
useImperativeHandle2(ref, () => ({
|
|
19939
19942
|
getType: () => type,
|
|
@@ -20075,6 +20078,14 @@ var SourceEditor_default = memo7(SourceEditor);
|
|
|
20075
20078
|
// src/editor/hooks/index.ts
|
|
20076
20079
|
import { useHelpers, useKeymap, useRemirrorContext as useRemirrorContext4, useCommands as useCommands4 } from "@remirror/react";
|
|
20077
20080
|
|
|
20081
|
+
// src/editor/types/index.ts
|
|
20082
|
+
var EditorViewType = /* @__PURE__ */ ((EditorViewType2) => {
|
|
20083
|
+
EditorViewType2["WYSIWYG"] = "wysiwyg";
|
|
20084
|
+
EditorViewType2["SOURCECODE"] = "sourceCode";
|
|
20085
|
+
EditorViewType2["PREVIEW"] = "preview";
|
|
20086
|
+
return EditorViewType2;
|
|
20087
|
+
})(EditorViewType || {});
|
|
20088
|
+
|
|
20078
20089
|
// src/editor/components/ThemeProvider.tsx
|
|
20079
20090
|
import { ThemeProvider as ScThemeProvider } from "styled-components";
|
|
20080
20091
|
import { memo as memo8, useEffect as useEffect8 } from "react";
|
|
@@ -20263,6 +20274,7 @@ var Preview = (props) => {
|
|
|
20263
20274
|
export {
|
|
20264
20275
|
Editor,
|
|
20265
20276
|
extensions_default as EditorExtensions,
|
|
20277
|
+
EditorViewType,
|
|
20266
20278
|
MfCodemirrorView,
|
|
20267
20279
|
Preview,
|
|
20268
20280
|
SourceCodeThemeWrapper,
|