@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
|
@@ -1,46 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as z from 'zod';
|
|
2
|
+
import type * as z from 'zod';
|
|
3
|
+
import {
|
|
4
|
+
LOGO_ANIMATIONS,
|
|
5
|
+
LOGO_PAINT_TOKENS,
|
|
6
|
+
type logoContracts,
|
|
7
|
+
type presentationFields,
|
|
8
|
+
shapeGeometry,
|
|
9
|
+
} from '../../../catalogs/parts/logo';
|
|
3
10
|
import {
|
|
4
11
|
BlokNodeErrorSurface,
|
|
5
|
-
createBlokComponent,
|
|
6
12
|
useBlok,
|
|
7
13
|
useBlokDataAttributes,
|
|
8
14
|
usePendingAction,
|
|
9
15
|
useValue,
|
|
10
16
|
type Blok,
|
|
11
|
-
type BlokComponentPlacement,
|
|
12
17
|
type BlokNodeErrorProps,
|
|
13
|
-
type
|
|
18
|
+
type BlokRender,
|
|
14
19
|
type BlokRenderArgs,
|
|
15
20
|
} from '../../runtime';
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
|
|
22
|
+
type Contracts = typeof logoContracts;
|
|
18
23
|
|
|
19
24
|
/**
|
|
20
|
-
* The `logo@1` module
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `Path` or a `Circle` is only ever placed inside one. The root names the
|
|
25
|
-
* blok's context: an `AgentLogo` root is a LOGO blok, an `ActionLogo` root an
|
|
26
|
-
* ACTION_LOGO blok (it reads `task`, the viewer's last task of the action); any
|
|
27
|
-
* html blok may draw either too.
|
|
28
|
-
*
|
|
29
|
-
* A logo paints with the viewer's pens only (vocabulary `theme.logo_pens`:
|
|
30
|
-
* `ink`, `brand`, ..., the status roles `success`, `warning`, `info`), drawn
|
|
31
|
-
* from the brand hue as `var(--logo-*)`, or with `url(#id)` into the drawing.
|
|
32
|
-
* Anything else is drawn in `ink`; the server refuses it at save.
|
|
33
|
-
*
|
|
34
|
-
* A shape may `animate`. It plays while the logo is hovered, and while an
|
|
35
|
-
* action logo's task runs (`[data-logo-active]`); see `index.css`.
|
|
36
|
-
*
|
|
37
|
-
* Names are capitalised like the rest of the catalog and props are camelCase
|
|
38
|
-
* (`strokeWidth`, not `stroke-width`). `Text` is the typography component, so
|
|
39
|
-
* SVG text is `SvgText`.
|
|
40
|
-
*
|
|
41
|
-
* A node's id is the BSX `id`, and that is what a gradient or a clip path is
|
|
42
|
-
* referenced by: `fill="url(#sky)"` names `<LinearGradient id="sky">`. Ids are
|
|
43
|
-
* made unique per drawing, so two logos on one page never share a gradient.
|
|
25
|
+
* The `logo@1` module drawn: see the contract for the language. A node's id is
|
|
26
|
+
* the BSX `id`, and that is what a gradient or a clip path is referenced by.
|
|
27
|
+
* Ids are made unique per drawing, so two logos on one page never share a
|
|
28
|
+
* gradient.
|
|
44
29
|
*/
|
|
45
30
|
|
|
46
31
|
/** Which drawing a node is in: the prefix that makes its ids unique on the page. */
|
|
@@ -64,11 +49,6 @@ const useReference = (value: string | undefined) => {
|
|
|
64
49
|
return match ? `url(#${prefix ?? 'svg'}-${safeId(match[1])})` : value;
|
|
65
50
|
};
|
|
66
51
|
|
|
67
|
-
/** The pens: what `var(--logo-<pen>)` in `index.css` draws from the brand hue (vocabulary `theme.logo_pens`). */
|
|
68
|
-
export const LOGO_PAINT_TOKENS: readonly string[] = loadVocabulary().theme.logoPens;
|
|
69
|
-
|
|
70
|
-
/** What a shape may play: a class `logo-anim-<name>` the stylesheet animates. */
|
|
71
|
-
export const LOGO_ANIMATIONS = ['spin', 'pulse', 'float', 'draw', 'march', 'blink'] as const;
|
|
72
52
|
type LogoAnimation = (typeof LOGO_ANIMATIONS)[number];
|
|
73
53
|
|
|
74
54
|
const isPaletteToken = (value: string) => LOGO_PAINT_TOKENS.includes(value);
|
|
@@ -84,45 +64,6 @@ const usePaint = (value: string | undefined) => {
|
|
|
84
64
|
return 'var(--logo-ink)';
|
|
85
65
|
};
|
|
86
66
|
|
|
87
|
-
const length = (description: string) =>
|
|
88
|
-
z.union([z.number(), z.string()]).optional().describe(description);
|
|
89
|
-
|
|
90
|
-
export const AGENT_LOGO_ROOT = 'AgentLogo';
|
|
91
|
-
export const ACTION_LOGO_ROOT = 'ActionLogo';
|
|
92
|
-
export const LOGO_ROOTS = [AGENT_LOGO_ROOT, ACTION_LOGO_ROOT];
|
|
93
|
-
|
|
94
|
-
const IN_SVG: BlokComponentPlacement = {context: 'logo', downstreamOf: LOGO_ROOTS};
|
|
95
|
-
|
|
96
|
-
/* -------------------------------------------------------------------------- */
|
|
97
|
-
/* Presentation: what every shape and group may set */
|
|
98
|
-
/* -------------------------------------------------------------------------- */
|
|
99
|
-
|
|
100
|
-
const PAINT_HELP = `${LOGO_PAINT_TOKENS.join(', ')} (the viewer's pens), or url(#gradient)`;
|
|
101
|
-
|
|
102
|
-
const presentationFields = {
|
|
103
|
-
fill: describedString(`Fill paint: ${PAINT_HELP}.`),
|
|
104
|
-
fillOpacity: length('Fill opacity, 0 to 1.'),
|
|
105
|
-
fillRule: z.enum(['nonzero', 'evenodd']).optional().describe('Which parts of a self-intersecting shape are inside.'),
|
|
106
|
-
stroke: describedString(`Stroke paint: ${PAINT_HELP}.`),
|
|
107
|
-
strokeWidth: length('Stroke width, in user units.'),
|
|
108
|
-
strokeOpacity: length('Stroke opacity, 0 to 1.'),
|
|
109
|
-
strokeLinecap: z.enum(['butt', 'round', 'square']).optional().describe('How open line ends are drawn.'),
|
|
110
|
-
strokeLinejoin: z.enum(['miter', 'round', 'bevel']).optional().describe('How corners are drawn.'),
|
|
111
|
-
strokeDasharray: describedString('Dash pattern, e.g. "4 2".'),
|
|
112
|
-
opacity: length('Opacity of the whole element, 0 to 1.'),
|
|
113
|
-
transform: describedString('SVG transform, e.g. "rotate(45 12 12)".'),
|
|
114
|
-
clipPath: describedString('url(#clip) of a ClipPath to clip by.'),
|
|
115
|
-
title: describedString('Tooltip text (an SVG <title>).'),
|
|
116
|
-
onClick: actionProp('Runs when the element is clicked.'),
|
|
117
|
-
animate: z
|
|
118
|
-
.enum(LOGO_ANIMATIONS)
|
|
119
|
-
.optional()
|
|
120
|
-
.describe(
|
|
121
|
-
'Plays while the logo is hovered, and while an action logo\'s task runs: spin, pulse, float, draw (traces the stroke), march (moves a dashed stroke) or blink.',
|
|
122
|
-
),
|
|
123
|
-
animateDelay: length('Seconds before the animation starts, to stagger shapes.'),
|
|
124
|
-
};
|
|
125
|
-
|
|
126
67
|
type PresentationBlok = Blok<z.ZodObject<typeof presentationFields>>;
|
|
127
68
|
|
|
128
69
|
const usePresentation = (blok: PresentationBlok) => {
|
|
@@ -173,15 +114,12 @@ const childrenOf = ({component, buildChild}: BlokRenderArgs) =>
|
|
|
173
114
|
* A shape: one SVG element, its geometry props passed through as they are,
|
|
174
115
|
* plus the shared presentation.
|
|
175
116
|
*/
|
|
176
|
-
const
|
|
177
|
-
name: string,
|
|
117
|
+
const shapeRender = (
|
|
178
118
|
tag: 'path' | 'circle' | 'ellipse' | 'rect' | 'line' | 'polyline' | 'polygon',
|
|
179
|
-
description: string,
|
|
180
119
|
geometry: Record<string, z.ZodTypeAny>,
|
|
181
|
-
) => {
|
|
182
|
-
const schema: BlokObjectSchema = z.object({...geometry, ...presentationFields}).describe(description);
|
|
120
|
+
): BlokRender<Contracts['Path']> => {
|
|
183
121
|
const keys = Object.keys(geometry);
|
|
184
|
-
return
|
|
122
|
+
return ({component, schema}) => {
|
|
185
123
|
const blok = useBlok(component, schema);
|
|
186
124
|
const {props, title, animate} = usePresentation(blok as unknown as PresentationBlok);
|
|
187
125
|
// The geometry keys are fixed per component, so the hooks run in the same order every render.
|
|
@@ -193,7 +131,7 @@ const createShape = (
|
|
|
193
131
|
{title ? <title>{title}</title> : null}
|
|
194
132
|
</Element>
|
|
195
133
|
);
|
|
196
|
-
}
|
|
134
|
+
};
|
|
197
135
|
};
|
|
198
136
|
|
|
199
137
|
/* -------------------------------------------------------------------------- */
|
|
@@ -207,323 +145,142 @@ const SvgNodeError = ({componentId, title, detail}: BlokNodeErrorProps) => (
|
|
|
207
145
|
</g>
|
|
208
146
|
);
|
|
209
147
|
|
|
210
|
-
const rootSchema = (description: string) =>
|
|
211
|
-
z
|
|
212
|
-
.object({
|
|
213
|
-
viewBox: describedString('The user coordinate system, "minX minY width height", e.g. "0 0 24 24".'),
|
|
214
|
-
width: length('Width; fills its box when left out.'),
|
|
215
|
-
height: length('Height; fills its box when left out.'),
|
|
216
|
-
preserveAspectRatio: describedString('How the viewBox fits the box, e.g. "xMidYMid meet".'),
|
|
217
|
-
title: describedString('What the drawing shows, for screen readers and as a tooltip.'),
|
|
218
|
-
})
|
|
219
|
-
.describe(description);
|
|
220
|
-
|
|
221
148
|
/** A drawing's root: an `<svg>` whose shapes paint with the pens. */
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
data-blok-prefix={prefix}
|
|
251
|
-
data-logo-palette=""
|
|
252
|
-
>
|
|
253
|
-
{title ? <title>{title}</title> : null}
|
|
254
|
-
<SvgDrawingContext.Provider value={prefix}>
|
|
255
|
-
<BlokNodeErrorSurface.Provider value={SvgNodeError}>{childrenOf(args)}</BlokNodeErrorSurface.Provider>
|
|
256
|
-
</SvgDrawingContext.Provider>
|
|
257
|
-
</svg>
|
|
258
|
-
);
|
|
259
|
-
},
|
|
149
|
+
const LogoRootRender: BlokRender<Contracts['AgentLogo']> = args => {
|
|
150
|
+
const blok = useBlok(args.component, args.schema);
|
|
151
|
+
const viewBox = useValue(blok.viewBox);
|
|
152
|
+
const width = useValue(blok.width);
|
|
153
|
+
const height = useValue(blok.height);
|
|
154
|
+
const preserveAspectRatio = useValue(blok.preserveAspectRatio);
|
|
155
|
+
const title = useValue(blok.title);
|
|
156
|
+
const prefix = `svg${React.useId().replace(/[^A-Za-z0-9]/g, '')}`;
|
|
157
|
+
const attributes = useBlokDataAttributes();
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<svg
|
|
161
|
+
{...attributes}
|
|
162
|
+
viewBox={viewBox}
|
|
163
|
+
width={width ?? '100%'}
|
|
164
|
+
height={height ?? '100%'}
|
|
165
|
+
preserveAspectRatio={preserveAspectRatio}
|
|
166
|
+
role={title ? 'img' : undefined}
|
|
167
|
+
aria-label={title}
|
|
168
|
+
data-blok-svg={args.component.id}
|
|
169
|
+
data-blok-prefix={prefix}
|
|
170
|
+
data-logo-palette=""
|
|
171
|
+
>
|
|
172
|
+
{title ? <title>{title}</title> : null}
|
|
173
|
+
<SvgDrawingContext.Provider value={prefix}>
|
|
174
|
+
<BlokNodeErrorSurface.Provider value={SvgNodeError}>{childrenOf(args)}</BlokNodeErrorSurface.Provider>
|
|
175
|
+
</SvgDrawingContext.Provider>
|
|
176
|
+
</svg>
|
|
260
177
|
);
|
|
178
|
+
};
|
|
261
179
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
cx: length('Centre x.'),
|
|
282
|
-
cy: length('Centre y.'),
|
|
283
|
-
r: length('Radius.'),
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
export const EllipseBlok = createShape('Ellipse', 'ellipse', 'An SVG ellipse.', {
|
|
287
|
-
cx: length('Centre x.'),
|
|
288
|
-
cy: length('Centre y.'),
|
|
289
|
-
rx: length('Horizontal radius.'),
|
|
290
|
-
ry: length('Vertical radius.'),
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
export const RectBlok = createShape('Rect', 'rect', 'An SVG rectangle.', {
|
|
294
|
-
x: length('Left edge.'),
|
|
295
|
-
y: length('Top edge.'),
|
|
296
|
-
width: length('Width.'),
|
|
297
|
-
height: length('Height.'),
|
|
298
|
-
rx: length('Corner radius, horizontal.'),
|
|
299
|
-
ry: length('Corner radius, vertical.'),
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
export const LineBlok = createShape('Line', 'line', 'An SVG line.', {
|
|
303
|
-
x1: length('Start x.'),
|
|
304
|
-
y1: length('Start y.'),
|
|
305
|
-
x2: length('End x.'),
|
|
306
|
-
y2: length('End y.'),
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
export const PolylineBlok = createShape('Polyline', 'polyline', 'An open SVG polyline.', {
|
|
310
|
-
points: describedString('Points, e.g. "0,0 10,5 20,0".'),
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
export const PolygonBlok = createShape('Polygon', 'polygon', 'A closed SVG polygon.', {
|
|
314
|
-
points: describedString('Points, e.g. "0,0 10,5 20,0".'),
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
export const SvgTextBlok = createBlokComponent(
|
|
318
|
-
{
|
|
319
|
-
name: 'SvgText',
|
|
320
|
-
placement: IN_SVG,
|
|
321
|
-
schema: z
|
|
322
|
-
.object({
|
|
323
|
-
text: describedString('The text to draw.'),
|
|
324
|
-
x: length('Anchor x.'),
|
|
325
|
-
y: length('Baseline y.'),
|
|
326
|
-
fontSize: length('Font size, in user units.'),
|
|
327
|
-
fontFamily: describedString('Font family.'),
|
|
328
|
-
fontWeight: describedString('Font weight, e.g. "bold" or "600".'),
|
|
329
|
-
textAnchor: z.enum(['start', 'middle', 'end']).optional().describe('Where x is on the text.'),
|
|
330
|
-
dominantBaseline: z
|
|
331
|
-
.enum(['auto', 'middle', 'central', 'hanging', 'alphabetic'])
|
|
332
|
-
.optional()
|
|
333
|
-
.describe('Where y is on the text.'),
|
|
334
|
-
...presentationFields,
|
|
335
|
-
})
|
|
336
|
-
.describe('Text in an SVG drawing (the SVG <text> element).'),
|
|
337
|
-
},
|
|
338
|
-
({component, schema}) => {
|
|
339
|
-
const blok = useBlok(component, schema);
|
|
340
|
-
const {props, title} = usePresentation(blok as unknown as PresentationBlok);
|
|
341
|
-
return (
|
|
342
|
-
<text
|
|
343
|
-
{...props}
|
|
344
|
-
x={useValue(blok.x)}
|
|
345
|
-
y={useValue(blok.y)}
|
|
346
|
-
fontSize={useValue(blok.fontSize)}
|
|
347
|
-
fontFamily={useValue(blok.fontFamily)}
|
|
348
|
-
fontWeight={useValue(blok.fontWeight)}
|
|
349
|
-
textAnchor={useValue(blok.textAnchor)}
|
|
350
|
-
dominantBaseline={useValue(blok.dominantBaseline)}
|
|
351
|
-
>
|
|
352
|
-
{title ? <title>{title}</title> : null}
|
|
353
|
-
{useValue(blok.text)}
|
|
354
|
-
</text>
|
|
355
|
-
);
|
|
356
|
-
},
|
|
357
|
-
);
|
|
180
|
+
const SvgTextRender: BlokRender<Contracts['SvgText']> = ({component, schema}) => {
|
|
181
|
+
const blok = useBlok(component, schema);
|
|
182
|
+
const {props, title} = usePresentation(blok as unknown as PresentationBlok);
|
|
183
|
+
return (
|
|
184
|
+
<text
|
|
185
|
+
{...props}
|
|
186
|
+
x={useValue(blok.x)}
|
|
187
|
+
y={useValue(blok.y)}
|
|
188
|
+
fontSize={useValue(blok.fontSize)}
|
|
189
|
+
fontFamily={useValue(blok.fontFamily)}
|
|
190
|
+
fontWeight={useValue(blok.fontWeight)}
|
|
191
|
+
textAnchor={useValue(blok.textAnchor)}
|
|
192
|
+
dominantBaseline={useValue(blok.dominantBaseline)}
|
|
193
|
+
>
|
|
194
|
+
{title ? <title>{title}</title> : null}
|
|
195
|
+
{useValue(blok.text)}
|
|
196
|
+
</text>
|
|
197
|
+
);
|
|
198
|
+
};
|
|
358
199
|
|
|
359
200
|
/* -------------------------------------------------------------------------- */
|
|
360
201
|
/* Structure: groups, definitions, gradients, clip paths */
|
|
361
202
|
/* -------------------------------------------------------------------------- */
|
|
362
203
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
return (
|
|
374
|
-
<g {...props}>
|
|
375
|
-
{title ? <title>{title}</title> : null}
|
|
376
|
-
{childrenOf(args)}
|
|
377
|
-
</g>
|
|
378
|
-
);
|
|
379
|
-
},
|
|
380
|
-
);
|
|
381
|
-
|
|
382
|
-
export const DefsBlok = createBlokComponent(
|
|
383
|
-
{
|
|
384
|
-
name: 'Defs',
|
|
385
|
-
acceptsChildren: true,
|
|
386
|
-
placement: IN_SVG,
|
|
387
|
-
schema: z.object({}).describe('Definitions (gradients, clip paths) that are referenced, not drawn.'),
|
|
388
|
-
},
|
|
389
|
-
args => <defs>{childrenOf(args)}</defs>,
|
|
390
|
-
);
|
|
391
|
-
|
|
392
|
-
const gradientUnits = z
|
|
393
|
-
.enum(['objectBoundingBox', 'userSpaceOnUse'])
|
|
394
|
-
.optional()
|
|
395
|
-
.describe('Whether the coordinates are fractions of the shape (the default) or user units.');
|
|
204
|
+
const GroupRender: BlokRender<Contracts['G']> = args => {
|
|
205
|
+
const blok = useBlok(args.component, args.schema);
|
|
206
|
+
const {props, title} = usePresentation(blok);
|
|
207
|
+
return (
|
|
208
|
+
<g {...props}>
|
|
209
|
+
{title ? <title>{title}</title> : null}
|
|
210
|
+
{childrenOf(args)}
|
|
211
|
+
</g>
|
|
212
|
+
);
|
|
213
|
+
};
|
|
396
214
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
return (
|
|
416
|
-
<linearGradient
|
|
417
|
-
id={useElementId(args.component.id)}
|
|
418
|
-
x1={useValue(blok.x1)}
|
|
419
|
-
y1={useValue(blok.y1)}
|
|
420
|
-
x2={useValue(blok.x2)}
|
|
421
|
-
y2={useValue(blok.y2)}
|
|
422
|
-
gradientUnits={useValue(blok.gradientUnits)}
|
|
423
|
-
gradientTransform={useValue(blok.gradientTransform)}
|
|
424
|
-
>
|
|
425
|
-
{childrenOf(args)}
|
|
426
|
-
</linearGradient>
|
|
427
|
-
);
|
|
428
|
-
},
|
|
429
|
-
);
|
|
215
|
+
const DefsRender: BlokRender<Contracts['Defs']> = args => <defs>{childrenOf(args)}</defs>;
|
|
216
|
+
|
|
217
|
+
const LinearGradientRender: BlokRender<Contracts['LinearGradient']> = args => {
|
|
218
|
+
const blok = useBlok(args.component, args.schema);
|
|
219
|
+
return (
|
|
220
|
+
<linearGradient
|
|
221
|
+
id={useElementId(args.component.id)}
|
|
222
|
+
x1={useValue(blok.x1)}
|
|
223
|
+
y1={useValue(blok.y1)}
|
|
224
|
+
x2={useValue(blok.x2)}
|
|
225
|
+
y2={useValue(blok.y2)}
|
|
226
|
+
gradientUnits={useValue(blok.gradientUnits)}
|
|
227
|
+
gradientTransform={useValue(blok.gradientTransform)}
|
|
228
|
+
>
|
|
229
|
+
{childrenOf(args)}
|
|
230
|
+
</linearGradient>
|
|
231
|
+
);
|
|
232
|
+
};
|
|
430
233
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
.
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
args => {
|
|
449
|
-
const blok = useBlok(args.component, args.schema);
|
|
450
|
-
return (
|
|
451
|
-
<radialGradient
|
|
452
|
-
id={useElementId(args.component.id)}
|
|
453
|
-
cx={useValue(blok.cx)}
|
|
454
|
-
cy={useValue(blok.cy)}
|
|
455
|
-
r={useValue(blok.r)}
|
|
456
|
-
fx={useValue(blok.fx)}
|
|
457
|
-
fy={useValue(blok.fy)}
|
|
458
|
-
gradientUnits={useValue(blok.gradientUnits)}
|
|
459
|
-
gradientTransform={useValue(blok.gradientTransform)}
|
|
460
|
-
>
|
|
461
|
-
{childrenOf(args)}
|
|
462
|
-
</radialGradient>
|
|
463
|
-
);
|
|
464
|
-
},
|
|
465
|
-
);
|
|
234
|
+
const RadialGradientRender: BlokRender<Contracts['RadialGradient']> = args => {
|
|
235
|
+
const blok = useBlok(args.component, args.schema);
|
|
236
|
+
return (
|
|
237
|
+
<radialGradient
|
|
238
|
+
id={useElementId(args.component.id)}
|
|
239
|
+
cx={useValue(blok.cx)}
|
|
240
|
+
cy={useValue(blok.cy)}
|
|
241
|
+
r={useValue(blok.r)}
|
|
242
|
+
fx={useValue(blok.fx)}
|
|
243
|
+
fy={useValue(blok.fy)}
|
|
244
|
+
gradientUnits={useValue(blok.gradientUnits)}
|
|
245
|
+
gradientTransform={useValue(blok.gradientTransform)}
|
|
246
|
+
>
|
|
247
|
+
{childrenOf(args)}
|
|
248
|
+
</radialGradient>
|
|
249
|
+
);
|
|
250
|
+
};
|
|
466
251
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
offset: length('Where along the gradient, 0 to 1 or a percentage.'),
|
|
474
|
-
stopColor: describedString(`The colour at this stop: ${PAINT_HELP}.`),
|
|
475
|
-
stopOpacity: length('The opacity at this stop, 0 to 1.'),
|
|
476
|
-
})
|
|
477
|
-
.describe('One colour stop of a gradient.'),
|
|
478
|
-
},
|
|
479
|
-
({component, schema}) => {
|
|
480
|
-
const blok = useBlok(component, schema);
|
|
481
|
-
return (
|
|
482
|
-
<stop offset={useValue(blok.offset)} stopColor={usePaint(useValue(blok.stopColor))} stopOpacity={useValue(blok.stopOpacity)} />
|
|
483
|
-
);
|
|
484
|
-
},
|
|
485
|
-
);
|
|
252
|
+
const StopRender: BlokRender<Contracts['Stop']> = ({component, schema}) => {
|
|
253
|
+
const blok = useBlok(component, schema);
|
|
254
|
+
return (
|
|
255
|
+
<stop offset={useValue(blok.offset)} stopColor={usePaint(useValue(blok.stopColor))} stopOpacity={useValue(blok.stopOpacity)} />
|
|
256
|
+
);
|
|
257
|
+
};
|
|
486
258
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
.enum(['userSpaceOnUse', 'objectBoundingBox'])
|
|
496
|
-
.optional()
|
|
497
|
-
.describe('Whether its shapes are in user units (the default) or fractions of the clipped shape.'),
|
|
498
|
-
})
|
|
499
|
-
.describe('A clip path made of its shape children. Referenced as url(#id) by its BSX id.'),
|
|
500
|
-
},
|
|
501
|
-
args => {
|
|
502
|
-
const blok = useBlok(args.component, args.schema);
|
|
503
|
-
return (
|
|
504
|
-
<clipPath id={useElementId(args.component.id)} clipPathUnits={useValue(blok.clipPathUnits)}>
|
|
505
|
-
{childrenOf(args)}
|
|
506
|
-
</clipPath>
|
|
507
|
-
);
|
|
508
|
-
},
|
|
509
|
-
);
|
|
259
|
+
const ClipPathRender: BlokRender<Contracts['ClipPath']> = args => {
|
|
260
|
+
const blok = useBlok(args.component, args.schema);
|
|
261
|
+
return (
|
|
262
|
+
<clipPath id={useElementId(args.component.id)} clipPathUnits={useValue(blok.clipPathUnits)}>
|
|
263
|
+
{childrenOf(args)}
|
|
264
|
+
</clipPath>
|
|
265
|
+
);
|
|
266
|
+
};
|
|
510
267
|
|
|
511
268
|
/** The `logo@1` module: the root, seven shapes, text, and what shapes reference. */
|
|
512
|
-
export const
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
269
|
+
export const logoRenders = {
|
|
270
|
+
AgentLogo: LogoRootRender,
|
|
271
|
+
ActionLogo: LogoRootRender,
|
|
272
|
+
Path: shapeRender('path', shapeGeometry.Path),
|
|
273
|
+
Circle: shapeRender('circle', shapeGeometry.Circle),
|
|
274
|
+
Ellipse: shapeRender('ellipse', shapeGeometry.Ellipse),
|
|
275
|
+
Rect: shapeRender('rect', shapeGeometry.Rect),
|
|
276
|
+
Line: shapeRender('line', shapeGeometry.Line),
|
|
277
|
+
Polyline: shapeRender('polyline', shapeGeometry.Polyline),
|
|
278
|
+
Polygon: shapeRender('polygon', shapeGeometry.Polygon),
|
|
279
|
+
SvgText: SvgTextRender,
|
|
280
|
+
G: GroupRender,
|
|
281
|
+
Defs: DefsRender,
|
|
282
|
+
LinearGradient: LinearGradientRender,
|
|
283
|
+
RadialGradient: RadialGradientRender,
|
|
284
|
+
Stop: StopRender,
|
|
285
|
+
ClipPath: ClipPathRender,
|
|
286
|
+
};
|