@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightshift/frontend-libs-tailwind",
3
- "version": "1.5.0",
3
+ "version": "2.0.1",
4
4
  "description": "A framework for creating modern Gutenberg themes with styling provided by Tailwind CSS.",
5
5
  "author": {
6
6
  "name": "Eightshift team",
@@ -27,55 +27,45 @@
27
27
  },
28
28
  "scripts": {
29
29
  "lintStyle": "stylelint **/*.css",
30
- "lintJs": "npx eslint",
30
+ "lintJs": "bunx eslint",
31
31
  "lint": "npm run lintJs && npm run lintStyle",
32
32
  "prepare": "husky"
33
33
  },
34
34
  "homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@eightshift/ui-components": "^3.0.0",
37
+ "@eightshift/ui-components": "^3.0.1",
38
38
  "@stylistic/eslint-plugin-js": "^4.2.0",
39
39
  "@stylistic/stylelint-plugin": "^3.1.2",
40
- "@swc/core": "^1.11.8",
41
- "@wordpress/api-fetch": "^7.19.0",
42
- "@wordpress/block-editor": "^14.14.0",
43
- "@wordpress/dependency-extraction-webpack-plugin": "^5.9.0",
44
- "@wordpress/dom-ready": "^4.19.0",
45
- "@wordpress/server-side-render": "^5.19.0",
40
+ "@swc/core": "^1.11.22",
41
+ "@wordpress/dependency-extraction-webpack-plugin": "^6.22.0",
46
42
  "browserslist": "^4.24.4",
47
43
  "css-loader": "^7.1.2",
48
44
  "css-minimizer-webpack-plugin": "^7.0.2",
49
- "eslint": "^9.22.0",
50
- "eslint-config-prettier": "^10.1.1",
51
- "eslint-plugin-prettier": "^5.2.3",
45
+ "eslint": "^9.25.1",
46
+ "eslint-config-prettier": "^10.1.2",
47
+ "eslint-plugin-prettier": "^5.2.6",
52
48
  "globals": "^16.0.0",
53
49
  "husky": "^9.1.7",
54
- "lightningcss": "^1.29.2",
50
+ "lightningcss": "^1.29.3",
55
51
  "mini-css-extract-plugin": "^2.9.2",
56
52
  "postcss": "^8.5.3",
57
53
  "postcss-loader": "^8.1.1",
58
54
  "prettier": "^3.5.3",
59
55
  "prettier-plugin-tailwindcss": "^0.6.11",
60
- "sonner": "^2.0.1",
61
- "stylelint": "^16.15.0",
62
- "stylelint-config-standard": "^37.0.0",
56
+ "sonner": "^2.0.3",
57
+ "stylelint": "^16.19.0",
58
+ "stylelint-config-standard": "^38.0.0",
63
59
  "swc-loader": "^0.2.6",
64
60
  "terser-webpack-plugin": "^5.3.14",
65
- "webpack": "^5.98.0",
61
+ "webpack": "^5.99.6",
66
62
  "webpack-cli": "^6.0.1",
67
- "webpack-manifest-plugin": "^5.0.0",
63
+ "webpack-manifest-plugin": "^5.0.1",
68
64
  "webpack-merge": "^6.0.1"
69
65
  },
70
66
  "devDependencies": {
71
- "embla-carousel": "^8.5.2",
72
- "fluid-tailwind": "^1.0.4",
73
- "lint-staged": "^15.4.3",
74
- "micromodal": "^0.4.10",
75
- "ol": "^10.4.0",
76
- "ol-mapbox-style": "^12.5.0",
77
- "tailwindcss": "^4.0.12",
78
- "tailwindcss-animate": "^1.0.7"
67
+ "lint-staged": "^15.5.1",
68
+ "@wordpress/api-fetch": "^7.22.0"
79
69
  },
80
70
  "sideEffects": false,
81
71
  "lint-staged": {
@@ -29,6 +29,11 @@
29
29
  "type": "boolean",
30
30
  "description": "Set to 'false' to disable wrapper.",
31
31
  "default": true
32
+ },
33
+ "useLegacyComponents": {
34
+ "type": "boolean",
35
+ "description": "Set to 'true' to use legacy components.",
36
+ "default": false
32
37
  }
33
38
  }
34
39
  },
@@ -64,7 +64,7 @@ export const PickerPlaceholder = (props) => {
64
64
  <RichLabel
65
65
  icon={icon}
66
66
  label={title}
67
- className='col-span-2 mb-2 font-medium !text-gray-400 select-none'
67
+ className='col-span-2 mb-2 select-none font-medium !text-gray-400'
68
68
  />
69
69
 
70
70
  <span className='es:col-span-2 es:select-none es:justify-self-center'>{presetsHeading}</span>
@@ -16,9 +16,9 @@ import { upperFirst } from '@eightshift/ui-components/utilities';
16
16
  */
17
17
  export const getPaletteColors = () =>
18
18
  useSelect((select) => {
19
- const colors = select(STORE_NAME).getSettings().globalVariables.colors;
19
+ const colors = select(STORE_NAME).getSettings()?.globalVariables?.colors;
20
20
 
21
- return colors.reduce(
21
+ return colors?.reduce(
22
22
  (obj, item) => ({
23
23
  ...obj,
24
24
  [item.slug]: item,
@@ -116,7 +116,7 @@ export const getOptionColors = (colors) => {
116
116
  return Object.values(coreColors);
117
117
  }
118
118
 
119
- return colors.map((colorName) => coreColors[colorName]);
119
+ return colors.map((colorName) => coreColors?.[colorName]);
120
120
  };
121
121
 
122
122
  /**
@@ -31,7 +31,7 @@ import { camelCase, kebabCase, lowerFirst, upperFirst } from '@eightshift/ui-com
31
31
  * Usage:
32
32
  * ```js
33
33
  * registerBlocks(
34
- * globalSettings,
34
+ * globalManifest,
35
35
  * Wrapper,
36
36
  * WrapperManifest,
37
37
  * require.context('./../../components', true, /manifest.json$/),
@@ -49,9 +49,9 @@ export const registerBlocks = (
49
49
  globalManifest = {},
50
50
  wrapperComponent = null,
51
51
  wrapperManifest = {},
52
- componentsManifestPath,
53
- blocksManifestPath,
54
- blocksEditComponentPath,
52
+ componentsManifestPath = null,
53
+ blocksManifestPath = null,
54
+ blocksEditComponentPath = null,
55
55
  hooksComponentPath = null,
56
56
  transformsComponentPath = null,
57
57
  deprecationsComponentPath = null,
@@ -226,9 +226,6 @@ export const registerVariations = (
226
226
  ) => {
227
227
  const variationsManifests = variationsManifestPath.keys().map(variationsManifestPath);
228
228
 
229
- // Set all store values.
230
- dispatch(STORE_NAME).setVariations(variationsManifests);
231
-
232
229
  // Iterate blocks to register.
233
230
  variationsManifests.map((variationManifest) => {
234
231
  const { active = true } = variationManifest;
@@ -10,6 +10,7 @@ const DEFAULT_STATE = {
10
10
  components: {},
11
11
  config: {
12
12
  useWrapper: true,
13
+ useLegacyComponents: true,
13
14
  },
14
15
  wrapper: {},
15
16
  variations: {},
@@ -44,6 +45,9 @@ const selectors = {
44
45
  getConfigUseWrapper(state) {
45
46
  return state.config.useWrapper;
46
47
  },
48
+ getConfigUseLegacyComponents(state) {
49
+ return state.config.useLegacyComponents;
50
+ },
47
51
  getWrapper(state) {
48
52
  return state.wrapper;
49
53
  },
@@ -90,6 +94,12 @@ const actions = {
90
94
  config,
91
95
  };
92
96
  },
97
+ setConfigUseLegacyComponents(config) {
98
+ return {
99
+ type: 'SET_CONFIG_USE_LEGACY_COMPONENTS',
100
+ config,
101
+ };
102
+ },
93
103
  setWrapper(wrapper) {
94
104
  return {
95
105
  type: 'SET_WRAPPER',
@@ -140,6 +150,15 @@ const reducer = (state = DEFAULT_STATE, action) => {
140
150
  },
141
151
  };
142
152
  }
153
+ case 'SET_CONFIG_USE_LEGACY_COMPONENTS': {
154
+ return {
155
+ ...state,
156
+ config: {
157
+ ...state.config,
158
+ useLegacyComponents: action.config,
159
+ },
160
+ };
161
+ }
143
162
  case 'SET_WRAPPER': {
144
163
  return {
145
164
  ...state,
@@ -2,7 +2,6 @@
2
2
  * Helper to set and unset cookies.
3
3
  */
4
4
  export const cookies = {
5
-
6
5
  /**
7
6
  * Set a cookie value
8
7
  *
@@ -10,32 +9,41 @@ export const cookies = {
10
9
  * @param {string} value - Cookie value.
11
10
  * @param {number} time - Number denoting the expiration of the cookie.
12
11
  * @param {string} path - URL path that must exist in the requested URL in order to send the Cookie header.
13
- * @param {string?} domain - Cookie domain. Optional.
12
+ * @param {string} domain - Domain name of the server that set the cookie.
13
+ * @param {boolean} secure - A secure cookie is only sent to the server with an encrypted request over the HTTPS protocol.
14
+ * @param {string} sameSite - A SameSite cookie prevents the browser from sending this cookie along with cross-site requests
15
+ *
14
16
  * @access public
15
17
  *
16
- * @returns {void}
18
+ * @returns {boolean}
17
19
  *
18
20
  * Usage:
19
21
  * ```js
20
- * cookies.setCookie('gdpr', '2', cookies.setOneDay(), '/');
22
+ * cookies.setCookie('gdpr', '2', cookies.setOneDay(), '/', '.example.com', true, 'Strict');
21
23
  * ```
22
24
  */
23
- setCookie(key, value, time, path, domain) {
25
+ setCookie(key, value, time, path, domain, secure = true, sameSite = 'Lax') {
24
26
  const expires = new Date();
25
- expires.setTime(expires.getTime() + (time));
26
-
27
- let pathValue = '';
28
- let domainValue = '';
27
+ expires.setTime(expires.getTime() + time);
29
28
 
30
- if (typeof path !== 'undefined') {
31
- pathValue = `;path=${path}`;
32
- }
29
+ const cookieParts = {
30
+ value: `${key}=${value}`,
31
+ expires: `expires=${expires.toUTCString()}`,
32
+ sameSite: `SameSite=${sameSite}`,
33
+ path: path ? `path=${path}` : '',
34
+ domain: domain ? `domain=${domain}` : '',
35
+ secure: secure ? 'Secure' : '',
36
+ };
33
37
 
34
- if (typeof domain !== 'undefined') {
35
- domainValue = `;domain=${domain}`;
36
- }
38
+ try {
39
+ document.cookie = Object.values(cookieParts).filter(Boolean).join('; ');
40
+
41
+ return true;
42
+ } catch (e) {
43
+ console.error('Failed to set cookie:', e);
37
44
 
38
- document.cookie = `${key}=${value}${pathValue}${domainValue};expires=${expires.toUTCString()}`;
45
+ return false;
46
+ }
39
47
  },
40
48
 
41
49
  /**
@@ -1,7 +1,7 @@
1
1
  import domReady from '@wordpress/dom-ready';
2
2
  import apiFetch from '@wordpress/api-fetch';
3
- import { subscribe, select } from '@wordpress/data';
4
- import { debounce, isEmpty } from '@eightshift/ui-components/utilities';
3
+ import { addAction } from '@wordpress/hooks';
4
+ import { select } from '@wordpress/data';
5
5
 
6
6
  /* global YoastSEO */
7
7
 
@@ -9,61 +9,87 @@ import { debounce, isEmpty } from '@eightshift/ui-components/utilities';
9
9
  * Attributes with this key will be passed as custom data to YoastSEO's analysis.
10
10
  * See https://developer.yoast.com/customization/yoast-seo/adding-custom-data-analysis for more info.
11
11
  */
12
- export const yoastSeo = () => {
12
+ export const yoastSeo = (options) => {
13
+ const filterPriority = options?.filterPriority || 20;
14
+ const filterName = options?.filterName || 'EightshiftCustomSeo';
15
+
13
16
  domReady(() => {
14
- // Bailout if plugin is missing.
15
- if (typeof YoastSEO === 'undefined' && typeof YoastSEO?.app === 'undefined') {
17
+ // Ensure YoastSEO.js is present and can access the necessary features.
18
+ if (
19
+ typeof YoastSEO === 'undefined' ||
20
+ typeof YoastSEO.analysis === 'undefined' ||
21
+ typeof YoastSEO.analysis.worker === 'undefined'
22
+ ) {
16
23
  return;
17
24
  }
18
25
 
19
- // Local variable content, used to update Yoast modifications.
20
- let content = '';
21
- let isDataAvailable = false;
26
+ // Initialize the state and dirty flag.
27
+ let state = '';
28
+ let isDirty = true;
29
+
30
+ /**
31
+ * This function fetches the content of the post from the API.
32
+ * It will only fetch the content data and will not refresh the content.
33
+ *
34
+ * @param {boolean} shouldReload Should the content be refreshed after fetching.
35
+ */
36
+ const fetchContent = async (shouldReload = true) => {
37
+ // Set the dirty flag to false.
38
+ isDirty = false;
39
+
40
+ // Find API url for single item.
41
+ const apiUrl = select('core/editor')?.getCurrentPost()?.['_links']?.['wp:action-publish']?.[0]?.href;
22
42
 
23
- YoastSEO.app.registerPlugin('EightshiftCustomSeo', { status: 'ready' });
24
- YoastSEO.app.registerModification('content', () => content, 'EightshiftCustomSeo', 5);
43
+ if (typeof apiUrl === 'undefined') {
44
+ return;
45
+ }
25
46
 
26
- // Subscribe to changes.
27
- subscribe(
28
- // Small debounce for more optimisations in loading.
29
- debounce(() => {
30
- // Filter only when saved or autosaved.
31
- const isSavingPost = wp.data.select('core/editor').isSavingPost();
32
- const isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
47
+ // Fetch content from the api with only content data in it.
48
+ const response = await apiFetch({
49
+ url: `${apiUrl}?_fields=content`,
50
+ method: 'GET',
51
+ });
33
52
 
34
- // Get the new current post when ready.
35
- const currentPost = select('core/editor').getCurrentPost();
53
+ // Set the content to the state.
54
+ state = response?.content?.rendered || '';
36
55
 
37
- // Filter subscribes. Check only if post is saving, autosaving or initial load.
38
- if (isEmpty(currentPost) || (isDataAvailable && !isSavingPost && !isAutosavingPost)) {
39
- return;
40
- }
56
+ // Refresh the content if needed.
57
+ if (shouldReload) {
58
+ YoastSEO.app.refresh();
59
+ }
60
+ };
41
61
 
42
- isDataAvailable = true;
62
+ /**
63
+ * This function is called by the editor to save the content of the post.
64
+ * It will refresh the content after the save is done.
65
+ *
66
+ * @param {string} edits The content of the post.
67
+ *
68
+ * @return {string} The content of the post.
69
+ */
70
+ const onSaveCallback = (edits) => {
71
+ fetchContent();
43
72
 
44
- // Find API url for single item.
45
- const apiUrl = currentPost['_links']['wp:action-publish'][0].href;
73
+ return edits;
74
+ };
46
75
 
47
- if (typeof apiUrl === 'undefined') {
48
- return;
49
- }
76
+ /**
77
+ * This function is called by YoastSEO to get the content of the post.
78
+ *
79
+ * @return {string} The content of the post.
80
+ */
81
+ const registerYoastSeoPlugin = () => {
82
+ // Set the dirty flag to true.
83
+ if (isDirty) {
84
+ fetchContent(false);
85
+ }
50
86
 
51
- // Fetch content from the api with only content data in it.
52
- apiFetch({
53
- url: `${apiUrl}?_fields=content`,
54
- method: 'GET',
55
- }).then((response) => {
56
- const fetchedContent = response?.content?.rendered;
87
+ return state;
88
+ };
57
89
 
58
- if (typeof content === 'undefined' && fetchedContent === content) {
59
- return;
60
- }
61
- // Updating global variable content.
62
- content = fetchedContent;
63
- // Refreshing Yoast input.
64
- YoastSEO.app.pluggable.refresh();
65
- });
66
- }, 50),
67
- );
90
+ // Register the filter and the plugin.
91
+ addAction('editor.savePost', filterName, onSaveCallback);
92
+ YoastSEO.app.registerPlugin(filterName, { status: 'ready' });
93
+ YoastSEO.app.registerModification('content', registerYoastSeoPlugin, filterName, filterPriority);
68
94
  });
69
95
  };
package/webpack/base.mjs CHANGED
@@ -53,11 +53,6 @@ export default (options) => {
53
53
  plugins.push(
54
54
  new DependencyExtractionWebpackPlugin({
55
55
  outputFormat: 'json',
56
- requestToExternal: function (request) {
57
- if (request === '@wordpress/dom-ready') {
58
- return '';
59
- }
60
- },
61
56
  }),
62
57
  );
63
58
  }
@@ -10,7 +10,6 @@ import path from 'path';
10
10
  *
11
11
  * @param {string} projectDir Current project directory absolute path.
12
12
  * @param {string} projectPathConfig Project path relative to project root.
13
- * @param {string} assetsPathConfig Assets path after projectPath location.
14
13
  * @param {string} blocksAssetsPathConfig Path of the block assets.
15
14
  * @param {string} outputPathConfig Public output path after projectPath location.
16
15
  * @param {string} blocksManifestSettingsPath Main global settings manifest.json path after projectPath location.
@@ -19,7 +18,6 @@ import path from 'path';
19
18
  function getConfig(
20
19
  projectDir,
21
20
  projectPathConfig,
22
- assetsPathConfig = 'assets',
23
21
  blocksAssetsPathConfig = 'src/Blocks/assets',
24
22
  outputPathConfig = 'public',
25
23
  blocksManifestSettingsPath = 'src/Blocks/manifest.json',
@@ -38,7 +36,6 @@ function getConfig(
38
36
 
39
37
  // Clear all slashes from user config.
40
38
  const projectPathConfigClean = projectPathConfig.replace(/^\/|\/$/g, '');
41
- const assetsPathConfigClean = assetsPathConfig.replace(/^\/|\/$/g, '');
42
39
  const blocksAssetsPathConfigClean = blocksAssetsPathConfig.replace(/^\/|\/$/g, '');
43
40
  const outputPathConfigClean = outputPathConfig.replace(/^\/|\/$/g, '');
44
41
  const blocksManifestSettingsPathClean = blocksManifestSettingsPath.replace(/^\/|\/$/g, '');
@@ -56,8 +53,7 @@ function getConfig(
56
53
  publicPath: path.join('/', projectPathConfigClean, outputPathConfigClean, '/'),
57
54
 
58
55
  // Source files entries absolute locations.
59
- applicationEntry: path.resolve(absolutePath, assetsPathConfigClean, 'application.js'),
60
- applicationAdminEntry: path.resolve(absolutePath, assetsPathConfigClean, 'application-admin.js'),
56
+ applicationAdminEntry: path.resolve(absolutePath, blocksAssetsPathConfigClean, 'application-admin.js'),
61
57
  applicationBlocksEntry: path.resolve(absolutePath, blocksAssetsPathConfigClean, 'application-blocks.js'),
62
58
  applicationBlocksEditorEntry: path.resolve(
63
59
  absolutePath,
package/webpack/index.mjs CHANGED
@@ -21,7 +21,6 @@ const eightshiftConfig = (mode, optionsData = {}) => {
21
21
  options.config = getConfig(
22
22
  optionsData.config.projectDir,
23
23
  optionsData.config.projectPath,
24
- optionsData.config.assetsPath,
25
24
  optionsData.config.blocksAssetsPath,
26
25
  optionsData.config.outputPath,
27
26
  optionsData.config.blocksManifestSettingsPath,
@@ -18,11 +18,6 @@ export default (options) => {
18
18
  library: '[name]',
19
19
  };
20
20
 
21
- // Load Application Entrypoint.
22
- if (!options.overrides.includes('application') && fs.existsSync(options.config.applicationEntry)) {
23
- entry.application = options.config.applicationEntry;
24
- }
25
-
26
21
  // Load ApplicationAdmin Entrypoint.
27
22
  if (!options.overrides.includes('applicationAdmin') && fs.existsSync(options.config.applicationAdminEntry)) {
28
23
  entry.applicationAdmin = options.config.applicationAdminEntry;
@@ -1,10 +0,0 @@
1
- /**
2
- * Main entry point for styles, scripts, and other assets used in the WordPress admin.
3
- * Does not apply to the Block editor!
4
- */
5
-
6
- // Styles.
7
- import './styles/application-admin.css';
8
-
9
- // Scripts.
10
- import './scripts/application-admin';
@@ -1,13 +0,0 @@
1
- /**
2
- * Main entry point for styles, scripts, and other assets used in the site frontend.
3
- * Don't load Block editor-related assets here!
4
- */
5
-
6
- // Styles.
7
- import './styles/application.css';
8
-
9
- // Scripts.
10
- import './scripts/application';
11
-
12
- // Images.
13
- import './images';
@@ -1,5 +0,0 @@
1
- /**
2
- * Main entry point for project images.
3
- *
4
- * Used in the WordPress admin, Block editor, and frontend.
5
- */
@@ -1,7 +0,0 @@
1
- /**
2
- * Main entry point for scripts used in the WordPress admin.
3
- */
4
-
5
- import { dynamicImport } from '@eightshift/frontend-libs-tailwind/scripts/helpers';
6
-
7
- dynamicImport(require.context('./../../src/Blocks/components', true, /assets-admin\/index\.js$/));
@@ -1,3 +0,0 @@
1
- /**
2
- * Main entry point for scripts used in the site frontend.
3
- */
@@ -1,39 +0,0 @@
1
- /**
2
- * Theme color definitions, used in the Tailwind configuration file and during registration.
3
- */
4
-
5
- import colors from 'tailwindcss/colors';
6
-
7
- export const themeColors = {
8
- transparent: 'transparent',
9
- current: 'currentColor',
10
- black: colors.black,
11
- white: colors.white,
12
- gray: colors.stone,
13
- navy: {
14
- 50: '#eef8ff',
15
- 100: '#dcf0ff',
16
- 200: '#b2e3ff',
17
- 300: '#6dceff',
18
- 400: '#20b5ff',
19
- 500: '#009cff',
20
- 600: '#007bdf',
21
- 700: '#0061b4',
22
- 800: '#005395',
23
- 900: '#00447a',
24
- 950: '#002c54',
25
- },
26
- red: {
27
- 50: '#fff0f2',
28
- 100: '#ffdde1',
29
- 200: '#ffc1c9',
30
- 300: '#ff95a3',
31
- 400: '#ff596f',
32
- 500: '#ff2643',
33
- 600: '#fc0626',
34
- 700: '#c5001a',
35
- 800: '#af051b',
36
- 900: '#900c1d',
37
- 950: '#50000b',
38
- },
39
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Main entry point for styles used in the WordPress admin.
3
- */
4
-
5
- @import '~@eightshift/ui-components/dist/assets/fonts.css';
6
- @import '~@eightshift/ui-components/dist/assets/style.css';
@@ -1,3 +0,0 @@
1
- /**
2
- * Main entry point for styles used in the site frontend.
3
- */
@@ -1,14 +0,0 @@
1
- /**
2
- * This is the main entry point for Block Editor blocks used for the `WordPress admin editor`.
3
- * This file registers styles and scripts.
4
- *
5
- * Usage: `WordPress admin editor`.
6
- */
7
-
8
- // Styles.
9
- import './styles/tailwind.css';
10
- import './styles/application-blocks-editor.css';
11
- import './styles/editor/editor-overrides.css';
12
-
13
- // Scripts.
14
- import './scripts/application-blocks-editor';
@@ -1,13 +0,0 @@
1
- /**
2
- * This is the main entry point for Block Editor blocks used for the `WordPress frontend screen`.
3
- * This file registers styles and scripts.
4
- *
5
- * Usage: `WordPress frontend screen`.
6
- */
7
-
8
- // Styles.
9
- import './styles/tailwind.css';
10
- import './styles/application-blocks-frontend.css';
11
-
12
- // Scripts.
13
- import './scripts/application-blocks-frontend';
@@ -1,9 +0,0 @@
1
- /**
2
- * This is the main entry point for Block Editor blocks used for the `WordPress frontend screen` and `WordPress admin editor`.
3
- * This file registers styles and scripts.
4
- *
5
- * Usage: `WordPress frontend screen` and `WordPress admin editor`.
6
- */
7
-
8
- // Styles.
9
- import './styles/application-blocks.css';