@gradial/aci 0.1.20-preview.2 → 0.1.20
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/README.md +48 -110
- package/bin/{aci → aci-darwin-arm64} +0 -0
- package/bin/aci.js +99 -6
- package/dist/assets/index.d.ts +3 -3
- package/dist/assets/index.js +3 -3
- package/dist/astro/index.d.ts +14 -3
- package/dist/astro/index.js +24 -5
- package/dist/content/assets.d.ts +17 -0
- package/dist/content/assets.js +65 -0
- package/dist/content/index.d.ts +2 -0
- package/dist/content/index.js +2 -0
- package/dist/content/provider.d.ts +19 -0
- package/dist/content/provider.js +7 -0
- package/dist/content/resolve-slots.d.ts +9 -0
- package/dist/content/resolve-slots.js +24 -0
- package/dist/content/types.d.ts +1 -1
- package/dist/define-component.d.ts +1 -2
- package/dist/define-component.js +73 -11
- package/dist/define-layout.d.ts +2 -0
- package/dist/define-layout.js +3 -0
- package/dist/dev/content-watch.d.ts +37 -0
- package/dist/dev/content-watch.js +154 -0
- package/dist/dev/index.d.ts +24 -43
- package/dist/dev/index.js +4 -169
- package/dist/index.d.ts +14 -5
- package/dist/index.js +8 -8
- package/dist/next/asset-route.d.ts +2 -0
- package/dist/next/asset-route.js +12 -4
- package/dist/next/config.d.ts +2 -2
- package/dist/next/config.js +6 -6
- package/dist/next/content-watch.js +6 -1
- package/dist/next/index.d.ts +2 -2
- package/dist/next/index.js +2 -2
- package/dist/next/middleware.d.ts +7 -3
- package/dist/next/middleware.js +12 -7
- package/dist/next/page.d.ts +16 -15
- package/dist/next/page.js +30 -10
- package/dist/next/render.d.ts +5 -0
- package/dist/next/render.js +17 -0
- package/dist/next/root-layout.d.ts +4 -0
- package/dist/next/root-layout.js +5 -0
- package/dist/next/server.d.ts +14 -13
- package/dist/next/server.js +13 -3
- package/dist/providers/file.d.ts +2 -0
- package/dist/providers/file.js +61 -1
- package/dist/providers/s3.d.ts +1 -0
- package/dist/providers/s3.js +14 -1
- package/dist/react/Media.d.ts +24 -0
- package/dist/react/Media.js +30 -0
- package/dist/react/Picture.d.ts +12 -0
- package/dist/react/Picture.js +11 -0
- package/dist/react/VideoPlayer.d.ts +13 -0
- package/dist/react/{GradialVideoPlayer.js → VideoPlayer.js} +6 -5
- package/dist/react/index.d.ts +333 -3
- package/dist/react/index.js +89 -3
- package/dist/registry.d.ts +15 -0
- package/dist/registry.js +10 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.js +15 -2
- package/dist/types/block-ref.d.ts +26 -0
- package/dist/types/block-ref.js +28 -0
- package/dist/types/component.d.ts +36 -41
- package/dist/types/config.d.ts +1 -2
- package/dist/types/image.d.ts +33 -20
- package/dist/types/image.js +42 -50
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/link.d.ts +38 -0
- package/dist/types/link.js +58 -0
- package/dist/types/media.d.ts +16 -35
- package/dist/types/media.js +15 -84
- package/dist/types/page.d.ts +1 -2
- package/dist/types/render-mode.d.ts +0 -1
- package/dist/types/renderer.d.ts +1 -1
- package/dist/types/rich-text.d.ts +40 -0
- package/dist/types/rich-text.js +39 -0
- package/dist/types/video.d.ts +7 -13
- package/dist/types/video.js +3 -3
- package/package.json +32 -74
- package/src/cli/compile-registry.mjs +236 -59
- package/src/cli/validate-content.mjs +38 -75
- package/src/types/image.ts +79 -60
- package/templates/astro/template/.aci.yaml +27 -0
- package/templates/astro/template/.storybook/main.ts +79 -0
- package/templates/astro/template/.storybook/manager.ts +6 -0
- package/templates/astro/template/.storybook/preview.ts +33 -0
- package/templates/astro/template/astro.config.mjs +37 -0
- package/templates/astro/template/package.json.tmpl +41 -0
- package/templates/astro/template/src/cms/contracts/layouts/index.ts +18 -0
- package/templates/astro/template/src/cms/registry.ts +28 -0
- package/templates/astro/template/src/components/chrome/Footer.astro +107 -0
- package/templates/astro/template/src/components/chrome/Header.astro +94 -0
- package/templates/astro/template/src/components/elements/AtomicBlock.astro +15 -0
- package/templates/astro/template/src/components/elements/AtomicBlocks.astro +16 -0
- package/templates/astro/template/src/components/elements/Button.astro +51 -0
- package/templates/astro/template/src/components/elements/ButtonBlock.astro +25 -0
- package/templates/astro/template/src/components/elements/Container.astro +11 -0
- package/templates/astro/template/src/components/elements/Icon.astro +31 -0
- package/templates/astro/template/src/components/elements/Logo.astro +29 -0
- package/templates/astro/template/src/components/elements/RemoteImage.astro +41 -0
- package/templates/astro/template/src/components/sections/ContainerSection.astro +32 -0
- package/templates/astro/template/src/components/sections/FeatureCard.astro +23 -0
- package/templates/astro/template/src/components/sections/FeatureGrid.astro +35 -0
- package/templates/astro/template/src/components/sections/HomeHero.astro +51 -0
- package/templates/astro/template/src/components/sections/StatsBar.astro +33 -0
- package/templates/astro/template/src/design-system/styles.css +399 -0
- package/templates/astro/template/src/design-system/tokens/colors.css +60 -0
- package/templates/astro/template/src/design-system/tokens/components.css +69 -0
- package/templates/astro/template/src/design-system/tokens/index.css +6 -0
- package/templates/astro/template/src/design-system/tokens/radii.css +5 -0
- package/templates/astro/template/src/design-system/tokens/shadows.css +5 -0
- package/templates/astro/template/src/design-system/tokens/spacing.css +13 -0
- package/templates/astro/template/src/design-system/tokens/typography.css +24 -0
- package/templates/astro/template/src/env.d.ts +1 -0
- package/templates/astro/template/src/fixtures/atomicBlocks.ts +33 -0
- package/templates/astro/template/src/fixtures/composition.ts +31 -0
- package/templates/astro/template/src/fixtures/index.ts +17 -0
- package/templates/astro/template/src/fixtures/sections.ts +39 -0
- package/templates/astro/template/src/layouts/SiteLayout.astro +30 -0
- package/templates/astro/template/src/pages/[...slug].astro +61 -0
- package/templates/astro/template/src/render/RenderPage.astro +66 -0
- package/templates/astro/template/src/stories/CompositionStoryFrame.astro +15 -0
- package/templates/astro/template/src/stories/HomeHero.stories.ts +24 -0
- package/templates/astro/template/src/stories/SectionStoryFrame.astro +16 -0
- package/templates/astro/template/src/stories/StoryDocFrame.astro +31 -0
- package/templates/astro/template/tsconfig.json +11 -0
- package/templates/common/.agents/AGENTS.md +37 -0
- package/templates/common/.agents/skills/aci/SKILL.md +162 -0
- package/templates/common/.agents/skills/authoring/SKILL.md +590 -0
- package/templates/common/.agents/skills/authoring/references/block-registry.md +151 -0
- package/templates/common/.agents/skills/authoring/references/contracts.md +153 -0
- package/templates/common/.agents/skills/authoring/references/design-system.md +171 -0
- package/templates/common/.agents/skills/authoring/references/image-assets.md +73 -0
- package/templates/common/.agents/skills/authoring/references/repo-structure.md +157 -0
- package/templates/common/.agents/skills/migration/SKILL.md +160 -0
- package/templates/common/.agents/skills/migration/references/analyzing-source.md +215 -0
- package/templates/common/.agents/skills/migration/references/component-migration.md +200 -0
- package/templates/common/.agents/skills/migration/references/selector-map.md +31 -0
- package/templates/common/.content/.gradial-dam/blobs/sha256/7f/bf/7fbfc7fe230ff12688c496f660119e41d9725c4504d82e310c15665c73c09292 +0 -0
- package/templates/common/.content/.gradial-dam/blobs/sha256/a0/f5/a0f506689de9b15a7055f70103a3f02cd3ba105771ae2de6754df2ede1210d3a +0 -0
- package/templates/common/.content/.gradial-dam/blobs/sha256/dd/b7/ddb7e9642be08317bcd4b2bd26b58ba8d0d34dd7239e03e684a4f3634fa3845b +0 -0
- package/templates/common/.content/.gradial-dam/blobs/sha256/fb/32/fb3260e8286ea8231ea1c77b9c0be92d6edd9026565731eb14cfdcfd6b1b75b3 +0 -0
- package/templates/common/.content/config/site.json +192 -0
- package/templates/common/.content/dam/folders/seed/ast_site_about_hero/asset.json +9 -0
- package/templates/common/.content/dam/folders/seed/ast_site_about_hero/editorial.json +14 -0
- package/templates/common/.content/dam/folders/seed/ast_site_about_hero/governance.json +23 -0
- package/templates/common/.content/dam/folders/seed/ast_site_about_hero/versions/v0001.json +37 -0
- package/templates/common/.content/dam/folders/seed/ast_site_home_hero/asset.json +9 -0
- package/templates/common/.content/dam/folders/seed/ast_site_home_hero/editorial.json +14 -0
- package/templates/common/.content/dam/folders/seed/ast_site_home_hero/governance.json +23 -0
- package/templates/common/.content/dam/folders/seed/ast_site_home_hero/versions/v0001.json +37 -0
- package/templates/common/.content/fragments/navbar/_index.json +25 -0
- package/templates/common/.content/fragments/site-footer/_index.json +62 -0
- package/templates/common/.content/pages/about/_index.json +51 -0
- package/templates/common/.content/pages/home/_index.json +112 -0
- package/templates/common/.content/schemas/site.schema.json +123 -0
- package/templates/common/README.md.tmpl +45 -0
- package/templates/common/contracts/components/button.contract.ts +19 -0
- package/templates/common/contracts/components/container.contract.ts +19 -0
- package/templates/common/contracts/components/featureCard.contract.ts +15 -0
- package/templates/common/contracts/components/featureGrid.contract.ts +16 -0
- package/templates/common/contracts/components/homeHero.contract.ts +36 -0
- package/templates/common/contracts/components/index.ts +21 -0
- package/templates/common/contracts/components/siteFooter.contract.ts +45 -0
- package/templates/common/contracts/components/siteNavigation.contract.ts +30 -0
- package/templates/common/contracts/components/statsBar.contract.ts +19 -0
- package/templates/common/design-system/styles.css +346 -0
- package/templates/common/design-system/tokens/colors.css +110 -0
- package/templates/common/design-system/tokens/components.css +86 -0
- package/templates/common/design-system/tokens/index.css +6 -0
- package/templates/common/design-system/tokens/radii.css +5 -0
- package/templates/common/design-system/tokens/shadows.css +9 -0
- package/templates/common/design-system/tokens/spacing.css +26 -0
- package/templates/common/design-system/tokens/typography.css +32 -0
- package/templates/common/eslint-rules/no-raw-tailwind-values.js +127 -0
- package/templates/common/public/assets/Dwire-model.png +0 -0
- package/templates/common/public/assets/bare-metal-logo.png +0 -0
- package/templates/common/public/assets/meridian-logo.svg +8 -0
- package/templates/common/public/assets/seattle.avif +0 -0
- package/templates/nextjs/template/.aci.yaml +25 -0
- package/templates/nextjs/template/.storybook/main.ts +13 -0
- package/templates/nextjs/template/.storybook/preview.ts +34 -0
- package/templates/nextjs/template/eslint.config.mjs +36 -0
- package/templates/nextjs/template/next-env.d.ts +6 -0
- package/templates/nextjs/template/next.config.ts +8 -0
- package/templates/nextjs/template/package.json.tmpl +46 -0
- package/templates/nextjs/template/postcss.config.mjs +7 -0
- package/templates/nextjs/template/src/app/[[...slug]]/page.tsx +8 -0
- package/templates/nextjs/template/src/app/gradial/assets/[releaseId]/[...path]/route.ts +31 -0
- package/templates/nextjs/template/src/app/layout.tsx +29 -0
- package/templates/nextjs/template/src/cms/contracts/components/button.contract.ts +19 -0
- package/templates/nextjs/template/src/cms/contracts/components/container.contract.ts +20 -0
- package/templates/nextjs/template/src/cms/contracts/components/homeHero.contract.ts +36 -0
- package/templates/nextjs/template/src/cms/contracts/components/index.ts +15 -0
- package/templates/nextjs/template/src/cms/contracts/components/siteFooter.contract.ts +45 -0
- package/templates/nextjs/template/src/cms/contracts/components/siteNavigation.contract.ts +30 -0
- package/templates/nextjs/template/src/cms/contracts/layouts/index.ts +16 -0
- package/templates/nextjs/template/src/cms/registry.ts +28 -0
- package/templates/nextjs/template/src/components/chrome/Footer.tsx +86 -0
- package/templates/nextjs/template/src/components/chrome/Header.tsx +74 -0
- package/templates/nextjs/template/src/components/elements/AtomicBlock.tsx +13 -0
- package/templates/nextjs/template/src/components/elements/Button.tsx +40 -0
- package/templates/nextjs/template/src/components/elements/ButtonBlock.tsx +18 -0
- package/templates/nextjs/template/src/components/elements/Container.tsx +14 -0
- package/templates/nextjs/template/src/components/elements/Icon.tsx +29 -0
- package/templates/nextjs/template/src/components/elements/Logo.tsx +38 -0
- package/templates/nextjs/template/src/components/sections/ContainerSection.tsx +28 -0
- package/templates/nextjs/template/src/components/sections/FeatureCard.tsx +25 -0
- package/templates/nextjs/template/src/components/sections/FeatureGrid.tsx +36 -0
- package/templates/nextjs/template/src/components/sections/HomeHero.tsx +62 -0
- package/templates/nextjs/template/src/components/sections/StatsBar.tsx +30 -0
- package/templates/nextjs/template/src/middleware.ts +4 -0
- package/templates/nextjs/template/src/stories/Button.stories.tsx +38 -0
- package/templates/nextjs/template/src/stories/Header.stories.tsx +30 -0
- package/templates/nextjs/template/src/stories/HomeHero.stories.tsx +33 -0
- package/templates/nextjs/template/tsconfig.json +23 -0
- package/templates/nextjs/template/vercel.json +6 -0
- package/dist/content/cache.test.d.ts +0 -1
- package/dist/content/cache.test.js +0 -86
- package/dist/content/contract.d.ts +0 -83
- package/dist/content/contract.js +0 -104
- package/dist/content/tailwind-validator.d.ts +0 -6
- package/dist/content/tailwind-validator.js +0 -31
- package/dist/content/validation.d.ts +0 -108
- package/dist/content/validation.js +0 -184
- package/dist/next/preview-banner.d.ts +0 -4
- package/dist/next/preview-banner.js +0 -51
- package/dist/next/preview.d.ts +0 -7
- package/dist/next/preview.js +0 -37
- package/dist/react/GradialMedia.d.ts +0 -24
- package/dist/react/GradialMedia.js +0 -31
- package/dist/react/GradialPicture.d.ts +0 -14
- package/dist/react/GradialPicture.js +0 -30
- package/dist/react/GradialVideoPlayer.d.ts +0 -13
- package/dist/sveltekit/index.d.ts +0 -23
- package/dist/sveltekit/index.js +0 -62
- package/dist/sveltekit/preview.d.ts +0 -5
- package/dist/sveltekit/preview.js +0 -33
- package/src/cli/verify-renderer.mjs +0 -73
- package/src/types/component.ts +0 -59
- package/src/types/config.ts +0 -38
- package/src/types/data.ts +0 -47
- package/src/types/index.ts +0 -10
- package/src/types/layout.ts +0 -29
- package/src/types/media.ts +0 -125
- package/src/types/page.ts +0 -48
- package/src/types/render-mode.ts +0 -18
- package/src/types/renderer.ts +0 -83
- package/src/types/video.ts +0 -66
package/src/types/page.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { RenderMode, VaryDimension } from './render-mode.js';
|
|
2
|
-
|
|
3
|
-
export interface PageDocument {
|
|
4
|
-
path: string;
|
|
5
|
-
layout: string;
|
|
6
|
-
locale: string;
|
|
7
|
-
metadata: PageMetadata;
|
|
8
|
-
regions: Record<string, RegionNode>;
|
|
9
|
-
renderMode: RenderMode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface PageMetadata {
|
|
13
|
-
title: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
openGraph?: Record<string, string>;
|
|
16
|
-
canonicalUrl?: string;
|
|
17
|
-
alternateLocales?: { locale: string; path: string }[];
|
|
18
|
-
customHead?: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface RegionNode {
|
|
22
|
-
kind: 'region';
|
|
23
|
-
name: string;
|
|
24
|
-
children: Array<BlockNode | FragmentRefNode>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface BlockNode {
|
|
28
|
-
kind: 'block';
|
|
29
|
-
id: string;
|
|
30
|
-
component: string;
|
|
31
|
-
props: Record<string, unknown>;
|
|
32
|
-
renderHints: BlockRenderHints;
|
|
33
|
-
contentRef?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface BlockRenderHints {
|
|
37
|
-
canStatic: boolean;
|
|
38
|
-
needsSSR: boolean;
|
|
39
|
-
isIsland: boolean;
|
|
40
|
-
islandMode?: 'ssr' | 'client';
|
|
41
|
-
varyDimensions?: VaryDimension[];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface FragmentRefNode {
|
|
45
|
-
kind: 'fragment-ref';
|
|
46
|
-
fragmentId: string;
|
|
47
|
-
inline: boolean;
|
|
48
|
-
}
|
package/src/types/render-mode.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type RenderMode =
|
|
2
|
-
| 'static'
|
|
3
|
-
| 'static-with-fragments'
|
|
4
|
-
| 'prerender-on-demand'
|
|
5
|
-
| 'ssr-page'
|
|
6
|
-
| 'ssr-island'
|
|
7
|
-
| 'client-island';
|
|
8
|
-
|
|
9
|
-
export type IslandMode = 'ssr' | 'client';
|
|
10
|
-
|
|
11
|
-
export type VaryDimension =
|
|
12
|
-
| 'geo:country'
|
|
13
|
-
| 'geo:region'
|
|
14
|
-
| 'geo:city'
|
|
15
|
-
| `cookie:${string}`
|
|
16
|
-
| `header:${string}`
|
|
17
|
-
| 'locale'
|
|
18
|
-
| `query:${string}`;
|
package/src/types/renderer.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { PageDocument } from './page.js';
|
|
2
|
-
import type { VaryDimension } from './render-mode.js';
|
|
3
|
-
|
|
4
|
-
export interface RenderCapabilities {
|
|
5
|
-
staticRender: boolean;
|
|
6
|
-
ssr: boolean;
|
|
7
|
-
ssrIslands: boolean;
|
|
8
|
-
clientIslands: boolean;
|
|
9
|
-
fragmentRender: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface GradialRenderer {
|
|
13
|
-
renderPage(request: RenderPageRequest): Promise<RenderPageResult>;
|
|
14
|
-
renderFragment?(request: RenderFragmentRequest): Promise<RenderResult>;
|
|
15
|
-
renderIsland?(request: RenderIslandRequest): Promise<RenderResult>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface RenderPageRequest {
|
|
19
|
-
page: PageDocument;
|
|
20
|
-
requestContext?: RequestContext;
|
|
21
|
-
release: ReleaseContext;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface RequestContext {
|
|
25
|
-
url: string;
|
|
26
|
-
method: string;
|
|
27
|
-
headers: Record<string, string>;
|
|
28
|
-
cookies: Record<string, string>;
|
|
29
|
-
geo?: GeoContext;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface GeoContext {
|
|
33
|
-
country?: string;
|
|
34
|
-
region?: string;
|
|
35
|
-
city?: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ReleaseContext {
|
|
39
|
-
releaseId: string;
|
|
40
|
-
codeDigest: string;
|
|
41
|
-
contentSnapshotId: string;
|
|
42
|
-
assetUrl(logicalPath: string): string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface RenderFragmentRequest {
|
|
46
|
-
fragmentId: string;
|
|
47
|
-
content: unknown;
|
|
48
|
-
release: ReleaseContext;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface RenderIslandRequest {
|
|
52
|
-
islandId: string;
|
|
53
|
-
component: string;
|
|
54
|
-
props: Record<string, unknown>;
|
|
55
|
-
requestContext: RequestContext;
|
|
56
|
-
release: ReleaseContext;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface RenderResult {
|
|
60
|
-
html: string;
|
|
61
|
-
status?: number;
|
|
62
|
-
headers?: Record<string, string>;
|
|
63
|
-
cachePolicy?: CachePolicy;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface RenderPageResult extends RenderResult {
|
|
67
|
-
islands?: IslandDescriptor[];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface IslandDescriptor {
|
|
71
|
-
islandId: string;
|
|
72
|
-
component: string;
|
|
73
|
-
props: Record<string, unknown>;
|
|
74
|
-
mode: 'ssr' | 'client';
|
|
75
|
-
varyDimensions?: VaryDimension[];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface CachePolicy {
|
|
79
|
-
scope: 'public' | 'private' | 'no-store';
|
|
80
|
-
ttl?: number;
|
|
81
|
-
staleWhileRevalidate?: number;
|
|
82
|
-
tags?: string[];
|
|
83
|
-
}
|
package/src/types/video.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { GradialImageSchema, type GradialImage } from './image.js';
|
|
3
|
-
|
|
4
|
-
// ---------------------------------------------------------------------------
|
|
5
|
-
// Video source variant (format alternatives)
|
|
6
|
-
// ---------------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
export interface VideoSource {
|
|
9
|
-
src: string;
|
|
10
|
-
type: string; // MIME type: video/mp4, video/webm
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// ---------------------------------------------------------------------------
|
|
14
|
-
// GradialVideo — DAM-backed video asset with compiler-resolved derivatives
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
|
|
17
|
-
export interface GradialVideo {
|
|
18
|
-
/** Discriminator — always 'gradial.video'. */
|
|
19
|
-
$type: 'gradial.video';
|
|
20
|
-
/** DAM asset identifier. */
|
|
21
|
-
assetId: string;
|
|
22
|
-
/** DAM version identifier. */
|
|
23
|
-
versionId: string;
|
|
24
|
-
/** Accessible description of the video content. */
|
|
25
|
-
alt: string;
|
|
26
|
-
/** Primary video URL (compiler-resolved). */
|
|
27
|
-
src: string;
|
|
28
|
-
/** Primary video MIME type (e.g. 'video/mp4'). */
|
|
29
|
-
type: string;
|
|
30
|
-
/** Intrinsic width in pixels. */
|
|
31
|
-
width: number;
|
|
32
|
-
/** Intrinsic height in pixels. */
|
|
33
|
-
height: number;
|
|
34
|
-
/**
|
|
35
|
-
* Poster frame — a full GradialImage with responsive srcset.
|
|
36
|
-
* The compiler extracts or generates this from the video asset.
|
|
37
|
-
*/
|
|
38
|
-
poster?: GradialImage;
|
|
39
|
-
/** Format variants (e.g. mp4 + webm). Maps to <video><source> elements. */
|
|
40
|
-
sources?: VideoSource[];
|
|
41
|
-
/** Duration in seconds (if known). */
|
|
42
|
-
duration?: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// ---------------------------------------------------------------------------
|
|
46
|
-
// Zod schema
|
|
47
|
-
// ---------------------------------------------------------------------------
|
|
48
|
-
|
|
49
|
-
export const VideoSourceSchema = z.object({
|
|
50
|
-
src: z.string().min(1),
|
|
51
|
-
type: z.string().min(1),
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export const GradialVideoSchema = z.object({
|
|
55
|
-
$type: z.literal('gradial.video'),
|
|
56
|
-
assetId: z.string().min(1),
|
|
57
|
-
versionId: z.string().min(1),
|
|
58
|
-
alt: z.string(),
|
|
59
|
-
src: z.string().min(1),
|
|
60
|
-
type: z.string().min(1),
|
|
61
|
-
width: z.number().int().nonnegative(),
|
|
62
|
-
height: z.number().int().nonnegative(),
|
|
63
|
-
poster: GradialImageSchema.optional(),
|
|
64
|
-
sources: z.array(VideoSourceSchema).optional(),
|
|
65
|
-
duration: z.number().nonnegative().optional(),
|
|
66
|
-
});
|