@campxdev/react-blueprint 1.1.12 → 1.2.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.
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-blueprint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "./export.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@campxdev/campx-web-utils":
|
|
7
|
+
"@campxdev/campx-web-utils":"0.1.5",
|
|
8
8
|
"@emotion/react": "^11.11.4",
|
|
9
9
|
"@emotion/styled": "^11.11.5",
|
|
10
10
|
"@mui/icons-material": "^5.15.20",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"yalc": "^1.0.0-pre.53"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"start": "
|
|
47
|
-
"build": "
|
|
48
|
-
"test": "
|
|
46
|
+
"start": "react-scripts start",
|
|
47
|
+
"build": "react-scripts build",
|
|
48
|
+
"test": "react-scripts test",
|
|
49
49
|
"eject": "react-scripts eject",
|
|
50
50
|
"storybook": "storybook dev -p 6006",
|
|
51
51
|
"build-storybook": "storybook build"
|
|
@@ -72,7 +72,6 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
74
74
|
"@chromatic-com/storybook": "^1.6.1",
|
|
75
|
-
"@craco/craco": "^7.1.0",
|
|
76
75
|
"@storybook/addon-essentials": "^8.2.6",
|
|
77
76
|
"@storybook/addon-interactions": "^8.2.6",
|
|
78
77
|
"@storybook/addon-links": "^8.2.6",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getBreadcrumbsCharacter } from '@campxdev/campx-web-utils';
|
|
2
1
|
import {
|
|
3
2
|
Breadcrumbs as MuiBreadcrumbs,
|
|
4
3
|
BreadcrumbsProps as MuiBreadcrumbsProps,
|
|
@@ -12,6 +11,20 @@ export type BreadcrumbsProps = {
|
|
|
12
11
|
urlSpliceCount: number;
|
|
13
12
|
} & MuiBreadcrumbsProps;
|
|
14
13
|
|
|
14
|
+
const getBreadcrumbsCharacter = () => {
|
|
15
|
+
const unicodeChar = String.fromCharCode(0x21e5);
|
|
16
|
+
const testElement = document.createElement('span');
|
|
17
|
+
testElement.innerHTML = unicodeChar;
|
|
18
|
+
document.body.appendChild(testElement);
|
|
19
|
+
const isRendered = testElement.offsetWidth > 0;
|
|
20
|
+
document.body.removeChild(testElement);
|
|
21
|
+
|
|
22
|
+
const fallbackChar = '~~';
|
|
23
|
+
const s = isRendered ? unicodeChar : fallbackChar;
|
|
24
|
+
|
|
25
|
+
return s;
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
export const Breadcrumbs = ({ urlSpliceCount, ...rest }: BreadcrumbsProps) => {
|
|
16
29
|
const specialCharacter = getBreadcrumbsCharacter();
|
|
17
30
|
const currentPathArray = window.location.pathname.split('/');
|
package/craco.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { getLoader, loaderByName } = require('@craco/craco');
|
|
3
|
-
const packages = [];
|
|
4
|
-
packages.push(path.dirname(require.resolve('@campxdev/campx-web-utils')));
|
|
5
|
-
packages.push(path.dirname(require.resolve('@campxdev/react-blueprint')));
|
|
6
|
-
module.exports = {
|
|
7
|
-
webpack: {
|
|
8
|
-
configure: (webpackConfig) => {
|
|
9
|
-
const { isFound, match } = getLoader(webpackConfig, loaderByName('babel-loader'));
|
|
10
|
-
if (isFound) {
|
|
11
|
-
const include = Array.isArray(match.loader.include) ? match.loader.include : [match.loader.include];
|
|
12
|
-
match.loader.include = include.concat(packages);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return webpackConfig;
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|