@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.7
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 +28 -0
- package/README.md +2 -4
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +3 -18
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/index.d.ts +3 -5
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +2 -2
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +19 -140
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +12 -108
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -1
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +4 -3
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
- package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
- package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +53 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +41 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +149 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +113 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +516 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +99 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +63 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +313 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +413 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/components/trees/audio/node-audio.d.ts +109 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +167 -0
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +2 -2
- package/dist/document/command-traits.js +1 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +1 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -2
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +3 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/registry.d.ts +23 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +12 -18
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline.d.ts +3 -3
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +2 -2
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +4 -4
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/experimental.d.ts +19 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +17 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +11 -5
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +7 -1
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +13 -19
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-update.js +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +3 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +4 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +17 -35
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +3 -3
- package/dist/runtime/engine.js +2 -2
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +1 -1
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +1 -1
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +43 -39
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +24 -25
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +7 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +2 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/index.d.ts +2 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +2 -10
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-layout.js","sourceRoot":"","sources":["../../../src/components/modules/text-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,GAE1F,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAWnF,wGAAwG;AACxG,MAAM,UAAU,OAAO,CAAC,QAAkB,EAAE,CAAa,EAAE,MAAkB;IACzE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,CAAC;IACtC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;AAC7G,CAAC;AAED,MAAM,KAAK,GAAG,IAAI,OAAO,EAAmE,CAAC;AAE7F,0IAA0I;AAC1I,MAAM,UAAU,IAAI,CAAC,GAAoB,EAAE,CAAuB,EAAE,MAAkB;IAClF,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3B,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC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EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAkB,EAAE,CAAa;IAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,CAAC;IAChC,OAAO,WAAW,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;AACnG,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAoB,EAAE,CAAa;IAC5D,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,OAAO;QAAE,OAAO;IACtB,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,GAAG,CAAC,QAAQ,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,CAAa;IACtD,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import type { Size2D } from \"@/attributes/layout/size\";\r\nimport type { ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Node2D } from \"@/components/trees/2d/node2d\";\r\nimport {\r\n declareGlyphAssets, declareRichAssets, measureGlyphs, measureRich, richState, textState,\r\n type RichValues, type TextSource, type TextValues,\r\n} from \"@/components/builtins/text/text-layout\";\r\nimport type { TextState } from \"@/render/descriptors/text\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport type { Loader, Measurer, RenderContext2D } from \"@/components/factory/api\";\r\nimport { currentPass, internalsOf, markDecided } from \"@/components/factory/views\";\r\n\r\n/**\r\n * Glyphs: measured, drawn and loaded by the shared functions in `components/builtins/text/text-layout.ts`.\r\n * `source` is where the string comes from: a `text` entry, a formatted number.\r\n */\r\n\r\nexport type { TextSource, TextValues, RichValues };\r\n\r\ntype Painted = { readonly shadow: unknown; readonly fill: unknown; readonly stroke: unknown };\r\n\r\n/** The block's own size, which a filling text still reports, so a hugging ancestor sees its content. */\r\nexport function measure(measurer: Measurer, s: TextValues, source: TextSource): Size2D {\r\n const { node, scope } = currentPass();\r\n markDecided(node);\r\n return measureGlyphs(s, source, { maxWidth: measurer.max.width, maxHeight: measurer.max.height }, scope);\r\n}\r\n\r\nconst drawn = new WeakMap<Node2D, { readonly s: TextValues; readonly source: TextSource }>();\r\n\r\n/** The glyphs, shadow and fill, then the children, then the stroke. A styled piece paints itself, so the node's own paint steps aside. */\r\nexport function draw(ctx: RenderContext2D, s: TextValues & Painted, source: TextSource): void {\r\n const c = internalsOf(ctx);\r\n drawn.set(c.host, { s, source });\r\n if (c.probing) return;\r\n const out = c.target();\r\n const state = textState(s, source, c.host.layoutBounds);\r\n const segmented = state.segments != null;\r\n c.inFront(() => {\r\n const g = new Graphics2D().text(state).shadow(s.shadow as ShadowResolved[]);\r\n if (!segmented) g.fill(s.fill as never);\r\n out.draw(g);\r\n });\r\n ctx.children();\r\n c.inFront(() => {\r\n const stroke = s.stroke as StrokeResolved[];\r\n if (stroke.length === 0 || segmented) return;\r\n out.draw(new Graphics2D().text(state).stroke(stroke));\r\n });\r\n}\r\n\r\nexport function load(loader: Loader, s: TextValues, source: TextSource): void {\r\n declareGlyphAssets(s, source, loader);\r\n}\r\n\r\n/** What a node drew its glyphs as, for a host's caret geometry. `null` for a node that draws none. */\r\nexport function textStateOf(node: Node2D): Partial<TextState> | null {\r\n const last = drawn.get(node);\r\n return last ? textState(last.s, last.source, node.layoutBounds) : null;\r\n}\r\n\r\nexport function measureRichText(measurer: Measurer, s: RichValues): Size2D {\r\n const { scope } = currentPass();\r\n return measureRich(s, { maxWidth: measurer.max.width, maxHeight: measurer.max.height }, scope);\r\n}\r\n\r\nexport function drawRichText(ctx: RenderContext2D, s: RichValues): void {\r\n const c = internalsOf(ctx);\r\n if (c.probing) return;\r\n const out = c.target();\r\n c.inFront(() => out.draw(new Graphics2D().richText(richState(s, c.host.layoutBounds))));\r\n ctx.children();\r\n}\r\n\r\nexport function loadRichText(loader: Loader, s: RichValues): void {\r\n declareRichAssets(s, loader);\r\n}\r\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Fill } from "../../attributes/shape/fill/chain.js";
|
|
2
|
+
import type { Shadow } from "../../attributes/shape/shadow/shadow.js";
|
|
3
|
+
import type { Stroke } from "../../attributes/shape/stroke/stroke.js";
|
|
4
|
+
import type { FontStyle, TextAlign, TextStyle } from "../../attributes/text/types.js";
|
|
5
|
+
import { type Provided, type Values } from "../../components/factory/api.js";
|
|
6
|
+
import type { Inherit } from "../../components/factory/type-def.js";
|
|
7
|
+
/** What `key` inherits. `autofit: false` refuses an inherited `'autofit'` size, for a node that can't fit to its box. */
|
|
8
|
+
export declare function inherit(key: keyof TextStyle, options?: {
|
|
9
|
+
readonly autofit?: boolean;
|
|
10
|
+
}): Inherit;
|
|
11
|
+
export declare const state: {
|
|
12
|
+
fontFamily: import("../../components/factory/api.js").Type<string, string, false>;
|
|
13
|
+
fontSize: import("../../components/factory/api.js").Type<number | "autofit", number | "autofit", false>;
|
|
14
|
+
fontWeight: import("../../components/factory/api.js").Type<number, number, false>;
|
|
15
|
+
fontStyle: import("../../components/factory/api.js").Type<FontStyle, FontStyle, false>;
|
|
16
|
+
letterSpacing: import("../../components/factory/api.js").Type<number, number, false>;
|
|
17
|
+
lineHeight: import("../../components/factory/api.js").Type<number, number, false>;
|
|
18
|
+
textAlign: import("../../components/factory/api.js").Type<TextAlign, TextAlign, false>;
|
|
19
|
+
verticalAlign: import("../../components/factory/api.js").Type<"top" | "bottom" | "center", "top" | "bottom" | "center", false>;
|
|
20
|
+
textDecoration: import("../../components/factory/api.js").Type<"none" | "underline" | "line-through", "none" | "underline" | "line-through", false>;
|
|
21
|
+
textCase: import("../../components/factory/api.js").Type<"none" | "upper" | "lower" | "title", "none" | "upper" | "lower" | "title", false>;
|
|
22
|
+
minFontSize: import("../../components/factory/api.js").Type<number, number, false>;
|
|
23
|
+
variant: import("../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
|
|
24
|
+
fill: import("../../components/factory/api.js").Type<Fill, import("../../index.js").FillResolved[], false>;
|
|
25
|
+
stroke: import("../../components/factory/api.js").Type<Stroke, import("../../attributes/shape/stroke/stroke.js").StrokeResolved[], false>;
|
|
26
|
+
shadow: import("../../components/factory/api.js").Type<Shadow, import("../../attributes/shape/shadow/shadow.js").ShadowResolved[], false>;
|
|
27
|
+
};
|
|
28
|
+
/** The style a provider sets: each field left unset is inherited from above. */
|
|
29
|
+
export declare const provided: {
|
|
30
|
+
fontFamily: import("../../components/factory/api.js").Type<string | undefined, string | undefined, false>;
|
|
31
|
+
fontSize: import("../../components/factory/api.js").Type<number | "autofit" | undefined, number | "autofit" | undefined, false>;
|
|
32
|
+
fontWeight: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
33
|
+
fontStyle: import("../../components/factory/api.js").Type<FontStyle | undefined, FontStyle | undefined, false>;
|
|
34
|
+
letterSpacing: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
35
|
+
lineHeight: import("../../components/factory/api.js").Type<number | undefined, number | undefined, false>;
|
|
36
|
+
textAlign: import("../../components/factory/api.js").Type<TextAlign | undefined, TextAlign | undefined, false>;
|
|
37
|
+
fill: import("../../components/factory/api.js").Type<Fill | undefined, Fill | undefined, false>;
|
|
38
|
+
stroke: import("../../components/factory/api.js").Type<Stroke | undefined, Stroke | undefined, false>;
|
|
39
|
+
shadow: import("../../components/factory/api.js").Type<Shadow | undefined, Shadow | undefined, false>;
|
|
40
|
+
};
|
|
41
|
+
/** The subtree's style: the inherited one with this provider's fields laid over it. */
|
|
42
|
+
export declare function provide(s: Values<typeof provided>, inherited: <T>(context: {
|
|
43
|
+
readonly id: symbol;
|
|
44
|
+
readonly defaultValue: T;
|
|
45
|
+
}) => T): readonly Provided[];
|
|
46
|
+
/** This provider's own fields, as the default for text drawn under it. */
|
|
47
|
+
export declare function current(s: Values<typeof provided>): TextStyle;
|
|
48
|
+
//# sourceMappingURL=text-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-style.d.ts","sourceRoot":"","sources":["../../../src/components/modules/text-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAiB7D,yHAAyH;AACzH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,SAAS,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAKnG;AAED,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAoBjB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,QAAQ;;;;;;;;;;;CAWpB,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAA;CAAE,KAAK,CAAC,GAAG,SAAS,QAAQ,EAAE,CAExJ;AAED,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { textOps } from "../../attributes/text/ops.js";
|
|
2
|
+
import { TextStyleToken } from "../../runtime/builtin-context.js";
|
|
3
|
+
import { provides } from "../../components/factory/api.js";
|
|
4
|
+
import { Types } from "../../components/factory/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* The face text is set in, each field taken, when the author leaves it unset,
|
|
7
|
+
* from the cascade: the theme's `default` typography, under the nearest
|
|
8
|
+
* provider's style, under the node's own `variant` preset.
|
|
9
|
+
*/
|
|
10
|
+
function cascade(use, given) {
|
|
11
|
+
const variant = given.variant;
|
|
12
|
+
return textOps.mergeStyle(textOps.mergeStyle(textOps.preset("default"), use(TextStyleToken)), variant ? textOps.preset(variant) : undefined);
|
|
13
|
+
}
|
|
14
|
+
/** What `key` inherits. `autofit: false` refuses an inherited `'autofit'` size, for a node that can't fit to its box. */
|
|
15
|
+
export function inherit(key, options = {}) {
|
|
16
|
+
return (use, given) => {
|
|
17
|
+
const value = cascade(use, given)[key];
|
|
18
|
+
return key === "fontSize" && value === "autofit" && options.autofit === false ? undefined : value;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export const state = {
|
|
22
|
+
// No default: a face nobody chose is one never declared and never loaded, so the renderer says so.
|
|
23
|
+
fontFamily: Types.custom(undefined, { inherit: inherit("fontFamily") }),
|
|
24
|
+
fontSize: Types.custom(48, {
|
|
25
|
+
lerp: (a, b, t) => textOps.lerpFontSize(a, b, t),
|
|
26
|
+
inherit: inherit("fontSize"),
|
|
27
|
+
}),
|
|
28
|
+
fontWeight: Types.number(400, { inherit: inherit("fontWeight") }),
|
|
29
|
+
fontStyle: Types.custom("normal", { inherit: inherit("fontStyle") }),
|
|
30
|
+
letterSpacing: Types.number(0, { inherit: inherit("letterSpacing") }),
|
|
31
|
+
lineHeight: Types.number(1.2, { inherit: inherit("lineHeight") }),
|
|
32
|
+
textAlign: Types.custom("center", { inherit: inherit("textAlign") }),
|
|
33
|
+
verticalAlign: Types.oneOf(["top", "center", "bottom"], { default: "center" }),
|
|
34
|
+
textDecoration: Types.oneOf(["none", "underline", "line-through"]),
|
|
35
|
+
textCase: Types.oneOf(["none", "upper", "lower", "title"]),
|
|
36
|
+
minFontSize: Types.number(12),
|
|
37
|
+
variant: Types.custom(undefined),
|
|
38
|
+
fill: Types.fill(undefined, { inherit: inherit("fill") }),
|
|
39
|
+
stroke: Types.stroke(undefined, { inherit: inherit("stroke") }),
|
|
40
|
+
shadow: Types.shadow(undefined, { inherit: inherit("shadow") }),
|
|
41
|
+
};
|
|
42
|
+
/** The style a provider sets: each field left unset is inherited from above. */
|
|
43
|
+
export const provided = {
|
|
44
|
+
fontFamily: Types.custom(undefined),
|
|
45
|
+
fontSize: Types.custom(undefined),
|
|
46
|
+
fontWeight: Types.custom(undefined),
|
|
47
|
+
fontStyle: Types.custom(undefined),
|
|
48
|
+
letterSpacing: Types.custom(undefined),
|
|
49
|
+
lineHeight: Types.custom(undefined),
|
|
50
|
+
textAlign: Types.custom(undefined),
|
|
51
|
+
fill: Types.custom(undefined),
|
|
52
|
+
stroke: Types.custom(undefined),
|
|
53
|
+
shadow: Types.custom(undefined),
|
|
54
|
+
};
|
|
55
|
+
/** The subtree's style: the inherited one with this provider's fields laid over it. */
|
|
56
|
+
export function provide(s, inherited) {
|
|
57
|
+
return [provides(TextStyleToken, textOps.mergeStyle(inherited(TextStyleToken), s))];
|
|
58
|
+
}
|
|
59
|
+
/** This provider's own fields, as the default for text drawn under it. */
|
|
60
|
+
export function current(s) {
|
|
61
|
+
return textOps.mergeStyle({}, s);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=text-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-style.js","sourceRoot":"","sources":["../../../src/components/modules/text-style.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAA8B,MAAM,0BAA0B,CAAC;AAEhF,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;;;GAIG;AAEH,SAAS,OAAO,CAAC,GAA2B,EAAE,KAAwC;IAClF,MAAM,OAAO,GAAG,KAAK,CAAC,OAA6B,CAAC;IACpD,OAAO,OAAO,CAAC,UAAU,CACrB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,EAClE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAChD,CAAC;AACN,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,OAAO,CAAC,GAAoB,EAAE,UAA0C,EAAE;IACtF,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAClB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,OAAO,GAAG,KAAK,UAAU,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IACtG,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,mGAAmG;IACnG,UAAU,EAAE,KAAK,CAAC,MAAM,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AAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,OAAO,CAAC,CAA0B;IAC9C,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,CAAc,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport { textOps } from \"@/attributes/text/ops\";\r\nimport type { FontStyle, TextAlign, TextStyle } from \"@/attributes/text/types\";\r\nimport { TextStyleToken } from \"@/runtime/builtin-context\";\r\nimport { provides, type Provided, type Values } from \"@/components/factory/api\";\r\nimport type { Inherit } from \"@/components/factory/type-def\";\r\nimport { Types } from \"@/components/factory/types\";\r\n\r\n/**\r\n * The face text is set in, each field taken, when the author leaves it unset,\r\n * from the cascade: the theme's `default` typography, under the nearest\r\n * provider's style, under the node's own `variant` preset.\r\n */\r\n\r\nfunction cascade(use: Parameters<Inherit>[0], given: Readonly<Record<string, unknown>>): TextStyle {\r\n const variant = given.variant as string | undefined;\r\n return textOps.mergeStyle(\r\n textOps.mergeStyle(textOps.preset(\"default\"), use(TextStyleToken)),\r\n variant ? textOps.preset(variant) : undefined,\r\n );\r\n}\r\n\r\n/** What `key` inherits. `autofit: false` refuses an inherited `'autofit'` size, for a node that can't fit to its box. */\r\nexport function inherit(key: keyof TextStyle, options: { readonly autofit?: boolean } = {}): Inherit {\r\n return (use, given) => {\r\n const value = cascade(use, given)[key];\r\n return key === \"fontSize\" && value === \"autofit\" && options.autofit === false ? undefined : value;\r\n };\r\n}\r\n\r\nexport const state = {\r\n // No default: a face nobody chose is one never declared and never loaded, so the renderer says so.\r\n fontFamily: Types.custom<string>(undefined as unknown as string, { inherit: inherit(\"fontFamily\") }),\r\n fontSize: Types.custom<number | \"autofit\">(48, {\r\n lerp: (a, b, t) => textOps.lerpFontSize(a, b, t) as number | \"autofit\",\r\n inherit: inherit(\"fontSize\"),\r\n }),\r\n fontWeight: Types.number(400, { inherit: inherit(\"fontWeight\") }),\r\n fontStyle: Types.custom<FontStyle>(\"normal\", { inherit: inherit(\"fontStyle\") }),\r\n letterSpacing: Types.number(0, { inherit: inherit(\"letterSpacing\") }),\r\n lineHeight: Types.number(1.2, { inherit: inherit(\"lineHeight\") }),\r\n textAlign: Types.custom<TextAlign>(\"center\", { inherit: inherit(\"textAlign\") }),\r\n verticalAlign: Types.oneOf([\"top\", \"center\", \"bottom\"], { default: \"center\" }),\r\n textDecoration: Types.oneOf([\"none\", \"underline\", \"line-through\"]),\r\n textCase: Types.oneOf([\"none\", \"upper\", \"lower\", \"title\"]),\r\n minFontSize: Types.number(12),\r\n variant: Types.custom<string | undefined>(undefined),\r\n fill: Types.fill(undefined, { inherit: inherit(\"fill\") }),\r\n stroke: Types.stroke(undefined, { inherit: inherit(\"stroke\") }),\r\n shadow: Types.shadow(undefined, { inherit: inherit(\"shadow\") }),\r\n};\r\n\r\n/** The style a provider sets: each field left unset is inherited from above. */\r\nexport const provided = {\r\n fontFamily: Types.custom<string | undefined>(undefined),\r\n fontSize: Types.custom<number | \"autofit\" | undefined>(undefined),\r\n fontWeight: Types.custom<number | undefined>(undefined),\r\n fontStyle: Types.custom<FontStyle | undefined>(undefined),\r\n letterSpacing: Types.custom<number | undefined>(undefined),\r\n lineHeight: Types.custom<number | undefined>(undefined),\r\n textAlign: Types.custom<TextAlign | undefined>(undefined),\r\n fill: Types.custom<Fill | undefined>(undefined),\r\n stroke: Types.custom<Stroke | undefined>(undefined),\r\n shadow: Types.custom<Shadow | undefined>(undefined),\r\n};\r\n\r\n/** The subtree's style: the inherited one with this provider's fields laid over it. */\r\nexport function provide(s: Values<typeof provided>, inherited: <T>(context: { readonly id: symbol; readonly defaultValue: T }) => T): readonly Provided[] {\r\n return [provides(TextStyleToken, textOps.mergeStyle(inherited(TextStyleToken), s as TextStyle))];\r\n}\r\n\r\n/** This provider's own fields, as the default for text drawn under it. */\r\nexport function current(s: Values<typeof provided>): TextStyle {\r\n return textOps.mergeStyle({}, s as TextStyle);\r\n}\r\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Color, NormalizedColor } from "../../attributes/shape/fill/color/parser.js";
|
|
2
|
+
import { type Vector3, type Vector3Input } from "../../render3d/vector3.js";
|
|
3
|
+
import type { Type } from "../../components/factory/api.js";
|
|
4
|
+
import { type EntryOptions } from "../../components/factory/types.js";
|
|
5
|
+
/** The 3D tree's entries that start unset: the renderer's own default applies until one is given. */
|
|
6
|
+
export declare function optional<T>(): Type<T | undefined>;
|
|
7
|
+
/** A number, unset until given, with a number's hints. */
|
|
8
|
+
export declare function optionalNumber<const H extends NumberHints>(hints: H): Type<number | undefined>;
|
|
9
|
+
interface NumberHints extends EntryOptions {
|
|
10
|
+
readonly min?: number;
|
|
11
|
+
readonly max?: number;
|
|
12
|
+
readonly step?: number;
|
|
13
|
+
readonly unit?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function optionalColor(): Type<Color | undefined, NormalizedColor | undefined>;
|
|
16
|
+
/** A point, unset until given: tweening from unset starts at the origin, or snaps. */
|
|
17
|
+
export declare function optionalVector3(unset: "origin" | "snap"): Type<Vector3Input | undefined, Vector3 | undefined>;
|
|
18
|
+
/** Each of `keys` the state has set: what a scene descriptor takes. */
|
|
19
|
+
export declare function defined<T>(s: object, keys: readonly string[]): T;
|
|
20
|
+
/** `{ type, ...defined(s, keys) }`. */
|
|
21
|
+
export declare function stated<T>(type: string, s: object, keys: readonly string[]): T;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=three-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-entries.d.ts","sourceRoot":"","sources":["../../../src/components/modules/three-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAA+C,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,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alVector3 } from "../../render3d/vector3.js";
|
|
3
|
+
import { Types } from "../../components/factory/types.js";
|
|
4
|
+
/** The 3D tree's entries that start unset: the renderer's own default applies until one is given. */
|
|
5
|
+
export function optional() {
|
|
6
|
+
return Types.custom(undefined);
|
|
7
|
+
}
|
|
8
|
+
/** A number, unset until given, with a number's hints. */
|
|
9
|
+
export function optionalNumber(hints) {
|
|
10
|
+
return Types.custom(undefined, { kind: "number", ...hints });
|
|
11
|
+
}
|
|
12
|
+
export function optionalColor() {
|
|
13
|
+
return Types.custom(undefined, {
|
|
14
|
+
resolve: (v) => (v === undefined ? undefined : colorOps.resolve(v)),
|
|
15
|
+
lerp: colorOps.lerp,
|
|
16
|
+
kind: "color",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** A point, unset until given: tweening from unset starts at the origin, or snaps. */
|
|
20
|
+
export function optionalVector3(unset) {
|
|
21
|
+
return Types.custom(undefined, {
|
|
22
|
+
resolve: resolveOptionalVector3,
|
|
23
|
+
lerp: (from, to, t) => lerpOptionalVector3(from, to, t, unset),
|
|
24
|
+
kind: "vector3",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Each of `keys` the state has set: what a scene descriptor takes. */
|
|
28
|
+
export function defined(s, keys) {
|
|
29
|
+
const out = {};
|
|
30
|
+
for (const key of keys) {
|
|
31
|
+
const value = s[key];
|
|
32
|
+
if (value !== undefined)
|
|
33
|
+
out[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** `{ type, ...defined(s, keys) }`. */
|
|
38
|
+
export function stated(type, s, keys) {
|
|
39
|
+
return { type, ...defined(s, keys) };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=three-entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-entries.js","sourceRoot":"","sources":["../../../src/components/modules/three-entries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM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,CAA6B,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,KAAK,KAAK,SAAS;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC9C,CAAC;IACD,OAAO,GAAQ,CAAC;AACpB,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,MAAM,CAAI,IAAY,EAAE,CAAS,EAAE,IAAuB;IACtE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAS,CAAC,EAAE,IAAI,CAAC,EAAO,CAAC;AACtD,CAAC","sourcesContent":["import type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { colorOps } from \"@/attributes/shape/fill/lerp\";\r\nimport { lerpOptionalVector3, resolveOptionalVector3, type Vector3, type Vector3Input } from \"@/render3d/vector3\";\r\nimport type { Type } from \"@/components/factory/api\";\r\nimport { Types, type EntryOptions } from \"@/components/factory/types\";\r\n\r\n/** The 3D tree's entries that start unset: the renderer's own default applies until one is given. */\r\n\r\nexport function optional<T>(): Type<T | undefined> {\r\n return Types.custom<T | undefined>(undefined);\r\n}\r\n\r\n/** A number, unset until given, with a number's hints. */\r\nexport function optionalNumber<const H extends NumberHints>(hints: H): Type<number | undefined> {\r\n return Types.custom<number | undefined, number | undefined, H>(undefined, { kind: \"number\", ...hints }) as Type<number | undefined>;\r\n}\r\n\r\ninterface NumberHints extends EntryOptions {\r\n readonly min?: number;\r\n readonly max?: number;\r\n readonly step?: number;\r\n readonly unit?: string;\r\n}\r\n\r\nexport function optionalColor(): Type<Color | undefined, NormalizedColor | undefined> {\r\n return Types.custom<Color | undefined, NormalizedColor | undefined>(undefined, {\r\n resolve: (v) => (v === undefined ? undefined : colorOps.resolve(v)),\r\n lerp: colorOps.lerp as (from: NormalizedColor | undefined, to: NormalizedColor | undefined, t: number) => NormalizedColor | undefined,\r\n kind: \"color\",\r\n });\r\n}\r\n\r\n/** A point, unset until given: tweening from unset starts at the origin, or snaps. */\r\nexport function optionalVector3(unset: \"origin\" | \"snap\"): Type<Vector3Input | undefined, Vector3 | undefined> {\r\n return Types.custom<Vector3Input | undefined, Vector3 | undefined>(undefined, {\r\n resolve: resolveOptionalVector3,\r\n lerp: (from, to, t) => lerpOptionalVector3(from, to, t, unset),\r\n kind: \"vector3\",\r\n });\r\n}\r\n\r\n/** Each of `keys` the state has set: what a scene descriptor takes. */\r\nexport function defined<T>(s: object, keys: readonly string[]): T {\r\n const out: Record<string, unknown> = {};\r\n for (const key of keys) {\r\n const value = (s as Record<string, unknown>)[key];\r\n if (value !== undefined) out[key] = value;\r\n }\r\n return out as T;\r\n}\r\n\r\n/** `{ type, ...defined(s, keys) }`. */\r\nexport function stated<T>(type: string, s: object, keys: readonly string[]): T {\r\n return { type, ...defined<object>(s, keys) } as T;\r\n}\r\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Color, NormalizedColor } from "../../attributes/shape/fill/color/parser.js";
|
|
2
|
+
import type { FillResolved } from "../../attributes/shape/fill/union.js";
|
|
3
|
+
import { type PostEffect3D, type Shadows3D, type ToneMapping3D } from "../../render3d/scene-settings.js";
|
|
4
|
+
import { Scene3D } from "../../render3d/scene3d.js";
|
|
5
|
+
import type { Loader, RenderContext2D, Type, Values } from "../../components/factory/api.js";
|
|
6
|
+
import * as Corners from "../../components/modules/corners.js";
|
|
7
|
+
import * as Paint from "../../components/modules/paint.js";
|
|
8
|
+
export declare const state: {
|
|
9
|
+
orbit: Type<number, number, false>;
|
|
10
|
+
elevation: Type<number, number, false>;
|
|
11
|
+
zoom: Type<number, number, false>;
|
|
12
|
+
fov: Type<number, number, false>;
|
|
13
|
+
ambientIntensity: Type<number, number, false>;
|
|
14
|
+
ambientColor: Type<Color, NormalizedColor, false>;
|
|
15
|
+
keyIntensity: Type<number, number, false>;
|
|
16
|
+
keyColor: Type<Color, NormalizedColor, false>;
|
|
17
|
+
showGrid: Type<boolean, boolean, false>;
|
|
18
|
+
gridSize: Type<number, number, false>;
|
|
19
|
+
gridDivisions: Type<number, number, false>;
|
|
20
|
+
gridMajorEvery: Type<number, number, false>;
|
|
21
|
+
gridColor: Type<Color, NormalizedColor, false>;
|
|
22
|
+
gridMajorColor: Type<Color, NormalizedColor, false>;
|
|
23
|
+
showAxes: Type<boolean, boolean, false>;
|
|
24
|
+
axisXColor: Type<Color, NormalizedColor, false>;
|
|
25
|
+
axisZColor: Type<Color, NormalizedColor, false>;
|
|
26
|
+
gridFade: Type<number, number, false>;
|
|
27
|
+
gridFadeColor: Type<Color, NormalizedColor, false>;
|
|
28
|
+
maxPixelRatio: Type<number, number, false>;
|
|
29
|
+
antialias: Type<boolean, boolean, false>;
|
|
30
|
+
shadows: Type<Shadows3D, Shadows3D, false>;
|
|
31
|
+
tone: Type<ToneMapping3D | undefined, ToneMapping3D | undefined, false>;
|
|
32
|
+
exposure: Type<number | undefined, number | undefined, false>;
|
|
33
|
+
post: Type<PostEffect3D | readonly PostEffect3D[] | undefined, PostEffect3D | readonly PostEffect3D[] | undefined, false>;
|
|
34
|
+
};
|
|
35
|
+
export declare const commands: {
|
|
36
|
+
/** Swing the default camera: only the angles given move. */
|
|
37
|
+
orbitTo: {
|
|
38
|
+
args: readonly ["orbit", "elevation", "zoom"];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type ViewState = Values<typeof state> & {
|
|
42
|
+
readonly fill: FillResolved[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The 3D runtime, warmed before the first frame, and whatever `extend` draws:
|
|
46
|
+
* pass the `extend` your render hands {@link draw}, so its textures, models and
|
|
47
|
+
* surfaces load before a frame needs them, as a 3D child's own drawing does.
|
|
48
|
+
*/
|
|
49
|
+
export declare function load(loader: Loader, extend?: (scene: Scene3D) => void): void;
|
|
50
|
+
/**
|
|
51
|
+
* Your 3D children's scene with this view's settings, its grid, and the default
|
|
52
|
+
* camera and lights where the scene has none; `extend` draws more into it last.
|
|
53
|
+
* `null` when there is nothing to show.
|
|
54
|
+
*/
|
|
55
|
+
export declare function scene(ctx: RenderContext2D, s: ViewState, extend?: (scene: Scene3D) => void): Scene3D | null;
|
|
56
|
+
/** The box painted, with the scene as its top fill layer. */
|
|
57
|
+
export declare function draw(ctx: RenderContext2D, s: ViewState & Parameters<typeof Paint.draw>[1] & Values<typeof Corners.state>, extend?: (scene: Scene3D) => void): void;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=view3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view3d.d.ts","sourceRoot":"","sources":["../../../src/components/modules/view3d.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAKlE,OAAO,EAAoB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGtF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAYpD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BjB,CAAC;AAEF,eAAO,MAAM,QAAQ;IACjB,4DAA4D;;;;CAE/D,CAAC;AAEF,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC;AAM1E;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAO5E;AAID;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,IAAI,CA+B3G;AAED,6DAA6D;AAC7D,wBAAgB,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAelK"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { cameraOrbit, lerpColor3D, resolveColor3D } from "../../attributes/render3d/orbit.js";
|
|
2
|
+
import { Fills } from "../../attributes/shape/fill/chain.js";
|
|
3
|
+
import { gridGeometry3D } from "../../components/builtins/three/grid-geometry3d.js";
|
|
4
|
+
import { Graphics3D } from "../../render3d/graphics3d.js";
|
|
5
|
+
import { warmCanvas3D } from "../../render3d/resources.js";
|
|
6
|
+
import { resolveShadows3D } from "../../render3d/scene-settings.js";
|
|
7
|
+
import { Scene3D } from "../../render3d/scene3d.js";
|
|
8
|
+
import { isSurfaceTexture3D, resolveSurfaceSource } from "../../render3d/texture.js";
|
|
9
|
+
import { forEachTexture3D } from "../../render3d/walk.js";
|
|
10
|
+
import { Types } from "../../components/factory/types.js";
|
|
11
|
+
import { internalsOf } from "../../components/factory/views.js";
|
|
12
|
+
import * as Corners from "../../components/modules/corners.js";
|
|
13
|
+
import * as Paint from "../../components/modules/paint.js";
|
|
14
|
+
import { optional } from "../../components/modules/three-entries.js";
|
|
15
|
+
/**
|
|
16
|
+
* A viewport onto its 3D children: the default camera and light rig a scene
|
|
17
|
+
* gets when it has none of its own, the floor grid, and the render settings.
|
|
18
|
+
*/
|
|
19
|
+
function color3D(initial) {
|
|
20
|
+
return Types.custom(initial, { resolve: resolveColor3D, lerp: lerpColor3D });
|
|
21
|
+
}
|
|
22
|
+
export const state = {
|
|
23
|
+
orbit: Types.number(35, { step: 1, unit: "°" }),
|
|
24
|
+
elevation: Types.number(20, { min: -89, max: 89, step: 1, unit: "°" }),
|
|
25
|
+
zoom: Types.number(12, { min: 0.01, step: 0.1 }),
|
|
26
|
+
fov: Types.custom(45),
|
|
27
|
+
ambientIntensity: Types.custom(0.45),
|
|
28
|
+
ambientColor: color3D("#ffffff"),
|
|
29
|
+
keyIntensity: Types.custom(2.4),
|
|
30
|
+
keyColor: color3D("#ffffff"),
|
|
31
|
+
showGrid: Types.custom(false),
|
|
32
|
+
gridSize: Types.custom(40),
|
|
33
|
+
gridDivisions: Types.custom(40),
|
|
34
|
+
gridMajorEvery: Types.custom(5),
|
|
35
|
+
gridColor: color3D("#26292f"),
|
|
36
|
+
gridMajorColor: color3D("#363a42"),
|
|
37
|
+
showAxes: Types.custom(false),
|
|
38
|
+
axisXColor: color3D("#c8404f"),
|
|
39
|
+
axisZColor: color3D("#2f6fd0"),
|
|
40
|
+
gridFade: Types.custom(0.55),
|
|
41
|
+
gridFadeColor: color3D("#0b0d12"),
|
|
42
|
+
maxPixelRatio: Types.custom(2),
|
|
43
|
+
antialias: Types.custom(true),
|
|
44
|
+
shadows: Types.custom(false),
|
|
45
|
+
tone: optional(),
|
|
46
|
+
exposure: optional(),
|
|
47
|
+
post: optional(),
|
|
48
|
+
};
|
|
49
|
+
export const commands = {
|
|
50
|
+
/** Swing the default camera: only the angles given move. */
|
|
51
|
+
orbitTo: { args: ["orbit", "elevation", "zoom"] },
|
|
52
|
+
};
|
|
53
|
+
const loadThreeRuntime = async () => {
|
|
54
|
+
await warmCanvas3D();
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The 3D runtime, warmed before the first frame, and whatever `extend` draws:
|
|
58
|
+
* pass the `extend` your render hands {@link draw}, so its textures, models and
|
|
59
|
+
* surfaces load before a frame needs them, as a 3D child's own drawing does.
|
|
60
|
+
*/
|
|
61
|
+
export function load(loader, extend) {
|
|
62
|
+
loader.task("three:runtime", loadThreeRuntime);
|
|
63
|
+
if (!extend)
|
|
64
|
+
return;
|
|
65
|
+
const scene = new Scene3D();
|
|
66
|
+
extend(scene);
|
|
67
|
+
const fill = { type: "canvas3D", scene };
|
|
68
|
+
loader.fill(fill);
|
|
69
|
+
}
|
|
70
|
+
const grids = new WeakMap();
|
|
71
|
+
/**
|
|
72
|
+
* Your 3D children's scene with this view's settings, its grid, and the default
|
|
73
|
+
* camera and lights where the scene has none; `extend` draws more into it last.
|
|
74
|
+
* `null` when there is nothing to show.
|
|
75
|
+
*/
|
|
76
|
+
export function scene(ctx, s, extend) {
|
|
77
|
+
const scene = ctx.scene3D();
|
|
78
|
+
const hasChildren = scene.ops().length > 0;
|
|
79
|
+
const shadows = resolveShadows3D(s.shadows);
|
|
80
|
+
if (shadows)
|
|
81
|
+
scene.shadows(shadows);
|
|
82
|
+
if (s.tone !== undefined || s.exposure !== undefined)
|
|
83
|
+
scene.tone({ mapping: s.tone, exposure: s.exposure });
|
|
84
|
+
if (s.post !== undefined)
|
|
85
|
+
scene.post(s.post);
|
|
86
|
+
const fog = scene.fogDescriptor();
|
|
87
|
+
if (fog && fog.color === undefined) {
|
|
88
|
+
const base = baseColor(s.fill);
|
|
89
|
+
if (base !== undefined)
|
|
90
|
+
scene.fog({ ...fog, color: base });
|
|
91
|
+
}
|
|
92
|
+
if (s.showGrid) {
|
|
93
|
+
scene.draw(new Graphics3D().line({
|
|
94
|
+
geometry: gridOf(internalsOf(ctx).host, s),
|
|
95
|
+
segments: true,
|
|
96
|
+
material: { type: "lineBasic", vertexColors: true, toneMapped: false },
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
if (!extend && scene.isEmpty() && !hasChildren)
|
|
100
|
+
return null;
|
|
101
|
+
if (scene.cameraDescriptor() === null) {
|
|
102
|
+
scene.perspective({ fov: s.fov, orbit: cameraOrbit(s.orbit), elevation: s.elevation, distance: s.zoom });
|
|
103
|
+
}
|
|
104
|
+
if (!scene.ops().some((op) => op.kind === "light")) {
|
|
105
|
+
scene
|
|
106
|
+
.light({ type: "ambient", intensity: s.ambientIntensity, color: s.ambientColor })
|
|
107
|
+
.light({ type: "directional", intensity: s.keyIntensity, color: s.keyColor }, { position: [4, 6, 3] })
|
|
108
|
+
.light({ type: "directional", intensity: s.keyIntensity * 0.35, color: s.keyColor }, { position: [-5, -2, -4] });
|
|
109
|
+
}
|
|
110
|
+
extend?.(scene);
|
|
111
|
+
return scene.isEmpty() ? null : scene;
|
|
112
|
+
}
|
|
113
|
+
/** The box painted, with the scene as its top fill layer. */
|
|
114
|
+
export function draw(ctx, s, extend) {
|
|
115
|
+
const built = scene(ctx, s, extend);
|
|
116
|
+
const internals = internalsOf(ctx);
|
|
117
|
+
if (built && !internals.probing) {
|
|
118
|
+
built.assertBalanced();
|
|
119
|
+
// A surface texture draws a detached 2D node: it renders in this node's scope.
|
|
120
|
+
const host = internals.host;
|
|
121
|
+
forEachTexture3D(built, (texture) => {
|
|
122
|
+
if (!isSurfaceTexture3D(texture))
|
|
123
|
+
return;
|
|
124
|
+
const source = resolveSurfaceSource(texture.source);
|
|
125
|
+
if (source.kind === "node")
|
|
126
|
+
host.attachDetached(source.node);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const fill = built ? [...s.fill, ...Fills.canvas3D(built, { maxPixelRatio: s.maxPixelRatio, antialias: s.antialias })] : s.fill;
|
|
130
|
+
Paint.draw(ctx, s, Corners.rect(ctx.size, s), { fill: fill });
|
|
131
|
+
}
|
|
132
|
+
function gridOf(host, s) {
|
|
133
|
+
const options = {
|
|
134
|
+
size: s.gridSize,
|
|
135
|
+
divisions: Math.max(1, Math.round(s.gridDivisions)),
|
|
136
|
+
majorEvery: Math.max(1, Math.round(s.gridMajorEvery)),
|
|
137
|
+
minorColor: s.gridColor,
|
|
138
|
+
majorColor: s.gridMajorColor,
|
|
139
|
+
axisXColor: s.axisXColor,
|
|
140
|
+
axisZColor: s.axisZColor,
|
|
141
|
+
showAxes: s.showAxes,
|
|
142
|
+
fadeTo: fadeColor(s),
|
|
143
|
+
fade: s.gridFade,
|
|
144
|
+
};
|
|
145
|
+
const key = JSON.stringify(options);
|
|
146
|
+
let kept = grids.get(host);
|
|
147
|
+
if (kept?.key !== key)
|
|
148
|
+
grids.set(host, kept = { key, geometry: gridGeometry3D(options) });
|
|
149
|
+
return kept.geometry;
|
|
150
|
+
}
|
|
151
|
+
/** The grid fades into the first visible solid fill, so it melts into the background. */
|
|
152
|
+
function fadeColor(s) {
|
|
153
|
+
for (const layer of s.fill) {
|
|
154
|
+
if (layer?.type !== "solid")
|
|
155
|
+
continue;
|
|
156
|
+
const color = layer.color;
|
|
157
|
+
if (typeof color === "string")
|
|
158
|
+
return color;
|
|
159
|
+
if (Array.isArray(color) && (color[3] ?? 1) > 0)
|
|
160
|
+
return color;
|
|
161
|
+
}
|
|
162
|
+
return s.gridFadeColor;
|
|
163
|
+
}
|
|
164
|
+
function baseColor(fill) {
|
|
165
|
+
for (const layer of fill) {
|
|
166
|
+
if (layer && layer.type === "solid")
|
|
167
|
+
return layer.color;
|
|
168
|
+
}
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=view3d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view3d.js","sourceRoot":"","sources":["../../../src/components/modules/view3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAsB,MAAM,6CAA6C,CAAC;AAEjG,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,g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AAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1F,OAAO,IAAI,CAAC,QAAQ,CAAC;AACzB,CAAC;AAED,yFAAyF;AACzF,SAAS,SAAS,CAAC,CAAY;IAC3B,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,IAAyE,EAAE,CAAC;QAC9F,IAAI,KAAK,EAAE,IAAI,KAAK,OAAO;YAAE,SAAS;QACtC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;YAAE,OAAO,KAAc,CAAC;IAC3E,CAAC;IACD,OAAO,CAAC,CAAC,aAAa,CAAC;AAC3B,CAAC;AAED,SAAS,SAAS,CAAC,IAA6B;IAC5C,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,KAAK,IAAK,KAA2B,CAAC,IAAI,KAAK,OAAO;YAAE,OAAQ,KAAqC,CAAC,KAAK,CAAC;IACpH,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC","sourcesContent":["import type { LoaderFn } from \"@/assets/record\";\r\nimport { cameraOrbit, lerpColor3D, resolveColor3D } from \"@/attributes/render3d/orbit\";\r\nimport type { Color, NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\r\nimport { Fills } from \"@/attributes/shape/fill/chain\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport { gridGeometry3D, type Grid3DOptions } from \"@/components/builtins/three/grid-geometry3d\";\r\nimport type { BufferGeometry3D } from \"@/render3d/geometry\";\r\nimport { Graphics3D } from \"@/render3d/graphics3d\";\r\nimport { warmCanvas3D } from \"@/render3d/resources\";\r\nimport { resolveShadows3D, type PostEffect3D, type Shadows3D, type ToneMapping3D } from \"@/render3d/scene-settings\";\r\nimport { Scene3D } from \"@/render3d/scene3d\";\r\nimport type { Canvas3DFillResolved } from \"@/attributes/shape/fill/implementations/canvas3d\";\r\nimport { isSurfaceTexture3D, resolveSurfaceSource } from \"@/render3d/texture\";\r\nimport { forEachTexture3D } from \"@/render3d/walk\";\r\nimport type { Loader, RenderContext2D, Type, Values } from \"@/components/factory/api\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport { internalsOf } from \"@/components/factory/views\";\r\nimport * as Corners from \"@/components/modules/corners\";\r\nimport * as Paint from \"@/components/modules/paint\";\r\nimport { optional } from \"@/components/modules/three-entries\";\r\n\r\n/**\r\n * A viewport onto its 3D children: the default camera and light rig a scene\r\n * gets when it has none of its own, the floor grid, and the render settings.\r\n */\r\n\r\nfunction color3D(initial: Color): Type<Color, NormalizedColor> {\r\n return Types.custom<Color, NormalizedColor>(initial, { resolve: resolveColor3D, lerp: lerpColor3D });\r\n}\r\n\r\nexport const state = {\r\n orbit: Types.number(35, { step: 1, unit: \"°\" }),\r\n elevation: Types.number(20, { min: -89, max: 89, step: 1, unit: \"°\" }),\r\n zoom: Types.number(12, { min: 0.01, step: 0.1 }),\r\n fov: Types.custom(45),\r\n ambientIntensity: Types.custom(0.45),\r\n ambientColor: color3D(\"#ffffff\"),\r\n keyIntensity: Types.custom(2.4),\r\n keyColor: color3D(\"#ffffff\"),\r\n showGrid: Types.custom(false),\r\n gridSize: Types.custom(40),\r\n gridDivisions: Types.custom(40),\r\n gridMajorEvery: Types.custom(5),\r\n gridColor: color3D(\"#26292f\"),\r\n gridMajorColor: color3D(\"#363a42\"),\r\n showAxes: Types.custom(false),\r\n axisXColor: color3D(\"#c8404f\"),\r\n axisZColor: color3D(\"#2f6fd0\"),\r\n gridFade: Types.custom(0.55),\r\n gridFadeColor: color3D(\"#0b0d12\"),\r\n maxPixelRatio: Types.custom(2),\r\n antialias: Types.custom(true),\r\n shadows: Types.custom<Shadows3D>(false),\r\n tone: optional<ToneMapping3D>(),\r\n exposure: optional<number>(),\r\n post: optional<PostEffect3D | readonly PostEffect3D[]>(),\r\n};\r\n\r\nexport const commands = {\r\n /** Swing the default camera: only the angles given move. */\r\n orbitTo: { args: [\"orbit\", \"elevation\", \"zoom\"] as const },\r\n};\r\n\r\ntype ViewState = Values<typeof state> & { readonly fill: FillResolved[] };\r\n\r\nconst loadThreeRuntime: LoaderFn = async () => {\r\n await warmCanvas3D();\r\n};\r\n\r\n/**\r\n * The 3D runtime, warmed before the first frame, and whatever `extend` draws:\r\n * pass the `extend` your render hands {@link draw}, so its textures, models and\r\n * surfaces load before a frame needs them, as a 3D child's own drawing does.\r\n */\r\nexport function load(loader: Loader, extend?: (scene: Scene3D) => void): void {\r\n loader.task(\"three:runtime\", loadThreeRuntime);\r\n if (!extend) return;\r\n const scene = new Scene3D();\r\n extend(scene);\r\n const fill: Canvas3DFillResolved = { type: \"canvas3D\", scene };\r\n loader.fill(fill);\r\n}\r\n\r\nconst grids = new WeakMap<object, { readonly key: string; readonly geometry: BufferGeometry3D }>();\r\n\r\n/**\r\n * Your 3D children's scene with this view's settings, its grid, and the default\r\n * camera and lights where the scene has none; `extend` draws more into it last.\r\n * `null` when there is nothing to show.\r\n */\r\nexport function scene(ctx: RenderContext2D, s: ViewState, extend?: (scene: Scene3D) => void): Scene3D | null {\r\n const scene = ctx.scene3D();\r\n const hasChildren = scene.ops().length > 0;\r\n const shadows = resolveShadows3D(s.shadows);\r\n if (shadows) scene.shadows(shadows);\r\n if (s.tone !== undefined || s.exposure !== undefined) scene.tone({ mapping: s.tone, exposure: s.exposure });\r\n if (s.post !== undefined) scene.post(s.post);\r\n const fog = scene.fogDescriptor();\r\n if (fog && fog.color === undefined) {\r\n const base = baseColor(s.fill);\r\n if (base !== undefined) scene.fog({ ...fog, color: base });\r\n }\r\n if (s.showGrid) {\r\n scene.draw(new Graphics3D().line({\r\n geometry: gridOf(internalsOf(ctx).host, s),\r\n segments: true,\r\n material: { type: \"lineBasic\", vertexColors: true, toneMapped: false },\r\n }));\r\n }\r\n if (!extend && scene.isEmpty() && !hasChildren) return null;\r\n if (scene.cameraDescriptor() === null) {\r\n scene.perspective({ fov: s.fov, orbit: cameraOrbit(s.orbit), elevation: s.elevation, distance: s.zoom });\r\n }\r\n if (!scene.ops().some((op) => op.kind === \"light\")) {\r\n scene\r\n .light({ type: \"ambient\", intensity: s.ambientIntensity, color: s.ambientColor })\r\n .light({ type: \"directional\", intensity: s.keyIntensity, color: s.keyColor }, { position: [4, 6, 3] })\r\n .light({ type: \"directional\", intensity: s.keyIntensity * 0.35, color: s.keyColor }, { position: [-5, -2, -4] });\r\n }\r\n extend?.(scene);\r\n return scene.isEmpty() ? null : scene;\r\n}\r\n\r\n/** The box painted, with the scene as its top fill layer. */\r\nexport function draw(ctx: RenderContext2D, s: ViewState & Parameters<typeof Paint.draw>[1] & Values<typeof Corners.state>, extend?: (scene: Scene3D) => void): void {\r\n const built = scene(ctx, s, extend);\r\n const internals = internalsOf(ctx);\r\n if (built && !internals.probing) {\r\n built.assertBalanced();\r\n // A surface texture draws a detached 2D node: it renders in this node's scope.\r\n const host = internals.host as unknown as { attachDetached(node: object): void };\r\n forEachTexture3D(built, (texture) => {\r\n if (!isSurfaceTexture3D(texture)) return;\r\n const source = resolveSurfaceSource(texture.source);\r\n if (source.kind === \"node\") host.attachDetached(source.node);\r\n });\r\n }\r\n const fill = built ? [...s.fill, ...Fills.canvas3D(built, { maxPixelRatio: s.maxPixelRatio, antialias: s.antialias })] : s.fill;\r\n Paint.draw(ctx, s, Corners.rect(ctx.size, s), { fill: fill as never });\r\n}\r\n\r\nfunction gridOf(host: object, s: ViewState): BufferGeometry3D {\r\n const options: Grid3DOptions = {\r\n size: s.gridSize,\r\n divisions: Math.max(1, Math.round(s.gridDivisions)),\r\n majorEvery: Math.max(1, Math.round(s.gridMajorEvery)),\r\n minorColor: s.gridColor,\r\n majorColor: s.gridMajorColor,\r\n axisXColor: s.axisXColor,\r\n axisZColor: s.axisZColor,\r\n showAxes: s.showAxes,\r\n fadeTo: fadeColor(s),\r\n fade: s.gridFade,\r\n };\r\n const key = JSON.stringify(options);\r\n let kept = grids.get(host);\r\n if (kept?.key !== key) grids.set(host, kept = { key, geometry: gridGeometry3D(options) });\r\n return kept.geometry;\r\n}\r\n\r\n/** The grid fades into the first visible solid fill, so it melts into the background. */\r\nfunction fadeColor(s: ViewState): Color {\r\n for (const layer of s.fill as unknown as readonly ({ type?: string; color?: unknown } | null)[]) {\r\n if (layer?.type !== \"solid\") continue;\r\n const color = layer.color;\r\n if (typeof color === \"string\") return color;\r\n if (Array.isArray(color) && (color[3] ?? 1) > 0) return color as Color;\r\n }\r\n return s.gridFadeColor;\r\n}\r\n\r\nfunction baseColor(fill: readonly FillResolved[]): Color | undefined {\r\n for (const layer of fill) {\r\n if (layer && (layer as { type?: string }).type === \"solid\") return (layer as unknown as { color: Color }).color;\r\n }\r\n return undefined;\r\n}\r\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Node2D } from "../../../components/trees/2d/node2d.js";
|
|
2
|
+
import { BoxBounds } from "../../../layout/bounds.js";
|
|
3
|
+
/**
|
|
4
|
+
* The ink extent of a node whose drawing is made **out of its children** rather
|
|
5
|
+
* than out of a box of its own — a {@link BooleanGroup}, a {@link MaskGroup}.
|
|
6
|
+
*
|
|
7
|
+
* Both of those classes report their layout cell as their bounds by default,
|
|
8
|
+
* and for both that cell is a fiction: nothing is drawn at its edges, nothing
|
|
9
|
+
* is grabbable there, and it does not move when the parts inside it do. An
|
|
10
|
+
* editor drawing a selection box around one is drawing a rectangle that has no
|
|
11
|
+
* relationship to the pixels — which is exactly what {@link Node2D._localBounds}
|
|
12
|
+
* exists to fix, and the reason it is a separate seam from `measure()`: the box
|
|
13
|
+
* moves, the layout does not.
|
|
14
|
+
*
|
|
15
|
+
* ## Why an op decides the answer
|
|
16
|
+
*
|
|
17
|
+
* A bounding box is the one thing about a boolean result you *can* work out
|
|
18
|
+
* without running the boolean. For a union it is even exact —
|
|
19
|
+
* `bounds(A ∪ B) = bounds(A) ∪ bounds(B)` — and the same union is the honest
|
|
20
|
+
* answer for `exclude`, whose result is a subset of it and whose parts are all
|
|
21
|
+
* still there to be seen. The other two shrink instead: subtracting can only
|
|
22
|
+
* ever cut into the first child, and an intersection lives inside every child
|
|
23
|
+
* at once. So each mode below states which of those it is, and the result is a
|
|
24
|
+
* *superset* of the true silhouette for `subtract`/`intersect` and exact for
|
|
25
|
+
* the other two — never a box the drawing spills out of, which is the failure
|
|
26
|
+
* that would matter.
|
|
27
|
+
*
|
|
28
|
+
* ## Why this composes with a resize that scales the children
|
|
29
|
+
*
|
|
30
|
+
* An editor can resize one of these nodes by scaling every child about the
|
|
31
|
+
* corner the drag holds still, and that gesture is only
|
|
32
|
+
* coherent if the box it is dragging follows the parts by the same factor. It
|
|
33
|
+
* does, for all three modes: an axis-aligned scale about a point commutes with
|
|
34
|
+
* union and intersection alike, so scaling every child by `k` scales the answer
|
|
35
|
+
* here by exactly `k`. Neither half has to know about the other.
|
|
36
|
+
*/
|
|
37
|
+
export type ChildBoundsMode =
|
|
38
|
+
/** Every child's ink, together — `union` and `exclude`. */
|
|
39
|
+
"union"
|
|
40
|
+
/** The first child's ink alone — `subtract`'s base, and a mask's stencil. */
|
|
41
|
+
| "first"
|
|
42
|
+
/** Where every child's ink overlaps — `intersect`. */
|
|
43
|
+
| "intersect";
|
|
44
|
+
/**
|
|
45
|
+
* The extent of `node`'s children's ink in `node`'s own local space, or `null`
|
|
46
|
+
* when there is nothing to measure — no children, or an `intersect` whose parts
|
|
47
|
+
* don't overlap at all.
|
|
48
|
+
*
|
|
49
|
+
* `null` is the caller's cue to keep the layout cell: a node with no children
|
|
50
|
+
* has nothing else to offer, and an empty intersection draws nothing anywhere,
|
|
51
|
+
* so a box round the parts would be a box round a shape that isn't there. The
|
|
52
|
+
* cell at least stays in one place and stays grabbable, which is what a node you
|
|
53
|
+
* need to put another child into has to be.
|
|
54
|
+
*/
|
|
55
|
+
export declare function childInkBounds(node: Node2D, mode: ChildBoundsMode): BoxBounds | null;
|
|
56
|
+
//# sourceMappingURL=group-bounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-bounds.d.ts","sourceRoot":"","sources":["../../../../src/components/trees/2d/group-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,eAAe;AACvB,2DAA2D;AACzD,OAAO;AACT,6EAA6E;GAC3E,OAAO;AACT,sDAAsD;GACpD,WAAW,CAAC;AAkDlB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,GACtB,SAAS,GAAG,IAAI,CA+BlB"}
|