@vicacha-devs/astro-tiptap-blocks 1.2.0 → 1.2.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.
Files changed (37) hide show
  1. package/README.md +6 -0
  2. package/dist/lib/html-parser/html-custom-blocks.js +15 -1
  3. package/dist/lib/html-parser/html-inline.d.ts +5 -16
  4. package/dist/lib/html-parser/html-inline.js +52 -103
  5. package/dist/lib/html-parser/html-parser.js +27 -51
  6. package/dist/lib/html-parser/html-tokenizer.d.ts +15 -0
  7. package/dist/lib/html-parser/html-tokenizer.js +91 -0
  8. package/dist/lib/markdown-parser/markdown-inline.d.ts +5 -0
  9. package/dist/lib/markdown-parser/markdown-inline.js +135 -0
  10. package/dist/lib/markdown-parser/markdown-parser.d.ts +3 -3
  11. package/dist/lib/markdown-parser/markdown-parser.js +20 -136
  12. package/dist/lib/parser/index.d.ts +1 -0
  13. package/dist/lib/parser/index.js +1 -0
  14. package/dist/lib/parser/parser-inline.d.ts +14 -0
  15. package/dist/lib/parser/parser-inline.js +122 -0
  16. package/dist/lib/parser/parser-sanitize.d.ts +2 -0
  17. package/dist/lib/parser/parser-sanitize.js +149 -0
  18. package/dist/lib/parser/parser.js +28 -238
  19. package/dist/lib/relations/relations-uri.d.ts +16 -0
  20. package/dist/lib/relations/relations-uri.js +39 -0
  21. package/dist/lib/relations/relations.d.ts +4 -17
  22. package/dist/lib/relations/relations.js +6 -41
  23. package/dist/lib/sanitize/sanitize-format.d.ts +12 -0
  24. package/dist/lib/sanitize/sanitize-format.js +158 -0
  25. package/dist/lib/sanitize/sanitize.d.ts +10 -10
  26. package/dist/lib/sanitize/sanitize.js +48 -118
  27. package/dist/lib/theme/theme-default.d.ts +2 -0
  28. package/dist/lib/theme/theme-default.js +119 -0
  29. package/dist/lib/theme/theme.d.ts +3 -1
  30. package/dist/lib/theme/theme.js +10 -118
  31. package/dist/types/custom.d.ts +19 -0
  32. package/dist/types/tiptap-inline.d.ts +1 -0
  33. package/dist/types/tiptap-media.d.ts +146 -0
  34. package/dist/types/tiptap-media.js +1 -0
  35. package/dist/types/tiptap.d.ts +3 -132
  36. package/dist/types/tiptap.js +1 -0
  37. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
- import type { TiptapElementAlign, TiptapHeadingLevel, TiptapHeadingTag, TiptapInlineNode, TiptapInternalLinkResolver, TiptapMathematicsNode, TiptapTextAlign, TiptapTextDirection, TiptapTextNode } from "./tiptap-inline";
1
+ import type { TiptapHeadingLevel, TiptapHeadingTag, TiptapInlineNode, TiptapMathematicsNode, TiptapTextAlign, TiptapTextDirection, TiptapTextNode } from "./tiptap-inline";
2
+ import type { TiptapAttachmentNode, TiptapAudioNode, TiptapHorizontalRuleNode, TiptapIframeNode, TiptapImageNode, TiptapPageBreakNode, TiptapTableNode, TiptapTableOfContentsNode, TiptapVideoNode } from "./tiptap-media";
2
3
  export * from "./tiptap-inline";
4
+ export * from "./tiptap-media";
3
5
  export type TiptapBlockBaseAttrs = {
4
6
  textAlign?: TiptapTextAlign | null;
5
7
  dir?: TiptapTextDirection | null;
@@ -114,136 +116,5 @@ export type TiptapCodeBlockNode = {
114
116
  };
115
117
  content?: Array<TiptapTextNode>;
116
118
  };
117
- export type TiptapMediaCommonAttrs = {
118
- "data-align"?: TiptapElementAlign | null;
119
- "data-asset-id"?: string | number | null;
120
- "data-document-id"?: string | null;
121
- };
122
- export type TiptapImageNode = {
123
- type: "image";
124
- attrs: TiptapMediaCommonAttrs & {
125
- src: string;
126
- alt?: string | null;
127
- title?: string | null;
128
- caption?: string | null;
129
- width?: number | string | null;
130
- height?: number | string | null;
131
- srcset?: string | null;
132
- sizes?: string | null;
133
- loading?: "lazy" | "eager" | null;
134
- decoding?: "async" | "sync" | "auto" | null;
135
- fetchpriority?: "high" | "low" | "auto" | null;
136
- };
137
- };
138
- export type TiptapVideoNode = {
139
- type: "video";
140
- attrs: TiptapMediaCommonAttrs & {
141
- src: string;
142
- embedType?: "embed" | "file" | null;
143
- title?: string | null;
144
- caption?: string | null;
145
- width?: number | string | null;
146
- height?: number | string | null;
147
- mime?: string | null;
148
- };
149
- };
150
- export type TiptapAudioNode = {
151
- type: "audio";
152
- attrs: TiptapMediaCommonAttrs & {
153
- src: string;
154
- title?: string | null;
155
- caption?: string | null;
156
- mime?: string | null;
157
- };
158
- };
159
- export type TiptapAttachmentNode = {
160
- type: "attachment";
161
- attrs: TiptapMediaCommonAttrs & {
162
- href: string;
163
- filename?: string | null;
164
- title?: string | null;
165
- size?: number | string | null;
166
- mime?: string | null;
167
- ext?: string | null;
168
- };
169
- };
170
- export type TiptapIframeNode = {
171
- type: "iframe";
172
- attrs: {
173
- "src": string;
174
- "title"?: string | null;
175
- "width"?: number | string | null;
176
- "height"?: number | string | null;
177
- "data-align"?: TiptapElementAlign | null;
178
- };
179
- };
180
- export type TiptapCustomBlockNode = {
181
- type: string;
182
- attrs?: Record<string, unknown>;
183
- content?: Array<TiptapBlockNode>;
184
- };
185
- export type TiptapTocHeadingItem = {
186
- id: string;
187
- text: string;
188
- level: TiptapHeadingLevel;
189
- };
190
- export type TiptapTableOfContentsNode = {
191
- type: "tableOfContents";
192
- attrs?: {
193
- headings?: Array<TiptapTocHeadingItem>;
194
- title?: string | null;
195
- };
196
- };
197
- export type TiptapPageBreakNode = {
198
- type: "pageBreak";
199
- };
200
- export type TiptapHorizontalRuleNode = {
201
- type: "horizontalRule";
202
- };
203
- export type TiptapTableCellNode = {
204
- type: "tableHeader" | "tableCell";
205
- attrs?: {
206
- colspan?: number;
207
- rowspan?: number;
208
- colwidth?: Array<number> | null;
209
- backgroundColor?: string | null;
210
- };
211
- content?: Array<TiptapBlockNode>;
212
- };
213
- export type TiptapTableRowNode = {
214
- type: "tableRow";
215
- content?: Array<TiptapTableCellNode>;
216
- };
217
- export type TiptapTableNode = {
218
- type: "table";
219
- content?: Array<TiptapTableRowNode>;
220
- };
221
119
  export type TiptapBlockNode = TiptapHeadingNode | TiptapParagraphNode | TiptapLeadParagraphNode | TiptapBlockquoteNode | TiptapInformationPaneNode | TiptapConversationHistoryNode | TiptapDetailsNode | TiptapLayoutContainerNode | TiptapBulletListNode | TiptapOrderedListNode | TiptapTaskListNode | TiptapCodeBlockNode | TiptapImageNode | TiptapVideoNode | TiptapAudioNode | TiptapAttachmentNode | TiptapIframeNode | TiptapMathematicsNode | TiptapTableOfContentsNode | TiptapPageBreakNode | TiptapHorizontalRuleNode | TiptapTableNode;
222
- export type TiptapDocStats = {
223
- words: number;
224
- characters: number;
225
- readingTimeMinutes: number;
226
- readingTime?: string;
227
- wordsPerMinute?: number;
228
- };
229
- export type TiptapDocNode = {
230
- type: "doc";
231
- content: Array<TiptapBlockNode>;
232
- words?: number;
233
- characters?: number;
234
- readingTimeMinutes?: number;
235
- readingTime?: string;
236
- stats?: TiptapDocStats;
237
- };
238
120
  export type TiptapBlockType = "heading" | "paragraph" | "leadParagraph" | "quote" | "informationPane" | "conversationHistory" | "details" | "columns" | "list" | "taskList" | "code" | "image" | "video" | "audio" | "attachment" | "iframe" | "mathematics" | "tableOfContents" | "pageBreak" | "table" | "hr";
239
- export type TiptapContentInput = TiptapDocNode | {
240
- type: "doc";
241
- content: Array<TiptapBlockNode | TiptapCustomBlockNode>;
242
- } | Array<TiptapBlockNode | TiptapCustomBlockNode> | string | ReadonlyArray<string> | null | undefined;
243
- export type TiptapMediaUrlResolver = (url: string) => string | null | undefined;
244
- export type TiptapParserOptions = {
245
- allowedIframeDomains?: ReadonlyArray<string>;
246
- resolveInternalLink?: TiptapInternalLinkResolver;
247
- mediaBaseUrl?: string;
248
- resolveMediaUrl?: TiptapMediaUrlResolver;
249
- };
@@ -1 +1,2 @@
1
1
  export * from "./tiptap-inline";
2
+ export * from "./tiptap-media";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicacha-devs/astro-tiptap-blocks",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Zero-JS Astro block components and themeable renderer for Tiptap & ProseMirror rich text (JSON, HTML & Markdown)",
5
5
  "keywords": [
6
6
  "astro",