slate 0.75.0 → 0.76.0-2022220113731

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 +1 @@
1
- {"version":3,"file":"create-editor.d.ts","sourceRoot":"","sources":["packages/slate/src/create-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAYP,MAAM,IAAI,CAAA;AAGX;;GAEG;AAEH,eAAO,MAAM,YAAY,QAAO,MAmR/B,CAAA"}
1
+ {"version":3,"file":"create-editor.d.ts","sourceRoot":"","sources":["packages/slate/src/create-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAYP,MAAM,IAAI,CAAA;AAGX;;GAEG;AAEH,eAAO,MAAM,YAAY,QAAO,MAuR/B,CAAA"}
package/dist/index.es.js CHANGED
@@ -183,6 +183,11 @@ var createEditor = () => {
183
183
  always: true
184
184
  });
185
185
  },
186
+ insertSoftBreak: () => {
187
+ Transforms.splitNodes(editor, {
188
+ always: true
189
+ });
190
+ },
186
191
  insertFragment: fragment => {
187
192
  Transforms.insertFragment(editor, fragment);
188
193
  },
@@ -1045,6 +1050,15 @@ var Editor = {
1045
1050
  editor.insertBreak();
1046
1051
  },
1047
1052
 
1053
+ /**
1054
+ * Insert a soft break at the current selection.
1055
+ *
1056
+ * If the selection is currently expanded, it will be deleted first.
1057
+ */
1058
+ insertSoftBreak(editor) {
1059
+ editor.insertSoftBreak();
1060
+ },
1061
+
1048
1062
  /**
1049
1063
  * Insert a fragment at the current selection.
1050
1064
  *
@@ -1090,7 +1104,7 @@ var Editor = {
1090
1104
  return cachedIsEditor;
1091
1105
  }
1092
1106
 
1093
- var isEditor = typeof value.addMark === 'function' && typeof value.apply === 'function' && typeof value.deleteBackward === 'function' && typeof value.deleteForward === 'function' && typeof value.deleteFragment === 'function' && typeof value.insertBreak === 'function' && typeof value.insertFragment === 'function' && typeof value.insertNode === 'function' && typeof value.insertText === 'function' && typeof value.isInline === 'function' && typeof value.isVoid === 'function' && typeof value.normalizeNode === 'function' && typeof value.onChange === 'function' && typeof value.removeMark === 'function' && (value.marks === null || isPlainObject(value.marks)) && (value.selection === null || Range.isRange(value.selection)) && Node.isNodeList(value.children) && Operation.isOperationList(value.operations);
1107
+ var isEditor = typeof value.addMark === 'function' && typeof value.apply === 'function' && typeof value.deleteBackward === 'function' && typeof value.deleteForward === 'function' && typeof value.deleteFragment === 'function' && typeof value.insertBreak === 'function' && typeof value.insertSoftBreak === 'function' && typeof value.insertFragment === 'function' && typeof value.insertNode === 'function' && typeof value.insertText === 'function' && typeof value.isInline === 'function' && typeof value.isVoid === 'function' && typeof value.normalizeNode === 'function' && typeof value.onChange === 'function' && typeof value.removeMark === 'function' && (value.marks === null || isPlainObject(value.marks)) && (value.selection === null || Range.isRange(value.selection)) && Node.isNodeList(value.children) && Operation.isOperationList(value.operations);
1094
1108
  IS_EDITOR_CACHE.set(value, isEditor);
1095
1109
  return isEditor;
1096
1110
  },