@eightshift/frontend-libs-tailwind 1.5.0 → 2.0.1

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 (246) hide show
  1. package/.gitattributes +8 -30
  2. package/.github/workflows/ci.yml +2 -1
  3. package/CHANGELOG.md +29 -1
  4. package/bun.lock +1009 -0
  5. package/package.json +16 -26
  6. package/schemas/globalManifest.json +5 -0
  7. package/scripts/components/picker-placeholder.js +1 -1
  8. package/scripts/editor/colors.js +2 -2
  9. package/scripts/editor/options.js +1 -1
  10. package/scripts/editor/registration.js +4 -7
  11. package/scripts/editor/store.js +19 -0
  12. package/scripts/helpers/cookies.js +24 -16
  13. package/scripts/plugins/yoast-seo.js +71 -45
  14. package/webpack/base.mjs +0 -5
  15. package/webpack/helpers.mjs +1 -5
  16. package/webpack/index.mjs +0 -1
  17. package/webpack/project.mjs +0 -5
  18. package/blocks/init/assets/application-admin.js +0 -10
  19. package/blocks/init/assets/application.js +0 -13
  20. package/blocks/init/assets/fonts/fraunces-italic-latin-extended.woff2 +0 -0
  21. package/blocks/init/assets/fonts/fraunces-italic-latin.woff2 +0 -0
  22. package/blocks/init/assets/fonts/fraunces-latin-extended.woff2 +0 -0
  23. package/blocks/init/assets/fonts/fraunces-latin.woff2 +0 -0
  24. package/blocks/init/assets/fonts/noto-sans-italic-latin-extended.woff2 +0 -0
  25. package/blocks/init/assets/fonts/noto-sans-italic-latin.woff2 +0 -0
  26. package/blocks/init/assets/fonts/noto-sans-latin-extended.woff2 +0 -0
  27. package/blocks/init/assets/fonts/noto-sans-latin.woff2 +0 -0
  28. package/blocks/init/assets/images/index.js +0 -5
  29. package/blocks/init/assets/scripts/application-admin.js +0 -7
  30. package/blocks/init/assets/scripts/application.js +0 -3
  31. package/blocks/init/assets/scripts/theme-colors.js +0 -39
  32. package/blocks/init/assets/styles/application-admin.css +0 -6
  33. package/blocks/init/assets/styles/application.css +0 -3
  34. package/blocks/init/src/Blocks/assets/application-blocks-editor.js +0 -14
  35. package/blocks/init/src/Blocks/assets/application-blocks-frontend.js +0 -13
  36. package/blocks/init/src/Blocks/assets/application-blocks.js +0 -9
  37. package/blocks/init/src/Blocks/assets/scripts/application-blocks-editor.js +0 -65
  38. package/blocks/init/src/Blocks/assets/scripts/application-blocks-frontend.js +0 -24
  39. package/blocks/init/src/Blocks/assets/scripts/link-section-editor.js +0 -262
  40. package/blocks/init/src/Blocks/assets/scripts/shared.js +0 -25
  41. package/blocks/init/src/Blocks/assets/styles/application-blocks-editor.css +0 -15
  42. package/blocks/init/src/Blocks/assets/styles/application-blocks-frontend.css +0 -9
  43. package/blocks/init/src/Blocks/assets/styles/application-blocks.css +0 -1
  44. package/blocks/init/src/Blocks/assets/styles/editor/editor-overrides.css +0 -15
  45. package/blocks/init/src/Blocks/assets/styles/fonts.css +0 -90
  46. package/blocks/init/src/Blocks/assets/styles/tailwind.css +0 -30
  47. package/blocks/init/src/Blocks/components/admin-theme-options/admin-theme-options.php +0 -20
  48. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/index.js +0 -36
  49. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/pages/parts.js +0 -56
  50. package/blocks/init/src/Blocks/components/admin-theme-options/manifest.json +0 -5
  51. package/blocks/init/src/Blocks/components/button/assets/index.js +0 -22
  52. package/blocks/init/src/Blocks/components/button/button.php +0 -88
  53. package/blocks/init/src/Blocks/components/button/components/button-editor.js +0 -36
  54. package/blocks/init/src/Blocks/components/button/components/button-options.js +0 -134
  55. package/blocks/init/src/Blocks/components/button/manifest.json +0 -302
  56. package/blocks/init/src/Blocks/components/card/card.php +0 -42
  57. package/blocks/init/src/Blocks/components/card/components/card-editor.js +0 -43
  58. package/blocks/init/src/Blocks/components/card/components/card-options.js +0 -55
  59. package/blocks/init/src/Blocks/components/card/manifest.json +0 -111
  60. package/blocks/init/src/Blocks/components/head/head.php +0 -52
  61. package/blocks/init/src/Blocks/components/head/manifest.json +0 -17
  62. package/blocks/init/src/Blocks/components/heading/components/heading-editor.js +0 -26
  63. package/blocks/init/src/Blocks/components/heading/components/heading-options.js +0 -62
  64. package/blocks/init/src/Blocks/components/heading/heading.php +0 -45
  65. package/blocks/init/src/Blocks/components/heading/manifest.json +0 -76
  66. package/blocks/init/src/Blocks/components/hero/components/hero-editor.js +0 -42
  67. package/blocks/init/src/Blocks/components/hero/components/hero-options.js +0 -100
  68. package/blocks/init/src/Blocks/components/hero/hero.php +0 -45
  69. package/blocks/init/src/Blocks/components/hero/manifest.json +0 -96
  70. package/blocks/init/src/Blocks/components/icon/components/icon-editor.js +0 -23
  71. package/blocks/init/src/Blocks/components/icon/components/icon-options.js +0 -65
  72. package/blocks/init/src/Blocks/components/icon/icon.php +0 -53
  73. package/blocks/init/src/Blocks/components/icon/manifest.json +0 -1238
  74. package/blocks/init/src/Blocks/components/image/components/image-editor.js +0 -64
  75. package/blocks/init/src/Blocks/components/image/components/image-options.js +0 -111
  76. package/blocks/init/src/Blocks/components/image/image.php +0 -68
  77. package/blocks/init/src/Blocks/components/image/manifest.json +0 -125
  78. package/blocks/init/src/Blocks/components/list/components/list-editor.js +0 -30
  79. package/blocks/init/src/Blocks/components/list/components/list-options.js +0 -62
  80. package/blocks/init/src/Blocks/components/list/list.php +0 -32
  81. package/blocks/init/src/Blocks/components/list/manifest.json +0 -127
  82. package/blocks/init/src/Blocks/components/load-more/assets/index.js +0 -19
  83. package/blocks/init/src/Blocks/components/load-more/assets/load-more.js +0 -146
  84. package/blocks/init/src/Blocks/components/load-more/components/load-more-editor.js +0 -14
  85. package/blocks/init/src/Blocks/components/load-more/components/load-more-options.js +0 -19
  86. package/blocks/init/src/Blocks/components/load-more/load-more.php +0 -47
  87. package/blocks/init/src/Blocks/components/load-more/manifest.json +0 -39
  88. package/blocks/init/src/Blocks/components/modal/assets/index.js +0 -27
  89. package/blocks/init/src/Blocks/components/modal/manifest.json +0 -48
  90. package/blocks/init/src/Blocks/components/modal/modal.php +0 -46
  91. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-editor.js +0 -38
  92. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-options.js +0 -48
  93. package/blocks/init/src/Blocks/components/paragraph/manifest.json +0 -81
  94. package/blocks/init/src/Blocks/components/paragraph/paragraph.php +0 -33
  95. package/blocks/init/src/Blocks/components/post-header/manifest.json +0 -5
  96. package/blocks/init/src/Blocks/components/post-header/post-header.php +0 -24
  97. package/blocks/init/src/Blocks/components/quote/components/quote-editor.js +0 -53
  98. package/blocks/init/src/Blocks/components/quote/components/quote-options.js +0 -29
  99. package/blocks/init/src/Blocks/components/quote/manifest.json +0 -47
  100. package/blocks/init/src/Blocks/components/quote/quote.php +0 -49
  101. package/blocks/init/src/Blocks/components/share/assets/index.js +0 -39
  102. package/blocks/init/src/Blocks/components/share/components/share-editor.js +0 -28
  103. package/blocks/init/src/Blocks/components/share/components/share-options.js +0 -112
  104. package/blocks/init/src/Blocks/components/share/manifest.json +0 -72
  105. package/blocks/init/src/Blocks/components/share/share.php +0 -69
  106. package/blocks/init/src/Blocks/components/tracking-before-body-end/manifest.json +0 -5
  107. package/blocks/init/src/Blocks/components/tracking-before-body-end/tracking-before-body-end.php +0 -9
  108. package/blocks/init/src/Blocks/components/tracking-head/manifest.json +0 -5
  109. package/blocks/init/src/Blocks/components/tracking-head/tracking-head.php +0 -9
  110. package/blocks/init/src/Blocks/components/video/components/video-editor.js +0 -74
  111. package/blocks/init/src/Blocks/components/video/components/video-options.js +0 -279
  112. package/blocks/init/src/Blocks/components/video/manifest.json +0 -120
  113. package/blocks/init/src/Blocks/components/video/video.php +0 -70
  114. package/blocks/init/src/Blocks/custom/accordion/accordion-block.js +0 -15
  115. package/blocks/init/src/Blocks/custom/accordion/accordion.php +0 -28
  116. package/blocks/init/src/Blocks/custom/accordion/assets/index.js +0 -37
  117. package/blocks/init/src/Blocks/custom/accordion/components/accordion-editor.js +0 -22
  118. package/blocks/init/src/Blocks/custom/accordion/components/accordion-options.js +0 -18
  119. package/blocks/init/src/Blocks/custom/accordion/manifest.json +0 -32
  120. package/blocks/init/src/Blocks/custom/accordion-item/accordion-item-block.js +0 -19
  121. package/blocks/init/src/Blocks/custom/accordion-item/accordion-item.php +0 -46
  122. package/blocks/init/src/Blocks/custom/accordion-item/components/accordion-item-editor.js +0 -60
  123. package/blocks/init/src/Blocks/custom/accordion-item/manifest.json +0 -69
  124. package/blocks/init/src/Blocks/custom/button/button-block.js +0 -13
  125. package/blocks/init/src/Blocks/custom/button/button.php +0 -11
  126. package/blocks/init/src/Blocks/custom/button/components/button-editor.js +0 -12
  127. package/blocks/init/src/Blocks/custom/button/components/button-options.js +0 -12
  128. package/blocks/init/src/Blocks/custom/button/manifest.json +0 -18
  129. package/blocks/init/src/Blocks/custom/card/card-block.js +0 -13
  130. package/blocks/init/src/Blocks/custom/card/card.php +0 -11
  131. package/blocks/init/src/Blocks/custom/card/components/card-editor.js +0 -12
  132. package/blocks/init/src/Blocks/custom/card/components/card-options.js +0 -15
  133. package/blocks/init/src/Blocks/custom/card/manifest.json +0 -18
  134. package/blocks/init/src/Blocks/custom/carousel/assets/index.js +0 -46
  135. package/blocks/init/src/Blocks/custom/carousel/assets/navigation.js +0 -31
  136. package/blocks/init/src/Blocks/custom/carousel/assets/pagination.js +0 -40
  137. package/blocks/init/src/Blocks/custom/carousel/carousel-block.js +0 -21
  138. package/blocks/init/src/Blocks/custom/carousel/carousel.php +0 -61
  139. package/blocks/init/src/Blocks/custom/carousel/components/carousel-editor.js +0 -25
  140. package/blocks/init/src/Blocks/custom/carousel/components/carousel-options.js +0 -47
  141. package/blocks/init/src/Blocks/custom/carousel/manifest.json +0 -130
  142. package/blocks/init/src/Blocks/custom/column/column-block.js +0 -21
  143. package/blocks/init/src/Blocks/custom/column/column-hooks.js +0 -32
  144. package/blocks/init/src/Blocks/custom/column/column.php +0 -21
  145. package/blocks/init/src/Blocks/custom/column/components/column-editor.js +0 -22
  146. package/blocks/init/src/Blocks/custom/column/components/column-options.js +0 -580
  147. package/blocks/init/src/Blocks/custom/column/manifest.json +0 -625
  148. package/blocks/init/src/Blocks/custom/columns/columns-block.js +0 -20
  149. package/blocks/init/src/Blocks/custom/columns/columns.php +0 -21
  150. package/blocks/init/src/Blocks/custom/columns/components/columns-editor.js +0 -81
  151. package/blocks/init/src/Blocks/custom/columns/components/columns-options.js +0 -104
  152. package/blocks/init/src/Blocks/custom/columns/manifest.json +0 -581
  153. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-editor.js +0 -28
  154. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-options.js +0 -248
  155. package/blocks/init/src/Blocks/custom/featured-content/featured-content-block.js +0 -13
  156. package/blocks/init/src/Blocks/custom/featured-content/featured-content.php +0 -139
  157. package/blocks/init/src/Blocks/custom/featured-content/manifest.json +0 -131
  158. package/blocks/init/src/Blocks/custom/featured-content/partials/cards.php +0 -39
  159. package/blocks/init/src/Blocks/custom/group/components/group-editor.js +0 -6
  160. package/blocks/init/src/Blocks/custom/group/group-block.js +0 -14
  161. package/blocks/init/src/Blocks/custom/group/group.php +0 -10
  162. package/blocks/init/src/Blocks/custom/group/manifest.json +0 -32
  163. package/blocks/init/src/Blocks/custom/heading/components/heading-editor.js +0 -15
  164. package/blocks/init/src/Blocks/custom/heading/components/heading-options.js +0 -38
  165. package/blocks/init/src/Blocks/custom/heading/heading-block.js +0 -13
  166. package/blocks/init/src/Blocks/custom/heading/heading-transforms.js +0 -26
  167. package/blocks/init/src/Blocks/custom/heading/heading.php +0 -15
  168. package/blocks/init/src/Blocks/custom/heading/manifest.json +0 -79
  169. package/blocks/init/src/Blocks/custom/hero/components/hero-editor.js +0 -12
  170. package/blocks/init/src/Blocks/custom/hero/components/hero-options.js +0 -14
  171. package/blocks/init/src/Blocks/custom/hero/hero-block.js +0 -13
  172. package/blocks/init/src/Blocks/custom/hero/hero.php +0 -11
  173. package/blocks/init/src/Blocks/custom/hero/manifest.json +0 -17
  174. package/blocks/init/src/Blocks/custom/image/components/image-editor.js +0 -12
  175. package/blocks/init/src/Blocks/custom/image/components/image-options.js +0 -14
  176. package/blocks/init/src/Blocks/custom/image/image-block.js +0 -13
  177. package/blocks/init/src/Blocks/custom/image/image.php +0 -11
  178. package/blocks/init/src/Blocks/custom/image/manifest.json +0 -33
  179. package/blocks/init/src/Blocks/custom/list/components/list-editor.js +0 -14
  180. package/blocks/init/src/Blocks/custom/list/components/list-options.js +0 -39
  181. package/blocks/init/src/Blocks/custom/list/list-block.js +0 -13
  182. package/blocks/init/src/Blocks/custom/list/list.php +0 -15
  183. package/blocks/init/src/Blocks/custom/list/manifest.json +0 -58
  184. package/blocks/init/src/Blocks/custom/map/assets/index.js +0 -20
  185. package/blocks/init/src/Blocks/custom/map/assets/map-controller.js +0 -41
  186. package/blocks/init/src/Blocks/custom/map/assets/utils.js +0 -161
  187. package/blocks/init/src/Blocks/custom/map/components/map-components.js +0 -403
  188. package/blocks/init/src/Blocks/custom/map/components/map-editor.js +0 -56
  189. package/blocks/init/src/Blocks/custom/map/components/map-options.js +0 -550
  190. package/blocks/init/src/Blocks/custom/map/manifest.json +0 -79
  191. package/blocks/init/src/Blocks/custom/map/map-block.js +0 -13
  192. package/blocks/init/src/Blocks/custom/map/map.php +0 -52
  193. package/blocks/init/src/Blocks/custom/map/styles.css +0 -2
  194. package/blocks/init/src/Blocks/custom/modal/components/modal-editor.js +0 -90
  195. package/blocks/init/src/Blocks/custom/modal/manifest.json +0 -51
  196. package/blocks/init/src/Blocks/custom/modal/modal-block.js +0 -14
  197. package/blocks/init/src/Blocks/custom/modal/modal.php +0 -20
  198. package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-editor.js +0 -17
  199. package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-options.js +0 -38
  200. package/blocks/init/src/Blocks/custom/paragraph/manifest.json +0 -82
  201. package/blocks/init/src/Blocks/custom/paragraph/paragraph-block.js +0 -13
  202. package/blocks/init/src/Blocks/custom/paragraph/paragraph-transforms.js +0 -46
  203. package/blocks/init/src/Blocks/custom/paragraph/paragraph.php +0 -15
  204. package/blocks/init/src/Blocks/custom/quote/components/quote-editor.js +0 -12
  205. package/blocks/init/src/Blocks/custom/quote/components/quote-options.js +0 -14
  206. package/blocks/init/src/Blocks/custom/quote/manifest.json +0 -17
  207. package/blocks/init/src/Blocks/custom/quote/quote-block.js +0 -13
  208. package/blocks/init/src/Blocks/custom/quote/quote.php +0 -13
  209. package/blocks/init/src/Blocks/custom/share/components/share-editor.js +0 -6
  210. package/blocks/init/src/Blocks/custom/share/components/share-options.js +0 -12
  211. package/blocks/init/src/Blocks/custom/share/manifest.json +0 -19
  212. package/blocks/init/src/Blocks/custom/share/share-block.js +0 -13
  213. package/blocks/init/src/Blocks/custom/share/share.php +0 -11
  214. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-editor.js +0 -57
  215. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-options.js +0 -106
  216. package/blocks/init/src/Blocks/custom/site-footer/manifest.json +0 -73
  217. package/blocks/init/src/Blocks/custom/site-footer/site-footer-block.js +0 -13
  218. package/blocks/init/src/Blocks/custom/site-footer/site-footer.php +0 -74
  219. package/blocks/init/src/Blocks/custom/site-navigation/assets/index.js +0 -9
  220. package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-editor.js +0 -42
  221. package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-options.js +0 -73
  222. package/blocks/init/src/Blocks/custom/site-navigation/manifest.json +0 -77
  223. package/blocks/init/src/Blocks/custom/site-navigation/site-navigation-block.js +0 -13
  224. package/blocks/init/src/Blocks/custom/site-navigation/site-navigation.php +0 -99
  225. package/blocks/init/src/Blocks/custom/table-of-contents/assets/index.js +0 -58
  226. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-editor.js +0 -38
  227. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-options.js +0 -32
  228. package/blocks/init/src/Blocks/custom/table-of-contents/manifest.json +0 -48
  229. package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents-block.js +0 -13
  230. package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents.php +0 -31
  231. package/blocks/init/src/Blocks/custom/video/components/video-editor.js +0 -6
  232. package/blocks/init/src/Blocks/custom/video/components/video-options.js +0 -12
  233. package/blocks/init/src/Blocks/custom/video/manifest.json +0 -29
  234. package/blocks/init/src/Blocks/custom/video/video-block.js +0 -13
  235. package/blocks/init/src/Blocks/custom/video/video.php +0 -22
  236. package/blocks/init/src/Blocks/manifest.json +0 -32
  237. package/blocks/init/src/Blocks/variations/card-simple/manifest.json +0 -17
  238. package/blocks/init/src/Blocks/wrapper/components/wrapper-editor.js +0 -12
  239. package/blocks/init/src/Blocks/wrapper/components/wrapper-options.js +0 -364
  240. package/blocks/init/src/Blocks/wrapper/manifest.json +0 -459
  241. package/blocks/init/src/Blocks/wrapper/styles-editor.css +0 -13
  242. package/blocks/init/src/Blocks/wrapper/styles.css +0 -19
  243. package/blocks/init/src/Blocks/wrapper/wrapper.js +0 -27
  244. package/blocks/init/src/Blocks/wrapper/wrapper.php +0 -34
  245. package/bun.lockb +0 -0
  246. package/readme/packages.md +0 -74
@@ -1,38 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { checkAttr, getAttrKey, getOption, props } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import { HeadingOptions as OptionsComponent } from '../../../components/heading/components/heading-options';
4
- import { ColorPicker, OptionSelect } from '@eightshift/ui-components';
5
- import { getColorOption } from '../../../assets/scripts/shared';
6
- import manifest from '../manifest.json';
7
-
8
- export const HeadingOptions = ({ attributes, setAttributes }) => {
9
- const headingAlign = checkAttr('headingAlign', attributes, manifest);
10
- const headingColor = checkAttr('headingColor', attributes, manifest);
11
-
12
- return (
13
- <OptionsComponent
14
- {...props('heading', attributes, {
15
- setAttributes,
16
- })}
17
- additionalControls={
18
- <>
19
- <ColorPicker
20
- colors={getColorOption('headingColor', manifest)}
21
- onChange={(value) => setAttributes({ [getAttrKey('headingColor', attributes, manifest)]: value })}
22
- type='textColor'
23
- value={headingColor}
24
- aria-label={__('Text color', '%g_textdomain%')}
25
- />
26
-
27
- <OptionSelect
28
- value={headingAlign}
29
- onChange={(value) => setAttributes({ [getAttrKey('headingAlign', attributes, manifest)]: value })}
30
- options={getOption('headingAlign', attributes, manifest)}
31
- aria-label={__('Text alignment', '%g_textdomain%')}
32
- />
33
- </>
34
- }
35
- controlOnly
36
- />
37
- );
38
- };
@@ -1,13 +0,0 @@
1
- import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
2
- import { HeadingEditor } from './components/heading-editor';
3
- import { HeadingOptions } from './components/heading-options';
4
-
5
- export const Heading = (props) => {
6
- return (
7
- <GutenbergBlock
8
- {...props}
9
- options={HeadingOptions}
10
- editor={HeadingEditor}
11
- />
12
- );
13
- };
@@ -1,26 +0,0 @@
1
- import { createBlock } from '@wordpress/blocks';
2
- import manifest from '../../manifest.json';
3
- import manifestHeading from './manifest.json';
4
- import manifestParagraph from '../paragraph/manifest.json';
5
-
6
- export const transforms = {
7
- from: [
8
- {
9
- type: 'block',
10
- blocks: [`${manifest.namespace}/${manifestParagraph.blockName}`],
11
- transform: (attributes) => {
12
- let headingAttributes = {};
13
-
14
- for (const attribute in attributes) {
15
- if (attribute.startsWith('block')) {
16
- continue;
17
- }
18
- const attrKey = attribute.replace('paragraph', 'heading').replace('Paragraph', 'Heading');
19
- headingAttributes[attrKey] = attributes[attribute];
20
- }
21
-
22
- return createBlock(`${manifest.namespace}/${manifestHeading.blockName}`, headingAttributes);
23
- },
24
- },
25
- ],
26
- };
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Heading block template.
5
- *
6
- * @package %g_namespace%
7
- */
8
-
9
- use %g_namespace_vendor_prefix%\EightshiftLibs\Helpers\Helpers;
10
-
11
- $manifest = Helpers::getManifestByDir(__DIR__);
12
-
13
- echo Helpers::render('heading', Helpers::props('heading', $attributes, [
14
- 'additionalClass' => Helpers::tailwindClasses('base', $attributes, $manifest),
15
- ]));
@@ -1,79 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
- "blockName": "heading",
4
- "title": "Heading",
5
- "description" : "Establish a document structure by splitting it up into meaningful sections.",
6
- "category": "eightshift",
7
- "icon": {
8
- "src": "es-heading"
9
- },
10
- "keywords": [
11
- "heading",
12
- "title",
13
- "label"
14
- ],
15
- "example": {
16
- "attributes": {
17
- "headingAlign": "start"
18
- }
19
- },
20
- "attributes": {
21
- "headingAlign": {
22
- "type": "string",
23
- "default": "start"
24
- },
25
- "headingColor": {
26
- "type": "string",
27
- "default": "black"
28
- }
29
- },
30
- "components": {
31
- "heading": "heading"
32
- },
33
- "options": {
34
- "headingAlign": [
35
- {
36
- "tooltip": "Start",
37
- "value": "start",
38
- "icon": "textAlignLeft"
39
- },
40
- {
41
- "tooltip": "Center",
42
- "value": "center",
43
- "icon": "textAlignCenter"
44
- },
45
- {
46
- "tooltip": "End",
47
- "value": "end",
48
- "icon": "textAlignRight"
49
- }
50
- ],
51
- "headingColor": [
52
- "white",
53
- "black",
54
- "navy-500",
55
- "red-500",
56
- "red-50"
57
- ]
58
- },
59
- "tailwind": {
60
- "options": {
61
- "headingAlign": {
62
- "twClasses": {
63
- "start": "text-start",
64
- "center": "text-center",
65
- "end": "text-end"
66
- }
67
- },
68
- "headingColor": {
69
- "twClasses": {
70
- "black": "text-gray-900 [&>a]:text-navy-900",
71
- "white": "text-gray-50 [&>a]:text-navy-900",
72
- "navy-500": "text-navy-500 [&>a]:text-navy-900",
73
- "red-500": "text-red-500 [&>a]:text-navy-900",
74
- "red-50": "text-red-50 [&>a]:text-red-300"
75
- }
76
- }
77
- }
78
- }
79
- }
@@ -1,12 +0,0 @@
1
- import { props } from '@eightshift/frontend-libs-tailwind/scripts';
2
- import { HeroEditor as EditorComponent } from '../../../components/hero/components/hero-editor';
3
-
4
- export const HeroEditor = ({ attributes, setAttributes }) => {
5
- return (
6
- <EditorComponent
7
- {...props('hero', attributes, {
8
- setAttributes,
9
- })}
10
- />
11
- );
12
- };
@@ -1,14 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { props } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import { HeroOptions as OptionsComponent } from '../../../components/hero/components/hero-options';
4
-
5
- export const HeroOptions = ({ attributes, setAttributes }) => {
6
- return (
7
- <OptionsComponent
8
- {...props('hero', attributes, {
9
- setAttributes,
10
- })}
11
- controlOnly
12
- />
13
- );
14
- };
@@ -1,13 +0,0 @@
1
- import { HeroEditor } from './components/hero-editor';
2
- import { HeroOptions } from './components/hero-options';
3
- import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
4
-
5
- export const Hero = (props) => {
6
- return (
7
- <GutenbergBlock
8
- {...props}
9
- options={HeroOptions}
10
- editor={HeroEditor}
11
- />
12
- );
13
- };
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Hero block template.
5
- *
6
- * @package %g_namespace%
7
- */
8
-
9
- use %g_namespace_vendor_prefix%\EightshiftLibs\Helpers\Helpers;
10
-
11
- echo Helpers::render('hero', Helpers::props('hero', $attributes));
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
- "blockName": "hero",
4
- "title": "Hero",
5
- "description" : "Emphasize a section.",
6
- "category": "eightshift",
7
- "icon": {
8
- "src": "es-jumbotron"
9
- },
10
- "keywords": [
11
- "hero",
12
- "cover"
13
- ],
14
- "components": {
15
- "hero": "hero"
16
- }
17
- }
@@ -1,12 +0,0 @@
1
- import { props } from '@eightshift/frontend-libs-tailwind/scripts';
2
- import { ImageEditor as EditorComponent } from '../../../components/image/components/image-editor';
3
-
4
- export const ImageEditor = ({ attributes, setAttributes }) => {
5
- return (
6
- <EditorComponent
7
- {...props('image', attributes, {
8
- setAttributes,
9
- })}
10
- />
11
- );
12
- };
@@ -1,14 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { props } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import { ImageOptions as OptionsComponent } from '../../../components/image/components/image-options';
4
-
5
- export const ImageOptions = ({ attributes, setAttributes }) => {
6
- return (
7
- <OptionsComponent
8
- {...props('image', attributes, {
9
- setAttributes,
10
- })}
11
- controlOnly
12
- />
13
- );
14
- };
@@ -1,13 +0,0 @@
1
- import { ImageEditor } from './components/image-editor';
2
- import { ImageOptions } from './components/image-options';
3
- import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
4
-
5
- export const Image = (props) => {
6
- return (
7
- <GutenbergBlock
8
- {...props}
9
- options={ImageOptions}
10
- editor={ImageEditor}
11
- />
12
- );
13
- };
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Image block template.
5
- *
6
- * @package %g_namespace%
7
- */
8
-
9
- use %g_namespace_vendor_prefix%\EightshiftLibs\Helpers\Helpers;
10
-
11
- echo Helpers::render('image', Helpers::props('image', $attributes));
@@ -1,33 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
- "blockName": "image",
4
- "title": "Image",
5
- "description" : "Worth a 1000 words.",
6
- "category": "eightshift",
7
- "icon": {
8
- "src": "es-image"
9
- },
10
- "keywords": [
11
- "image",
12
- "picture",
13
- "img"
14
- ],
15
- "example": {
16
- "attributes": {
17
- "imageAlign": "center center"
18
- }
19
- },
20
- "attributes": {
21
- "imageAlign": {
22
- "type": "string",
23
- "default": "center center"
24
- },
25
- "wrapperDisabledOptions": {
26
- "type": "string",
27
- "default": "roundedCorners"
28
- }
29
- },
30
- "components": {
31
- "image": "image"
32
- }
33
- }
@@ -1,14 +0,0 @@
1
- import { tailwindClasses, props } from '@eightshift/frontend-libs-tailwind/scripts';
2
- import { ListEditor as EditorComponent } from '../../../components/list/components/list-editor';
3
- import manifest from '../manifest.json';
4
-
5
- export const ListEditor = ({ attributes, setAttributes }) => {
6
- return (
7
- <EditorComponent
8
- {...props('list', attributes, {
9
- setAttributes,
10
- additionalClass: tailwindClasses(attributes, manifest),
11
- })}
12
- />
13
- );
14
- };
@@ -1,39 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { props, getOption, checkAttr, getAttrKey } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import { ListOptions as OptionsComponent } from '../../../components/list/components/list-options';
4
- import { ButtonGroup, ColorPicker } from '@eightshift/ui-components';
5
- import { getColorOption } from '../../../assets/scripts/shared';
6
- import manifest from '../manifest.json';
7
-
8
- export const ListOptions = ({ attributes, setAttributes }) => {
9
- const listTextColor = checkAttr('listTextColor', attributes, manifest);
10
- const listMarkerColor = checkAttr('listMarkerColor', attributes, manifest);
11
-
12
- const colorOptions = getColorOption('listColor', manifest);
13
-
14
- return (
15
- <OptionsComponent
16
- {...props('list', attributes, {
17
- setAttributes,
18
- })}
19
- additionalControls={
20
- <ButtonGroup>
21
- <ColorPicker
22
- value={listTextColor}
23
- onChange={(value) => setAttributes({ [getAttrKey('listTextColor', attributes, manifest)]: value })}
24
- colors={colorOptions}
25
- type='textColor'
26
- />
27
- <ColorPicker
28
- value={listMarkerColor}
29
- onChange={(value) => setAttributes({ [getAttrKey('listMarkerColor', attributes, manifest)]: value })}
30
- colors={colorOptions}
31
- type='listMarkerColor'
32
- clearable
33
- />
34
- </ButtonGroup>
35
- }
36
- controlOnly
37
- />
38
- );
39
- };
@@ -1,13 +0,0 @@
1
- import { ListEditor } from './components/list-editor';
2
- import { ListOptions } from './components/list-options';
3
- import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
4
-
5
- export const List = (props) => {
6
- return (
7
- <GutenbergBlock
8
- {...props}
9
- options={ListOptions}
10
- editor={ListEditor}
11
- />
12
- );
13
- };
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * List block template.
5
- *
6
- * @package %g_namespace%
7
- */
8
-
9
- use %g_namespace_vendor_prefix%\EightshiftLibs\Helpers\Helpers;
10
-
11
- $manifest = Helpers::getManifestByDir(__DIR__);
12
-
13
- echo Helpers::render('list', Helpers::props('list', $attributes, [
14
- 'additionalClass' => Helpers::tailwindClasses('base', $attributes, $manifest),
15
- ]));
@@ -1,58 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
- "blockName": "list",
4
- "title": "List",
5
- "description" : "Add a basic list of items.",
6
- "category": "eightshift",
7
- "icon": {
8
- "src": "es-lists"
9
- },
10
- "keywords": [
11
- "list",
12
- "btn",
13
- "list"
14
- ],
15
- "components": {
16
- "list": "list"
17
- },
18
- "attributes": {
19
- "listTextColor": {
20
- "type": "string",
21
- "default": "black"
22
- },
23
- "listMarkerColor": {
24
- "type": "string"
25
- }
26
- },
27
- "options": {
28
- "listColor": [
29
- "red-500",
30
- "navy-500",
31
- "gray-500",
32
- "black",
33
- "white"
34
- ]
35
- },
36
- "tailwind": {
37
- "options": {
38
- "listMarkerColor": {
39
- "twClasses": {
40
- "red-500": "marker:text-red-500",
41
- "navy-500": "marker:text-navy-500",
42
- "gray-500": "marker:text-gray-500",
43
- "black": "marker:text-black",
44
- "white": "marker:text-white"
45
- }
46
- },
47
- "listTextColor": {
48
- "twClasses": {
49
- "red-500": "text-red-500",
50
- "navy-500": "text-navy-500",
51
- "gray-500": "text-gray-500",
52
- "black": "text-black",
53
- "white": "text-white"
54
- }
55
- }
56
- }
57
- }
58
- }
@@ -1,20 +0,0 @@
1
- import domReady from '@wordpress/dom-ready';
2
- import manifest from '../manifest.json';
3
-
4
- domReady(async () => {
5
- const { blockName } = manifest;
6
-
7
- const selector = `.js-block-${blockName}`;
8
- const elements = document.querySelectorAll(selector);
9
-
10
- if (!elements.length) {
11
- return;
12
- }
13
-
14
- const { MapController } = await import('./map-controller');
15
-
16
- elements.forEach((element) => {
17
- const map = new MapController({ element });
18
- map.init();
19
- });
20
- });
@@ -1,41 +0,0 @@
1
- import { Map, View } from 'ol';
2
- import { useGeographic } from 'ol/proj';
3
- import { processMapInteraction, processMapLayer } from './utils';
4
- import { defaults as OLDefaultInteractions } from 'ol/interaction/defaults';
5
-
6
- export class MapController {
7
- constructor(options) {
8
- this.element = options.element;
9
- }
10
-
11
- init() {
12
- useGeographic();
13
-
14
- const parsedLayers = JSON.parse(this.element?.dataset?.mapLayers ?? '');
15
- const parsedControls = JSON.parse(this.element?.dataset?.mapControls ?? '');
16
- const parsedInteractions = JSON.parse(this.element?.dataset?.mapInteractions ?? '');
17
-
18
- const parsedLat = parseFloat(this.element?.dataset?.centerLat || '46.314045');
19
- const parsedLon = parseFloat(this.element?.dataset?.centerLon || '16.352532');
20
- const parsedZoom = parseFloat(this.element?.dataset?.centerZoom || '14');
21
-
22
- if (parsedLayers?.length < 1) {
23
- return;
24
- }
25
-
26
- const view = new View({
27
- center: [parsedLon, parsedLat],
28
- zoom: parsedZoom,
29
- });
30
-
31
- new Map({
32
- target: this.element,
33
- layers: parsedLayers.map((layer) => processMapLayer(layer)),
34
- view: view,
35
- interactions: OLDefaultInteractions(parsedInteractions).getArray(),
36
- controls: Object.entries(parsedControls)
37
- .filter(([_, v]) => v === true)
38
- .map(([name]) => processMapInteraction(name)),
39
- });
40
- }
41
- }