@eightshift/frontend-libs-tailwind 1.0.0 → 1.1.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 (84) hide show
  1. package/.husky/pre-commit +0 -0
  2. package/CHANGELOG.md +20 -1
  3. package/blocks/init/assets/fonts/fraunces-italic-latin-extended.woff2 +0 -0
  4. package/blocks/init/assets/fonts/fraunces-italic-latin.woff2 +0 -0
  5. package/blocks/init/assets/fonts/fraunces-latin-extended.woff2 +0 -0
  6. package/blocks/init/assets/fonts/fraunces-latin.woff2 +0 -0
  7. package/blocks/init/assets/fonts/noto-sans-italic-latin-extended.woff2 +0 -0
  8. package/blocks/init/assets/fonts/noto-sans-italic-latin.woff2 +0 -0
  9. package/blocks/init/assets/fonts/noto-sans-latin-extended.woff2 +0 -0
  10. package/blocks/init/assets/fonts/noto-sans-latin.woff2 +0 -0
  11. package/blocks/init/src/Blocks/assets/scripts/shared.js +1 -3
  12. package/blocks/init/src/Blocks/assets/styles/application-blocks-frontend.css +0 -3
  13. package/blocks/init/src/Blocks/assets/styles/editor/editor-overrides.css +1 -1
  14. package/blocks/init/src/Blocks/assets/styles/fonts.css +90 -0
  15. package/blocks/init/src/Blocks/assets/styles/tailwind.css +1 -5
  16. package/blocks/init/src/Blocks/components/admin-theme-options/assets-admin/pages/parts.js +1 -0
  17. package/blocks/init/src/Blocks/components/button/components/button-editor.js +1 -5
  18. package/blocks/init/src/Blocks/components/button/components/button-options.js +2 -21
  19. package/blocks/init/src/Blocks/components/button/manifest.json +8 -8
  20. package/blocks/init/src/Blocks/components/card/components/card-editor.js +1 -2
  21. package/blocks/init/src/Blocks/components/card/components/card-options.js +0 -1
  22. package/blocks/init/src/Blocks/components/heading/components/heading-editor.js +1 -5
  23. package/blocks/init/src/Blocks/components/image/components/image-editor.js +1 -7
  24. package/blocks/init/src/Blocks/components/image/components/image-options.js +3 -17
  25. package/blocks/init/src/Blocks/components/list/components/list-options.js +1 -3
  26. package/blocks/init/src/Blocks/components/load-more/assets/load-more.js +1 -2
  27. package/blocks/init/src/Blocks/components/load-more/components/load-more-options.js +1 -0
  28. package/blocks/init/src/Blocks/components/modal/assets/index.js +7 -9
  29. package/blocks/init/src/Blocks/components/paragraph/components/paragraph-options.js +1 -3
  30. package/blocks/init/src/Blocks/components/paragraph/manifest.json +14 -16
  31. package/blocks/init/src/Blocks/components/post-header/post-header.php +1 -1
  32. package/blocks/init/src/Blocks/components/share/assets/index.js +1 -5
  33. package/blocks/init/src/Blocks/components/share/components/share-editor.js +7 -4
  34. package/blocks/init/src/Blocks/components/share/components/share-options.js +2 -11
  35. package/blocks/init/src/Blocks/components/video/components/video-editor.js +2 -4
  36. package/blocks/init/src/Blocks/components/video/components/video-options.js +5 -27
  37. package/blocks/init/src/Blocks/custom/accordion/assets/index.js +1 -1
  38. package/blocks/init/src/Blocks/custom/accordion/components/accordion-editor.js +6 -1
  39. package/blocks/init/src/Blocks/custom/carousel/assets/pagination.js +3 -8
  40. package/blocks/init/src/Blocks/custom/column/components/column-editor.js +4 -1
  41. package/blocks/init/src/Blocks/custom/column/components/column-options.js +5 -12
  42. package/blocks/init/src/Blocks/custom/columns/components/columns-editor.js +2 -6
  43. package/blocks/init/src/Blocks/custom/featured-content/components/featured-content-options.js +18 -30
  44. package/blocks/init/src/Blocks/custom/featured-content/partials/cards.php +5 -5
  45. package/blocks/init/src/Blocks/custom/group/components/group-editor.js +1 -3
  46. package/blocks/init/src/Blocks/custom/heading/heading-transforms.js +1 -0
  47. package/blocks/init/src/Blocks/custom/map/assets/map-controller.js +0 -1
  48. package/blocks/init/src/Blocks/custom/map/components/map-components.js +3 -3
  49. package/blocks/init/src/Blocks/custom/map/components/map-editor.js +2 -12
  50. package/blocks/init/src/Blocks/custom/map/components/map-options.js +10 -46
  51. package/blocks/init/src/Blocks/custom/paragraph/paragraph-transforms.js +1 -0
  52. package/blocks/init/src/Blocks/custom/site-footer/components/site-footer-options.js +1 -3
  53. package/blocks/init/src/Blocks/custom/table-of-contents/components/table-of-contents-editor.js +1 -1
  54. package/blocks/init/src/Blocks/manifest.json +22 -4
  55. package/blocks/init/src/Blocks/wrapper/components/wrapper-options.js +4 -19
  56. package/blocks/init/src/Blocks/wrapper/wrapper.js +1 -4
  57. package/linters/base.config.mjs +1 -1
  58. package/linters/eslint.config.mjs +1 -2
  59. package/linters/stylelint.config.js +9 -13
  60. package/package.json +92 -92
  61. package/schemas/block.json +4 -0
  62. package/schemas/component.json +4 -0
  63. package/scripts/components/block-inserter.js +8 -14
  64. package/scripts/components/file-picker.js +42 -39
  65. package/scripts/components/index.js +1 -0
  66. package/scripts/components/link-section-editor.js +6 -2
  67. package/scripts/components/picker-placeholder.js +109 -0
  68. package/scripts/components/server-side-render.js +2 -4
  69. package/scripts/components/settings/settings.js +3 -14
  70. package/scripts/components/settings/use-theme-options.js +2 -2
  71. package/scripts/editor/attributes.js +3 -9
  72. package/scripts/editor/colors.js +43 -41
  73. package/scripts/editor/editor.js +9 -16
  74. package/scripts/editor/fetch.js +26 -19
  75. package/scripts/editor/hooks.js +1 -0
  76. package/scripts/editor/options.js +2 -4
  77. package/scripts/editor/registration.js +51 -128
  78. package/scripts/editor/tailwindcss.js +118 -37
  79. package/scripts/helpers/breakpoints.js +3 -8
  80. package/scripts/helpers/cookies.js +2 -1
  81. package/scripts/helpers/index.js +1 -7
  82. package/scripts/index.js +2 -0
  83. package/scripts/plugins/yoast-seo.js +2 -3
  84. package/linters/ignore-gitignored.mjs +0 -9
package/.husky/pre-commit CHANGED
File without changes
package/CHANGELOG.md CHANGED
@@ -4,10 +4,29 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).
6
6
 
7
- ## [1.0.0] - 2024-06
7
+ ## [1.1.1] - 2024-07-11
8
+ - Fixed default global manifest.
9
+ - Removed erroneous styles.
10
+
11
+ ## [1.1.0] - 2024-07-09
12
+ - Updated dependencies.
13
+ - Tweaked fetch script to use WP `apiFetch`.
14
+ - Added new options to the fetch script: `truncateTitle` and `labelProp`
15
+ - Removed `urlBase` option from fetch script, as it's no longer needed.
16
+ - Updated some built-in blocks
17
+ - Moved fonts from Google Fonts to built-in.
18
+ - Removed `.gitignore` ESLint ignore.
19
+ - Tweaked ESLint config.
20
+ - Updated base blocks.
21
+ - Added `hidden` prop to `BlockInserter`.
22
+ - Added `PickerPlaceholder` component.
23
+ - Added option for dynamic parts and the `getTwDynamicPart` helper.
8
24
 
25
+ ## [1.0.0] - 2024-06
9
26
  - Initial release.
10
27
 
11
28
  [Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
12
29
 
30
+ [1.1.1]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.1.0...1.1.1
31
+ [1.1.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.0.0...1.1.0
13
32
  [1.0.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/0.0.1...1.0.0
@@ -5,9 +5,7 @@ const colorData = getColorData(themeColors);
5
5
 
6
6
  export const getColorOption = (key, manifest) => {
7
7
  if (!manifest?.options?.[key]) {
8
- throw new Error(
9
- `The key ${key} is not defined in the manifest options for ${manifest?.componentName ?? manifest?.title}.`,
10
- );
8
+ throw new Error(`The key ${key} is not defined in the manifest options for ${manifest?.componentName ?? manifest?.title}.`);
11
9
  }
12
10
 
13
11
  return colorData?.filter(({ slug }) => manifest?.options?.[key]?.includes(slug)) ?? [];
@@ -7,6 +7,3 @@
7
7
  * Usage: `WordPress frontend screen`.
8
8
  *
9
9
  */
10
-
11
- /* OpenLayers */
12
- @import '~ol/ol.css';
@@ -11,5 +11,5 @@
11
11
  }
12
12
 
13
13
  .editor-styles-wrapper.block-editor-writing-flow {
14
- @apply p-0;
14
+ @apply p-0 font-sans;
15
15
  }
@@ -0,0 +1,90 @@
1
+ /*
2
+ Font definitions
3
+ Font files are split by charset to optimize loading.
4
+
5
+ Fonts used are from Google Fonts.
6
+ */
7
+
8
+ /* Fraunces Italic - Latin extended */
9
+ @font-face {
10
+ font-family: 'Fraunces';
11
+ font-style: italic;
12
+ font-weight: 100 900;
13
+ font-display: swap;
14
+ src: url('../../../../assets/fonts/fraunces-italic-latin-extended.woff2') format('woff2');
15
+ unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
16
+ }
17
+
18
+ /* Fraunces Italic - Latin */
19
+ @font-face {
20
+ font-family: 'Fraunces';
21
+ font-style: italic;
22
+ font-weight: 100 900;
23
+ font-display: swap;
24
+ src: url('../../../../assets/fonts/fraunces-italic-latin.woff2') format('woff2');
25
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
26
+ }
27
+
28
+ /* Fraunces - Latin extended */
29
+ @font-face {
30
+ font-family: 'Fraunces';
31
+ font-style: normal;
32
+ font-weight: 100 900;
33
+ font-display: swap;
34
+ src: url('../../../../assets/fonts/fraunces-latin-extended.woff2') format('woff2');
35
+ unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
36
+ }
37
+
38
+ /* Fraunces - Latin */
39
+ @font-face {
40
+ font-family: 'Fraunces';
41
+ font-style: normal;
42
+ font-weight: 100 900;
43
+ font-display: swap;
44
+ src: url('../../../../assets/fonts/fraunces-latin.woff2') format('woff2');
45
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
46
+ }
47
+
48
+ /* Noto Sans Italic - Latin extended */
49
+ @font-face {
50
+ font-family: 'Noto Sans';
51
+ font-style: italic;
52
+ font-weight: 100 900;
53
+ font-stretch: 62.5% 100%;
54
+ font-display: swap;
55
+ src: url('../../../../assets/fonts/noto-sans-italic-latin-extended.woff2') format('woff2');
56
+ unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
57
+ }
58
+
59
+ /* Noto Sans Italic - Latin */
60
+ @font-face {
61
+ font-family: 'Noto Sans';
62
+ font-style: italic;
63
+ font-weight: 100 900;
64
+ font-stretch: 62.5% 100%;
65
+ font-display: swap;
66
+ src: url('../../../../assets/fonts/noto-sans-italic-latin.woff2') format('woff2');
67
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
68
+ }
69
+
70
+ /* Noto Sans - Latin extended */
71
+ @font-face {
72
+ font-family: 'Noto Sans';
73
+ font-style: normal;
74
+ font-weight: 100 900;
75
+ font-stretch: 62.5% 100%;
76
+ font-display: swap;
77
+ src: url('../../../../assets/fonts/noto-sans-latin-extended.woff2') format('woff2');
78
+ unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
79
+ }
80
+
81
+ /* Noto Sans - Latin */
82
+ @font-face {
83
+ font-family: 'Noto Sans';
84
+ font-style: normal;
85
+ font-weight: 100 900;
86
+ font-stretch: 62.5% 100%;
87
+ font-display: swap;
88
+ src: url('../../../../assets/fonts/noto-sans-latin.woff2') format('woff2');
89
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
90
+ }
@@ -1,8 +1,4 @@
1
- /* Fonts */
2
- @import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&display=swap');
3
- @import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,100..900,0..100,0..1;1,9..144,100..900,0..100,0..1&display=swap');
4
-
5
- /* stylelint-disable scss/at-rule-no-unknown */
1
+ /* stylelint-disable at-rule-no-unknown */
6
2
  @tailwind base;
7
3
  @tailwind components;
8
4
  @tailwind utilities;
@@ -6,6 +6,7 @@ import { EsThemeOptionsContext } from '@eightshift/frontend-libs-tailwind/script
6
6
 
7
7
  export const Parts = ({ patterns }) => {
8
8
  const { settings, updateSettings, isLoading } = useContext(EsThemeOptionsContext);
9
+
9
10
  return (
10
11
  <OptionsPanel>
11
12
  <OptionsPanelSection>
@@ -7,11 +7,7 @@ import manifest from './../manifest.json';
7
7
  export const ButtonEditor = (attributes) => {
8
8
  const { componentClass } = manifest;
9
9
 
10
- const {
11
- setAttributes,
12
- additionalClass,
13
- placeholder = __('Add content', '%g_textdomain%'),
14
- } = attributes;
10
+ const { setAttributes, additionalClass, placeholder = __('Add content', '%g_textdomain%') } = attributes;
15
11
 
16
12
  const buttonContent = checkAttr('buttonContent', attributes, manifest);
17
13
  const buttonUse = checkAttr('buttonUse', attributes, manifest);
@@ -1,26 +1,7 @@
1
1
  import { __ } from '@wordpress/i18n';
2
- import {
3
- getOption,
4
- checkAttr,
5
- getAttrKey,
6
- props,
7
- getOptions,
8
- wpSearchRoute,
9
- getHiddenOptions,
10
- } from '@eightshift/frontend-libs-tailwind/scripts';
2
+ import { getOption, checkAttr, getAttrKey, props, getOptions, wpSearchRoute, getHiddenOptions } from '@eightshift/frontend-libs-tailwind/scripts';
11
3
  import { IconOptions } from '../../icon/components/icon-options';
12
- import {
13
- BaseControl,
14
- ButtonGroup,
15
- ColorPicker,
16
- ComponentToggle,
17
- HStack,
18
- InputField,
19
- LinkInput,
20
- OptionSelect,
21
- Spacer,
22
- Toggle,
23
- } from '@eightshift/ui-components';
4
+ import { ButtonGroup, ColorPicker, ComponentToggle, HStack, InputField, LinkInput, OptionSelect, Spacer, Toggle } from '@eightshift/ui-components';
24
5
  import { icons } from '@eightshift/ui-components/icons';
25
6
  import { upperFirst } from '@eightshift/ui-components/utilities';
26
7
  import manifest from './../manifest.json';
@@ -222,49 +222,49 @@
222
222
  "buttonColor": "navy-100",
223
223
  "buttonVariant": "secondary"
224
224
  },
225
- "twClasses": "text-navy-100 border-navy-100 focus-visible:ring-navy-500/30 hover:bg-navy-50"
225
+ "twClasses": "text-navy-100 border-navy-100 focus-visible:ring-navy-500/30 hover:bg-navy-100 hover:text-navy-950"
226
226
  },
227
227
  {
228
228
  "attributes": {
229
229
  "buttonColor": "navy-800",
230
230
  "buttonVariant": "secondary"
231
231
  },
232
- "twClasses": "text-navy-800 border-navy-800 focus-visible:ring-navy-500/30 hover:bg-navy-50"
232
+ "twClasses": "text-navy-800 border-navy-800 focus-visible:ring-navy-500/30 hover:bg-navy-800 hover:text-navy-50"
233
233
  },
234
234
  {
235
235
  "attributes": {
236
236
  "buttonColor": "red-100",
237
237
  "buttonVariant": "secondary"
238
238
  },
239
- "twClasses": "text-red-100 border-red-100 focus-visible:ring-red-500/30 hover:bg-red-50"
239
+ "twClasses": "text-red-100 border-red-100 focus-visible:ring-red-500/30 hover:bg-red-100 hover:text-red-950"
240
240
  },
241
241
  {
242
242
  "attributes": {
243
243
  "buttonColor": "red-800",
244
244
  "buttonVariant": "secondary"
245
245
  },
246
- "twClasses": "text-red-800 border-red-800 focus-visible:ring-red-500/30 hover:bg-red-50"
246
+ "twClasses": "text-red-800 border-red-800 focus-visible:ring-red-500/30 hover:bg-red-800 hover:text-red-50"
247
247
  },
248
248
  {
249
249
  "attributes": {
250
250
  "buttonColor": "gray-100",
251
251
  "buttonVariant": "secondary"
252
252
  },
253
- "twClasses": "text-gray-100 border-gray-100 focus-visible:ring-gray-500/30 hover:bg-gray-50"
253
+ "twClasses": "text-gray-100 border-gray-100 focus-visible:ring-gray-500/30 hover:bg-gray-100 hover:text-gray-950"
254
254
  },
255
255
  {
256
256
  "attributes": {
257
257
  "buttonColor": "gray-500",
258
258
  "buttonVariant": "secondary"
259
259
  },
260
- "twClasses": "text-gray-500 border-gray-500 focus-visible:ring-gray-500/30 hover:bg-gray-50"
260
+ "twClasses": "text-gray-500 border-gray-500 focus-visible:ring-gray-500/30 hover:bg-gray-500 hover:text-white"
261
261
  },
262
262
  {
263
263
  "attributes": {
264
264
  "buttonColor": "gray-800",
265
265
  "buttonVariant": "secondary"
266
266
  },
267
- "twClasses": "text-gray-800 border-gray-800 focus-visible:ring-gray-500/30"
267
+ "twClasses": "text-gray-800 border-gray-800 focus-visible:ring-gray-500/30 hover:bg-gray-800 hover:text-gray-50"
268
268
  },
269
269
  {
270
270
  "attributes": {
@@ -278,7 +278,7 @@
278
278
  "buttonColor": "white",
279
279
  "buttonVariant": "link"
280
280
  },
281
- "twClasses": "text-gray-50 decoration-gray-100 hover:bg-gray-100 focus-visible:ring-gray-500/30 hover:ring-gray-100"
281
+ "twClasses": "text-gray-50 decoration-gray-100 hover:bg-gray-100 focus-visible:ring-gray-500/30 hover:ring-gray-100 hover:text-gray-950 hover:decoration-gray-400"
282
282
  },
283
283
  {
284
284
  "attributes": {
@@ -15,8 +15,7 @@ export const CardEditor = (attributes) => {
15
15
  additionalClass: {
16
16
  image: getTwPart('image', manifest),
17
17
  picture: getTwPart('imagePicture', manifest),
18
- imagePlaceholder:
19
- '!border-x-0 !border-t-0 !border-solid !w-full !h-auto aspect-3/2 [&_svg]:!size-12 border-b !rounded-none bg-gray-100 !border-b-gray-200',
18
+ imagePlaceholder: '!border-x-0 !border-t-0 !border-solid !w-full !h-auto aspect-3/2 [&_svg]:!size-12 border-b !rounded-none bg-gray-100 !border-b-gray-200',
20
19
  },
21
20
  })}
22
21
  />
@@ -19,7 +19,6 @@ export const CardOptions = (attributes) => {
19
19
  options={getOption('cardAlign', attributes, manifest)}
20
20
  onChange={(value) => setAttributes({ [getAttrKey('cardAlign', attributes, manifest)]: value })}
21
21
  aria-label={__('Card align', '%g_textdomain%')}
22
- itemProps={{ size: 'large' }}
23
22
  noItemLabel
24
23
  />
25
24
 
@@ -4,11 +4,7 @@ import { checkAttr, getAttrKey, getTwClasses } from '@eightshift/frontend-libs-t
4
4
  import manifest from './../manifest.json';
5
5
 
6
6
  export const HeadingEditor = (attributes) => {
7
- const {
8
- setAttributes,
9
- additionalClass,
10
- placeholder = __('Heading', '%g_textdomain%'),
11
- } = attributes;
7
+ const { setAttributes, additionalClass, placeholder = __('Heading', '%g_textdomain%') } = attributes;
12
8
 
13
9
  const headingUse = checkAttr('headingUse', attributes, manifest);
14
10
 
@@ -1,10 +1,4 @@
1
- import {
2
- checkAttr,
3
- getBreakpointData,
4
- getBreakpointNames,
5
- getTwClasses,
6
- getTwPart,
7
- } from '@eightshift/frontend-libs-tailwind/scripts';
1
+ import { checkAttr, getBreakpointData, getBreakpointNames, getTwClasses, getTwPart } from '@eightshift/frontend-libs-tailwind/scripts';
8
2
  import { ImagePlaceholder } from '@eightshift/ui-components';
9
3
  import manifest from './../manifest.json';
10
4
 
@@ -1,13 +1,5 @@
1
1
  import { __ } from '@wordpress/i18n';
2
- import {
3
- checkAttr,
4
- getAttrKey,
5
- MediaPicker,
6
- generateOptionsFromValue,
7
- getOption,
8
- getHiddenOptions,
9
- getResponsiveData,
10
- } from '@eightshift/frontend-libs-tailwind/scripts';
2
+ import { checkAttr, getAttrKey, MediaPicker, generateOptionsFromValue, getOption, getHiddenOptions, getResponsiveData } from '@eightshift/frontend-libs-tailwind/scripts';
11
3
  import manifest from './../manifest.json';
12
4
  import { ComponentToggle, OptionSelect, Responsive, Spacer, Toggle } from '@eightshift/ui-components';
13
5
  import { icons } from '@eightshift/ui-components/icons';
@@ -41,11 +33,7 @@ export const ImageOptions = (attributes) => {
41
33
  icon={icons.imageFile}
42
34
  label={__('Image', 'eightshift-ui-components')}
43
35
  options={generateOptionsFromValue(imageData, (v) =>
44
- truncateMiddle(
45
- v?.url?.replace(window.location.origin, '')?.replace(/\/wp-content\/uploads\/\d{4}\/\d{2}\//g, '') ??
46
- __('Not set', '%g_textdomain%'),
47
- 15,
48
- ),
36
+ truncateMiddle(v?.url?.replace(window.location.origin, '')?.replace(/\/wp-content\/uploads\/\d{4}\/\d{2}\//g, '') ?? __('Not set', '%g_textdomain%'), 15),
49
37
  )}
50
38
  hidden={hiddenOptions?.imagePicker}
51
39
  {...responsiveData}
@@ -98,9 +86,7 @@ export const ImageOptions = (attributes) => {
98
86
  icon={icons.expandXl}
99
87
  label={__('Stretch', '%g_textdomain%')}
100
88
  checked={imageSize === 'stretch'}
101
- onChange={(value) =>
102
- setAttributes({ [getAttrKey('imageSize', attributes, manifest)]: value ? 'stretch' : 'default' })
103
- }
89
+ onChange={(value) => setAttributes({ [getAttrKey('imageSize', attributes, manifest)]: value ? 'stretch' : 'default' })}
104
90
  hidden={hiddenOptions?.stretch}
105
91
  />
106
92
 
@@ -35,9 +35,7 @@ export const ListOptions = (attributes) => {
35
35
  <ToggleButton
36
36
  selected={listFontWeight === '700'}
37
37
  icon={icons.bold}
38
- onChange={(value) =>
39
- setAttributes({ [getAttrKey('listFontWeight', attributes, manifest)]: value ? '700' : '400' })
40
- }
38
+ onChange={(value) => setAttributes({ [getAttrKey('listFontWeight', attributes, manifest)]: value ? '700' : '400' })}
41
39
  tooltip={__('Bold', '%g_textdomain%')}
42
40
  hidden={hiddenOptions.weight}
43
41
  />
@@ -59,6 +59,7 @@ export class LoadMore {
59
59
  // Disable 'Load more' button if something went wrong.
60
60
  if (!received || !received?.success) {
61
61
  this.element.disabled = true;
62
+
62
63
  return;
63
64
  }
64
65
 
@@ -127,8 +128,6 @@ export class LoadMore {
127
128
  return;
128
129
  }
129
130
 
130
- console.log({ param });
131
-
132
131
  this.page = param;
133
132
  this.loadFromQueryParam = true;
134
133
  };
@@ -4,6 +4,7 @@ import manifest from '../manifest.json';
4
4
 
5
5
  export const LoadMoreOptions = (attributes) => {
6
6
  const { setAttributes, label, noUseToggle, controlOnly } = attributes;
7
+
7
8
  return (
8
9
  <ButtonOptions
9
10
  label={label ?? manifest.title}
@@ -11,17 +11,15 @@ domReady(() => {
11
11
  }
12
12
 
13
13
  elements.forEach((element) => {
14
- document
15
- .querySelectorAll(`[href=":open-modal-${element.id}:"],[data-micromodal-trigger="${element.id}"]`)
16
- .forEach((trigger) => {
17
- trigger.addEventListener('click', (event) => {
18
- event.preventDefault();
14
+ document.querySelectorAll(`[href=":open-modal-${element.id}:"],[data-micromodal-trigger="${element.id}"]`).forEach((trigger) => {
15
+ trigger.addEventListener('click', (event) => {
16
+ event.preventDefault();
19
17
 
20
- MicroModal.show(element.id, {
21
- disableScroll: true,
22
- awaitCloseAnimation: true,
23
- });
18
+ MicroModal.show(element.id, {
19
+ disableScroll: true,
20
+ awaitCloseAnimation: true,
24
21
  });
25
22
  });
23
+ });
26
24
  });
27
25
  });
@@ -34,9 +34,7 @@ export const ParagraphOptions = (attributes) => {
34
34
  <ToggleButton
35
35
  selected={paragraphFontWeight === '700'}
36
36
  icon={icons.bold}
37
- onChange={(value) =>
38
- setAttributes({ [getAttrKey('paragraphFontWeight', attributes, manifest)]: value ? '700' : '400' })
39
- }
37
+ onChange={(value) => setAttributes({ [getAttrKey('paragraphFontWeight', attributes, manifest)]: value ? '700' : '400' })}
40
38
  tooltip={__('Bold', '%g_textdomain%')}
41
39
  hidden={hiddenOptions.weight}
42
40
  />
@@ -59,23 +59,21 @@
59
59
  ]
60
60
  },
61
61
  "tailwind": {
62
- "tailwind": {
63
- "base": {
64
- "twClasses": "font-sans [&>a]:underline font-synthesis-none"
62
+ "base": {
63
+ "twClasses": "font-sans [&>a]:underline font-synthesis-none"
64
+ },
65
+ "options": {
66
+ "paragraphSize": {
67
+ "twClasses": {
68
+ "sm": "text-sm",
69
+ "base": "~sm/md:~text-sm/base",
70
+ "md": "~sm/md:~text-lg/2xl",
71
+ "lg": "~sm/md:~text-xl/3xl"
72
+ }
65
73
  },
66
- "options": {
67
- "paragraphSize": {
68
- "twClasses": {
69
- "sm": "text-sm",
70
- "base": "~sm/md:~text-sm/base",
71
- "md": "~sm/md:~text-lg/2xl",
72
- "lg": "~sm/md:~text-xl/3xl"
73
- }
74
- },
75
- "paragraphFontWeight": {
76
- "twClasses": {
77
- "700": "font-bold"
78
- }
74
+ "paragraphFontWeight": {
75
+ "twClasses": {
76
+ "700": "font-bold"
79
77
  }
80
78
  }
81
79
  }
@@ -17,7 +17,7 @@ $featuredImage = get_the_post_thumbnail_url(get_the_ID(), 'full') ?? '';
17
17
  <?php if (!empty($featuredImage)) { ?>
18
18
  <img class="w-full h-80 col-span-full -z-10 object-cover row-start-1" src="<?php echo esc_attr($featuredImage); ?>" alt="" role="presentation">
19
19
  <?php } ?>
20
- <div class="~sm/md:~mx-4/12 ~sm/md:~px-4/8 ~sm/md:~py-4/6 col-start-2 row-start-1 bg-black/75 text-white border border-b-0 border-black/25 backdrop-blur-2xl backdrop-brightness-200 backdrop-saturate-150 self-end">
20
+ <div class="~sm/md:~mx-4/12 ~sm/md:~px-4/8 ~sm/md:~py-4/6 col-start-2 row-start-1 bg-black/75 text-white border border-b-0 border-black/25 backdrop-blur-2xl backdrop-brightness-110 backdrop-saturate-150 self-end">
21
21
  <h1 class="font-display text-balance font-synthesis-none ~text-5xl/6xl !leading-none font-soft-25 italic"><?php echo esc_html(get_the_title()); ?></h1>
22
22
  <span class="opacity-75 text-sm"><?php echo esc_html(get_the_date()); ?></span>
23
23
  </div>
@@ -17,11 +17,7 @@ domReady(async () => {
17
17
  if ('share' in navigator && navigator?.canShare(navigatorShareData)) {
18
18
  await navigator?.share(navigatorShareData);
19
19
  } else {
20
- window.open(
21
- shareUrl,
22
- 'share-post',
23
- 'height=600,width=800,left=0,top=0,location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1'
24
- );
20
+ window.open(shareUrl, 'share-post', 'height=600,width=800,left=0,top=0,location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1');
25
21
  }
26
22
  };
27
23
 
@@ -3,9 +3,7 @@ import { JsxSvg } from '@eightshift/ui-components/icons';
3
3
  import manifest from '../manifest.json';
4
4
 
5
5
  export const ShareEditor = (attributes) => {
6
- const {
7
- additionalClass,
8
- } = attributes;
6
+ const { additionalClass } = attributes;
9
7
 
10
8
  const shareUse = checkAttr('shareUse', attributes, manifest);
11
9
 
@@ -18,7 +16,12 @@ export const ShareEditor = (attributes) => {
18
16
  return (
19
17
  <div className={getTwPart('container', manifest, additionalClass)}>
20
18
  {shareTargets.map((network) => {
21
- return <JsxSvg className={getTwPart('icon', manifest)} svg={manifest?.networks?.[network]?.icon} />;
19
+ return (
20
+ <JsxSvg
21
+ className={getTwPart('icon', manifest)}
22
+ svg={manifest?.networks?.[network]?.icon}
23
+ />
24
+ );
22
25
  })}
23
26
  </div>
24
27
  );
@@ -1,14 +1,7 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import { checkAttr, getAttrKey, getHiddenOptions } from '@eightshift/frontend-libs-tailwind/scripts';
3
3
  import manifest from '../manifest.json';
4
- import {
5
- ComponentToggle,
6
- OptionSelect,
7
- DraggableList,
8
- DraggableListItem,
9
- Spacer,
10
- Switch,
11
- } from '@eightshift/ui-components';
4
+ import { ComponentToggle, OptionSelect, DraggableList, DraggableListItem, Spacer, Switch } from '@eightshift/ui-components';
12
5
  import { icons, JsxSvg } from '@eightshift/ui-components/icons';
13
6
 
14
7
  export const ShareOptions = (attributes) => {
@@ -43,9 +36,7 @@ export const ShareOptions = (attributes) => {
43
36
  },
44
37
  ];
45
38
 
46
- const pickerSectionTitle = shareMode
47
- ? __('Share targets', '%g_textdomain%')
48
- : __('Social networks', '%g_textdomain%');
39
+ const pickerSectionTitle = shareMode ? __('Share targets', '%g_textdomain%') : __('Social networks', '%g_textdomain%');
49
40
 
50
41
  return (
51
42
  <ComponentToggle
@@ -34,8 +34,7 @@ export const VideoEditor = (attributes) => {
34
34
  setAttributes({
35
35
  [getAttrKey('videoId', attributes, manifest)]: id,
36
36
  [getAttrKey('videoUrl', attributes, manifest)]: url,
37
- [getAttrKey('videoMimeType', attributes, manifest)]:
38
- typeof mime === 'undefined' ? mime_type : mime,
37
+ [getAttrKey('videoMimeType', attributes, manifest)]: typeof mime === 'undefined' ? mime_type : mime,
39
38
  })
40
39
  }
41
40
  allowedTypes={['video/mp4', 'video/webm']}
@@ -48,8 +47,7 @@ export const VideoEditor = (attributes) => {
48
47
  setAttributes({
49
48
  [getAttrKey('videoId', attributes, manifest)]: id,
50
49
  [getAttrKey('videoUrl', attributes, manifest)]: url,
51
- [getAttrKey('videoMimeType', attributes, manifest)]:
52
- typeof mime === 'undefined' ? mime_type : mime,
50
+ [getAttrKey('videoMimeType', attributes, manifest)]: typeof mime === 'undefined' ? mime_type : mime,
53
51
  })
54
52
  }
55
53
  allowedTypes={['video/mp4', 'video/webm']}