@cyberyozh/text-editor 0.5.3 → 0.5.4

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.
@@ -0,0 +1,28 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ export { JSONContent } from '@tiptap/core';
3
+
4
+ interface SharedExtensionsOptions {
5
+ /**
6
+ * Domains (with all their subdomains) of the site the content belongs to —
7
+ * see the ownDomains option of LinkExtension.
8
+ */
9
+ ownDomains?: string[];
10
+ /**
11
+ * Domains (with all their subdomains) whose links are treated as internal —
12
+ * see the trustedDomains option of LinkExtension.
13
+ */
14
+ trustedDomains?: string[];
15
+ }
16
+
17
+ /**
18
+ * HTML entry point for @cyberyozh/text-editor
19
+ *
20
+ * Converts Tiptap JSON content to HTML and back with the full set of content extensions.
21
+ * Server-side only: parses with happy-dom, no React and no stylesheets, so it is safe for
22
+ * server code, scripts and tests. Broken HTML throws instead of returning an empty document.
23
+ */
24
+
25
+ declare function tiptapContentToHtml(content: JSONContent, options?: SharedExtensionsOptions): string;
26
+ declare function htmlToTiptapContent(html: string, options?: SharedExtensionsOptions): JSONContent;
27
+
28
+ export { type SharedExtensionsOptions, htmlToTiptapContent, tiptapContentToHtml };
package/dist/html.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ export { JSONContent } from '@tiptap/core';
3
+
4
+ interface SharedExtensionsOptions {
5
+ /**
6
+ * Domains (with all their subdomains) of the site the content belongs to —
7
+ * see the ownDomains option of LinkExtension.
8
+ */
9
+ ownDomains?: string[];
10
+ /**
11
+ * Domains (with all their subdomains) whose links are treated as internal —
12
+ * see the trustedDomains option of LinkExtension.
13
+ */
14
+ trustedDomains?: string[];
15
+ }
16
+
17
+ /**
18
+ * HTML entry point for @cyberyozh/text-editor
19
+ *
20
+ * Converts Tiptap JSON content to HTML and back with the full set of content extensions.
21
+ * Server-side only: parses with happy-dom, no React and no stylesheets, so it is safe for
22
+ * server code, scripts and tests. Broken HTML throws instead of returning an empty document.
23
+ */
24
+
25
+ declare function tiptapContentToHtml(content: JSONContent, options?: SharedExtensionsOptions): string;
26
+ declare function htmlToTiptapContent(html: string, options?: SharedExtensionsOptions): JSONContent;
27
+
28
+ export { type SharedExtensionsOptions, htmlToTiptapContent, tiptapContentToHtml };