deckjsx 0.6.0 → 0.8.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.
@@ -0,0 +1,32 @@
1
+ //#region src/projection/pptx/model.ts
2
+ function isPptxPackagePart(part) {
3
+ return part.payload !== void 0;
4
+ }
5
+ function isPptxContentTypesPart(part) {
6
+ return part.kind === "content-types" && Array.isArray(part.payload?.defaults) && Array.isArray(part.payload?.overrides);
7
+ }
8
+ function isPptxMediaPart(part) {
9
+ return part.kind === "media" && isImageSourceCandidate(part.payload?.source) && Array.isArray(part.payload?.sources) && part.payload.sources.length > 0 && part.payload.sources.every(isImageSourceCandidate);
10
+ }
11
+ function isPptxRelationshipsPart(part) {
12
+ return part.kind === "relationships" && Array.isArray(part.payload?.relationships);
13
+ }
14
+ function isPptxSlidePart(part) {
15
+ return part.kind === "slide" && typeof part.payload?.slideId === "string" && part.payload.drawing !== void 0;
16
+ }
17
+ function isPptxSupportPart(part) {
18
+ return part.category === "support" && part.payload?.kind === part.kind;
19
+ }
20
+ function isImageSourceCandidate(value) {
21
+ if (typeof value !== "object" || value === null) return false;
22
+ switch (value.kind) {
23
+ case "data": return typeof value.data === "string";
24
+ case "path": return typeof value.path === "string";
25
+ case "url": return typeof value.url === "string";
26
+ }
27
+ }
28
+ function isPptxPackageModel(projection) {
29
+ return projection.format === "pptx" && Array.isArray(projection.parts) && Array.isArray(projection.slides) && projection.parts.every(isPptxPackagePart) && projection.slides.every(isPptxSlidePart);
30
+ }
31
+ //#endregion
32
+ export { isPptxRelationshipsPart as a, isPptxPackagePart as i, isPptxMediaPart as n, isPptxSlidePart as o, isPptxPackageModel as r, isPptxSupportPart as s, isPptxContentTypesPart as t };
@@ -0,0 +1,28 @@
1
+ import { closeSync, mkdirSync, openSync, writeSync } from "node:fs";
2
+ import { mkdir, writeFile } from "node:fs/promises";
3
+ import { dirname } from "node:path";
4
+ //#region src/runtime/node-output.ts
5
+ function createNodeOutputByteSink(input) {
6
+ mkdirSync(dirname(input.output), { recursive: true });
7
+ const fd = openSync(input.output, "w");
8
+ let closed = false;
9
+ return {
10
+ name: "node-file-output",
11
+ write(chunk) {
12
+ if (closed) throw new Error("Cannot write output bytes after the file sink is closed.");
13
+ writeSync(fd, chunk, 0, chunk.byteLength);
14
+ },
15
+ close() {
16
+ if (closed) return;
17
+ closed = true;
18
+ closeSync(fd);
19
+ }
20
+ };
21
+ }
22
+ async function writeNodeOutput(input) {
23
+ await mkdir(dirname(input.output), { recursive: true });
24
+ await writeFile(input.output, input.artifact.bytes);
25
+ return { path: input.output };
26
+ }
27
+ //#endregion
28
+ export { createNodeOutputByteSink, writeNodeOutput };
@@ -0,0 +1,36 @@
1
+ import { $ as Diagnostics, M as GraphNodeId, an as StyleDeclarationValue, in as StyleDeclaration } from "./index-dx2ZSBgF.mjs";
2
+
3
+ //#region src/style/resolve.d.ts
4
+ type ResolvedStyleDeclaration = StyleDeclaration;
5
+ type ResolvedStyleValue = StyleDeclarationValue;
6
+ type ResolvedStyleLayer = "default" | "theme" | "class" | "style";
7
+ type ResolvedStyleSource = {
8
+ readonly layer: "default";
9
+ } | {
10
+ readonly layer: "theme";
11
+ readonly defaultKey: string;
12
+ } | {
13
+ readonly layer: "class";
14
+ readonly className: string;
15
+ readonly stylesheetIndex: number;
16
+ readonly ruleIndex: number;
17
+ readonly selector: string;
18
+ } | {
19
+ readonly layer: "style";
20
+ };
21
+ type ResolvedStyleProperty = {
22
+ readonly value: ResolvedStyleValue | undefined;
23
+ readonly source: ResolvedStyleSource;
24
+ };
25
+ type ResolvedStyle = {
26
+ readonly style: Readonly<ResolvedStyleDeclaration>;
27
+ readonly properties: Readonly<Record<string, ResolvedStyleProperty>>;
28
+ readonly appliedClasses: readonly ResolvedStyleSource[];
29
+ };
30
+ type ResolvedStyleMap = ReadonlyMap<GraphNodeId, ResolvedStyle>;
31
+ type StyleResolutionResult = {
32
+ readonly resolvedStyles: ResolvedStyleMap;
33
+ readonly diagnostics: Diagnostics;
34
+ };
35
+ //#endregion
36
+ export { ResolvedStyleSource as a, ResolvedStyleProperty as i, ResolvedStyleLayer as n, StyleResolutionResult as o, ResolvedStyleMap as r, ResolvedStyle as t };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "deckjsx",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Generate PowerPoint presentations from TSX/JSX through a compiler pipeline.",
5
5
  "license": "MIT",
6
6
  "author": "deckjsx contributors",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/chikina-dev/deckjsx"
9
+ "url": "git+https://github.com/chikina-dev/deckjsx.git"
10
10
  },
11
11
  "files": [
12
12
  "dist"
@@ -29,11 +29,12 @@
29
29
  "dev": "vp pack --watch",
30
30
  "test": "vp test",
31
31
  "check": "vp check",
32
- "verify:render": "bun run scripts/verify-render.ts",
32
+ "benchmark:pptx": "bun run scripts/benchmark-pptx-writer.tsx",
33
+ "verify:render": "bun run .github/render/verify-render.tsx",
33
34
  "prepublishOnly": "vp run build"
34
35
  },
35
36
  "dependencies": {
36
- "pptxgenjs": "^4.0.1"
37
+ "fflate": "^0.8.3"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@types/node": "^25.5.0",
@@ -46,22 +47,5 @@
46
47
  "vite": "npm:@voidzero-dev/vite-plus-core@latest",
47
48
  "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
48
49
  },
49
- "packageManager": "bun@1.3.13",
50
- "inlinedDependencies": {
51
- "core-util-is": "1.0.3",
52
- "image-size": "1.2.1",
53
- "immediate": "3.0.6",
54
- "inherits": "2.0.4",
55
- "isarray": "1.0.0",
56
- "jszip": "3.10.1",
57
- "lie": "3.3.0",
58
- "pako": "1.0.11",
59
- "process-nextick-args": "2.0.1",
60
- "queue": "6.0.2",
61
- "readable-stream": "2.3.8",
62
- "safe-buffer": "5.1.2",
63
- "setimmediate": "1.0.5",
64
- "string_decoder": "1.1.1",
65
- "util-deprecate": "1.0.2"
66
- }
50
+ "packageManager": "bun@1.3.13"
67
51
  }