From d52362ad9bdb4f145a9eba6eaa8070bde4baa5e7 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Wed, 22 Apr 2026 00:21:46 +0200 Subject: [PATCH] fix: repair tiptap patch integrity --- patches/@tiptap__extension-link@3.19.0.patch | 115 ++++++++++--------- pnpm-lock.yaml | 6 +- 2 files changed, 62 insertions(+), 59 deletions(-) diff --git a/patches/@tiptap__extension-link@3.19.0.patch b/patches/@tiptap__extension-link@3.19.0.patch index 66d84c82..6737bc24 100644 --- a/patches/@tiptap__extension-link@3.19.0.patch +++ b/patches/@tiptap__extension-link@3.19.0.patch @@ -1,31 +1,46 @@ -diff --git a/src/link.ts b/src/link.ts ---- a/src/link.ts -+++ b/src/link.ts -@@ -6,6 +6,21 @@ import { autolink } from './helpers/autolink.js' - import { clickHandler } from './helpers/clickHandler.js' - import { pasteHandler } from './helpers/pasteHandler.js' - import { UNICODE_WHITESPACE_REGEX_GLOBAL } from './helpers/whitespace.js' -+ -+const PRE_REGISTERED_PROTOCOLS = ['tel', 'callto', 'sms', 'cid', 'xmpp'] as const -+const linkifyProtocolFlag = '__tolariaTiptapLinkifyProtocolsRegistered' -+const linkifyGlobalObject = typeof globalThis === 'undefined' -+ ? undefined -+ : (globalThis as Record) -+ +diff --git a/dist/index.cjs b/dist/index.cjs +index b7357fa..c2c59cb 100644 +--- a/dist/index.cjs ++++ b/dist/index.cjs +@@ -36,6 +36,16 @@ var import_core = require("@tiptap/core"); + var import_state = require("@tiptap/pm/state"); + var import_linkifyjs = require("linkifyjs"); + ++var PRE_REGISTERED_PROTOCOLS = ["tel", "callto", "sms", "cid", "xmpp"]; ++var linkifyProtocolFlag = "__tolariaTiptapLinkifyProtocolsRegistered"; ++var linkifyGlobalObject = typeof globalThis === "undefined" ? void 0 : globalThis; +if (linkifyGlobalObject && !linkifyGlobalObject[linkifyProtocolFlag]) { + PRE_REGISTERED_PROTOCOLS.forEach((protocol) => { -+ registerCustomProtocol(protocol) -+ }) -+ -+ linkifyGlobalObject[linkifyProtocolFlag] = true ++ (0, import_linkifyjs.registerCustomProtocol)(protocol); ++ }); ++ linkifyGlobalObject[linkifyProtocolFlag] = true; +} - - export interface LinkProtocolOptions { - /** ++ + // src/helpers/whitespace.ts + var UNICODE_WHITESPACE_PATTERN = "[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]"; + var UNICODE_WHITESPACE_REGEX = new RegExp(UNICODE_WHITESPACE_PATTERN); +@@ -253,7 +263,8 @@ var Link = import_core3.Mark.create({ + }); + }, + onDestroy() { +- (0, import_linkifyjs3.reset)(); ++ // Tolaria keeps a single editor shell alive across note swaps, so linkify's ++ // protocol registry must survive editor teardown and remount cycles. + }, + inclusive() { + return this.options.autolink; +@@ -472,4 +483,4 @@ var index_default = Link; + isAllowedUri, + pasteRegex + }); +-//# sourceMappingURL=index.cjs.map +\ No newline at end of file ++//# sourceMappingURL=index.cjs.map diff --git a/dist/index.js b/dist/index.js +index d486894..cb8e256 100644 --- a/dist/index.js +++ b/dist/index.js -@@ -8,6 +8,18 @@ var UNICODE_WHITESPACE_REGEX = new RegExp(UNICODE_WHITESPACE_PATTERN); +@@ -13,6 +13,16 @@ var UNICODE_WHITESPACE_REGEX = new RegExp(UNICODE_WHITESPACE_PATTERN); var UNICODE_WHITESPACE_REGEX_END = new RegExp(`${UNICODE_WHITESPACE_PATTERN}$`); var UNICODE_WHITESPACE_REGEX_GLOBAL = new RegExp(UNICODE_WHITESPACE_PATTERN, "g"); @@ -42,7 +57,7 @@ diff --git a/dist/index.js b/dist/index.js // src/helpers/autolink.ts function isValidLinkStructure(tokens) { if (tokens.length === 1) { -@@ -224,7 +236,8 @@ var Link = Mark.create({ +@@ -224,7 +234,8 @@ var Link = Mark.create({ }); }, onDestroy() { @@ -52,47 +67,35 @@ diff --git a/dist/index.js b/dist/index.js }, inclusive() { return this.options.autolink; -@@ -443,4 +444,4 @@ export { +@@ -443,4 +454,4 @@ export { isAllowedUri, pasteRegex }; -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map -diff --git a/dist/index.cjs b/dist/index.cjs ---- a/dist/index.cjs -+++ b/dist/index.cjs -@@ -10,6 +10,18 @@ var import_state3 = require("@tiptap/pm/state"); - var import_linkifyjs2 = require("linkifyjs"); - var import_whitespace = require("./helpers/whitespace.cjs"); +diff --git a/src/link.ts b/src/link.ts +index 839a575..bbef783 100644 +--- a/src/link.ts ++++ b/src/link.ts +@@ -8,6 +8,20 @@ import { clickHandler } from './helpers/clickHandler.js' + import { pasteHandler } from './helpers/pasteHandler.js' + import { UNICODE_WHITESPACE_REGEX_GLOBAL } from './helpers/whitespace.js' -+var PRE_REGISTERED_PROTOCOLS = ["tel", "callto", "sms", "cid", "xmpp"]; -+var linkifyProtocolFlag = "__tolariaTiptapLinkifyProtocolsRegistered"; -+var linkifyGlobalObject = typeof globalThis === "undefined" ? void 0 : globalThis; ++const PRE_REGISTERED_PROTOCOLS = ['tel', 'callto', 'sms', 'cid', 'xmpp'] as const ++const linkifyProtocolFlag = '__tolariaTiptapLinkifyProtocolsRegistered' ++const linkifyGlobalObject = typeof globalThis === 'undefined' ++ ? undefined ++ : (globalThis as Record) ++ +if (linkifyGlobalObject && !linkifyGlobalObject[linkifyProtocolFlag]) { + PRE_REGISTERED_PROTOCOLS.forEach((protocol) => { -+ (0, import_linkifyjs.registerCustomProtocol)(protocol); -+ }); -+ linkifyGlobalObject[linkifyProtocolFlag] = true; ++ registerCustomProtocol(protocol) ++ }) ++ ++ linkifyGlobalObject[linkifyProtocolFlag] = true +} + - // src/helpers/autolink.ts - function isValidLinkStructure(tokens) { - if (tokens.length === 1) { -@@ -253,7 +265,8 @@ var Link = import_core3.Mark.create({ - }); - }, - onDestroy() { -- (0, import_linkifyjs3.reset)(); -+ // Tolaria keeps a single editor shell alive across note swaps, so linkify's -+ // protocol registry must survive editor teardown and remount cycles. - }, - inclusive() { - return this.options.autolink; -@@ -472,4 +473,4 @@ var index_default = Link; - isAllowedUri, - pasteRegex - }); --//# sourceMappingURL=index.cjs.map -\ No newline at end of file -+//# sourceMappingURL=index.cjs.map + export interface LinkProtocolOptions { + /** + * The protocol scheme to be registered. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 736cef1b..eb574c6f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ patchedDependencies: hash: e3726d75ed65e07adb1fd48262d6a15f8e52b1cc257177aaf632937830170c97 path: patches/@blocknote__react@0.46.2.patch '@tiptap/extension-link@3.19.0': - hash: 9bc08d5f05c6bb2ca803ed64cec4c0cccfc6a6482147131488e3426324f587de + hash: fbe59b1b8b798ba3fefa371c0729b5aa3458e1ea70a4b86cd5267f9f62529284 path: patches/@tiptap__extension-link@3.19.0.patch prosemirror-tables@1.8.5: hash: cd456f0d1d88a3ce11bcf53122a0e0575c0d82810eddd887adae21d6ec570a8b @@ -4535,7 +4535,7 @@ snapshots: '@tiptap/extension-code': 3.19.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0)) '@tiptap/extension-horizontal-rule': 3.19.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0))(@tiptap/pm@3.19.0) '@tiptap/extension-italic': 3.19.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0)) - '@tiptap/extension-link': 3.19.0(patch_hash=9bc08d5f05c6bb2ca803ed64cec4c0cccfc6a6482147131488e3426324f587de)(@tiptap/core@3.19.0(@tiptap/pm@3.19.0))(@tiptap/pm@3.19.0) + '@tiptap/extension-link': 3.19.0(patch_hash=fbe59b1b8b798ba3fefa371c0729b5aa3458e1ea70a4b86cd5267f9f62529284)(@tiptap/core@3.19.0(@tiptap/pm@3.19.0))(@tiptap/pm@3.19.0) '@tiptap/extension-paragraph': 3.19.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0)) '@tiptap/extension-strike': 3.19.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0)) '@tiptap/extension-text': 3.19.0(@tiptap/core@3.19.0(@tiptap/pm@3.19.0)) @@ -6291,7 +6291,7 @@ snapshots: dependencies: '@tiptap/core': 3.19.0(@tiptap/pm@3.19.0) - '@tiptap/extension-link@3.19.0(patch_hash=9bc08d5f05c6bb2ca803ed64cec4c0cccfc6a6482147131488e3426324f587de)(@tiptap/core@3.19.0(@tiptap/pm@3.19.0))(@tiptap/pm@3.19.0)': + '@tiptap/extension-link@3.19.0(patch_hash=fbe59b1b8b798ba3fefa371c0729b5aa3458e1ea70a4b86cd5267f9f62529284)(@tiptap/core@3.19.0(@tiptap/pm@3.19.0))(@tiptap/pm@3.19.0)': dependencies: '@tiptap/core': 3.19.0(@tiptap/pm@3.19.0) '@tiptap/pm': 3.19.0