@tiptap/core 3.0.0-beta.24 → 3.0.0-beta.25
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/{chunk-PR4QN5HX.js → chunk-G3PMV62Z.js} +2 -9
- package/dist/dist-GJ4HMHO4.js +15184 -0
- package/dist/dist-GJ4HMHO4.js.map +1 -0
- package/dist/index.cjs +14482 -53165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
- package/src/Editor.ts +7 -7
- package/src/types.ts +1 -1
- package/dist/chunk-GRT2MR5L.js +0 -59
- package/dist/chunk-GRT2MR5L.js.map +0 -1
- package/dist/chunk-TH7LERQR.js +0 -34
- package/dist/chunk-TH7LERQR.js.map +0 -1
- package/dist/chunk-UNIMJOD2.js +0 -1010
- package/dist/chunk-UNIMJOD2.js.map +0 -1
- package/dist/esm-7BF7U2WM.js +0 -47055
- package/dist/esm-7BF7U2WM.js.map +0 -1
- package/dist/json-diff-main-ASELUCBE.js +0 -4742
- package/dist/json-diff-main-ASELUCBE.js.map +0 -1
- package/dist/json-diff-worker-ET432FKY.js +0 -398
- package/dist/json-diff-worker-ET432FKY.js.map +0 -1
- /package/dist/{chunk-PR4QN5HX.js.map → chunk-G3PMV62Z.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/core",
|
|
3
3
|
"description": "headless rich text editor",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.25",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -52,12 +52,11 @@
|
|
|
52
52
|
"jsx-dev-runtime"
|
|
53
53
|
],
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"@tiptap/pm": "3.0.0-beta.24"
|
|
55
|
+
"prosemirror-dev-toolkit": "^1.1.8",
|
|
56
|
+
"@tiptap/pm": "3.0.0-beta.25"
|
|
58
57
|
},
|
|
59
58
|
"peerDependencies": {
|
|
60
|
-
"@tiptap/pm": "3.0.0-beta.
|
|
59
|
+
"@tiptap/pm": "3.0.0-beta.25"
|
|
61
60
|
},
|
|
62
61
|
"repository": {
|
|
63
62
|
"type": "git",
|
package/src/Editor.ts
CHANGED
|
@@ -194,14 +194,14 @@ export class Editor extends EventEmitter<EditorEvents> {
|
|
|
194
194
|
/**
|
|
195
195
|
* Applies ProseMirror dev tools to the editor instance if enabled and running in a browser environment.
|
|
196
196
|
*
|
|
197
|
-
* This method dynamically imports the `prosemirror-dev-
|
|
197
|
+
* This method dynamically imports the `prosemirror-dev-toolkit` package and applies it to the current
|
|
198
198
|
* editor view. If the dev tools are not installed, a warning is logged to the console.
|
|
199
199
|
*
|
|
200
200
|
* @private
|
|
201
201
|
* @remarks
|
|
202
202
|
* - Dev tools are only applied if `this.options.enableDevTools` is `true` and the code is running in a browser.
|
|
203
203
|
* - If the editor view is not available, the dev tools are not applied.
|
|
204
|
-
* - If the `prosemirror-dev-
|
|
204
|
+
* - If the `prosemirror-dev-toolkit` package is missing, a warning is shown in the console.
|
|
205
205
|
*
|
|
206
206
|
* @returns {void}
|
|
207
207
|
*/
|
|
@@ -210,17 +210,17 @@ export class Editor extends EventEmitter<EditorEvents> {
|
|
|
210
210
|
return
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
import('prosemirror-dev-
|
|
214
|
-
.then(({
|
|
213
|
+
import('prosemirror-dev-toolkit')
|
|
214
|
+
.then(({ applyDevTools }) => {
|
|
215
215
|
if (!this.editorView) {
|
|
216
216
|
return
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
applyDevTools(this.editorView)
|
|
220
220
|
})
|
|
221
221
|
.catch(() => {
|
|
222
|
-
console.warn('[Tiptap warning]: Devtools are enabled but `prosemirror-dev-
|
|
223
|
-
console.warn("Install 'prosemirror-dev-
|
|
222
|
+
console.warn('[Tiptap warning]: Devtools are enabled but `prosemirror-dev-toolkit` is not installed.')
|
|
223
|
+
console.warn("Install 'prosemirror-dev-toolkit' as a dev dependency to use the dev tools.")
|
|
224
224
|
})
|
|
225
225
|
}
|
|
226
226
|
|
package/src/types.ts
CHANGED
|
@@ -366,7 +366,7 @@ export interface EditorOptions {
|
|
|
366
366
|
/**
|
|
367
367
|
* Enable a lazy-loaded Prosemirror DevTools integration.
|
|
368
368
|
*
|
|
369
|
-
* Requires having the `prosemirror-dev-
|
|
369
|
+
* Requires having the `prosemirror-dev-toolkit` npm package installed.
|
|
370
370
|
* @type boolean
|
|
371
371
|
* @default false
|
|
372
372
|
* @example
|
package/dist/chunk-GRT2MR5L.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/prosemirror-dev-tools@4.2.0_@babel+core@7.26.0_@babel+template@7.25.9_@types+react@19.1.6_rea_wz3aei26oeuigobt6rwizjq3ci/node_modules/prosemirror-dev-tools/dist/esm/state/idle-scheduler.js
|
|
2
|
-
function _classCallCheck(instance, Constructor) {
|
|
3
|
-
if (!(instance instanceof Constructor)) {
|
|
4
|
-
throw new TypeError("Cannot call a class as a function");
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
function _defineProperties(target, props) {
|
|
8
|
-
for (var i = 0; i < props.length; i++) {
|
|
9
|
-
var descriptor = props[i];
|
|
10
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
11
|
-
descriptor.configurable = true;
|
|
12
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
13
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
17
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
18
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
19
|
-
Object.defineProperty(Constructor, "prototype", { writable: false });
|
|
20
|
-
return Constructor;
|
|
21
|
-
}
|
|
22
|
-
function _defineProperty(obj, key, value) {
|
|
23
|
-
if (key in obj) {
|
|
24
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
25
|
-
} else {
|
|
26
|
-
obj[key] = value;
|
|
27
|
-
}
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
30
|
-
var IdleScheduler = /* @__PURE__ */ function() {
|
|
31
|
-
function IdleScheduler2() {
|
|
32
|
-
_classCallCheck(this, IdleScheduler2);
|
|
33
|
-
_defineProperty(this, "task", void 0);
|
|
34
|
-
}
|
|
35
|
-
_createClass(IdleScheduler2, [{
|
|
36
|
-
key: "request",
|
|
37
|
-
value: function request() {
|
|
38
|
-
this.cancel();
|
|
39
|
-
var request2 = window.requestIdleCallback || window.requestAnimationFrame;
|
|
40
|
-
return new Promise(function(resolve) {
|
|
41
|
-
return request2(resolve);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
key: "cancel",
|
|
46
|
-
value: function cancel() {
|
|
47
|
-
var cancel2 = window.cancelIdleCallack || window.cancelAnimationFrame;
|
|
48
|
-
if (this.task) {
|
|
49
|
-
cancel2(this.task);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}]);
|
|
53
|
-
return IdleScheduler2;
|
|
54
|
-
}();
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
IdleScheduler
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=chunk-GRT2MR5L.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/prosemirror-dev-tools@4.2.0_@babel+core@7.26.0_@babel+template@7.25.9_@types+react@19.1.6_rea_wz3aei26oeuigobt6rwizjq3ci/node_modules/prosemirror-dev-tools/dist/esm/state/idle-scheduler.js"],"sourcesContent":["function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nexport var IdleScheduler = /*#__PURE__*/function () {\n function IdleScheduler() {\n _classCallCheck(this, IdleScheduler);\n _defineProperty(this, \"task\", undefined);\n }\n _createClass(IdleScheduler, [{\n key: \"request\",\n value: function request() {\n this.cancel();\n var request = window.requestIdleCallback || window.requestAnimationFrame;\n return new Promise(function (resolve) {\n return request(resolve);\n });\n }\n }, {\n key: \"cancel\",\n value: function cancel() {\n var cancel = window.cancelIdleCallack || window.cancelAnimationFrame;\n if (this.task) {\n cancel(this.task);\n }\n }\n }]);\n return IdleScheduler;\n}();"],"mappings":";AAAA,SAAS,gBAAgB,UAAU,aAAa;AAAE,MAAI,EAAE,oBAAoB,cAAc;AAAE,UAAM,IAAI,UAAU,mCAAmC;AAAA,EAAG;AAAE;AACxJ,SAAS,kBAAkB,QAAQ,OAAO;AAAE,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AAAE,QAAI,aAAa,MAAM,CAAC;AAAG,eAAW,aAAa,WAAW,cAAc;AAAO,eAAW,eAAe;AAAM,QAAI,WAAW,WAAY,YAAW,WAAW;AAAM,WAAO,eAAe,QAAQ,WAAW,KAAK,UAAU;AAAA,EAAG;AAAE;AAC5T,SAAS,aAAa,aAAa,YAAY,aAAa;AAAE,MAAI,WAAY,mBAAkB,YAAY,WAAW,UAAU;AAAG,MAAI,YAAa,mBAAkB,aAAa,WAAW;AAAG,SAAO,eAAe,aAAa,aAAa,EAAE,UAAU,MAAM,CAAC;AAAG,SAAO;AAAa;AAC5R,SAAS,gBAAgB,KAAK,KAAK,OAAO;AAAE,MAAI,OAAO,KAAK;AAAE,WAAO,eAAe,KAAK,KAAK,EAAE,OAAc,YAAY,MAAM,cAAc,MAAM,UAAU,KAAK,CAAC;AAAA,EAAG,OAAO;AAAE,QAAI,GAAG,IAAI;AAAA,EAAO;AAAE,SAAO;AAAK;AACzM,IAAI,gBAA6B,2BAAY;AAClD,WAASA,iBAAgB;AACvB,oBAAgB,MAAMA,cAAa;AACnC,oBAAgB,MAAM,QAAQ,MAAS;AAAA,EACzC;AACA,eAAaA,gBAAe,CAAC;AAAA,IAC3B,KAAK;AAAA,IACL,OAAO,SAAS,UAAU;AACxB,WAAK,OAAO;AACZ,UAAIC,WAAU,OAAO,uBAAuB,OAAO;AACnD,aAAO,IAAI,QAAQ,SAAU,SAAS;AACpC,eAAOA,SAAQ,OAAO;AAAA,MACxB,CAAC;AAAA,IACH;AAAA,EACF,GAAG;AAAA,IACD,KAAK;AAAA,IACL,OAAO,SAAS,SAAS;AACvB,UAAIC,UAAS,OAAO,qBAAqB,OAAO;AAChD,UAAI,KAAK,MAAM;AACb,QAAAA,QAAO,KAAK,IAAI;AAAA,MAClB;AAAA,IACF;AAAA,EACF,CAAC,CAAC;AACF,SAAOF;AACT,EAAE;","names":["IdleScheduler","request","cancel"]}
|
package/dist/chunk-TH7LERQR.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/nanoid@3.3.8/node_modules/nanoid/index.js
|
|
2
|
-
import crypto from "crypto";
|
|
3
|
-
|
|
4
|
-
// ../../node_modules/.pnpm/nanoid@3.3.8/node_modules/nanoid/url-alphabet/index.js
|
|
5
|
-
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
6
|
-
|
|
7
|
-
// ../../node_modules/.pnpm/nanoid@3.3.8/node_modules/nanoid/index.js
|
|
8
|
-
var POOL_SIZE_MULTIPLIER = 128;
|
|
9
|
-
var pool;
|
|
10
|
-
var poolOffset;
|
|
11
|
-
var fillPool = (bytes) => {
|
|
12
|
-
if (!pool || pool.length < bytes) {
|
|
13
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
14
|
-
crypto.randomFillSync(pool);
|
|
15
|
-
poolOffset = 0;
|
|
16
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
17
|
-
crypto.randomFillSync(pool);
|
|
18
|
-
poolOffset = 0;
|
|
19
|
-
}
|
|
20
|
-
poolOffset += bytes;
|
|
21
|
-
};
|
|
22
|
-
var nanoid = (size = 21) => {
|
|
23
|
-
fillPool(size |= 0);
|
|
24
|
-
let id = "";
|
|
25
|
-
for (let i = poolOffset - size; i < poolOffset; i++) {
|
|
26
|
-
id += urlAlphabet[pool[i] & 63];
|
|
27
|
-
}
|
|
28
|
-
return id;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
nanoid
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=chunk-TH7LERQR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/nanoid@3.3.8/node_modules/nanoid/index.js","../../../node_modules/.pnpm/nanoid@3.3.8/node_modules/nanoid/url-alphabet/index.js"],"sourcesContent":["import crypto from 'crypto'\n\nimport { urlAlphabet } from './url-alphabet/index.js'\n\n// It is best to make fewer, larger requests to the crypto module to\n// avoid system call overhead. So, random numbers are generated in a\n// pool. The pool is a Buffer that is larger than the initial random\n// request size by this multiplier. The pool is enlarged if subsequent\n// requests exceed the maximum buffer size.\nconst POOL_SIZE_MULTIPLIER = 128\nlet pool, poolOffset\n\nlet fillPool = bytes => {\n if (!pool || pool.length < bytes) {\n pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)\n crypto.randomFillSync(pool)\n poolOffset = 0\n } else if (poolOffset + bytes > pool.length) {\n crypto.randomFillSync(pool)\n poolOffset = 0\n }\n poolOffset += bytes\n}\n\nlet random = bytes => {\n // `|=` convert `bytes` to number to prevent `valueOf` abusing and pool pollution\n fillPool((bytes |= 0))\n return pool.subarray(poolOffset - bytes, poolOffset)\n}\n\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n // First, a bitmask is necessary to generate the ID. The bitmask makes bytes\n // values closer to the alphabet size. The bitmask calculates the closest\n // `2^31 - 1` number, which exceeds the alphabet size.\n // For example, the bitmask for the alphabet size 30 is 31 (00011111).\n let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1\n // Though, the bitmask solution is not perfect since the bytes exceeding\n // the alphabet size are refused. Therefore, to reliably generate the ID,\n // the random bytes redundancy has to be satisfied.\n\n // Note: every hardware random generator call is performance expensive,\n // because the system call for entropy collection takes a lot of time.\n // So, to avoid additional system calls, extra bytes are requested in advance.\n\n // Next, a step determines how many random bytes to generate.\n // The number of random bytes gets decided upon the ID size, mask,\n // alphabet size, and magic number 1.6 (using 1.6 peaks at performance\n // according to benchmarks).\n let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)\n\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n // A compact alternative for `for (let i = 0; i < step; i++)`.\n let i = step\n while (i--) {\n // Adding `|| ''` refuses a random byte that exceeds the alphabet size.\n id += alphabet[bytes[i] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\n\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\n\nlet nanoid = (size = 21) => {\n // `|=` convert `size` to number to prevent `valueOf` abusing and pool pollution\n fillPool((size |= 0))\n let id = ''\n // We are reading directly from the random pool to avoid creating new array\n for (let i = poolOffset - size; i < poolOffset; i++) {\n // It is incorrect to use bytes exceeding the alphabet size.\n // The following mask reduces the random byte in the 0-255 value\n // range to the 0-63 value range. Therefore, adding hacks, such\n // as empty string fallback or magic numbers, is unneccessary because\n // the bitmask trims bytes down to the alphabet size.\n id += urlAlphabet[pool[i] & 63]\n }\n return id\n}\n\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","// This alphabet uses `A-Za-z0-9_-` symbols.\n// The order of characters is optimized for better gzip and brotli compression.\n// Same as in non-secure/index.js\nlet urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n\nexport { urlAlphabet }\n"],"mappings":";AAAA,OAAO,YAAY;;;ACGnB,IAAI,cACF;;;ADKF,IAAM,uBAAuB;AAC7B,IAAI;AAAJ,IAAU;AAEV,IAAI,WAAW,WAAS;AACtB,MAAI,CAAC,QAAQ,KAAK,SAAS,OAAO;AAChC,WAAO,OAAO,YAAY,QAAQ,oBAAoB;AACtD,WAAO,eAAe,IAAI;AAC1B,iBAAa;AAAA,EACf,WAAW,aAAa,QAAQ,KAAK,QAAQ;AAC3C,WAAO,eAAe,IAAI;AAC1B,iBAAa;AAAA,EACf;AACA,gBAAc;AAChB;AA8CA,IAAI,SAAS,CAAC,OAAO,OAAO;AAE1B,WAAU,QAAQ,CAAE;AACpB,MAAI,KAAK;AAET,WAAS,IAAI,aAAa,MAAM,IAAI,YAAY,KAAK;AAMnD,UAAM,YAAY,KAAK,CAAC,IAAI,EAAE;AAAA,EAChC;AACA,SAAO;AACT;","names":[]}
|