@brilo/base-blocks 0.1.41 → 0.1.43
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/build/.tsbuildinfo +1 -1
- package/build/blocks/compare/compare-group/types.d.ts +1 -1
- package/build/blocks/compare/compare-group/types.d.ts.map +1 -1
- package/build/blocks/compare/compare-option/types.d.ts +1 -1
- package/build/blocks/compare/compare-option/types.d.ts.map +1 -1
- package/build/blocks/core/basic-button/edit.d.ts.map +1 -1
- package/build/blocks/core/basic-button/edit.js +3 -3
- package/build/blocks/core/basic-button/factory.d.ts.map +1 -1
- package/build/blocks/core/basic-button/factory.js +1 -0
- package/build/blocks/core/basic-button/types.d.ts +1 -0
- package/build/blocks/core/basic-button/types.d.ts.map +1 -1
- package/build/blocks/core/basic-overline/edit.d.ts.map +1 -1
- package/build/blocks/core/basic-overline/edit.js +6 -1
- package/build/blocks/core/basic-overline/factory.d.ts.map +1 -1
- package/build/blocks/core/basic-overline/factory.js +2 -0
- package/build/blocks/core/basic-overline/types.d.ts +3 -1
- package/build/blocks/core/basic-overline/types.d.ts.map +1 -1
- package/build/blocks/form/form-field/edit.d.ts +1 -1
- package/build/blocks/form/form-field/edit.d.ts.map +1 -1
- package/build/blocks/form/form-field/types.d.ts +1 -1
- package/build/blocks/form/form-field/types.d.ts.map +1 -1
- package/build/blocks/gallery/gallery-item/index.d.ts +1 -1
- package/build/blocks/gallery/gallery-item/index.d.ts.map +1 -1
- package/build/blocks/groups/banner-group/index.d.ts +1 -1
- package/build/blocks/groups/banner-group/index.d.ts.map +1 -1
- package/build/blocks/groups/banner-group/types.d.ts +2 -2
- package/build/blocks/groups/banner-group/types.d.ts.map +1 -1
- package/build/blocks/groups/basic-header-group/edit.d.ts.map +1 -1
- package/build/blocks/groups/basic-header-group/edit.js +8 -3
- package/build/blocks/groups/basic-header-group/factory.js +1 -1
- package/build/blocks/groups/basic-header-group/types.d.ts +2 -0
- package/build/blocks/groups/basic-header-group/types.d.ts.map +1 -1
- package/build/blocks/groups/text-and-media-group/constants.d.ts +25 -0
- package/build/blocks/groups/text-and-media-group/constants.d.ts.map +1 -1
- package/build/blocks/groups/text-and-media-group/constants.js +10 -0
- package/build/blocks/groups/text-and-media-group/edit.d.ts.map +1 -1
- package/build/blocks/groups/text-and-media-group/edit.js +16 -9
- package/build/blocks/groups/text-and-media-group/factory.d.ts +2 -2
- package/build/blocks/groups/text-and-media-group/factory.d.ts.map +1 -1
- package/build/blocks/groups/text-and-media-group/factory.js +12 -10
- package/build/blocks/groups/text-and-media-group/types.d.ts +8 -3
- package/build/blocks/groups/text-and-media-group/types.d.ts.map +1 -1
- package/build/blocks/hero/hero-group/constants.d.ts +16 -0
- package/build/blocks/hero/hero-group/constants.d.ts.map +1 -1
- package/build/blocks/hero/hero-group/constants.js +7 -0
- package/build/blocks/hero/hero-group/edit.d.ts.map +1 -1
- package/build/blocks/hero/hero-group/edit.js +6 -5
- package/build/blocks/hero/hero-group/factory.d.ts +2 -2
- package/build/blocks/hero/hero-group/factory.d.ts.map +1 -1
- package/build/blocks/hero/hero-group/factory.js +11 -5
- package/build/blocks/hero/hero-group/types.d.ts +7 -4
- package/build/blocks/hero/hero-group/types.d.ts.map +1 -1
- package/build/blocks/hero/hero-item/edit.d.ts.map +1 -1
- package/build/blocks/hero/hero-item/edit.js +7 -2
- package/build/blocks/hero/hero-item/factory.d.ts.map +1 -1
- package/build/blocks/hero/hero-item/factory.js +1 -0
- package/build/blocks/hero/hero-item/types.d.ts +12 -2
- package/build/blocks/hero/hero-item/types.d.ts.map +1 -1
- package/build/blocks/link/link-item/factory.d.ts +1 -1
- package/build/blocks/link/link-item/factory.d.ts.map +1 -1
- package/build/blocks/map/map-group/types.d.ts +3 -3
- package/build/blocks/map/map-group/types.d.ts.map +1 -1
- package/build/blocks/newsletter/newsletter-form/types.d.ts +1 -1
- package/build/blocks/newsletter/newsletter-form/types.d.ts.map +1 -1
- package/build/blocks/person/person-group/types.d.ts +1 -1
- package/build/blocks/person/person-group/types.d.ts.map +1 -1
- package/build/blocks/person/person-item/constants.d.ts.map +1 -1
- package/build/blocks/person/person-item/types.d.ts +2 -2
- package/build/blocks/person/person-item/types.d.ts.map +1 -1
- package/build/blocks/priceplan/priceplan-group/constants.d.ts +2 -0
- package/build/blocks/priceplan/priceplan-group/constants.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-group/constants.js +1 -0
- package/build/blocks/priceplan/priceplan-group/edit.d.ts +3 -0
- package/build/blocks/priceplan/priceplan-group/edit.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-group/edit.js +16 -0
- package/build/blocks/priceplan/priceplan-group/factory.d.ts +5 -0
- package/build/blocks/priceplan/priceplan-group/factory.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-group/factory.js +20 -0
- package/build/blocks/priceplan/priceplan-group/icon.d.ts +2 -0
- package/build/blocks/priceplan/priceplan-group/icon.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-group/icon.js +2 -0
- package/build/blocks/priceplan/priceplan-group/index.d.ts +5 -0
- package/build/blocks/priceplan/priceplan-group/index.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-group/index.js +11 -0
- package/build/blocks/priceplan/priceplan-group/types.d.ts +7 -0
- package/build/blocks/priceplan/priceplan-group/types.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-group/types.js +1 -0
- package/build/blocks/priceplan/priceplan-item/constants.d.ts +15 -0
- package/build/blocks/priceplan/priceplan-item/constants.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-item/constants.js +9 -0
- package/build/blocks/priceplan/priceplan-item/edit.d.ts +6 -0
- package/build/blocks/priceplan/priceplan-item/edit.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-item/edit.js +30 -0
- package/build/blocks/priceplan/priceplan-item/factory.d.ts +7 -0
- package/build/blocks/priceplan/priceplan-item/factory.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-item/factory.js +70 -0
- package/build/blocks/priceplan/priceplan-item/icon.d.ts +2 -0
- package/build/blocks/priceplan/priceplan-item/icon.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-item/icon.js +2 -0
- package/build/blocks/priceplan/priceplan-item/index.d.ts +5 -0
- package/build/blocks/priceplan/priceplan-item/index.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-item/index.js +12 -0
- package/build/blocks/priceplan/priceplan-item/types.d.ts +28 -0
- package/build/blocks/priceplan/priceplan-item/types.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-item/types.js +1 -0
- package/build/blocks/priceplan/priceplan-list-item/constants.d.ts +8 -0
- package/build/blocks/priceplan/priceplan-list-item/constants.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-list-item/constants.js +5 -0
- package/build/blocks/priceplan/priceplan-list-item/edit.d.ts +6 -0
- package/build/blocks/priceplan/priceplan-list-item/edit.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-list-item/edit.js +17 -0
- package/build/blocks/priceplan/priceplan-list-item/factory.d.ts +7 -0
- package/build/blocks/priceplan/priceplan-list-item/factory.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-list-item/factory.js +30 -0
- package/build/blocks/priceplan/priceplan-list-item/icon.d.ts +2 -0
- package/build/blocks/priceplan/priceplan-list-item/icon.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-list-item/icon.js +2 -0
- package/build/blocks/priceplan/priceplan-list-item/index.d.ts +5 -0
- package/build/blocks/priceplan/priceplan-list-item/index.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-list-item/index.js +5 -0
- package/build/blocks/priceplan/priceplan-list-item/types.d.ts +11 -0
- package/build/blocks/priceplan/priceplan-list-item/types.d.ts.map +1 -0
- package/build/blocks/priceplan/priceplan-list-item/types.js +1 -0
- package/build/blocks/review/review-group/constants.d.ts +16 -0
- package/build/blocks/review/review-group/constants.d.ts.map +1 -0
- package/build/blocks/review/review-group/constants.js +16 -0
- package/build/blocks/review/review-group/edit.d.ts +4 -0
- package/build/blocks/review/review-group/edit.d.ts.map +1 -0
- package/build/blocks/review/review-group/edit.js +28 -0
- package/build/blocks/review/review-group/factory.d.ts +7 -0
- package/build/blocks/review/review-group/factory.d.ts.map +1 -0
- package/build/blocks/review/review-group/factory.js +36 -0
- package/build/blocks/review/review-group/icon.d.ts +2 -0
- package/build/blocks/review/review-group/icon.d.ts.map +1 -0
- package/build/blocks/review/review-group/icon.js +2 -0
- package/build/blocks/review/review-group/index.d.ts +5 -0
- package/build/blocks/review/review-group/index.d.ts.map +1 -0
- package/build/blocks/review/review-group/index.js +6 -0
- package/build/blocks/review/review-group/types.d.ts +15 -0
- package/build/blocks/review/review-group/types.d.ts.map +1 -0
- package/build/blocks/review/review-group/types.js +1 -0
- package/build/blocks/review/review-item/constants.d.ts +2 -0
- package/build/blocks/review/review-item/constants.d.ts.map +1 -0
- package/build/blocks/review/review-item/constants.js +1 -0
- package/build/blocks/review/review-item/edit.d.ts +4 -0
- package/build/blocks/review/review-item/edit.d.ts.map +1 -0
- package/build/blocks/review/review-item/edit.js +29 -0
- package/build/blocks/review/review-item/factory.d.ts +5 -0
- package/build/blocks/review/review-item/factory.d.ts.map +1 -0
- package/build/blocks/review/review-item/factory.js +36 -0
- package/build/blocks/review/review-item/icon.d.ts +2 -0
- package/build/blocks/review/review-item/icon.d.ts.map +1 -0
- package/build/blocks/review/review-item/icon.js +2 -0
- package/build/blocks/review/review-item/index.d.ts +5 -0
- package/build/blocks/review/review-item/index.d.ts.map +1 -0
- package/build/blocks/review/review-item/index.js +5 -0
- package/build/blocks/review/review-item/types.d.ts +17 -0
- package/build/blocks/review/review-item/types.d.ts.map +1 -0
- package/build/blocks/review/review-item/types.js +1 -0
- package/build/blocks/sections/base-section/attributes.d.ts +25 -0
- package/build/blocks/sections/base-section/attributes.d.ts.map +1 -1
- package/build/blocks/sections/base-section/attributes.js +9 -0
- package/build/blocks/sections/base-section/controls.d.ts.map +1 -1
- package/build/blocks/sections/base-section/controls.js +46 -2
- package/build/blocks/sections/base-section/types.d.ts +24 -1
- package/build/blocks/sections/base-section/types.d.ts.map +1 -1
- package/build/blocks/share/share/index.d.ts.map +1 -1
- package/build/blocks/share/share/index.js +1 -0
- package/build/blocks/signpost/signpost-group/constants.d.ts +26 -0
- package/build/blocks/signpost/signpost-group/constants.d.ts.map +1 -1
- package/build/blocks/signpost/signpost-group/constants.js +21 -0
- package/build/blocks/signpost/signpost-group/edit.d.ts.map +1 -1
- package/build/blocks/signpost/signpost-group/edit.js +13 -8
- package/build/blocks/signpost/signpost-group/factory.d.ts.map +1 -1
- package/build/blocks/signpost/signpost-group/factory.js +5 -1
- package/build/blocks/signpost/signpost-group/types.d.ts +5 -1
- package/build/blocks/signpost/signpost-group/types.d.ts.map +1 -1
- package/build/blocks/step/step-group/edit.d.ts +1 -1
- package/build/blocks/step/step-group/edit.d.ts.map +1 -1
- package/build/blocks/step/step-group/factory.d.ts +1 -1
- package/build/blocks/step/step-group/factory.d.ts.map +1 -1
- package/build/blocks/step/step-group/types.d.ts +2 -2
- package/build/blocks/step/step-group/types.d.ts.map +1 -1
- package/build/blocks/step/step-item/types.d.ts +1 -1
- package/build/blocks/step/step-item/types.d.ts.map +1 -1
- package/build/blocks/testimonial/testimonial-group/index.d.ts +1 -1
- package/build/blocks/testimonial/testimonial-group/index.d.ts.map +1 -1
- package/build/blocks/testimonial/testimonial-group/types.d.ts +1 -1
- package/build/blocks/testimonial/testimonial-group/types.d.ts.map +1 -1
- package/build/blocks/text-and-form/text-and-form-text-column/edit.d.ts.map +1 -1
- package/build/blocks/text-and-form/text-and-form-text-column/edit.js +9 -2
- package/build/blocks/text-and-form/text-and-form-text-column/factory.js +1 -1
- package/build/blocks/text-and-form/text-and-form-text-column/types.d.ts +2 -0
- package/build/blocks/text-and-form/text-and-form-text-column/types.d.ts.map +1 -1
- package/build/blocks/usp/usp-item/types.d.ts +1 -1
- package/build/blocks/usp/usp-item/types.d.ts.map +1 -1
- package/build/blocks/video/video-group/constants.d.ts +15 -0
- package/build/blocks/video/video-group/constants.d.ts.map +1 -0
- package/build/blocks/video/video-group/constants.js +9 -0
- package/build/blocks/video/video-group/edit.d.ts +4 -0
- package/build/blocks/video/video-group/edit.d.ts.map +1 -0
- package/build/blocks/video/video-group/edit.js +23 -0
- package/build/blocks/video/video-group/factory.d.ts +5 -0
- package/build/blocks/video/video-group/factory.d.ts.map +1 -0
- package/build/blocks/video/video-group/factory.js +47 -0
- package/build/blocks/video/video-group/icon.d.ts +2 -0
- package/build/blocks/video/video-group/icon.d.ts.map +1 -0
- package/build/blocks/video/video-group/icon.js +2 -0
- package/build/blocks/video/video-group/index.d.ts +5 -0
- package/build/blocks/video/video-group/index.d.ts.map +1 -0
- package/build/blocks/video/video-group/index.js +5 -0
- package/build/blocks/video/video-group/types.d.ts +19 -0
- package/build/blocks/video/video-group/types.d.ts.map +1 -0
- package/build/blocks/video/video-group/types.js +1 -0
- package/build/components/Document/DocumentTermSelectModal.js +1 -1
- package/build/components/EntitySelectModal/EntitySelectModal.d.ts.map +1 -0
- package/build/components/Event/EventSelectModal.js +1 -1
- package/build/components/Event/EventTermSelectModal.js +1 -1
- package/build/components/Post/PostSelectModal.js +1 -1
- package/build/components/Post/PostTermSelectModal.js +1 -1
- package/build/index.d.ts +12 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -0
- package/build/types.d.ts +1 -1
- package/build/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blocks/compare/compare-group/types.ts +1 -1
- package/src/blocks/compare/compare-option/types.ts +1 -1
- package/src/blocks/core/basic-button/edit.tsx +29 -18
- package/src/blocks/core/basic-button/factory.tsx +1 -0
- package/src/blocks/core/basic-button/types.ts +1 -0
- package/src/blocks/core/basic-overline/edit.tsx +8 -0
- package/src/blocks/core/basic-overline/factory.tsx +2 -0
- package/src/blocks/core/basic-overline/types.ts +3 -1
- package/src/blocks/form/form-field/edit.tsx +1 -1
- package/src/blocks/form/form-field/types.ts +4 -4
- package/src/blocks/form/form-group/editor.scss +1 -0
- package/src/blocks/gallery/gallery-item/index.ts +1 -1
- package/src/blocks/groups/banner-group/index.ts +1 -1
- package/src/blocks/groups/banner-group/types.ts +2 -2
- package/src/blocks/groups/basic-header-group/edit.tsx +25 -1
- package/src/blocks/groups/basic-header-group/factory.tsx +1 -1
- package/src/blocks/groups/basic-header-group/types.ts +1 -1
- package/src/blocks/groups/text-and-media-group/constants.ts +11 -0
- package/src/blocks/groups/text-and-media-group/edit.tsx +37 -2
- package/src/blocks/groups/text-and-media-group/editor.scss +50 -4
- package/src/blocks/groups/text-and-media-group/factory.tsx +10 -4
- package/src/blocks/groups/text-and-media-group/types.ts +7 -1
- package/src/blocks/hero/hero-group/constants.ts +8 -0
- package/src/blocks/hero/hero-group/edit.tsx +16 -4
- package/src/blocks/hero/hero-group/factory.tsx +13 -4
- package/src/blocks/hero/hero-group/types.ts +15 -3
- package/src/blocks/hero/hero-item/edit.tsx +42 -2
- package/src/blocks/hero/hero-item/editor.scss +13 -0
- package/src/blocks/hero/hero-item/factory.tsx +1 -0
- package/src/blocks/hero/hero-item/types.ts +4 -2
- package/src/blocks/link/link-item/factory.tsx +1 -1
- package/src/blocks/map/map-group/types.ts +3 -3
- package/src/blocks/newsletter/newsletter-form/types.ts +1 -1
- package/src/blocks/person/person-group/types.ts +1 -1
- package/src/blocks/person/person-item/constants.ts +0 -3
- package/src/blocks/person/person-item/types.ts +2 -2
- package/src/blocks/priceplan/priceplan-group/constants.ts +1 -0
- package/src/blocks/priceplan/priceplan-group/edit.tsx +21 -0
- package/src/blocks/priceplan/priceplan-group/editor.scss +3 -0
- package/src/blocks/priceplan/priceplan-group/factory.tsx +23 -0
- package/src/blocks/priceplan/priceplan-group/icon.tsx +36 -0
- package/src/blocks/priceplan/priceplan-group/index.ts +15 -0
- package/src/blocks/priceplan/priceplan-group/types.ts +7 -0
- package/src/blocks/priceplan/priceplan-item/constants.ts +11 -0
- package/src/blocks/priceplan/priceplan-item/edit.tsx +158 -0
- package/src/blocks/priceplan/priceplan-item/editor.scss +131 -0
- package/src/blocks/priceplan/priceplan-item/factory.tsx +80 -0
- package/src/blocks/priceplan/priceplan-item/icon.tsx +9 -0
- package/src/blocks/priceplan/priceplan-item/index.ts +16 -0
- package/src/blocks/priceplan/priceplan-item/types.ts +34 -0
- package/src/blocks/priceplan/priceplan-list-item/constants.ts +6 -0
- package/src/blocks/priceplan/priceplan-list-item/edit.tsx +59 -0
- package/src/blocks/priceplan/priceplan-list-item/editor.scss +21 -0
- package/src/blocks/priceplan/priceplan-list-item/factory.tsx +38 -0
- package/src/blocks/priceplan/priceplan-list-item/icon.tsx +9 -0
- package/src/blocks/priceplan/priceplan-list-item/index.ts +9 -0
- package/src/blocks/priceplan/priceplan-list-item/types.ts +13 -0
- package/src/blocks/review/review-group/constants.ts +19 -0
- package/src/blocks/review/review-group/edit.tsx +72 -0
- package/src/blocks/review/review-group/editor.scss +10 -0
- package/src/blocks/review/review-group/factory.tsx +43 -0
- package/src/blocks/review/review-group/icon.tsx +12 -0
- package/src/blocks/review/review-group/index.ts +10 -0
- package/src/blocks/review/review-group/types.ts +17 -0
- package/src/blocks/review/review-item/constants.ts +1 -0
- package/src/blocks/review/review-item/edit.tsx +126 -0
- package/src/blocks/review/review-item/editor.scss +96 -0
- package/src/blocks/review/review-item/factory.tsx +40 -0
- package/src/blocks/review/review-item/icon.tsx +9 -0
- package/src/blocks/review/review-item/index.ts +9 -0
- package/src/blocks/review/review-item/types.ts +19 -0
- package/src/blocks/sections/base-section/attributes.ts +9 -0
- package/src/blocks/sections/base-section/controls.tsx +97 -1
- package/src/blocks/sections/base-section/types.ts +9 -1
- package/src/blocks/share/share/index.ts +1 -0
- package/src/blocks/signpost/signpost-group/constants.ts +23 -0
- package/src/blocks/signpost/signpost-group/edit.tsx +25 -4
- package/src/blocks/signpost/signpost-group/factory.tsx +5 -1
- package/src/blocks/signpost/signpost-group/types.ts +4 -1
- package/src/blocks/signpost/signpost-item/editor.scss +5 -0
- package/src/blocks/step/step-group/edit.tsx +1 -1
- package/src/blocks/step/step-group/factory.tsx +1 -1
- package/src/blocks/step/step-group/types.ts +2 -2
- package/src/blocks/step/step-item/types.ts +1 -1
- package/src/blocks/testimonial/testimonial-group/index.ts +1 -1
- package/src/blocks/testimonial/testimonial-group/types.ts +1 -1
- package/src/blocks/text-and-form/text-and-form-text-column/edit.tsx +31 -0
- package/src/blocks/text-and-form/text-and-form-text-column/editor.scss +8 -4
- package/src/blocks/text-and-form/text-and-form-text-column/factory.tsx +1 -1
- package/src/blocks/text-and-form/text-and-form-text-column/types.ts +1 -1
- package/src/blocks/usp/usp-item/types.ts +1 -1
- package/src/blocks/video/video-group/constants.ts +11 -0
- package/src/blocks/video/video-group/edit.tsx +158 -0
- package/src/blocks/video/video-group/editor.scss +105 -0
- package/src/blocks/video/video-group/factory.tsx +51 -0
- package/src/blocks/video/video-group/icon.tsx +17 -0
- package/src/blocks/video/video-group/index.ts +9 -0
- package/src/blocks/video/video-group/types.ts +21 -0
- package/src/components/Document/DocumentTermSelectModal.tsx +1 -1
- package/src/components/Event/EventSelectModal.tsx +1 -1
- package/src/components/Event/EventTermSelectModal.tsx +1 -1
- package/src/components/ImagePicker/ImagePicker.tsx +1 -1
- package/src/components/Post/PostSelectModal.tsx +1 -1
- package/src/components/Post/PostTermSelectModal.tsx +1 -1
- package/src/editor.scss +6 -0
- package/src/index.ts +12 -0
- package/src/types.ts +1 -1
- package/build/components/Event/EntitySelectModal.d.ts.map +0 -1
- /package/build/components/{Event → EntitySelectModal}/EntitySelectModal.d.ts +0 -0
- /package/build/components/{Event → EntitySelectModal}/EntitySelectModal.js +0 -0
- /package/src/components/{Event → EntitySelectModal}/EntitySelectModal.tsx +0 -0
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from './constants'
|
|
15
15
|
import {normalizeOptions, serializeOptions, type OptionRow} from './normalizeOptions'
|
|
16
16
|
import {SelectOptionsRepeater} from './SelectOptionsRepeater'
|
|
17
|
-
import {
|
|
17
|
+
import type {
|
|
18
18
|
FormFieldAttributes,
|
|
19
19
|
FormFieldFileButtonVariant,
|
|
20
20
|
FormFieldOptions,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
FIELD_SELECT_MODE_VALUES,
|
|
2
|
+
type FIELD_SELECT_MODE_VALUES,
|
|
3
3
|
FIELD_TEXT_TYPES,
|
|
4
|
-
FIELD_TEXT_TYPE_VALUES,
|
|
5
|
-
FIELD_TYPE_VALUES,
|
|
6
|
-
FILE_BUTTON_VARIANT_VALUES,
|
|
4
|
+
type FIELD_TEXT_TYPE_VALUES,
|
|
5
|
+
type FIELD_TYPE_VALUES,
|
|
6
|
+
type FILE_BUTTON_VARIANT_VALUES,
|
|
7
7
|
} from './constants'
|
|
8
8
|
import type {BriloBlockType} from '~/types'
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {BannerGroupOptions} from '~/blocks/groups/banner-group/types'
|
|
1
|
+
import type {BannerGroupOptions} from '~/blocks/groups/banner-group/types'
|
|
2
2
|
|
|
3
3
|
export type {BannerGroupAttributes, BannerGroupOptions} from './factory'
|
|
4
4
|
export {createBannerGroupBlock} from './factory'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {BriloBlockType, Media, OptionArray, StringArray} from '~/types'
|
|
2
|
-
import {DEFAULT_HEADING_STYLES, DEFAULT_VARIANTS} from './constants'
|
|
3
|
-
import {HEADING_LEVELS} from '~/constants'
|
|
2
|
+
import type {DEFAULT_HEADING_STYLES, DEFAULT_VARIANTS} from './constants'
|
|
3
|
+
import type {HEADING_LEVELS} from '~/constants'
|
|
4
4
|
|
|
5
5
|
export type Variants = (typeof DEFAULT_VARIANTS)[number]['value']
|
|
6
6
|
export type HeadingLevels = (typeof HEADING_LEVELS)[number]
|
|
@@ -33,6 +33,22 @@ export function createBasicHeaderGroupEdit(options: BasicHeaderGroupOptions) {
|
|
|
33
33
|
return (
|
|
34
34
|
<>
|
|
35
35
|
<InspectorControls>
|
|
36
|
+
<PanelBody title={__('Overline', 'brilo-blocks')}>
|
|
37
|
+
<BaseControl label={__('Barva pozadí', 'brilo-blocks')}>
|
|
38
|
+
<ColorPalette
|
|
39
|
+
colors={paletteColors}
|
|
40
|
+
value={overline.background || undefined}
|
|
41
|
+
onChange={(value) => setAttributes({overline: {...overline, background: value ?? ''}})}
|
|
42
|
+
/>
|
|
43
|
+
</BaseControl>
|
|
44
|
+
<BaseControl label={__('Barva textu', 'brilo-blocks')}>
|
|
45
|
+
<ColorPalette
|
|
46
|
+
colors={paletteColors}
|
|
47
|
+
value={overline.color || undefined}
|
|
48
|
+
onChange={(value) => setAttributes({overline: {...overline, color: value ?? ''}})}
|
|
49
|
+
/>
|
|
50
|
+
</BaseControl>
|
|
51
|
+
</PanelBody>
|
|
36
52
|
<PanelBody title={__('Nadpis', 'brilo-blocks')}>
|
|
37
53
|
<ToggleGroupControl
|
|
38
54
|
label={__('Úroveň nadpisu', 'brilo-blocks')}
|
|
@@ -81,8 +97,16 @@ export function createBasicHeaderGroupEdit(options: BasicHeaderGroupOptions) {
|
|
|
81
97
|
<RichText
|
|
82
98
|
tagName="span"
|
|
83
99
|
className="g-header__overline u-text-editable"
|
|
100
|
+
style={
|
|
101
|
+
overline.color || overline.background
|
|
102
|
+
? {
|
|
103
|
+
...(overline.color ? {color: overline.color} : {}),
|
|
104
|
+
...(overline.background ? {backgroundColor: overline.background} : {}),
|
|
105
|
+
}
|
|
106
|
+
: undefined
|
|
107
|
+
}
|
|
84
108
|
value={overline.title}
|
|
85
|
-
onChange={(value) => setAttributes({overline: {title: value}})}
|
|
109
|
+
onChange={(value) => setAttributes({overline: {...overline, title: value}})}
|
|
86
110
|
placeholder={__('Overline...', 'brilo-blocks')}
|
|
87
111
|
allowedFormats={[]}
|
|
88
112
|
/>
|
|
@@ -32,7 +32,7 @@ export function createBasicHeaderGroupBlock<
|
|
|
32
32
|
type: 'object',
|
|
33
33
|
default: {title: '', level: levels[1] ?? levels[0], style: styles[1] ?? styles[0], color: ''},
|
|
34
34
|
},
|
|
35
|
-
overline: {type: 'object', default: {title: ''}},
|
|
35
|
+
overline: {type: 'object', default: {title: '', color: '', background: ''}},
|
|
36
36
|
content: {type: 'string', default: ''},
|
|
37
37
|
textAlign: {
|
|
38
38
|
type: 'string',
|
|
@@ -11,7 +11,7 @@ export interface BasicHeaderGroupAttributes<
|
|
|
11
11
|
TAlignment extends string = HeaderAlignment,
|
|
12
12
|
> extends Record<string, unknown> {
|
|
13
13
|
heading: {title: string; level: TLevel; style: TStyle; color?: string}
|
|
14
|
-
overline: {title: string}
|
|
14
|
+
overline: {title: string; color?: string; background?: string}
|
|
15
15
|
content: string
|
|
16
16
|
textAlign: TAlignment
|
|
17
17
|
}
|
|
@@ -41,3 +41,14 @@ export const DEFAULT_GRID_STYLES = [
|
|
|
41
41
|
{value: '1-1', label: __('Půl na půl', 'brilo-blocks')},
|
|
42
42
|
{value: '2-1', label: __('2/3 + 1/3', 'brilo-blocks')},
|
|
43
43
|
] as const
|
|
44
|
+
|
|
45
|
+
export const DEFAULT_IMAGE_CLIP_PATHS = [
|
|
46
|
+
{value: 'none', label: __('Žádný', 'brilo-blocks')},
|
|
47
|
+
{value: 'circle', label: __('Kruh', 'brilo-blocks')},
|
|
48
|
+
{value: 'triangle', label: __('Trojúhelník', 'brilo-blocks')},
|
|
49
|
+
{value: 'rhombus', label: __('Kosočtverec', 'brilo-blocks')},
|
|
50
|
+
{value: 'octagon', label: __('Osmiúhelník', 'brilo-blocks')},
|
|
51
|
+
{value: 'bevel', label: __('Zkosený', 'brilo-blocks')},
|
|
52
|
+
{value: 'rabbet', label: __('Drážkovaný', 'brilo-blocks')},
|
|
53
|
+
{value: 'parallelogram', label: __('Rovnoběžník', 'brilo-blocks')},
|
|
54
|
+
] as const
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BaseControl,
|
|
4
4
|
ColorPalette,
|
|
5
5
|
PanelBody,
|
|
6
|
+
SelectControl,
|
|
6
7
|
TextControl,
|
|
7
8
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
8
9
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
DEFAULT_CONTENT_SIZES,
|
|
21
22
|
DEFAULT_GRID_STYLES,
|
|
22
23
|
DEFAULT_HEADING_STYLES,
|
|
24
|
+
DEFAULT_IMAGE_CLIP_PATHS,
|
|
23
25
|
DEFAULT_MEDIA_POSITIONS,
|
|
24
26
|
DEFAULT_RATIOS,
|
|
25
27
|
HEADING_LEVELS,
|
|
@@ -31,6 +33,7 @@ import type {
|
|
|
31
33
|
GridStyles,
|
|
32
34
|
HeadingLevels,
|
|
33
35
|
HeadingStyles,
|
|
36
|
+
ImageClipPaths,
|
|
34
37
|
MediaPositions,
|
|
35
38
|
Ratios,
|
|
36
39
|
TextAndMediaGroupAttributes,
|
|
@@ -44,6 +47,7 @@ export function createTextAndMediaGroupEdit(options: TextAndMediaGroupOptions) {
|
|
|
44
47
|
const HEADING_STYLES = options.headingStyles ?? DEFAULT_HEADING_STYLES
|
|
45
48
|
const CONTENT_SIZES = options.contentSizes ?? DEFAULT_CONTENT_SIZES
|
|
46
49
|
const CHIP_VARIANTS = options.chipVariants ?? DEFAULT_CHIP_VARIANTS
|
|
50
|
+
const IMAGE_CLIP_PATHS = options.imageClipPaths ?? DEFAULT_IMAGE_CLIP_PATHS
|
|
47
51
|
|
|
48
52
|
return function Edit({
|
|
49
53
|
attributes,
|
|
@@ -54,6 +58,7 @@ export function createTextAndMediaGroupEdit(options: TextAndMediaGroupOptions) {
|
|
|
54
58
|
}) {
|
|
55
59
|
const {header, mediaPosition, img, ratio, gridStyle, content} = attributes
|
|
56
60
|
const isMediaLeft = mediaPosition === 'left'
|
|
61
|
+
const clipPath = img.clipPath ?? 'none'
|
|
57
62
|
const {paletteColors} = useTenantColorPalette()
|
|
58
63
|
|
|
59
64
|
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
@@ -69,7 +74,7 @@ export function createTextAndMediaGroupEdit(options: TextAndMediaGroupOptions) {
|
|
|
69
74
|
})
|
|
70
75
|
|
|
71
76
|
const mediaColumn = (
|
|
72
|
-
<div className=
|
|
77
|
+
<div className={clsx('g-text-and-media__media', clipPath !== 'none' && `--clip-path --clip-path-${clipPath}`)}>
|
|
73
78
|
<ImagePickerBody
|
|
74
79
|
value={{id: img.id, alt: img.alt}}
|
|
75
80
|
onChange={(val) => setAttributes({img: {...img, ...val}})}
|
|
@@ -86,8 +91,16 @@ export function createTextAndMediaGroupEdit(options: TextAndMediaGroupOptions) {
|
|
|
86
91
|
<RichText
|
|
87
92
|
tagName="span"
|
|
88
93
|
className="g-text-and-media__overline u-text-editable"
|
|
94
|
+
style={
|
|
95
|
+
header.overline.color || header.overline.background
|
|
96
|
+
? {
|
|
97
|
+
...(header.overline.color ? {color: header.overline.color} : {}),
|
|
98
|
+
...(header.overline.background ? {backgroundColor: header.overline.background} : {}),
|
|
99
|
+
}
|
|
100
|
+
: undefined
|
|
101
|
+
}
|
|
89
102
|
value={header.overline.title}
|
|
90
|
-
onChange={(value: string) => setAttributes({header: {...header, overline: {title: value}}})}
|
|
103
|
+
onChange={(value: string) => setAttributes({header: {...header, overline: {...header.overline, title: value}}})}
|
|
91
104
|
placeholder={__('Overline...', 'brilo-blocks')}
|
|
92
105
|
allowedFormats={[]}
|
|
93
106
|
/>
|
|
@@ -135,6 +148,12 @@ export function createTextAndMediaGroupEdit(options: TextAndMediaGroupOptions) {
|
|
|
135
148
|
<ToggleGroupControlOption key={r.value} value={r.value} label={r.label} />
|
|
136
149
|
))}
|
|
137
150
|
</ToggleGroupControl>
|
|
151
|
+
<SelectControl
|
|
152
|
+
label={__('Tvar výřezu', 'brilo-blocks')}
|
|
153
|
+
value={clipPath}
|
|
154
|
+
options={[...IMAGE_CLIP_PATHS]}
|
|
155
|
+
onChange={(value) => setAttributes({img: {...img, clipPath: value as ImageClipPaths}})}
|
|
156
|
+
/>
|
|
138
157
|
<TextControl
|
|
139
158
|
label={__('URL videa', 'brilo-blocks')}
|
|
140
159
|
value={img.video.src}
|
|
@@ -200,6 +219,22 @@ export function createTextAndMediaGroupEdit(options: TextAndMediaGroupOptions) {
|
|
|
200
219
|
))}
|
|
201
220
|
</ToggleGroupControl>
|
|
202
221
|
</PanelBody>
|
|
222
|
+
<PanelBody title={__('Overline', 'brilo-blocks')} initialOpen={false}>
|
|
223
|
+
<BaseControl label={__('Barva pozadí', 'brilo-blocks')}>
|
|
224
|
+
<ColorPalette
|
|
225
|
+
colors={paletteColors}
|
|
226
|
+
value={header.overline.background || undefined}
|
|
227
|
+
onChange={(value) => setAttributes({header: {...header, overline: {...header.overline, background: value ?? ''}}})}
|
|
228
|
+
/>
|
|
229
|
+
</BaseControl>
|
|
230
|
+
<BaseControl label={__('Barva textu', 'brilo-blocks')}>
|
|
231
|
+
<ColorPalette
|
|
232
|
+
colors={paletteColors}
|
|
233
|
+
value={header.overline.color || undefined}
|
|
234
|
+
onChange={(value) => setAttributes({header: {...header, overline: {...header.overline, color: value ?? ''}}})}
|
|
235
|
+
/>
|
|
236
|
+
</BaseControl>
|
|
237
|
+
</PanelBody>
|
|
203
238
|
<PanelBody title={__('Nadpis', 'brilo-blocks')} initialOpen={false}>
|
|
204
239
|
<ToggleGroupControl
|
|
205
240
|
label={__('Úroveň nadpisu', 'brilo-blocks')}
|
|
@@ -51,6 +51,48 @@
|
|
|
51
51
|
.c-image-picker-body__preview img {
|
|
52
52
|
aspect-ratio: var(--ratio);
|
|
53
53
|
object-fit: cover;
|
|
54
|
+
clip-path: var(--image-clip-path, none);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.--clip-path-circle {
|
|
58
|
+
--image-clip-path: circle(50% at 50% 50%);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.--clip-path-triangle {
|
|
62
|
+
--image-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.--clip-path-rhombus {
|
|
66
|
+
--image-clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.--clip-path-octagon {
|
|
70
|
+
--image-clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.--clip-path-bevel {
|
|
74
|
+
--image-clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.--clip-path-rabbet {
|
|
78
|
+
--image-clip-path: polygon(
|
|
79
|
+
0% 15%,
|
|
80
|
+
15% 15%,
|
|
81
|
+
15% 0%,
|
|
82
|
+
85% 0%,
|
|
83
|
+
85% 15%,
|
|
84
|
+
100% 15%,
|
|
85
|
+
100% 85%,
|
|
86
|
+
85% 85%,
|
|
87
|
+
85% 100%,
|
|
88
|
+
15% 100%,
|
|
89
|
+
15% 85%,
|
|
90
|
+
0% 85%
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.--clip-path-parallelogram {
|
|
95
|
+
--image-clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
|
|
54
96
|
}
|
|
55
97
|
|
|
56
98
|
.c-image-picker-body__placeholder {
|
|
@@ -65,12 +107,16 @@
|
|
|
65
107
|
}
|
|
66
108
|
|
|
67
109
|
.g-text-and-media__overline {
|
|
68
|
-
display:
|
|
69
|
-
font-size:
|
|
110
|
+
display: inline-flex;
|
|
111
|
+
font-size: 11px;
|
|
70
112
|
font-weight: 600;
|
|
71
113
|
text-transform: uppercase;
|
|
72
|
-
letter-spacing:
|
|
73
|
-
color: #
|
|
114
|
+
letter-spacing: 1.5px;
|
|
115
|
+
color: #555;
|
|
116
|
+
background-color: #f0f0f0;
|
|
117
|
+
border-radius: 100px;
|
|
118
|
+
padding: 3px 10px;
|
|
119
|
+
margin-bottom: 8px;
|
|
74
120
|
}
|
|
75
121
|
|
|
76
122
|
.g-text-and-media__heading {
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
DEFAULT_CONTENT_SIZES,
|
|
8
8
|
DEFAULT_GRID_STYLES,
|
|
9
9
|
DEFAULT_HEADING_STYLES,
|
|
10
|
+
DEFAULT_IMAGE_CLIP_PATHS,
|
|
10
11
|
DEFAULT_MEDIA_POSITIONS,
|
|
11
12
|
DEFAULT_RATIOS,
|
|
12
13
|
HEADING_LEVELS,
|
|
@@ -24,8 +25,9 @@ export function createTextAndMediaGroupBlock<
|
|
|
24
25
|
THeadingStyles extends OptionArray = typeof DEFAULT_HEADING_STYLES,
|
|
25
26
|
TContentSizes extends OptionArray = typeof DEFAULT_CONTENT_SIZES,
|
|
26
27
|
TChipVariants extends OptionArray = typeof DEFAULT_CHIP_VARIANTS,
|
|
28
|
+
TImageClipPaths extends OptionArray = typeof DEFAULT_IMAGE_CLIP_PATHS,
|
|
27
29
|
>(
|
|
28
|
-
options: TextAndMediaGroupOptions<TRatios, TMediaPositions, TGridStyles, THeadingStyles, TContentSizes, TChipVariants>,
|
|
30
|
+
options: TextAndMediaGroupOptions<TRatios, TMediaPositions, TGridStyles, THeadingStyles, TContentSizes, TChipVariants, TImageClipPaths>,
|
|
29
31
|
): BlockConfiguration<
|
|
30
32
|
TextAndMediaGroupAttributes<
|
|
31
33
|
TRatios[number]['value'],
|
|
@@ -33,7 +35,8 @@ export function createTextAndMediaGroupBlock<
|
|
|
33
35
|
TGridStyles[number]['value'],
|
|
34
36
|
THeadingStyles[number]['value'],
|
|
35
37
|
TContentSizes[number]['value'],
|
|
36
|
-
TChipVariants[number]['value']
|
|
38
|
+
TChipVariants[number]['value'],
|
|
39
|
+
TImageClipPaths[number]['value']
|
|
37
40
|
>
|
|
38
41
|
> {
|
|
39
42
|
const ratios = options.ratios ?? DEFAULT_RATIOS
|
|
@@ -42,6 +45,7 @@ export function createTextAndMediaGroupBlock<
|
|
|
42
45
|
const headingStyles = options.headingStyles ?? DEFAULT_HEADING_STYLES
|
|
43
46
|
const contentSizes = options.contentSizes ?? DEFAULT_CONTENT_SIZES
|
|
44
47
|
const chipVariants = options.chipVariants ?? DEFAULT_CHIP_VARIANTS
|
|
48
|
+
const imageClipPaths = options.imageClipPaths ?? DEFAULT_IMAGE_CLIP_PATHS
|
|
45
49
|
|
|
46
50
|
return {
|
|
47
51
|
name: options.name,
|
|
@@ -56,7 +60,7 @@ export function createTextAndMediaGroupBlock<
|
|
|
56
60
|
type: 'object',
|
|
57
61
|
default: {
|
|
58
62
|
heading: {title: '', level: HEADING_LEVELS[1], style: headingStyles[1]?.value ?? headingStyles[0].value, color: ''},
|
|
59
|
-
overline: {title: ''},
|
|
63
|
+
overline: {title: '', color: '', background: ''},
|
|
60
64
|
},
|
|
61
65
|
},
|
|
62
66
|
mediaPosition: {
|
|
@@ -70,6 +74,7 @@ export function createTextAndMediaGroupBlock<
|
|
|
70
74
|
id: 0,
|
|
71
75
|
alt: '',
|
|
72
76
|
video: {src: ''},
|
|
77
|
+
clipPath: imageClipPaths[0].value,
|
|
73
78
|
chip: {title: '', position: 'bottom-right', variant: chipVariants[0].value},
|
|
74
79
|
},
|
|
75
80
|
},
|
|
@@ -94,7 +99,8 @@ export function createTextAndMediaGroupBlock<
|
|
|
94
99
|
TGridStyles[number]['value'],
|
|
95
100
|
THeadingStyles[number]['value'],
|
|
96
101
|
TContentSizes[number]['value'],
|
|
97
|
-
TChipVariants[number]['value']
|
|
102
|
+
TChipVariants[number]['value'],
|
|
103
|
+
TImageClipPaths[number]['value']
|
|
98
104
|
>
|
|
99
105
|
>
|
|
100
106
|
}
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
DEFAULT_CONTENT_SIZES,
|
|
6
6
|
DEFAULT_GRID_STYLES,
|
|
7
7
|
DEFAULT_HEADING_STYLES,
|
|
8
|
+
DEFAULT_IMAGE_CLIP_PATHS,
|
|
8
9
|
DEFAULT_MEDIA_POSITIONS,
|
|
9
10
|
DEFAULT_RATIOS,
|
|
10
11
|
HEADING_LEVELS,
|
|
@@ -18,6 +19,7 @@ export type HeadingLevels = (typeof HEADING_LEVELS)[number]
|
|
|
18
19
|
export type ContentSizes = (typeof DEFAULT_CONTENT_SIZES)[number]['value']
|
|
19
20
|
export type ChipPositions = (typeof CHIP_POSITIONS)[number]['value']
|
|
20
21
|
export type ChipVariants = (typeof DEFAULT_CHIP_VARIANTS)[number]['value']
|
|
22
|
+
export type ImageClipPaths = (typeof DEFAULT_IMAGE_CLIP_PATHS)[number]['value']
|
|
21
23
|
|
|
22
24
|
export interface TextAndMediaGroupAttributes<
|
|
23
25
|
TRatio extends string = Ratios,
|
|
@@ -26,16 +28,18 @@ export interface TextAndMediaGroupAttributes<
|
|
|
26
28
|
THeadingStyle extends string = HeadingStyles,
|
|
27
29
|
TContentSize extends string = ContentSizes,
|
|
28
30
|
TChipVariant extends string = ChipVariants,
|
|
31
|
+
TImageClipPath extends string = ImageClipPaths,
|
|
29
32
|
> extends Record<string, unknown> {
|
|
30
33
|
header: {
|
|
31
34
|
heading: {title: string; level: HeadingLevels; style: THeadingStyle; color?: string}
|
|
32
|
-
overline: {title: string}
|
|
35
|
+
overline: {title: string; color?: string; background?: string}
|
|
33
36
|
}
|
|
34
37
|
mediaPosition: TMediaPosition
|
|
35
38
|
img: {
|
|
36
39
|
id: number
|
|
37
40
|
alt: string
|
|
38
41
|
video: {src: string}
|
|
42
|
+
clipPath: TImageClipPath
|
|
39
43
|
chip: {title: string; position: ChipPositions; variant: TChipVariant}
|
|
40
44
|
}
|
|
41
45
|
ratio: TRatio
|
|
@@ -50,6 +54,7 @@ export interface TextAndMediaGroupOptions<
|
|
|
50
54
|
THeadingStyles extends OptionArray = typeof DEFAULT_HEADING_STYLES,
|
|
51
55
|
TContentSizes extends OptionArray = typeof DEFAULT_CONTENT_SIZES,
|
|
52
56
|
TChipVariants extends OptionArray = typeof DEFAULT_CHIP_VARIANTS,
|
|
57
|
+
TImageClipPaths extends OptionArray = typeof DEFAULT_IMAGE_CLIP_PATHS,
|
|
53
58
|
> extends BriloBlockType {
|
|
54
59
|
ratios?: TRatios
|
|
55
60
|
mediaPositions?: TMediaPositions
|
|
@@ -57,4 +62,5 @@ export interface TextAndMediaGroupOptions<
|
|
|
57
62
|
headingStyles?: THeadingStyles
|
|
58
63
|
contentSizes?: TContentSizes
|
|
59
64
|
chipVariants?: TChipVariants
|
|
65
|
+
imageClipPaths?: TImageClipPaths
|
|
60
66
|
}
|
|
@@ -21,3 +21,11 @@ export const EFFECTS = [
|
|
|
21
21
|
label: __('Fade', 'brilo-blocks'),
|
|
22
22
|
},
|
|
23
23
|
] as const
|
|
24
|
+
|
|
25
|
+
export const DEFAULT_ASPECT_RATIOS = [
|
|
26
|
+
{value: '5/3', label: __('5:3', 'brilo-blocks')},
|
|
27
|
+
{value: '8/3', label: __('8:3', 'brilo-blocks')},
|
|
28
|
+
{value: '16/9', label: __('16:9', 'brilo-blocks')},
|
|
29
|
+
{value: '21/9', label: __('21:9', 'brilo-blocks')},
|
|
30
|
+
{value: 'full-height', label: __('Plná výška', 'brilo-blocks')},
|
|
31
|
+
] as const
|
|
@@ -11,19 +11,25 @@ import {
|
|
|
11
11
|
import {__} from '@wordpress/i18n'
|
|
12
12
|
import clsx from 'clsx'
|
|
13
13
|
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
14
|
-
import {EFFECTS, VARIANTS} from './constants'
|
|
15
|
-
import type {Effect, HeroGroupAttributes, HeroGroupOptions, Variant} from './types'
|
|
14
|
+
import {DEFAULT_ASPECT_RATIOS, EFFECTS, VARIANTS} from './constants'
|
|
15
|
+
import type {AspectRatio, Effect, HeroGroupAttributes, HeroGroupOptions, Variant} from './types'
|
|
16
16
|
|
|
17
17
|
export function createHeroGroupEdit(options: HeroGroupOptions) {
|
|
18
18
|
const VARIANTS_OPTIONS = options.variants ?? VARIANTS
|
|
19
19
|
const EFFECTS_OPTIONS = options.effects ?? EFFECTS
|
|
20
|
+
const ASPECT_RATIOS_OPTIONS = options.aspectRatios ?? DEFAULT_ASPECT_RATIOS
|
|
20
21
|
|
|
21
22
|
return function Edit(props: BlockEditProps<HeroGroupAttributes>) {
|
|
22
23
|
const {attributes, setAttributes} = props
|
|
23
|
-
const {variant, effect, autoplay, autoplaySpeed, pauseOnHover} = attributes
|
|
24
|
+
const {variant, effect, autoplay, autoplaySpeed, pauseOnHover, aspectRatio} = attributes
|
|
24
25
|
|
|
25
26
|
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
26
|
-
blockClassName: clsx(
|
|
27
|
+
blockClassName: clsx(
|
|
28
|
+
options.blockClassName ?? 'g-hero wp-block-section',
|
|
29
|
+
`--variant-${variant}`,
|
|
30
|
+
`--effect-${effect}`,
|
|
31
|
+
`--aspect-ratio-${aspectRatio}`,
|
|
32
|
+
),
|
|
27
33
|
containerClassName: [options.containerClassName ?? 'g-hero__container'],
|
|
28
34
|
allowedBlocks: options.allowedBlocks,
|
|
29
35
|
orientation: 'horizontal',
|
|
@@ -51,6 +57,12 @@ export function createHeroGroupEdit(options: HeroGroupOptions) {
|
|
|
51
57
|
options={EFFECTS_OPTIONS as any}
|
|
52
58
|
onChange={(v) => setAttributes({effect: v as Effect})}
|
|
53
59
|
/>
|
|
60
|
+
<SelectControl
|
|
61
|
+
label={__('Poměr stran', 'brilo-blocks')}
|
|
62
|
+
value={aspectRatio}
|
|
63
|
+
options={ASPECT_RATIOS_OPTIONS as any}
|
|
64
|
+
onChange={(v) => setAttributes({aspectRatio: v as AspectRatio})}
|
|
65
|
+
/>
|
|
54
66
|
</PanelBody>
|
|
55
67
|
<PanelBody title={__('Nastavení slideru', 'brilo-blocks')}>
|
|
56
68
|
<ToggleControl
|
|
@@ -2,7 +2,7 @@ import {InnerBlocks} from '@wordpress/block-editor'
|
|
|
2
2
|
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
3
3
|
import {__} from '@wordpress/i18n'
|
|
4
4
|
import type {OptionArray} from '~/types'
|
|
5
|
-
import {EFFECTS, VARIANTS} from './constants'
|
|
5
|
+
import {DEFAULT_ASPECT_RATIOS, EFFECTS, VARIANTS} from './constants'
|
|
6
6
|
import {createHeroGroupEdit} from './edit'
|
|
7
7
|
import type {HeroGroupAttributes, HeroGroupOptions} from './types'
|
|
8
8
|
import {icon} from './icon'
|
|
@@ -12,12 +12,14 @@ export type {HeroGroupAttributes, HeroGroupOptions}
|
|
|
12
12
|
export function createHeroGroupBlock<
|
|
13
13
|
TVariants extends OptionArray = typeof VARIANTS,
|
|
14
14
|
TEffects extends OptionArray = typeof EFFECTS,
|
|
15
|
+
TAspectRatio extends OptionArray = typeof DEFAULT_ASPECT_RATIOS,
|
|
15
16
|
TExtra extends Record<string, unknown> = Record<string, never>,
|
|
16
17
|
>(
|
|
17
|
-
options: HeroGroupOptions<TVariants, TEffects, TExtra>,
|
|
18
|
-
): BlockConfiguration<HeroGroupAttributes<TVariants[number]['value'], TEffects[number]['value']> & TExtra> {
|
|
18
|
+
options: HeroGroupOptions<TVariants, TEffects, TAspectRatio, TExtra>,
|
|
19
|
+
): BlockConfiguration<HeroGroupAttributes<TVariants[number]['value'], TEffects[number]['value'], TAspectRatio[number]['value']> & TExtra> {
|
|
19
20
|
const variants = options.variants ?? VARIANTS
|
|
20
21
|
const effects = options.effects ?? EFFECTS
|
|
22
|
+
const aspectRatios = options.aspectRatios ?? DEFAULT_ASPECT_RATIOS
|
|
21
23
|
|
|
22
24
|
return {
|
|
23
25
|
name: options.name,
|
|
@@ -42,9 +44,16 @@ export function createHeroGroupBlock<
|
|
|
42
44
|
default: effects[0].value,
|
|
43
45
|
enum: effects.map((e) => e.value),
|
|
44
46
|
},
|
|
47
|
+
aspectRatio: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: aspectRatios[1].value,
|
|
50
|
+
enum: aspectRatios.map((a) => a.value),
|
|
51
|
+
},
|
|
45
52
|
...options.extraAttributes,
|
|
46
53
|
},
|
|
47
54
|
edit: createHeroGroupEdit(options as unknown as HeroGroupOptions),
|
|
48
55
|
save: () => <InnerBlocks.Content />,
|
|
49
|
-
} as unknown as BlockConfiguration<
|
|
56
|
+
} as unknown as BlockConfiguration<
|
|
57
|
+
HeroGroupAttributes<TVariants[number]['value'], TEffects[number]['value'], TAspectRatio[number]['value']> & TExtra
|
|
58
|
+
>
|
|
50
59
|
}
|
|
@@ -2,33 +2,45 @@ import type {BlockEditProps} from '@wordpress/blocks'
|
|
|
2
2
|
import type {ReactNode} from 'react'
|
|
3
3
|
import type {BriloBlockType, OptionArray} from '~/types'
|
|
4
4
|
import type {HeroSliderItem} from '../hero-item/types'
|
|
5
|
-
import
|
|
5
|
+
import {DEFAULT_ASPECT_RATIOS, EFFECTS, VARIANTS} from './constants'
|
|
6
6
|
|
|
7
7
|
export type Variant = (typeof VARIANTS)[number]['value']
|
|
8
8
|
export type Effect = (typeof EFFECTS)[number]['value']
|
|
9
|
+
export type AspectRatio = (typeof DEFAULT_ASPECT_RATIOS)[number]['value']
|
|
9
10
|
|
|
10
|
-
export interface HeroGroupAttributes<
|
|
11
|
+
export interface HeroGroupAttributes<
|
|
12
|
+
TVariant extends string = Variant,
|
|
13
|
+
TEffect extends string = Effect,
|
|
14
|
+
TAspectRatio extends string = AspectRatio,
|
|
15
|
+
> extends Record<string, unknown> {
|
|
11
16
|
items: HeroSliderItem[]
|
|
12
17
|
variant: TVariant
|
|
13
18
|
autoplay: boolean
|
|
14
19
|
autoplaySpeed: number
|
|
15
20
|
pauseOnHover: boolean
|
|
16
21
|
effect: TEffect
|
|
22
|
+
aspectRatio: TAspectRatio
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
export interface HeroGroupOptions<
|
|
20
26
|
TVariants extends OptionArray = typeof VARIANTS,
|
|
21
27
|
TEffects extends OptionArray = typeof EFFECTS,
|
|
28
|
+
TAspectRatio extends OptionArray = typeof DEFAULT_ASPECT_RATIOS,
|
|
22
29
|
TExtra extends Record<string, unknown> = Record<string, never>,
|
|
23
30
|
> extends BriloBlockType {
|
|
24
31
|
allowedBlocks: string[]
|
|
25
32
|
variants?: TVariants
|
|
26
33
|
effects?: TEffects
|
|
34
|
+
aspectRatios?: TAspectRatio
|
|
27
35
|
extraAttributes?: {
|
|
28
36
|
[K in keyof TExtra]: {
|
|
29
37
|
type: string
|
|
30
38
|
default: TExtra[K]
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
|
-
extraControls?: (
|
|
41
|
+
extraControls?: (
|
|
42
|
+
props: BlockEditProps<
|
|
43
|
+
HeroGroupAttributes<TVariants[number]['value'], TEffects[number]['value'], TAspectRatio[number]['value']> & TExtra
|
|
44
|
+
>,
|
|
45
|
+
) => ReactNode
|
|
34
46
|
}
|
|
@@ -25,7 +25,7 @@ export function createHeroItemEdit(options: HeroItemOptions) {
|
|
|
25
25
|
attributes: HeroItemAttributes
|
|
26
26
|
setAttributes: (a: Partial<HeroItemAttributes>) => void
|
|
27
27
|
}) {
|
|
28
|
-
const {title, titleColor, img, headingLevel, contentPosition, url, focalPoint} = attributes
|
|
28
|
+
const {title, titleColor, img, headingLevel, contentPosition, url, focalPoint, overline} = attributes
|
|
29
29
|
const {paletteColors} = useTenantColorPalette()
|
|
30
30
|
|
|
31
31
|
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
@@ -40,7 +40,7 @@ export function createHeroItemEdit(options: HeroItemOptions) {
|
|
|
40
40
|
return (
|
|
41
41
|
<>
|
|
42
42
|
<InspectorControls>
|
|
43
|
-
<PanelBody title={__('
|
|
43
|
+
<PanelBody title={__('Obrázek', 'brilo-blocks')}>
|
|
44
44
|
<ImagePickerControl value={{id: img.id, alt: img.alt}} onChange={(v) => setAttributes({img: {...img, ...v}})} />
|
|
45
45
|
|
|
46
46
|
<BaseControl label={__('Focal point (desktop)', 'brilo-blocks')}>
|
|
@@ -56,7 +56,26 @@ export function createHeroItemEdit(options: HeroItemOptions) {
|
|
|
56
56
|
onChange={(v) => setAttributes({focalPoint: {...focalPoint, sm: {point: (v ?? 'center center') as ContentPosition}}})}
|
|
57
57
|
/>
|
|
58
58
|
</BaseControl>
|
|
59
|
+
</PanelBody>
|
|
60
|
+
|
|
61
|
+
<PanelBody title={__('Overline', 'brilo-blocks')}>
|
|
62
|
+
<BaseControl label={__('Barva overline pozadí', 'brilo-blocks')}>
|
|
63
|
+
<ColorPalette
|
|
64
|
+
colors={paletteColors}
|
|
65
|
+
value={overline.background || undefined}
|
|
66
|
+
onChange={(value) => setAttributes({overline: {...overline, background: value ?? ''}})}
|
|
67
|
+
/>
|
|
68
|
+
</BaseControl>
|
|
69
|
+
<BaseControl label={__('Barva overline textu', 'brilo-blocks')}>
|
|
70
|
+
<ColorPalette
|
|
71
|
+
colors={paletteColors}
|
|
72
|
+
value={overline.color || undefined}
|
|
73
|
+
onChange={(value) => setAttributes({overline: {...overline, color: value ?? ''}})}
|
|
74
|
+
/>
|
|
75
|
+
</BaseControl>
|
|
76
|
+
</PanelBody>
|
|
59
77
|
|
|
78
|
+
<PanelBody title={__('Nadpis', 'brilo-blocks')}>
|
|
60
79
|
<BaseControl label={__('Barva nadpisu', 'brilo-blocks')}>
|
|
61
80
|
<ColorPalette colors={paletteColors} value={titleColor || undefined} onChange={(v) => setAttributes({titleColor: v ?? ''})} />
|
|
62
81
|
</BaseControl>
|
|
@@ -71,11 +90,15 @@ export function createHeroItemEdit(options: HeroItemOptions) {
|
|
|
71
90
|
<ToggleGroupControlOption key={l} value={String(l)} label={`H${l}`} />
|
|
72
91
|
))}
|
|
73
92
|
</ToggleGroupControl>
|
|
93
|
+
</PanelBody>
|
|
74
94
|
|
|
95
|
+
<PanelBody title={__('Rozložení', 'brilo-blocks')}>
|
|
75
96
|
<BaseControl label={__('Pozice obsahu', 'brilo-blocks')}>
|
|
76
97
|
<AlignmentMatrixControl value={contentPosition} onChange={(v) => setAttributes({contentPosition: v as ContentPosition})} />
|
|
77
98
|
</BaseControl>
|
|
99
|
+
</PanelBody>
|
|
78
100
|
|
|
101
|
+
<PanelBody title={__('Odkaz', 'brilo-blocks')}>
|
|
79
102
|
<TextControl
|
|
80
103
|
label={__('URL odkazu', 'brilo-blocks')}
|
|
81
104
|
value={url.src}
|
|
@@ -98,6 +121,23 @@ export function createHeroItemEdit(options: HeroItemOptions) {
|
|
|
98
121
|
/>
|
|
99
122
|
</div>
|
|
100
123
|
<div className={`i-hero__overlay --${contentPosition.replace(' ', '-')}`}>
|
|
124
|
+
<RichText
|
|
125
|
+
tagName="span"
|
|
126
|
+
className="i-hero__overline u-text-editable"
|
|
127
|
+
style={
|
|
128
|
+
overline.color || overline.background
|
|
129
|
+
? {
|
|
130
|
+
...(overline.color ? {color: overline.color} : {}),
|
|
131
|
+
...(overline.background ? {backgroundColor: overline.background} : {}),
|
|
132
|
+
}
|
|
133
|
+
: undefined
|
|
134
|
+
}
|
|
135
|
+
value={overline.title}
|
|
136
|
+
onChange={(value) => setAttributes({overline: {...overline, title: value}})}
|
|
137
|
+
placeholder={__('Overline...', 'brilo-blocks')}
|
|
138
|
+
allowedFormats={[]}
|
|
139
|
+
/>
|
|
140
|
+
|
|
101
141
|
<RichText
|
|
102
142
|
tagName={`h${headingLevel}` as any}
|
|
103
143
|
className="i-hero__title u-text-editable"
|