@datalayer/jupyter-lexical 1.0.4 → 1.0.6
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/lib/appSettings.d.ts +29 -0
- package/lib/appSettings.js +45 -0
- package/lib/appSettings.js.map +1 -0
- package/lib/components/DropDown.d.ts +17 -3
- package/lib/components/DropDown.js +42 -20
- package/lib/components/DropDown.js.map +1 -1
- package/lib/context/SettingsContext.d.ts +19 -0
- package/lib/context/SettingsContext.js +39 -0
- package/lib/context/SettingsContext.js.map +1 -0
- package/lib/context/ToolbarContext.d.ts +72 -0
- package/lib/context/ToolbarContext.js +85 -0
- package/lib/context/ToolbarContext.js.map +1 -0
- package/lib/context/index.d.ts +2 -0
- package/lib/context/index.js +2 -0
- package/lib/context/index.js.map +1 -1
- package/lib/editor/Editor.d.ts +1 -0
- package/lib/editor/Editor.js +15 -11
- package/lib/editor/Editor.js.map +1 -1
- package/lib/examples/AppNbformat.js +1 -1
- package/lib/examples/AppNbformat.js.map +1 -1
- package/lib/examples/AppSimple.js +1 -1
- package/lib/examples/AppSimple.js.map +1 -1
- package/lib/plugins/{MardownPlugin.js → MarkdownPlugin.js} +1 -1
- package/lib/plugins/MarkdownPlugin.js.map +1 -0
- package/lib/plugins/ShortcutsPlugin/index.d.ts +6 -0
- package/lib/plugins/ShortcutsPlugin/index.js +125 -0
- package/lib/plugins/ShortcutsPlugin/index.js.map +1 -0
- package/lib/plugins/ShortcutsPlugin/shortcuts.d.ts +59 -0
- package/lib/plugins/ShortcutsPlugin/shortcuts.js +182 -0
- package/lib/plugins/ShortcutsPlugin/shortcuts.js.map +1 -0
- package/lib/plugins/ToolbarPlugin/fontSize.d.ts +15 -0
- package/lib/plugins/ToolbarPlugin/fontSize.js +80 -0
- package/lib/plugins/ToolbarPlugin/fontSize.js.map +1 -0
- package/lib/plugins/ToolbarPlugin/index.d.ts +17 -0
- package/lib/plugins/ToolbarPlugin/index.js +450 -0
- package/lib/plugins/ToolbarPlugin/index.js.map +1 -0
- package/lib/plugins/ToolbarPlugin/utils.d.ts +26 -0
- package/lib/plugins/ToolbarPlugin/utils.js +249 -0
- package/lib/plugins/ToolbarPlugin/utils.js.map +1 -0
- package/lib/plugins/index.d.ts +2 -1
- package/lib/plugins/index.js +2 -1
- package/lib/plugins/index.js.map +1 -1
- package/lib/utils/url.d.ts +2 -0
- package/lib/utils/url.js +39 -0
- package/lib/utils/url.js.map +1 -0
- package/package.json +15 -13
- package/style/lexical/Editor.css +36 -5
- package/style/lexical/FontSize.css +63 -0
- package/style/lexical/Rich.css +50 -6
- package/style/lexical/icons/add-sign.svg +3 -0
- package/style/lexical/icons/minus-sign.svg +3 -0
- package/style/lexical/index.css +1 -0
- package/lib/plugins/MardownPlugin.js.map +0 -1
- package/lib/plugins/ToolbarPlugin.d.ts +0 -2
- package/lib/plugins/ToolbarPlugin.js +0 -455
- package/lib/plugins/ToolbarPlugin.js.map +0 -1
- /package/lib/plugins/{MardownPlugin.d.ts → MarkdownPlugin.d.ts} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const isDevPlayground: boolean;
|
|
2
|
+
export declare const DEFAULT_SETTINGS: {
|
|
3
|
+
readonly disableBeforeInput: false;
|
|
4
|
+
readonly emptyEditor: boolean;
|
|
5
|
+
readonly hasLinkAttributes: false;
|
|
6
|
+
readonly isAutocomplete: false;
|
|
7
|
+
readonly isCharLimit: false;
|
|
8
|
+
readonly isCharLimitUtf8: false;
|
|
9
|
+
readonly isCodeHighlighted: true;
|
|
10
|
+
readonly isCodeShiki: false;
|
|
11
|
+
readonly isCollab: false;
|
|
12
|
+
readonly isMaxLength: false;
|
|
13
|
+
readonly isRichText: true;
|
|
14
|
+
readonly listStrictIndent: false;
|
|
15
|
+
readonly measureTypingPerf: false;
|
|
16
|
+
readonly selectionAlwaysOnDisplay: false;
|
|
17
|
+
readonly shouldAllowHighlightingWithBrackets: false;
|
|
18
|
+
readonly shouldPreserveNewLinesInMarkdown: false;
|
|
19
|
+
readonly shouldUseLexicalContextMenu: false;
|
|
20
|
+
readonly showNestedEditorTreeView: false;
|
|
21
|
+
readonly showTableOfContents: false;
|
|
22
|
+
readonly showTreeView: true;
|
|
23
|
+
readonly tableCellBackgroundColor: true;
|
|
24
|
+
readonly tableCellMerge: true;
|
|
25
|
+
readonly tableHorizontalScroll: true;
|
|
26
|
+
};
|
|
27
|
+
export declare const INITIAL_SETTINGS: Record<SettingName, boolean>;
|
|
28
|
+
export type SettingName = keyof typeof DEFAULT_SETTINGS;
|
|
29
|
+
export type Settings = typeof INITIAL_SETTINGS;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
const hostName = window.location.hostname;
|
|
14
|
+
export const isDevPlayground = hostName !== 'playground.lexical.dev' &&
|
|
15
|
+
hostName !== 'lexical-playground.vercel.app';
|
|
16
|
+
export const DEFAULT_SETTINGS = {
|
|
17
|
+
disableBeforeInput: false,
|
|
18
|
+
emptyEditor: isDevPlayground,
|
|
19
|
+
hasLinkAttributes: false,
|
|
20
|
+
isAutocomplete: false,
|
|
21
|
+
isCharLimit: false,
|
|
22
|
+
isCharLimitUtf8: false,
|
|
23
|
+
isCodeHighlighted: true,
|
|
24
|
+
isCodeShiki: false,
|
|
25
|
+
isCollab: false,
|
|
26
|
+
isMaxLength: false,
|
|
27
|
+
isRichText: true,
|
|
28
|
+
listStrictIndent: false,
|
|
29
|
+
measureTypingPerf: false,
|
|
30
|
+
selectionAlwaysOnDisplay: false,
|
|
31
|
+
shouldAllowHighlightingWithBrackets: false,
|
|
32
|
+
shouldPreserveNewLinesInMarkdown: false,
|
|
33
|
+
shouldUseLexicalContextMenu: false,
|
|
34
|
+
showNestedEditorTreeView: false,
|
|
35
|
+
showTableOfContents: false,
|
|
36
|
+
showTreeView: true,
|
|
37
|
+
tableCellBackgroundColor: true,
|
|
38
|
+
tableCellMerge: true,
|
|
39
|
+
tableHorizontalScroll: true,
|
|
40
|
+
};
|
|
41
|
+
// These are mutated in setupEnv
|
|
42
|
+
export const INITIAL_SETTINGS = {
|
|
43
|
+
...DEFAULT_SETTINGS,
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=appSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSettings.js","sourceRoot":"","sources":["../src/appSettings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAC1C,MAAM,CAAC,MAAM,eAAe,GAC1B,QAAQ,KAAK,wBAAwB;IACrC,QAAQ,KAAK,+BAA+B,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,kBAAkB,EAAE,KAAK;IACzB,WAAW,EAAE,eAAe;IAC5B,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,KAAK;IAClB,eAAe,EAAE,KAAK;IACtB,iBAAiB,EAAE,IAAI;IACvB,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,KAAK;IACxB,wBAAwB,EAAE,KAAK;IAC/B,mCAAmC,EAAE,KAAK;IAC1C,gCAAgC,EAAE,KAAK;IACvC,2BAA2B,EAAE,KAAK;IAClC,wBAAwB,EAAE,KAAK;IAC/B,mBAAmB,EAAE,KAAK;IAC1B,YAAY,EAAE,IAAI;IAClB,wBAAwB,EAAE,IAAI;IAC9B,cAAc,EAAE,IAAI;IACpB,qBAAqB,EAAE,IAAI;CACnB,CAAC;AAEX,gCAAgC;AAChC,MAAM,CAAC,MAAM,gBAAgB,GAAiC;IAC5D,GAAG,gBAAgB;CACpB,CAAC"}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { JSX } from 'react';
|
|
2
9
|
import * as React from 'react';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
3
11
|
export declare function DropDownItem({ children, className, onClick, title, }: {
|
|
4
12
|
children: React.ReactNode;
|
|
5
13
|
className: string;
|
|
6
14
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
15
|
title?: string;
|
|
8
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare
|
|
17
|
+
export declare function DropDownItems({ children, dropDownRef, onClose, }: {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
dropDownRef: React.Ref<HTMLDivElement>;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function DropDown({ disabled, buttonLabel, buttonAriaLabel, buttonClassName, buttonIconClassName, children, stopCloseOnClickSelf, }: {
|
|
23
|
+
disabled?: boolean;
|
|
10
24
|
buttonAriaLabel?: string;
|
|
11
25
|
buttonClassName: string;
|
|
12
26
|
buttonIconClassName?: string;
|
|
13
27
|
buttonLabel?: string;
|
|
14
28
|
children: ReactNode;
|
|
15
29
|
stopCloseOnClickSelf?: boolean;
|
|
16
|
-
})
|
|
30
|
+
}): JSX.Element;
|
|
17
31
|
export default DropDown;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
-
*
|
|
5
|
-
* MIT License
|
|
6
|
-
*/
|
|
7
|
-
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
2
|
+
import { isDOMNode } from 'lexical';
|
|
8
3
|
import * as React from 'react';
|
|
4
|
+
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
9
5
|
import { createPortal } from 'react-dom';
|
|
10
6
|
const DropDownContext = React.createContext(null);
|
|
7
|
+
const dropDownPadding = 4;
|
|
11
8
|
export function DropDownItem({ children, className, onClick, title, }) {
|
|
12
9
|
const ref = useRef(null);
|
|
13
10
|
const dropDownContext = React.useContext(DropDownContext);
|
|
@@ -20,17 +17,18 @@ export function DropDownItem({ children, className, onClick, title, }) {
|
|
|
20
17
|
registerItem(ref);
|
|
21
18
|
}
|
|
22
19
|
}, [ref, registerItem]);
|
|
23
|
-
return (_jsx("button", { className: className, onClick: onClick, ref: ref, title: title, children: children }));
|
|
20
|
+
return (_jsx("button", { className: className, onClick: onClick, ref: ref, title: title, type: "button", children: children }));
|
|
24
21
|
}
|
|
25
|
-
function DropDownItems({ children, dropDownRef, onClose, }) {
|
|
22
|
+
export function DropDownItems({ children, dropDownRef, onClose, }) {
|
|
26
23
|
const [items, setItems] = useState();
|
|
27
24
|
const [highlightedItem, setHighlightedItem] = useState();
|
|
28
25
|
const registerItem = useCallback((itemRef) => {
|
|
29
|
-
setItems(prev => (prev ? [...prev, itemRef] : [itemRef]));
|
|
26
|
+
setItems((prev) => (prev ? [...prev, itemRef] : [itemRef]));
|
|
30
27
|
}, [setItems]);
|
|
31
28
|
const handleKeyDown = (event) => {
|
|
32
|
-
if (!items)
|
|
29
|
+
if (!items) {
|
|
33
30
|
return;
|
|
31
|
+
}
|
|
34
32
|
const key = event.key;
|
|
35
33
|
if (['Escape', 'ArrowUp', 'ArrowDown', 'Tab'].includes(key)) {
|
|
36
34
|
event.preventDefault();
|
|
@@ -39,17 +37,19 @@ function DropDownItems({ children, dropDownRef, onClose, }) {
|
|
|
39
37
|
onClose();
|
|
40
38
|
}
|
|
41
39
|
else if (key === 'ArrowUp') {
|
|
42
|
-
setHighlightedItem(prev => {
|
|
43
|
-
if (!prev)
|
|
40
|
+
setHighlightedItem((prev) => {
|
|
41
|
+
if (!prev) {
|
|
44
42
|
return items[0];
|
|
43
|
+
}
|
|
45
44
|
const index = items.indexOf(prev) - 1;
|
|
46
45
|
return items[index === -1 ? items.length - 1 : index];
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
else if (key === 'ArrowDown') {
|
|
50
|
-
setHighlightedItem(prev => {
|
|
51
|
-
if (!prev)
|
|
49
|
+
setHighlightedItem((prev) => {
|
|
50
|
+
if (!prev) {
|
|
52
51
|
return items[0];
|
|
52
|
+
}
|
|
53
53
|
return items[items.indexOf(prev) + 1];
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -67,7 +67,7 @@ function DropDownItems({ children, dropDownRef, onClose, }) {
|
|
|
67
67
|
}, [items, highlightedItem]);
|
|
68
68
|
return (_jsx(DropDownContext.Provider, { value: contextValue, children: _jsx("div", { className: "dropdown", ref: dropDownRef, onKeyDown: handleKeyDown, children: children }) }));
|
|
69
69
|
}
|
|
70
|
-
export
|
|
70
|
+
export function DropDown({ disabled = false, buttonLabel, buttonAriaLabel, buttonClassName, buttonIconClassName, children, stopCloseOnClickSelf, }) {
|
|
71
71
|
const dropDownRef = useRef(null);
|
|
72
72
|
const buttonRef = useRef(null);
|
|
73
73
|
const [showDropDown, setShowDropDown] = useState(false);
|
|
@@ -82,7 +82,7 @@ export const DropDown = ({ buttonLabel, buttonAriaLabel, buttonClassName, button
|
|
|
82
82
|
const dropDown = dropDownRef.current;
|
|
83
83
|
if (showDropDown && button !== null && dropDown !== null) {
|
|
84
84
|
const { top, left } = button.getBoundingClientRect();
|
|
85
|
-
dropDown.style.top = `${top +
|
|
85
|
+
dropDown.style.top = `${top + button.offsetHeight + dropDownPadding}px`;
|
|
86
86
|
dropDown.style.left = `${Math.min(left, window.innerWidth - dropDown.offsetWidth - 20)}px`;
|
|
87
87
|
}
|
|
88
88
|
}, [dropDownRef, buttonRef, showDropDown]);
|
|
@@ -91,10 +91,13 @@ export const DropDown = ({ buttonLabel, buttonAriaLabel, buttonClassName, button
|
|
|
91
91
|
if (button !== null && showDropDown) {
|
|
92
92
|
const handle = (event) => {
|
|
93
93
|
const target = event.target;
|
|
94
|
+
if (!isDOMNode(target)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
94
97
|
if (stopCloseOnClickSelf) {
|
|
95
|
-
if (dropDownRef.current &&
|
|
96
|
-
dropDownRef.current.contains(target))
|
|
98
|
+
if (dropDownRef.current && dropDownRef.current.contains(target)) {
|
|
97
99
|
return;
|
|
100
|
+
}
|
|
98
101
|
}
|
|
99
102
|
if (!button.contains(target)) {
|
|
100
103
|
setShowDropDown(false);
|
|
@@ -106,8 +109,27 @@ export const DropDown = ({ buttonLabel, buttonAriaLabel, buttonClassName, button
|
|
|
106
109
|
};
|
|
107
110
|
}
|
|
108
111
|
}, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf]);
|
|
109
|
-
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
const handleButtonPositionUpdate = () => {
|
|
114
|
+
if (showDropDown) {
|
|
115
|
+
const button = buttonRef.current;
|
|
116
|
+
const dropDown = dropDownRef.current;
|
|
117
|
+
if (button !== null && dropDown !== null) {
|
|
118
|
+
const { top } = button.getBoundingClientRect();
|
|
119
|
+
const newPosition = top + button.offsetHeight + dropDownPadding;
|
|
120
|
+
if (newPosition !== dropDown.getBoundingClientRect().top) {
|
|
121
|
+
dropDown.style.top = `${newPosition}px`;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
document.addEventListener('scroll', handleButtonPositionUpdate);
|
|
127
|
+
return () => {
|
|
128
|
+
document.removeEventListener('scroll', handleButtonPositionUpdate);
|
|
129
|
+
};
|
|
130
|
+
}, [buttonRef, dropDownRef, showDropDown]);
|
|
131
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", disabled: disabled, "aria-label": buttonAriaLabel || buttonLabel, className: buttonClassName, onClick: () => setShowDropDown(!showDropDown), ref: buttonRef, children: [buttonIconClassName && _jsx("span", { className: buttonIconClassName }), buttonLabel && (_jsx("span", { className: "text dropdown-button-text", children: buttonLabel })), _jsx("i", { className: "chevron-down" })] }), showDropDown &&
|
|
110
132
|
createPortal(_jsx(DropDownItems, { dropDownRef: dropDownRef, onClose: handleClose, children: children }), document.body)] }));
|
|
111
|
-
}
|
|
133
|
+
}
|
|
112
134
|
export default DropDown;
|
|
113
135
|
//# sourceMappingURL=DropDown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDown.js","sourceRoot":"","sources":["../../src/components/DropDown.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DropDown.js","sourceRoot":"","sources":["../../src/components/DropDown.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAMzC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAA6B,IAAI,CAAC,CAAC;AAE9E,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GAMN;IACC,MAAM,GAAG,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IAEnD,MAAM,eAAe,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AY;gBACX,YAAY,CACV,KAAC,aAAa,IAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,YAC1D,QAAQ,GACK,EAChB,QAAQ,CAAC,IAAI,CACd,IACF,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { SettingName } from '../appSettings';
|
|
9
|
+
import type { JSX } from 'react';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
|
+
type SettingsContextShape = {
|
|
12
|
+
setOption: (name: SettingName, value: boolean) => void;
|
|
13
|
+
settings: Record<SettingName, boolean>;
|
|
14
|
+
};
|
|
15
|
+
export declare const SettingsContext: ({ children, }: {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}) => JSX.Element;
|
|
18
|
+
export declare const useSettings: () => SettingsContextShape;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useMemo, useState, } from 'react';
|
|
3
|
+
import { DEFAULT_SETTINGS, INITIAL_SETTINGS } from '../appSettings';
|
|
4
|
+
const Context = createContext({
|
|
5
|
+
setOption: (name, value) => {
|
|
6
|
+
return;
|
|
7
|
+
},
|
|
8
|
+
settings: INITIAL_SETTINGS,
|
|
9
|
+
});
|
|
10
|
+
export const SettingsContext = ({ children, }) => {
|
|
11
|
+
const [settings, setSettings] = useState(INITIAL_SETTINGS);
|
|
12
|
+
const setOption = useCallback((setting, value) => {
|
|
13
|
+
setSettings((options) => ({
|
|
14
|
+
...options,
|
|
15
|
+
[setting]: value,
|
|
16
|
+
}));
|
|
17
|
+
setURLParam(setting, value);
|
|
18
|
+
}, []);
|
|
19
|
+
const contextValue = useMemo(() => {
|
|
20
|
+
return { setOption, settings };
|
|
21
|
+
}, [setOption, settings]);
|
|
22
|
+
return _jsx(Context.Provider, { value: contextValue, children: children });
|
|
23
|
+
};
|
|
24
|
+
export const useSettings = () => {
|
|
25
|
+
return useContext(Context);
|
|
26
|
+
};
|
|
27
|
+
function setURLParam(param, value) {
|
|
28
|
+
const url = new URL(window.location.href);
|
|
29
|
+
const params = new URLSearchParams(url.search);
|
|
30
|
+
if (value !== DEFAULT_SETTINGS[param]) {
|
|
31
|
+
params.set(param, String(value));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
params.delete(param);
|
|
35
|
+
}
|
|
36
|
+
url.search = params.toString();
|
|
37
|
+
window.history.pushState(null, '', url.toString());
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=SettingsContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsContext.js","sourceRoot":"","sources":["../../src/context/SettingsContext.tsx"],"names":[],"mappings":";AAkBA,OAAO,EACL,aAAa,EAEb,WAAW,EACX,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAOlE,MAAM,OAAO,GAAwC,aAAa,CAAC;IACjE,SAAS,EAAE,CAAC,IAAiB,EAAE,KAAc,EAAE,EAAE;QAC/C,OAAO;IACT,CAAC;IACD,QAAQ,EAAE,gBAAgB;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,GAGT,EAAe,EAAE;IAChB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAE3D,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,OAAoB,EAAE,KAAc,EAAE,EAAE;QACr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1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { JSX } from 'react';
|
|
9
|
+
import { ElementFormatType } from 'lexical';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
|
+
export declare const MIN_ALLOWED_FONT_SIZE = 8;
|
|
12
|
+
export declare const MAX_ALLOWED_FONT_SIZE = 72;
|
|
13
|
+
export declare const DEFAULT_FONT_SIZE = 15;
|
|
14
|
+
declare const rootTypeToRootName: {
|
|
15
|
+
root: string;
|
|
16
|
+
table: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const blockTypeToBlockName: {
|
|
19
|
+
bullet: string;
|
|
20
|
+
check: string;
|
|
21
|
+
code: string;
|
|
22
|
+
h1: string;
|
|
23
|
+
h2: string;
|
|
24
|
+
h3: string;
|
|
25
|
+
h4: string;
|
|
26
|
+
h5: string;
|
|
27
|
+
h6: string;
|
|
28
|
+
number: string;
|
|
29
|
+
paragraph: string;
|
|
30
|
+
quote: string;
|
|
31
|
+
};
|
|
32
|
+
declare const INITIAL_TOOLBAR_STATE: {
|
|
33
|
+
bgColor: string;
|
|
34
|
+
blockType: keyof typeof blockTypeToBlockName;
|
|
35
|
+
canRedo: boolean;
|
|
36
|
+
canUndo: boolean;
|
|
37
|
+
codeLanguage: string;
|
|
38
|
+
codeTheme: string;
|
|
39
|
+
elementFormat: ElementFormatType;
|
|
40
|
+
fontColor: string;
|
|
41
|
+
fontFamily: string;
|
|
42
|
+
fontSize: string;
|
|
43
|
+
fontSizeInputValue: string;
|
|
44
|
+
isBold: boolean;
|
|
45
|
+
isCode: boolean;
|
|
46
|
+
isHighlight: boolean;
|
|
47
|
+
isImageCaption: boolean;
|
|
48
|
+
isItalic: boolean;
|
|
49
|
+
isLink: boolean;
|
|
50
|
+
isRTL: boolean;
|
|
51
|
+
isStrikethrough: boolean;
|
|
52
|
+
isSubscript: boolean;
|
|
53
|
+
isSuperscript: boolean;
|
|
54
|
+
isUnderline: boolean;
|
|
55
|
+
isLowercase: boolean;
|
|
56
|
+
isUppercase: boolean;
|
|
57
|
+
isCapitalize: boolean;
|
|
58
|
+
rootType: keyof typeof rootTypeToRootName;
|
|
59
|
+
listStartNumber: number | null;
|
|
60
|
+
};
|
|
61
|
+
type ToolbarState = typeof INITIAL_TOOLBAR_STATE;
|
|
62
|
+
type ToolbarStateKey = keyof ToolbarState;
|
|
63
|
+
type ToolbarStateValue<Key extends ToolbarStateKey> = ToolbarState[Key];
|
|
64
|
+
type ContextShape = {
|
|
65
|
+
toolbarState: ToolbarState;
|
|
66
|
+
updateToolbarState<Key extends ToolbarStateKey>(key: Key, value: ToolbarStateValue<Key>): void;
|
|
67
|
+
};
|
|
68
|
+
export declare const ToolbarContext: ({ children, }: {
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
}) => JSX.Element;
|
|
71
|
+
export declare const useToolbarState: () => ContextShape;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from 'react';
|
|
3
|
+
export const MIN_ALLOWED_FONT_SIZE = 8;
|
|
4
|
+
export const MAX_ALLOWED_FONT_SIZE = 72;
|
|
5
|
+
export const DEFAULT_FONT_SIZE = 15;
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
const rootTypeToRootName = {
|
|
8
|
+
root: 'Root',
|
|
9
|
+
table: 'Table',
|
|
10
|
+
};
|
|
11
|
+
export const blockTypeToBlockName = {
|
|
12
|
+
bullet: 'Bulleted List',
|
|
13
|
+
check: 'Check List',
|
|
14
|
+
code: 'Code Block',
|
|
15
|
+
h1: 'Heading 1',
|
|
16
|
+
h2: 'Heading 2',
|
|
17
|
+
h3: 'Heading 3',
|
|
18
|
+
h4: 'Heading 4',
|
|
19
|
+
h5: 'Heading 5',
|
|
20
|
+
h6: 'Heading 6',
|
|
21
|
+
number: 'Numbered List',
|
|
22
|
+
paragraph: 'Normal',
|
|
23
|
+
quote: 'Quote',
|
|
24
|
+
};
|
|
25
|
+
//disable eslint sorting rule for quick reference to toolbar state
|
|
26
|
+
const INITIAL_TOOLBAR_STATE = {
|
|
27
|
+
bgColor: '#fff',
|
|
28
|
+
blockType: 'paragraph',
|
|
29
|
+
canRedo: false,
|
|
30
|
+
canUndo: false,
|
|
31
|
+
codeLanguage: '',
|
|
32
|
+
codeTheme: '',
|
|
33
|
+
elementFormat: 'left',
|
|
34
|
+
fontColor: '#000',
|
|
35
|
+
fontFamily: 'Arial',
|
|
36
|
+
// Current font size in px
|
|
37
|
+
fontSize: `${DEFAULT_FONT_SIZE}px`,
|
|
38
|
+
// Font size input value - for controlled input
|
|
39
|
+
fontSizeInputValue: `${DEFAULT_FONT_SIZE}`,
|
|
40
|
+
isBold: false,
|
|
41
|
+
isCode: false,
|
|
42
|
+
isHighlight: false,
|
|
43
|
+
isImageCaption: false,
|
|
44
|
+
isItalic: false,
|
|
45
|
+
isLink: false,
|
|
46
|
+
isRTL: false,
|
|
47
|
+
isStrikethrough: false,
|
|
48
|
+
isSubscript: false,
|
|
49
|
+
isSuperscript: false,
|
|
50
|
+
isUnderline: false,
|
|
51
|
+
isLowercase: false,
|
|
52
|
+
isUppercase: false,
|
|
53
|
+
isCapitalize: false,
|
|
54
|
+
rootType: 'root',
|
|
55
|
+
listStartNumber: null,
|
|
56
|
+
};
|
|
57
|
+
const Context = createContext(undefined);
|
|
58
|
+
export const ToolbarContext = ({ children, }) => {
|
|
59
|
+
const [toolbarState, setToolbarState] = useState(INITIAL_TOOLBAR_STATE);
|
|
60
|
+
const selectionFontSize = toolbarState.fontSize;
|
|
61
|
+
const updateToolbarState = useCallback((key, value) => {
|
|
62
|
+
setToolbarState(prev => ({
|
|
63
|
+
...prev,
|
|
64
|
+
[key]: value,
|
|
65
|
+
}));
|
|
66
|
+
}, []);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
updateToolbarState('fontSizeInputValue', selectionFontSize.slice(0, -2));
|
|
69
|
+
}, [selectionFontSize, updateToolbarState]);
|
|
70
|
+
const contextValue = useMemo(() => {
|
|
71
|
+
return {
|
|
72
|
+
toolbarState,
|
|
73
|
+
updateToolbarState,
|
|
74
|
+
};
|
|
75
|
+
}, [toolbarState, updateToolbarState]);
|
|
76
|
+
return _jsx(Context.Provider, { value: contextValue, children: children });
|
|
77
|
+
};
|
|
78
|
+
export const useToolbarState = () => {
|
|
79
|
+
const context = useContext(Context);
|
|
80
|
+
if (context === undefined) {
|
|
81
|
+
throw new Error('useToolbarState must be used within a ToolbarProvider');
|
|
82
|
+
}
|
|
83
|
+
return context;
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=ToolbarContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarContext.js","sourceRoot":"","sources":["../../src/context/ToolbarContext.tsx"],"names":[],"mappings":";AAiBA,OAAO,EACL,aAAa,EAEb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,6DAA6D;AAC7D,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IAC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AAQ,EAAE,KAA6B,EAAE,EAAE;QACvE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvB,GAAG,IAAI;YACP,CAAC,GAAG,CAAC,EAAE,KAAK;SACb,CAAC,CAAC,CAAC;IACN,CAAC,EACD,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,kBAAkB,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,OAAO;YACL,YAAY;YACZ,kBAAkB;SACnB,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEvC,OAAO,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAAG,QAAQ,GAAoB,CAAC;AAC9E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
package/lib/context/index.d.ts
CHANGED
package/lib/context/index.js
CHANGED
package/lib/context/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
package/lib/editor/Editor.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ type Props = {
|
|
|
5
5
|
notebook?: INotebookContent;
|
|
6
6
|
onSessionConnection?: OnSessionConnection;
|
|
7
7
|
};
|
|
8
|
+
export declare function EditorContainer(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export declare function Editor(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default Editor;
|
package/lib/editor/Editor.js
CHANGED
|
@@ -7,6 +7,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
import { useState, useEffect } from 'react';
|
|
8
8
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
9
|
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
|
10
|
+
import { HashtagPlugin } from '@lexical/react/LexicalHashtagPlugin';
|
|
10
11
|
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
|
|
11
12
|
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
|
12
13
|
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
@@ -14,7 +15,6 @@ import { AutoFocusPlugin } from '@lexical/react/LexicalAutoFocusPlugin';
|
|
|
14
15
|
import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
|
|
15
16
|
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
16
17
|
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
|
17
|
-
import { HashtagNode } from '@lexical/hashtag';
|
|
18
18
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
19
19
|
import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin';
|
|
20
20
|
import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
|
@@ -22,19 +22,18 @@ import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
|
|
|
22
22
|
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
|
|
23
23
|
import { TableCellNode, TableNode, TableRowNode } from '@lexical/table';
|
|
24
24
|
import { ListItemNode, ListNode } from '@lexical/list';
|
|
25
|
+
import { HashtagNode } from '@lexical/hashtag';
|
|
25
26
|
import { MarkNode } from '@lexical/mark';
|
|
26
27
|
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
|
27
28
|
import { CodeNode } from '@lexical/code';
|
|
28
29
|
import { useJupyter } from '@datalayer/jupyter-react';
|
|
29
|
-
import { CounterNode, EquationNode, ImageNode, JupyterInputHighlightNode, JupyterInputNode, JupyterOutputNode,
|
|
30
|
-
|
|
31
|
-
YouTubeNode, } from '../nodes';
|
|
32
|
-
import { AutoEmbedPlugin, AutoLinkPlugin, CodeActionMenuPlugin, CommentPlugin, ComponentPickerMenuPlugin, DraggableBlockPlugin, EquationsPlugin, FloatingTextFormatToolbarPlugin, HorizontalRulePlugin, ImagesPlugin,
|
|
33
|
-
// JupyterCellPlugin,
|
|
34
|
-
JupyterInputOutputPlugin, ListMaxIndentLevelPlugin, MarkdownPlugin, NbformatContentPlugin, TableOfContentsPlugin, YouTubePlugin, } from './..';
|
|
30
|
+
import { CounterNode, EquationNode, ImageNode, JupyterInputHighlightNode, JupyterInputNode, JupyterOutputNode, YouTubeNode, } from '../nodes';
|
|
31
|
+
import { AutoEmbedPlugin, AutoLinkPlugin, CodeActionMenuPlugin, CommentPlugin, ComponentPickerMenuPlugin, DraggableBlockPlugin, EquationsPlugin, FloatingTextFormatToolbarPlugin, HorizontalRulePlugin, ImagesPlugin, JupyterInputOutputPlugin, ListMaxIndentLevelPlugin, MarkdownPlugin, NbformatContentPlugin, TableOfContentsPlugin, YouTubePlugin, } from './..';
|
|
35
32
|
import { commentTheme } from '../themes';
|
|
36
33
|
import { useLexical } from '../context';
|
|
37
|
-
import { TreeViewPlugin
|
|
34
|
+
import { TreeViewPlugin } from '../plugins';
|
|
35
|
+
import { ToolbarPlugin } from '../plugins/ToolbarPlugin';
|
|
36
|
+
import { ToolbarContext } from '../context/ToolbarContext';
|
|
38
37
|
import './../../style/index.css';
|
|
39
38
|
function Placeholder() {
|
|
40
39
|
return _jsx("div", { className: "editor-placeholder", children: "Code and analyse data." });
|
|
@@ -54,7 +53,6 @@ const initialConfig = {
|
|
|
54
53
|
HeadingNode,
|
|
55
54
|
HorizontalRuleNode,
|
|
56
55
|
ImageNode,
|
|
57
|
-
// JupyterCellNode,
|
|
58
56
|
JupyterInputHighlightNode,
|
|
59
57
|
JupyterInputNode,
|
|
60
58
|
JupyterOutputNode,
|
|
@@ -78,9 +76,12 @@ const EditorContextPlugin = () => {
|
|
|
78
76
|
}, [editor, setEditor]);
|
|
79
77
|
return null;
|
|
80
78
|
};
|
|
81
|
-
export function
|
|
79
|
+
export function EditorContainer(props) {
|
|
82
80
|
const { notebook, onSessionConnection } = props;
|
|
83
81
|
const { defaultKernel } = useJupyter();
|
|
82
|
+
const [editor] = useLexicalComposerContext();
|
|
83
|
+
const [activeEditor, setActiveEditor] = useState(editor);
|
|
84
|
+
const [_, setIsLinkEditMode] = useState(false);
|
|
84
85
|
const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
|
|
85
86
|
const onRef = (_floatingAnchorElem) => {
|
|
86
87
|
if (_floatingAnchorElem !== null) {
|
|
@@ -90,7 +91,10 @@ export function Editor(props) {
|
|
|
90
91
|
function onChange(_editorState) {
|
|
91
92
|
// console.log('---', _editorState.toJSON());
|
|
92
93
|
}
|
|
93
|
-
return (
|
|
94
|
+
return (_jsxs("div", { className: "editor-container", children: [_jsx(ToolbarPlugin, { editor: editor, activeEditor: activeEditor, setActiveEditor: setActiveEditor, setIsLinkEditMode: setIsLinkEditMode }), _jsxs("div", { className: "editor-inner", children: [_jsx(RichTextPlugin, { contentEditable: _jsx("div", { className: "editor-scroller", children: _jsx("div", { className: "editor", ref: onRef, children: _jsx(ContentEditable, { className: "editor-input" }) }) }), placeholder: _jsx(Placeholder, {}), ErrorBoundary: LexicalErrorBoundary }), _jsx(OnChangePlugin, { onChange: onChange }), _jsx(HistoryPlugin, {}), _jsx(TreeViewPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(TablePlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), _jsx(MarkdownPlugin, {}), _jsx(JupyterInputOutputPlugin, { kernel: defaultKernel, onSessionConnection: onSessionConnection }), _jsx(ComponentPickerMenuPlugin, { initCode: "print('\uD83E\uDE90 \u269B\uFE0F Hello Jupyter UI')", kernel: defaultKernel }), _jsx(EquationsPlugin, {}), _jsx(ImagesPlugin, {}), _jsx(HashtagPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(YouTubePlugin, {}), _jsx(NbformatContentPlugin, { notebook: notebook }), _jsx(CodeActionMenuPlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(EditorContextPlugin, {}), _jsx(TableOfContentsPlugin, {}), _jsx(CommentPlugin, { providerFactory: undefined }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem })] }))] })] }));
|
|
95
|
+
}
|
|
96
|
+
export function Editor(props) {
|
|
97
|
+
return (_jsx(LexicalComposer, { initialConfig: initialConfig, children: _jsx(ToolbarContext, { children: _jsx("div", { className: "editor-shell", children: _jsx(EditorContainer, { ...props }) }) }) }));
|
|
94
98
|
}
|
|
95
99
|
export default Editor;
|
|
96
100
|
//# sourceMappingURL=Editor.js.map
|
package/lib/editor/Editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../src/editor/Editor.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ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