@ctzhian/tiptap 2.3.1 → 2.3.2-beta.1

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.
@@ -5,30 +5,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { getHierarchicalIndexes, TableOfContents } from '@tiptap/extension-table-of-contents';
8
- import { Plugin, PluginKey } from '@tiptap/pm/state';
9
8
  export var TableOfContentsExtension = function TableOfContentsExtension(_ref) {
10
9
  var onTocUpdate = _ref.onTocUpdate,
11
10
  tableOfContentsOptions = _ref.tableOfContentsOptions;
12
- return TableOfContents.extend({
13
- addProseMirrorPlugins: function addProseMirrorPlugins() {
14
- var imeCompositionPluginKey = new PluginKey('imeComposition');
15
- return [new Plugin({
16
- key: new PluginKey('tableOfContentImeFix'),
17
- appendTransaction: function appendTransaction(transactions, _oldState, newState) {
18
- if (transactions.some(function (tr) {
19
- return tr.getMeta('composition');
20
- })) {
21
- return null;
22
- }
23
- var imePluginState = imeCompositionPluginKey.getState(newState);
24
- if (imePluginState !== null && imePluginState !== void 0 && imePluginState.isComposing) {
25
- return null;
26
- }
27
- return null;
28
- }
29
- })];
30
- }
31
- }).configure(_objectSpread(_objectSpread({
11
+ return TableOfContents.configure(_objectSpread(_objectSpread({
32
12
  getIndex: getHierarchicalIndexes
33
13
  }, tableOfContentsOptions || {}), {}, {
34
14
  onUpdate: function onUpdate(data, isCreate) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "2.3.1",
3
+ "version": "2.3.2-beta.1",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",