@brilo/base-blocks 0.1.42 → 0.1.44
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/constants.d.ts +27 -0
- package/build/blocks/compare/compare-group/constants.d.ts.map +1 -1
- package/build/blocks/compare/compare-group/constants.js +23 -0
- package/build/blocks/compare/compare-group/edit.d.ts.map +1 -1
- package/build/blocks/compare/compare-group/edit.js +12 -7
- package/build/blocks/compare/compare-group/factory.d.ts.map +1 -1
- package/build/blocks/compare/compare-group/factory.js +10 -1
- package/build/blocks/compare/compare-group/index.d.ts +1 -1
- package/build/blocks/compare/compare-group/index.d.ts.map +1 -1
- package/build/blocks/compare/compare-group/types.d.ts +7 -1
- package/build/blocks/compare/compare-group/types.d.ts.map +1 -1
- package/build/blocks/compare/compare-item/edit.d.ts.map +1 -1
- package/build/blocks/compare/compare-item/edit.js +6 -4
- package/build/blocks/compare/compare-item/factory.d.ts.map +1 -1
- package/build/blocks/compare/compare-item/factory.js +4 -0
- package/build/blocks/compare/compare-item/types.d.ts +2 -0
- package/build/blocks/compare/compare-item/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-icon/buildPreviewStyle.d.ts +8 -0
- package/build/blocks/core/basic-icon/buildPreviewStyle.d.ts.map +1 -0
- package/build/blocks/core/basic-icon/buildPreviewStyle.js +22 -0
- package/build/blocks/core/basic-icon/constants.d.ts +84 -0
- package/build/blocks/core/basic-icon/constants.d.ts.map +1 -0
- package/build/blocks/core/basic-icon/constants.js +41 -0
- package/build/blocks/core/basic-icon/edit.d.ts +6 -0
- package/build/blocks/core/basic-icon/edit.d.ts.map +1 -0
- package/build/blocks/core/basic-icon/edit.js +22 -0
- package/build/blocks/core/basic-icon/factory.d.ts +5 -0
- package/build/blocks/core/basic-icon/factory.d.ts.map +1 -0
- package/build/blocks/core/basic-icon/factory.js +38 -0
- package/build/blocks/core/basic-icon/index.d.ts +5 -0
- package/build/blocks/core/basic-icon/index.d.ts.map +1 -0
- package/build/blocks/core/basic-icon/index.js +7 -0
- package/build/blocks/core/basic-icon/types.d.ts +30 -0
- package/build/blocks/core/basic-icon/types.d.ts.map +1 -0
- package/build/blocks/core/basic-icon/types.js +1 -0
- 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/faq/faq-group/constants.d.ts +29 -0
- package/build/blocks/faq/faq-group/constants.d.ts.map +1 -1
- package/build/blocks/faq/faq-group/constants.js +15 -0
- package/build/blocks/faq/faq-group/edit.d.ts.map +1 -1
- package/build/blocks/faq/faq-group/edit.js +12 -5
- package/build/blocks/faq/faq-group/factory.d.ts.map +1 -1
- package/build/blocks/faq/faq-group/factory.js +35 -17
- package/build/blocks/faq/faq-group/index.d.ts +1 -1
- package/build/blocks/faq/faq-group/index.d.ts.map +1 -1
- package/build/blocks/faq/faq-group/types.d.ts +20 -1
- package/build/blocks/faq/faq-group/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 +26 -0
- package/build/blocks/review/review-group/constants.d.ts.map +1 -0
- package/build/blocks/review/review-group/constants.js +21 -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 +31 -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 +49 -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 +24 -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 +51 -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 +20 -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 +14 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -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/constants.ts +27 -0
- package/src/blocks/compare/compare-group/edit.tsx +27 -4
- package/src/blocks/compare/compare-group/factory.tsx +10 -1
- package/src/blocks/compare/compare-group/index.ts +7 -1
- package/src/blocks/compare/compare-group/types.ts +5 -1
- package/src/blocks/compare/compare-item/edit.tsx +32 -13
- package/src/blocks/compare/compare-item/editor.scss +16 -0
- package/src/blocks/compare/compare-item/factory.tsx +4 -0
- package/src/blocks/compare/compare-item/types.ts +2 -0
- package/src/blocks/compare/compare-option/types.ts +1 -1
- package/src/blocks/core/basic-icon/buildPreviewStyle.ts +40 -0
- package/src/blocks/core/basic-icon/constants.ts +48 -0
- package/src/blocks/core/basic-icon/edit.tsx +170 -0
- package/src/blocks/core/basic-icon/editor.scss +119 -0
- package/src/blocks/core/basic-icon/factory.tsx +42 -0
- package/src/blocks/core/basic-icon/index.ts +17 -0
- package/src/blocks/core/basic-icon/types.ts +34 -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/faq/faq-group/constants.ts +18 -0
- package/src/blocks/faq/faq-group/edit.tsx +118 -4
- package/src/blocks/faq/faq-group/factory.tsx +33 -13
- package/src/blocks/faq/faq-group/index.ts +9 -1
- package/src/blocks/faq/faq-group/types.ts +22 -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 +25 -0
- package/src/blocks/review/review-group/edit.tsx +116 -0
- package/src/blocks/review/review-group/editor.scss +10 -0
- package/src/blocks/review/review-group/factory.tsx +58 -0
- package/src/blocks/review/review-group/icon.tsx +12 -0
- package/src/blocks/review/review-group/index.ts +19 -0
- package/src/blocks/review/review-group/types.ts +27 -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 +165 -0
- package/src/blocks/video/video-group/editor.scss +105 -0
- package/src/blocks/video/video-group/factory.tsx +55 -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 +22 -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 +7 -0
- package/src/index.ts +19 -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
|
@@ -1 +1,28 @@
|
|
|
1
|
+
import {__} from '@wordpress/i18n'
|
|
2
|
+
|
|
1
3
|
export const HEADING_LEVELS = [2, 3, 4] as const
|
|
4
|
+
|
|
5
|
+
export const RATIOS = ['4:3', '3:2', '16:9', '1:1', '2:1', '3:4'] as const
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_IMAGE_CLIP_PATHS = [
|
|
8
|
+
{value: 'none', label: __('Žádný', 'brilo-blocks')},
|
|
9
|
+
{value: 'circle', label: __('Kruh', 'brilo-blocks')},
|
|
10
|
+
{value: 'triangle', label: __('Trojúhelník', 'brilo-blocks')},
|
|
11
|
+
{value: 'rhombus', label: __('Kosočtverec', 'brilo-blocks')},
|
|
12
|
+
{value: 'octagon', label: __('Osmiúhelník', 'brilo-blocks')},
|
|
13
|
+
{value: 'bevel', label: __('Zkosený', 'brilo-blocks')},
|
|
14
|
+
{value: 'rabbet', label: __('Drážkovaný', 'brilo-blocks')},
|
|
15
|
+
{value: 'parallelogram', label: __('Rovnoběžník', 'brilo-blocks')},
|
|
16
|
+
] as const
|
|
17
|
+
|
|
18
|
+
// Frontend reads the shapes from the theme's --shape-* tokens; the editor has no
|
|
19
|
+
// access to them, so the same geometry is inlined here for the preview CSS var.
|
|
20
|
+
export const IMAGE_CLIP_PATH_VALUES: Record<string, string> = {
|
|
21
|
+
circle: 'circle(50% at 50% 50%)',
|
|
22
|
+
triangle: 'polygon(50% 0%, 0% 100%, 100% 100%)',
|
|
23
|
+
rhombus: 'polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)',
|
|
24
|
+
octagon: 'polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)',
|
|
25
|
+
bevel: 'polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%)',
|
|
26
|
+
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%)',
|
|
27
|
+
parallelogram: 'polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)',
|
|
28
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {InspectorControls} from '@wordpress/block-editor'
|
|
2
2
|
import {
|
|
3
3
|
PanelBody,
|
|
4
|
+
SelectControl,
|
|
4
5
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
5
6
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
6
7
|
} from '@wordpress/components'
|
|
7
8
|
import {__} from '@wordpress/i18n'
|
|
8
9
|
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
9
|
-
import {HEADING_LEVELS} from './constants'
|
|
10
|
-
import type {CompareGroupAttributes, CompareGroupOptions} from './types'
|
|
10
|
+
import {DEFAULT_IMAGE_CLIP_PATHS, HEADING_LEVELS, IMAGE_CLIP_PATH_VALUES, RATIOS} from './constants'
|
|
11
|
+
import type {CompareGroupAttributes, CompareGroupOptions, CompareImageClipPath} from './types'
|
|
11
12
|
|
|
12
13
|
export function createCompareGroupEdit(options: CompareGroupOptions) {
|
|
13
14
|
return function Edit({
|
|
@@ -17,10 +18,16 @@ export function createCompareGroupEdit(options: CompareGroupOptions) {
|
|
|
17
18
|
attributes: CompareGroupAttributes
|
|
18
19
|
setAttributes: (a: Partial<CompareGroupAttributes>) => void
|
|
19
20
|
}) {
|
|
20
|
-
const {headingLevel} = attributes
|
|
21
|
+
const {headingLevel, ratio, img} = attributes
|
|
22
|
+
const clipPath = img?.clipPath ?? 'none'
|
|
23
|
+
|
|
21
24
|
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
22
25
|
blockClassName: options.blockClassName ?? 'g-compare wp-block-section',
|
|
23
|
-
containerClassName: [options.containerClassName ?? 'u-grid-responsive'],
|
|
26
|
+
containerClassName: [options.containerClassName ?? 'u-grid-responsive', `--ratio-${ratio.replace(':', '-')}`],
|
|
27
|
+
containerStyle: {
|
|
28
|
+
// Inherited by every compare item inside the container.
|
|
29
|
+
...(IMAGE_CLIP_PATH_VALUES[clipPath] && {'--compare-image-clip-path': IMAGE_CLIP_PATH_VALUES[clipPath]}),
|
|
30
|
+
},
|
|
24
31
|
allowedBlocks: options.allowedBlocks,
|
|
25
32
|
orientation: 'horizontal',
|
|
26
33
|
template: options.template,
|
|
@@ -41,6 +48,22 @@ export function createCompareGroupEdit(options: CompareGroupOptions) {
|
|
|
41
48
|
<ToggleGroupControlOption key={l} value={String(l)} label={`H${l}`} />
|
|
42
49
|
))}
|
|
43
50
|
</ToggleGroupControl>
|
|
51
|
+
<ToggleGroupControl
|
|
52
|
+
isBlock
|
|
53
|
+
label={__('Poměr stran obrázku', 'brilo-blocks')}
|
|
54
|
+
value={ratio}
|
|
55
|
+
onChange={(v) => setAttributes({ratio: v as CompareGroupAttributes['ratio']})}
|
|
56
|
+
>
|
|
57
|
+
{RATIOS.map((r) => (
|
|
58
|
+
<ToggleGroupControlOption key={r} value={r} label={r} />
|
|
59
|
+
))}
|
|
60
|
+
</ToggleGroupControl>
|
|
61
|
+
<SelectControl<string>
|
|
62
|
+
label={__('Tvar výřezu obrázku', 'brilo-blocks')}
|
|
63
|
+
value={clipPath}
|
|
64
|
+
options={[...DEFAULT_IMAGE_CLIP_PATHS]}
|
|
65
|
+
onChange={(v) => setAttributes({img: {...img, clipPath: v as CompareImageClipPath}})}
|
|
66
|
+
/>
|
|
44
67
|
</PanelBody>
|
|
45
68
|
</InspectorControls>
|
|
46
69
|
<div {...blockProps}>
|
|
@@ -3,7 +3,7 @@ import type {BlockConfiguration} from '@wordpress/blocks'
|
|
|
3
3
|
import {__} from '@wordpress/i18n'
|
|
4
4
|
import {createCompareGroupEdit} from './edit'
|
|
5
5
|
import {icon as defaultIcon} from './icon'
|
|
6
|
-
import {HEADING_LEVELS} from './constants'
|
|
6
|
+
import {DEFAULT_IMAGE_CLIP_PATHS, HEADING_LEVELS, RATIOS} from './constants'
|
|
7
7
|
import type {CompareGroupAttributes, CompareGroupOptions} from './types'
|
|
8
8
|
|
|
9
9
|
export type {CompareGroupAttributes, CompareGroupOptions}
|
|
@@ -22,6 +22,15 @@ export function createCompareGroupBlock(options: CompareGroupOptions): BlockConf
|
|
|
22
22
|
type: 'number',
|
|
23
23
|
default: HEADING_LEVELS[1],
|
|
24
24
|
},
|
|
25
|
+
ratio: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: RATIOS[0],
|
|
28
|
+
enum: [...RATIOS],
|
|
29
|
+
},
|
|
30
|
+
img: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
default: {clipPath: DEFAULT_IMAGE_CLIP_PATHS[0].value},
|
|
33
|
+
},
|
|
25
34
|
},
|
|
26
35
|
edit: createCompareGroupEdit(options),
|
|
27
36
|
save: () => <InnerBlocks.Content />,
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type {
|
|
2
|
+
CompareGroupAttributes,
|
|
3
|
+
CompareGroupOptions,
|
|
4
|
+
CompareHeadingLevel,
|
|
5
|
+
CompareImageClipPath,
|
|
6
|
+
CompareRatio,
|
|
7
|
+
} from './types'
|
|
2
8
|
export {createCompareGroupBlock} from './factory'
|
|
3
9
|
import type {CompareGroupOptions} from './types'
|
|
4
10
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {HEADING_LEVELS} from './constants'
|
|
2
1
|
import type {BriloBlockType} from '~/types'
|
|
2
|
+
import type {DEFAULT_IMAGE_CLIP_PATHS, HEADING_LEVELS, RATIOS} from './constants'
|
|
3
3
|
|
|
4
4
|
export type CompareHeadingLevel = (typeof HEADING_LEVELS)[number]
|
|
5
|
+
export type CompareRatio = (typeof RATIOS)[number]
|
|
6
|
+
export type CompareImageClipPath = (typeof DEFAULT_IMAGE_CLIP_PATHS)[number]['value']
|
|
5
7
|
|
|
6
8
|
export interface CompareGroupAttributes extends Record<string, unknown> {
|
|
7
9
|
headingLevel: CompareHeadingLevel
|
|
10
|
+
ratio: CompareRatio
|
|
11
|
+
img: {clipPath: CompareImageClipPath}
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
export interface CompareGroupOptions extends BriloBlockType {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {RichText, useBlockProps, useInnerBlocksProps} from '@wordpress/block-editor'
|
|
1
|
+
import {InspectorControls, RichText, useBlockProps, useInnerBlocksProps} from '@wordpress/block-editor'
|
|
2
|
+
import {PanelBody} from '@wordpress/components'
|
|
2
3
|
import {__} from '@wordpress/i18n'
|
|
4
|
+
import {ImagePickerControl} from '~/components/ImagePicker'
|
|
3
5
|
import type {CompareItemAttributes, CompareItemOptions} from './types'
|
|
4
6
|
|
|
5
7
|
export function createCompareItemEdit(options: CompareItemOptions) {
|
|
@@ -10,7 +12,7 @@ export function createCompareItemEdit(options: CompareItemOptions) {
|
|
|
10
12
|
attributes: CompareItemAttributes
|
|
11
13
|
setAttributes: (a: Partial<CompareItemAttributes>) => void
|
|
12
14
|
}) {
|
|
13
|
-
const {title} = attributes
|
|
15
|
+
const {title, img} = attributes
|
|
14
16
|
const blockProps = useBlockProps({className: 'i-compare'})
|
|
15
17
|
const innerBlocksProps = useInnerBlocksProps(
|
|
16
18
|
{className: 'i-compare__options wp-block-inner-content'},
|
|
@@ -21,18 +23,35 @@ export function createCompareItemEdit(options: CompareItemOptions) {
|
|
|
21
23
|
)
|
|
22
24
|
|
|
23
25
|
return (
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
<>
|
|
27
|
+
<InspectorControls>
|
|
28
|
+
<PanelBody title={__('Obrázek', 'brilo-blocks')}>
|
|
29
|
+
<ImagePickerControl value={img} onChange={(val) => setAttributes({img: val})} />
|
|
30
|
+
</PanelBody>
|
|
31
|
+
</InspectorControls>
|
|
32
|
+
|
|
33
|
+
<div {...blockProps}>
|
|
34
|
+
<div className={'i-compare__inner'}>
|
|
35
|
+
<div className="i-compare__image-wrapper">
|
|
36
|
+
{img.id ? (
|
|
37
|
+
<ImagePickerControl value={img} onChange={(val) => setAttributes({img: val})} size={[128, 128]} />
|
|
38
|
+
) : (
|
|
39
|
+
<div className="i-compare__image-placeholder">
|
|
40
|
+
<ImagePickerControl value={img} onChange={(val) => setAttributes({img: val})} />
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
<RichText
|
|
45
|
+
tagName={'div'}
|
|
46
|
+
className="i-compare__title u-text-editable"
|
|
47
|
+
value={title}
|
|
48
|
+
onChange={(v) => setAttributes({title: v})}
|
|
49
|
+
placeholder={__('Nadpis...', 'brilo-blocks')}
|
|
50
|
+
/>
|
|
51
|
+
<div {...innerBlocksProps} />
|
|
52
|
+
</div>
|
|
34
53
|
</div>
|
|
35
|
-
|
|
54
|
+
</>
|
|
36
55
|
)
|
|
37
56
|
}
|
|
38
57
|
}
|
|
@@ -12,4 +12,20 @@
|
|
|
12
12
|
.i-compare {
|
|
13
13
|
width: 100%;
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
.i-compare__image-placeholder {
|
|
17
|
+
border: 1px dashed #0073aa;
|
|
18
|
+
padding: 16px 8px 8px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.i-compare__image-wrapper {
|
|
22
|
+
.c-image-picker-control__row {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Set by the parent compare group on the inner blocks container.
|
|
27
|
+
.c-image-picker-control__thumb {
|
|
28
|
+
clip-path: var(--compare-image-clip-path, none);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
15
31
|
}
|
|
@@ -21,6 +21,10 @@ export function createCompareItemBlock(options: CompareItemOptions): BlockConfig
|
|
|
21
21
|
type: 'string',
|
|
22
22
|
default: '',
|
|
23
23
|
},
|
|
24
|
+
img: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
default: {id: 0, alt: ''},
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
edit: createCompareItemEdit(options),
|
|
26
30
|
save: () => <InnerBlocks.Content />,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type {ImageValue} from '~/components/ImagePicker/ImagePicker'
|
|
1
2
|
import type {BriloBlockType} from '~/types'
|
|
2
3
|
|
|
3
4
|
export interface CompareItemAttributes extends Record<string, unknown> {
|
|
4
5
|
title: string
|
|
6
|
+
img: ImageValue
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
export interface CompareItemOptions extends BriloBlockType {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import clsx from 'clsx'
|
|
2
|
+
import type {BasicIconStyle} from './types'
|
|
3
|
+
|
|
4
|
+
export interface BasicIconPreviewStyle {
|
|
5
|
+
rootClassName: string
|
|
6
|
+
iconClassName: string
|
|
7
|
+
cssVars: Record<string, string>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function buildBasicIconPreviewStyle(
|
|
11
|
+
style: BasicIconStyle,
|
|
12
|
+
resolveHex: (value: string) => string = (value) => value,
|
|
13
|
+
): BasicIconPreviewStyle {
|
|
14
|
+
const icon = style.icon ?? ({} as BasicIconStyle['icon'])
|
|
15
|
+
|
|
16
|
+
const rootClassName = clsx(
|
|
17
|
+
style.align && `--align-${style.align}`,
|
|
18
|
+
icon.background && icon.background !== 'none' && '--icon-background',
|
|
19
|
+
icon.color && icon.color !== 'none' && '--icon-color',
|
|
20
|
+
icon.borderColor && '--icon-bordered',
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const iconClassName = clsx(
|
|
24
|
+
icon.backgroundShape && icon.backgroundShape !== 'none' && `--background-shape --background-shape-${icon.backgroundShape}`,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const cssVars: Record<string, string> = {}
|
|
28
|
+
if (icon.background && icon.background !== 'none') cssVars['--icon-background-color'] = resolveHex(icon.background)
|
|
29
|
+
if (icon.color && icon.color !== 'none') cssVars['--icon-color'] = resolveHex(icon.color)
|
|
30
|
+
if (icon.size) cssVars['--icon-size'] = `${icon.size}px`
|
|
31
|
+
if (icon.background && icon.background !== 'none' && icon.backgroundSize) {
|
|
32
|
+
cssVars['--icon-background-size'] = `${icon.backgroundSize}px`
|
|
33
|
+
}
|
|
34
|
+
if (icon.borderColor) {
|
|
35
|
+
cssVars['--icon-outline-color'] = resolveHex(icon.borderColor)
|
|
36
|
+
cssVars['--icon-outline-width'] = `${icon.borderWidth || 1}px`
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return {rootClassName, iconClassName, cssVars}
|
|
40
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {__} from '@wordpress/i18n'
|
|
2
|
+
|
|
3
|
+
export const ICON_TYPES = [
|
|
4
|
+
{value: 'preselected', label: __('Předvolená', 'brilo-blocks')},
|
|
5
|
+
{value: 'media', label: __('Obrázek', 'brilo-blocks')},
|
|
6
|
+
{value: 'number', label: __('Číslo', 'brilo-blocks')},
|
|
7
|
+
] as const
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_ALIGNMENTS = [
|
|
10
|
+
{value: 'left', label: __('Vlevo', 'brilo-blocks')},
|
|
11
|
+
{value: 'center', label: __('Na střed', 'brilo-blocks')},
|
|
12
|
+
{value: 'right', label: __('Vpravo', 'brilo-blocks')},
|
|
13
|
+
] as const
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_ICON_SIZE = 88
|
|
16
|
+
export const ICON_SIZE_MIN = 4
|
|
17
|
+
export const ICON_SIZE_MAX = 128
|
|
18
|
+
|
|
19
|
+
export const DEFAULT_ICON_SIZE_PRESETS = [
|
|
20
|
+
{value: 8, label: __('XS', 'brilo-blocks')},
|
|
21
|
+
{value: 16, label: __('SM', 'brilo-blocks')},
|
|
22
|
+
{value: 24, label: __('MD', 'brilo-blocks')},
|
|
23
|
+
{value: 32, label: __('LG', 'brilo-blocks')},
|
|
24
|
+
{value: 48, label: __('XL', 'brilo-blocks')},
|
|
25
|
+
] as const
|
|
26
|
+
|
|
27
|
+
export const DEFAULT_ICON_BACKGROUND_SIZE = 88
|
|
28
|
+
export const ICON_BACKGROUND_SIZE_MIN = 16
|
|
29
|
+
export const ICON_BACKGROUND_SIZE_MAX = 240
|
|
30
|
+
|
|
31
|
+
export const DEFAULT_ICON_BACKGROUND_SIZE_PRESETS = [
|
|
32
|
+
{value: 48, label: __('XS', 'brilo-blocks')},
|
|
33
|
+
{value: 64, label: __('SM', 'brilo-blocks')},
|
|
34
|
+
{value: 88, label: __('Výchozí', 'brilo-blocks')},
|
|
35
|
+
{value: 104, label: __('LG', 'brilo-blocks')},
|
|
36
|
+
{value: 128, label: __('XL', 'brilo-blocks')},
|
|
37
|
+
] as const
|
|
38
|
+
|
|
39
|
+
export const DEFAULT_ICON_BACKGROUND_SHAPES = [
|
|
40
|
+
{value: 'none', label: __('Žádný', 'brilo-blocks')},
|
|
41
|
+
{value: 'circle', label: __('Kruh', 'brilo-blocks')},
|
|
42
|
+
{value: 'triangle', label: __('Trojúhelník', 'brilo-blocks')},
|
|
43
|
+
{value: 'rhombus', label: __('Kosočtverec', 'brilo-blocks')},
|
|
44
|
+
{value: 'octagon', label: __('Osmiúhelník', 'brilo-blocks')},
|
|
45
|
+
{value: 'bevel', label: __('Zkosený', 'brilo-blocks')},
|
|
46
|
+
{value: 'rabbet', label: __('Drážkovaný', 'brilo-blocks')},
|
|
47
|
+
{value: 'parallelogram', label: __('Rovnoběžník', 'brilo-blocks')},
|
|
48
|
+
] as const
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {InspectorControls, useBlockProps} from '@wordpress/block-editor'
|
|
2
|
+
import {
|
|
3
|
+
BaseControl,
|
|
4
|
+
Button,
|
|
5
|
+
ColorPalette,
|
|
6
|
+
PanelBody,
|
|
7
|
+
RangeControl,
|
|
8
|
+
SelectControl,
|
|
9
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
10
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
11
|
+
} from '@wordpress/components'
|
|
12
|
+
import {__} from '@wordpress/i18n'
|
|
13
|
+
import clsx from 'clsx'
|
|
14
|
+
import {ItemIconControl, ItemIconPreview} from '~/components/ItemIconControl'
|
|
15
|
+
import {useTenantColorPalette} from '~/hooks/useTenantColorPalette'
|
|
16
|
+
import {buildBasicIconPreviewStyle} from './buildPreviewStyle'
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_ALIGNMENTS,
|
|
19
|
+
DEFAULT_ICON_BACKGROUND_SHAPES,
|
|
20
|
+
DEFAULT_ICON_BACKGROUND_SIZE_PRESETS,
|
|
21
|
+
DEFAULT_ICON_SIZE_PRESETS,
|
|
22
|
+
ICON_BACKGROUND_SIZE_MAX,
|
|
23
|
+
ICON_BACKGROUND_SIZE_MIN,
|
|
24
|
+
ICON_SIZE_MAX,
|
|
25
|
+
ICON_SIZE_MIN,
|
|
26
|
+
ICON_TYPES,
|
|
27
|
+
} from './constants'
|
|
28
|
+
import type {BasicIconAlignment, BasicIconAttributes, BasicIconBackgroundShape, BasicIconOptions, BasicIconSizePreset} from './types'
|
|
29
|
+
|
|
30
|
+
function PresetSizeControl({
|
|
31
|
+
label,
|
|
32
|
+
value,
|
|
33
|
+
presets,
|
|
34
|
+
min,
|
|
35
|
+
max,
|
|
36
|
+
onChange,
|
|
37
|
+
}: {
|
|
38
|
+
label: string
|
|
39
|
+
value: number
|
|
40
|
+
presets: readonly BasicIconSizePreset[]
|
|
41
|
+
min: number
|
|
42
|
+
max: number
|
|
43
|
+
onChange: (v: number) => void
|
|
44
|
+
}) {
|
|
45
|
+
return (
|
|
46
|
+
<BaseControl label={label} id={`basic-icon-size-${label}`}>
|
|
47
|
+
<div style={{display: 'flex', gap: 4, marginBottom: 8, flexWrap: 'wrap'}}>
|
|
48
|
+
{presets.map((p) => (
|
|
49
|
+
<Button key={p.label} variant={value === p.value ? 'primary' : 'secondary'} size="small" onClick={() => onChange(p.value)}>
|
|
50
|
+
{p.label}
|
|
51
|
+
</Button>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
<RangeControl value={value} onChange={(v) => onChange(v ?? min)} min={min} max={max} step={1} withInputField />
|
|
55
|
+
</BaseControl>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function createBasicIconEdit(options: BasicIconOptions) {
|
|
60
|
+
return function Edit({
|
|
61
|
+
attributes,
|
|
62
|
+
setAttributes,
|
|
63
|
+
}: {
|
|
64
|
+
attributes: BasicIconAttributes
|
|
65
|
+
setAttributes: (a: Partial<BasicIconAttributes>) => void
|
|
66
|
+
}) {
|
|
67
|
+
const {icon, style} = attributes
|
|
68
|
+
const {paletteColors, resolveHex} = useTenantColorPalette()
|
|
69
|
+
const {rootClassName, iconClassName, cssVars} = buildBasicIconPreviewStyle(style, resolveHex)
|
|
70
|
+
|
|
71
|
+
const blockProps = useBlockProps({className: clsx('i-basic-icon', rootClassName)})
|
|
72
|
+
|
|
73
|
+
const setIcon = (patch: Partial<BasicIconAttributes['style']['icon']>) =>
|
|
74
|
+
setAttributes({style: {...style, icon: {...style.icon, ...patch}}})
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<>
|
|
78
|
+
<InspectorControls>
|
|
79
|
+
<PanelBody title={__('Ikona', 'brilo-blocks')}>
|
|
80
|
+
<ItemIconControl icon={icon} setAttributes={setAttributes} iconTypes={ICON_TYPES} options={options} />
|
|
81
|
+
</PanelBody>
|
|
82
|
+
<PanelBody title={__('Zarovnání', 'brilo-blocks')}>
|
|
83
|
+
<ToggleGroupControl
|
|
84
|
+
isBlock
|
|
85
|
+
label={__('Zarovnání', 'brilo-blocks')}
|
|
86
|
+
value={style.align}
|
|
87
|
+
onChange={(v) => setAttributes({style: {...style, align: v as BasicIconAlignment}})}
|
|
88
|
+
>
|
|
89
|
+
{DEFAULT_ALIGNMENTS.map((a) => (
|
|
90
|
+
<ToggleGroupControlOption key={a.value} value={a.value} label={a.label} />
|
|
91
|
+
))}
|
|
92
|
+
</ToggleGroupControl>
|
|
93
|
+
</PanelBody>
|
|
94
|
+
<PanelBody title={__('Styl ikony', 'brilo-blocks')} initialOpen={false}>
|
|
95
|
+
<PresetSizeControl
|
|
96
|
+
label={__('Velikost', 'brilo-blocks')}
|
|
97
|
+
value={style.icon.size}
|
|
98
|
+
presets={DEFAULT_ICON_SIZE_PRESETS}
|
|
99
|
+
min={ICON_SIZE_MIN}
|
|
100
|
+
max={ICON_SIZE_MAX}
|
|
101
|
+
onChange={(v) => setIcon({size: v})}
|
|
102
|
+
/>
|
|
103
|
+
<BaseControl label={__('Barva', 'brilo-blocks')} id="basic-icon-color">
|
|
104
|
+
<ColorPalette
|
|
105
|
+
colors={paletteColors}
|
|
106
|
+
value={style.icon.color || undefined}
|
|
107
|
+
onChange={(value) => setIcon({color: value ?? ''})}
|
|
108
|
+
/>
|
|
109
|
+
</BaseControl>
|
|
110
|
+
<BaseControl label={__('Pozadí', 'brilo-blocks')} id="basic-icon-background-color">
|
|
111
|
+
<ColorPalette
|
|
112
|
+
colors={paletteColors}
|
|
113
|
+
value={style.icon.background || undefined}
|
|
114
|
+
onChange={(value) => setIcon({background: value ?? ''})}
|
|
115
|
+
/>
|
|
116
|
+
</BaseControl>
|
|
117
|
+
<PresetSizeControl
|
|
118
|
+
label={__('Velikost pozadí', 'brilo-blocks')}
|
|
119
|
+
value={style.icon.backgroundSize}
|
|
120
|
+
presets={DEFAULT_ICON_BACKGROUND_SIZE_PRESETS}
|
|
121
|
+
min={ICON_BACKGROUND_SIZE_MIN}
|
|
122
|
+
max={ICON_BACKGROUND_SIZE_MAX}
|
|
123
|
+
onChange={(v) => setIcon({backgroundSize: v})}
|
|
124
|
+
/>
|
|
125
|
+
{style.icon.background && (
|
|
126
|
+
<SelectControl<string>
|
|
127
|
+
label={__('Tvar pozadí', 'brilo-blocks')}
|
|
128
|
+
value={style.icon.backgroundShape}
|
|
129
|
+
options={[...DEFAULT_ICON_BACKGROUND_SHAPES]}
|
|
130
|
+
onChange={(v) => setIcon({backgroundShape: v as BasicIconBackgroundShape})}
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
133
|
+
<BaseControl
|
|
134
|
+
label={__('Barva ohraničení', 'brilo-blocks')}
|
|
135
|
+
help={__('Bez vybrané barvy se okraj nevykreslí.', 'brilo-blocks')}
|
|
136
|
+
id="basic-icon-border-color"
|
|
137
|
+
>
|
|
138
|
+
<ColorPalette
|
|
139
|
+
colors={paletteColors}
|
|
140
|
+
value={style.icon.borderColor || undefined}
|
|
141
|
+
onChange={(value) => setIcon({borderColor: value ?? ''})}
|
|
142
|
+
/>
|
|
143
|
+
</BaseControl>
|
|
144
|
+
{style.icon.borderColor && (
|
|
145
|
+
<RangeControl
|
|
146
|
+
label={__('Šířka ohraničení (px)', 'brilo-blocks')}
|
|
147
|
+
value={style.icon.borderWidth}
|
|
148
|
+
onChange={(v) => setIcon({borderWidth: v ?? 0})}
|
|
149
|
+
min={0}
|
|
150
|
+
max={10}
|
|
151
|
+
step={1}
|
|
152
|
+
/>
|
|
153
|
+
)}
|
|
154
|
+
</PanelBody>
|
|
155
|
+
</InspectorControls>
|
|
156
|
+
|
|
157
|
+
<div {...blockProps}>
|
|
158
|
+
<ItemIconPreview
|
|
159
|
+
icon={icon}
|
|
160
|
+
className="i-basic-icon__icon"
|
|
161
|
+
modifierClassName={iconClassName}
|
|
162
|
+
style={cssVars}
|
|
163
|
+
setAttributes={setAttributes}
|
|
164
|
+
options={options}
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
</>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
.i-basic-icon {
|
|
2
|
+
display: flex;
|
|
3
|
+
--icon-background-size: 0px;
|
|
4
|
+
|
|
5
|
+
// Background size only reserves space when a background or outline is actually selected.
|
|
6
|
+
&.--icon-background,
|
|
7
|
+
&.--icon-bordered {
|
|
8
|
+
--icon-background-size: 88px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.--align-left {
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.--align-center {
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.--align-right {
|
|
20
|
+
justify-content: flex-end;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.i-basic-icon__icon {
|
|
25
|
+
--icon-box-size: max(var(--icon-background-size, 0px), var(--icon-size, 88px));
|
|
26
|
+
|
|
27
|
+
width: var(--icon-box-size);
|
|
28
|
+
height: var(--icon-box-size);
|
|
29
|
+
flex: 0 0 var(--icon-box-size);
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-areas: "pile";
|
|
32
|
+
place-items: center;
|
|
33
|
+
isolation: isolate;
|
|
34
|
+
|
|
35
|
+
&::before,
|
|
36
|
+
&::after {
|
|
37
|
+
content: "";
|
|
38
|
+
grid-area: pile;
|
|
39
|
+
width: var(--icon-background-size, 0px);
|
|
40
|
+
height: var(--icon-background-size, 0px);
|
|
41
|
+
border-radius: inherit;
|
|
42
|
+
clip-path: var(--icon-background-shape, none);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::before {
|
|
46
|
+
z-index: 0;
|
|
47
|
+
background-color: var(--icon-outline-color, transparent);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&::after {
|
|
51
|
+
z-index: 1;
|
|
52
|
+
width: calc(var(--icon-background-size, 0px) - var(--icon-outline-width, 0px) * 2);
|
|
53
|
+
height: calc(var(--icon-background-size, 0px) - var(--icon-outline-width, 0px) * 2);
|
|
54
|
+
background-color: var(--icon-background-color, transparent);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
img,
|
|
58
|
+
svg,
|
|
59
|
+
span {
|
|
60
|
+
grid-area: pile;
|
|
61
|
+
position: relative;
|
|
62
|
+
z-index: 2;
|
|
63
|
+
width: var(--icon-size, 88px);
|
|
64
|
+
height: var(--icon-size, 88px);
|
|
65
|
+
object-fit: contain;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
svg path {
|
|
69
|
+
fill: var(--icon-color, currentcolor);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
span {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
color: var(--icon-color, currentcolor);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.--background-shape-circle {
|
|
80
|
+
--icon-background-shape: circle(50% at 50% 50%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.--background-shape-triangle {
|
|
84
|
+
--icon-background-shape: polygon(50% 0%, 0% 100%, 100% 100%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.--background-shape-rhombus {
|
|
88
|
+
--icon-background-shape: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.--background-shape-octagon {
|
|
92
|
+
--icon-background-shape: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.--background-shape-bevel {
|
|
96
|
+
--icon-background-shape: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.--background-shape-rabbet {
|
|
100
|
+
--icon-background-shape: polygon(
|
|
101
|
+
0% 15%,
|
|
102
|
+
15% 15%,
|
|
103
|
+
15% 0%,
|
|
104
|
+
85% 0%,
|
|
105
|
+
85% 15%,
|
|
106
|
+
100% 15%,
|
|
107
|
+
100% 85%,
|
|
108
|
+
85% 85%,
|
|
109
|
+
85% 100%,
|
|
110
|
+
15% 100%,
|
|
111
|
+
15% 85%,
|
|
112
|
+
0% 85%
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.--background-shape-parallelogram {
|
|
117
|
+
--icon-background-shape: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
|
|
118
|
+
}
|
|
119
|
+
}
|