@webiny/lexical-editor 5.44.1-beta.0 → 5.45.0-beta.0
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/README.md +6 -12
- package/commands/image.d.ts +2 -2
- package/commands/image.js +2 -8
- package/commands/image.js.map +1 -1
- package/commands/index.d.ts +5 -4
- package/commands/index.js +5 -49
- package/commands/index.js.map +1 -1
- package/commands/list.d.ts +1 -1
- package/commands/list.js +4 -10
- package/commands/list.js.map +1 -1
- package/commands/quote.d.ts +1 -1
- package/commands/quote.js +2 -8
- package/commands/quote.js.map +1 -1
- package/commands/toolbar.js +2 -8
- package/commands/toolbar.js.map +1 -1
- package/commands/typography.d.ts +8 -0
- package/commands/typography.js +4 -0
- package/commands/typography.js.map +1 -0
- package/components/Editor/EnsureHeadingTagPlugin.js +10 -16
- package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -1
- package/components/Editor/RichTextEditor.d.ts +12 -8
- package/components/Editor/RichTextEditor.js +89 -102
- package/components/Editor/RichTextEditor.js.map +1 -1
- package/components/Editor/normalizeInputValue.d.ts +1 -1
- package/components/Editor/normalizeInputValue.js +2 -8
- package/components/Editor/normalizeInputValue.js.map +1 -1
- package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +14 -16
- package/components/LexicalEditorConfig/LexicalEditorConfig.js +21 -69
- package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
- package/components/LexicalEditorConfig/components/Node.d.ts +1 -1
- package/components/LexicalEditorConfig/components/Node.js +17 -26
- package/components/LexicalEditorConfig/components/Node.js.map +1 -1
- package/components/LexicalEditorConfig/components/Plugin.js +17 -26
- package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
- package/components/LexicalEditorConfig/components/ToolbarElement.js +17 -26
- package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
- package/components/LexicalHtmlRenderer.d.ts +4 -7
- package/components/LexicalHtmlRenderer.js +35 -53
- package/components/LexicalHtmlRenderer.js.map +1 -1
- package/components/Toolbar/StaticToolbar.css +416 -0
- package/components/Toolbar/StaticToolbar.d.ts +3 -1
- package/components/Toolbar/StaticToolbar.js +19 -23
- package/components/Toolbar/StaticToolbar.js.map +1 -1
- package/components/ToolbarActions/BoldAction.js +16 -21
- package/components/ToolbarActions/BoldAction.js.map +1 -1
- package/components/ToolbarActions/BulletListAction.js +25 -31
- package/components/ToolbarActions/BulletListAction.js.map +1 -1
- package/components/ToolbarActions/CodeHighlightAction.js +16 -21
- package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
- package/components/ToolbarActions/FontColorAction.js +32 -42
- package/components/ToolbarActions/FontColorAction.js.map +1 -1
- package/components/ToolbarActions/ImageAction.js +19 -34
- package/components/ToolbarActions/ImageAction.js.map +1 -1
- package/components/ToolbarActions/ItalicAction.js +16 -21
- package/components/ToolbarActions/ItalicAction.js.map +1 -1
- package/components/ToolbarActions/LinkAction.js +19 -24
- package/components/ToolbarActions/LinkAction.js.map +1 -1
- package/components/ToolbarActions/NumberedListAction.js +25 -36
- package/components/ToolbarActions/NumberedListAction.js.map +1 -1
- package/components/ToolbarActions/QuoteAction.js +20 -25
- package/components/ToolbarActions/QuoteAction.js.map +1 -1
- package/components/ToolbarActions/TextAlignmentAction.js +36 -45
- package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
- package/components/ToolbarActions/TypographyAction.js +57 -79
- package/components/ToolbarActions/TypographyAction.js.map +1 -1
- package/components/ToolbarActions/UnderlineAction.js +16 -21
- package/components/ToolbarActions/UnderlineAction.js.map +1 -1
- package/context/FontColorActionContext.js +2 -9
- package/context/FontColorActionContext.js.map +1 -1
- package/context/RichTextEditorContext.d.ts +6 -7
- package/context/RichTextEditorContext.js +28 -26
- package/context/RichTextEditorContext.js.map +1 -1
- package/context/SharedHistoryContext.d.ts +2 -2
- package/context/SharedHistoryContext.js +12 -20
- package/context/SharedHistoryContext.js.map +1 -1
- package/context/TextAlignmentActionContextProps.d.ts +1 -1
- package/context/TextAlignmentActionContextProps.js +2 -9
- package/context/TextAlignmentActionContextProps.js.map +1 -1
- package/context/TypographyActionContext.d.ts +3 -2
- package/context/TypographyActionContext.js +2 -9
- package/context/TypographyActionContext.js.map +1 -1
- package/exports/admin/lexical.d.ts +15 -0
- package/exports/admin/lexical.js +23 -0
- package/exports/admin/lexical.js.map +1 -0
- package/hooks/index.d.ts +7 -8
- package/hooks/index.js +7 -93
- package/hooks/index.js.map +1 -1
- package/hooks/useCurrentElement.d.ts +3 -3
- package/hooks/useCurrentElement.js +11 -18
- package/hooks/useCurrentElement.js.map +1 -1
- package/hooks/useCurrentSelection.d.ts +2 -1
- package/hooks/useCurrentSelection.js +27 -40
- package/hooks/useCurrentSelection.js.map +1 -1
- package/hooks/useFontColorPicker.d.ts +1 -1
- package/hooks/useFontColorPicker.js +5 -11
- package/hooks/useFontColorPicker.js.map +1 -1
- package/hooks/useIsMounted.js +6 -14
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useRichTextEditor.d.ts +1 -1
- package/hooks/useRichTextEditor.js +5 -11
- package/hooks/useRichTextEditor.js.map +1 -1
- package/hooks/useTextAlignmentAction.d.ts +1 -1
- package/hooks/useTextAlignmentAction.js +5 -11
- package/hooks/useTextAlignmentAction.js.map +1 -1
- package/hooks/useTypographyAction.d.ts +1 -1
- package/hooks/useTypographyAction.js +5 -11
- package/hooks/useTypographyAction.js.map +1 -1
- package/index.d.ts +33 -38
- package/index.js +44 -322
- package/index.js.map +1 -1
- package/package.json +18 -22
- package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
- package/plugins/BlurEventPlugin/BlurEventPlugin.js +16 -22
- package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +9 -14
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/index.d.ts +1 -1
- package/plugins/CodeHighlightPlugin/index.js +1 -16
- package/plugins/CodeHighlightPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +10 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +28 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +7 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +61 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +2 -136
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -16
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +7 -180
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -1
- package/plugins/FloatingLinkEditorPlugin/index.js +1 -16
- package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +3 -9
- package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/types.d.ts +10 -0
- package/plugins/FloatingLinkEditorPlugin/types.js +3 -0
- package/plugins/FloatingLinkEditorPlugin/types.js.map +1 -0
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +8 -2
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +120 -88
- package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -1
- package/plugins/FontColorPlugin/FontColorPlugin.js +19 -22
- package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
- package/plugins/FontColorPlugin/applyColorToNode.d.ts +2 -2
- package/plugins/FontColorPlugin/applyColorToNode.js +4 -10
- package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -1
- package/plugins/FontColorPlugin/applyColorToSelection.d.ts +2 -2
- package/plugins/FontColorPlugin/applyColorToSelection.js +28 -44
- package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -1
- package/plugins/ImagesPlugin/ImagesPlugin.d.ts +1 -2
- package/plugins/ImagesPlugin/ImagesPlugin.js +58 -60
- package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
- package/plugins/LinkPlugin/LinkPlugin.js +29 -37
- package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/plugins/ListPLugin/ListPlugin.js +52 -15
- package/plugins/ListPLugin/ListPlugin.js.map +1 -1
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +19 -16
- package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -1
- package/plugins/StateHandlingPlugin.d.ts +1 -1
- package/plugins/StateHandlingPlugin.js +32 -39
- package/plugins/StateHandlingPlugin.js.map +1 -1
- package/plugins/TypographyPlugin/TypographyPlugin.js +17 -21
- package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
- package/types.d.ts +4 -4
- package/types.js +6 -38
- package/types.js.map +1 -1
- package/ui/ContentEditable.d.ts +0 -1
- package/ui/ContentEditable.js +7 -14
- package/ui/ContentEditable.js.map +1 -1
- package/ui/Divider.d.ts +0 -1
- package/ui/Divider.js +3 -10
- package/ui/Divider.js.map +1 -1
- package/ui/DropDown.d.ts +1 -1
- package/ui/DropDown.js +64 -90
- package/ui/DropDown.js.map +1 -1
- package/ui/ImageResizer.d.ts +0 -1
- package/ui/ImageResizer.js +78 -83
- package/ui/ImageResizer.js.map +1 -1
- package/ui/LinkPreview.d.ts +0 -1
- package/ui/LinkPreview.js +22 -29
- package/ui/LinkPreview.js.map +1 -1
- package/ui/Placeholder.d.ts +1 -1
- package/ui/Placeholder.js +10 -16
- package/ui/Placeholder.js.map +1 -1
- package/ui/TextInput.d.ts +0 -1
- package/ui/TextInput.js +11 -18
- package/ui/TextInput.js.map +1 -1
- package/ui/ToolbarActionDialog.js +30 -42
- package/ui/ToolbarActionDialog.js.map +1 -1
- package/utils/canUseDOM.js +1 -7
- package/utils/canUseDOM.js.map +1 -1
- package/utils/files.d.ts +6 -6
- package/utils/files.js +5 -32
- package/utils/files.js.map +1 -1
- package/utils/getDOMRangeRect.js +4 -10
- package/utils/getDOMRangeRect.js.map +1 -1
- package/utils/getSelectedNode.d.ts +1 -1
- package/utils/getSelectedNode.js +9 -16
- package/utils/getSelectedNode.js.map +1 -1
- package/utils/getTransparentImage.js +1 -7
- package/utils/getTransparentImage.js.map +1 -1
- package/utils/insertImage.d.ts +1 -1
- package/utils/insertImage.js +8 -14
- package/utils/insertImage.js.map +1 -1
- package/utils/isAnchorLink.js +1 -7
- package/utils/isAnchorLink.js.map +1 -1
- package/utils/isChildOfFloatingToolbar.js +3 -12
- package/utils/isChildOfFloatingToolbar.js.map +1 -1
- package/utils/isHTMLElement.js +1 -7
- package/utils/isHTMLElement.js.map +1 -1
- package/utils/isValidJSON.js +3 -9
- package/utils/isValidJSON.js.map +1 -1
- package/utils/isValidLexicalData.d.ts +3 -3
- package/utils/isValidLexicalData.js +6 -12
- package/utils/isValidLexicalData.js.map +1 -1
- package/utils/point.js +35 -60
- package/utils/point.js.map +1 -1
- package/utils/rect.d.ts +1 -1
- package/utils/rect.js +115 -149
- package/utils/rect.js.map +1 -1
- package/utils/sanitizeUrl.js +6 -13
- package/utils/sanitizeUrl.js.map +1 -1
- package/utils/setFloatingElemPosition.d.ts +1 -1
- package/utils/setFloatingElemPosition.js +24 -30
- package/utils/setFloatingElemPosition.js.map +1 -1
- package/components/Editor/HeadingEditor.d.ts +0 -7
- package/components/Editor/HeadingEditor.js +0 -30
- package/components/Editor/HeadingEditor.js.map +0 -1
- package/components/Editor/ParagraphEditor.d.ts +0 -7
- package/components/Editor/ParagraphEditor.js +0 -29
- package/components/Editor/ParagraphEditor.js.map +0 -1
- package/components/Toolbar/Toolbar.css +0 -643
- package/components/Toolbar/Toolbar.d.ts +0 -11
- package/components/Toolbar/Toolbar.js +0 -165
- package/components/Toolbar/Toolbar.js.map +0 -1
- package/components/ToolbarActions/FontSizeAction.d.ts +0 -14
- package/components/ToolbarActions/FontSizeAction.js +0 -109
- package/components/ToolbarActions/FontSizeAction.js.map +0 -1
- package/hooks/useList.d.ts +0 -2
- package/hooks/useList.js +0 -54
- package/hooks/useList.js.map +0 -1
- package/hooks/useQuote.d.ts +0 -2
- package/hooks/useQuote.js +0 -22
- package/hooks/useQuote.js.map +0 -1
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +0 -9
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +0 -118
- package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +0 -1
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +0 -9
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +0 -44
- package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +0 -1
- package/utils/generateInitialLexicalValue.d.ts +0 -4
- package/utils/generateInitialLexicalValue.js +0 -33
- package/utils/generateInitialLexicalValue.js.map +0 -1
|
@@ -1,37 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setFloatingElemPosition = setFloatingElemPosition;
|
|
7
|
-
var VERTICAL_GAP = 10;
|
|
8
|
-
var HORIZONTAL_OFFSET = 5;
|
|
9
|
-
function setFloatingElemPosition(basePosition, elementToPosition, anchorElem) {
|
|
10
|
-
var verticalGap = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : VERTICAL_GAP;
|
|
11
|
-
var horizontalOffset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : HORIZONTAL_OFFSET;
|
|
1
|
+
import { computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
2
|
+
const GAP = 10;
|
|
3
|
+
export function setFloatingElemPosition(basePosition, elementToPosition) {
|
|
12
4
|
// A small timeout gives enough time for DOM to update and provides us with correct bounding rect values.
|
|
13
|
-
setTimeout(
|
|
14
|
-
|
|
15
|
-
if (basePosition === null || !scrollerElem) {
|
|
16
|
-
elementToPosition.style.opacity = "0";
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
if (basePosition === null) {
|
|
17
7
|
elementToPosition.style.transform = "translate(-10000px, -10000px)";
|
|
18
8
|
return;
|
|
19
9
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
const virtualElement = {
|
|
11
|
+
getBoundingClientRect: () => basePosition.getBoundingClientRect()
|
|
12
|
+
};
|
|
13
|
+
computePosition(virtualElement, elementToPosition, {
|
|
14
|
+
placement: "bottom",
|
|
15
|
+
middleware: [offset(GAP),
|
|
16
|
+
// adds gap between anchor and popup
|
|
17
|
+
flip(),
|
|
18
|
+
// switches to the opposite side if no room (bottom → top)
|
|
19
|
+
shift({
|
|
20
|
+
padding: GAP
|
|
21
|
+
}) // slides along the axis to stay within viewport
|
|
22
|
+
]
|
|
23
|
+
}).then(({
|
|
24
|
+
x,
|
|
25
|
+
y
|
|
26
|
+
}) => {
|
|
27
|
+
elementToPosition.style.transform = `translate(${x}px, ${y}px)`;
|
|
28
|
+
});
|
|
35
29
|
}, 10);
|
|
36
30
|
}
|
|
37
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["computePosition","flip","offset","shift","GAP","setFloatingElemPosition","basePosition","elementToPosition","setTimeout","style","transform","virtualElement","getBoundingClientRect","placement","middleware","padding","then","x","y"],"sources":["setFloatingElemPosition.ts"],"sourcesContent":["import { computePosition, flip, offset, shift } from \"@floating-ui/dom\";\n\nconst GAP = 10;\n\nexport function setFloatingElemPosition(\n basePosition: Range | null,\n elementToPosition: HTMLElement\n): void {\n // A small timeout gives enough time for DOM to update and provides us with correct bounding rect values.\n setTimeout(() => {\n if (basePosition === null) {\n elementToPosition.style.transform = \"translate(-10000px, -10000px)\";\n return;\n }\n\n const virtualElement = {\n getBoundingClientRect: () => basePosition.getBoundingClientRect()\n };\n\n computePosition(virtualElement, elementToPosition, {\n placement: \"bottom\",\n middleware: [\n offset(GAP), // adds gap between anchor and popup\n flip(), // switches to the opposite side if no room (bottom → top)\n shift({ padding: GAP }) // slides along the axis to stay within viewport\n ]\n }).then(({ x, y }) => {\n elementToPosition.style.transform = `translate(${x}px, ${y}px)`;\n });\n }, 10);\n}\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,IAAI,EAAEC,MAAM,EAAEC,KAAK,QAAQ,kBAAkB;AAEvE,MAAMC,GAAG,GAAG,EAAE;AAEd,OAAO,SAASC,uBAAuBA,CACnCC,YAA0B,EAC1BC,iBAA8B,EAC1B;EACJ;EACAC,UAAU,CAAC,MAAM;IACb,IAAIF,YAAY,KAAK,IAAI,EAAE;MACvBC,iBAAiB,CAACE,KAAK,CAACC,SAAS,GAAG,+BAA+B;MACnE;IACJ;IAEA,MAAMC,cAAc,GAAG;MACnBC,qBAAqB,EAAEA,CAAA,KAAMN,YAAY,CAACM,qBAAqB,CAAC;IACpE,CAAC;IAEDZ,eAAe,CAACW,cAAc,EAAEJ,iBAAiB,EAAE;MAC/CM,SAAS,EAAE,QAAQ;MACnBC,UAAU,EAAE,CACRZ,MAAM,CAACE,GAAG,CAAC;MAAE;MACbH,IAAI,CAAC,CAAC;MAAE;MACRE,KAAK,CAAC;QAAEY,OAAO,EAAEX;MAAI,CAAC,CAAC,CAAC;MAAA;IAEhC,CAAC,CAAC,CAACY,IAAI,CAAC,CAAC;MAAEC,CAAC;MAAEC;IAAE,CAAC,KAAK;MAClBX,iBAAiB,CAACE,KAAK,CAACC,SAAS,GAAG,aAAaO,CAAC,OAAOC,CAAC,KAAK;IACnE,CAAC,CAAC;EACN,CAAC,EAAE,EAAE,CAAC;AACV","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { RichTextEditorProps } from "./RichTextEditor";
|
|
3
|
-
interface HeadingEditorProps extends RichTextEditorProps {
|
|
4
|
-
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
|
-
}
|
|
6
|
-
export declare const HeadingEditor: ({ tag, placeholder, ...rest }: HeadingEditorProps) => React.JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.HeadingEditor = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _RichTextEditor = require("./RichTextEditor");
|
|
11
|
-
var _Toolbar = require("../Toolbar/Toolbar");
|
|
12
|
-
var _EnsureHeadingTagPlugin = require("./EnsureHeadingTagPlugin");
|
|
13
|
-
var _excluded = ["tag", "placeholder"];
|
|
14
|
-
var styles = {
|
|
15
|
-
padding: 5
|
|
16
|
-
};
|
|
17
|
-
var HeadingEditor = exports.HeadingEditor = function HeadingEditor(_ref) {
|
|
18
|
-
var tag = _ref.tag,
|
|
19
|
-
placeholder = _ref.placeholder,
|
|
20
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
|
|
22
|
-
toolbar: /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null),
|
|
23
|
-
tag: tag ?? "h1",
|
|
24
|
-
placeholder: placeholder ?? "Enter your heading text here..."
|
|
25
|
-
}, rest, {
|
|
26
|
-
styles: styles
|
|
27
|
-
}), /*#__PURE__*/_react.default.createElement(_EnsureHeadingTagPlugin.EnsureHeadingTagPlugin, null), rest?.children);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=HeadingEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_EnsureHeadingTagPlugin","_excluded","styles","padding","HeadingEditor","exports","_ref","tag","placeholder","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","EnsureHeadingTagPlugin","children"],"sources":["HeadingEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\nimport { EnsureHeadingTagPlugin } from \"~/components/Editor/EnsureHeadingTagPlugin\";\n\ninterface HeadingEditorProps extends RichTextEditorProps {\n tag?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n}\n\nconst styles = { padding: 5 };\n\nexport const HeadingEditor = ({ tag, placeholder, ...rest }: HeadingEditorProps) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"h1\"}\n placeholder={placeholder ?? \"Enter your heading text here...\"}\n {...rest}\n styles={styles}\n >\n <EnsureHeadingTagPlugin />\n {rest?.children}\n </RichTextEditor>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AAAoF,IAAAI,SAAA;AAMpF,IAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAEtB,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAAhBA,aAAaA,CAAAE,IAAA,EAA0D;EAAA,IAApDC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,EAAAL,SAAA;EACrD,oBACIN,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,eAAA,CAAAe,cAAc,EAAAC,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAErB,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACb,QAAA,CAAAkB,OAAO,MAAE,CAAE;IACrBV,GAAG,EAAEA,GAAG,IAAI,IAAK;IACjBC,WAAW,EAAEA,WAAW,IAAI;EAAkC,GAC1DC,IAAI;IACRP,MAAM,EAAEA;EAAO,iBAEfP,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACZ,uBAAA,CAAAkB,sBAAsB,MAAE,CAAC,EACzBT,IAAI,EAAEU,QACK,CAAC;AAEzB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { RichTextEditorProps } from "./RichTextEditor";
|
|
3
|
-
interface ParagraphLexicalEditorProps extends RichTextEditorProps {
|
|
4
|
-
tag?: "p";
|
|
5
|
-
}
|
|
6
|
-
declare const ParagraphEditor: ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => React.JSX.Element;
|
|
7
|
-
export { ParagraphEditor };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ParagraphEditor = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _RichTextEditor = require("./RichTextEditor");
|
|
11
|
-
var _Toolbar = require("../Toolbar/Toolbar");
|
|
12
|
-
var _excluded = ["placeholder", "tag"];
|
|
13
|
-
var styles = {
|
|
14
|
-
padding: 5
|
|
15
|
-
};
|
|
16
|
-
var ParagraphEditor = exports.ParagraphEditor = function ParagraphEditor(_ref) {
|
|
17
|
-
var placeholder = _ref.placeholder,
|
|
18
|
-
tag = _ref.tag,
|
|
19
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
|
|
21
|
-
toolbar: /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null),
|
|
22
|
-
tag: tag ?? "p",
|
|
23
|
-
placeholder: placeholder ?? "Enter your text here..."
|
|
24
|
-
}, rest, {
|
|
25
|
-
styles: styles
|
|
26
|
-
}), rest?.children);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=ParagraphEditor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","styles","padding","ParagraphEditor","exports","_ref","placeholder","tag","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","children"],"sources":["ParagraphEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\n\ninterface ParagraphLexicalEditorProps extends RichTextEditorProps {\n tag?: \"p\";\n}\n\nconst styles = { padding: 5 };\n\nconst ParagraphEditor = ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"p\"}\n placeholder={placeholder ?? \"Enter your text here...\"}\n {...rest}\n styles={styles}\n >\n {rest?.children}\n </RichTextEditor>\n );\n};\n\nexport { ParagraphEditor };\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAuD,IAAAG,SAAA;AAMvD,IAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAE7B,IAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAAE,IAAA,EAAmE;EAAA,IAA7DC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,EAAAL,SAAA;EAChD,oBACIL,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACb,eAAA,CAAAc,cAAc,EAAAC,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEpB,MAAA,CAAAe,OAAA,CAAAC,aAAA,CAACZ,QAAA,CAAAiB,OAAO,MAAE,CAAE;IACrBT,GAAG,EAAEA,GAAG,IAAI,GAAI;IAChBD,WAAW,EAAEA,WAAW,IAAI;EAA0B,GAClDE,IAAI;IACRP,MAAM,EAAEA;EAAO,IAEdO,IAAI,EAAES,QACK,CAAC;AAEzB,CAAC","ignoreList":[]}
|