@progress/kendo-editor-common 1.10.0-dev.202307170654 → 1.10.0-dev.202307181205

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/dist/es/align.js CHANGED
@@ -10,12 +10,11 @@ export var alignBlocks = function (actions, commandName) { return function (stat
10
10
  tr.setMeta('commandName', commandName);
11
11
  blocks.forEach(function (node) {
12
12
  if (node.type.isTextblock) {
13
- var newAttrs = {};
14
13
  var action = actions.find(function (n) { return n.node === node.type.name; });
15
14
  if (action) {
16
- newAttrs = addStyles(node, action.style);
15
+ var newAttrs = addStyles(node, action.style);
16
+ changeTextBlock(tr, node, node.type, newAttrs);
17
17
  }
18
- changeTextBlock(tr, node, node.type, newAttrs);
19
18
  }
20
19
  });
21
20
  var result = tr.docChanged;
@@ -3,21 +3,26 @@ var style = function (name, value) {
3
3
  };
4
4
  export var alignLeftRules = [
5
5
  { node: 'paragraph', style: [style('text-align', 'left')] },
6
- { node: 'heading', style: [style('text-align', 'left')] }
6
+ { node: 'heading', style: [style('text-align', 'left')] },
7
+ { node: 'table_caption_external', style: [style('text-align', 'left')] }
7
8
  ];
8
9
  export var alignRightRules = [
9
10
  { node: 'paragraph', style: [style('text-align', 'right')] },
10
- { node: 'heading', style: [style('text-align', 'right')] }
11
+ { node: 'heading', style: [style('text-align', 'right')] },
12
+ { node: 'table_caption_external', style: [style('text-align', 'right')] }
11
13
  ];
12
14
  export var alignCenterRules = [
13
15
  { node: 'paragraph', style: [style('text-align', 'center')] },
14
- { node: 'heading', style: [style('text-align', 'center')] }
16
+ { node: 'heading', style: [style('text-align', 'center')] },
17
+ { node: 'table_caption_external', style: [style('text-align', 'center')] }
15
18
  ];
16
19
  export var alignJustifyRules = [
17
20
  { node: 'paragraph', style: [style('text-align', 'justify')] },
18
- { node: 'heading', style: [style('text-align', 'justify')] }
21
+ { node: 'heading', style: [style('text-align', 'justify')] },
22
+ { node: 'table_caption_external', style: [style('text-align', 'justify')] }
19
23
  ];
20
24
  export var alignRemoveRules = [
21
25
  { node: 'paragraph', style: [style('text-align', '')] },
22
- { node: 'heading', style: [style('text-align', '')] }
26
+ { node: 'heading', style: [style('text-align', '')] },
27
+ { node: 'table_caption_external', style: [style('text-align', '')] }
23
28
  ];
@@ -220,7 +220,10 @@ export var tableResizing = function (options) {
220
220
  tr.setMeta('addToHistory', false);
221
221
  if (selected && prevSelected && selected.pos !== prevSelected.pos) {
222
222
  tr.setMeta(key, { nodePosition: selected.pos });
223
- tr.setNodeMarkup(prevSelected.pos, nodeType, __assign(__assign({}, prevSelected.node.attrs), (_a = {}, _a[resizableAttr] = false, _a)));
223
+ var prevNode = tr.doc.nodeAt(prevSelected.pos);
224
+ if (prevNode && prevNode.type.name === nodeType.name) {
225
+ tr.setNodeMarkup(prevSelected.pos, nodeType, __assign(__assign({}, prevSelected.node.attrs), (_a = {}, _a[resizableAttr] = false, _a)));
226
+ }
224
227
  tr.setNodeMarkup(selected.pos, nodeType, __assign(__assign({}, selected.node.attrs), (_b = {}, _b[resizableAttr] = true, _b)));
225
228
  view.dispatch(tr);
226
229
  }
@@ -10,12 +10,11 @@ export const alignBlocks = (actions, commandName) => (state, dispatch) => {
10
10
  tr.setMeta('commandName', commandName);
11
11
  blocks.forEach(node => {
12
12
  if (node.type.isTextblock) {
13
- let newAttrs = {};
14
13
  const action = actions.find(n => n.node === node.type.name);
15
14
  if (action) {
16
- newAttrs = addStyles(node, action.style);
15
+ const newAttrs = addStyles(node, action.style);
16
+ changeTextBlock(tr, node, node.type, newAttrs);
17
17
  }
18
- changeTextBlock(tr, node, node.type, newAttrs);
19
18
  }
20
19
  });
21
20
  const result = tr.docChanged;
@@ -3,21 +3,26 @@ const style = (name, value) => {
3
3
  };
4
4
  export const alignLeftRules = [
5
5
  { node: 'paragraph', style: [style('text-align', 'left')] },
6
- { node: 'heading', style: [style('text-align', 'left')] }
6
+ { node: 'heading', style: [style('text-align', 'left')] },
7
+ { node: 'table_caption_external', style: [style('text-align', 'left')] }
7
8
  ];
8
9
  export const alignRightRules = [
9
10
  { node: 'paragraph', style: [style('text-align', 'right')] },
10
- { node: 'heading', style: [style('text-align', 'right')] }
11
+ { node: 'heading', style: [style('text-align', 'right')] },
12
+ { node: 'table_caption_external', style: [style('text-align', 'right')] }
11
13
  ];
12
14
  export const alignCenterRules = [
13
15
  { node: 'paragraph', style: [style('text-align', 'center')] },
14
- { node: 'heading', style: [style('text-align', 'center')] }
16
+ { node: 'heading', style: [style('text-align', 'center')] },
17
+ { node: 'table_caption_external', style: [style('text-align', 'center')] }
15
18
  ];
16
19
  export const alignJustifyRules = [
17
20
  { node: 'paragraph', style: [style('text-align', 'justify')] },
18
- { node: 'heading', style: [style('text-align', 'justify')] }
21
+ { node: 'heading', style: [style('text-align', 'justify')] },
22
+ { node: 'table_caption_external', style: [style('text-align', 'justify')] }
19
23
  ];
20
24
  export const alignRemoveRules = [
21
25
  { node: 'paragraph', style: [style('text-align', '')] },
22
- { node: 'heading', style: [style('text-align', '')] }
26
+ { node: 'heading', style: [style('text-align', '')] },
27
+ { node: 'table_caption_external', style: [style('text-align', '')] }
23
28
  ];
@@ -216,7 +216,10 @@ export const tableResizing = (options = { node: 'table' }) => {
216
216
  tr.setMeta('addToHistory', false);
217
217
  if (selected && prevSelected && selected.pos !== prevSelected.pos) {
218
218
  tr.setMeta(key, { nodePosition: selected.pos });
219
- tr.setNodeMarkup(prevSelected.pos, nodeType, Object.assign(Object.assign({}, prevSelected.node.attrs), { [resizableAttr]: false }));
219
+ const prevNode = tr.doc.nodeAt(prevSelected.pos);
220
+ if (prevNode && prevNode.type.name === nodeType.name) {
221
+ tr.setNodeMarkup(prevSelected.pos, nodeType, Object.assign(Object.assign({}, prevSelected.node.attrs), { [resizableAttr]: false }));
222
+ }
220
223
  tr.setNodeMarkup(selected.pos, nodeType, Object.assign(Object.assign({}, selected.node.attrs), { [resizableAttr]: true }));
221
224
  view.dispatch(tr);
222
225
  }
package/dist/npm/align.js CHANGED
@@ -13,12 +13,11 @@ var alignBlocks = function (actions, commandName) { return function (state, disp
13
13
  tr.setMeta('commandName', commandName);
14
14
  blocks.forEach(function (node) {
15
15
  if (node.type.isTextblock) {
16
- var newAttrs = {};
17
16
  var action = actions.find(function (n) { return n.node === node.type.name; });
18
17
  if (action) {
19
- newAttrs = blockNode_1.addStyles(node, action.style);
18
+ var newAttrs = blockNode_1.addStyles(node, action.style);
19
+ blockNode_1.changeTextBlock(tr, node, node.type, newAttrs);
20
20
  }
21
- blockNode_1.changeTextBlock(tr, node, node.type, newAttrs);
22
21
  }
23
22
  });
24
23
  var result = tr.docChanged;
@@ -6,21 +6,26 @@ var style = function (name, value) {
6
6
  };
7
7
  exports.alignLeftRules = [
8
8
  { node: 'paragraph', style: [style('text-align', 'left')] },
9
- { node: 'heading', style: [style('text-align', 'left')] }
9
+ { node: 'heading', style: [style('text-align', 'left')] },
10
+ { node: 'table_caption_external', style: [style('text-align', 'left')] }
10
11
  ];
11
12
  exports.alignRightRules = [
12
13
  { node: 'paragraph', style: [style('text-align', 'right')] },
13
- { node: 'heading', style: [style('text-align', 'right')] }
14
+ { node: 'heading', style: [style('text-align', 'right')] },
15
+ { node: 'table_caption_external', style: [style('text-align', 'right')] }
14
16
  ];
15
17
  exports.alignCenterRules = [
16
18
  { node: 'paragraph', style: [style('text-align', 'center')] },
17
- { node: 'heading', style: [style('text-align', 'center')] }
19
+ { node: 'heading', style: [style('text-align', 'center')] },
20
+ { node: 'table_caption_external', style: [style('text-align', 'center')] }
18
21
  ];
19
22
  exports.alignJustifyRules = [
20
23
  { node: 'paragraph', style: [style('text-align', 'justify')] },
21
- { node: 'heading', style: [style('text-align', 'justify')] }
24
+ { node: 'heading', style: [style('text-align', 'justify')] },
25
+ { node: 'table_caption_external', style: [style('text-align', 'justify')] }
22
26
  ];
23
27
  exports.alignRemoveRules = [
24
28
  { node: 'paragraph', style: [style('text-align', '')] },
25
- { node: 'heading', style: [style('text-align', '')] }
29
+ { node: 'heading', style: [style('text-align', '')] },
30
+ { node: 'table_caption_external', style: [style('text-align', '')] }
26
31
  ];
@@ -223,7 +223,10 @@ var tableResizing = function (options) {
223
223
  tr.setMeta('addToHistory', false);
224
224
  if (selected && prevSelected && selected.pos !== prevSelected.pos) {
225
225
  tr.setMeta(utils_1.tableResizeKey, { nodePosition: selected.pos });
226
- tr.setNodeMarkup(prevSelected.pos, nodeType, tslib_1.__assign(tslib_1.__assign({}, prevSelected.node.attrs), (_a = {}, _a[constants_1.resizableAttr] = false, _a)));
226
+ var prevNode = tr.doc.nodeAt(prevSelected.pos);
227
+ if (prevNode && prevNode.type.name === nodeType.name) {
228
+ tr.setNodeMarkup(prevSelected.pos, nodeType, tslib_1.__assign(tslib_1.__assign({}, prevSelected.node.attrs), (_a = {}, _a[constants_1.resizableAttr] = false, _a)));
229
+ }
227
230
  tr.setNodeMarkup(selected.pos, nodeType, tslib_1.__assign(tslib_1.__assign({}, selected.node.attrs), (_b = {}, _b[constants_1.resizableAttr] = true, _b)));
228
231
  view.dispatch(tr);
229
232
  }