Merge remote-tracking branch 'hub/hotfix/editor-adapter' into feature/rating
This commit is contained in:
commit
b34da48e8c
1076
package-lock.json
generated
1076
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
|
@ -14,7 +14,7 @@
|
||||||
"fix": "npm run check:code:fix && stylelint **/*.{scss,css} --fix",
|
"fix": "npm run check:code:fix && stylelint **/*.{scss,css} --fix",
|
||||||
"format": "npx @biomejs/biome format src/. --write",
|
"format": "npx @biomejs/biome format src/. --write",
|
||||||
"hygen": "HYGEN_TMPLS=gen hygen",
|
"hygen": "HYGEN_TMPLS=gen hygen",
|
||||||
"postinstall": "npm run codegen",
|
"postinstall": "npm run codegen && npx patch-package",
|
||||||
"check:code": "npx @biomejs/biome check src --log-kind=compact --verbose",
|
"check:code": "npx @biomejs/biome check src --log-kind=compact --verbose",
|
||||||
"check:code:fix": "npx @biomejs/biome check src --log-kind=compact --verbose --apply-unsafe",
|
"check:code:fix": "npx @biomejs/biome check src --log-kind=compact --verbose --apply-unsafe",
|
||||||
"lint": "npm run lint:code && stylelint **/*.{scss,css}",
|
"lint": "npm run lint:code && stylelint **/*.{scss,css}",
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
"@tiptap/extension-underline": "2.2.3",
|
"@tiptap/extension-underline": "2.2.3",
|
||||||
"@tiptap/extension-youtube": "2.2.3",
|
"@tiptap/extension-youtube": "2.2.3",
|
||||||
"@types/js-cookie": "3.0.6",
|
"@types/js-cookie": "3.0.6",
|
||||||
"@types/node": "^20.9.0",
|
"@types/node": "^20.11.0",
|
||||||
"@urql/core": "4.2.3",
|
"@urql/core": "4.2.3",
|
||||||
"@urql/devtools": "^2.0.3",
|
"@urql/devtools": "^2.0.3",
|
||||||
"babel-preset-solid": "1.8.4",
|
"babel-preset-solid": "1.8.4",
|
||||||
|
@ -97,7 +97,6 @@
|
||||||
"ga-gtag": "1.2.0",
|
"ga-gtag": "1.2.0",
|
||||||
"graphql": "16.8.1",
|
"graphql": "16.8.1",
|
||||||
"graphql-tag": "2.12.6",
|
"graphql-tag": "2.12.6",
|
||||||
"husky": "8.0.3",
|
|
||||||
"hygen": "6.2.11",
|
"hygen": "6.2.11",
|
||||||
"i18next": "22.4.15",
|
"i18next": "22.4.15",
|
||||||
"i18next-http-backend": "2.2.0",
|
"i18next-http-backend": "2.2.0",
|
||||||
|
@ -109,12 +108,13 @@
|
||||||
"loglevel": "1.8.1",
|
"loglevel": "1.8.1",
|
||||||
"loglevel-plugin-prefix": "0.8.4",
|
"loglevel-plugin-prefix": "0.8.4",
|
||||||
"nanostores": "0.9.5",
|
"nanostores": "0.9.5",
|
||||||
"prosemirror-history": "1.3.0",
|
"patch-package": "^8.0.0",
|
||||||
"prosemirror-trailing-node": "2.0.3",
|
"prosemirror-history": "1.3.2",
|
||||||
"prosemirror-view": "1.30.2",
|
"prosemirror-trailing-node": "2.0.7",
|
||||||
|
"prosemirror-view": "1.32.7",
|
||||||
"rollup": "4.11.0",
|
"rollup": "4.11.0",
|
||||||
"sass": "1.69.5",
|
"sass": "1.69.5",
|
||||||
"solid-js": "1.8.14",
|
"solid-js": "1.8.15",
|
||||||
"solid-popper": "0.3.0",
|
"solid-popper": "0.3.0",
|
||||||
"solid-tiptap": "0.7.0",
|
"solid-tiptap": "0.7.0",
|
||||||
"solid-transition-group": "0.2.3",
|
"solid-transition-group": "0.2.3",
|
||||||
|
|
62
patches/solid-tiptap+0.7.0.patch
Normal file
62
patches/solid-tiptap+0.7.0.patch
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
diff --git a/node_modules/solid-tiptap/src/Editor.tsx b/node_modules/solid-tiptap/src/Editor.tsx
|
||||||
|
index 9d1e51a..2cc36b3 100644
|
||||||
|
--- a/node_modules/solid-tiptap/src/Editor.tsx
|
||||||
|
+++ b/node_modules/solid-tiptap/src/Editor.tsx
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
import type { EditorOptions } from '@tiptap/core';
|
||||||
|
import { Editor } from '@tiptap/core';
|
||||||
|
-import { createEffect, createSignal, onCleanup } from 'solid-js';
|
||||||
|
+import { createEffect, createSignal, onCleanup, on } from 'solid-js';
|
||||||
|
|
||||||
|
export type EditorRef = Editor | ((editor: Editor) => void);
|
||||||
|
|
||||||
|
@@ -42,17 +42,19 @@ export default function useEditor<T extends HTMLElement>(
|
||||||
|
): () => Editor | undefined {
|
||||||
|
const [signal, setSignal] = createSignal<Editor>();
|
||||||
|
|
||||||
|
- createEffect(() => {
|
||||||
|
- const instance = new Editor({
|
||||||
|
- ...props(),
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- onCleanup(() => {
|
||||||
|
- instance.destroy();
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- setSignal(instance);
|
||||||
|
- });
|
||||||
|
+ createEffect(
|
||||||
|
+ on(
|
||||||
|
+ props,
|
||||||
|
+ (properties) => {
|
||||||
|
+ if (properties) {
|
||||||
|
+ const instance = new Editor({ ...properties })
|
||||||
|
+ onCleanup(instance.destroy)
|
||||||
|
+ setSignal(instance)
|
||||||
|
+ }
|
||||||
|
+ },
|
||||||
|
+ { defer: true }
|
||||||
|
+ )
|
||||||
|
+ )
|
||||||
|
|
||||||
|
return signal;
|
||||||
|
}
|
||||||
|
@@ -65,14 +67,16 @@ export function useEditorHTML<V extends Editor | undefined>(
|
||||||
|
|
||||||
|
export function useEditorJSON<
|
||||||
|
V extends Editor | undefined,
|
||||||
|
- R extends Record<string, any>,
|
||||||
|
+ // biome-ignore lint/suspicious/noExplicitAny: TODO: <explanation>
|
||||||
|
+R extends Record<string, any>,
|
||||||
|
>(editor: () => V): () => R | undefined {
|
||||||
|
return createEditorTransaction(editor, instance => instance?.getJSON() as R);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useEditorIsActive<
|
||||||
|
V extends Editor | undefined,
|
||||||
|
- R extends Record<string, any>,
|
||||||
|
+ // biome-ignore lint/suspicious/noExplicitAny: TODO: <explanation>
|
||||||
|
+R extends Record<string, any>,
|
||||||
|
>(
|
||||||
|
editor: () => V,
|
||||||
|
...args: [name: () => string, options?: R] | [options: R]
|
Loading…
Reference in New Issue
Block a user