@eightshift/frontend-libs-tailwind 2.1.0 → 2.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.
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [2.1.1]
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Updated Media and File pickers image component.
|
|
14
|
+
|
|
9
15
|
## [2.1.0]
|
|
10
16
|
|
|
11
17
|
### Changed
|
|
@@ -256,6 +262,7 @@ Co-authored with @piqusy
|
|
|
256
262
|
- Initial release.
|
|
257
263
|
|
|
258
264
|
[Unreleased]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/master...HEAD
|
|
265
|
+
[2.1.1]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.1.0...2.1.1
|
|
259
266
|
[2.1.0]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.7...2.1.0
|
|
260
267
|
[2.0.7]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.6...2.0.7
|
|
261
268
|
[2.0.6]: https://github.com/infinum/eightshift-frontend-libs-tailwind/compare/2.0.5...2.0.6
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eightshift/frontend-libs-tailwind",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.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",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@wordpress/api-fetch": "^7.32.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@eightshift/ui-components": "^5.
|
|
70
|
+
"@eightshift/ui-components": "^5.5.0"
|
|
71
71
|
},
|
|
72
72
|
"sideEffects": false,
|
|
73
73
|
"lint-staged": {
|
|
@@ -51,11 +51,6 @@ export const ManageFileButton = (props) => {
|
|
|
51
51
|
|
|
52
52
|
const strings = {
|
|
53
53
|
file: {
|
|
54
|
-
buttonTooltip: {
|
|
55
|
-
browse: __('Select a file from Media library', 'eightshift-frontend-libs-tailwind'),
|
|
56
|
-
upload: __('Upload a file', 'eightshift-frontend-libs-tailwind'),
|
|
57
|
-
replace: __('Replace file', 'eightshift-frontend-libs-tailwind'),
|
|
58
|
-
},
|
|
59
54
|
buttonLabel: {
|
|
60
55
|
browse: __('Select', 'eightshift-frontend-libs-tailwind'),
|
|
61
56
|
upload: __('Upload', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -73,11 +68,6 @@ export const ManageFileButton = (props) => {
|
|
|
73
68
|
},
|
|
74
69
|
},
|
|
75
70
|
video: {
|
|
76
|
-
buttonTooltip: {
|
|
77
|
-
browse: __('Select a video from Media library', 'eightshift-frontend-libs-tailwind'),
|
|
78
|
-
upload: __('Upload a video', 'eightshift-frontend-libs-tailwind'),
|
|
79
|
-
replace: __('Replace video', 'eightshift-frontend-libs-tailwind'),
|
|
80
|
-
},
|
|
81
71
|
modalTitle: {
|
|
82
72
|
browse: __('Select a video', 'eightshift-frontend-libs-tailwind'),
|
|
83
73
|
upload: __('Upload a video', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -85,11 +75,6 @@ export const ManageFileButton = (props) => {
|
|
|
85
75
|
},
|
|
86
76
|
},
|
|
87
77
|
image: {
|
|
88
|
-
buttonTooltip: {
|
|
89
|
-
browse: __('Select an image from Media library', 'eightshift-frontend-libs-tailwind'),
|
|
90
|
-
upload: __('Upload an image', 'eightshift-frontend-libs-tailwind'),
|
|
91
|
-
replace: __('Replace image', 'eightshift-frontend-libs-tailwind'),
|
|
92
|
-
},
|
|
93
78
|
modalTitle: {
|
|
94
79
|
browse: __('Select an image', 'eightshift-frontend-libs-tailwind'),
|
|
95
80
|
upload: __('Upload an image', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -97,11 +82,6 @@ export const ManageFileButton = (props) => {
|
|
|
97
82
|
},
|
|
98
83
|
},
|
|
99
84
|
subtitle: {
|
|
100
|
-
buttonTooltip: {
|
|
101
|
-
browse: __('Select a subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
102
|
-
upload: __('Upload a subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
103
|
-
replace: __('Replace subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
104
|
-
},
|
|
105
85
|
modalTitle: {
|
|
106
86
|
browse: __('Select a subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
107
87
|
upload: __('Upload a subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -109,11 +89,6 @@ export const ManageFileButton = (props) => {
|
|
|
109
89
|
},
|
|
110
90
|
},
|
|
111
91
|
geoJson: {
|
|
112
|
-
buttonTooltip: {
|
|
113
|
-
browse: __('Select a GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
114
|
-
upload: __('Upload a GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
115
|
-
replace: __('Replace GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
116
|
-
},
|
|
117
92
|
modalTitle: {
|
|
118
93
|
browse: __('Select a GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
119
94
|
upload: __('Upload a GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -121,11 +96,6 @@ export const ManageFileButton = (props) => {
|
|
|
121
96
|
},
|
|
122
97
|
},
|
|
123
98
|
lottie: {
|
|
124
|
-
buttonTooltip: {
|
|
125
|
-
browse: __('Select a Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
126
|
-
upload: __('Upload a Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
127
|
-
replace: __('Replace Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
128
|
-
},
|
|
129
99
|
modalTitle: {
|
|
130
100
|
browse: __('Select a Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
131
101
|
upload: __('Upload a Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -133,11 +103,6 @@ export const ManageFileButton = (props) => {
|
|
|
133
103
|
},
|
|
134
104
|
},
|
|
135
105
|
rive: {
|
|
136
|
-
buttonTooltip: {
|
|
137
|
-
browse: __('Select a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
138
|
-
upload: __('Upload a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
139
|
-
replace: __('Replace Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
140
|
-
},
|
|
141
106
|
modalTitle: {
|
|
142
107
|
browse: __('Select a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
143
108
|
upload: __('Upload a Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
@@ -145,14 +110,12 @@ export const ManageFileButton = (props) => {
|
|
|
145
110
|
},
|
|
146
111
|
},
|
|
147
112
|
custom: {
|
|
148
|
-
buttonTooltip: labels?.buttonTooltip,
|
|
149
113
|
buttonLabel: labels?.buttonLabel,
|
|
150
114
|
modalTitle: labels?.modalTitle,
|
|
151
115
|
buttonIcon: labels?.buttonIcon,
|
|
152
116
|
},
|
|
153
117
|
};
|
|
154
118
|
|
|
155
|
-
const buttonTooltip = strings?.[kind]?.buttonTooltip?.[type] ?? strings.file.buttonTooltip?.[type];
|
|
156
119
|
const buttonLabel = strings?.[kind]?.buttonLabel?.[type] ?? strings.file.buttonLabel?.[type];
|
|
157
120
|
const buttonIcon = strings?.[kind]?.buttonIcon?.[type] ?? strings.file.buttonIcon?.[type];
|
|
158
121
|
const modalTitle = strings?.[kind]?.modalTitle?.[type] ?? strings.file.modalTitle?.[type];
|
|
@@ -216,17 +179,6 @@ export const FileSelector = (props) => {
|
|
|
216
179
|
labels,
|
|
217
180
|
};
|
|
218
181
|
|
|
219
|
-
const removeTooltips = {
|
|
220
|
-
file: __('Remove file', 'eightshift-frontend-libs-tailwind'),
|
|
221
|
-
image: __('Remove image', 'eightshift-frontend-libs-tailwind'),
|
|
222
|
-
video: __('Remove video', 'eightshift-frontend-libs-tailwind'),
|
|
223
|
-
subtitle: __('Remove subtitle file', 'eightshift-frontend-libs-tailwind'),
|
|
224
|
-
geoJson: __('Remove GeoJSON file', 'eightshift-frontend-libs-tailwind'),
|
|
225
|
-
lottie: __('Remove Lottie animation', 'eightshift-frontend-libs-tailwind'),
|
|
226
|
-
rive: __('Remove Rive animation', 'eightshift-frontend-libs-tailwind'),
|
|
227
|
-
custom: labels?.removeTooltip,
|
|
228
|
-
};
|
|
229
|
-
|
|
230
182
|
const fileIcons = {
|
|
231
183
|
image: icons.imageFile,
|
|
232
184
|
video: icons.videoFile,
|
|
@@ -256,12 +208,14 @@ export const FileSelector = (props) => {
|
|
|
256
208
|
>
|
|
257
209
|
<ManageFileButton
|
|
258
210
|
{...commonManageFileButtonProps}
|
|
211
|
+
buttonProps={{ className: 'es:grow' }}
|
|
259
212
|
currentId={fileId}
|
|
260
213
|
type='replace'
|
|
261
214
|
/>
|
|
262
215
|
|
|
263
216
|
<Button
|
|
264
217
|
onPress={() => onChange({ id: undefined, url: undefined })}
|
|
218
|
+
className='es:grow'
|
|
265
219
|
hidden={noDelete}
|
|
266
220
|
>
|
|
267
221
|
{__('Remove', 'eightshift-frontend-libs-tailwind')}
|
|
@@ -64,23 +64,37 @@ export const MediaPicker = (props) => {
|
|
|
64
64
|
}
|
|
65
65
|
className={className}
|
|
66
66
|
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
onChange={onChange}
|
|
70
|
-
currentId={imageId}
|
|
71
|
-
allowedTypes={allowedTypes}
|
|
72
|
-
buttonProps={{
|
|
73
|
-
type: 'glass',
|
|
74
|
-
}}
|
|
75
|
-
/>
|
|
67
|
+
{({ isDark, isTransparent }) => {
|
|
68
|
+
let buttonType = 'default';
|
|
76
69
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
if (!isTransparent) {
|
|
71
|
+
buttonType = isDark ? 'glass' : 'glassDark';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
<MediaButton
|
|
77
|
+
type='replace'
|
|
78
|
+
onChange={onChange}
|
|
79
|
+
currentId={imageId}
|
|
80
|
+
allowedTypes={allowedTypes}
|
|
81
|
+
buttonProps={{
|
|
82
|
+
type: buttonType,
|
|
83
|
+
className: 'es:grow',
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<Button
|
|
88
|
+
onPress={() => onChange({ id: undefined, url: undefined })}
|
|
89
|
+
className='es:grow'
|
|
90
|
+
type={buttonType}
|
|
91
|
+
hidden={noDelete}
|
|
92
|
+
>
|
|
93
|
+
{__('Remove', 'eightshift-frontend-libs-tailwind')}
|
|
94
|
+
</Button>
|
|
95
|
+
</>
|
|
96
|
+
);
|
|
97
|
+
}}
|
|
84
98
|
</FilePickerShell>
|
|
85
99
|
);
|
|
86
100
|
};
|