@frank/ad-template (0.1.0)
Published 2026-09-26 16:06:46 +10:00 by steve
Installation
@frank:registry=npm install @frank/ad-template@0.1.0"@frank/ad-template": "0.1.0"About this package
@frank/ad-template
The sole shared layered ad-template contract, ported unchanged from
packages/ad-template-contract in the Blockwise repo. It defines the
AdTemplate and AdDocument shapes, the Zod schemas that validate them at
trust boundaries, and the render-primitive constants (placements, semantic
colour roles, icon names, minimum text sizes) that renderers and editors must
agree on. The schema string literals (blockwise.ad-template,
blockwise.ad-document) are wire-format identifiers and stay as they are.
Public API (src/index.ts)
- Types:
AdTemplate,AdDocument,Layout,LayoutLayer,Rect,Placement,ColourRole,SupportedIconName,NativeEditorDocument, and the metadata/publish-requirement types. - Schemas:
adTemplateSchema,adDocumentSchema,nativeEditorDocumentSchema,nativeFabricSceneSchema. - Constants:
COLOUR_ROLES,LAYER_TYPES,SUPPORTED_ICON_NAMES,PLACEMENTS,PLACEMENT_DIMENSIONS,MINIMUM_TEXT_SIZE_PX,MINIMUM_MULTILINE_LINE_HEIGHT,MINIMUM_VECTOR_LINE_LENGTH_PX.
Config
None. The package reads no environment and touches no network or database.
Usage
import { adTemplateSchema, type AdTemplate } from "@frank/ad-template";
const parsed = adTemplateSchema.safeParse(JSON.parse(artifactJson));
if (!parsed.success) throw new Error("invalid template artifact");
const template: AdTemplate = parsed.data;
Consumers: @frank/ad-template-renderer and, after slice 3 cutover, the
Blockwise app.
Dependencies
Dependencies
| ID | Version |
|---|---|
| zod | ^3.24.0 |
Development dependencies
| ID | Version |
|---|---|
| @types/node | ^22.0.0 |
Details
2026-09-26 16:06:46 +10:00
Assets (1)
Versions (2)
View all
npm
75
24 KiB
ad-template-0.1.0.tgz
24 KiB