@modusoperandi/licit 1.4.10 → 1.6.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/client/Licit.js CHANGED
@@ -1,6 +1,10 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
5
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
6
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
7
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
4
8
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
9
  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; }
6
10
  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) { _defineProperty(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; }
@@ -359,7 +363,7 @@ var Licit = /*#__PURE__*/function (_React$Component) {
359
363
  }, {
360
364
  key: "getEffectivePlugins",
361
365
  value: function getEffectivePlugins(schema, defaultPlugins, plugins) {
362
- var effectivePlugins = defaultPlugins;
366
+ var effectivePlugins = _toConsumableArray(defaultPlugins);
363
367
  var pasteJSONPlugin = null;
364
368
  if (plugins) {
365
369
  var _iterator = _createForOfIteratorHelper(plugins),
@@ -373,7 +377,12 @@ var Licit = /*#__PURE__*/function (_React$Component) {
373
377
  schema = p.getEffectiveSchema(schema);
374
378
  }
375
379
  if (p.initKeyCommands) {
376
- effectivePlugins.push(p.initKeyCommands());
380
+ var keyCommandPlugins = p.initKeyCommands();
381
+ if (Array.isArray(keyCommandPlugins)) {
382
+ effectivePlugins.push.apply(effectivePlugins, _toConsumableArray(keyCommandPlugins));
383
+ } else if (keyCommandPlugins) {
384
+ effectivePlugins.push(keyCommandPlugins);
385
+ }
377
386
  }
378
387
  if (p.insert) {
379
388
  pasteJSONPlugin = p;
@@ -204,35 +204,42 @@ class Licit extends React.Component<any, any> {
204
204
  return editorState;
205
205
  }
206
206
 
207
- getEffectivePlugins(
208
- schema: Schema,
209
- defaultPlugins: Array<Plugin>,
210
- plugins: Array<Plugin>
211
- ): { plugins: Array<Plugin>, schema: Schema, pasteJSONPlugin: Plugin } {
212
- const effectivePlugins = defaultPlugins;
213
- let pasteJSONPlugin = null;
214
-
215
- if (plugins) {
216
- for (const p of plugins) {
217
- if (!effectivePlugins.includes(p)) {
218
- effectivePlugins.push(p);
219
- if (p.getEffectiveSchema) {
220
- schema = p.getEffectiveSchema(schema);
221
- }
207
+ getEffectivePlugins(
208
+ schema: Schema,
209
+ defaultPlugins: Array<Plugin>,
210
+ plugins: Array<Plugin>
211
+ ): { plugins: Array<Plugin>; schema: Schema; pasteJSONPlugin: Plugin | null } {
212
+ const effectivePlugins = [...defaultPlugins];
213
+ let pasteJSONPlugin: Plugin | null = null;
214
+
215
+ if (plugins) {
216
+ for (const p of plugins) {
217
+ if (!effectivePlugins.includes(p)) {
218
+ effectivePlugins.push(p);
219
+
220
+ if (p.getEffectiveSchema) {
221
+ schema = p.getEffectiveSchema(schema);
222
+ }
222
223
 
223
- if (p.initKeyCommands) {
224
- effectivePlugins.push(p.initKeyCommands());
224
+ if (p.initKeyCommands) {
225
+ const keyCommandPlugins = p.initKeyCommands();
226
+ if (Array.isArray(keyCommandPlugins)) {
227
+ effectivePlugins.push(...keyCommandPlugins);
228
+ } else if (keyCommandPlugins) {
229
+ effectivePlugins.push(keyCommandPlugins);
225
230
  }
231
+ }
226
232
 
227
- if (p.insert) {
228
- pasteJSONPlugin = p;
229
- }
233
+ if (p.insert) {
234
+ pasteJSONPlugin = p;
230
235
  }
231
236
  }
232
237
  }
233
- return { plugins: effectivePlugins, schema, pasteJSONPlugin };
234
238
  }
235
239
 
240
+ return { plugins: effectivePlugins, schema, pasteJSONPlugin };
241
+ }
242
+
236
243
  // [FS] IRAD-1578 2021-09-27
237
244
  onReady(state: EditorState) {
238
245
  const collabEditing = this.state.docID !== '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modusoperandi/licit",
3
- "version": "1.4.10",
3
+ "version": "1.6.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "subversion": "1",
@@ -51,54 +51,54 @@
51
51
  "webfontloader": "^1.6.28"
52
52
  },
53
53
  "devDependencies": {
54
- "@babel/cli": "^7.28.3",
55
- "@babel/core": "^7.28.5",
56
- "@babel/eslint-parser": "^7.28.5",
54
+ "@babel/cli": "^7.28.6",
55
+ "@babel/core": "^7.28.6",
56
+ "@babel/eslint-parser": "^7.28.6",
57
57
  "@babel/plugin-proposal-class-properties": "^7.18.6",
58
- "@babel/plugin-proposal-decorators": "^7.28.0",
59
- "@babel/plugin-proposal-do-expressions": "^7.28.3",
58
+ "@babel/plugin-proposal-decorators": "^7.28.6",
59
+ "@babel/plugin-proposal-do-expressions": "^7.28.6",
60
60
  "@babel/plugin-proposal-export-default-from": "^7.27.1",
61
61
  "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
62
62
  "@babel/plugin-proposal-function-sent": "^7.27.1",
63
63
  "@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",
64
64
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
65
- "@babel/plugin-proposal-pipeline-operator": "^7.27.1",
65
+ "@babel/plugin-proposal-pipeline-operator": "^7.28.6",
66
66
  "@babel/plugin-proposal-throw-expressions": "^7.27.1",
67
67
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
68
68
  "@babel/plugin-syntax-import-meta": "^7.10.4",
69
69
  "@babel/plugin-transform-flow-strip-types": "^7.27.1",
70
70
  "@babel/plugin-transform-parameters": "^7.27.7",
71
71
  "@babel/plugin-transform-runtime": "^7.28.5",
72
- "@babel/preset-env": "^7.28.5",
72
+ "@babel/preset-env": "^7.28.6",
73
73
  "@babel/preset-flow": "^7.27.1",
74
74
  "@babel/preset-react": "^7.28.5",
75
75
  "babel-jest": "^30.2.0",
76
76
  "babel-loader": "^10.0.0",
77
77
  "babel-plugin-flow-react-proptypes": "^26.0.0",
78
78
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
79
- "body-parser": "^2.2.0",
79
+ "body-parser": "^2.2.2",
80
80
  "clean-webpack-plugin": "^4.0.0",
81
81
  "copy-webpack-plugin": "^13.0.1",
82
82
  "copyfiles": "^2.4.1",
83
- "cors": "^2.8.5",
84
- "css-loader": "^7.1.2",
85
- "eslint": "^9.39.1",
83
+ "cors": "^2.8.6",
84
+ "css-loader": "^7.1.3",
85
+ "eslint": "^9.39.2",
86
86
  "eslint-config-prettier": "^10.1.8",
87
- "eslint-plugin-jest": "^29.1.0",
88
- "eslint-plugin-prettier": "^5.5.4",
87
+ "eslint-plugin-jest": "^29.12.1",
88
+ "eslint-plugin-prettier": "^5.5.5",
89
89
  "eslint-plugin-react": "^7.37.5",
90
90
  "exports-loader": "^5.0.0",
91
- "express": "^5.1.0",
91
+ "express": "^5.2.1",
92
92
  "file-loader": "^6.2.0",
93
- "flow-bin": "^0.290.0",
93
+ "flow-bin": "^0.298.0",
94
94
  "flow-copy-source": "^2.0.9",
95
95
  "flow-typed": "^4.1.1",
96
96
  "flow-webpack-plugin": "^1.2.0",
97
97
  "formidable": "^3.5.4",
98
- "globals": "^16.5.0",
98
+ "globals": "^17.2.0",
99
99
  "html-loader": "^5.1.0",
100
100
  "html-webpack-inline-source-plugin": "1.0.0-beta.2",
101
- "html-webpack-plugin": "^5.6.4",
101
+ "html-webpack-plugin": "^5.6.6",
102
102
  "husky": "^9.1.7",
103
103
  "identity-obj-proxy": "^3.0.0",
104
104
  "jest": "^29.7.0",
@@ -106,22 +106,22 @@
106
106
  "jest-junit": "^16.0.0",
107
107
  "jest-prosemirror": "^3.0.1",
108
108
  "jest-sonar-reporter": "^2.0.0",
109
- "lint-staged": "^16.2.6",
109
+ "lint-staged": "^16.2.7",
110
110
  "mkdirp": "^3.0.1",
111
111
  "mv": "^2.1.1",
112
- "prettier": "^3.6.2",
112
+ "prettier": "^3.8.1",
113
113
  "style-loader": "^4.0.0",
114
- "stylelint": "^16.25.0",
114
+ "stylelint": "^16.26.1",
115
115
  "stylelint-config-standard": "^39.0.1",
116
116
  "stylelint-prettier": "^5.0.3",
117
- "terser-webpack-plugin": "^5.3.14",
118
- "ts-jest": "^29.4.5",
117
+ "terser-webpack-plugin": "^5.3.16",
118
+ "ts-jest": "^29.4.6",
119
119
  "ts-loader": "^9.5.4",
120
120
  "ts-node": "^10.9.2",
121
121
  "typescript": "5.9.3",
122
- "webpack": "^5.102.1",
122
+ "webpack": "^5.104.1",
123
123
  "webpack-cli": "^6.0.1",
124
- "webpack-dev-server": "^5.2.2",
124
+ "webpack-dev-server": "^5.2.3",
125
125
  "write-file-webpack-plugin": "^4.5.1"
126
126
  },
127
127
  "importSort": {
@@ -6,7 +6,7 @@
6
6
  import convertToCSSPTValue from './convertToCSSPTValue.js';
7
7
  export function toClosestFontPtSize(styleValue) {
8
8
  // duplicated FONT_PT_SIZES(available in ./ui/FontSizeCommandMenuButton)
9
- var FONT_PT_SIZES = [8, 9, 10, 11, 12, 14, 18, 24, 30, 36, 48, 60, 72, 90];
9
+ var FONT_PT_SIZES = [6, 6.5, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 30, 36, 48, 60, 72, 90];
10
10
  var originalPTValue = convertToCSSPTValue(styleValue);
11
11
  if (FONT_PT_SIZES.includes(originalPTValue)) {
12
12
  return originalPTValue;
@@ -7,7 +7,26 @@ import convertToCSSPTValue from './convertToCSSPTValue.js';
7
7
 
8
8
  export function toClosestFontPtSize(styleValue: string): number {
9
9
  // duplicated FONT_PT_SIZES(available in ./ui/FontSizeCommandMenuButton)
10
- const FONT_PT_SIZES = [8, 9, 10, 11, 12, 14, 18, 24, 30, 36, 48, 60, 72, 90];
10
+ const FONT_PT_SIZES = [6,
11
+ 6.5,
12
+ 7,
13
+ 8,
14
+ 9,
15
+ 10,
16
+ 11,
17
+ 12,
18
+ 14,
19
+ 16,
20
+ 18,
21
+ 20,
22
+ 22,
23
+ 24,
24
+ 30,
25
+ 36,
26
+ 48,
27
+ 60,
28
+ 72,
29
+ 90,];
11
30
  const originalPTValue = convertToCSSPTValue(styleValue);
12
31
 
13
32
  if (FONT_PT_SIZES.includes(originalPTValue)) {
@@ -47,6 +47,7 @@ var CLEAR_FORMAT = EditorCommands.CLEAR_FORMAT,
47
47
  TABLE_ADD_ROW_AFTER = EditorCommands.TABLE_ADD_ROW_AFTER,
48
48
  TABLE_ADD_ROW_BEFORE = EditorCommands.TABLE_ADD_ROW_BEFORE,
49
49
  TABLE_BORDER_COLOR = EditorCommands.TABLE_BORDER_COLOR,
50
+ TABLE_DETAILS = EditorCommands.TABLE_DETAILS,
50
51
  TABLE_BACKGROUND_COLOR = EditorCommands.TABLE_BACKGROUND_COLOR,
51
52
  TABLE_DELETE_COLUMN = EditorCommands.TABLE_DELETE_COLUMN,
52
53
  TABLE_DELETE_ROW = EditorCommands.TABLE_DELETE_ROW,
@@ -90,6 +91,8 @@ export var TABLE_COMMANDS_GROUP = [{
90
91
  'Toggle Header Cells': TABLE_TOGGLE_HEADER_CELL
91
92
  }, {
92
93
  'Delete Table': TABLE_DELETE_TABLE
94
+ }, {
95
+ 'Container Dimensions': TABLE_DETAILS
93
96
  }];
94
97
 
95
98
  // [FS] IRAD-1012 2020-07-14
@@ -51,6 +51,7 @@ const {
51
51
  TABLE_ADD_ROW_AFTER,
52
52
  TABLE_ADD_ROW_BEFORE,
53
53
  TABLE_BORDER_COLOR,
54
+ TABLE_DETAILS,
54
55
  TABLE_BACKGROUND_COLOR,
55
56
  TABLE_DELETE_COLUMN,
56
57
  TABLE_DELETE_ROW,
@@ -103,6 +104,9 @@ export const TABLE_COMMANDS_GROUP = [
103
104
  {
104
105
  'Delete Table': TABLE_DELETE_TABLE,
105
106
  },
107
+ {
108
+ 'Container Dimensions': TABLE_DETAILS,
109
+ },
106
110
  ];
107
111
 
108
112
  // [FS] IRAD-1012 2020-07-14
@@ -19,7 +19,7 @@ import * as React from 'react';
19
19
  import { FontSizeCommand } from '@modusoperandi/licit-ui-commands';
20
20
  import CommandMenuButton from './CommandMenuButton.js';
21
21
  import findActiveFontSize from './findActiveFontSize.js';
22
- export var FONT_PT_SIZES = [8, 9, 10, 11, 12, 14, 18, 24, 30, 36, 48, 60, 72, 90];
22
+ export var FONT_PT_SIZES = [6, 6.5, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 30, 36, 48, 60, 72, 90];
23
23
  var FONT_PT_SIZE_COMMANDS = FONT_PT_SIZES.reduce(function (memo, size) {
24
24
  memo[" ".concat(size, " ")] = new FontSizeCommand(size);
25
25
  return memo;
@@ -5,18 +5,24 @@ import { Transform } from 'prosemirror-transform';
5
5
  import { EditorView } from 'prosemirror-view';
6
6
  import * as React from 'react';
7
7
 
8
- import {FontSizeCommand} from '@modusoperandi/licit-ui-commands';
8
+ import { FontSizeCommand } from '@modusoperandi/licit-ui-commands';
9
9
  import CommandMenuButton from './CommandMenuButton.js';
10
10
  import findActiveFontSize from './findActiveFontSize.js';
11
11
 
12
12
  export const FONT_PT_SIZES = [
13
+ 6,
14
+ 6.5,
15
+ 7,
13
16
  8,
14
17
  9,
15
18
  10,
16
19
  11,
17
20
  12,
18
21
  14,
22
+ 16,
19
23
  18,
24
+ 20,
25
+ 22,
20
26
  24,
21
27
  30,
22
28
  36,
@@ -0,0 +1,63 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
3
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
4
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
5
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
6
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
7
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
8
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
10
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
11
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ import * as React from 'react';
16
+ var TableDetails = /*#__PURE__*/function (_React$PureComponent) {
17
+ function TableDetails() {
18
+ var _this;
19
+ _classCallCheck(this, TableDetails);
20
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ args[_key] = arguments[_key];
22
+ }
23
+ _this = _callSuper(this, TableDetails, [].concat(args));
24
+ _defineProperty(_this, "props", void 0);
25
+ return _this;
26
+ }
27
+ _inherits(TableDetails, _React$PureComponent);
28
+ return _createClass(TableDetails, [{
29
+ key: "render",
30
+ value: function render() {
31
+ var _this$props = this.props,
32
+ table = _this$props.table,
33
+ cell = _this$props.cell,
34
+ close = _this$props.close;
35
+ return /*#__PURE__*/React.createElement("div", {
36
+ className: "czi-table-details-popup"
37
+ }, /*#__PURE__*/React.createElement("div", {
38
+ className: "czi-table-details-header"
39
+ }, /*#__PURE__*/React.createElement("span", null, "Table Details"), /*#__PURE__*/React.createElement("button", {
40
+ className: "czi-table-details-close",
41
+ onClick: function onClick() {
42
+ return close && close();
43
+ },
44
+ title: "Close"
45
+ }, "\u2715")), /*#__PURE__*/React.createElement("div", {
46
+ className: "czi-table-details-section"
47
+ }, /*#__PURE__*/React.createElement("div", {
48
+ className: "czi-row"
49
+ }, /*#__PURE__*/React.createElement("span", null, "Table Width"), /*#__PURE__*/React.createElement("strong", null, table.width, "px")), /*#__PURE__*/React.createElement("div", {
50
+ className: "czi-row"
51
+ }, /*#__PURE__*/React.createElement("span", null, "Table Height"), /*#__PURE__*/React.createElement("strong", null, table.height, "px"))), cell && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
52
+ className: "czi-divider"
53
+ }), /*#__PURE__*/React.createElement("div", {
54
+ className: "czi-table-details-section"
55
+ }, /*#__PURE__*/React.createElement("div", {
56
+ className: "czi-row"
57
+ }, /*#__PURE__*/React.createElement("span", null, "Cell Width"), /*#__PURE__*/React.createElement("strong", null, cell.width, "px")), /*#__PURE__*/React.createElement("div", {
58
+ className: "czi-row"
59
+ }, /*#__PURE__*/React.createElement("span", null, "Cell Height"), /*#__PURE__*/React.createElement("strong", null, cell.height, "px")))));
60
+ }
61
+ }]);
62
+ }(React.PureComponent);
63
+ export default TableDetails;
@@ -0,0 +1,68 @@
1
+ // @flow
2
+
3
+ import * as React from 'react';
4
+
5
+ class TableDetails extends React.PureComponent<any, any> {
6
+ props: {
7
+ close?: () => void,
8
+ table: {
9
+ width: number,
10
+ height: number,
11
+ },
12
+ cell?: {
13
+ width: number,
14
+ height: number,
15
+ },
16
+ };
17
+
18
+ render(): React.Element<any> {
19
+ const { table, cell, close } = this.props;
20
+
21
+ return (
22
+ <div className="czi-table-details-popup">
23
+ <div className="czi-table-details-header">
24
+ <span>Table Details</span>
25
+
26
+ <button
27
+ className="czi-table-details-close"
28
+ onClick={() => close && close()}
29
+ title="Close"
30
+ >
31
+
32
+ </button>
33
+ </div>
34
+
35
+ <div className="czi-table-details-section">
36
+ <div className="czi-row">
37
+ <span>Table Width</span>
38
+ <strong>{table.width}px</strong>
39
+ </div>
40
+ <div className="czi-row">
41
+ <span>Table Height</span>
42
+ <strong>{table.height}px</strong>
43
+ </div>
44
+ </div>
45
+
46
+ {cell && (
47
+ <>
48
+ <div className="czi-divider" />
49
+
50
+ <div className="czi-table-details-section">
51
+ <div className="czi-row">
52
+ <span>Cell Width</span>
53
+ <strong>{cell.width}px</strong>
54
+ </div>
55
+ <div className="czi-row">
56
+ <span>Cell Height</span>
57
+ <strong>{cell.height}px</strong>
58
+ </div>
59
+ </div>
60
+ </>
61
+ )}
62
+ </div>
63
+ );
64
+ }
65
+
66
+ }
67
+
68
+ export default TableDetails;
@@ -40,7 +40,7 @@ var TableNodeView = /*#__PURE__*/function (_TableView) {
40
40
  }, {
41
41
  key: "_updateAttrs",
42
42
  value: function _updateAttrs(node) {
43
- var _node$attrs, _node$attrs2, _node$attrs3;
43
+ var _node$attrs, _node$attrs2, _node$attrs3, _node$attrs4;
44
44
  // Handle marginLeft
45
45
  var marginLeft = ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.marginLeft) || 0;
46
46
  this.table.style.marginLeft = marginLeft ? "".concat(marginLeft, "px") : '';
@@ -56,6 +56,11 @@ var TableNodeView = /*#__PURE__*/function (_TableView) {
56
56
  } else {
57
57
  this.table.removeAttribute('dirty');
58
58
  }
59
+ if ((_node$attrs4 = node.attrs) !== null && _node$attrs4 !== void 0 && _node$attrs4.coverPage) {
60
+ this.table.setAttribute('data-cover-page', 'true');
61
+ } else {
62
+ this.table.removeAttribute('data-cover-page');
63
+ }
59
64
  }
60
65
  }]);
61
66
  }(TableView);
@@ -32,5 +32,10 @@ export default class TableNodeView extends TableView {
32
32
  } else {
33
33
  this.table.removeAttribute('dirty');
34
34
  }
35
+ if (node.attrs?.coverPage) {
36
+ this.table.setAttribute('data-cover-page', 'true');
37
+ } else {
38
+ this.table.removeAttribute('data-cover-page');
39
+ }
35
40
  }
36
41
  }
@@ -3,10 +3,10 @@
3
3
  border-radius: 0;
4
4
  display: block;
5
5
  margin: 0;
6
- padding-bottom: 8px;
6
+ padding-bottom: 6px;
7
7
  padding-left: 20px;
8
8
  padding-right: 20px;
9
- padding-top: 8px;
9
+ padding-top: 5px;
10
10
  }
11
11
 
12
12
  .czi-custom-menu-item.czi-custom-button:hover {
package/ui/czi-table.css CHANGED
@@ -32,6 +32,15 @@
32
32
  vertical-align: top;
33
33
  }
34
34
 
35
+ .ProseMirror table[data-cover-page="true"] td,
36
+ .ProseMirror table[data-cover-page="true"] th {
37
+ padding: 4px;
38
+ }
39
+
40
+ table[data-cover-page="true"].molm-czi-image-view.align-center {
41
+ margin: 0 0 -18px;
42
+ }
43
+
35
44
  .ProseMirror th {
36
45
  background-color: var(--czi-table-header-background-color);
37
46
  font-weight: bold;
@@ -81,6 +90,62 @@ Rezie cursor position issue fixed. */
81
90
  z-index: 2;
82
91
  }
83
92
 
93
+ .czi-table-details-popup {
94
+ min-width: 220px;
95
+ background: #fff;
96
+ border-radius: 6px;
97
+ box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
98
+ font-size: 12px;
99
+ color: #1f2937;
100
+ }
101
+
102
+ .czi-table-details-header {
103
+ display: flex;
104
+ justify-content: space-between;
105
+ align-items: center;
106
+ padding: 8px 12px;
107
+ font-weight: 600;
108
+ background: #f8fafc;
109
+ border-bottom: 1px solid #e5e7eb;
110
+ }
111
+
112
+ .czi-table-details-close {
113
+ background: none;
114
+ border: none;
115
+ cursor: pointer;
116
+ font-size: 14px;
117
+ line-height: 1;
118
+ color: #555;
119
+ }
120
+
121
+ .czi-table-details-close:hover {
122
+ color: #000;
123
+ }
124
+
125
+ .czi-table-details-section {
126
+ padding: 8px 12px;
127
+ }
128
+
129
+ .czi-row {
130
+ display: flex;
131
+ justify-content: space-between;
132
+ margin: 4px 0;
133
+ }
134
+
135
+ .czi-row span {
136
+ color: #555;
137
+ }
138
+
139
+ .czi-row strong {
140
+ font-weight: 600;
141
+ }
142
+
143
+ .czi-divider {
144
+ height: 1px;
145
+ background: #e5e7eb;
146
+ margin: 4px 0;
147
+ }
148
+
84
149
 
85
150
  @media only print {
86
151
  .ProseMirror table {