From e8ea6aecc512d901cdbf30036a2e9f75a7d3fbc8 Mon Sep 17 00:00:00 2001 From: Amir Angel <36531255+17Amir17@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:38:14 +0300 Subject: [PATCH 1/2] fix: expose internal tiptap view/state --- example/src/Examples/Advanced/editor-web/vite.config.ts | 9 +++++++++ src/webEditorUtils/index.ts | 4 ++++ website/docs/setup/advancedSetup.md | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/example/src/Examples/Advanced/editor-web/vite.config.ts b/example/src/Examples/Advanced/editor-web/vite.config.ts index ee1f0c5..dfcfba4 100644 --- a/example/src/Examples/Advanced/editor-web/vite.config.ts +++ b/example/src/Examples/Advanced/editor-web/vite.config.ts @@ -16,6 +16,15 @@ export default defineConfig({ find: '@10play/tentap-editor', replacement: resolve(__dirname, '../../../../../src/webEditorUtils'), }, + // We alias tiptap view and state to use the internal version of tiptap to avoid this error https://github.com/ueberdosis/tiptap/issues/3869#issuecomment-2167931620 + { + find: '@tiptap/pm/view', + replacement: '@10play/tentap-editor/web', + }, + { + find: '@tiptap/pm/state', + replacement: '@10play/tentap-editor/web', + }, ], }, plugins: [react(), viteSingleFile()], diff --git a/src/webEditorUtils/index.ts b/src/webEditorUtils/index.ts index 19aa747..210f247 100644 --- a/src/webEditorUtils/index.ts +++ b/src/webEditorUtils/index.ts @@ -21,3 +21,7 @@ export { StrikeBridge } from '../bridges/strike'; export { TaskListBridge } from '../bridges/tasklist'; export { UnderlineBridge } from '../bridges/underline'; export { HardBreakBridge } from '../bridges/br'; + +// We are exposing tiptap view + state here to avoid this error https://github.com/ueberdosis/tiptap/issues/3869#issuecomment-2167931620 +export * from '@tiptap/pm/view'; +export * from '@tiptap/pm/state'; diff --git a/website/docs/setup/advancedSetup.md b/website/docs/setup/advancedSetup.md index 381503b..1d710d5 100644 --- a/website/docs/setup/advancedSetup.md +++ b/website/docs/setup/advancedSetup.md @@ -174,6 +174,15 @@ export default defineConfig({ find: '@10play/tentap-editor', // On our web bundle we only want to include web related code replacement: '@10play/tentap-editor/web', }, + // We alias tiptap view and state to use the internal version of tiptap to avoid this error https://github.com/ueberdostiptap/issues/3869#issuecomment-2167931620 + { + find: '@tiptap/pm/view', + replacement: '@10play/tentap-editor/web', + }, + { + find: '@tiptap/pm/state', + replacement: '@10play/tentap-editor/web', + }, ], }, plugins: [react(), viteSingleFile()], From cf37ceacc6c4dbaee95a8722e95df86677a3785e Mon Sep 17 00:00:00 2001 From: Amir Angel <36531255+17Amir17@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:46:01 +0300 Subject: [PATCH 2/2] fix: advanced example --- example/ios/Podfile.lock | 4 +- .../Advanced/editor-web/build/editorHtml.ts | 65 ++++++++++--------- .../Advanced/editor-web/vite.config.ts | 8 +-- 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 8280445..a423471 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1124,7 +1124,7 @@ PODS: - RNSVG (14.1.0): - React-Core - SocketRocket (0.6.1) - - tentap (0.5.2): + - tentap (0.5.15): - glog - RCT-Folly (= 2022.05.16.00) - React-Core @@ -1400,7 +1400,7 @@ SPEC CHECKSUMS: RNScreens: 17e2f657f1b09a71ec3c821368a04acbb7ebcb46 RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - tentap: cd55c8d991abd94603ec17e5304b62a1e36a4cf0 + tentap: b5b76471ae0e1ad1f05ffd5bacabf4622c07a667 Yoga: 9e6a04eacbd94f97d94577017e9f23b3ab41cf6c PODFILE CHECKSUM: 59f02bbde682eb22b765a58d4a0ce59d95964282 diff --git a/example/src/Examples/Advanced/editor-web/build/editorHtml.ts b/example/src/Examples/Advanced/editor-web/build/editorHtml.ts index 0018721..e03ff5d 100644 --- a/example/src/Examples/Advanced/editor-web/build/editorHtml.ts +++ b/example/src/Examples/Advanced/editor-web/build/editorHtml.ts @@ -7,7 +7,7 @@ export const editorHtml = String.raw` RichTextEditor diff --git a/example/src/Examples/Advanced/editor-web/vite.config.ts b/example/src/Examples/Advanced/editor-web/vite.config.ts index dfcfba4..fc4bcbf 100644 --- a/example/src/Examples/Advanced/editor-web/vite.config.ts +++ b/example/src/Examples/Advanced/editor-web/vite.config.ts @@ -1,4 +1,3 @@ -import { resolve } from 'path'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { viteSingleFile } from 'vite-plugin-singlefile'; @@ -14,13 +13,10 @@ export default defineConfig({ alias: [ { find: '@10play/tentap-editor', - replacement: resolve(__dirname, '../../../../../src/webEditorUtils'), - }, - // We alias tiptap view and state to use the internal version of tiptap to avoid this error https://github.com/ueberdosis/tiptap/issues/3869#issuecomment-2167931620 - { - find: '@tiptap/pm/view', replacement: '@10play/tentap-editor/web', }, + // We alias tiptap view and state to use the internal version of tiptap to avoid this error https://github.com/ueberdosis/tiptap/issues/3869#issuecomment-2167931620 { + { find: '@tiptap/pm/view', replacement: '@10play/tentap-editor/web' }, { find: '@tiptap/pm/state', replacement: '@10play/tentap-editor/web',