Assets

[中文]

Overview

This page is the entry description for assets and Runtime resources. Public JSON uses camelCase.

It does not cover view internal field details, nor the specifics of layout / placement / style / props. For those, see View, Layout, Placement, Style, Props.

Asset Types

Entries in root.json.assets and variants[].assets may be path strings or inline asset objects. Paths resolve relative to the directory of the current root.json, and relative paths inside an inline object resolve against that same directory.

Document assets compose the current document:

type

document

Description

constant

Constant

Constant tree, referenced by ${constant.<path>}

imageSet

Imageset

Image resources of the current document, referenced by imageProps.src

viewScreen

Viewscreen

Mountable page root node

viewTemplate

Viewtemplate

Reusable template root node

interactionTemplate

Interactiontemplate

Reusable interaction events, animations, and state styles

styleSet

Theme

Named style collection within the document, referenced by styleRefs

screenFlow

Screen Flow

Switching state machine for a group of screens in one document

Runtime global resources are registered or loaded through the Runtime API:

type

document

Description

fontSet

Fontset

Global font resource collection, referenced by style.font

imageSet

Imageset

Global image resource collection, referenced by imageProps.src

theme

Theme

Global theme overlay, selected by set_theme(...)

Resource Boundaries

  • constant, imageSet, viewScreen, viewTemplate, interactionTemplate, styleSet, screenFlow are the document asset types.

  • An ordinary view node uses type for its control type.

  • Image and font resources always use imageSet / fontSet, even for a single resource.

  • fontSet and theme are not document assets types; register or load them through the Runtime global API.

Subdocuments