@clevertask/scribe 0.0.7 → 0.0.9

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/main.js CHANGED
@@ -1,10 +1,12 @@
1
- import { Scribe as m } from "./components/Scribe/index.js";
2
- import { html2md as e } from "./utils/html-to-markdown.js";
1
+ import { Scribe as e } from "./components/Scribe/index.js";
2
+ import { html2md as m } from "./utils/html-to-markdown.js";
3
3
  import { md2html as f } from "./utils/markdown-to-html.js";
4
- import { isInViewport as i } from "./utils/is-in-viewport.js";
4
+ import { isInViewport as x } from "./utils/is-in-viewport.js";
5
+ import { createScribeEditor as d } from "./utils/create-scribe-editor.js";
5
6
  export {
6
- m as Scribe,
7
- e as html2md,
8
- i as isInViewport,
7
+ e as Scribe,
8
+ d as createScribeEditor,
9
+ m as html2md,
10
+ x as isInViewport,
9
11
  f as md2html
10
12
  };
@@ -0,0 +1,11 @@
1
+ import { Editor } from '@tiptap/core';
2
+ export type CreateEditorOptions = {
3
+ content?: string;
4
+ editable?: boolean;
5
+ onContentChange?: (content: {
6
+ htmlContent: string;
7
+ jsonContent: any;
8
+ markdownContent: string;
9
+ }) => void;
10
+ };
11
+ export declare function createScribeEditor({ content, editable, onContentChange }: CreateEditorOptions): Editor;
@@ -0,0 +1,26 @@
1
+ import { E as i } from "../index-Gm-3o3nq.js";
2
+ import { initExtensions as n } from "../components/Scribe/extension/index.js";
3
+ import { html2md as s } from "./html-to-markdown.js";
4
+ import "../browser-DEobZXxB.js";
5
+ function c({ content: r = "", editable: e = !1, onContentChange: o }) {
6
+ return new i({
7
+ content: r,
8
+ editable: e,
9
+ extensions: n({}),
10
+ onUpdate({ editor: t }) {
11
+ o && o({
12
+ htmlContent: t.getHTML(),
13
+ jsonContent: t.getJSON(),
14
+ markdownContent: s(t.getHTML())
15
+ });
16
+ },
17
+ editorProps: {
18
+ attributes: {
19
+ class: "scribe"
20
+ }
21
+ }
22
+ });
23
+ }
24
+ export {
25
+ c as createScribeEditor
26
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './html-to-markdown';
2
2
  export * from './markdown-to-html';
3
3
  export * from './is-in-viewport';
4
+ export * from './create-scribe-editor';
@@ -1,8 +1,10 @@
1
- import { html2md as r } from "./html-to-markdown.js";
2
- import { md2html as e } from "./markdown-to-html.js";
1
+ import { html2md as t } from "./html-to-markdown.js";
2
+ import { md2html as m } from "./markdown-to-html.js";
3
3
  import { isInViewport as f } from "./is-in-viewport.js";
4
+ import { createScribeEditor as x } from "./create-scribe-editor.js";
4
5
  export {
5
- r as html2md,
6
+ x as createScribeEditor,
7
+ t as html2md,
6
8
  f as isInViewport,
7
- e as md2html
9
+ m as md2html
8
10
  };
@@ -1,4 +1,4 @@
1
- import { D as s, m } from "../browser-Ce149ePN.js";
1
+ import { D as s, m } from "../browser-DEobZXxB.js";
2
2
  const e = (a) => s.sanitize(m.parse(a, { async: !1 }));
3
3
  export {
4
4
  e as md2html
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A Tiptap-based rich text editor with a Notion-style block interface for viewing and creating content. Perfect for diverse needs like notes, documents, AI chat, Markdown parsing, and comments.",
4
4
  "author": "CleverTask",
5
5
  "private": false,
6
- "version": "0.0.7",
6
+ "version": "0.0.9",
7
7
  "type": "module",
8
8
  "main": "dist/main.js",
9
9
  "types": "dist/main.d.ts",