@formulaxjs/tiptap 0.4.0 → 0.4.1

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,79 @@
1
+ import { Node } from '@tiptap/core';
2
+ import { FormulaDoc } from '@formulaxjs/core';
3
+ import { FormulaXEditorPreloadMode, FormulaXEditorOptions } from '@formulaxjs/editor';
4
+ import { FormulaRenderer } from '@formulaxjs/renderer';
5
+
6
+ interface FormulaXPayload {
7
+ latex: string;
8
+ }
9
+ interface FormulaXTiptapOptions {
10
+ name?: string;
11
+ formulaClassName?: string;
12
+ formulaAttributeName?: string;
13
+ cursorStyle?: string;
14
+ initialLatex?: string;
15
+ renderer?: FormulaRenderer;
16
+ preload?: FormulaXEditorPreloadMode;
17
+ modal?: {
18
+ title?: string;
19
+ insertText?: string;
20
+ updateText?: string;
21
+ cancelText?: string;
22
+ closeOnBackdrop?: boolean;
23
+ };
24
+ editor?: Omit<FormulaXEditorOptions, 'initialLatex'>;
25
+ }
26
+ interface RequiredFormulaXTiptapOptions {
27
+ name: string;
28
+ formulaClassName: string;
29
+ formulaAttributeName: string;
30
+ cursorStyle: string;
31
+ initialLatex: string;
32
+ renderer: FormulaRenderer;
33
+ preload: FormulaXEditorPreloadMode;
34
+ modal: {
35
+ title: string;
36
+ insertText: string;
37
+ updateText: string;
38
+ cancelText: string;
39
+ closeOnBackdrop: boolean;
40
+ };
41
+ editor: {
42
+ height: number | string;
43
+ autofocus: boolean;
44
+ locale: FormulaXEditorOptions['locale'];
45
+ assets: FormulaXEditorOptions['assets'];
46
+ render: {
47
+ fontsize: number;
48
+ };
49
+ };
50
+ }
51
+
52
+ interface OpenFormulaXTiptapModalInput {
53
+ initialLatex: string;
54
+ isUpdate: boolean;
55
+ options: RequiredFormulaXTiptapOptions;
56
+ }
57
+ declare function openFormulaXTiptapModal(input: OpenFormulaXTiptapModalInput): Promise<FormulaXPayload | null>;
58
+
59
+ interface FormulaXNodeAttributes {
60
+ latex: string;
61
+ }
62
+ declare const FORMULAX_NODE_NAME = "formulaX";
63
+ declare module '@tiptap/core' {
64
+ interface Commands<ReturnType> {
65
+ formulaX: {
66
+ openFormulaX: () => ReturnType;
67
+ };
68
+ }
69
+ }
70
+ declare function resolveOptions(options?: FormulaXTiptapOptions): RequiredFormulaXTiptapOptions;
71
+ interface TiptapNodeFactory {
72
+ create: typeof Node.create;
73
+ }
74
+ declare function createFormulaXNode(nodeFactory?: TiptapNodeFactory, options?: FormulaXTiptapOptions): any;
75
+ declare const FormulaXNode: any;
76
+ declare const createFormulaXPayload: (latex: string) => FormulaDoc;
77
+ declare const serializeFormulaXPayload: (doc: FormulaDoc) => string;
78
+
79
+ export { FORMULAX_NODE_NAME, FormulaXNode, type FormulaXNodeAttributes, type FormulaXPayload, type FormulaXTiptapOptions, type RequiredFormulaXTiptapOptions, type TiptapNodeFactory, createFormulaXNode, createFormulaXPayload, openFormulaXTiptapModal, resolveOptions, serializeFormulaXPayload };
@@ -0,0 +1,79 @@
1
+ import { Node } from '@tiptap/core';
2
+ import { FormulaDoc } from '@formulaxjs/core';
3
+ import { FormulaXEditorPreloadMode, FormulaXEditorOptions } from '@formulaxjs/editor';
4
+ import { FormulaRenderer } from '@formulaxjs/renderer';
5
+
6
+ interface FormulaXPayload {
7
+ latex: string;
8
+ }
9
+ interface FormulaXTiptapOptions {
10
+ name?: string;
11
+ formulaClassName?: string;
12
+ formulaAttributeName?: string;
13
+ cursorStyle?: string;
14
+ initialLatex?: string;
15
+ renderer?: FormulaRenderer;
16
+ preload?: FormulaXEditorPreloadMode;
17
+ modal?: {
18
+ title?: string;
19
+ insertText?: string;
20
+ updateText?: string;
21
+ cancelText?: string;
22
+ closeOnBackdrop?: boolean;
23
+ };
24
+ editor?: Omit<FormulaXEditorOptions, 'initialLatex'>;
25
+ }
26
+ interface RequiredFormulaXTiptapOptions {
27
+ name: string;
28
+ formulaClassName: string;
29
+ formulaAttributeName: string;
30
+ cursorStyle: string;
31
+ initialLatex: string;
32
+ renderer: FormulaRenderer;
33
+ preload: FormulaXEditorPreloadMode;
34
+ modal: {
35
+ title: string;
36
+ insertText: string;
37
+ updateText: string;
38
+ cancelText: string;
39
+ closeOnBackdrop: boolean;
40
+ };
41
+ editor: {
42
+ height: number | string;
43
+ autofocus: boolean;
44
+ locale: FormulaXEditorOptions['locale'];
45
+ assets: FormulaXEditorOptions['assets'];
46
+ render: {
47
+ fontsize: number;
48
+ };
49
+ };
50
+ }
51
+
52
+ interface OpenFormulaXTiptapModalInput {
53
+ initialLatex: string;
54
+ isUpdate: boolean;
55
+ options: RequiredFormulaXTiptapOptions;
56
+ }
57
+ declare function openFormulaXTiptapModal(input: OpenFormulaXTiptapModalInput): Promise<FormulaXPayload | null>;
58
+
59
+ interface FormulaXNodeAttributes {
60
+ latex: string;
61
+ }
62
+ declare const FORMULAX_NODE_NAME = "formulaX";
63
+ declare module '@tiptap/core' {
64
+ interface Commands<ReturnType> {
65
+ formulaX: {
66
+ openFormulaX: () => ReturnType;
67
+ };
68
+ }
69
+ }
70
+ declare function resolveOptions(options?: FormulaXTiptapOptions): RequiredFormulaXTiptapOptions;
71
+ interface TiptapNodeFactory {
72
+ create: typeof Node.create;
73
+ }
74
+ declare function createFormulaXNode(nodeFactory?: TiptapNodeFactory, options?: FormulaXTiptapOptions): any;
75
+ declare const FormulaXNode: any;
76
+ declare const createFormulaXPayload: (latex: string) => FormulaDoc;
77
+ declare const serializeFormulaXPayload: (doc: FormulaDoc) => string;
78
+
79
+ export { FORMULAX_NODE_NAME, FormulaXNode, type FormulaXNodeAttributes, type FormulaXPayload, type FormulaXTiptapOptions, type RequiredFormulaXTiptapOptions, type TiptapNodeFactory, createFormulaXNode, createFormulaXPayload, openFormulaXTiptapModal, resolveOptions, serializeFormulaXPayload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formulaxjs/tiptap",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "require": "./dist/index.cjs"
28
28
  }
29
29
  },
30
- "unpkg": "./dist/browser/index.global.js",
30
+ "unpkg": "./dist/index.global.js",
31
31
  "files": [
32
32
  "dist"
33
33
  ],
@@ -35,10 +35,10 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@formulaxjs/core": "0.1.0",
39
- "@formulaxjs/editor": "0.4.0",
40
- "@formulaxjs/renderer-kity": "0.3.0",
41
- "@formulaxjs/renderer": "0.2.0"
38
+ "@formulaxjs/core": "0.1.1",
39
+ "@formulaxjs/renderer-kity": "0.3.1",
40
+ "@formulaxjs/editor": "0.4.1",
41
+ "@formulaxjs/renderer": "0.2.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@tiptap/core": ">=2 <4"