@squiz/resource-browser 3.0.1-pre-alpha.1 → 3.0.1-rc.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.
Files changed (63) 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 +272 -0
  7. package/LICENSE.md +15 -0
  8. package/README_DEVS.md +18 -0
  9. package/build.js +21 -0
  10. package/jest.config.ts +30 -0
  11. package/package.json +6 -17
  12. package/postcss.config.js +21 -0
  13. package/tailwind.config.cjs +99 -0
  14. package/tsconfig.json +22 -0
  15. package/tsconfig.storybook.json +4 -0
  16. package/tsconfig.test.json +12 -0
  17. package/vite.config.js +20 -0
  18. package/lib-esm/BrowseToSource/BrowseToSource.d.ts +0 -8
  19. package/lib-esm/BrowseToSource/BrowseToSource.js +0 -50
  20. package/lib-esm/Hooks/useAuth.d.ts +0 -7
  21. package/lib-esm/Hooks/useAuth.js +0 -54
  22. package/lib-esm/Hooks/useSelectedState.d.ts +0 -15
  23. package/lib-esm/Hooks/useSelectedState.js +0 -12
  24. package/lib-esm/Hooks/useSources.d.ts +0 -14
  25. package/lib-esm/Hooks/useSources.js +0 -44
  26. package/lib-esm/Icons/AdsClickIcon.d.ts +0 -4
  27. package/lib-esm/Icons/AdsClickIcon.js +0 -5
  28. package/lib-esm/Icons/ArrowDownIcon.d.ts +0 -4
  29. package/lib-esm/Icons/ArrowDownIcon.js +0 -5
  30. package/lib-esm/Icons/CircledLoopIcon.d.ts +0 -4
  31. package/lib-esm/Icons/CircledLoopIcon.js +0 -5
  32. package/lib-esm/MainContainer/MainContainer.d.ts +0 -19
  33. package/lib-esm/MainContainer/MainContainer.js +0 -43
  34. package/lib-esm/Plugin/Plugin.d.ts +0 -13
  35. package/lib-esm/Plugin/Plugin.js +0 -12
  36. package/lib-esm/ResourceBrowserContext/AuthProvider.d.ts +0 -16
  37. package/lib-esm/ResourceBrowserContext/AuthProvider.js +0 -18
  38. package/lib-esm/ResourceBrowserContext/ResourceBrowserContext.d.ts +0 -15
  39. package/lib-esm/ResourceBrowserContext/ResourceBrowserContext.js +0 -26
  40. package/lib-esm/ResourceBrowserInput/ResourceBrowserInput.d.ts +0 -26
  41. package/lib-esm/ResourceBrowserInput/ResourceBrowserInput.js +0 -9
  42. package/lib-esm/ResourceLauncher/ResourceLauncher.d.ts +0 -8
  43. package/lib-esm/ResourceLauncher/ResourceLauncher.js +0 -12
  44. package/lib-esm/ResourcePicker/ResourcePicker.d.ts +0 -16
  45. package/lib-esm/ResourcePicker/ResourcePicker.js +0 -25
  46. package/lib-esm/ResourcePicker/States/Error.d.ts +0 -7
  47. package/lib-esm/ResourcePicker/States/Error.js +0 -6
  48. package/lib-esm/ResourcePicker/States/Loading.d.ts +0 -2
  49. package/lib-esm/ResourcePicker/States/Loading.js +0 -4
  50. package/lib-esm/ResourcePicker/States/Selected.d.ts +0 -15
  51. package/lib-esm/ResourcePicker/States/Selected.js +0 -20
  52. package/lib-esm/SourceDropdown/SourceDropdown.d.ts +0 -7
  53. package/lib-esm/SourceDropdown/SourceDropdown.js +0 -46
  54. package/lib-esm/SourceDropdownContainer/SourceDropdownContainer.d.ts +0 -5
  55. package/lib-esm/SourceDropdownContainer/SourceDropdownContainer.js +0 -12
  56. package/lib-esm/SourceList/SourceList.d.ts +0 -8
  57. package/lib-esm/SourceList/SourceList.js +0 -16
  58. package/lib-esm/index.d.ts +0 -18
  59. package/lib-esm/index.js +0 -79
  60. package/lib-esm/types.d.ts +0 -97
  61. package/lib-esm/types.js +0 -5
  62. package/lib-esm/utils/authUtils.d.ts +0 -5
  63. 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,272 @@
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-rc.0](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/compare/@squiz/resource-browser@2.4.12...@squiz/resource-browser@3.0.1-rc.0) (2024-11-25)
7
+
8
+ **Note:** Version bump only for package @squiz/resource-browser
9
+
10
+ ## [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)
11
+
12
+ ### Features
13
+
14
+ - **prodam-346:** implement new top bar in matrix plugin ([b962c6f](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/b962c6fc7d2c7a1d05d90fa57d149eabdfbee5b9))
15
+
16
+ ## [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)
17
+
18
+ **Note:** Version bump only for package @squiz/resource-browser
19
+
20
+ ## [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)
21
+
22
+ **Note:** Version bump only for package @squiz/resource-browser
23
+
24
+ # [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)
25
+
26
+ ### Features
27
+
28
+ - **prodam-346:** implement new top bar in matrix plugin ([b962c6f](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/b962c6fc7d2c7a1d05d90fa57d149eabdfbee5b9))
29
+
30
+ ## [3.0.0] Manual entry
31
+
32
+ **Note:** Major version bump as plugin interface and UI changed that will require updates to plugins to be compatible and render correctly.
33
+
34
+ ## [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)
35
+
36
+ **Note:** Version bump only for package @squiz/resource-browser
37
+
38
+ ## [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)
39
+
40
+ **Note:** Version bump only for package @squiz/resource-browser
41
+
42
+ ## [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)
43
+
44
+ **Note:** Version bump only for package @squiz/resource-browser
45
+
46
+ ## [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)
47
+
48
+ **Note:** Version bump only for package @squiz/resource-browser
49
+
50
+ ## [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)
51
+
52
+ **Note:** Version bump only for package @squiz/resource-browser
53
+
54
+ ## [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)
55
+
56
+ **Note:** Version bump only for package @squiz/resource-browser
57
+
58
+ ## [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)
59
+
60
+ **Note:** Version bump only for package @squiz/resource-browser
61
+
62
+ ## [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)
63
+
64
+ **Note:** Version bump only for package @squiz/resource-browser
65
+
66
+ ## [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)
67
+
68
+ **Note:** Version bump only for package @squiz/resource-browser
69
+
70
+ ## [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)
71
+
72
+ **Note:** Version bump only for package @squiz/resource-browser
73
+
74
+ ## [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)
75
+
76
+ **Note:** Version bump only for package @squiz/resource-browser
77
+
78
+ ## [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)
79
+
80
+ **Note:** Version bump only for package @squiz/resource-browser
81
+
82
+ ## [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)
83
+
84
+ ### Bug Fixes
85
+
86
+ - wip hooks fix ([274701c](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/274701c0874888430d8dcdaecfb6e5a8efe4a98f))
87
+
88
+ # [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)
89
+
90
+ ### Features
91
+
92
+ - **PRODAM-161:** updated versions ([8ed02b5](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/8ed02b5aa5b818c27a0d23d98cbbee468e4e559e))
93
+
94
+ # [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)
95
+
96
+ ### Features
97
+
98
+ - **PRODAM-161:** lint ([7bc6f21](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/7bc6f2112a0364efb6c7e6e56c1fcfac61dc1086))
99
+ - **PRODAM-161:** linting ([afef928](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/afef928ac5a3fd05693f44995c144548e44b4392))
100
+ - **PRODAM-161:** route resource fetch tru internal api ([3073a7a](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/3073a7a34b8700f63f3b60070c489a7476c62122))
101
+
102
+ ## [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)
103
+
104
+ **Note:** Version bump only for package @squiz/resource-browser
105
+
106
+ ## [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)
107
+
108
+ **Note:** Version bump only for package @squiz/resource-browser
109
+
110
+ # [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)
111
+
112
+ ### Features
113
+
114
+ - **PRODAM:92:** auth provider ([3c7136d](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/3c7136da5f5ef148f713ad6a39f5d2328eaff4c7))
115
+
116
+ ## [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)
117
+
118
+ **Note:** Version bump only for package @squiz/resource-browser
119
+
120
+ ## [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)
121
+
122
+ **Note:** Version bump only for package @squiz/resource-browser
123
+
124
+ ## 2.1.8-rc.0 (2024-05-30)
125
+
126
+ **Note:** Version bump only for package @squiz/resource-browser
127
+
128
+ ## [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)
129
+
130
+ **Note:** Version bump only for package @squiz/resource-browser-v2
131
+
132
+ ## [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)
133
+
134
+ **Note:** Version bump only for package @squiz/resource-browser-v2
135
+
136
+ ## [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)
137
+
138
+ **Note:** Version bump only for package @squiz/resource-browser-v2
139
+
140
+ ## [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)
141
+
142
+ **Note:** Version bump only for package @squiz/resource-browser-v2
143
+
144
+ ## [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)
145
+
146
+ **Note:** Version bump only for package @squiz/resource-browser-v2
147
+
148
+ ## [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)
149
+
150
+ **Note:** Version bump only for package @squiz/resource-browser-v2
151
+
152
+ ## [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)
153
+
154
+ **Note:** Version bump only for package @squiz/resource-browser-v2
155
+
156
+ # [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)
157
+
158
+ ### Features
159
+
160
+ - **prodam-133:** add source dropdown to rb wrapper ([a258b0f](https://gitlab.squiz.net/dxp/dxp-shared-ui/resource-browser/commit/a258b0febebca94aad1885f602d6a10a323ab95f))
161
+
162
+ ## [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)
163
+
164
+ **Note:** Version bump only for package @squiz/resource-browser-v2
165
+
166
+ ## [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)
167
+
168
+ **Note:** Version bump only for package @squiz/resource-browser-v2
169
+
170
+ ## [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)
171
+
172
+ **Note:** Version bump only for package @squiz/resource-browser-v2
173
+
174
+ ## [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)
175
+
176
+ **Note:** Version bump only for package @squiz/resource-browser-v2
177
+
178
+ ## [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)
179
+
180
+ **Note:** Version bump only for package @squiz/resource-browser-v2
181
+
182
+ ## [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)
183
+
184
+ **Note:** Version bump only for package @squiz/resource-browser-v2
185
+
186
+ ## [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)
187
+
188
+ **Note:** Version bump only for package @squiz/resource-browser-v2
189
+
190
+ ## [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)
191
+
192
+ **Note:** Version bump only for package @squiz/resource-browser-v2
193
+
194
+ ## 2.0.1-rc.0 (2024-04-26)
195
+
196
+ **Note:** Version bump only for package @squiz/resource-browser-v2
197
+
198
+ # @squiz/resource-browser
199
+
200
+ ## 1.67.1
201
+
202
+ ### Patch Changes
203
+
204
+ - 9e4cad8: Fixed minor issue with finding best matched lineage in resource browser
205
+
206
+ ## 1.67.0
207
+
208
+ ### Minor Changes
209
+
210
+ - 5fa9b39: Updated resource browser to allow replacing the previously selected resource. Replacing will open the resource browser to the location where the resource resides.
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [5fa9b39]
215
+ - Updated dependencies [5fa9b39]
216
+ - @squiz/dx-json-schema-lib@1.67.0
217
+ - @squiz/generic-browser-lib@1.66.0
218
+
219
+ ## 1.66.3
220
+
221
+ ### Patch Changes
222
+
223
+ - 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
224
+
225
+ ## 1.66.2
226
+
227
+ ### Patch Changes
228
+
229
+ - 6d41052: Added white background to resource picker input to avoid it inheriting the background colour of its parent element.
230
+
231
+ ## 1.66.1
232
+
233
+ ### Patch Changes
234
+
235
+ - 81c7cba: Image asset previews will now display the image if there is a URL in the returned resource data
236
+ Also fixes a bug around the selected resource name not having break-word applied so the filename was not wrapping as expected
237
+
238
+ ## 1.66.0
239
+
240
+ ### Minor Changes
241
+
242
+ - 5032c38: Added content page asset icon.
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies [5032c38]
247
+ - @squiz/generic-browser-lib@1.65.0
248
+
249
+ ## 1.65.0
250
+
251
+ ### Minor Changes
252
+
253
+ - ac68ec6: Unpinned Squiz dependencies, they should now be following semver.
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies [ac68ec6]
258
+ - @squiz/dx-json-schema-lib@1.65.0
259
+
260
+ ## 1.64.1
261
+
262
+ ### Patch Changes
263
+
264
+ - Updated dependencies [e717e6e]
265
+ - @squiz/generic-browser-lib@1.64.0
266
+ - @squiz/dx-json-schema-lib@1.64.0
267
+
268
+ ## 1.64.0
269
+
270
+ ### Minor Changes
271
+
272
+ - e7d4c0f: Updated disabled styling for component-editing-ui & resource browser
package/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ This software is copyright Squiz and may only be used with the explicit
2
+ permission of the copyright holder.
3
+
4
+ 1. Squiz shall make the Services available to You pursuant to your Agreement and these terms.
5
+ 2. Squiz shall provide the Services only in accordance with applicable laws and government regulations and where applicable your Agreement.
6
+ 3. You shall:
7
+ (a) be responsible for Your compliance with these terms and the Agreement;
8
+ (b) prevent unauthorised access to or use of the Services, and notify Squiz promptly of any such unauthorised access or use, and
9
+ (c) use the Services only in accordance with the Documentation and applicable laws and government regulations.
10
+ 4. You shall not:
11
+ (a) sell, resell, rent or lease the Services;
12
+ (b) use the Services to store or transmit Malicious Code;
13
+ (c) interfere with or disrupt the integrity or performance of the Services or third-party data contained therein, or
14
+ (d) attempt to gain unauthorised access to the Services or their related systems or networks.
15
+ 5. You acknowledge that Squiz retains ownership of the Software, the Documentation and the source code and all proprietary rights relating thereto and You agree all Intellectual Property Rights in the Software and Documentation are and shall remain the exclusive property of Squiz and its third party suppliers, as applicable. Unless expressly permitted in this Subscription Agreement, You must not use any of Squiz's or its third party suppliers' intellectual property without Squiz or its third party suppliers' prior written consent. Nothing in these terms should be construed as transferring any aspects of such rights mentioned in this clause to You or any Third Party. Squiz reserves any and all rights not expressly granted herein.
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-rc.0",
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-rc.0",
42
30
  "clsx": "^2.1.0",
43
31
  "expiry-map": "^2.0.0",
44
32
  "p-memoize": "^4.0.4",
@@ -97,5 +85,6 @@
97
85
  },
98
86
  "volta": {
99
87
  "node": "18.18.0"
100
- }
88
+ },
89
+ "gitHead": "df5f8e74af27b274781237cc0c09b8f0521b66af"
101
90
  }
@@ -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
+ }