@bigbinary/neeto-commons-frontend 4.13.0-beta.11 → 4.13.0-beta.12
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/configs/esbuild/alias.js +0 -3
- package/configs/esbuild/babel.config.js +2 -21
- package/configs/esbuild/constants.js +21 -0
- package/configs/esbuild/index.js +4 -19
- package/configs/esbuild/plugins/watch.js +24 -0
- package/configs/esbuild/utils.js +1 -44
- package/configs/vite/index.js +33 -0
- package/configs/vite/plugins/preval.js +22 -0
- package/configs/vite/plugins/svgr.js +54 -0
- package/configs/webpack/resolve.js +1 -0
- package/dist/cjs/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js.map +1 -1
- package/dist/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js +2 -2
- package/dist/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js.map +1 -1
- package/package.json +7 -2
package/configs/esbuild/alias.js
CHANGED
|
@@ -2,11 +2,8 @@ const path = require("path");
|
|
|
2
2
|
|
|
3
3
|
const commonResolve = require("@bigbinary/neeto-commons-frontend/configs/webpack/resolve.js");
|
|
4
4
|
|
|
5
|
-
const appResolve = require("../webpack/resolve.js");
|
|
6
|
-
|
|
7
5
|
module.exports = {
|
|
8
6
|
...commonResolve.alias,
|
|
9
|
-
...appResolve.alias,
|
|
10
7
|
images: path.resolve(process.cwd(), "app/assets/images"),
|
|
11
8
|
assert: require.resolve("assert/"),
|
|
12
9
|
buffer: require.resolve("buffer/"),
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
const {
|
|
2
|
-
TRANSFORM_RULES,
|
|
3
|
-
} = require("@bigbinary/neeto-commons-frontend/configs/constants.js");
|
|
1
|
+
const { BABEL_CONFIG } = require("configs/esbuild/constants");
|
|
4
2
|
|
|
5
3
|
module.exports = api => {
|
|
6
4
|
api.cache(true);
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
presets: ["@bigbinary/neeto"],
|
|
10
|
-
plugins: [
|
|
11
|
-
[
|
|
12
|
-
"module-resolver",
|
|
13
|
-
{
|
|
14
|
-
root: ["./src"],
|
|
15
|
-
alias: {
|
|
16
|
-
"dayjs/plugin/timezone":
|
|
17
|
-
"@bigbinary/neeto-commons-frontend/utils/timezonePlugin",
|
|
18
|
-
},
|
|
19
|
-
loglevel: "silent",
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
...TRANSFORM_RULES,
|
|
23
|
-
],
|
|
24
|
-
};
|
|
5
|
+
return BABEL_CONFIG;
|
|
25
6
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { TRANSFORM_RULES } = require("../constants");
|
|
2
|
+
|
|
3
|
+
const BABEL_CONFIG = {
|
|
4
|
+
presets: ["@bigbinary/neeto"],
|
|
5
|
+
plugins: [
|
|
6
|
+
[
|
|
7
|
+
"module-resolver",
|
|
8
|
+
{
|
|
9
|
+
root: ["./src"],
|
|
10
|
+
alias: {
|
|
11
|
+
"dayjs/plugin/timezone":
|
|
12
|
+
"@bigbinary/neeto-commons-frontend/utils/timezonePlugin",
|
|
13
|
+
},
|
|
14
|
+
loglevel: "silent",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
...TRANSFORM_RULES,
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
module.exports = { BABEL_CONFIG };
|
package/configs/esbuild/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
|
|
3
|
-
const commonResolve = require("@bigbinary/neeto-commons-frontend/configs/webpack/resolve.js");
|
|
4
3
|
const dotenv = require("dotenv");
|
|
5
4
|
const svgPlugin = require("esbuild-plugin-svgr");
|
|
6
5
|
const rails = require("esbuild-rails");
|
|
@@ -12,17 +11,11 @@ const alias = require("./alias.js");
|
|
|
12
11
|
const { babelPlugin } = require("./plugins/babel.js");
|
|
13
12
|
const { prevalPlugin } = require("./plugins/preval.js");
|
|
14
13
|
const { virtualizedPlugin } = require("./plugins/virtualized.js");
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
entryPoint,
|
|
18
|
-
createModuleEntryPoints,
|
|
19
|
-
build,
|
|
20
|
-
watch,
|
|
21
|
-
createBigbinaryEntryPoints,
|
|
22
|
-
} = require("./utils.js");
|
|
14
|
+
const { watchPlugin } = require("./plugins/watch.js");
|
|
15
|
+
const { createDefinitions, entryPoint, build, watch } = require("./utils.js");
|
|
23
16
|
|
|
24
|
-
// @ts-ignore
|
|
25
17
|
const postCssConfig = require("../../../../../postcss.config.js");
|
|
18
|
+
const commonResolve = require("../webpack/resolve.js");
|
|
26
19
|
|
|
27
20
|
const isProduction = process.env.NODE_ENV === "production";
|
|
28
21
|
const isWatchMode = process.argv.includes("--watch");
|
|
@@ -35,8 +28,6 @@ dotenv.config({ path: isProduction ? ".env" : ".env.development" });
|
|
|
35
28
|
const config = {
|
|
36
29
|
entryPoints: {
|
|
37
30
|
application: entryPoint("app/javascript/packs/application.js"),
|
|
38
|
-
...createBigbinaryEntryPoints(),
|
|
39
|
-
...createModuleEntryPoints(["antd", "recharts", "emojiMart"]),
|
|
40
31
|
},
|
|
41
32
|
publicPath: `${assetHost ?? ""}/assets`,
|
|
42
33
|
bundle: true,
|
|
@@ -48,6 +39,7 @@ const config = {
|
|
|
48
39
|
chunkNames: "chunks/[name]-[hash].digested",
|
|
49
40
|
plugins: [
|
|
50
41
|
rails(),
|
|
42
|
+
watchPlugin(isWatchMode),
|
|
51
43
|
prevalPlugin(),
|
|
52
44
|
babelPlugin(),
|
|
53
45
|
virtualizedPlugin(),
|
|
@@ -87,13 +79,6 @@ const config = {
|
|
|
87
79
|
"process.env.NODE_DEBUG": "'development'",
|
|
88
80
|
...createDefinitions(process),
|
|
89
81
|
},
|
|
90
|
-
banner: {
|
|
91
|
-
js: isWatchMode
|
|
92
|
-
? `(() => new EventSource("http://localhost:${
|
|
93
|
-
process.env.ESBUILD_PORT || 8000
|
|
94
|
-
}/esbuild").addEventListener('change', () => location.reload()))();`
|
|
95
|
-
: "",
|
|
96
|
-
},
|
|
97
82
|
};
|
|
98
83
|
|
|
99
84
|
module.exports = { config, build: isWatchMode ? watch : build };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const EVENT_SRC_CODE = `new EventSource("http://localhost:${
|
|
2
|
+
process.env.DEVSERVER_PORT || 8000
|
|
3
|
+
}/esbuild").addEventListener('change', () => location.reload());`;
|
|
4
|
+
|
|
5
|
+
const watchPlugin = isWatch => ({
|
|
6
|
+
name: "watch-plugin",
|
|
7
|
+
setup(build) {
|
|
8
|
+
build.onLoad(
|
|
9
|
+
{ filter: /app\/javascript\/packs\/application.js/ },
|
|
10
|
+
async args => {
|
|
11
|
+
const fs = require("fs").promises;
|
|
12
|
+
const contents = await fs.readFile(args.path, "utf8");
|
|
13
|
+
const appendedContents = `${EVENT_SRC_CODE}\n${contents}`;
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
contents: isWatch ? appendedContents : contents,
|
|
17
|
+
loader: "js",
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
module.exports = { watchPlugin };
|
package/configs/esbuild/utils.js
CHANGED
|
@@ -20,47 +20,6 @@ const createDefinitions = process => {
|
|
|
20
20
|
|
|
21
21
|
const entryPoint = file => path.join(process.cwd(), file);
|
|
22
22
|
|
|
23
|
-
const createBigbinaryEntryPoints = () => {
|
|
24
|
-
const directoryPath = "node_modules/@bigbinary";
|
|
25
|
-
const excludeList = [
|
|
26
|
-
"babel-preset-neeto",
|
|
27
|
-
"eslint-plugin-neeto",
|
|
28
|
-
"neeto-access-control-frontend",
|
|
29
|
-
];
|
|
30
|
-
const entries = {};
|
|
31
|
-
try {
|
|
32
|
-
const items = fs.readdirSync(directoryPath);
|
|
33
|
-
items.forEach(item => {
|
|
34
|
-
if (excludeList.includes(item)) return;
|
|
35
|
-
const itemPath = path.join(directoryPath, item, "/dist/index.js");
|
|
36
|
-
try {
|
|
37
|
-
fs.accessSync(itemPath);
|
|
38
|
-
entries[item] = entryPoint(itemPath);
|
|
39
|
-
} catch {
|
|
40
|
-
console.log(itemPath, "doesn't exist");
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return entries;
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error(`Error reading directory ${directoryPath}:`, error);
|
|
46
|
-
return {};
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const createModuleEntryPoints = modules => {
|
|
51
|
-
const entries = {};
|
|
52
|
-
modules.forEach(module => {
|
|
53
|
-
const modulePath = `node_modules/${
|
|
54
|
-
module instanceof String ? module : module.path
|
|
55
|
-
}`;
|
|
56
|
-
const name = module instanceof String ? module : module.name;
|
|
57
|
-
if (fs.existsSync(modulePath)) {
|
|
58
|
-
entries[name] = entryPoint(modulePath);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return entries;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
23
|
const build = async config => {
|
|
65
24
|
try {
|
|
66
25
|
console.info(
|
|
@@ -82,7 +41,7 @@ const watch = async config => {
|
|
|
82
41
|
await ctx.watch();
|
|
83
42
|
await ctx.serve({
|
|
84
43
|
servedir: config.outdir,
|
|
85
|
-
port: parseInt(process.env.
|
|
44
|
+
port: parseInt(process.env.DEVSERVER_PORT || "8000"),
|
|
86
45
|
});
|
|
87
46
|
};
|
|
88
47
|
|
|
@@ -90,8 +49,6 @@ module.exports = {
|
|
|
90
49
|
consoleColors,
|
|
91
50
|
createDefinitions,
|
|
92
51
|
entryPoint,
|
|
93
|
-
createModuleEntryPoints,
|
|
94
52
|
build,
|
|
95
53
|
watch,
|
|
96
|
-
createBigbinaryEntryPoints,
|
|
97
54
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const { default: react } = require("@vitejs/plugin-react");
|
|
2
|
+
const dotenv = require("dotenv");
|
|
3
|
+
|
|
4
|
+
const { prevalPlugin } = require("./plugins/preval.js");
|
|
5
|
+
const svgr = require("./plugins/svgr.js");
|
|
6
|
+
|
|
7
|
+
const postCssConfig = require("../../../../../postcss.config.js");
|
|
8
|
+
const { BABEL_CONFIG } = require("../esbuild/constants.js");
|
|
9
|
+
const { config: esbuildConfig } = require("../esbuild/index.js");
|
|
10
|
+
const { entryPoint } = require("../esbuild/utils.js");
|
|
11
|
+
|
|
12
|
+
dotenv.config({ path: ".env.development" });
|
|
13
|
+
|
|
14
|
+
const port = process.env.DEVSERVER_PORT || 8000;
|
|
15
|
+
|
|
16
|
+
const config = {
|
|
17
|
+
css: { postcss: postCssConfig },
|
|
18
|
+
plugins: [svgr(), react({ babel: BABEL_CONFIG }), prevalPlugin()],
|
|
19
|
+
resolve: { extensions: esbuildConfig.resolveExtensions },
|
|
20
|
+
server: { port, origin: `http://localhost:${port}` },
|
|
21
|
+
build: {
|
|
22
|
+
manifest: true,
|
|
23
|
+
sourcemap: true,
|
|
24
|
+
cssCodeSplit: false,
|
|
25
|
+
rollupOptions: {
|
|
26
|
+
input: { application: entryPoint("app/javascript/packs/application.js") },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
define: esbuildConfig.define,
|
|
30
|
+
root: "app/javascript/packs",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = { config };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const PkgTranslations = require("../../scripts/getPkgTranslations.js");
|
|
2
|
+
|
|
3
|
+
const PREVAL_IMPORT =
|
|
4
|
+
'preval.require("../../configs/scripts/getPkgTranslations.js")';
|
|
5
|
+
|
|
6
|
+
const prevalPlugin = () => ({
|
|
7
|
+
name: "preval-plugin",
|
|
8
|
+
transform(code, id) {
|
|
9
|
+
if (id.includes("node_modules") && code.includes(PREVAL_IMPORT)) {
|
|
10
|
+
const replacedCode = code.replace(
|
|
11
|
+
PREVAL_IMPORT,
|
|
12
|
+
JSON.stringify(PkgTranslations)
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return { code: replacedCode, map: null };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return null;
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
module.exports = { prevalPlugin };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
|
|
3
|
+
const { transformAsync, createConfigItem } = require("@babel/core");
|
|
4
|
+
const pluginTransformReactConstantElements = require("@babel/plugin-transform-react-constant-elements");
|
|
5
|
+
const presetEnv = require("@babel/preset-env");
|
|
6
|
+
const presetReact = require("@babel/preset-react");
|
|
7
|
+
const { createFilter } = require("@rollup/pluginutils");
|
|
8
|
+
const { transform } = require("@svgr/core");
|
|
9
|
+
const jsx = require("@svgr/plugin-jsx");
|
|
10
|
+
const svgo = require("@svgr/plugin-svgo");
|
|
11
|
+
|
|
12
|
+
const babelOptions = {
|
|
13
|
+
babelrc: false,
|
|
14
|
+
configFile: false,
|
|
15
|
+
presets: [
|
|
16
|
+
createConfigItem(presetReact, { type: "preset" }),
|
|
17
|
+
createConfigItem([presetEnv, { modules: false }], { type: "preset" }),
|
|
18
|
+
],
|
|
19
|
+
plugins: [createConfigItem(pluginTransformReactConstantElements)],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const plugin = (options = {}) => {
|
|
23
|
+
const filter = createFilter(options.include || "**/*.svg", options.exclude);
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
name: "svgr",
|
|
27
|
+
|
|
28
|
+
async transform(_data, id) {
|
|
29
|
+
if (!filter(id)) return null;
|
|
30
|
+
|
|
31
|
+
if (id.slice(-4) !== ".svg") return null;
|
|
32
|
+
|
|
33
|
+
const load = fs.readFileSync(id, "utf8");
|
|
34
|
+
|
|
35
|
+
const jsCode = await transform(load, options, {
|
|
36
|
+
filePath: id,
|
|
37
|
+
caller: {
|
|
38
|
+
name: "@svgr/rollup",
|
|
39
|
+
previousExport: null, // Force default export
|
|
40
|
+
defaultPlugins: [svgo, jsx],
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const result = await transformAsync(jsCode, babelOptions);
|
|
45
|
+
if (!result?.code) {
|
|
46
|
+
throw new Error("Error while transforming using Babel");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return { code: result.code, map: null };
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
module.exports = plugin;
|
|
@@ -15,6 +15,7 @@ module.exports = {
|
|
|
15
15
|
translations: absolutePath("src/translations"),
|
|
16
16
|
utils: absolutePath("src/utils"),
|
|
17
17
|
src: absolutePath("src"),
|
|
18
|
+
stylesheets: absolutePath("stylesheets"),
|
|
18
19
|
neetoui: "@bigbinary/neetoui",
|
|
19
20
|
neetocommons: "@bigbinary/neeto-commons-frontend",
|
|
20
21
|
neetoicons: "@bigbinary/neeto-icons",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackComponent.js","sources":["../../../../src/react-utils/HoneybadgerErrorBoundary/FallbackComponent.jsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport FallbackComponentImage from \"assets/images/fallback-component.svg\";\nimport
|
|
1
|
+
{"version":3,"file":"FallbackComponent.js","sources":["../../../../src/react-utils/HoneybadgerErrorBoundary/FallbackComponent.jsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport FallbackComponentImage from \"assets/images/fallback-component.svg\";\nimport DOMPurify from \"dompurify\";\nimport { Button, Typography } from \"neetoui\";\nimport { isNil } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nconst FallbackComponent = () => {\n const { t } = useTranslation();\n\n useEffect(() => {\n const listener = e => {\n if (isNil(e.state)) return;\n window.location.href = DOMPurify.sanitize(e.target?.location.href);\n };\n window.addEventListener(\"popstate\", listener);\n\n return () => window.removeEventListener(\"popstate\", listener);\n }, []);\n\n return (\n <div className=\"flex h-screen w-full flex-row items-start justify-start\">\n <div className=\"m-auto text-center\">\n <div className=\"m-auto mb-8 flex items-center justify-center\">\n <FallbackComponentImage />\n </div>\n <Typography\n className=\"mb-4\"\n component=\"h2\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {t(\"neetoCommons.fallbackComponent.somethingWentWrong\")}\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-600 mb-8\"\n component=\"p\"\n style=\"body1\"\n weight=\"normal\"\n >\n <Trans\n i18nKey=\"neetoCommons.fallbackComponent.description\"\n components={{\n reloading: (\n <Button style=\"link\" onClick={() => window.location.reload()} />\n ),\n contactus: (\n <Button\n style=\"link\"\n onClick={() => {\n window.NeetoChat?.contextualHelp?.maximizeWidget();\n window.NeetoChat?.contextualHelp?.openWidget();\n }}\n />\n ),\n }}\n />\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default FallbackComponent;\n"],"names":["FallbackComponentImage","props","_jsxs","_objectSpread","children","_jsx","d","fill","defaultProps","width","height","viewBox","xmlns","FallbackComponent","_useTranslation","useTranslation","t","useEffect","listener","e","_e$target","isNil","state","window","location","href","DOMPurify","sanitize","target","addEventListener","removeEventListener","className","Typography","component","style","weight","Trans","i18nKey","components","reloading","Button","onClick","reload","contactus","_window$NeetoChat","_window$NeetoChat$con","_window$NeetoChat2","_window$NeetoChat2$co","NeetoChat","contextualHelp","maximizeWidget","openWidget"],"mappings":";;;;;;;;;;;;;AAAkC,IAE3BA,sBAAsB,GAAA,SAAtBA,sBAAsBA,CAAAC,KAAA,EAAA;AAAA,EAAA,oBAAAC,eAAA,CAAAC,KAAAA,EAAAA,aAAA,CAAAA,aAAA,KAAAF,KAAA,CAAA,EAAA,EAAA,EAAA;AAAAG,IAAAA,QAAA,gBAAAC,cAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,s8BAAA;MAAAC,IAAA,EAAA,SAAA;AAAA,KAAA,CAAA,eAAAF,cAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,w4BAAA;MAAAC,IAAA,EAAA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M,CAACC,QAAQ,CAACkB,MAAM,EAAE,CAAA;AAAA,eAAA;AAAC,aAAE,CAChE;YACDC,SAAS,eACPtC,cAAA,CAACmC,MAAM,EAAA;AACLN,cAAAA,KAAK,EAAC,MAAM;AACZO,cAAAA,OAAO,EAAE,SAATA,OAAOA,GAAQ;AAAA,gBAAA,IAAAG,iBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,qBAAA,CAAA;gBACb,CAAAH,iBAAA,GAAArB,MAAM,CAACyB,SAAS,MAAAJ,IAAAA,IAAAA,iBAAA,wBAAAC,qBAAA,GAAhBD,iBAAA,CAAkBK,cAAc,cAAAJ,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhCA,qBAAA,CAAkCK,cAAc,EAAE,CAAA;gBAClD,CAAAJ,kBAAA,GAAAvB,MAAM,CAACyB,SAAS,MAAAF,IAAAA,IAAAA,kBAAA,wBAAAC,qBAAA,GAAhBD,kBAAA,CAAkBG,cAAc,cAAAF,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhCA,qBAAA,CAAkCI,UAAU,EAAE,CAAA;AAChD,eAAA;aACD,CAAA;AAEL,WAAA;SACD,CAAA;AAAC,OACQ,CAAC,CAAA;KACV,CAAA;AAAC,GACH,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _defineProperty } from '../../defineProperty-CEd-kZQW.js';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import DOMPurify from 'dompurify';
|
|
4
4
|
import Button from '@bigbinary/neetoui/Button';
|
|
5
5
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
6
6
|
import { isNil } from 'ramda';
|
|
@@ -47,7 +47,7 @@ var FallbackComponent = function FallbackComponent() {
|
|
|
47
47
|
var listener = function listener(e) {
|
|
48
48
|
var _e$target;
|
|
49
49
|
if (isNil(e.state)) return;
|
|
50
|
-
window.location.href = sanitize((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.location.href);
|
|
50
|
+
window.location.href = DOMPurify.sanitize((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.location.href);
|
|
51
51
|
};
|
|
52
52
|
window.addEventListener("popstate", listener);
|
|
53
53
|
return function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackComponent.js","sources":["../../../src/react-utils/HoneybadgerErrorBoundary/FallbackComponent.jsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport FallbackComponentImage from \"assets/images/fallback-component.svg\";\nimport
|
|
1
|
+
{"version":3,"file":"FallbackComponent.js","sources":["../../../src/react-utils/HoneybadgerErrorBoundary/FallbackComponent.jsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport FallbackComponentImage from \"assets/images/fallback-component.svg\";\nimport DOMPurify from \"dompurify\";\nimport { Button, Typography } from \"neetoui\";\nimport { isNil } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nconst FallbackComponent = () => {\n const { t } = useTranslation();\n\n useEffect(() => {\n const listener = e => {\n if (isNil(e.state)) return;\n window.location.href = DOMPurify.sanitize(e.target?.location.href);\n };\n window.addEventListener(\"popstate\", listener);\n\n return () => window.removeEventListener(\"popstate\", listener);\n }, []);\n\n return (\n <div className=\"flex h-screen w-full flex-row items-start justify-start\">\n <div className=\"m-auto text-center\">\n <div className=\"m-auto mb-8 flex items-center justify-center\">\n <FallbackComponentImage />\n </div>\n <Typography\n className=\"mb-4\"\n component=\"h2\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {t(\"neetoCommons.fallbackComponent.somethingWentWrong\")}\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-600 mb-8\"\n component=\"p\"\n style=\"body1\"\n weight=\"normal\"\n >\n <Trans\n i18nKey=\"neetoCommons.fallbackComponent.description\"\n components={{\n reloading: (\n <Button style=\"link\" onClick={() => window.location.reload()} />\n ),\n contactus: (\n <Button\n style=\"link\"\n onClick={() => {\n window.NeetoChat?.contextualHelp?.maximizeWidget();\n window.NeetoChat?.contextualHelp?.openWidget();\n }}\n />\n ),\n }}\n />\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default FallbackComponent;\n"],"names":["FallbackComponentImage","props","_jsxs","_objectSpread","children","_jsx","d","fill","defaultProps","width","height","viewBox","xmlns","FallbackComponent","_useTranslation","useTranslation","t","useEffect","listener","e","_e$target","isNil","state","window","location","href","DOMPurify","sanitize","target","addEventListener","removeEventListener","className","Typography","component","style","weight","Trans","i18nKey","components","reloading","Button","onClick","reload","contactus","_window$NeetoChat","_window$NeetoChat$con","_window$NeetoChat2","_window$NeetoChat2$co","NeetoChat","contextualHelp","maximizeWidget","openWidget"],"mappings":";;;;;;;;;;;AAAkC,IAE3BA,sBAAsB,GAAA,SAAtBA,sBAAsBA,CAAAC,KAAA,EAAA;AAAA,EAAA,oBAAAC,IAAA,CAAAC,KAAAA,EAAAA,aAAA,CAAAA,aAAA,KAAAF,KAAA,CAAA,EAAA,EAAA,EAAA;AAAAG,IAAAA,QAAA,gBAAAC,GAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,s8BAAA;MAAAC,IAAA,EAAA,SAAA;AAAA,KAAA,CAAA,eAAAF,GAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,w4BAAA;MAAAC,IAAA,EAAA,SAAA;AAAA,KAAA,CAAA,eAAAF,GAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,w4BAAA;MAAAC,IAAA,EAAA,SAAA;AAAA,KAAA,CAAA,eAAAF,GAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,ipFAAA;MAAAC,IAAA,EAAA,SAAA;AAAA,KAAA,CAAA,eAAAF,GAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,04CAAA;MAAAC,IAAA,EAAA,SAAA;AAAA,KAAA,CAAA,eAAAF,GAAA,CAAA,MAAA,EAAA;MAAAC,CAAA,EAAA,ukHAAA;M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AAAJ,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhCA,qBAAA,CAAkCK,cAAc,EAAE,CAAA;gBAClD,CAAAJ,kBAAA,GAAAvB,MAAM,CAACyB,SAAS,MAAAF,IAAAA,IAAAA,kBAAA,wBAAAC,qBAAA,GAAhBD,kBAAA,CAAkBG,cAAc,cAAAF,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhCA,qBAAA,CAAkCI,UAAU,EAAE,CAAA;AAChD,eAAA;aACD,CAAA;AAEL,WAAA;SACD,CAAA;AAAC,OACQ,CAAC,CAAA;KACV,CAAA;AAAC,GACH,CAAC,CAAA;AAEV;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "4.13.0-beta.
|
|
3
|
+
"version": "4.13.0-beta.12",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"@storybook/manager-webpack5": "6.5.16",
|
|
115
115
|
"@storybook/preset-scss": "1.0.3",
|
|
116
116
|
"@storybook/react": "6.5.16",
|
|
117
|
-
"@svgr/rollup": "8.1.0",
|
|
117
|
+
"@svgr/rollup": "^8.1.0",
|
|
118
118
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
119
119
|
"@tanstack/react-query": "5.40.0",
|
|
120
120
|
"@tanstack/react-query-devtools": "5.40.0",
|
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
"@testing-library/react-hooks": "^8.0.0",
|
|
124
124
|
"@testing-library/user-event": "13.5.0",
|
|
125
125
|
"@tippyjs/react": "4.2.6",
|
|
126
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
126
127
|
"antd": "5.16.0",
|
|
127
128
|
"autoprefixer": "^10.4.5",
|
|
128
129
|
"avvvatars-react": "0.4.2",
|
|
@@ -206,6 +207,7 @@
|
|
|
206
207
|
"unified": "11.0.0",
|
|
207
208
|
"util": "^0.12.5",
|
|
208
209
|
"uuid": "10.0.0",
|
|
210
|
+
"vite": "^6.0.3",
|
|
209
211
|
"yup": "0.32.11",
|
|
210
212
|
"zustand": "4.3.2"
|
|
211
213
|
},
|
|
@@ -222,10 +224,12 @@
|
|
|
222
224
|
"@honeybadger-io/js": "^6.4.1",
|
|
223
225
|
"@honeybadger-io/react": "^6.1.3",
|
|
224
226
|
"@rails/actioncable": "7.2.100",
|
|
227
|
+
"@svgr/rollup": "^8.1.0",
|
|
225
228
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
226
229
|
"@tanstack/react-query": "5.40.0",
|
|
227
230
|
"@tanstack/react-query-devtools": "5.40.0",
|
|
228
231
|
"@tippyjs/react": "4.2.6",
|
|
232
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
229
233
|
"antd": "5.16.0",
|
|
230
234
|
"autoprefixer": "^10.4.5",
|
|
231
235
|
"avvvatars-react": "0.4.2",
|
|
@@ -261,6 +265,7 @@
|
|
|
261
265
|
"tailwindcss": "^3.4.1",
|
|
262
266
|
"util": "^0.12.5",
|
|
263
267
|
"uuid": "10.0.0",
|
|
268
|
+
"vite": "^6.0.3",
|
|
264
269
|
"webpack": "^5.75.0",
|
|
265
270
|
"yup": "0.32.11",
|
|
266
271
|
"zustand": "4.3.2"
|