@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,37 @@
|
|
|
1
|
+
/** pckt.blog rich-text facet feature types (`blog.pckt.richtext.facet#*`). */
|
|
2
|
+
export const PCKT_FACET = {
|
|
3
|
+
bold: "blog.pckt.richtext.facet#bold",
|
|
4
|
+
italic: "blog.pckt.richtext.facet#italic",
|
|
5
|
+
link: "blog.pckt.richtext.facet#link",
|
|
6
|
+
code: "blog.pckt.richtext.facet#code",
|
|
7
|
+
underline: "blog.pckt.richtext.facet#underline",
|
|
8
|
+
strikethrough: "blog.pckt.richtext.facet#strikethrough",
|
|
9
|
+
highlight: "blog.pckt.richtext.facet#highlight",
|
|
10
|
+
didMention: "blog.pckt.richtext.facet#didMention",
|
|
11
|
+
atMention: "blog.pckt.richtext.facet#atMention",
|
|
12
|
+
};
|
|
13
|
+
export const PCKT_BLOCK = {
|
|
14
|
+
text: "blog.pckt.block.text",
|
|
15
|
+
heading: "blog.pckt.block.heading",
|
|
16
|
+
blockquote: "blog.pckt.block.blockquote",
|
|
17
|
+
horizontalRule: "blog.pckt.block.horizontalRule",
|
|
18
|
+
bulletList: "blog.pckt.block.bulletList",
|
|
19
|
+
orderedList: "blog.pckt.block.orderedList",
|
|
20
|
+
listItem: "blog.pckt.block.listItem",
|
|
21
|
+
taskList: "blog.pckt.block.taskList",
|
|
22
|
+
taskItem: "blog.pckt.block.taskItem",
|
|
23
|
+
image: "blog.pckt.block.image",
|
|
24
|
+
codeBlock: "blog.pckt.block.codeBlock",
|
|
25
|
+
iframe: "blog.pckt.block.iframe",
|
|
26
|
+
blueskyEmbed: "blog.pckt.block.blueskyEmbed",
|
|
27
|
+
gallery: "blog.pckt.block.gallery",
|
|
28
|
+
table: "blog.pckt.block.table",
|
|
29
|
+
tableRow: "blog.pckt.block.tableRow",
|
|
30
|
+
tableHeader: "blog.pckt.block.tableHeader",
|
|
31
|
+
tableCell: "blog.pckt.block.tableCell",
|
|
32
|
+
website: "blog.pckt.block.website",
|
|
33
|
+
hardBreak: "blog.pckt.block.hardBreak",
|
|
34
|
+
noteEmbed: "blog.pckt.block.noteEmbed",
|
|
35
|
+
};
|
|
36
|
+
export const PCKT_CONTENT = "blog.pckt.content";
|
|
37
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pckt/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,+BAA+B;IACrC,MAAM,EAAE,iCAAiC;IACzC,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,+BAA+B;IACrC,SAAS,EAAE,oCAAoC;IAC/C,aAAa,EAAE,wCAAwC;IACvD,SAAS,EAAE,oCAAoC;IAC/C,UAAU,EAAE,qCAAqC;IACjD,SAAS,EAAE,oCAAoC;CACvC,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,yBAAyB;IAClC,UAAU,EAAE,4BAA4B;IACxC,cAAc,EAAE,gCAAgC;IAChD,UAAU,EAAE,4BAA4B;IACxC,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,0BAA0B;IACpC,QAAQ,EAAE,0BAA0B;IACpC,QAAQ,EAAE,0BAA0B;IACpC,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,2BAA2B;IACtC,MAAM,EAAE,wBAAwB;IAChC,YAAY,EAAE,8BAA8B;IAC5C,OAAO,EAAE,yBAAyB;IAClC,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,0BAA0B;IACpC,WAAW,EAAE,6BAA6B;IAC1C,SAAS,EAAE,2BAA2B;IACtC,OAAO,EAAE,yBAAyB;IAClC,SAAS,EAAE,2BAA2B;IACtC,SAAS,EAAE,2BAA2B;CAC9B,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Standard Site document, as supplied to the renderers.
|
|
3
|
+
*
|
|
4
|
+
* `content` is the raw content-union payload of a `site.standard.document`
|
|
5
|
+
* record (the object whose `$type` names the content format). The format is
|
|
6
|
+
* read from `content.$type`, falling back to `contentFormat`.
|
|
7
|
+
*/
|
|
8
|
+
export interface StandardSiteDocument {
|
|
9
|
+
/** The content-union payload (the `contentJson` of a document record). */
|
|
10
|
+
content: unknown;
|
|
11
|
+
/** Explicit content format `$type`, used when `content.$type` is absent. */
|
|
12
|
+
contentFormat?: string | null;
|
|
13
|
+
/** DID of the repo that hosts the document's image blobs. */
|
|
14
|
+
authorDid?: string;
|
|
15
|
+
/** Header description; a leading heading matching it is dropped as a dupe. */
|
|
16
|
+
description?: string | null;
|
|
17
|
+
}
|
|
18
|
+
/** Width ÷ height of an image (defaults to 16∶9 when unknown). */
|
|
19
|
+
export type AspectRatio = number;
|
|
20
|
+
/** How to turn a blob ref + author DID into an image URL. */
|
|
21
|
+
export type ImageUrlResolver = (input: {
|
|
22
|
+
/** Raw blob ref from the record, when the image is blob-backed. */
|
|
23
|
+
blob?: unknown;
|
|
24
|
+
/** External `https` source, when the image is not blob-backed. */
|
|
25
|
+
externalSrc?: string;
|
|
26
|
+
/** DID of the blob-hosting repo (`StandardSiteDocument.authorDid`). */
|
|
27
|
+
authorDid?: string;
|
|
28
|
+
}) => string | null;
|
|
29
|
+
/** Options that shape the render tree, independent of any UI framework. */
|
|
30
|
+
export interface RendererOptions {
|
|
31
|
+
/** Flag the body's first paragraph so renderers can add a drop cap. */
|
|
32
|
+
dropCap?: boolean;
|
|
33
|
+
/** Drop the document's leading image block (e.g. a hero shown separately). */
|
|
34
|
+
skipLeadingImage?: boolean;
|
|
35
|
+
/** Override how blob refs become image URLs (defaults to the Bluesky CDN). */
|
|
36
|
+
resolveImageUrl?: ImageUrlResolver;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,kEAAkE;AAClE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE;IACrC,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,KAAK,MAAM,GAAG,IAAI,CAAC;AAEpB,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,gBAAgB,CAAC;CACpC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@standard-reader/renderer-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-agnostic core for rendering Standard Site documents: parsing + a normalized render tree.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"standard-reader",
|
|
23
|
+
"atproto",
|
|
24
|
+
"leaflet",
|
|
25
|
+
"renderer",
|
|
26
|
+
"headless"
|
|
27
|
+
],
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"typescript": "^6.0.2",
|
|
30
|
+
"vitest": "^4.1.5"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p tsconfig.build.json",
|
|
34
|
+
"clean": "rm -rf dist",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest"
|
|
38
|
+
}
|
|
39
|
+
}
|