@brilo/base-blocks 0.1.41 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/blocks/compare/compare-group/types.d.ts +1 -1
  3. package/build/blocks/compare/compare-group/types.d.ts.map +1 -1
  4. package/build/blocks/compare/compare-option/types.d.ts +1 -1
  5. package/build/blocks/compare/compare-option/types.d.ts.map +1 -1
  6. package/build/blocks/core/basic-button/edit.d.ts.map +1 -1
  7. package/build/blocks/core/basic-button/edit.js +3 -3
  8. package/build/blocks/core/basic-button/factory.d.ts.map +1 -1
  9. package/build/blocks/core/basic-button/factory.js +1 -0
  10. package/build/blocks/core/basic-button/types.d.ts +1 -0
  11. package/build/blocks/core/basic-button/types.d.ts.map +1 -1
  12. package/build/blocks/core/basic-overline/edit.d.ts.map +1 -1
  13. package/build/blocks/core/basic-overline/edit.js +6 -1
  14. package/build/blocks/core/basic-overline/factory.d.ts.map +1 -1
  15. package/build/blocks/core/basic-overline/factory.js +2 -0
  16. package/build/blocks/core/basic-overline/types.d.ts +3 -1
  17. package/build/blocks/core/basic-overline/types.d.ts.map +1 -1
  18. package/build/blocks/form/form-field/edit.d.ts +1 -1
  19. package/build/blocks/form/form-field/edit.d.ts.map +1 -1
  20. package/build/blocks/form/form-field/types.d.ts +1 -1
  21. package/build/blocks/form/form-field/types.d.ts.map +1 -1
  22. package/build/blocks/gallery/gallery-item/index.d.ts +1 -1
  23. package/build/blocks/gallery/gallery-item/index.d.ts.map +1 -1
  24. package/build/blocks/groups/banner-group/index.d.ts +1 -1
  25. package/build/blocks/groups/banner-group/index.d.ts.map +1 -1
  26. package/build/blocks/groups/banner-group/types.d.ts +2 -2
  27. package/build/blocks/groups/banner-group/types.d.ts.map +1 -1
  28. package/build/blocks/groups/basic-header-group/edit.d.ts.map +1 -1
  29. package/build/blocks/groups/basic-header-group/edit.js +8 -3
  30. package/build/blocks/groups/basic-header-group/factory.js +1 -1
  31. package/build/blocks/groups/basic-header-group/types.d.ts +2 -0
  32. package/build/blocks/groups/basic-header-group/types.d.ts.map +1 -1
  33. package/build/blocks/groups/text-and-media-group/constants.d.ts +25 -0
  34. package/build/blocks/groups/text-and-media-group/constants.d.ts.map +1 -1
  35. package/build/blocks/groups/text-and-media-group/constants.js +10 -0
  36. package/build/blocks/groups/text-and-media-group/edit.d.ts.map +1 -1
  37. package/build/blocks/groups/text-and-media-group/edit.js +16 -9
  38. package/build/blocks/groups/text-and-media-group/factory.d.ts +2 -2
  39. package/build/blocks/groups/text-and-media-group/factory.d.ts.map +1 -1
  40. package/build/blocks/groups/text-and-media-group/factory.js +12 -10
  41. package/build/blocks/groups/text-and-media-group/types.d.ts +8 -3
  42. package/build/blocks/groups/text-and-media-group/types.d.ts.map +1 -1
  43. package/build/blocks/hero/hero-group/constants.d.ts +16 -0
  44. package/build/blocks/hero/hero-group/constants.d.ts.map +1 -1
  45. package/build/blocks/hero/hero-group/constants.js +7 -0
  46. package/build/blocks/hero/hero-group/edit.d.ts.map +1 -1
  47. package/build/blocks/hero/hero-group/edit.js +6 -5
  48. package/build/blocks/hero/hero-group/factory.d.ts +2 -2
  49. package/build/blocks/hero/hero-group/factory.d.ts.map +1 -1
  50. package/build/blocks/hero/hero-group/factory.js +11 -5
  51. package/build/blocks/hero/hero-group/types.d.ts +7 -4
  52. package/build/blocks/hero/hero-group/types.d.ts.map +1 -1
  53. package/build/blocks/hero/hero-item/edit.d.ts.map +1 -1
  54. package/build/blocks/hero/hero-item/edit.js +7 -2
  55. package/build/blocks/hero/hero-item/factory.d.ts.map +1 -1
  56. package/build/blocks/hero/hero-item/factory.js +1 -0
  57. package/build/blocks/hero/hero-item/types.d.ts +12 -2
  58. package/build/blocks/hero/hero-item/types.d.ts.map +1 -1
  59. package/build/blocks/link/link-item/factory.d.ts +1 -1
  60. package/build/blocks/link/link-item/factory.d.ts.map +1 -1
  61. package/build/blocks/map/map-group/types.d.ts +3 -3
  62. package/build/blocks/map/map-group/types.d.ts.map +1 -1
  63. package/build/blocks/newsletter/newsletter-form/types.d.ts +1 -1
  64. package/build/blocks/newsletter/newsletter-form/types.d.ts.map +1 -1
  65. package/build/blocks/person/person-group/types.d.ts +1 -1
  66. package/build/blocks/person/person-group/types.d.ts.map +1 -1
  67. package/build/blocks/person/person-item/constants.d.ts.map +1 -1
  68. package/build/blocks/person/person-item/types.d.ts +2 -2
  69. package/build/blocks/person/person-item/types.d.ts.map +1 -1
  70. package/build/blocks/priceplan/priceplan-group/constants.d.ts +2 -0
  71. package/build/blocks/priceplan/priceplan-group/constants.d.ts.map +1 -0
  72. package/build/blocks/priceplan/priceplan-group/constants.js +1 -0
  73. package/build/blocks/priceplan/priceplan-group/edit.d.ts +3 -0
  74. package/build/blocks/priceplan/priceplan-group/edit.d.ts.map +1 -0
  75. package/build/blocks/priceplan/priceplan-group/edit.js +16 -0
  76. package/build/blocks/priceplan/priceplan-group/factory.d.ts +5 -0
  77. package/build/blocks/priceplan/priceplan-group/factory.d.ts.map +1 -0
  78. package/build/blocks/priceplan/priceplan-group/factory.js +20 -0
  79. package/build/blocks/priceplan/priceplan-group/icon.d.ts +2 -0
  80. package/build/blocks/priceplan/priceplan-group/icon.d.ts.map +1 -0
  81. package/build/blocks/priceplan/priceplan-group/icon.js +2 -0
  82. package/build/blocks/priceplan/priceplan-group/index.d.ts +5 -0
  83. package/build/blocks/priceplan/priceplan-group/index.d.ts.map +1 -0
  84. package/build/blocks/priceplan/priceplan-group/index.js +11 -0
  85. package/build/blocks/priceplan/priceplan-group/types.d.ts +7 -0
  86. package/build/blocks/priceplan/priceplan-group/types.d.ts.map +1 -0
  87. package/build/blocks/priceplan/priceplan-group/types.js +1 -0
  88. package/build/blocks/priceplan/priceplan-item/constants.d.ts +15 -0
  89. package/build/blocks/priceplan/priceplan-item/constants.d.ts.map +1 -0
  90. package/build/blocks/priceplan/priceplan-item/constants.js +9 -0
  91. package/build/blocks/priceplan/priceplan-item/edit.d.ts +6 -0
  92. package/build/blocks/priceplan/priceplan-item/edit.d.ts.map +1 -0
  93. package/build/blocks/priceplan/priceplan-item/edit.js +30 -0
  94. package/build/blocks/priceplan/priceplan-item/factory.d.ts +7 -0
  95. package/build/blocks/priceplan/priceplan-item/factory.d.ts.map +1 -0
  96. package/build/blocks/priceplan/priceplan-item/factory.js +70 -0
  97. package/build/blocks/priceplan/priceplan-item/icon.d.ts +2 -0
  98. package/build/blocks/priceplan/priceplan-item/icon.d.ts.map +1 -0
  99. package/build/blocks/priceplan/priceplan-item/icon.js +2 -0
  100. package/build/blocks/priceplan/priceplan-item/index.d.ts +5 -0
  101. package/build/blocks/priceplan/priceplan-item/index.d.ts.map +1 -0
  102. package/build/blocks/priceplan/priceplan-item/index.js +12 -0
  103. package/build/blocks/priceplan/priceplan-item/types.d.ts +28 -0
  104. package/build/blocks/priceplan/priceplan-item/types.d.ts.map +1 -0
  105. package/build/blocks/priceplan/priceplan-item/types.js +1 -0
  106. package/build/blocks/priceplan/priceplan-list-item/constants.d.ts +8 -0
  107. package/build/blocks/priceplan/priceplan-list-item/constants.d.ts.map +1 -0
  108. package/build/blocks/priceplan/priceplan-list-item/constants.js +5 -0
  109. package/build/blocks/priceplan/priceplan-list-item/edit.d.ts +6 -0
  110. package/build/blocks/priceplan/priceplan-list-item/edit.d.ts.map +1 -0
  111. package/build/blocks/priceplan/priceplan-list-item/edit.js +17 -0
  112. package/build/blocks/priceplan/priceplan-list-item/factory.d.ts +7 -0
  113. package/build/blocks/priceplan/priceplan-list-item/factory.d.ts.map +1 -0
  114. package/build/blocks/priceplan/priceplan-list-item/factory.js +30 -0
  115. package/build/blocks/priceplan/priceplan-list-item/icon.d.ts +2 -0
  116. package/build/blocks/priceplan/priceplan-list-item/icon.d.ts.map +1 -0
  117. package/build/blocks/priceplan/priceplan-list-item/icon.js +2 -0
  118. package/build/blocks/priceplan/priceplan-list-item/index.d.ts +5 -0
  119. package/build/blocks/priceplan/priceplan-list-item/index.d.ts.map +1 -0
  120. package/build/blocks/priceplan/priceplan-list-item/index.js +5 -0
  121. package/build/blocks/priceplan/priceplan-list-item/types.d.ts +11 -0
  122. package/build/blocks/priceplan/priceplan-list-item/types.d.ts.map +1 -0
  123. package/build/blocks/priceplan/priceplan-list-item/types.js +1 -0
  124. package/build/blocks/review/review-group/constants.d.ts +16 -0
  125. package/build/blocks/review/review-group/constants.d.ts.map +1 -0
  126. package/build/blocks/review/review-group/constants.js +16 -0
  127. package/build/blocks/review/review-group/edit.d.ts +4 -0
  128. package/build/blocks/review/review-group/edit.d.ts.map +1 -0
  129. package/build/blocks/review/review-group/edit.js +28 -0
  130. package/build/blocks/review/review-group/factory.d.ts +7 -0
  131. package/build/blocks/review/review-group/factory.d.ts.map +1 -0
  132. package/build/blocks/review/review-group/factory.js +36 -0
  133. package/build/blocks/review/review-group/icon.d.ts +2 -0
  134. package/build/blocks/review/review-group/icon.d.ts.map +1 -0
  135. package/build/blocks/review/review-group/icon.js +2 -0
  136. package/build/blocks/review/review-group/index.d.ts +5 -0
  137. package/build/blocks/review/review-group/index.d.ts.map +1 -0
  138. package/build/blocks/review/review-group/index.js +6 -0
  139. package/build/blocks/review/review-group/types.d.ts +15 -0
  140. package/build/blocks/review/review-group/types.d.ts.map +1 -0
  141. package/build/blocks/review/review-group/types.js +1 -0
  142. package/build/blocks/review/review-item/constants.d.ts +2 -0
  143. package/build/blocks/review/review-item/constants.d.ts.map +1 -0
  144. package/build/blocks/review/review-item/constants.js +1 -0
  145. package/build/blocks/review/review-item/edit.d.ts +4 -0
  146. package/build/blocks/review/review-item/edit.d.ts.map +1 -0
  147. package/build/blocks/review/review-item/edit.js +29 -0
  148. package/build/blocks/review/review-item/factory.d.ts +5 -0
  149. package/build/blocks/review/review-item/factory.d.ts.map +1 -0
  150. package/build/blocks/review/review-item/factory.js +36 -0
  151. package/build/blocks/review/review-item/icon.d.ts +2 -0
  152. package/build/blocks/review/review-item/icon.d.ts.map +1 -0
  153. package/build/blocks/review/review-item/icon.js +2 -0
  154. package/build/blocks/review/review-item/index.d.ts +5 -0
  155. package/build/blocks/review/review-item/index.d.ts.map +1 -0
  156. package/build/blocks/review/review-item/index.js +5 -0
  157. package/build/blocks/review/review-item/types.d.ts +17 -0
  158. package/build/blocks/review/review-item/types.d.ts.map +1 -0
  159. package/build/blocks/review/review-item/types.js +1 -0
  160. package/build/blocks/sections/base-section/attributes.d.ts +25 -0
  161. package/build/blocks/sections/base-section/attributes.d.ts.map +1 -1
  162. package/build/blocks/sections/base-section/attributes.js +9 -0
  163. package/build/blocks/sections/base-section/controls.d.ts.map +1 -1
  164. package/build/blocks/sections/base-section/controls.js +46 -2
  165. package/build/blocks/sections/base-section/types.d.ts +24 -1
  166. package/build/blocks/sections/base-section/types.d.ts.map +1 -1
  167. package/build/blocks/share/share/index.d.ts.map +1 -1
  168. package/build/blocks/share/share/index.js +1 -0
  169. package/build/blocks/signpost/signpost-group/constants.d.ts +26 -0
  170. package/build/blocks/signpost/signpost-group/constants.d.ts.map +1 -1
  171. package/build/blocks/signpost/signpost-group/constants.js +21 -0
  172. package/build/blocks/signpost/signpost-group/edit.d.ts.map +1 -1
  173. package/build/blocks/signpost/signpost-group/edit.js +13 -8
  174. package/build/blocks/signpost/signpost-group/factory.d.ts.map +1 -1
  175. package/build/blocks/signpost/signpost-group/factory.js +5 -1
  176. package/build/blocks/signpost/signpost-group/types.d.ts +5 -1
  177. package/build/blocks/signpost/signpost-group/types.d.ts.map +1 -1
  178. package/build/blocks/step/step-group/edit.d.ts +1 -1
  179. package/build/blocks/step/step-group/edit.d.ts.map +1 -1
  180. package/build/blocks/step/step-group/factory.d.ts +1 -1
  181. package/build/blocks/step/step-group/factory.d.ts.map +1 -1
  182. package/build/blocks/step/step-group/types.d.ts +2 -2
  183. package/build/blocks/step/step-group/types.d.ts.map +1 -1
  184. package/build/blocks/step/step-item/types.d.ts +1 -1
  185. package/build/blocks/step/step-item/types.d.ts.map +1 -1
  186. package/build/blocks/testimonial/testimonial-group/index.d.ts +1 -1
  187. package/build/blocks/testimonial/testimonial-group/index.d.ts.map +1 -1
  188. package/build/blocks/testimonial/testimonial-group/types.d.ts +1 -1
  189. package/build/blocks/testimonial/testimonial-group/types.d.ts.map +1 -1
  190. package/build/blocks/text-and-form/text-and-form-text-column/edit.d.ts.map +1 -1
  191. package/build/blocks/text-and-form/text-and-form-text-column/edit.js +9 -2
  192. package/build/blocks/text-and-form/text-and-form-text-column/factory.js +1 -1
  193. package/build/blocks/text-and-form/text-and-form-text-column/types.d.ts +2 -0
  194. package/build/blocks/text-and-form/text-and-form-text-column/types.d.ts.map +1 -1
  195. package/build/blocks/usp/usp-item/types.d.ts +1 -1
  196. package/build/blocks/usp/usp-item/types.d.ts.map +1 -1
  197. package/build/blocks/video/video-group/constants.d.ts +15 -0
  198. package/build/blocks/video/video-group/constants.d.ts.map +1 -0
  199. package/build/blocks/video/video-group/constants.js +9 -0
  200. package/build/blocks/video/video-group/edit.d.ts +4 -0
  201. package/build/blocks/video/video-group/edit.d.ts.map +1 -0
  202. package/build/blocks/video/video-group/edit.js +23 -0
  203. package/build/blocks/video/video-group/factory.d.ts +5 -0
  204. package/build/blocks/video/video-group/factory.d.ts.map +1 -0
  205. package/build/blocks/video/video-group/factory.js +47 -0
  206. package/build/blocks/video/video-group/icon.d.ts +2 -0
  207. package/build/blocks/video/video-group/icon.d.ts.map +1 -0
  208. package/build/blocks/video/video-group/icon.js +2 -0
  209. package/build/blocks/video/video-group/index.d.ts +5 -0
  210. package/build/blocks/video/video-group/index.d.ts.map +1 -0
  211. package/build/blocks/video/video-group/index.js +5 -0
  212. package/build/blocks/video/video-group/types.d.ts +19 -0
  213. package/build/blocks/video/video-group/types.d.ts.map +1 -0
  214. package/build/blocks/video/video-group/types.js +1 -0
  215. package/build/components/Document/DocumentTermSelectModal.js +1 -1
  216. package/build/components/EntitySelectModal/EntitySelectModal.d.ts.map +1 -0
  217. package/build/components/Event/EventSelectModal.js +1 -1
  218. package/build/components/Event/EventTermSelectModal.js +1 -1
  219. package/build/components/Post/PostSelectModal.js +1 -1
  220. package/build/components/Post/PostTermSelectModal.js +1 -1
  221. package/build/index.d.ts +12 -0
  222. package/build/index.d.ts.map +1 -1
  223. package/build/index.js +6 -0
  224. package/build/types.d.ts +1 -1
  225. package/build/types.d.ts.map +1 -1
  226. package/package.json +1 -1
  227. package/src/blocks/compare/compare-group/types.ts +1 -1
  228. package/src/blocks/compare/compare-option/types.ts +1 -1
  229. package/src/blocks/core/basic-button/edit.tsx +29 -18
  230. package/src/blocks/core/basic-button/factory.tsx +1 -0
  231. package/src/blocks/core/basic-button/types.ts +1 -0
  232. package/src/blocks/core/basic-overline/edit.tsx +8 -0
  233. package/src/blocks/core/basic-overline/factory.tsx +2 -0
  234. package/src/blocks/core/basic-overline/types.ts +3 -1
  235. package/src/blocks/form/form-field/edit.tsx +1 -1
  236. package/src/blocks/form/form-field/types.ts +4 -4
  237. package/src/blocks/form/form-group/editor.scss +1 -0
  238. package/src/blocks/gallery/gallery-item/index.ts +1 -1
  239. package/src/blocks/groups/banner-group/index.ts +1 -1
  240. package/src/blocks/groups/banner-group/types.ts +2 -2
  241. package/src/blocks/groups/basic-header-group/edit.tsx +25 -1
  242. package/src/blocks/groups/basic-header-group/factory.tsx +1 -1
  243. package/src/blocks/groups/basic-header-group/types.ts +1 -1
  244. package/src/blocks/groups/text-and-media-group/constants.ts +11 -0
  245. package/src/blocks/groups/text-and-media-group/edit.tsx +37 -2
  246. package/src/blocks/groups/text-and-media-group/editor.scss +50 -4
  247. package/src/blocks/groups/text-and-media-group/factory.tsx +10 -4
  248. package/src/blocks/groups/text-and-media-group/types.ts +7 -1
  249. package/src/blocks/hero/hero-group/constants.ts +8 -0
  250. package/src/blocks/hero/hero-group/edit.tsx +16 -4
  251. package/src/blocks/hero/hero-group/factory.tsx +13 -4
  252. package/src/blocks/hero/hero-group/types.ts +15 -3
  253. package/src/blocks/hero/hero-item/edit.tsx +42 -2
  254. package/src/blocks/hero/hero-item/editor.scss +13 -0
  255. package/src/blocks/hero/hero-item/factory.tsx +1 -0
  256. package/src/blocks/hero/hero-item/types.ts +4 -2
  257. package/src/blocks/link/link-item/factory.tsx +1 -1
  258. package/src/blocks/map/map-group/types.ts +3 -3
  259. package/src/blocks/newsletter/newsletter-form/types.ts +1 -1
  260. package/src/blocks/person/person-group/types.ts +1 -1
  261. package/src/blocks/person/person-item/constants.ts +0 -3
  262. package/src/blocks/person/person-item/types.ts +2 -2
  263. package/src/blocks/priceplan/priceplan-group/constants.ts +1 -0
  264. package/src/blocks/priceplan/priceplan-group/edit.tsx +21 -0
  265. package/src/blocks/priceplan/priceplan-group/editor.scss +3 -0
  266. package/src/blocks/priceplan/priceplan-group/factory.tsx +23 -0
  267. package/src/blocks/priceplan/priceplan-group/icon.tsx +36 -0
  268. package/src/blocks/priceplan/priceplan-group/index.ts +15 -0
  269. package/src/blocks/priceplan/priceplan-group/types.ts +7 -0
  270. package/src/blocks/priceplan/priceplan-item/constants.ts +11 -0
  271. package/src/blocks/priceplan/priceplan-item/edit.tsx +158 -0
  272. package/src/blocks/priceplan/priceplan-item/editor.scss +131 -0
  273. package/src/blocks/priceplan/priceplan-item/factory.tsx +80 -0
  274. package/src/blocks/priceplan/priceplan-item/icon.tsx +9 -0
  275. package/src/blocks/priceplan/priceplan-item/index.ts +16 -0
  276. package/src/blocks/priceplan/priceplan-item/types.ts +34 -0
  277. package/src/blocks/priceplan/priceplan-list-item/constants.ts +6 -0
  278. package/src/blocks/priceplan/priceplan-list-item/edit.tsx +59 -0
  279. package/src/blocks/priceplan/priceplan-list-item/editor.scss +21 -0
  280. package/src/blocks/priceplan/priceplan-list-item/factory.tsx +38 -0
  281. package/src/blocks/priceplan/priceplan-list-item/icon.tsx +9 -0
  282. package/src/blocks/priceplan/priceplan-list-item/index.ts +9 -0
  283. package/src/blocks/priceplan/priceplan-list-item/types.ts +13 -0
  284. package/src/blocks/review/review-group/constants.ts +19 -0
  285. package/src/blocks/review/review-group/edit.tsx +72 -0
  286. package/src/blocks/review/review-group/editor.scss +10 -0
  287. package/src/blocks/review/review-group/factory.tsx +43 -0
  288. package/src/blocks/review/review-group/icon.tsx +12 -0
  289. package/src/blocks/review/review-group/index.ts +10 -0
  290. package/src/blocks/review/review-group/types.ts +17 -0
  291. package/src/blocks/review/review-item/constants.ts +1 -0
  292. package/src/blocks/review/review-item/edit.tsx +126 -0
  293. package/src/blocks/review/review-item/editor.scss +96 -0
  294. package/src/blocks/review/review-item/factory.tsx +40 -0
  295. package/src/blocks/review/review-item/icon.tsx +9 -0
  296. package/src/blocks/review/review-item/index.ts +9 -0
  297. package/src/blocks/review/review-item/types.ts +19 -0
  298. package/src/blocks/sections/base-section/attributes.ts +9 -0
  299. package/src/blocks/sections/base-section/controls.tsx +97 -1
  300. package/src/blocks/sections/base-section/types.ts +9 -1
  301. package/src/blocks/share/share/index.ts +1 -0
  302. package/src/blocks/signpost/signpost-group/constants.ts +23 -0
  303. package/src/blocks/signpost/signpost-group/edit.tsx +25 -4
  304. package/src/blocks/signpost/signpost-group/factory.tsx +5 -1
  305. package/src/blocks/signpost/signpost-group/types.ts +4 -1
  306. package/src/blocks/signpost/signpost-item/editor.scss +5 -0
  307. package/src/blocks/step/step-group/edit.tsx +1 -1
  308. package/src/blocks/step/step-group/factory.tsx +1 -1
  309. package/src/blocks/step/step-group/types.ts +2 -2
  310. package/src/blocks/step/step-item/types.ts +1 -1
  311. package/src/blocks/testimonial/testimonial-group/index.ts +1 -1
  312. package/src/blocks/testimonial/testimonial-group/types.ts +1 -1
  313. package/src/blocks/text-and-form/text-and-form-text-column/edit.tsx +31 -0
  314. package/src/blocks/text-and-form/text-and-form-text-column/editor.scss +8 -4
  315. package/src/blocks/text-and-form/text-and-form-text-column/factory.tsx +1 -1
  316. package/src/blocks/text-and-form/text-and-form-text-column/types.ts +1 -1
  317. package/src/blocks/usp/usp-item/types.ts +1 -1
  318. package/src/blocks/video/video-group/constants.ts +11 -0
  319. package/src/blocks/video/video-group/edit.tsx +158 -0
  320. package/src/blocks/video/video-group/editor.scss +105 -0
  321. package/src/blocks/video/video-group/factory.tsx +51 -0
  322. package/src/blocks/video/video-group/icon.tsx +17 -0
  323. package/src/blocks/video/video-group/index.ts +9 -0
  324. package/src/blocks/video/video-group/types.ts +21 -0
  325. package/src/components/Document/DocumentTermSelectModal.tsx +1 -1
  326. package/src/components/Event/EventSelectModal.tsx +1 -1
  327. package/src/components/Event/EventTermSelectModal.tsx +1 -1
  328. package/src/components/ImagePicker/ImagePicker.tsx +1 -1
  329. package/src/components/Post/PostSelectModal.tsx +1 -1
  330. package/src/components/Post/PostTermSelectModal.tsx +1 -1
  331. package/src/editor.scss +6 -0
  332. package/src/index.ts +12 -0
  333. package/src/types.ts +1 -1
  334. package/build/components/Event/EntitySelectModal.d.ts.map +0 -1
  335. /package/build/components/{Event → EntitySelectModal}/EntitySelectModal.d.ts +0 -0
  336. /package/build/components/{Event → EntitySelectModal}/EntitySelectModal.js +0 -0
  337. /package/src/components/{Event → EntitySelectModal}/EntitySelectModal.tsx +0 -0
@@ -7,6 +7,19 @@
7
7
  margin-top: 0;
8
8
  }
9
9
 
10
+ .i-hero__overline {
11
+ display: inline-flex;
12
+ font-size: 11px;
13
+ font-weight: 600;
14
+ text-transform: uppercase;
15
+ letter-spacing: 1.5px;
16
+ color: #555;
17
+ background-color: #f0f0f0;
18
+ border-radius: 100px;
19
+ padding: 3px 10px;
20
+ margin-bottom: 8px;
21
+ }
22
+
10
23
  .i-hero__overlay {
11
24
  position: absolute;
12
25
  padding: 2rem;
@@ -21,6 +21,7 @@ export function createHeroItemBlock(options: HeroItemOptions): BlockConfiguratio
21
21
  attributes: {
22
22
  title: {type: 'string', default: ''},
23
23
  titleColor: {type: 'string', default: ''},
24
+ overline: {type: 'object', default: {title: '', color: '', background: ''}},
24
25
  img: {
25
26
  type: 'object',
26
27
  default: {id: 0, url: '', alt: ''},
@@ -1,5 +1,5 @@
1
- import {BriloBlockType, Media, OptionArray} from '~/types'
2
- import {CONTENT_POSITIONS, HEADING_LEVELS} from './constants'
1
+ import type {BriloBlockType, Media, OptionArray} from '~/types'
2
+ import type {CONTENT_POSITIONS, HEADING_LEVELS} from './constants'
3
3
 
4
4
  export type ContentPosition = (typeof CONTENT_POSITIONS)[number]['value']
5
5
  export type HeadingLevel = (typeof HEADING_LEVELS)[number]
@@ -11,6 +11,7 @@ export type HeroItemUrl = {
11
11
 
12
12
  export type HeroSliderItem = {
13
13
  title: string
14
+ overline: {title: string; color?: string; background?: string}
14
15
  img: Media
15
16
  headingLevel: number
16
17
  contentPosition: ContentPosition
@@ -27,6 +28,7 @@ export type HeroItemFocalPoint = {
27
28
  export interface HeroItemAttributes extends Record<string, unknown> {
28
29
  title: string
29
30
  titleColor: string
31
+ overline: {title: string; color?: string; background?: string}
30
32
  img: Media
31
33
  headingLevel: number
32
34
  contentPosition: ContentPosition
@@ -1,4 +1,4 @@
1
- import {type BlockConfiguration} from '@wordpress/blocks'
1
+ import type {BlockConfiguration} from '@wordpress/blocks'
2
2
  import {__} from '@wordpress/i18n'
3
3
  import {createLinkItemEdit} from './edit'
4
4
  import {icon as defaultIcon} from './icon'
@@ -1,6 +1,6 @@
1
- import {BriloBlockType, Media, type OptionArray, type StringArray} from '~/types'
2
- import {DEFAULT_HEADING_STYLES, MAP_TYPES} from './constants'
3
- import {HEADING_LEVELS} from '~/constants'
1
+ import type {BriloBlockType, Media, OptionArray, StringArray} from '~/types'
2
+ import type {DEFAULT_HEADING_STYLES, MAP_TYPES} from './constants'
3
+ import type {HEADING_LEVELS} from '~/constants'
4
4
 
5
5
  export type MapType = (typeof MAP_TYPES)[number]['value']
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type {BriloBlockType, Icon, StringArray} from '~/types'
2
2
  import type {IconType} from '~/components/IconControl'
3
- import {DEFAULT_HEADING_STYLES, NEWSLETTER_LEVELS} from './constants'
3
+ import type {DEFAULT_HEADING_STYLES, NEWSLETTER_LEVELS} from './constants'
4
4
 
5
5
  export type HeadingLevels = (typeof NEWSLETTER_LEVELS)[number]
6
6
  export type HeadingStyles = (typeof DEFAULT_HEADING_STYLES)[number]
@@ -1,4 +1,4 @@
1
- import {BriloBlockType} from '~/types'
1
+ import type {BriloBlockType} from '~/types'
2
2
 
3
3
  export interface PersonGroupAttributes extends Record<string, unknown> {
4
4
  columns: number
@@ -1,4 +1 @@
1
1
  import {__} from '@wordpress/i18n'
2
-
3
- // No item-specific constants yet, but file is required by anatomy
4
- export {}
@@ -1,5 +1,5 @@
1
- import {BriloBlockType} from '~/types'
2
- import {ImageValue} from '~/components/ImagePicker/ImagePicker'
1
+ import type {BriloBlockType} from '~/types'
2
+ import type {ImageValue} from '~/components/ImagePicker/ImagePicker'
3
3
 
4
4
  export interface PersonItemAttributes extends Record<string, unknown> {
5
5
  title: string
@@ -0,0 +1 @@
1
+ export const PRICEPLAN_GROUP_DEFAULTS = {} as const
@@ -0,0 +1,21 @@
1
+ import {useGroupBlock} from '~/hooks/useGroupBlock'
2
+ import type {PriceplanGroupOptions} from './types'
3
+
4
+ export function createPriceplanGroupEdit(options: PriceplanGroupOptions) {
5
+ return function Edit() {
6
+ const {blockProps, innerBlocksProps} = useGroupBlock({
7
+ blockClassName: options.blockClassName ?? 'g-priceplan wp-block-section',
8
+ containerClassName: [options.containerClassName ?? 'u-grid-responsive-blocks-list --cols-3'],
9
+ allowedBlocks: options.allowedBlocks,
10
+ orientation: 'horizontal',
11
+ template: options.template,
12
+ layout: {type: 'default'},
13
+ })
14
+
15
+ return (
16
+ <div {...blockProps}>
17
+ <div {...innerBlocksProps} />
18
+ </div>
19
+ )
20
+ }
21
+ }
@@ -0,0 +1,3 @@
1
+ .g-priceplan {
2
+ padding: 8px;
3
+ }
@@ -0,0 +1,23 @@
1
+ import {InnerBlocks} from '@wordpress/block-editor'
2
+ import type {BlockConfiguration} from '@wordpress/blocks'
3
+ import {__} from '@wordpress/i18n'
4
+ import {createPriceplanGroupEdit} from './edit'
5
+ import {icon as defaultIcon} from './icon'
6
+ import type {PriceplanGroupAttributes, PriceplanGroupOptions} from './types'
7
+
8
+ export type {PriceplanGroupAttributes, PriceplanGroupOptions}
9
+
10
+ export function createPriceplanGroupBlock(options: PriceplanGroupOptions): BlockConfiguration<PriceplanGroupAttributes> {
11
+ return {
12
+ name: options.name,
13
+ title: options.title ?? __('Ceník skupina', 'brilo-blocks'),
14
+ description: options.description ?? __('Skupina ceníkových karet (max 3 položky)', 'brilo-blocks'),
15
+ category: options.category ?? 'layout',
16
+ ...(options.parent && {parent: options.parent}),
17
+ icon: options.icon ?? {src: defaultIcon},
18
+ supports: {html: false, customClassName: false},
19
+ attributes: {},
20
+ edit: createPriceplanGroupEdit(options),
21
+ save: () => <InnerBlocks.Content />,
22
+ } as unknown as BlockConfiguration<PriceplanGroupAttributes>
23
+ }
@@ -0,0 +1,36 @@
1
+ export const icon = (
2
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <title>Priceplan Group</title>
4
+ <path d="M4 4H8V5H4V4Z" fill="currentColor" />
5
+ <path d="M9 4H16V5H9V4Z" fill="currentColor" />
6
+ <path
7
+ d="M12 2C12 1.44772 12.4477 1 13 1H14C14.5523 1 15 1.44772 15 2C15 2.55228 14.5523 3 14 3H13C12.4477 3 12 2.55228 12 2Z"
8
+ fill="currentColor"
9
+ />
10
+ <path
11
+ d="M5 2C5 1.44772 5.44772 1 6 1H10C10.5523 1 11 1.44772 11 2C11 2.55228 10.5523 3 10 3H6C5.44772 3 5 2.55228 5 2Z"
12
+ fill="currentColor"
13
+ />
14
+ <rect x="13.5" y="8.5" width="6" height="10" stroke="currentColor" fill="none" />
15
+ <path
16
+ d="M15 11.5C15 10.6716 15.6716 10 16.5 10C17.3284 10 18 10.6716 18 11.5C18 12.3284 17.3284 13 16.5 13C15.6716 13 15 12.3284 15 11.5Z"
17
+ fill="#357AB5"
18
+ />
19
+ <rect x="0.5" y="8.5" width="6" height="10" stroke="currentColor" fill="none" />
20
+ <path
21
+ d="M2 11.5C2 10.6716 2.67157 10 3.5 10C4.32843 10 5 10.6716 5 11.5C5 12.3284 4.32843 13 3.5 13C2.67157 13 2 12.3284 2 11.5Z"
22
+ fill="#357AB5"
23
+ />
24
+ <path d="M2 14H5V15H2V14Z" fill="currentColor" />
25
+ <path d="M2 16H5V17H2V16Z" fill="currentColor" />
26
+ <rect x="6.5" y="7.5" width="7" height="12" stroke="currentColor" fill="none" />
27
+ <path
28
+ d="M8 11C8 9.89543 8.89543 9 10 9C11.1046 9 12 9.89543 12 11C12 12.1046 11.1046 13 10 13C8.89543 13 8 12.1046 8 11Z"
29
+ fill="#357AB5"
30
+ />
31
+ <path d="M8 14H12V15H8V14Z" fill="currentColor" />
32
+ <path d="M8 16H12V17H8V16Z" fill="currentColor" />
33
+ <path d="M15 14H18V15H15V14Z" fill="currentColor" />
34
+ <path d="M15 16H18V17H15V16Z" fill="currentColor" />
35
+ </svg>
36
+ )
@@ -0,0 +1,15 @@
1
+ import type {PriceplanGroupOptions} from './types'
2
+
3
+ export type {PriceplanGroupAttributes, PriceplanGroupOptions} from './types'
4
+ export {createPriceplanGroupBlock} from './factory'
5
+
6
+ export const priceplanGroupDefaults: PriceplanGroupOptions = {
7
+ name: 'brilo/priceplan-group',
8
+ parent: ['brilo/base-section'],
9
+ allowedBlocks: ['brilo/priceplan-item'],
10
+ template: [
11
+ ['brilo/priceplan-item', {}],
12
+ ['brilo/priceplan-item', {}],
13
+ ['brilo/priceplan-item', {}],
14
+ ],
15
+ }
@@ -0,0 +1,7 @@
1
+ import type {BriloBlockType} from '~/types'
2
+
3
+ export interface PriceplanGroupAttributes extends Record<string, unknown> {}
4
+
5
+ export interface PriceplanGroupOptions extends BriloBlockType {
6
+ allowedBlocks?: string[]
7
+ }
@@ -0,0 +1,11 @@
1
+ import {__} from '@wordpress/i18n'
2
+
3
+ export const ALIGNMENTS = [
4
+ {value: 'left', label: __('Vlevo', 'brilo-blocks')},
5
+ {value: 'center', label: __('Na střed', 'brilo-blocks')},
6
+ ] as const
7
+
8
+ export const CHIP_VARIANTS = [
9
+ {value: 'primary', label: __('Primární', 'brilo-blocks')},
10
+ {value: 'secondary', label: __('Sekundární', 'brilo-blocks')},
11
+ ] as const
@@ -0,0 +1,158 @@
1
+ import {InspectorControls, RichText, useBlockProps, useInnerBlocksProps} from '@wordpress/block-editor'
2
+ import {
3
+ PanelBody,
4
+ TextControl,
5
+ ToggleControl,
6
+ __experimentalToggleGroupControl as ToggleGroupControl,
7
+ __experimentalToggleGroupControlOption as ToggleGroupControlOption,
8
+ } from '@wordpress/components'
9
+ import {__} from '@wordpress/i18n'
10
+ import clsx from 'clsx'
11
+ import {ImagePickerBody, ImagePickerControl, useMediaUrl} from '~/components/ImagePicker'
12
+ import {ALIGNMENTS, CHIP_VARIANTS} from './constants'
13
+ import type {PriceplanAlignment, PriceplanChipVariant, PriceplanItemAttributes, PriceplanItemOptions} from './types'
14
+
15
+ export function createPriceplanItemEdit(options: PriceplanItemOptions) {
16
+ const ALIGNMENTS_OPTIONS = options.alignments ?? ALIGNMENTS
17
+ const CHIP_VARIANTS_OPTIONS = options.chipVariants ?? CHIP_VARIANTS
18
+
19
+ return function Edit({
20
+ attributes,
21
+ setAttributes,
22
+ }: {
23
+ attributes: PriceplanItemAttributes
24
+ setAttributes: (a: Partial<PriceplanItemAttributes>) => void
25
+ }) {
26
+ const {title, description, alignment, img, price, highlighted, chip, footer} = attributes
27
+ const chipIconUrl = useMediaUrl(chip?.icon?.id)
28
+
29
+ const blockProps = useBlockProps({
30
+ className: clsx('i-priceplan', `--align-${alignment}`, highlighted && '--highlighted'),
31
+ })
32
+
33
+ const innerBlocksProps = useInnerBlocksProps(
34
+ {className: 'i-priceplan__inner'},
35
+ {
36
+ allowedBlocks: options.allowedBlocks,
37
+ template: options.template,
38
+ },
39
+ )
40
+
41
+ return (
42
+ <>
43
+ <InspectorControls>
44
+ <PanelBody title={__('Karta', 'brilo-blocks')}>
45
+ <ToggleControl
46
+ label={__('Zvýrazněná karta', 'brilo-blocks')}
47
+ checked={highlighted}
48
+ onChange={(value) => setAttributes({highlighted: value})}
49
+ />
50
+ <ToggleGroupControl
51
+ label={__('Zarovnání', 'brilo-blocks')}
52
+ value={alignment}
53
+ onChange={(value) => setAttributes({alignment: value as PriceplanAlignment})}
54
+ isBlock
55
+ >
56
+ {ALIGNMENTS_OPTIONS.map((a) => (
57
+ <ToggleGroupControlOption key={a.value} value={a.value} label={a.label} />
58
+ ))}
59
+ </ToggleGroupControl>
60
+ </PanelBody>
61
+ <PanelBody title={__('Obrázek', 'brilo-blocks')} initialOpen={false}>
62
+ <ImagePickerControl value={img} onChange={(val) => setAttributes({img: val})} />
63
+ </PanelBody>
64
+ <PanelBody title={__('Chip / badge', 'brilo-blocks')} initialOpen={false}>
65
+ <TextControl
66
+ label={__('Text chipu', 'brilo-blocks')}
67
+ value={chip?.title ?? ''}
68
+ onChange={(value) => setAttributes({chip: {...chip, title: value}})}
69
+ placeholder={__('např. Doporučujeme', 'brilo-blocks')}
70
+ />
71
+ <ToggleGroupControl
72
+ label={__('Varianta chipu', 'brilo-blocks')}
73
+ value={chip?.variant ?? 'primary'}
74
+ onChange={(value) => setAttributes({chip: {...chip, variant: value as PriceplanChipVariant}})}
75
+ isBlock
76
+ >
77
+ {CHIP_VARIANTS_OPTIONS.map((v) => (
78
+ <ToggleGroupControlOption key={v.value} value={v.value} label={v.label} />
79
+ ))}
80
+ </ToggleGroupControl>
81
+ <ImagePickerControl
82
+ value={chip?.icon ?? {id: 0, alt: ''}}
83
+ onChange={(val) => setAttributes({chip: {...chip, icon: val}})}
84
+ labels={{
85
+ select: __('Vybrat ikonu chipu', 'brilo-blocks'),
86
+ change: __('Změnit ikonu', 'brilo-blocks'),
87
+ remove: __('Odebrat ikonu', 'brilo-blocks'),
88
+ }}
89
+ />
90
+ </PanelBody>
91
+ </InspectorControls>
92
+
93
+ <div {...blockProps}>
94
+ <div className="i-priceplan__wrap">
95
+ {chip?.title && (
96
+ <div className={clsx('i-priceplan__chip', `--chip-${chip.variant}`)}>
97
+ {!!chip.icon?.id && chipIconUrl && <img src={chipIconUrl} alt={chip.icon?.alt ?? ''} className="i-priceplan__chip-icon" />}
98
+ <span>{chip.title}</span>
99
+ </div>
100
+ )}
101
+
102
+ <div className="i-priceplan__header">
103
+ <RichText
104
+ tagName="h3"
105
+ className="i-priceplan__title u-text-editable"
106
+ value={title}
107
+ onChange={(value) => setAttributes({title: value})}
108
+ placeholder={__('Název balíčku...', 'brilo-blocks')}
109
+ allowedFormats={['core/bold', 'core/italic', 'brilo-blocks/text-color']}
110
+ />
111
+ <RichText
112
+ tagName="p"
113
+ className="i-priceplan__description u-text-editable"
114
+ value={description}
115
+ onChange={(value) => setAttributes({description: value})}
116
+ placeholder={__('Popis balíčku...', 'brilo-blocks')}
117
+ />
118
+ </div>
119
+
120
+ <div className="i-priceplan__image">
121
+ <ImagePickerBody value={img} onChange={(val) => setAttributes({img: val})} />
122
+ </div>
123
+
124
+ <div className="i-priceplan__price">
125
+ <RichText
126
+ tagName="p"
127
+ className="i-priceplan__price-value u-text-editable"
128
+ value={price?.value ?? ''}
129
+ onChange={(value) => setAttributes({price: {...price, value}})}
130
+ placeholder={__('od 0 Kč', 'brilo-blocks')}
131
+ allowedFormats={[]}
132
+ />
133
+ <RichText
134
+ tagName="p"
135
+ className="i-priceplan__price-footer u-text-editable"
136
+ value={price?.footer ?? ''}
137
+ onChange={(value) => setAttributes({price: {...price, footer: value}})}
138
+ placeholder={__('s DPH · po odečtení dotace...', 'brilo-blocks')}
139
+ allowedFormats={['core/bold', 'core/italic', 'core/link', 'brilo-blocks/text-color']}
140
+ />
141
+ </div>
142
+
143
+ <div {...innerBlocksProps} />
144
+
145
+ <RichText
146
+ tagName="p"
147
+ className="i-priceplan__footer u-text-editable"
148
+ value={footer}
149
+ onChange={(value) => setAttributes({footer: value})}
150
+ placeholder={__('Poznámka (volitelné)...', 'brilo-blocks')}
151
+ allowedFormats={['core/bold', 'core/italic', 'core/link', 'brilo-blocks/text-color']}
152
+ />
153
+ </div>
154
+ </div>
155
+ </>
156
+ )
157
+ }
158
+ }
@@ -0,0 +1,131 @@
1
+ .i-priceplan {
2
+ width: 100%;
3
+ overflow: hidden;
4
+ border: 1px solid #ddd;
5
+ border-radius: 8px;
6
+ background: #fff;
7
+ position: relative;
8
+
9
+ &.--highlighted {
10
+ border-color: #333;
11
+ border-width: 2px;
12
+ }
13
+
14
+ &.--align-center {
15
+ text-align: center;
16
+
17
+ .i-priceplan__wrap > .i-priceplan__chip {
18
+ align-self: center;
19
+ }
20
+ }
21
+ }
22
+
23
+ .i-priceplan__wrap {
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: 12px;
27
+ padding: 16px;
28
+ }
29
+
30
+ .i-priceplan__chip {
31
+ display: inline-flex;
32
+ align-items: center;
33
+ gap: 4px;
34
+ padding: 4px 10px;
35
+ border-radius: 20px;
36
+ font-size: 12px;
37
+ font-weight: 600;
38
+ align-self: flex-start;
39
+
40
+ &.--chip-primary {
41
+ background: #f60;
42
+ color: #fff;
43
+ }
44
+
45
+ &.--chip-secondary {
46
+ background: #eee;
47
+ color: #333;
48
+ }
49
+ }
50
+
51
+ .i-priceplan__chip-icon {
52
+ width: 14px;
53
+ height: 14px;
54
+ object-fit: contain;
55
+ }
56
+
57
+ .i-priceplan__header {
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: 4px;
61
+ }
62
+
63
+ .i-priceplan__title {
64
+ font-size: 18px;
65
+ font-weight: 700;
66
+ margin: 0;
67
+ }
68
+
69
+ .i-priceplan__description {
70
+ font-size: 13px;
71
+ color: #666;
72
+ margin: 0;
73
+ }
74
+
75
+ .i-priceplan__image {
76
+ width: 100%;
77
+
78
+ .c-image-picker-body__preview img {
79
+ width: 100%;
80
+ aspect-ratio: 16/9;
81
+ object-fit: cover;
82
+ display: block;
83
+ border-radius: 4px;
84
+ }
85
+
86
+ .c-image-picker-body__placeholder {
87
+ aspect-ratio: 16/9;
88
+ min-height: unset;
89
+ border-radius: 4px;
90
+ }
91
+ }
92
+
93
+ .i-priceplan__price {
94
+ display: flex;
95
+ flex-direction: column;
96
+ gap: 2px;
97
+ }
98
+
99
+ .i-priceplan__price-value {
100
+ font-size: 22px;
101
+ font-weight: 700;
102
+ margin: 0;
103
+ }
104
+
105
+ .i-priceplan__price-footer {
106
+ font-size: 12px;
107
+ color: #888;
108
+ margin: 0;
109
+ }
110
+
111
+ .i-priceplan__inner {
112
+ display: flex;
113
+ flex-direction: column;
114
+ gap: 4px;
115
+
116
+ > * {
117
+ margin-block: 0 !important;
118
+ }
119
+ }
120
+
121
+ .i-priceplan__wrap .g-button-group__inner {
122
+ flex-direction: column;
123
+ }
124
+
125
+ .i-priceplan__footer {
126
+ font-size: 12px;
127
+ color: #888;
128
+ margin: 0;
129
+ padding-top: 8px;
130
+ border-top: 1px solid #eee;
131
+ }
@@ -0,0 +1,80 @@
1
+ import {InnerBlocks} from '@wordpress/block-editor'
2
+ import type {BlockConfiguration} from '@wordpress/blocks'
3
+ import {__} from '@wordpress/i18n'
4
+ import type {OptionArray} from '~/types'
5
+ import {ALIGNMENTS, CHIP_VARIANTS} from './constants'
6
+ import {createPriceplanItemEdit} from './edit'
7
+ import {icon as defaultIcon} from './icon'
8
+ import type {PriceplanItemAttributes, PriceplanItemOptions} from './types'
9
+
10
+ export type {PriceplanItemAttributes, PriceplanItemOptions}
11
+
12
+ export function createPriceplanItemBlock<
13
+ TAlignments extends OptionArray = typeof ALIGNMENTS,
14
+ TChipVariants extends OptionArray = typeof CHIP_VARIANTS,
15
+ >(
16
+ options: PriceplanItemOptions<TAlignments, TChipVariants>,
17
+ ): BlockConfiguration<PriceplanItemAttributes<TAlignments[number]['value'], TChipVariants[number]['value']>> {
18
+ const alignments = options.alignments ?? ALIGNMENTS
19
+ const chipVariants = options.chipVariants ?? CHIP_VARIANTS
20
+
21
+ return {
22
+ name: options.name,
23
+ title: options.title ?? __('Ceník položka', 'brilo-blocks'),
24
+ description: options.description ?? __('Ceníková karta s cenou, seznamem funkcí a tlačítkem', 'brilo-blocks'),
25
+ category: options.category ?? 'layout',
26
+ ...(options.parent && {parent: options.parent}),
27
+ icon: options.icon ?? {src: defaultIcon},
28
+ supports: {html: false, customClassName: false},
29
+ attributes: {
30
+ title: {
31
+ type: 'string',
32
+ default: '',
33
+ },
34
+ description: {
35
+ type: 'string',
36
+ default: '',
37
+ },
38
+ alignment: {
39
+ type: 'string',
40
+ default: alignments[0].value,
41
+ enum: alignments.map((a) => a.value),
42
+ },
43
+ price: {
44
+ type: 'object',
45
+ default: {
46
+ value: '',
47
+ footer: '',
48
+ },
49
+ },
50
+ highlighted: {
51
+ type: 'boolean',
52
+ default: false,
53
+ },
54
+ chip: {
55
+ type: 'object',
56
+ default: {
57
+ title: '',
58
+ variant: chipVariants[0].value,
59
+ icon: {
60
+ id: 0,
61
+ alt: '',
62
+ },
63
+ },
64
+ },
65
+ img: {
66
+ type: 'object',
67
+ default: {
68
+ id: 0,
69
+ alt: '',
70
+ },
71
+ },
72
+ footer: {
73
+ type: 'string',
74
+ default: '',
75
+ },
76
+ },
77
+ edit: createPriceplanItemEdit(options as unknown as PriceplanItemOptions),
78
+ save: () => <InnerBlocks.Content />,
79
+ } as unknown as BlockConfiguration<PriceplanItemAttributes<TAlignments[number]['value'], TChipVariants[number]['value']>>
80
+ }
@@ -0,0 +1,9 @@
1
+ export const icon = (
2
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <title>Priceplan Item</title>
4
+ <rect x="3" y="2" width="14" height="16" rx="1.5" stroke="currentColor" strokeWidth="1.5" fill="none" />
5
+ <path d="M6 6H14" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
6
+ <path d="M6 9H11" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
7
+ <path d="M6 13H14" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
8
+ </svg>
9
+ )
@@ -0,0 +1,16 @@
1
+ import type {PriceplanItemOptions} from './types'
2
+
3
+ export type {PriceplanItemAttributes, PriceplanItemOptions} from './types'
4
+ export {createPriceplanItemBlock} from './factory'
5
+
6
+ export const priceplanItemDefaults: PriceplanItemOptions = {
7
+ name: 'brilo/priceplan-item',
8
+ parent: ['brilo/priceplan-group'],
9
+ allowedBlocks: ['brilo/priceplan-list-item', 'brilo/button-group'],
10
+ template: [
11
+ ['brilo/priceplan-list-item', {}],
12
+ ['brilo/priceplan-list-item', {}],
13
+ ['brilo/priceplan-list-item', {}],
14
+ ['brilo/button-group', {}],
15
+ ],
16
+ }
@@ -0,0 +1,34 @@
1
+ import type {ImageValue} from '~/components/ImagePicker'
2
+ import type {BriloBlockType, OptionArray} from '~/types'
3
+ import type {ALIGNMENTS, CHIP_VARIANTS} from './constants'
4
+
5
+ export type PriceplanAlignment = (typeof ALIGNMENTS)[number]['value']
6
+ export type PriceplanChipVariant = (typeof CHIP_VARIANTS)[number]['value']
7
+
8
+ export interface PriceplanItemAttributes<TAlignment extends string = PriceplanAlignment, TChipVariant extends string = PriceplanChipVariant>
9
+ extends Record<string, unknown> {
10
+ title: string
11
+ description: string
12
+ alignment: TAlignment
13
+ img: ImageValue
14
+ price: {
15
+ value: string
16
+ footer: string
17
+ }
18
+ highlighted: boolean
19
+ chip: {
20
+ title: string
21
+ variant: TChipVariant
22
+ icon: ImageValue
23
+ }
24
+ footer: string
25
+ }
26
+
27
+ export interface PriceplanItemOptions<
28
+ TAlignments extends OptionArray = typeof ALIGNMENTS,
29
+ TChipVariants extends OptionArray = typeof CHIP_VARIANTS,
30
+ > extends BriloBlockType {
31
+ allowedBlocks?: string[]
32
+ alignments?: TAlignments
33
+ chipVariants?: TChipVariants
34
+ }
@@ -0,0 +1,6 @@
1
+ import {__} from '@wordpress/i18n'
2
+
3
+ export const LIST_VARIANTS = [
4
+ {value: 'included', label: __('Zahrnuto', 'brilo-blocks')},
5
+ {value: 'excluded', label: __('Nezahrnuto', 'brilo-blocks')},
6
+ ] as const