@pie-lib/editable-html 11.21.2 → 11.21.3-next.155
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/CHANGELOG.md +6 -76
- package/esm/package.json +3 -0
- package/lib/block-tags.js +2 -3
- package/lib/block-tags.js.map +1 -1
- package/lib/constants.js +3 -6
- package/lib/constants.js.map +1 -1
- package/lib/editor.js +350 -481
- package/lib/editor.js.map +1 -1
- package/lib/index.js +18 -79
- package/lib/index.js.map +1 -1
- package/lib/parse-html.js +7 -7
- package/lib/parse-html.js.map +1 -1
- package/lib/plugins/characters/custom-popper.js +28 -44
- package/lib/plugins/characters/custom-popper.js.map +1 -1
- package/lib/plugins/characters/index.js +23 -63
- package/lib/plugins/characters/index.js.map +1 -1
- package/lib/plugins/characters/utils.js +3 -6
- package/lib/plugins/characters/utils.js.map +1 -1
- package/lib/plugins/css/icons/index.js +13 -25
- package/lib/plugins/css/icons/index.js.map +1 -1
- package/lib/plugins/css/index.js +34 -93
- package/lib/plugins/css/index.js.map +1 -1
- package/lib/plugins/customPlugin/index.js +10 -26
- package/lib/plugins/customPlugin/index.js.map +1 -1
- package/lib/plugins/html/icons/index.js +17 -25
- package/lib/plugins/html/icons/index.js.map +1 -1
- package/lib/plugins/html/index.js +4 -13
- package/lib/plugins/html/index.js.map +1 -1
- package/lib/plugins/image/alt-dialog.js +20 -49
- package/lib/plugins/image/alt-dialog.js.map +1 -1
- package/lib/plugins/image/component.js +118 -194
- package/lib/plugins/image/component.js.map +1 -1
- package/lib/plugins/image/image-toolbar.js +48 -88
- package/lib/plugins/image/image-toolbar.js.map +1 -1
- package/lib/plugins/image/index.js +6 -46
- package/lib/plugins/image/index.js.map +1 -1
- package/lib/plugins/image/insert-image-handler.js +10 -31
- package/lib/plugins/image/insert-image-handler.js.map +1 -1
- package/lib/plugins/index.js +46 -106
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/list/index.js +27 -73
- package/lib/plugins/list/index.js.map +1 -1
- package/lib/plugins/math/index.js +64 -116
- package/lib/plugins/math/index.js.map +1 -1
- package/lib/plugins/media/index.js +27 -84
- package/lib/plugins/media/index.js.map +1 -1
- package/lib/plugins/media/media-dialog.js +192 -307
- package/lib/plugins/media/media-dialog.js.map +1 -1
- package/lib/plugins/media/media-toolbar.js +40 -65
- package/lib/plugins/media/media-toolbar.js.map +1 -1
- package/lib/plugins/media/media-wrapper.js +20 -49
- package/lib/plugins/media/media-wrapper.js.map +1 -1
- package/lib/plugins/rendering/index.js +5 -15
- package/lib/plugins/rendering/index.js.map +1 -1
- package/lib/plugins/respArea/drag-in-the-blank/choice.js +233 -251
- package/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -1
- package/lib/plugins/respArea/drag-in-the-blank/index.js +17 -59
- package/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -1
- package/lib/plugins/respArea/drag-in-the-blank/utils.js +38 -0
- package/lib/plugins/respArea/drag-in-the-blank/utils.js.map +1 -0
- package/lib/plugins/respArea/explicit-constructed-response/index.js +3 -10
- package/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -1
- package/lib/plugins/respArea/icons/index.js +22 -45
- package/lib/plugins/respArea/icons/index.js.map +1 -1
- package/lib/plugins/respArea/index.js +5 -59
- package/lib/plugins/respArea/index.js.map +1 -1
- package/lib/plugins/respArea/inline-dropdown/index.js +2 -10
- package/lib/plugins/respArea/inline-dropdown/index.js.map +1 -1
- package/lib/plugins/respArea/math-templated/index.js +91 -109
- package/lib/plugins/respArea/math-templated/index.js.map +1 -1
- package/lib/plugins/respArea/utils.js +12 -42
- package/lib/plugins/respArea/utils.js.map +1 -1
- package/lib/plugins/table/CustomTablePlugin.js +24 -41
- package/lib/plugins/table/CustomTablePlugin.js.map +1 -1
- package/lib/plugins/table/icons/index.js +21 -35
- package/lib/plugins/table/icons/index.js.map +1 -1
- package/lib/plugins/table/index.js +48 -118
- package/lib/plugins/table/index.js.map +1 -1
- package/lib/plugins/table/table-toolbar.js +37 -86
- package/lib/plugins/table/table-toolbar.js.map +1 -1
- package/lib/plugins/textAlign/icons/index.js +25 -64
- package/lib/plugins/textAlign/icons/index.js.map +1 -1
- package/lib/plugins/textAlign/index.js +0 -8
- package/lib/plugins/textAlign/index.js.map +1 -1
- package/lib/plugins/toolbar/default-toolbar.js +30 -79
- package/lib/plugins/toolbar/default-toolbar.js.map +1 -1
- package/lib/plugins/toolbar/done-button.js +16 -34
- package/lib/plugins/toolbar/done-button.js.map +1 -1
- package/lib/plugins/toolbar/editor-and-toolbar.js +174 -202
- package/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -1
- package/lib/plugins/toolbar/index.js +0 -5
- package/lib/plugins/toolbar/index.js.map +1 -1
- package/lib/plugins/toolbar/toolbar-buttons.js +59 -108
- package/lib/plugins/toolbar/toolbar-buttons.js.map +1 -1
- package/lib/plugins/toolbar/toolbar.js +93 -162
- package/lib/plugins/toolbar/toolbar.js.map +1 -1
- package/lib/plugins/utils.js +5 -25
- package/lib/plugins/utils.js.map +1 -1
- package/lib/serialization.js +47 -153
- package/lib/serialization.js.map +1 -1
- package/lib/shared/alert-dialog.js +35 -42
- package/lib/theme.js +1 -2
- package/lib/theme.js.map +1 -1
- package/package.json +26 -14
- package/src/__tests__/editor-utils.test.js +162 -0
- package/src/__tests__/utils.js +1 -1
- package/src/editor.jsx +175 -153
- package/src/index.jsx +0 -3
- package/src/plugins/characters/custom-popper.js +25 -25
- package/src/plugins/characters/index.jsx +15 -5
- package/src/plugins/css/icons/index.jsx +11 -13
- package/src/plugins/css/index.jsx +16 -11
- package/src/plugins/html/icons/index.jsx +17 -14
- package/src/plugins/image/__tests__/component.test.jsx +61 -29
- package/src/plugins/image/__tests__/image-toolbar-logic.test.jsx +69 -17
- package/src/plugins/image/__tests__/image-toolbar.test.jsx +6 -4
- package/src/plugins/image/alt-dialog.jsx +9 -8
- package/src/plugins/image/component.jsx +68 -92
- package/src/plugins/image/image-toolbar.jsx +31 -28
- package/src/plugins/image/index.jsx +1 -1
- package/src/plugins/index.jsx +12 -10
- package/src/plugins/math/__tests__/index.test.jsx +45 -26
- package/src/plugins/math/index.jsx +1 -1
- package/src/plugins/media/index.jsx +6 -5
- package/src/plugins/media/media-dialog.js +65 -76
- package/src/plugins/media/media-toolbar.jsx +32 -33
- package/src/plugins/media/media-wrapper.jsx +10 -13
- package/src/plugins/respArea/drag-in-the-blank/choice.jsx +240 -167
- package/src/plugins/respArea/drag-in-the-blank/index.jsx +27 -56
- package/src/plugins/respArea/drag-in-the-blank/utils.js +14 -0
- package/src/plugins/respArea/icons/index.jsx +16 -16
- package/src/plugins/respArea/math-templated/index.jsx +88 -89
- package/src/plugins/respArea/utils.jsx +5 -3
- package/src/plugins/table/__tests__/table-toolbar.test.jsx +40 -7
- package/src/plugins/table/icons/index.jsx +16 -16
- package/src/plugins/table/index.jsx +35 -19
- package/src/plugins/table/table-toolbar.jsx +18 -19
- package/src/plugins/textAlign/icons/index.jsx +13 -4
- package/src/plugins/textAlign/index.jsx +0 -3
- package/src/plugins/toolbar/__tests__/default-toolbar.test.jsx +102 -69
- package/src/plugins/toolbar/__tests__/editor-and-toolbar.test.jsx +14 -11
- package/src/plugins/toolbar/__tests__/toolbar-buttons.test.jsx +81 -35
- package/src/plugins/toolbar/__tests__/toolbar.test.jsx +44 -38
- package/src/plugins/toolbar/default-toolbar.jsx +18 -21
- package/src/plugins/toolbar/done-button.jsx +16 -22
- package/src/plugins/toolbar/editor-and-toolbar.jsx +134 -158
- package/src/plugins/toolbar/toolbar-buttons.jsx +30 -46
- package/src/plugins/toolbar/toolbar.jsx +57 -79
- package/src/serialization.jsx +3 -3
- package/src/__tests__/editor.test.jsx +0 -363
- package/src/plugins/image/__tests__/__snapshots__/component.test.jsx.snap +0 -51
- package/src/plugins/image/__tests__/__snapshots__/image-toolbar-logic.test.jsx.snap +0 -27
- package/src/plugins/image/__tests__/__snapshots__/image-toolbar.test.jsx.snap +0 -44
- package/src/plugins/math/__tests__/__snapshots__/index.test.jsx.snap +0 -48
- package/src/plugins/table/__tests__/__snapshots__/table-toolbar.test.jsx.snap +0 -44
- package/src/plugins/toolbar/__tests__/__snapshots__/default-toolbar.test.jsx.snap +0 -923
- package/src/plugins/toolbar/__tests__/__snapshots__/editor-and-toolbar.test.jsx.snap +0 -20
- package/src/plugins/toolbar/__tests__/__snapshots__/toolbar-buttons.test.jsx.snap +0 -36
- package/src/plugins/toolbar/__tests__/__snapshots__/toolbar.test.jsx.snap +0 -46
|
@@ -1,69 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.RemoveTable = exports.RemoveRow = exports.RemoveColumn = exports.AddRow = exports.AddColumn = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
fill: 'grey',
|
|
19
|
-
'&:hover': {
|
|
20
|
-
fill: 'black'
|
|
21
|
-
}
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
11
|
+
var StyledPath = (0, _styles.styled)('path')({
|
|
12
|
+
fill: 'grey',
|
|
13
|
+
'&:hover': {
|
|
14
|
+
fill: 'black'
|
|
22
15
|
}
|
|
23
|
-
};
|
|
24
|
-
|
|
16
|
+
});
|
|
25
17
|
var SvgIcon = function SvgIcon(Component) {
|
|
26
|
-
|
|
18
|
+
var SvgIconComponent = function SvgIconComponent(props) {
|
|
27
19
|
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
28
20
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
21
|
version: "1.1",
|
|
30
22
|
width: "24",
|
|
31
23
|
height: "24",
|
|
32
24
|
viewBox: "0 0 24 24"
|
|
33
|
-
}, /*#__PURE__*/_react["default"].createElement(Component,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement(Component, props));
|
|
26
|
+
};
|
|
27
|
+
SvgIconComponent.displayName = "SvgIcon(".concat(Component.displayName || Component.name || 'Component', ")");
|
|
28
|
+
return SvgIconComponent;
|
|
37
29
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return /*#__PURE__*/_react["default"].createElement("path", (0, _extends2["default"])({}, props, {
|
|
30
|
+
var AddRow = exports.AddRow = SvgIcon(function (props) {
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement(StyledPath, (0, _extends2["default"])({}, props, {
|
|
41
32
|
d: "M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z"
|
|
42
33
|
}));
|
|
43
34
|
});
|
|
44
|
-
exports.
|
|
45
|
-
|
|
46
|
-
return /*#__PURE__*/_react["default"].createElement("path", (0, _extends2["default"])({}, props, {
|
|
35
|
+
var RemoveRow = exports.RemoveRow = SvgIcon(function (props) {
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement(StyledPath, (0, _extends2["default"])({}, props, {
|
|
47
37
|
d: "M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z"
|
|
48
38
|
}));
|
|
49
39
|
});
|
|
50
|
-
exports.
|
|
51
|
-
|
|
52
|
-
return /*#__PURE__*/_react["default"].createElement("path", (0, _extends2["default"])({}, props, {
|
|
40
|
+
var AddColumn = exports.AddColumn = SvgIcon(function (props) {
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(StyledPath, (0, _extends2["default"])({}, props, {
|
|
53
42
|
d: "M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z"
|
|
54
43
|
}));
|
|
55
44
|
});
|
|
56
|
-
exports.
|
|
57
|
-
|
|
58
|
-
return /*#__PURE__*/_react["default"].createElement("path", (0, _extends2["default"])({}, props, {
|
|
45
|
+
var RemoveColumn = exports.RemoveColumn = SvgIcon(function (props) {
|
|
46
|
+
return /*#__PURE__*/_react["default"].createElement(StyledPath, (0, _extends2["default"])({}, props, {
|
|
59
47
|
d: "M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z"
|
|
60
48
|
}));
|
|
61
49
|
});
|
|
62
|
-
exports.
|
|
63
|
-
|
|
64
|
-
return /*#__PURE__*/_react["default"].createElement("path", (0, _extends2["default"])({}, props, {
|
|
50
|
+
var RemoveTable = exports.RemoveTable = SvgIcon(function (props) {
|
|
51
|
+
return /*#__PURE__*/_react["default"].createElement(StyledPath, (0, _extends2["default"])({}, props, {
|
|
65
52
|
d: "M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z"
|
|
66
53
|
}));
|
|
67
54
|
});
|
|
68
|
-
exports.RemoveTable = RemoveTable;
|
|
69
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_styles","StyledPath","styled","fill","SvgIcon","Component","SvgIconComponent","props","createElement","xmlns","version","width","height","viewBox","displayName","concat","name","AddRow","exports","_extends2","d","RemoveRow","AddColumn","RemoveColumn","RemoveTable"],"sources":["../../../../src/plugins/table/icons/index.jsx"],"sourcesContent":["import React from 'react';\nimport { styled } from '@mui/material/styles';\n\nconst StyledPath = styled('path')({\n fill: 'grey',\n '&:hover': {\n fill: 'black',\n },\n});\n\nconst SvgIcon = (Component) => {\n const SvgIconComponent = (props) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <Component {...props} />\n </svg>\n );\n SvgIconComponent.displayName = `SvgIcon(${Component.displayName || Component.name || 'Component'})`;\n return SvgIconComponent;\n};\nexport const AddRow = SvgIcon((props) => (\n <StyledPath\n {...props}\n d=\"M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z\"\n />\n));\n\nexport const RemoveRow = SvgIcon((props) => (\n <StyledPath\n {...props}\n d=\"M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z\"\n />\n));\n\nexport const AddColumn = SvgIcon((props) => (\n <StyledPath\n {...props}\n d=\"M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z\"\n />\n));\n\nexport const RemoveColumn = SvgIcon((props) => (\n <StyledPath\n {...props}\n d=\"M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z\"\n />\n));\n\nexport const RemoveTable = SvgIcon((props) => (\n <StyledPath\n {...props}\n d=\"M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z\"\n />\n));\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAME,UAAU,GAAG,IAAAC,cAAM,EAAC,MAAM,CAAC,CAAC;EAChCC,IAAI,EAAE,MAAM;EACZ,SAAS,EAAE;IACTA,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIC,SAAS,EAAK;EAC7B,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,KAAK;IAAA,oBAC7BV,MAAA,YAAAW,aAAA;MAAKC,KAAK,EAAC,4BAA4B;MAACC,OAAO,EAAC,KAAK;MAACC,KAAK,EAAC,IAAI;MAACC,MAAM,EAAC,IAAI;MAACC,OAAO,EAAC;IAAW,gBAC9FhB,MAAA,YAAAW,aAAA,CAACH,SAAS,EAAKE,KAAQ,CACpB,CAAC;EAAA,CACP;EACDD,gBAAgB,CAACQ,WAAW,cAAAC,MAAA,CAAcV,SAAS,CAACS,WAAW,IAAIT,SAAS,CAACW,IAAI,IAAI,WAAW,MAAG;EACnG,OAAOV,gBAAgB;AACzB,CAAC;AACM,IAAMW,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGb,OAAO,CAAC,UAACG,KAAK;EAAA,oBAClCV,MAAA,YAAAW,aAAA,CAACP,UAAU,MAAAkB,SAAA,iBACLZ,KAAK;IACTa,CAAC,EAAC;EAAuK,EAC1K,CAAC;AAAA,CACH,CAAC;AAEK,IAAMC,SAAS,GAAAH,OAAA,CAAAG,SAAA,GAAGjB,OAAO,CAAC,UAACG,KAAK;EAAA,oBACrCV,MAAA,YAAAW,aAAA,CAACP,UAAU,MAAAkB,SAAA,iBACLZ,KAAK;IACTa,CAAC,EAAC;EAAsO,EACzO,CAAC;AAAA,CACH,CAAC;AAEK,IAAME,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGlB,OAAO,CAAC,UAACG,KAAK;EAAA,oBACrCV,MAAA,YAAAW,aAAA,CAACP,UAAU,MAAAkB,SAAA,iBACLZ,KAAK;IACTa,CAAC,EAAC;EAAuI,EAC1I,CAAC;AAAA,CACH,CAAC;AAEK,IAAMG,YAAY,GAAAL,OAAA,CAAAK,YAAA,GAAGnB,OAAO,CAAC,UAACG,KAAK;EAAA,oBACxCV,MAAA,YAAAW,aAAA,CAACP,UAAU,MAAAkB,SAAA,iBACLZ,KAAK;IACTa,CAAC,EAAC;EAA2O,EAC9O,CAAC;AAAA,CACH,CAAC;AAEK,IAAMI,WAAW,GAAAN,OAAA,CAAAM,WAAA,GAAGpB,OAAO,CAAC,UAACG,KAAK;EAAA,oBACvCV,MAAA,YAAAW,aAAA,CAACP,UAAU,MAAAkB,SAAA,iBACLZ,KAAK;IACTa,CAAC,EAAC;EAA4U,EAC/U,CAAC;AAAA,CACH,CAAC","ignoreList":[]}
|
|
@@ -1,56 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.serialization = exports.reactAttributes = exports.parseStyleString = exports.moveFocusToBeginningOfTable = exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
11
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
12
|
var _slate = require("slate");
|
|
17
|
-
|
|
18
13
|
var _debug = _interopRequireDefault(require("debug"));
|
|
19
|
-
|
|
20
|
-
var _GridOn = _interopRequireDefault(require("@material-ui/icons/GridOn"));
|
|
21
|
-
|
|
14
|
+
var _GridOn = _interopRequireDefault(require("@mui/icons-material/GridOn"));
|
|
22
15
|
var _tableToolbar = _interopRequireDefault(require("./table-toolbar"));
|
|
23
|
-
|
|
24
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
17
|
var _slatePropTypes = _interopRequireDefault(require("slate-prop-types"));
|
|
27
|
-
|
|
28
|
-
var _styles = require("@material-ui/core/styles");
|
|
29
|
-
|
|
18
|
+
var _styles = require("@mui/material/styles");
|
|
30
19
|
var _reactAttrConverter = _interopRequireDefault(require("react-attr-converter"));
|
|
31
|
-
|
|
32
20
|
var _toStyle = require("to-style");
|
|
33
|
-
|
|
34
21
|
var _CustomTablePlugin = _interopRequireDefault(require("./CustomTablePlugin"));
|
|
35
|
-
|
|
36
|
-
function ownKeys(
|
|
37
|
-
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
-
|
|
22
|
+
var _excluded = ["node"];
|
|
23
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40
25
|
var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:table');
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
var StyledTable = (0, _styles.styled)('table')({});
|
|
27
|
+
var StyledTableCell = (0, _styles.styled)(function (_ref) {
|
|
28
|
+
var node = _ref.node,
|
|
29
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
30
|
+
var Tag = node.data.get('header') ? 'th' : 'td';
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement(Tag, props);
|
|
32
|
+
})({
|
|
33
|
+
'&': {
|
|
34
|
+
minWidth: '25px'
|
|
35
|
+
},
|
|
36
|
+
'&[data-cell-type="td"]': {
|
|
37
|
+
minWidth: '25px'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var Table = function Table(props) {
|
|
46
41
|
var nodeAttributes = dataToAttributes(props.node.data);
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
48
|
-
className: props.classes.table
|
|
49
|
-
}, props.attributes, nodeAttributes, {
|
|
42
|
+
return /*#__PURE__*/_react["default"].createElement(StyledTable, (0, _extends2["default"])({}, props.attributes, nodeAttributes, {
|
|
50
43
|
onFocus: props.onFocus,
|
|
51
44
|
onBlur: props.onBlur
|
|
52
45
|
}), /*#__PURE__*/_react["default"].createElement("tbody", null, props.children));
|
|
53
|
-
}
|
|
46
|
+
};
|
|
54
47
|
Table.propTypes = {
|
|
55
48
|
attributes: _propTypes["default"].object,
|
|
56
49
|
onFocus: _propTypes["default"].func,
|
|
@@ -58,81 +51,74 @@ Table.propTypes = {
|
|
|
58
51
|
node: _slatePropTypes["default"].node,
|
|
59
52
|
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
|
|
60
53
|
};
|
|
61
|
-
|
|
62
54
|
var TableRow = function TableRow(props) {
|
|
63
55
|
return /*#__PURE__*/_react["default"].createElement("tr", props.attributes, props.children);
|
|
64
56
|
};
|
|
65
|
-
|
|
66
57
|
TableRow.propTypes = {
|
|
67
58
|
attributes: _propTypes["default"].object,
|
|
68
59
|
onFocus: _propTypes["default"].func,
|
|
69
60
|
onBlur: _propTypes["default"].func,
|
|
70
61
|
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
|
|
71
62
|
};
|
|
72
|
-
var TableCell =
|
|
73
|
-
return {
|
|
74
|
-
td: {
|
|
75
|
-
minWidth: '25px'
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
})(function (props) {
|
|
63
|
+
var TableCell = function TableCell(props) {
|
|
79
64
|
var Tag = props.node.data.get('header') ? 'th' : 'td';
|
|
80
65
|
var nodeAttributes = dataToAttributes(props.node.data);
|
|
81
66
|
delete nodeAttributes.header;
|
|
82
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
67
|
+
return /*#__PURE__*/_react["default"].createElement(StyledTableCell, (0, _extends2["default"])({
|
|
68
|
+
as: Tag,
|
|
69
|
+
node: props.node
|
|
70
|
+
}, props.attributes, nodeAttributes, {
|
|
83
71
|
colSpan: props.node.data.get('colspan'),
|
|
84
|
-
|
|
72
|
+
"data-cell-type": Tag,
|
|
85
73
|
onFocus: props.onFocus,
|
|
86
74
|
onBlur: props.onBlur
|
|
87
75
|
}), props.children);
|
|
88
|
-
}
|
|
76
|
+
};
|
|
89
77
|
TableCell.propTypes = {
|
|
78
|
+
node: _slatePropTypes["default"].node.isRequired,
|
|
90
79
|
attributes: _propTypes["default"].object,
|
|
91
80
|
onFocus: _propTypes["default"].func,
|
|
92
81
|
onBlur: _propTypes["default"].func,
|
|
93
82
|
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
|
|
94
83
|
};
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
TableCell.propTypes = {
|
|
85
|
+
attributes: _propTypes["default"].object,
|
|
86
|
+
onFocus: _propTypes["default"].func,
|
|
87
|
+
onBlur: _propTypes["default"].func,
|
|
88
|
+
children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired
|
|
89
|
+
};
|
|
90
|
+
var moveFocusToBeginningOfTable = exports.moveFocusToBeginningOfTable = function moveFocusToBeginningOfTable(change) {
|
|
97
91
|
var addedTable = change.value.document.findDescendant(function (d) {
|
|
98
92
|
return !!d.data && !!d.data.get('newTable');
|
|
99
93
|
});
|
|
100
|
-
|
|
101
94
|
if (!addedTable) {
|
|
102
95
|
return;
|
|
103
96
|
}
|
|
104
|
-
|
|
105
97
|
change.collapseToStartOf(addedTable);
|
|
106
98
|
var update = addedTable.data.remove('newTable');
|
|
107
99
|
change.setNodeByKey(addedTable.key, {
|
|
108
100
|
data: update
|
|
109
101
|
});
|
|
110
102
|
};
|
|
103
|
+
var _default = exports["default"] = function _default(opts, toolbarPlugins /* : {toolbar: {}}[] */) {
|
|
104
|
+
var core = (0, _CustomTablePlugin["default"])(opts);
|
|
111
105
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
var _default = function _default(opts, toolbarPlugins
|
|
115
|
-
/* : {toolbar: {}}[] */
|
|
116
|
-
) {
|
|
117
|
-
var core = (0, _CustomTablePlugin["default"])(opts); // fix outdated schema
|
|
106
|
+
// fix outdated schema
|
|
118
107
|
|
|
119
108
|
if (core.schema && core.schema.blocks) {
|
|
120
109
|
Object.keys(core.schema.blocks).forEach(function (key) {
|
|
121
110
|
var block = core.schema.blocks[key];
|
|
122
|
-
|
|
123
111
|
if (block.parent) {
|
|
124
112
|
if (block.nodes[0].types) {
|
|
125
113
|
block.nodes[0] = {
|
|
126
114
|
type: block.nodes[0].types[0]
|
|
127
115
|
};
|
|
128
116
|
}
|
|
129
|
-
|
|
130
117
|
if (block.nodes[0].objects) {
|
|
131
118
|
block.nodes[0] = {
|
|
132
119
|
object: block.nodes[0].objects[0]
|
|
133
120
|
};
|
|
134
121
|
}
|
|
135
|
-
|
|
136
122
|
block.parent = {
|
|
137
123
|
type: block.parent.types[0]
|
|
138
124
|
};
|
|
@@ -143,7 +129,6 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
143
129
|
}
|
|
144
130
|
});
|
|
145
131
|
}
|
|
146
|
-
|
|
147
132
|
core.utils.getTableBlock = function (containerNode, key) {
|
|
148
133
|
var node = containerNode.getDescendant(key);
|
|
149
134
|
var ancestors = containerNode.getAncestors(key).push(node);
|
|
@@ -151,15 +136,11 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
151
136
|
return p.type === 'table';
|
|
152
137
|
});
|
|
153
138
|
};
|
|
154
|
-
|
|
155
139
|
core.utils.createTableWithOptions = function (row, columns, extra) {
|
|
156
140
|
var createdTable = core.utils.createTable(row, columns);
|
|
157
|
-
|
|
158
141
|
var newTable = _slate.Block.create(_objectSpread(_objectSpread({}, createdTable.toJSON()), extra));
|
|
159
|
-
|
|
160
142
|
return newTable;
|
|
161
143
|
};
|
|
162
|
-
|
|
163
144
|
core.toolbar = {
|
|
164
145
|
type: 'table',
|
|
165
146
|
icon: /*#__PURE__*/_react["default"].createElement(_GridOn["default"], null),
|
|
@@ -180,7 +161,6 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
180
161
|
supports: function supports(node, value) {
|
|
181
162
|
return node && node.object === 'block' && core.utils.isSelectionInTable(value);
|
|
182
163
|
},
|
|
183
|
-
|
|
184
164
|
/**
|
|
185
165
|
* Note - the node may not be a table node - it may be a node inside a table.
|
|
186
166
|
*/
|
|
@@ -188,36 +168,29 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
188
168
|
log('[customToolbar] node.data: ', node.data);
|
|
189
169
|
var tableBlock = core.utils.getTableBlock(value.document, node === null || node === void 0 ? void 0 : node.key);
|
|
190
170
|
log('[customToolbar] tableBlock: ', tableBlock);
|
|
191
|
-
|
|
192
171
|
var hasBorder = function hasBorder() {
|
|
193
172
|
return tableBlock.data.get('border') && tableBlock.data.get('border') !== '0';
|
|
194
173
|
};
|
|
195
|
-
|
|
196
174
|
var addRow = function addRow() {
|
|
197
175
|
var change = core.changes.insertRow(value.change());
|
|
198
176
|
onToolbarDone(change, false);
|
|
199
177
|
};
|
|
200
|
-
|
|
201
178
|
var addColumn = function addColumn() {
|
|
202
179
|
var change = core.changes.insertColumn(value.change());
|
|
203
180
|
onToolbarDone(change, false);
|
|
204
181
|
};
|
|
205
|
-
|
|
206
182
|
var removeRow = function removeRow() {
|
|
207
183
|
var change = core.changes.removeRow(value.change());
|
|
208
184
|
onToolbarDone(change, false);
|
|
209
185
|
};
|
|
210
|
-
|
|
211
186
|
var removeColumn = function removeColumn() {
|
|
212
187
|
var change = core.changes.removeColumn(value.change());
|
|
213
188
|
onToolbarDone(change, false);
|
|
214
189
|
};
|
|
215
|
-
|
|
216
190
|
var removeTable = function removeTable() {
|
|
217
191
|
var change = core.changes.removeTable(value.change());
|
|
218
192
|
onToolbarDone(change, false);
|
|
219
193
|
};
|
|
220
|
-
|
|
221
194
|
var toggleBorder = function toggleBorder() {
|
|
222
195
|
var data = tableBlock.data;
|
|
223
196
|
var update = data.set('border', hasBorder() ? '0' : '1');
|
|
@@ -227,12 +200,10 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
227
200
|
});
|
|
228
201
|
onToolbarDone(change, false);
|
|
229
202
|
};
|
|
230
|
-
|
|
231
203
|
var onDone = function onDone() {
|
|
232
204
|
log('[onDone] call onToolbarDone...');
|
|
233
205
|
onToolbarDone(null, true);
|
|
234
206
|
};
|
|
235
|
-
|
|
236
207
|
var Tb = function Tb() {
|
|
237
208
|
return /*#__PURE__*/_react["default"].createElement(_tableToolbar["default"], {
|
|
238
209
|
getFocusedValue: getFocusedValue,
|
|
@@ -251,11 +222,9 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
251
222
|
onDone: onDone
|
|
252
223
|
});
|
|
253
224
|
};
|
|
254
|
-
|
|
255
225
|
return Tb;
|
|
256
226
|
}
|
|
257
227
|
};
|
|
258
|
-
|
|
259
228
|
var Node = function Node(props) {
|
|
260
229
|
switch (props.node.type) {
|
|
261
230
|
case 'table':
|
|
@@ -263,25 +232,20 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
263
232
|
onFocus: opts.onFocus,
|
|
264
233
|
onBlur: opts.onBlur
|
|
265
234
|
}));
|
|
266
|
-
|
|
267
235
|
case 'table_row':
|
|
268
236
|
return /*#__PURE__*/_react["default"].createElement(TableRow, props);
|
|
269
|
-
|
|
270
237
|
case 'table_cell':
|
|
271
238
|
return /*#__PURE__*/_react["default"].createElement(TableCell, (0, _extends2["default"])({}, props, {
|
|
272
239
|
onFocus: opts.onFocus,
|
|
273
240
|
onBlur: opts.onBlur
|
|
274
241
|
}));
|
|
275
|
-
|
|
276
242
|
default:
|
|
277
243
|
return null;
|
|
278
244
|
}
|
|
279
245
|
};
|
|
280
|
-
|
|
281
246
|
Node.propTypes = {
|
|
282
247
|
node: _propTypes["default"].object
|
|
283
248
|
};
|
|
284
|
-
|
|
285
249
|
core.normalizeNode = function (node) {
|
|
286
250
|
var addNodeBeforeArray = [];
|
|
287
251
|
if (node.object !== 'document') return;
|
|
@@ -290,7 +254,6 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
290
254
|
var tablePath = node.getPath(d.key);
|
|
291
255
|
var prevNode = node.getPreviousNode(tablePath);
|
|
292
256
|
var nextNode = node.getNextNode(tablePath);
|
|
293
|
-
|
|
294
257
|
if (!prevNode || !nextNode) {
|
|
295
258
|
addNodeBeforeArray.push({
|
|
296
259
|
node: d,
|
|
@@ -300,29 +263,25 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
300
263
|
}
|
|
301
264
|
}
|
|
302
265
|
});
|
|
303
|
-
|
|
304
266
|
if (!addNodeBeforeArray.length) {
|
|
305
267
|
return;
|
|
306
268
|
}
|
|
307
|
-
|
|
308
269
|
return function (change) {
|
|
309
270
|
var newBlock = {
|
|
310
271
|
object: 'block',
|
|
311
272
|
type: 'div'
|
|
312
273
|
};
|
|
313
274
|
addNodeBeforeArray.forEach(function (n) {
|
|
314
|
-
var tablePath = change.value.document.getPath(n.node.key).toJSON();
|
|
315
|
-
|
|
275
|
+
var tablePath = change.value.document.getPath(n.node.key).toJSON();
|
|
276
|
+
// removing tableIndex
|
|
316
277
|
var indexToAdd = tablePath.splice(-1)[0];
|
|
317
|
-
|
|
318
278
|
if (!n.prevNode) {
|
|
319
279
|
// inserting block key before table
|
|
320
|
-
change.insertNodeByPath(tablePath, indexToAdd, newBlock);
|
|
280
|
+
change.insertNodeByPath(tablePath, indexToAdd, newBlock);
|
|
281
|
+
// this will trigger another normalization, which will figure out if there's not
|
|
321
282
|
// a block after the table and add it, so we exit for now
|
|
322
|
-
|
|
323
283
|
return;
|
|
324
284
|
}
|
|
325
|
-
|
|
326
285
|
if (!n.nextNode) {
|
|
327
286
|
// inserting block key after table
|
|
328
287
|
change.insertNodeByPath(tablePath, indexToAdd + 1, newBlock);
|
|
@@ -330,41 +289,28 @@ var _default = function _default(opts, toolbarPlugins
|
|
|
330
289
|
});
|
|
331
290
|
};
|
|
332
291
|
};
|
|
333
|
-
|
|
334
292
|
core.renderNode = Node;
|
|
335
293
|
core.name = 'table';
|
|
336
294
|
return core;
|
|
337
295
|
};
|
|
338
|
-
|
|
339
|
-
exports["default"] = _default;
|
|
340
|
-
|
|
341
|
-
var parseStyleString = function parseStyleString(s) {
|
|
296
|
+
var parseStyleString = exports.parseStyleString = function parseStyleString(s) {
|
|
342
297
|
var regex = /([\w-]*)\s*:\s*([^;]*)/g;
|
|
343
298
|
var match;
|
|
344
299
|
var result = {};
|
|
345
|
-
|
|
346
300
|
while (match = regex.exec(s)) {
|
|
347
301
|
result[match[1]] = match[2].trim();
|
|
348
302
|
}
|
|
349
|
-
|
|
350
303
|
return result;
|
|
351
304
|
};
|
|
352
|
-
|
|
353
|
-
exports.parseStyleString = parseStyleString;
|
|
354
|
-
|
|
355
|
-
var reactAttributes = function reactAttributes(o) {
|
|
305
|
+
var reactAttributes = exports.reactAttributes = function reactAttributes(o) {
|
|
356
306
|
return (0, _toStyle.object)(o, {
|
|
357
307
|
camelize: true,
|
|
358
308
|
addUnits: false
|
|
359
309
|
});
|
|
360
310
|
};
|
|
361
|
-
|
|
362
|
-
exports.reactAttributes = reactAttributes;
|
|
363
|
-
|
|
364
311
|
var attributesToMap = function attributesToMap(el) {
|
|
365
312
|
return function (acc, attribute) {
|
|
366
313
|
var value = el.getAttribute(attribute);
|
|
367
|
-
|
|
368
314
|
if (value) {
|
|
369
315
|
if (attribute === 'style') {
|
|
370
316
|
var styleString = el.getAttribute(attribute);
|
|
@@ -374,31 +320,25 @@ var attributesToMap = function attributesToMap(el) {
|
|
|
374
320
|
acc[attribute] = el.getAttribute(attribute);
|
|
375
321
|
}
|
|
376
322
|
}
|
|
377
|
-
|
|
378
323
|
return acc;
|
|
379
324
|
};
|
|
380
325
|
};
|
|
381
|
-
|
|
382
326
|
var dataToAttributes = function dataToAttributes(data) {
|
|
383
327
|
if (!data || !data.get) {
|
|
384
328
|
return {};
|
|
385
329
|
}
|
|
386
|
-
|
|
387
330
|
return data.reduce(function (acc, v, name) {
|
|
388
331
|
if (v) {
|
|
389
332
|
acc[(0, _reactAttrConverter["default"])(name)] = v;
|
|
390
333
|
}
|
|
391
|
-
|
|
392
334
|
return acc;
|
|
393
335
|
}, {});
|
|
394
336
|
};
|
|
395
|
-
|
|
396
337
|
var attributes = ['border', 'cellpadding', 'cellspacing', 'class', 'style'];
|
|
397
338
|
var cellAttributes = ['colspan', 'rowspan', 'class', 'style'];
|
|
398
|
-
var serialization = {
|
|
339
|
+
var serialization = exports.serialization = {
|
|
399
340
|
deserialize: function deserialize(el, next) {
|
|
400
341
|
var tag = el.tagName.toLowerCase();
|
|
401
|
-
|
|
402
342
|
switch (tag) {
|
|
403
343
|
case 'table':
|
|
404
344
|
{
|
|
@@ -411,7 +351,6 @@ var serialization = {
|
|
|
411
351
|
data: attributes.reduce(attributesToMap(el), {})
|
|
412
352
|
};
|
|
413
353
|
}
|
|
414
|
-
|
|
415
354
|
case 'th':
|
|
416
355
|
{
|
|
417
356
|
return {
|
|
@@ -423,7 +362,6 @@ var serialization = {
|
|
|
423
362
|
})
|
|
424
363
|
};
|
|
425
364
|
}
|
|
426
|
-
|
|
427
365
|
case 'tr':
|
|
428
366
|
{
|
|
429
367
|
return {
|
|
@@ -432,7 +370,6 @@ var serialization = {
|
|
|
432
370
|
nodes: next(Array.from(el.children))
|
|
433
371
|
};
|
|
434
372
|
}
|
|
435
|
-
|
|
436
373
|
case 'td':
|
|
437
374
|
{
|
|
438
375
|
return {
|
|
@@ -450,26 +387,20 @@ var serialization = {
|
|
|
450
387
|
if (object.object !== 'block') {
|
|
451
388
|
return;
|
|
452
389
|
}
|
|
453
|
-
|
|
454
390
|
switch (object.type) {
|
|
455
391
|
case 'table':
|
|
456
392
|
{
|
|
457
393
|
var _attributes = dataToAttributes(object.data);
|
|
458
|
-
|
|
459
394
|
return /*#__PURE__*/_react["default"].createElement("table", _attributes, /*#__PURE__*/_react["default"].createElement("tbody", null, children));
|
|
460
395
|
}
|
|
461
|
-
|
|
462
396
|
case 'table_row':
|
|
463
397
|
{
|
|
464
398
|
return /*#__PURE__*/_react["default"].createElement("tr", null, children);
|
|
465
399
|
}
|
|
466
|
-
|
|
467
400
|
case 'table_cell':
|
|
468
401
|
{
|
|
469
402
|
var _attributes2 = dataToAttributes(object.data);
|
|
470
|
-
|
|
471
403
|
delete _attributes2.header;
|
|
472
|
-
|
|
473
404
|
if (object.data.get('header')) {
|
|
474
405
|
return /*#__PURE__*/_react["default"].createElement("th", _attributes2, children);
|
|
475
406
|
} else {
|
|
@@ -479,5 +410,4 @@ var serialization = {
|
|
|
479
410
|
}
|
|
480
411
|
}
|
|
481
412
|
};
|
|
482
|
-
exports.serialization = serialization;
|
|
483
413
|
//# sourceMappingURL=index.js.map
|