@tiptap/core 2.0.0-beta.157 → 2.0.0-beta.160
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/packages/core/src/Node.d.ts +9 -0
- package/dist/tiptap-core.cjs.js +11 -6
- package/dist/tiptap-core.cjs.js.map +1 -1
- package/dist/tiptap-core.esm.js +11 -6
- package/dist/tiptap-core.esm.js.map +1 -1
- package/dist/tiptap-core.umd.js +11 -6
- package/dist/tiptap-core.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/InputRule.ts +1 -1
- package/src/Node.ts +10 -0
- package/src/helpers/getDebugJSON.ts +12 -5
|
@@ -309,6 +309,15 @@ declare module '@tiptap/core' {
|
|
|
309
309
|
storage: Storage;
|
|
310
310
|
parent: ParentConfig<NodeConfig<Options, Storage>>['code'];
|
|
311
311
|
}) => NodeSpec['code']);
|
|
312
|
+
/**
|
|
313
|
+
* Whitespace
|
|
314
|
+
*/
|
|
315
|
+
whitespace?: NodeSpec['whitespace'] | ((this: {
|
|
316
|
+
name: string;
|
|
317
|
+
options: Options;
|
|
318
|
+
storage: Storage;
|
|
319
|
+
parent: ParentConfig<NodeConfig<Options, Storage>>['whitespace'];
|
|
320
|
+
}) => NodeSpec['whitespace']);
|
|
312
321
|
/**
|
|
313
322
|
* Defining
|
|
314
323
|
*/
|
package/dist/tiptap-core.cjs.js
CHANGED
|
@@ -2252,7 +2252,7 @@ function run$1(config) {
|
|
|
2252
2252
|
}
|
|
2253
2253
|
let matched = false;
|
|
2254
2254
|
const maxMatch = 500;
|
|
2255
|
-
const textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - maxMatch), $from.parentOffset, undefined, '
|
|
2255
|
+
const textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - maxMatch), $from.parentOffset, undefined, ' ') + text;
|
|
2256
2256
|
rules.forEach(rule => {
|
|
2257
2257
|
if (matched) {
|
|
2258
2258
|
return;
|
|
@@ -4255,12 +4255,17 @@ function getChangedRanges(transform) {
|
|
|
4255
4255
|
function getDebugJSON(node, startOffset = 0) {
|
|
4256
4256
|
const isTopNode = node.type === node.type.schema.topNodeType;
|
|
4257
4257
|
const increment = isTopNode ? 0 : 1;
|
|
4258
|
-
const from = startOffset;
|
|
4258
|
+
const from = startOffset;
|
|
4259
4259
|
const to = from + node.nodeSize;
|
|
4260
|
-
const marks = node.marks.map(mark =>
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4260
|
+
const marks = node.marks.map(mark => {
|
|
4261
|
+
const output = {
|
|
4262
|
+
type: mark.type.name,
|
|
4263
|
+
};
|
|
4264
|
+
if (Object.keys(mark.attrs).length) {
|
|
4265
|
+
output.attrs = { ...mark.attrs };
|
|
4266
|
+
}
|
|
4267
|
+
return output;
|
|
4268
|
+
});
|
|
4264
4269
|
const attrs = { ...node.attrs };
|
|
4265
4270
|
const output = {
|
|
4266
4271
|
type: node.type.name,
|