@popcraft/kit 0.1.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 +16 -0
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/index.js +160558 -0
- package/package.json +40 -0
- package/types/design-script.d.ts +39 -0
- package/types/lib/agent/design-script/build.d.ts +35 -0
- package/types/lib/agent/design-script/check.d.ts +11 -0
- package/types/lib/agent/design-script/helper-names.d.ts +1 -0
- package/types/lib/agent/design-script/kit-modules.d.ts +43 -0
- package/types/lib/agent/design-script/recorder.d.ts +52 -0
- package/types/lib/agent/design-script/replay.d.ts +13 -0
- package/types/lib/agent/design-script/run-node.d.ts +2 -0
- package/types/lib/ai/audio-models.d.ts +66 -0
- package/types/lib/ai/content.d.ts +27 -0
- package/types/lib/ai/limits.d.ts +42 -0
- package/types/lib/audio/presentation/loudness.d.ts +80 -0
- package/types/lib/audio/presentation/types.d.ts +112 -0
- package/types/lib/brand/apply.d.ts +25 -0
- package/types/lib/brand/review-kits.d.ts +10 -0
- package/types/lib/brand/types.d.ts +20 -0
- package/types/lib/code/hash.d.ts +2 -0
- package/types/lib/document/auto-layout.d.ts +10 -0
- package/types/lib/document/breakpoints.d.ts +45 -0
- package/types/lib/document/clone.d.ts +6 -0
- package/types/lib/document/color.d.ts +52 -0
- package/types/lib/document/detach.d.ts +12 -0
- package/types/lib/document/effects.d.ts +60 -0
- package/types/lib/document/expressions.d.ts +78 -0
- package/types/lib/document/instance-layout.d.ts +94 -0
- package/types/lib/document/instances.d.ts +63 -0
- package/types/lib/document/libraries.d.ts +97 -0
- package/types/lib/document/node-delta.d.ts +21 -0
- package/types/lib/document/page-tokens.d.ts +16 -0
- package/types/lib/document/photo-frames.d.ts +14 -0
- package/types/lib/document/print-pages.d.ts +85 -0
- package/types/lib/document/scene-graph.d.ts +194 -0
- package/types/lib/document/scene3d.d.ts +76 -0
- package/types/lib/document/shader-graph-effects.d.ts +8 -0
- package/types/lib/document/shader-graph.d.ts +134 -0
- package/types/lib/document/shader-params.d.ts +65 -0
- package/types/lib/document/shape-to-path.d.ts +20 -0
- package/types/lib/document/text-styles.d.ts +28 -0
- package/types/lib/document/text-tokens.d.ts +6 -0
- package/types/lib/document/transform.d.ts +79 -0
- package/types/lib/document/transform3d.d.ts +99 -0
- package/types/lib/document/trim.d.ts +35 -0
- package/types/lib/document/types.d.ts +2560 -0
- package/types/lib/document/variables.d.ts +14 -0
- package/types/lib/editor/easing.d.ts +46 -0
- package/types/lib/editor/modes/types.d.ts +131 -0
- package/types/lib/editor/prototype-connect.d.ts +49 -0
- package/types/lib/editor/smart-animate.d.ts +37 -0
- package/types/lib/engine/geometry/flatten.d.ts +2 -0
- package/types/lib/engine/geometry/shape-outline.d.ts +24 -0
- package/types/lib/engine/pixel/cells.d.ts +12 -0
- package/types/lib/engine/pixel/palettes.d.ts +25 -0
- package/types/lib/engine/readiness.d.ts +20 -0
- package/types/lib/engine/routing.d.ts +41 -0
- package/types/lib/engine/shader-graph-presets.d.ts +22 -0
- package/types/lib/engine/shader-presets-legacy.d.ts +7 -0
- package/types/lib/engine/shader-presets.d.ts +43 -0
- package/types/lib/engine/text/atlas.d.ts +120 -0
- package/types/lib/engine/text/emoji/segment.d.ts +15 -0
- package/types/lib/engine/text/fallback-fonts.d.ts +47 -0
- package/types/lib/engine/text/fontkit-lazy.d.ts +8 -0
- package/types/lib/engine/text/fonts.d.ts +33 -0
- package/types/lib/engine/text/glyph-linear.d.ts +22 -0
- package/types/lib/engine/text/google-fonts.d.ts +17 -0
- package/types/lib/engine/text/hyphenate/en-us.d.ts +6 -0
- package/types/lib/engine/text/hyphenate/liang.d.ts +21 -0
- package/types/lib/engine/text/layout-access.d.ts +16 -0
- package/types/lib/engine/text/layout.d.ts +168 -0
- package/types/lib/engine/text/lists.d.ts +16 -0
- package/types/lib/engine/text/measure.d.ts +58 -0
- package/types/lib/engine/text/outline-sdf.d.ts +34 -0
- package/types/lib/engine/text/shaper.d.ts +88 -0
- package/types/lib/engine/text/text-area.d.ts +16 -0
- package/types/lib/engine/text/text-fit.d.ts +51 -0
- package/types/lib/engine/text/text-path.d.ts +134 -0
- package/types/lib/engine/text/text-rings.d.ts +17 -0
- package/types/lib/engine/text/wrap-obstacles.d.ts +20 -0
- package/types/lib/i18n/catalogs.d.ts +10 -0
- package/types/lib/i18n/format.d.ts +27 -0
- package/types/lib/i18n/locales.d.ts +25 -0
- package/types/lib/i18n/pseudo.d.ts +10 -0
- package/types/lib/i18n/runtime.d.ts +27 -0
- package/types/lib/io/codecs/wav.d.ts +7 -0
- package/types/lib/io/codecs/webp.d.ts +7 -0
- package/types/lib/io/export-ir/children.d.ts +2 -0
- package/types/lib/io/json-export.d.ts +11 -0
- package/types/lib/media-library/types.d.ts +39 -0
- package/types/lib/motion/audio-analysis.d.ts +44 -0
- package/types/lib/motion/audio-clips.d.ts +92 -0
- package/types/lib/motion/audio-onsets.d.ts +13 -0
- package/types/lib/motion/audio-signals.d.ts +59 -0
- package/types/lib/motion/author.d.ts +80 -0
- package/types/lib/motion/composition.d.ts +99 -0
- package/types/lib/motion/instances.d.ts +95 -0
- package/types/lib/motion/key-selection.d.ts +100 -0
- package/types/lib/motion/keys.d.ts +41 -0
- package/types/lib/motion/layer-time-edit.d.ts +40 -0
- package/types/lib/motion/markers.d.ts +31 -0
- package/types/lib/motion/modifier-edit.d.ts +84 -0
- package/types/lib/motion/modifiers.d.ts +44 -0
- package/types/lib/motion/morph.d.ts +14 -0
- package/types/lib/motion/pose-layout.d.ts +6 -0
- package/types/lib/motion/pose.d.ts +115 -0
- package/types/lib/motion/presets.d.ts +148 -0
- package/types/lib/motion/properties.d.ts +74 -0
- package/types/lib/motion/sample-keys.d.ts +8 -0
- package/types/lib/motion/sample.d.ts +51 -0
- package/types/lib/motion/sound.d.ts +25 -0
- package/types/lib/motion/spatial-curve.d.ts +15 -0
- package/types/lib/motion/spatial.d.ts +38 -0
- package/types/lib/motion/text-animators.d.ts +79 -0
- package/types/lib/motion/text-units.d.ts +47 -0
- package/types/lib/motion/time.d.ts +58 -0
- package/types/lib/motion/transitions.d.ts +99 -0
- package/types/lib/motion/values.d.ts +12 -0
- package/types/lib/motion/video-clip.d.ts +63 -0
- package/types/lib/presets/page-presets.d.ts +50 -0
- package/types/lib/storage/media-hash.d.ts +4 -0
- package/types/lib/storage/media-refs.d.ts +2 -0
- package/types/lib/storage/media-store.d.ts +70 -0
- package/types/lib/templates/apply.d.ts +38 -0
- package/types/lib/templates/capture.d.ts +25 -0
- package/types/lib/templates/groups.d.ts +82 -0
- package/types/lib/templates/layout.d.ts +20 -0
- package/types/lib/templates/quality.d.ts +59 -0
- package/types/lib/templates/resize.d.ts +34 -0
- package/types/lib/templates/safe-areas.d.ts +42 -0
- package/types/lib/templates/text-measurer.d.ts +10 -0
- package/types/lib/templates/thumbnail.d.ts +134 -0
- package/types/lib/templates/types.d.ts +95 -0
- package/types/lib/templates/vocabulary.d.ts +50 -0
- package/types/lib/units/units.d.ts +23 -0
- package/types/packages/kit/src/index.d.ts +59 -0
- package/types/packages/runtime/src/expressions.d.ts +41 -0
- package/types/templates/src/app/shared.d.ts +29 -0
- package/types/templates/src/audio/beat-loop.d.ts +9 -0
- package/types/templates/src/audio/media.d.ts +42 -0
- package/types/templates/src/audio/music-synth.d.ts +57 -0
- package/types/templates/src/audio/music-worlds.d.ts +8 -0
- package/types/templates/src/audio/music.d.ts +19 -0
- package/types/templates/src/audio/studio/deck.d.ts +340 -0
- package/types/templates/src/audio/studio/dsp.d.ts +151 -0
- package/types/templates/src/audio/studio/fx.d.ts +96 -0
- package/types/templates/src/audio/studio/mix.d.ts +84 -0
- package/types/templates/src/audio/studio/voices.d.ts +120 -0
- package/types/templates/src/data/geometry.d.ts +16 -0
- package/types/templates/src/effects/shared.d.ts +17 -0
- package/types/templates/src/kit.d.ts +582 -0
- package/types/templates/src/motion3d/devices.d.ts +42 -0
- package/types/templates/src/motion3d/ui.d.ts +48 -0
- package/types/templates/src/saas/video-shared.d.ts +114 -0
- package/types/templates/src/saas/web-shared.d.ts +74 -0
- package/types/templates/src/shared/beat.d.ts +24 -0
- package/types/templates/src/shared/captions.d.ts +24 -0
- package/types/templates/src/shared/devices.d.ts +188 -0
- package/types/templates/src/shared/draw.d.ts +43 -0
- package/types/templates/src/shared/fit.d.ts +73 -0
- package/types/templates/src/shared/marks.d.ts +51 -0
- package/types/templates/src/shared/motion.d.ts +15 -0
- package/types/templates/src/shared/overlays.d.ts +80 -0
- package/types/templates/src/shared/pointer.d.ts +46 -0
- package/types/templates/src/shared/texture.d.ts +41 -0
- package/types/templates/src/shared/type.d.ts +6 -0
- package/types/templates/src/shared/window.d.ts +50 -0
- package/types/templates/src/social/shared.d.ts +66 -0
- package/types/templates/src/web/shared.d.ts +64 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { VectorPath } from '../../../lib/document/types.js';
|
|
2
|
+
import type { AbsoluteAt, Kit } from '../kit.js';
|
|
3
|
+
/** The dark half of every 6 px, over a `w` × `h` box. */
|
|
4
|
+
export declare const scanPaths: (w: number, h: number) => VectorPath[];
|
|
5
|
+
/** A CRT's scanlines over the whole of `parent` (add it last, so it lies over everything): dark lines, every 6 px. */
|
|
6
|
+
export declare function scanlines(k: Kit, parent: string, o?: {
|
|
7
|
+
opacity?: number;
|
|
8
|
+
}): string;
|
|
9
|
+
/** The scanlines of a resized copy, drawn again at its parent's size. */
|
|
10
|
+
export declare function fitScanlines(k: Kit, sheetId: string): void;
|
|
11
|
+
/** How far the rain's pattern runs before it repeats (px): a layer `period` taller than its box wraps unseen. */
|
|
12
|
+
export declare const RAIN_PERIOD = 240;
|
|
13
|
+
/** The streaks of rain over a `w` × `h` box: `count` drops `len` px long (give or take), repeated every period down it. */
|
|
14
|
+
export declare function rainPaths(w: number, h: number, seed: number, count: number, len: number, slant: number): VectorPath[];
|
|
15
|
+
/**
|
|
16
|
+
* Rain over `w` × `h` at the top left of `parent` (which should clip): slanted streaks in `color` that fall `rate` px
|
|
17
|
+
* a second and wrap every 240 px, so they never run out. `rate` × a loop's seconds should be a whole number of 240s
|
|
18
|
+
* for a loop to be seamless.
|
|
19
|
+
*/
|
|
20
|
+
export declare function rain(k: Kit, parent: string, w: number, h: number, o: {
|
|
21
|
+
color: string;
|
|
22
|
+
opacity: number;
|
|
23
|
+
rate: number;
|
|
24
|
+
seed: number;
|
|
25
|
+
count: number;
|
|
26
|
+
len?: number;
|
|
27
|
+
width?: number;
|
|
28
|
+
name?: string;
|
|
29
|
+
}): string;
|
|
30
|
+
/** The rain of a resized copy (layers named `name`), falling again over the whole of its parent. */
|
|
31
|
+
export declare function fitRain(k: Kit, sheetId: string, o: {
|
|
32
|
+
name: string;
|
|
33
|
+
seed: number;
|
|
34
|
+
count: number;
|
|
35
|
+
len?: number;
|
|
36
|
+
}): void;
|
|
37
|
+
/** Snow falling over a sheet `w` × `h` drawn at the size `u`: `n` flakes at one depth. */
|
|
38
|
+
export interface SnowSpec {
|
|
39
|
+
w: number;
|
|
40
|
+
h: number;
|
|
41
|
+
n: number;
|
|
42
|
+
u: number;
|
|
43
|
+
/** 'far': small, faint, slow flakes (behind the subject). 'near': big, soft, fast ones (in front of it). */
|
|
44
|
+
depth: 'far' | 'near';
|
|
45
|
+
/** Given, every flake falls a whole number of sheets over this loop (ms), swaying as it goes. */
|
|
46
|
+
loopMs?: number;
|
|
47
|
+
seed?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Snow over a `w` × `h` sheet at one depth, in a layer named "Snow far" or "Snow near". Each flake falls at its own
|
|
51
|
+
* speed and comes round again from the top, swaying; over `loopMs` it falls a whole number of sheets, so a loop ends
|
|
52
|
+
* where it began. With no `loopMs` it hangs in the air (a still).
|
|
53
|
+
*/
|
|
54
|
+
export declare function snow(k: Kit, parent: string, o: SnowSpec): string;
|
|
55
|
+
/** The snow under `root` put back where `o` (the master's own description) hung it: a shorter sheet simply sees less of it. */
|
|
56
|
+
export declare function fitSnow(k: Kit, root: string, o: SnowSpec): void;
|
|
57
|
+
/** Print `id` over what is under it, as a second pass of ink does: the two multiply where they cross. */
|
|
58
|
+
export declare function overprint(k: Kit, id: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* A halftone screen in one ink: a disc (or, `square`, a `size` × `height` block) of `role` broken into dots that
|
|
61
|
+
* swell along `angle`. The dots take the layer's own bound fill, so a kit's colour reaches them, and the gaps are
|
|
62
|
+
* bare paper. The screen is a rectangle in a frame named `name`, cut to a disc by a mask (so the dots are whole up
|
|
63
|
+
* to the cut, as a screened photograph's are); the rectangle is `<name> screen` and its effect `e1`: `effects[@e1].dotSize` is what
|
|
64
|
+
* a swell keys. `from` and `to` are the lightest and heaviest tone (0…1).
|
|
65
|
+
*/
|
|
66
|
+
export declare function dots(k: Kit, parent: string, o: {
|
|
67
|
+
size: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
role?: string;
|
|
70
|
+
dot?: number;
|
|
71
|
+
screen?: number;
|
|
72
|
+
angle?: number;
|
|
73
|
+
from?: number;
|
|
74
|
+
to?: number;
|
|
75
|
+
square?: boolean;
|
|
76
|
+
line?: boolean;
|
|
77
|
+
name?: string;
|
|
78
|
+
absolute?: AbsoluteAt;
|
|
79
|
+
over?: boolean;
|
|
80
|
+
}): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Kit } from '../kit.js';
|
|
2
|
+
/**
|
|
3
|
+
* A drawn pointer, enlarged so it reads on a phone, with its tip at (`x`, `y`) of `parent`, and the ring that
|
|
4
|
+
* spreads from the tip when it clicks (resting hidden). Returns both; `clicks` plays a click.
|
|
5
|
+
*/
|
|
6
|
+
export declare function pointer(k: Kit, parent: string, o: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
size?: number;
|
|
10
|
+
fill: string;
|
|
11
|
+
edge: string;
|
|
12
|
+
ring: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
}): {
|
|
15
|
+
arrow: string;
|
|
16
|
+
ring: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A touch indicator, as a screen recording shows one: a translucent dot `size` px across centred on (`x`, `y`) of
|
|
20
|
+
* `parent`, and the ring that spreads from it at a tap (resting hidden). `glide` and `clicks` move and tap
|
|
21
|
+
* it: pass the pair as their pointer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function touch(k: Kit, parent: string, o: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
size?: number;
|
|
27
|
+
fill: string;
|
|
28
|
+
ring: string;
|
|
29
|
+
}): {
|
|
30
|
+
arrow: string;
|
|
31
|
+
ring: string;
|
|
32
|
+
};
|
|
33
|
+
/** Glide the pointer through `stops` (offsets from where it rests, sheet ms of arrival); it leaves each on a smooth curve. */
|
|
34
|
+
export declare function glide(k: Kit, p: {
|
|
35
|
+
arrow: string;
|
|
36
|
+
ring: string;
|
|
37
|
+
}, stops: readonly {
|
|
38
|
+
t: number;
|
|
39
|
+
dx: number;
|
|
40
|
+
dy: number;
|
|
41
|
+
}[]): void;
|
|
42
|
+
/** The pointer clicks at each of `times`: it dips, and its ring spreads and fades. */
|
|
43
|
+
export declare function clicks(k: Kit, p: {
|
|
44
|
+
arrow: string;
|
|
45
|
+
ring: string;
|
|
46
|
+
}, times: readonly number[]): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Effect } from '../../../lib/document/types.js';
|
|
2
|
+
import type { Kit } from '../kit.js';
|
|
3
|
+
/** Monochrome noise over whatever it is put on. An `id` lets a timeline key the effect by name. */
|
|
4
|
+
export declare const noise: (o: {
|
|
5
|
+
amount: number;
|
|
6
|
+
size: number;
|
|
7
|
+
seed: number;
|
|
8
|
+
density?: number;
|
|
9
|
+
id?: string;
|
|
10
|
+
}) => Effect;
|
|
11
|
+
/** Fine monochrome grain over a ground. */
|
|
12
|
+
export declare const grain: (amount?: number, size?: number, seed?: number) => Effect[];
|
|
13
|
+
/** A soft shadow under a card, in a role's colour. */
|
|
14
|
+
export declare const shadow: (k: Kit, role: string, a?: number, y?: number, blur?: number) => Effect;
|
|
15
|
+
/** A soft shadow in black at `a`, for a surface no role describes (a card on a photograph, an email). */
|
|
16
|
+
export declare const blackShadow: (a: number, y: number, blur: number) => Effect;
|
|
17
|
+
/** A hard offset shadow with no blur (the neo-brutalist block, a pixel shadow), in a role's colour. */
|
|
18
|
+
export declare const hardShadow: (k: Kit, role: string, x: number, y?: number, a?: number) => Effect;
|
|
19
|
+
/** Light of a role's colour spilling round a layer (a blurred shadow with no offset; an effect's colour is a literal). */
|
|
20
|
+
export declare const bloom: (k: Kit, role: string, blur?: number, a?: number) => Effect;
|
|
21
|
+
/** The same light as a layer's whole effect list: colour bleeding from glass or flame. */
|
|
22
|
+
export declare const bleed: (k: Kit, role: string, blur: number, alpha?: number) => Effect[];
|
|
23
|
+
/** Light round a layer whose reach is worked out (held to a thousandth), and can spread before it fades. */
|
|
24
|
+
export declare const halo: (k: Kit, role: string, a: number, blur: number, spread?: number) => Effect;
|
|
25
|
+
/** A radial gradient's handles: from the middle of the box out to its edges. */
|
|
26
|
+
export declare const RADIAL: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}[];
|
|
30
|
+
/** A soft round glow of `role`, centred on (`x`, `y`): a radial wash that fades to nothing (its stops are literals). */
|
|
31
|
+
export declare function glow(k: Kit, parent: string, o: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
w: number;
|
|
35
|
+
h?: number;
|
|
36
|
+
role: string;
|
|
37
|
+
alpha: number;
|
|
38
|
+
name?: string;
|
|
39
|
+
}): string;
|
|
40
|
+
/** A layer out of focus by `radius` px. */
|
|
41
|
+
export declare const blurred: (radius: number) => Effect;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Effect } from '../../../lib/document/types.js';
|
|
2
|
+
import type { BrandStroke, Kit } from '../kit.js';
|
|
3
|
+
export interface WindowLook {
|
|
4
|
+
/** The window's ground, and the role its title bar is filled with. */
|
|
5
|
+
fill: string;
|
|
6
|
+
bar: string;
|
|
7
|
+
/** The title's text style and ink, and the colour of the three window dots. */
|
|
8
|
+
titleStyle: string;
|
|
9
|
+
titleInk: string;
|
|
10
|
+
dots: string | readonly [string, string, string];
|
|
11
|
+
radius?: number;
|
|
12
|
+
barHeight?: number;
|
|
13
|
+
stroke?: BrandStroke;
|
|
14
|
+
effects?: Effect[];
|
|
15
|
+
/** A rule under the title bar, in this role. */
|
|
16
|
+
rule?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A product window: a card with a title bar (three dots and the window's title) and a body `height − bar` tall for
|
|
20
|
+
* the screen. Returns the window and its body; the body clips, so a screen can be larger than it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function productWindow(k: Kit, parent: string, o: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
title: string;
|
|
26
|
+
look: WindowLook;
|
|
27
|
+
name?: string;
|
|
28
|
+
absolute?: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
}): {
|
|
33
|
+
win: string;
|
|
34
|
+
body: string;
|
|
35
|
+
bodyHeight: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The picture slot under a window's drawn screen: a photo frame the size of the body. Drop a screenshot on it and
|
|
39
|
+
* hide the drawn placeholder (`Placeholder screen`) above it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function screenshotSlot(k: Kit, body: string, width: number, height: number, ground: string): string;
|
|
42
|
+
/** A window's title bar: three lights and a title, on `fill`. Returns the bar. */
|
|
43
|
+
export declare function chrome(k: Kit, parent: string, o: {
|
|
44
|
+
title: string;
|
|
45
|
+
style: string;
|
|
46
|
+
fill: string;
|
|
47
|
+
ink: string;
|
|
48
|
+
light: string;
|
|
49
|
+
pad?: number;
|
|
50
|
+
}): string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Kit, Cue, VariantSpec } from '../kit.js';
|
|
2
|
+
import { type Inset } from '../../../lib/templates/safe-areas.js';
|
|
3
|
+
/** A 1080×1920 sheet's padding: clear of every vertical app's header, caption strip and action rail. */
|
|
4
|
+
export declare const verticalPadding: (atLeast?: number) => Inset;
|
|
5
|
+
/** Per-size overrides after the resize: `post` is 1080², `portrait` 1080×1350, `vertical` 1080×1920. */
|
|
6
|
+
export interface SizeTweaks {
|
|
7
|
+
post?: (k: Kit, sheetId: string) => void;
|
|
8
|
+
portrait?: (k: Kit, sheetId: string) => void;
|
|
9
|
+
vertical?: (k: Kit, sheetId: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/** The sizes a 9:16 master (a Reels / TikTok / Shorts promo) is also posted at: square and 4:5 feed posts. */
|
|
12
|
+
export declare function feedVariants(pad: {
|
|
13
|
+
post: number;
|
|
14
|
+
portrait: number;
|
|
15
|
+
}, tweak?: SizeTweaks): VariantSpec[];
|
|
16
|
+
/** The sizes a square master (an animated feed post) is also posted at: 4:5, and 9:16 inside the safe area. */
|
|
17
|
+
export declare function postVariants(pad: {
|
|
18
|
+
portrait: number;
|
|
19
|
+
vertical?: number;
|
|
20
|
+
}, tweak?: SizeTweaks): VariantSpec[];
|
|
21
|
+
/**
|
|
22
|
+
* The looping outro: every layer in `layers` leaves with `preset`, last-listed first, `gap` ms apart, so the
|
|
23
|
+
* clip ends on the empty ground it started on and a feed's replay is seamless.
|
|
24
|
+
*/
|
|
25
|
+
export declare function outro(layers: readonly string[], at: number, o?: {
|
|
26
|
+
preset?: Cue['preset'];
|
|
27
|
+
gap?: number;
|
|
28
|
+
duration?: number;
|
|
29
|
+
}): Cue;
|
|
30
|
+
/** How long a display ad's loop runs: within what display networks take for an HTML5 or GIF ad. */
|
|
31
|
+
export declare const AD_LOOP_MS = 6000;
|
|
32
|
+
/**
|
|
33
|
+
* A display ad's loop, on the copy plate's layers by name: the plate fades up, its tag slides in, the name blurs in,
|
|
34
|
+
* the lines rise one by one, the button pops in, all within two seconds; it holds for three with the button nudging
|
|
35
|
+
* twice, then everything clears and comes round. `extra` layers (a sticker) pop in beside the button.
|
|
36
|
+
*/
|
|
37
|
+
export declare function displayAdLoop(o: {
|
|
38
|
+
plate: string;
|
|
39
|
+
tag: readonly string[];
|
|
40
|
+
name: string;
|
|
41
|
+
lines: readonly string[];
|
|
42
|
+
button: readonly string[];
|
|
43
|
+
extra?: readonly string[];
|
|
44
|
+
}): Cue[];
|
|
45
|
+
/**
|
|
46
|
+
* A one-label pill component — a tag, a chip, a button: auto layout that hugs its label, filled with a brand
|
|
47
|
+
* colour and set in that colour's on-colour, so a kit that changes the fill keeps the label readable.
|
|
48
|
+
*/
|
|
49
|
+
export declare function pill(k: Kit, name: string, o: {
|
|
50
|
+
fill: string;
|
|
51
|
+
ink: string;
|
|
52
|
+
style: string;
|
|
53
|
+
label: string;
|
|
54
|
+
pad?: [number, number];
|
|
55
|
+
radius?: number;
|
|
56
|
+
}): void;
|
|
57
|
+
/** The brand logo on a tile of a brand colour (the placeholder mark is white, for a coloured ground). */
|
|
58
|
+
export declare function logoBadge(k: Kit, parent: string, o: {
|
|
59
|
+
fill: string;
|
|
60
|
+
size: number;
|
|
61
|
+
pad?: number;
|
|
62
|
+
radius?: number;
|
|
63
|
+
name?: string;
|
|
64
|
+
}): string;
|
|
65
|
+
/** A photo frame (mask group) at another size: the group, its mask and the placeholder picture together. */
|
|
66
|
+
export declare function resizePhoto(k: Kit, groupId: string, width: number, height: number): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Kit, VariantSpec } from '../kit.js';
|
|
2
|
+
export type Breakpoint = 'desktop' | 'laptop' | 'tablet' | 'mobile';
|
|
3
|
+
/** Side padding and the viewport height each breakpoint's page is at least as tall as. */
|
|
4
|
+
export declare const BREAKPOINTS: Record<Breakpoint, {
|
|
5
|
+
preset: string;
|
|
6
|
+
side: number;
|
|
7
|
+
viewport: number;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* How a page reflows below the desktop: `stack` rows (by layer name) turn into columns at the tablet and below,
|
|
11
|
+
* `stackMobile` only on the phone, `restyle` steps a text style down
|
|
12
|
+
* (every text set in it), `hide` folds layers away (a nav's links on the phone), and `tweaks` (one function per size)
|
|
13
|
+
* or `tweak` make any other change by hand. In a design script use `tweaks`: a script's function is recorded once,
|
|
14
|
+
* before the kit runs, so `tweak`'s `size` is not a word it can test.
|
|
15
|
+
*/
|
|
16
|
+
export interface Responsive {
|
|
17
|
+
stack?: readonly string[];
|
|
18
|
+
stackMobile?: readonly string[];
|
|
19
|
+
restyle?: Record<string, Partial<Record<Breakpoint, string>>>;
|
|
20
|
+
hide?: Partial<Record<Breakpoint, readonly string[]>>;
|
|
21
|
+
/** Vertical padding of the page at each size (the side padding is the breakpoint's). */
|
|
22
|
+
top?: Partial<Record<Breakpoint, number>>;
|
|
23
|
+
gap?: Partial<Record<Breakpoint, number>>;
|
|
24
|
+
tweak?: (k: Kit, sheetId: string, size: Breakpoint) => void;
|
|
25
|
+
tweaks?: Partial<Record<Breakpoint, (k: Kit, sheetId: string) => void>>;
|
|
26
|
+
}
|
|
27
|
+
/** Apply `r` to the page `sheetId` at `size`. */
|
|
28
|
+
export declare function reflow(k: Kit, sheetId: string, size: Breakpoint, r: Responsive): void;
|
|
29
|
+
/**
|
|
30
|
+
* The laptop, tablet and phone copies of a desktop page, and the desktop page itself made responsive from them: at
|
|
31
|
+
* the file's Tablet and Phone breakpoints it lays out as the tablet and phone copies do. Someone who starts from the
|
|
32
|
+
* desktop size gets a page that reflows; the copies stay as sizes to start from.
|
|
33
|
+
*/
|
|
34
|
+
export declare function webResponsive(k: Kit, sheetId: string, r?: Responsive): string[];
|
|
35
|
+
/** The laptop, tablet and phone copies of a desktop page. */
|
|
36
|
+
export declare function webVariants(r?: Responsive): VariantSpec[];
|
|
37
|
+
/**
|
|
38
|
+
* The desktop page: an auto-layout column on the page ground, as tall as its content and at least a viewport
|
|
39
|
+
* tall. `center` centres the content across (a 404) instead of running it from the left edge.
|
|
40
|
+
*/
|
|
41
|
+
export declare function page(k: Kit, sheet: string, o?: {
|
|
42
|
+
gap?: number;
|
|
43
|
+
top?: number;
|
|
44
|
+
center?: boolean;
|
|
45
|
+
paper?: string;
|
|
46
|
+
spread?: boolean;
|
|
47
|
+
}): void;
|
|
48
|
+
/** The shared parts: a primary and a quiet button, and a nav link — components every page instances. */
|
|
49
|
+
export declare function buttons(k: Kit, o: {
|
|
50
|
+
style: string;
|
|
51
|
+
pad?: [number, number];
|
|
52
|
+
radius?: number;
|
|
53
|
+
}): void;
|
|
54
|
+
/**
|
|
55
|
+
* The top bar: the brand logo on its tile and the name, the links (folded away on the phone) and a button. The
|
|
56
|
+
* links are a component so every page's nav says the same thing.
|
|
57
|
+
*/
|
|
58
|
+
export declare function nav(k: Kit, sheet: string, o: {
|
|
59
|
+
links: readonly string[];
|
|
60
|
+
cta: string;
|
|
61
|
+
style: string;
|
|
62
|
+
brandStyle: string;
|
|
63
|
+
quiet?: boolean;
|
|
64
|
+
}): string;
|