document-ir 0.4.2 → 0.5.0
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/WhitespaceTransformer.d.ts +3 -1
- package/dist/index.js +9 -0
- package/dist/types.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { IdentityTransformer } from './IdentityTransformer.ts';
|
|
2
|
-
import { CodeNode, DocumentNode, Node, TextNode } from './types.ts';
|
|
2
|
+
import { BadgeNode, CodeNode, DocumentNode, EmojiNode, Node, TextNode } from './types.ts';
|
|
3
3
|
export declare class WhitespaceTransformer extends IdentityTransformer {
|
|
4
4
|
private stripWhitespace;
|
|
5
5
|
private lastText;
|
|
6
6
|
constructor();
|
|
7
7
|
protected text(node: TextNode): Promise<Node | null>;
|
|
8
8
|
private stripLastText;
|
|
9
|
+
protected emoji(node: EmojiNode): Promise<Node | null>;
|
|
10
|
+
protected badge(node: BadgeNode): Promise<Node | null>;
|
|
9
11
|
protected code(node: CodeNode): Promise<Node | null>;
|
|
10
12
|
protected beforeBlock(): Promise<void>;
|
|
11
13
|
protected afterBlock(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -801,6 +801,7 @@ class u {
|
|
|
801
801
|
return await this.table(t);
|
|
802
802
|
case "text":
|
|
803
803
|
return await this.text(t);
|
|
804
|
+
case "bluesky":
|
|
804
805
|
case "toot":
|
|
805
806
|
case "tweet":
|
|
806
807
|
case "vimeo":
|
|
@@ -915,7 +916,14 @@ class T extends u {
|
|
|
915
916
|
stripLastText() {
|
|
916
917
|
this.lastText && (this.lastText.text.endsWith(" ") && (this.lastText.text = this.lastText.text.slice(0, -1)), this.lastText = null), this.stripWhitespace = !0;
|
|
917
918
|
}
|
|
919
|
+
async emoji(e) {
|
|
920
|
+
return this.lastText = null, this.stripWhitespace = !1, await super.emoji(e);
|
|
921
|
+
}
|
|
922
|
+
async badge(e) {
|
|
923
|
+
return this.lastText = null, this.stripWhitespace = !1, await super.badge(e);
|
|
924
|
+
}
|
|
918
925
|
async code(e) {
|
|
926
|
+
this.lastText = null, this.stripWhitespace = !1;
|
|
919
927
|
const i = {
|
|
920
928
|
type: "code",
|
|
921
929
|
content: e.content
|
|
@@ -1265,6 +1273,7 @@ class w {
|
|
|
1265
1273
|
return this.table(t);
|
|
1266
1274
|
case "text":
|
|
1267
1275
|
return this.text(t);
|
|
1276
|
+
case "bluesky":
|
|
1268
1277
|
case "toot":
|
|
1269
1278
|
case "tweet":
|
|
1270
1279
|
case "vimeo":
|
package/dist/types.d.ts
CHANGED
|
@@ -303,6 +303,10 @@ export interface TootNode extends NodeIdentity {
|
|
|
303
303
|
type: "toot";
|
|
304
304
|
id: string;
|
|
305
305
|
}
|
|
306
|
+
export interface BlueskyNode extends NodeIdentity {
|
|
307
|
+
type: "bluesky";
|
|
308
|
+
id: string;
|
|
309
|
+
}
|
|
306
310
|
export interface VimeoNode extends NodeIdentity {
|
|
307
311
|
type: "vimeo";
|
|
308
312
|
id: string;
|
|
@@ -311,7 +315,7 @@ export interface YoutubeNode extends NodeIdentity {
|
|
|
311
315
|
type: "youtube";
|
|
312
316
|
id: string;
|
|
313
317
|
}
|
|
314
|
-
export type SocialNode = TweetNode | TootNode | VimeoNode | YoutubeNode;
|
|
318
|
+
export type SocialNode = TweetNode | TootNode | BlueskyNode | VimeoNode | YoutubeNode;
|
|
315
319
|
export interface CardHeader extends NodeIdentity {
|
|
316
320
|
type: "card-header";
|
|
317
321
|
imageUrl?: string;
|