@eightshift/frontend-libs-tailwind 1.4.8 → 2.0.0

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 (235) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/bun.lockb +0 -0
  3. package/package.json +28 -35
  4. package/scripts/components/block-inserter.js +1 -1
  5. package/scripts/components/file-picker.js +17 -3
  6. package/scripts/components/picker-placeholder.js +5 -7
  7. package/scripts/components/server-side-render.js +1 -1
  8. package/scripts/components/settings/settings.js +21 -20
  9. package/blocks/init/assets/application-admin.js +0 -10
  10. package/blocks/init/assets/application.js +0 -13
  11. package/blocks/init/assets/fonts/fraunces-italic-latin-extended.woff2 +0 -0
  12. package/blocks/init/assets/fonts/fraunces-italic-latin.woff2 +0 -0
  13. package/blocks/init/assets/fonts/fraunces-latin-extended.woff2 +0 -0
  14. package/blocks/init/assets/fonts/fraunces-latin.woff2 +0 -0
  15. package/blocks/init/assets/fonts/noto-sans-italic-latin-extended.woff2 +0 -0
  16. package/blocks/init/assets/fonts/noto-sans-italic-latin.woff2 +0 -0
  17. package/blocks/init/assets/fonts/noto-sans-latin-extended.woff2 +0 -0
  18. package/blocks/init/assets/fonts/noto-sans-latin.woff2 +0 -0
  19. package/blocks/init/assets/images/index.js +0 -5
  20. package/blocks/init/assets/scripts/application-admin.js +0 -7
  21. package/blocks/init/assets/scripts/application.js +0 -3
  22. package/blocks/init/assets/scripts/theme-colors.js +0 -39
  23. package/blocks/init/assets/styles/application-admin.css +0 -6
  24. package/blocks/init/assets/styles/application.css +0 -3
  25. package/blocks/init/src/Blocks/assets/application-blocks-editor.js +0 -14
  26. package/blocks/init/src/Blocks/assets/application-blocks-frontend.js +0 -13
  27. package/blocks/init/src/Blocks/assets/application-blocks.js +0 -9
  28. package/blocks/init/src/Blocks/assets/scripts/application-blocks-editor.js +0 -65
  29. package/blocks/init/src/Blocks/assets/scripts/application-blocks-frontend.js +0 -24
  30. package/blocks/init/src/Blocks/assets/scripts/link-section-editor.js +0 -262
  31. package/blocks/init/src/Blocks/assets/scripts/shared.js +0 -25
  32. package/blocks/init/src/Blocks/assets/styles/application-blocks-editor.css +0 -15
  33. package/blocks/init/src/Blocks/assets/styles/application-blocks-frontend.css +0 -9
  34. package/blocks/init/src/Blocks/assets/styles/application-blocks.css +0 -1
  35. package/blocks/init/src/Blocks/assets/styles/editor/editor-overrides.css +0 -15
  36. package/blocks/init/src/Blocks/assets/styles/fonts.css +0 -90
  37. package/blocks/init/src/Blocks/assets/styles/tailwind.css +0 -30
  38. package/blocks/init/src/Blocks/components/admin-theme-options/admin-theme-options.php +0 -20
  39. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/index.js +0 -36
  40. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/pages/parts.js +0 -56
  41. package/blocks/init/src/Blocks/components/admin-theme-options/manifest.json +0 -5
  42. package/blocks/init/src/Blocks/components/button/assets/index.js +0 -22
  43. package/blocks/init/src/Blocks/components/button/button.php +0 -88
  44. package/blocks/init/src/Blocks/components/button/components/button-editor.js +0 -36
  45. package/blocks/init/src/Blocks/components/button/components/button-options.js +0 -134
  46. package/blocks/init/src/Blocks/components/button/manifest.json +0 -302
  47. package/blocks/init/src/Blocks/components/card/card.php +0 -42
  48. package/blocks/init/src/Blocks/components/card/components/card-editor.js +0 -43
  49. package/blocks/init/src/Blocks/components/card/components/card-options.js +0 -55
  50. package/blocks/init/src/Blocks/components/card/manifest.json +0 -111
  51. package/blocks/init/src/Blocks/components/head/head.php +0 -52
  52. package/blocks/init/src/Blocks/components/head/manifest.json +0 -17
  53. package/blocks/init/src/Blocks/components/heading/components/heading-editor.js +0 -26
  54. package/blocks/init/src/Blocks/components/heading/components/heading-options.js +0 -62
  55. package/blocks/init/src/Blocks/components/heading/heading.php +0 -45
  56. package/blocks/init/src/Blocks/components/heading/manifest.json +0 -76
  57. package/blocks/init/src/Blocks/components/hero/components/hero-editor.js +0 -42
  58. package/blocks/init/src/Blocks/components/hero/components/hero-options.js +0 -100
  59. package/blocks/init/src/Blocks/components/hero/hero.php +0 -45
  60. package/blocks/init/src/Blocks/components/hero/manifest.json +0 -96
  61. package/blocks/init/src/Blocks/components/icon/components/icon-editor.js +0 -23
  62. package/blocks/init/src/Blocks/components/icon/components/icon-options.js +0 -65
  63. package/blocks/init/src/Blocks/components/icon/icon.php +0 -53
  64. package/blocks/init/src/Blocks/components/icon/manifest.json +0 -1238
  65. package/blocks/init/src/Blocks/components/image/components/image-editor.js +0 -64
  66. package/blocks/init/src/Blocks/components/image/components/image-options.js +0 -111
  67. package/blocks/init/src/Blocks/components/image/image.php +0 -68
  68. package/blocks/init/src/Blocks/components/image/manifest.json +0 -125
  69. package/blocks/init/src/Blocks/components/list/components/list-editor.js +0 -30
  70. package/blocks/init/src/Blocks/components/list/components/list-options.js +0 -62
  71. package/blocks/init/src/Blocks/components/list/list.php +0 -32
  72. package/blocks/init/src/Blocks/components/list/manifest.json +0 -127
  73. package/blocks/init/src/Blocks/components/load-more/assets/index.js +0 -19
  74. package/blocks/init/src/Blocks/components/load-more/assets/load-more.js +0 -146
  75. package/blocks/init/src/Blocks/components/load-more/components/load-more-editor.js +0 -14
  76. package/blocks/init/src/Blocks/components/load-more/components/load-more-options.js +0 -19
  77. package/blocks/init/src/Blocks/components/load-more/load-more.php +0 -47
  78. package/blocks/init/src/Blocks/components/load-more/manifest.json +0 -39
  79. package/blocks/init/src/Blocks/components/modal/assets/index.js +0 -27
  80. package/blocks/init/src/Blocks/components/modal/manifest.json +0 -48
  81. package/blocks/init/src/Blocks/components/modal/modal.php +0 -46
  82. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-editor.js +0 -38
  83. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-options.js +0 -48
  84. package/blocks/init/src/Blocks/components/paragraph/manifest.json +0 -81
  85. package/blocks/init/src/Blocks/components/paragraph/paragraph.php +0 -33
  86. package/blocks/init/src/Blocks/components/post-header/manifest.json +0 -5
  87. package/blocks/init/src/Blocks/components/post-header/post-header.php +0 -24
  88. package/blocks/init/src/Blocks/components/quote/components/quote-editor.js +0 -53
  89. package/blocks/init/src/Blocks/components/quote/components/quote-options.js +0 -29
  90. package/blocks/init/src/Blocks/components/quote/manifest.json +0 -47
  91. package/blocks/init/src/Blocks/components/quote/quote.php +0 -49
  92. package/blocks/init/src/Blocks/components/share/assets/index.js +0 -39
  93. package/blocks/init/src/Blocks/components/share/components/share-editor.js +0 -28
  94. package/blocks/init/src/Blocks/components/share/components/share-options.js +0 -112
  95. package/blocks/init/src/Blocks/components/share/manifest.json +0 -72
  96. package/blocks/init/src/Blocks/components/share/share.php +0 -69
  97. package/blocks/init/src/Blocks/components/tracking-before-body-end/manifest.json +0 -5
  98. package/blocks/init/src/Blocks/components/tracking-before-body-end/tracking-before-body-end.php +0 -9
  99. package/blocks/init/src/Blocks/components/tracking-head/manifest.json +0 -5
  100. package/blocks/init/src/Blocks/components/tracking-head/tracking-head.php +0 -9
  101. package/blocks/init/src/Blocks/components/video/components/video-editor.js +0 -74
  102. package/blocks/init/src/Blocks/components/video/components/video-options.js +0 -279
  103. package/blocks/init/src/Blocks/components/video/manifest.json +0 -120
  104. package/blocks/init/src/Blocks/components/video/video.php +0 -70
  105. package/blocks/init/src/Blocks/custom/accordion/accordion-block.js +0 -15
  106. package/blocks/init/src/Blocks/custom/accordion/accordion.php +0 -28
  107. package/blocks/init/src/Blocks/custom/accordion/assets/index.js +0 -37
  108. package/blocks/init/src/Blocks/custom/accordion/components/accordion-editor.js +0 -22
  109. package/blocks/init/src/Blocks/custom/accordion/components/accordion-options.js +0 -18
  110. package/blocks/init/src/Blocks/custom/accordion/manifest.json +0 -32
  111. package/blocks/init/src/Blocks/custom/accordion-item/accordion-item-block.js +0 -19
  112. package/blocks/init/src/Blocks/custom/accordion-item/accordion-item.php +0 -46
  113. package/blocks/init/src/Blocks/custom/accordion-item/components/accordion-item-editor.js +0 -60
  114. package/blocks/init/src/Blocks/custom/accordion-item/manifest.json +0 -69
  115. package/blocks/init/src/Blocks/custom/button/button-block.js +0 -13
  116. package/blocks/init/src/Blocks/custom/button/button.php +0 -11
  117. package/blocks/init/src/Blocks/custom/button/components/button-editor.js +0 -12
  118. package/blocks/init/src/Blocks/custom/button/components/button-options.js +0 -12
  119. package/blocks/init/src/Blocks/custom/button/manifest.json +0 -18
  120. package/blocks/init/src/Blocks/custom/card/card-block.js +0 -13
  121. package/blocks/init/src/Blocks/custom/card/card.php +0 -11
  122. package/blocks/init/src/Blocks/custom/card/components/card-editor.js +0 -12
  123. package/blocks/init/src/Blocks/custom/card/components/card-options.js +0 -15
  124. package/blocks/init/src/Blocks/custom/card/manifest.json +0 -18
  125. package/blocks/init/src/Blocks/custom/carousel/assets/index.js +0 -46
  126. package/blocks/init/src/Blocks/custom/carousel/assets/navigation.js +0 -31
  127. package/blocks/init/src/Blocks/custom/carousel/assets/pagination.js +0 -40
  128. package/blocks/init/src/Blocks/custom/carousel/carousel-block.js +0 -21
  129. package/blocks/init/src/Blocks/custom/carousel/carousel.php +0 -61
  130. package/blocks/init/src/Blocks/custom/carousel/components/carousel-editor.js +0 -25
  131. package/blocks/init/src/Blocks/custom/carousel/components/carousel-options.js +0 -47
  132. package/blocks/init/src/Blocks/custom/carousel/manifest.json +0 -130
  133. package/blocks/init/src/Blocks/custom/column/column-block.js +0 -21
  134. package/blocks/init/src/Blocks/custom/column/column-hooks.js +0 -32
  135. package/blocks/init/src/Blocks/custom/column/column.php +0 -21
  136. package/blocks/init/src/Blocks/custom/column/components/column-editor.js +0 -22
  137. package/blocks/init/src/Blocks/custom/column/components/column-options.js +0 -580
  138. package/blocks/init/src/Blocks/custom/column/manifest.json +0 -625
  139. package/blocks/init/src/Blocks/custom/columns/columns-block.js +0 -20
  140. package/blocks/init/src/Blocks/custom/columns/columns.php +0 -21
  141. package/blocks/init/src/Blocks/custom/columns/components/columns-editor.js +0 -81
  142. package/blocks/init/src/Blocks/custom/columns/components/columns-options.js +0 -104
  143. package/blocks/init/src/Blocks/custom/columns/manifest.json +0 -581
  144. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-editor.js +0 -28
  145. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-options.js +0 -248
  146. package/blocks/init/src/Blocks/custom/featured-content/featured-content-block.js +0 -13
  147. package/blocks/init/src/Blocks/custom/featured-content/featured-content.php +0 -139
  148. package/blocks/init/src/Blocks/custom/featured-content/manifest.json +0 -131
  149. package/blocks/init/src/Blocks/custom/featured-content/partials/cards.php +0 -39
  150. package/blocks/init/src/Blocks/custom/group/components/group-editor.js +0 -6
  151. package/blocks/init/src/Blocks/custom/group/group-block.js +0 -14
  152. package/blocks/init/src/Blocks/custom/group/group.php +0 -10
  153. package/blocks/init/src/Blocks/custom/group/manifest.json +0 -32
  154. package/blocks/init/src/Blocks/custom/heading/components/heading-editor.js +0 -15
  155. package/blocks/init/src/Blocks/custom/heading/components/heading-options.js +0 -38
  156. package/blocks/init/src/Blocks/custom/heading/heading-block.js +0 -13
  157. package/blocks/init/src/Blocks/custom/heading/heading-transforms.js +0 -26
  158. package/blocks/init/src/Blocks/custom/heading/heading.php +0 -15
  159. package/blocks/init/src/Blocks/custom/heading/manifest.json +0 -79
  160. package/blocks/init/src/Blocks/custom/hero/components/hero-editor.js +0 -12
  161. package/blocks/init/src/Blocks/custom/hero/components/hero-options.js +0 -14
  162. package/blocks/init/src/Blocks/custom/hero/hero-block.js +0 -13
  163. package/blocks/init/src/Blocks/custom/hero/hero.php +0 -11
  164. package/blocks/init/src/Blocks/custom/hero/manifest.json +0 -17
  165. package/blocks/init/src/Blocks/custom/image/components/image-editor.js +0 -12
  166. package/blocks/init/src/Blocks/custom/image/components/image-options.js +0 -14
  167. package/blocks/init/src/Blocks/custom/image/image-block.js +0 -13
  168. package/blocks/init/src/Blocks/custom/image/image.php +0 -11
  169. package/blocks/init/src/Blocks/custom/image/manifest.json +0 -33
  170. package/blocks/init/src/Blocks/custom/list/components/list-editor.js +0 -14
  171. package/blocks/init/src/Blocks/custom/list/components/list-options.js +0 -39
  172. package/blocks/init/src/Blocks/custom/list/list-block.js +0 -13
  173. package/blocks/init/src/Blocks/custom/list/list.php +0 -15
  174. package/blocks/init/src/Blocks/custom/list/manifest.json +0 -58
  175. package/blocks/init/src/Blocks/custom/map/assets/index.js +0 -20
  176. package/blocks/init/src/Blocks/custom/map/assets/map-controller.js +0 -41
  177. package/blocks/init/src/Blocks/custom/map/assets/utils.js +0 -161
  178. package/blocks/init/src/Blocks/custom/map/components/map-components.js +0 -403
  179. package/blocks/init/src/Blocks/custom/map/components/map-editor.js +0 -56
  180. package/blocks/init/src/Blocks/custom/map/components/map-options.js +0 -550
  181. package/blocks/init/src/Blocks/custom/map/manifest.json +0 -79
  182. package/blocks/init/src/Blocks/custom/map/map-block.js +0 -13
  183. package/blocks/init/src/Blocks/custom/map/map.php +0 -52
  184. package/blocks/init/src/Blocks/custom/map/styles.css +0 -2
  185. package/blocks/init/src/Blocks/custom/modal/components/modal-editor.js +0 -90
  186. package/blocks/init/src/Blocks/custom/modal/manifest.json +0 -51
  187. package/blocks/init/src/Blocks/custom/modal/modal-block.js +0 -14
  188. package/blocks/init/src/Blocks/custom/modal/modal.php +0 -20
  189. package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-editor.js +0 -17
  190. package/blocks/init/src/Blocks/custom/paragraph/components/paragraph-options.js +0 -38
  191. package/blocks/init/src/Blocks/custom/paragraph/manifest.json +0 -82
  192. package/blocks/init/src/Blocks/custom/paragraph/paragraph-block.js +0 -13
  193. package/blocks/init/src/Blocks/custom/paragraph/paragraph-transforms.js +0 -46
  194. package/blocks/init/src/Blocks/custom/paragraph/paragraph.php +0 -15
  195. package/blocks/init/src/Blocks/custom/quote/components/quote-editor.js +0 -12
  196. package/blocks/init/src/Blocks/custom/quote/components/quote-options.js +0 -14
  197. package/blocks/init/src/Blocks/custom/quote/manifest.json +0 -17
  198. package/blocks/init/src/Blocks/custom/quote/quote-block.js +0 -13
  199. package/blocks/init/src/Blocks/custom/quote/quote.php +0 -13
  200. package/blocks/init/src/Blocks/custom/share/components/share-editor.js +0 -6
  201. package/blocks/init/src/Blocks/custom/share/components/share-options.js +0 -12
  202. package/blocks/init/src/Blocks/custom/share/manifest.json +0 -19
  203. package/blocks/init/src/Blocks/custom/share/share-block.js +0 -13
  204. package/blocks/init/src/Blocks/custom/share/share.php +0 -11
  205. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-editor.js +0 -57
  206. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-options.js +0 -106
  207. package/blocks/init/src/Blocks/custom/site-footer/manifest.json +0 -73
  208. package/blocks/init/src/Blocks/custom/site-footer/site-footer-block.js +0 -13
  209. package/blocks/init/src/Blocks/custom/site-footer/site-footer.php +0 -74
  210. package/blocks/init/src/Blocks/custom/site-navigation/assets/index.js +0 -9
  211. package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-editor.js +0 -42
  212. package/blocks/init/src/Blocks/custom/site-navigation/components/site-navigation-options.js +0 -73
  213. package/blocks/init/src/Blocks/custom/site-navigation/manifest.json +0 -77
  214. package/blocks/init/src/Blocks/custom/site-navigation/site-navigation-block.js +0 -13
  215. package/blocks/init/src/Blocks/custom/site-navigation/site-navigation.php +0 -99
  216. package/blocks/init/src/Blocks/custom/table-of-contents/assets/index.js +0 -58
  217. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-editor.js +0 -38
  218. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-options.js +0 -32
  219. package/blocks/init/src/Blocks/custom/table-of-contents/manifest.json +0 -48
  220. package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents-block.js +0 -13
  221. package/blocks/init/src/Blocks/custom/table-of-contents/table-of-contents.php +0 -31
  222. package/blocks/init/src/Blocks/custom/video/components/video-editor.js +0 -6
  223. package/blocks/init/src/Blocks/custom/video/components/video-options.js +0 -12
  224. package/blocks/init/src/Blocks/custom/video/manifest.json +0 -29
  225. package/blocks/init/src/Blocks/custom/video/video-block.js +0 -13
  226. package/blocks/init/src/Blocks/custom/video/video.php +0 -22
  227. package/blocks/init/src/Blocks/manifest.json +0 -32
  228. package/blocks/init/src/Blocks/variations/card-simple/manifest.json +0 -17
  229. package/blocks/init/src/Blocks/wrapper/components/wrapper-editor.js +0 -12
  230. package/blocks/init/src/Blocks/wrapper/components/wrapper-options.js +0 -364
  231. package/blocks/init/src/Blocks/wrapper/manifest.json +0 -459
  232. package/blocks/init/src/Blocks/wrapper/styles-editor.css +0 -13
  233. package/blocks/init/src/Blocks/wrapper/styles.css +0 -19
  234. package/blocks/init/src/Blocks/wrapper/wrapper.js +0 -27
  235. package/blocks/init/src/Blocks/wrapper/wrapper.php +0 -34
@@ -1,38 +0,0 @@
1
- import { __, sprintf } from '@wordpress/i18n';
2
- import { RichText } from '@wordpress/block-editor';
3
- import { checkAttr, tailwindClasses } from '@eightshift/frontend-libs-tailwind/scripts';
4
- import { clsx } from '@eightshift/ui-components/utilities';
5
- import manifest from '../manifest.json';
6
-
7
- export const TableOfContentsEditor = ({ attributes, setAttributes }) => {
8
- const tableOfContentsDescription = checkAttr('tableOfContentsDescription', attributes, manifest);
9
- const tableOfContentsHeadingLevels = checkAttr('tableOfContentsHeadingLevels', attributes, manifest);
10
-
11
- return (
12
- <div className={tailwindClasses('container', attributes, manifest)}>
13
- <RichText
14
- placeholder={manifest.attributes.tableOfContentsDescription.default}
15
- value={tableOfContentsDescription}
16
- onChange={(value) => setAttributes({ [getAttrKey('tableOfContentsDescription', attributes, manifest)]: value })}
17
- allowedFormats={[]}
18
- className={tailwindClasses('description', attributes, manifest)}
19
- />
20
-
21
- {Object.entries(tableOfContentsHeadingLevels).map(([tag, enabled = false]) => (
22
- <DemoTocItem
23
- level={parseInt(tag.replace('h', ''))}
24
- disabled={!enabled}
25
- />
26
- ))}
27
- </div>
28
- );
29
- };
30
-
31
- const DemoTocItem = ({ level, disabled }) => (
32
- <div class={clsx('group block select-none py-0.5 focus:outline-none', disabled && 'pointer-events-none opacity-25')}>
33
- {level > 1 && <span class='mr-1.5 tracking-tighter text-gray-300'>{'–'.repeat(level - 1)}</span>}
34
- <span class='group-focus-visible:text-navy-50px-0.5 group-hover:bg-navy-100 group-hover:text-navy-950 group-hover:ring-navy-100 group-focus-visible:bg-navy-950 group-focus-visible:ring-navy-950 rounded text-sm transition group-hover:ring-4 group-focus-visible:ring-4'>
35
- {sprintf(__('Heading %d', '%g_textdomain%'), level)}
36
- </span>
37
- </div>
38
- );
@@ -1,32 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { checkAttr, getAttrKey } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import { BaseControl, Checkbox } from '@eightshift/ui-components';
4
- import { icons } from '@eightshift/ui-components/icons';
5
- import manifest from '../manifest.json';
6
-
7
- export const TableOfContentsOptions = ({ attributes, setAttributes }) => {
8
- const tableOfContentsHeadingLevels = checkAttr('tableOfContentsHeadingLevels', attributes, manifest);
9
-
10
- return (
11
- <BaseControl
12
- icon={icons.headingLevelAlt}
13
- label={__('Include', '%g_textdomain%')}
14
- >
15
- {Object.keys(tableOfContentsHeadingLevels).map((level, i, arr) => {
16
- return (
17
- <Checkbox
18
- key={i}
19
- checked={tableOfContentsHeadingLevels[level]}
20
- label={level.replace('h', __('Heading', '%g_textdomain%') + ' ')}
21
- onChange={(value) => {
22
- const newValue = { ...tableOfContentsHeadingLevels };
23
- newValue[level] = value;
24
-
25
- setAttributes({ [getAttrKey('tableOfContentsHeadingLevels', attributes, manifest)]: newValue });
26
- }}
27
- />
28
- );
29
- })}
30
- </BaseControl>
31
- );
32
- };
@@ -1,48 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
- "blockName": "table-of-contents",
4
- "title": "Table of contents",
5
- "description": "Display the structure of the current post.",
6
- "category": "eightshift",
7
- "icon": {
8
- "src": "es-table-of-contents"
9
- },
10
- "keywords": [
11
- "table",
12
- "of",
13
- "contents",
14
- "toc"
15
- ],
16
- "example": {
17
- "attributes": {
18
- "tableOfContentsParagraphContent": "Contents"
19
- }
20
- },
21
- "attributes": {
22
- "tableOfContentsHeadingLevels": {
23
- "type": "object",
24
- "default": {
25
- "h1": false,
26
- "h2": true,
27
- "h3": true,
28
- "h4": true,
29
- "h5": true,
30
- "h6": true
31
- }
32
- },
33
- "tableOfContentsDescription": {
34
- "type": "string",
35
- "default": "In this article"
36
- }
37
- },
38
- "tailwind": {
39
- "parts": {
40
- "container": {
41
- "twClasses": "pl-2 py-2 border-l border-l-gray-300"
42
- },
43
- "description": {
44
- "twClasses": "font-display ~text-xl/2xl text-gray-500 mb-1"
45
- }
46
- }
47
- }
48
- }
@@ -1,13 +0,0 @@
1
- import { TableOfContentsEditor } from './components/table-of-contents-editor';
2
- import { TableOfContentsOptions } from './components/table-of-contents-options';
3
- import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
4
-
5
- export const TableOfContents = (props) => {
6
- return (
7
- <GutenbergBlock
8
- {...props}
9
- options={TableOfContentsOptions}
10
- editor={TableOfContentsEditor}
11
- />
12
- );
13
- };
@@ -1,31 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Table of contents 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
- $blockClass = $attributes['blockClass'] ?? '';
14
- $blockJsClass = $attributes['blockJsClass'] ?? '';
15
-
16
- $tocClass = Helpers::classnames([
17
- Helpers::tailwindClasses('container', $attributes, $manifest),
18
- $blockJsClass,
19
- ]);
20
-
21
- $tableOfContentsHeadingLevels = Helpers::checkAttr('tableOfContentsHeadingLevels', $attributes, $manifest);
22
- $tableOfContentsDescription = Helpers::checkAttr('tableOfContentsDescription', $attributes, $manifest);
23
-
24
- $headingLevelsToUse = implode(',', array_keys(array_filter($tableOfContentsHeadingLevels, fn($v) => $v)));
25
- ?>
26
-
27
- <div class="<?php echo esc_attr($tocClass); ?>" data-levels="<?php echo esc_attr($headingLevelsToUse); ?>">
28
- <p class="<?php echo esc_attr(Helpers::tailwindClasses('description', $attributes, $manifest)); ?>">
29
- <?php echo esc_attr($tableOfContentsDescription); ?>
30
- </p>
31
- </div>
@@ -1,6 +0,0 @@
1
- import { props } from '@eightshift/frontend-libs-tailwind/scripts';
2
- import { VideoEditor as EditorComponent } from '../../../components/video/components/video-editor';
3
-
4
- export const VideoEditor = ({ attributes, setAttributes }) => {
5
- return <EditorComponent {...props('video', attributes, { setAttributes })} />;
6
- };
@@ -1,12 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { props } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import { VideoOptions as OptionsComponent } from '../../../components/video/components/video-options';
4
-
5
- export const VideoOptions = ({ attributes, setAttributes }) => {
6
- return (
7
- <OptionsComponent
8
- {...props('video', attributes, { setAttributes })}
9
- controlOnly
10
- />
11
- );
12
- };
@@ -1,29 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/block.json",
3
- "blockName": "video",
4
- "title": "Video",
5
- "description" : "Showcase a video from the Media library.",
6
- "category": "eightshift",
7
- "icon": {
8
- "src": "es-video"
9
- },
10
- "keywords": [
11
- "video",
12
- "picture",
13
- "img"
14
- ],
15
- "components": {
16
- "video": "video"
17
- },
18
- "example": {
19
- "attributes": {
20
- "videoAlign": "center center"
21
- }
22
- },
23
- "attributes": {
24
- "videoAlign": {
25
- "type": "string",
26
- "default": "center center"
27
- }
28
- }
29
- }
@@ -1,13 +0,0 @@
1
- import { VideoEditor } from './components/video-editor';
2
- import { VideoOptions } from './components/video-options';
3
- import { GutenbergBlock } from '@eightshift/frontend-libs-tailwind/scripts';
4
-
5
- export const Video = (props) => {
6
- return (
7
- <GutenbergBlock
8
- {...props}
9
- options={VideoOptions}
10
- editor={VideoEditor}
11
- />
12
- );
13
- };
@@ -1,22 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Video 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
- $blockClass = $attributes['blockClass'] ?? '';
14
-
15
-
16
- ?>
17
-
18
- <div class="<?php echo esc_attr($blockClass); ?>" >
19
- <?php
20
- echo Helpers::render('video', Helpers::props('video', $attributes));
21
- ?>
22
- </div>
@@ -1,32 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/globalManifest.json",
3
- "namespace": "eightshift-boilerplate",
4
- "background": "#FFFFFF",
5
- "foreground": "#0F766E",
6
- "globalVariables": {
7
- "breakpoints": {
8
- "sm": 40,
9
- "md": 80,
10
- "lg": 90,
11
- "xl": 120
12
- },
13
- "breakpointData": {
14
- "sm": {
15
- "icon": "screenMobile",
16
- "label": "Mobile"
17
- },
18
- "md": {
19
- "icon": "screenTablet",
20
- "label": "Tablet"
21
- },
22
- "lg": {
23
- "icon": "screenDesktop",
24
- "label": "Desktop"
25
- },
26
- "xl": {
27
- "icon": "screenLarge",
28
- "label": "Large"
29
- }
30
- }
31
- }
32
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/infinum/eightshift-frontend-libs-tailwind/main/schemas/variation.json",
3
- "parentName": "card",
4
- "name": "card-simple",
5
- "title": "Card: Simple",
6
- "description" : "A simplified version of the Card.",
7
- "icon": {
8
- "src": "es-card-simple"
9
- },
10
- "attributes": {
11
- "cardCardParagraphUse": false,
12
- "cardCardButtonUse": false
13
- },
14
- "scope": [
15
- "inserter"
16
- ]
17
- }
@@ -1,12 +0,0 @@
1
- import { checkAttr, tailwindClasses } from '@eightshift/frontend-libs-tailwind/scripts';
2
- import manifest from './../manifest.json';
3
-
4
- export const WrapperEditor = ({ attributes, children }) => {
5
- const wrapperUse = checkAttr('wrapperUse', attributes, manifest);
6
-
7
- if (!wrapperUse) {
8
- return children;
9
- }
10
-
11
- return <div className={tailwindClasses(attributes, manifest)}>{children}</div>;
12
- };
@@ -1,364 +0,0 @@
1
- import { __ } from '@wordpress/i18n';
2
- import { checkAttr, getAttrKey, getHiddenOptions, getOption } from '@eightshift/frontend-libs-tailwind/scripts';
3
- import {
4
- BaseControl,
5
- ButtonGroup,
6
- ColorPicker,
7
- ContainerPanel,
8
- OptionSelect,
9
- Spacer,
10
- Responsive,
11
- InputField,
12
- } from '@eightshift/ui-components';
13
- import { icons } from '@eightshift/ui-components/icons';
14
- import { clsx } from '@eightshift/ui-components/utilities';
15
- import { getResponsiveData } from '@eightshift/frontend-libs-tailwind/scripts/helpers/breakpoints';
16
- import { getColorOption, rotationClassName } from '../../assets/scripts/shared';
17
- import manifest from './../manifest.json';
18
-
19
- export const WrapperOptions = ({ attributes, setAttributes }) => {
20
- const wrapperUse = checkAttr('wrapperUse', attributes, manifest);
21
- const wrapperNoControls = checkAttr('wrapperNoControls', attributes, manifest);
22
- const wrapperNoWidthControls = checkAttr('wrapperNoWidthControls', attributes, manifest);
23
-
24
- const wrapperWidth = checkAttr('wrapperWidth', attributes, manifest);
25
- const wrapperContentWidth = checkAttr('wrapperContentWidth', attributes, manifest);
26
-
27
- const wrapperBackground = checkAttr('wrapperBackground', attributes, manifest);
28
- const wrapperGradientDirection = checkAttr('wrapperGradientDirection', attributes, manifest);
29
-
30
- const wrapperBorderRadius = checkAttr('wrapperBorderRadius', attributes, manifest);
31
-
32
- const wrapperMarginTop = checkAttr('wrapperMarginTop', attributes, manifest);
33
- const wrapperMarginBottom = checkAttr('wrapperMarginBottom', attributes, manifest);
34
-
35
- const wrapperPaddingTop = checkAttr('wrapperPaddingTop', attributes, manifest);
36
- const wrapperPaddingBottom = checkAttr('wrapperPaddingBottom', attributes, manifest);
37
-
38
- const wrapperHide = checkAttr('wrapperHide', attributes, manifest);
39
-
40
- const wrapperId = checkAttr('wrapperId', attributes, manifest);
41
-
42
- const wrapperDisabledOptions = checkAttr('wrapperDisabledOptions', attributes, manifest);
43
-
44
- const hiddenOptions = getHiddenOptions(wrapperDisabledOptions);
45
-
46
- if (wrapperNoControls || wrapperDisabledOptions === 'all') {
47
- return null;
48
- }
49
-
50
- let backgroundType = 'none';
51
-
52
- if (wrapperBackground?.startsWith('solid-')) {
53
- backgroundType = 'solid';
54
- } else if (wrapperBackground?.startsWith('gradient-')) {
55
- backgroundType = 'gradient';
56
- }
57
-
58
- const responsiveData = getResponsiveData(true);
59
-
60
- return (
61
- <ContainerPanel
62
- title={__('Wrapper', '%g_textdomain%')}
63
- use={wrapperUse}
64
- actions={
65
- <OptionSelect
66
- aria-label={__('Width', '%g_textdomain%')}
67
- value={wrapperWidth}
68
- onChange={(value) =>
69
- setAttributes({
70
- [getAttrKey('wrapperWidth', attributes, manifest)]: value,
71
- [getAttrKey('wrapperUse', attributes, manifest)]: value !== 'off',
72
- })
73
- }
74
- options={getOption('wrapperWidth', attributes, manifest)}
75
- hidden={wrapperNoWidthControls}
76
- type='menu'
77
- wrapperProps={{
78
- triggerProps: { size: 'small' },
79
- }}
80
- inline
81
- />
82
- }
83
- closable
84
- >
85
- <Responsive
86
- value={wrapperContentWidth}
87
- onChange={(value) =>
88
- setAttributes({
89
- [getAttrKey('wrapperContentWidth', attributes, manifest)]: value,
90
- })
91
- }
92
- icon={icons.containerWidth}
93
- label={__('Width', '%g_textdomain%')}
94
- options={getOption('wrapperContentWidth', attributes, manifest)}
95
- hidden={wrapperNoWidthControls || hiddenOptions?.width}
96
- noModeSelect
97
- inline
98
- {...responsiveData}
99
- >
100
- {({ currentValue, handleChange, options }) => (
101
- <OptionSelect
102
- options={options}
103
- value={currentValue}
104
- onChange={(value) => handleChange(value)}
105
- type='menu'
106
- />
107
- )}
108
- </Responsive>
109
-
110
- <BaseControl
111
- icon={icons.backgroundType}
112
- label={__('Background', '%g_textdomain%')}
113
- hidden={hiddenOptions?.background}
114
- inline
115
- >
116
- <ButtonGroup>
117
- <OptionSelect
118
- options={getOption('wrapperBackground', attributes, manifest)}
119
- value={backgroundType}
120
- onChange={(value) => {
121
- if (value === 'none') {
122
- setAttributes({ [getAttrKey('wrapperBackground', attributes, manifest)]: undefined });
123
- } else {
124
- setAttributes({
125
- [getAttrKey('wrapperBackground', attributes, manifest)]: Object.keys(
126
- manifest.tailwind.options.wrapperBackground.twClasses,
127
- ).find((key) => key.startsWith(value)),
128
- });
129
- }
130
- }}
131
- aria-label={__('Background type', '%g_textdomain%')}
132
- type='menu'
133
- hidden={hiddenOptions?.backgroundType}
134
- noItemIcon
135
- />
136
-
137
- {backgroundType === 'solid' && (
138
- <ColorPicker
139
- colors={getColorOption('wrapperBackgroundSolid', manifest)}
140
- onChange={(value) =>
141
- setAttributes({ [getAttrKey('wrapperBackground', attributes, manifest)]: `solid-${value}` })
142
- }
143
- value={wrapperBackground?.replace('solid-', '')}
144
- aria-label={__('Background color', '%g_textdomain%')}
145
- hidden={hiddenOptions?.backgroundType}
146
- />
147
- )}
148
- {backgroundType === 'gradient' && (
149
- <>
150
- <OptionSelect
151
- value={wrapperBackground}
152
- onChange={(value) => setAttributes({ [getAttrKey('wrapperBackground', attributes, manifest)]: value })}
153
- options={getOption('wrapperBackgroundGradient', attributes, manifest).map((option) => ({
154
- ...option,
155
- icon: (
156
- <div
157
- className={clsx(
158
- 'es-uic-size-5 es-uic-rounded es-uic-border es-uic-border-gray-300 bg-gradient-to-r',
159
- manifest.tailwind.options.wrapperBackground.twClasses[option.value],
160
- )}
161
- />
162
- ),
163
- }))}
164
- wrapperProps={{
165
- triggerIcon: (
166
- <div
167
- className={clsx(
168
- 'es-uic-size-6 es-uic-rounded es-uic-border es-uic-border-gray-300 es-uic-shadow-sm bg-gradient-to-r',
169
- manifest.tailwind.options.wrapperBackground.twClasses[wrapperBackground],
170
- )}
171
- />
172
- ),
173
- }}
174
- aria-label={__('Gradient style', '%g_textdomain%')}
175
- hidden={hiddenOptions?.backgroundType}
176
- noTriggerLabel
177
- type='menu'
178
- />
179
- <OptionSelect
180
- value={wrapperGradientDirection}
181
- onChange={(value) =>
182
- setAttributes({ [getAttrKey('wrapperGradientDirection', attributes, manifest)]: value })
183
- }
184
- options={getOption('wrapperGradientDirection', attributes, manifest)}
185
- wrapperProps={{
186
- triggerIcon: <div className={rotationClassName[wrapperGradientDirection]}>{icons.arrowUpCircle}</div>,
187
- }}
188
- aria-label={__('Gradient angle', '%g_textdomain%')}
189
- hidden={hiddenOptions?.backgroundType}
190
- noTriggerLabel
191
- type='menu'
192
- />
193
- </>
194
- )}
195
- </ButtonGroup>
196
- </BaseControl>
197
-
198
- <OptionSelect
199
- icon={icons.roundedCorners}
200
- label={__('Rounded corners', '%g_textdomain%')}
201
- value={wrapperBorderRadius}
202
- onChange={(value) => setAttributes({ [getAttrKey('wrapperBorderRadius', attributes, manifest)]: value })}
203
- options={getOption('wrapperBorderRadius', attributes, manifest)}
204
- aria-label={__('Rounded corners', '%g_textdomain%')}
205
- type='menu'
206
- hidden={hiddenOptions?.roundedCorners}
207
- inline
208
- />
209
-
210
- <Spacer />
211
- <Spacer
212
- icon={icons.containerSpacingH}
213
- text={__('Spacing', '%g_textdomain%')}
214
- border
215
- />
216
-
217
- <Responsive
218
- value={wrapperMarginTop}
219
- onChange={(value) =>
220
- setAttributes({
221
- [getAttrKey('wrapperMarginTop', attributes, manifest)]: value,
222
- })
223
- }
224
- icon={icons.spacingTop}
225
- label={__('Top margin', '%g_textdomain%')}
226
- options={getOption('wrapperSpacing', attributes, manifest)}
227
- hidden={hiddenOptions?.marginTop}
228
- noModeSelect
229
- inline
230
- {...responsiveData}
231
- >
232
- {({ currentValue, handleChange, options }) => (
233
- <OptionSelect
234
- options={options}
235
- value={currentValue}
236
- onChange={(value) => handleChange(value)}
237
- type='menu'
238
- />
239
- )}
240
- </Responsive>
241
-
242
- <Responsive
243
- value={wrapperMarginBottom}
244
- onChange={(value) =>
245
- setAttributes({
246
- [getAttrKey('wrapperMarginBottom', attributes, manifest)]: value,
247
- })
248
- }
249
- icon={icons.spacingBottom}
250
- label={__('Bottom margin', '%g_textdomain%')}
251
- options={getOption('wrapperSpacing', attributes, manifest)}
252
- hidden={hiddenOptions?.marginBottom}
253
- noModeSelect
254
- inline
255
- {...responsiveData}
256
- >
257
- {({ currentValue, handleChange, options }) => (
258
- <OptionSelect
259
- options={options}
260
- value={currentValue}
261
- onChange={(value) => handleChange(value)}
262
- type='menu'
263
- />
264
- )}
265
- </Responsive>
266
-
267
- <Spacer />
268
-
269
- <Responsive
270
- value={wrapperPaddingTop}
271
- onChange={(value) =>
272
- setAttributes({
273
- [getAttrKey('wrapperPaddingTop', attributes, manifest)]: value,
274
- })
275
- }
276
- icon={icons.spacingTopIn}
277
- label={__('Top padding', '%g_textdomain%')}
278
- options={getOption('wrapperSpacing', attributes, manifest)}
279
- hidden={hiddenOptions?.paddingTop}
280
- noModeSelect
281
- inline
282
- {...responsiveData}
283
- >
284
- {({ currentValue, handleChange, options }) => (
285
- <OptionSelect
286
- options={options}
287
- value={currentValue}
288
- onChange={(value) => handleChange(value)}
289
- type='menu'
290
- />
291
- )}
292
- </Responsive>
293
-
294
- <Responsive
295
- value={wrapperPaddingBottom}
296
- onChange={(value) =>
297
- setAttributes({
298
- [getAttrKey('wrapperPaddingBottom', attributes, manifest)]: value,
299
- })
300
- }
301
- icon={icons.spacingBottomIn}
302
- label={__('Bottom padding', '%g_textdomain%')}
303
- options={getOption('wrapperSpacing', attributes, manifest)}
304
- hidden={hiddenOptions?.paddingBottom}
305
- noModeSelect
306
- inline
307
- {...responsiveData}
308
- >
309
- {({ currentValue, handleChange, options }) => (
310
- <OptionSelect
311
- options={options}
312
- value={currentValue}
313
- onChange={(value) => handleChange(value)}
314
- type='menu'
315
- />
316
- )}
317
- </Responsive>
318
-
319
- <Spacer />
320
- <Spacer
321
- icon={icons.moreHCircle}
322
- text={__('Advanced', '%g_textdomain%')}
323
- border
324
- />
325
-
326
- <Responsive
327
- value={wrapperHide}
328
- onChange={(value) =>
329
- setAttributes({
330
- [getAttrKey('wrapperHide', attributes, manifest)]: value,
331
- })
332
- }
333
- icon={icons.visibility}
334
- label={__('Visibility', '%g_textdomain%')}
335
- options={getOption('wrapperHide', attributes, manifest)}
336
- hidden={hiddenOptions?.hide}
337
- noModeSelect
338
- inline
339
- {...responsiveData}
340
- >
341
- {({ currentValue, handleChange, options, isInlineCollapsedView }) => (
342
- <OptionSelect
343
- options={options}
344
- value={String(currentValue)}
345
- onChange={(value) => handleChange(value)}
346
- noItemLabel={isInlineCollapsedView}
347
- noItemIcon={!isInlineCollapsedView}
348
- />
349
- )}
350
- </Responsive>
351
-
352
- <Spacer />
353
-
354
- <InputField
355
- icon={icons.id}
356
- label={__('Unique identifier', '%g_textdomain%')}
357
- value={wrapperId}
358
- onChange={(value) => setAttributes({ [getAttrKey('wrapperId', attributes, manifest)]: value })}
359
- className='es-uic-font-mono'
360
- hidden={hiddenOptions?.id}
361
- />
362
- </ContainerPanel>
363
- );
364
- };