@firedesktop/react-base 1.1.0 → 1.2.1

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,59 +1,60 @@
1
- {
2
- "name": "@firedesktop/react-base",
3
- "version": "1.1.0",
4
- "license": "ISC",
5
- "main": "dist/index.js",
6
- "description": "This is the FireDesktop base package used to support every React Project in this Company.",
7
- "author": "alessandro.gambaro",
8
- "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
9
- "dependencies": {
10
- "@testing-library/jest-dom": "^5.11.5",
11
- "@testing-library/react": "^11.1.0",
12
- "@testing-library/user-event": "^12.1.10",
13
- "@types/jest": "^26.0.15",
14
- "@types/node": "^12.19.1",
15
- "@types/react": "^16.9.53",
16
- "@types/react-dom": "^16.9.8",
17
- "react": "^17.0.1",
18
- "react-dom": "^17.0.1",
19
- "react-scripts": "4.0.0",
20
- "react-redux": "^7.2.1",
21
- "redux": "^4.0.5",
22
- "@types/react-redux": "^7.1.9",
23
- "typescript": "^4.0.3",
24
- "web-vitals": "^0.2.4"
25
- },
26
- "devDependencies": {
27
- "@babel/cli": "^7.10.5",
28
- "@babel/core": "^7.10.5",
29
- "@babel/plugin-proposal-class-properties": "7.10.4",
30
- "@babel/plugin-transform-arrow-functions": "^7.12.1",
31
- "@babel/preset-typescript": "^7.12.1",
32
- "babel-preset-minify": "0.5.1",
33
- "babel-plugin-minify-builtins": "^0.5.0",
34
- "react-scripts": "^3.4.3"
35
- },
36
- "peerDependencies": {},
37
- "scripts": {
38
- "distribute": "rmdir /s /q dist & mkdir dist && npx babel src/lib --out-dir dist --extensions \".js,.ts,.tsx\" --source-maps inline",
39
- "start": "react-scripts start"
40
- },
41
- "eslintConfig": {
42
- "extends": [
43
- "react-app",
44
- "react-app/jest"
45
- ]
46
- },
47
- "browserslist": {
48
- "production": [
49
- ">0.2%",
50
- "not dead",
51
- "not op_mini all"
52
- ],
53
- "development": [
54
- "last 1 chrome version",
55
- "last 1 firefox version",
56
- "last 1 safari version"
57
- ]
58
- }
59
- }
1
+ {
2
+ "name": "@firedesktop/react-base",
3
+ "version": "1.2.1",
4
+ "license": "ISC",
5
+ "main": "dist/index.js",
6
+ "description": "This is the FireDesktop base package used to support every React Project in this Company.",
7
+ "author": "alessandro.gambaro",
8
+ "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
9
+ "dependencies": {
10
+ "react": "^17.0.1",
11
+ "react-dom": "^17.0.1",
12
+ "react-redux": "^7.2.1",
13
+ "redux": "^4.0.5"
14
+ },
15
+ "devDependencies": {
16
+ "@types/jest": "^26.0.15",
17
+ "@types/node": "^12.19.1",
18
+ "@types/react": "^16.9.53",
19
+ "@types/react-dom": "^16.9.8",
20
+ "@types/react-redux": "^7.1.9",
21
+ "@testing-library/jest-dom": "^5.11.5",
22
+ "@testing-library/react": "^11.1.0",
23
+ "@testing-library/user-event": "^12.1.10",
24
+ "@babel/cli": "^7.10.5",
25
+ "@babel/core": "^7.10.5",
26
+ "@babel/plugin-proposal-class-properties": "7.10.4",
27
+ "@babel/plugin-transform-arrow-functions": "^7.12.1",
28
+ "@babel/preset-typescript": "^7.12.1",
29
+ "babel-preset-minify": "0.5.1",
30
+ "babel-plugin-minify-builtins": "^0.5.0",
31
+ "react-scripts": "^3.4.3",
32
+ "typescript": "^4.0.3",
33
+ "web-vitals": "^0.2.4",
34
+ "@firedesktop/react-base": "1.2.0"
35
+ },
36
+ "peerDependencies": {},
37
+ "scripts": {
38
+ "distribute_not_working": "rmdir /s /q dist & mkdir dist && npx babel src/lib --out-dir dist --extensions \".js,.ts,.tsx\" --source-maps inline",
39
+ "start": "react-scripts start",
40
+ "distribute": "rmdir /s /q dist & mkdir dist && tsc"
41
+ },
42
+ "eslintConfig": {
43
+ "extends": [
44
+ "react-app",
45
+ "react-app/jest"
46
+ ]
47
+ },
48
+ "browserslist": {
49
+ "production": [
50
+ ">0.2%",
51
+ "not dead",
52
+ "not op_mini all"
53
+ ],
54
+ "development": [
55
+ "last 1 chrome version",
56
+ "last 1 firefox version",
57
+ "last 1 safari version"
58
+ ]
59
+ }
60
+ }
package/public/index.html CHANGED
@@ -1,43 +1,43 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Web site created using create-react-app"
11
- />
12
- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
- <!--
14
- manifest.json provides metadata used when your web app is installed on a
15
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
- -->
17
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
- <!--
19
- Notice the use of %PUBLIC_URL% in the tags above.
20
- It will be replaced with the URL of the `public` folder during the build.
21
- Only files inside the `public` folder can be referenced from the HTML.
22
-
23
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
- work correctly both with client-side routing and a non-root public URL.
25
- Learn how to configure a non-root public URL by running `npm run build`.
26
- -->
27
- <title>React App</title>
28
- </head>
29
- <body>
30
- <noscript>You need to enable JavaScript to run this app.</noscript>
31
- <div id="root"></div>
32
- <!--
33
- This HTML file is a template.
34
- If you open it directly in the browser, you will see an empty page.
35
-
36
- You can add webfonts, meta tags, or analytics to this file.
37
- The build step will place the bundled scripts into the <body> tag.
38
-
39
- To begin the development, run `npm start` or `yarn start`.
40
- To create a production bundle, use `npm run build` or `yarn build`.
41
- -->
42
- </body>
43
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta
9
+ name="description"
10
+ content="Web site created using create-react-app"
11
+ />
12
+ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
+ <!--
14
+ manifest.json provides metadata used when your web app is installed on a
15
+ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
+ -->
17
+ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
+ <!--
19
+ Notice the use of %PUBLIC_URL% in the tags above.
20
+ It will be replaced with the URL of the `public` folder during the build.
21
+ Only files inside the `public` folder can be referenced from the HTML.
22
+
23
+ Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
+ work correctly both with client-side routing and a non-root public URL.
25
+ Learn how to configure a non-root public URL by running `npm run build`.
26
+ -->
27
+ <title>React App</title>
28
+ </head>
29
+ <body>
30
+ <noscript>You need to enable JavaScript to run this app.</noscript>
31
+ <div id="root"></div>
32
+ <!--
33
+ This HTML file is a template.
34
+ If you open it directly in the browser, you will see an empty page.
35
+
36
+ You can add webfonts, meta tags, or analytics to this file.
37
+ The build step will place the bundled scripts into the <body> tag.
38
+
39
+ To begin the development, run `npm start` or `yarn start`.
40
+ To create a production bundle, use `npm run build` or `yarn build`.
41
+ -->
42
+ </body>
43
+ </html>
@@ -1,25 +1,25 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
package/public/robots.txt CHANGED
@@ -1,3 +1,3 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
package/src/App.test.tsx CHANGED
@@ -1,9 +1,9 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import App from './App';
4
-
5
- test('renders learn react link', () => {
6
- render(<App />);
7
- const linkElement = screen.getByText(/learn react/i);
8
- expect(linkElement).toBeInTheDocument();
9
- });
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import App from './App';
4
+
5
+ test('renders learn react link', () => {
6
+ render(<App />);
7
+ const linkElement = screen.getByText(/learn react/i);
8
+ expect(linkElement).toBeInTheDocument();
9
+ });
package/src/App.tsx CHANGED
@@ -1,51 +1,51 @@
1
- import React from 'react';
2
- import { Provider } from "react-redux";
3
- import { createStore } from 'redux';
4
-
5
- import ConfigurationLoader from './lib/ConfigurationLoader';
6
- import LanguageLoader from './lib/LanguageLoader';
7
- import TestLabelFunction from './TestLabelFunction';
8
-
9
- export const UPDATE_APP_STATE = 'UPDATE_APP_STATE';
10
- const appReducer = (state = {}, action: any) => {
11
- switch (action.type) {
12
- case UPDATE_APP_STATE: {
13
- const { name, value } = action.payload;
14
- const newState = { ...state, [name]: value };
15
- return newState;
16
- }
17
- default:
18
- return state;
19
- }
20
- }
21
-
22
- function App() {
23
-
24
- const updateAppState = (name: string, value: object) => {
25
- console.log(`updateState name: ${name}, configuration: ${value}`);
26
- return {
27
- type: UPDATE_APP_STATE,
28
- payload: {
29
- name,
30
- value,
31
- },
32
- };
33
- }
34
-
35
- // @ts-ignore
36
- const store = createStore(appReducer);
37
-
38
-
39
- return (
40
-
41
- <Provider store={store}>
42
-
43
- <TestLabelFunction />
44
-
45
- <ConfigurationLoader updateAppState={updateAppState} path={null} />
46
- <LanguageLoader updateAppState={updateAppState} locale='it-IT' path={null} />
47
- </Provider >
48
- );
49
- }
50
-
51
- export default App;
1
+ import React from 'react';
2
+ import { Provider } from "react-redux";
3
+ import { createStore } from 'redux';
4
+
5
+ import ConfigurationLoader from './types/ConfigurationLoader';
6
+ // import LanguageLoader from './types/LanguageLoader';
7
+ import TestLabelFunction from './TestLabelFunction';
8
+
9
+ export const UPDATE_APP_STATE = 'UPDATE_APP_STATE';
10
+ const appReducer = (state = {}, action: any) => {
11
+ switch (action.type) {
12
+ case UPDATE_APP_STATE: {
13
+ const { name, value } = action.payload;
14
+ const newState = { ...state, [name]: value };
15
+ return newState;
16
+ }
17
+ default:
18
+ return state;
19
+ }
20
+ }
21
+
22
+ function App() {
23
+
24
+ const updateAppState = (name: string, value: object) => {
25
+ console.log(`updateState name: ${name}, configuration: ${value}`);
26
+ return {
27
+ type: UPDATE_APP_STATE,
28
+ payload: {
29
+ name,
30
+ value,
31
+ },
32
+ };
33
+ }
34
+
35
+ // @ts-ignore
36
+ const store = createStore(appReducer);
37
+
38
+
39
+ return (
40
+
41
+ <Provider store={store}>
42
+
43
+ <TestLabelFunction />
44
+ <ConfigurationLoader updateAppState={updateAppState} path={null} />
45
+ {/*
46
+ <LanguageLoader updateAppState={updateAppState} locale='it-IT' path={null} /> */}
47
+ </Provider >
48
+ );
49
+ }
50
+
51
+ export default App;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { useSelector } from "react-redux";
3
-
4
3
  import LanguageManager from './lib/LanguageManager';
5
4
  const { getLabel } = LanguageManager();
6
5
 
package/src/index.tsx CHANGED
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
- import App from './App';
4
- import reportWebVitals from './reportWebVitals';
5
-
6
- ReactDOM.render(
7
- <React.StrictMode>
8
- <App />
9
- </React.StrictMode>,
10
- document.getElementById('root')
11
- );
12
-
13
- // If you want to start measuring performance in your app, pass a function
14
- // to log results (for example: reportWebVitals(console.log))
15
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
16
- reportWebVitals();
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import App from './App';
4
+ import reportWebVitals from './reportWebVitals';
5
+
6
+ ReactDOM.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ document.getElementById('root')
11
+ );
12
+
13
+ // If you want to start measuring performance in your app, pass a function
14
+ // to log results (for example: reportWebVitals(console.log))
15
+ // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
16
+ reportWebVitals();
@@ -1,15 +1,15 @@
1
- import { ReportHandler } from 'web-vitals';
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry);
7
- getFID(onPerfEntry);
8
- getFCP(onPerfEntry);
9
- getLCP(onPerfEntry);
10
- getTTFB(onPerfEntry);
11
- });
12
- }
13
- }
14
-
15
- export default reportWebVitals;
1
+ import { ReportHandler } from 'web-vitals';
2
+
3
+ const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
+ if (onPerfEntry && onPerfEntry instanceof Function) {
5
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
+ getCLS(onPerfEntry);
7
+ getFID(onPerfEntry);
8
+ getFCP(onPerfEntry);
9
+ getLCP(onPerfEntry);
10
+ getTTFB(onPerfEntry);
11
+ });
12
+ }
13
+ }
14
+
15
+ export default reportWebVitals;
package/src/setupTests.ts CHANGED
@@ -1,5 +1,5 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom';
1
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
+ // allows you to do things like:
3
+ // expect(element).toHaveTextContent(/react/i)
4
+ // learn more: https://github.com/testing-library/jest-dom
5
+ import '@testing-library/jest-dom';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare type configurationLoaderParamsType = {
3
+ updateAppState: any;
4
+ path: string | null;
5
+ };
6
+ declare function ConfigurationLoader({ updateAppState, path }: configurationLoaderParamsType): JSX.Element;
7
+ export default ConfigurationLoader;
@@ -0,0 +1,26 @@
1
+ import React, { useEffect } from "react";
2
+ import { useDispatch, useSelector } from "react-redux";
3
+ import ConfigurationManager from './ConfigurationManager';
4
+ function ConfigurationLoader(_a) {
5
+ var updateAppState = _a.updateAppState, path = _a.path;
6
+ var dispatch = useDispatch();
7
+ var configuration = useSelector(function (state) { return state; }).configuration;
8
+ var loadConfiguration = ConfigurationManager().loadConfiguration;
9
+ var fullPath = './configuration/config.json';
10
+ if (path)
11
+ fullPath = path;
12
+ useEffect(function () {
13
+ if (!configuration) {
14
+ console.log("Loading Configuration for this Site in this path: " + fullPath);
15
+ loadConfiguration(fullPath).then(function (response) {
16
+ console.log("Loaded Configuration for this Site in this path: " + fullPath, response);
17
+ dispatch(updateAppState("configuration", response));
18
+ })
19
+ .catch(function (err) {
20
+ console.log("Problem loading the Site Configuration in this path: " + fullPath);
21
+ });
22
+ }
23
+ }, [configuration, dispatch, loadConfiguration, fullPath, updateAppState]);
24
+ return (React.createElement(React.Fragment, null));
25
+ }
26
+ export default ConfigurationLoader;
@@ -0,0 +1,4 @@
1
+ declare function ConfigurationManager(formData?: any): {
2
+ loadConfiguration: (fullPath: string) => Promise<any>;
3
+ };
4
+ export default ConfigurationManager;
@@ -0,0 +1,62 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ function ConfigurationManager(formData) {
38
+ function loadConfiguration(fullPath) {
39
+ return __awaiter(this, void 0, void 0, function () {
40
+ var res, err_1;
41
+ return __generator(this, function (_a) {
42
+ switch (_a.label) {
43
+ case 0:
44
+ _a.trys.push([0, 3, , 4]);
45
+ return [4 /*yield*/, fetch(fullPath, { headers: { "Content-Type": "application/json; charset=utf-8" } })];
46
+ case 1:
47
+ res = _a.sent();
48
+ return [4 /*yield*/, res.json()];
49
+ case 2: return [2 /*return*/, _a.sent()];
50
+ case 3:
51
+ err_1 = _a.sent();
52
+ console.log("Problem loading the Site Labels");
53
+ return [3 /*break*/, 4];
54
+ case 4: return [2 /*return*/];
55
+ }
56
+ });
57
+ });
58
+ }
59
+ ;
60
+ return { loadConfiguration: loadConfiguration };
61
+ }
62
+ export default ConfigurationManager;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare type languageLoaderParamsType = {
3
+ updateAppState: any;
4
+ locale: string;
5
+ path: string | null;
6
+ };
7
+ declare function LanguageLoader({ updateAppState, locale, path }: languageLoaderParamsType): JSX.Element;
8
+ export default LanguageLoader;
@@ -0,0 +1,27 @@
1
+ import React, { useEffect } from "react";
2
+ import { useDispatch, useSelector } from "react-redux";
3
+ import LanguageManager from './LanguageManager';
4
+ function LanguageLoader(_a) {
5
+ var updateAppState = _a.updateAppState, locale = _a.locale, path = _a.path;
6
+ var dispatch = useDispatch();
7
+ var labels = useSelector(function (state) { return state; }).labels;
8
+ var loadLabels = LanguageManager().loadLabels;
9
+ var fileName = locale + ".json";
10
+ var fullPath = "./labels/" + fileName;
11
+ if (path)
12
+ fullPath = "./" + path + "/" + fileName;
13
+ useEffect(function () {
14
+ if (!labels) {
15
+ console.log("Loading Language Labels for this Site in this path: " + fullPath);
16
+ loadLabels(fullPath).then(function (response) {
17
+ console.log("Loaded Language Labels for this Site in this path: " + fullPath, response);
18
+ dispatch(updateAppState("labels", response));
19
+ })
20
+ .catch(function (err) {
21
+ console.log("Problem loading the Site Language Labels in this path: " + fullPath);
22
+ });
23
+ }
24
+ }, [labels, dispatch, loadLabels, fullPath, updateAppState]);
25
+ return (React.createElement(React.Fragment, null));
26
+ }
27
+ export default LanguageLoader;
@@ -0,0 +1,5 @@
1
+ declare function LanguageManager(formData?: any): {
2
+ getLabel: (labels: any, id: string, defaultValue: string) => any;
3
+ loadLabels: (fullPath: string) => Promise<any>;
4
+ };
5
+ export default LanguageManager;