@atcute/bluesky-richtext-builder 2.0.0 → 2.0.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.
- package/dist/index.d.ts +4 -4
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/lib/index.ts +4 -4
- package/package.json +5 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '@atcute/bluesky
|
|
2
|
-
import type {
|
|
1
|
+
import type { AppBskyRichtextFacet } from '@atcute/bluesky';
|
|
2
|
+
import type { Did, GenericUri } from '@atcute/lexicons';
|
|
3
3
|
type UnwrapArray<T> = T extends (infer V)[] ? V : never;
|
|
4
4
|
/** Facet interface, `app.bsky.richtext.facet#main` from the lexicon */
|
|
5
5
|
export type Facet = AppBskyRichtextFacet.Main;
|
|
@@ -40,14 +40,14 @@ declare class RichtextBuilder {
|
|
|
40
40
|
* @param uri Valid URL, for example: https://example.com
|
|
41
41
|
* @returns The builder instance, for chaining
|
|
42
42
|
*/
|
|
43
|
-
addLink(substr: string, uri:
|
|
43
|
+
addLink(substr: string, uri: GenericUri): this;
|
|
44
44
|
/**
|
|
45
45
|
* Mentions a user in rich text
|
|
46
46
|
* @param substr Text of the mention, this is usually in the form of `@handle`
|
|
47
47
|
* @param did Valid DID, for example: did:plc:ia76kvnndjutgedggx2ibrem
|
|
48
48
|
* @returns The builder instance, for chaining
|
|
49
49
|
*/
|
|
50
|
-
addMention(substr: string, did:
|
|
50
|
+
addMention(substr: string, did: Did): this;
|
|
51
51
|
/**
|
|
52
52
|
* Add inline hashtag to the rich text
|
|
53
53
|
* @param tag The tag, without the pound prefix
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"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I,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,GAAW;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,GAAG,GAAG,EAAE,EAAE,KAAK,EAAE,6BAA6B,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7F,CAAC;CACD;AAED,eAAe,eAAe,CAAC"}
|
package/lib/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '@atcute/bluesky
|
|
2
|
-
import type {
|
|
1
|
+
import type { AppBskyRichtextFacet } from '@atcute/bluesky';
|
|
2
|
+
import type { Did, GenericUri } from '@atcute/lexicons';
|
|
3
3
|
|
|
4
4
|
type UnwrapArray<T> = T extends (infer V)[] ? V : never;
|
|
5
5
|
|
|
@@ -112,7 +112,7 @@ class RichtextBuilder {
|
|
|
112
112
|
* @param uri Valid URL, for example: https://example.com
|
|
113
113
|
* @returns The builder instance, for chaining
|
|
114
114
|
*/
|
|
115
|
-
addLink(substr: string, uri:
|
|
115
|
+
addLink(substr: string, uri: GenericUri): this {
|
|
116
116
|
return this.addDecoratedText(substr, { $type: 'app.bsky.richtext.facet#link', uri: uri });
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -122,7 +122,7 @@ class RichtextBuilder {
|
|
|
122
122
|
* @param did Valid DID, for example: did:plc:ia76kvnndjutgedggx2ibrem
|
|
123
123
|
* @returns The builder instance, for chaining
|
|
124
124
|
*/
|
|
125
|
-
addMention(substr: string, did:
|
|
125
|
+
addMention(substr: string, did: Did): this {
|
|
126
126
|
return this.addDecoratedText(substr, { $type: 'app.bsky.richtext.facet#mention', did: did });
|
|
127
127
|
}
|
|
128
128
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@atcute/bluesky-richtext-builder",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"description": "builder pattern for Bluesky's rich text facets",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -18,14 +18,12 @@
|
|
|
18
18
|
".": "./dist/index.js"
|
|
19
19
|
},
|
|
20
20
|
"sideEffects": false,
|
|
21
|
-
"
|
|
22
|
-
"@atcute/bluesky": "^
|
|
23
|
-
"@atcute/
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@atcute/bluesky": "^3.0.0",
|
|
23
|
+
"@atcute/lexicons": "^1.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/bun": "^1.2.
|
|
27
|
-
"@atcute/bluesky": "^2.0.0",
|
|
28
|
-
"@atcute/client": "^3.0.0"
|
|
26
|
+
"@types/bun": "^1.2.13"
|
|
29
27
|
},
|
|
30
28
|
"scripts": {
|
|
31
29
|
"build": "tsc --project tsconfig.build.json",
|