@docen/tiptap-extensions 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -125,20 +125,30 @@ import type {
125
125
  **Content Nodes:**
126
126
 
127
127
  ```typescript
128
- // Paragraph with text alignment
128
+ // Paragraph with text alignment and spacing
129
129
  interface ParagraphNode {
130
130
  type: "paragraph";
131
131
  attrs?: {
132
132
  textAlign?: "left" | "right" | "center" | "justify";
133
+ indentLeft?: number;
134
+ indentRight?: number;
135
+ indentFirstLine?: number;
136
+ spacingBefore?: number;
137
+ spacingAfter?: number;
133
138
  };
134
139
  content?: Array<TextContent>;
135
140
  }
136
141
 
137
- // Heading with level
142
+ // Heading with level and spacing
138
143
  interface HeadingNode {
139
144
  type: "heading";
140
145
  attrs: {
141
146
  level: 1 | 2 | 3 | 4 | 5 | 6;
147
+ indentLeft?: number;
148
+ indentRight?: number;
149
+ indentFirstLine?: number;
150
+ spacingBefore?: number;
151
+ spacingAfter?: number;
142
152
  };
143
153
  content?: Array<TextContent>;
144
154
  }
@@ -163,7 +173,9 @@ interface ImageNode {
163
173
  title?: string | null;
164
174
  width?: number | null;
165
175
  height?: number | null;
166
- rotation?: number; // Additional attribute: rotation in degrees (not in TipTap core)
176
+ rotation?: number; // Rotation in degrees (not in TipTap core)
177
+ floating?: ImageFloatingOptions; // Floating positioning options (not in TipTap core)
178
+ outline?: ImageOutlineOptions; // Border/outline options (not in TipTap core)
167
179
  };
168
180
  }
169
181
  ```
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const o=require("@tiptap/extension-blockquote"),r=require("@tiptap/extension-bullet-list"),m=require("@tiptap/extension-code-block-lowlight"),extensionDetails=require("@tiptap/extension-details"),e=require("@tiptap/extension-document"),f=require("@tiptap/extension-emoji"),a=require("@tiptap/extension-hard-break"),l=require("@tiptap/extension-heading"),n=require("@tiptap/extension-horizontal-rule"),extensionImage=require("@tiptap/extension-image"),c=require("@tiptap/extension-list-item"),extensionMathematics=require("@tiptap/extension-mathematics"),k=require("@tiptap/extension-ordered-list"),g=require("@tiptap/extension-paragraph"),extensionTable=require("@tiptap/extension-table"),x=require("@tiptap/extension-table-cell"),T=require("@tiptap/extension-table-header"),L=require("@tiptap/extension-table-row"),h=require("@tiptap/extension-task-list"),B=require("@tiptap/extension-task-item"),C=require("@tiptap/extension-text"),H=require("@tiptap/extension-bold"),S=require("@tiptap/extension-code"),b=require("@tiptap/extension-highlight"),D=require("@tiptap/extension-italic"),E=require("@tiptap/extension-link"),I=require("@tiptap/extension-strike"),y=require("@tiptap/extension-subscript"),F=require("@tiptap/extension-superscript"),extensionTextStyle=require("@tiptap/extension-text-style"),z=require("@tiptap/extension-underline");function _interopDefaultCompat(t){return t&&typeof t=="object"&&"default"in t?t.default:t}const o__default=_interopDefaultCompat(o),r__default=_interopDefaultCompat(r),m__default=_interopDefaultCompat(m),e__default=_interopDefaultCompat(e),f__default=_interopDefaultCompat(f),a__default=_interopDefaultCompat(a),l__default=_interopDefaultCompat(l),n__default=_interopDefaultCompat(n),c__default=_interopDefaultCompat(c),k__default=_interopDefaultCompat(k),g__default=_interopDefaultCompat(g),x__default=_interopDefaultCompat(x),T__default=_interopDefaultCompat(T),L__default=_interopDefaultCompat(L),h__default=_interopDefaultCompat(h),B__default=_interopDefaultCompat(B),C__default=_interopDefaultCompat(C),H__default=_interopDefaultCompat(H),S__default=_interopDefaultCompat(S),b__default=_interopDefaultCompat(b),D__default=_interopDefaultCompat(D),E__default=_interopDefaultCompat(E),I__default=_interopDefaultCompat(I),y__default=_interopDefaultCompat(y),F__default=_interopDefaultCompat(F),z__default=_interopDefaultCompat(z),Image=extensionImage.Image.extend({addAttributes(){return{...this.parent?.(),rotation:{default:null}}},parseHTML(){return[{tag:"img[src]",getAttributes:t=>{const i={src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:t.getAttribute("width"),height:t.getAttribute("height")},s=(t.getAttribute("style")||"").match(/transform:\s*rotate\(([\d.]+)deg\)/);return s?{...i,rotation:parseFloat(s[1])}:i}}]},renderHTML({HTMLAttributes:t}){const{rotation:i,...s}=t;if(i){const p=s.style||"";s.style=p?`${p}; transform: rotate(${i}deg)`:`transform: rotate(${i}deg)`}return["img",s]}}),tiptapNodeExtensions=[e__default,g__default,C__default,a__default,o__default,k__default,r__default,c__default,m__default,extensionDetails.Details,extensionDetails.DetailsSummary,extensionDetails.DetailsContent,f__default,n__default,Image,extensionMathematics.Mathematics,extensionTable.Table,L__default,x__default,T__default,h__default,B__default,l__default],tiptapMarkExtensions=[H__default,S__default,b__default,D__default,E__default,I__default,y__default,F__default,extensionTextStyle.TextStyle,z__default,extensionTextStyle.Color,extensionTextStyle.BackgroundColor,extensionTextStyle.FontFamily,extensionTextStyle.FontSize,extensionTextStyle.LineHeight],tiptapExtensions=[...tiptapNodeExtensions,...tiptapMarkExtensions];exports.tiptapExtensions=tiptapExtensions,exports.tiptapMarkExtensions=tiptapMarkExtensions,exports.tiptapNodeExtensions=tiptapNodeExtensions;
1
+ "use strict";const o=require("@tiptap/extension-blockquote"),r=require("@tiptap/extension-bullet-list"),t=require("@tiptap/extension-code-block-lowlight"),extensionDetails=require("@tiptap/extension-details"),p=require("@tiptap/extension-document"),f=require("@tiptap/extension-emoji"),a=require("@tiptap/extension-hard-break"),extensionHeading=require("@tiptap/extension-heading"),x=require("@tiptap/extension-horizontal-rule"),extensionImage=require("@tiptap/extension-image"),n=require("@tiptap/extension-list-item"),extensionMathematics=require("@tiptap/extension-mathematics"),c=require("@tiptap/extension-ordered-list"),extensionParagraph=require("@tiptap/extension-paragraph"),extensionTable=require("@tiptap/extension-table"),g=require("@tiptap/extension-table-cell"),T=require("@tiptap/extension-table-header"),L=require("@tiptap/extension-table-row"),h=require("@tiptap/extension-task-list"),B=require("@tiptap/extension-task-item"),C=require("@tiptap/extension-text"),H=require("@tiptap/extension-bold"),S=require("@tiptap/extension-code"),b=require("@tiptap/extension-highlight"),D=require("@tiptap/extension-italic"),I=require("@tiptap/extension-link"),y=require("@tiptap/extension-strike"),F=require("@tiptap/extension-subscript"),E=require("@tiptap/extension-superscript"),extensionTextStyle=require("@tiptap/extension-text-style"),z=require("@tiptap/extension-underline");function _interopDefaultCompat(e){return e&&typeof e=="object"&&"default"in e?e.default:e}const o__default=_interopDefaultCompat(o),r__default=_interopDefaultCompat(r),t__default=_interopDefaultCompat(t),p__default=_interopDefaultCompat(p),f__default=_interopDefaultCompat(f),a__default=_interopDefaultCompat(a),x__default=_interopDefaultCompat(x),n__default=_interopDefaultCompat(n),c__default=_interopDefaultCompat(c),g__default=_interopDefaultCompat(g),T__default=_interopDefaultCompat(T),L__default=_interopDefaultCompat(L),h__default=_interopDefaultCompat(h),B__default=_interopDefaultCompat(B),C__default=_interopDefaultCompat(C),H__default=_interopDefaultCompat(H),S__default=_interopDefaultCompat(S),b__default=_interopDefaultCompat(b),D__default=_interopDefaultCompat(D),I__default=_interopDefaultCompat(I),y__default=_interopDefaultCompat(y),F__default=_interopDefaultCompat(F),E__default=_interopDefaultCompat(E),z__default=_interopDefaultCompat(z),Heading=extensionHeading.Heading.extend({addAttributes(){return{...this.parent?.(),indentLeft:{default:null,parseHTML:e=>e.style.marginLeft||null,renderHTML:e=>e.indentLeft?{style:`margin-left: ${e.indentLeft}`}:{}},indentRight:{default:null,parseHTML:e=>e.style.marginRight||null,renderHTML:e=>e.indentRight?{style:`margin-right: ${e.indentRight}`}:{}},indentFirstLine:{default:null,parseHTML:e=>e.style.textIndent||null,renderHTML:e=>e.indentFirstLine?{style:`text-indent: ${e.indentFirstLine}`}:{}},spacingBefore:{default:null,parseHTML:e=>e.style.marginTop||null,renderHTML:e=>e.spacingBefore?{style:`margin-top: ${e.spacingBefore}`}:{}},spacingAfter:{default:null,parseHTML:e=>e.style.marginBottom||null,renderHTML:e=>e.spacingAfter?{style:`margin-bottom: ${e.spacingAfter}`}:{}}}}}),Image=extensionImage.Image.extend({addAttributes(){return{...this.parent?.(),rotation:{default:null,parseHTML:e=>{const i=(e.getAttribute("style")||"").match(/transform:\s*rotate\(([\d.]+)deg\)/);return i?parseFloat(i[1]):null},renderHTML:e=>e.rotation?{style:`transform: rotate(${e.rotation}deg)`}:{}},floating:{default:null,parseHTML:e=>{const i=e.getAttribute("data-floating");if(!i)return null;try{return JSON.parse(i)}catch{return null}},renderHTML:e=>e.floating?{"data-floating":JSON.stringify(e.floating)}:{}},outline:{default:null,parseHTML:e=>{const i=e.getAttribute("data-outline");if(!i)return null;try{return JSON.parse(i)}catch{return null}},renderHTML:e=>e.outline?{"data-outline":JSON.stringify(e.outline)}:{}}}}}),Paragraph=extensionParagraph.Paragraph.extend({addAttributes(){return{...this.parent?.(),indentLeft:{default:null,parseHTML:e=>e.style.marginLeft||null,renderHTML:e=>e.indentLeft?{style:`margin-left: ${e.indentLeft}`}:{}},indentRight:{default:null,parseHTML:e=>e.style.marginRight||null,renderHTML:e=>e.indentRight?{style:`margin-right: ${e.indentRight}`}:{}},indentFirstLine:{default:null,parseHTML:e=>e.style.textIndent||null,renderHTML:e=>e.indentFirstLine?{style:`text-indent: ${e.indentFirstLine}`}:{}},spacingBefore:{default:null,parseHTML:e=>e.style.marginTop||null,renderHTML:e=>e.spacingBefore?{style:`margin-top: ${e.spacingBefore}`}:{}},spacingAfter:{default:null,parseHTML:e=>e.style.marginBottom||null,renderHTML:e=>e.spacingAfter?{style:`margin-bottom: ${e.spacingAfter}`}:{}}}}}),tiptapNodeExtensions=[p__default,Paragraph,C__default,a__default,o__default,c__default,r__default,n__default,t__default,extensionDetails.Details,extensionDetails.DetailsSummary,extensionDetails.DetailsContent,f__default,x__default,Image,extensionMathematics.Mathematics,extensionTable.Table,L__default,g__default,T__default,h__default,B__default,Heading],tiptapMarkExtensions=[H__default,S__default,b__default,D__default,I__default,y__default,F__default,E__default,extensionTextStyle.TextStyle,z__default,extensionTextStyle.Color,extensionTextStyle.BackgroundColor,extensionTextStyle.FontFamily,extensionTextStyle.FontSize,extensionTextStyle.LineHeight],tiptapExtensions=[...tiptapNodeExtensions,...tiptapMarkExtensions];exports.tiptapExtensions=tiptapExtensions,exports.tiptapMarkExtensions=tiptapMarkExtensions,exports.tiptapNodeExtensions=tiptapNodeExtensions;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import p from"@tiptap/extension-blockquote";import a from"@tiptap/extension-bullet-list";import f from"@tiptap/extension-code-block-lowlight";import{Details as s,DetailsSummary as n,DetailsContent as g}from"@tiptap/extension-details";import l from"@tiptap/extension-document";import u from"@tiptap/extension-emoji";import d from"@tiptap/extension-hard-break";import c from"@tiptap/extension-heading";import b from"@tiptap/extension-horizontal-rule";import{Image as h}from"@tiptap/extension-image";import A from"@tiptap/extension-list-item";import{Mathematics as x}from"@tiptap/extension-mathematics";import y from"@tiptap/extension-ordered-list";import T from"@tiptap/extension-paragraph";import{Table as F}from"@tiptap/extension-table";import H from"@tiptap/extension-table-cell";import L from"@tiptap/extension-table-header";import M from"@tiptap/extension-table-row";import C from"@tiptap/extension-task-list";import D from"@tiptap/extension-task-item";import E from"@tiptap/extension-text";import I from"@tiptap/extension-bold";import S from"@tiptap/extension-code";import $ from"@tiptap/extension-highlight";import k from"@tiptap/extension-italic";import w from"@tiptap/extension-link";import z from"@tiptap/extension-strike";import B from"@tiptap/extension-subscript";import N from"@tiptap/extension-superscript";import{TextStyle as j,Color as q,BackgroundColor as v,FontFamily as G,FontSize as J,LineHeight as K}from"@tiptap/extension-text-style";import O from"@tiptap/extension-underline";const P=h.extend({addAttributes(){return{...this.parent?.(),rotation:{default:null}}},parseHTML(){return[{tag:"img[src]",getAttributes:t=>{const r={src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:t.getAttribute("width"),height:t.getAttribute("height")},o=(t.getAttribute("style")||"").match(/transform:\s*rotate\(([\d.]+)deg\)/);return o?{...r,rotation:parseFloat(o[1])}:r}}]},renderHTML({HTMLAttributes:t}){const{rotation:r,...o}=t;if(r){const m=o.style||"";o.style=m?`${m}; transform: rotate(${r}deg)`:`transform: rotate(${r}deg)`}return["img",o]}}),i=[l,T,E,d,p,y,a,A,f,s,n,g,u,b,P,x,F,M,H,L,C,D,c],e=[I,S,$,k,w,z,B,N,j,O,q,v,G,J,K],Q=[...i,...e];export{Q as tiptapExtensions,e as tiptapMarkExtensions,i as tiptapNodeExtensions};
1
+ import i from"@tiptap/extension-blockquote";import o from"@tiptap/extension-bullet-list";import a from"@tiptap/extension-code-block-lowlight";import{Details as l,DetailsSummary as m,DetailsContent as s}from"@tiptap/extension-details";import f from"@tiptap/extension-document";import p from"@tiptap/extension-emoji";import d from"@tiptap/extension-hard-break";import{Heading as u}from"@tiptap/extension-heading";import g from"@tiptap/extension-horizontal-rule";import{Image as L}from"@tiptap/extension-image";import H from"@tiptap/extension-list-item";import{Mathematics as T}from"@tiptap/extension-mathematics";import y from"@tiptap/extension-ordered-list";import{Paragraph as M}from"@tiptap/extension-paragraph";import{Table as c}from"@tiptap/extension-table";import h from"@tiptap/extension-table-cell";import $ from"@tiptap/extension-table-header";import x from"@tiptap/extension-table-row";import A from"@tiptap/extension-task-list";import F from"@tiptap/extension-task-item";import b from"@tiptap/extension-text";import B from"@tiptap/extension-bold";import R from"@tiptap/extension-code";import S from"@tiptap/extension-highlight";import I from"@tiptap/extension-italic";import N from"@tiptap/extension-link";import C from"@tiptap/extension-strike";import D from"@tiptap/extension-subscript";import E from"@tiptap/extension-superscript";import{TextStyle as J,Color as O,BackgroundColor as P,FontFamily as k,FontSize as z,LineHeight as j}from"@tiptap/extension-text-style";import q from"@tiptap/extension-underline";const v=u.extend({addAttributes(){return{...this.parent?.(),indentLeft:{default:null,parseHTML:t=>t.style.marginLeft||null,renderHTML:t=>t.indentLeft?{style:`margin-left: ${t.indentLeft}`}:{}},indentRight:{default:null,parseHTML:t=>t.style.marginRight||null,renderHTML:t=>t.indentRight?{style:`margin-right: ${t.indentRight}`}:{}},indentFirstLine:{default:null,parseHTML:t=>t.style.textIndent||null,renderHTML:t=>t.indentFirstLine?{style:`text-indent: ${t.indentFirstLine}`}:{}},spacingBefore:{default:null,parseHTML:t=>t.style.marginTop||null,renderHTML:t=>t.spacingBefore?{style:`margin-top: ${t.spacingBefore}`}:{}},spacingAfter:{default:null,parseHTML:t=>t.style.marginBottom||null,renderHTML:t=>t.spacingAfter?{style:`margin-bottom: ${t.spacingAfter}`}:{}}}}}),w=L.extend({addAttributes(){return{...this.parent?.(),rotation:{default:null,parseHTML:t=>{const r=(t.getAttribute("style")||"").match(/transform:\s*rotate\(([\d.]+)deg\)/);return r?parseFloat(r[1]):null},renderHTML:t=>t.rotation?{style:`transform: rotate(${t.rotation}deg)`}:{}},floating:{default:null,parseHTML:t=>{const r=t.getAttribute("data-floating");if(!r)return null;try{return JSON.parse(r)}catch{return null}},renderHTML:t=>t.floating?{"data-floating":JSON.stringify(t.floating)}:{}},outline:{default:null,parseHTML:t=>{const r=t.getAttribute("data-outline");if(!r)return null;try{return JSON.parse(r)}catch{return null}},renderHTML:t=>t.outline?{"data-outline":JSON.stringify(t.outline)}:{}}}}}),G=M.extend({addAttributes(){return{...this.parent?.(),indentLeft:{default:null,parseHTML:t=>t.style.marginLeft||null,renderHTML:t=>t.indentLeft?{style:`margin-left: ${t.indentLeft}`}:{}},indentRight:{default:null,parseHTML:t=>t.style.marginRight||null,renderHTML:t=>t.indentRight?{style:`margin-right: ${t.indentRight}`}:{}},indentFirstLine:{default:null,parseHTML:t=>t.style.textIndent||null,renderHTML:t=>t.indentFirstLine?{style:`text-indent: ${t.indentFirstLine}`}:{}},spacingBefore:{default:null,parseHTML:t=>t.style.marginTop||null,renderHTML:t=>t.spacingBefore?{style:`margin-top: ${t.spacingBefore}`}:{}},spacingAfter:{default:null,parseHTML:t=>t.style.marginBottom||null,renderHTML:t=>t.spacingAfter?{style:`margin-bottom: ${t.spacingAfter}`}:{}}}}}),e=[f,G,b,d,i,y,o,H,a,l,m,s,p,g,w,T,c,x,h,$,A,F,v],n=[B,R,S,I,N,C,D,E,J,q,O,P,k,z,j],K=[...e,...n];export{K as tiptapExtensions,n as tiptapMarkExtensions,e as tiptapNodeExtensions};
package/dist/types.d.cts CHANGED
@@ -1,6 +1,212 @@
1
+ /// <reference types="node" />
1
2
  import { JSONContent } from '@tiptap/core';
2
3
  export { JSONContent } from '@tiptap/core';
3
4
 
5
+ declare const CompoundLine: {
6
+ readonly SINGLE: "sng";
7
+ readonly DOUBLE: "dbl";
8
+ readonly THICK_THIN: "thickThin";
9
+ readonly THIN_THICK: "thinThick";
10
+ readonly TRI: "tri";
11
+ };
12
+
13
+ declare type CoreImageOptions = {
14
+ readonly transformation: IMediaTransformation;
15
+ readonly floating?: IFloating;
16
+ readonly altText?: DocPropertiesOptions;
17
+ readonly outline?: OutlineOptions;
18
+ };
19
+
20
+ declare type DocPropertiesOptions = {
21
+ readonly name: string;
22
+ readonly description?: string;
23
+ readonly title?: string;
24
+ };
25
+
26
+ declare const HorizontalPositionAlign: {
27
+ readonly CENTER: "center";
28
+ readonly INSIDE: "inside";
29
+ readonly LEFT: "left";
30
+ readonly OUTSIDE: "outside";
31
+ readonly RIGHT: "right";
32
+ };
33
+
34
+ declare const HorizontalPositionRelativeFrom: {
35
+ readonly CHARACTER: "character";
36
+ readonly COLUMN: "column";
37
+ readonly INSIDE_MARGIN: "insideMargin";
38
+ readonly LEFT_MARGIN: "leftMargin";
39
+ readonly MARGIN: "margin";
40
+ readonly OUTSIDE_MARGIN: "outsideMargin";
41
+ readonly PAGE: "page";
42
+ readonly RIGHT_MARGIN: "rightMargin";
43
+ };
44
+
45
+ declare type IDistance = {
46
+ readonly distT?: number;
47
+ readonly distB?: number;
48
+ readonly distL?: number;
49
+ readonly distR?: number;
50
+ };
51
+
52
+ declare type IFloating = {
53
+ readonly horizontalPosition: IHorizontalPositionOptions;
54
+ readonly verticalPosition: IVerticalPositionOptions;
55
+ readonly allowOverlap?: boolean;
56
+ readonly lockAnchor?: boolean;
57
+ readonly behindDocument?: boolean;
58
+ readonly layoutInCell?: boolean;
59
+ readonly margins?: IMargins;
60
+ readonly wrap?: ITextWrapping;
61
+ readonly zIndex?: number;
62
+ };
63
+
64
+ declare type IHorizontalPositionOptions = {
65
+ readonly relative?: (typeof HorizontalPositionRelativeFrom)[keyof typeof HorizontalPositionRelativeFrom];
66
+ readonly align?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];
67
+ readonly offset?: number;
68
+ };
69
+
70
+ declare type IImageOptions = (RegularImageOptions | SvgMediaOptions) & CoreImageOptions;
71
+
72
+ declare type IMargins = {
73
+ readonly left?: number;
74
+ readonly bottom?: number;
75
+ readonly top?: number;
76
+ readonly right?: number;
77
+ };
78
+
79
+ declare type IMediaTransformation = {
80
+ readonly width: number;
81
+ readonly height: number;
82
+ readonly flip?: {
83
+ readonly vertical?: boolean;
84
+ readonly horizontal?: boolean;
85
+ };
86
+ readonly rotation?: number;
87
+ };
88
+
89
+ declare type ITextWrapping = {
90
+ readonly type: (typeof TextWrappingType)[keyof typeof TextWrappingType];
91
+ readonly side?: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];
92
+ readonly margins?: IDistance;
93
+ };
94
+
95
+ declare type IVerticalPositionOptions = {
96
+ readonly relative?: (typeof VerticalPositionRelativeFrom)[keyof typeof VerticalPositionRelativeFrom];
97
+ readonly align?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];
98
+ readonly offset?: number;
99
+ };
100
+
101
+ declare const LineCap: {
102
+ readonly ROUND: "rnd";
103
+ readonly SQUARE: "sq";
104
+ readonly FLAT: "flat";
105
+ };
106
+
107
+ declare type OutlineAttributes = {
108
+ readonly width?: number;
109
+ readonly cap?: keyof typeof LineCap;
110
+ readonly compoundLine?: keyof typeof CompoundLine;
111
+ readonly align?: keyof typeof PenAlignment;
112
+ };
113
+
114
+ declare type OutlineFillProperties = OutlineNoFill | OutlineSolidFill;
115
+
116
+ declare type OutlineNoFill = {
117
+ readonly type: "noFill";
118
+ };
119
+
120
+ declare type OutlineOptions = OutlineAttributes & OutlineFillProperties;
121
+
122
+ declare type OutlineRgbSolidFill = {
123
+ readonly type: "solidFill";
124
+ readonly solidFillType: "rgb";
125
+ readonly value: string;
126
+ };
127
+
128
+ declare type OutlineSchemeSolidFill = {
129
+ readonly type: "solidFill";
130
+ readonly solidFillType: "scheme";
131
+ readonly value: (typeof SchemeColor)[keyof typeof SchemeColor];
132
+ };
133
+
134
+ declare type OutlineSolidFill = OutlineRgbSolidFill | OutlineSchemeSolidFill;
135
+
136
+ declare const PenAlignment: {
137
+ readonly CENTER: "ctr";
138
+ readonly INSET: "in";
139
+ };
140
+
141
+ declare type RegularImageOptions = {
142
+ readonly type: "jpg" | "png" | "gif" | "bmp";
143
+ readonly data: Buffer | string | Uint8Array | ArrayBuffer;
144
+ };
145
+
146
+ declare const SchemeColor: {
147
+ readonly BG1: "bg1";
148
+ readonly TX1: "tx1";
149
+ readonly BG2: "bg2";
150
+ readonly TX2: "tx2";
151
+ readonly ACCENT1: "accent1";
152
+ readonly ACCENT2: "accent2";
153
+ readonly ACCENT3: "accent3";
154
+ readonly ACCENT4: "accent4";
155
+ readonly ACCENT5: "accent5";
156
+ readonly ACCENT6: "accent6";
157
+ readonly HLINK: "hlink";
158
+ readonly FOLHLINK: "folHlink";
159
+ readonly DK1: "dk1";
160
+ readonly LT1: "lt1";
161
+ readonly DK2: "dk2";
162
+ readonly LT2: "lt2";
163
+ readonly PHCLR: "phClr";
164
+ };
165
+
166
+ declare type SvgMediaOptions = {
167
+ readonly type: "svg";
168
+ readonly data: Buffer | string | Uint8Array | ArrayBuffer;
169
+ readonly fallback: RegularImageOptions;
170
+ };
171
+
172
+ declare const TextWrappingSide: {
173
+ readonly BOTH_SIDES: "bothSides";
174
+ readonly LEFT: "left";
175
+ readonly RIGHT: "right";
176
+ readonly LARGEST: "largest";
177
+ };
178
+
179
+ declare const TextWrappingType: {
180
+ readonly NONE: 0;
181
+ readonly SQUARE: 1;
182
+ readonly TIGHT: 2;
183
+ readonly TOP_AND_BOTTOM: 3;
184
+ };
185
+
186
+ declare const VerticalPositionAlign: {
187
+ readonly BOTTOM: "bottom";
188
+ readonly CENTER: "center";
189
+ readonly INSIDE: "inside";
190
+ readonly OUTSIDE: "outside";
191
+ readonly TOP: "top";
192
+ };
193
+
194
+ declare const VerticalPositionRelativeFrom: {
195
+ readonly BOTTOM_MARGIN: "bottomMargin";
196
+ readonly INSIDE_MARGIN: "insideMargin";
197
+ readonly LINE: "line";
198
+ readonly MARGIN: "margin";
199
+ readonly OUTSIDE_MARGIN: "outsideMargin";
200
+ readonly PAGE: "page";
201
+ readonly PARAGRAPH: "paragraph";
202
+ readonly TOP_MARGIN: "topMargin";
203
+ };
204
+
205
+ type ImageFloatingOptions = {
206
+ horizontalPosition: IHorizontalPositionOptions;
207
+ verticalPosition: IVerticalPositionOptions;
208
+ } & Partial<Omit<IFloating, "horizontalPosition" | "verticalPosition">>;
209
+ type ImageOutlineOptions = IImageOptions["outline"];
4
210
  interface TextNode {
5
211
  type: "text";
6
212
  text: string;
@@ -31,12 +237,26 @@ interface DocumentNode extends JSONContent {
31
237
  }
32
238
  interface ParagraphNode extends JSONContent {
33
239
  type: "paragraph";
240
+ attrs?: {
241
+ textAlign?: "left" | "center" | "right" | "justify";
242
+ indentLeft?: string;
243
+ indentRight?: string;
244
+ indentFirstLine?: string;
245
+ spacingBefore?: string;
246
+ spacingAfter?: string;
247
+ };
34
248
  content?: Array<TextNode | HardBreakNode | ImageNode>;
35
249
  }
36
250
  interface HeadingNode extends JSONContent {
37
251
  type: "heading";
38
252
  attrs: {
39
253
  level: 1 | 2 | 3 | 4 | 5 | 6;
254
+ indentLeft?: string;
255
+ indentRight?: string;
256
+ indentFirstLine?: string;
257
+ spacingBefore?: string;
258
+ spacingAfter?: string;
259
+ textAlign?: "left" | "right" | "center" | "justify";
40
260
  };
41
261
  content?: Array<TextNode | HardBreakNode>;
42
262
  }
@@ -117,6 +337,8 @@ interface ImageNode extends JSONContent {
117
337
  width?: number | null;
118
338
  height?: number | null;
119
339
  rotation?: number;
340
+ floating?: ImageFloatingOptions;
341
+ outline?: ImageOutlineOptions;
120
342
  };
121
343
  }
122
344
  interface DetailsNode extends JSONContent {
@@ -134,4 +356,4 @@ interface DetailsContentNode extends JSONContent {
134
356
  type TextContent = TextNode | HardBreakNode;
135
357
  type BlockNode = ParagraphNode | HeadingNode | BlockquoteNode | CodeBlockNode | HorizontalRuleNode | BulletListNode | OrderedListNode | TaskListNode | TableNode | ImageNode | DetailsNode;
136
358
 
137
- export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageNode, ListItemNode, Mark, OrderedListNode, ParagraphNode, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
359
+ export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageFloatingOptions, ImageNode, ImageOutlineOptions, ListItemNode, Mark, OrderedListNode, ParagraphNode, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
package/dist/types.d.mts CHANGED
@@ -1,6 +1,212 @@
1
+ /// <reference types="node" />
1
2
  import { JSONContent } from '@tiptap/core';
2
3
  export { JSONContent } from '@tiptap/core';
3
4
 
5
+ declare const CompoundLine: {
6
+ readonly SINGLE: "sng";
7
+ readonly DOUBLE: "dbl";
8
+ readonly THICK_THIN: "thickThin";
9
+ readonly THIN_THICK: "thinThick";
10
+ readonly TRI: "tri";
11
+ };
12
+
13
+ declare type CoreImageOptions = {
14
+ readonly transformation: IMediaTransformation;
15
+ readonly floating?: IFloating;
16
+ readonly altText?: DocPropertiesOptions;
17
+ readonly outline?: OutlineOptions;
18
+ };
19
+
20
+ declare type DocPropertiesOptions = {
21
+ readonly name: string;
22
+ readonly description?: string;
23
+ readonly title?: string;
24
+ };
25
+
26
+ declare const HorizontalPositionAlign: {
27
+ readonly CENTER: "center";
28
+ readonly INSIDE: "inside";
29
+ readonly LEFT: "left";
30
+ readonly OUTSIDE: "outside";
31
+ readonly RIGHT: "right";
32
+ };
33
+
34
+ declare const HorizontalPositionRelativeFrom: {
35
+ readonly CHARACTER: "character";
36
+ readonly COLUMN: "column";
37
+ readonly INSIDE_MARGIN: "insideMargin";
38
+ readonly LEFT_MARGIN: "leftMargin";
39
+ readonly MARGIN: "margin";
40
+ readonly OUTSIDE_MARGIN: "outsideMargin";
41
+ readonly PAGE: "page";
42
+ readonly RIGHT_MARGIN: "rightMargin";
43
+ };
44
+
45
+ declare type IDistance = {
46
+ readonly distT?: number;
47
+ readonly distB?: number;
48
+ readonly distL?: number;
49
+ readonly distR?: number;
50
+ };
51
+
52
+ declare type IFloating = {
53
+ readonly horizontalPosition: IHorizontalPositionOptions;
54
+ readonly verticalPosition: IVerticalPositionOptions;
55
+ readonly allowOverlap?: boolean;
56
+ readonly lockAnchor?: boolean;
57
+ readonly behindDocument?: boolean;
58
+ readonly layoutInCell?: boolean;
59
+ readonly margins?: IMargins;
60
+ readonly wrap?: ITextWrapping;
61
+ readonly zIndex?: number;
62
+ };
63
+
64
+ declare type IHorizontalPositionOptions = {
65
+ readonly relative?: (typeof HorizontalPositionRelativeFrom)[keyof typeof HorizontalPositionRelativeFrom];
66
+ readonly align?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];
67
+ readonly offset?: number;
68
+ };
69
+
70
+ declare type IImageOptions = (RegularImageOptions | SvgMediaOptions) & CoreImageOptions;
71
+
72
+ declare type IMargins = {
73
+ readonly left?: number;
74
+ readonly bottom?: number;
75
+ readonly top?: number;
76
+ readonly right?: number;
77
+ };
78
+
79
+ declare type IMediaTransformation = {
80
+ readonly width: number;
81
+ readonly height: number;
82
+ readonly flip?: {
83
+ readonly vertical?: boolean;
84
+ readonly horizontal?: boolean;
85
+ };
86
+ readonly rotation?: number;
87
+ };
88
+
89
+ declare type ITextWrapping = {
90
+ readonly type: (typeof TextWrappingType)[keyof typeof TextWrappingType];
91
+ readonly side?: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];
92
+ readonly margins?: IDistance;
93
+ };
94
+
95
+ declare type IVerticalPositionOptions = {
96
+ readonly relative?: (typeof VerticalPositionRelativeFrom)[keyof typeof VerticalPositionRelativeFrom];
97
+ readonly align?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];
98
+ readonly offset?: number;
99
+ };
100
+
101
+ declare const LineCap: {
102
+ readonly ROUND: "rnd";
103
+ readonly SQUARE: "sq";
104
+ readonly FLAT: "flat";
105
+ };
106
+
107
+ declare type OutlineAttributes = {
108
+ readonly width?: number;
109
+ readonly cap?: keyof typeof LineCap;
110
+ readonly compoundLine?: keyof typeof CompoundLine;
111
+ readonly align?: keyof typeof PenAlignment;
112
+ };
113
+
114
+ declare type OutlineFillProperties = OutlineNoFill | OutlineSolidFill;
115
+
116
+ declare type OutlineNoFill = {
117
+ readonly type: "noFill";
118
+ };
119
+
120
+ declare type OutlineOptions = OutlineAttributes & OutlineFillProperties;
121
+
122
+ declare type OutlineRgbSolidFill = {
123
+ readonly type: "solidFill";
124
+ readonly solidFillType: "rgb";
125
+ readonly value: string;
126
+ };
127
+
128
+ declare type OutlineSchemeSolidFill = {
129
+ readonly type: "solidFill";
130
+ readonly solidFillType: "scheme";
131
+ readonly value: (typeof SchemeColor)[keyof typeof SchemeColor];
132
+ };
133
+
134
+ declare type OutlineSolidFill = OutlineRgbSolidFill | OutlineSchemeSolidFill;
135
+
136
+ declare const PenAlignment: {
137
+ readonly CENTER: "ctr";
138
+ readonly INSET: "in";
139
+ };
140
+
141
+ declare type RegularImageOptions = {
142
+ readonly type: "jpg" | "png" | "gif" | "bmp";
143
+ readonly data: Buffer | string | Uint8Array | ArrayBuffer;
144
+ };
145
+
146
+ declare const SchemeColor: {
147
+ readonly BG1: "bg1";
148
+ readonly TX1: "tx1";
149
+ readonly BG2: "bg2";
150
+ readonly TX2: "tx2";
151
+ readonly ACCENT1: "accent1";
152
+ readonly ACCENT2: "accent2";
153
+ readonly ACCENT3: "accent3";
154
+ readonly ACCENT4: "accent4";
155
+ readonly ACCENT5: "accent5";
156
+ readonly ACCENT6: "accent6";
157
+ readonly HLINK: "hlink";
158
+ readonly FOLHLINK: "folHlink";
159
+ readonly DK1: "dk1";
160
+ readonly LT1: "lt1";
161
+ readonly DK2: "dk2";
162
+ readonly LT2: "lt2";
163
+ readonly PHCLR: "phClr";
164
+ };
165
+
166
+ declare type SvgMediaOptions = {
167
+ readonly type: "svg";
168
+ readonly data: Buffer | string | Uint8Array | ArrayBuffer;
169
+ readonly fallback: RegularImageOptions;
170
+ };
171
+
172
+ declare const TextWrappingSide: {
173
+ readonly BOTH_SIDES: "bothSides";
174
+ readonly LEFT: "left";
175
+ readonly RIGHT: "right";
176
+ readonly LARGEST: "largest";
177
+ };
178
+
179
+ declare const TextWrappingType: {
180
+ readonly NONE: 0;
181
+ readonly SQUARE: 1;
182
+ readonly TIGHT: 2;
183
+ readonly TOP_AND_BOTTOM: 3;
184
+ };
185
+
186
+ declare const VerticalPositionAlign: {
187
+ readonly BOTTOM: "bottom";
188
+ readonly CENTER: "center";
189
+ readonly INSIDE: "inside";
190
+ readonly OUTSIDE: "outside";
191
+ readonly TOP: "top";
192
+ };
193
+
194
+ declare const VerticalPositionRelativeFrom: {
195
+ readonly BOTTOM_MARGIN: "bottomMargin";
196
+ readonly INSIDE_MARGIN: "insideMargin";
197
+ readonly LINE: "line";
198
+ readonly MARGIN: "margin";
199
+ readonly OUTSIDE_MARGIN: "outsideMargin";
200
+ readonly PAGE: "page";
201
+ readonly PARAGRAPH: "paragraph";
202
+ readonly TOP_MARGIN: "topMargin";
203
+ };
204
+
205
+ type ImageFloatingOptions = {
206
+ horizontalPosition: IHorizontalPositionOptions;
207
+ verticalPosition: IVerticalPositionOptions;
208
+ } & Partial<Omit<IFloating, "horizontalPosition" | "verticalPosition">>;
209
+ type ImageOutlineOptions = IImageOptions["outline"];
4
210
  interface TextNode {
5
211
  type: "text";
6
212
  text: string;
@@ -31,12 +237,26 @@ interface DocumentNode extends JSONContent {
31
237
  }
32
238
  interface ParagraphNode extends JSONContent {
33
239
  type: "paragraph";
240
+ attrs?: {
241
+ textAlign?: "left" | "center" | "right" | "justify";
242
+ indentLeft?: string;
243
+ indentRight?: string;
244
+ indentFirstLine?: string;
245
+ spacingBefore?: string;
246
+ spacingAfter?: string;
247
+ };
34
248
  content?: Array<TextNode | HardBreakNode | ImageNode>;
35
249
  }
36
250
  interface HeadingNode extends JSONContent {
37
251
  type: "heading";
38
252
  attrs: {
39
253
  level: 1 | 2 | 3 | 4 | 5 | 6;
254
+ indentLeft?: string;
255
+ indentRight?: string;
256
+ indentFirstLine?: string;
257
+ spacingBefore?: string;
258
+ spacingAfter?: string;
259
+ textAlign?: "left" | "right" | "center" | "justify";
40
260
  };
41
261
  content?: Array<TextNode | HardBreakNode>;
42
262
  }
@@ -117,6 +337,8 @@ interface ImageNode extends JSONContent {
117
337
  width?: number | null;
118
338
  height?: number | null;
119
339
  rotation?: number;
340
+ floating?: ImageFloatingOptions;
341
+ outline?: ImageOutlineOptions;
120
342
  };
121
343
  }
122
344
  interface DetailsNode extends JSONContent {
@@ -134,4 +356,4 @@ interface DetailsContentNode extends JSONContent {
134
356
  type TextContent = TextNode | HardBreakNode;
135
357
  type BlockNode = ParagraphNode | HeadingNode | BlockquoteNode | CodeBlockNode | HorizontalRuleNode | BulletListNode | OrderedListNode | TaskListNode | TableNode | ImageNode | DetailsNode;
136
358
 
137
- export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageNode, ListItemNode, Mark, OrderedListNode, ParagraphNode, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
359
+ export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageFloatingOptions, ImageNode, ImageOutlineOptions, ListItemNode, Mark, OrderedListNode, ParagraphNode, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
package/dist/types.d.ts CHANGED
@@ -1,6 +1,212 @@
1
+ /// <reference types="node" />
1
2
  import { JSONContent } from '@tiptap/core';
2
3
  export { JSONContent } from '@tiptap/core';
3
4
 
5
+ declare const CompoundLine: {
6
+ readonly SINGLE: "sng";
7
+ readonly DOUBLE: "dbl";
8
+ readonly THICK_THIN: "thickThin";
9
+ readonly THIN_THICK: "thinThick";
10
+ readonly TRI: "tri";
11
+ };
12
+
13
+ declare type CoreImageOptions = {
14
+ readonly transformation: IMediaTransformation;
15
+ readonly floating?: IFloating;
16
+ readonly altText?: DocPropertiesOptions;
17
+ readonly outline?: OutlineOptions;
18
+ };
19
+
20
+ declare type DocPropertiesOptions = {
21
+ readonly name: string;
22
+ readonly description?: string;
23
+ readonly title?: string;
24
+ };
25
+
26
+ declare const HorizontalPositionAlign: {
27
+ readonly CENTER: "center";
28
+ readonly INSIDE: "inside";
29
+ readonly LEFT: "left";
30
+ readonly OUTSIDE: "outside";
31
+ readonly RIGHT: "right";
32
+ };
33
+
34
+ declare const HorizontalPositionRelativeFrom: {
35
+ readonly CHARACTER: "character";
36
+ readonly COLUMN: "column";
37
+ readonly INSIDE_MARGIN: "insideMargin";
38
+ readonly LEFT_MARGIN: "leftMargin";
39
+ readonly MARGIN: "margin";
40
+ readonly OUTSIDE_MARGIN: "outsideMargin";
41
+ readonly PAGE: "page";
42
+ readonly RIGHT_MARGIN: "rightMargin";
43
+ };
44
+
45
+ declare type IDistance = {
46
+ readonly distT?: number;
47
+ readonly distB?: number;
48
+ readonly distL?: number;
49
+ readonly distR?: number;
50
+ };
51
+
52
+ declare type IFloating = {
53
+ readonly horizontalPosition: IHorizontalPositionOptions;
54
+ readonly verticalPosition: IVerticalPositionOptions;
55
+ readonly allowOverlap?: boolean;
56
+ readonly lockAnchor?: boolean;
57
+ readonly behindDocument?: boolean;
58
+ readonly layoutInCell?: boolean;
59
+ readonly margins?: IMargins;
60
+ readonly wrap?: ITextWrapping;
61
+ readonly zIndex?: number;
62
+ };
63
+
64
+ declare type IHorizontalPositionOptions = {
65
+ readonly relative?: (typeof HorizontalPositionRelativeFrom)[keyof typeof HorizontalPositionRelativeFrom];
66
+ readonly align?: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];
67
+ readonly offset?: number;
68
+ };
69
+
70
+ declare type IImageOptions = (RegularImageOptions | SvgMediaOptions) & CoreImageOptions;
71
+
72
+ declare type IMargins = {
73
+ readonly left?: number;
74
+ readonly bottom?: number;
75
+ readonly top?: number;
76
+ readonly right?: number;
77
+ };
78
+
79
+ declare type IMediaTransformation = {
80
+ readonly width: number;
81
+ readonly height: number;
82
+ readonly flip?: {
83
+ readonly vertical?: boolean;
84
+ readonly horizontal?: boolean;
85
+ };
86
+ readonly rotation?: number;
87
+ };
88
+
89
+ declare type ITextWrapping = {
90
+ readonly type: (typeof TextWrappingType)[keyof typeof TextWrappingType];
91
+ readonly side?: (typeof TextWrappingSide)[keyof typeof TextWrappingSide];
92
+ readonly margins?: IDistance;
93
+ };
94
+
95
+ declare type IVerticalPositionOptions = {
96
+ readonly relative?: (typeof VerticalPositionRelativeFrom)[keyof typeof VerticalPositionRelativeFrom];
97
+ readonly align?: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];
98
+ readonly offset?: number;
99
+ };
100
+
101
+ declare const LineCap: {
102
+ readonly ROUND: "rnd";
103
+ readonly SQUARE: "sq";
104
+ readonly FLAT: "flat";
105
+ };
106
+
107
+ declare type OutlineAttributes = {
108
+ readonly width?: number;
109
+ readonly cap?: keyof typeof LineCap;
110
+ readonly compoundLine?: keyof typeof CompoundLine;
111
+ readonly align?: keyof typeof PenAlignment;
112
+ };
113
+
114
+ declare type OutlineFillProperties = OutlineNoFill | OutlineSolidFill;
115
+
116
+ declare type OutlineNoFill = {
117
+ readonly type: "noFill";
118
+ };
119
+
120
+ declare type OutlineOptions = OutlineAttributes & OutlineFillProperties;
121
+
122
+ declare type OutlineRgbSolidFill = {
123
+ readonly type: "solidFill";
124
+ readonly solidFillType: "rgb";
125
+ readonly value: string;
126
+ };
127
+
128
+ declare type OutlineSchemeSolidFill = {
129
+ readonly type: "solidFill";
130
+ readonly solidFillType: "scheme";
131
+ readonly value: (typeof SchemeColor)[keyof typeof SchemeColor];
132
+ };
133
+
134
+ declare type OutlineSolidFill = OutlineRgbSolidFill | OutlineSchemeSolidFill;
135
+
136
+ declare const PenAlignment: {
137
+ readonly CENTER: "ctr";
138
+ readonly INSET: "in";
139
+ };
140
+
141
+ declare type RegularImageOptions = {
142
+ readonly type: "jpg" | "png" | "gif" | "bmp";
143
+ readonly data: Buffer | string | Uint8Array | ArrayBuffer;
144
+ };
145
+
146
+ declare const SchemeColor: {
147
+ readonly BG1: "bg1";
148
+ readonly TX1: "tx1";
149
+ readonly BG2: "bg2";
150
+ readonly TX2: "tx2";
151
+ readonly ACCENT1: "accent1";
152
+ readonly ACCENT2: "accent2";
153
+ readonly ACCENT3: "accent3";
154
+ readonly ACCENT4: "accent4";
155
+ readonly ACCENT5: "accent5";
156
+ readonly ACCENT6: "accent6";
157
+ readonly HLINK: "hlink";
158
+ readonly FOLHLINK: "folHlink";
159
+ readonly DK1: "dk1";
160
+ readonly LT1: "lt1";
161
+ readonly DK2: "dk2";
162
+ readonly LT2: "lt2";
163
+ readonly PHCLR: "phClr";
164
+ };
165
+
166
+ declare type SvgMediaOptions = {
167
+ readonly type: "svg";
168
+ readonly data: Buffer | string | Uint8Array | ArrayBuffer;
169
+ readonly fallback: RegularImageOptions;
170
+ };
171
+
172
+ declare const TextWrappingSide: {
173
+ readonly BOTH_SIDES: "bothSides";
174
+ readonly LEFT: "left";
175
+ readonly RIGHT: "right";
176
+ readonly LARGEST: "largest";
177
+ };
178
+
179
+ declare const TextWrappingType: {
180
+ readonly NONE: 0;
181
+ readonly SQUARE: 1;
182
+ readonly TIGHT: 2;
183
+ readonly TOP_AND_BOTTOM: 3;
184
+ };
185
+
186
+ declare const VerticalPositionAlign: {
187
+ readonly BOTTOM: "bottom";
188
+ readonly CENTER: "center";
189
+ readonly INSIDE: "inside";
190
+ readonly OUTSIDE: "outside";
191
+ readonly TOP: "top";
192
+ };
193
+
194
+ declare const VerticalPositionRelativeFrom: {
195
+ readonly BOTTOM_MARGIN: "bottomMargin";
196
+ readonly INSIDE_MARGIN: "insideMargin";
197
+ readonly LINE: "line";
198
+ readonly MARGIN: "margin";
199
+ readonly OUTSIDE_MARGIN: "outsideMargin";
200
+ readonly PAGE: "page";
201
+ readonly PARAGRAPH: "paragraph";
202
+ readonly TOP_MARGIN: "topMargin";
203
+ };
204
+
205
+ type ImageFloatingOptions = {
206
+ horizontalPosition: IHorizontalPositionOptions;
207
+ verticalPosition: IVerticalPositionOptions;
208
+ } & Partial<Omit<IFloating, "horizontalPosition" | "verticalPosition">>;
209
+ type ImageOutlineOptions = IImageOptions["outline"];
4
210
  interface TextNode {
5
211
  type: "text";
6
212
  text: string;
@@ -31,12 +237,26 @@ interface DocumentNode extends JSONContent {
31
237
  }
32
238
  interface ParagraphNode extends JSONContent {
33
239
  type: "paragraph";
240
+ attrs?: {
241
+ textAlign?: "left" | "center" | "right" | "justify";
242
+ indentLeft?: string;
243
+ indentRight?: string;
244
+ indentFirstLine?: string;
245
+ spacingBefore?: string;
246
+ spacingAfter?: string;
247
+ };
34
248
  content?: Array<TextNode | HardBreakNode | ImageNode>;
35
249
  }
36
250
  interface HeadingNode extends JSONContent {
37
251
  type: "heading";
38
252
  attrs: {
39
253
  level: 1 | 2 | 3 | 4 | 5 | 6;
254
+ indentLeft?: string;
255
+ indentRight?: string;
256
+ indentFirstLine?: string;
257
+ spacingBefore?: string;
258
+ spacingAfter?: string;
259
+ textAlign?: "left" | "right" | "center" | "justify";
40
260
  };
41
261
  content?: Array<TextNode | HardBreakNode>;
42
262
  }
@@ -117,6 +337,8 @@ interface ImageNode extends JSONContent {
117
337
  width?: number | null;
118
338
  height?: number | null;
119
339
  rotation?: number;
340
+ floating?: ImageFloatingOptions;
341
+ outline?: ImageOutlineOptions;
120
342
  };
121
343
  }
122
344
  interface DetailsNode extends JSONContent {
@@ -134,4 +356,4 @@ interface DetailsContentNode extends JSONContent {
134
356
  type TextContent = TextNode | HardBreakNode;
135
357
  type BlockNode = ParagraphNode | HeadingNode | BlockquoteNode | CodeBlockNode | HorizontalRuleNode | BulletListNode | OrderedListNode | TaskListNode | TableNode | ImageNode | DetailsNode;
136
358
 
137
- export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageNode, ListItemNode, Mark, OrderedListNode, ParagraphNode, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
359
+ export type { BlockNode, BlockquoteNode, BulletListNode, CodeBlockNode, DetailsContentNode, DetailsNode, DetailsSummaryNode, DocumentNode, HardBreakNode, HeadingNode, HorizontalRuleNode, ImageFloatingOptions, ImageNode, ImageOutlineOptions, ListItemNode, Mark, OrderedListNode, ParagraphNode, TableCellNode, TableHeaderNode, TableNode, TableRowNode, TaskItemNode, TaskListNode, TextContent, TextNode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docen/tiptap-extensions",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Collection of TipTap extensions with TypeScript type definitions for Docen",
5
5
  "keywords": [
6
6
  "docen",
@@ -43,39 +43,42 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@tiptap/core": "3.7.2",
47
- "@tiptap/extension-blockquote": "3.7.2",
48
- "@tiptap/extension-bold": "3.7.2",
49
- "@tiptap/extension-bullet-list": "3.7.2",
50
- "@tiptap/extension-code": "3.7.2",
51
- "@tiptap/extension-code-block-lowlight": "3.7.2",
52
- "@tiptap/extension-details": "3.10.7",
53
- "@tiptap/extension-document": "3.7.2",
54
- "@tiptap/extension-emoji": "3.10.7",
55
- "@tiptap/extension-hard-break": "3.7.2",
56
- "@tiptap/extension-heading": "3.7.2",
57
- "@tiptap/extension-highlight": "3.7.2",
58
- "@tiptap/extension-horizontal-rule": "3.10.7",
59
- "@tiptap/extension-image": "3.7.2",
60
- "@tiptap/extension-italic": "3.7.2",
61
- "@tiptap/extension-link": "3.7.2",
62
- "@tiptap/extension-list-item": "3.7.2",
63
- "@tiptap/extension-mathematics": "3.10.7",
64
- "@tiptap/extension-mention": "3.10.7",
65
- "@tiptap/extension-ordered-list": "3.7.2",
66
- "@tiptap/extension-paragraph": "3.7.2",
67
- "@tiptap/extension-strike": "3.7.2",
68
- "@tiptap/extension-subscript": "3.7.2",
69
- "@tiptap/extension-superscript": "3.7.2",
70
- "@tiptap/extension-table": "3.7.2",
71
- "@tiptap/extension-table-cell": "3.7.2",
72
- "@tiptap/extension-table-header": "3.7.2",
73
- "@tiptap/extension-table-row": "3.7.2",
74
- "@tiptap/extension-task-item": "3.7.2",
75
- "@tiptap/extension-task-list": "3.7.2",
76
- "@tiptap/extension-text": "3.7.2",
77
- "@tiptap/extension-text-style": "3.7.2",
78
- "@tiptap/extension-underline": "3.7.2"
46
+ "@tiptap/core": "3.15.3",
47
+ "@tiptap/extension-blockquote": "3.15.3",
48
+ "@tiptap/extension-bold": "3.15.3",
49
+ "@tiptap/extension-bullet-list": "3.15.3",
50
+ "@tiptap/extension-code": "3.15.3",
51
+ "@tiptap/extension-code-block-lowlight": "3.15.3",
52
+ "@tiptap/extension-details": "3.15.3",
53
+ "@tiptap/extension-document": "3.15.3",
54
+ "@tiptap/extension-emoji": "3.15.3",
55
+ "@tiptap/extension-hard-break": "3.15.3",
56
+ "@tiptap/extension-heading": "3.15.3",
57
+ "@tiptap/extension-highlight": "3.15.3",
58
+ "@tiptap/extension-horizontal-rule": "3.15.3",
59
+ "@tiptap/extension-image": "3.15.3",
60
+ "@tiptap/extension-italic": "3.15.3",
61
+ "@tiptap/extension-link": "3.15.3",
62
+ "@tiptap/extension-list-item": "3.15.3",
63
+ "@tiptap/extension-mathematics": "3.15.3",
64
+ "@tiptap/extension-mention": "3.15.3",
65
+ "@tiptap/extension-ordered-list": "3.15.3",
66
+ "@tiptap/extension-paragraph": "3.15.3",
67
+ "@tiptap/extension-strike": "3.15.3",
68
+ "@tiptap/extension-subscript": "3.15.3",
69
+ "@tiptap/extension-superscript": "3.15.3",
70
+ "@tiptap/extension-table": "3.15.3",
71
+ "@tiptap/extension-table-cell": "3.15.3",
72
+ "@tiptap/extension-table-header": "3.15.3",
73
+ "@tiptap/extension-table-row": "3.15.3",
74
+ "@tiptap/extension-task-item": "3.15.3",
75
+ "@tiptap/extension-task-list": "3.15.3",
76
+ "@tiptap/extension-text": "3.15.3",
77
+ "@tiptap/extension-text-style": "3.15.3",
78
+ "@tiptap/extension-underline": "3.15.3"
79
+ },
80
+ "devDependencies": {
81
+ "docx": "9.5.1"
79
82
  },
80
83
  "scripts": {
81
84
  "dev": "unbuild --stub",