@popcraft/kit 0.53.0 → 0.53.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/chunks/{agent-VDTFMQFH.js → agent-SED37SYN.js} +1 -1
- package/dist/chunks/{builtin-B425EDUG.js → builtin-6C24JNML.js} +4 -3
- package/dist/chunks/{buy-credits-YD6DBAQB.js → buy-credits-L4YYC7OH.js} +2 -2
- package/dist/chunks/{check-template-QIUI3LQM.js → check-template-EE5TET2G.js} +3 -2
- package/dist/chunks/{chunk-U5UFIM2E.js → chunk-32OBPYVY.js} +1 -1
- package/dist/chunks/{chunk-SMF4YIFH.js → chunk-3OXHJA4W.js} +1 -1
- package/dist/chunks/{chunk-V4SNTWZO.js → chunk-3OZO3VDZ.js} +4 -4
- package/dist/chunks/{chunk-MY5CBA5H.js → chunk-7DRZUU3D.js} +121 -63
- package/dist/chunks/{chunk-UDUHQLOJ.js → chunk-AEVF4O3X.js} +2 -2
- package/dist/chunks/{chunk-SD7QCT7C.js → chunk-AYWP3RXA.js} +4 -4
- package/dist/chunks/{chunk-MJMCMLHB.js → chunk-BKRXB4FD.js} +1 -1
- package/dist/chunks/{chunk-HGUHRTIM.js → chunk-DGM2NZSE.js} +2 -2
- package/dist/chunks/{chunk-PUFEIOUT.js → chunk-E6DRH2F2.js} +1 -1
- package/dist/chunks/{chunk-A3MCE2OL.js → chunk-F6NLCJI5.js} +45 -5
- package/dist/chunks/{chunk-EKKA4A5J.js → chunk-FLGDAOPE.js} +60 -101
- package/dist/chunks/{chunk-6Q7JYDNH.js → chunk-FM4WN2UV.js} +4 -4
- package/dist/chunks/{chunk-MGWBSGMA.js → chunk-GMUR223M.js} +2 -2
- package/dist/chunks/{chunk-5AMNMH7S.js → chunk-GNOX55UB.js} +9 -9
- package/dist/chunks/{chunk-XMO6D5A2.js → chunk-GUGOVTVN.js} +55 -7
- package/dist/chunks/{chunk-IROVLB4V.js → chunk-HS4CR6HU.js} +19 -5
- package/dist/chunks/{chunk-B4DDU5KM.js → chunk-L6TWTQWB.js} +2 -2
- package/dist/chunks/{chunk-LHKOU6BP.js → chunk-M5MBUFEB.js} +1 -1
- package/dist/chunks/{chunk-AN2LMY4M.js → chunk-MGNS52I2.js} +4 -4
- package/dist/chunks/{chunk-NPTJQ2AF.js → chunk-NBFZY6QK.js} +1 -1
- package/dist/chunks/{chunk-GPNEAC5E.js → chunk-NDMT4BWH.js} +1 -1
- package/dist/chunks/{chunk-7XLYPWQL.js → chunk-NYGQP3I2.js} +4 -4
- package/dist/chunks/{chunk-U54RHZSX.js → chunk-OE2LGHLL.js} +3 -3
- package/dist/chunks/chunk-OLQTCVWP.js +92 -0
- package/dist/chunks/{chunk-T4FFRJAH.js → chunk-OWWBFGCR.js} +3 -3
- package/dist/chunks/{chunk-VLEZSLRZ.js → chunk-TRTT3FG2.js} +5 -5
- package/dist/chunks/{chunk-WXMIWRZM.js → chunk-WENYC56A.js} +11 -11
- package/dist/chunks/{chunk-EISISJQ4.js → chunk-Y6MJOYOD.js} +8 -8
- package/dist/chunks/{client-O2YCQZT7.js → client-FHS3A5KE.js} +1 -1
- package/dist/chunks/{client-4LUUUMO2.js → client-FZXXX7Z4.js} +2 -2
- package/dist/chunks/{client-AMMTXTFS.js → client-JTMPIRKQ.js} +3 -3
- package/dist/chunks/{client-actions-L7II3NNB.js → client-actions-3KZRX52M.js} +13 -12
- package/dist/chunks/{dangerous-RSWVATGA.js → dangerous-D6BD66C2.js} +4 -3
- package/dist/chunks/{delete-current-file-E46EEPRC.js → delete-current-file-EUYQ4W5Y.js} +7 -6
- package/dist/chunks/{editor-seams-UO4QUUQH.js → editor-seams-SJRRQFZT.js} +18 -17
- package/dist/chunks/{editor-store-V43NADG6.js → editor-store-AXRJNCRC.js} +5 -5
- package/dist/chunks/{export-PGMO7YEU.js → export-ILWWIDBI.js} +1 -1
- package/dist/chunks/{export-watermark-XHQOOPR7.js → export-watermark-MYKTALXF.js} +7 -6
- package/dist/chunks/{eyedropper-4D6OK4VM.js → eyedropper-EZ33OG43.js} +3 -2
- package/dist/chunks/{generate-media-XMD232CS.js → generate-media-ODWN3RNS.js} +4 -4
- package/dist/chunks/{host-WX77JQ2K.js → host-K6K7OOJY.js} +12 -11
- package/dist/chunks/{integrations-LOGIGZY2.js → integrations-TPVN7WNB.js} +1 -1
- package/dist/chunks/{libraries-R63ARXMI.js → libraries-L7RTUME7.js} +7 -6
- package/dist/chunks/{live-QLSNGZ3Y.js → live-SODTH6AK.js} +3 -2
- package/dist/chunks/{lottie-CBQTJRYU.js → lottie-ZWAKIFY2.js} +4 -4
- package/dist/chunks/{media-tool-TXQINVAR.js → media-tool-76BJQ4EH.js} +4 -3
- package/dist/chunks/{new-file-UUBSWKHK.js → new-file-4B74SA7T.js} +5 -4
- package/dist/chunks/{pdf-NHOWFQ66.js → pdf-HK3GJ6QP.js} +3 -3
- package/dist/chunks/{player-check-4LAIMR3H.js → player-check-3HTULNTP.js} +4 -4
- package/dist/chunks/{plugin-CUBE33JW.js → plugin-OFAK7X55.js} +3 -2
- package/dist/chunks/{plugin-import-C5S2SHFZ.js → plugin-import-FHPXNY5S.js} +23 -22
- package/dist/chunks/{pptx-LHJRZA42.js → pptx-O7RRDHAR.js} +2 -2
- package/dist/chunks/{presence-UQHDKT4A.js → presence-CLCMZPNT.js} +4 -3
- package/dist/chunks/{project-KEEZ7XYP.js → project-RJ3UIR3F.js} +3 -3
- package/dist/chunks/{publish-site-UL2ISNZU.js → publish-site-NYDQQTVZ.js} +8 -7
- package/dist/chunks/{publish-store-2TTGS2LW.js → publish-store-YNPQKV6P.js} +5 -5
- package/dist/chunks/{raster-actions-KYYBZLGY.js → raster-actions-MC3CT72Z.js} +3 -2
- package/dist/chunks/{reference-images-CYSRQG7A.js → reference-images-TAWHPRYN.js} +2 -2
- package/dist/chunks/{resolvers-BQ5WXLUC.js → resolvers-UTQHZ6ET.js} +5 -5
- package/dist/chunks/{runner-ULBSWTOK.js → runner-YB2KJMV5.js} +30 -24
- package/dist/chunks/{store-OUZ5GTY5.js → store-RMG4PHWL.js} +14 -13
- package/dist/chunks/{storefront-prepare-EXR7OIWW.js → storefront-prepare-6IUMZTCQ.js} +1 -1
- package/dist/chunks/{svg-export-J2YVV3WM.js → svg-export-LMGINUQK.js} +5 -5
- package/dist/chunks/{svg-place-ZAG7VYF6.js → svg-place-LWB4XU2O.js} +2 -1
- package/dist/chunks/{sync-A56IG32K.js → sync-K72H36V7.js} +7 -6
- package/dist/chunks/{tabs-UWETDGQJ.js → tabs-56YA6CWU.js} +10 -9
- package/dist/chunks/{team-5VEJ3OZ6.js → team-35KCR2TX.js} +1 -1
- package/dist/chunks/{team-client-SG3SVF4G.js → team-client-NJYR2EHQ.js} +1 -1
- package/dist/chunks/{tools-2TCRJ6YI.js → tools-HSZSBWOP.js} +4 -2
- package/dist/chunks/{ui-commands-HVPH6ZXC.js → ui-commands-J54KK6XU.js} +20 -19
- package/dist/chunks/{versions-BIJCROBJ.js → versions-X2TC2RMO.js} +7 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -76,6 +76,9 @@ import {
|
|
|
76
76
|
reboxed,
|
|
77
77
|
textAndShapeOf
|
|
78
78
|
} from "./chunk-ZWKNYWUL.js";
|
|
79
|
+
import {
|
|
80
|
+
scaleSubtreePatches
|
|
81
|
+
} from "./chunk-OLQTCVWP.js";
|
|
79
82
|
import {
|
|
80
83
|
cleanAnchor,
|
|
81
84
|
hrefOf
|
|
@@ -316,6 +319,7 @@ import {
|
|
|
316
319
|
} from "./chunk-WLPGSUI2.js";
|
|
317
320
|
import {
|
|
318
321
|
addNode,
|
|
322
|
+
applyConstraints,
|
|
319
323
|
createArrow,
|
|
320
324
|
createEllipse,
|
|
321
325
|
createFrame,
|
|
@@ -862,7 +866,7 @@ init_scene_graph();
|
|
|
862
866
|
var licence = external_exports.enum(["commercial", "any"]).optional().describe("commercial (default): only licences that allow commercial use and edits (CC0, public domain, CC BY, CC BY-SA). any: every Creative Commons licence, including NC and ND.");
|
|
863
867
|
var brief2 = (p) => ({ id: p.id, title: p.title, creator: p.credit.creator, licence: licenceLabel(p.credit), width: p.width, height: p.height, source: p.credit.sourceUrl });
|
|
864
868
|
async function placeImportedPicture(ctx, imported, at, what, extra = {}) {
|
|
865
|
-
const client = await import("./client-
|
|
869
|
+
const client = await import("./client-FHS3A5KE.js");
|
|
866
870
|
if (at.fillLayerId) {
|
|
867
871
|
const doc2 = ctx.doc();
|
|
868
872
|
const target = nodeOrThrow(doc2, at.fillLayerId);
|
|
@@ -908,7 +912,7 @@ var photoSearch = defineCommand({
|
|
|
908
912
|
}
|
|
909
913
|
},
|
|
910
914
|
run: async (args) => {
|
|
911
|
-
const { searchStockPhotos } = await import("./client-
|
|
915
|
+
const { searchStockPhotos } = await import("./client-FHS3A5KE.js");
|
|
912
916
|
const page = await searchStockPhotos(args.query, args.page ?? 1, { licence: args.licence });
|
|
913
917
|
return {
|
|
914
918
|
summary: `${page.results.length} photo${page.results.length === 1 ? "" : "s"} for \u201C${page.query}\u201D (page ${page.page} of ${page.pageCount || 1})`,
|
|
@@ -942,7 +946,7 @@ var photoInsert = defineCommand({
|
|
|
942
946
|
run: async (args, ctx) => {
|
|
943
947
|
if (!args.id && !args.query) throw new ToolError("Pass an id from search_photos, or a query.");
|
|
944
948
|
if (args.id && !isPhotoId(args.id)) throw new ToolError(`"${args.id}" is not a photo id from search_photos.`);
|
|
945
|
-
const client = await import("./client-
|
|
949
|
+
const client = await import("./client-FHS3A5KE.js");
|
|
946
950
|
let photo;
|
|
947
951
|
if (args.id) photo = await client.stockPhotoInfo(args.id);
|
|
948
952
|
else {
|
|
@@ -980,8 +984,15 @@ var mediaList = defineCommand({
|
|
|
980
984
|
}
|
|
981
985
|
},
|
|
982
986
|
run: async (args) => {
|
|
983
|
-
const { listLibraryMedia } = await import("./client-
|
|
984
|
-
const
|
|
987
|
+
const { listLibraryMedia } = await import("./client-FZXXX7Z4.js");
|
|
988
|
+
const q = { ...args };
|
|
989
|
+
if (!q.workspace) {
|
|
990
|
+
const { syncStatus } = await import("./sync-K72H36V7.js");
|
|
991
|
+
const link2 = syncStatus().link;
|
|
992
|
+
if (!link2) throw new ToolError("This document is not saved to the cloud, so it has no team media library. Pass workspace.");
|
|
993
|
+
q.workspace = (await listLibraryMedia({ file: link2.key, limit: 1 })).workspaceId;
|
|
994
|
+
}
|
|
995
|
+
const page = await listLibraryMedia(q);
|
|
985
996
|
return { summary: `${page.items.length} media item${page.items.length === 1 ? "" : "s"}${page.nextCursor ? " (more)" : ""}`, data: { workspaceId: page.workspaceId, items: page.items.map(brief3), nextCursor: page.nextCursor } };
|
|
986
997
|
}
|
|
987
998
|
});
|
|
@@ -1011,7 +1022,7 @@ var mediaInsert = defineCommand({
|
|
|
1011
1022
|
run: async (args, ctx) => {
|
|
1012
1023
|
const contentType = args.contentType ?? "image/*";
|
|
1013
1024
|
if (!contentType.startsWith("image/")) throw new ToolError("insert_media places pictures; this item is not one.");
|
|
1014
|
-
const { importLibraryPicture } = await import("./client-
|
|
1025
|
+
const { importLibraryPicture } = await import("./client-FZXXX7Z4.js");
|
|
1015
1026
|
const item = { hash: args.hash, fileKey: args.fileKey, fileName: args.name ?? "Media", contentType, size: 0, createdAt: "", fileCount: 1, source: null };
|
|
1016
1027
|
const imported = await importLibraryPicture(item);
|
|
1017
1028
|
return placeImportedPicture(ctx, imported, args, `\u201C${imported.name}\u201D`, { hash: imported.hash });
|
|
@@ -1032,7 +1043,7 @@ var mediaDownload = defineCommand({
|
|
|
1032
1043
|
// The Library's right-click menu: saves the item's file to the computer.
|
|
1033
1044
|
expose: { ui: { label: "Download", palette: false } },
|
|
1034
1045
|
run: async (args) => {
|
|
1035
|
-
const { libraryBlob, libraryFileName } = await import("./client-
|
|
1046
|
+
const { libraryBlob, libraryFileName } = await import("./client-FZXXX7Z4.js");
|
|
1036
1047
|
const { downloadBlob } = await import("./download-YRHNMQPH.js");
|
|
1037
1048
|
const item = { hash: args.hash, fileKey: args.fileKey, fileName: args.name ?? "media", contentType: args.contentType ?? "", size: 0, createdAt: "", fileCount: 1, source: null };
|
|
1038
1049
|
const blob = await libraryBlob(item);
|
|
@@ -1063,7 +1074,7 @@ var mediaDelete = defineCommand({
|
|
|
1063
1074
|
}
|
|
1064
1075
|
},
|
|
1065
1076
|
run: async (args) => {
|
|
1066
|
-
const { deleteLibraryMedia } = await import("./client-
|
|
1077
|
+
const { deleteLibraryMedia } = await import("./client-FZXXX7Z4.js");
|
|
1067
1078
|
const out = await deleteLibraryMedia(args.workspace, args.hash);
|
|
1068
1079
|
return { summary: `Deleted it from the library (it was in ${out.files} file${out.files === 1 ? "" : "s"})`, data: out };
|
|
1069
1080
|
}
|
|
@@ -1077,13 +1088,13 @@ async function signedIn() {
|
|
|
1077
1088
|
}
|
|
1078
1089
|
async function publishedFile() {
|
|
1079
1090
|
await signedIn();
|
|
1080
|
-
const { openFileKey } = await import("./publish-site-
|
|
1091
|
+
const { openFileKey } = await import("./publish-site-NYDQQTVZ.js");
|
|
1081
1092
|
const key = openFileKey();
|
|
1082
1093
|
if (!key) throw new CommandError("This file is not saved to the cloud yet, so it has no site. Publish it first.", "failed");
|
|
1083
1094
|
return key;
|
|
1084
1095
|
}
|
|
1085
1096
|
async function formsWithoutDatabase(key) {
|
|
1086
|
-
const [{ useEditorStore }, { usesForms, formsGoNowhere }, { siteBackend }] = await Promise.all([import("./editor-store-
|
|
1097
|
+
const [{ useEditorStore }, { usesForms, formsGoNowhere }, { siteBackend }] = await Promise.all([import("./editor-store-AXRJNCRC.js"), import("./backend-Q4FQVKIS.js"), import("./integrations-TPVN7WNB.js")]);
|
|
1087
1098
|
const doc2 = useEditorStore.getState().document;
|
|
1088
1099
|
if (!usesForms(doc2)) return false;
|
|
1089
1100
|
return formsGoNowhere(doc2, await siteBackend(key).catch(() => void 0));
|
|
@@ -1119,7 +1130,7 @@ var publishSite = defineCommand({
|
|
|
1119
1130
|
const { cleanSlug } = await import("./rules-QWGSAJAE.js");
|
|
1120
1131
|
const address = p.address === void 0 ? void 0 : cleanSlug(p.address);
|
|
1121
1132
|
if (address === null) throw new CommandError("That cannot be a site address: use 3 to 40 letters, digits and dashes.", "invalid_params");
|
|
1122
|
-
const { publishOpenFile, NoScreens } = await import("./publish-site-
|
|
1133
|
+
const { publishOpenFile, NoScreens } = await import("./publish-site-NYDQQTVZ.js");
|
|
1123
1134
|
try {
|
|
1124
1135
|
const done = await publishOpenFile(address);
|
|
1125
1136
|
ctx.notice(`Published version ${done.version}: ${done.url}`);
|
|
@@ -1174,7 +1185,7 @@ var publishListSites = defineCommand({
|
|
|
1174
1185
|
},
|
|
1175
1186
|
run: async (p) => {
|
|
1176
1187
|
await signedIn();
|
|
1177
|
-
const [{ workspaceSites }, { activeTeamWorkspaceId, useHyperyTeam }] = await Promise.all([import("./sites-L6JYZ4SV.js"), import("./team-
|
|
1188
|
+
const [{ workspaceSites }, { activeTeamWorkspaceId, useHyperyTeam }] = await Promise.all([import("./sites-L6JYZ4SV.js"), import("./team-35KCR2TX.js")]);
|
|
1178
1189
|
const workspaceId = p.workspaceId ?? activeTeamWorkspaceId() ?? useHyperyTeam.getState().personalWorkspaceId;
|
|
1179
1190
|
if (!workspaceId) throw new CommandError("Your workspaces have not loaded yet. Try again in a moment.", "failed");
|
|
1180
1191
|
const out = await workspaceSites(workspaceId);
|
|
@@ -1223,12 +1234,12 @@ var publishStatus = defineCommand({
|
|
|
1223
1234
|
},
|
|
1224
1235
|
run: async () => {
|
|
1225
1236
|
await signedIn();
|
|
1226
|
-
const [{ openFileKey }, { siteStatus }] = await Promise.all([import("./publish-site-
|
|
1237
|
+
const [{ openFileKey }, { siteStatus }] = await Promise.all([import("./publish-site-NYDQQTVZ.js"), import("./sites-L6JYZ4SV.js")]);
|
|
1227
1238
|
const key = openFileKey();
|
|
1228
1239
|
const status = await siteStatus(key);
|
|
1229
1240
|
const site = status.site;
|
|
1230
|
-
const backend = key ? await (await import("./integrations-
|
|
1231
|
-
const destinations = key ? await (await import("./integrations-
|
|
1241
|
+
const backend = key ? await (await import("./integrations-TPVN7WNB.js")).siteBackend(key).catch(() => null) : null;
|
|
1242
|
+
const destinations = key ? await (await import("./integrations-TPVN7WNB.js")).listDestinations(key).catch(() => []) : [];
|
|
1232
1243
|
return {
|
|
1233
1244
|
summary: !status.configured ? "This server does not publish websites" : !site ? "Not published yet" : site.currentVersion === null ? `Offline (${site.versions.length} versions kept) \u2014 ${site.url}` : `Version ${site.currentVersion} is online at ${site.url}`,
|
|
1234
1245
|
data: { ...statusData(status), database: backend?.database ? { provider: backend.database.connection.provider, account: backend.database.connection.account, target: backend.database.target.map((t) => t.name), visitorsCanSignIn: backend.database.signIn } : null, destinations: destinations.map((d) => ({ destinationId: d.id, provider: d.connection.provider, account: d.connection.account, kind: d.capability, target: d.target.map((t) => t.name), lastSent: d.lastDeploy })) }
|
|
@@ -1259,7 +1270,7 @@ var publishStore = defineCommand({
|
|
|
1259
1270
|
},
|
|
1260
1271
|
run: async (p, ctx) => {
|
|
1261
1272
|
await signedIn();
|
|
1262
|
-
const { deployOpenStore } = await import("./publish-store-
|
|
1273
|
+
const { deployOpenStore } = await import("./publish-store-YNPQKV6P.js");
|
|
1263
1274
|
const done = await deployOpenStore(ctx.doc(), ctx.pageId(), { destinationId: p.destinationId }).catch((e) => {
|
|
1264
1275
|
throw new CommandError(e instanceof Error ? e.message : String(e), "failed");
|
|
1265
1276
|
});
|
|
@@ -1288,7 +1299,7 @@ var integrationList = defineCommand({
|
|
|
1288
1299
|
}
|
|
1289
1300
|
},
|
|
1290
1301
|
run: async ({ capability }) => {
|
|
1291
|
-
const [{ cloudUser }, { integrationsWorkspaceId, listWorkspaceIntegrations }] = await Promise.all([import("./session-QE4TAG7G.js"), import("./integrations-
|
|
1302
|
+
const [{ cloudUser }, { integrationsWorkspaceId, listWorkspaceIntegrations }] = await Promise.all([import("./session-QE4TAG7G.js"), import("./integrations-TPVN7WNB.js")]);
|
|
1292
1303
|
if (!cloudUser()) throw new CommandError("You are not signed in: integrations belong to your account's workspace.", "denied");
|
|
1293
1304
|
const workspaceId = integrationsWorkspaceId();
|
|
1294
1305
|
if (!workspaceId) throw new CommandError("Your workspaces have not loaded yet. Try again in a moment.", "failed");
|
|
@@ -1329,7 +1340,7 @@ var integrationOpen = defineCommand({
|
|
|
1329
1340
|
}
|
|
1330
1341
|
});
|
|
1331
1342
|
async function openFile() {
|
|
1332
|
-
const [{ cloudUser }, { openFileKey }] = await Promise.all([import("./session-QE4TAG7G.js"), import("./publish-site-
|
|
1343
|
+
const [{ cloudUser }, { openFileKey }] = await Promise.all([import("./session-QE4TAG7G.js"), import("./publish-site-NYDQQTVZ.js")]);
|
|
1333
1344
|
if (!cloudUser()) throw new CommandError("You are not signed in.", "denied");
|
|
1334
1345
|
const key = openFileKey();
|
|
1335
1346
|
if (!key) throw new CommandError("This file is not saved to the cloud yet. Publish it first (publish_site).", "failed");
|
|
@@ -1355,7 +1366,7 @@ var integrationListResources = defineCommand({
|
|
|
1355
1366
|
}
|
|
1356
1367
|
},
|
|
1357
1368
|
run: async ({ connectionId, capability, path }) => {
|
|
1358
|
-
const { listResources } = await import("./integrations-
|
|
1369
|
+
const { listResources } = await import("./integrations-TPVN7WNB.js");
|
|
1359
1370
|
const list = await listResources(connectionId, capability, asPath2(path));
|
|
1360
1371
|
return {
|
|
1361
1372
|
summary: list.level ? `${list.resources.length} at the ${list.level.label.toLowerCase()} level${list.canCreate ? " (a new one can be made)" : ""}` : "Nothing further to pick: the path is complete",
|
|
@@ -1390,7 +1401,7 @@ var integrationAddDestination = defineCommand({
|
|
|
1390
1401
|
},
|
|
1391
1402
|
run: async (p, ctx) => {
|
|
1392
1403
|
const key = await openFile();
|
|
1393
|
-
const { addDestination, createDestination, createResource } = await import("./integrations-
|
|
1404
|
+
const { addDestination, createDestination, createResource } = await import("./integrations-TPVN7WNB.js");
|
|
1394
1405
|
let made;
|
|
1395
1406
|
if (p.create) made = await createDestination(key, p.capability, void 0, p.connectionId);
|
|
1396
1407
|
else {
|
|
@@ -1427,7 +1438,7 @@ var integrationDeploy = defineCommand({
|
|
|
1427
1438
|
},
|
|
1428
1439
|
run: async (p, ctx) => {
|
|
1429
1440
|
const key = await openFile();
|
|
1430
|
-
const { deployDestination, listDestinations } = await import("./integrations-
|
|
1441
|
+
const { deployDestination, listDestinations } = await import("./integrations-TPVN7WNB.js");
|
|
1431
1442
|
const all = await listDestinations(key);
|
|
1432
1443
|
const dest = p.destinationId ? all.find((d) => d.id === p.destinationId) : all.length === 1 ? all[0] : void 0;
|
|
1433
1444
|
if (!dest) throw new CommandError(all.length ? `Say which destination: ${all.map((d) => `${d.id} (${d.target.map((t) => t.name).join(" / ")})`).join(", ")}.` : "This file has no destination yet. Add one first (add_site_destination).", "invalid_params");
|
|
@@ -1461,7 +1472,7 @@ var integrationAttachDatabase = defineCommand({
|
|
|
1461
1472
|
},
|
|
1462
1473
|
run: async (p, ctx) => {
|
|
1463
1474
|
const key = await openFile();
|
|
1464
|
-
const { attachDatabase, createDatabase, createResource, listResources } = await import("./integrations-
|
|
1475
|
+
const { attachDatabase, createDatabase, createResource, listResources } = await import("./integrations-TPVN7WNB.js");
|
|
1465
1476
|
if (p.create) return attached(await createDatabase(key, void 0, p.connectionId), ctx);
|
|
1466
1477
|
if (!p.connectionId || !p.target) throw new CommandError("Say connectionId and target, or create: true.", "invalid_params");
|
|
1467
1478
|
let target = asPath2(p.target);
|
|
@@ -1500,7 +1511,7 @@ var integrationSubmissions = defineCommand({
|
|
|
1500
1511
|
},
|
|
1501
1512
|
run: async ({ form, limit }) => {
|
|
1502
1513
|
const key = await openFile();
|
|
1503
|
-
const { listSubmissions } = await import("./integrations-
|
|
1514
|
+
const { listSubmissions } = await import("./integrations-TPVN7WNB.js");
|
|
1504
1515
|
const rows = await listSubmissions(key, { form, limit: limit ?? 20 });
|
|
1505
1516
|
return { summary: rows.length ? `${rows.length} ${rows.length === 1 ? "submission" : "submissions"}, the newest ${new Date(rows[0].createdAt).toISOString()}` : "Nothing has been sent yet", data: { submissions: rows } };
|
|
1506
1517
|
}
|
|
@@ -1525,7 +1536,7 @@ var integrationSetSignIn = defineCommand({
|
|
|
1525
1536
|
},
|
|
1526
1537
|
run: async ({ on }, ctx) => {
|
|
1527
1538
|
const key = await openFile();
|
|
1528
|
-
const { setSignIn } = await import("./integrations-
|
|
1539
|
+
const { setSignIn } = await import("./integrations-TPVN7WNB.js");
|
|
1529
1540
|
const done = await setSignIn(key, on);
|
|
1530
1541
|
ctx.notice(on ? "Visitors can sign in." : "Sign-in is off.");
|
|
1531
1542
|
return { summary: on ? "Visitors can now create accounts and sign in on the published site" : "Sign-in is off for the published site", data: { signIn: !!done.database?.signIn } };
|
|
@@ -1743,7 +1754,7 @@ var fontTeamList = defineCommand({
|
|
|
1743
1754
|
agent: { name: "list_team_fonts", readOnly: true, description: "The team's fonts: faces uploaded once that every file of the team can use (family, weight, style)." }
|
|
1744
1755
|
},
|
|
1745
1756
|
run: async (args) => {
|
|
1746
|
-
const { refreshTeamFonts } = await import("./team-client-
|
|
1757
|
+
const { refreshTeamFonts } = await import("./team-client-NJYR2EHQ.js");
|
|
1747
1758
|
const fonts = await refreshTeamFonts(args.workspace);
|
|
1748
1759
|
return { summary: plural(fonts.length, "team font"), data: { fonts: fonts.map((f) => ({ id: f.id, family: f.family, weight: f.weight, style: f.style, face: f.face, fileName: f.fileName })) } };
|
|
1749
1760
|
}
|
|
@@ -1770,7 +1781,7 @@ var fontTeamAdd = defineCommand({
|
|
|
1770
1781
|
run: async (args, ctx) => {
|
|
1771
1782
|
const { bytes, fileName: fileName2 } = await fontBytes(args, ctx);
|
|
1772
1783
|
const { face, family, weight, style } = await resolveFace(bytes, args);
|
|
1773
|
-
const { uploadTeamFont } = await import("./team-client-
|
|
1784
|
+
const { uploadTeamFont } = await import("./team-client-NJYR2EHQ.js");
|
|
1774
1785
|
const font = await uploadTeamFont(bytes, { family, weight, style, face: face.index, fileName: fileName2 }, args.workspace);
|
|
1775
1786
|
return { summary: `Added ${family} ${weight}${style === "italic" ? " italic" : ""} to the team`, data: { font } };
|
|
1776
1787
|
}
|
|
@@ -1792,7 +1803,7 @@ var fontTeamRemove = defineCommand({
|
|
|
1792
1803
|
agent: { name: "remove_team_font", description: "Remove a font from the team (list_team_fonts). Files that use it fall back to another font unless they carry it themselves. The user approves every call." }
|
|
1793
1804
|
},
|
|
1794
1805
|
run: async (args) => {
|
|
1795
|
-
const { removeTeamFont } = await import("./team-client-
|
|
1806
|
+
const { removeTeamFont } = await import("./team-client-NJYR2EHQ.js");
|
|
1796
1807
|
const out = await removeTeamFont(args.id, args.workspace);
|
|
1797
1808
|
return { summary: `Removed the team font${out.freed ? " and freed its storage" : ""}`, data: out };
|
|
1798
1809
|
}
|
|
@@ -1803,7 +1814,7 @@ var fontTeamCommands = [fontTeamList, fontTeamAdd];
|
|
|
1803
1814
|
init_define_POPCRAFT_COMPONENT_IDS();
|
|
1804
1815
|
async function cloudFile() {
|
|
1805
1816
|
const [{ syncStatus }, { cloudUser }] = await Promise.all([
|
|
1806
|
-
import("./sync-
|
|
1817
|
+
import("./sync-K72H36V7.js"),
|
|
1807
1818
|
import("./session-QE4TAG7G.js")
|
|
1808
1819
|
]);
|
|
1809
1820
|
const link2 = syncStatus().link;
|
|
@@ -1865,7 +1876,7 @@ var fileTrash = defineCommand({
|
|
|
1865
1876
|
agent: { name: "trash_file", description: "Delete the open file: a cloud file goes to the Trash (restorable), a signed-out local file is deleted for good. Then the editor goes back to Home. The user approves every call." }
|
|
1866
1877
|
},
|
|
1867
1878
|
run: async () => {
|
|
1868
|
-
const { deleteCurrentFile, leaveDeletedFile } = await import("./delete-current-file-
|
|
1879
|
+
const { deleteCurrentFile, leaveDeletedFile } = await import("./delete-current-file-EUYQ4W5Y.js");
|
|
1869
1880
|
const { name: name2, kind } = await deleteCurrentFile();
|
|
1870
1881
|
leaveDeletedFile();
|
|
1871
1882
|
return { summary: kind === "cloud" ? `Moved \u201C${name2}\u201D to the Trash` : `Deleted \u201C${name2}\u201D` };
|
|
@@ -1978,11 +1989,11 @@ var fileDuplicate = defineCommand({
|
|
|
1978
1989
|
},
|
|
1979
1990
|
run: async (_p, ctx) => {
|
|
1980
1991
|
const [{ syncStatus }, { cloudApi }, { isDesktopTabs }, { createFileInTab }, { openNewCloudFile }, { v4: uuid }] = await Promise.all([
|
|
1981
|
-
import("./sync-
|
|
1992
|
+
import("./sync-K72H36V7.js"),
|
|
1982
1993
|
import("./api-7ZHHFXRP.js"),
|
|
1983
1994
|
import("./tab-mode-5ALKOT7S.js"),
|
|
1984
|
-
import("./tabs-
|
|
1985
|
-
import("./sync-
|
|
1995
|
+
import("./tabs-56YA6CWU.js"),
|
|
1996
|
+
import("./sync-K72H36V7.js"),
|
|
1986
1997
|
import("./dist-node-MAITLUAX.js")
|
|
1987
1998
|
]);
|
|
1988
1999
|
const doc2 = ctx.doc();
|
|
@@ -2527,6 +2538,31 @@ var nodeCreate = defineCommand({
|
|
|
2527
2538
|
}
|
|
2528
2539
|
});
|
|
2529
2540
|
var FORBIDDEN_PROPS = /* @__PURE__ */ new Set(["id", "type", "parentId", "childIds"]);
|
|
2541
|
+
function normalizeColor(c, key) {
|
|
2542
|
+
if (typeof c === "string") return parseHex(c);
|
|
2543
|
+
const o = c;
|
|
2544
|
+
const ch = o && ["r", "g", "b"].map((k) => o[k]);
|
|
2545
|
+
if (!ch || !ch.every((v) => typeof v === "number" && Number.isFinite(v))) {
|
|
2546
|
+
throw new ToolError(`${key} has a colour without numeric r, g and b. Give 0\u20131 channels, or use set_fills with a hex colour.`);
|
|
2547
|
+
}
|
|
2548
|
+
const nums = ch;
|
|
2549
|
+
const scale = nums.some((v) => v > 1) ? 255 : 1;
|
|
2550
|
+
const a = typeof o.a === "number" && Number.isFinite(o.a) ? o.a > 1 ? o.a / 255 : o.a : 1;
|
|
2551
|
+
return createColor(nums[0] / scale, nums[1] / scale, nums[2] / scale, a);
|
|
2552
|
+
}
|
|
2553
|
+
function normalizePaints(v, key) {
|
|
2554
|
+
if (!Array.isArray(v)) throw new ToolError(`${key} must be an array of paints.`);
|
|
2555
|
+
return v.map((p) => {
|
|
2556
|
+
const paint = p;
|
|
2557
|
+
if (!paint || typeof paint !== "object") throw new ToolError(`${key} must be an array of paint objects.`);
|
|
2558
|
+
const out = { ...paint };
|
|
2559
|
+
if ("color" in paint) out.color = normalizeColor(paint.color, key);
|
|
2560
|
+
if (Array.isArray(paint.gradientStops)) {
|
|
2561
|
+
out.gradientStops = paint.gradientStops.map((s) => ({ ...s, color: normalizeColor(s.color, key) }));
|
|
2562
|
+
}
|
|
2563
|
+
return out;
|
|
2564
|
+
});
|
|
2565
|
+
}
|
|
2530
2566
|
var nodeUpdate = defineCommand({
|
|
2531
2567
|
id: "node.update",
|
|
2532
2568
|
title: "Update layers",
|
|
@@ -2575,7 +2611,7 @@ var nodeUpdate = defineCommand({
|
|
|
2575
2611
|
for (const [k, v] of Object.entries(u.props)) {
|
|
2576
2612
|
if (args.strict && FORBIDDEN_PROPS.has(k)) throw new ToolError(`update_nodes cannot change "${k}". Use reparent, delete_nodes or create_node instead.`);
|
|
2577
2613
|
if (FORBIDDEN_PROPS.has(k) || v === void 0) continue;
|
|
2578
|
-
patch[k] = v;
|
|
2614
|
+
patch[k] = k === "fills" || k === "strokes" ? normalizePaints(v, k) : v;
|
|
2579
2615
|
changedKeys.add(k);
|
|
2580
2616
|
}
|
|
2581
2617
|
if (args.strict && !Object.keys(patch).length) throw new ToolError(`No properties given for "${u.id}".`);
|
|
@@ -2690,9 +2726,21 @@ var nodeResize = defineCommand({
|
|
|
2690
2726
|
const n = doc2.nodes[id];
|
|
2691
2727
|
const w = args.width ?? (args.scale ? n.width * args.scale : n.width);
|
|
2692
2728
|
const h = args.height ?? (args.scale ? n.height * args.scale : n.height);
|
|
2693
|
-
|
|
2729
|
+
const width = Math.max(AI_LIMITS.minSize, w), height = Math.max(AI_LIMITS.minSize, h);
|
|
2730
|
+
patches.set(id, { width, height });
|
|
2731
|
+
if (n.width <= 0 || n.height <= 0) continue;
|
|
2732
|
+
for (const [pid, patch] of scaleSubtreePatches(doc2.nodes, id, width / n.width, height / n.height)) {
|
|
2733
|
+
patches.set(pid, { ...patches.get(pid), ...patch });
|
|
2734
|
+
}
|
|
2694
2735
|
}
|
|
2695
|
-
|
|
2736
|
+
let next = doc2;
|
|
2737
|
+
for (const id of ids) {
|
|
2738
|
+
const n = doc2.nodes[id], p = patches.get(id);
|
|
2739
|
+
if (n.type === "FRAME" || n.type === "COMPONENT" || n.type === "SECTION") {
|
|
2740
|
+
next = applyConstraints(next, id, n.width, n.height, p.width, p.height);
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
commitUpdates(ctx, next, patches);
|
|
2696
2744
|
return { summary: `Resized ${plural(ids.length, "layer")}`, data: { ids } };
|
|
2697
2745
|
}
|
|
2698
2746
|
});
|
|
@@ -3029,6 +3077,9 @@ var nodeImportSvg = defineCommand({
|
|
|
3029
3077
|
svg: external_exports.string().min(8).optional().describe("The full <svg>\u2026</svg> markup."),
|
|
3030
3078
|
parentId: external_exports.string().optional(),
|
|
3031
3079
|
at: external_exports.object({ x: external_exports.number(), y: external_exports.number() }).optional().describe("Place the layers in one frame centred on this point (parent coordinates) instead of at the SVG's own coordinates."),
|
|
3080
|
+
anchor: external_exports.enum(["center", "top-left"]).optional().describe("Whether `at` is the frame's centre (default) or its top-left corner."),
|
|
3081
|
+
width: external_exports.number().positive().optional().describe("With `at`: scale the artwork to fit this width (keeps proportions)."),
|
|
3082
|
+
height: external_exports.number().positive().optional().describe("With `at`: scale the artwork to fit this height (keeps proportions)."),
|
|
3032
3083
|
name: external_exports.string().max(200).optional().describe("Name of that frame (with `at`)."),
|
|
3033
3084
|
more: external_exports.array(external_exports.object({ svg: external_exports.string().min(8), name: external_exports.string().max(200).optional() })).max(50).optional().describe("Further SVGs placed in the same step (with `at`), each 24 px further down and right.")
|
|
3034
3085
|
}),
|
|
@@ -3036,7 +3087,7 @@ var nodeImportSvg = defineCommand({
|
|
|
3036
3087
|
plugin: { method: "importSvg" },
|
|
3037
3088
|
agent: {
|
|
3038
3089
|
name: "import_svg",
|
|
3039
|
-
description:
|
|
3090
|
+
description: 'Import SVG markup as editable layers under a parent (default: the current page). Pass `at` (in the PARENT\'s coordinates) to place them in one frame centred on that point, or with its top-left there when anchor is "top-left"; add width and/or height to scale the artwork to fit that box. Returns the ids of the new top-level layers.'
|
|
3040
3091
|
},
|
|
3041
3092
|
// Paste, drop and File › Import: one undo step, and the ones that would not convert reported back so the
|
|
3042
3093
|
// caller can place them as pictures instead (lib/editor/svg-paste.ts).
|
|
@@ -3047,14 +3098,14 @@ var nodeImportSvg = defineCommand({
|
|
|
3047
3098
|
const parentId = args.parentId ?? ctx.pageId();
|
|
3048
3099
|
const parent = nodeOrThrow(doc2, parentId);
|
|
3049
3100
|
if (args.at) {
|
|
3050
|
-
const [{ placeSvgLayers }, { internDataUrl: internDataUrl2 }] = await Promise.all([import("./svg-place-
|
|
3101
|
+
const [{ placeSvgLayers }, { internDataUrl: internDataUrl2 }] = await Promise.all([import("./svg-place-LWB4XU2O.js"), import("./media-store-QUBUGXZ2.js")]);
|
|
3051
3102
|
const items = [...args.svg ? [{ svg: args.svg, name: args.name }] : [], ...args.more ?? []];
|
|
3052
3103
|
if (!items.length) throw new ToolError("Pass the SVG markup.");
|
|
3053
3104
|
let next2 = doc2;
|
|
3054
3105
|
const added2 = [];
|
|
3055
3106
|
const failed = [];
|
|
3056
3107
|
items.forEach((item, i) => {
|
|
3057
|
-
const placed = placeSvgLayers(next2, parentId, item.svg, { name: item.name || "SVG", cx: args.at.x + i * 24, cy: args.at.y + i * 24, intern: (url) => internDataUrl2(url) });
|
|
3108
|
+
const placed = placeSvgLayers(next2, parentId, item.svg, { name: item.name || "SVG", cx: args.at.x + i * 24, cy: args.at.y + i * 24, anchor: args.anchor, fit: { width: args.width, height: args.height }, intern: (url) => internDataUrl2(url) });
|
|
3058
3109
|
if (placed) {
|
|
3059
3110
|
next2 = placed.doc;
|
|
3060
3111
|
added2.push(placed.id);
|
|
@@ -4016,7 +4067,8 @@ var paintReplaceColor = defineCommand({
|
|
|
4016
4067
|
const rec = n;
|
|
4017
4068
|
const patch = {};
|
|
4018
4069
|
let hit = 0;
|
|
4019
|
-
const
|
|
4070
|
+
const fillStyle = rec.fillStyleId ? doc2.styles?.[rec.fillStyleId] : void 0;
|
|
4071
|
+
const paints = fillStyle?.type === "PAINT" ? fillStyle.paints : rec.fills;
|
|
4020
4072
|
if (paints?.length) {
|
|
4021
4073
|
let changed = false;
|
|
4022
4074
|
const next = paints.map((p) => {
|
|
@@ -4043,7 +4095,10 @@ var paintReplaceColor = defineCommand({
|
|
|
4043
4095
|
}
|
|
4044
4096
|
return out;
|
|
4045
4097
|
});
|
|
4046
|
-
if (changed)
|
|
4098
|
+
if (changed) {
|
|
4099
|
+
patch.fills = next;
|
|
4100
|
+
if (rec.fillStyleId) patch.fillStyleId = void 0;
|
|
4101
|
+
}
|
|
4047
4102
|
}
|
|
4048
4103
|
const strokes = rec.strokes;
|
|
4049
4104
|
if (strokes?.length) {
|
|
@@ -4055,7 +4110,10 @@ var paintReplaceColor = defineCommand({
|
|
|
4055
4110
|
hit++;
|
|
4056
4111
|
return { ...s, color: c };
|
|
4057
4112
|
});
|
|
4058
|
-
if (changed)
|
|
4113
|
+
if (changed) {
|
|
4114
|
+
patch.strokes = next;
|
|
4115
|
+
if (rec.strokeStyleId) patch.strokeStyleId = void 0;
|
|
4116
|
+
}
|
|
4059
4117
|
}
|
|
4060
4118
|
const effects = effectsOf(n);
|
|
4061
4119
|
if (effects.length) {
|
|
@@ -4086,7 +4144,7 @@ var paintReplaceColor = defineCommand({
|
|
|
4086
4144
|
}
|
|
4087
4145
|
}
|
|
4088
4146
|
if (!swaps) throw new ToolError(`No ${args.from} found under ${args.rootId ?? "the selection"}. Check the color with get_node, or raise "tolerance".`);
|
|
4089
|
-
ctx.commit({ ...doc2, nodes });
|
|
4147
|
+
ctx.commit(applyInvariants({ ...doc2, nodes }, touched));
|
|
4090
4148
|
return { summary: `Replaced ${args.from} with ${args.to} in ${plural(touched.length, "layer")} (${swaps} paints)`, data: { ids: touched.slice(0, 50), swaps } };
|
|
4091
4149
|
}
|
|
4092
4150
|
});
|
|
@@ -4649,7 +4707,7 @@ var viewCopyLink = defineCommand({
|
|
|
4649
4707
|
},
|
|
4650
4708
|
run: async (args, ctx) => {
|
|
4651
4709
|
const [{ syncStatus }, { fileUrl }, { withDeepLink }] = await Promise.all([
|
|
4652
|
-
import("./sync-
|
|
4710
|
+
import("./sync-K72H36V7.js"),
|
|
4653
4711
|
import("./api-7ZHHFXRP.js"),
|
|
4654
4712
|
import("./deep-link-BD4WN46A.js")
|
|
4655
4713
|
]);
|
|
@@ -4974,7 +5032,7 @@ var pageGo = defineCommand({
|
|
|
4974
5032
|
] }
|
|
4975
5033
|
},
|
|
4976
5034
|
run: async ({ to }) => {
|
|
4977
|
-
const { useEditorStore } = await import("./editor-store-
|
|
5035
|
+
const { useEditorStore } = await import("./editor-store-AXRJNCRC.js");
|
|
4978
5036
|
useEditorStore.getState().goToPrintPage(to);
|
|
4979
5037
|
return { summary: typeof to === "number" ? `Page ${to + 1}` : `${to} page` };
|
|
4980
5038
|
}
|
|
@@ -5008,7 +5066,7 @@ var pageSetup = defineCommand({
|
|
|
5008
5066
|
}
|
|
5009
5067
|
},
|
|
5010
5068
|
run: async (args) => {
|
|
5011
|
-
const { useEditorStore } = await import("./editor-store-
|
|
5069
|
+
const { useEditorStore } = await import("./editor-store-AXRJNCRC.js");
|
|
5012
5070
|
useEditorStore.getState().applyPageSetup(args);
|
|
5013
5071
|
return { summary: `Page setup updated${args.kind ? ` (${args.kind.toLowerCase()})` : ""}` };
|
|
5014
5072
|
}
|
|
@@ -5767,7 +5825,7 @@ async function docAtTime(doc2, ids, time2) {
|
|
|
5767
5825
|
let frameId;
|
|
5768
5826
|
if (time2 === void 0) {
|
|
5769
5827
|
try {
|
|
5770
|
-
const { useEditorStore } = await import("./editor-store-
|
|
5828
|
+
const { useEditorStore } = await import("./editor-store-AXRJNCRC.js");
|
|
5771
5829
|
const st = useEditorStore.getState();
|
|
5772
5830
|
const target = st.transport?.target;
|
|
5773
5831
|
if (st.mode !== "ANIMATE" || target?.kind !== "frame") return doc2;
|
|
@@ -5820,7 +5878,7 @@ var exportSvg = reportsMissingFonts(defineCommand({
|
|
|
5820
5878
|
const node = nodeOrThrow(doc2, args.id);
|
|
5821
5879
|
const renderer = ctx.use("canvas")();
|
|
5822
5880
|
if (!renderer) throw new ToolError("SVG export needs the canvas renderer, which is not running (the editor canvas may not have initialised WebGPU). Use get_node or measure instead.");
|
|
5823
|
-
const { exportNodeToSVG } = await import("./svg-export-
|
|
5881
|
+
const { exportNodeToSVG } = await import("./svg-export-LMGINUQK.js");
|
|
5824
5882
|
const svg = await exportNodeToSVG(renderer, node, doc2, doc2.styles);
|
|
5825
5883
|
if (!svg) throw new ToolError(`"${node.name}" has nothing to export (it may be empty or zero-sized).`);
|
|
5826
5884
|
const max = args.maxChars ?? 2e4;
|
|
@@ -5874,7 +5932,7 @@ var exportNodes = reportsMissingFonts(defineCommand({
|
|
|
5874
5932
|
const nodes = ids.map((id) => nodeOrThrow(doc2, id));
|
|
5875
5933
|
const renderer = ctx.use("canvas")();
|
|
5876
5934
|
if (!renderer) throw new ToolError("Exporting needs the canvas renderer, which is not running (the editor canvas may not have initialised WebGPU). Use measure or export_svg instead.");
|
|
5877
|
-
const { exportSettingFile, exportSettingsOf } = await import("./export-
|
|
5935
|
+
const { exportSettingFile, exportSettingsOf } = await import("./export-ILWWIDBI.js");
|
|
5878
5936
|
const { downloadBlob } = await import("./download-YRHNMQPH.js");
|
|
5879
5937
|
const files = [];
|
|
5880
5938
|
let savedByFormat = 0;
|
|
@@ -5885,7 +5943,7 @@ var exportNodes = reportsMissingFonts(defineCommand({
|
|
|
5885
5943
|
};
|
|
5886
5944
|
const asked = args.format ? [{ format: args.format, scale: args.scale ?? 1, suffix: args.suffix ?? "" }] : null;
|
|
5887
5945
|
if (asked && args.format === "PDF" && args.singlePdf !== false && nodes.length > 1) {
|
|
5888
|
-
const { exportNodesToPDF } = await import("./pdf-
|
|
5946
|
+
const { exportNodesToPDF } = await import("./pdf-HK3GJ6QP.js");
|
|
5889
5947
|
record(ids.join(","), `${doc2.name || "export"}.pdf`, await exportNodesToPDF(renderer, nodes, args.scale ?? 1, doc2, doc2.styles));
|
|
5890
5948
|
} else {
|
|
5891
5949
|
for (const n of nodes) {
|
|
@@ -5953,7 +6011,7 @@ var exportPdf = reportsMissingFonts(defineCommand({
|
|
|
5953
6011
|
if (!nodes.length) throw new ToolError("There is nothing on this page to export.");
|
|
5954
6012
|
const posed = await docAtTime(doc2, nodes.map((n) => n.id), args.time);
|
|
5955
6013
|
nodes = nodes.map((n) => posed.nodes[n.id] ?? n);
|
|
5956
|
-
const { exportNodesToPDF } = await import("./pdf-
|
|
6014
|
+
const { exportNodesToPDF } = await import("./pdf-HK3GJ6QP.js");
|
|
5957
6015
|
const { downloadBlob } = await import("./download-YRHNMQPH.js");
|
|
5958
6016
|
const { scale, ids: _ids, time: _time, ...print } = args;
|
|
5959
6017
|
void _ids;
|
|
@@ -5998,7 +6056,7 @@ var exportCopy = defineCommand({
|
|
|
5998
6056
|
const renderer = ctx.use("canvas")();
|
|
5999
6057
|
if (!renderer) throw new ToolError("Copying a layer needs the canvas renderer, which is not running.");
|
|
6000
6058
|
const format = args.format ?? "PNG";
|
|
6001
|
-
const { copyNodeAsPNG, copyNodeAsSVG } = await import("./export-
|
|
6059
|
+
const { copyNodeAsPNG, copyNodeAsSVG } = await import("./export-ILWWIDBI.js");
|
|
6002
6060
|
const ok = format === "SVG" ? await copyNodeAsSVG(renderer, node, doc2, doc2.styles) : await copyNodeAsPNG(renderer, node, doc2, doc2.styles, args.scale ?? 2);
|
|
6003
6061
|
if (!ok) throw new ToolError(`"${node.name}" could not be copied as ${format} \u2014 it may be empty, or the browser refused clipboard access.`);
|
|
6004
6062
|
return { summary: `Copied "${node.name}" as ${format}`, data: { id: node.id, format } };
|
|
@@ -6042,7 +6100,7 @@ var exportPages = reportsMissingFonts(defineCommand({
|
|
|
6042
6100
|
nodes = nodes.map((n) => posed.nodes[n.id] ?? n);
|
|
6043
6101
|
const format = args.format ?? "PNG";
|
|
6044
6102
|
const dpi = args.dpi ?? (doc2.settings?.kind === "PRINT" ? doc2.settings.dpi ?? 300 : 96);
|
|
6045
|
-
const { exportNodeToBlob } = await import("./export-
|
|
6103
|
+
const { exportNodeToBlob } = await import("./export-ILWWIDBI.js");
|
|
6046
6104
|
const { downloadBlob } = await import("./download-YRHNMQPH.js");
|
|
6047
6105
|
const { zipFiles } = await import("./zip-export-ZYXDK4SM.js");
|
|
6048
6106
|
const files = [];
|
|
@@ -6087,7 +6145,7 @@ var exportPptx = reportsMissingFonts(defineCommand({
|
|
|
6087
6145
|
}
|
|
6088
6146
|
}
|
|
6089
6147
|
if (!nodes.length) throw new ToolError("There are no slides on this page to export.");
|
|
6090
|
-
const { exportSlidesToPPTX } = await import("./pptx-
|
|
6148
|
+
const { exportSlidesToPPTX } = await import("./pptx-O7RRDHAR.js");
|
|
6091
6149
|
const { downloadBlob } = await import("./download-YRHNMQPH.js");
|
|
6092
6150
|
const blob = await exportSlidesToPPTX(renderer, nodes, doc2, doc2.styles);
|
|
6093
6151
|
if (!blob) throw new ToolError("Those slides produced no file.");
|
|
@@ -6161,7 +6219,7 @@ async function runAnimationExport(format, args, ctx) {
|
|
|
6161
6219
|
const filename = exportFileName(args.filename || targetName(doc2, target), format);
|
|
6162
6220
|
const [{ exportAnimation }, { memoryDestination }] = await Promise.all([import("./video-TWXTQTP3.js"), import("./destination-DJEJM5KM.js")]);
|
|
6163
6221
|
if (format === "lottie" || format === "dotlottie") return runLottieExport(renderer, doc2, spec, filename, ctx, memoryDestination, args.stateMachine);
|
|
6164
|
-
const planWatermark = format !== "png" && await (await import("./export-watermark-
|
|
6222
|
+
const planWatermark = format !== "png" && await (await import("./export-watermark-MYKTALXF.js")).exportWatermark();
|
|
6165
6223
|
if (format !== "png") spec = { ...spec, watermark: planWatermark || args.watermark !== false };
|
|
6166
6224
|
const dest = ctx.destination ? await ctx.destination(filename, FORMAT_MIME[format]) : memoryDestination(filename, FORMAT_MIME[format]);
|
|
6167
6225
|
let stats;
|
|
@@ -6186,7 +6244,7 @@ async function runAnimationExport(format, args, ctx) {
|
|
|
6186
6244
|
};
|
|
6187
6245
|
}
|
|
6188
6246
|
async function runLottieExport(renderer, doc2, spec, filename, ctx, memoryDestination, stateMachine) {
|
|
6189
|
-
const { exportLottie: exportLottie2, lottieSupport } = await import("./lottie-
|
|
6247
|
+
const { exportLottie: exportLottie2, lottieSupport } = await import("./lottie-ZWAKIFY2.js");
|
|
6190
6248
|
const { FORMAT_MIME } = await import("./plan-LHP757QC.js");
|
|
6191
6249
|
const support = lottieSupport(doc2, spec.target);
|
|
6192
6250
|
if (!support.ok) throw new ToolError(`Lottie cannot carry this animation: ${support.blockers.join("; ")}. Export MP4, WebM or GIF instead.`);
|
|
@@ -6247,7 +6305,7 @@ var exportLottie = animationCommand((args) => args.container === "lottie" ? "dot
|
|
|
6247
6305
|
});
|
|
6248
6306
|
async function exportSite(doc2, pageId2, packaging, styling = "css", siteUrl) {
|
|
6249
6307
|
const [{ completeSite, nextFilesOf, shareImageFiles, staticFilesOf, NoSiteRuntime, bytesOf }, { fileBase }, { zipFiles }, { downloadBlob }] = await Promise.all([
|
|
6250
|
-
import("./project-
|
|
6308
|
+
import("./project-RJ3UIR3F.js"),
|
|
6251
6309
|
import("./web-TDSHIXQY.js"),
|
|
6252
6310
|
import("./zip-export-ZYXDK4SM.js"),
|
|
6253
6311
|
import("./download-YRHNMQPH.js")
|
|
@@ -6291,7 +6349,7 @@ var exportWeb = reportsMissingFonts(defineCommand({
|
|
|
6291
6349
|
const node = id ? doc2.nodes[id] : void 0;
|
|
6292
6350
|
if (!node) throw new ToolError("Select a frame or layer to export.");
|
|
6293
6351
|
const { webTreeFor, extensionFor, externalAssets, fileBase, resolveWebAssets, serializeFor, flatten } = await import("./web-TDSHIXQY.js");
|
|
6294
|
-
const { rendererAssetResolvers } = await import("./resolvers-
|
|
6352
|
+
const { rendererAssetResolvers } = await import("./resolvers-UTQHZ6ET.js");
|
|
6295
6353
|
const { downloadBlob } = await import("./download-YRHNMQPH.js");
|
|
6296
6354
|
const tree = webTreeFor(doc2, node.id, lang, { nodeCap: EXPORT_NODE_CAP, fullImageUrls: true });
|
|
6297
6355
|
if (flatten(tree.root).some((n) => n.asset)) await resolveWebAssets(tree, rendererAssetResolvers(doc2));
|
|
@@ -6339,9 +6397,9 @@ var exportStorefront = defineCommand({
|
|
|
6339
6397
|
run: async (args, ctx) => {
|
|
6340
6398
|
const doc2 = ctx.doc();
|
|
6341
6399
|
const [{ storefrontInputs }, { STOREFRONT_TARGETS }, { bytesOf }, { fileBase, flatten }, { zipFiles }, { downloadBlob }] = await Promise.all([
|
|
6342
|
-
import("./storefront-prepare-
|
|
6400
|
+
import("./storefront-prepare-6IUMZTCQ.js"),
|
|
6343
6401
|
import("./storefront-BPMM6QWK.js"),
|
|
6344
|
-
import("./project-
|
|
6402
|
+
import("./project-RJ3UIR3F.js"),
|
|
6345
6403
|
import("./web-TDSHIXQY.js"),
|
|
6346
6404
|
import("./zip-export-ZYXDK4SM.js"),
|
|
6347
6405
|
import("./download-YRHNMQPH.js")
|
|
@@ -6402,7 +6460,7 @@ var exportBoard = defineCommand({
|
|
|
6402
6460
|
const bounds = boardBounds(doc2, roots);
|
|
6403
6461
|
const scale = boardScale(bounds, args.scale);
|
|
6404
6462
|
const { documentForExport } = await import("./export-fills-MFME3KCW.js");
|
|
6405
|
-
const { encodeImageData } = await import("./export-
|
|
6463
|
+
const { encodeImageData } = await import("./export-ILWWIDBI.js");
|
|
6406
6464
|
const clean = documentForExport(doc2);
|
|
6407
6465
|
const image = await renderer.exportRegion(roots.map((n) => clean.nodes[n.id] ?? n), bounds, scale, clean, clean.styles, void 0, true);
|
|
6408
6466
|
const blob = image && await encodeImageData(image, "PNG");
|
|
@@ -6736,7 +6794,7 @@ var visionRegenerateImage = defineCommand({
|
|
|
6736
6794
|
const id = args.id ?? ctx.selection()[0];
|
|
6737
6795
|
if (!id) throw new ToolError("Select a generated image to regenerate.");
|
|
6738
6796
|
nodeOrThrow(ctx.doc(), id);
|
|
6739
|
-
const { regenerateImage } = await import("./client-actions-
|
|
6797
|
+
const { regenerateImage } = await import("./client-actions-3KZRX52M.js");
|
|
6740
6798
|
regenerateImage(id, args.count);
|
|
6741
6799
|
return { summary: args.count > 1 ? `Regenerating ${args.count} variants` : "Regenerating the image", data: { id, count: args.count } };
|
|
6742
6800
|
}
|
|
@@ -9895,7 +9953,7 @@ var scriptRun = defineCommand({
|
|
|
9895
9953
|
// A script is not the turn the user is watching: confirm-tier tools are refused inside it (dispatch, `nested`).
|
|
9896
9954
|
actor: { ...ctx.actor, nested: true, label: "Script" },
|
|
9897
9955
|
// A look_at inside the script sees the document as the script has left it so far, not as it was before.
|
|
9898
|
-
use: ((name2) => name2 === "render" && ctx.can("render") ? (async (ids, options) => (await import("./agent-
|
|
9956
|
+
use: ((name2) => name2 === "render" && ctx.can("render") ? (async (ids, options) => (await import("./agent-SED37SYN.js")).renderDocument(staged, ids, options)) : ctx.use(name2))
|
|
9899
9957
|
};
|
|
9900
9958
|
let calls = 0;
|
|
9901
9959
|
const images = [];
|
|
@@ -10715,7 +10773,7 @@ var docImportFile = defineCommand({
|
|
|
10715
10773
|
const file = new File([body], args.name);
|
|
10716
10774
|
if (file.size > MAX_BYTES) throw new ToolError(`"${args.name}" is larger than ${MAX_BYTES / 1024 / 1024} MB.`);
|
|
10717
10775
|
const [{ buildImportedDocument }, { mergeImportedDocument }] = await Promise.all([
|
|
10718
|
-
import("./plugin-import-
|
|
10776
|
+
import("./plugin-import-FHPXNY5S.js"),
|
|
10719
10777
|
import("./import-merge-73U4J6IN.js")
|
|
10720
10778
|
]);
|
|
10721
10779
|
const built = await buildImportedDocument(file);
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from "./chunk-NPQT5C4A.js";
|
|
11
11
|
import {
|
|
12
12
|
walkNode
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BKRXB4FD.js";
|
|
14
14
|
import {
|
|
15
15
|
fittedRadii,
|
|
16
16
|
vectorCmds
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NBFZY6QK.js";
|
|
18
18
|
import {
|
|
19
19
|
strToU8,
|
|
20
20
|
zipSync
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
hostEnv,
|
|
10
10
|
plain,
|
|
11
11
|
registerBuiltinCommands
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7DRZUU3D.js";
|
|
13
13
|
import {
|
|
14
14
|
storeOpsSeam
|
|
15
15
|
} from "./chunk-KOAEKWIA.js";
|
|
@@ -613,9 +613,9 @@ var commands = [
|
|
|
613
613
|
// saves (the Ecommerce plugin's Shopify theme), so a target is written once, here, and never again in a plugin.
|
|
614
614
|
run: async (p, ctx) => {
|
|
615
615
|
const [{ storefrontInputs }, { STOREFRONT_TARGETS }, { bytesOf }, { zipFiles }, { EXPORT_NODE_CAP }] = await Promise.all([
|
|
616
|
-
import("./storefront-prepare-
|
|
616
|
+
import("./storefront-prepare-6IUMZTCQ.js"),
|
|
617
617
|
import("./storefront-BPMM6QWK.js"),
|
|
618
|
-
import("./project-
|
|
618
|
+
import("./project-RJ3UIR3F.js"),
|
|
619
619
|
import("./zip-export-ZYXDK4SM.js"),
|
|
620
620
|
import("./tree-YKYXBPRZ.js")
|
|
621
621
|
]);
|
|
@@ -812,7 +812,7 @@ var pluginRun = defineCommand({
|
|
|
812
812
|
}
|
|
813
813
|
},
|
|
814
814
|
run: async (p, ctx) => {
|
|
815
|
-
const { runPlugin } = await import("./host-
|
|
815
|
+
const { runPlugin } = await import("./host-K6K7OOJY.js");
|
|
816
816
|
await runPlugin(p.pluginId, p.commandId);
|
|
817
817
|
ctx.notice(`Started ${p.pluginId}.`);
|
|
818
818
|
return {
|