@pie-lib/editable-html 8.1.2 → 9.0.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.
@@ -166,7 +166,7 @@ export default (opts, toolbarPlugins /* : {toolbar: {}}[] */) => {
166
166
  customToolbar: (node, value, onToolbarDone) => {
167
167
  log('[customToolbar] node.data: ', node.data);
168
168
 
169
- const tableBlock = core.utils.getTableBlock(value.document, node.key);
169
+ const tableBlock = core.utils.getTableBlock(value.document, node?.key);
170
170
  log('[customToolbar] tableBlock: ', tableBlock);
171
171
 
172
172
  const hasBorder = () =>
@@ -295,8 +295,8 @@ export default (opts, toolbarPlugins /* : {toolbar: {}}[] */) => {
295
295
  if (prevText) {
296
296
  // we move focus to the previous text
297
297
  change
298
- .moveFocusTo(prevText.key, prevText.text.length)
299
- .moveAnchorTo(prevText.key, prevText.text.length);
298
+ .moveFocusTo(prevText.key, prevText.text?.length)
299
+ .moveAnchorTo(prevText.key, prevText.text?.length);
300
300
  }
301
301
 
302
302
  // we insert the table block between the first block with text and the last block with text