@junejs/pdf 0.2.2 → 0.2.3
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/bidi-classes.d.ts +1 -3
- package/dist/bidi-classes.js +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/markdown-typst.d.ts +1 -3
- package/dist/markdown-typst.js +1 -2
- package/dist/renderer.d.ts +1 -3
- package/dist/renderer.js +1 -2
- package/dist/tools.d.ts +1 -3
- package/dist/tools.js +1 -2
- package/package.json +2 -2
package/dist/bidi-classes.d.ts
CHANGED
package/dist/bidi-classes.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PdfDocument, PdfPaper, PdfRenderError, PdfRenderer } from "./renderer.js";
|
|
2
1
|
import { PdfToolsOptions, RenderPdfInput, RenderPdfResult, pdfFilename, pdfTools } from "./tools.js";
|
|
2
|
+
import { PdfDocument, PdfPaper, PdfRenderError, PdfRenderer } from "./renderer.js";
|
|
3
3
|
import { TypstSourceOptions, markdownToTypst, typstSource } from "./markdown-typst.js";
|
|
4
4
|
export { type PdfDocument, type PdfPaper, PdfRenderError, type PdfRenderer, type PdfToolsOptions, type RenderPdfInput, type RenderPdfResult, type TypstSourceOptions, markdownToTypst, pdfFilename, pdfTools, typstSource };
|
package/dist/markdown-typst.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { PdfDocument } from "./renderer.js";
|
|
2
|
-
//#region src/markdown-typst.d.ts
|
|
3
2
|
export type TypstSourceOptions = {
|
|
4
3
|
fonts?: string[];
|
|
5
4
|
};
|
|
6
5
|
export declare function markdownToTypst(markdown: string): string;
|
|
7
|
-
export declare function typstSource(doc: PdfDocument, opts?: TypstSourceOptions): string;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare function typstSource(doc: PdfDocument, opts?: TypstSourceOptions): string;
|
package/dist/markdown-typst.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { STRONG } from "./bidi-classes.js";
|
|
2
2
|
import { Lexer } from "marked";
|
|
3
|
-
|
|
3
|
+
// src/markdown-typst.ts
|
|
4
4
|
function markdownToTypst(markdown) {
|
|
5
5
|
return body(lex(markdown));
|
|
6
6
|
}
|
|
@@ -275,5 +275,4 @@ function decodeEntities(s) {
|
|
|
275
275
|
return NAMED[e.toLowerCase()] ?? m;
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
|
-
//#endregion
|
|
279
278
|
export { markdownToTypst, typstSource };
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/renderer.d.ts
|
|
2
1
|
export type PdfDocument = {
|
|
3
2
|
markdown: string;
|
|
4
3
|
title?: string;
|
|
@@ -15,5 +14,4 @@ export declare class PdfRenderError extends Error {
|
|
|
15
14
|
constructor(message: string, options?: {
|
|
16
15
|
cause?: unknown;
|
|
17
16
|
});
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
17
|
+
}
|
package/dist/renderer.js
CHANGED
package/dist/tools.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PdfDocument, PdfPaper, PdfRenderer } from "./renderer.js";
|
|
2
2
|
import { FileRef } from "@junejs/core/agent-files";
|
|
3
3
|
import { Tool } from "@junejs/core/agent-runtime";
|
|
4
|
-
//#region src/tools.d.ts
|
|
5
4
|
export type PdfToolsOptions = {
|
|
6
5
|
renderer: PdfRenderer;
|
|
7
6
|
name?: string;
|
|
@@ -21,5 +20,4 @@ export type RenderPdfResult = {
|
|
|
21
20
|
note: string;
|
|
22
21
|
};
|
|
23
22
|
export declare function pdfTools(opts: PdfToolsOptions): Tool[];
|
|
24
|
-
export declare function pdfFilename(raw: string): string;
|
|
25
|
-
//#endregion
|
|
23
|
+
export declare function pdfFilename(raw: string): string;
|
package/dist/tools.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools.ts
|
|
2
2
|
const PDF_MEDIA_TYPE = "application/pdf";
|
|
3
3
|
const MAX_MARKDOWN = 2e5;
|
|
4
4
|
function pdfTools(opts) {
|
|
@@ -115,5 +115,4 @@ function formatSize(bytes) {
|
|
|
115
115
|
if (bytes < 1048576) return `${(bytes / 1024).toFixed(0)} KB`;
|
|
116
116
|
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
117
117
|
}
|
|
118
|
-
//#endregion
|
|
119
118
|
export { pdfFilename, pdfTools };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junejs/pdf",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "June — PDF output as an agent capability: a render_pdf tool over a replaceable PdfRenderer (@junejs/pdf-typst-wasm is June's).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build": "tsdown"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@junejs/core": "^0.2.
|
|
27
|
+
"@junejs/core": "^0.2.3",
|
|
28
28
|
"marked": "^18.0.14"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|