@clipwright/core 0.33.0 → 0.35.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/CHANGELOG.md +251 -0
- package/README.md +3 -1
- package/dist/account-actors.d.ts +173 -14
- package/dist/account-actors.js +142 -10
- package/dist/account-actors.js.map +1 -1
- package/dist/actor-bounds.d.ts +4 -0
- package/dist/actor-bounds.js +4 -0
- package/dist/actor-bounds.js.map +1 -1
- package/dist/actors.d.ts +31 -0
- package/dist/actors.js +26 -0
- package/dist/actors.js.map +1 -1
- package/dist/api-failure.js +2 -1
- package/dist/api-failure.js.map +1 -1
- package/dist/asset-identity.d.ts +6 -0
- package/dist/asset-identity.js +7 -0
- package/dist/asset-identity.js.map +1 -0
- package/dist/assets.d.ts +403 -8
- package/dist/assets.js +132 -22
- package/dist/assets.js.map +1 -1
- package/dist/billing-terms.d.ts +69 -0
- package/dist/billing-terms.js +8 -0
- package/dist/billing-terms.js.map +1 -1
- package/dist/caption-language.d.ts +2 -0
- package/dist/caption-language.js +17 -0
- package/dist/caption-language.js.map +1 -0
- package/dist/contract-dispositions.d.ts +1617 -8
- package/dist/contract-dispositions.js +75 -11
- package/dist/contract-dispositions.js.map +1 -1
- package/dist/contracts/v1/workflow-brief.d.ts +3166 -78
- package/dist/contracts/v1/workflow-brief.js +4 -0
- package/dist/contracts/v1/workflow-brief.js.map +1 -1
- package/dist/contracts/v1/workflow-catalog.d.ts +3712 -8
- package/dist/contracts/v1/workflow-catalog.js +4 -2
- package/dist/contracts/v1/workflow-catalog.js.map +1 -1
- package/dist/contracts/v1/workflow-client.d.ts +2466 -4
- package/dist/contracts/v1/workflow-client.js +6 -3
- package/dist/contracts/v1/workflow-client.js.map +1 -1
- package/dist/contracts/v1/workflow-execution.d.ts +163 -9
- package/dist/contracts/v1/workflow-execution.js +15 -7
- package/dist/contracts/v1/workflow-execution.js.map +1 -1
- package/dist/contracts/v1/workflow-plan.d.ts +6014 -487
- package/dist/contracts/v1/workflow-primitives.d.ts +3 -1
- package/dist/contracts/v1/workflow-primitives.js +1 -1
- package/dist/contracts/v1/workflow-primitives.js.map +1 -1
- package/dist/contracts/v1/workflow-run-read.d.ts +114 -1
- package/dist/edit-billing.d.ts +12 -0
- package/dist/edit-billing.js +8 -0
- package/dist/edit-billing.js.map +1 -1
- package/dist/edit-long-form.d.ts +1 -1
- package/dist/edit-long-form.js +12 -2
- package/dist/edit-long-form.js.map +1 -1
- package/dist/endpoint-notes.d.ts +3 -0
- package/dist/endpoint-notes.js +66 -0
- package/dist/endpoint-notes.js.map +1 -0
- package/dist/endpoints.d.ts +4 -0
- package/dist/endpoints.js +15 -0
- package/dist/endpoints.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/face-billing.d.ts +55 -0
- package/dist/face-billing.js +22 -0
- package/dist/face-billing.js.map +1 -1
- package/dist/faceless-price.d.ts +26 -2
- package/dist/faceless-price.js +33 -6
- package/dist/faceless-price.js.map +1 -1
- package/dist/faceless-public.d.ts +6 -1
- package/dist/faceless-public.js +2 -2
- package/dist/faceless-public.js.map +1 -1
- package/dist/generations.d.ts +32 -6
- package/dist/generations.js +82 -27
- package/dist/generations.js.map +1 -1
- package/dist/idempotency.d.ts +2 -0
- package/dist/idempotency.js +7 -4
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/dist/long-form-pricing.d.ts +7 -4
- package/dist/long-form-pricing.js +13 -10
- package/dist/long-form-pricing.js.map +1 -1
- package/dist/long-form-revision.js +1 -1
- package/dist/long-form-revision.js.map +1 -1
- package/dist/openapi.d.ts +154 -0
- package/dist/openapi.js +334 -0
- package/dist/openapi.js.map +1 -0
- package/dist/pacing.d.ts +15 -0
- package/dist/pacing.js +30 -0
- package/dist/pacing.js.map +1 -1
- package/dist/parts-pricing.d.ts +84 -0
- package/dist/parts-pricing.js +105 -0
- package/dist/parts-pricing.js.map +1 -0
- package/dist/presenter-beats.d.ts +45 -0
- package/dist/presenter-beats.js +144 -0
- package/dist/presenter-beats.js.map +1 -0
- package/dist/prices.d.ts +98 -0
- package/dist/prices.js +189 -0
- package/dist/prices.js.map +1 -0
- package/dist/public-endpoints.d.ts +2 -0
- package/dist/public-endpoints.js +2 -0
- package/dist/public-endpoints.js.map +1 -1
- package/dist/public-responses.d.ts +23 -0
- package/dist/public-responses.js +11 -0
- package/dist/public-responses.js.map +1 -0
- package/dist/reference-analysis.d.ts +683 -0
- package/dist/reference-analysis.js +91 -0
- package/dist/reference-analysis.js.map +1 -0
- package/dist/reference-kinds.d.ts +6 -0
- package/dist/reference-kinds.js +8 -0
- package/dist/reference-kinds.js.map +1 -0
- package/dist/reference-profile.d.ts +633 -0
- package/dist/reference-profile.js +151 -0
- package/dist/reference-profile.js.map +1 -0
- package/dist/reference-staging.d.ts +571 -0
- package/dist/reference-staging.js +151 -0
- package/dist/reference-staging.js.map +1 -0
- package/dist/reference-voice.d.ts +305 -0
- package/dist/reference-voice.js +108 -0
- package/dist/reference-voice.js.map +1 -0
- package/dist/resolved-timeline.d.ts +206 -1
- package/dist/resolved-timeline.js +96 -4
- package/dist/resolved-timeline.js.map +1 -1
- package/dist/run-static-warnings.js +19 -7
- package/dist/run-static-warnings.js.map +1 -1
- package/dist/runs.d.ts +75 -3
- package/dist/runs.js +6 -1
- package/dist/runs.js.map +1 -1
- package/dist/semantic-inserts.d.ts +7 -0
- package/dist/semantic-inserts.js +19 -9
- package/dist/semantic-inserts.js.map +1 -1
- package/dist/skills.d.ts +5838 -22
- package/dist/skills.js +380 -25
- package/dist/skills.js.map +1 -1
- package/dist/templates/callout.d.ts +34 -0
- package/dist/templates/callout.js +51 -0
- package/dist/templates/callout.js.map +1 -0
- package/dist/templates/checklist.d.ts +42 -0
- package/dist/templates/checklist.js +47 -0
- package/dist/templates/checklist.js.map +1 -0
- package/dist/templates/compare.d.ts +26 -0
- package/dist/templates/compare.js +35 -0
- package/dist/templates/compare.js.map +1 -0
- package/dist/templates/end-card.d.ts +16 -0
- package/dist/templates/end-card.js +25 -0
- package/dist/templates/end-card.js.map +1 -0
- package/dist/templates/index.d.ts +171 -0
- package/dist/templates/index.js +394 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/lower-third.d.ts +18 -0
- package/dist/templates/lower-third.js +26 -0
- package/dist/templates/lower-third.js.map +1 -0
- package/dist/templates/notification.d.ts +30 -0
- package/dist/templates/notification.js +32 -0
- package/dist/templates/notification.js.map +1 -0
- package/dist/templates/phone-call.d.ts +27 -0
- package/dist/templates/phone-call.js +43 -0
- package/dist/templates/phone-call.js.map +1 -0
- package/dist/templates/progress.d.ts +22 -0
- package/dist/templates/progress.js +42 -0
- package/dist/templates/progress.js.map +1 -0
- package/dist/templates/quote.d.ts +21 -0
- package/dist/templates/quote.js +29 -0
- package/dist/templates/quote.js.map +1 -0
- package/dist/templates/rating.d.ts +22 -0
- package/dist/templates/rating.js +29 -0
- package/dist/templates/rating.js.map +1 -0
- package/dist/templates/size.d.ts +13 -0
- package/dist/templates/size.js +10 -0
- package/dist/templates/size.js.map +1 -0
- package/dist/templates/slot.d.ts +10 -0
- package/dist/templates/slot.js +5 -0
- package/dist/templates/slot.js.map +1 -0
- package/dist/templates/sounds.d.ts +701 -0
- package/dist/templates/sounds.js +89 -0
- package/dist/templates/sounds.js.map +1 -0
- package/dist/templates/stat.d.ts +20 -0
- package/dist/templates/stat.js +33 -0
- package/dist/templates/stat.js.map +1 -0
- package/dist/templates/tag.d.ts +23 -0
- package/dist/templates/tag.js +31 -0
- package/dist/templates/tag.js.map +1 -0
- package/dist/templates/theme.d.ts +29 -0
- package/dist/templates/theme.js +47 -0
- package/dist/templates/theme.js.map +1 -0
- package/dist/templates/title-card.d.ts +21 -0
- package/dist/templates/title-card.js +30 -0
- package/dist/templates/title-card.js.map +1 -0
- package/dist/tts-backend.d.ts +9 -0
- package/dist/tts-backend.js +21 -0
- package/dist/tts-backend.js.map +1 -1
- package/dist/ugc-call.d.ts +89 -0
- package/dist/ugc-call.js +111 -0
- package/dist/ugc-call.js.map +1 -0
- package/dist/ugc-framing.d.ts +26 -0
- package/dist/ugc-framing.js +64 -0
- package/dist/ugc-framing.js.map +1 -0
- package/dist/ugc-layers.d.ts +88 -0
- package/dist/ugc-layers.js +142 -0
- package/dist/ugc-layers.js.map +1 -0
- package/dist/ugc-video-media.d.ts +12 -0
- package/dist/ugc-video-media.js +39 -0
- package/dist/ugc-video-media.js.map +1 -0
- package/dist/vendor-response.d.ts +4 -0
- package/dist/vendor-response.js +12 -0
- package/dist/vendor-response.js.map +1 -1
- package/dist/voice-admission.d.ts +1244 -1
- package/dist/voice-listing.js +7 -1
- package/dist/voice-listing.js.map +1 -1
- package/dist/voice-pace.d.ts +34 -0
- package/dist/voice-pace.generated.json +72 -0
- package/dist/voice-pace.js +34 -0
- package/dist/voice-pace.js.map +1 -0
- package/dist/voices.d.ts +21 -8
- package/dist/voices.js +44 -19
- package/dist/voices.js.map +1 -1
- package/dist/workflows/catalog.js +2 -1
- package/dist/workflows/catalog.js.map +1 -1
- package/dist/workflows/index.d.ts +2 -0
- package/dist/workflows/index.js +2 -0
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/methods/faceless-explainer.d.ts +697 -3
- package/dist/workflows/methods/kinetic-launch.d.ts +697 -3
- package/dist/workflows/methods/product-image-story.d.ts +697 -3
- package/dist/workflows/methods/reference-remake.d.ts +870 -0
- package/dist/workflows/methods/reference-remake.js +26 -0
- package/dist/workflows/methods/reference-remake.js.map +1 -0
- package/dist/workflows/methods/shared.d.ts +697 -3
- package/dist/workflows/methods/ugc-faq-answer.d.ts +697 -3
- package/dist/workflows/methods/ugc-product-intro.d.ts +697 -3
- package/dist/workflows/methods/website-proof-demo.d.ts +697 -3
- package/dist/workflows/reference-remake.d.ts +663 -0
- package/dist/workflows/reference-remake.js +598 -0
- package/dist/workflows/reference-remake.js.map +1 -0
- package/dist/workflows/validate.js +19 -11
- package/dist/workflows/validate.js.map +1 -1
- package/package.json +9 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { faceZone, frameCanvasOf } from "../ugc-layers.js";
|
|
3
|
+
import { sizedScale, templateSize } from "./size.js";
|
|
4
|
+
import { templateMedia } from "./slot.js";
|
|
5
|
+
/** The phone's width at medium on a 1080 short side; it is twice as high. */
|
|
6
|
+
export const PHONE_CALL_WIDTH_PX = 360;
|
|
7
|
+
const data = z.object({ caller: z.string().min(1).max(24), subtitle: z.string().min(1).max(32).optional(), avatar: templateMedia.optional(),
|
|
8
|
+
answer_at: z.string().min(1).max(200), side: z.enum(["left", "right"]).optional(), size: templateSize,
|
|
9
|
+
// Version 2 (#857 S5, D8): the reference's in-call banner and a number shown only to its area code; absent draws as version 1.
|
|
10
|
+
banner: z.string().min(1).max(32).optional(), banner_note: z.string().min(1).max(48).optional(), mask_number: z.boolean().optional() }).strict();
|
|
11
|
+
/** An incoming call on a neutral phone at the side of the frame, ringing until it is answered on a word (reference seconds 26–43). */
|
|
12
|
+
export const phoneCall = {
|
|
13
|
+
kind: "phone_call",
|
|
14
|
+
kindVersion: 2,
|
|
15
|
+
description: "an incoming call on a neutral phone at the side (right unless side left): the caller, a subtitle and a round avatar ring, then " +
|
|
16
|
+
"the call is answered on answer_at and its timer runs (or a hold banner shows); beside the face in wide frames, under it in tall ones",
|
|
17
|
+
placements: ["over"],
|
|
18
|
+
data,
|
|
19
|
+
text: { caller: 24, subtitle: 32, banner: 32, banner_note: 48 },
|
|
20
|
+
quotes: ["answer_at"],
|
|
21
|
+
beatsFrom: 9,
|
|
22
|
+
slots: { avatar: { type: "image", cover: 1 } },
|
|
23
|
+
hidesCaptions: () => false,
|
|
24
|
+
onInserts: false,
|
|
25
|
+
rect: (value, aspectRatio, _placement, framing) => {
|
|
26
|
+
const canvas = frameCanvasOf(aspectRatio), { width: w, height: h } = canvas, margin = Math.round(0.04 * Math.min(w, h)), face = faceZone(aspectRatio, framing);
|
|
27
|
+
let width = Math.round(PHONE_CALL_WIDTH_PX * sizedScale(value.size, canvas)), top = Math.round((face.top + face.height + 0.01) * h);
|
|
28
|
+
// A frame at least as wide as high has room beside the face, from the top; a tall one under it, down the side.
|
|
29
|
+
if (w >= h) {
|
|
30
|
+
width = Math.min(width, Math.floor((w * (1 - face.left - face.width) - 2 * margin) / 2) * 2, Math.floor((h - 2 * margin) / 4) * 2);
|
|
31
|
+
top = margin;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// A wide presenter leaves less room under the face; the close one always fits.
|
|
35
|
+
width = Math.min(width, Math.floor((h - margin - top) / 4) * 2);
|
|
36
|
+
}
|
|
37
|
+
const left = value.side === "left" ? margin : w - margin - width;
|
|
38
|
+
return { left: left / w, top: top / h, width: width / w, height: (2 * width) / h };
|
|
39
|
+
},
|
|
40
|
+
sample: { caller: "+1 (305) 555-0147", subtitle: "Brightline Plumbing", answer_at: "answers", side: "right", banner: "Hold This Call?",
|
|
41
|
+
banner_note: "You'll be notified to pick up." },
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=phone-call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-call.js","sourceRoot":"","sources":["../../src/templates/phone-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,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C,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;QACjE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;IACrF,CAAC;IACD,MAAM,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB;QACpI,WAAW,EAAE,gCAAgC,EAAE;CAClD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { TemplateKind } from "./index.js";
|
|
3
|
+
/** A step's label at medium on a 1080 short side. */
|
|
4
|
+
export declare const PROGRESS_FONT_PX = 56;
|
|
5
|
+
/** Label sizes: a step's row, the card's padding above and below, and the card's width. */
|
|
6
|
+
export declare const PROGRESS_EMS: {
|
|
7
|
+
readonly row: 1.6;
|
|
8
|
+
readonly pad: 0.4;
|
|
9
|
+
readonly width: 12;
|
|
10
|
+
};
|
|
11
|
+
declare const data: z.ZodObject<{
|
|
12
|
+
steps: z.ZodArray<z.ZodString>;
|
|
13
|
+
advance_at: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
large: "large";
|
|
16
|
+
medium: "medium";
|
|
17
|
+
small: "small";
|
|
18
|
+
}>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
/** Steps in a column on a card, completing in turn: below the face in tall and square frames, beside it in wide ones. */
|
|
21
|
+
export declare const progress: TemplateKind<typeof data>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { faceZone, frameCanvasOf } from "../ugc-layers.js";
|
|
3
|
+
import { sizedScale, templateSize } from "./size.js";
|
|
4
|
+
/** A step's label at medium on a 1080 short side. */
|
|
5
|
+
export const PROGRESS_FONT_PX = 56;
|
|
6
|
+
/** Label sizes: a step's row, the card's padding above and below, and the card's width. */
|
|
7
|
+
export const PROGRESS_EMS = { row: 1.6, pad: 0.4, width: 12 };
|
|
8
|
+
const data = z.object({ steps: z.array(z.string().min(1).max(20)).min(2).max(5), advance_at: z.array(z.string().min(1).max(200)).min(2).max(5).optional(),
|
|
9
|
+
size: templateSize }).strict().superRefine((value, context) => {
|
|
10
|
+
if (value.advance_at && value.advance_at.length !== value.steps.length) {
|
|
11
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["advance_at"], message: `gives ${value.advance_at.length} quotes for ${value.steps.length} steps: one per step` });
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/** Steps in a column on a card, completing in turn: below the face in tall and square frames, beside it in wide ones. */
|
|
15
|
+
export const progress = {
|
|
16
|
+
kind: "progress",
|
|
17
|
+
kindVersion: 1,
|
|
18
|
+
description: "2–5 steps in a column on a card, each completing with a check in turn, on its advance_at quote (one per step, in order) or " +
|
|
19
|
+
"spread evenly; below the face",
|
|
20
|
+
placements: ["over"],
|
|
21
|
+
data,
|
|
22
|
+
text: { steps: 20 },
|
|
23
|
+
quotes: ["advance_at"],
|
|
24
|
+
beatsFrom: 9,
|
|
25
|
+
spreads: "steps",
|
|
26
|
+
slots: {},
|
|
27
|
+
hidesCaptions: () => false,
|
|
28
|
+
onInserts: false,
|
|
29
|
+
rect: (value, aspectRatio, _placement, framing) => {
|
|
30
|
+
const canvas = frameCanvasOf(aspectRatio), { width: w, height: h } = canvas, margin = Math.round(0.04 * Math.min(w, h)), face = faceZone(aspectRatio, framing);
|
|
31
|
+
const ems = value.steps.length * PROGRESS_EMS.row + 2 * PROGRESS_EMS.pad, below = Math.round((face.top + face.height + 0.01) * h);
|
|
32
|
+
const wide = w > h, room = wide ? h - 2 * margin : h - margin - below;
|
|
33
|
+
// The size scales the card, and a frame without room under the face shrinks it to fit.
|
|
34
|
+
const em = Math.min(PROGRESS_FONT_PX * sizedScale(value.size, canvas), room / ems), height = Math.round(ems * em);
|
|
35
|
+
const width = Math.round(Math.min(wide ? face.left * w - 2 * margin : 0.9 * w, PROGRESS_EMS.width * em));
|
|
36
|
+
const left = wide ? margin : Math.round((w - width) / 2);
|
|
37
|
+
const top = wide ? Math.round((h - height) / 2) : Math.min(h - margin - height, Math.max(below, Math.round(0.71 * h - height / 2)));
|
|
38
|
+
return { left: left / w, top: top / h, width: width / w, height: height / h };
|
|
39
|
+
},
|
|
40
|
+
sample: { steps: ["call answered", "slot found", "visit booked"], advance_at: ["answers", "finds", "books"] },
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/templates/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAErD,qDAAqD;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAW,CAAC;AACvE,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAA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AM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,YAAY,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;QACzG,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpI,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;IAChF,CAAC;IACD,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;CAC9G,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { TemplateKind } from "./index.js";
|
|
3
|
+
/** The quote's text at medium on a 1080 short side. */
|
|
4
|
+
export declare const QUOTE_FONT_PX = 72;
|
|
5
|
+
/** The drawn area is this many text sizes high: the marks, four lines and the author row. */
|
|
6
|
+
export declare const QUOTE_RECT_EMS = 8.5;
|
|
7
|
+
declare const data: z.ZodObject<{
|
|
8
|
+
text: z.ZodString;
|
|
9
|
+
author: z.ZodOptional<z.ZodString>;
|
|
10
|
+
photo: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
asset_id: z.ZodString;
|
|
12
|
+
}, z.core.$strict>>;
|
|
13
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
large: "large";
|
|
15
|
+
medium: "medium";
|
|
16
|
+
small: "small";
|
|
17
|
+
}>>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
/** A full-frame quote: marks, then the text in up to four lines, then the author with an optional round photo. */
|
|
20
|
+
export declare const quote: TemplateKind<typeof data>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { frameCanvasOf } from "../ugc-layers.js";
|
|
3
|
+
import { sizedScale, templateSize } from "./size.js";
|
|
4
|
+
import { templateMedia } from "./slot.js";
|
|
5
|
+
/** The quote's text at medium on a 1080 short side. */
|
|
6
|
+
export const QUOTE_FONT_PX = 72;
|
|
7
|
+
/** The drawn area is this many text sizes high: the marks, four lines and the author row. */
|
|
8
|
+
export const QUOTE_RECT_EMS = 8.5;
|
|
9
|
+
const data = z.object({ text: z.string().min(1).max(120), author: z.string().min(1).max(32).optional(), photo: templateMedia.optional(),
|
|
10
|
+
size: templateSize }).strict();
|
|
11
|
+
/** A full-frame quote: marks, then the text in up to four lines, then the author with an optional round photo. */
|
|
12
|
+
export const quote = {
|
|
13
|
+
kind: "quote",
|
|
14
|
+
kindVersion: 1,
|
|
15
|
+
description: "a full-frame quote: marks, the text in up to four lines, then the author with an optional round photo, cut to a circle",
|
|
16
|
+
placements: ["full"],
|
|
17
|
+
data,
|
|
18
|
+
text: { text: 120, author: 32 },
|
|
19
|
+
slots: { photo: { type: "image", cover: 1 } },
|
|
20
|
+
hidesCaptions: () => true,
|
|
21
|
+
onInserts: false,
|
|
22
|
+
rect: (value, aspectRatio) => {
|
|
23
|
+
const canvas = frameCanvasOf(aspectRatio), { width: w, height: h } = canvas, scale = sizedScale(value.size, canvas);
|
|
24
|
+
const width = Math.round(Math.min(0.9 * w, 1000 * scale)), height = Math.round(Math.min(0.92 * h, QUOTE_RECT_EMS * QUOTE_FONT_PX * scale));
|
|
25
|
+
return { left: Math.round((w - width) / 2) / w, top: Math.round((h - height) / 2) / h, width: width / w, height: height / h };
|
|
26
|
+
},
|
|
27
|
+
sample: { text: "It answered every call while I was with patients, and nobody could tell.", author: "Maya Chen" },
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../src/templates/quote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,EAAE;IACrI,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAEjC,kHAAkH;AAClH,MAAM,CAAC,MAAM,KAAK,GAA8B;IAC9C,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,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|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { TemplateKind } from "./index.js";
|
|
3
|
+
/** A star's size at medium on a 1080 short side. */
|
|
4
|
+
export declare const RATING_STAR_PX = 104;
|
|
5
|
+
/** Star sizes: the card's height with the row of stars, the label's band under it, and the card's width (five stars, four gaps, padding). */
|
|
6
|
+
export declare const RATING_EMS: {
|
|
7
|
+
readonly row: 1.44;
|
|
8
|
+
readonly label: 0.62;
|
|
9
|
+
readonly width: 6.32;
|
|
10
|
+
};
|
|
11
|
+
declare const data: z.ZodObject<{
|
|
12
|
+
stars: z.ZodNumber;
|
|
13
|
+
label: z.ZodOptional<z.ZodString>;
|
|
14
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
large: "large";
|
|
16
|
+
medium: "medium";
|
|
17
|
+
small: "small";
|
|
18
|
+
}>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
/** Five stars on a card filling in turn up to a score, with an optional label: at chest level, off the face. */
|
|
21
|
+
export declare const rating: TemplateKind<typeof data>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { frameCanvasOf } from "../ugc-layers.js";
|
|
3
|
+
import { sizedScale, templateSize } from "./size.js";
|
|
4
|
+
/** A star's size at medium on a 1080 short side. */
|
|
5
|
+
export const RATING_STAR_PX = 104;
|
|
6
|
+
/** Star sizes: the card's height with the row of stars, the label's band under it, and the card's width (five stars, four gaps, padding). */
|
|
7
|
+
export const RATING_EMS = { row: 1.44, label: 0.62, width: 6.32 };
|
|
8
|
+
const data = z.object({ stars: z.number().min(1).max(5).multipleOf(0.5), label: z.string().min(1).max(32).optional(), size: templateSize }).strict();
|
|
9
|
+
/** Five stars on a card filling in turn up to a score, with an optional label: at chest level, off the face. */
|
|
10
|
+
export const rating = {
|
|
11
|
+
kind: "rating",
|
|
12
|
+
kindVersion: 1,
|
|
13
|
+
description: "five stars on a card filling in turn up to stars (1–5 in halves, a half star half filled), an optional label under them; " +
|
|
14
|
+
"at chest level",
|
|
15
|
+
placements: ["over"],
|
|
16
|
+
data,
|
|
17
|
+
text: { label: 32 },
|
|
18
|
+
slots: {},
|
|
19
|
+
hidesCaptions: () => false,
|
|
20
|
+
onInserts: false,
|
|
21
|
+
rect: (value, aspectRatio) => {
|
|
22
|
+
const canvas = frameCanvasOf(aspectRatio), { width: w, height: h } = canvas, star = RATING_STAR_PX * sizedScale(value.size, canvas);
|
|
23
|
+
const width = Math.round(Math.min(0.9 * w, RATING_EMS.width * star)), height = Math.round((RATING_EMS.row + (value.label ? RATING_EMS.label : 0)) * star);
|
|
24
|
+
// At chest level, as the stat over the presenter, off the face (62–80% of the height).
|
|
25
|
+
return { left: Math.round((w - width) / 2) / w, top: Math.round(0.71 * h - height / 2) / h, width: width / w, height: height / h };
|
|
26
|
+
},
|
|
27
|
+
sample: { stars: 4.5, label: "rated by 312 patients" },
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=rating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rating.js","sourceRoot":"","sources":["../../src/templates/rating.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAErD,oDAAoD;AACpD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,6IAA6I;AAC7I,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAW,CAAC;AAC3E,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,C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AC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;IACrI,CAAC;IACD,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,uBAAuB,EAAE;CACvD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** How large a kind draws; absent is medium, the reference scale (#778 S3, owner 2026-10-22). No default in the schema (A8). */
|
|
3
|
+
export declare const TEMPLATE_SIZES: readonly ["small", "medium", "large"];
|
|
4
|
+
export declare const templateSize: z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
large: "large";
|
|
6
|
+
medium: "medium";
|
|
7
|
+
small: "small";
|
|
8
|
+
}>>;
|
|
9
|
+
/** Pixels per pixel at a 1080 short side, times the size's scale. */
|
|
10
|
+
export declare function sizedScale(size: (typeof TEMPLATE_SIZES)[number] | undefined, canvas: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** How large a kind draws; absent is medium, the reference scale (#778 S3, owner 2026-10-22). No default in the schema (A8). */
|
|
3
|
+
export const TEMPLATE_SIZES = ["small", "medium", "large"];
|
|
4
|
+
export const templateSize = z.enum(TEMPLATE_SIZES).optional();
|
|
5
|
+
const SCALE = { small: 0.75, medium: 1, large: 1.3 };
|
|
6
|
+
/** Pixels per pixel at a 1080 short side, times the size's scale. */
|
|
7
|
+
export function sizedScale(size, canvas) {
|
|
8
|
+
return (Math.min(canvas.width, canvas.height) / 1080) * SCALE[size ?? "medium"];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.js","sourceRoot":"","sources":["../../src/templates/size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gIAAgI;AAChI,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9D,MAAM,KAAK,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAW,CAAC;AAE9D,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,IAAiD,EAAE,MAAyC;IACrH,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A template's media slot: a ready asset of the account, pinned at admission by (template id, slot) (#778 S3a(ii), A1). */
|
|
3
|
+
export declare const templateMedia: z.ZodObject<{
|
|
4
|
+
asset_id: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
/** What a slot takes; `cover` is the shape it fills, width over height, so a picture of another shape is cut and named. */
|
|
7
|
+
export interface TemplateSlot {
|
|
8
|
+
type: "image" | "video";
|
|
9
|
+
cover?: number | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { assetId } from "../asset-identity.js";
|
|
3
|
+
/** A template's media slot: a ready asset of the account, pinned at admission by (template id, slot) (#778 S3a(ii), A1). */
|
|
4
|
+
export const templateMedia = z.object({ asset_id: assetId.describe("A ready asset from list_assets, of the kind the slot takes.") }).strict();
|
|
5
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/templates/slot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,4HAA4H;AAC5H,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,6DAA6D,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC"}
|