@squiz/resource-browser 1.39.1-alpha.8 → 1.40.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/lib/index.css
CHANGED
@@ -526,6 +526,9 @@
|
|
526
526
|
.squiz-rb-scope .block {
|
527
527
|
display: block;
|
528
528
|
}
|
529
|
+
.squiz-rb-scope .inline-block {
|
530
|
+
display: inline-block;
|
531
|
+
}
|
529
532
|
.squiz-rb-scope .flex {
|
530
533
|
display: flex;
|
531
534
|
}
|
@@ -652,6 +655,14 @@
|
|
652
655
|
.squiz-rb-scope .grow-\[3\] {
|
653
656
|
flex-grow: 3;
|
654
657
|
}
|
658
|
+
@keyframes spin {
|
659
|
+
to {
|
660
|
+
transform: rotate(360deg);
|
661
|
+
}
|
662
|
+
}
|
663
|
+
.squiz-rb-scope .animate-spin {
|
664
|
+
animation: spin 1s linear infinite;
|
665
|
+
}
|
655
666
|
.squiz-rb-scope .cursor-not-allowed {
|
656
667
|
cursor: not-allowed;
|
657
668
|
}
|
@@ -742,6 +753,9 @@
|
|
742
753
|
--tw-border-opacity: 1;
|
743
754
|
border-color: rgb(0 0 0 / var(--tw-border-opacity));
|
744
755
|
}
|
756
|
+
.squiz-rb-scope .border-current {
|
757
|
+
border-color: currentColor;
|
758
|
+
}
|
745
759
|
.squiz-rb-scope .border-gray-300 {
|
746
760
|
--tw-border-opacity: 1;
|
747
761
|
border-color: rgb(224 224 224 / var(--tw-border-opacity));
|
@@ -850,6 +864,9 @@
|
|
850
864
|
.squiz-rb-scope .text-right {
|
851
865
|
text-align: right;
|
852
866
|
}
|
867
|
+
.squiz-rb-scope .align-\[-0\.125em\] {
|
868
|
+
vertical-align: -0.125em;
|
869
|
+
}
|
853
870
|
.squiz-rb-scope .text-base {
|
854
871
|
font-size: 1rem;
|
855
872
|
}
|
@@ -913,6 +930,10 @@
|
|
913
930
|
--tw-text-opacity: 1;
|
914
931
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
915
932
|
}
|
933
|
+
.squiz-rb-scope .antialiased {
|
934
|
+
-webkit-font-smoothing: antialiased;
|
935
|
+
-moz-osx-font-smoothing: grayscale;
|
936
|
+
}
|
916
937
|
.squiz-rb-scope .opacity-40 {
|
917
938
|
opacity: 0.4;
|
918
939
|
}
|
@@ -990,6 +1011,57 @@
|
|
990
1011
|
gap: 0.5rem;
|
991
1012
|
justify-items: center;
|
992
1013
|
}
|
1014
|
+
.squiz-rb-scope .spinner {
|
1015
|
+
display: inline-block;
|
1016
|
+
border-radius: 9999px;
|
1017
|
+
border-width: 2px;
|
1018
|
+
border-style: solid;
|
1019
|
+
border-color: currentColor;
|
1020
|
+
border-right-color: transparent;
|
1021
|
+
}
|
1022
|
+
@keyframes spin {
|
1023
|
+
to {
|
1024
|
+
transform: rotate(360deg);
|
1025
|
+
}
|
1026
|
+
}
|
1027
|
+
.squiz-rb-scope .spinner {
|
1028
|
+
animation: spin 1s linear infinite;
|
1029
|
+
vertical-align: -0.125em;
|
1030
|
+
}
|
1031
|
+
@media (prefers-reduced-motion: reduce) {
|
1032
|
+
@keyframes spin {
|
1033
|
+
}
|
1034
|
+
.squiz-rb-scope .spinner {
|
1035
|
+
animation: spin 1.5s linear infinite;
|
1036
|
+
}
|
1037
|
+
}
|
1038
|
+
.squiz-rb-scope .spinner {
|
1039
|
+
height: 20px;
|
1040
|
+
width: 20px;
|
1041
|
+
}
|
1042
|
+
.squiz-rb-scope .spinner__wrapper {
|
1043
|
+
display: flex;
|
1044
|
+
align-items: center;
|
1045
|
+
justify-content: center;
|
1046
|
+
}
|
1047
|
+
.squiz-rb-scope .spinner--md {
|
1048
|
+
height: 32px;
|
1049
|
+
width: 32px;
|
1050
|
+
}
|
1051
|
+
.squiz-rb-scope .animate-skeleton-pulse {
|
1052
|
+
animation: pulse 2s linear infinite;
|
1053
|
+
}
|
1054
|
+
@keyframes pulse {
|
1055
|
+
0% {
|
1056
|
+
opacity: 1;
|
1057
|
+
}
|
1058
|
+
50% {
|
1059
|
+
opacity: 0.45;
|
1060
|
+
}
|
1061
|
+
100% {
|
1062
|
+
opacity: 1;
|
1063
|
+
}
|
1064
|
+
}
|
993
1065
|
.squiz-rb-scope *,
|
994
1066
|
.squiz-rb-scope button {
|
995
1067
|
-webkit-font-smoothing: antialiased;
|
@@ -1153,6 +1225,16 @@
|
|
1153
1225
|
--tw-text-opacity: 1;
|
1154
1226
|
color: rgb(148 148 148 / var(--tw-text-opacity));
|
1155
1227
|
}
|
1228
|
+
@media (prefers-reduced-motion: reduce) {
|
1229
|
+
@keyframes spin {
|
1230
|
+
to {
|
1231
|
+
transform: rotate(360deg);
|
1232
|
+
}
|
1233
|
+
}
|
1234
|
+
.squiz-rb-scope .motion-reduce\:animate-\[spin_1\.5s_linear_infinite\] {
|
1235
|
+
animation: spin 1.5s linear infinite;
|
1236
|
+
}
|
1237
|
+
}
|
1156
1238
|
@media not all and (min-width: 768px) {
|
1157
1239
|
.squiz-rb-scope .max-md\:hidden {
|
1158
1240
|
display: none;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@squiz/resource-browser",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.40.0",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"scripts": {
|
@@ -15,8 +15,8 @@
|
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
17
|
"@mui/icons-material": "5.11.16",
|
18
|
-
"@squiz/dx-json-schema-lib": "1.
|
19
|
-
"@squiz/generic-browser-lib": "1.
|
18
|
+
"@squiz/dx-json-schema-lib": "1.40.0",
|
19
|
+
"@squiz/generic-browser-lib": "1.40.0",
|
20
20
|
"pretty-bytes": "5.6.0",
|
21
21
|
"react-aria": "3.23.1",
|
22
22
|
"react-responsive": "9.0.2",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"volta": {
|
75
75
|
"node": "18.15.0"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "42d08bd61b20a1a8a4bb6ccb4a9c60ababcd8f39"
|
78
78
|
}
|
package/postcss.config.js
CHANGED
@@ -5,6 +5,12 @@ module.exports = {
|
|
5
5
|
require('postcss-nested'),
|
6
6
|
require('postcss-prefix-selector')({
|
7
7
|
prefix: '.squiz-rb-scope',
|
8
|
+
transform(prefix, selector, prefixedSelector, filePath, rule) {
|
9
|
+
if (selector.match(/(squiz-gb-scope)/)) {
|
10
|
+
return selector;
|
11
|
+
}
|
12
|
+
return prefixedSelector;
|
13
|
+
},
|
8
14
|
includeFiles: ['./src/index.scss'],
|
9
15
|
}),
|
10
16
|
],
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
2
2
|
import React from 'react';
|
3
|
-
import { screen, render, waitFor, within } from '@testing-library/react';
|
3
|
+
import { screen, render, waitFor, within, act } from '@testing-library/react';
|
4
4
|
import userEvent from '@testing-library/user-event';
|
5
5
|
import { mockResource, mockSource } from '../__mocks__/MockModels';
|
6
6
|
import { Resource, Source, Hierarchy } from '../types';
|
@@ -175,8 +175,10 @@ describe('ResourcePickerContainer', () => {
|
|
175
175
|
mockResource({ id: '3', name: 'Test Page 3' }),
|
176
176
|
]);
|
177
177
|
|
178
|
-
|
179
|
-
|
178
|
+
const { getAllByText } = await act(async () => {
|
179
|
+
// Component has finished initial render
|
180
|
+
return render(<ResourcePickerContainer {...baseProps} onRequestChildren={onRequestChildren} />);
|
181
|
+
});
|
180
182
|
await waitFor(() => {
|
181
183
|
expect(getAllByText('Test system')[0]).toBeInTheDocument();
|
182
184
|
});
|
@@ -198,10 +200,12 @@ describe('ResourcePickerContainer', () => {
|
|
198
200
|
])(
|
199
201
|
'Selecting a node on %s shows its properties in the details panel',
|
200
202
|
async (description: string, width: number, expectedPreviewPanelCloseButtons: number) => {
|
201
|
-
|
202
|
-
|
203
|
-
<
|
204
|
-
|
203
|
+
await act(async () =>
|
204
|
+
render(
|
205
|
+
<ResponsiveContext.Provider value={{ width }}>
|
206
|
+
<ResourcePickerContainer {...baseProps} />
|
207
|
+
</ResponsiveContext.Provider>,
|
208
|
+
),
|
205
209
|
);
|
206
210
|
await waitFor(() => {
|
207
211
|
expect(screen.getByRole('button', { name: 'Drill down to Test Website children' })).toBeInTheDocument();
|
@@ -393,7 +397,7 @@ describe('ResourcePickerContainer', () => {
|
|
393
397
|
}),
|
394
398
|
]);
|
395
399
|
|
396
|
-
const { getByLabelText, getByText, getAllByText } = render(
|
400
|
+
const { getByLabelText, getByText, getAllByText, queryAllByText } = render(
|
397
401
|
<ResourcePickerContainer {...baseProps} onRequestChildren={onRequestChildren} />,
|
398
402
|
);
|
399
403
|
await waitFor(() => {
|
@@ -408,6 +412,11 @@ describe('ResourcePickerContainer', () => {
|
|
408
412
|
expect(getByLabelText('Resource breadcrumb')).toBeInTheDocument();
|
409
413
|
});
|
410
414
|
|
415
|
+
// Loading is done
|
416
|
+
await waitFor(() => {
|
417
|
+
expect(queryAllByText('loading Resource list')).toHaveLength(0);
|
418
|
+
});
|
419
|
+
|
411
420
|
// Drill down again
|
412
421
|
user.click(screen.getByRole('button', { name: 'Drill down to Test Page children' }));
|
413
422
|
|
package/src/index.scss
CHANGED
package/tailwind.config.cjs
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
/** @type {import('tailwindcss').Config} */
|
2
2
|
module.exports = {
|
3
|
-
content:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
content: {
|
4
|
+
relative: true,
|
5
|
+
files: [
|
6
|
+
'../generic-browser-lib/src/**/*.{js,ts,jsx,tsx,scss}',
|
7
|
+
'./index.html',
|
8
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
9
|
+
'./node_modules/flowbite/**/*.js',
|
10
|
+
],
|
11
|
+
},
|
9
12
|
theme: {
|
10
13
|
extend: {
|
11
14
|
borderWidth: {
|