@arkitektio/bsx 0.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -16
- package/dist/catalogs/html.d.ts +117 -0
- package/dist/catalogs/html.d.ts.map +1 -0
- package/dist/catalogs/html.js +14 -0
- package/dist/catalogs/html.js.map +1 -0
- package/dist/catalogs/index.d.ts +6059 -0
- package/dist/catalogs/index.d.ts.map +1 -0
- package/dist/catalogs/index.js +11 -0
- package/dist/catalogs/index.js.map +1 -0
- package/dist/catalogs/logo.d.ts +214 -0
- package/dist/catalogs/logo.d.ts.map +1 -0
- package/dist/catalogs/logo.js +27 -0
- package/dist/catalogs/logo.js.map +1 -0
- package/dist/catalogs/parts/data.d.ts +408 -0
- package/dist/catalogs/parts/data.d.ts.map +1 -0
- package/dist/catalogs/parts/data.js +206 -0
- package/dist/catalogs/parts/data.js.map +1 -0
- package/dist/catalogs/parts/feedback.d.ts +440 -0
- package/dist/catalogs/parts/feedback.d.ts.map +1 -0
- package/dist/catalogs/parts/feedback.js +70 -0
- package/dist/catalogs/parts/feedback.js.map +1 -0
- package/dist/catalogs/parts/forms.d.ts +874 -0
- package/dist/catalogs/parts/forms.d.ts.map +1 -0
- package/dist/catalogs/parts/forms.js +302 -0
- package/dist/catalogs/parts/forms.js.map +1 -0
- package/dist/catalogs/parts/html.d.ts +93 -0
- package/dist/catalogs/parts/html.d.ts.map +1 -0
- package/dist/catalogs/parts/html.js +45 -0
- package/dist/catalogs/parts/html.js.map +1 -0
- package/dist/catalogs/parts/icons.d.ts +266 -0
- package/dist/catalogs/parts/icons.d.ts.map +1 -0
- package/dist/catalogs/parts/icons.js +149 -0
- package/dist/catalogs/parts/icons.js.map +1 -0
- package/dist/catalogs/parts/index.d.ts +5765 -0
- package/dist/catalogs/parts/index.d.ts.map +1 -0
- package/dist/catalogs/parts/index.js +38 -0
- package/dist/catalogs/parts/index.js.map +1 -0
- package/dist/catalogs/parts/inspector.d.ts +10 -0
- package/dist/catalogs/parts/inspector.d.ts.map +1 -0
- package/dist/catalogs/parts/inspector.js +12 -0
- package/dist/catalogs/parts/inspector.js.map +1 -0
- package/dist/catalogs/parts/layout.d.ts +647 -0
- package/dist/catalogs/parts/layout.d.ts.map +1 -0
- package/dist/catalogs/parts/layout.js +188 -0
- package/dist/catalogs/parts/layout.js.map +1 -0
- package/dist/catalogs/parts/logo.d.ts +321 -0
- package/dist/catalogs/parts/logo.d.ts.map +1 -0
- package/dist/catalogs/parts/logo.js +227 -0
- package/dist/catalogs/parts/logo.js.map +1 -0
- package/dist/catalogs/parts/navigation.d.ts +697 -0
- package/dist/catalogs/parts/navigation.d.ts.map +1 -0
- package/dist/catalogs/parts/navigation.js +194 -0
- package/dist/catalogs/parts/navigation.js.map +1 -0
- package/dist/catalogs/parts/overlays.d.ts +2012 -0
- package/dist/catalogs/parts/overlays.d.ts.map +1 -0
- package/dist/catalogs/parts/overlays.js +191 -0
- package/dist/catalogs/parts/overlays.js.map +1 -0
- package/dist/catalogs/parts/run.d.ts +41 -0
- package/dist/catalogs/parts/run.d.ts.map +1 -0
- package/dist/catalogs/parts/run.js +46 -0
- package/dist/catalogs/parts/run.js.map +1 -0
- package/dist/catalogs/parts/scene.d.ts +326 -0
- package/dist/catalogs/parts/scene.d.ts.map +1 -0
- package/dist/catalogs/parts/scene.js +237 -0
- package/dist/catalogs/parts/scene.js.map +1 -0
- package/dist/catalogs/parts/structure.d.ts +51 -0
- package/dist/catalogs/parts/structure.d.ts.map +1 -0
- package/dist/catalogs/parts/structure.js +66 -0
- package/dist/catalogs/parts/structure.js.map +1 -0
- package/dist/catalogs/parts/toast.d.ts +37 -0
- package/dist/catalogs/parts/toast.d.ts.map +1 -0
- package/dist/catalogs/parts/toast.js +23 -0
- package/dist/catalogs/parts/toast.js.map +1 -0
- package/dist/catalogs/parts/typography.d.ts +174 -0
- package/dist/catalogs/parts/typography.d.ts.map +1 -0
- package/dist/catalogs/parts/typography.js +56 -0
- package/dist/catalogs/parts/typography.js.map +1 -0
- package/dist/{renderer/bloks/shared/schemas.d.ts → catalogs/props.d.ts} +3 -3
- package/dist/catalogs/props.d.ts.map +1 -0
- package/dist/{renderer/bloks/shared/schemas.js → catalogs/props.js} +3 -4
- package/dist/catalogs/props.js.map +1 -0
- package/dist/catalogs/scene.d.ts +250 -0
- package/dist/catalogs/scene.d.ts.map +1 -0
- package/dist/catalogs/scene.js +28 -0
- package/dist/catalogs/scene.js.map +1 -0
- package/dist/catalogs/shadcn.d.ts +2397 -0
- package/dist/catalogs/shadcn.d.ts.map +1 -0
- package/dist/catalogs/shadcn.js +82 -0
- package/dist/catalogs/shadcn.js.map +1 -0
- package/dist/catalogs/structure.d.ts +61 -0
- package/dist/catalogs/structure.d.ts.map +1 -0
- package/dist/catalogs/structure.js +14 -0
- package/dist/catalogs/structure.js.map +1 -0
- package/dist/catalogs/ui.d.ts +3027 -0
- package/dist/catalogs/ui.d.ts.map +1 -0
- package/dist/catalogs/ui.js +91 -0
- package/dist/catalogs/ui.js.map +1 -0
- package/dist/catalogs.d.ts +5 -0
- package/dist/catalogs.d.ts.map +1 -0
- package/dist/catalogs.js +6 -0
- package/dist/catalogs.js.map +1 -0
- package/dist/platform.d.ts +11 -2
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js.map +1 -1
- package/dist/renderer/bloks/control.d.ts.map +1 -1
- package/dist/renderer/bloks/control.js +5 -1
- package/dist/renderer/bloks/control.js.map +1 -1
- package/dist/renderer/bloks/data.d.ts +378 -27
- package/dist/renderer/bloks/data.d.ts.map +1 -1
- package/dist/renderer/bloks/data.js +55 -251
- package/dist/renderer/bloks/data.js.map +1 -1
- package/dist/renderer/bloks/feedback.d.ts +425 -8
- package/dist/renderer/bloks/feedback.d.ts.map +1 -1
- package/dist/renderer/bloks/feedback.js +23 -79
- package/dist/renderer/bloks/feedback.js.map +1 -1
- package/dist/renderer/bloks/forms.d.ts +828 -42
- package/dist/renderer/bloks/forms.d.ts.map +1 -1
- package/dist/renderer/bloks/forms.js +78 -368
- package/dist/renderer/bloks/forms.js.map +1 -1
- package/dist/renderer/bloks/html.d.ts +84 -9
- package/dist/renderer/bloks/html.d.ts.map +1 -1
- package/dist/renderer/bloks/html.js +13 -48
- package/dist/renderer/bloks/html.js.map +1 -1
- package/dist/renderer/bloks/icons.d.ts +133 -130
- package/dist/renderer/bloks/icons.d.ts.map +1 -1
- package/dist/renderer/bloks/icons.js +10 -23
- package/dist/renderer/bloks/icons.js.map +1 -1
- package/dist/renderer/bloks/index.d.ts +5251 -16
- package/dist/renderer/bloks/index.d.ts.map +1 -1
- package/dist/renderer/bloks/index.js +29 -27
- package/dist/renderer/bloks/index.js.map +1 -1
- package/dist/renderer/bloks/inspector/Inspector.d.ts +5 -1
- package/dist/renderer/bloks/inspector/Inspector.d.ts.map +1 -1
- package/dist/renderer/bloks/inspector/Inspector.js +5 -11
- package/dist/renderer/bloks/inspector/Inspector.js.map +1 -1
- package/dist/renderer/bloks/layout.d.ts +432 -15
- package/dist/renderer/bloks/layout.d.ts.map +1 -1
- package/dist/renderer/bloks/layout.js +43 -224
- package/dist/renderer/bloks/layout.js.map +1 -1
- package/dist/renderer/bloks/logo/index.d.ts +172 -24
- package/dist/renderer/bloks/logo/index.d.ts.map +1 -1
- package/dist/renderer/bloks/logo/index.js +42 -236
- package/dist/renderer/bloks/logo/index.js.map +1 -1
- package/dist/renderer/bloks/navigation.d.ts +651 -28
- package/dist/renderer/bloks/navigation.d.ts.map +1 -1
- package/dist/renderer/bloks/navigation.js +65 -249
- package/dist/renderer/bloks/navigation.js.map +1 -1
- package/dist/renderer/bloks/overlays.d.ts +1998 -55
- package/dist/renderer/bloks/overlays.d.ts.map +1 -1
- package/dist/renderer/bloks/overlays.js +87 -265
- package/dist/renderer/bloks/overlays.js.map +1 -1
- package/dist/renderer/bloks/run/components.d.ts +13 -4
- package/dist/renderer/bloks/run/components.d.ts.map +1 -1
- package/dist/renderer/bloks/run/components.js +12 -34
- package/dist/renderer/bloks/run/components.js.map +1 -1
- package/dist/renderer/bloks/run/index.d.ts +1 -1
- package/dist/renderer/bloks/run/index.d.ts.map +1 -1
- package/dist/renderer/bloks/run/index.js +1 -1
- package/dist/renderer/bloks/run/index.js.map +1 -1
- package/dist/renderer/bloks/scene/Model.d.ts +6 -2
- package/dist/renderer/bloks/scene/Model.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/Model.js +4 -48
- package/dist/renderer/bloks/scene/Model.js.map +1 -1
- package/dist/renderer/bloks/scene/Scene.d.ts +4 -1
- package/dist/renderer/bloks/scene/Scene.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/Scene.js +3 -24
- package/dist/renderer/bloks/scene/Scene.js.map +1 -1
- package/dist/renderer/bloks/scene/Transform.d.ts +5 -1
- package/dist/renderer/bloks/scene/Transform.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/Transform.js +3 -25
- package/dist/renderer/bloks/scene/Transform.js.map +1 -1
- package/dist/renderer/bloks/scene/bindings.d.ts +40 -8
- package/dist/renderer/bloks/scene/bindings.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/bindings.js +18 -102
- package/dist/renderer/bloks/scene/bindings.js.map +1 -1
- package/dist/renderer/bloks/scene/index.d.ts +194 -1
- package/dist/renderer/bloks/scene/index.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/index.js +21 -21
- package/dist/renderer/bloks/scene/index.js.map +1 -1
- package/dist/renderer/bloks/scene/interaction.d.ts +6 -2
- package/dist/renderer/bloks/scene/interaction.d.ts.map +1 -1
- package/dist/renderer/bloks/scene/interaction.js +6 -42
- package/dist/renderer/bloks/scene/interaction.js.map +1 -1
- package/dist/renderer/bloks/shared/index.d.ts +0 -1
- package/dist/renderer/bloks/shared/index.d.ts.map +1 -1
- package/dist/renderer/bloks/shared/index.js +0 -1
- package/dist/renderer/bloks/shared/index.js.map +1 -1
- package/dist/renderer/bloks/shared/props.d.ts +1 -1
- package/dist/renderer/bloks/shared/props.d.ts.map +1 -1
- package/dist/renderer/bloks/shared/props.js +1 -1
- package/dist/renderer/bloks/shared/props.js.map +1 -1
- package/dist/renderer/bloks/testing.d.ts +1 -1
- package/dist/renderer/bloks/testing.d.ts.map +1 -1
- package/dist/renderer/bloks/testing.js +5 -5
- package/dist/renderer/bloks/testing.js.map +1 -1
- package/dist/renderer/bloks/toast.d.ts +15 -5
- package/dist/renderer/bloks/toast.d.ts.map +1 -1
- package/dist/renderer/bloks/toast.js +11 -19
- package/dist/renderer/bloks/toast.js.map +1 -1
- package/dist/renderer/bloks/typography.d.ts +166 -24
- package/dist/renderer/bloks/typography.d.ts.map +1 -1
- package/dist/renderer/bloks/typography.js +22 -98
- package/dist/renderer/bloks/typography.js.map +1 -1
- package/dist/renderer/catalog.d.ts +3 -19
- package/dist/renderer/catalog.d.ts.map +1 -1
- package/dist/renderer/catalog.js +12 -29
- package/dist/renderer/catalog.js.map +1 -1
- package/dist/renderer/declare.d.ts +40 -0
- package/dist/renderer/declare.d.ts.map +1 -0
- package/dist/renderer/declare.js +40 -0
- package/dist/renderer/declare.js.map +1 -0
- package/dist/renderer/modules.d.ts +1 -18
- package/dist/renderer/modules.d.ts.map +1 -1
- package/dist/renderer/modules.js +1 -31
- package/dist/renderer/modules.js.map +1 -1
- package/dist/renderer/runtime/catalog.d.ts +63 -0
- package/dist/renderer/runtime/catalog.d.ts.map +1 -0
- package/dist/renderer/runtime/catalog.js +33 -0
- package/dist/renderer/runtime/catalog.js.map +1 -0
- package/dist/renderer/runtime/components.d.ts +27 -1
- package/dist/renderer/runtime/components.d.ts.map +1 -1
- package/dist/renderer/runtime/components.js +3 -0
- package/dist/renderer/runtime/components.js.map +1 -1
- package/dist/renderer/runtime/describe.d.ts +49 -0
- package/dist/renderer/runtime/describe.d.ts.map +1 -0
- package/dist/renderer/runtime/describe.js +127 -0
- package/dist/renderer/runtime/describe.js.map +1 -0
- package/dist/renderer/runtime/functions.d.ts +0 -13
- package/dist/renderer/runtime/functions.d.ts.map +1 -1
- package/dist/renderer/runtime/functions.js +0 -14
- package/dist/renderer/runtime/functions.js.map +1 -1
- package/dist/renderer/runtime/index.d.ts +2 -0
- package/dist/renderer/runtime/index.d.ts.map +1 -1
- package/dist/renderer/runtime/index.js +2 -0
- package/dist/renderer/runtime/index.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -0
- package/dist/runtime.js.map +1 -1
- package/dist/scene.d.ts +2 -0
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +27 -1
- package/dist/scene.js.map +1 -1
- package/dist/shadcn.d.ts +5265 -0
- package/dist/shadcn.d.ts.map +1 -0
- package/dist/shadcn.js +194 -0
- package/dist/shadcn.js.map +1 -0
- package/dist/spec/bsx_v2.json +74 -113
- package/dist/spec/catalogs/logo@1.json +39 -25
- package/dist/spec/catalogs/logo@1.json.js +39 -25
- package/dist/spec/catalogs/scene@1.json +23 -23
- package/dist/spec/catalogs/scene@1.json.js +23 -23
- package/dist/spec/{modules/orkestrator.json → catalogs/shadcn@1.json} +1391 -286
- package/dist/spec/{modules/orkestrator.json.js → catalogs/shadcn@1.json.js} +1391 -286
- package/dist/spec/catalogs/structure@1.json +1 -1
- package/dist/spec/catalogs/structure@1.json.js +1 -1
- package/dist/spec/catalogs/ui@1.json +1690 -37
- package/dist/spec/catalogs/ui@1.json.js +1690 -37
- package/dist/spec/catalogs.d.ts +16 -12
- package/dist/spec/catalogs.d.ts.map +1 -1
- package/dist/spec/catalogs.js +23 -15
- package/dist/spec/catalogs.js.map +1 -1
- package/dist/spec/vocabulary.json +1 -1
- package/dist/spec/vocabulary.json.js +1 -1
- package/dist/vendor/core/ui/button-group.d.ts +1 -1
- package/dist/vendor/core/ui/field.d.ts +1 -1
- package/dist/web.d.ts +0 -3
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +2 -4
- package/dist/web.js.map +1 -1
- package/package.json +12 -3
- package/src/bsx/infer.test.ts +2 -2
- package/src/bsx/references.test.ts +2 -2
- package/src/catalogs/catalogs.test.ts +28 -0
- package/src/catalogs/html.ts +14 -0
- package/src/catalogs/index.ts +12 -0
- package/src/catalogs/logo.ts +27 -0
- package/src/catalogs/parts/data.ts +228 -0
- package/src/catalogs/parts/feedback.ts +79 -0
- package/src/catalogs/parts/forms.ts +335 -0
- package/src/catalogs/parts/html.ts +51 -0
- package/src/catalogs/parts/icons.ts +154 -0
- package/src/catalogs/parts/index.ts +38 -0
- package/src/catalogs/parts/inspector.ts +14 -0
- package/src/catalogs/parts/layout.ts +217 -0
- package/src/catalogs/parts/logo.ts +254 -0
- package/src/catalogs/parts/navigation.ts +198 -0
- package/src/catalogs/parts/overlays.ts +221 -0
- package/src/catalogs/parts/run.ts +57 -0
- package/src/catalogs/parts/scene.ts +292 -0
- package/src/catalogs/parts/structure.ts +83 -0
- package/src/catalogs/parts/toast.ts +27 -0
- package/src/catalogs/parts/typography.ts +63 -0
- package/src/{renderer/bloks/shared/schemas.ts → catalogs/props.ts} +2 -3
- package/src/catalogs/scene.ts +28 -0
- package/src/catalogs/shadcn.ts +82 -0
- package/src/catalogs/structure.ts +14 -0
- package/src/catalogs/ui.ts +91 -0
- package/src/catalogs.ts +6 -0
- package/src/platform.ts +8 -2
- package/src/preview/CachedBlokPreview.test.tsx +6 -1
- package/src/renderer/addBlokComponents.test.tsx +9 -7
- package/src/renderer/bloks/control.tsx +8 -1
- package/src/renderer/bloks/data.tsx +339 -621
- package/src/renderer/bloks/feedback.tsx +32 -112
- package/src/renderer/bloks/forms.tsx +103 -504
- package/src/renderer/bloks/html.tsx +16 -78
- package/src/renderer/bloks/icons.tsx +14 -31
- package/src/renderer/bloks/index.ts +28 -38
- package/src/renderer/bloks/inspector/Inspector.tsx +9 -11
- package/src/renderer/bloks/layout.tsx +216 -453
- package/src/renderer/bloks/logo/index.tsx +144 -387
- package/src/renderer/bloks/navigation.tsx +87 -343
- package/src/renderer/bloks/overlays.tsx +106 -524
- package/src/renderer/bloks/primitives.test.tsx +3 -1
- package/src/renderer/bloks/run/components.tsx +20 -58
- package/src/renderer/bloks/run/index.ts +1 -1
- package/src/renderer/bloks/scene/Model.tsx +7 -64
- package/src/renderer/bloks/scene/Scene.tsx +12 -38
- package/src/renderer/bloks/scene/Transform.tsx +6 -34
- package/src/renderer/bloks/scene/animate.test.tsx +2 -2
- package/src/renderer/bloks/scene/bindings.tsx +31 -113
- package/src/renderer/bloks/scene/index.ts +21 -21
- package/src/renderer/bloks/scene/interaction.tsx +7 -59
- package/src/renderer/bloks/shared/index.ts +0 -1
- package/src/renderer/bloks/shared/props.ts +1 -1
- package/src/renderer/bloks/testing.tsx +5 -5
- package/src/renderer/bloks/toast.tsx +16 -31
- package/src/renderer/bloks/typography.tsx +28 -141
- package/src/renderer/bloks/unavailable.test.tsx +3 -1
- package/src/renderer/catalog.tsx +13 -36
- package/src/renderer/declare.ts +82 -0
- package/src/renderer/modules.ts +1 -43
- package/src/renderer/runtime/catalog.test.ts +102 -0
- package/src/renderer/runtime/catalog.ts +108 -0
- package/src/renderer/runtime/components.tsx +27 -0
- package/src/renderer/runtime/describe.ts +180 -0
- package/src/renderer/runtime/functions.ts +0 -25
- package/src/renderer/runtime/index.ts +2 -0
- package/src/runtime.ts +1 -0
- package/src/scene.ts +30 -1
- package/src/shadcn.ts +202 -0
- package/src/spec/bsx_v2.json +74 -113
- package/src/spec/catalogs/logo@1.json +39 -25
- package/src/spec/catalogs/scene@1.json +23 -23
- package/src/spec/{modules/orkestrator.json → catalogs/shadcn@1.json} +1391 -286
- package/src/spec/catalogs/structure@1.json +1 -1
- package/src/spec/catalogs/ui@1.json +1690 -37
- package/src/spec/catalogs.ts +25 -16
- package/src/spec/spec.test.ts +1 -1
- package/src/spec/vocabulary.json +1 -1
- package/src/web.ts +2 -4
- package/dist/renderer/base_v1.json +0 -1541
- package/dist/renderer/bloks/shared/schemas.d.ts.map +0 -1
- package/dist/renderer/bloks/shared/schemas.js.map +0 -1
- package/dist/renderer/functions/argumentSchemas.d.ts +0 -19
- package/dist/renderer/functions/argumentSchemas.d.ts.map +0 -1
- package/dist/renderer/functions/argumentSchemas.js +0 -35
- package/dist/renderer/functions/argumentSchemas.js.map +0 -1
- package/dist/renderer/functions/base.d.ts +0 -3
- package/dist/renderer/functions/base.d.ts.map +0 -1
- package/dist/renderer/functions/base.js +0 -159
- package/dist/renderer/functions/base.js.map +0 -1
- package/dist/renderer/functions/coerce.d.ts +0 -2
- package/dist/renderer/functions/coerce.d.ts.map +0 -1
- package/dist/renderer/functions/coerce.js +0 -73
- package/dist/renderer/functions/coerce.js.map +0 -1
- package/dist/renderer/functions/effects.d.ts +0 -4
- package/dist/renderer/functions/effects.d.ts.map +0 -1
- package/dist/renderer/functions/effects.js +0 -102
- package/dist/renderer/functions/effects.js.map +0 -1
- package/dist/renderer/functions/format.d.ts +0 -2
- package/dist/renderer/functions/format.d.ts.map +0 -1
- package/dist/renderer/functions/format.js +0 -134
- package/dist/renderer/functions/format.js.map +0 -1
- package/dist/renderer/functions/lists.d.ts +0 -2
- package/dist/renderer/functions/lists.d.ts.map +0 -1
- package/dist/renderer/functions/lists.js +0 -139
- package/dist/renderer/functions/lists.js.map +0 -1
- package/dist/renderer/functions/logic.d.ts +0 -3
- package/dist/renderer/functions/logic.d.ts.map +0 -1
- package/dist/renderer/functions/logic.js +0 -37
- package/dist/renderer/functions/logic.js.map +0 -1
- package/dist/renderer/functions/math.d.ts +0 -4
- package/dist/renderer/functions/math.d.ts.map +0 -1
- package/dist/renderer/functions/math.js +0 -61
- package/dist/renderer/functions/math.js.map +0 -1
- package/dist/renderer/functions/objects.d.ts +0 -2
- package/dist/renderer/functions/objects.d.ts.map +0 -1
- package/dist/renderer/functions/objects.js +0 -42
- package/dist/renderer/functions/objects.js.map +0 -1
- package/dist/renderer/functions/strings.d.ts +0 -4
- package/dist/renderer/functions/strings.d.ts.map +0 -1
- package/dist/renderer/functions/strings.js +0 -115
- package/dist/renderer/functions/strings.js.map +0 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { markBindSchema } from '../../renderer/runtime/schemas.js';
|
|
3
|
+
import { actionProp, bindSchema, describedString } from '../props.js';
|
|
4
|
+
/**
|
|
5
|
+
* The 3D vocabulary: three containers place models, a transform places what
|
|
6
|
+
* it holds (and lets a gizmo move it), eight children bind their named nodes
|
|
7
|
+
* to state, and two handle interaction and HTML.
|
|
8
|
+
*
|
|
9
|
+
* Several renders read their props through the module-level schema rather than
|
|
10
|
+
* the `schema` they are handed: those schemas are exported here.
|
|
11
|
+
*/
|
|
12
|
+
/* -------------------------------------------------------------------------- */
|
|
13
|
+
/* Scene */
|
|
14
|
+
/* -------------------------------------------------------------------------- */
|
|
15
|
+
export const sceneSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
camera: z
|
|
18
|
+
.enum(['iso', 'front', 'side', 'top'])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Where the camera starts looking from; it frames the models whatever their size. Defaults to iso.'),
|
|
21
|
+
grid: z.boolean().optional().describe('Whether the ground grid starts shown; the viewer can switch it. Defaults to true.'),
|
|
22
|
+
height: describedString('CSS height of the view, e.g. "24rem". Omit to fit the element the scene is in (24rem where that has no height of its own).'),
|
|
23
|
+
persist: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Keep where the viewer leaves the camera (and the grid) on this device, by the scene\'s explicit id.'),
|
|
27
|
+
})
|
|
28
|
+
.describe('Root of a 3D view: one renderer, camera and light rig. Y is up and one unit is one meter. Place Model and Robot inside.');
|
|
29
|
+
/* -------------------------------------------------------------------------- */
|
|
30
|
+
/* Model and Robot */
|
|
31
|
+
/* -------------------------------------------------------------------------- */
|
|
32
|
+
const modelShape = {
|
|
33
|
+
src: z
|
|
34
|
+
.string()
|
|
35
|
+
.describe('The 3D model to show: an asset its app registered, as in `{self.assets.scope}`.'),
|
|
36
|
+
origin: describedString('Where the model sits in the scene, as "x y z" in meters.'),
|
|
37
|
+
rotation: describedString('How the model is turned, as "x y z" Euler angles in radians.'),
|
|
38
|
+
scale: z.number().optional().describe('Uniform scale. Defaults to 1; a model is authored in meters.'),
|
|
39
|
+
};
|
|
40
|
+
export const modelSchema = z
|
|
41
|
+
.object(modelShape)
|
|
42
|
+
.describe('Places one GLB model in the scene. Its children bind the model\'s named nodes to state. A model that is missing or refused renders a placeholder that says why.');
|
|
43
|
+
const jointValues = z
|
|
44
|
+
.record(z.string(), z.unknown())
|
|
45
|
+
.optional();
|
|
46
|
+
export const robotSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
...modelShape,
|
|
49
|
+
joints: jointValues.describe('Where each joint is: a map of joint name to radians (revolute, continuous) or meters (prismatic). A joint left out keeps its last value.'),
|
|
50
|
+
animateTo: jointValues.describe('Where each joint is going. Joints named here move at speed, or over duration.'),
|
|
51
|
+
speed: z
|
|
52
|
+
.unknown()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('How fast joints move to animateTo, in rad/s or m/s: one number for all joints or a map by joint name.'),
|
|
55
|
+
duration: z
|
|
56
|
+
.unknown()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('How long a move to animateTo takes, in seconds: one number or a map by joint name. Ignored where speed is given.'),
|
|
59
|
+
onJointChange: actionProp('Called when the viewer sets a joint by hand. Arguments may read event.name and event.value.'),
|
|
60
|
+
})
|
|
61
|
+
.describe('A Model with a joint table (extras.arkitekt.joints): applies a joint state map to it, including mimic joints, and clamps to limits.');
|
|
62
|
+
const MODEL_PROP_KINDS = { src: 'ASSET' };
|
|
63
|
+
/* -------------------------------------------------------------------------- */
|
|
64
|
+
/* Transform */
|
|
65
|
+
/* -------------------------------------------------------------------------- */
|
|
66
|
+
export const transformSchema = z
|
|
67
|
+
.object({
|
|
68
|
+
matrix: z
|
|
69
|
+
.unknown()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe('Where the children stand: a 4x4 affine matrix as four rows, in meters with Y up (as a space placement keeps it). The identity when absent or malformed.'),
|
|
72
|
+
bind: markBindSchema(bindSchema.describe('The local holding the matrix (`bind={pose}`): read in place of `matrix`, and written by the gizmo.')),
|
|
73
|
+
persist: z
|
|
74
|
+
.boolean()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('Keep where the gizmo left the children on this device, by the explicit id (unbound: the pose is the component\'s own).'),
|
|
77
|
+
gizmo: z.boolean().optional().describe('Whether a gizmo moves the children. Defaults to true when bound or persisted; never shown while viewing the past.'),
|
|
78
|
+
mode: z.enum(['translate', 'rotate', 'scale']).optional().describe('What the gizmo does: "translate" (the default), "rotate" or "scale".'),
|
|
79
|
+
size: z.number().optional().describe('The size of the gizmo on screen. Defaults to 0.7.'),
|
|
80
|
+
})
|
|
81
|
+
.describe('Places its children by an affine matrix. Bound (`bind={pose}`) or persisted (`id="arm-pose" persist`), a gizmo moves them and keeps the matrix.');
|
|
82
|
+
/* -------------------------------------------------------------------------- */
|
|
83
|
+
/* Bindings */
|
|
84
|
+
/* -------------------------------------------------------------------------- */
|
|
85
|
+
/** Every binding sits somewhere under the model whose nodes it names. */
|
|
86
|
+
const IN_MODEL = { context: 'scene', downstreamOf: ['Model', 'Robot'] };
|
|
87
|
+
/**
|
|
88
|
+
* Bindings an action's overlay may also use under an `At`, on the model the
|
|
89
|
+
* anchored device's scene blok loaded. Interaction (OnClick, Popout) sits here too.
|
|
90
|
+
*/
|
|
91
|
+
const IN_MODEL_OR_AT = { context: 'scene', downstreamOf: ['Model', 'Robot', 'Anchor'] };
|
|
92
|
+
const nodeProp = z.string().describe('The name of the node in the enclosing model that this binds.');
|
|
93
|
+
const motionShape = (unit, rate) => ({
|
|
94
|
+
node: nodeProp,
|
|
95
|
+
axis: z
|
|
96
|
+
.string()
|
|
97
|
+
.describe('The axis in the node\'s own frame: "x", "y", "z" or a vector as "x y z".'),
|
|
98
|
+
value: z
|
|
99
|
+
.unknown()
|
|
100
|
+
.optional()
|
|
101
|
+
.describe(`Where the part is, in ${unit} from the pose the model was authored in. A quantity ({magnitude, unit}) is converted.`),
|
|
102
|
+
animateTo: z
|
|
103
|
+
.unknown()
|
|
104
|
+
.optional()
|
|
105
|
+
.describe('Where the part is going. With it, the view moves there at speed (or over duration) and value corrects it.'),
|
|
106
|
+
speed: z.number().optional().describe(`How fast it moves to animateTo, in ${rate}.`),
|
|
107
|
+
duration: z.number().optional().describe('How long a move to animateTo takes, in seconds. Ignored when speed is given.'),
|
|
108
|
+
scale: z.number().optional().describe('Multiplies the value before it is applied. Defaults to 1.'),
|
|
109
|
+
offset: z.number().optional().describe(`Added after scale, in ${unit}. Defaults to 0.`),
|
|
110
|
+
gain: z.number().optional().describe('Exaggerates the motion on screen only, for travel too small to see. Defaults to 1.'),
|
|
111
|
+
smooth: z.boolean().optional().describe('Whether to ease toward each new value over 300 ms. Defaults to true.'),
|
|
112
|
+
});
|
|
113
|
+
export const moveSchema = z
|
|
114
|
+
.object(motionShape('meters', 'm/s'))
|
|
115
|
+
.describe('Translates a node along an axis by value x scale + offset meters from its authored pose.');
|
|
116
|
+
export const rotateSchema = z
|
|
117
|
+
.object(motionShape('radians', 'rad/s'))
|
|
118
|
+
.describe('Rotates a node about an axis by value x scale + offset radians from its authored pose.');
|
|
119
|
+
export const visibleSchema = z
|
|
120
|
+
.object({
|
|
121
|
+
node: nodeProp,
|
|
122
|
+
on: z.boolean().nullish().describe('Whether the node is visible. Hiding a node hides everything beneath it.'),
|
|
123
|
+
})
|
|
124
|
+
.describe('Shows or hides a node and its whole subtree.');
|
|
125
|
+
export const glowSchema = z
|
|
126
|
+
.object({
|
|
127
|
+
node: describedString('The name of the node in the enclosing model that glows; the whole model when unset.'),
|
|
128
|
+
on: z.boolean().optional().describe('Whether the node glows.'),
|
|
129
|
+
intensity: z.number().optional().describe('How strongly. Defaults to 1 for materials, and to the authored intensity for a light.'),
|
|
130
|
+
color: describedString('The colour of the glow: a colour role of the theme (`brand`, `success`, `chart-1`). Defaults to the material\'s own emissive colour, or white.'),
|
|
131
|
+
})
|
|
132
|
+
.describe('Switches the emissive output of a node\'s materials, or the intensity of a punctual light attached to it.');
|
|
133
|
+
export const tintSchema = z
|
|
134
|
+
.object({
|
|
135
|
+
node: nodeProp,
|
|
136
|
+
color: describedString('The base colour to give the node: a colour role of the theme (`brand`, `muted`, `chart-3`). Without it the authored colour shows.'),
|
|
137
|
+
})
|
|
138
|
+
.describe('Overrides the base color of a node. Its materials are copied first, so nodes sharing them are unaffected.');
|
|
139
|
+
export const attachSchema = z
|
|
140
|
+
.object({
|
|
141
|
+
node: nodeProp,
|
|
142
|
+
to: z
|
|
143
|
+
.string()
|
|
144
|
+
.describe('What to attach it to: a node of this model, or "<model id>:<node>" for a node of another model in the scene.'),
|
|
145
|
+
on: z.boolean().nullish().describe('Whether it is attached. When false the node returns to where it was authored.'),
|
|
146
|
+
})
|
|
147
|
+
.describe('While `on` holds, carries a node with another node, keeping its place in the world at the moment of attaching. For picked-up objects.');
|
|
148
|
+
export const beamSchema = z
|
|
149
|
+
.object({
|
|
150
|
+
start: z.string().describe('The node the beam leaves from.'),
|
|
151
|
+
end: describedString('The node the beam ends at, in this model or as "<model id>:<node>". Use this or length.'),
|
|
152
|
+
length: z.number().optional().describe('How far the beam reaches along the start node\'s own Z axis, in meters. Use this or end.'),
|
|
153
|
+
on: z.boolean().optional().describe('Whether the beam is drawn. Defaults to true.'),
|
|
154
|
+
wavelength: z.number().optional().describe('The wavelength in nanometers, shown as its color.'),
|
|
155
|
+
color: describedString('The colour of the beam: a colour role of the theme (`info`, `chart-2`, `destructive`). Takes precedence over wavelength.'),
|
|
156
|
+
width: z.number().optional().describe('The diameter of the beam in meters. Defaults to 2 mm.'),
|
|
157
|
+
})
|
|
158
|
+
.describe('Draws a beam from one anchor to another, or for a length along an anchor\'s Z axis, following both as they move.');
|
|
159
|
+
export const animateSchema = z
|
|
160
|
+
.object({
|
|
161
|
+
clip: z.string().describe('The name of an animation clip in the enclosing model.'),
|
|
162
|
+
progress: z.number().optional().describe('Where in the clip to show, from 0 (start) to 1 (end). Use this or time.'),
|
|
163
|
+
time: z.number().optional().describe('Where in the clip to show, in seconds. Use this or progress.'),
|
|
164
|
+
animateTo: z.number().optional().describe('The position to play to, in the unit of whichever of progress or time is used.'),
|
|
165
|
+
duration: z.number().optional().describe('How long playing to animateTo takes, in seconds.'),
|
|
166
|
+
})
|
|
167
|
+
.describe('Scrubs a named animation clip of the model to a position, for mechanisms a single move or turn cannot describe. Never loops on its own.');
|
|
168
|
+
/* -------------------------------------------------------------------------- */
|
|
169
|
+
/* Interaction */
|
|
170
|
+
/* -------------------------------------------------------------------------- */
|
|
171
|
+
const nodeOrModelProp = describedString('The name of the node in the enclosing model; the whole model when unset.');
|
|
172
|
+
const titleProp = describedString('The heading of the card; it shows the node name when unset.');
|
|
173
|
+
const descriptionProp = describedString('A line under the heading of the card.');
|
|
174
|
+
export const onClickSchema = z
|
|
175
|
+
.object({
|
|
176
|
+
node: nodeOrModelProp,
|
|
177
|
+
onClick: actionProp('Called when the node is clicked (not when a drag of the view ends on it). Arguments may read event.node and event.point ([x, y, z] in meters, where it was hit).'),
|
|
178
|
+
open: describedString('The name of an html blok to show when the node is clicked.'),
|
|
179
|
+
title: titleProp,
|
|
180
|
+
description: descriptionProp,
|
|
181
|
+
mode: z
|
|
182
|
+
.enum(['popout', 'panel'])
|
|
183
|
+
.optional()
|
|
184
|
+
.describe('Where the opened blok shows: "popout" as a card on the clicked spot (the viewer can drag it aside), "panel" beside the scene. Defaults to popout.'),
|
|
185
|
+
})
|
|
186
|
+
.describe('Makes a node and everything beneath it clickable, with a highlight on hover. A click runs an action, opens a blok, or both; a second click closes it, and opening one card closes the others that are not pinned.');
|
|
187
|
+
export const popoutSchema = z
|
|
188
|
+
.object({
|
|
189
|
+
node: nodeOrModelProp,
|
|
190
|
+
trigger: z
|
|
191
|
+
.enum(['click', 'hover', 'always'])
|
|
192
|
+
.optional()
|
|
193
|
+
.describe('What shows the card: a click on the node, the pointer over it, or always. Defaults to click.'),
|
|
194
|
+
open: z.boolean().optional().describe('Whether the card shows. When bound it decides alone and trigger is ignored.'),
|
|
195
|
+
title: titleProp,
|
|
196
|
+
description: descriptionProp,
|
|
197
|
+
})
|
|
198
|
+
.describe('An HTML card anchored to a node that follows it as it moves; the viewer can drag it aside, and a line keeps pointing at the node. Its children are ordinary html components.');
|
|
199
|
+
export const sceneContracts = {
|
|
200
|
+
Scene: {
|
|
201
|
+
acceptsChildren: true,
|
|
202
|
+
placement: { childrenContext: 'scene', notDownstreamOf: ['Scene'] },
|
|
203
|
+
schema: sceneSchema,
|
|
204
|
+
},
|
|
205
|
+
Model: {
|
|
206
|
+
acceptsChildren: true,
|
|
207
|
+
placement: { context: 'scene', downstreamOf: ['Scene'] },
|
|
208
|
+
propKinds: MODEL_PROP_KINDS,
|
|
209
|
+
schema: modelSchema,
|
|
210
|
+
},
|
|
211
|
+
Robot: {
|
|
212
|
+
acceptsChildren: true,
|
|
213
|
+
placement: { context: 'scene', downstreamOf: ['Scene'] },
|
|
214
|
+
propKinds: MODEL_PROP_KINDS,
|
|
215
|
+
schema: robotSchema,
|
|
216
|
+
},
|
|
217
|
+
Transform: {
|
|
218
|
+
acceptsChildren: true,
|
|
219
|
+
placement: { context: 'scene', downstreamOf: ['Overlay', 'Scene'] },
|
|
220
|
+
schema: transformSchema,
|
|
221
|
+
},
|
|
222
|
+
Move: { placement: IN_MODEL, schema: moveSchema },
|
|
223
|
+
Rotate: { placement: IN_MODEL, schema: rotateSchema },
|
|
224
|
+
Animate: { placement: IN_MODEL, schema: animateSchema },
|
|
225
|
+
Visible: { placement: IN_MODEL, schema: visibleSchema },
|
|
226
|
+
Glow: { placement: IN_MODEL_OR_AT, schema: glowSchema },
|
|
227
|
+
Tint: { placement: IN_MODEL, schema: tintSchema },
|
|
228
|
+
Attach: { placement: IN_MODEL, schema: attachSchema },
|
|
229
|
+
Beam: { placement: IN_MODEL, schema: beamSchema },
|
|
230
|
+
OnClick: { placement: IN_MODEL_OR_AT, schema: onClickSchema },
|
|
231
|
+
Popout: {
|
|
232
|
+
acceptsChildren: true,
|
|
233
|
+
placement: { ...IN_MODEL_OR_AT, childrenContext: 'html' },
|
|
234
|
+
schema: popoutSchema,
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
//# sourceMappingURL=scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.js","sourceRoot":"","sources":["../../../src/catalogs/parts/scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAC,cAAc,EAAC,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AAEjE;;;;;;;GAOG;AAEH,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;SACrC,QAAQ,EAAE;SACV,QAAQ,CAAC,kGAAkG,CAAC;IAC/G,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mFAAmF,CAAC;IAC1H,MAAM,EAAE,eAAe,CACrB,4HAA4H,CAC7H;IACD,OAAO,EAAE,CAAC;SACP,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,qGAAqG,CAAC;CACnH,CAAC;KACD,QAAQ,CACP,yHAAyH,CAC1H,CAAC;AAEJ,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,MAAM,UAAU,GAAG;IACjB,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,CAAC,iFAAiF,CAAC;IAC9F,MAAM,EAAE,eAAe,CAAC,0DAA0D,CAAC;IACnF,QAAQ,EAAE,eAAe,CAAC,8DAA8D,CAAC;IAC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ACjE,MAAM,EAAE,eAAe;KACxB;IACD,IAAI,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAC;IAC/C,MAAM,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAC;IACnD,OAAO,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAC;IACrD,OAAO,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAC;IACrD,IAAI,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAC;IACrD,IAAI,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAC;IAC/C,MAAM,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAC;IACnD,IAAI,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAC;IAC/C,OAAO,EAAE,EAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAC;IAC3D,MAAM,EAAE;QACN,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,EAAC,GAAG,cAAc,EAAE,eAAe,EAAE,MAAM,EAAC;QACvD,MAAM,EAAE,YAAY;KACrB;CAC+B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const structureContracts: {
|
|
3
|
+
StructurePicker: {
|
|
4
|
+
schema: z.ZodObject<{
|
|
5
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
6
|
+
bind: z.ZodOptional<z.ZodString>;
|
|
7
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
8
|
+
object: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
9
|
+
__identifier: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>>;
|
|
11
|
+
query: z.ZodOptional<z.ZodString>;
|
|
12
|
+
ward: z.ZodOptional<z.ZodString>;
|
|
13
|
+
variables: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
14
|
+
placeholder: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
15
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
className: z.ZodOptional<z.ZodString>;
|
|
17
|
+
onChange: z.ZodOptional<z.ZodCustom<() => void, () => void>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
};
|
|
20
|
+
StructureDisplay: {
|
|
21
|
+
schema: z.ZodObject<{
|
|
22
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
23
|
+
object: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
24
|
+
__identifier: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
card: "card";
|
|
28
|
+
inline: "inline";
|
|
29
|
+
avatar: "avatar";
|
|
30
|
+
chip: "chip";
|
|
31
|
+
}>>;
|
|
32
|
+
link: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
emptyText: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
34
|
+
className: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
};
|
|
37
|
+
StructureViewer: {
|
|
38
|
+
schema: z.ZodObject<{
|
|
39
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
40
|
+
object: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
41
|
+
__identifier: z.ZodString;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
height: z.ZodOptional<z.ZodString>;
|
|
44
|
+
minHeight: z.ZodOptional<z.ZodString>;
|
|
45
|
+
controls: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
emptyText: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
47
|
+
className: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../src/catalogs/parts/structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAezB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEG,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { BlokPropSchemas } from '../../renderer/runtime/schemas.js';
|
|
3
|
+
import { actionProp, bindSchema, boolSchema, classNameSchema, disabledSchema, sizeSchema, structureValueSchema } from '../props.js';
|
|
4
|
+
/**
|
|
5
|
+
* structure@1: bloks over other modules' objects, by structure identifier. The
|
|
6
|
+
* contract only: drawing one needs the app's smart system (its option sources,
|
|
7
|
+
* displays and viewers), so every app that claims structure@1 draws it itself.
|
|
8
|
+
*/
|
|
9
|
+
const emptyTextSchema = BlokPropSchemas.DynamicString.optional().describe('Shown while there is no structure.');
|
|
10
|
+
export const structureContracts = {
|
|
11
|
+
StructurePicker: {
|
|
12
|
+
schema: z
|
|
13
|
+
.object({
|
|
14
|
+
identifier: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('The kind of structure to pick, e.g. "@mikro/arraydataset". As the widget of an action input it defaults to the structure the input is typed on.'),
|
|
18
|
+
bind: bindSchema,
|
|
19
|
+
value: structureValueSchema.describe('Controlled value, a structure reference.'),
|
|
20
|
+
query: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('The GraphQL query that lists the candidates, run on the `ward` service: one `query` operation, never a mutation. It selects a list aliased `options` with `value` (the id), `label` and optionally `description`, and may declare: $search: String (what the user typed), $values: [ID!] (ids to resolve), $limit: Int and $offset: Int (a page), $requires (the constraints of the action input being filled). Any other variable is read from `variables`, else from the data path of the same name; a structure held there is passed as its id. A nullable one narrows the list while it has a value and the user may lift it; the picker waits for one declared non-null. Without a query the module that owns the structure answers.'),
|
|
24
|
+
ward: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('The service that runs `query`, by its key, e.g. "mikro".'),
|
|
28
|
+
variables: z
|
|
29
|
+
.record(z.string(), z.unknown())
|
|
30
|
+
.nullish()
|
|
31
|
+
.describe('Values for the variables `query` declares beyond the ones the picker supplies.'),
|
|
32
|
+
placeholder: BlokPropSchemas.DynamicString.optional().describe('Shown while nothing is selected.'),
|
|
33
|
+
disabled: disabledSchema,
|
|
34
|
+
className: classNameSchema,
|
|
35
|
+
onChange: actionProp('Runs on selection. event.value is the structure reference, or null when cleared.'),
|
|
36
|
+
})
|
|
37
|
+
.describe('A search-backed picker for one structure of a given identifier. Writes {"object", "__identifier"}, or null when cleared. The candidates come from its `query`, or from the module that owns the structure when it has none.'),
|
|
38
|
+
},
|
|
39
|
+
StructureDisplay: {
|
|
40
|
+
schema: z
|
|
41
|
+
.object({
|
|
42
|
+
value: structureValueSchema.describe('The structure to show.'),
|
|
43
|
+
variant: z
|
|
44
|
+
.enum(['inline', 'avatar', 'chip', 'card'])
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('How much of it to show. Defaults to "card".'),
|
|
47
|
+
link: boolSchema.describe("Link to the structure's own page."),
|
|
48
|
+
emptyText: emptyTextSchema,
|
|
49
|
+
className: classNameSchema,
|
|
50
|
+
})
|
|
51
|
+
.describe('Shows a structure through the display of the module that owns it.'),
|
|
52
|
+
},
|
|
53
|
+
StructureViewer: {
|
|
54
|
+
schema: z
|
|
55
|
+
.object({
|
|
56
|
+
value: structureValueSchema.describe('The structure to open.'),
|
|
57
|
+
height: sizeSchema.describe('CSS height of the viewer. Defaults to "24rem".'),
|
|
58
|
+
minHeight: sizeSchema.describe('CSS minimum height of the viewer.'),
|
|
59
|
+
controls: boolSchema.describe("Show the viewer's own controls. Defaults to true."),
|
|
60
|
+
emptyText: emptyTextSchema,
|
|
61
|
+
className: classNameSchema,
|
|
62
|
+
})
|
|
63
|
+
.describe('An interactive viewer for a structure (a mikro image or scene), provided by the module that owns it.'),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=structure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure.js","sourceRoot":"","sources":["../../../src/catalogs/parts/structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAE/H;;;;GAIG;AAEH,MAAM,eAAe,GAAG,eAAe,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACvE,oCAAoC,CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe,EAAE;QACf,MAAM,EAAE,CAAC;aACN,MAAM,CAAC;YACN,UAAU,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,iJAAiJ,CAClJ;YACH,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,0CAA0C,CAAC;YAChF,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE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,EAAE,UAAU,CAAC,QAAQ,CAAC,mDAAmD,CAAC;YAClF,SAAS,EAAE,eAAe;YAC1B,SAAS,EAAE,eAAe;SAC3B,CAAC;aACD,QAAQ,CACP,sGAAsG,CACvG;KACJ;CAC+B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const toastContracts: {
|
|
3
|
+
Toast: {
|
|
4
|
+
acceptsChildren: true;
|
|
5
|
+
schema: z.ZodObject<{
|
|
6
|
+
task: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
};
|
|
9
|
+
done: {
|
|
10
|
+
acceptsChildren: boolean;
|
|
11
|
+
placement: {
|
|
12
|
+
downstreamOf: string[];
|
|
13
|
+
};
|
|
14
|
+
schema: z.ZodObject<{
|
|
15
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
};
|
|
18
|
+
failed: {
|
|
19
|
+
acceptsChildren: boolean;
|
|
20
|
+
placement: {
|
|
21
|
+
downstreamOf: string[];
|
|
22
|
+
};
|
|
23
|
+
schema: z.ZodObject<{
|
|
24
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
};
|
|
27
|
+
cancelled: {
|
|
28
|
+
acceptsChildren: boolean;
|
|
29
|
+
placement: {
|
|
30
|
+
downstreamOf: string[];
|
|
31
|
+
};
|
|
32
|
+
schema: z.ZodObject<{
|
|
33
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/catalogs/parts/toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAqBzB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKO,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { BlokPropSchemas } from '../../renderer/runtime/schemas.js';
|
|
3
|
+
/** `<Toast task={move}>` (ui@1) and its outcome slots `done`, `failed`, `cancelled`. */
|
|
4
|
+
const toastSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
task: z.unknown().refine(value => value !== undefined, 'A Toast follows a task.').describe('The task record to follow: an `into` name of this blok (`task={move}`), or `task`.'),
|
|
7
|
+
})
|
|
8
|
+
.describe('A notification when a task settles, once per task: its `done`, `failed` and `cancelled` slots hold the text.');
|
|
9
|
+
const outcomeSlot = (description) => ({
|
|
10
|
+
// Its text children are the message (`<done>Moved {move.result}</done>`).
|
|
11
|
+
acceptsChildren: true,
|
|
12
|
+
placement: { downstreamOf: ['Toast'] },
|
|
13
|
+
schema: z
|
|
14
|
+
.object({ text: BlokPropSchemas.DynamicString.optional().describe('What the toast says.') })
|
|
15
|
+
.describe(description),
|
|
16
|
+
});
|
|
17
|
+
export const toastContracts = {
|
|
18
|
+
Toast: { acceptsChildren: true, schema: toastSchema },
|
|
19
|
+
done: outcomeSlot('What a `<Toast>` says when its task is done.'),
|
|
20
|
+
failed: outcomeSlot('What a `<Toast>` says when its task failed (`move.error` says why).'),
|
|
21
|
+
cancelled: outcomeSlot('What a `<Toast>` says when its task was cancelled.'),
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/catalogs/parts/toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,wFAAwF;AAExF,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,EAAE,yBAAyB,CAAC,CAAC,QAAQ,CAAC,oFAAoF,CAAC;CACjL,CAAC;KACD,QAAQ,CAAC,8GAA8G,CAAC,CAAC;AAE5H,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,eAAe,EAAE,IAAI;IACrB,SAAS,EAAE,EAAC,YAAY,EAAE,CAAC,OAAO,CAAC,EAAC;IACpC,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,EAAC,IAAI,EAAE,eAAe,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAC,CAAC;SACzF,QAAQ,CAAC,WAAW,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,EAAC,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAC;IACnD,IAAI,EAAE,WAAW,CAAC,8CAA8C,CAAC;IACjE,MAAM,EAAE,WAAW,CAAC,qEAAqE,CAAC;IAC1F,SAAS,EAAE,WAAW,CAAC,oDAAoD,CAAC;CAC5C,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const typographyContracts: {
|
|
3
|
+
Text: {
|
|
4
|
+
schema: z.ZodObject<{
|
|
5
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
default: "default";
|
|
7
|
+
muted: "muted";
|
|
8
|
+
destructive: "destructive";
|
|
9
|
+
success: "success";
|
|
10
|
+
}>>;
|
|
11
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
base: "base";
|
|
13
|
+
xs: "xs";
|
|
14
|
+
sm: "sm";
|
|
15
|
+
lg: "lg";
|
|
16
|
+
}>>;
|
|
17
|
+
weight: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
bold: "bold";
|
|
19
|
+
medium: "medium";
|
|
20
|
+
regular: "regular";
|
|
21
|
+
semibold: "semibold";
|
|
22
|
+
}>>;
|
|
23
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
start: "start";
|
|
25
|
+
end: "end";
|
|
26
|
+
center: "center";
|
|
27
|
+
}>>;
|
|
28
|
+
mono: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
truncate: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
32
|
+
children: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>]>>]>>;
|
|
39
|
+
className: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
};
|
|
42
|
+
p: {
|
|
43
|
+
schema: z.ZodObject<{
|
|
44
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
default: "default";
|
|
46
|
+
muted: "muted";
|
|
47
|
+
destructive: "destructive";
|
|
48
|
+
success: "success";
|
|
49
|
+
}>>;
|
|
50
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
base: "base";
|
|
52
|
+
xs: "xs";
|
|
53
|
+
sm: "sm";
|
|
54
|
+
lg: "lg";
|
|
55
|
+
}>>;
|
|
56
|
+
weight: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
bold: "bold";
|
|
58
|
+
medium: "medium";
|
|
59
|
+
regular: "regular";
|
|
60
|
+
semibold: "semibold";
|
|
61
|
+
}>>;
|
|
62
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
start: "start";
|
|
64
|
+
end: "end";
|
|
65
|
+
center: "center";
|
|
66
|
+
}>>;
|
|
67
|
+
mono: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
truncate: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
71
|
+
children: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>]>>]>>;
|
|
78
|
+
className: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
};
|
|
81
|
+
span: {
|
|
82
|
+
schema: z.ZodObject<{
|
|
83
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
84
|
+
default: "default";
|
|
85
|
+
muted: "muted";
|
|
86
|
+
destructive: "destructive";
|
|
87
|
+
success: "success";
|
|
88
|
+
}>>;
|
|
89
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
90
|
+
base: "base";
|
|
91
|
+
xs: "xs";
|
|
92
|
+
sm: "sm";
|
|
93
|
+
lg: "lg";
|
|
94
|
+
}>>;
|
|
95
|
+
weight: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
bold: "bold";
|
|
97
|
+
medium: "medium";
|
|
98
|
+
regular: "regular";
|
|
99
|
+
semibold: "semibold";
|
|
100
|
+
}>>;
|
|
101
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
start: "start";
|
|
103
|
+
end: "end";
|
|
104
|
+
center: "center";
|
|
105
|
+
}>>;
|
|
106
|
+
mono: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
truncate: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
110
|
+
children: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>]>>]>>;
|
|
117
|
+
className: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
};
|
|
120
|
+
Heading: {
|
|
121
|
+
schema: z.ZodObject<{
|
|
122
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
123
|
+
h1: "h1";
|
|
124
|
+
h2: "h2";
|
|
125
|
+
h3: "h3";
|
|
126
|
+
h4: "h4";
|
|
127
|
+
h5: "h5";
|
|
128
|
+
h6: "h6";
|
|
129
|
+
}>>;
|
|
130
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
131
|
+
children: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>]>>]>>;
|
|
138
|
+
align: z.ZodOptional<z.ZodEnum<{
|
|
139
|
+
start: "start";
|
|
140
|
+
end: "end";
|
|
141
|
+
center: "center";
|
|
142
|
+
}>>;
|
|
143
|
+
className: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
};
|
|
146
|
+
Kbd: {
|
|
147
|
+
schema: z.ZodObject<{
|
|
148
|
+
text: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
149
|
+
children: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
153
|
+
id: z.ZodString;
|
|
154
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$strip>]>>]>>;
|
|
156
|
+
className: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
};
|
|
159
|
+
Markdown: {
|
|
160
|
+
schema: z.ZodObject<{
|
|
161
|
+
content: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean>>>;
|
|
162
|
+
className: z.ZodOptional<z.ZodString>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
};
|
|
165
|
+
Time: {
|
|
166
|
+
schema: z.ZodObject<{
|
|
167
|
+
value: z.ZodNullable<z.ZodString>;
|
|
168
|
+
relative: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
className: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/catalogs/parts/typography.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAmCzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BE,CAAC"}
|