@cratis/scene.blueprint.components 0.1.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/.storybook/main.ts +61 -0
- package/.storybook/preview.tsx +42 -0
- package/BorrowedComponentName.ts +22 -0
- package/ComponentName.ts +27 -0
- package/CompositeName.ts +97 -0
- package/README.md +40 -0
- package/componentsBlueprint.ts +72 -0
- package/componentsBlueprintComponents.ts +23 -0
- package/dist/cjs/BorrowedComponentName.js +25 -0
- package/dist/cjs/BorrowedComponentName.js.map +1 -0
- package/dist/cjs/ComponentName.js +30 -0
- package/dist/cjs/ComponentName.js.map +1 -0
- package/dist/cjs/CompositeName.js +52 -0
- package/dist/cjs/CompositeName.js.map +1 -0
- package/dist/cjs/componentsBlueprint.js +93 -0
- package/dist/cjs/componentsBlueprint.js.map +1 -0
- package/dist/cjs/componentsBlueprintComponents.js +27 -0
- package/dist/cjs/componentsBlueprintComponents.js.map +1 -0
- package/dist/cjs/gallery/DialogTemplatePreview.js +46 -0
- package/dist/cjs/gallery/DialogTemplatePreview.js.map +1 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js +65 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/cjs/gallery/applicationChrome.js +137 -0
- package/dist/cjs/gallery/applicationChrome.js.map +1 -0
- package/dist/cjs/gallery/navigation.js +128 -0
- package/dist/cjs/gallery/navigation.js.map +1 -0
- package/dist/cjs/gallery/previewProfile.js +87 -0
- package/dist/cjs/gallery/previewProfile.js.map +1 -0
- package/dist/cjs/gallery/screens.js +80 -0
- package/dist/cjs/gallery/screens.js.map +1 -0
- package/dist/cjs/header/ArcPageHeader.js +65 -0
- package/dist/cjs/header/ArcPageHeader.js.map +1 -0
- package/dist/cjs/header/deriveArcHeading.js +51 -0
- package/dist/cjs/header/deriveArcHeading.js.map +1 -0
- package/dist/cjs/header/humanizeBindingName.js +36 -0
- package/dist/cjs/header/humanizeBindingName.js.map +1 -0
- package/dist/cjs/index.js +119 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +15 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/templates/SampleBindingName.js +39 -0
- package/dist/cjs/templates/SampleBindingName.js.map +1 -0
- package/dist/cjs/templates/commandTemplates.js +82 -0
- package/dist/cjs/templates/commandTemplates.js.map +1 -0
- package/dist/cjs/templates/dataElements.js +131 -0
- package/dist/cjs/templates/dataElements.js.map +1 -0
- package/dist/cjs/templates/dialogElements.js +69 -0
- package/dist/cjs/templates/dialogElements.js.map +1 -0
- package/dist/cjs/templates/dialogTemplates.js +118 -0
- package/dist/cjs/templates/dialogTemplates.js.map +1 -0
- package/dist/cjs/templates/editorElements.js +81 -0
- package/dist/cjs/templates/editorElements.js.map +1 -0
- package/dist/cjs/templates/editorTemplates.js +172 -0
- package/dist/cjs/templates/editorTemplates.js.map +1 -0
- package/dist/cjs/templates/elements.js +101 -0
- package/dist/cjs/templates/elements.js.map +1 -0
- package/dist/cjs/templates/formElements.js +77 -0
- package/dist/cjs/templates/formElements.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +187 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/nesting.js +150 -0
- package/dist/cjs/templates/nesting.js.map +1 -0
- package/dist/cjs/templates/sampleData.js +141 -0
- package/dist/cjs/templates/sampleData.js.map +1 -0
- package/dist/cjs/templates/screenTemplates.js +41 -0
- package/dist/cjs/templates/screenTemplates.js.map +1 -0
- package/dist/cjs/templates/workspaceTemplates.js +212 -0
- package/dist/cjs/templates/workspaceTemplates.js.map +1 -0
- package/dist/esm/BorrowedComponentName.d.ts +4 -0
- package/dist/esm/BorrowedComponentName.d.ts.map +1 -0
- package/dist/esm/BorrowedComponentName.js +23 -0
- package/dist/esm/BorrowedComponentName.js.map +1 -0
- package/dist/esm/ComponentName.d.ts +4 -0
- package/dist/esm/ComponentName.d.ts.map +1 -0
- package/dist/esm/ComponentName.js +28 -0
- package/dist/esm/ComponentName.js.map +1 -0
- package/dist/esm/CompositeName.d.ts +28 -0
- package/dist/esm/CompositeName.d.ts.map +1 -0
- package/dist/esm/CompositeName.js +50 -0
- package/dist/esm/CompositeName.js.map +1 -0
- package/dist/esm/componentsBlueprint.d.ts +5 -0
- package/dist/esm/componentsBlueprint.d.ts.map +1 -0
- package/dist/esm/componentsBlueprint.js +90 -0
- package/dist/esm/componentsBlueprint.js.map +1 -0
- package/dist/esm/componentsBlueprintComponents.d.ts +3 -0
- package/dist/esm/componentsBlueprintComponents.d.ts.map +1 -0
- package/dist/esm/componentsBlueprintComponents.js +25 -0
- package/dist/esm/componentsBlueprintComponents.js.map +1 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.d.ts +2 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.d.ts.map +1 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js +57 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js.map +1 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.d.ts +2 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.d.ts.map +1 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.js +26 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.js.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.d.ts +2 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.d.ts.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js +65 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.d.ts +2 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.d.ts.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.js +41 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.js.map +1 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.js +38 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +47 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.js +56 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.js +31 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.js +54 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.js.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.d.ts +2 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.d.ts.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.js +27 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.js.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.d.ts +2 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.d.ts.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.js +18 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.js.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.d.ts +2 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.d.ts.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.js +26 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.js.map +1 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.d.ts +2 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.d.ts.map +1 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.js +25 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.js.map +1 -0
- package/dist/esm/gallery/ArcPages.stories.d.ts +30 -0
- package/dist/esm/gallery/ArcPages.stories.d.ts.map +1 -0
- package/dist/esm/gallery/ArcPages.stories.js +34 -0
- package/dist/esm/gallery/ArcPages.stories.js.map +1 -0
- package/dist/esm/gallery/Bindings.stories.d.ts +22 -0
- package/dist/esm/gallery/Bindings.stories.d.ts.map +1 -0
- package/dist/esm/gallery/Bindings.stories.js +78 -0
- package/dist/esm/gallery/Bindings.stories.js.map +1 -0
- package/dist/esm/gallery/DialogTemplatePreview.d.ts +7 -0
- package/dist/esm/gallery/DialogTemplatePreview.d.ts.map +1 -0
- package/dist/esm/gallery/DialogTemplatePreview.js +44 -0
- package/dist/esm/gallery/DialogTemplatePreview.js.map +1 -0
- package/dist/esm/gallery/DialogTemplates.stories.d.ts +21 -0
- package/dist/esm/gallery/DialogTemplates.stories.d.ts.map +1 -0
- package/dist/esm/gallery/DialogTemplates.stories.js +23 -0
- package/dist/esm/gallery/DialogTemplates.stories.js.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +10 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.js +62 -0
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/esm/gallery/applicationChrome.d.ts +3 -0
- package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
- package/dist/esm/gallery/applicationChrome.js +135 -0
- package/dist/esm/gallery/applicationChrome.js.map +1 -0
- package/dist/esm/gallery/index.d.ts +7 -0
- package/dist/esm/gallery/index.d.ts.map +1 -0
- package/dist/esm/gallery/index.js +7 -0
- package/dist/esm/gallery/index.js.map +1 -0
- package/dist/esm/gallery/navigation.d.ts +9 -0
- package/dist/esm/gallery/navigation.d.ts.map +1 -0
- package/dist/esm/gallery/navigation.js +121 -0
- package/dist/esm/gallery/navigation.js.map +1 -0
- package/dist/esm/gallery/previewProfile.d.ts +6 -0
- package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
- package/dist/esm/gallery/previewProfile.js +83 -0
- package/dist/esm/gallery/previewProfile.js.map +1 -0
- package/dist/esm/gallery/screens.d.ts +4 -0
- package/dist/esm/gallery/screens.d.ts.map +1 -0
- package/dist/esm/gallery/screens.js +77 -0
- package/dist/esm/gallery/screens.js.map +1 -0
- package/dist/esm/header/ArcHeading.d.ts +9 -0
- package/dist/esm/header/ArcHeading.d.ts.map +1 -0
- package/dist/esm/header/ArcHeading.js +2 -0
- package/dist/esm/header/ArcHeading.js.map +1 -0
- package/dist/esm/header/ArcPageHeader.d.ts +3 -0
- package/dist/esm/header/ArcPageHeader.d.ts.map +1 -0
- package/dist/esm/header/ArcPageHeader.js +63 -0
- package/dist/esm/header/ArcPageHeader.js.map +1 -0
- package/dist/esm/header/deriveArcHeading.d.ts +4 -0
- package/dist/esm/header/deriveArcHeading.d.ts.map +1 -0
- package/dist/esm/header/deriveArcHeading.js +49 -0
- package/dist/esm/header/deriveArcHeading.js.map +1 -0
- package/dist/esm/header/humanizeBindingName.d.ts +2 -0
- package/dist/esm/header/humanizeBindingName.d.ts.map +1 -0
- package/dist/esm/header/humanizeBindingName.js +34 -0
- package/dist/esm/header/humanizeBindingName.js.map +1 -0
- package/dist/esm/header/index.d.ts +5 -0
- package/dist/esm/header/index.d.ts.map +1 -0
- package/dist/esm/header/index.js +5 -0
- package/dist/esm/header/index.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +13 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/templates/ArcHeaderOptions.d.ts +8 -0
- package/dist/esm/templates/ArcHeaderOptions.d.ts.map +1 -0
- package/dist/esm/templates/ArcHeaderOptions.js +2 -0
- package/dist/esm/templates/ArcHeaderOptions.js.map +1 -0
- package/dist/esm/templates/ColumnDefinition.d.ts +5 -0
- package/dist/esm/templates/ColumnDefinition.d.ts.map +1 -0
- package/dist/esm/templates/ColumnDefinition.js +2 -0
- package/dist/esm/templates/ColumnDefinition.js.map +1 -0
- package/dist/esm/templates/SampleBindingName.d.ts +11 -0
- package/dist/esm/templates/SampleBindingName.d.ts.map +1 -0
- package/dist/esm/templates/SampleBindingName.js +37 -0
- package/dist/esm/templates/SampleBindingName.js.map +1 -0
- package/dist/esm/templates/TableOptions.d.ts +6 -0
- package/dist/esm/templates/TableOptions.d.ts.map +1 -0
- package/dist/esm/templates/TableOptions.js +2 -0
- package/dist/esm/templates/TableOptions.js.map +1 -0
- package/dist/esm/templates/commandTemplates.d.ts +4 -0
- package/dist/esm/templates/commandTemplates.d.ts.map +1 -0
- package/dist/esm/templates/commandTemplates.js +79 -0
- package/dist/esm/templates/commandTemplates.js.map +1 -0
- package/dist/esm/templates/dataElements.d.ts +11 -0
- package/dist/esm/templates/dataElements.d.ts.map +1 -0
- package/dist/esm/templates/dataElements.js +123 -0
- package/dist/esm/templates/dataElements.js.map +1 -0
- package/dist/esm/templates/dialogElements.d.ts +5 -0
- package/dist/esm/templates/dialogElements.d.ts.map +1 -0
- package/dist/esm/templates/dialogElements.js +65 -0
- package/dist/esm/templates/dialogElements.js.map +1 -0
- package/dist/esm/templates/dialogTemplates.d.ts +6 -0
- package/dist/esm/templates/dialogTemplates.d.ts.map +1 -0
- package/dist/esm/templates/dialogTemplates.js +113 -0
- package/dist/esm/templates/dialogTemplates.js.map +1 -0
- package/dist/esm/templates/editorElements.d.ts +11 -0
- package/dist/esm/templates/editorElements.d.ts.map +1 -0
- package/dist/esm/templates/editorElements.js +74 -0
- package/dist/esm/templates/editorElements.js.map +1 -0
- package/dist/esm/templates/editorTemplates.d.ts +5 -0
- package/dist/esm/templates/editorTemplates.d.ts.map +1 -0
- package/dist/esm/templates/editorTemplates.js +168 -0
- package/dist/esm/templates/editorTemplates.js.map +1 -0
- package/dist/esm/templates/elements.d.ts +11 -0
- package/dist/esm/templates/elements.d.ts.map +1 -0
- package/dist/esm/templates/elements.js +92 -0
- package/dist/esm/templates/elements.js.map +1 -0
- package/dist/esm/templates/formElements.d.ts +11 -0
- package/dist/esm/templates/formElements.d.ts.map +1 -0
- package/dist/esm/templates/formElements.js +70 -0
- package/dist/esm/templates/formElements.js.map +1 -0
- package/dist/esm/templates/index.d.ts +18 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +18 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +6 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +182 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/nesting.d.ts +6 -0
- package/dist/esm/templates/nesting.d.ts.map +1 -0
- package/dist/esm/templates/nesting.js +145 -0
- package/dist/esm/templates/nesting.js.map +1 -0
- package/dist/esm/templates/sampleData.d.ts +10 -0
- package/dist/esm/templates/sampleData.d.ts.map +1 -0
- package/dist/esm/templates/sampleData.js +134 -0
- package/dist/esm/templates/sampleData.js.map +1 -0
- package/dist/esm/templates/screenTemplates.d.ts +4 -0
- package/dist/esm/templates/screenTemplates.d.ts.map +1 -0
- package/dist/esm/templates/screenTemplates.js +38 -0
- package/dist/esm/templates/screenTemplates.js.map +1 -0
- package/dist/esm/templates/workspaceTemplates.d.ts +5 -0
- package/dist/esm/templates/workspaceTemplates.d.ts.map +1 -0
- package/dist/esm/templates/workspaceTemplates.js +208 -0
- package/dist/esm/templates/workspaceTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/for_ArcPageHeader/when_rendering_a_gallery_screen.tsx +79 -0
- package/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.ts +41 -0
- package/for_componentsBlueprint/when_resolving_its_dependencies.ts +85 -0
- package/for_componentsBlueprint/when_validating_the_bundle.ts +55 -0
- package/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +56 -0
- package/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +66 -0
- package/for_componentsScreenTemplates/when_following_the_nesting_chain.ts +83 -0
- package/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.ts +51 -0
- package/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.ts +72 -0
- package/for_deriveArcHeading/when_no_binding_is_named.ts +42 -0
- package/for_deriveArcHeading/when_the_binding_is_not_registered.ts +25 -0
- package/for_deriveArcHeading/when_the_binding_is_registered.ts +35 -0
- package/for_humanizeBindingName/when_reading_a_proxy_name.ts +34 -0
- package/gallery/ArcPages.stories.tsx +80 -0
- package/gallery/Bindings.stories.tsx +134 -0
- package/gallery/DialogTemplatePreview.tsx +49 -0
- package/gallery/DialogTemplates.stories.tsx +44 -0
- package/gallery/GalleryScreenPreview.tsx +70 -0
- package/gallery/applicationChrome.ts +108 -0
- package/gallery/index.ts +9 -0
- package/gallery/navigation.ts +63 -0
- package/gallery/previewProfile.ts +68 -0
- package/gallery/screens.ts +75 -0
- package/header/ArcHeading.ts +39 -0
- package/header/ArcPageHeader.tsx +44 -0
- package/header/deriveArcHeading.ts +47 -0
- package/header/humanizeBindingName.ts +36 -0
- package/header/index.ts +7 -0
- package/index.ts +12 -0
- package/package.json +71 -0
- package/packageName.ts +12 -0
- package/templates/ArcHeaderOptions.ts +27 -0
- package/templates/ColumnDefinition.ts +18 -0
- package/templates/SampleBindingName.ts +50 -0
- package/templates/TableOptions.ts +22 -0
- package/templates/commandTemplates.ts +59 -0
- package/templates/dataElements.ts +97 -0
- package/templates/dialogElements.ts +53 -0
- package/templates/dialogTemplates.ts +105 -0
- package/templates/editorElements.ts +69 -0
- package/templates/editorTemplates.ts +129 -0
- package/templates/elements.ts +81 -0
- package/templates/formElements.ts +61 -0
- package/templates/index.ts +20 -0
- package/templates/listTemplates.ts +142 -0
- package/templates/nesting.ts +118 -0
- package/templates/sampleData.ts +81 -0
- package/templates/screenTemplates.ts +35 -0
- package/templates/workspaceTemplates.ts +163 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
4
|
+
require('../templates/listTemplates.js');
|
|
5
|
+
require('../templates/workspaceTemplates.js');
|
|
6
|
+
require('../templates/commandTemplates.js');
|
|
7
|
+
require('../templates/editorTemplates.js');
|
|
8
|
+
var nesting = require('../templates/nesting.js');
|
|
9
|
+
require('../templates/dialogTemplates.js');
|
|
10
|
+
var screenTemplates = require('../templates/screenTemplates.js');
|
|
11
|
+
var applicationChrome = require('./applicationChrome.js');
|
|
12
|
+
var navigation = require('./navigation.js');
|
|
13
|
+
|
|
14
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
15
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
16
|
+
/**
|
|
17
|
+
* The gallery: one {@link Screen} per template, ready to boot through the real engine.
|
|
18
|
+
*
|
|
19
|
+
* These exist so a preview is a working miniature application rather than a set of pictures - the same
|
|
20
|
+
* `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate
|
|
21
|
+
* preview pipeline and nothing mocked.
|
|
22
|
+
*
|
|
23
|
+
* They will render with unregistered bindings, and that is the normal design-time state rather than a
|
|
24
|
+
* shortcoming of the gallery. A host owns the generated Arc proxies; a gallery is not a host. What a
|
|
25
|
+
* preview therefore shows is every Arc-bound region as a placeholder naming the binding it wanted, every
|
|
26
|
+
* Arc-free region rendered for real, and a header on each page saying which of the two you are looking at.
|
|
27
|
+
*
|
|
28
|
+
* Every screen renders in the default blueprint's `AppShell`. There is no full-page variant here because
|
|
29
|
+
* there is no Arc-bound page that belongs outside the application shell - a sign-in screen queries nothing
|
|
30
|
+
* and submits no command, so it stays where it already is, in the default blueprint.
|
|
31
|
+
*/ /**
|
|
32
|
+
* Builds the {@link Screen} that instantiates one template.
|
|
33
|
+
*
|
|
34
|
+
* A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the
|
|
35
|
+
* content that fills it, and what it contributes elsewhere. Everything structural comes from the template,
|
|
36
|
+
* which is why adding a screen is a handful of lines rather than another copy of the chrome.
|
|
37
|
+
*/ function screenFor(template) {
|
|
38
|
+
const placeable = scene_blueprint_default.nestScreenTemplates(containmentChainFor(template));
|
|
39
|
+
return {
|
|
40
|
+
name: template.name,
|
|
41
|
+
layout: scene_blueprint_default.LayoutName.AppShell,
|
|
42
|
+
screenTemplate: template.name,
|
|
43
|
+
slotContent: mergeSlotContent(applicationChrome.componentsApplicationChrome(template.name), scene_blueprint_default.templateContentInLayout(placeable, scene_blueprint_default.appShellLayout)),
|
|
44
|
+
forms: [],
|
|
45
|
+
contributions: navigation.componentsNavigationContributions
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The chain of templates a screen renders through, outermost first.
|
|
50
|
+
*
|
|
51
|
+
* The eight page templates fit the layout's own `content` slot, so each one's chain is just itself. The
|
|
52
|
+
* three nesting-chain templates are the exception and the only ones that need the walk - which is the
|
|
53
|
+
* honest version of the story: nesting exists for the applications that need it, and costs nothing for the
|
|
54
|
+
* ones that do not.
|
|
55
|
+
*/ function containmentChainFor(template) {
|
|
56
|
+
const depth = nesting.nestingChainTemplates.findIndex((candidate)=>candidate.name === template.name);
|
|
57
|
+
return depth < 0 ? [
|
|
58
|
+
template
|
|
59
|
+
] : nesting.nestingChainTemplates.slice(0, depth + 1);
|
|
60
|
+
}
|
|
61
|
+
function mergeSlotContent(chrome, content) {
|
|
62
|
+
const merged = {
|
|
63
|
+
...chrome
|
|
64
|
+
};
|
|
65
|
+
for (const [slotName, elements] of Object.entries(content)){
|
|
66
|
+
merged[slotName] = [
|
|
67
|
+
...merged[slotName] ?? [],
|
|
68
|
+
...elements
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
return merged;
|
|
72
|
+
}
|
|
73
|
+
/** One screen per screen template this blueprint provides. */ const componentsGalleryScreens = screenTemplates.componentsScreenTemplates.map(screenFor);
|
|
74
|
+
/** One gallery screen by name, for a story or a host that boots a specific one. */ function componentsGalleryScreen(name) {
|
|
75
|
+
return componentsGalleryScreens.find((screen)=>screen.name === name);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
exports.componentsGalleryScreen = componentsGalleryScreen;
|
|
79
|
+
exports.componentsGalleryScreens = componentsGalleryScreens;
|
|
80
|
+
//# sourceMappingURL=screens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screens.js","sources":["../../../gallery/screens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, nestScreenTemplates, templateContentInLayout } from '@cratis/scene.blueprint.default';\nimport { componentsScreenTemplates, nestingChainTemplates } from '../templates';\nimport { componentsApplicationChrome } from './applicationChrome';\nimport { componentsNavigationContributions } from './navigation';\n\n/**\n * The gallery: one {@link Screen} per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n *\n * They will render with unregistered bindings, and that is the normal design-time state rather than a\n * shortcoming of the gallery. A host owns the generated Arc proxies; a gallery is not a host. What a\n * preview therefore shows is every Arc-bound region as a placeholder naming the binding it wanted, every\n * Arc-free region rendered for real, and a header on each page saying which of the two you are looking at.\n *\n * Every screen renders in the default blueprint's `AppShell`. There is no full-page variant here because\n * there is no Arc-bound page that belongs outside the application shell - a sign-in screen queries nothing\n * and submits no command, so it stays where it already is, in the default blueprint.\n */\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(componentsApplicationChrome(template.name), templateContentInLayout(placeable, appShellLayout)),\n forms: [],\n contributions: componentsNavigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * The eight page templates fit the layout's own `content` slot, so each one's chain is just itself. The\n * three nesting-chain templates are the exception and the only ones that need the walk - which is the\n * honest version of the story: nesting exists for the applications that need it, and costs nothing for the\n * ones that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/** One screen per screen template this blueprint provides. */\nexport const componentsGalleryScreens: Screen[] = componentsScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function componentsGalleryScreen(name: string): Screen | undefined {\n return componentsGalleryScreens.find(screen => screen.name === name);\n}\n"],"names":["screenFor","template","placeable","nestScreenTemplates","containmentChainFor","name","layout","LayoutName","AppShell","screenTemplate","slotContent","mergeSlotContent","componentsApplicationChrome","templateContentInLayout","appShellLayout","forms","contributions","componentsNavigationContributions","depth","nestingChainTemplates","findIndex","candidate","slice","chrome","content","merged","slotName","elements","Object","entries","componentsGalleryScreens","componentsScreenTemplates","map","componentsGalleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;;;;IAwBA,SAASA,UAAUC,QAAwB,EAAA;IACvC,MAAMC,SAAAA,GAAYC,4CAAoBC,mBAAAA,CAAoBH,QAAAA,CAAAA,CAAAA;IAE1D,OAAO;AACHI,QAAAA,IAAAA,EAAMJ,SAASI,IAAI;AACnBC,QAAAA,MAAAA,EAAQC,mCAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBR,SAASI,IAAI;AAC7BK,QAAAA,WAAAA,EAAaC,iBAAiBC,6CAAAA,CAA4BX,QAAAA,CAASI,IAAI,CAAA,EAAGQ,gDAAwBX,SAAAA,EAAWY,sCAAAA,CAAAA,CAAAA;AAC7GC,QAAAA,KAAAA,EAAO,EAAE;QACTC,aAAAA,EAAeC;AACnB,KAAA;AACJ;AAEA;;;;;;;IAQA,SAASb,oBAAoBH,QAAwB,EAAA;IACjD,MAAMiB,KAAAA,GAAQC,6BAAAA,CAAsBC,SAAS,CAACC,CAAAA,YAAaA,SAAAA,CAAUhB,IAAI,KAAKJ,QAAAA,CAASI,IAAI,CAAA;AAC3F,IAAA,OAAOa,QAAQ,CAAA,GAAI;AAACjB,QAAAA;AAAS,KAAA,GAAGkB,6BAAAA,CAAsBG,KAAK,CAAC,CAAA,EAAGJ,KAAAA,GAAQ,CAAA,CAAA;AAC3E;AAEA,SAASP,gBAAAA,CAAiBY,MAAqD,EAAEC,OAAsD,EAAA;AACnI,IAAA,MAAMC,MAAAA,GAAgC;AAAE,QAAA,GAAGF;AAAO,KAAA;IAClD,KAAK,MAAM,CAACG,QAAAA,EAAUC,QAAAA,CAAS,IAAIC,MAAAA,CAAOC,OAAO,CAACL,OAAAA,CAAAA,CAAU;QACxDC,MAAM,CAACC,SAAS,GAAG;eAAKD,MAAM,CAACC,QAAAA,CAAS,IAAI,EAAE;AAAMC,YAAAA,GAAAA;AAAS,SAAA;AACjE,IAAA;IAEA,OAAOF,MAAAA;AACX;AAEA,+DACO,MAAMK,2BAAqCC,yCAAAA,CAA0BC,GAAG,CAAChC,SAAAA;AAEhF,oFACO,SAASiC,uBAAAA,CAAwB5B,IAAY,EAAA;AAChD,IAAA,OAAOyB,yBAAyBI,IAAI,CAACC,CAAAA,MAAAA,GAAUA,MAAAA,CAAO9B,IAAI,KAAKA,IAAAA,CAAAA;AACnE;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var scene_components = require('@cratis/scene.components');
|
|
5
|
+
var deriveArcHeading = require('./deriveArcHeading.js');
|
|
6
|
+
|
|
7
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
8
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
|
+
/**
|
|
10
|
+
* The one component this blueprint registers: a page header whose heading, trail and design-time state all
|
|
11
|
+
* follow from a single binding name.
|
|
12
|
+
*
|
|
13
|
+
* Every template in this package opens with one, and every template gives it the same binding its body is
|
|
14
|
+
* built around - `AllInvoices` on the list page, `RecordAdjustment` on the command page. Saying it once is
|
|
15
|
+
* the point. A hand-authored header repeats the page's subject in the title, again in the trail, and a
|
|
16
|
+
* third time in the table below it, and those three copies drift the first time anything is renamed.
|
|
17
|
+
*
|
|
18
|
+
* It also reports whether the binding is registered, which is what makes a design-time preview readable.
|
|
19
|
+
* A page whose body is one dashed placeholder is ambiguous - is the name wrong, or has the host simply not
|
|
20
|
+
* wired anything yet? The header answers that at the top of the page, in words, without opening a debugger.
|
|
21
|
+
*
|
|
22
|
+
* The `layout-page-header` class names are the default blueprint's, not this package's. That is this
|
|
23
|
+
* blueprint's whole posture in one detail: it reuses the shell it depends on rather than shipping a rival
|
|
24
|
+
* one, so a page of Arc-bound content sits inside the default shell looking like it belongs there.
|
|
25
|
+
*/ function ArcPageHeader({ element, slots }) {
|
|
26
|
+
const query = scene_components.resolveElementBinding(element, scene_components.BindingKind.Query);
|
|
27
|
+
const kind = query.name === undefined ? scene_components.BindingKind.Command : scene_components.BindingKind.Query;
|
|
28
|
+
const binding = kind === scene_components.BindingKind.Query ? query : scene_components.resolveElementBinding(element, scene_components.BindingKind.Command);
|
|
29
|
+
const heading = deriveArcHeading.deriveArcHeading(element.properties, binding, kind);
|
|
30
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
31
|
+
className: "layout-page-header",
|
|
32
|
+
"data-scene-id": element.id,
|
|
33
|
+
"data-scene-binding": heading.bindingName,
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ jsxRuntime.jsx("nav", {
|
|
38
|
+
className: "layout-page-header-trail",
|
|
39
|
+
"aria-label": "Breadcrumb",
|
|
40
|
+
children: heading.trail.join(' › ')
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsxRuntime.jsx("h1", {
|
|
43
|
+
className: "layout-page-header-title",
|
|
44
|
+
children: heading.title
|
|
45
|
+
}),
|
|
46
|
+
heading.subtitle && /*#__PURE__*/ jsxRuntime.jsx("p", {
|
|
47
|
+
className: "layout-page-header-subtitle",
|
|
48
|
+
children: heading.subtitle
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
51
|
+
"data-scene-binding-state": heading.isBound ? 'bound' : 'unbound',
|
|
52
|
+
children: heading.bindingLabel
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
(slots.actions?.length ?? 0) > 0 && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
57
|
+
className: "layout-page-header-actions",
|
|
58
|
+
children: slots.actions
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.ArcPageHeader = ArcPageHeader;
|
|
65
|
+
//# sourceMappingURL=ArcPageHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcPageHeader.js","sources":["../../../header/ArcPageHeader.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { BindingKind, resolveElementBinding } from '@cratis/scene.components';\nimport { deriveArcHeading } from './deriveArcHeading';\n\n/**\n * The one component this blueprint registers: a page header whose heading, trail and design-time state all\n * follow from a single binding name.\n *\n * Every template in this package opens with one, and every template gives it the same binding its body is\n * built around - `AllInvoices` on the list page, `RecordAdjustment` on the command page. Saying it once is\n * the point. A hand-authored header repeats the page's subject in the title, again in the trail, and a\n * third time in the table below it, and those three copies drift the first time anything is renamed.\n *\n * It also reports whether the binding is registered, which is what makes a design-time preview readable.\n * A page whose body is one dashed placeholder is ambiguous - is the name wrong, or has the host simply not\n * wired anything yet? The header answers that at the top of the page, in words, without opening a debugger.\n *\n * The `layout-page-header` class names are the default blueprint's, not this package's. That is this\n * blueprint's whole posture in one detail: it reuses the shell it depends on rather than shipping a rival\n * one, so a page of Arc-bound content sits inside the default shell looking like it belongs there.\n */\nexport function ArcPageHeader({ element, slots }: RegisteredComponentProps) {\n const query = resolveElementBinding(element, BindingKind.Query);\n const kind = query.name === undefined ? BindingKind.Command : BindingKind.Query;\n const binding = kind === BindingKind.Query ? query : resolveElementBinding(element, BindingKind.Command);\n const heading = deriveArcHeading(element.properties, binding, kind);\n\n return (\n <div className='layout-page-header' data-scene-id={element.id} data-scene-binding={heading.bindingName}>\n <div>\n <nav className='layout-page-header-trail' aria-label='Breadcrumb'>\n {heading.trail.join(' › ')}\n </nav>\n <h1 className='layout-page-header-title'>{heading.title}</h1>\n {heading.subtitle && <p className='layout-page-header-subtitle'>{heading.subtitle}</p>}\n <span data-scene-binding-state={heading.isBound ? 'bound' : 'unbound'}>{heading.bindingLabel}</span>\n </div>\n {(slots.actions?.length ?? 0) > 0 && <div className='layout-page-header-actions'>{slots.actions}</div>}\n </div>\n );\n}\n"],"names":["ArcPageHeader","element","slots","query","resolveElementBinding","BindingKind","Query","kind","name","undefined","Command","binding","heading","deriveArcHeading","properties","_jsxs","div","className","data-scene-id","id","data-scene-binding","bindingName","_jsx","nav","aria-label","trail","join","h1","title","subtitle","p","span","data-scene-binding-state","isBound","bindingLabel","actions","length"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;AAgBC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACtE,IAAA,MAAMC,KAAAA,GAAQC,sCAAAA,CAAsBH,OAAAA,EAASI,4BAAAA,CAAYC,KAAK,CAAA;IAC9D,MAAMC,IAAAA,GAAOJ,MAAMK,IAAI,KAAKC,YAAYJ,4BAAAA,CAAYK,OAAO,GAAGL,4BAAAA,CAAYC,KAAK;IAC/E,MAAMK,OAAAA,GAAUJ,SAASF,4BAAAA,CAAYC,KAAK,GAAGH,KAAAA,GAAQC,sCAAAA,CAAsBH,OAAAA,EAASI,4BAAAA,CAAYK,OAAO,CAAA;AACvG,IAAA,MAAME,OAAAA,GAAUC,iCAAAA,CAAiBZ,OAAAA,CAAQa,UAAU,EAAEH,OAAAA,EAASJ,IAAAA,CAAAA;AAE9D,IAAA,qBACIQ,eAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,oBAAA;AAAqBC,QAAAA,eAAAA,EAAejB,QAAQkB,EAAE;AAAEC,QAAAA,oBAAAA,EAAoBR,QAAQS,WAAW;;0BAClGN,eAAA,CAACC,KAAAA,EAAAA;;kCACGM,cAAA,CAACC,KAAAA,EAAAA;wBAAIN,SAAAA,EAAU,0BAAA;wBAA2BO,YAAAA,EAAW,YAAA;kCAChDZ,OAAAA,CAAQa,KAAK,CAACC,IAAI,CAAC,KAAA;;kCAExBJ,cAAA,CAACK,IAAAA,EAAAA;wBAAGV,SAAAA,EAAU,0BAAA;AAA4BL,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQgB;;oBACjDhB,OAAAA,CAAQiB,QAAQ,kBAAIP,cAAA,CAACQ,GAAAA,EAAAA;wBAAEb,SAAAA,EAAU,6BAAA;AAA+BL,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQiB;;kCACzEP,cAAA,CAACS,MAAAA,EAAAA;wBAAKC,0BAAAA,EAA0BpB,OAAAA,CAAQqB,OAAO,GAAG,OAAA,GAAU,SAAA;AAAYrB,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQsB;;;;AAElFhC,YAAAA,CAAAA,MAAMiC,OAAO,EAAEC,UAAU,CAAA,IAAK,mBAAKd,cAAA,CAACN,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,4BAAA;AAA8Bf,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMiC;;;;AAGpG;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_components = require('@cratis/scene.components');
|
|
4
|
+
var humanizeBindingName = require('./humanizeBindingName.js');
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/**
|
|
9
|
+
* Derives everything a page header shows from one binding and the few properties around it.
|
|
10
|
+
*
|
|
11
|
+
* This function is the entire argument for {@link ArcPageHeader} being a component at all. A screen
|
|
12
|
+
* template can hold a title, a subtitle and a breadcrumb trail perfectly well - they are three literals in
|
|
13
|
+
* a property bag, and a tree is the right place for literals. What a tree cannot do is *derive* them from
|
|
14
|
+
* a single binding name and a registry lookup, and that is what an Arc-bound page needs: the page is about
|
|
15
|
+
* `AllInvoices`, so the heading, the trail and the design-time state should all follow from saying so once.
|
|
16
|
+
*
|
|
17
|
+
* The three binding states are kept apart deliberately, because they are three different problems with
|
|
18
|
+
* three different fixes. No name at all means the template is incomplete. A name nothing is registered
|
|
19
|
+
* under means the host has not wired it - which is the *normal* state at design time, not an error. A
|
|
20
|
+
* resolved name means the page will really talk to a backend.
|
|
21
|
+
*
|
|
22
|
+
* @param properties The element's property bag - `title`, `subtitle` and `section` are read from it.
|
|
23
|
+
* @param binding What the element asked for at its binding site, and what the registry produced.
|
|
24
|
+
* @param kind Whether the binding was a query or a command, so the state can be described in the right words.
|
|
25
|
+
* @returns The derived {@link ArcHeading}.
|
|
26
|
+
*/ function deriveArcHeading(properties, binding, kind) {
|
|
27
|
+
const title = scene_components.stringProperty(properties, 'title') ?? (binding.name === undefined ? 'Untitled page' : humanizeBindingName.humanizeBindingName(binding.name));
|
|
28
|
+
const section = scene_components.stringProperty(properties, 'section');
|
|
29
|
+
return {
|
|
30
|
+
title,
|
|
31
|
+
subtitle: scene_components.stringProperty(properties, 'subtitle'),
|
|
32
|
+
trail: section === undefined ? [
|
|
33
|
+
title
|
|
34
|
+
] : [
|
|
35
|
+
section,
|
|
36
|
+
title
|
|
37
|
+
],
|
|
38
|
+
bindingName: binding.name,
|
|
39
|
+
isBound: binding.target !== undefined,
|
|
40
|
+
bindingLabel: bindingLabelFor(binding, kind)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function bindingLabelFor(binding, kind) {
|
|
44
|
+
if (binding.name === undefined) {
|
|
45
|
+
return 'No binding';
|
|
46
|
+
}
|
|
47
|
+
return binding.target === undefined ? `No ${kind} registered as ${binding.name}` : `Bound to ${kind} ${binding.name}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.deriveArcHeading = deriveArcHeading;
|
|
51
|
+
//# sourceMappingURL=deriveArcHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deriveArcHeading.js","sources":["../../../header/deriveArcHeading.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingKind, ElementBinding, stringProperty } from '@cratis/scene.components';\nimport { ArcHeading } from './ArcHeading';\nimport { humanizeBindingName } from './humanizeBindingName';\n\n/**\n * Derives everything a page header shows from one binding and the few properties around it.\n *\n * This function is the entire argument for {@link ArcPageHeader} being a component at all. A screen\n * template can hold a title, a subtitle and a breadcrumb trail perfectly well - they are three literals in\n * a property bag, and a tree is the right place for literals. What a tree cannot do is *derive* them from\n * a single binding name and a registry lookup, and that is what an Arc-bound page needs: the page is about\n * `AllInvoices`, so the heading, the trail and the design-time state should all follow from saying so once.\n *\n * The three binding states are kept apart deliberately, because they are three different problems with\n * three different fixes. No name at all means the template is incomplete. A name nothing is registered\n * under means the host has not wired it - which is the *normal* state at design time, not an error. A\n * resolved name means the page will really talk to a backend.\n *\n * @param properties The element's property bag - `title`, `subtitle` and `section` are read from it.\n * @param binding What the element asked for at its binding site, and what the registry produced.\n * @param kind Whether the binding was a query or a command, so the state can be described in the right words.\n * @returns The derived {@link ArcHeading}.\n */\nexport function deriveArcHeading(properties: Record<string, unknown>, binding: ElementBinding, kind: BindingKind): ArcHeading {\n const title = stringProperty(properties, 'title') ?? (binding.name === undefined ? 'Untitled page' : humanizeBindingName(binding.name));\n const section = stringProperty(properties, 'section');\n\n return {\n title,\n subtitle: stringProperty(properties, 'subtitle'),\n trail: section === undefined ? [title] : [section, title],\n bindingName: binding.name,\n isBound: binding.target !== undefined,\n bindingLabel: bindingLabelFor(binding, kind),\n };\n}\n\nfunction bindingLabelFor(binding: ElementBinding, kind: BindingKind): string {\n if (binding.name === undefined) {\n return 'No binding';\n }\n\n return binding.target === undefined ? `No ${kind} registered as ${binding.name}` : `Bound to ${kind} ${binding.name}`;\n}\n"],"names":["deriveArcHeading","properties","binding","kind","title","stringProperty","name","undefined","humanizeBindingName","section","subtitle","trail","bindingName","isBound","target","bindingLabel","bindingLabelFor"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;AAkBC,IACM,SAASA,gBAAAA,CAAiBC,UAAmC,EAAEC,OAAuB,EAAEC,IAAiB,EAAA;AAC5G,IAAA,MAAMC,KAAAA,GAAQC,+BAAAA,CAAeJ,UAAAA,EAAY,OAAA,CAAA,KAAaC,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,GAAY,eAAA,GAAkBC,uCAAAA,CAAoBN,OAAAA,CAAQI,IAAI,CAAA,CAAA;IACrI,MAAMG,OAAAA,GAAUJ,gCAAeJ,UAAAA,EAAY,SAAA,CAAA;IAE3C,OAAO;AACHG,QAAAA,KAAAA;AACAM,QAAAA,QAAAA,EAAUL,gCAAeJ,UAAAA,EAAY,UAAA,CAAA;AACrCU,QAAAA,KAAAA,EAAOF,YAAYF,SAAAA,GAAY;AAACH,YAAAA;SAAM,GAAG;AAACK,YAAAA,OAAAA;AAASL,YAAAA;AAAM,SAAA;AACzDQ,QAAAA,WAAAA,EAAaV,QAAQI,IAAI;QACzBO,OAAAA,EAASX,OAAAA,CAAQY,MAAM,KAAKP,SAAAA;AAC5BQ,QAAAA,YAAAA,EAAcC,gBAAgBd,OAAAA,EAASC,IAAAA;AAC3C,KAAA;AACJ;AAEA,SAASa,eAAAA,CAAgBd,OAAuB,EAAEC,IAAiB,EAAA;IAC/D,IAAID,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,EAAW;QAC5B,OAAO,YAAA;AACX,IAAA;IAEA,OAAOL,OAAAA,CAAQY,MAAM,KAAKP,SAAAA,GAAY,CAAC,GAAG,EAAEJ,IAAAA,CAAK,eAAe,EAAED,OAAAA,CAAQI,IAAI,CAAA,CAAE,GAAG,CAAC,SAAS,EAAEH,KAAK,CAAC,EAAED,OAAAA,CAAQI,IAAI,CAAA,CAAE;AACzH;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Reads an Arc binding name as a sentence: `AllInvoices` becomes `All invoices`.
|
|
7
|
+
*
|
|
8
|
+
* Arc proxy names are the C# artifact names - a `[ReadModel]`'s static query method, a `[Command]` record -
|
|
9
|
+
* so they arrive in PascalCase and describe exactly what the page is about. Using them as the fallback
|
|
10
|
+
* heading means a page template is legible before anyone has written a title, and the heading a designer
|
|
11
|
+
* sees at design time is the one the backend actually named.
|
|
12
|
+
*
|
|
13
|
+
* Only the boundary between a lowercase or numeric character and an uppercase one is treated as a word
|
|
14
|
+
* break, so a run of capitals stays together: `AllPIIRecords` reads as `All PIIRecords` rather than being
|
|
15
|
+
* chopped into initials. That is the right trade - a wrong word break in an acronym is much more jarring
|
|
16
|
+
* than a missing one. For the same reason a word is only lowered when it looks like an ordinary
|
|
17
|
+
* capitalized word, so an acronym keeps its shape instead of being flattened into `piirecords`.
|
|
18
|
+
*
|
|
19
|
+
* @param name The binding name as a screen wrote it.
|
|
20
|
+
* @returns The name as a sentence, with only the first word capitalized.
|
|
21
|
+
*/ function humanizeBindingName(name) {
|
|
22
|
+
const words = name.replace(/([a-z0-9])([A-Z])/g, '$1 $2').split(/\s+/).filter((word)=>word.length > 0);
|
|
23
|
+
if (words.length === 0) {
|
|
24
|
+
return name;
|
|
25
|
+
}
|
|
26
|
+
return [
|
|
27
|
+
words[0],
|
|
28
|
+
...words.slice(1).map(lowered)
|
|
29
|
+
].join(' ');
|
|
30
|
+
}
|
|
31
|
+
function lowered(word) {
|
|
32
|
+
return /^[A-Z][a-z]/.test(word) ? `${word[0].toLowerCase()}${word.slice(1)}` : word;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.humanizeBindingName = humanizeBindingName;
|
|
36
|
+
//# sourceMappingURL=humanizeBindingName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanizeBindingName.js","sources":["../../../header/humanizeBindingName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Reads an Arc binding name as a sentence: `AllInvoices` becomes `All invoices`.\n *\n * Arc proxy names are the C# artifact names - a `[ReadModel]`'s static query method, a `[Command]` record -\n * so they arrive in PascalCase and describe exactly what the page is about. Using them as the fallback\n * heading means a page template is legible before anyone has written a title, and the heading a designer\n * sees at design time is the one the backend actually named.\n *\n * Only the boundary between a lowercase or numeric character and an uppercase one is treated as a word\n * break, so a run of capitals stays together: `AllPIIRecords` reads as `All PIIRecords` rather than being\n * chopped into initials. That is the right trade - a wrong word break in an acronym is much more jarring\n * than a missing one. For the same reason a word is only lowered when it looks like an ordinary\n * capitalized word, so an acronym keeps its shape instead of being flattened into `piirecords`.\n *\n * @param name The binding name as a screen wrote it.\n * @returns The name as a sentence, with only the first word capitalized.\n */\nexport function humanizeBindingName(name: string): string {\n const words = name\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .split(/\\s+/)\n .filter(word => word.length > 0);\n\n if (words.length === 0) {\n return name;\n }\n\n return [words[0], ...words.slice(1).map(lowered)].join(' ');\n}\n\nfunction lowered(word: string): string {\n return /^[A-Z][a-z]/.test(word) ? `${word[0].toLowerCase()}${word.slice(1)}` : word;\n}\n"],"names":["humanizeBindingName","name","words","replace","split","filter","word","length","slice","map","lowered","join","test","toLowerCase"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;IAiBO,SAASA,mBAAAA,CAAoBC,IAAY,EAAA;AAC5C,IAAA,MAAMC,KAAAA,GAAQD,IAAAA,CACTE,OAAO,CAAC,sBAAsB,OAAA,CAAA,CAC9BC,KAAK,CAAC,KAAA,CAAA,CACNC,MAAM,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,MAAM,GAAG,CAAA,CAAA;IAElC,IAAIL,KAAAA,CAAMK,MAAM,KAAK,CAAA,EAAG;QACpB,OAAON,IAAAA;AACX,IAAA;IAEA,OAAO;AAACC,QAAAA,KAAK,CAAC,CAAA,CAAE;AAAKA,QAAAA,GAAAA,KAAAA,CAAMM,KAAK,CAAC,CAAA,CAAA,CAAGC,GAAG,CAACC,OAAAA;AAAS,KAAA,CAACC,IAAI,CAAC,GAAA,CAAA;AAC3D;AAEA,SAASD,QAAQJ,IAAY,EAAA;AACzB,IAAA,OAAO,aAAA,CAAcM,IAAI,CAACN,IAAAA,CAAAA,GAAQ,GAAGA,IAAI,CAAC,CAAA,CAAE,CAACO,WAAW,EAAA,CAAA,EAAKP,IAAAA,CAAKE,KAAK,CAAC,IAAI,GAAGF,IAAAA;AACnF;;;;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var packageName = require('./packageName.js');
|
|
4
|
+
var ComponentName = require('./ComponentName.js');
|
|
5
|
+
var CompositeName = require('./CompositeName.js');
|
|
6
|
+
var BorrowedComponentName = require('./BorrowedComponentName.js');
|
|
7
|
+
var humanizeBindingName = require('./header/humanizeBindingName.js');
|
|
8
|
+
var deriveArcHeading = require('./header/deriveArcHeading.js');
|
|
9
|
+
var ArcPageHeader = require('./header/ArcPageHeader.js');
|
|
10
|
+
var SampleBindingName = require('./templates/SampleBindingName.js');
|
|
11
|
+
var sampleData = require('./templates/sampleData.js');
|
|
12
|
+
var elements = require('./templates/elements.js');
|
|
13
|
+
var dataElements = require('./templates/dataElements.js');
|
|
14
|
+
var formElements = require('./templates/formElements.js');
|
|
15
|
+
var dialogElements = require('./templates/dialogElements.js');
|
|
16
|
+
var editorElements = require('./templates/editorElements.js');
|
|
17
|
+
var listTemplates = require('./templates/listTemplates.js');
|
|
18
|
+
var workspaceTemplates = require('./templates/workspaceTemplates.js');
|
|
19
|
+
var commandTemplates = require('./templates/commandTemplates.js');
|
|
20
|
+
var editorTemplates = require('./templates/editorTemplates.js');
|
|
21
|
+
var nesting = require('./templates/nesting.js');
|
|
22
|
+
var dialogTemplates = require('./templates/dialogTemplates.js');
|
|
23
|
+
var screenTemplates = require('./templates/screenTemplates.js');
|
|
24
|
+
var navigation = require('./gallery/navigation.js');
|
|
25
|
+
var applicationChrome = require('./gallery/applicationChrome.js');
|
|
26
|
+
var screens = require('./gallery/screens.js');
|
|
27
|
+
var previewProfile = require('./gallery/previewProfile.js');
|
|
28
|
+
var GalleryScreenPreview = require('./gallery/GalleryScreenPreview.js');
|
|
29
|
+
var DialogTemplatePreview = require('./gallery/DialogTemplatePreview.js');
|
|
30
|
+
var componentsBlueprintComponents = require('./componentsBlueprintComponents.js');
|
|
31
|
+
var componentsBlueprint = require('./componentsBlueprint.js');
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.componentsBlueprintName = packageName.componentsBlueprintName;
|
|
36
|
+
exports.ComponentName = ComponentName.ComponentName;
|
|
37
|
+
exports.CompositeName = CompositeName.CompositeName;
|
|
38
|
+
exports.BorrowedComponentName = BorrowedComponentName.BorrowedComponentName;
|
|
39
|
+
exports.humanizeBindingName = humanizeBindingName.humanizeBindingName;
|
|
40
|
+
exports.deriveArcHeading = deriveArcHeading.deriveArcHeading;
|
|
41
|
+
exports.ArcPageHeader = ArcPageHeader.ArcPageHeader;
|
|
42
|
+
exports.SampleBindingName = SampleBindingName.SampleBindingName;
|
|
43
|
+
exports.invoiceDocument = sampleData.invoiceDocument;
|
|
44
|
+
exports.invoiceFilters = sampleData.invoiceFilters;
|
|
45
|
+
exports.invoiceNavigationPath = sampleData.invoiceNavigationPath;
|
|
46
|
+
exports.invoiceSchema = sampleData.invoiceSchema;
|
|
47
|
+
exports.invoiceVersions = sampleData.invoiceVersions;
|
|
48
|
+
exports.statusOptions = sampleData.statusOptions;
|
|
49
|
+
exports.arcPageHeader = elements.arcPageHeader;
|
|
50
|
+
exports.errorBoundary = elements.errorBoundary;
|
|
51
|
+
exports.icon = elements.icon;
|
|
52
|
+
exports.page = elements.page;
|
|
53
|
+
exports.toolbar = elements.toolbar;
|
|
54
|
+
exports.toolbarButton = elements.toolbarButton;
|
|
55
|
+
exports.toolbarGroup = elements.toolbarGroup;
|
|
56
|
+
exports.toolbarSeparator = elements.toolbarSeparator;
|
|
57
|
+
exports.adjustmentColumns = dataElements.adjustmentColumns;
|
|
58
|
+
exports.columns = dataElements.columns;
|
|
59
|
+
exports.dataPage = dataElements.dataPage;
|
|
60
|
+
exports.dataTable = dataElements.dataTable;
|
|
61
|
+
exports.invoiceColumns = dataElements.invoiceColumns;
|
|
62
|
+
exports.invoiceTableOptions = dataElements.invoiceTableOptions;
|
|
63
|
+
exports.observableDataTable = dataElements.observableDataTable;
|
|
64
|
+
exports.calendarField = formElements.calendarField;
|
|
65
|
+
exports.commandForm = formElements.commandForm;
|
|
66
|
+
exports.dropdownField = formElements.dropdownField;
|
|
67
|
+
exports.inputTextField = formElements.inputTextField;
|
|
68
|
+
exports.numberField = formElements.numberField;
|
|
69
|
+
exports.textAreaField = formElements.textAreaField;
|
|
70
|
+
exports.busyIndicatorDialog = dialogElements.busyIndicatorDialog;
|
|
71
|
+
exports.commandDialog = dialogElements.commandDialog;
|
|
72
|
+
exports.dialog = dialogElements.dialog;
|
|
73
|
+
exports.dropdown = editorElements.dropdown;
|
|
74
|
+
exports.filterPanel = editorElements.filterPanel;
|
|
75
|
+
exports.objectContentEditor = editorElements.objectContentEditor;
|
|
76
|
+
exports.objectNavigationalBar = editorElements.objectNavigationalBar;
|
|
77
|
+
exports.schemaEditor = editorElements.schemaEditor;
|
|
78
|
+
exports.timeMachine = editorElements.timeMachine;
|
|
79
|
+
exports.dataListPageTemplate = listTemplates.dataListPageTemplate;
|
|
80
|
+
exports.dataListWithDetailPageTemplate = listTemplates.dataListWithDetailPageTemplate;
|
|
81
|
+
exports.listTemplates = listTemplates.listTemplates;
|
|
82
|
+
exports.observableDataListPageTemplate = listTemplates.observableDataListPageTemplate;
|
|
83
|
+
exports.dashboardPageTemplate = workspaceTemplates.dashboardPageTemplate;
|
|
84
|
+
exports.masterDetailPageTemplate = workspaceTemplates.masterDetailPageTemplate;
|
|
85
|
+
exports.workspaceTemplates = workspaceTemplates.workspaceTemplates;
|
|
86
|
+
exports.commandFormPageTemplate = commandTemplates.commandFormPageTemplate;
|
|
87
|
+
exports.commandTemplates = commandTemplates.commandTemplates;
|
|
88
|
+
exports.editorTemplates = editorTemplates.editorTemplates;
|
|
89
|
+
exports.objectEditorPageTemplate = editorTemplates.objectEditorPageTemplate;
|
|
90
|
+
exports.schemaEditorPageTemplate = editorTemplates.schemaEditorPageTemplate;
|
|
91
|
+
exports.commandSliceSectionTemplate = nesting.commandSliceSectionTemplate;
|
|
92
|
+
exports.dataFeatureSectionTemplate = nesting.dataFeatureSectionTemplate;
|
|
93
|
+
exports.dataModulePageTemplate = nesting.dataModulePageTemplate;
|
|
94
|
+
exports.nestingChainTemplates = nesting.nestingChainTemplates;
|
|
95
|
+
exports.busyDialogTemplate = dialogTemplates.busyDialogTemplate;
|
|
96
|
+
exports.commandDialogTemplate = dialogTemplates.commandDialogTemplate;
|
|
97
|
+
exports.componentsDialogTemplates = dialogTemplates.componentsDialogTemplates;
|
|
98
|
+
exports.confirmDialogTemplate = dialogTemplates.confirmDialogTemplate;
|
|
99
|
+
exports.componentsPageTemplates = screenTemplates.componentsPageTemplates;
|
|
100
|
+
exports.componentsScreenTemplates = screenTemplates.componentsScreenTemplates;
|
|
101
|
+
exports.componentsNavigationContributions = navigation.componentsNavigationContributions;
|
|
102
|
+
exports.componentsNavigationEntries = navigation.componentsNavigationEntries;
|
|
103
|
+
exports.componentsNavigationGroups = navigation.componentsNavigationGroups;
|
|
104
|
+
exports.entriesInGroup = navigation.entriesInGroup;
|
|
105
|
+
exports.groupOfScreen = navigation.groupOfScreen;
|
|
106
|
+
exports.labelOfScreen = navigation.labelOfScreen;
|
|
107
|
+
exports.componentsApplicationChrome = applicationChrome.componentsApplicationChrome;
|
|
108
|
+
exports.componentsGalleryScreen = screens.componentsGalleryScreen;
|
|
109
|
+
exports.componentsGalleryScreens = screens.componentsGalleryScreens;
|
|
110
|
+
exports.componentsBlueprintCatalog = previewProfile.componentsBlueprintCatalog;
|
|
111
|
+
exports.componentsBlueprintProfile = previewProfile.componentsBlueprintProfile;
|
|
112
|
+
exports.primeReactComponentNames = previewProfile.primeReactComponentNames;
|
|
113
|
+
exports.GalleryScreenPreview = GalleryScreenPreview.GalleryScreenPreview;
|
|
114
|
+
exports.componentsPreviewRegistry = GalleryScreenPreview.componentsPreviewRegistry;
|
|
115
|
+
exports.DialogTemplatePreview = DialogTemplatePreview.DialogTemplatePreview;
|
|
116
|
+
exports.componentsBlueprintComponents = componentsBlueprintComponents.componentsBlueprintComponents;
|
|
117
|
+
exports.componentsBlueprint = componentsBlueprint.componentsBlueprint;
|
|
118
|
+
exports.componentsBlueprintManifest = componentsBlueprint.componentsBlueprintManifest;
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* The name this blueprint is known by inside a `ui profile`.
|
|
7
|
+
*
|
|
8
|
+
* It is not the npm package name: a profile lists Scene package names, a `PackageDependency` refers to
|
|
9
|
+
* one, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own
|
|
10
|
+
* rather than inside the manifest, so the registry can key off it without importing the manifest that
|
|
11
|
+
* describes the registry.
|
|
12
|
+
*/ const componentsBlueprintName = 'Cratis.Blueprint.Components';
|
|
13
|
+
|
|
14
|
+
exports.componentsBlueprintName = componentsBlueprintName;
|
|
15
|
+
//# sourceMappingURL=packageName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The name this blueprint is known by inside a `ui profile`.\n *\n * It is not the npm package name: a profile lists Scene package names, a `PackageDependency` refers to\n * one, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own\n * rather than inside the manifest, so the registry can key off it without importing the manifest that\n * describes the registry.\n */\nexport const componentsBlueprintName = 'Cratis.Blueprint.Components';\n"],"names":["componentsBlueprintName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,MAAMA,uBAAAA,GAA0B;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* The Arc query and command names this blueprint's templates ship bound to.
|
|
7
|
+
*
|
|
8
|
+
* A template carries a binding *name*, never a class - the binding registry in `@cratis/scene.components`
|
|
9
|
+
* is what turns a name into the generated proxy at render time, and only a host owns those proxies. So a
|
|
10
|
+
* template has to write some name, and these are the ones it writes.
|
|
11
|
+
*
|
|
12
|
+
* They are defaults, not fixtures. An application picking `DataListPage` replaces `AllInvoices` with its
|
|
13
|
+
* own query and the page is done; nothing else about the template changes. Shipping a template with no
|
|
14
|
+
* name at all would have been the alternative, and it is a worse one - it renders as a diagram of a page
|
|
15
|
+
* rather than a page, and the thing a template most needs to prove is that it composes into something
|
|
16
|
+
* real.
|
|
17
|
+
*
|
|
18
|
+
* The names are deliberately in the shape Arc generates: a `[ReadModel]`'s static query method
|
|
19
|
+
* (`AllInvoices`), and a `[Command]` record (`RegisterInvoice`). A designer reading a preview should
|
|
20
|
+
* recognize them as the artifacts they would really be wiring.
|
|
21
|
+
*
|
|
22
|
+
* This is an enum of *this package's defaults*, not of every name a binding may take. The element builders
|
|
23
|
+
* therefore take a plain `string`, so an application can point the same builders at `AllPurchaseOrders`
|
|
24
|
+
* without having to widen anything - the set of Arc proxies in an application is open, and a closed type
|
|
25
|
+
* over it would make these builders usable only for the invoices they ship bound to.
|
|
26
|
+
*/ var SampleBindingName = /*#__PURE__*/ function(SampleBindingName) {
|
|
27
|
+
/** Every invoice - the snapshot query a list page reads. */ SampleBindingName["AllInvoices"] = "AllInvoices";
|
|
28
|
+
/** Invoices still being processed - an observable query, so the page is live. */ SampleBindingName["InvoicesInFlight"] = "InvoicesInFlight";
|
|
29
|
+
/** One invoice by its id - what a detail region reads. */ SampleBindingName["InvoiceById"] = "InvoiceById";
|
|
30
|
+
/** Revenue aggregated by month - a dashboard widget's query. */ SampleBindingName["RevenueByMonth"] = "RevenueByMonth";
|
|
31
|
+
/** Open support tickets - a second dashboard widget's query. */ SampleBindingName["OpenTickets"] = "OpenTickets";
|
|
32
|
+
/** Every adjustment recorded against an invoice. */ SampleBindingName["AllAdjustments"] = "AllAdjustments";
|
|
33
|
+
/** Registers a new invoice - the command a form page submits. */ SampleBindingName["RegisterInvoice"] = "RegisterInvoice";
|
|
34
|
+
/** Records an adjustment against an invoice - the command a dialog submits. */ SampleBindingName["RecordAdjustment"] = "RecordAdjustment";
|
|
35
|
+
return SampleBindingName;
|
|
36
|
+
}({});
|
|
37
|
+
|
|
38
|
+
exports.SampleBindingName = SampleBindingName;
|
|
39
|
+
//# sourceMappingURL=SampleBindingName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SampleBindingName.js","sources":["../../../templates/SampleBindingName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The Arc query and command names this blueprint's templates ship bound to.\n *\n * A template carries a binding *name*, never a class - the binding registry in `@cratis/scene.components`\n * is what turns a name into the generated proxy at render time, and only a host owns those proxies. So a\n * template has to write some name, and these are the ones it writes.\n *\n * They are defaults, not fixtures. An application picking `DataListPage` replaces `AllInvoices` with its\n * own query and the page is done; nothing else about the template changes. Shipping a template with no\n * name at all would have been the alternative, and it is a worse one - it renders as a diagram of a page\n * rather than a page, and the thing a template most needs to prove is that it composes into something\n * real.\n *\n * The names are deliberately in the shape Arc generates: a `[ReadModel]`'s static query method\n * (`AllInvoices`), and a `[Command]` record (`RegisterInvoice`). A designer reading a preview should\n * recognize them as the artifacts they would really be wiring.\n *\n * This is an enum of *this package's defaults*, not of every name a binding may take. The element builders\n * therefore take a plain `string`, so an application can point the same builders at `AllPurchaseOrders`\n * without having to widen anything - the set of Arc proxies in an application is open, and a closed type\n * over it would make these builders usable only for the invoices they ship bound to.\n */\nexport enum SampleBindingName {\n /** Every invoice - the snapshot query a list page reads. */\n AllInvoices = 'AllInvoices',\n\n /** Invoices still being processed - an observable query, so the page is live. */\n InvoicesInFlight = 'InvoicesInFlight',\n\n /** One invoice by its id - what a detail region reads. */\n InvoiceById = 'InvoiceById',\n\n /** Revenue aggregated by month - a dashboard widget's query. */\n RevenueByMonth = 'RevenueByMonth',\n\n /** Open support tickets - a second dashboard widget's query. */\n OpenTickets = 'OpenTickets',\n\n /** Every adjustment recorded against an invoice. */\n AllAdjustments = 'AllAdjustments',\n\n /** Registers a new invoice - the command a form page submits. */\n RegisterInvoice = 'RegisterInvoice',\n\n /** Records an adjustment against an invoice - the command a dialog submits. */\n RecordAdjustment = 'RecordAdjustment',\n}\n"],"names":["SampleBindingName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;IAsBO,IAAKA,iBAAAA,iBAAAA,SAAAA,iBAAAA,EAAAA;iEACkD,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;sFAGqB,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;+DAGvB,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;qEAGM,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;qEAGA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;yDAGZ,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;sEAGa,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;oFAGc,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AAtBrEA,IAAAA,OAAAA,iBAAAA;AAwBX,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
4
|
+
var elements = require('./elements.js');
|
|
5
|
+
var formElements = require('./formElements.js');
|
|
6
|
+
var SampleBindingName = require('./SampleBindingName.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/**
|
|
11
|
+
* The write side: a page whose body is one command, and whose action bar submits it.
|
|
12
|
+
*/ /**
|
|
13
|
+
* A command form page - a header, the generated form, and the bar that closes it.
|
|
14
|
+
*
|
|
15
|
+
* The form is `commandForm`, which is `AutoCommandForm`: it reads the command's own property descriptors
|
|
16
|
+
* and picks a field component per property type. That is the whole reason a *template* can ship a form at
|
|
17
|
+
* all. A template that listed fields by hand would be a snapshot of a command as it looked the day the
|
|
18
|
+
* template was written, and would go quietly wrong the first time a property was added on the backend.
|
|
19
|
+
* This one follows the command, which is the same guarantee Arc's generated proxies give everywhere else.
|
|
20
|
+
*
|
|
21
|
+
* `exclude` names the properties the form should not generate. `invoiceId` is excluded because it is the
|
|
22
|
+
* event-source identity - Arc resolves it, and a form offering to type it in is offering to break it.
|
|
23
|
+
*
|
|
24
|
+
* The action bar is the template's rather than the form's, and it declares its own slot for that reason: a
|
|
25
|
+
* screen replacing "Register" with "Register and approve" should not have to replace the form.
|
|
26
|
+
*/ const commandFormPageTemplate = {
|
|
27
|
+
name: 'CommandFormPage',
|
|
28
|
+
fitsSlot: scene_blueprint_default.SlotName.Content,
|
|
29
|
+
slots: [
|
|
30
|
+
{
|
|
31
|
+
name: scene_blueprint_default.TemplateSlotName.Header
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: scene_blueprint_default.TemplateSlotName.Body
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: scene_blueprint_default.TemplateSlotName.Actions
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
arrangement: {
|
|
41
|
+
root: scene_blueprint_default.column([
|
|
42
|
+
scene_blueprint_default.slotLeaf(scene_blueprint_default.TemplateSlotName.Header),
|
|
43
|
+
scene_blueprint_default.slotLeaf(scene_blueprint_default.TemplateSlotName.Body, {
|
|
44
|
+
grow: 1
|
|
45
|
+
}),
|
|
46
|
+
scene_blueprint_default.slotLeaf(scene_blueprint_default.TemplateSlotName.Actions)
|
|
47
|
+
], 16)
|
|
48
|
+
},
|
|
49
|
+
content: {
|
|
50
|
+
[scene_blueprint_default.TemplateSlotName.Header]: [
|
|
51
|
+
elements.arcPageHeader('command-form-header', {
|
|
52
|
+
title: 'Register an invoice',
|
|
53
|
+
subtitle: 'The form follows the command, so a property added on the backend shows up here',
|
|
54
|
+
section: 'Billing',
|
|
55
|
+
command: SampleBindingName.SampleBindingName.RegisterInvoice
|
|
56
|
+
})
|
|
57
|
+
],
|
|
58
|
+
[scene_blueprint_default.TemplateSlotName.Body]: [
|
|
59
|
+
elements.page('command-form-body', '', [
|
|
60
|
+
formElements.commandForm('command-form', SampleBindingName.SampleBindingName.RegisterInvoice, [
|
|
61
|
+
'invoiceId'
|
|
62
|
+
])
|
|
63
|
+
])
|
|
64
|
+
],
|
|
65
|
+
[scene_blueprint_default.TemplateSlotName.Actions]: [
|
|
66
|
+
elements.toolbar('command-form-actions', [
|
|
67
|
+
elements.toolbarButton('command-form-submit', 'Register the invoice', 'pi pi-check', 'Register'),
|
|
68
|
+
elements.toolbarSeparator('command-form-separator'),
|
|
69
|
+
elements.toolbarButton('command-form-cancel', 'Discard and go back', 'pi pi-times', 'Cancel')
|
|
70
|
+
])
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
displayName: 'Command form page',
|
|
74
|
+
description: 'A generated command form under a header that states the command, with its own action bar.'
|
|
75
|
+
};
|
|
76
|
+
/** The command-shaped templates. */ const commandTemplates = [
|
|
77
|
+
commandFormPageTemplate
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
exports.commandFormPageTemplate = commandFormPageTemplate;
|
|
81
|
+
exports.commandTemplates = commandTemplates;
|
|
82
|
+
//# sourceMappingURL=commandTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandTemplates.js","sources":["../../../templates/commandTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { commandForm } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The write side: a page whose body is one command, and whose action bar submits it.\n */\n\n/**\n * A command form page - a header, the generated form, and the bar that closes it.\n *\n * The form is `commandForm`, which is `AutoCommandForm`: it reads the command's own property descriptors\n * and picks a field component per property type. That is the whole reason a *template* can ship a form at\n * all. A template that listed fields by hand would be a snapshot of a command as it looked the day the\n * template was written, and would go quietly wrong the first time a property was added on the backend.\n * This one follows the command, which is the same guarantee Arc's generated proxies give everywhere else.\n *\n * `exclude` names the properties the form should not generate. `invoiceId` is excluded because it is the\n * event-source identity - Arc resolves it, and a form offering to type it in is offering to break it.\n *\n * The action bar is the template's rather than the form's, and it declares its own slot for that reason: a\n * screen replacing \"Register\" with \"Register and approve\" should not have to replace the form.\n */\nexport const commandFormPageTemplate: ScreenTemplate = {\n name: 'CommandFormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('command-form-header', {\n title: 'Register an invoice',\n subtitle: 'The form follows the command, so a property added on the backend shows up here',\n section: 'Billing',\n command: SampleBindingName.RegisterInvoice,\n }),\n ],\n [TemplateSlotName.Body]: [page('command-form-body', '', [commandForm('command-form', SampleBindingName.RegisterInvoice, ['invoiceId'])])],\n [TemplateSlotName.Actions]: [\n toolbar('command-form-actions', [\n toolbarButton('command-form-submit', 'Register the invoice', 'pi pi-check', 'Register'),\n toolbarSeparator('command-form-separator'),\n toolbarButton('command-form-cancel', 'Discard and go back', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n displayName: 'Command form page',\n description: 'A generated command form under a header that states the command, with its own action bar.',\n};\n\n/** The command-shaped templates. */\nexport const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate];\n"],"names":["commandFormPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","Actions","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","command","SampleBindingName","RegisterInvoice","page","commandForm","toolbar","toolbarButton","toolbarSeparator","displayName","description","commandTemplates"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,yCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,yCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,yCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,8BAAAA,CAAO;AAACC,YAAAA,gCAAAA,CAASP,yCAAiBC,MAAM,CAAA;YAAGM,gCAAAA,CAASP,wCAAAA,CAAiBE,IAAI,EAAE;gBAAEM,IAAAA,EAAM;AAAE,aAAA,CAAA;AAAID,YAAAA,gCAAAA,CAASP,yCAAiBG,OAAO;SAAE,EAAE,EAAA;AACxI,KAAA;IACAM,OAAAA,EAAS;QACL,CAACT,wCAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,sBAAAA,CAAc,qBAAA,EAAuB;gBACjCC,KAAAA,EAAO,qBAAA;gBACPC,QAAAA,EAAU,gFAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,OAAAA,EAASC,oCAAkBC;AAC/B,aAAA;AACH,SAAA;QACD,CAAChB,wCAAAA,CAAiBE,IAAI,GAAG;AAACe,YAAAA,aAAAA,CAAK,qBAAqB,EAAA,EAAI;gBAACC,wBAAAA,CAAY,cAAA,EAAgBH,mCAAAA,CAAkBC,eAAe,EAAE;AAAC,oBAAA;AAAY,iBAAA;AAAE,aAAA;AAAE,SAAA;QACzI,CAAChB,wCAAAA,CAAiBG,OAAO,GAAG;AACxBgB,YAAAA,gBAAAA,CAAQ,sBAAA,EAAwB;gBAC5BC,sBAAAA,CAAc,qBAAA,EAAuB,wBAAwB,aAAA,EAAe,UAAA,CAAA;gBAC5EC,yBAAAA,CAAiB,wBAAA,CAAA;gBACjBD,sBAAAA,CAAc,qBAAA,EAAuB,uBAAuB,aAAA,EAAe,QAAA;AAC9E,aAAA;AACJ;AACL,KAAA;IACAE,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qCACO,MAAMC,gBAAAA,GAAqC;AAAC9B,IAAAA;;;;;;"}
|