@griddo/ax 11.4.9-rc.3 → 11.4.9

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/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "11.4.9-rc.3",
4
+ "version": "11.4.9",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
+ "Carlos Torres <carlos.torres@secuoyas.com>",
7
8
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
8
9
  "Francis Vega <francis.vega@secuoyas.com>",
9
10
  "Gonzalo Hernández <gonzalo.hernandez@secuoyas.com>",
@@ -40,148 +41,153 @@
40
41
  },
41
42
  "dependencies": {
42
43
  "@atlaskit/tree": "8.12.0",
43
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
44
+ "@babel/plugin-transform-optional-chaining": "7.24.5",
45
+ "@babel/preset-react": "^7.14.5",
46
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.0-rc.0",
44
47
  "@styled-system/prop-types": "5.1.5",
45
48
  "@styled-system/theme-get": "5.1.2",
46
49
  "@svgr/webpack": "5.5.0",
47
- "@testing-library/jest-dom": "5.16.5",
48
- "@testing-library/react": "13.4.0",
49
- "@testing-library/user-event": "14.6.1",
50
- "@types/compress.js": "1.1.3",
51
- "@types/draft-js": "0.11.18",
52
- "@types/lodash.isequal": "4.5.8",
53
- "@types/markdown-draft-js": "2.2.7",
50
+ "@testing-library/jest-dom": "^5.16.4",
51
+ "@testing-library/react": "^13.0.0",
52
+ "@testing-library/user-event": "^14.0.4",
53
+ "@types/compress.js": "^1.1.0",
54
+ "@types/draft-js": "^0.10.44",
55
+ "@types/lodash.isequal": "^4.5.5",
56
+ "@types/markdown-draft-js": "^2.2.2",
54
57
  "@types/node": "20.17.10",
55
- "@types/react": "18.2.79",
56
- "@types/react-beautiful-dnd": "13.1.3",
57
- "@types/react-datepicker": "4.19.6",
58
- "@types/react-dom": "18.2.25",
59
- "@types/react-draft-wysiwyg": "1.13.8",
60
- "@types/react-redux": "7.1.25",
58
+ "@types/react": "18.2.11",
59
+ "@types/react-beautiful-dnd": "^13.1.2",
60
+ "@types/react-datepicker": "^3.1.1",
61
+ "@types/react-dom": "18.0.11",
62
+ "@types/react-draft-wysiwyg": "^1.13.1",
63
+ "@types/react-redux": "^7.1.23",
61
64
  "@types/react-router-dom": "5.3.3",
62
- "@types/react-slick": "0.23.13",
65
+ "@types/react-select": "4.0.18",
66
+ "@types/react-slick": "^0.23.10",
63
67
  "@types/react-test-renderer": "17.0.1",
64
- "@types/styled-components": "5.1.26",
65
- "@types/webpack-env": "1.18.0",
66
- "add": "2.0.6",
68
+ "@types/react-textarea-autosize": "^4.3.5",
69
+ "@types/styled-components": "^5.1.25",
70
+ "@types/uuid": "8.3.4",
71
+ "@types/webpack-env": "^1.14.1",
72
+ "@typescript-eslint/eslint-plugin": "7.18.0",
73
+ "@typescript-eslint/parser": "7.18.0",
74
+ "add": "^2.0.6",
67
75
  "axios": "0.19.0",
76
+ "babel-eslint": "10.0.3",
68
77
  "babel-loader": "8.2.2",
69
- "babel-plugin-named-asset-import": "0.3.8",
70
- "babel-plugin-require-context-hook": "1.0.0",
71
- "babel-plugin-root-import": "6.6.0",
72
- "babel-plugin-styled-components": "2.1.4",
73
- "babel-preset-react-app": "10.1.0",
78
+ "babel-plugin-named-asset-import": "^0.3.7",
79
+ "babel-plugin-require-context-hook": "^1.0.0",
80
+ "babel-plugin-root-import": "^6.4.1",
81
+ "babel-plugin-styled-components": "^1.13.2",
82
+ "babel-preset-react-app": "^10.0.0",
74
83
  "case-sensitive-paths-webpack-plugin": "2.4.0",
75
- "compress.js": "1.2.2",
76
- "connected-react-router": "6.9.3",
77
- "css-loader": "4.3.0",
84
+ "compress.js": "^1.1.2",
85
+ "connected-react-router": "^6.9.2",
86
+ "css-loader": "^4.3.0",
78
87
  "css-minimizer-webpack-plugin": "3.0.2",
79
- "date-fns": "2.30.0",
88
+ "date-fns": "^2.21.3",
80
89
  "dotenv": "6.2.0",
81
90
  "dotenv-expand": "5.1.0",
82
- "draft-js": "0.11.7",
83
- "draft-js-import-html": "1.4.1",
84
- "draftjs-to-html": "0.9.1",
85
- "enhanced-resolve": "5.18.1",
86
- "env-cmd": "10.1.0",
87
- "file-loader": "6.2.0",
88
- "find-up": "5.0.0",
91
+ "draft-js": "^0.11.7",
92
+ "draft-js-import-html": "^1.4.1",
93
+ "draftjs-to-html": "^0.9.1",
94
+ "enhanced-resolve": "^5.8.2",
95
+ "env-cmd": "^10.1.0",
96
+ "file-loader": "^6.2.0",
97
+ "find-up": "^5.0.0",
89
98
  "fs-extra": "7.0.1",
90
- "html-to-draftjs": "1.5.0",
91
- "html-to-image": "1.11.7",
99
+ "html-to-draftjs": "^1.5.0",
100
+ "html-to-image": "^1.9.0",
92
101
  "html-webpack-plugin": "4.5.0",
93
102
  "identity-obj-proxy": "3.0.0",
94
- "ignore-loader": "0.1.2",
95
- "is-wsl": "3.1.0",
96
- "jsdom": "20.0.3",
97
- "jsdom-global": "3.0.2",
103
+ "ignore-loader": "^0.1.2",
104
+ "is-wsl": "^1.1.0",
105
+ "jest-environment-jsdom": "^27.5.1",
106
+ "jest-environment-jsdom-fourteen": "0.1.0",
107
+ "jest-resolve": "24.9.0",
108
+ "jest-watch-typeahead": "0.4.0",
109
+ "jsdom": "^19.0.0",
110
+ "jsdom-global": "^3.0.2",
98
111
  "lodash.isequal": "4.5.0",
99
- "markdown-draft-js": "2.4.0",
100
- "masonic": "4.1.0",
112
+ "markdown-draft-js": "^2.2.1",
113
+ "masonic": "^4.0.1",
101
114
  "mini-css-extract-plugin": "0.11.3",
102
- "optimize-css-assets-webpack-plugin": "6.0.1",
103
- "pkg-dir": "5.0.0",
104
- "pnp-webpack-plugin": "1.7.0",
115
+ "optimize-css-assets-webpack-plugin": "^6.0.1",
116
+ "pkg-dir": "^5.0.0",
117
+ "pnp-webpack-plugin": "^1.7.0",
105
118
  "polished": "3.4.1",
106
- "postcss": "8.5.3",
119
+ "postcss": "^8.4.5",
107
120
  "postcss-flexbugs-fixes": "4.1.0",
108
121
  "postcss-loader": "3.0.0",
109
122
  "postcss-normalize": "7.0.1",
110
123
  "postcss-preset-env": "6.7.0",
111
- "postcss-safe-parser": "6.0.0",
112
- "react": "18.2.0",
113
- "react-app-polyfill": "1.0.6",
114
- "react-beautiful-dnd": "13.1.1",
115
- "react-datepicker": "4.25.0",
116
- "react-dev-utils": "11.0.4",
117
- "react-dom": "18.2.0",
118
- "react-draft-wysiwyg": "1.15.0",
124
+ "postcss-safe-parser": "^6.0.0",
125
+ "react": "18.1.0",
126
+ "react-app-polyfill": "^1.0.4",
127
+ "react-beautiful-dnd": "^13.1.0",
128
+ "react-datepicker": "^3.2.2",
129
+ "react-dev-utils": "^11.0.4",
130
+ "react-dom": "18.1.0",
131
+ "react-draft-wysiwyg": "^1.14.5",
119
132
  "react-error-boundary": "4.0.13",
120
- "react-froala-wysiwyg": "3.2.7",
121
- "react-redux": "7.2.9",
122
- "react-refresh": "0.14.2",
133
+ "react-frame-component": "^5.2.1",
134
+ "react-froala-wysiwyg": "^3.2.7",
135
+ "react-redux": "^7.2.8",
136
+ "react-refresh": "^0.10.0",
123
137
  "react-router-dom": "5.1.2",
124
- "react-select": "5.10.1",
125
- "react-slick": "0.30.3",
126
- "react-textarea-autosize": "8.5.9",
127
- "redux": "4.2.1",
128
- "redux-devtools-extension": "2.13.9",
138
+ "react-select": "4.3.1",
139
+ "react-slick": "^0.29.0",
140
+ "react-textarea-autosize": "^7.1.2",
141
+ "redux": "4.0.4",
142
+ "redux-devtools-extension": "2.13.8",
129
143
  "redux-persist": "6.0.0",
144
+ "redux-thunk": "^2.4.1",
130
145
  "reflect-metadata": "0.1.13",
131
- "resolve": "1.22.10",
132
- "resolve-url-loader": "4.0.0",
133
- "sass-alias": "1.0.5",
134
- "sass-loader": "10.4.1",
146
+ "resolve": "^1.20.0",
147
+ "resolve-url-loader": "^4.0.0",
148
+ "sass-alias": "^1.0.5",
149
+ "sass-loader": "^10.0.0",
135
150
  "semver": "7.6.3",
136
151
  "slick-carousel": "1.8.1",
137
- "source-map-loader": "1.1.3",
138
- "string-replace-loader": "3.1.0",
139
- "style-loader": "1.3.0",
140
- "styled-components": "5.3.11",
152
+ "source-map-loader": "^1.1.2",
153
+ "string-replace-loader": "^3.0.1",
154
+ "style-loader": "^1.2.1",
155
+ "styled-components": "^5.3.5",
141
156
  "styled-reset": "4.0.1",
142
157
  "styled-system": "5.1.5",
143
158
  "terser-webpack-plugin": "1.4.1",
144
159
  "ts-pnp": "1.1.4",
160
+ "typescript": "^4.6.3",
145
161
  "url-loader": "4.1.1",
146
- "webpack": "4.47.0",
162
+ "uuid": "8.3.2",
163
+ "webpack": "4.44.2",
147
164
  "webpack-dev-server": "3.11.1",
148
165
  "webpack-manifest-plugin": "2.2.0",
149
166
  "workbox-webpack-plugin": "5.1.4"
150
167
  },
151
168
  "devDependencies": {
152
- "@babel/core": "7.26.10",
153
- "@babel/plugin-transform-optional-chaining": "7.25.9",
154
- "@babel/preset-env": "7.26.9",
155
- "@babel/preset-react": "7.26.3",
156
- "@babel/preset-typescript": "7.26.0",
157
- "@types/jest": "27.5.2",
158
- "@types/redux-mock-store": "1.0.3",
159
- "@types/uuid": "8.3.4",
160
- "@typescript-eslint/eslint-plugin": "7.18.0",
161
- "@typescript-eslint/parser": "7.18.0",
162
- "axios-mock-adapter": "1.22.0",
163
- "babel-eslint": "10.0.3",
164
- "babel-jest": "27.5.1",
169
+ "@babel/core": "^7.21.0",
170
+ "@babel/preset-env": "^7.16.11",
171
+ "@babel/preset-typescript": "^7.16.7",
172
+ "@types/jest": "^27.4.1",
173
+ "@types/redux-mock-store": "^1.0.3",
174
+ "axios-mock-adapter": "^1.21.2",
175
+ "babel-jest": "^27.5.1",
165
176
  "eslint": "8.57.1",
166
- "eslint-plugin-import": "2.31.0",
167
- "eslint-plugin-jsx-a11y": "6.10.2",
168
- "eslint-plugin-react": "7.37.5",
169
- "eslint-plugin-react-hooks": "4.6.2",
170
- "jest": "27.5.1",
171
- "jest-environment-jsdom": "27.5.1",
172
- "jest-environment-jsdom-fourteen": "0.1.0",
173
- "jest-mock-extended": "2.0.9",
174
- "jest-resolve": "24.9.0",
175
- "jest-styled-components": "7.1.1",
176
- "jest-watch-typeahead": "0.4.0",
177
+ "eslint-loader": "^4.0.2",
178
+ "eslint-plugin-import": "^2.23.4",
179
+ "eslint-plugin-jsx-a11y": "6.2.3",
180
+ "eslint-plugin-react": "7.14.3",
181
+ "eslint-plugin-react-hooks": "^4.2.0",
182
+ "jest": "^27.5.1",
183
+ "jest-mock-extended": "^2.0.5",
184
+ "jest-styled-components": "^7.0.8",
177
185
  "prettier": "3.4.2",
178
- "react-test-renderer": "18.2.0",
179
- "redux-mock-store": "1.5.5",
180
- "redux-thunk": "2.4.2",
181
- "ts-jest": "27.1.5",
182
- "ts-node": "10.9.2",
183
- "typescript": "4.9.5",
184
- "uuid": "8.3.2"
186
+ "react-test-render": "1.1.2",
187
+ "react-test-renderer": "^18.2.0",
188
+ "redux-mock-store": "^1.5.4",
189
+ "ts-jest": "^27.1.4",
190
+ "ts-node": "^10.9.1"
185
191
  },
186
192
  "babel": {
187
193
  "presets": [
@@ -220,5 +226,5 @@
220
226
  "publishConfig": {
221
227
  "access": "public"
222
228
  },
223
- "gitHead": "3d444ce9aca10ab4818c7770715f6dacc47b18fe"
229
+ "gitHead": "d5852b3f95f7a79bfbd02ab8b150c053aaa3acb5"
224
230
  }
@@ -65,7 +65,6 @@ describe("Wysiwyg component rendering", () => {
65
65
  defaultLanguage: 4,
66
66
  path: "",
67
67
  domain: 1,
68
- navigationModules: [],
69
68
  };
70
69
 
71
70
  const initialState = { ...initialStore, ...defaultProps };
@@ -1,5 +1,5 @@
1
1
  import { template } from "./config";
2
- import { IServiceConfig, sendRequest, sendUploadRequest } from "./utils";
2
+ import { IServiceConfig, sendRequest } from "./utils";
3
3
 
4
4
  const SERVICES: { [key: string]: IServiceConfig } = {
5
5
  GET_NAVIGATION: {
@@ -113,14 +113,14 @@ const getFooters = (siteID: number, params?: any) => {
113
113
  return sendRequest(SERVICES.GET_FOOTERS);
114
114
  };
115
115
 
116
- const createNavigation = (data: FormData) => sendUploadRequest(SERVICES.CREATE_NAVIGATION, data);
116
+ const createNavigation = (data: any) => sendRequest(SERVICES.CREATE_NAVIGATION, data);
117
117
 
118
- const updateNavigation = (navID: number, data: FormData) => {
118
+ const updateNavigation = (navID: number, data: any) => {
119
119
  const { host, endpoint } = SERVICES.UPDATE_NAVIGATION;
120
120
 
121
121
  SERVICES.UPDATE_NAVIGATION.dynamicUrl = `${host}${endpoint}${navID}`;
122
122
 
123
- return sendUploadRequest(SERVICES.UPDATE_NAVIGATION, data);
123
+ return sendRequest(SERVICES.UPDATE_NAVIGATION, data);
124
124
  };
125
125
 
126
126
  const deleteNavigation = (navID: number) => {
package/src/api/utils.tsx CHANGED
@@ -31,7 +31,7 @@ const getLang = (): Record<string, unknown> => {
31
31
  return { lang };
32
32
  };
33
33
 
34
- const getHeaders = (headers: Record<string, unknown>, hasToken: boolean) => {
34
+ const getHeaders = (headers: Record<string, unknown>, hasToken: boolean): Record<string, unknown> => {
35
35
  return hasToken
36
36
  ? {
37
37
  ...headers,
@@ -57,7 +57,7 @@ const wrapConfig = (serviceConfig: IServiceConfig): AxiosRequestConfig => {
57
57
  };
58
58
  };
59
59
 
60
- /*class RequestCache {
60
+ class RequestCache {
61
61
  private _cacheTime = 1; // SECONDS
62
62
  private _cache: { [key: string]: { timestamp: number; value: string } } = {};
63
63
 
@@ -80,7 +80,7 @@ const wrapConfig = (serviceConfig: IServiceConfig): AxiosRequestConfig => {
80
80
  }
81
81
  }
82
82
 
83
- const requestCache = new RequestCache();*/
83
+ const requestCache = new RequestCache();
84
84
 
85
85
  export const sendInitialRequest = async (
86
86
  serviceConfig: IServiceConfig,
@@ -118,10 +118,9 @@ export const sendRequest = async (
118
118
  dataHeader?: Record<string, unknown>
119
119
  ): Promise<AxiosResponse> => {
120
120
  let config = wrapConfig(serviceConfig);
121
- const headers = { ...config.headers, ...dataHeader };
122
121
 
123
122
  if (dataHeader) {
124
- config = { ...config, headers };
123
+ config = { ...config, headers: { ...config.headers, ...dataHeader } };
125
124
  }
126
125
 
127
126
  try {
@@ -165,7 +164,7 @@ export const sendUploadRequest = async (
165
164
  if (setProgress) {
166
165
  requestConfig = {
167
166
  ...requestConfig,
168
- onUploadProgress: (progressEvent: ProgressEvent) => {
167
+ onUploadProgress: (progressEvent: any) => {
169
168
  const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
170
169
  setProgress(percentCompleted);
171
170
  },
@@ -94,8 +94,8 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
94
94
  // eslint-disable-next-line react-hooks/exhaustive-deps
95
95
  }, [entity, site, lang, selectedContent, entityId, mandatory, placeholder, filter, isCategories, isPage, options]);
96
96
 
97
- const handleChange = (selectedValue: unknown | null) => {
98
- const newValue = selectedValue ? (selectedValue as ICheck | IOption).value : null;
97
+ const handleChange = (selectedValue: ICheck | IOption | null) => {
98
+ const newValue = selectedValue ? selectedValue.value : selectedValue;
99
99
  onChange(newValue);
100
100
  };
101
101
 
@@ -141,8 +141,8 @@ const AsyncSelect = (props: IAsyncSelectProps): JSX.Element => {
141
141
  error={error}
142
142
  isDisabled={disabled}
143
143
  className={className}
144
- required={mandatory}
145
- isClearable={state.hasEmptyOption}
144
+ mandatory={mandatory}
145
+ hasEmptyOption={state.hasEmptyOption}
146
146
  isSearchable={searchable}
147
147
  maxWidth={maxWidth}
148
148
  inputValue={state.inputText}
@@ -68,8 +68,8 @@ export const StyledSelect = styled(AsyncSelect)<{
68
68
  padding: ${(p) => `13px ${p.theme.spacing.s} 12px ${p.theme.spacing.s}`};
69
69
  &:first-child {
70
70
  ${(p) =>
71
- !p.required &&
72
- p.isClearable &&
71
+ !p.mandatory &&
72
+ p.hasEmptyOption &&
73
73
  css`
74
74
  font-style: italic;
75
75
  color: ${(p) => p.theme.color.textLowEmphasis};
@@ -103,6 +103,7 @@ export const StyledSelect = styled(AsyncSelect)<{
103
103
  background: transparent;
104
104
  border: none;
105
105
  height: auto;
106
+ justify-content: ${(p) => (p.alignRight ? "flex-end" : "flex-start")};
106
107
  min-width: auto;
107
108
 
108
109
  .react-select__value-container {
@@ -49,20 +49,14 @@ export const DatePickerWrapper = styled.div`
49
49
  border: none;
50
50
  }
51
51
 
52
- .react-datepicker__navigation-icon {
53
- display: none;
54
- }
55
-
56
52
  &.react-datepicker__navigation--next {
57
53
  background-image: url(/img/icons/Right-arrow.svg);
58
54
  margin-right: ${(p) => p.theme.spacing.s};
59
- margin-top: ${(p) => p.theme.spacing.xs};
60
55
  }
61
56
 
62
57
  &.react-datepicker__navigation--previous {
63
58
  background-image: url(/img/icons/Left-arrow.svg);
64
59
  margin-left: ${(p) => p.theme.spacing.s};
65
- margin-top: ${(p) => p.theme.spacing.xs};
66
60
  }
67
61
  }
68
62
 
@@ -27,7 +27,7 @@ const Select = (props: ISelectProps): JSX.Element => {
27
27
 
28
28
  const optionValues: IOptionProps[] = hasEmptyOption ? [emptyOption, ...options] : options;
29
29
 
30
- const handleChange = (selectedValue: unknown) => onChange((selectedValue as IOptionProps).value);
30
+ const handleChange = (selectedValue: IOptionProps) => onChange(selectedValue.value);
31
31
 
32
32
  const handleInputChange = (inputText: string, meta: InputActionMeta) => {
33
33
  if (meta.action !== "input-blur" && meta.action !== "menu-close") {
@@ -57,7 +57,7 @@ const Select = (props: ISelectProps): JSX.Element => {
57
57
  error={error}
58
58
  onChange={handleChange}
59
59
  isSearchable={searchable}
60
- isClearable={hasEmptyOption}
60
+ hasEmptyOption={hasEmptyOption}
61
61
  onInputChange={handleInputChange}
62
62
  alignRight={alignRight}
63
63
  aria-label={name}
@@ -68,7 +68,7 @@ export const StyledSelect = styled(Select)<{
68
68
  padding: ${(p) => `13px ${p.theme.spacing.s} 12px ${p.theme.spacing.s}`};
69
69
  &:first-child {
70
70
  ${(p) =>
71
- p.isClearable &&
71
+ p.hasEmptyOption &&
72
72
  css`
73
73
  font-style: italic;
74
74
  color: ${(p) => p.theme.color.textLowEmphasis};