@popcraft/kit 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{agent-UXEVU3PP.js → agent-ORS5BEZC.js} +1 -1
- package/dist/chunks/{builtin-Z3JB7AQR.js → builtin-2KL2EXTB.js} +3 -3
- package/dist/chunks/{buy-credits-G7NUE6ZB.js → buy-credits-NARMZ33F.js} +2 -2
- package/dist/chunks/{check-template-SOF7SCBW.js → check-template-6D3CE5JN.js} +2 -2
- package/dist/chunks/{chunk-XXR2TY7O.js → chunk-5DIPBJ54.js} +5 -5
- package/dist/chunks/{chunk-KSOUY2WC.js → chunk-7JRE5KFW.js} +17 -5
- package/dist/chunks/{chunk-TTHTG4AT.js → chunk-7K4DVIS7.js} +1 -1
- package/dist/chunks/{chunk-ODX6NC4Y.js → chunk-A433G4Q3.js} +1 -1
- package/dist/chunks/{chunk-YAIPIG2T.js → chunk-AQ7VIL3I.js} +5 -5
- package/dist/chunks/{chunk-FQAXGCTR.js → chunk-AX7B2WCS.js} +3 -3
- package/dist/chunks/{chunk-HJ2OTGEV.js → chunk-BO35G3Z6.js} +1 -1
- package/dist/chunks/{chunk-7HZDPAV4.js → chunk-BPU5YIDG.js} +11 -11
- package/dist/chunks/{chunk-JDKR2URT.js → chunk-C7L2KQY5.js} +2 -2
- package/dist/chunks/{chunk-EPXMVWU6.js → chunk-E56VSHG3.js} +9 -9
- package/dist/chunks/{chunk-KBH3DY37.js → chunk-FF2OZPHF.js} +3 -3
- package/dist/chunks/{chunk-ICG7LWCM.js → chunk-G73CQMMJ.js} +2 -2
- package/dist/chunks/{chunk-YBXHSJZG.js → chunk-H3F5EWSJ.js} +1 -1
- package/dist/chunks/{chunk-TU3AYIIJ.js → chunk-I5NXE524.js} +43 -43
- package/dist/chunks/{chunk-QU4HXR5E.js → chunk-IXK5DQVP.js} +5 -5
- package/dist/chunks/{chunk-TNQNH3V3.js → chunk-JGC6PIT5.js} +88 -13
- package/dist/chunks/{chunk-OI74BAIT.js → chunk-MBS22UU3.js} +1 -1
- package/dist/chunks/{chunk-TC7IHZZL.js → chunk-MJVFENH4.js} +3 -3
- package/dist/chunks/{chunk-253XHQUI.js → chunk-MO6VTJRB.js} +2 -2
- package/dist/chunks/{chunk-VULPLVRT.js → chunk-MWHXK5L3.js} +4 -4
- package/dist/chunks/{chunk-3LA7EL7G.js → chunk-OBCV7RHJ.js} +1 -1
- package/dist/chunks/{chunk-TWG5JTA7.js → chunk-PNLVMTDJ.js} +1 -1
- package/dist/chunks/{chunk-R2SDI262.js → chunk-Q2ZB3FHK.js} +12 -5
- package/dist/chunks/{chunk-KDLFP3DC.js → chunk-RAKVPFZV.js} +1 -1
- package/dist/chunks/{chunk-HRYJ5YQT.js → chunk-RUD5NE4E.js} +1 -1
- package/dist/chunks/{chunk-ZODSUXQL.js → chunk-U63R2IUJ.js} +2 -2
- package/dist/chunks/{chunk-QQL3GGJD.js → chunk-UGUFREHV.js} +4 -4
- package/dist/chunks/{chunk-3KNQR6CL.js → chunk-ULSPD424.js} +2 -2
- package/dist/chunks/{chunk-XLLXOVVZ.js → chunk-UMPR42SA.js} +5 -5
- package/dist/chunks/{chunk-YRGHWQT5.js → chunk-WEM3QUB5.js} +53 -20
- package/dist/chunks/{chunk-WFOR35TQ.js → chunk-XATKFHIC.js} +6 -6
- package/dist/chunks/{chunk-NCKYRWBR.js → chunk-XDEOO7Q3.js} +1 -1
- package/dist/chunks/{chunk-HFBXTTUQ.js → chunk-XLMMVQTY.js} +1 -1
- package/dist/chunks/{client-IKQMNK4P.js → client-3XVU7EZN.js} +2 -2
- package/dist/chunks/{client-J5DLHQY5.js → client-NKXABBB2.js} +1 -1
- package/dist/chunks/{client-CFUYJ27O.js → client-UEBKLRWH.js} +3 -3
- package/dist/chunks/{client-actions-MGRTGVLB.js → client-actions-HSU6LXB3.js} +5 -5
- package/dist/chunks/{dangerous-ZXVEEDTX.js → dangerous-IUSV6JMX.js} +3 -3
- package/dist/chunks/{delete-current-file-ATFSV5HE.js → delete-current-file-B7GF6WKT.js} +5 -5
- package/dist/chunks/{editor-seams-MNACNSMF.js → editor-seams-7V7DY52W.js} +12 -12
- package/dist/chunks/{editor-store-FGXPU3UO.js → editor-store-JFHEOFHY.js} +1 -1
- package/dist/chunks/{export-watermark-MYN7T5KL.js → export-watermark-22LJTK5X.js} +5 -5
- package/dist/chunks/{eyedropper-6T3GH5QA.js → eyedropper-BGMQDPTB.js} +1 -1
- package/dist/chunks/{generate-media-PUC27DFY.js → generate-media-7RV2ZT4X.js} +3 -3
- package/dist/chunks/{host-YBEAX4RZ.js → host-PPWYGYTN.js} +6 -6
- package/dist/chunks/{integrations-YFBT6VMA.js → integrations-TMJB7SEY.js} +1 -1
- package/dist/chunks/{libraries-XPQT4ICF.js → libraries-7AUYSQU4.js} +5 -5
- package/dist/chunks/{live-RWTT4BGD.js → live-JRCK5ROW.js} +1 -1
- package/dist/chunks/{media-tool-PRVEIKYF.js → media-tool-BGIARYN2.js} +1 -1
- package/dist/chunks/{new-file-7WMZVHYL.js → new-file-XB2B4U6V.js} +3 -3
- package/dist/chunks/{next-commerce-LNSNGX4Z.js → next-commerce-A7ZHR63R.js} +2 -2
- package/dist/chunks/{plugin-4JOUMU3A.js → plugin-J6JF3PXI.js} +2 -2
- package/dist/chunks/{plugin-import-3VAIIKAX.js → plugin-import-YRTFZW5S.js} +16 -16
- package/dist/chunks/{presence-WCPLK37W.js → presence-MW5DBXWS.js} +2 -2
- package/dist/chunks/{project-OXKZCAUE.js → project-37JVFD6K.js} +1 -1
- package/dist/chunks/{publish-site-W74H7AYH.js → publish-site-4BKVML3W.js} +6 -6
- package/dist/chunks/{publish-store-756CUU4F.js → publish-store-QXVBQRV7.js} +5 -5
- package/dist/chunks/{raster-actions-U5WAAU7C.js → raster-actions-FSIUMW5Y.js} +1 -1
- package/dist/chunks/{runner-KWTHN3U5.js → runner-Q53FUQ4P.js} +18 -18
- package/dist/chunks/{store-FFLZCMSB.js → store-QGNPU45L.js} +6 -6
- package/dist/chunks/{storefront-N3Q5WUPF.js → storefront-YZAY7XSO.js} +2 -2
- package/dist/chunks/{sync-ZMDBWZV7.js → sync-XVXFWCTT.js} +5 -5
- package/dist/chunks/{tabs-SSQFEWTW.js → tabs-GRBJ3KDT.js} +8 -8
- package/dist/chunks/{team-ZWNOX4CP.js → team-GWLLCLUM.js} +1 -1
- package/dist/chunks/{team-client-24UFEZIK.js → team-client-JTGXOWAU.js} +1 -1
- package/dist/chunks/{tools-P67S2SXN.js → tools-RMNATBMU.js} +2 -2
- package/dist/chunks/{ui-commands-OGE7WUKH.js → ui-commands-C4R3GX3N.js} +12 -12
- package/dist/chunks/{versions-77MNOGSJ.js → versions-33OVXBDN.js} +5 -5
- package/dist/index.js +1 -1
- package/dist/templates/count.js +1 -1
- package/dist/templates/index.js +12 -12
- package/dist/templates/motion/landing-hero/index.js +4 -4
- package/dist/templates/motion/launch-trailer/document.js +12 -12
- package/dist/templates/motion/launch-trailer/index.js +4 -4
- package/dist/templates/motion/launch-trailer/scenes.js +3 -3
- package/dist/templates/motion/template-wall.js +2 -2
- package/dist/templates/print/knit-christmas-tree-sweater.js +2 -2
- package/dist/templates/print/knit-nordic-snowflake-sweater.js +2 -2
- package/dist/templates/print/knit-shared.js +74 -1
- package/dist/templates/print/knit-snowflake-beanie.js +2 -2
- package/dist/templates/themes/holidays.js +5 -5
- package/dist/templates/themes/index.js +6 -6
- package/package.json +1 -1
- package/src/templates/print/knit-christmas-tree-sweater.ts +57 -20
- package/src/templates/print/knit-nordic-snowflake-sweater.ts +19 -6
- package/src/templates/print/knit-shared.ts +98 -11
- package/src/templates/print/knit-snowflake-beanie.ts +12 -4
- package/types/templates/src/print/knit-shared.d.ts +49 -1
|
@@ -951,7 +951,7 @@ init_scene_graph();
|
|
|
951
951
|
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.");
|
|
952
952
|
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 });
|
|
953
953
|
async function placeImportedPicture(ctx, imported, at2, what, extra = {}) {
|
|
954
|
-
const client = await import("./client-
|
|
954
|
+
const client = await import("./client-NKXABBB2.js");
|
|
955
955
|
if (at2.fillLayerId) {
|
|
956
956
|
const doc2 = ctx.doc();
|
|
957
957
|
const target = nodeOrThrow(doc2, at2.fillLayerId);
|
|
@@ -997,7 +997,7 @@ var photoSearch = defineCommand({
|
|
|
997
997
|
}
|
|
998
998
|
},
|
|
999
999
|
run: async (args) => {
|
|
1000
|
-
const { searchStockPhotos } = await import("./client-
|
|
1000
|
+
const { searchStockPhotos } = await import("./client-NKXABBB2.js");
|
|
1001
1001
|
const page = await searchStockPhotos(args.query, args.page ?? 1, { licence: args.licence });
|
|
1002
1002
|
return {
|
|
1003
1003
|
summary: `${page.results.length} photo${page.results.length === 1 ? "" : "s"} for \u201C${page.query}\u201D (page ${page.page} of ${page.pageCount || 1})`,
|
|
@@ -1031,7 +1031,7 @@ var photoInsert = defineCommand({
|
|
|
1031
1031
|
run: async (args, ctx) => {
|
|
1032
1032
|
if (!args.id && !args.query) throw new ToolError("Pass an id from search_photos, or a query.");
|
|
1033
1033
|
if (args.id && !isPhotoId(args.id)) throw new ToolError(`"${args.id}" is not a photo id from search_photos.`);
|
|
1034
|
-
const client = await import("./client-
|
|
1034
|
+
const client = await import("./client-NKXABBB2.js");
|
|
1035
1035
|
let photo;
|
|
1036
1036
|
if (args.id) photo = await client.stockPhotoInfo(args.id);
|
|
1037
1037
|
else {
|
|
@@ -1069,10 +1069,10 @@ var mediaList = defineCommand({
|
|
|
1069
1069
|
}
|
|
1070
1070
|
},
|
|
1071
1071
|
run: async (args) => {
|
|
1072
|
-
const { listLibraryMedia } = await import("./client-
|
|
1072
|
+
const { listLibraryMedia } = await import("./client-3XVU7EZN.js");
|
|
1073
1073
|
const q = { ...args };
|
|
1074
1074
|
if (!q.workspace) {
|
|
1075
|
-
const { syncStatus } = await import("./sync-
|
|
1075
|
+
const { syncStatus } = await import("./sync-XVXFWCTT.js");
|
|
1076
1076
|
const link2 = syncStatus().link;
|
|
1077
1077
|
if (!link2) throw new ToolError("This document is not saved to the cloud, so it has no team media library. Pass workspace.");
|
|
1078
1078
|
q.workspace = (await listLibraryMedia({ file: link2.key, limit: 1 })).workspaceId;
|
|
@@ -1107,7 +1107,7 @@ var mediaInsert = defineCommand({
|
|
|
1107
1107
|
run: async (args, ctx) => {
|
|
1108
1108
|
const contentType = args.contentType ?? "image/*";
|
|
1109
1109
|
if (!contentType.startsWith("image/")) throw new ToolError("insert_media places pictures; this item is not one.");
|
|
1110
|
-
const { importLibraryPicture } = await import("./client-
|
|
1110
|
+
const { importLibraryPicture } = await import("./client-3XVU7EZN.js");
|
|
1111
1111
|
const item = { hash: args.hash, fileKey: args.fileKey, fileName: args.name ?? "Media", contentType, size: 0, createdAt: "", fileCount: 1, source: null };
|
|
1112
1112
|
const imported = await importLibraryPicture(item);
|
|
1113
1113
|
return placeImportedPicture(ctx, imported, args, `\u201C${imported.name}\u201D`, { hash: imported.hash });
|
|
@@ -1128,7 +1128,7 @@ var mediaDownload = defineCommand({
|
|
|
1128
1128
|
// The Library's right-click menu: saves the item's file to the computer.
|
|
1129
1129
|
expose: { ui: { label: "Download", palette: false } },
|
|
1130
1130
|
run: async (args) => {
|
|
1131
|
-
const { libraryBlob, libraryFileName } = await import("./client-
|
|
1131
|
+
const { libraryBlob, libraryFileName } = await import("./client-3XVU7EZN.js");
|
|
1132
1132
|
const { downloadBlob } = await import("./download-CT4TQCRP.js");
|
|
1133
1133
|
const item = { hash: args.hash, fileKey: args.fileKey, fileName: args.name ?? "media", contentType: args.contentType ?? "", size: 0, createdAt: "", fileCount: 1, source: null };
|
|
1134
1134
|
const blob = await libraryBlob(item);
|
|
@@ -1159,7 +1159,7 @@ var mediaDelete = defineCommand({
|
|
|
1159
1159
|
}
|
|
1160
1160
|
},
|
|
1161
1161
|
run: async (args) => {
|
|
1162
|
-
const { deleteLibraryMedia } = await import("./client-
|
|
1162
|
+
const { deleteLibraryMedia } = await import("./client-3XVU7EZN.js");
|
|
1163
1163
|
const out = await deleteLibraryMedia(args.workspace, args.hash);
|
|
1164
1164
|
return { summary: `Deleted it from the library (it was in ${out.files} file${out.files === 1 ? "" : "s"})`, data: out };
|
|
1165
1165
|
}
|
|
@@ -1173,13 +1173,13 @@ async function signedIn() {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
async function publishedFile() {
|
|
1175
1175
|
await signedIn();
|
|
1176
|
-
const { openFileKey } = await import("./publish-site-
|
|
1176
|
+
const { openFileKey } = await import("./publish-site-4BKVML3W.js");
|
|
1177
1177
|
const key = openFileKey();
|
|
1178
1178
|
if (!key) throw new CommandError("This file is not saved to the cloud yet, so it has no site. Publish it first.", "failed");
|
|
1179
1179
|
return key;
|
|
1180
1180
|
}
|
|
1181
1181
|
async function formsWithoutDatabase(key) {
|
|
1182
|
-
const [{ useEditorStore }, { usesForms, formsGoNowhere }, { siteBackend }] = await Promise.all([import("./editor-store-
|
|
1182
|
+
const [{ useEditorStore }, { usesForms, formsGoNowhere }, { siteBackend }] = await Promise.all([import("./editor-store-JFHEOFHY.js"), import("./backend-FK5YT66V.js"), import("./integrations-TMJB7SEY.js")]);
|
|
1183
1183
|
const doc2 = useEditorStore.getState().document;
|
|
1184
1184
|
if (!usesForms(doc2)) return false;
|
|
1185
1185
|
return formsGoNowhere(doc2, await siteBackend(key).catch(() => void 0));
|
|
@@ -1215,7 +1215,7 @@ var publishSite = defineCommand({
|
|
|
1215
1215
|
const { cleanSlug } = await import("./rules-YA6ENCS7.js");
|
|
1216
1216
|
const address = p.address === void 0 ? void 0 : cleanSlug(p.address);
|
|
1217
1217
|
if (address === null) throw new CommandError("That cannot be a site address: use 3 to 40 letters, digits and dashes.", "invalid_params");
|
|
1218
|
-
const { publishOpenFile, NoScreens } = await import("./publish-site-
|
|
1218
|
+
const { publishOpenFile, NoScreens } = await import("./publish-site-4BKVML3W.js");
|
|
1219
1219
|
try {
|
|
1220
1220
|
const done = await publishOpenFile(address);
|
|
1221
1221
|
ctx.notice(`Published version ${done.version}: ${done.url}`);
|
|
@@ -1270,7 +1270,7 @@ var publishListSites = defineCommand({
|
|
|
1270
1270
|
},
|
|
1271
1271
|
run: async (p) => {
|
|
1272
1272
|
await signedIn();
|
|
1273
|
-
const [{ workspaceSites }, { activeTeamWorkspaceId, useHyperyTeam }] = await Promise.all([import("./sites-GKYHBZ5E.js"), import("./team-
|
|
1273
|
+
const [{ workspaceSites }, { activeTeamWorkspaceId, useHyperyTeam }] = await Promise.all([import("./sites-GKYHBZ5E.js"), import("./team-GWLLCLUM.js")]);
|
|
1274
1274
|
const workspaceId = p.workspaceId ?? activeTeamWorkspaceId() ?? useHyperyTeam.getState().personalWorkspaceId;
|
|
1275
1275
|
if (!workspaceId) throw new CommandError("Your workspaces have not loaded yet. Try again in a moment.", "failed");
|
|
1276
1276
|
const out = await workspaceSites(workspaceId);
|
|
@@ -1319,12 +1319,12 @@ var publishStatus = defineCommand({
|
|
|
1319
1319
|
},
|
|
1320
1320
|
run: async () => {
|
|
1321
1321
|
await signedIn();
|
|
1322
|
-
const [{ openFileKey }, { siteStatus }] = await Promise.all([import("./publish-site-
|
|
1322
|
+
const [{ openFileKey }, { siteStatus }] = await Promise.all([import("./publish-site-4BKVML3W.js"), import("./sites-GKYHBZ5E.js")]);
|
|
1323
1323
|
const key = openFileKey();
|
|
1324
1324
|
const status = await siteStatus(key);
|
|
1325
1325
|
const site = status.site;
|
|
1326
|
-
const backend = key ? await (await import("./integrations-
|
|
1327
|
-
const destinations = key ? await (await import("./integrations-
|
|
1326
|
+
const backend = key ? await (await import("./integrations-TMJB7SEY.js")).siteBackend(key).catch(() => null) : null;
|
|
1327
|
+
const destinations = key ? await (await import("./integrations-TMJB7SEY.js")).listDestinations(key).catch(() => []) : [];
|
|
1328
1328
|
return {
|
|
1329
1329
|
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}`,
|
|
1330
1330
|
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 })) }
|
|
@@ -1355,7 +1355,7 @@ var publishStore = defineCommand({
|
|
|
1355
1355
|
},
|
|
1356
1356
|
run: async (p, ctx) => {
|
|
1357
1357
|
await signedIn();
|
|
1358
|
-
const { deployOpenStore } = await import("./publish-store-
|
|
1358
|
+
const { deployOpenStore } = await import("./publish-store-QXVBQRV7.js");
|
|
1359
1359
|
const done = await deployOpenStore(ctx.doc(), ctx.pageId(), { destinationId: p.destinationId }).catch((e) => {
|
|
1360
1360
|
throw new CommandError(e instanceof Error ? e.message : String(e), "failed");
|
|
1361
1361
|
});
|
|
@@ -1384,7 +1384,7 @@ var integrationList = defineCommand({
|
|
|
1384
1384
|
}
|
|
1385
1385
|
},
|
|
1386
1386
|
run: async ({ capability }) => {
|
|
1387
|
-
const [{ cloudUser }, { integrationsWorkspaceId, listWorkspaceIntegrations }] = await Promise.all([import("./session-L4GMC36Z.js"), import("./integrations-
|
|
1387
|
+
const [{ cloudUser }, { integrationsWorkspaceId, listWorkspaceIntegrations }] = await Promise.all([import("./session-L4GMC36Z.js"), import("./integrations-TMJB7SEY.js")]);
|
|
1388
1388
|
if (!cloudUser()) throw new CommandError("You are not signed in: integrations belong to your account's workspace.", "denied");
|
|
1389
1389
|
const workspaceId = integrationsWorkspaceId();
|
|
1390
1390
|
if (!workspaceId) throw new CommandError("Your workspaces have not loaded yet. Try again in a moment.", "failed");
|
|
@@ -1425,7 +1425,7 @@ var integrationOpen = defineCommand({
|
|
|
1425
1425
|
}
|
|
1426
1426
|
});
|
|
1427
1427
|
async function openFile() {
|
|
1428
|
-
const [{ cloudUser }, { openFileKey }] = await Promise.all([import("./session-L4GMC36Z.js"), import("./publish-site-
|
|
1428
|
+
const [{ cloudUser }, { openFileKey }] = await Promise.all([import("./session-L4GMC36Z.js"), import("./publish-site-4BKVML3W.js")]);
|
|
1429
1429
|
if (!cloudUser()) throw new CommandError("You are not signed in.", "denied");
|
|
1430
1430
|
const key = openFileKey();
|
|
1431
1431
|
if (!key) throw new CommandError("This file is not saved to the cloud yet. Publish it first (publish_site).", "failed");
|
|
@@ -1451,7 +1451,7 @@ var integrationListResources = defineCommand({
|
|
|
1451
1451
|
}
|
|
1452
1452
|
},
|
|
1453
1453
|
run: async ({ connectionId, capability, path }) => {
|
|
1454
|
-
const { listResources } = await import("./integrations-
|
|
1454
|
+
const { listResources } = await import("./integrations-TMJB7SEY.js");
|
|
1455
1455
|
const list = await listResources(connectionId, capability, asPath2(path));
|
|
1456
1456
|
return {
|
|
1457
1457
|
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",
|
|
@@ -1486,7 +1486,7 @@ var integrationAddDestination = defineCommand({
|
|
|
1486
1486
|
},
|
|
1487
1487
|
run: async (p, ctx) => {
|
|
1488
1488
|
const key = await openFile();
|
|
1489
|
-
const { addDestination, createDestination, createResource } = await import("./integrations-
|
|
1489
|
+
const { addDestination, createDestination, createResource } = await import("./integrations-TMJB7SEY.js");
|
|
1490
1490
|
let made;
|
|
1491
1491
|
if (p.create) made = await createDestination(key, p.capability, void 0, p.connectionId);
|
|
1492
1492
|
else {
|
|
@@ -1523,7 +1523,7 @@ var integrationDeploy = defineCommand({
|
|
|
1523
1523
|
},
|
|
1524
1524
|
run: async (p, ctx) => {
|
|
1525
1525
|
const key = await openFile();
|
|
1526
|
-
const { deployDestination, listDestinations } = await import("./integrations-
|
|
1526
|
+
const { deployDestination, listDestinations } = await import("./integrations-TMJB7SEY.js");
|
|
1527
1527
|
const all = await listDestinations(key);
|
|
1528
1528
|
const dest = p.destinationId ? all.find((d) => d.id === p.destinationId) : all.length === 1 ? all[0] : void 0;
|
|
1529
1529
|
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");
|
|
@@ -1557,7 +1557,7 @@ var integrationAttachDatabase = defineCommand({
|
|
|
1557
1557
|
},
|
|
1558
1558
|
run: async (p, ctx) => {
|
|
1559
1559
|
const key = await openFile();
|
|
1560
|
-
const { attachDatabase, createDatabase, createResource, listResources } = await import("./integrations-
|
|
1560
|
+
const { attachDatabase, createDatabase, createResource, listResources } = await import("./integrations-TMJB7SEY.js");
|
|
1561
1561
|
if (p.create) return attached(await createDatabase(key, void 0, p.connectionId), ctx);
|
|
1562
1562
|
if (!p.connectionId || !p.target) throw new CommandError("Say connectionId and target, or create: true.", "invalid_params");
|
|
1563
1563
|
let target = asPath2(p.target);
|
|
@@ -1596,7 +1596,7 @@ var integrationSubmissions = defineCommand({
|
|
|
1596
1596
|
},
|
|
1597
1597
|
run: async ({ form, limit }) => {
|
|
1598
1598
|
const key = await openFile();
|
|
1599
|
-
const { listSubmissions } = await import("./integrations-
|
|
1599
|
+
const { listSubmissions } = await import("./integrations-TMJB7SEY.js");
|
|
1600
1600
|
const rows = await listSubmissions(key, { form, limit: limit ?? 20 });
|
|
1601
1601
|
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 } };
|
|
1602
1602
|
}
|
|
@@ -1621,7 +1621,7 @@ var integrationSetSignIn = defineCommand({
|
|
|
1621
1621
|
},
|
|
1622
1622
|
run: async ({ on }, ctx) => {
|
|
1623
1623
|
const key = await openFile();
|
|
1624
|
-
const { setSignIn } = await import("./integrations-
|
|
1624
|
+
const { setSignIn } = await import("./integrations-TMJB7SEY.js");
|
|
1625
1625
|
const done = await setSignIn(key, on);
|
|
1626
1626
|
ctx.notice(on ? "Visitors can sign in." : "Sign-in is off.");
|
|
1627
1627
|
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 } };
|
|
@@ -1839,7 +1839,7 @@ var fontTeamList = defineCommand({
|
|
|
1839
1839
|
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)." }
|
|
1840
1840
|
},
|
|
1841
1841
|
run: async (args) => {
|
|
1842
|
-
const { refreshTeamFonts } = await import("./team-client-
|
|
1842
|
+
const { refreshTeamFonts } = await import("./team-client-JTGXOWAU.js");
|
|
1843
1843
|
const fonts = await refreshTeamFonts(args.workspace);
|
|
1844
1844
|
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 })) } };
|
|
1845
1845
|
}
|
|
@@ -1866,7 +1866,7 @@ var fontTeamAdd = defineCommand({
|
|
|
1866
1866
|
run: async (args, ctx) => {
|
|
1867
1867
|
const { bytes, fileName: fileName2 } = await fontBytes(args, ctx);
|
|
1868
1868
|
const { face, family, weight, style } = await resolveFace(bytes, args);
|
|
1869
|
-
const { uploadTeamFont } = await import("./team-client-
|
|
1869
|
+
const { uploadTeamFont } = await import("./team-client-JTGXOWAU.js");
|
|
1870
1870
|
const font = await uploadTeamFont(bytes, { family, weight, style, face: face.index, fileName: fileName2 }, args.workspace);
|
|
1871
1871
|
return { summary: `Added ${family} ${weight}${style === "italic" ? " italic" : ""} to the team`, data: { font } };
|
|
1872
1872
|
}
|
|
@@ -1888,7 +1888,7 @@ var fontTeamRemove = defineCommand({
|
|
|
1888
1888
|
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." }
|
|
1889
1889
|
},
|
|
1890
1890
|
run: async (args) => {
|
|
1891
|
-
const { removeTeamFont } = await import("./team-client-
|
|
1891
|
+
const { removeTeamFont } = await import("./team-client-JTGXOWAU.js");
|
|
1892
1892
|
const out = await removeTeamFont(args.id, args.workspace);
|
|
1893
1893
|
return { summary: `Removed the team font${out.freed ? " and freed its storage" : ""}`, data: out };
|
|
1894
1894
|
}
|
|
@@ -1899,7 +1899,7 @@ var fontTeamCommands = [fontTeamList, fontTeamAdd];
|
|
|
1899
1899
|
init_define_POPCRAFT_COMPONENT_IDS();
|
|
1900
1900
|
async function cloudFile() {
|
|
1901
1901
|
const [{ syncStatus }, { cloudUser }] = await Promise.all([
|
|
1902
|
-
import("./sync-
|
|
1902
|
+
import("./sync-XVXFWCTT.js"),
|
|
1903
1903
|
import("./session-L4GMC36Z.js")
|
|
1904
1904
|
]);
|
|
1905
1905
|
const link2 = syncStatus().link;
|
|
@@ -1961,7 +1961,7 @@ var fileTrash = defineCommand({
|
|
|
1961
1961
|
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." }
|
|
1962
1962
|
},
|
|
1963
1963
|
run: async () => {
|
|
1964
|
-
const { deleteCurrentFile, leaveDeletedFile } = await import("./delete-current-file-
|
|
1964
|
+
const { deleteCurrentFile, leaveDeletedFile } = await import("./delete-current-file-B7GF6WKT.js");
|
|
1965
1965
|
const { name: name2, kind } = await deleteCurrentFile();
|
|
1966
1966
|
leaveDeletedFile();
|
|
1967
1967
|
return { summary: kind === "cloud" ? `Moved \u201C${name2}\u201D to the Trash` : `Deleted \u201C${name2}\u201D` };
|
|
@@ -2074,11 +2074,11 @@ var fileDuplicate = defineCommand({
|
|
|
2074
2074
|
},
|
|
2075
2075
|
run: async (_p, ctx) => {
|
|
2076
2076
|
const [{ syncStatus }, { cloudApi }, { isDesktopTabs }, { createFileInTab }, { openNewCloudFile }, { v4: uuid }] = await Promise.all([
|
|
2077
|
-
import("./sync-
|
|
2077
|
+
import("./sync-XVXFWCTT.js"),
|
|
2078
2078
|
import("./api-O4V5ICO5.js"),
|
|
2079
2079
|
import("./tab-mode-ELW74CVC.js"),
|
|
2080
|
-
import("./tabs-
|
|
2081
|
-
import("./sync-
|
|
2080
|
+
import("./tabs-GRBJ3KDT.js"),
|
|
2081
|
+
import("./sync-XVXFWCTT.js"),
|
|
2082
2082
|
import("./dist-node-EF3J2YOD.js")
|
|
2083
2083
|
]);
|
|
2084
2084
|
const doc2 = ctx.doc();
|
|
@@ -4955,7 +4955,7 @@ var viewCopyLink = defineCommand({
|
|
|
4955
4955
|
},
|
|
4956
4956
|
run: async (args, ctx) => {
|
|
4957
4957
|
const [{ syncStatus }, { fileUrl }, { withDeepLink }] = await Promise.all([
|
|
4958
|
-
import("./sync-
|
|
4958
|
+
import("./sync-XVXFWCTT.js"),
|
|
4959
4959
|
import("./api-O4V5ICO5.js"),
|
|
4960
4960
|
import("./deep-link-U333HG7D.js")
|
|
4961
4961
|
]);
|
|
@@ -5280,7 +5280,7 @@ var pageGo = defineCommand({
|
|
|
5280
5280
|
] }
|
|
5281
5281
|
},
|
|
5282
5282
|
run: async ({ to }) => {
|
|
5283
|
-
const { useEditorStore } = await import("./editor-store-
|
|
5283
|
+
const { useEditorStore } = await import("./editor-store-JFHEOFHY.js");
|
|
5284
5284
|
useEditorStore.getState().goToPrintPage(to);
|
|
5285
5285
|
return { summary: typeof to === "number" ? `Page ${to + 1}` : `${to} page` };
|
|
5286
5286
|
}
|
|
@@ -5314,7 +5314,7 @@ var pageSetup = defineCommand({
|
|
|
5314
5314
|
}
|
|
5315
5315
|
},
|
|
5316
5316
|
run: async (args) => {
|
|
5317
|
-
const { useEditorStore } = await import("./editor-store-
|
|
5317
|
+
const { useEditorStore } = await import("./editor-store-JFHEOFHY.js");
|
|
5318
5318
|
useEditorStore.getState().applyPageSetup(args);
|
|
5319
5319
|
return { summary: `Page setup updated${args.kind ? ` (${args.kind.toLowerCase()})` : ""}` };
|
|
5320
5320
|
}
|
|
@@ -5752,7 +5752,7 @@ async function docAtTime(doc2, ids, time2) {
|
|
|
5752
5752
|
let frameId;
|
|
5753
5753
|
if (time2 === void 0) {
|
|
5754
5754
|
try {
|
|
5755
|
-
const { useEditorStore } = await import("./editor-store-
|
|
5755
|
+
const { useEditorStore } = await import("./editor-store-JFHEOFHY.js");
|
|
5756
5756
|
const st = useEditorStore.getState();
|
|
5757
5757
|
const target = st.transport?.target;
|
|
5758
5758
|
if (st.mode !== "ANIMATE" || target?.kind !== "frame") return doc2;
|
|
@@ -6146,7 +6146,7 @@ async function runAnimationExport(format, args, ctx) {
|
|
|
6146
6146
|
const filename = exportFileName(args.filename || targetName(doc2, target), format);
|
|
6147
6147
|
const [{ exportAnimation }, { memoryDestination }] = await Promise.all([import("./video-K364OZFS.js"), import("./destination-NMHWTSBJ.js")]);
|
|
6148
6148
|
if (format === "lottie" || format === "dotlottie") return runLottieExport(renderer, doc2, spec, filename, ctx, memoryDestination, args.stateMachine);
|
|
6149
|
-
const planWatermark = format !== "png" && await (await import("./export-watermark-
|
|
6149
|
+
const planWatermark = format !== "png" && await (await import("./export-watermark-22LJTK5X.js")).exportWatermark();
|
|
6150
6150
|
if (format !== "png") spec = { ...spec, watermark: planWatermark || args.watermark !== false };
|
|
6151
6151
|
const dest = ctx.destination ? await ctx.destination(filename, FORMAT_MIME[format]) : memoryDestination(filename, FORMAT_MIME[format]);
|
|
6152
6152
|
let stats;
|
|
@@ -6232,7 +6232,7 @@ var exportLottie = animationCommand((args) => args.container === "lottie" ? "dot
|
|
|
6232
6232
|
});
|
|
6233
6233
|
async function exportSite(doc2, pageId2, packaging, styling = "css", siteUrl) {
|
|
6234
6234
|
const [{ completeSite, nextFilesOf, nextProjectDropped, shareImageFiles, staticFilesOf, NoSiteRuntime, bytesOf }, { fileBase }, { zipFiles }, { downloadBlob }] = await Promise.all([
|
|
6235
|
-
import("./project-
|
|
6235
|
+
import("./project-37JVFD6K.js"),
|
|
6236
6236
|
import("./web-36MGF6CW.js"),
|
|
6237
6237
|
import("./zip-export-TZA7FPVI.js"),
|
|
6238
6238
|
import("./download-CT4TQCRP.js")
|
|
@@ -6327,8 +6327,8 @@ var exportStorefront = defineCommand({
|
|
|
6327
6327
|
const doc2 = ctx.doc();
|
|
6328
6328
|
const [{ storefrontInputs }, { STOREFRONT_TARGETS }, { bytesOf }, { fileBase, flatten }, { zipFiles }, { downloadBlob }] = await Promise.all([
|
|
6329
6329
|
import("./storefront-prepare-4XRHUBPC.js"),
|
|
6330
|
-
import("./storefront-
|
|
6331
|
-
import("./project-
|
|
6330
|
+
import("./storefront-YZAY7XSO.js"),
|
|
6331
|
+
import("./project-37JVFD6K.js"),
|
|
6332
6332
|
import("./web-36MGF6CW.js"),
|
|
6333
6333
|
import("./zip-export-TZA7FPVI.js"),
|
|
6334
6334
|
import("./download-CT4TQCRP.js")
|
|
@@ -6723,7 +6723,7 @@ var visionRegenerateImage = defineCommand({
|
|
|
6723
6723
|
const id = args.id ?? ctx.selection()[0];
|
|
6724
6724
|
if (!id) throw new ToolError("Select a generated image to regenerate.");
|
|
6725
6725
|
nodeOrThrow(ctx.doc(), id);
|
|
6726
|
-
const { regenerateImage } = await import("./client-actions-
|
|
6726
|
+
const { regenerateImage } = await import("./client-actions-HSU6LXB3.js");
|
|
6727
6727
|
regenerateImage(id, args.count);
|
|
6728
6728
|
return { summary: args.count > 1 ? `Regenerating ${args.count} variants` : "Regenerating the image", data: { id, count: args.count } };
|
|
6729
6729
|
}
|
|
@@ -12118,7 +12118,7 @@ var scriptRun = defineCommand({
|
|
|
12118
12118
|
// A script is not the turn the user is watching: confirm-tier tools are refused inside it (dispatch, `nested`).
|
|
12119
12119
|
actor: { ...ctx.actor, nested: true, label: "Script" },
|
|
12120
12120
|
// A look_at inside the script sees the document as the script has left it so far, not as it was before.
|
|
12121
|
-
use: ((name2) => name2 === "render" && ctx.can("render") ? (async (ids, options) => (await import("./agent-
|
|
12121
|
+
use: ((name2) => name2 === "render" && ctx.can("render") ? (async (ids, options) => (await import("./agent-ORS5BEZC.js")).renderDocument(staged, ids, options)) : ctx.use(name2))
|
|
12122
12122
|
};
|
|
12123
12123
|
let calls = 0;
|
|
12124
12124
|
const images = [];
|
|
@@ -12971,7 +12971,7 @@ var docImportFile = defineCommand({
|
|
|
12971
12971
|
const file = new File([body], args.name);
|
|
12972
12972
|
if (file.size > MAX_BYTES) throw new ToolError(`"${args.name}" is larger than ${MAX_BYTES / 1024 / 1024} MB.`);
|
|
12973
12973
|
const [{ buildImportedDocument }, { mergeImportedDocument }] = await Promise.all([
|
|
12974
|
-
import("./plugin-import-
|
|
12974
|
+
import("./plugin-import-YRTFZW5S.js"),
|
|
12975
12975
|
import("./import-merge-2KRXBK23.js")
|
|
12976
12976
|
]);
|
|
12977
12977
|
const built = await buildImportedDocument(file);
|
|
@@ -4862,7 +4862,7 @@ function createPopcornSlice(set2, get2) {
|
|
|
4862
4862
|
privateMode: false,
|
|
4863
4863
|
setPrivateMode: (on) => {
|
|
4864
4864
|
set2({ privateMode: on });
|
|
4865
|
-
void import("./presence-
|
|
4865
|
+
void import("./presence-MW5DBXWS.js").then((m) => m.setPresencePrivate(on)).catch(() => {
|
|
4866
4866
|
});
|
|
4867
4867
|
},
|
|
4868
4868
|
/** Reveal every private item THIS user created (they sync to collaborators). Others' stay theirs. */
|
|
@@ -6924,7 +6924,7 @@ var useEditorStore = create()(
|
|
|
6924
6924
|
// A copy is a new file, so it is cloud-backed like any other (see lib/client/cloud/new-file.ts).
|
|
6925
6925
|
// Returns '' when it was refused (offline, signed out, plan full) or failed; nothing is left behind.
|
|
6926
6926
|
duplicateDocument: async (id) => {
|
|
6927
|
-
const { duplicateDocumentToCloud } = await import("./sync-
|
|
6927
|
+
const { duplicateDocumentToCloud } = await import("./sync-XVXFWCTT.js");
|
|
6928
6928
|
return duplicateDocumentToCloud(id);
|
|
6929
6929
|
},
|
|
6930
6930
|
deleteDocument: async (id) => {
|
|
@@ -10432,9 +10432,9 @@ if (typeof window !== "undefined") {
|
|
|
10432
10432
|
if (typeof window !== "undefined" && navigator.webdriver) {
|
|
10433
10433
|
window.__vpDesign = async (script, o = {}) => {
|
|
10434
10434
|
const [{ registerBuiltinTools, runTool }, { editorToolContext }, { createDesignPreview }] = await Promise.all([
|
|
10435
|
-
import("./tools-
|
|
10436
|
-
import("./editor-seams-
|
|
10437
|
-
import("./live-
|
|
10435
|
+
import("./tools-RMNATBMU.js").then(async (m) => ({ ...m, registerBuiltinTools: (await import("./builtin-2KL2EXTB.js")).registerBuiltinTools })),
|
|
10436
|
+
import("./editor-seams-7V7DY52W.js"),
|
|
10437
|
+
import("./live-JRCK5ROW.js")
|
|
10438
10438
|
]);
|
|
10439
10439
|
registerBuiltinTools();
|
|
10440
10440
|
const args = JSON.stringify({ ...o.name ? { name: o.name } : {}, ...o.size ? { size: o.size } : {}, ...o.frame ? { frame: o.frame } : {}, script });
|
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
LOGO_ROWS,
|
|
10
10
|
LOGO_W
|
|
11
11
|
} from "./chunk-JXBXISRI.js";
|
|
12
|
+
import {
|
|
13
|
+
hex
|
|
14
|
+
} from "./chunk-ONHLN4VB.js";
|
|
12
15
|
import {
|
|
13
16
|
init_define_POPCRAFT_COMPONENT_IDS
|
|
14
17
|
} from "./chunk-6JXNKUNX.js";
|
|
@@ -172,9 +175,8 @@ function logoMask() {
|
|
|
172
175
|
return logoBits;
|
|
173
176
|
}
|
|
174
177
|
var logoHeight = (width) => Math.round(width * LOGO_H / LOGO_W);
|
|
175
|
-
function
|
|
176
|
-
const bits = logoMask(), h = logoHeight(width),
|
|
177
|
-
const scale = LOGO_W / width;
|
|
178
|
+
function logoStitches(width) {
|
|
179
|
+
const bits = logoMask(), h = logoHeight(width), scale = LOGO_W / width;
|
|
178
180
|
const on = new Uint8Array(width * h);
|
|
179
181
|
for (let y = 0; y < h; y++) for (let x = 0; x < width; x++) {
|
|
180
182
|
let ink = 0, all = 0;
|
|
@@ -185,18 +187,21 @@ function popcraftLogo(s, cx, cy, width, c, outline) {
|
|
|
185
187
|
}
|
|
186
188
|
on[y * width + x] = ink * 2 >= all && all ? 1 : 0;
|
|
187
189
|
}
|
|
188
|
-
|
|
190
|
+
return { on, width, height: h, at: (x, y) => x >= 0 && y >= 0 && x < width && y < h && on[y * width + x] === 1 };
|
|
191
|
+
}
|
|
192
|
+
function popcraftLogo(s, cx, cy, width, c, outline) {
|
|
193
|
+
const L = logoStitches(width), x0 = Math.round(cx - width / 2), y0 = Math.round(cy - L.height / 2);
|
|
189
194
|
if (outline) {
|
|
190
195
|
const r = outline.ring;
|
|
191
|
-
for (let y = -r; y <
|
|
196
|
+
for (let y = -r; y < L.height + r; y++) for (let x = -r; x < width + r; x++) {
|
|
192
197
|
let near = false;
|
|
193
|
-
for (let dy = -r; dy <= r && !near; dy++) for (let dx = -r; dx <= r && !near; dx++) if (dx * dx + dy * dy <= r * r + r && at(x + dx, y + dy)) near = true;
|
|
198
|
+
for (let dy = -r; dy <= r && !near; dy++) for (let dx = -r; dx <= r && !near; dx++) if (dx * dx + dy * dy <= r * r + r && L.at(x + dx, y + dy)) near = true;
|
|
194
199
|
if (near) s.set(x0 + x, y0 + y, outline.c);
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
|
-
for (let y = 0; y <
|
|
202
|
+
for (let y = 0; y < L.height; y++) for (let x = 0; x < width; x++) if (L.at(x, y)) s.set(x0 + x, y0 + y, c);
|
|
198
203
|
const pad = outline ? outline.ring : 0;
|
|
199
|
-
return { x0: x0 - pad, y0: y0 - pad, x1: x0 + width + pad, y1: y0 +
|
|
204
|
+
return { x0: x0 - pad, y0: y0 - pad, x1: x0 + width + pad, y1: y0 + L.height + pad };
|
|
200
205
|
}
|
|
201
206
|
function banner(s, cx, cy, w, h, c, shade) {
|
|
202
207
|
const top = cy - h / 2, bot = cy + h / 2, l = cx - w / 2, r = cx + w / 2, tail = h * 0.55, drop = h * 0.22;
|
|
@@ -221,13 +226,13 @@ var clear = (s, pad) => (x, y) => {
|
|
|
221
226
|
}
|
|
222
227
|
return true;
|
|
223
228
|
};
|
|
224
|
-
function knitPanel(k, sheet, panel, yarns, s, trimSlot) {
|
|
229
|
+
function knitPanel(k, sheet, panel, yarns, s, trimSlot, o = {}) {
|
|
225
230
|
s.removeStrays();
|
|
226
231
|
for (const [a, b] of panel.trim) s.rows(a, b, trimSlot);
|
|
227
232
|
const chars = "abcdefgh";
|
|
228
233
|
const key = {};
|
|
229
|
-
yarns.forEach((
|
|
230
|
-
key[chars[i]] =
|
|
234
|
+
yarns.forEach((hex2, i) => {
|
|
235
|
+
key[chars[i]] = hex2;
|
|
231
236
|
});
|
|
232
237
|
const rows = [];
|
|
233
238
|
for (let y = 0; y < s.height; y++) {
|
|
@@ -239,12 +244,77 @@ function knitPanel(k, sheet, panel, yarns, s, trimSlot) {
|
|
|
239
244
|
k.patch(sheet, { fills: [], clipsContent: true });
|
|
240
245
|
const area = k.frame(sheet, { x: 0, y: 0, width: panel.width * CELL, height: panel.height * CELL }, { name: "Knit area", clip: true });
|
|
241
246
|
const grid = k.pixels(area, [rows], key, { cell: CELL, name: "Stitches", palette: [...yarns], absolute: { x: 0, y: 0 } });
|
|
242
|
-
k.patch(grid, { layerPaletteSnap: true });
|
|
247
|
+
k.patch(grid, { layerPaletteSnap: true, layerBlend: o.blend ?? "DITHER", ...o.dot ? { layerHalftoneSize: o.dot } : {} });
|
|
248
|
+
o.layers?.(new KnitLayers(k, grid));
|
|
249
|
+
if (o.layers) for (const [a, b] of panel.trim) new KnitLayers(k, grid).rect(0, a, panel.width, b - a + 1, [{ ...k.paint("trim")[0] }], "Trim yarn");
|
|
243
250
|
for (const [a, b] of panel.trim) {
|
|
244
251
|
const id = k.rect(sheet, panel.width * CELL, (b - a + 1) * CELL, "trim", { name: "Trim", absolute: { x: 0, y: a * CELL } });
|
|
245
252
|
k.patch(id, { locked: true });
|
|
246
253
|
}
|
|
247
254
|
}
|
|
255
|
+
var stops = (s) => s.map(([position, h, a]) => ({ position, color: hex(h, a ?? 1) }));
|
|
256
|
+
function linear(angle, s) {
|
|
257
|
+
const r = angle * Math.PI / 180, dx = Math.cos(r) / 2, dy = Math.sin(r) / 2;
|
|
258
|
+
return [{ type: "GRADIENT_LINEAR", gradientStops: stops(s), gradientHandlePositions: [{ x: 0.5 - dx, y: 0.5 - dy }, { x: 0.5 + dx, y: 0.5 + dy }, { x: 0.5 - dy, y: 0.5 + dx }], opacity: 1, visible: true }];
|
|
259
|
+
}
|
|
260
|
+
function radial(s, cx = 0.5, cy = 0.5, r = 0.5) {
|
|
261
|
+
return [{ type: "GRADIENT_RADIAL", gradientStops: stops(s), gradientHandlePositions: [{ x: cx, y: cy }, { x: cx + r, y: cy }, { x: cx, y: cy + r }], opacity: 1, visible: true }];
|
|
262
|
+
}
|
|
263
|
+
function between(a, b, t = 0.5) {
|
|
264
|
+
const p = (h, i) => parseInt(h.slice(1 + i * 2, 3 + i * 2), 16);
|
|
265
|
+
return "#" + [0, 1, 2].map((i) => Math.round(p(a, i) + (p(b, i) - p(a, i)) * t).toString(16).padStart(2, "0")).join("");
|
|
266
|
+
}
|
|
267
|
+
var KnitLayers = class {
|
|
268
|
+
constructor(k, grid) {
|
|
269
|
+
this.k = k;
|
|
270
|
+
this.grid = grid;
|
|
271
|
+
}
|
|
272
|
+
add(x0, y0, w, h, paths, fill, name) {
|
|
273
|
+
return this.k.vector(this.grid, w * CELL, h * CELL, paths, fill, { name, absolute: { x: x0 * CELL, y: y0 * CELL } });
|
|
274
|
+
}
|
|
275
|
+
/** A closed shape through `pts` (stitches). */
|
|
276
|
+
poly(pts, fill, name) {
|
|
277
|
+
const xs = pts.map((p) => p[0]), ys = pts.map((p) => p[1]), x0 = Math.min(...xs), y0 = Math.min(...ys);
|
|
278
|
+
const points = pts.map(([x, y]) => ({ x: (x - x0) * CELL, y: (y - y0) * CELL }));
|
|
279
|
+
return this.add(x0, y0, Math.max(...xs) - x0, Math.max(...ys) - y0, [{ points, closed: true }], fill, name);
|
|
280
|
+
}
|
|
281
|
+
/** An ellipse round (cx, cy), `rx` by `ry` stitches. */
|
|
282
|
+
ellipse(cx, cy, rx, ry, fill, name) {
|
|
283
|
+
const n = 48, pts = [];
|
|
284
|
+
for (let i = 0; i < n; i++) {
|
|
285
|
+
const a = i / n * Math.PI * 2;
|
|
286
|
+
pts.push([cx + Math.cos(a) * rx, cy + Math.sin(a) * ry]);
|
|
287
|
+
}
|
|
288
|
+
return this.poly(pts, fill, name);
|
|
289
|
+
}
|
|
290
|
+
rect(x, y, w, h, fill, name) {
|
|
291
|
+
return this.poly([[x, y], [x + w, y], [x + w, y + h], [x, y + h]], fill, name);
|
|
292
|
+
}
|
|
293
|
+
/** A glow: a soft ring of `hex` round (cx, cy), densest `at` of the way out, fading to nothing both ways. */
|
|
294
|
+
halo(cx, cy, rx, ry, h, peak, at = 0.6, name = "Glow") {
|
|
295
|
+
return this.ellipse(cx, cy, rx, ry, radial([[0, h, 0], [at * 0.6, h, peak * 0.35], [at, h, peak], [1, h, 0]]), name);
|
|
296
|
+
}
|
|
297
|
+
/** A shaded ball: lit from the upper left, `light` → `body` → `shadow`. */
|
|
298
|
+
bauble(cx, cy, r, light, body, shadow, name = "Bauble") {
|
|
299
|
+
return this.ellipse(cx, cy, r, r, radial([[0, light], [0.35, body], [1, shadow]], 0.36, 0.32, 0.75), name);
|
|
300
|
+
}
|
|
301
|
+
/** The PopCraft wordmark as one vector layer, `width` stitches wide, centred on (cx, cy), filled with `fill`. */
|
|
302
|
+
logo(cx, cy, width, fill, name = "PopCraft logo") {
|
|
303
|
+
const L = logoStitches(width), x0 = Math.round(cx - width / 2), y0 = Math.round(cy - L.height / 2);
|
|
304
|
+
const paths = [];
|
|
305
|
+
for (let y = 0; y < L.height; y++) {
|
|
306
|
+
for (let x = 0; x < width; x++) {
|
|
307
|
+
if (!L.at(x, y)) continue;
|
|
308
|
+
let e = x;
|
|
309
|
+
while (L.at(e + 1, y)) e++;
|
|
310
|
+
const a = x * CELL, b = (e + 1) * CELL, t = y * CELL, u = (y + 1) * CELL;
|
|
311
|
+
paths.push({ points: [{ x: a, y: t }, { x: b, y: t }, { x: b, y: u }, { x: a, y: u }], closed: true });
|
|
312
|
+
x = e;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return { id: this.add(x0, y0, width, L.height, paths, fill, name), x0, y0, x1: x0 + width, y1: y0 + L.height };
|
|
316
|
+
}
|
|
317
|
+
};
|
|
248
318
|
|
|
249
319
|
export {
|
|
250
320
|
YARN,
|
|
@@ -261,9 +331,14 @@ export {
|
|
|
261
331
|
zigzag,
|
|
262
332
|
diamonds,
|
|
263
333
|
logoHeight,
|
|
334
|
+
logoStitches,
|
|
264
335
|
popcraftLogo,
|
|
265
336
|
banner,
|
|
266
337
|
lice,
|
|
267
338
|
clear,
|
|
268
|
-
knitPanel
|
|
339
|
+
knitPanel,
|
|
340
|
+
linear,
|
|
341
|
+
radial,
|
|
342
|
+
between,
|
|
343
|
+
KnitLayers
|
|
269
344
|
};
|
|
@@ -150,7 +150,7 @@ function startHyperyTeams() {
|
|
|
150
150
|
maybePromptForTeam();
|
|
151
151
|
void followFileTeam(linkedKey);
|
|
152
152
|
});
|
|
153
|
-
void import("./sync-
|
|
153
|
+
void import("./sync-XVXFWCTT.js").then(({ onSyncStatus, syncStatus }) => {
|
|
154
154
|
linkedKey = syncStatus().link?.key ?? null;
|
|
155
155
|
void followFileTeam(linkedKey);
|
|
156
156
|
onSyncStatus((_s, link) => {
|
|
@@ -9537,21 +9537,21 @@ var templates_default = [
|
|
|
9537
9537
|
name: "Christmas tree knit sweater",
|
|
9538
9538
|
kind: "PRINT",
|
|
9539
9539
|
category: "knitwear",
|
|
9540
|
-
bytes:
|
|
9540
|
+
bytes: 7745532
|
|
9541
9541
|
},
|
|
9542
9542
|
{
|
|
9543
9543
|
id: "popcraft.print-knit-nordic-snowflake-sweater",
|
|
9544
9544
|
name: "Nordic snowflake knit sweater",
|
|
9545
9545
|
kind: "PRINT",
|
|
9546
9546
|
category: "knitwear",
|
|
9547
|
-
bytes:
|
|
9547
|
+
bytes: 7675449
|
|
9548
9548
|
},
|
|
9549
9549
|
{
|
|
9550
9550
|
id: "popcraft.print-knit-snowflake-beanie",
|
|
9551
9551
|
name: "Snowflake knit beanie",
|
|
9552
9552
|
kind: "PRINT",
|
|
9553
9553
|
category: "knitwear",
|
|
9554
|
-
bytes:
|
|
9554
|
+
bytes: 589765
|
|
9555
9555
|
},
|
|
9556
9556
|
{
|
|
9557
9557
|
id: "popcraft.print-large-format",
|
|
@@ -91,9 +91,9 @@ async function placeStockPhoto(photo, opts = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
async function placePicture(imported, opts = {}) {
|
|
93
93
|
const [{ useEditorStore }, { photoFrameOf }, { placeImage }] = await Promise.all([
|
|
94
|
-
import("./editor-store-
|
|
94
|
+
import("./editor-store-JFHEOFHY.js"),
|
|
95
95
|
import("../lib/document/photo-frames.js"),
|
|
96
|
-
import("./media-tool-
|
|
96
|
+
import("./media-tool-BGIARYN2.js")
|
|
97
97
|
]);
|
|
98
98
|
const st = useEditorStore.getState();
|
|
99
99
|
const frame = photoFrameOf(st.document.nodes, opts.targetId !== void 0 ? opts.targetId : st.selection[0] ?? null);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-NI5BBHJX.js";
|
|
10
10
|
import {
|
|
11
11
|
notice
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-G73CQMMJ.js";
|
|
13
13
|
import {
|
|
14
14
|
effectiveChatModel,
|
|
15
15
|
setModelPref,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-MKWU7K63.js";
|
|
18
18
|
import {
|
|
19
19
|
useEditorStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IXK5DQVP.js";
|
|
21
21
|
import {
|
|
22
22
|
create
|
|
23
23
|
} from "./chunk-LLNAXNMG.js";
|
|
@@ -1979,7 +1979,7 @@ async function sendMessage(text) {
|
|
|
1979
1979
|
if (!useAgentStore.getState().activeThreadId) newThread();
|
|
1980
1980
|
const mentions = pruneMentions(body, useAgentStore.getState().draftMentions);
|
|
1981
1981
|
useAgentStore.setState({ draft: "", draftMentions: [], error: null });
|
|
1982
|
-
const { runTurn } = await import("./runner-
|
|
1982
|
+
const { runTurn } = await import("./runner-Q53FUQ4P.js");
|
|
1983
1983
|
await runTurn(body, mentions);
|
|
1984
1984
|
}
|
|
1985
1985
|
function stop() {
|
|
@@ -2082,7 +2082,7 @@ var clearTaskChildren = () => useAgentStore.setState({ taskChildren: {} });
|
|
|
2082
2082
|
function subscribeChildTools() {
|
|
2083
2083
|
let dispose;
|
|
2084
2084
|
let cancelled = false;
|
|
2085
|
-
void import("./runner-
|
|
2085
|
+
void import("./runner-Q53FUQ4P.js").then(({ onChildTool }) => {
|
|
2086
2086
|
const off = onChildTool((report) => {
|
|
2087
2087
|
if (report?.status !== "running" || report.jobId) return;
|
|
2088
2088
|
recordChildTool(report.toolCallId ?? "", report.name);
|