@elia-ori/editor 0.1.25 → 0.1.27

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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _tiptap_core from '@tiptap/core';
2
3
  import { JSONContent, Node } from '@tiptap/core';
3
4
  import { NodeType } from '@tiptap/pm/model';
5
+ import * as _tiptap_extension_image from '@tiptap/extension-image';
6
+ import * as _tiptap_extension_table from '@tiptap/extension-table';
7
+ import * as _tiptap_extension_text_style from '@tiptap/extension-text-style';
8
+ import * as _tiptap_extension_superscript from '@tiptap/extension-superscript';
9
+ import * as _tiptap_extension_typography from '@tiptap/extension-typography';
10
+ import * as _tiptap_extension_highlight from '@tiptap/extension-highlight';
11
+ import * as _tiptap_extension_list from '@tiptap/extension-list';
12
+ import * as _tiptap_extension_text_align from '@tiptap/extension-text-align';
13
+ import * as _tiptap_starter_kit from '@tiptap/starter-kit';
14
+ import * as _tiptap_extension_horizontal_rule from '@tiptap/extension-horizontal-rule';
4
15
 
5
16
  type UploadFunction = (file: File, onProgress?: (event: {
6
17
  progress: number;
@@ -96,4 +107,16 @@ declare module "@tiptap/core" {
96
107
  }
97
108
  declare const Callout: Node<CalloutOptions, any>;
98
109
 
99
- export { Callout, type CalloutOptions, type CalloutType, EliaEditor, type EliaEditorProps, EliaEditor as SimpleEditor, type ToolbarItem, type UploadFunction };
110
+ /**
111
+ * Extensions needed for rendering editor content.
112
+ * Use this with generateHTML() to render JSONContent to HTML.
113
+ */
114
+ declare const contentExtensions: (_tiptap_core.Node<CalloutOptions, any> | _tiptap_core.Node<_tiptap_extension_horizontal_rule.HorizontalRuleOptions, any> | _tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_text_align.TextAlignOptions, any> | _tiptap_core.Node<_tiptap_extension_list.TaskListOptions, any> | _tiptap_core.Node<_tiptap_extension_list.TaskItemOptions, any> | _tiptap_core.Mark<_tiptap_extension_highlight.HighlightOptions, any> | _tiptap_core.Extension<_tiptap_extension_typography.TypographyOptions, any> | _tiptap_core.Mark<_tiptap_extension_superscript.SuperscriptExtensionOptions, any> | _tiptap_core.Mark<_tiptap_extension_text_style.TextStyleOptions, any> | _tiptap_core.Extension<_tiptap_extension_text_style.ColorOptions, any> | _tiptap_core.Node<_tiptap_extension_table.TableOptions, any> | _tiptap_core.Node<_tiptap_extension_table.TableRowOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
115
+ /**
116
+ * Generate HTML from editor JSON content.
117
+ * @param content - The JSONContent from EliaEditor
118
+ * @returns HTML string
119
+ */
120
+ declare function generateEditorHTML(content: JSONContent): string;
121
+
122
+ export { Callout, type CalloutOptions, type CalloutType, EliaEditor, type EliaEditorProps, EliaEditor as SimpleEditor, type ToolbarItem, type UploadFunction, contentExtensions, generateEditorHTML };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,17 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _tiptap_core from '@tiptap/core';
2
3
  import { JSONContent, Node } from '@tiptap/core';
3
4
  import { NodeType } from '@tiptap/pm/model';
5
+ import * as _tiptap_extension_image from '@tiptap/extension-image';
6
+ import * as _tiptap_extension_table from '@tiptap/extension-table';
7
+ import * as _tiptap_extension_text_style from '@tiptap/extension-text-style';
8
+ import * as _tiptap_extension_superscript from '@tiptap/extension-superscript';
9
+ import * as _tiptap_extension_typography from '@tiptap/extension-typography';
10
+ import * as _tiptap_extension_highlight from '@tiptap/extension-highlight';
11
+ import * as _tiptap_extension_list from '@tiptap/extension-list';
12
+ import * as _tiptap_extension_text_align from '@tiptap/extension-text-align';
13
+ import * as _tiptap_starter_kit from '@tiptap/starter-kit';
14
+ import * as _tiptap_extension_horizontal_rule from '@tiptap/extension-horizontal-rule';
4
15
 
5
16
  type UploadFunction = (file: File, onProgress?: (event: {
6
17
  progress: number;
@@ -96,4 +107,16 @@ declare module "@tiptap/core" {
96
107
  }
97
108
  declare const Callout: Node<CalloutOptions, any>;
98
109
 
99
- export { Callout, type CalloutOptions, type CalloutType, EliaEditor, type EliaEditorProps, EliaEditor as SimpleEditor, type ToolbarItem, type UploadFunction };
110
+ /**
111
+ * Extensions needed for rendering editor content.
112
+ * Use this with generateHTML() to render JSONContent to HTML.
113
+ */
114
+ declare const contentExtensions: (_tiptap_core.Node<CalloutOptions, any> | _tiptap_core.Node<_tiptap_extension_horizontal_rule.HorizontalRuleOptions, any> | _tiptap_core.Extension<_tiptap_starter_kit.StarterKitOptions, any> | _tiptap_core.Extension<_tiptap_extension_text_align.TextAlignOptions, any> | _tiptap_core.Node<_tiptap_extension_list.TaskListOptions, any> | _tiptap_core.Node<_tiptap_extension_list.TaskItemOptions, any> | _tiptap_core.Mark<_tiptap_extension_highlight.HighlightOptions, any> | _tiptap_core.Extension<_tiptap_extension_typography.TypographyOptions, any> | _tiptap_core.Mark<_tiptap_extension_superscript.SuperscriptExtensionOptions, any> | _tiptap_core.Mark<_tiptap_extension_text_style.TextStyleOptions, any> | _tiptap_core.Extension<_tiptap_extension_text_style.ColorOptions, any> | _tiptap_core.Node<_tiptap_extension_table.TableOptions, any> | _tiptap_core.Node<_tiptap_extension_table.TableRowOptions, any> | _tiptap_core.Node<_tiptap_extension_image.ImageOptions, any>)[];
115
+ /**
116
+ * Generate HTML from editor JSON content.
117
+ * @param content - The JSONContent from EliaEditor
118
+ * @returns HTML string
119
+ */
120
+ declare function generateEditorHTML(content: JSONContent): string;
121
+
122
+ export { Callout, type CalloutOptions, type CalloutType, EliaEditor, type EliaEditorProps, EliaEditor as SimpleEditor, type ToolbarItem, type UploadFunction, contentExtensions, generateEditorHTML };
package/dist/index.js CHANGED
@@ -6333,9 +6333,52 @@ function EliaEditor({
6333
6333
  }
6334
6334
  );
6335
6335
  }
6336
+
6337
+ // src/utils/content-renderer.ts
6338
+ import { generateHTML } from "@tiptap/core";
6339
+ import StarterKit2 from "@tiptap/starter-kit";
6340
+ import { TextAlign as TextAlign2 } from "@tiptap/extension-text-align";
6341
+ import { TaskItem as TaskItem2, TaskList as TaskList2 } from "@tiptap/extension-list";
6342
+ import { Highlight as Highlight2 } from "@tiptap/extension-highlight";
6343
+ import { Typography as Typography2 } from "@tiptap/extension-typography";
6344
+ import { Superscript as Superscript2 } from "@tiptap/extension-superscript";
6345
+ import { Subscript as Subscript2 } from "@tiptap/extension-subscript";
6346
+ import { TextStyle as TextStyle2 } from "@tiptap/extension-text-style";
6347
+ import { Color as Color2 } from "@tiptap/extension-color";
6348
+ import { Table as Table2 } from "@tiptap/extension-table";
6349
+ import { TableRow as TableRow2 } from "@tiptap/extension-table-row";
6350
+ import { TableHeader as TableHeader2 } from "@tiptap/extension-table-header";
6351
+ import { TableCell as TableCell2 } from "@tiptap/extension-table-cell";
6352
+ import ImageResize2 from "tiptap-extension-resize-image";
6353
+ var contentExtensions = [
6354
+ StarterKit2.configure({
6355
+ horizontalRule: false
6356
+ }),
6357
+ HorizontalRule,
6358
+ TextAlign2.configure({ types: ["heading", "paragraph"] }),
6359
+ TaskList2,
6360
+ TaskItem2.configure({ nested: true }),
6361
+ Highlight2.configure({ multicolor: true }),
6362
+ Typography2,
6363
+ Superscript2,
6364
+ Subscript2,
6365
+ TextStyle2,
6366
+ Color2,
6367
+ Table2.configure({ resizable: true }),
6368
+ TableRow2,
6369
+ TableHeader2,
6370
+ TableCell2,
6371
+ ImageResize2.configure({ allowBase64: true }),
6372
+ Callout
6373
+ ];
6374
+ function generateEditorHTML(content) {
6375
+ return generateHTML(content, contentExtensions);
6376
+ }
6336
6377
  export {
6337
6378
  Callout,
6338
6379
  EliaEditor,
6339
- EliaEditor as SimpleEditor
6380
+ EliaEditor as SimpleEditor,
6381
+ contentExtensions,
6382
+ generateEditorHTML
6340
6383
  };
6341
6384
  //# sourceMappingURL=index.js.map