@squiz/resource-browser 3.3.1 → 3.3.2
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
@@ -16,7 +16,7 @@ const SelectedState = ({ resource, showThumbnail, icon, label, description, isDi
|
|
16
16
|
const replaceAsset = (react_1.default.createElement(resource_browser_ui_lib_1.ModalTrigger, { overlayTriggerState: modalController, showLabel: false, label: "Replace selection", containerClasses: "text-gray-500 hover:text-gray-800 focus:text-gray-800 disabled:text-gray-500 disabled:cursor-not-allowed", icon: react_1.default.createElement(CircledLoopIcon_1.CircledLoopIcon, { "aria-hidden": true, className: "m-1" }), isDisabled: isDisabled, scope: "squiz-rb-scope" }, resourcePickerContainer));
|
17
17
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
18
18
|
showThumbnail && resource.squizImage ? (react_1.default.createElement("div", { className: "checkered-bg w-[56px] h-[56px] overflow-hidden flex justify-center items-center rounded" },
|
19
|
-
react_1.default.createElement("img", { src: resource.squizImage.imageVariations.original.url || resource.url, className: "w-full h-full object-cover object-center", alt: resource.squizImage.name || resource.name }))) : (react_1.default.createElement("div", { className: "w-4 h-
|
19
|
+
react_1.default.createElement("img", { src: resource.squizImage.imageVariations.original.url || resource.url, className: "w-full h-full object-cover object-center", alt: resource.squizImage.name || resource.name }))) : (react_1.default.createElement("div", { className: "w-4 h-5 mt-1 flex self-start overflow-hidden" }, icon)),
|
20
20
|
react_1.default.createElement("div", { className: "justify-self-start self-center w-full overflow-hidden break-words" },
|
21
21
|
label,
|
22
22
|
description),
|
package/lib/index.css
CHANGED
@@ -5005,6 +5005,9 @@
|
|
5005
5005
|
.squiz-rb-scope .h-4:not(.squiz-rb-plugin *) {
|
5006
5006
|
height: 1rem;
|
5007
5007
|
}
|
5008
|
+
.squiz-rb-scope .h-5:not(.squiz-rb-plugin *) {
|
5009
|
+
height: 1.25rem;
|
5010
|
+
}
|
5008
5011
|
.squiz-rb-scope .h-6:not(.squiz-rb-plugin *) {
|
5009
5012
|
height: 1.5rem;
|
5010
5013
|
}
|
@@ -6050,11 +6053,21 @@
|
|
6050
6053
|
padding: 0.25rem 0;
|
6051
6054
|
border-bottom: 1px solid #ededed;
|
6052
6055
|
}
|
6053
|
-
.squiz-rb-scope .searchItem--selected .searchItem__button:not(.squiz-rb-plugin *) {
|
6056
|
+
.squiz-rb-scope .searchItem.searchItem--selected .searchItem__button:not(.squiz-rb-plugin *) {
|
6054
6057
|
background-color: #e6f1fa;
|
6055
6058
|
border-radius: 0.5rem;
|
6056
6059
|
}
|
6057
|
-
.squiz-rb-scope .searchItem--selected .searchItem__label:not(.squiz-rb-plugin *) {
|
6060
|
+
.squiz-rb-scope .searchItem.searchItem--selected .searchItem__label:not(.squiz-rb-plugin *) {
|
6061
|
+
color: #044985;
|
6062
|
+
}
|
6063
|
+
.squiz-rb-scope .searchItem.searchItem--selected:hover .searchItem__button:not(.squiz-rb-plugin *),
|
6064
|
+
.squiz-rb-scope .searchItem.searchItem--selected:focus .searchItem__button:not(.squiz-rb-plugin *),
|
6065
|
+
.squiz-rb-scope .searchItem.searchItem--selected:focus-within .searchItem__button:not(.squiz-rb-plugin *) {
|
6066
|
+
background-color: #e6f1fa;
|
6067
|
+
}
|
6068
|
+
.squiz-rb-scope .searchItem.searchItem--selected:hover .searchItem__label:not(.squiz-rb-plugin *),
|
6069
|
+
.squiz-rb-scope .searchItem.searchItem--selected:focus .searchItem__label:not(.squiz-rb-plugin *),
|
6070
|
+
.squiz-rb-scope .searchItem.searchItem--selected:focus-within .searchItem__label:not(.squiz-rb-plugin *) {
|
6058
6071
|
color: #044985;
|
6059
6072
|
}
|
6060
6073
|
.squiz-rb-scope .searchItem:hover .searchItem__button:not(.squiz-rb-plugin *),
|
@@ -6105,7 +6118,7 @@
|
|
6105
6118
|
line-height: 24px;
|
6106
6119
|
text-align: center;
|
6107
6120
|
letter-spacing: -0.4px;
|
6108
|
-
color: #
|
6121
|
+
color: #949494;
|
6109
6122
|
}
|
6110
6123
|
.squiz-rb-scope .no-search-result-container .no-result-message:not(.squiz-rb-plugin *) {
|
6111
6124
|
margin-top: 1rem;
|
@@ -6272,6 +6285,74 @@
|
|
6272
6285
|
.squiz-rb-scope .image-info__loading:not(.squiz-rb-plugin *) {
|
6273
6286
|
margin-top: 80px;
|
6274
6287
|
}
|
6288
|
+
.squiz-rb-scope .divider:not(.squiz-rb-plugin *) {
|
6289
|
+
width: 100%;
|
6290
|
+
padding: 0 1.25rem;
|
6291
|
+
}
|
6292
|
+
.squiz-rb-scope .empty-wrapper:not(.squiz-rb-plugin *) {
|
6293
|
+
align-items: center;
|
6294
|
+
color: #707070;
|
6295
|
+
display: flex;
|
6296
|
+
flex-direction: column;
|
6297
|
+
}
|
6298
|
+
.squiz-rb-scope .empty-text:not(.squiz-rb-plugin *) {
|
6299
|
+
padding-left: 1.25rem;
|
6300
|
+
padding-right: 1.25rem;
|
6301
|
+
}
|
6302
|
+
.squiz-rb-scope .empty-text__select:not(.squiz-rb-plugin *) {
|
6303
|
+
padding-top: 1.5rem;
|
6304
|
+
padding-bottom: 1rem;
|
6305
|
+
}
|
6306
|
+
.squiz-rb-scope .empty-text__select svg:not(.squiz-rb-plugin *) {
|
6307
|
+
height: 72px;
|
6308
|
+
width: 72px;
|
6309
|
+
}
|
6310
|
+
.squiz-rb-scope .empty-text__select svg path:not(.squiz-rb-plugin *) {
|
6311
|
+
fill: #bababa;
|
6312
|
+
}
|
6313
|
+
.squiz-rb-scope .image-info__details-list:not(.squiz-rb-plugin *) {
|
6314
|
+
width: 270px;
|
6315
|
+
display: flex;
|
6316
|
+
flex-direction: column;
|
6317
|
+
margin: 1rem 0;
|
6318
|
+
width: 100%;
|
6319
|
+
padding: 0 1.25rem;
|
6320
|
+
}
|
6321
|
+
.squiz-rb-scope .info__details-list:not(.squiz-rb-plugin *) {
|
6322
|
+
width: 270px;
|
6323
|
+
display: flex;
|
6324
|
+
flex-direction: column;
|
6325
|
+
margin: 1rem 0;
|
6326
|
+
width: 100%;
|
6327
|
+
padding: 0 1.25rem;
|
6328
|
+
}
|
6329
|
+
.squiz-rb-scope .info__details-item:not(.squiz-rb-plugin *) {
|
6330
|
+
display: flex;
|
6331
|
+
margin-bottom: 0.5rem;
|
6332
|
+
padding-left: 0.25rem;
|
6333
|
+
}
|
6334
|
+
.squiz-rb-scope .info__details-label:not(.squiz-rb-plugin *) {
|
6335
|
+
color: #707070;
|
6336
|
+
width: 60px;
|
6337
|
+
display: flex;
|
6338
|
+
}
|
6339
|
+
.squiz-rb-scope .info__details-value:not(.squiz-rb-plugin *) {
|
6340
|
+
margin-left: 20px;
|
6341
|
+
color: #3d3d3d;
|
6342
|
+
}
|
6343
|
+
.squiz-rb-scope .info__title:not(.squiz-rb-plugin *) {
|
6344
|
+
padding: 0 2.2rem;
|
6345
|
+
margin: 1rem 0;
|
6346
|
+
color: #3d3d3d;
|
6347
|
+
}
|
6348
|
+
.squiz-rb-scope .loader__container:not(.squiz-rb-plugin *) {
|
6349
|
+
display: flex;
|
6350
|
+
justify-content: center;
|
6351
|
+
align-items: center;
|
6352
|
+
height: 100%;
|
6353
|
+
width: 100%;
|
6354
|
+
color: #949494;
|
6355
|
+
}
|
6275
6356
|
.squiz-rb-scope .resource-picker:not(.squiz-rb-plugin *) {
|
6276
6357
|
display: grid;
|
6277
6358
|
grid-template-columns: 24px 1fr;
|
package/package.json
CHANGED
@@ -60,7 +60,7 @@ export const SelectedState = ({
|
|
60
60
|
/>
|
61
61
|
</div>
|
62
62
|
) : (
|
63
|
-
<div className="w-4 h-
|
63
|
+
<div className="w-4 h-5 mt-1 flex self-start overflow-hidden">{icon}</div>
|
64
64
|
)}
|
65
65
|
{/* Center columns */}
|
66
66
|
<div className="justify-self-start self-center w-full overflow-hidden break-words">
|
@@ -85,26 +85,28 @@ export const createPlugins = (callbackWait: number, headerPortal = false, resour
|
|
85
85
|
setTimeout(() => {
|
86
86
|
resolve({
|
87
87
|
showThumbnail: resource.squizImage ? true : false,
|
88
|
-
icon: <Icon icon={resource.type.code} resourceSource="matrix" className="
|
88
|
+
icon: <Icon icon={resource.type.code} resourceSource="matrix" className="" />,
|
89
89
|
label: resource.name || resource.squizImage?.name || resource.id,
|
90
|
-
description:
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
90
|
+
description: resource.squizImage
|
91
|
+
? [
|
92
|
+
<dl
|
93
|
+
key="1"
|
94
|
+
className="col-start-2 col-end-2 flex flex-row gap-1 justify-self-start items-center font-normal text-sm"
|
95
|
+
>
|
96
|
+
<div>
|
97
|
+
<span>{type} plugin</span>
|
98
|
+
<dt className="hidden">Asset size</dt>
|
99
|
+
<dd className="text-gray-600">
|
100
|
+
{resource.squizImage && (
|
101
|
+
<>
|
102
|
+
{fileSize} kB , {fileWidth} x {fileHeight}px
|
103
|
+
</>
|
104
|
+
)}
|
105
|
+
</dd>
|
106
|
+
</div>
|
107
|
+
</dl>,
|
108
|
+
]
|
109
|
+
: undefined,
|
108
110
|
});
|
109
111
|
}, callbackWait);
|
110
112
|
});
|
@@ -121,6 +123,7 @@ export const createPlugins = (callbackWait: number, headerPortal = false, resour
|
|
121
123
|
}
|
122
124
|
useEffect(() => {
|
123
125
|
if (unresolvedResource !== null) {
|
126
|
+
const forceType: string = unresolvedResource.forceResourceType;
|
124
127
|
setTimeout(() => {
|
125
128
|
setIsLoading(false);
|
126
129
|
setResource({
|
@@ -129,23 +132,25 @@ export const createPlugins = (callbackWait: number, headerPortal = false, resour
|
|
129
132
|
url: 'https://cdn.mediavalet.com/aunsw/squiz/KfIjcjUJz0O6kWoInBys5A/XpBxg3Hj-0qOXFWnAAWvXQ/Large/RX-7.jpeg',
|
130
133
|
source: unresolvedResource.source,
|
131
134
|
type: {
|
132
|
-
code: 'jpeg',
|
135
|
+
code: forceType ? forceType : 'jpeg',
|
133
136
|
name: 'JPEG image',
|
134
137
|
},
|
135
|
-
squizImage:
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
138
|
+
squizImage: forceType
|
139
|
+
? undefined
|
140
|
+
: {
|
141
|
+
name: 'An image from Bynder',
|
142
|
+
imageVariations: {
|
143
|
+
original: {
|
144
|
+
width: 1024,
|
145
|
+
height: 900,
|
146
|
+
url: 'https://cdn.mediavalet.com/aunsw/squiz/KfIjcjUJz0O6kWoInBys5A/XpBxg3Hj-0qOXFWnAAWvXQ/Large/RX-7.jpeg',
|
147
|
+
mimeType: 'image/jpeg',
|
148
|
+
byteSize: 1068,
|
149
|
+
sha1Hash: '',
|
150
|
+
aspectRatio: '',
|
151
|
+
},
|
152
|
+
},
|
153
|
+
},
|
149
154
|
});
|
150
155
|
}, callbackWait);
|
151
156
|
} else {
|
package/src/index.stories.tsx
CHANGED
@@ -74,6 +74,16 @@ Selected.args = {
|
|
74
74
|
},
|
75
75
|
};
|
76
76
|
|
77
|
+
export const SelectedFile = Template.bind({});
|
78
|
+
SelectedFile.args = {
|
79
|
+
...Primary.args,
|
80
|
+
value: {
|
81
|
+
resourceId: '1f7a25b4-380f-4540-9555-8be2dcab4019',
|
82
|
+
sourceId: 'c90feac1-55f3-4e1f-9b56-c22829e3f510',
|
83
|
+
forceResourceType: 'pdf',
|
84
|
+
},
|
85
|
+
};
|
86
|
+
|
77
87
|
export const ImagesOnly = Template.bind({});
|
78
88
|
ImagesOnly.args = {
|
79
89
|
...Primary.args,
|