@standard-reader/renderer-core 0.1.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/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/atproto/blob.d.ts +31 -0
- package/dist/atproto/blob.d.ts.map +1 -0
- package/dist/atproto/blob.js +47 -0
- package/dist/atproto/blob.js.map +1 -0
- package/dist/build.d.ts +13 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +674 -0
- package/dist/build.js.map +1 -0
- package/dist/document/content-formats.d.ts +18 -0
- package/dist/document/content-formats.d.ts.map +1 -0
- package/dist/document/content-formats.js +76 -0
- package/dist/document/content-formats.js.map +1 -0
- package/dist/document/structured-content/blocknote.d.ts +11 -0
- package/dist/document/structured-content/blocknote.d.ts.map +1 -0
- package/dist/document/structured-content/blocknote.js +169 -0
- package/dist/document/structured-content/blocknote.js.map +1 -0
- package/dist/document/structured-content/fables.d.ts +5 -0
- package/dist/document/structured-content/fables.d.ts.map +1 -0
- package/dist/document/structured-content/fables.js +61 -0
- package/dist/document/structured-content/fables.js.map +1 -0
- package/dist/document/structured-content/image.d.ts +22 -0
- package/dist/document/structured-content/image.d.ts.map +1 -0
- package/dist/document/structured-content/image.js +54 -0
- package/dist/document/structured-content/image.js.map +1 -0
- package/dist/document/structured-content/item-blocks.d.ts +12 -0
- package/dist/document/structured-content/item-blocks.d.ts.map +1 -0
- package/dist/document/structured-content/item-blocks.js +138 -0
- package/dist/document/structured-content/item-blocks.js.map +1 -0
- package/dist/document/structured-content/oxa.d.ts +5 -0
- package/dist/document/structured-content/oxa.d.ts.map +1 -0
- package/dist/document/structured-content/oxa.js +72 -0
- package/dist/document/structured-content/oxa.js.map +1 -0
- package/dist/document/structured-content/prosemirror.d.ts +10 -0
- package/dist/document/structured-content/prosemirror.d.ts.map +1 -0
- package/dist/document/structured-content/prosemirror.js +165 -0
- package/dist/document/structured-content/prosemirror.js.map +1 -0
- package/dist/document/structured-content/text-runs.d.ts +16 -0
- package/dist/document/structured-content/text-runs.d.ts.map +1 -0
- package/dist/document/structured-content/text-runs.js +64 -0
- package/dist/document/structured-content/text-runs.js.map +1 -0
- package/dist/document/structured-content/types.d.ts +131 -0
- package/dist/document/structured-content/types.d.ts.map +1 -0
- package/dist/document/structured-content/types.js +2 -0
- package/dist/document/structured-content/types.js.map +1 -0
- package/dist/facets.d.ts +16 -0
- package/dist/facets.d.ts.map +1 -0
- package/dist/facets.js +16 -0
- package/dist/facets.js.map +1 -0
- package/dist/image.d.ts +13 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +32 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/inline.d.ts +14 -0
- package/dist/inline.d.ts.map +1 -0
- package/dist/inline.js +78 -0
- package/dist/inline.js.map +1 -0
- package/dist/internal.d.ts +24 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +44 -0
- package/dist/internal.js.map +1 -0
- package/dist/leaflet/blocks.d.ts +18 -0
- package/dist/leaflet/blocks.d.ts.map +1 -0
- package/dist/leaflet/blocks.js +437 -0
- package/dist/leaflet/blocks.js.map +1 -0
- package/dist/leaflet/facets.d.ts +10 -0
- package/dist/leaflet/facets.d.ts.map +1 -0
- package/dist/leaflet/facets.js +77 -0
- package/dist/leaflet/facets.js.map +1 -0
- package/dist/leaflet/footnotes.d.ts +29 -0
- package/dist/leaflet/footnotes.d.ts.map +1 -0
- package/dist/leaflet/footnotes.js +113 -0
- package/dist/leaflet/footnotes.js.map +1 -0
- package/dist/leaflet/image.d.ts +9 -0
- package/dist/leaflet/image.d.ts.map +1 -0
- package/dist/leaflet/image.js +16 -0
- package/dist/leaflet/image.js.map +1 -0
- package/dist/leaflet/types.d.ts +266 -0
- package/dist/leaflet/types.d.ts.map +1 -0
- package/dist/leaflet/types.js +46 -0
- package/dist/leaflet/types.js.map +1 -0
- package/dist/leaflet/utf8.d.ts +5 -0
- package/dist/leaflet/utf8.d.ts.map +1 -0
- package/dist/leaflet/utf8.js +12 -0
- package/dist/leaflet/utf8.js.map +1 -0
- package/dist/nodes.d.ts +200 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +15 -0
- package/dist/nodes.js.map +1 -0
- package/dist/offprint/blocks.d.ts +3 -0
- package/dist/offprint/blocks.d.ts.map +1 -0
- package/dist/offprint/blocks.js +265 -0
- package/dist/offprint/blocks.js.map +1 -0
- package/dist/offprint/types.d.ts +25 -0
- package/dist/offprint/types.d.ts.map +1 -0
- package/dist/offprint/types.js +25 -0
- package/dist/offprint/types.js.map +1 -0
- package/dist/pckt/blocks.d.ts +19 -0
- package/dist/pckt/blocks.d.ts.map +1 -0
- package/dist/pckt/blocks.js +337 -0
- package/dist/pckt/blocks.js.map +1 -0
- package/dist/pckt/image.d.ts +11 -0
- package/dist/pckt/image.d.ts.map +1 -0
- package/dist/pckt/image.js +48 -0
- package/dist/pckt/image.js.map +1 -0
- package/dist/pckt/types.d.ts +220 -0
- package/dist/pckt/types.d.ts.map +1 -0
- package/dist/pckt/types.js +37 -0
- package/dist/pckt/types.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/document/structured-content/types.ts"],"names":[],"mappings":"AAkGA,MAAM,CAAC,MAAM,yBAAyB,GAAG,gCAAgC,CAAC"}
|
package/dist/facets.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface FacetFeature {
|
|
2
|
+
$type?: string;
|
|
3
|
+
uri?: string;
|
|
4
|
+
did?: string;
|
|
5
|
+
handle?: string;
|
|
6
|
+
atURI?: string;
|
|
7
|
+
/** `#footnote` — stable id shared by the inline reference and its entry. */
|
|
8
|
+
footnoteId?: string;
|
|
9
|
+
/** `#footnote` — the footnote body as plaintext (for the reference tooltip). */
|
|
10
|
+
contentPlaintext?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Extract the `#feature` suffix from any AT Proto facet `$type`. */
|
|
13
|
+
export declare function facetFeatureKind($type: string | undefined): string | null;
|
|
14
|
+
export declare function hasFacetKind(features: Array<FacetFeature>, kind: string): boolean;
|
|
15
|
+
export declare function findFacetFeature(features: Array<FacetFeature>, kind: string): FacetFeature | undefined;
|
|
16
|
+
//# sourceMappingURL=facets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facets.d.ts","sourceRoot":"","sources":["../src/facets.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKzE;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,EAC7B,IAAI,EAAE,MAAM,GACX,OAAO,CAET;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,EAC7B,IAAI,EAAE,MAAM,GACX,YAAY,GAAG,SAAS,CAE1B"}
|
package/dist/facets.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Extract the `#feature` suffix from any AT Proto facet `$type`. */
|
|
2
|
+
export function facetFeatureKind($type) {
|
|
3
|
+
if (!$type)
|
|
4
|
+
return null;
|
|
5
|
+
const hash = $type.indexOf("#");
|
|
6
|
+
if (hash === -1)
|
|
7
|
+
return null;
|
|
8
|
+
return $type.slice(hash + 1);
|
|
9
|
+
}
|
|
10
|
+
export function hasFacetKind(features, kind) {
|
|
11
|
+
return features.some((feature) => facetFeatureKind(feature.$type) === kind);
|
|
12
|
+
}
|
|
13
|
+
export function findFacetFeature(features, kind) {
|
|
14
|
+
return features.find((feature) => facetFeatureKind(feature.$type) === kind);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=facets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facets.js","sourceRoot":"","sources":["../src/facets.ts"],"names":[],"mappings":"AAYA,qEAAqE;AACrE,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACxD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,IAAI,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,QAA6B,EAC7B,IAAY;IAEZ,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,QAA6B,EAC7B,IAAY;IAEZ,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/image.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StructuredGridImage } from "./document/structured-content/types";
|
|
2
|
+
import type { CollectionImage } from "./nodes";
|
|
3
|
+
import type { ImageUrlResolver } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* The default image URL resolver: pass through absolute `https` sources, and
|
|
6
|
+
* build a Bluesky CDN URL from a blob CID + the document's author DID. PNG is
|
|
7
|
+
* requested to preserve alpha, matching the app. The CDN serves any PDS blob by
|
|
8
|
+
* `(did, cid)`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const defaultImageUrlResolver: ImageUrlResolver;
|
|
11
|
+
/** Resolve a list of structured grid images to renderable collection images. */
|
|
12
|
+
export declare function resolveGridImages(images: Array<StructuredGridImage>, resolve: ImageUrlResolver, authorDid: string | undefined): Array<CollectionImage>;
|
|
13
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBASrC,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,KAAK,CAAC,mBAAmB,CAAC,EAClC,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,KAAK,CAAC,eAAe,CAAC,CAYxB"}
|
package/dist/image.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { structuredImageAspectRatio } from "./document/structured-content/image";
|
|
2
|
+
import { blobImageUrl, externalHttpUrl } from "./internal";
|
|
3
|
+
/**
|
|
4
|
+
* The default image URL resolver: pass through absolute `https` sources, and
|
|
5
|
+
* build a Bluesky CDN URL from a blob CID + the document's author DID. PNG is
|
|
6
|
+
* requested to preserve alpha, matching the app. The CDN serves any PDS blob by
|
|
7
|
+
* `(did, cid)`.
|
|
8
|
+
*/
|
|
9
|
+
export const defaultImageUrlResolver = ({ blob, externalSrc, authorDid, }) => {
|
|
10
|
+
const external = externalHttpUrl(externalSrc);
|
|
11
|
+
if (external)
|
|
12
|
+
return external;
|
|
13
|
+
if (!authorDid)
|
|
14
|
+
return null;
|
|
15
|
+
return blobImageUrl(blob, authorDid);
|
|
16
|
+
};
|
|
17
|
+
/** Resolve a list of structured grid images to renderable collection images. */
|
|
18
|
+
export function resolveGridImages(images, resolve, authorDid) {
|
|
19
|
+
return images.flatMap((image) => {
|
|
20
|
+
const src = resolve({ blob: image.blob, authorDid });
|
|
21
|
+
if (!src)
|
|
22
|
+
return [];
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
src,
|
|
26
|
+
alt: image.alt ?? "",
|
|
27
|
+
aspectRatio: structuredImageAspectRatio(image),
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI3D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAqB,CAAC,EACxD,IAAI,EACJ,WAAW,EACX,SAAS,GACV,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,gFAAgF;AAChF,MAAM,UAAU,iBAAiB,CAC/B,MAAkC,EAClC,OAAyB,EACzB,SAA6B;IAE7B,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,GAAG;YAAE,OAAO,EAAE,CAAC;QACpB,OAAO;YACL;gBACE,GAAG;gBACH,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE;gBACpB,WAAW,EAAE,0BAA0B,CAAC,KAAK,CAAC;aAC/C;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { buildRenderTree } from "./build";
|
|
2
|
+
export { segmentInline, richTextIsEmpty } from "./inline";
|
|
3
|
+
export type { DocumentTree, BlockNode, InlineNode, MarkKind, RichText, ListItem, TaskItem, TableCell, TableRow, CollectionImage, FootnoteEntry, } from "./nodes";
|
|
4
|
+
export type { StandardSiteDocument, RendererOptions, ImageUrlResolver, AspectRatio, } from "./types";
|
|
5
|
+
export { defaultImageUrlResolver, resolveGridImages } from "./image";
|
|
6
|
+
export { blobCid, cdnImageUrl } from "./atproto/blob";
|
|
7
|
+
export type { BlobRef } from "./atproto/blob";
|
|
8
|
+
export { leafletBlocks, leafletBskyPostUris, asLeafletContent, } from "./leaflet/blocks";
|
|
9
|
+
export type { LeafletRenderableBlock, LeafletContent } from "./leaflet/types";
|
|
10
|
+
export { LEAFLET_CONTENT } from "./leaflet/types";
|
|
11
|
+
export { pcktBlocks, asPcktContent } from "./pckt/blocks";
|
|
12
|
+
export type { PcktRenderableBlock, PcktContent } from "./pckt/types";
|
|
13
|
+
export { PCKT_CONTENT } from "./pckt/types";
|
|
14
|
+
export { offprintBlocks } from "./offprint/blocks";
|
|
15
|
+
export { OFFPRINT_CONTENT } from "./offprint/types";
|
|
16
|
+
export { structuredFormatBlocks, STRUCTURED_BLOCK_FORMATS, isStructuredBlockFormat, leafletDocumentContent, LEAFLET_DOCUMENT_FORMAT, } from "./document/content-formats";
|
|
17
|
+
export type { StructuredRenderableBlock, StructuredText, } from "./document/structured-content/types";
|
|
18
|
+
export { collectLeafletFootnotes } from "./leaflet/footnotes";
|
|
19
|
+
export type { LeafletFootnote } from "./leaflet/footnotes";
|
|
20
|
+
export { segmentFacetedText } from "./leaflet/facets";
|
|
21
|
+
export { facetFeatureKind, hasFacetKind, findFacetFeature } from "./facets";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC1D,YAAY,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,yBAAyB,EACzB,cAAc,GACf,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Public entry point for @standard-reader/renderer-core — the framework-agnostic
|
|
2
|
+
// parsing + normalized render tree that every UI-framework renderer builds on.
|
|
3
|
+
// The normalized render tree + inline segmentation
|
|
4
|
+
export { buildRenderTree } from "./build";
|
|
5
|
+
export { segmentInline, richTextIsEmpty } from "./inline";
|
|
6
|
+
// Image resolution
|
|
7
|
+
export { defaultImageUrlResolver, resolveGridImages } from "./image";
|
|
8
|
+
export { blobCid, cdnImageUrl } from "./atproto/blob";
|
|
9
|
+
// Pure block-vocabulary parsers + types
|
|
10
|
+
export { leafletBlocks, leafletBskyPostUris, asLeafletContent, } from "./leaflet/blocks";
|
|
11
|
+
export { LEAFLET_CONTENT } from "./leaflet/types";
|
|
12
|
+
export { pcktBlocks, asPcktContent } from "./pckt/blocks";
|
|
13
|
+
export { PCKT_CONTENT } from "./pckt/types";
|
|
14
|
+
export { offprintBlocks } from "./offprint/blocks";
|
|
15
|
+
export { OFFPRINT_CONTENT } from "./offprint/types";
|
|
16
|
+
export { structuredFormatBlocks, STRUCTURED_BLOCK_FORMATS, isStructuredBlockFormat, leafletDocumentContent, LEAFLET_DOCUMENT_FORMAT, } from "./document/content-formats";
|
|
17
|
+
export { collectLeafletFootnotes } from "./leaflet/footnotes";
|
|
18
|
+
// Facet helpers
|
|
19
|
+
export { segmentFacetedText } from "./leaflet/facets";
|
|
20
|
+
export { facetFeatureKind, hasFacetKind, findFacetFeature } from "./facets";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAE/E,mDAAmD;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAuB1D,mBAAmB;AACnB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGtD,wCAAwC;AACxC,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,gBAAgB;AAChB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/inline.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InlineNode, RichText } from "./nodes";
|
|
2
|
+
/**
|
|
3
|
+
* Turn a run of faceted rich text into an {@link InlineNode} tree: split the
|
|
4
|
+
* plaintext by byte-indexed facets, then compose marks, links, mentions and
|
|
5
|
+
* footnote references over each segment. Works across every format's facet
|
|
6
|
+
* dialect (the `#feature` suffix is what's matched, not the full `$type`).
|
|
7
|
+
*
|
|
8
|
+
* `footnoteNumbers` maps a footnote id to its 1-based display number; pass the
|
|
9
|
+
* map from {@link DocumentTree} so inline references are numbered.
|
|
10
|
+
*/
|
|
11
|
+
export declare function segmentInline(text: RichText, footnoteNumbers?: ReadonlyMap<string, number>): Array<InlineNode>;
|
|
12
|
+
/** True when a rich-text run carries any renderable text. */
|
|
13
|
+
export declare function richTextIsEmpty(text: RichText): boolean;
|
|
14
|
+
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../src/inline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAY,QAAQ,EAAE,MAAM,SAAS,CAAC;AAM9D;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,QAAQ,EACd,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5C,KAAK,CAAC,UAAU,CAAC,CAgEnB;AAED,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAEvD"}
|
package/dist/inline.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { findFacetFeature, hasFacetKind } from "./facets";
|
|
2
|
+
import { segmentFacetedText } from "./leaflet/facets";
|
|
3
|
+
function wrapMark(node, mark) {
|
|
4
|
+
return { type: "mark", mark, children: [node] };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Turn a run of faceted rich text into an {@link InlineNode} tree: split the
|
|
8
|
+
* plaintext by byte-indexed facets, then compose marks, links, mentions and
|
|
9
|
+
* footnote references over each segment. Works across every format's facet
|
|
10
|
+
* dialect (the `#feature` suffix is what's matched, not the full `$type`).
|
|
11
|
+
*
|
|
12
|
+
* `footnoteNumbers` maps a footnote id to its 1-based display number; pass the
|
|
13
|
+
* map from {@link DocumentTree} so inline references are numbered.
|
|
14
|
+
*/
|
|
15
|
+
export function segmentInline(text, footnoteNumbers) {
|
|
16
|
+
const segments = segmentFacetedText(text.plaintext, text.facets);
|
|
17
|
+
const out = [];
|
|
18
|
+
for (const segment of segments) {
|
|
19
|
+
const { text: value, features } = segment;
|
|
20
|
+
if (features.length === 0) {
|
|
21
|
+
out.push({ type: "text", value });
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const isBold = hasFacetKind(features, "bold") || hasFacetKind(features, "strong");
|
|
25
|
+
const isItalic = hasFacetKind(features, "italic");
|
|
26
|
+
const isCode = hasFacetKind(features, "code");
|
|
27
|
+
const isUnderline = hasFacetKind(features, "underline");
|
|
28
|
+
const isStrikethrough = hasFacetKind(features, "strikethrough");
|
|
29
|
+
const isHighlight = hasFacetKind(features, "highlight");
|
|
30
|
+
// Offprint's `#webMention` is a `#link` enriched with page metadata; render
|
|
31
|
+
// it as a plain link since the plaintext already carries the label.
|
|
32
|
+
const link = findFacetFeature(features, "link") ??
|
|
33
|
+
findFacetFeature(features, "webMention");
|
|
34
|
+
const mention = findFacetFeature(features, "atMention") ??
|
|
35
|
+
findFacetFeature(features, "didMention") ??
|
|
36
|
+
findFacetFeature(features, "mention");
|
|
37
|
+
const footnote = findFacetFeature(features, "footnote");
|
|
38
|
+
let node = { type: "text", value };
|
|
39
|
+
if (isCode)
|
|
40
|
+
node = wrapMark(node, "code");
|
|
41
|
+
if (mention && (mention.atURI || mention.did)) {
|
|
42
|
+
node = {
|
|
43
|
+
type: "mention",
|
|
44
|
+
atUri: mention.atURI,
|
|
45
|
+
did: mention.did,
|
|
46
|
+
children: [node],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
else if (link?.uri) {
|
|
50
|
+
node = { type: "link", href: link.uri, children: [node] };
|
|
51
|
+
}
|
|
52
|
+
if (isHighlight)
|
|
53
|
+
node = wrapMark(node, "highlight");
|
|
54
|
+
if (isStrikethrough)
|
|
55
|
+
node = wrapMark(node, "strikethrough");
|
|
56
|
+
if (isUnderline)
|
|
57
|
+
node = wrapMark(node, "underline");
|
|
58
|
+
if (isItalic)
|
|
59
|
+
node = wrapMark(node, "emphasis");
|
|
60
|
+
if (isBold)
|
|
61
|
+
node = wrapMark(node, "strong");
|
|
62
|
+
out.push(node);
|
|
63
|
+
if (footnote?.footnoteId) {
|
|
64
|
+
out.push({
|
|
65
|
+
type: "footnoteRef",
|
|
66
|
+
footnoteId: footnote.footnoteId,
|
|
67
|
+
number: footnoteNumbers?.get(footnote.footnoteId) ?? null,
|
|
68
|
+
contentPlaintext: footnote.contentPlaintext,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return out;
|
|
73
|
+
}
|
|
74
|
+
/** True when a rich-text run carries any renderable text. */
|
|
75
|
+
export function richTextIsEmpty(text) {
|
|
76
|
+
return text.plaintext.length === 0;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../src/inline.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small internal helpers shared across the format parsers and the render-tree
|
|
3
|
+
* builder. Deliberately not re-exported from `index.ts` — these are
|
|
4
|
+
* implementation details, not part of the package's public API.
|
|
5
|
+
*
|
|
6
|
+
* This module has no local dependencies beyond {@link ./atproto/blob}, so it
|
|
7
|
+
* stays a leaf in the import graph and can be pulled in anywhere without
|
|
8
|
+
* risking a cycle.
|
|
9
|
+
*/
|
|
10
|
+
/** Narrow to a plain (non-array) object. */
|
|
11
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
12
|
+
/** The value unchanged when it is an absolute `http(s)` URL string, else null. */
|
|
13
|
+
export declare function externalHttpUrl(value: unknown): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Width ÷ height for image layout. Returns {@link fallback} (16∶9 by default)
|
|
16
|
+
* when either dimension is missing, non-numeric, or non-positive.
|
|
17
|
+
*/
|
|
18
|
+
export declare function aspectRatioFromDimensions(width: unknown, height: unknown, fallback?: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Build a Bluesky CDN image URL from a blob ref + the repo's DID. Returns null
|
|
21
|
+
* when the blob carries no CID. PNG is requested to preserve alpha.
|
|
22
|
+
*/
|
|
23
|
+
export declare function blobImageUrl(blob: unknown, did: string): string | null;
|
|
24
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,4CAA4C;AAC5C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI7D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,QAAQ,SAAS,GAChB,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAItE"}
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small internal helpers shared across the format parsers and the render-tree
|
|
3
|
+
* builder. Deliberately not re-exported from `index.ts` — these are
|
|
4
|
+
* implementation details, not part of the package's public API.
|
|
5
|
+
*
|
|
6
|
+
* This module has no local dependencies beyond {@link ./atproto/blob}, so it
|
|
7
|
+
* stays a leaf in the import graph and can be pulled in anywhere without
|
|
8
|
+
* risking a cycle.
|
|
9
|
+
*/
|
|
10
|
+
import { blobCid, cdnImageUrl } from "./atproto/blob";
|
|
11
|
+
/** Narrow to a plain (non-array) object. */
|
|
12
|
+
export function isRecord(value) {
|
|
13
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14
|
+
}
|
|
15
|
+
/** The value unchanged when it is an absolute `http(s)` URL string, else null. */
|
|
16
|
+
export function externalHttpUrl(value) {
|
|
17
|
+
return typeof value === "string" && /^https?:\/\//i.test(value)
|
|
18
|
+
? value
|
|
19
|
+
: null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Width ÷ height for image layout. Returns {@link fallback} (16∶9 by default)
|
|
23
|
+
* when either dimension is missing, non-numeric, or non-positive.
|
|
24
|
+
*/
|
|
25
|
+
export function aspectRatioFromDimensions(width, height, fallback = 16 / 9) {
|
|
26
|
+
if (typeof width === "number" &&
|
|
27
|
+
typeof height === "number" &&
|
|
28
|
+
width > 0 &&
|
|
29
|
+
height > 0) {
|
|
30
|
+
return width / height;
|
|
31
|
+
}
|
|
32
|
+
return fallback;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build a Bluesky CDN image URL from a blob ref + the repo's DID. Returns null
|
|
36
|
+
* when the blob carries no CID. PNG is requested to preserve alpha.
|
|
37
|
+
*/
|
|
38
|
+
export function blobImageUrl(blob, did) {
|
|
39
|
+
const cid = blobCid(blob);
|
|
40
|
+
if (!cid)
|
|
41
|
+
return null;
|
|
42
|
+
return cdnImageUrl(did, cid, "png");
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtD,4CAA4C;AAC5C,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;QAC7D,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAc,EACd,MAAe,EACf,QAAQ,GAAG,EAAE,GAAG,CAAC;IAEjB,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,MAAM,KAAK,QAAQ;QAC1B,KAAK,GAAG,CAAC;QACT,MAAM,GAAG,CAAC,EACV,CAAC;QACD,OAAO,KAAK,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAa,EAAE,GAAW;IACrD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAqC,CAAC,CAAC;IAC3D,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LeafletContent, LeafletRenderableBlock, LeafletTextBlock, LeafletWebsiteBlock } from "./types";
|
|
2
|
+
export declare function asTextBlock(value: unknown): LeafletTextBlock | null;
|
|
3
|
+
/** Bookmark URL for a leaflet website block (`src` in current lexicon). */
|
|
4
|
+
export declare function leafletWebsiteSrc(block: LeafletWebsiteBlock): string;
|
|
5
|
+
/** Every renderable block in document order. */
|
|
6
|
+
export declare function leafletBlocks(content: unknown): Array<LeafletRenderableBlock>;
|
|
7
|
+
/** AT-URIs of every embedded Bluesky post block, in document order. */
|
|
8
|
+
export declare function leafletBskyPostUris(content: unknown): Array<string>;
|
|
9
|
+
/** First header plaintext inside a page embed, for chrome labels. */
|
|
10
|
+
export declare function leafletPageEmbedLabel(blocks: Array<LeafletRenderableBlock>): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Plaintext lines contributed by a single leaflet block (for reading-time
|
|
13
|
+
* ingest). `bskyPostText` optionally supplies narration text for embedded
|
|
14
|
+
* Bluesky posts (keyed by their AT-URI) so the page reader can speak them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function plaintextLinesFromBlock(block: LeafletRenderableBlock, bskyPostText?: Map<string, string>): Array<string>;
|
|
17
|
+
export declare function asLeafletContent(content: unknown): LeafletContent | null;
|
|
18
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/leaflet/blocks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,cAAc,EAQd,sBAAsB,EAGtB,gBAAgB,EAEhB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAoBjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAKnE;AA4DD,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAEpE;AAgPD,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAAC,sBAAsB,CAAC,CA0B7E;AAED,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,GACpC,MAAM,GAAG,IAAI,CAQf;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,EAC7B,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,KAAK,CAAC,MAAM,CAAC,CA0Ef;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAIxE"}
|