@artifact-kit/deckkit-pro 0.1.1 → 0.1.2
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/cli.cjs +4 -4
- package/dist/image.cjs +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/dist/replica-runtime.cjs +175 -0
- package/dist/replica-runtime.js +175 -0
- package/dist/svg-to-png-cli.cjs +4 -4
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/replica-runtime.d.ts +150 -0
- package/dist/types/replica-runtime.d.ts.map +1 -0
- package/package.json +6 -1
package/dist/cli.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
const
|
|
3
|
+
const fs = require("node:fs");
|
|
4
4
|
const promises = require("node:fs/promises");
|
|
5
|
-
const
|
|
5
|
+
const path = require("node:path");
|
|
6
6
|
const image = require("./image.cjs");
|
|
7
7
|
const svgToPng = require("./svg-to-png.cjs");
|
|
8
8
|
const FIT_VALUES = /* @__PURE__ */ new Set(["cover", "contain", "fill", "inside", "outside"]);
|
|
@@ -133,7 +133,7 @@ function normalizeOptionName(name) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
async function readSvgInput(input) {
|
|
136
|
-
if (
|
|
136
|
+
if (fs.existsSync(input)) {
|
|
137
137
|
return promises.readFile(input, "utf8");
|
|
138
138
|
}
|
|
139
139
|
return input;
|
|
@@ -178,7 +178,7 @@ function readValue(args, index, option) {
|
|
|
178
178
|
return value;
|
|
179
179
|
}
|
|
180
180
|
function printUsage() {
|
|
181
|
-
const command =
|
|
181
|
+
const command = path.basename(process.argv[1] ?? "cli.js", path.extname(process.argv[1] ?? ""));
|
|
182
182
|
console.log(`Usage:
|
|
183
183
|
node ${command}.js image-info <image>
|
|
184
184
|
node ${command}.js crop <image> --x <px> --y <px> --w <px> --h <px> -o <png>
|
package/dist/image.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
|
-
const
|
|
4
|
+
const path = require("node:path");
|
|
5
5
|
const sharp = require("sharp");
|
|
6
6
|
async function getImageInfo(input) {
|
|
7
7
|
const metadata = await sharp(input).metadata();
|
|
@@ -90,7 +90,7 @@ async function withOpacity(input, opacity) {
|
|
|
90
90
|
}).png().toBuffer();
|
|
91
91
|
}
|
|
92
92
|
async function writeImage(buffer, output) {
|
|
93
|
-
await promises.mkdir(
|
|
93
|
+
await promises.mkdir(path.dirname(output), { recursive: true });
|
|
94
94
|
await sharp(buffer).toFile(output);
|
|
95
95
|
}
|
|
96
96
|
exports.compareImages = compareImages;
|
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const svgToCustomGeometry = require("./svg-to-custom-geometry.cjs");
|
|
|
5
5
|
const lifecycle = require("./lifecycle.cjs");
|
|
6
6
|
const svgFallback = require("./svg-fallback.cjs");
|
|
7
7
|
const svgToPng = require("./svg-to-png.cjs");
|
|
8
|
+
const replicaRuntime = require("./replica-runtime.cjs");
|
|
8
9
|
const image = require("./image.cjs");
|
|
9
10
|
function deckkitPro(options = {}) {
|
|
10
11
|
if (options.DeckKit) lifecycle.installDeckKitLifecyclePatch(options.DeckKit);
|
|
@@ -28,6 +29,7 @@ exports.prepareSvgPngFallbacks = svgFallback.prepareSvgPngFallbacks;
|
|
|
28
29
|
exports.setupSvgPngFallback = svgFallback.setupSvgPngFallback;
|
|
29
30
|
exports.renderSvgToPng = svgToPng.renderSvgToPng;
|
|
30
31
|
exports.writeSvgToPng = svgToPng.writeSvgToPng;
|
|
32
|
+
exports.createReplicaRuntime = replicaRuntime.createReplicaRuntime;
|
|
31
33
|
exports.compareImages = image.compareImages;
|
|
32
34
|
exports.cropImage = image.cropImage;
|
|
33
35
|
exports.getImageInfo = image.getImageInfo;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { addBeforeWriteHook } from "./lifecycle.js";
|
|
|
7
7
|
import { setupSvgPngFallback } from "./svg-fallback.js";
|
|
8
8
|
import { prepareSvgPngFallbacks } from "./svg-fallback.js";
|
|
9
9
|
import { renderSvgToPng, writeSvgToPng } from "./svg-to-png.js";
|
|
10
|
+
import { createReplicaRuntime } from "./replica-runtime.js";
|
|
10
11
|
import { compareImages, cropImage, getImageInfo, overlayImages, resizeImage, sampleColor, writeImage } from "./image.js";
|
|
11
12
|
function deckkitPro(options = {}) {
|
|
12
13
|
if (options.DeckKit) installDeckKitLifecyclePatch(options.DeckKit);
|
|
@@ -22,6 +23,7 @@ function deckkitPro(options = {}) {
|
|
|
22
23
|
export {
|
|
23
24
|
addBeforeWriteHook,
|
|
24
25
|
compareImages,
|
|
26
|
+
createReplicaRuntime,
|
|
25
27
|
cropImage,
|
|
26
28
|
deckkitPro,
|
|
27
29
|
deckkitPro as default,
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const node_url = require("node:url");
|
|
6
|
+
const DEFAULT_TASK_MANIFEST = "manifests/tasks/native-elements.json";
|
|
7
|
+
const DEFAULT_CROPS_MANIFEST = "manifests/source-raster-cutouts.json";
|
|
8
|
+
const DEFAULT_SVG_ASSETS_MANIFEST = "manifests/svg-assets.json";
|
|
9
|
+
const DEFAULT_NATIVE_ELEMENTS_MANIFEST = "manifests/native-elements.json";
|
|
10
|
+
const DEFAULT_NATIVE_ELEMENTS_SCRIPT = "scripts/regions/native-elements.mjs";
|
|
11
|
+
const DEFAULT_SLIDE_WIDTH = 13.333;
|
|
12
|
+
const SVG_ROUTES = /* @__PURE__ */ new Set(["svg-image", "editable-vector", "drawio-svg"]);
|
|
13
|
+
function workspaceFromImportMeta(importMetaUrl) {
|
|
14
|
+
const filePath = node_url.fileURLToPath(importMetaUrl);
|
|
15
|
+
return path.resolve(path.dirname(filePath), "../..");
|
|
16
|
+
}
|
|
17
|
+
function readJson(workspacePath, relPath) {
|
|
18
|
+
return JSON.parse(fs.readFileSync(path.join(workspacePath, relPath), "utf8"));
|
|
19
|
+
}
|
|
20
|
+
function readOptionalJson(workspacePath, relPath) {
|
|
21
|
+
try {
|
|
22
|
+
const filePath = path.join(workspacePath, relPath);
|
|
23
|
+
if (!fs.existsSync(filePath)) return null;
|
|
24
|
+
const text = fs.readFileSync(filePath, "utf8").trim();
|
|
25
|
+
return text ? JSON.parse(text) : null;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function assertFiniteBBox(bbox, label) {
|
|
31
|
+
for (const key of ["x", "y", "w", "h"]) {
|
|
32
|
+
if (!Number.isFinite(bbox[key])) throw new Error(`${label} bbox has non-finite ${key}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function unique(items) {
|
|
36
|
+
return [...new Set(items)];
|
|
37
|
+
}
|
|
38
|
+
function createReplicaRuntime(options) {
|
|
39
|
+
const workspacePath = path.resolve(options.workspacePath ?? workspaceFromImportMeta(options.importMetaUrl));
|
|
40
|
+
const taskManifestPath = options.taskManifestPath ?? DEFAULT_TASK_MANIFEST;
|
|
41
|
+
const sourceRasterCutoutsManifestPath = options.sourceRasterCutoutsManifestPath ?? DEFAULT_CROPS_MANIFEST;
|
|
42
|
+
const svgAssetsManifestPath = options.svgAssetsManifestPath ?? DEFAULT_SVG_ASSETS_MANIFEST;
|
|
43
|
+
const nativeElementsManifestPath = options.nativeElementsManifestPath ?? DEFAULT_NATIVE_ELEMENTS_MANIFEST;
|
|
44
|
+
const nativeElementsScriptPath = options.nativeElementsScriptPath ?? DEFAULT_NATIVE_ELEMENTS_SCRIPT;
|
|
45
|
+
const slideWidth = options.slideWidth ?? DEFAULT_SLIDE_WIDTH;
|
|
46
|
+
const slideHeight = options.slideHeight ?? options.sourceSize.h / options.sourceSize.w * slideWidth;
|
|
47
|
+
const taskManifest = readJson(workspacePath, taskManifestPath);
|
|
48
|
+
const cropManifest = readJson(workspacePath, sourceRasterCutoutsManifestPath);
|
|
49
|
+
const taskElements = new Map(taskManifest.elements.map((element) => [element.id, element]));
|
|
50
|
+
const cropElements = new Map(cropManifest.crops.map((crop) => [crop.elementId, crop]));
|
|
51
|
+
function pbox(bbox) {
|
|
52
|
+
assertFiniteBBox(bbox, "source");
|
|
53
|
+
return {
|
|
54
|
+
x: bbox.x / options.sourceSize.w * slideWidth,
|
|
55
|
+
y: bbox.y / options.sourceSize.h * slideHeight,
|
|
56
|
+
w: bbox.w / options.sourceSize.w * slideWidth,
|
|
57
|
+
h: bbox.h / options.sourceSize.h * slideHeight
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function getElement(id) {
|
|
61
|
+
const element = taskElements.get(id);
|
|
62
|
+
if (!element) throw new Error(`Missing native element: ${id}`);
|
|
63
|
+
return element;
|
|
64
|
+
}
|
|
65
|
+
function getCrop(id) {
|
|
66
|
+
const crop = cropElements.get(id);
|
|
67
|
+
if (!crop) throw new Error(`Missing crop slot: ${id}`);
|
|
68
|
+
return crop;
|
|
69
|
+
}
|
|
70
|
+
function cropPath(id) {
|
|
71
|
+
return path.join(workspacePath, getCrop(id).path);
|
|
72
|
+
}
|
|
73
|
+
function assetPath(elementId, fallbackPath = cropPath(elementId)) {
|
|
74
|
+
const crop = cropElements.get(elementId);
|
|
75
|
+
if (!crop || !SVG_ROUTES.has(crop.route ?? "")) return fallbackPath;
|
|
76
|
+
const svgAssets = readOptionalJson(workspacePath, svgAssetsManifestPath);
|
|
77
|
+
const asset = svgAssets?.assets?.find((candidate) => candidate.elementId === elementId);
|
|
78
|
+
if (!asset || asset.status === "gap" || typeof asset.svgPath !== "string") return fallbackPath;
|
|
79
|
+
const svgPath = path.isAbsolute(asset.svgPath) ? asset.svgPath : path.join(workspacePath, asset.svgPath);
|
|
80
|
+
return fs.existsSync(svgPath) ? svgPath : fallbackPath;
|
|
81
|
+
}
|
|
82
|
+
function assertCoverage(ids, expectedIds, label) {
|
|
83
|
+
const duplicates = ids.filter((id, index) => ids.indexOf(id) !== index);
|
|
84
|
+
if (duplicates.length) throw new Error(`${label} duplicate ids: ${unique(duplicates).join(", ")}`);
|
|
85
|
+
const missing = expectedIds.filter((id) => !ids.includes(id));
|
|
86
|
+
const extra = ids.filter((id) => !expectedIds.includes(id));
|
|
87
|
+
if (missing.length || extra.length) {
|
|
88
|
+
throw new Error(`${label} coverage mismatch. Missing: ${missing.join(", ") || "none"} Extra: ${extra.join(", ") || "none"}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function replacementOwner(route) {
|
|
92
|
+
if (route === "source-raster") return "source-raster-cutouts";
|
|
93
|
+
if (SVG_ROUTES.has(route)) return "svg-assets";
|
|
94
|
+
if (route === "imagegen") return "imagegen-assets";
|
|
95
|
+
throw new Error(`Unexpected raster route: ${route}`);
|
|
96
|
+
}
|
|
97
|
+
function statusFor(route) {
|
|
98
|
+
return route === "source-raster" ? "final" : "placeholder";
|
|
99
|
+
}
|
|
100
|
+
function createRasterSlots(cropIds) {
|
|
101
|
+
const selectedIds = cropIds ?? cropManifest.crops.map((crop) => crop.elementId);
|
|
102
|
+
assertCoverage(selectedIds, cropManifest.crops.map((crop) => crop.elementId), "Raster slots");
|
|
103
|
+
return selectedIds.map((id) => {
|
|
104
|
+
const crop = getCrop(id);
|
|
105
|
+
const route = crop.route ?? "source-raster";
|
|
106
|
+
return {
|
|
107
|
+
elementId: crop.elementId,
|
|
108
|
+
route,
|
|
109
|
+
cropPath: crop.path,
|
|
110
|
+
bbox: crop.bbox,
|
|
111
|
+
status: statusFor(route),
|
|
112
|
+
replacementOwner: replacementOwner(route)
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function writeNativeElementsManifest(input) {
|
|
117
|
+
const manifest = {
|
|
118
|
+
taskId: "native-elements",
|
|
119
|
+
generatedAt: input.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
120
|
+
codexThreadId: input.codexThreadId,
|
|
121
|
+
scriptPath: nativeElementsScriptPath,
|
|
122
|
+
taskManifest: taskManifestPath,
|
|
123
|
+
sourceRasterCutoutsManifest: sourceRasterCutoutsManifestPath,
|
|
124
|
+
nativeElements: input.nativeElements,
|
|
125
|
+
rasterSlots: input.rasterSlots ?? createRasterSlots(),
|
|
126
|
+
outputPaths: input.outputPaths ?? [],
|
|
127
|
+
validationGaps: input.validationGaps ?? []
|
|
128
|
+
};
|
|
129
|
+
if (!manifest.codexThreadId) delete manifest.codexThreadId;
|
|
130
|
+
fs.writeFileSync(path.join(workspacePath, nativeElementsManifestPath), `${JSON.stringify(manifest, null, 2)}
|
|
131
|
+
`);
|
|
132
|
+
return manifest;
|
|
133
|
+
}
|
|
134
|
+
function setupDeck(deck, input = {}) {
|
|
135
|
+
const layoutName = input.layoutName ?? "SOURCE";
|
|
136
|
+
deck.title = input.title ?? deck.title;
|
|
137
|
+
deck.author = input.author ?? "Artifact Kit";
|
|
138
|
+
deck.company = input.company ?? "Artifact Kit";
|
|
139
|
+
deck.subject = input.subject ?? deck.subject;
|
|
140
|
+
deck.defineLayout({ name: layoutName, width: slideWidth, height: slideHeight });
|
|
141
|
+
deck.layout = layoutName;
|
|
142
|
+
deck.theme = input.theme ?? {
|
|
143
|
+
headFontFace: "Microsoft YaHei",
|
|
144
|
+
bodyFontFace: "Microsoft YaHei",
|
|
145
|
+
lang: "zh-CN"
|
|
146
|
+
};
|
|
147
|
+
return deck;
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
workspacePath,
|
|
151
|
+
slideSize: { w: slideWidth, h: slideHeight },
|
|
152
|
+
taskManifest,
|
|
153
|
+
cropManifest,
|
|
154
|
+
pbox,
|
|
155
|
+
getElement,
|
|
156
|
+
box: (id) => pbox(getElement(id).bbox),
|
|
157
|
+
getCrop,
|
|
158
|
+
cropBox: (id) => pbox(getCrop(id).bbox),
|
|
159
|
+
cropPath,
|
|
160
|
+
assetPath,
|
|
161
|
+
lineBox: (id) => {
|
|
162
|
+
const b = pbox(getElement(id).bbox);
|
|
163
|
+
return { x: b.x, y: b.y + b.h / 2, w: b.w, h: 0 };
|
|
164
|
+
},
|
|
165
|
+
assertCoverage,
|
|
166
|
+
assertNativeCoverage: (ids, label = "Native elements") => assertCoverage(ids, taskManifest.elements.map((element) => element.id), label),
|
|
167
|
+
assertRasterCoverage: (ids, label = "Raster slots") => assertCoverage(ids, cropManifest.crops.map((crop) => crop.elementId), label),
|
|
168
|
+
replacementOwner,
|
|
169
|
+
statusFor,
|
|
170
|
+
createRasterSlots,
|
|
171
|
+
writeNativeElementsManifest,
|
|
172
|
+
setupDeck
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
exports.createReplicaRuntime = createReplicaRuntime;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const DEFAULT_TASK_MANIFEST = "manifests/tasks/native-elements.json";
|
|
5
|
+
const DEFAULT_CROPS_MANIFEST = "manifests/source-raster-cutouts.json";
|
|
6
|
+
const DEFAULT_SVG_ASSETS_MANIFEST = "manifests/svg-assets.json";
|
|
7
|
+
const DEFAULT_NATIVE_ELEMENTS_MANIFEST = "manifests/native-elements.json";
|
|
8
|
+
const DEFAULT_NATIVE_ELEMENTS_SCRIPT = "scripts/regions/native-elements.mjs";
|
|
9
|
+
const DEFAULT_SLIDE_WIDTH = 13.333;
|
|
10
|
+
const SVG_ROUTES = /* @__PURE__ */ new Set(["svg-image", "editable-vector", "drawio-svg"]);
|
|
11
|
+
function workspaceFromImportMeta(importMetaUrl) {
|
|
12
|
+
const filePath = fileURLToPath(importMetaUrl);
|
|
13
|
+
return path.resolve(path.dirname(filePath), "../..");
|
|
14
|
+
}
|
|
15
|
+
function readJson(workspacePath, relPath) {
|
|
16
|
+
return JSON.parse(fs.readFileSync(path.join(workspacePath, relPath), "utf8"));
|
|
17
|
+
}
|
|
18
|
+
function readOptionalJson(workspacePath, relPath) {
|
|
19
|
+
try {
|
|
20
|
+
const filePath = path.join(workspacePath, relPath);
|
|
21
|
+
if (!fs.existsSync(filePath)) return null;
|
|
22
|
+
const text = fs.readFileSync(filePath, "utf8").trim();
|
|
23
|
+
return text ? JSON.parse(text) : null;
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function assertFiniteBBox(bbox, label) {
|
|
29
|
+
for (const key of ["x", "y", "w", "h"]) {
|
|
30
|
+
if (!Number.isFinite(bbox[key])) throw new Error(`${label} bbox has non-finite ${key}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function unique(items) {
|
|
34
|
+
return [...new Set(items)];
|
|
35
|
+
}
|
|
36
|
+
function createReplicaRuntime(options) {
|
|
37
|
+
const workspacePath = path.resolve(options.workspacePath ?? workspaceFromImportMeta(options.importMetaUrl));
|
|
38
|
+
const taskManifestPath = options.taskManifestPath ?? DEFAULT_TASK_MANIFEST;
|
|
39
|
+
const sourceRasterCutoutsManifestPath = options.sourceRasterCutoutsManifestPath ?? DEFAULT_CROPS_MANIFEST;
|
|
40
|
+
const svgAssetsManifestPath = options.svgAssetsManifestPath ?? DEFAULT_SVG_ASSETS_MANIFEST;
|
|
41
|
+
const nativeElementsManifestPath = options.nativeElementsManifestPath ?? DEFAULT_NATIVE_ELEMENTS_MANIFEST;
|
|
42
|
+
const nativeElementsScriptPath = options.nativeElementsScriptPath ?? DEFAULT_NATIVE_ELEMENTS_SCRIPT;
|
|
43
|
+
const slideWidth = options.slideWidth ?? DEFAULT_SLIDE_WIDTH;
|
|
44
|
+
const slideHeight = options.slideHeight ?? options.sourceSize.h / options.sourceSize.w * slideWidth;
|
|
45
|
+
const taskManifest = readJson(workspacePath, taskManifestPath);
|
|
46
|
+
const cropManifest = readJson(workspacePath, sourceRasterCutoutsManifestPath);
|
|
47
|
+
const taskElements = new Map(taskManifest.elements.map((element) => [element.id, element]));
|
|
48
|
+
const cropElements = new Map(cropManifest.crops.map((crop) => [crop.elementId, crop]));
|
|
49
|
+
function pbox(bbox) {
|
|
50
|
+
assertFiniteBBox(bbox, "source");
|
|
51
|
+
return {
|
|
52
|
+
x: bbox.x / options.sourceSize.w * slideWidth,
|
|
53
|
+
y: bbox.y / options.sourceSize.h * slideHeight,
|
|
54
|
+
w: bbox.w / options.sourceSize.w * slideWidth,
|
|
55
|
+
h: bbox.h / options.sourceSize.h * slideHeight
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function getElement(id) {
|
|
59
|
+
const element = taskElements.get(id);
|
|
60
|
+
if (!element) throw new Error(`Missing native element: ${id}`);
|
|
61
|
+
return element;
|
|
62
|
+
}
|
|
63
|
+
function getCrop(id) {
|
|
64
|
+
const crop = cropElements.get(id);
|
|
65
|
+
if (!crop) throw new Error(`Missing crop slot: ${id}`);
|
|
66
|
+
return crop;
|
|
67
|
+
}
|
|
68
|
+
function cropPath(id) {
|
|
69
|
+
return path.join(workspacePath, getCrop(id).path);
|
|
70
|
+
}
|
|
71
|
+
function assetPath(elementId, fallbackPath = cropPath(elementId)) {
|
|
72
|
+
const crop = cropElements.get(elementId);
|
|
73
|
+
if (!crop || !SVG_ROUTES.has(crop.route ?? "")) return fallbackPath;
|
|
74
|
+
const svgAssets = readOptionalJson(workspacePath, svgAssetsManifestPath);
|
|
75
|
+
const asset = svgAssets?.assets?.find((candidate) => candidate.elementId === elementId);
|
|
76
|
+
if (!asset || asset.status === "gap" || typeof asset.svgPath !== "string") return fallbackPath;
|
|
77
|
+
const svgPath = path.isAbsolute(asset.svgPath) ? asset.svgPath : path.join(workspacePath, asset.svgPath);
|
|
78
|
+
return fs.existsSync(svgPath) ? svgPath : fallbackPath;
|
|
79
|
+
}
|
|
80
|
+
function assertCoverage(ids, expectedIds, label) {
|
|
81
|
+
const duplicates = ids.filter((id, index) => ids.indexOf(id) !== index);
|
|
82
|
+
if (duplicates.length) throw new Error(`${label} duplicate ids: ${unique(duplicates).join(", ")}`);
|
|
83
|
+
const missing = expectedIds.filter((id) => !ids.includes(id));
|
|
84
|
+
const extra = ids.filter((id) => !expectedIds.includes(id));
|
|
85
|
+
if (missing.length || extra.length) {
|
|
86
|
+
throw new Error(`${label} coverage mismatch. Missing: ${missing.join(", ") || "none"} Extra: ${extra.join(", ") || "none"}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function replacementOwner(route) {
|
|
90
|
+
if (route === "source-raster") return "source-raster-cutouts";
|
|
91
|
+
if (SVG_ROUTES.has(route)) return "svg-assets";
|
|
92
|
+
if (route === "imagegen") return "imagegen-assets";
|
|
93
|
+
throw new Error(`Unexpected raster route: ${route}`);
|
|
94
|
+
}
|
|
95
|
+
function statusFor(route) {
|
|
96
|
+
return route === "source-raster" ? "final" : "placeholder";
|
|
97
|
+
}
|
|
98
|
+
function createRasterSlots(cropIds) {
|
|
99
|
+
const selectedIds = cropIds ?? cropManifest.crops.map((crop) => crop.elementId);
|
|
100
|
+
assertCoverage(selectedIds, cropManifest.crops.map((crop) => crop.elementId), "Raster slots");
|
|
101
|
+
return selectedIds.map((id) => {
|
|
102
|
+
const crop = getCrop(id);
|
|
103
|
+
const route = crop.route ?? "source-raster";
|
|
104
|
+
return {
|
|
105
|
+
elementId: crop.elementId,
|
|
106
|
+
route,
|
|
107
|
+
cropPath: crop.path,
|
|
108
|
+
bbox: crop.bbox,
|
|
109
|
+
status: statusFor(route),
|
|
110
|
+
replacementOwner: replacementOwner(route)
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function writeNativeElementsManifest(input) {
|
|
115
|
+
const manifest = {
|
|
116
|
+
taskId: "native-elements",
|
|
117
|
+
generatedAt: input.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
118
|
+
codexThreadId: input.codexThreadId,
|
|
119
|
+
scriptPath: nativeElementsScriptPath,
|
|
120
|
+
taskManifest: taskManifestPath,
|
|
121
|
+
sourceRasterCutoutsManifest: sourceRasterCutoutsManifestPath,
|
|
122
|
+
nativeElements: input.nativeElements,
|
|
123
|
+
rasterSlots: input.rasterSlots ?? createRasterSlots(),
|
|
124
|
+
outputPaths: input.outputPaths ?? [],
|
|
125
|
+
validationGaps: input.validationGaps ?? []
|
|
126
|
+
};
|
|
127
|
+
if (!manifest.codexThreadId) delete manifest.codexThreadId;
|
|
128
|
+
fs.writeFileSync(path.join(workspacePath, nativeElementsManifestPath), `${JSON.stringify(manifest, null, 2)}
|
|
129
|
+
`);
|
|
130
|
+
return manifest;
|
|
131
|
+
}
|
|
132
|
+
function setupDeck(deck, input = {}) {
|
|
133
|
+
const layoutName = input.layoutName ?? "SOURCE";
|
|
134
|
+
deck.title = input.title ?? deck.title;
|
|
135
|
+
deck.author = input.author ?? "Artifact Kit";
|
|
136
|
+
deck.company = input.company ?? "Artifact Kit";
|
|
137
|
+
deck.subject = input.subject ?? deck.subject;
|
|
138
|
+
deck.defineLayout({ name: layoutName, width: slideWidth, height: slideHeight });
|
|
139
|
+
deck.layout = layoutName;
|
|
140
|
+
deck.theme = input.theme ?? {
|
|
141
|
+
headFontFace: "Microsoft YaHei",
|
|
142
|
+
bodyFontFace: "Microsoft YaHei",
|
|
143
|
+
lang: "zh-CN"
|
|
144
|
+
};
|
|
145
|
+
return deck;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
workspacePath,
|
|
149
|
+
slideSize: { w: slideWidth, h: slideHeight },
|
|
150
|
+
taskManifest,
|
|
151
|
+
cropManifest,
|
|
152
|
+
pbox,
|
|
153
|
+
getElement,
|
|
154
|
+
box: (id) => pbox(getElement(id).bbox),
|
|
155
|
+
getCrop,
|
|
156
|
+
cropBox: (id) => pbox(getCrop(id).bbox),
|
|
157
|
+
cropPath,
|
|
158
|
+
assetPath,
|
|
159
|
+
lineBox: (id) => {
|
|
160
|
+
const b = pbox(getElement(id).bbox);
|
|
161
|
+
return { x: b.x, y: b.y + b.h / 2, w: b.w, h: 0 };
|
|
162
|
+
},
|
|
163
|
+
assertCoverage,
|
|
164
|
+
assertNativeCoverage: (ids, label = "Native elements") => assertCoverage(ids, taskManifest.elements.map((element) => element.id), label),
|
|
165
|
+
assertRasterCoverage: (ids, label = "Raster slots") => assertCoverage(ids, cropManifest.crops.map((crop) => crop.elementId), label),
|
|
166
|
+
replacementOwner,
|
|
167
|
+
statusFor,
|
|
168
|
+
createRasterSlots,
|
|
169
|
+
writeNativeElementsManifest,
|
|
170
|
+
setupDeck
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export {
|
|
174
|
+
createReplicaRuntime
|
|
175
|
+
};
|
package/dist/svg-to-png-cli.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
const
|
|
3
|
+
const fs = require("node:fs");
|
|
4
4
|
const promises = require("node:fs/promises");
|
|
5
|
-
const
|
|
5
|
+
const path = require("node:path");
|
|
6
6
|
const svgToPng = require("./svg-to-png.cjs");
|
|
7
7
|
const FIT_VALUES = /* @__PURE__ */ new Set(["cover", "contain", "fill", "inside", "outside"]);
|
|
8
8
|
async function main(args) {
|
|
@@ -68,7 +68,7 @@ function parseArgs(args) {
|
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
70
|
async function readSvgInput(input) {
|
|
71
|
-
if (
|
|
71
|
+
if (fs.existsSync(input)) {
|
|
72
72
|
return promises.readFile(input, "utf8");
|
|
73
73
|
}
|
|
74
74
|
return input;
|
|
@@ -88,7 +88,7 @@ function readNumber(args, index, option) {
|
|
|
88
88
|
return value;
|
|
89
89
|
}
|
|
90
90
|
function printUsage() {
|
|
91
|
-
const command =
|
|
91
|
+
const command = path.basename(process.argv[1] ?? "svg-to-png-cli.js", path.extname(process.argv[1] ?? ""));
|
|
92
92
|
console.log(`Usage:
|
|
93
93
|
node ${command}.js "<svg ...>" -o output.png
|
|
94
94
|
node ${command}.js input.svg -o output.png
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export { renderSvgToPng, writeSvgToPng } from './svg-to-png';
|
|
|
17
17
|
export { setupSvgPngFallback, prepareSvgPngFallbacks } from './svg-fallback';
|
|
18
18
|
export { addBeforeWriteHook, installDeckKitLifecyclePatch } from './lifecycle';
|
|
19
19
|
export type { DeckKitBeforeWriteHook, DeckKitConstructor } from './lifecycle';
|
|
20
|
+
export type { ReplicaBBox, ReplicaCropManifest, ReplicaCropRecord, ReplicaDeckSetupOptions, ReplicaManifestWriteOptions, ReplicaNativeElementRecord, ReplicaNativeElementsManifest, ReplicaRasterReplacementOwner, ReplicaRasterSlotRecord, ReplicaRasterSlotStatus, ReplicaRuntime, ReplicaRuntimeOptions, ReplicaSourceSize, ReplicaSvgAssetRecord, ReplicaSvgAssetsManifest, ReplicaTaskElement, ReplicaTaskManifest, } from './replica-runtime';
|
|
21
|
+
export { createReplicaRuntime } from './replica-runtime';
|
|
20
22
|
export type { SvgCustomGeometryPath, SvgToCustomGeometryOptions, SvgToCustomGeometryResult } from './svg-to-custom-geometry';
|
|
21
23
|
export { handleSvgCustomGeometry, setupSvgCustomGeometry, svgToCustomGeometry } from './svg-to-custom-geometry';
|
|
22
24
|
export type { CompareImagesOptions, CropImageOptions, ImageInfo, OverlayImagesOptions, ResizeImageOptions, SampleColorResult, } from './image';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,iBAAiB,CAAA;AACxB,OAAO,0BAA0B,CAAA;AACjC,OAAO,aAAa,CAAA;AAIpB,OAAO,EAA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kBAAkB,EAClB,iBAAiB,GACjB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAErH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa,CAWzE;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
export interface ReplicaBBox {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
w: number;
|
|
5
|
+
h: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ReplicaSourceSize {
|
|
8
|
+
w: number;
|
|
9
|
+
h: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ReplicaTaskElement {
|
|
12
|
+
id: string;
|
|
13
|
+
route?: string;
|
|
14
|
+
bbox: ReplicaBBox;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface ReplicaCropRecord {
|
|
18
|
+
elementId: string;
|
|
19
|
+
path: string;
|
|
20
|
+
route?: string;
|
|
21
|
+
bbox: ReplicaBBox;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface ReplicaTaskManifest {
|
|
25
|
+
elements: ReplicaTaskElement[];
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface ReplicaCropManifest {
|
|
29
|
+
crops: ReplicaCropRecord[];
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface ReplicaSvgAssetRecord {
|
|
33
|
+
elementId: string;
|
|
34
|
+
svgPath?: string;
|
|
35
|
+
status?: string;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface ReplicaSvgAssetsManifest {
|
|
39
|
+
assets?: ReplicaSvgAssetRecord[];
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface ReplicaNativeElementRecord {
|
|
43
|
+
elementId: string;
|
|
44
|
+
route: 'native-text' | 'native-shape';
|
|
45
|
+
implementation: 'deckkit-text' | 'deckkit-shape';
|
|
46
|
+
bbox: ReplicaBBox;
|
|
47
|
+
editable: true;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
export type ReplicaRasterReplacementOwner = 'source-raster-cutouts' | 'svg-assets' | 'imagegen-assets';
|
|
51
|
+
export type ReplicaRasterSlotStatus = 'final' | 'placeholder';
|
|
52
|
+
export interface ReplicaRasterSlotRecord {
|
|
53
|
+
elementId: string;
|
|
54
|
+
route: string;
|
|
55
|
+
cropPath: string;
|
|
56
|
+
bbox: ReplicaBBox;
|
|
57
|
+
status: ReplicaRasterSlotStatus;
|
|
58
|
+
replacementOwner: ReplicaRasterReplacementOwner;
|
|
59
|
+
}
|
|
60
|
+
export interface ReplicaNativeElementsManifest {
|
|
61
|
+
taskId: 'native-elements';
|
|
62
|
+
generatedAt: string;
|
|
63
|
+
codexThreadId?: string;
|
|
64
|
+
scriptPath: string;
|
|
65
|
+
taskManifest: string;
|
|
66
|
+
sourceRasterCutoutsManifest: string;
|
|
67
|
+
nativeElements: ReplicaNativeElementRecord[];
|
|
68
|
+
rasterSlots: ReplicaRasterSlotRecord[];
|
|
69
|
+
outputPaths: string[];
|
|
70
|
+
validationGaps: string[];
|
|
71
|
+
}
|
|
72
|
+
export interface ReplicaRuntimeOptions {
|
|
73
|
+
importMetaUrl: string;
|
|
74
|
+
sourceSize: ReplicaSourceSize;
|
|
75
|
+
slideWidth?: number;
|
|
76
|
+
slideHeight?: number;
|
|
77
|
+
workspacePath?: string;
|
|
78
|
+
taskManifestPath?: string;
|
|
79
|
+
sourceRasterCutoutsManifestPath?: string;
|
|
80
|
+
svgAssetsManifestPath?: string;
|
|
81
|
+
nativeElementsManifestPath?: string;
|
|
82
|
+
nativeElementsScriptPath?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface ReplicaDeckSetupOptions {
|
|
85
|
+
title?: string;
|
|
86
|
+
author?: string;
|
|
87
|
+
company?: string;
|
|
88
|
+
subject?: string;
|
|
89
|
+
layoutName?: string;
|
|
90
|
+
theme?: {
|
|
91
|
+
headFontFace?: string;
|
|
92
|
+
bodyFontFace?: string;
|
|
93
|
+
lang?: string;
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface ReplicaManifestWriteOptions {
|
|
98
|
+
nativeElements: ReplicaNativeElementRecord[];
|
|
99
|
+
rasterSlots?: ReplicaRasterSlotRecord[];
|
|
100
|
+
outputPaths?: string[];
|
|
101
|
+
validationGaps?: string[];
|
|
102
|
+
generatedAt?: string;
|
|
103
|
+
codexThreadId?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface ReplicaRuntime {
|
|
106
|
+
workspacePath: string;
|
|
107
|
+
slideSize: {
|
|
108
|
+
w: number;
|
|
109
|
+
h: number;
|
|
110
|
+
};
|
|
111
|
+
taskManifest: ReplicaTaskManifest;
|
|
112
|
+
cropManifest: ReplicaCropManifest;
|
|
113
|
+
pbox(bbox: ReplicaBBox): ReplicaBBox;
|
|
114
|
+
getElement(id: string): ReplicaTaskElement;
|
|
115
|
+
box(id: string): ReplicaBBox;
|
|
116
|
+
getCrop(id: string): ReplicaCropRecord;
|
|
117
|
+
cropBox(id: string): ReplicaBBox;
|
|
118
|
+
cropPath(id: string): string;
|
|
119
|
+
assetPath(elementId: string, fallbackPath?: string): string;
|
|
120
|
+
lineBox(id: string): {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
w: number;
|
|
124
|
+
h: number;
|
|
125
|
+
};
|
|
126
|
+
assertCoverage(ids: string[], expectedIds: string[], label: string): void;
|
|
127
|
+
assertNativeCoverage(ids: string[], label?: string): void;
|
|
128
|
+
assertRasterCoverage(ids: string[], label?: string): void;
|
|
129
|
+
replacementOwner(route: string): ReplicaRasterReplacementOwner;
|
|
130
|
+
statusFor(route: string): ReplicaRasterSlotStatus;
|
|
131
|
+
createRasterSlots(cropIds?: string[]): ReplicaRasterSlotRecord[];
|
|
132
|
+
writeNativeElementsManifest(options: ReplicaManifestWriteOptions): ReplicaNativeElementsManifest;
|
|
133
|
+
setupDeck<TDeck extends ReplicaDeckLike>(deck: TDeck, options?: ReplicaDeckSetupOptions): TDeck;
|
|
134
|
+
}
|
|
135
|
+
interface ReplicaDeckLike {
|
|
136
|
+
title?: string;
|
|
137
|
+
author?: string;
|
|
138
|
+
company?: string;
|
|
139
|
+
subject?: string;
|
|
140
|
+
layout?: string;
|
|
141
|
+
theme?: unknown;
|
|
142
|
+
defineLayout(layout: {
|
|
143
|
+
name: string;
|
|
144
|
+
width: number;
|
|
145
|
+
height: number;
|
|
146
|
+
}): unknown;
|
|
147
|
+
}
|
|
148
|
+
export declare function createReplicaRuntime(options: ReplicaRuntimeOptions): ReplicaRuntime;
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=replica-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replica-runtime.d.ts","sourceRoot":"","sources":["../../src/replica-runtime.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT;AAED,MAAM,WAAW,iBAAiB;IACjC,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT;AAED,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,WAAW,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA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AAE,MAAM,GAAG,IAAI,CAAA;IACzD,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzD,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,6BAA6B,CAAA;IAC9D,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,uBAAuB,CAAA;IACjD,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,uBAAuB,EAAE,CAAA;IAChE,2BAA2B,CAAC,OAAO,EAAE,2BAA2B,GAAG,6BAA6B,CAAA;IAChG,SAAS,CAAC,KAAK,SAAS,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,KAAK,CAAA;CAC/F;AAED,UAAU,eAAe;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAA;CAC9E;AAwCD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAmJnF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artifact-kit/deckkit-pro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Commercial DeckKit plugin bundle.",
|
|
5
5
|
"license": "SEE LICENSE IN COMMERCIAL-LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
"import": "./dist/lifecycle.js",
|
|
49
49
|
"require": "./dist/lifecycle.cjs"
|
|
50
50
|
},
|
|
51
|
+
"./replica-runtime": {
|
|
52
|
+
"types": "./dist/types/replica-runtime.d.ts",
|
|
53
|
+
"import": "./dist/replica-runtime.js",
|
|
54
|
+
"require": "./dist/replica-runtime.cjs"
|
|
55
|
+
},
|
|
51
56
|
"./svg-to-custom-geometry": {
|
|
52
57
|
"types": "./dist/types/svg-to-custom-geometry.d.ts",
|
|
53
58
|
"import": "./dist/svg-to-custom-geometry.js",
|