@squiz/resource-browser 3.0.1-pre-alpha.1 → 3.0.1-pre-alpha.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.
Files changed (62) hide show
  1. package/.eslintrc +40 -0
  2. package/.storybook/main.ts +26 -0
  3. package/.storybook/preview-body.html +1 -0
  4. package/.storybook/preview-head.html +12 -0
  5. package/.storybook/preview.ts +16 -0
  6. package/CHANGELOG.md +281 -0
  7. package/README_DEVS.md +18 -0
  8. package/build.js +21 -0
  9. package/jest.config.ts +30 -0
  10. package/package.json +4 -16
  11. package/postcss.config.js +21 -0
  12. package/tailwind.config.cjs +99 -0
  13. package/tsconfig.json +22 -0
  14. package/tsconfig.storybook.json +4 -0
  15. package/tsconfig.test.json +12 -0
  16. package/vite.config.js +20 -0
  17. package/lib-esm/BrowseToSource/BrowseToSource.d.ts +0 -8
  18. package/lib-esm/BrowseToSource/BrowseToSource.js +0 -50
  19. package/lib-esm/Hooks/useAuth.d.ts +0 -7
  20. package/lib-esm/Hooks/useAuth.js +0 -54
  21. package/lib-esm/Hooks/useSelectedState.d.ts +0 -15
  22. package/lib-esm/Hooks/useSelectedState.js +0 -12
  23. package/lib-esm/Hooks/useSources.d.ts +0 -14
  24. package/lib-esm/Hooks/useSources.js +0 -44
  25. package/lib-esm/Icons/AdsClickIcon.d.ts +0 -4
  26. package/lib-esm/Icons/AdsClickIcon.js +0 -5
  27. package/lib-esm/Icons/ArrowDownIcon.d.ts +0 -4
  28. package/lib-esm/Icons/ArrowDownIcon.js +0 -5
  29. package/lib-esm/Icons/CircledLoopIcon.d.ts +0 -4
  30. package/lib-esm/Icons/CircledLoopIcon.js +0 -5
  31. package/lib-esm/MainContainer/MainContainer.d.ts +0 -19
  32. package/lib-esm/MainContainer/MainContainer.js +0 -43
  33. package/lib-esm/Plugin/Plugin.d.ts +0 -13
  34. package/lib-esm/Plugin/Plugin.js +0 -12
  35. package/lib-esm/ResourceBrowserContext/AuthProvider.d.ts +0 -16
  36. package/lib-esm/ResourceBrowserContext/AuthProvider.js +0 -18
  37. package/lib-esm/ResourceBrowserContext/ResourceBrowserContext.d.ts +0 -15
  38. package/lib-esm/ResourceBrowserContext/ResourceBrowserContext.js +0 -26
  39. package/lib-esm/ResourceBrowserInput/ResourceBrowserInput.d.ts +0 -26
  40. package/lib-esm/ResourceBrowserInput/ResourceBrowserInput.js +0 -9
  41. package/lib-esm/ResourceLauncher/ResourceLauncher.d.ts +0 -8
  42. package/lib-esm/ResourceLauncher/ResourceLauncher.js +0 -12
  43. package/lib-esm/ResourcePicker/ResourcePicker.d.ts +0 -16
  44. package/lib-esm/ResourcePicker/ResourcePicker.js +0 -25
  45. package/lib-esm/ResourcePicker/States/Error.d.ts +0 -7
  46. package/lib-esm/ResourcePicker/States/Error.js +0 -6
  47. package/lib-esm/ResourcePicker/States/Loading.d.ts +0 -2
  48. package/lib-esm/ResourcePicker/States/Loading.js +0 -4
  49. package/lib-esm/ResourcePicker/States/Selected.d.ts +0 -15
  50. package/lib-esm/ResourcePicker/States/Selected.js +0 -20
  51. package/lib-esm/SourceDropdown/SourceDropdown.d.ts +0 -7
  52. package/lib-esm/SourceDropdown/SourceDropdown.js +0 -46
  53. package/lib-esm/SourceDropdownContainer/SourceDropdownContainer.d.ts +0 -5
  54. package/lib-esm/SourceDropdownContainer/SourceDropdownContainer.js +0 -12
  55. package/lib-esm/SourceList/SourceList.d.ts +0 -8
  56. package/lib-esm/SourceList/SourceList.js +0 -16
  57. package/lib-esm/index.d.ts +0 -18
  58. package/lib-esm/index.js +0 -79
  59. package/lib-esm/types.d.ts +0 -97
  60. package/lib-esm/types.js +0 -5
  61. package/lib-esm/utils/authUtils.d.ts +0 -5
  62. package/lib-esm/utils/authUtils.js +0 -31
package/.eslintrc ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "extends": ["@squiz"],
3
+ "plugins": ["import", "prettier"],
4
+ "rules": {
5
+ "prettier/prettier": "error",
6
+ },
7
+ "settings": {
8
+ "import/parsers": {
9
+ "@typescript-eslint/parser": [".ts", ".tsx"],
10
+ },
11
+ "import/resolver": {
12
+ "typescript": {
13
+ "alwaysTryTypes": true,
14
+ },
15
+ },
16
+ },
17
+ "ignorePatterns": ["**/lib/"],
18
+ "overrides": [
19
+ {
20
+ "files": ["*.spec.ts", "*.spec.tsx"],
21
+ "rules": {
22
+ "no-var": 0,
23
+ "import/no-extraneous-dependencies": 0,
24
+ },
25
+ },
26
+ {
27
+ "files": ["*.config.ts", "*.config.js", "build.js"],
28
+ "rules": {
29
+ "import/no-extraneous-dependencies": 0,
30
+ },
31
+ },
32
+ {
33
+ "files": ["*.stories.ts", "*.stories.tsx"],
34
+ "rules": {
35
+ "import/no-extraneous-dependencies": 0,
36
+ "no-console": "off",
37
+ },
38
+ },
39
+ ],
40
+ }
@@ -0,0 +1,26 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+ const config: StorybookConfig = {
3
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
4
+ addons: [
5
+ '@storybook/addon-links',
6
+ '@storybook/addon-essentials',
7
+ '@storybook/addon-interactions',
8
+ {
9
+ name: '@storybook/addon-styling',
10
+ options: {
11
+ postCss: true,
12
+ },
13
+ },
14
+ ],
15
+ framework: {
16
+ name: '@storybook/react-vite',
17
+ options: {},
18
+ },
19
+ docs: {
20
+ autodocs: 'tag',
21
+ },
22
+ core: {
23
+ disableWhatsNewNotifications: true,
24
+ },
25
+ };
26
+ export default config;
@@ -0,0 +1 @@
1
+ <body class="squiz-rb-scope"></body>
@@ -0,0 +1,12 @@
1
+ <script>
2
+ window.global = window;
3
+ </script>
4
+
5
+ <style>
6
+ .sb-show-main.sb-main-padded {
7
+ padding: 0;
8
+ }
9
+ body {
10
+ font-family: 'Open Sans';
11
+ }
12
+ </style>
@@ -0,0 +1,16 @@
1
+ import type { Preview } from '@storybook/react';
2
+ import '../src/index.scss';
3
+
4
+ const preview: Preview = {
5
+ parameters: {
6
+ actions: { argTypesRegex: '^on[A-Z].*' },
7
+ controls: {
8
+ matchers: {
9
+ color: /(background|color)$/i,
10
+ date: /Date$/,
11
+ },
12
+ },
13
+ },
14
+ };
15
+
16
+ export default preview;
package/CHANGELOG.md ADDED
@@ -0,0 +1,281 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [3.0.1-pre-alpha.2](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.12...@squiz/resource-browser@3.0.1-pre-alpha.2) (2024-11-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * **prodam-346:** implement new top bar in matrix plugin ([b962c6f](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/b962c6fc7d2c7a1d05d90fa57d149eabdfbee5b9))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.0.1-pre-alpha.1](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@3.0.0-pre-alpha.0...@squiz/resource-browser@3.0.1-pre-alpha.1) (2024-11-19)
18
+
19
+ **Note:** Version bump only for package @squiz/resource-browser
20
+
21
+
22
+
23
+
24
+
25
+ ## [3.0.1-pre-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@3.0.0-pre-alpha.0...@squiz/resource-browser@3.0.1-pre-alpha.0) (2024-11-18)
26
+
27
+ **Note:** Version bump only for package @squiz/resource-browser
28
+
29
+
30
+
31
+
32
+
33
+ # [3.0.0-pre-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.12...@squiz/resource-browser@3.0.0-pre-alpha.0) (2024-11-18)
34
+
35
+ ### Features
36
+
37
+ - **prodam-346:** implement new top bar in matrix plugin ([b962c6f](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/b962c6fc7d2c7a1d05d90fa57d149eabdfbee5b9))
38
+
39
+ ## [3.0.0] Manual entry
40
+
41
+ **Note:** Major version bump as plugin interface and UI changed that will require updates to plugins to be compatible and render correctly.
42
+
43
+ ## [2.4.12](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.12-alpha.0...@squiz/resource-browser@2.4.12) (2024-06-17)
44
+
45
+ **Note:** Version bump only for package @squiz/resource-browser
46
+
47
+ ## [2.4.12-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.11-alpha.0...@squiz/resource-browser@2.4.12-alpha.0) (2024-06-14)
48
+
49
+ **Note:** Version bump only for package @squiz/resource-browser
50
+
51
+ ## [2.4.11-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.10-alpha.0...@squiz/resource-browser@2.4.11-alpha.0) (2024-06-14)
52
+
53
+ **Note:** Version bump only for package @squiz/resource-browser
54
+
55
+ ## [2.4.10-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.9-alpha.0...@squiz/resource-browser@2.4.10-alpha.0) (2024-06-14)
56
+
57
+ **Note:** Version bump only for package @squiz/resource-browser
58
+
59
+ ## [2.4.9-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.8-alpha.0...@squiz/resource-browser@2.4.9-alpha.0) (2024-06-14)
60
+
61
+ **Note:** Version bump only for package @squiz/resource-browser
62
+
63
+ ## [2.4.8-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.7-alpha.0...@squiz/resource-browser@2.4.8-alpha.0) (2024-06-14)
64
+
65
+ **Note:** Version bump only for package @squiz/resource-browser
66
+
67
+ ## [2.4.7-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.6-alpha.0...@squiz/resource-browser@2.4.7-alpha.0) (2024-06-14)
68
+
69
+ **Note:** Version bump only for package @squiz/resource-browser
70
+
71
+ ## [2.4.6-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.5-rc.0...@squiz/resource-browser@2.4.6-alpha.0) (2024-06-14)
72
+
73
+ **Note:** Version bump only for package @squiz/resource-browser
74
+
75
+ ## [2.4.5-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.4-alpha.0...@squiz/resource-browser@2.4.5-rc.0) (2024-06-14)
76
+
77
+ **Note:** Version bump only for package @squiz/resource-browser
78
+
79
+ ## [2.4.4-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.3-alpha.0...@squiz/resource-browser@2.4.4-alpha.0) (2024-06-14)
80
+
81
+ **Note:** Version bump only for package @squiz/resource-browser
82
+
83
+ ## [2.4.3-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.2-rc.0...@squiz/resource-browser@2.4.3-alpha.0) (2024-06-14)
84
+
85
+ **Note:** Version bump only for package @squiz/resource-browser
86
+
87
+ ## [2.4.2-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.1-alpha.0...@squiz/resource-browser@2.4.2-rc.0) (2024-06-14)
88
+
89
+ **Note:** Version bump only for package @squiz/resource-browser
90
+
91
+ ## [2.4.1-alpha.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.0-rc.0...@squiz/resource-browser@2.4.1-alpha.0) (2024-06-14)
92
+
93
+ ### Bug Fixes
94
+
95
+ - wip hooks fix ([274701c](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/274701c0874888430d8dcdaecfb6e5a8efe4a98f))
96
+
97
+ # [2.4.0-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.3.0-rc.0...@squiz/resource-browser@2.4.0-rc.0) (2024-06-13)
98
+
99
+ ### Features
100
+
101
+ - **PRODAM-161:** updated versions ([8ed02b5](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/8ed02b5aa5b818c27a0d23d98cbbee468e4e559e))
102
+
103
+ # [2.3.0-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.2.1...@squiz/resource-browser@2.3.0-rc.0) (2024-06-13)
104
+
105
+ ### Features
106
+
107
+ - **PRODAM-161:** lint ([7bc6f21](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/7bc6f2112a0364efb6c7e6e56c1fcfac61dc1086))
108
+ - **PRODAM-161:** linting ([afef928](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/afef928ac5a3fd05693f44995c144548e44b4392))
109
+ - **PRODAM-161:** route resource fetch tru internal api ([3073a7a](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/3073a7a34b8700f63f3b60070c489a7476c62122))
110
+
111
+ ## [2.2.1](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.2.1-rc.0...@squiz/resource-browser@2.2.1) (2024-06-11)
112
+
113
+ **Note:** Version bump only for package @squiz/resource-browser
114
+
115
+ ## [2.2.1-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.2.0-rc.0...@squiz/resource-browser@2.2.1-rc.0) (2024-06-07)
116
+
117
+ **Note:** Version bump only for package @squiz/resource-browser
118
+
119
+ # [2.2.0-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.1.10-rc.0...@squiz/resource-browser@2.2.0-rc.0) (2024-06-06)
120
+
121
+ ### Features
122
+
123
+ - **PRODAM:92:** auth provider ([3c7136d](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/3c7136da5f5ef148f713ad6a39f5d2328eaff4c7))
124
+
125
+ ## [2.1.10-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.1.9-rc.0...@squiz/resource-browser@2.1.10-rc.0) (2024-06-06)
126
+
127
+ **Note:** Version bump only for package @squiz/resource-browser
128
+
129
+ ## [2.1.9-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.1.8-rc.0...@squiz/resource-browser@2.1.9-rc.0) (2024-06-03)
130
+
131
+ **Note:** Version bump only for package @squiz/resource-browser
132
+
133
+ ## 2.1.8-rc.0 (2024-05-30)
134
+
135
+ **Note:** Version bump only for package @squiz/resource-browser
136
+
137
+ ## [2.1.7-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.6-rc.0...@squiz/resource-browser-v2@2.1.7-rc.0) (2024-05-27)
138
+
139
+ **Note:** Version bump only for package @squiz/resource-browser-v2
140
+
141
+ ## [2.1.6-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.5-rc.0...@squiz/resource-browser-v2@2.1.6-rc.0) (2024-05-27)
142
+
143
+ **Note:** Version bump only for package @squiz/resource-browser-v2
144
+
145
+ ## [2.1.5-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.4-rc.0...@squiz/resource-browser-v2@2.1.5-rc.0) (2024-05-23)
146
+
147
+ **Note:** Version bump only for package @squiz/resource-browser-v2
148
+
149
+ ## [2.1.4-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.3-rc.0...@squiz/resource-browser-v2@2.1.4-rc.0) (2024-05-20)
150
+
151
+ **Note:** Version bump only for package @squiz/resource-browser-v2
152
+
153
+ ## [2.1.3-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.2-rc.0...@squiz/resource-browser-v2@2.1.3-rc.0) (2024-05-20)
154
+
155
+ **Note:** Version bump only for package @squiz/resource-browser-v2
156
+
157
+ ## [2.1.2-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.1-rc.0...@squiz/resource-browser-v2@2.1.2-rc.0) (2024-05-15)
158
+
159
+ **Note:** Version bump only for package @squiz/resource-browser-v2
160
+
161
+ ## [2.1.1-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.1.0-rc.0...@squiz/resource-browser-v2@2.1.1-rc.0) (2024-05-13)
162
+
163
+ **Note:** Version bump only for package @squiz/resource-browser-v2
164
+
165
+ # [2.1.0-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.9-rc.0...@squiz/resource-browser-v2@2.1.0-rc.0) (2024-05-13)
166
+
167
+ ### Features
168
+
169
+ - **prodam-133:** add source dropdown to rb wrapper ([a258b0f](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/a258b0febebca94aad1885f602d6a10a323ab95f))
170
+
171
+ ## [2.0.9-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.8-rc.0...@squiz/resource-browser-v2@2.0.9-rc.0) (2024-05-13)
172
+
173
+ **Note:** Version bump only for package @squiz/resource-browser-v2
174
+
175
+ ## [2.0.8-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.7-rc.0...@squiz/resource-browser-v2@2.0.8-rc.0) (2024-05-10)
176
+
177
+ **Note:** Version bump only for package @squiz/resource-browser-v2
178
+
179
+ ## [2.0.7-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.6-rc.0...@squiz/resource-browser-v2@2.0.7-rc.0) (2024-05-09)
180
+
181
+ **Note:** Version bump only for package @squiz/resource-browser-v2
182
+
183
+ ## [2.0.6-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.5-rc.0...@squiz/resource-browser-v2@2.0.6-rc.0) (2024-05-07)
184
+
185
+ **Note:** Version bump only for package @squiz/resource-browser-v2
186
+
187
+ ## [2.0.5-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.4-rc.0...@squiz/resource-browser-v2@2.0.5-rc.0) (2024-05-07)
188
+
189
+ **Note:** Version bump only for package @squiz/resource-browser-v2
190
+
191
+ ## [2.0.4-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.3-rc.0...@squiz/resource-browser-v2@2.0.4-rc.0) (2024-05-03)
192
+
193
+ **Note:** Version bump only for package @squiz/resource-browser-v2
194
+
195
+ ## [2.0.3-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.2-rc.0...@squiz/resource-browser-v2@2.0.3-rc.0) (2024-05-02)
196
+
197
+ **Note:** Version bump only for package @squiz/resource-browser-v2
198
+
199
+ ## [2.0.2-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser-v2@2.0.1-rc.0...@squiz/resource-browser-v2@2.0.2-rc.0) (2024-04-29)
200
+
201
+ **Note:** Version bump only for package @squiz/resource-browser-v2
202
+
203
+ ## 2.0.1-rc.0 (2024-04-26)
204
+
205
+ **Note:** Version bump only for package @squiz/resource-browser-v2
206
+
207
+ # @squiz/resource-browser
208
+
209
+ ## 1.67.1
210
+
211
+ ### Patch Changes
212
+
213
+ - 9e4cad8: Fixed minor issue with finding best matched lineage in resource browser
214
+
215
+ ## 1.67.0
216
+
217
+ ### Minor Changes
218
+
219
+ - 5fa9b39: Updated resource browser to allow replacing the previously selected resource. Replacing will open the resource browser to the location where the resource resides.
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [5fa9b39]
224
+ - Updated dependencies [5fa9b39]
225
+ - @squiz/dx-json-schema-lib@1.67.0
226
+ - @squiz/generic-browser-lib@1.66.0
227
+
228
+ ## 1.66.3
229
+
230
+ ### Patch Changes
231
+
232
+ - 8421756: Selected image assets in the resource browser will now display the actual image instead of just the image asset icon if they have a URL specified
233
+
234
+ ## 1.66.2
235
+
236
+ ### Patch Changes
237
+
238
+ - 6d41052: Added white background to resource picker input to avoid it inheriting the background colour of its parent element.
239
+
240
+ ## 1.66.1
241
+
242
+ ### Patch Changes
243
+
244
+ - 81c7cba: Image asset previews will now display the image if there is a URL in the returned resource data
245
+ Also fixes a bug around the selected resource name not having break-word applied so the filename was not wrapping as expected
246
+
247
+ ## 1.66.0
248
+
249
+ ### Minor Changes
250
+
251
+ - 5032c38: Added content page asset icon.
252
+
253
+ ### Patch Changes
254
+
255
+ - Updated dependencies [5032c38]
256
+ - @squiz/generic-browser-lib@1.65.0
257
+
258
+ ## 1.65.0
259
+
260
+ ### Minor Changes
261
+
262
+ - ac68ec6: Unpinned Squiz dependencies, they should now be following semver.
263
+
264
+ ### Patch Changes
265
+
266
+ - Updated dependencies [ac68ec6]
267
+ - @squiz/dx-json-schema-lib@1.65.0
268
+
269
+ ## 1.64.1
270
+
271
+ ### Patch Changes
272
+
273
+ - Updated dependencies [e717e6e]
274
+ - @squiz/generic-browser-lib@1.64.0
275
+ - @squiz/dx-json-schema-lib@1.64.0
276
+
277
+ ## 1.64.0
278
+
279
+ ### Minor Changes
280
+
281
+ - e7d4c0f: Updated disabled styling for component-editing-ui & resource browser
package/README_DEVS.md ADDED
@@ -0,0 +1,18 @@
1
+ # Resource Browser Developer Notes
2
+
3
+ ## Component usage / render order
4
+
5
+ 1. ResourceBrowser e.g. index.tsx
6
+ 2. PluginRender
7
+ . A plugin is create for each inputted plugin to the ResourceBrowser
8
+ . They are conditional rendered based on if that plugin is needed by a source that matches that plugin being selected
9
+ . This pattern allows React Hooks to continue working inside the plugins because React doesn't like functions that include hooks being switch out at runtime e.g. switching what functions are used based on the selected source.
10
+ 3. ResourceBrowserInput
11
+ . This renders the first thing you see in the UI, an input area for a Resource to be selected or changed.
12
+ . This has two states: empty where selecting opens directly opens the modal at the next Component in the chain or selected where it will use a function from the selected resources matching plugin to render what that plugin thinks the Resource looks like.
13
+ 4. MainContainer
14
+ . This is the main body of the modal which opens when a Resource needs to be selected
15
+ . This has two sub views which can show: a launcher selection where the user can pick which connected source they want to select from and whether they want to search or browser or a resource browser / search page for when either a source is being changed.
16
+ 5. (path 1) ResourceLauncher
17
+ . This will show a list of connected sources and render a small UI from each's plugin to allow a user to launch into that sources selector via a search or browser context based on what that plugin supports.
18
+ 6. (path 2) Plugin's `sourceBrowserComponent` or `sourceSearchComponent` depending on what was selected in the launcher or browse if the launcher wasn't used e.g. changing and existing resource.
package/build.js ADDED
@@ -0,0 +1,21 @@
1
+ const esbuild = require('esbuild');
2
+ const { sassPlugin } = require('esbuild-sass-plugin');
3
+ const postcss = require('postcss');
4
+ const postcssConfig = require('./postcss.config').plugins;
5
+
6
+ esbuild
7
+ .build({
8
+ entryPoints: ['src/index.scss'],
9
+ bundle: true,
10
+ outdir: 'lib',
11
+ plugins: [
12
+ sassPlugin({
13
+ type: 'css',
14
+ transform: async (source) => {
15
+ const { css } = postcss(postcssConfig).process(source);
16
+ return css;
17
+ },
18
+ }),
19
+ ],
20
+ })
21
+ .catch(() => process.exit(1));
package/jest.config.ts ADDED
@@ -0,0 +1,30 @@
1
+ import type { Config } from 'jest';
2
+
3
+ // Sync object
4
+ const config: Config = {
5
+ preset: 'ts-jest',
6
+ clearMocks: true,
7
+ collectCoverage: true,
8
+ collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.stories.{ts,tsx}'],
9
+ coverageThreshold: {
10
+ global: {
11
+ branches: 90,
12
+ functions: 90,
13
+ lines: 90,
14
+ statements: 90,
15
+ },
16
+ },
17
+ errorOnDeprecated: true,
18
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
19
+ testTimeout: 60_000,
20
+ testEnvironment: 'jsdom',
21
+ testPathIgnorePatterns: ['/lib/', `/node_modules/`],
22
+ maxWorkers: 1,
23
+ moduleNameMapper: {
24
+ '^.+\\.(css|scss)$': '<rootDir>/src/__mocks__/styleMock.ts',
25
+ '^@squiz/resource-browser-ui-lib$': '<rootDir>/../resource-browser-ui-lib/src/index',
26
+ },
27
+ setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
28
+ };
29
+
30
+ export default config;
package/package.json CHANGED
@@ -1,27 +1,15 @@
1
1
  {
2
2
  "name": "@squiz/resource-browser",
3
- "version": "3.0.1-pre-alpha.1",
3
+ "version": "3.0.1-pre-alpha.2",
4
+ "main": "lib/index.js",
4
5
  "types": "lib/index.d.ts",
5
- "files": [
6
- "lib/*",
7
- "lib-esm/*",
8
- "src/*"
9
- ],
10
- "exports": {
11
- ".": {
12
- "import": "./lib-esm/index.js",
13
- "require": "./lib/index.js"
14
- },
15
- "./src/": "./src/",
16
- "./lib/": "./lib/"
17
- },
18
6
  "private": false,
19
7
  "publishConfig": {
20
8
  "access": "public"
21
9
  },
22
10
  "scripts": {
23
11
  "compile": "npm run compile:styles && npm run compile:code",
24
- "compile:code": "tsc -b ./tsconfig.json ./tsconfig.esm.json",
12
+ "compile:code": "tsc -b ./tsconfig.json",
25
13
  "compile:styles": "node build.js",
26
14
  "storybook": "storybook dev -p 6006",
27
15
  "storybook:build": "storybook build",
@@ -38,7 +26,7 @@
38
26
  "@react-types/shared": "^3.23.1",
39
27
  "@squiz/dx-json-schema-lib": "^1.67.0",
40
28
  "@squiz/generic-browser-lib": "1.67.2",
41
- "@squiz/resource-browser-ui-lib": "^1.0.0-pre-alpha.0",
29
+ "@squiz/resource-browser-ui-lib": "^1.0.0-pre-alpha.1",
42
30
  "clsx": "^2.1.0",
43
31
  "expiry-map": "^2.0.0",
44
32
  "p-memoize": "^4.0.4",
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ plugins: [
3
+ require('tailwindcss'),
4
+ require('autoprefixer'),
5
+ require('postcss-nested'),
6
+ require('postcss-prefix-selector')({
7
+ prefix: '.squiz-rb-scope',
8
+ transform(prefix, selector, prefixedSelector, filePath, rule) {
9
+ if (selector.match(/(squiz-gb-scope)/)) {
10
+ return selector;
11
+ }
12
+ if (selector.match(/(::)/)) {
13
+ const index = prefixedSelector.indexOf('::');
14
+ return `${prefixedSelector.slice(0, index)}:not(.squiz-rb-plugin *)${prefixedSelector.slice(index)}`;
15
+ }
16
+ return `${prefixedSelector}:not(.squiz-rb-plugin *)`;
17
+ },
18
+ includeFiles: ['./src/index.scss'],
19
+ }),
20
+ ],
21
+ };
@@ -0,0 +1,99 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: {
4
+ relative: true,
5
+ files: [
6
+ '../../node_modules/@squiz/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
+ },
12
+ theme: {
13
+ extend: {
14
+ borderWidth: {
15
+ // We shouldn't use ".border" class and instead use ".border-1".
16
+ // ".border" has !important styling defined in Matrix so overrides anything various border styling if used.
17
+ 1: '1px',
18
+ },
19
+ borderRadius: {
20
+ DEFAULT: '4px',
21
+ md: '6px',
22
+ },
23
+ fontFamily: {
24
+ base: 'Open Sans, Arial, sans-serif',
25
+ },
26
+ fontWeight: {
27
+ normal: '400',
28
+ medium: '500',
29
+ semibold: '600',
30
+ bold: '700',
31
+ },
32
+ fontSize: {
33
+ xlg: '1.125rem',
34
+ lg: '1rem',
35
+ md: '0.875rem',
36
+ sm: '0.8125rem',
37
+ base: '1rem',
38
+ 'heading-1': ['1.625rem', '2rem'],
39
+ 'heading-2': ['1.25rem', '1.5rem'],
40
+ 'heading-3': ['1.125rem', '1.375rem'],
41
+ 'heading-4': ['1rem', '1.25rem'],
42
+ },
43
+ fontFamily: {
44
+ base: 'Open Sans, Arial, sans-serif',
45
+ },
46
+ boxShadow: {
47
+ outline: '0 0 0 1px rgba(0,0,0,0.10)',
48
+ sm: '0 0 0 1px rgba(0,0,0,0.04), 0 1px 4px 2px rgba(0,0,0,0.08)',
49
+ DEFAULT: '0 0 0 1px rgba(0,0,0,0.04), 0 1px 12px 4px rgba(0,0,0,0.12)',
50
+ md: '0 0 0 1px rgba(0,0,0,0.04), 0 1px 12px 4px rgba(0,0,0,0.12)',
51
+ lg: '0 0 0 1px rgba(0,0,0,0.04), 0 1px 24px 12px rgba(0,0,0,0.12)',
52
+ inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
53
+ none: 'none',
54
+ },
55
+ width: {
56
+ 'modal-sm': '25rem',
57
+ 'modal-md': '37.5rem',
58
+ 'modal-lg': '50rem',
59
+ 'modal-xl': '62.5rem',
60
+ },
61
+ spacing: {
62
+ 1: '0.25rem', // 4px
63
+ 2: '0.5rem', // 8px
64
+ 3: '0.75rem', // 12px
65
+ 4: '1rem', // 16px
66
+ 4.5: '1.125rem', // 18px
67
+ 5: '1.25rem', // 20px
68
+ 6: '1.5rem', // 24px
69
+ 7: '1.75rem', // 28px
70
+ 8: '2rem', // 32px
71
+ 169: '169px', // 169px
72
+ },
73
+ colors: {
74
+ gray: {
75
+ 50: '#F7F7F7',
76
+ 100: '#F5F5F5',
77
+ 200: '#ededed',
78
+ 300: '#e0e0e0',
79
+ 400: '#BABABA',
80
+ 500: '#949494',
81
+ 600: '#707070',
82
+ 700: '#4F4F4F',
83
+ 800: '#3D3D3D',
84
+ 900: '#2B2B2B',
85
+ },
86
+ blue: {
87
+ 100: '#e6f1fa',
88
+ 150: '#C7DFF5',
89
+ 200: '#8FC0EB',
90
+ 300: '#0774d2',
91
+ 400: '#044985',
92
+ },
93
+ red: {
94
+ 300: '#d72321',
95
+ },
96
+ },
97
+ },
98
+ },
99
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "useDefineForClassFields": true,
5
+ "experimentalDecorators": true,
6
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
7
+ "allowJs": false,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "module": "CommonJS",
14
+ "moduleResolution": "node",
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "jsx": "react",
18
+ "declaration": true,
19
+ "outDir": "./lib"
20
+ },
21
+ "files": ["./src/index.tsx"]
22
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["./src/**/*.stories.ts", "./src/**/*.stories.tsx"]
4
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": [
4
+ "./src/**/*.spec.ts",
5
+ "./src/**/*.spec.tsx",
6
+ "./src/**/*.test.ts",
7
+ "./src/**/*.test.tsx",
8
+ "./src/**/__mocks__/**/*.ts",
9
+ "./src/**/__mocks__/**/*.tsx",
10
+ "./jest.config.ts"
11
+ ]
12
+ }