@bigbinary/neeto-folders-frontend 1.1.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.
@@ -0,0 +1,223 @@
1
+ 'use strict';
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var i18next = require('i18next');
5
+ var neetoCist = require('@bigbinary/neeto-cist');
6
+ var reactRouterDom = require('react-router-dom');
7
+ var shallow = require('zustand/shallow');
8
+ var reactQuery = require('@tanstack/react-query');
9
+ var constants = require('./cjs/constants.js');
10
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
11
+ var zustand = require('zustand');
12
+
13
+ var useDestroyMutation = function useDestroyMutation(config, api) {
14
+ var queryClient = reactQuery.useQueryClient();
15
+
16
+ // eslint-disable-next-line @bigbinary/neeto/use-use-mutation-with-invalidation-hook
17
+ return reactUtils.useMutationWithInvalidation(api, {
18
+ keysToInvalidate: [[constants.QUERY_KEYS.FOLDERS, config.type, constants.QUERY_KEYS.LIST]].concat(config.itemKeys),
19
+ onSuccess: function onSuccess() {
20
+ queryClient.invalidateQueries({
21
+ queryKey: [constants.QUERY_KEYS.FOLDERS, config.type, constants.QUERY_KEYS.DETAILS],
22
+ refetchType: "none"
23
+ });
24
+ }
25
+ });
26
+ };
27
+ var useFetchFolders = function useFetchFolders(config) {
28
+ return reactQuery.useQuery({
29
+ queryKey: [constants.QUERY_KEYS.FOLDERS, config.type, constants.QUERY_KEYS.LIST],
30
+ queryFn: config.api.fetch
31
+ });
32
+ };
33
+ var useShowFolder = function useShowFolder(config, folderId) {
34
+ return reactQuery.useQuery({
35
+ queryKey: [constants.QUERY_KEYS.FOLDERS, config.type, constants.QUERY_KEYS.DETAILS, folderId],
36
+ queryFn: function queryFn() {
37
+ return config.api.get(folderId);
38
+ },
39
+ enabled: !!folderId
40
+ });
41
+ };
42
+ var useCreateFolder = function useCreateFolder(config) {
43
+ return reactUtils.useMutationWithInvalidation(config.api.create, {
44
+ keysToInvalidate: [[constants.QUERY_KEYS.FOLDERS, config.type]]
45
+ });
46
+ };
47
+ var useUpdateFolder = function useUpdateFolder(config) {
48
+ return reactUtils.useMutationWithInvalidation(config.api.update, {
49
+ keysToInvalidate: [[constants.QUERY_KEYS.FOLDERS, config.type]]
50
+ });
51
+ };
52
+ var useReorderFolders = function useReorderFolders(config) {
53
+ return reactUtils.useMutationWithInvalidation(config.api.reorder, {
54
+ keysToInvalidate: [[constants.QUERY_KEYS.FOLDERS, config.type]]
55
+ });
56
+ };
57
+ var useDestroyFolder = function useDestroyFolder(config) {
58
+ return useDestroyMutation(config, config.api.destroy);
59
+ };
60
+ var useBulkUpdateFolders = function useBulkUpdateFolders(config) {
61
+ return reactUtils.useMutationWithInvalidation(config.api.bulkUpdate, {
62
+ keysToInvalidate: [[constants.QUERY_KEYS.FOLDERS, config.type]]
63
+ });
64
+ };
65
+ var useBulkDestroyFolders = function useBulkDestroyFolders(config) {
66
+ return useDestroyMutation(config, config.api.bulkDestroy);
67
+ };
68
+
69
+ var DEFAULT_CONFIG = {
70
+ type: "FOLDER",
71
+ // For query keys with different associated entities
72
+ maxDepth: 2,
73
+ // Maximum allowed depth for folder tree
74
+ folderPath: "/folders/:folderId",
75
+ // Path for handling URL redirections
76
+ itemLabel: i18next.t("common.items"),
77
+ // For displaying the item label in counts
78
+ itemKeys: [],
79
+ // For invalidation purposes
80
+ api: {
81
+ // Folder CRUD
82
+ fetch: neetoCist.noop,
83
+ get: neetoCist.noop,
84
+ create: neetoCist.noop,
85
+ update: neetoCist.noop,
86
+ destroy: neetoCist.noop,
87
+ bulkUpdate: neetoCist.noop,
88
+ bulkDestroy: neetoCist.noop
89
+ }
90
+ };
91
+
92
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
93
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
94
+ var useFolders = function useFolders(configArg) {
95
+ var config = _objectSpread$1(_objectSpread$1({}, DEFAULT_CONFIG), configArg);
96
+ var _useFetchFolders = useFetchFolders(config),
97
+ folders = _useFetchFolders.data,
98
+ isLoading = _useFetchFolders.isLoading;
99
+ return {
100
+ isLoading: isLoading,
101
+ folders: folders
102
+ };
103
+ };
104
+
105
+ /** @type {import("neetocommons/react-utils").ZustandStoreHook} */
106
+ var useFolderStore = zustand.create(reactUtils.withImmutableActions(function (set) {
107
+ return {
108
+ paneState: null,
109
+ alertState: null,
110
+ selectedItem: null,
111
+ setFolderState: set
112
+ };
113
+ }));
114
+
115
+ var getActiveFolderId = function getActiveFolderId(config) {
116
+ var _matchPath;
117
+ return (_matchPath = reactRouterDom.matchPath(window.location.pathname, config.folderPath)) === null || _matchPath === void 0 || (_matchPath = _matchPath.params) === null || _matchPath === void 0 ? void 0 : _matchPath.folderId;
118
+ };
119
+ var isActiveFolder = function isActiveFolder(config, folderId) {
120
+ return getActiveFolderId(config) === folderId;
121
+ };
122
+
123
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
124
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
125
+ var useFolder = function useFolder(configArg) {
126
+ var config = _objectSpread(_objectSpread({}, DEFAULT_CONFIG), configArg);
127
+ var folderId = getActiveFolderId(config);
128
+ var _useShowFolder = useShowFolder(config, folderId),
129
+ folder = _useShowFolder.data,
130
+ isLoading = _useShowFolder.isLoading;
131
+ return {
132
+ isLoading: isLoading,
133
+ folderId: folderId,
134
+ folder: folder
135
+ };
136
+ };
137
+
138
+ var useFolderActions = function useFolderActions(config) {
139
+ var queryClient = reactQuery.useQueryClient();
140
+ var _useFolderStore = useFolderStore(function (store) {
141
+ return {
142
+ setFolderState: store["setFolderState"]
143
+ };
144
+ }, shallow.shallow),
145
+ setFolderState = _useFolderStore.setFolderState;
146
+ var _useBulkUpdateFolders = useBulkUpdateFolders(config),
147
+ onBulkUpdate = _useBulkUpdateFolders.mutateAsync,
148
+ isUpdating = _useBulkUpdateFolders.isPending;
149
+ var _useBulkDestroyFolder = useBulkDestroyFolders(config),
150
+ onBulkDelete = _useBulkDestroyFolder.mutateAsync,
151
+ isDeleting = _useBulkDestroyFolder.isPending;
152
+ var onInvalidate = function onInvalidate() {
153
+ queryClient.invalidateQueries({
154
+ queryKey: [constants.QUERY_KEYS.FOLDERS, config.type]
155
+ });
156
+ };
157
+ var onAdd = function onAdd() {
158
+ return setFolderState({
159
+ paneState: {
160
+ type: "add",
161
+ item: null
162
+ }
163
+ });
164
+ };
165
+ var onEdit = function onEdit(item) {
166
+ return setFolderState({
167
+ paneState: {
168
+ type: "edit",
169
+ item: item
170
+ }
171
+ });
172
+ };
173
+ var onMove = function onMove(item) {
174
+ return setFolderState({
175
+ paneState: {
176
+ type: "move",
177
+ item: item
178
+ }
179
+ });
180
+ };
181
+ var onDelete = function onDelete(item) {
182
+ return setFolderState({
183
+ alertState: {
184
+ type: "delete",
185
+ item: item
186
+ }
187
+ });
188
+ };
189
+ var onReorder = function onReorder() {
190
+ return setFolderState({
191
+ paneState: {
192
+ type: "reorder",
193
+ item: null
194
+ }
195
+ });
196
+ };
197
+ var isPending = isUpdating || isDeleting;
198
+ return {
199
+ isPending: isPending,
200
+ onAdd: onAdd,
201
+ onEdit: onEdit,
202
+ onMove: onMove,
203
+ onDelete: onDelete,
204
+ onReorder: onReorder,
205
+ onInvalidate: onInvalidate,
206
+ onBulkUpdate: onBulkUpdate,
207
+ onBulkDelete: onBulkDelete
208
+ };
209
+ };
210
+
211
+ exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
212
+ exports.getActiveFolderId = getActiveFolderId;
213
+ exports.isActiveFolder = isActiveFolder;
214
+ exports.useCreateFolder = useCreateFolder;
215
+ exports.useDestroyFolder = useDestroyFolder;
216
+ exports.useFetchFolders = useFetchFolders;
217
+ exports.useFolder = useFolder;
218
+ exports.useFolderActions = useFolderActions;
219
+ exports.useFolderStore = useFolderStore;
220
+ exports.useFolders = useFolders;
221
+ exports.useReorderFolders = useReorderFolders;
222
+ exports.useUpdateFolder = useUpdateFolder;
223
+ //# sourceMappingURL=useFolderActions-DCs7hXdW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFolderActions-DCs7hXdW.js","sources":["../app/javascript/src/hooks/reactQuery/useFoldersApi.js","../app/javascript/src/constants/config.js","../app/javascript/src/hooks/useFolders.js","../app/javascript/src/stores/foldersStore.js","../app/javascript/src/utils/internal.js","../app/javascript/src/hooks/useFolder.js","../app/javascript/src/hooks/useFolderActions.js"],"sourcesContent":["import { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport { QUERY_KEYS } from \"constants/query\";\n\nconst useDestroyMutation = (config, api) => {\n const queryClient = useQueryClient();\n\n // eslint-disable-next-line @bigbinary/neeto/use-use-mutation-with-invalidation-hook\n return useMutationWithInvalidation(api, {\n keysToInvalidate: [\n [QUERY_KEYS.FOLDERS, config.type, QUERY_KEYS.LIST],\n ].concat(config.itemKeys),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [QUERY_KEYS.FOLDERS, config.type, QUERY_KEYS.DETAILS],\n refetchType: \"none\",\n });\n },\n });\n};\n\nexport const useFetchFolders = config =>\n useQuery({\n queryKey: [QUERY_KEYS.FOLDERS, config.type, QUERY_KEYS.LIST],\n queryFn: config.api.fetch,\n });\n\nexport const useShowFolder = (config, folderId) =>\n useQuery({\n queryKey: [QUERY_KEYS.FOLDERS, config.type, QUERY_KEYS.DETAILS, folderId],\n queryFn: () => config.api.get(folderId),\n enabled: !!folderId,\n });\n\nexport const useCreateFolder = config =>\n useMutationWithInvalidation(config.api.create, {\n keysToInvalidate: [[QUERY_KEYS.FOLDERS, config.type]],\n });\n\nexport const useUpdateFolder = config =>\n useMutationWithInvalidation(config.api.update, {\n keysToInvalidate: [[QUERY_KEYS.FOLDERS, config.type]],\n });\n\nexport const useReorderFolders = config =>\n useMutationWithInvalidation(config.api.reorder, {\n keysToInvalidate: [[QUERY_KEYS.FOLDERS, config.type]],\n });\n\nexport const useDestroyFolder = config =>\n useDestroyMutation(config, config.api.destroy);\n\nexport const useBulkUpdateFolders = config =>\n useMutationWithInvalidation(config.api.bulkUpdate, {\n keysToInvalidate: [[QUERY_KEYS.FOLDERS, config.type]],\n });\n\nexport const useBulkDestroyFolders = config =>\n useDestroyMutation(config, config.api.bulkDestroy);\n","import { t } from \"i18next\";\nimport { noop } from \"neetocist\";\n\nexport const DEFAULT_CONFIG = {\n type: \"FOLDER\", // For query keys with different associated entities\n maxDepth: 2, // Maximum allowed depth for folder tree\n folderPath: \"/folders/:folderId\", // Path for handling URL redirections\n itemLabel: t(\"common.items\"), // For displaying the item label in counts\n itemKeys: [], // For invalidation purposes\n api: {\n // Folder CRUD\n fetch: noop,\n get: noop,\n create: noop,\n update: noop,\n destroy: noop,\n bulkUpdate: noop,\n bulkDestroy: noop,\n },\n};\n","import { DEFAULT_CONFIG } from \"constants/config\";\nimport { useFetchFolders } from \"hooks/reactQuery/useFoldersApi\";\n\nconst useFolders = configArg => {\n const config = { ...DEFAULT_CONFIG, ...configArg };\n const { data: folders, isLoading } = useFetchFolders(config);\n\n return { isLoading, folders };\n};\n\nexport default useFolders;\n","import { withImmutableActions } from \"neetocommons/react-utils\";\nimport { create } from \"zustand\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useFolderStore = create(\n withImmutableActions(set => ({\n paneState: null,\n alertState: null,\n selectedItem: null,\n setFolderState: set,\n }))\n);\n\nexport default useFolderStore;\n","import { matchPath } from \"react-router-dom\";\n\nexport const getActiveFolderId = config =>\n matchPath(window.location.pathname, config.folderPath)?.params?.folderId;\n\nexport const isActiveFolder = (config, folderId) =>\n getActiveFolderId(config) === folderId;\n","import { DEFAULT_CONFIG } from \"constants/config\";\nimport { useShowFolder } from \"hooks/reactQuery/useFoldersApi\";\nimport { getActiveFolderId } from \"utils/internal\";\n\nconst useFolder = configArg => {\n const config = { ...DEFAULT_CONFIG, ...configArg };\n const folderId = getActiveFolderId(config);\n\n const { data: folder, isLoading } = useShowFolder(config, folderId);\n\n return { isLoading, folderId, folder };\n};\n\nexport default useFolder;\n","import { useQueryClient } from \"@tanstack/react-query\";\n\nimport { QUERY_KEYS } from \"constants/query\";\nimport useFolderStore from \"stores/foldersStore\";\n\nimport {\n useBulkUpdateFolders,\n useBulkDestroyFolders,\n} from \"./reactQuery/useFoldersApi\";\n\nconst useFolderActions = config => {\n const queryClient = useQueryClient();\n const { setFolderState } = useFolderStore.pick();\n\n const { mutateAsync: onBulkUpdate, isPending: isUpdating } =\n useBulkUpdateFolders(config);\n\n const { mutateAsync: onBulkDelete, isPending: isDeleting } =\n useBulkDestroyFolders(config);\n\n const onInvalidate = () => {\n queryClient.invalidateQueries({\n queryKey: [QUERY_KEYS.FOLDERS, config.type],\n });\n };\n\n const onAdd = () =>\n setFolderState({ paneState: { type: \"add\", item: null } });\n\n const onEdit = item => setFolderState({ paneState: { type: \"edit\", item } });\n\n const onMove = item => setFolderState({ paneState: { type: \"move\", item } });\n\n const onDelete = item =>\n setFolderState({ alertState: { type: \"delete\", item } });\n\n const onReorder = () =>\n setFolderState({ paneState: { type: \"reorder\", item: null } });\n\n const isPending = isUpdating || isDeleting;\n\n return {\n isPending,\n onAdd,\n onEdit,\n onMove,\n onDelete,\n onReorder,\n onInvalidate,\n onBulkUpdate,\n onBulkDelete,\n };\n};\n\nexport default useFolderActions;\n"],"names":["useDestroyMutation","config","api","queryClient","useQueryClient","useMutationWithInvalidation","keysToInvalidate","QUERY_KEYS","FOLDERS","type","LIST","concat","itemKeys","onSuccess","invalidateQueries","queryKey","DETAILS","refetchType","useFetchFolders","useQuery","queryFn","fetch","useShowFolder","folderId","get","enabled","useCreateFolder","create","useUpdateFolder","update","useReorderFolders","reorder","useDestroyFolder","destroy","useBulkUpdateFolders","bulkUpdate","useBulkDestroyFolders","bulkDestroy","DEFAULT_CONFIG","maxDepth","folderPath","itemLabel","t","noop","useFolders","configArg","_objectSpread","_useFetchFolders","folders","data","isLoading","useFolderStore","withImmutableActions","set","paneState","alertState","selectedItem","setFolderState","getActiveFolderId","_matchPath","matchPath","window","location","pathname","params","isActiveFolder","useFolder","_useShowFolder","folder","useFolderActions","_useFolderStore","store","shallow","_useBulkUpdateFolders","onBulkUpdate","mutateAsync","isUpdating","isPending","_useBulkDestroyFolder","onBulkDelete","isDeleting","onInvalidate","onAdd","item","onEdit","onMove","onDelete","onReorder"],"mappings":";;;;;;;;;;;;AAKA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,MAAM,EAAEC,GAAG,EAAK;AAC1C,EAAA,IAAMC,WAAW,GAAGC,yBAAc,EAAE;;AAEpC;EACA,OAAOC,sCAA2B,CAACH,GAAG,EAAE;IACtCI,gBAAgB,EAAE,CAChB,CAACC,oBAAU,CAACC,OAAO,EAAEP,MAAM,CAACQ,IAAI,EAAEF,oBAAU,CAACG,IAAI,CAAC,CACnD,CAACC,MAAM,CAACV,MA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KAAC,CAAC;AAAA,GAAA;AAE1D,EAAA,IAAMI,SAAS,GAAG,SAAZA,SAASA,GAAA;AAAA,IAAA,OACb9B,cAAc,CAAC;AAAEH,MAAAA,SAAS,EAAE;AAAE7C,QAAAA,IAAI,EAAE,SAAS;AAAE0E,QAAAA,IAAI,EAAE;AAAK;AAAE,KAAC,CAAC;AAAA,GAAA;AAEhE,EAAA,IAAMN,SAAS,GAAGD,UAAU,IAAII,UAAU;EAE1C,OAAO;AACLH,IAAAA,SAAS,EAATA,SAAS;AACTK,IAAAA,KAAK,EAALA,KAAK;AACLE,IAAAA,MAAM,EAANA,MAAM;AACNC,IAAAA,MAAM,EAANA,MAAM;AACNC,IAAAA,QAAQ,EAARA,QAAQ;AACRC,IAAAA,SAAS,EAATA,SAAS;AACTN,IAAAA,YAAY,EAAZA,YAAY;AACZP,IAAAA,YAAY,EAAZA,YAAY;AACZK,IAAAA,YAAY,EAAZA;GACD;AACH;;;;;;;;;;;;;;;"}
package/dist/utils.js ADDED
@@ -0,0 +1,3 @@
1
+ export { p as pathToFolder } from './pathUtils-B2uokQlx.js';
2
+ import '@babel/runtime/helpers/defineProperty';
3
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/package.json ADDED
@@ -0,0 +1,230 @@
1
+ {
2
+ "name": "@bigbinary/neeto-folders-frontend",
3
+ "version": "1.1.0",
4
+ "description": "A repo acts as the source of truth for the new nano's structure, configs, data etc.",
5
+ "license": "UNLICENSED",
6
+ "homepage": "https://github.com/bigbinary/neeto-folders-nano",
7
+ "bugs": {
8
+ "url": "https://github.com/bigbinary/neeto-folders-nano/issues"
9
+ },
10
+ "repository": "neeto-folders-nano",
11
+ "author": "BigBinary",
12
+ "files": [
13
+ "dist",
14
+ "types.d.ts",
15
+ "app/javascript/src/translations"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/cjs/index.js",
21
+ "types": "./types.d.ts"
22
+ },
23
+ "./*": {
24
+ "import": "./dist/*.js",
25
+ "require": "./dist/cjs/*.js",
26
+ "types": "./types.d.ts"
27
+ }
28
+ },
29
+ "main": "dist/index.cjs.js",
30
+ "module": "dist/index.js",
31
+ "types": "types.d.ts",
32
+ "scripts": {
33
+ "build": "NODE_ENV=production rollup --bundleConfigAsCjs -c --environment production",
34
+ "build-preview": "NODE_ENV=production webpack",
35
+ "prepare": "husky install",
36
+ "release": "yarn build && yalc push --sig"
37
+ },
38
+ "lint-staged": {
39
+ "./**/*.rb": [
40
+ "bundle exec rubocop -a --force-exclusion"
41
+ ],
42
+ "./**/app/javascript/**/*.{js,jsx,json}": [
43
+ "prettier --write",
44
+ "eslint --fix"
45
+ ],
46
+ "./test/dummy/**/app/javascript/**/*.{js,jsx,json}": [
47
+ "prettier --write",
48
+ "eslint --fix"
49
+ ],
50
+ "{Gemfile,Rakefile,config.ru}": [
51
+ "bundle exec rubocop -a --force-exclusion"
52
+ ]
53
+ },
54
+ "devDependencies": {
55
+ "@babel/core": "7.26.0",
56
+ "@babel/eslint-parser": "7.25.9",
57
+ "@babel/plugin-transform-runtime": "7.25.9",
58
+ "@babel/preset-env": "7.26.0",
59
+ "@babel/preset-react": "7.25.9",
60
+ "@babel/preset-typescript": "7.26.0",
61
+ "@babel/runtime": "7.26.10",
62
+ "@bigbinary/babel-preset-neeto": "^1.0.3",
63
+ "@bigbinary/eslint-plugin-neeto": "1.5.8",
64
+ "@bigbinary/neeto-cist": "1.0.15",
65
+ "@bigbinary/neeto-commons-frontend": "4.13.28",
66
+ "@bigbinary/neeto-filters-frontend": "4.3.15",
67
+ "@bigbinary/neeto-icons": "1.20.31",
68
+ "@bigbinary/neeto-molecules": "3.16.1",
69
+ "@bigbinary/neetoui": "8.2.75",
70
+ "@emotion/is-prop-valid": "1.2.0",
71
+ "@faker-js/faker": "8.2.0",
72
+ "@honeybadger-io/js": "6.10.1",
73
+ "@honeybadger-io/react": "6.1.25",
74
+ "@rollup/plugin-alias": "5.1.1",
75
+ "@rollup/plugin-babel": "6.0.4",
76
+ "@rollup/plugin-commonjs": "25.0.7",
77
+ "@rollup/plugin-json": "6.1.0",
78
+ "@rollup/plugin-node-resolve": "15.3.0",
79
+ "@rollup/plugin-replace": "5.0.4",
80
+ "@svgr/rollup": "8.1.0",
81
+ "@tailwindcss/container-queries": "^0.1.1",
82
+ "@tanstack/react-query": "5.59.20",
83
+ "@tanstack/react-query-devtools": "5.59.20",
84
+ "antd": "5.22.0",
85
+ "autoprefixer": "^10.4.5",
86
+ "axios": "1.8.2",
87
+ "babel-loader": "^8.2.5",
88
+ "babel-plugin-istanbul": "^6.1.1",
89
+ "babel-plugin-js-logger": "1.0.17",
90
+ "babel-plugin-macros": "3.1.0",
91
+ "babel-plugin-module-resolver": "^5.0.0",
92
+ "babel-plugin-preval": "^5.1.0",
93
+ "babel-plugin-transform-react-remove-prop-types": "0.4.24",
94
+ "babel-preset-react": "6.24.1",
95
+ "babel-preset-typescript": "^7.0.0-alpha.19",
96
+ "browserify-zlib": "0.2.0",
97
+ "buffer": "^6.0.3",
98
+ "classnames": "2.5.1",
99
+ "crypto-browserify": "3.12.1",
100
+ "css-loader": "6.8.1",
101
+ "dompurify": "^3.2.4",
102
+ "dotenv-webpack": "^8.0.1",
103
+ "eslint": "8.14.0",
104
+ "eslint-config-prettier": "8.5.0",
105
+ "eslint-plugin-cypress": "2.12.1",
106
+ "eslint-plugin-import": "2.31.0",
107
+ "eslint-plugin-jam3": "0.2.3",
108
+ "eslint-plugin-json": "3.1.0",
109
+ "eslint-plugin-prettier": "4.0.0",
110
+ "eslint-plugin-promise": "6.0.0",
111
+ "eslint-plugin-react": "7.37.2",
112
+ "eslint-plugin-react-hooks": "4.5.0",
113
+ "eslint-plugin-security": "^1.7.1",
114
+ "eslint-plugin-sonarjs": "^0.21.0",
115
+ "eslint-plugin-unused-imports": "2.0.0",
116
+ "eslint-plugin-xss": "^0.1.12",
117
+ "formik": "2.4.6",
118
+ "html-webpack-plugin": "5.5.3",
119
+ "https-browserify": "1.0.0",
120
+ "husky": "7.0.4",
121
+ "i18next": "22.5.1",
122
+ "i18next-browser-languagedetector": "7.0.1",
123
+ "js-logger": "1.6.1",
124
+ "lint-staged": "12.4.1",
125
+ "mini-css-extract-plugin": "2.7.6",
126
+ "mixpanel-browser": "2.47.0",
127
+ "os-browserify": "0.3.0",
128
+ "path-browserify": "^1.0.1",
129
+ "postcss": "8.4.49",
130
+ "postcss-import": "^15.0.0",
131
+ "postcss-loader": "^7.0.1",
132
+ "postcss-preset-env": "7.8.2",
133
+ "prettier": "2.6.2",
134
+ "prettier-plugin-tailwindcss": "0.1.10",
135
+ "process": "0.11.10",
136
+ "qs": "^6.11.2",
137
+ "ramda": "0.29.0",
138
+ "react": "18.2.0",
139
+ "react-dom": "18.2.0",
140
+ "react-helmet": "^6.1.0",
141
+ "react-i18next": "12.3.1",
142
+ "react-router-dom": "5.3.3",
143
+ "react-toastify": "8.0.2",
144
+ "react_ujs": "^3.1.1",
145
+ "rollup": "4.25.0",
146
+ "rollup-plugin-analyzer": "4.0.0",
147
+ "rollup-plugin-cleaner": "1.0.0",
148
+ "rollup-plugin-copy": "3.5.0",
149
+ "rollup-plugin-peer-deps-external": "2.2.4",
150
+ "rollup-plugin-styles": "4.0.0",
151
+ "sass": "^1.54.9",
152
+ "sass-loader": "^13.0.2",
153
+ "shakapacker": "6.6.0",
154
+ "source-map-loader": "4.0.1",
155
+ "stream-browserify": "^3.0.0",
156
+ "stream-http": "3.2.0",
157
+ "style-loader": "^3.3.1",
158
+ "tailwindcss": "3.4.14",
159
+ "tty-browserify": "0.0.1",
160
+ "url": "^0.11.0",
161
+ "util": "^0.12.5",
162
+ "vm-browserify": "1.1.2",
163
+ "webpack": "5.94.0",
164
+ "webpack-assets-manifest": "5.1.0",
165
+ "webpack-cli": "5.1.4",
166
+ "webpack-dev-server": "4.15.1",
167
+ "yup": "0.32.11",
168
+ "zustand": "4.3.2"
169
+ },
170
+ "peerDependencies": {
171
+ "@babel/runtime": "7.26.10",
172
+ "@bigbinary/neeto-cist": "1.0.15",
173
+ "@bigbinary/neeto-commons-frontend": "4.13.28",
174
+ "@bigbinary/neeto-filters-frontend": "4.3.15",
175
+ "@bigbinary/neeto-icons": "1.20.31",
176
+ "@bigbinary/neeto-molecules": "3.16.1",
177
+ "@bigbinary/neetoui": "8.2.75",
178
+ "@honeybadger-io/js": "6.10.1",
179
+ "@honeybadger-io/react": "6.1.25",
180
+ "@tailwindcss/container-queries": "^0.1.1",
181
+ "@tanstack/react-query": "5.59.20",
182
+ "@tanstack/react-query-devtools": "5.59.20",
183
+ "antd": "5.22.0",
184
+ "axios": "1.8.2",
185
+ "buffer": "^6.0.3",
186
+ "classnames": "2.5.1",
187
+ "crypto-browserify": "3.12.1",
188
+ "dompurify": "^3.2.4",
189
+ "formik": "2.4.6",
190
+ "https-browserify": "1.0.0",
191
+ "i18next": "22.5.1",
192
+ "js-logger": "1.6.1",
193
+ "mixpanel-browser": "^2.45.0",
194
+ "os-browserify": "0.3.0",
195
+ "path-browserify": "^1.0.1",
196
+ "qs": "^6.11.2",
197
+ "ramda": "0.29.0",
198
+ "react": "18.2.0",
199
+ "react-dom": "18.2.0",
200
+ "react-helmet": "^6.1.0",
201
+ "react-i18next": "12.3.1",
202
+ "react-router-dom": "5.3.3",
203
+ "react-toastify": "8.0.2",
204
+ "source-map-loader": "4.0.1",
205
+ "stream-browserify": "^3.0.0",
206
+ "stream-http": "3.2.0",
207
+ "tailwindcss": "3.4.14",
208
+ "tty-browserify": "0.0.1",
209
+ "url": "^0.11.0",
210
+ "util": "^0.12.5",
211
+ "vm-browserify": "1.1.2",
212
+ "yup": "0.32.11",
213
+ "zustand": "4.3.2"
214
+ },
215
+ "resolutions": {
216
+ "postcss": "^8",
217
+ "wrap-ansi": "7.0.0",
218
+ "string-width": "4.1.0"
219
+ },
220
+ "engines": {
221
+ "node": ">=22.13",
222
+ "npm": ">=9",
223
+ "yarn": ">=1.22"
224
+ },
225
+ "dependencies": {
226
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
227
+ "babel-plugin-transform-imports": "^2.0.0",
228
+ "react-router-nav-prompt": "0.4.1"
229
+ }
230
+ }
package/types.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+
3
+ export const WelcomeScreen = React.FC<{}>;