@webiny/lexical-editor 5.44.1-beta.0 → 5.44.1-beta.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.
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import { ToolbarElementConfig } from "./components/ToolbarElement";
|
|
3
|
-
import { PluginConfig } from "./components/Plugin";
|
|
4
|
-
import { NodeConfig } from "./components/Node";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ToolbarElement: ({ name, element, after, before, remove }: import("./components/ToolbarElement").ToolbarElementProps) =>
|
|
10
|
-
Plugin: ({ name, element, after, before, remove }: import("./components/Plugin").PluginProps) =>
|
|
11
|
-
Node: ({ name, node, after, before, remove }: import("./components/Node").NodeProps) =>
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ToolbarElementConfig } from "./components/ToolbarElement.js";
|
|
3
|
+
import type { PluginConfig } from "./components/Plugin.js";
|
|
4
|
+
import type { NodeConfig } from "./components/Node.js";
|
|
5
|
+
export type { ToolbarElementConfig } from "./components/ToolbarElement.js";
|
|
6
|
+
export type { PluginConfig } from "./components/Plugin.js";
|
|
7
|
+
export type { NodeConfig } from "./components/Node.js";
|
|
8
|
+
export declare const LexicalEditorConfig: (({ priority, children }: import("@webiny/react-properties").ConfigProps) => import("react").JSX.Element) & {
|
|
9
|
+
ToolbarElement: ({ name, element, after, before, remove }: import("./components/ToolbarElement.js").ToolbarElementProps) => import("react").JSX.Element;
|
|
10
|
+
Plugin: ({ name, element, after, before, remove }: import("./components/Plugin.js").PluginProps) => import("react").JSX.Element;
|
|
11
|
+
Node: ({ name, node, after, before, remove }: import("./components/Node.js").NodeProps) => import("react").JSX.Element;
|
|
12
12
|
};
|
|
13
|
-
export declare const LexicalEditorWithConfig: ({ children }:
|
|
14
|
-
|
|
15
|
-
}) => React.JSX.Element;
|
|
16
|
-
export declare function useLexicalEditorConfig(): {
|
|
13
|
+
export declare const LexicalEditorWithConfig: ({ onProperties, children }: import("@webiny/react-properties").WithConfigProps) => import("react").JSX.Element;
|
|
14
|
+
interface LexicalEditorConfigData {
|
|
17
15
|
toolbarElements: ToolbarElementConfig[];
|
|
18
16
|
plugins: PluginConfig[];
|
|
19
17
|
nodes: NodeConfig[];
|
|
20
|
-
}
|
|
18
|
+
}
|
|
19
|
+
export declare function useLexicalEditorConfig(): LexicalEditorConfigData;
|
|
@@ -1,73 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.LexicalEditorWithConfig = exports.LexicalEditorConfig = void 0;
|
|
9
8
|
exports.useLexicalEditorConfig = useLexicalEditorConfig;
|
|
10
|
-
var
|
|
11
|
-
var _react =
|
|
12
|
-
var _reactComposition = require("@webiny/react-composition");
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _react = require("react");
|
|
13
11
|
var _reactProperties = require("@webiny/react-properties");
|
|
14
|
-
var _ToolbarElement = require("./components/ToolbarElement");
|
|
15
|
-
var _Plugin = require("./components/Plugin");
|
|
16
|
-
var _Node = require("./components/Node");
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
var _ToolbarElement = require("./components/ToolbarElement.js");
|
|
13
|
+
var _Plugin = require("./components/Plugin.js");
|
|
14
|
+
var _Node = require("./components/Node.js");
|
|
15
|
+
var base = (0, _reactProperties.createConfigurableComponent)("LexicalEditor");
|
|
16
|
+
var LexicalEditorConfig = exports.LexicalEditorConfig = Object.assign(base.Config, {
|
|
17
|
+
ToolbarElement: _ToolbarElement.ToolbarElement,
|
|
18
|
+
Plugin: _Plugin.Plugin,
|
|
19
|
+
Node: _Node.Node
|
|
20
20
|
});
|
|
21
|
-
var
|
|
22
|
-
return function (BaseComponent) {
|
|
23
|
-
return function ConfigHOC(_ref2) {
|
|
24
|
-
var children = _ref2.children;
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(BaseComponent, null, newChildren, children);
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
var LexicalEditorConfig = exports.LexicalEditorConfig = function LexicalEditorConfig(_ref3) {
|
|
30
|
-
var children = _ref3.children;
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_reactComposition.Compose, {
|
|
32
|
-
component: LexicalEditorConfigApply,
|
|
33
|
-
with: createHOC(children)
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
LexicalEditorConfig.ToolbarElement = _ToolbarElement.ToolbarElement;
|
|
37
|
-
LexicalEditorConfig.Plugin = _Plugin.Plugin;
|
|
38
|
-
LexicalEditorConfig.Node = _Node.Node;
|
|
39
|
-
var ViewContext = /*#__PURE__*/_react.default.createContext({
|
|
40
|
-
properties: []
|
|
41
|
-
});
|
|
42
|
-
var LexicalEditorWithConfig = exports.LexicalEditorWithConfig = function LexicalEditorWithConfig(_ref4) {
|
|
43
|
-
var children = _ref4.children;
|
|
44
|
-
var _useState = (0, _react.useState)([]),
|
|
45
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
46
|
-
properties = _useState2[0],
|
|
47
|
-
setProperties = _useState2[1];
|
|
48
|
-
var context = {
|
|
49
|
-
properties: properties
|
|
50
|
-
};
|
|
51
|
-
var stateUpdater = function stateUpdater(properties) {
|
|
52
|
-
setProperties(properties);
|
|
53
|
-
};
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(ViewContext.Provider, {
|
|
55
|
-
value: context
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(_reactProperties.Properties, {
|
|
57
|
-
onChange: stateUpdater
|
|
58
|
-
}, /*#__PURE__*/_react.default.createElement(LexicalEditorConfigApply, null), children));
|
|
59
|
-
};
|
|
21
|
+
var LexicalEditorWithConfig = exports.LexicalEditorWithConfig = base.WithConfig;
|
|
60
22
|
function useLexicalEditorConfig() {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
23
|
+
var config = base.useConfig();
|
|
24
|
+
var toolbarElements = config.toolbarElements || [];
|
|
25
|
+
var plugins = config.plugins || [];
|
|
26
|
+
var nodes = config.nodes || [];
|
|
27
|
+
return (0, _react.useMemo)(function () {
|
|
28
|
+
return {
|
|
29
|
+
toolbarElements: (0, _toConsumableArray2.default)(toolbarElements),
|
|
30
|
+
plugins: (0, _toConsumableArray2.default)(plugins),
|
|
31
|
+
nodes: (0, _toConsumableArray2.default)(nodes)
|
|
32
|
+
};
|
|
33
|
+
}, [config]);
|
|
71
34
|
}
|
|
72
35
|
|
|
73
36
|
//# sourceMappingURL=LexicalEditorConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactProperties","_ToolbarElement","_Plugin","_Node","base","createConfigurableComponent","LexicalEditorConfig","exports","Object","assign","Config","ToolbarElement","Plugin","Node","LexicalEditorWithConfig","WithConfig","useLexicalEditorConfig","config","useConfig","toolbarElements","plugins","nodes","useMemo","_toConsumableArray2","default"],"sources":["LexicalEditorConfig.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { createConfigurableComponent } from \"@webiny/react-properties\";\nimport type { ToolbarElementConfig } from \"./components/ToolbarElement.js\";\nimport { ToolbarElement } from \"./components/ToolbarElement.js\";\nimport type { PluginConfig } from \"./components/Plugin.js\";\nimport { Plugin } from \"./components/Plugin.js\";\nimport type { NodeConfig } from \"./components/Node.js\";\nimport { Node } from \"./components/Node.js\";\n\nexport type { ToolbarElementConfig } from \"./components/ToolbarElement.js\";\nexport type { PluginConfig } from \"./components/Plugin.js\";\nexport type { NodeConfig } from \"./components/Node.js\";\n\nconst base = createConfigurableComponent<LexicalEditorConfigData>(\"LexicalEditor\");\n\nexport const LexicalEditorConfig = Object.assign(base.Config, {\n ToolbarElement,\n Plugin,\n Node\n});\n\nexport const LexicalEditorWithConfig = base.WithConfig;\n\ninterface LexicalEditorConfigData {\n toolbarElements: ToolbarElementConfig[];\n plugins: PluginConfig[];\n nodes: NodeConfig[];\n}\n\nexport function useLexicalEditorConfig(): LexicalEditorConfigData {\n const config = base.useConfig();\n const toolbarElements = config.toolbarElements || [];\n const plugins = config.plugins || [];\n const nodes = config.nodes || [];\n\n return useMemo(\n () => ({\n toolbarElements: [...toolbarElements],\n plugins: [...plugins],\n nodes: [...nodes]\n }),\n [config]\n );\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AAMA,IAAMK,IAAI,GAAG,IAAAC,4CAA2B,EAA0B,eAAe,CAAC;AAE3E,IAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,MAAM,CAACC,MAAM,CAACL,IAAI,CAACM,MAAM,EAAE;EAC1DC,cAAc,EAAdA,8BAAc;EACdC,MAAM,EAANA,cAAM;EACNC,IAAI,EAAJA;AACJ,CAAC,CAAC;AAEK,IAAMC,uBAAuB,GAAAP,OAAA,CAAAO,uBAAA,GAAGV,IAAI,CAACW,UAAU;AAQ/C,SAASC,sBAAsBA,CAAA,EAA4B;EAC9D,IAAMC,MAAM,GAAGb,IAAI,CAACc,SAAS,CAAC,CAAC;EAC/B,IAAMC,eAAe,GAAGF,MAAM,CAACE,eAAe,IAAI,EAAE;EACpD,IAAMC,OAAO,GAAGH,MAAM,CAACG,OAAO,IAAI,EAAE;EACpC,IAAMC,KAAK,GAAGJ,MAAM,CAACI,KAAK,IAAI,EAAE;EAEhC,OAAO,IAAAC,cAAO,EACV;IAAA,OAAO;MACHH,eAAe,MAAAI,mBAAA,CAAAC,OAAA,EAAML,eAAe,CAAC;MACrCC,OAAO,MAAAG,mBAAA,CAAAC,OAAA,EAAMJ,OAAO,CAAC;MACrBC,KAAK,MAAAE,mBAAA,CAAAC,OAAA,EAAMH,KAAK;IACpB,CAAC;EAAA,CAAC,EACF,CAACJ,MAAM,CACX,CAAC;AACL","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/lexical-editor",
|
|
3
|
-
"version": "5.44.1-beta.
|
|
3
|
+
"version": "5.44.1-beta.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"@lexical/selection": "0.23.1",
|
|
16
16
|
"@lexical/text": "0.23.1",
|
|
17
17
|
"@lexical/utils": "0.23.1",
|
|
18
|
-
"@webiny/lexical-nodes": "5.44.1-beta.
|
|
19
|
-
"@webiny/lexical-theme": "5.44.1-beta.
|
|
20
|
-
"@webiny/react-composition": "5.44.1-beta.
|
|
21
|
-
"@webiny/react-properties": "5.44.1-beta.
|
|
18
|
+
"@webiny/lexical-nodes": "5.44.1-beta.1",
|
|
19
|
+
"@webiny/lexical-theme": "5.44.1-beta.1",
|
|
20
|
+
"@webiny/react-composition": "5.44.1-beta.1",
|
|
21
|
+
"@webiny/react-properties": "5.44.1-beta.1",
|
|
22
22
|
"emotion": "10.0.27",
|
|
23
23
|
"lexical": "0.23.1",
|
|
24
24
|
"lodash": "4.17.21",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-dom": "18.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@webiny/project-utils": "5.44.1-beta.
|
|
29
|
+
"@webiny/project-utils": "5.44.1-beta.1"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"build": "node ../cli/bin.js run build",
|
|
37
37
|
"watch": "node ../cli/bin.js run watch"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "ff5f085c417040291d39fdbe5153067f3a23ed86"
|
|
40
40
|
}
|