@griddo/ax 11.4.7-rc.1 → 11.4.7

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.7-rc.1",
4
+ "version": "11.4.7",
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
- "@types/compress.js": "1.1.3",
48
- "@types/draft-js": "0.11.18",
49
- "@types/lodash.isequal": "4.5.8",
50
- "@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",
51
57
  "@types/node": "20.17.10",
52
- "@types/react": "18.2.79",
53
- "@types/react-beautiful-dnd": "13.1.3",
54
- "@types/react-datepicker": "4.19.6",
55
- "@types/react-dom": "18.2.25",
56
- "@types/react-draft-wysiwyg": "1.13.8",
57
- "@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",
58
64
  "@types/react-router-dom": "5.3.3",
59
- "@types/react-slick": "0.23.13",
65
+ "@types/react-select": "4.0.18",
66
+ "@types/react-slick": "^0.23.10",
60
67
  "@types/react-test-renderer": "17.0.1",
61
- "@types/styled-components": "5.1.26",
62
- "@types/webpack-env": "1.18.0",
63
- "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",
64
75
  "axios": "0.19.0",
76
+ "babel-eslint": "10.0.3",
77
+ "babel-loader": "8.2.2",
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",
65
83
  "case-sensitive-paths-webpack-plugin": "2.4.0",
66
- "compress.js": "1.2.2",
67
- "connected-react-router": "6.9.3",
68
- "css-loader": "4.3.0",
84
+ "compress.js": "^1.1.2",
85
+ "connected-react-router": "^6.9.2",
86
+ "css-loader": "^4.3.0",
69
87
  "css-minimizer-webpack-plugin": "3.0.2",
70
- "date-fns": "2.30.0",
88
+ "date-fns": "^2.21.3",
71
89
  "dotenv": "6.2.0",
72
90
  "dotenv-expand": "5.1.0",
73
- "draft-js": "0.11.7",
74
- "draft-js-import-html": "1.4.1",
75
- "draftjs-to-html": "0.9.1",
76
- "enhanced-resolve": "5.18.1",
77
- "env-cmd": "10.1.0",
78
- "file-loader": "6.2.0",
79
- "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",
80
98
  "fs-extra": "7.0.1",
81
- "html-to-draftjs": "1.5.0",
82
- "html-to-image": "1.11.7",
99
+ "html-to-draftjs": "^1.5.0",
100
+ "html-to-image": "^1.9.0",
83
101
  "html-webpack-plugin": "4.5.0",
84
102
  "identity-obj-proxy": "3.0.0",
85
- "ignore-loader": "0.1.2",
86
- "is-wsl": "3.1.0",
87
- "jsdom": "20.0.3",
88
- "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",
89
111
  "lodash.isequal": "4.5.0",
90
- "markdown-draft-js": "2.4.0",
91
- "masonic": "4.1.0",
112
+ "markdown-draft-js": "^2.2.1",
113
+ "masonic": "^4.0.1",
92
114
  "mini-css-extract-plugin": "0.11.3",
93
- "optimize-css-assets-webpack-plugin": "6.0.1",
94
- "pkg-dir": "5.0.0",
95
- "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",
96
118
  "polished": "3.4.1",
97
- "postcss": "8.5.3",
119
+ "postcss": "^8.4.5",
98
120
  "postcss-flexbugs-fixes": "4.1.0",
99
121
  "postcss-loader": "3.0.0",
100
122
  "postcss-normalize": "7.0.1",
101
123
  "postcss-preset-env": "6.7.0",
102
- "postcss-safe-parser": "6.0.0",
103
- "react": "18.2.0",
104
- "react-app-polyfill": "1.0.6",
105
- "react-beautiful-dnd": "13.1.1",
106
- "react-datepicker": "4.25.0",
107
- "react-dev-utils": "11.0.4",
108
- "react-dom": "18.2.0",
109
- "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",
110
132
  "react-error-boundary": "4.0.13",
111
- "react-froala-wysiwyg": "3.2.7",
112
- "react-redux": "7.2.9",
113
- "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",
114
137
  "react-router-dom": "5.1.2",
115
- "react-select": "5.10.1",
116
- "react-slick": "0.30.3",
117
- "react-textarea-autosize": "8.5.9",
118
- "redux": "4.2.1",
119
- "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",
120
143
  "redux-persist": "6.0.0",
144
+ "redux-thunk": "^2.4.1",
121
145
  "reflect-metadata": "0.1.13",
122
- "resolve": "1.22.10",
123
- "resolve-url-loader": "4.0.0",
124
- "sass-alias": "1.0.5",
125
- "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",
126
150
  "semver": "7.6.3",
127
151
  "slick-carousel": "1.8.1",
128
- "source-map-loader": "1.1.3",
129
- "string-replace-loader": "3.1.0",
130
- "style-loader": "1.3.0",
131
- "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",
132
156
  "styled-reset": "4.0.1",
133
157
  "styled-system": "5.1.5",
134
158
  "terser-webpack-plugin": "1.4.1",
135
159
  "ts-pnp": "1.1.4",
160
+ "typescript": "^4.6.3",
136
161
  "url-loader": "4.1.1",
137
- "webpack": "4.47.0",
162
+ "uuid": "8.3.2",
163
+ "webpack": "4.44.2",
138
164
  "webpack-dev-server": "3.11.1",
139
165
  "webpack-manifest-plugin": "2.2.0",
140
166
  "workbox-webpack-plugin": "5.1.4"
141
167
  },
142
168
  "devDependencies": {
143
- "@babel/core": "7.26.10",
144
- "@babel/plugin-transform-optional-chaining": "7.25.9",
145
- "@babel/preset-env": "7.26.9",
146
- "@babel/preset-react": "7.26.3",
147
- "@babel/preset-typescript": "7.26.0",
148
- "@testing-library/jest-dom": "5.16.5",
149
- "@testing-library/react": "13.4.0",
150
- "@testing-library/user-event": "14.6.1",
151
- "@types/jest": "27.5.2",
152
- "@types/redux-mock-store": "1.0.3",
153
- "@types/uuid": "8.3.4",
154
- "@typescript-eslint/eslint-plugin": "7.18.0",
155
- "@typescript-eslint/parser": "7.18.0",
156
- "axios-mock-adapter": "1.22.0",
157
- "babel-eslint": "10.0.3",
158
- "babel-jest": "27.5.1",
159
- "babel-loader": "8.2.2",
160
- "babel-plugin-named-asset-import": "0.3.8",
161
- "babel-plugin-require-context-hook": "1.0.0",
162
- "babel-plugin-root-import": "6.6.0",
163
- "babel-plugin-styled-components": "2.1.4",
164
- "babel-preset-react-app": "10.1.0",
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": "dfc1feebe08633311625c50081dc190d99c15780"
229
+ "gitHead": "0165d0d03257039a143ceae26df26fd34c7563c6"
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};