| 1 |
import { DEFAULT_SHADER } from '@auto-launch/functions/shader-canvas'; |
| 2 |
import background from './background.json'; |
| 3 |
import brand from './brand.json'; |
| 4 |
import color from './color.json'; |
| 5 |
import layout from './layout.json'; |
| 6 |
import shape from './shape.json'; |
| 7 |
import type from './type.json'; |
| 8 |
|
| 9 |
/** |
| 10 |
* The GLSL default is spliced in rather than sitting in the JSON: the flow |
| 11 |
* compiles that string, and a second copy is one that drifts from it. |
| 12 |
* |
| 13 |
* `layout` is advisory: a template may arrange with it or ignore it. |
| 14 |
*/ |
| 15 |
export const globalManifests = () => [ |
| 16 |
brand, |
| 17 |
color, |
| 18 |
shape, |
| 19 |
type, |
| 20 |
layout, |
| 21 |
{ |
| 22 |
...background, |
| 23 |
properties: { |
| 24 |
...background.properties, |
| 25 |
bgSource: { ...background.properties.bgSource, default: DEFAULT_SHADER }, |
| 26 |
}, |
| 27 |
}, |
| 28 |
]; |
| 29 |
|
| 30 |
// A design overrides at this same key, so the default is the only theme. |
| 31 |
export const globalDefault = (key) => |
| 32 |
globalManifests().find((manifest) => manifest.properties[key])?.properties[ |
| 33 |
key |
| 34 |
].default; |
| 35 |
|