@eightshift/frontend-libs-tailwind 1.4.7 → 1.5.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.
- package/CHANGELOG.md +17 -0
- package/bun.lockb +0 -0
- package/package.json +30 -30
- package/scripts/components/block-inserter.js +1 -1
- package/scripts/components/file-picker.js +17 -3
- package/scripts/components/picker-placeholder.js +5 -7
- package/scripts/components/server-side-render.js +1 -1
- package/scripts/components/settings/settings.js +21 -20
- package/scripts/helpers/cookies.js +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,21 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [1.5.0]
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Rive-related strings to `FilePicker`.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- Updated dependencies.
|
|
16
|
+
- Updated internal components to use ES UIC 2.x/3.x classnames.
|
|
17
|
+
|
|
18
|
+
## [1.4.8]
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `domain parameter` to setCookie function.
|
|
23
|
+
|
|
9
24
|
## [1.4.7]
|
|
10
25
|
|
|
11
26
|
### Changed
|
|
@@ -169,6 +184,8 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
169
184
|
- Initial release.
|
|
170
185
|
|
|
171
186
|
[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
|
|
187
|
+
[1.5.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.8...1.5.0
|
|
188
|
+
[1.4.8]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.7...1.4.8
|
|
172
189
|
[1.4.7]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.6...1.4.7
|
|
173
190
|
[1.4.6]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.5...1.4.6
|
|
174
191
|
[1.4.5]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/1.4.4...1.4.5
|
package/bun.lockb
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightshift/frontend-libs-tailwind",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A framework for creating modern Gutenberg themes with styling provided by Tailwind CSS.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Eightshift team",
|
|
@@ -34,47 +34,47 @@
|
|
|
34
34
|
"homepage": "https://github.com/infinum/eightshift-frontend-libs-tailwind#readme",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eightshift/ui-components": "^
|
|
38
|
-
"@stylistic/eslint-plugin-js": "^2.
|
|
39
|
-
"@stylistic/stylelint-plugin": "^3.1.
|
|
40
|
-
"@swc/core": "^1.
|
|
41
|
-
"@wordpress/api-fetch": "^7.
|
|
42
|
-
"@wordpress/block-editor": "^14.
|
|
37
|
+
"@eightshift/ui-components": "^3.0.0",
|
|
38
|
+
"@stylistic/eslint-plugin-js": "^4.2.0",
|
|
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
43
|
"@wordpress/dependency-extraction-webpack-plugin": "^5.9.0",
|
|
44
|
-
"@wordpress/dom-ready": "^4.
|
|
45
|
-
"@wordpress/server-side-render": "^5.
|
|
46
|
-
"browserslist": "^4.24.
|
|
44
|
+
"@wordpress/dom-ready": "^4.19.0",
|
|
45
|
+
"@wordpress/server-side-render": "^5.19.0",
|
|
46
|
+
"browserslist": "^4.24.4",
|
|
47
47
|
"css-loader": "^7.1.2",
|
|
48
|
-
"css-minimizer-webpack-plugin": "^7.0.
|
|
49
|
-
"eslint": "^9.
|
|
50
|
-
"eslint-config-prettier": "^
|
|
51
|
-
"eslint-plugin-prettier": "^5.2.
|
|
52
|
-
"globals": "^
|
|
48
|
+
"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",
|
|
52
|
+
"globals": "^16.0.0",
|
|
53
53
|
"husky": "^9.1.7",
|
|
54
|
-
"lightningcss": "^1.
|
|
54
|
+
"lightningcss": "^1.29.2",
|
|
55
55
|
"mini-css-extract-plugin": "^2.9.2",
|
|
56
|
-
"postcss": "^8.
|
|
56
|
+
"postcss": "^8.5.3",
|
|
57
57
|
"postcss-loader": "^8.1.1",
|
|
58
|
-
"prettier": "^3.
|
|
59
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
60
|
-
"sonner": "^
|
|
61
|
-
"stylelint": "^16.
|
|
62
|
-
"stylelint-config-standard": "^
|
|
58
|
+
"prettier": "^3.5.3",
|
|
59
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
60
|
+
"sonner": "^2.0.1",
|
|
61
|
+
"stylelint": "^16.15.0",
|
|
62
|
+
"stylelint-config-standard": "^37.0.0",
|
|
63
63
|
"swc-loader": "^0.2.6",
|
|
64
|
-
"terser-webpack-plugin": "^5.3.
|
|
65
|
-
"webpack": "^5.
|
|
66
|
-
"webpack-cli": "^
|
|
64
|
+
"terser-webpack-plugin": "^5.3.14",
|
|
65
|
+
"webpack": "^5.98.0",
|
|
66
|
+
"webpack-cli": "^6.0.1",
|
|
67
67
|
"webpack-manifest-plugin": "^5.0.0",
|
|
68
68
|
"webpack-merge": "^6.0.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"embla-carousel": "^8.5.
|
|
71
|
+
"embla-carousel": "^8.5.2",
|
|
72
72
|
"fluid-tailwind": "^1.0.4",
|
|
73
|
-
"lint-staged": "^15.
|
|
73
|
+
"lint-staged": "^15.4.3",
|
|
74
74
|
"micromodal": "^0.4.10",
|
|
75
|
-
"ol": "^10.
|
|
76
|
-
"ol-mapbox-style": "^12.
|
|
77
|
-
"tailwindcss": "^
|
|
75
|
+
"ol": "^10.4.0",
|
|
76
|
+
"ol-mapbox-style": "^12.5.0",
|
|
77
|
+
"tailwindcss": "^4.0.12",
|
|
78
78
|
"tailwindcss-animate": "^1.0.7"
|
|
79
79
|
},
|
|
80
80
|
"sideEffects": false,
|
|
@@ -123,6 +123,18 @@ export const ManageFileButton = (props) => {
|
|
|
123
123
|
replace: __('Select a new Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
|
+
rive: {
|
|
127
|
+
buttonTooltip: {
|
|
128
|
+
browse: __('Select a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
129
|
+
upload: __('Upload a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
130
|
+
replace: __('Replace Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
131
|
+
},
|
|
132
|
+
modalTitle: {
|
|
133
|
+
browse: __('Select a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
134
|
+
upload: __('Upload a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
135
|
+
replace: __('Select a new Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
126
138
|
custom: {
|
|
127
139
|
buttonTooltip: labels?.buttonTooltip,
|
|
128
140
|
buttonLabel: labels?.buttonLabel,
|
|
@@ -174,7 +186,7 @@ export const ManageFileButton = (props) => {
|
|
|
174
186
|
*
|
|
175
187
|
* @returns {JSX.Element} The FileSelector component.
|
|
176
188
|
*
|
|
177
|
-
* @typedef {'file' | 'image' | 'video' | 'subtitle' | 'geoJson' | 'lottie' | 'custom'} FileKind
|
|
189
|
+
* @typedef {'file' | 'image' | 'video' | 'subtitle' | 'geoJson' | 'lottie' | 'rive' | 'custom'} FileKind
|
|
178
190
|
*
|
|
179
191
|
* @example
|
|
180
192
|
* <FileSelector
|
|
@@ -202,6 +214,7 @@ export const FileSelector = (props) => {
|
|
|
202
214
|
subtitle: __('Remove subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
203
215
|
geoJson: __('Remove GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
204
216
|
lottie: __('Remove Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
217
|
+
rive: __('Remove Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
205
218
|
custom: labels?.removeTooltip,
|
|
206
219
|
};
|
|
207
220
|
|
|
@@ -211,6 +224,7 @@ export const FileSelector = (props) => {
|
|
|
211
224
|
subtitle: icons.closedCaptions,
|
|
212
225
|
geoJson: icons.fileMetadata,
|
|
213
226
|
lottie: icons.animationFile,
|
|
227
|
+
rive: icons.animationFile,
|
|
214
228
|
custom: labels?.removeIcon,
|
|
215
229
|
};
|
|
216
230
|
|
|
@@ -222,7 +236,7 @@ export const FileSelector = (props) => {
|
|
|
222
236
|
>
|
|
223
237
|
<HStack
|
|
224
238
|
noWrap
|
|
225
|
-
className='es
|
|
239
|
+
className='es:pl-1'
|
|
226
240
|
>
|
|
227
241
|
<ManageFileButton {...commonManageFileButtonProps} />
|
|
228
242
|
{!noUpload && (
|
|
@@ -236,7 +250,7 @@ export const FileSelector = (props) => {
|
|
|
236
250
|
</FilePlaceholder>
|
|
237
251
|
|
|
238
252
|
<AnimatedVisibility
|
|
239
|
-
visible={fileName}
|
|
253
|
+
visible={(fileName ?? '').length > 0}
|
|
240
254
|
noInitial
|
|
241
255
|
>
|
|
242
256
|
<HStack noWrap>
|
|
@@ -60,14 +60,14 @@ export const PickerPlaceholder = (props) => {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<div className='es
|
|
63
|
+
<div className='es:font-sans es:border-gray-200 es:mx-auto es:grid es:max-w-72 es:grid-cols-2 es:gap-1.5 es:rounded-lg es:border es:p-3 es:text-xs es:shadow-lg'>
|
|
64
64
|
<RichLabel
|
|
65
65
|
icon={icon}
|
|
66
66
|
label={title}
|
|
67
|
-
className='col-span-2 mb-2
|
|
67
|
+
className='col-span-2 mb-2 font-medium !text-gray-400 select-none'
|
|
68
68
|
/>
|
|
69
69
|
|
|
70
|
-
<span className='es
|
|
70
|
+
<span className='es:col-span-2 es:select-none es:justify-self-center'>{presetsHeading}</span>
|
|
71
71
|
|
|
72
72
|
{presets.map(({ name, icon, blocks: blockData, attributes: attrsToSet }, index) => {
|
|
73
73
|
return (
|
|
@@ -92,11 +92,9 @@ export const PickerPlaceholder = (props) => {
|
|
|
92
92
|
|
|
93
93
|
{inserter && (
|
|
94
94
|
<>
|
|
95
|
-
<span className='es
|
|
96
|
-
{__('or', 'fe-libs-tailwind')}
|
|
97
|
-
</span>
|
|
95
|
+
<span className='es:col-span-2 es:select-none es:justify-self-center'>{__('or', 'fe-libs-tailwind')}</span>
|
|
98
96
|
|
|
99
|
-
<div className='es
|
|
97
|
+
<div className='es:col-span-2 es:justify-self-center'>
|
|
100
98
|
{inserter}
|
|
101
99
|
|
|
102
100
|
{inserter === true && (
|
|
@@ -30,7 +30,7 @@ export const ServerSideRender = (props) => {
|
|
|
30
30
|
block={block}
|
|
31
31
|
attributes={attributes}
|
|
32
32
|
className={clsx(
|
|
33
|
-
'es
|
|
33
|
+
'es:pointer-events-none es:rounded-lg es:border es:border-dotted es:border-gray-300 es:p-2 es:flow-root',
|
|
34
34
|
className,
|
|
35
35
|
)}
|
|
36
36
|
/>
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { Toaster } from 'sonner';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { Button,
|
|
5
|
+
import { Button, OptionsPanelHeader } from '@eightshift/ui-components';
|
|
6
6
|
import { icons } from '@eightshift/ui-components/icons';
|
|
7
7
|
import { createContext } from '@wordpress/element';
|
|
8
|
-
import { clsx } from '@eightshift/ui-components/utilities';
|
|
9
8
|
import { useThemeOptions } from './use-theme-options';
|
|
10
9
|
|
|
11
10
|
export const EsThemeOptionsContext = createContext(null);
|
|
@@ -19,25 +18,27 @@ export const ThemeOptionsPage = ({
|
|
|
19
18
|
const { isLoading, saveSettings } = themeOptions;
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
<>
|
|
22
|
+
<EsThemeOptionsContext.Provider value={themeOptions}>
|
|
23
|
+
<OptionsPanelHeader
|
|
24
|
+
title={title}
|
|
25
|
+
actions={
|
|
26
|
+
<Button
|
|
27
|
+
onPress={() => saveSettings()}
|
|
28
|
+
disabled={isLoading}
|
|
29
|
+
icon={isLoading ? icons.moreH : icons.save}
|
|
30
|
+
>
|
|
31
|
+
{isLoading
|
|
32
|
+
? __('Saving...', 'eightshift-frontend-libs-tailwind')
|
|
33
|
+
: __('Save', 'eightshift-frontend-libs-tailwind')}
|
|
34
|
+
</Button>
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
38
37
|
|
|
39
38
|
{children}
|
|
40
|
-
</
|
|
41
|
-
|
|
39
|
+
</EsThemeOptionsContext.Provider>
|
|
40
|
+
|
|
41
|
+
<Toaster richColors />
|
|
42
|
+
</>
|
|
42
43
|
);
|
|
43
44
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Helper to set and unset cookies.
|
|
3
3
|
*/
|
|
4
4
|
export const cookies = {
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Set a cookie value
|
|
7
8
|
*
|
|
@@ -9,7 +10,7 @@ export const cookies = {
|
|
|
9
10
|
* @param {string} value - Cookie value.
|
|
10
11
|
* @param {number} time - Number denoting the expiration of the cookie.
|
|
11
12
|
* @param {string} path - URL path that must exist in the requested URL in order to send the Cookie header.
|
|
12
|
-
*
|
|
13
|
+
* @param {string?} domain - Cookie domain. Optional.
|
|
13
14
|
* @access public
|
|
14
15
|
*
|
|
15
16
|
* @returns {void}
|
|
@@ -19,16 +20,22 @@ export const cookies = {
|
|
|
19
20
|
* cookies.setCookie('gdpr', '2', cookies.setOneDay(), '/');
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
|
-
setCookie(key, value, time, path) {
|
|
23
|
+
setCookie(key, value, time, path, domain) {
|
|
23
24
|
const expires = new Date();
|
|
24
|
-
expires.setTime(expires.getTime() + time);
|
|
25
|
+
expires.setTime(expires.getTime() + (time));
|
|
26
|
+
|
|
25
27
|
let pathValue = '';
|
|
28
|
+
let domainValue = '';
|
|
26
29
|
|
|
27
30
|
if (typeof path !== 'undefined') {
|
|
28
|
-
pathValue =
|
|
31
|
+
pathValue = `;path=${path}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (typeof domain !== 'undefined') {
|
|
35
|
+
domainValue = `;domain=${domain}`;
|
|
29
36
|
}
|
|
30
37
|
|
|
31
|
-
document.cookie = `${key}=${value}
|
|
38
|
+
document.cookie = `${key}=${value}${pathValue}${domainValue};expires=${expires.toUTCString()}`;
|
|
32
39
|
},
|
|
33
40
|
|
|
34
41
|
/**
|