@brilo/base-blocks 0.1.42 → 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-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-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
|
@@ -56,6 +56,13 @@ export interface BackgroundImage {
|
|
|
56
56
|
overlay?: BackgroundImageOverlay
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
export interface Border {
|
|
60
|
+
top: {width: number; color: string; style: string}
|
|
61
|
+
bottom: {width: number; color: string; style: string}
|
|
62
|
+
left: {width: number; color: string; style: string}
|
|
63
|
+
right: {width: number; color: string; style: string}
|
|
64
|
+
}
|
|
65
|
+
|
|
59
66
|
export interface BaseBlockAttributes extends Record<string, unknown> {
|
|
60
67
|
id: string
|
|
61
68
|
spacing: {
|
|
@@ -72,9 +79,10 @@ export interface BaseBlockAttributes extends Record<string, unknown> {
|
|
|
72
79
|
}
|
|
73
80
|
}
|
|
74
81
|
backgroundImage: BackgroundImage
|
|
82
|
+
border: Border
|
|
75
83
|
}
|
|
76
84
|
|
|
77
|
-
export type ExcludableBaseAttr = 'spacing' | 'background' | 'id' | 'decorations' | 'decoration' | 'backgroundImage'
|
|
85
|
+
export type ExcludableBaseAttr = 'spacing' | 'background' | 'id' | 'decorations' | 'decoration' | 'backgroundImage' | 'border'
|
|
78
86
|
|
|
79
87
|
export interface BaseSectionOptions<TExtra extends Record<string, unknown> = Record<string, never>> extends BriloBlockType {
|
|
80
88
|
supports?: BlockConfiguration['supports']
|
|
@@ -22,3 +22,26 @@ export const PADDING_MARKS = [
|
|
|
22
22
|
{value: 1.5, label: '1.5'},
|
|
23
23
|
{value: 2, label: '2'},
|
|
24
24
|
] as const
|
|
25
|
+
|
|
26
|
+
export const DEFAULT_IMAGE_CLIP_PATHS = [
|
|
27
|
+
{value: 'none', label: __('Žádný', 'brilo-blocks')},
|
|
28
|
+
{value: 'circle', label: __('Kruh', 'brilo-blocks')},
|
|
29
|
+
{value: 'triangle', label: __('Trojúhelník', 'brilo-blocks')},
|
|
30
|
+
{value: 'rhombus', label: __('Kosočtverec', 'brilo-blocks')},
|
|
31
|
+
{value: 'octagon', label: __('Osmiúhelník', 'brilo-blocks')},
|
|
32
|
+
{value: 'bevel', label: __('Zkosený', 'brilo-blocks')},
|
|
33
|
+
{value: 'rabbet', label: __('Drážkovaný', 'brilo-blocks')},
|
|
34
|
+
{value: 'parallelogram', label: __('Rovnoběžník', 'brilo-blocks')},
|
|
35
|
+
] as const
|
|
36
|
+
|
|
37
|
+
// Frontend reads the shapes from the theme's --shape-* tokens; the editor has no
|
|
38
|
+
// access to them, so the same geometry is inlined here for the preview CSS var.
|
|
39
|
+
export const IMAGE_CLIP_PATH_VALUES: Record<string, string> = {
|
|
40
|
+
circle: 'circle(50% at 50% 50%)',
|
|
41
|
+
triangle: 'polygon(50% 0%, 0% 100%, 100% 100%)',
|
|
42
|
+
rhombus: 'polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)',
|
|
43
|
+
octagon: 'polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)',
|
|
44
|
+
bevel: 'polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%)',
|
|
45
|
+
rabbet: 'polygon(0% 15%, 15% 15%, 15% 0%, 85% 0%, 85% 15%, 100% 15%, 100% 85%, 85% 85%, 85% 100%, 15% 100%, 15% 85%, 0% 85%)',
|
|
46
|
+
parallelogram: 'polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)',
|
|
47
|
+
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ColorPalette,
|
|
5
5
|
PanelBody,
|
|
6
6
|
RangeControl,
|
|
7
|
+
SelectControl,
|
|
7
8
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
8
9
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
9
10
|
} from '@wordpress/components'
|
|
@@ -11,8 +12,17 @@ import {__} from '@wordpress/i18n'
|
|
|
11
12
|
import clsx from 'clsx'
|
|
12
13
|
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
13
14
|
import {useTenantColorPalette} from '~/hooks/useTenantColorPalette'
|
|
14
|
-
import {
|
|
15
|
-
|
|
15
|
+
import {
|
|
16
|
+
COLUMNS,
|
|
17
|
+
DEFAULT_IMAGE_CLIP_PATHS,
|
|
18
|
+
DEFAULT_SHADOWS,
|
|
19
|
+
HEADING_LEVELS,
|
|
20
|
+
IMAGE_CLIP_PATH_VALUES,
|
|
21
|
+
PADDING_MARKS,
|
|
22
|
+
RATIOS,
|
|
23
|
+
TEXT_ALIGNS,
|
|
24
|
+
} from './constants'
|
|
25
|
+
import type {SignpostGroupAttributes, SignpostGroupOptions, SignpostImageClipPath, SignpostShadow, SignpostTextAlign} from './types'
|
|
16
26
|
|
|
17
27
|
export function createSignpostGroupEdit(options: SignpostGroupOptions) {
|
|
18
28
|
const exclude = options.exclude ?? []
|
|
@@ -24,13 +34,18 @@ export function createSignpostGroupEdit(options: SignpostGroupOptions) {
|
|
|
24
34
|
attributes: SignpostGroupAttributes
|
|
25
35
|
setAttributes: (a: Partial<SignpostGroupAttributes>) => void
|
|
26
36
|
}) {
|
|
27
|
-
const {columns, headingLevel, ratio, style, padding} = attributes
|
|
37
|
+
const {columns, headingLevel, ratio, img, style, padding} = attributes
|
|
38
|
+
const clipPath = img?.clipPath ?? 'none'
|
|
28
39
|
const {paletteColors} = useTenantColorPalette()
|
|
29
40
|
|
|
30
41
|
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
31
42
|
blockClassName: clsx(options.blockClassName ?? 'g-signpost wp-block-section'),
|
|
32
43
|
containerClassName: [options.containerClassName ?? 'u-grid-responsive', `--cols-${columns}`, `--ratio-${ratio.replace(':', '-')}`],
|
|
33
|
-
containerStyle: {
|
|
44
|
+
containerStyle: {
|
|
45
|
+
'--grid-max-col-count': columns,
|
|
46
|
+
// Inherited by every signpost item inside the container.
|
|
47
|
+
...(IMAGE_CLIP_PATH_VALUES[clipPath] && {'--signpost-image-clip-path': IMAGE_CLIP_PATH_VALUES[clipPath]}),
|
|
48
|
+
},
|
|
34
49
|
allowedBlocks: options.allowedBlocks,
|
|
35
50
|
orientation: 'horizontal',
|
|
36
51
|
template: options.template,
|
|
@@ -61,6 +76,12 @@ export function createSignpostGroupEdit(options: SignpostGroupOptions) {
|
|
|
61
76
|
<ToggleGroupControlOption key={r} value={r} label={r} />
|
|
62
77
|
))}
|
|
63
78
|
</ToggleGroupControl>
|
|
79
|
+
<SelectControl<string>
|
|
80
|
+
label={__('Tvar výřezu obrázku', 'brilo-blocks')}
|
|
81
|
+
value={clipPath}
|
|
82
|
+
options={[...DEFAULT_IMAGE_CLIP_PATHS]}
|
|
83
|
+
onChange={(v) => setAttributes({img: {...img, clipPath: v as SignpostImageClipPath}})}
|
|
84
|
+
/>
|
|
64
85
|
<ToggleGroupControl
|
|
65
86
|
isBlock
|
|
66
87
|
label={__('Úroveň nadpisu položek', 'brilo-blocks')}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {InnerBlocks} from '@wordpress/block-editor'
|
|
2
2
|
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
3
3
|
import {__} from '@wordpress/i18n'
|
|
4
|
-
import {COLUMNS, DEFAULT_SHADOWS, HEADING_LEVELS, RATIOS, TEXT_ALIGNS} from './constants'
|
|
4
|
+
import {COLUMNS, DEFAULT_IMAGE_CLIP_PATHS, DEFAULT_SHADOWS, HEADING_LEVELS, RATIOS, TEXT_ALIGNS} from './constants'
|
|
5
5
|
import {createSignpostGroupEdit} from './edit'
|
|
6
6
|
import {icon as defaultIcon} from './icon'
|
|
7
7
|
import type {SignpostGroupAttributes, SignpostGroupOptions} from './types'
|
|
@@ -27,6 +27,10 @@ export function createSignpostGroupBlock(options: SignpostGroupOptions): BlockCo
|
|
|
27
27
|
default: HEADING_LEVELS[0],
|
|
28
28
|
enum: [...HEADING_LEVELS],
|
|
29
29
|
},
|
|
30
|
+
img: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
default: {clipPath: DEFAULT_IMAGE_CLIP_PATHS[0].value},
|
|
33
|
+
},
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
if (!exclude.includes('colors')) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type {BriloBlockType} from '~/types'
|
|
2
|
-
import type {DEFAULT_SHADOWS, TEXT_ALIGNS} from './constants'
|
|
2
|
+
import type {DEFAULT_IMAGE_CLIP_PATHS, DEFAULT_SHADOWS, TEXT_ALIGNS} from './constants'
|
|
3
3
|
|
|
4
4
|
export type SignpostShadow = (typeof DEFAULT_SHADOWS)[number]['value']
|
|
5
5
|
|
|
6
|
+
export type SignpostImageClipPath = (typeof DEFAULT_IMAGE_CLIP_PATHS)[number]['value']
|
|
7
|
+
|
|
6
8
|
export type SignpostTextAlign = (typeof TEXT_ALIGNS)[number]['value']
|
|
7
9
|
|
|
8
10
|
export type ExcludableSignpostAttr = 'colors' | 'padding'
|
|
@@ -11,6 +13,7 @@ export interface SignpostGroupAttributes extends Record<string, unknown> {
|
|
|
11
13
|
columns: number
|
|
12
14
|
headingLevel: number
|
|
13
15
|
ratio: string
|
|
16
|
+
img: {clipPath: SignpostImageClipPath}
|
|
14
17
|
style: {
|
|
15
18
|
shadow: SignpostShadow
|
|
16
19
|
borderColor: string
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {__} from '@wordpress/i18n'
|
|
9
9
|
import clsx from 'clsx'
|
|
10
10
|
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
11
|
-
import {OptionArray} from '~/types'
|
|
11
|
+
import type {OptionArray} from '~/types'
|
|
12
12
|
import type {StepGroupAttributes, StepGroupOptions, StepVariant} from './types'
|
|
13
13
|
import {DEFAULT_VARIANTS} from './constants'
|
|
14
14
|
|
|
@@ -5,7 +5,7 @@ import {DEFAULT_VARIANTS} from './constants'
|
|
|
5
5
|
import {createStepGroupEdit} from './edit'
|
|
6
6
|
import type {StepGroupAttributes, StepGroupOptions} from './types'
|
|
7
7
|
import {icon} from '~/blocks/step/step-group/icon'
|
|
8
|
-
import {OptionArray} from '~/types'
|
|
8
|
+
import type {OptionArray} from '~/types'
|
|
9
9
|
|
|
10
10
|
export function createStepGroupBlock<TVariants extends OptionArray = typeof DEFAULT_VARIANTS>(
|
|
11
11
|
options: StepGroupOptions<TVariants>,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {BriloBlockType, OptionArray} from '~/types'
|
|
2
|
-
import {DEFAULT_VARIANTS} from './constants'
|
|
1
|
+
import type {BriloBlockType, OptionArray} from '~/types'
|
|
2
|
+
import type {DEFAULT_VARIANTS} from './constants'
|
|
3
3
|
|
|
4
4
|
export type StepVariant = (typeof DEFAULT_VARIANTS)[number]['value']
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type {TestimonialGroupAttributes} from './types'
|
|
2
2
|
export {createTestimonialGroupBlock} from './factory'
|
|
3
3
|
|
|
4
|
-
import {TestimonialGroupOptions} from './types'
|
|
4
|
+
import type {TestimonialGroupOptions} from './types'
|
|
5
5
|
|
|
6
6
|
export const testimonialGroupDefaults: TestimonialGroupOptions = {
|
|
7
7
|
name: 'brilo/testimonial-group',
|
|
@@ -3,11 +3,14 @@ import {
|
|
|
3
3
|
PanelBody,
|
|
4
4
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
5
5
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
6
|
+
BaseControl,
|
|
7
|
+
ColorPalette,
|
|
6
8
|
} from '@wordpress/components'
|
|
7
9
|
import {__} from '@wordpress/i18n'
|
|
8
10
|
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
9
11
|
import {DEFAULT_CONTENT_SIZES, DEFAULT_HEADING_STYLES, HEADING_LEVELS} from './constants'
|
|
10
12
|
import type {ContentSizes, HeadingLevels, HeadingStyles, TextAndFormTextColumnAttributes, TextAndFormTextColumnOptions} from './types'
|
|
13
|
+
import {useTenantColorPalette} from '~/hooks/useTenantColorPalette'
|
|
11
14
|
|
|
12
15
|
export function createTextAndFormTextColumnEdit(options: TextAndFormTextColumnOptions) {
|
|
13
16
|
const HEADING_STYLES = options.headingStyles ?? DEFAULT_HEADING_STYLES
|
|
@@ -30,9 +33,28 @@ export function createTextAndFormTextColumnEdit(options: TextAndFormTextColumnOp
|
|
|
30
33
|
layout: {type: 'default'},
|
|
31
34
|
})
|
|
32
35
|
|
|
36
|
+
const {paletteColors} = useTenantColorPalette()
|
|
37
|
+
|
|
33
38
|
return (
|
|
34
39
|
<>
|
|
35
40
|
<InspectorControls>
|
|
41
|
+
<PanelBody title={__('Overline', 'brilo-blocks')}>
|
|
42
|
+
<BaseControl label={__('Barva pozadí', 'brilo-blocks')}>
|
|
43
|
+
<ColorPalette
|
|
44
|
+
colors={paletteColors}
|
|
45
|
+
value={header.overline.background || undefined}
|
|
46
|
+
onChange={(value) => setAttributes({header: {...header, overline: {...header.overline, background: value ?? ''}}})}
|
|
47
|
+
/>
|
|
48
|
+
</BaseControl>
|
|
49
|
+
<BaseControl label={__('Barva textu', 'brilo-blocks')}>
|
|
50
|
+
<ColorPalette
|
|
51
|
+
colors={paletteColors}
|
|
52
|
+
value={header.overline.color || undefined}
|
|
53
|
+
onChange={(value) => setAttributes({header: {...header, overline: {...header.overline, color: value ?? ''}}})}
|
|
54
|
+
/>
|
|
55
|
+
</BaseControl>
|
|
56
|
+
</PanelBody>
|
|
57
|
+
|
|
36
58
|
<PanelBody title={__('Nadpis', 'brilo-blocks')} initialOpen={false}>
|
|
37
59
|
<ToggleGroupControl
|
|
38
60
|
label={__('Úroveň nadpisu', 'brilo-blocks')}
|
|
@@ -57,6 +79,7 @@ export function createTextAndFormTextColumnEdit(options: TextAndFormTextColumnOp
|
|
|
57
79
|
))}
|
|
58
80
|
</ToggleGroupControl>
|
|
59
81
|
</PanelBody>
|
|
82
|
+
|
|
60
83
|
<PanelBody title={__('Rozložení', 'brilo-blocks')}>
|
|
61
84
|
<ToggleGroupControl
|
|
62
85
|
label={__('Velikost textu', 'brilo-blocks')}
|
|
@@ -74,6 +97,14 @@ export function createTextAndFormTextColumnEdit(options: TextAndFormTextColumnOp
|
|
|
74
97
|
<RichText
|
|
75
98
|
tagName="span"
|
|
76
99
|
className="g-text-and-form__overline u-text-editable"
|
|
100
|
+
style={
|
|
101
|
+
header.overline.color || header.overline.background
|
|
102
|
+
? {
|
|
103
|
+
...(header.overline.color ? {color: header.overline.color} : {}),
|
|
104
|
+
...(header.overline.background ? {backgroundColor: header.overline.background} : {}),
|
|
105
|
+
}
|
|
106
|
+
: undefined
|
|
107
|
+
}
|
|
77
108
|
value={header.overline.title}
|
|
78
109
|
onChange={(value: string) => setAttributes({header: {...header, overline: {title: value}}})}
|
|
79
110
|
placeholder={__('Overline...', 'brilo-blocks')}
|
|
@@ -8,12 +8,16 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.g-text-and-form__overline {
|
|
11
|
-
display:
|
|
12
|
-
font-size:
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
font-size: 11px;
|
|
13
13
|
font-weight: 600;
|
|
14
14
|
text-transform: uppercase;
|
|
15
|
-
letter-spacing:
|
|
16
|
-
color: #
|
|
15
|
+
letter-spacing: 1.5px;
|
|
16
|
+
color: #555;
|
|
17
|
+
background-color: #f0f0f0;
|
|
18
|
+
border-radius: 100px;
|
|
19
|
+
padding: 3px 10px;
|
|
20
|
+
margin-bottom: 8px;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
.g-text-and-form__heading {
|
|
@@ -30,7 +30,7 @@ export function createTextAndFormTextColumnBlock<
|
|
|
30
30
|
type: 'object',
|
|
31
31
|
default: {
|
|
32
32
|
heading: {title: '', level: HEADING_LEVELS[1], style: headingStyles[1]?.value ?? headingStyles[0].value},
|
|
33
|
-
overline: {title: ''},
|
|
33
|
+
overline: {type: 'object', default: {title: '', color: '', background: ''}},
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
content: {type: 'object', default: {size: contentSizes[1]?.value ?? contentSizes[0].value}},
|
|
@@ -9,7 +9,7 @@ export interface TextAndFormTextColumnAttributes<THeadingStyle extends string =
|
|
|
9
9
|
extends Record<string, unknown> {
|
|
10
10
|
header: {
|
|
11
11
|
heading: {title: string; level: HeadingLevels; style: THeadingStyle}
|
|
12
|
-
overline: {title: string}
|
|
12
|
+
overline: {title: string; color?: string; background?: string}
|
|
13
13
|
}
|
|
14
14
|
content: {size: TContentSize}
|
|
15
15
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {__} from '@wordpress/i18n'
|
|
2
|
+
|
|
3
|
+
export const VIDEO_TYPES = [
|
|
4
|
+
{value: 'youtube', label: __('YouTube', 'brilo-blocks')},
|
|
5
|
+
{value: 'media', label: __('WP médium', 'brilo-blocks')},
|
|
6
|
+
] as const
|
|
7
|
+
|
|
8
|
+
export const SIZES = [
|
|
9
|
+
{value: 'md', label: __('Střední', 'brilo-blocks')},
|
|
10
|
+
{value: 'lg', label: __('Velký', 'brilo-blocks')},
|
|
11
|
+
] as const
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import {InspectorControls, MediaUpload, MediaUploadCheck, RichText, useBlockProps} from '@wordpress/block-editor'
|
|
2
|
+
import type {BlockEditProps} from '@wordpress/blocks'
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
PanelBody,
|
|
6
|
+
TextControl,
|
|
7
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
8
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
9
|
+
} from '@wordpress/components'
|
|
10
|
+
import {__} from '@wordpress/i18n'
|
|
11
|
+
import clsx from 'clsx'
|
|
12
|
+
import {SIZES, VIDEO_TYPES} from './constants'
|
|
13
|
+
import type {VideoGroupAttributes, VideoGroupOptions, VideoSize, VideoType} from './types'
|
|
14
|
+
|
|
15
|
+
function extractYoutubeId(url: string): string | null {
|
|
16
|
+
const match = url.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/)
|
|
17
|
+
return match ? match[1] : null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function createVideoGroupEdit(_options: VideoGroupOptions) {
|
|
21
|
+
return function VideoGroupEdit({attributes, setAttributes}: BlockEditProps<VideoGroupAttributes>) {
|
|
22
|
+
const {type, url, mediaId, caption, size, poster} = attributes
|
|
23
|
+
|
|
24
|
+
const youtubeId = type === 'youtube' ? extractYoutubeId(url) : null
|
|
25
|
+
const youtubeThumbnail = youtubeId ? `https://img.youtube.com/vi/${youtubeId}/maxresdefault.jpg` : null
|
|
26
|
+
|
|
27
|
+
const blockProps = useBlockProps({
|
|
28
|
+
className: clsx('g-video wp-block-section', `--size-${size}`, `--type-${type}`),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<InspectorControls>
|
|
34
|
+
<PanelBody title={__('Typ videa', 'brilo-blocks')}>
|
|
35
|
+
<ToggleGroupControl
|
|
36
|
+
label={__('Zdroj', 'brilo-blocks')}
|
|
37
|
+
value={type}
|
|
38
|
+
onChange={(value) => setAttributes({type: value as VideoType, url: '', mediaId: 0})}
|
|
39
|
+
isBlock
|
|
40
|
+
>
|
|
41
|
+
{VIDEO_TYPES.map((t) => (
|
|
42
|
+
<ToggleGroupControlOption key={t.value} value={t.value} label={t.label} />
|
|
43
|
+
))}
|
|
44
|
+
</ToggleGroupControl>
|
|
45
|
+
</PanelBody>
|
|
46
|
+
|
|
47
|
+
{type === 'youtube' && (
|
|
48
|
+
<PanelBody title={__('YouTube', 'brilo-blocks')}>
|
|
49
|
+
<TextControl
|
|
50
|
+
label={__('URL videa', 'brilo-blocks')}
|
|
51
|
+
value={url}
|
|
52
|
+
onChange={(value) => setAttributes({url: value})}
|
|
53
|
+
placeholder="https://www.youtube.com/watch?v=..."
|
|
54
|
+
help={youtubeId ? __('✓ Platné YouTube video', 'brilo-blocks') : url ? __('⚠ Neplatná YouTube URL', 'brilo-blocks') : ''}
|
|
55
|
+
/>
|
|
56
|
+
</PanelBody>
|
|
57
|
+
)}
|
|
58
|
+
|
|
59
|
+
<PanelBody title={__('Náhledový obrázek', 'brilo-blocks')} initialOpen={false}>
|
|
60
|
+
<MediaUploadCheck>
|
|
61
|
+
<MediaUpload
|
|
62
|
+
onSelect={(media: {url: string; id: number}) => setAttributes({poster: {src: media.url, id: media.id}})}
|
|
63
|
+
allowedTypes={['image']}
|
|
64
|
+
value={poster?.id}
|
|
65
|
+
render={({open}: {open: () => void}) => (
|
|
66
|
+
<div className="g-video__poster-control">
|
|
67
|
+
{poster?.src ? (
|
|
68
|
+
<>
|
|
69
|
+
<img src={poster.src} alt="" className="g-video__poster-preview" />
|
|
70
|
+
<Button onClick={open} variant="secondary" size="small">
|
|
71
|
+
{__('Změnit obrázek', 'brilo-blocks')}
|
|
72
|
+
</Button>
|
|
73
|
+
<Button onClick={() => setAttributes({poster: {src: '', id: 0}})} variant="tertiary" size="small" isDestructive>
|
|
74
|
+
{__('Odebrat', 'brilo-blocks')}
|
|
75
|
+
</Button>
|
|
76
|
+
</>
|
|
77
|
+
) : (
|
|
78
|
+
<Button onClick={open} variant="secondary">
|
|
79
|
+
{__('Vybrat náhledový obrázek', 'brilo-blocks')}
|
|
80
|
+
</Button>
|
|
81
|
+
)}
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
/>
|
|
85
|
+
</MediaUploadCheck>
|
|
86
|
+
</PanelBody>
|
|
87
|
+
|
|
88
|
+
<PanelBody title={__('Rozložení', 'brilo-blocks')} initialOpen={false}>
|
|
89
|
+
<ToggleGroupControl
|
|
90
|
+
label={__('Velikost', 'brilo-blocks')}
|
|
91
|
+
value={size}
|
|
92
|
+
onChange={(value) => setAttributes({size: value as VideoSize})}
|
|
93
|
+
isBlock
|
|
94
|
+
>
|
|
95
|
+
{SIZES.map((s) => (
|
|
96
|
+
<ToggleGroupControlOption key={s.value} value={s.value} label={s.label} />
|
|
97
|
+
))}
|
|
98
|
+
</ToggleGroupControl>
|
|
99
|
+
</PanelBody>
|
|
100
|
+
</InspectorControls>
|
|
101
|
+
|
|
102
|
+
<div {...blockProps}>
|
|
103
|
+
<div className="g-video__media">
|
|
104
|
+
{type === 'youtube' ? (
|
|
105
|
+
youtubeThumbnail ? (
|
|
106
|
+
<div className="g-video__youtube-preview">
|
|
107
|
+
<img src={youtubeThumbnail} alt="" />
|
|
108
|
+
<div className="g-video__play-icon" />
|
|
109
|
+
</div>
|
|
110
|
+
) : (
|
|
111
|
+
<div className={clsx('g-video__empty', url && '--invalid')}>
|
|
112
|
+
<span className="g-video__empty-label">
|
|
113
|
+
{url
|
|
114
|
+
? __('⚠ Neplatná YouTube URL — zkontroluj odkaz', 'brilo-blocks')
|
|
115
|
+
: __('Zadej YouTube URL v postranním panelu →', 'brilo-blocks')}
|
|
116
|
+
</span>
|
|
117
|
+
</div>
|
|
118
|
+
)
|
|
119
|
+
) : (
|
|
120
|
+
<MediaUploadCheck>
|
|
121
|
+
<MediaUpload
|
|
122
|
+
onSelect={(media: {url: string; id: number}) => setAttributes({url: media.url, mediaId: media.id})}
|
|
123
|
+
allowedTypes={['video']}
|
|
124
|
+
value={mediaId}
|
|
125
|
+
render={({open}: {open: () => void}) =>
|
|
126
|
+
mediaId ? (
|
|
127
|
+
<div className="g-video__media-inner">
|
|
128
|
+
<video src={url} poster={poster?.src || undefined}>
|
|
129
|
+
<track kind="captions" />
|
|
130
|
+
</video>
|
|
131
|
+
<Button onClick={open} variant="primary" className="g-video__change-btn">
|
|
132
|
+
{__('Změnit video', 'brilo-blocks')}
|
|
133
|
+
</Button>
|
|
134
|
+
</div>
|
|
135
|
+
) : (
|
|
136
|
+
<button type="button" className="g-video__empty" onClick={open}>
|
|
137
|
+
<span className="g-video__empty-label">{__('Klikni pro výběr videa z médií', 'brilo-blocks')}</span>
|
|
138
|
+
</button>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
/>
|
|
142
|
+
</MediaUploadCheck>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<RichText
|
|
147
|
+
tagName="p"
|
|
148
|
+
className="g-video__caption u-text-editable"
|
|
149
|
+
value={caption}
|
|
150
|
+
onChange={(value) => setAttributes({caption: value})}
|
|
151
|
+
placeholder={__('Popisek videa...', 'brilo-blocks')}
|
|
152
|
+
allowedFormats={['core/bold', 'core/italic', 'brilo-blocks/text-color']}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
</>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.g-video {
|
|
2
|
+
padding: 8px;
|
|
3
|
+
|
|
4
|
+
&.--size-md {
|
|
5
|
+
max-width: 720px;
|
|
6
|
+
margin-inline: auto;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.g-video__media {
|
|
11
|
+
position: relative;
|
|
12
|
+
background: #f0f0f0;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.g-video__youtube-preview {
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
img {
|
|
21
|
+
width: 100%;
|
|
22
|
+
display: block;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.g-video__play-icon {
|
|
27
|
+
position: absolute;
|
|
28
|
+
inset: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
background: rgba(0, 0, 0, 0.2);
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
|
|
35
|
+
&::after {
|
|
36
|
+
content: "";
|
|
37
|
+
width: 64px;
|
|
38
|
+
height: 64px;
|
|
39
|
+
background: rgba(200, 0, 0, 0.9);
|
|
40
|
+
border-radius: 12px;
|
|
41
|
+
clip-path: polygon(30% 20%, 80% 50%, 30% 80%);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.g-video__empty {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
min-height: 240px;
|
|
50
|
+
border: 2px dashed #bbb;
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
background: none;
|
|
54
|
+
width: 100%;
|
|
55
|
+
padding: 0;
|
|
56
|
+
font: inherit;
|
|
57
|
+
|
|
58
|
+
&.--invalid {
|
|
59
|
+
border-color: #d63638;
|
|
60
|
+
background: #fff5f5;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.g-video__empty-label {
|
|
65
|
+
color: #888;
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
|
|
68
|
+
.--invalid & {
|
|
69
|
+
color: #d63638;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.g-video__media-inner {
|
|
74
|
+
position: relative;
|
|
75
|
+
|
|
76
|
+
video {
|
|
77
|
+
width: 100%;
|
|
78
|
+
display: block;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.g-video__change-btn {
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 8px;
|
|
85
|
+
right: 8px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.g-video__caption {
|
|
89
|
+
margin-top: 8px;
|
|
90
|
+
color: #555;
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
min-height: 1.4em;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.g-video__poster-control {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 8px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.g-video__poster-preview {
|
|
102
|
+
width: 100%;
|
|
103
|
+
border-radius: 4px;
|
|
104
|
+
display: block;
|
|
105
|
+
}
|