anim-3d-obj 1.0.9 → 1.0.13
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/README.md +5 -155
- package/dist/cjs/components/Cuboid.d.ts +2 -1
- package/dist/cjs/components/Cuboid.js +12 -24
- package/dist/cjs/components/Cuboid.js.map +1 -1
- package/dist/cjs/components/Faces/Face.js +15 -34
- package/dist/cjs/components/Faces/Face.js.map +1 -1
- package/dist/cjs/components/index.d.ts +0 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Cuboid.d.ts +2 -1
- package/dist/esm/components/Cuboid.js +13 -23
- package/dist/esm/components/Cuboid.js.map +1 -1
- package/dist/esm/components/Faces/Face.js +15 -34
- package/dist/esm/components/Faces/Face.js.map +1 -1
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/hooks/index.d.ts +0 -1
- package/dist/cjs/hooks/index.js +0 -18
- package/dist/cjs/hooks/index.js.map +0 -1
- package/dist/cjs/hooks/useLogging.d.ts +0 -7
- package/dist/cjs/hooks/useLogging.js +0 -19
- package/dist/cjs/hooks/useLogging.js.map +0 -1
- package/dist/cjs/library/Logging.d.ts +0 -25
- package/dist/cjs/library/Logging.js +0 -43
- package/dist/cjs/library/Logging.js.map +0 -1
- package/dist/cjs/library/index.d.ts +0 -1
- package/dist/cjs/library/index.js +0 -18
- package/dist/cjs/library/index.js.map +0 -1
- package/dist/esm/hooks/index.d.ts +0 -1
- package/dist/esm/hooks/index.js +0 -2
- package/dist/esm/hooks/index.js.map +0 -1
- package/dist/esm/hooks/useLogging.d.ts +0 -7
- package/dist/esm/hooks/useLogging.js +0 -12
- package/dist/esm/hooks/useLogging.js.map +0 -1
- package/dist/esm/library/Logging.d.ts +0 -25
- package/dist/esm/library/Logging.js +0 -39
- package/dist/esm/library/Logging.js.map +0 -1
- package/dist/esm/library/index.d.ts +0 -1
- package/dist/esm/library/index.js +0 -2
- package/dist/esm/library/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,159 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
This is component-library files on here are imported from: https://github.com/mdnelles/anim-3d-objs-launcher
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
The program does the leg work with regard to calculating translationZ depth and config on the fly.
|
|
3
|
+
That version is browser launchable (has App.tsx file)
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
This repo is for the npm published version
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## IMPORTANT
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
npm install anim-3d-objs
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Examples
|
|
15
|
-
|
|
16
|
-
All sided simple https://codesandbox.io/s/anim-3d-obj-all-sides-simple-sdy1q0
|
|
17
|
-
|
|
18
|
-
Two sided simple https://codesandbox.io/s/anim-3d-obj-2-sides-simple-9wognm
|
|
19
|
-
|
|
20
|
-
90 degree wobble on X axis https://codesandbox.io/s/anim-3d-obj-wobblex-08mxqe
|
|
21
|
-
|
|
22
|
-
speed wobble(y) 3 sides https://codesandbox.io/s/anim-3d-obj-3-sides-wobble-y-axis-dceqdp
|
|
23
|
-
|
|
24
|
-
## usage
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
<Cuboid
|
|
28
|
-
width={300}
|
|
29
|
-
height={200}
|
|
30
|
-
depth={100}
|
|
31
|
-
perspectiveOrigin='50% 50%'
|
|
32
|
-
zIndex={10}
|
|
33
|
-
animSpecs={animSpecs}
|
|
34
|
-
custom={custom}
|
|
35
|
-
faces={faceprops}
|
|
36
|
-
global={global}
|
|
37
|
-
>
|
|
38
|
-
{}
|
|
39
|
-
</Cuboid>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
example spec for global config and 6 sided cuboid
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
const faceprops = {
|
|
46
|
-
front: true,
|
|
47
|
-
back: true,
|
|
48
|
-
left: true,
|
|
49
|
-
right: true,
|
|
50
|
-
top: true,
|
|
51
|
-
bottom: true,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const global: object = {
|
|
55
|
-
// // face individual styles (over rides global)
|
|
56
|
-
css: `
|
|
57
|
-
border: 1px solid #00f;
|
|
58
|
-
background-color: red;
|
|
59
|
-
color:white;
|
|
60
|
-
opacity: 0.9;
|
|
61
|
-
backface-visibility: visible;
|
|
62
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
63
|
-
`,
|
|
64
|
-
body: "Hi I am global",
|
|
65
|
-
};
|
|
66
|
-
const animSpecs: object = {
|
|
67
|
-
anim1: "Y360",
|
|
68
|
-
anim2: "X360",
|
|
69
|
-
anim1duration: 5,
|
|
70
|
-
anim2duration: 23,
|
|
71
|
-
anim1count: "infinite",
|
|
72
|
-
anim1low: "-120",
|
|
73
|
-
anim2hi: "120",
|
|
74
|
-
anim2low: "-81",
|
|
75
|
-
anim2count: "infinite",
|
|
76
|
-
anim1direction: "normal",
|
|
77
|
-
anim2direction: "normal",
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const custom: object = {
|
|
81
|
-
// // face individual styles (over rides global)
|
|
82
|
-
bottom: {
|
|
83
|
-
css: `
|
|
84
|
-
border: 1px solid #00f;
|
|
85
|
-
background-color: red;
|
|
86
|
-
opacity: 0.9;
|
|
87
|
-
color:white;
|
|
88
|
-
fontFace:sans;
|
|
89
|
-
line-
|
|
90
|
-
backface-visibility: visible;
|
|
91
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
92
|
-
fontFamily: Cochin;
|
|
93
|
-
|
|
94
|
-
`,
|
|
95
|
-
body: "BOTTOMs UP!",
|
|
96
|
-
},
|
|
97
|
-
front: {
|
|
98
|
-
css: `
|
|
99
|
-
border: 1px solid #00f;
|
|
100
|
-
background-color: blue;
|
|
101
|
-
opacity: 0.9;
|
|
102
|
-
backface-visibility: visible;
|
|
103
|
-
color:white;
|
|
104
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
105
|
-
line-height:10;
|
|
106
|
-
text-align:center;
|
|
107
|
-
`,
|
|
108
|
-
body: "FRONT FACING!",
|
|
109
|
-
},
|
|
110
|
-
left: {
|
|
111
|
-
css: `
|
|
112
|
-
border: 1px solid #00f;
|
|
113
|
-
background-color: green;
|
|
114
|
-
opacity: 0.9;
|
|
115
|
-
backface-visibility: visible;
|
|
116
|
-
color:white;
|
|
117
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
118
|
-
line-height:10;
|
|
119
|
-
text-align:center;
|
|
120
|
-
`,
|
|
121
|
-
body: "LEFTY",
|
|
122
|
-
},
|
|
123
|
-
top: {
|
|
124
|
-
css: `
|
|
125
|
-
border: 1px solid #00f;
|
|
126
|
-
background-color: purple;
|
|
127
|
-
opacity: 0.9;
|
|
128
|
-
backface-visibility: visible;
|
|
129
|
-
color:white;
|
|
130
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
131
|
-
line-height:6;
|
|
132
|
-
text-align:center;
|
|
133
|
-
`,
|
|
134
|
-
body: "TOP DAWG",
|
|
135
|
-
},
|
|
136
|
-
right: {
|
|
137
|
-
css: `
|
|
138
|
-
border: 1px solid #00f;
|
|
139
|
-
background-color: orange;
|
|
140
|
-
opacity: 0.9;
|
|
141
|
-
backface-visibility: visible;
|
|
142
|
-
color:blue;
|
|
143
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
144
|
-
line-height:10;
|
|
145
|
-
text-align:center;
|
|
146
|
-
`,
|
|
147
|
-
body: "RIGHT SIDE",
|
|
148
|
-
},
|
|
149
|
-
back: {},
|
|
150
|
-
};
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## Authors
|
|
154
|
-
|
|
155
|
-
- [@mdnelles](https://github.com/mdnelles)
|
|
156
|
-
|
|
157
|
-
## Keywords
|
|
158
|
-
|
|
159
|
-
3d animate react css styles cuboid cube box spin
|
|
9
|
+
be sure and run `npm run build` then run `npm publish`
|
|
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Cuboid = void 0;
|
|
7
6
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const AnimWrap_1 = require("./styles/AnimWrap");
|
|
9
9
|
const Scene_1 = require("./styles/Scene");
|
|
10
10
|
const Face_1 = __importDefault(require("./Faces/Face"));
|
|
11
|
-
const react_1 = __importDefault(require("react"));
|
|
12
11
|
const CuboidWrapper = styled_components_1.default.div `
|
|
13
12
|
width: 100%;
|
|
14
13
|
height: 100%;
|
|
@@ -16,33 +15,22 @@ const CuboidWrapper = styled_components_1.default.div `
|
|
|
16
15
|
transform-style: preserve-3d;
|
|
17
16
|
`;
|
|
18
17
|
const Cuboid = (props) => {
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
const buildFace = (faceType, child) => {
|
|
22
|
-
//const { faceType, child } = props;
|
|
18
|
+
let { animSpecs = {}, width = 5, height = 5, depth = 5, faces, global, custom, tranz = (+height / 2) | 0, perspectiveOrigin, zIndex } = props;
|
|
19
|
+
const buildFace = (faceType) => {
|
|
23
20
|
return (react_1.default.createElement(Face_1.default, { width: width, height: height, depth: depth, faceType: faceType, id: faceType, tranz: tranz,
|
|
24
|
-
// if specified opac / bgc / border will over-ride
|
|
25
|
-
|
|
26
|
-
react_1.default.createElement("div", { style: {
|
|
27
|
-
color,
|
|
28
|
-
fontWeight,
|
|
29
|
-
textShadow,
|
|
30
|
-
lineHeight,
|
|
31
|
-
fontSize,
|
|
32
|
-
fontFamily,
|
|
33
|
-
textAlign
|
|
34
|
-
} }, child)));
|
|
21
|
+
// if specified opac / bgc / border will over-ride global
|
|
22
|
+
global: global, custom: custom }));
|
|
35
23
|
};
|
|
36
24
|
return (react_1.default.createElement(Scene_1.SceneStyle, { width: width, height: height, perspectiveOrigin: perspectiveOrigin, zIndex: zIndex },
|
|
37
25
|
react_1.default.createElement(AnimWrap_1.AnimWrap, { duration: animSpecs.anim1duration, iterationCount: animSpecs.anim1count, animName: animSpecs.anim1, animLow: animSpecs.anim1low, animHi: animSpecs.anim1hi, animDirection: animSpecs.anim1direction },
|
|
38
26
|
react_1.default.createElement(AnimWrap_1.AnimWrap, { duration: animSpecs.anim2duration, iterationCount: animSpecs.anim2count, animName: animSpecs.anim2, animLow: animSpecs.anim2low, animHi: animSpecs.anim2hi, animDirection: animSpecs.anim2direction },
|
|
39
27
|
react_1.default.createElement(CuboidWrapper, null,
|
|
40
|
-
!!faces && !!faces.front ? buildFace('front'
|
|
41
|
-
!!faces && !!faces.right ? buildFace('right'
|
|
42
|
-
!!faces && !!faces.back ? buildFace('back'
|
|
43
|
-
!!faces && !!faces.left ? buildFace('left'
|
|
44
|
-
!!faces && !!faces.top ? buildFace('top'
|
|
45
|
-
!!faces && !!faces.bottom ? buildFace('bottom'
|
|
28
|
+
!!faces && !!faces.front ? buildFace('front') : null,
|
|
29
|
+
!!faces && !!faces.right ? buildFace('right') : null,
|
|
30
|
+
!!faces && !!faces.back ? buildFace('back') : null,
|
|
31
|
+
!!faces && !!faces.left ? buildFace('left') : null,
|
|
32
|
+
!!faces && !!faces.top ? buildFace('top') : null,
|
|
33
|
+
!!faces && !!faces.bottom ? buildFace('bottom') : null)))));
|
|
46
34
|
};
|
|
47
|
-
exports.
|
|
35
|
+
exports.default = Cuboid;
|
|
48
36
|
//# sourceMappingURL=Cuboid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cuboid.js","sourceRoot":"","sources":["../../../src/components/Cuboid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cuboid.js","sourceRoot":"","sources":["../../../src/components/Cuboid.tsx"],"names":[],"mappings":";;;;;AAAA,0EAAuC;AACvC,kDAA0B;AAC1B,gDAA6C;AAC7C,0CAA4C;AAE5C,wDAAgC;AAEhC,MAAM,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;CAK/B,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAO,EAAE;IACvC,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE9I,MAAM,SAAS,GAAG,CAAC,QAAa,EAAO,EAAE;QACrC,OAAO,CACH,8BAAC,cAAI,IACD,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,KAAK;YACZ,yDAAyD;YACzD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAChB,CACL,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CACH,8BAAC,kBAAU,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM;QAC1F,8BAAC,mBAAQ,IACL,QAAQ,EAAE,SAAS,CAAC,aAAa,EACjC,cAAc,EAAE,SAAS,CAAC,UAAU,EACpC,QAAQ,EAAE,SAAS,CAAC,KAAK,EACzB,OAAO,EAAE,SAAS,CAAC,QAAQ,EAC3B,MAAM,EAAE,S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return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
6
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Face = (props) => {
|
|
9
|
-
let {
|
|
9
|
+
let { depth = 10, faceType, global = {}, height = 10, custom = false, tranz = 80, width = 100 } = props;
|
|
10
10
|
let transform;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
bgc = !!vars && !!vars.bgc ? vars.bgc : props.bgc;
|
|
14
|
-
opac = !!vars && !!vars.opac ? vars.opac : props.opac;
|
|
15
|
-
border = !!vars && !!vars.border ? vars.border : props.border;
|
|
16
|
-
fontFamily = !!vars && !!vars.fontFamily ? vars.fontFamily : props.fontFamily;
|
|
17
|
-
return true;
|
|
18
|
-
};
|
|
11
|
+
const styles = !!custom[faceType].css ? custom[faceType].css : global.css;
|
|
12
|
+
const body = !!custom[faceType].body ? custom[faceType].body : global.body;
|
|
19
13
|
if (faceType === 'bottom') {
|
|
20
14
|
tranz = +height - +depth / 2;
|
|
21
15
|
height = +depth;
|
|
22
16
|
transform = `transform: rotateX(-90deg) translateZ(${tranz}px);`;
|
|
23
|
-
|
|
17
|
+
//styles = !!custom["top"] ? custom : global;
|
|
18
|
+
}
|
|
19
|
+
else if (faceType === 'top') {
|
|
20
|
+
height = +depth;
|
|
21
|
+
if (!!depth)
|
|
22
|
+
tranz = +depth / 2;
|
|
23
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
24
24
|
}
|
|
25
25
|
else if (faceType === 'front') {
|
|
26
26
|
if (!!depth)
|
|
27
27
|
tranz = +depth / 2;
|
|
28
28
|
transform = `transform: rotateY(0deg) translateZ(${tranz}px);`;
|
|
29
|
-
setCustomVars(indivStyles['front'], props);
|
|
30
29
|
}
|
|
31
30
|
else if (faceType === 'back') {
|
|
32
31
|
if (!!depth)
|
|
33
32
|
tranz = +depth / 2;
|
|
34
33
|
transform = `transform: rotateY(180deg) translateZ(${tranz}px);`;
|
|
35
|
-
setCustomVars(indivStyles['back'], props);
|
|
36
|
-
}
|
|
37
|
-
else if (faceType === 'top') {
|
|
38
|
-
height = +depth;
|
|
39
|
-
if (!!depth)
|
|
40
|
-
tranz = +depth / 2;
|
|
41
|
-
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
42
|
-
setCustomVars(indivStyles['top'], props);
|
|
43
34
|
}
|
|
44
35
|
else if (faceType === 'right') {
|
|
45
36
|
if (height > width && !depth) {
|
|
@@ -55,7 +46,6 @@ const Face = (props) => {
|
|
|
55
46
|
width = +depth;
|
|
56
47
|
}
|
|
57
48
|
transform = `transform: rotateY(90deg) translateZ(${tranz}px);`;
|
|
58
|
-
setCustomVars(indivStyles['right'], props);
|
|
59
49
|
}
|
|
60
50
|
else {
|
|
61
51
|
if (height > width && !depth) {
|
|
@@ -73,24 +63,15 @@ const Face = (props) => {
|
|
|
73
63
|
width = +depth;
|
|
74
64
|
}
|
|
75
65
|
transform = `transform: rotateY(-90deg) translateZ(${tranz}px);`;
|
|
76
|
-
setCustomVars(indivStyles['left'], props);
|
|
77
66
|
}
|
|
78
67
|
const Specs = styled_components_1.default.div `
|
|
79
|
-
|
|
80
|
-
position: ${position};
|
|
81
|
-
left: ${left};
|
|
82
|
-
margin: ${margin};
|
|
83
|
-
padding: ${padding};
|
|
68
|
+
${styles}
|
|
84
69
|
width: ${width}px;
|
|
85
|
-
|
|
70
|
+
position: absolute;
|
|
86
71
|
height: ${height}px;
|
|
87
|
-
|
|
88
|
-
border: ${!!border ? border : globalStyles.border};
|
|
89
|
-
backface-visibility: ${!!bfv ? bfv : globalStyles.bfv};
|
|
90
|
-
${transform}
|
|
91
|
-
top: ${top};
|
|
72
|
+
${transform};
|
|
92
73
|
`;
|
|
93
|
-
return react_1.default.createElement(Specs, null,
|
|
74
|
+
return react_1.default.createElement(Specs, null, body);
|
|
94
75
|
};
|
|
95
76
|
exports.default = Face;
|
|
96
77
|
//# sourceMappingURL=Face.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Face.js","sourceRoot":"","sources":["../../../../src/components/Faces/Face.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Face.js","sourceRoot":"","sources":["../../../../src/components/Faces/Face.tsx"],"names":[],"mappings":";;;;;AAAA,0EAAuC;AACvC,kDAA0B;AAG1B,MAAM,IAAI,GAAG,CAAC,KAAgB,EAAO,EAAE;IACnC,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC;IAExG,IAAI,SAAS,CAAC;IACd,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC1E,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAE3E,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACvB,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;QAC7B,MAAM,GAAG,CAAC,KAAK,CAAC;QAChB,SAAS,GAAG,yCAAyC,KAAK,MAAM,CAAC;QACjE,6CAA6C;KAChD;SAAM,IAAI,QAAQ,KAAK,KAAK,EAAE;QAC3B,MAAM,GAAG,CAAC,KAAK,CAAC;QAChB,IAAI,CAAC,CAA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,IAAI,CAAC,KAAK,EAAE;YACjC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;YACpB,MAAM,GAAG,CAAC,KAAK,CAAC;SACnB;aAAM;YACH,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;YACnB,KAAK,GAAG,CAAC,KAAK,CAAC;SAClB;QACD,SAAS,GAAG,yCAAyC,KAAK,MAAM,CAAC;KACpE;IAED,MAAM,KAAK,GAAQ,2BAAM,CAAC,GAAG,CAAA;UACvB,MAAM;iBACC,KAAK;;kBAEJ,MAAM;UACd,SAAS;KACd,CAAC;IACF,OAAO,8BAAC,KAAK,QAAE,IAAI,CAAS,CAAC;AACjC,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
//export * from './Button';
|
|
18
18
|
__exportStar(require("./Cuboid"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2BAA2B;AAC3B,2CAAyB"}
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -14,7 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./hooks"), exports);
|
|
18
|
-
__exportStar(require("./library"), exports);
|
|
19
17
|
__exportStar(require("./components"), exports);
|
|
20
18
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -1,41 +1,31 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { AnimWrap } from './styles/AnimWrap';
|
|
3
4
|
import { SceneStyle } from './styles/Scene';
|
|
4
5
|
import Face from './Faces/Face';
|
|
5
|
-
import React from 'react';
|
|
6
6
|
const CuboidWrapper = styled.div `
|
|
7
7
|
width: 100%;
|
|
8
8
|
height: 100%;
|
|
9
9
|
position: relative;
|
|
10
10
|
transform-style: preserve-3d;
|
|
11
11
|
`;
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
const buildFace = (faceType, child) => {
|
|
16
|
-
//const { faceType, child } = props;
|
|
12
|
+
const Cuboid = (props) => {
|
|
13
|
+
let { animSpecs = {}, width = 5, height = 5, depth = 5, faces, global, custom, tranz = (+height / 2) | 0, perspectiveOrigin, zIndex } = props;
|
|
14
|
+
const buildFace = (faceType) => {
|
|
17
15
|
return (React.createElement(Face, { width: width, height: height, depth: depth, faceType: faceType, id: faceType, tranz: tranz,
|
|
18
|
-
// if specified opac / bgc / border will over-ride
|
|
19
|
-
|
|
20
|
-
React.createElement("div", { style: {
|
|
21
|
-
color,
|
|
22
|
-
fontWeight,
|
|
23
|
-
textShadow,
|
|
24
|
-
lineHeight,
|
|
25
|
-
fontSize,
|
|
26
|
-
fontFamily,
|
|
27
|
-
textAlign
|
|
28
|
-
} }, child)));
|
|
16
|
+
// if specified opac / bgc / border will over-ride global
|
|
17
|
+
global: global, custom: custom }));
|
|
29
18
|
};
|
|
30
19
|
return (React.createElement(SceneStyle, { width: width, height: height, perspectiveOrigin: perspectiveOrigin, zIndex: zIndex },
|
|
31
20
|
React.createElement(AnimWrap, { duration: animSpecs.anim1duration, iterationCount: animSpecs.anim1count, animName: animSpecs.anim1, animLow: animSpecs.anim1low, animHi: animSpecs.anim1hi, animDirection: animSpecs.anim1direction },
|
|
32
21
|
React.createElement(AnimWrap, { duration: animSpecs.anim2duration, iterationCount: animSpecs.anim2count, animName: animSpecs.anim2, animLow: animSpecs.anim2low, animHi: animSpecs.anim2hi, animDirection: animSpecs.anim2direction },
|
|
33
22
|
React.createElement(CuboidWrapper, null,
|
|
34
|
-
!!faces && !!faces.front ? buildFace('front'
|
|
35
|
-
!!faces && !!faces.right ? buildFace('right'
|
|
36
|
-
!!faces && !!faces.back ? buildFace('back'
|
|
37
|
-
!!faces && !!faces.left ? buildFace('left'
|
|
38
|
-
!!faces && !!faces.top ? buildFace('top'
|
|
39
|
-
!!faces && !!faces.bottom ? buildFace('bottom'
|
|
23
|
+
!!faces && !!faces.front ? buildFace('front') : null,
|
|
24
|
+
!!faces && !!faces.right ? buildFace('right') : null,
|
|
25
|
+
!!faces && !!faces.back ? buildFace('back') : null,
|
|
26
|
+
!!faces && !!faces.left ? buildFace('left') : null,
|
|
27
|
+
!!faces && !!faces.top ? buildFace('top') : null,
|
|
28
|
+
!!faces && !!faces.bottom ? buildFace('bottom') : null)))));
|
|
40
29
|
};
|
|
30
|
+
export default Cuboid;
|
|
41
31
|
//# sourceMappingURL=Cuboid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cuboid.js","sourceRoot":"","sources":["../../../src/components/Cuboid.tsx"],"names":[],"mappings":"AAAA,OAAO,M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IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAC3C,CACT,CACJ,CACF,CAChB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
const Face = (props) => {
|
|
4
|
-
let {
|
|
4
|
+
let { depth = 10, faceType, global = {}, height = 10, custom = false, tranz = 80, width = 100 } = props;
|
|
5
5
|
let transform;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
bgc = !!vars && !!vars.bgc ? vars.bgc : props.bgc;
|
|
9
|
-
opac = !!vars && !!vars.opac ? vars.opac : props.opac;
|
|
10
|
-
border = !!vars && !!vars.border ? vars.border : props.border;
|
|
11
|
-
fontFamily = !!vars && !!vars.fontFamily ? vars.fontFamily : props.fontFamily;
|
|
12
|
-
return true;
|
|
13
|
-
};
|
|
6
|
+
const styles = !!custom[faceType].css ? custom[faceType].css : global.css;
|
|
7
|
+
const body = !!custom[faceType].body ? custom[faceType].body : global.body;
|
|
14
8
|
if (faceType === 'bottom') {
|
|
15
9
|
tranz = +height - +depth / 2;
|
|
16
10
|
height = +depth;
|
|
17
11
|
transform = `transform: rotateX(-90deg) translateZ(${tranz}px);`;
|
|
18
|
-
|
|
12
|
+
//styles = !!custom["top"] ? custom : global;
|
|
13
|
+
}
|
|
14
|
+
else if (faceType === 'top') {
|
|
15
|
+
height = +depth;
|
|
16
|
+
if (!!depth)
|
|
17
|
+
tranz = +depth / 2;
|
|
18
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
19
19
|
}
|
|
20
20
|
else if (faceType === 'front') {
|
|
21
21
|
if (!!depth)
|
|
22
22
|
tranz = +depth / 2;
|
|
23
23
|
transform = `transform: rotateY(0deg) translateZ(${tranz}px);`;
|
|
24
|
-
setCustomVars(indivStyles['front'], props);
|
|
25
24
|
}
|
|
26
25
|
else if (faceType === 'back') {
|
|
27
26
|
if (!!depth)
|
|
28
27
|
tranz = +depth / 2;
|
|
29
28
|
transform = `transform: rotateY(180deg) translateZ(${tranz}px);`;
|
|
30
|
-
setCustomVars(indivStyles['back'], props);
|
|
31
|
-
}
|
|
32
|
-
else if (faceType === 'top') {
|
|
33
|
-
height = +depth;
|
|
34
|
-
if (!!depth)
|
|
35
|
-
tranz = +depth / 2;
|
|
36
|
-
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
37
|
-
setCustomVars(indivStyles['top'], props);
|
|
38
29
|
}
|
|
39
30
|
else if (faceType === 'right') {
|
|
40
31
|
if (height > width && !depth) {
|
|
@@ -50,7 +41,6 @@ const Face = (props) => {
|
|
|
50
41
|
width = +depth;
|
|
51
42
|
}
|
|
52
43
|
transform = `transform: rotateY(90deg) translateZ(${tranz}px);`;
|
|
53
|
-
setCustomVars(indivStyles['right'], props);
|
|
54
44
|
}
|
|
55
45
|
else {
|
|
56
46
|
if (height > width && !depth) {
|
|
@@ -68,24 +58,15 @@ const Face = (props) => {
|
|
|
68
58
|
width = +depth;
|
|
69
59
|
}
|
|
70
60
|
transform = `transform: rotateY(-90deg) translateZ(${tranz}px);`;
|
|
71
|
-
setCustomVars(indivStyles['left'], props);
|
|
72
61
|
}
|
|
73
62
|
const Specs = styled.div `
|
|
74
|
-
|
|
75
|
-
position: ${position};
|
|
76
|
-
left: ${left};
|
|
77
|
-
margin: ${margin};
|
|
78
|
-
padding: ${padding};
|
|
63
|
+
${styles}
|
|
79
64
|
width: ${width}px;
|
|
80
|
-
|
|
65
|
+
position: absolute;
|
|
81
66
|
height: ${height}px;
|
|
82
|
-
|
|
83
|
-
border: ${!!border ? border : globalStyles.border};
|
|
84
|
-
backface-visibility: ${!!bfv ? bfv : globalStyles.bfv};
|
|
85
|
-
${transform}
|
|
86
|
-
top: ${top};
|
|
67
|
+
${transform};
|
|
87
68
|
`;
|
|
88
|
-
return React.createElement(Specs, null,
|
|
69
|
+
return React.createElement(Specs, null, body);
|
|
89
70
|
};
|
|
90
71
|
export default Face;
|
|
91
72
|
//# sourceMappingURL=Face.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Face.js","sourceRoot":"","sources":["../../../../src/components/Faces/Face.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Face.js","sourceRoot":"","sources":["../../../../src/components/Faces/Face.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,IAAI,GAAG,CAAC,KAAgB,EAAO,EAAE;IACnC,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC;IAExG,IAAI,SAAS,CAAC;IACd,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC1E,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAE3E,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACvB,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;QAC7B,MAAM,GAAG,CAAC,KAAK,CAAC;QAChB,SAAS,GAAG,yCAAyC,KAAK,MAAM,CAAC;QACjE,6CAA6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AC,GAAG,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,GAAG,CAAC,MAAM,CAAC;SACnB;aAAM,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE;YACjC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;YACpB,MAAM,GAAG,CAAC,KAAK,CAAC;SACnB;aAAM;YACH,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;YACnB,KAAK,GAAG,CAAC,KAAK,CAAC;SAClB;QACD,SAAS,GAAG,yCAAyC,KAAK,MAAM,CAAC;KACpE;IAED,MAAM,KAAK,GAAQ,MAAM,CAAC,GAAG,CAAA;UACvB,MAAM;iBACC,KAAK;;kBAEJ,MAAM;UACd,SAAS;KACd,CAAC;IACF,OAAO,oBAAC,KAAK,QAAE,IAAI,CAAS,CAAC;AACjC,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,cAAc,UAAU,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "https://github.com/mdnelles/anim-3d-objs-launcher"
|
|
6
6
|
},
|
|
7
7
|
"homepage": "https://github.com/mdnelles/anim-3d-objs",
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.13",
|
|
9
9
|
"description": "A component library for getting people started with easy to re-use components for everyday projects.",
|
|
10
10
|
"main": "dist/cjs/index.js",
|
|
11
11
|
"module": "dist/esm/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useLogging';
|
package/dist/cjs/hooks/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useLogging"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Logging, { ILoggingOptions } from '../library/Logging';
|
|
2
|
-
/**
|
|
3
|
-
* A hook for a simple logging library.
|
|
4
|
-
* @param options Options to pass our logger.
|
|
5
|
-
* @returns object of type Logging
|
|
6
|
-
*/
|
|
7
|
-
export declare const useLogging: (options?: ILoggingOptions) => [Logging];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useLogging = void 0;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const Logging_1 = __importDefault(require("../library/Logging"));
|
|
9
|
-
/**
|
|
10
|
-
* A hook for a simple logging library.
|
|
11
|
-
* @param options Options to pass our logger.
|
|
12
|
-
* @returns object of type Logging
|
|
13
|
-
*/
|
|
14
|
-
const useLogging = (options) => {
|
|
15
|
-
const { current: logging } = (0, react_1.useRef)(new Logging_1.default(options));
|
|
16
|
-
return [logging];
|
|
17
|
-
};
|
|
18
|
-
exports.useLogging = useLogging;
|
|
19
|
-
//# sourceMappingURL=useLogging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLogging.js","sourceRoot":"","sources":["../../../src/hooks/useLogging.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA+B;AAC/B,iEAA8D;AAE9D;;;;GAIG;AACI,MAAM,UAAU,GAAG,CAAC,OAAyB,EAAa,EAAE;IAC/D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAA,cAAM,EAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAE1D,OAAO,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC,CAAC;AAJW,QAAA,UAAU,cAIrB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG = "DEBUG";
|
|
2
|
-
export declare const INFO = "INFO";
|
|
3
|
-
export declare const WARN = "WARN";
|
|
4
|
-
export declare const ERROR = "ERROR";
|
|
5
|
-
export interface ILoggingOptions {
|
|
6
|
-
namespace?: string;
|
|
7
|
-
debug?: boolean;
|
|
8
|
-
applyStyles?: boolean;
|
|
9
|
-
styles?: {
|
|
10
|
-
[key: string]: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare class Logging {
|
|
14
|
-
private namespace;
|
|
15
|
-
private applyStyles;
|
|
16
|
-
private environment;
|
|
17
|
-
private styles;
|
|
18
|
-
constructor(options?: ILoggingOptions);
|
|
19
|
-
log: (key: string, obj: any, ...objs: any[]) => void;
|
|
20
|
-
debug: (obj: any, ...objs: any[]) => void;
|
|
21
|
-
info: (obj: any, ...objs: any[]) => void;
|
|
22
|
-
warn: (obj: any, ...objs: any[]) => void;
|
|
23
|
-
error: (obj: any, ...objs: any[]) => void;
|
|
24
|
-
}
|
|
25
|
-
export default Logging;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Logging = exports.ERROR = exports.WARN = exports.INFO = exports.DEBUG = void 0;
|
|
4
|
-
exports.DEBUG = 'DEBUG';
|
|
5
|
-
exports.INFO = 'INFO';
|
|
6
|
-
exports.WARN = 'WARN';
|
|
7
|
-
exports.ERROR = 'ERROR';
|
|
8
|
-
class Logging {
|
|
9
|
-
constructor(options) {
|
|
10
|
-
this.styles = {
|
|
11
|
-
DEBUG: 'display: inline-block; background-color: Blue; color: white; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;',
|
|
12
|
-
INFO: 'display: inline-block; background-color: Green; color: black; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;',
|
|
13
|
-
WARN: 'display: inline-block; background-color: gold; color: black; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;',
|
|
14
|
-
ERROR: 'display: inline-block; background-color: Red; color: black; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;'
|
|
15
|
-
};
|
|
16
|
-
this.log = (key, obj, ...objs) => {
|
|
17
|
-
if (this.environment === 'production')
|
|
18
|
-
return;
|
|
19
|
-
if (this.applyStyles) {
|
|
20
|
-
console.log(`[${new Date().toISOString()}] [${this.namespace}] %c[${key}] ${obj}`, this.styles[key], ...objs);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
console.log(`[${new Date().toISOString()}] [${this.namespace}] [${key}] ${obj}`, ...objs);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
this.debug = (obj, ...objs) => this.log(exports.DEBUG, obj, ...objs);
|
|
27
|
-
this.info = (obj, ...objs) => this.log(exports.INFO, obj, ...objs);
|
|
28
|
-
this.warn = (obj, ...objs) => this.log(exports.WARN, obj, ...objs);
|
|
29
|
-
this.error = (obj, ...objs) => this.log(exports.ERROR, obj, ...objs);
|
|
30
|
-
this.namespace = (options === null || options === void 0 ? void 0 : options.namespace) || 'Default';
|
|
31
|
-
this.applyStyles = (options === null || options === void 0 ? void 0 : options.applyStyles) || false;
|
|
32
|
-
this.environment = process.env.NODE_ENV || 'development';
|
|
33
|
-
if ((options === null || options === void 0 ? void 0 : options.styles) && this.applyStyles) {
|
|
34
|
-
for (let key in options.styles) {
|
|
35
|
-
if (this.styles[key])
|
|
36
|
-
this.styles[key] = options.styles[key];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.Logging = Logging;
|
|
42
|
-
exports.default = Logging;
|
|
43
|
-
//# sourceMappingURL=Logging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/library/Logging.ts"],"names":[],"mappings":";;;AAAa,QAAA,KAAK,GAAG,OAAO,CAAC;AAChB,QAAA,IAAI,GAAG,MAAM,CAAC;AACd,QAAA,IAAI,GAAG,MAAM,CAAC;AACd,QAAA,KAAK,GAAG,OAAO,CAAC;AAS7B,MAAa,OAAO;IAYhB,YAAY,OAAyB;QAP7B,WAAM,GAA8B;YACxC,KAAK,EAAE,+HAA+H;YAC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S,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,KAAI,SAAS,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,KAAK,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;QAEzD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,KAAI,IAAI,CAAC,WAAW,EAAE;YACrC,KAAK,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE;gBAC5B,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;oBAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAChE;SACJ;IACL,CAAC;CAgBJ;AAtCD,0BAsCC;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Logging';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Logging"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/library/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useLogging';
|
package/dist/esm/hooks/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Logging, { ILoggingOptions } from '../library/Logging';
|
|
2
|
-
/**
|
|
3
|
-
* A hook for a simple logging library.
|
|
4
|
-
* @param options Options to pass our logger.
|
|
5
|
-
* @returns object of type Logging
|
|
6
|
-
*/
|
|
7
|
-
export declare const useLogging: (options?: ILoggingOptions) => [Logging];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import Logging from '../library/Logging';
|
|
3
|
-
/**
|
|
4
|
-
* A hook for a simple logging library.
|
|
5
|
-
* @param options Options to pass our logger.
|
|
6
|
-
* @returns object of type Logging
|
|
7
|
-
*/
|
|
8
|
-
export const useLogging = (options) => {
|
|
9
|
-
const { current: logging } = useRef(new Logging(options));
|
|
10
|
-
return [logging];
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=useLogging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLogging.js","sourceRoot":"","sources":["../../../src/hooks/useLogging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,OAA4B,MAAM,oBAAoB,CAAC;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAyB,EAAa,EAAE;IAC/D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAE1D,OAAO,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG = "DEBUG";
|
|
2
|
-
export declare const INFO = "INFO";
|
|
3
|
-
export declare const WARN = "WARN";
|
|
4
|
-
export declare const ERROR = "ERROR";
|
|
5
|
-
export interface ILoggingOptions {
|
|
6
|
-
namespace?: string;
|
|
7
|
-
debug?: boolean;
|
|
8
|
-
applyStyles?: boolean;
|
|
9
|
-
styles?: {
|
|
10
|
-
[key: string]: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare class Logging {
|
|
14
|
-
private namespace;
|
|
15
|
-
private applyStyles;
|
|
16
|
-
private environment;
|
|
17
|
-
private styles;
|
|
18
|
-
constructor(options?: ILoggingOptions);
|
|
19
|
-
log: (key: string, obj: any, ...objs: any[]) => void;
|
|
20
|
-
debug: (obj: any, ...objs: any[]) => void;
|
|
21
|
-
info: (obj: any, ...objs: any[]) => void;
|
|
22
|
-
warn: (obj: any, ...objs: any[]) => void;
|
|
23
|
-
error: (obj: any, ...objs: any[]) => void;
|
|
24
|
-
}
|
|
25
|
-
export default Logging;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export const DEBUG = 'DEBUG';
|
|
2
|
-
export const INFO = 'INFO';
|
|
3
|
-
export const WARN = 'WARN';
|
|
4
|
-
export const ERROR = 'ERROR';
|
|
5
|
-
export class Logging {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
this.styles = {
|
|
8
|
-
DEBUG: 'display: inline-block; background-color: Blue; color: white; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;',
|
|
9
|
-
INFO: 'display: inline-block; background-color: Green; color: black; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;',
|
|
10
|
-
WARN: 'display: inline-block; background-color: gold; color: black; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;',
|
|
11
|
-
ERROR: 'display: inline-block; background-color: Red; color: black; font-weight: bold; padding: 3px 7px 3px 7px; border-radius: 3px;'
|
|
12
|
-
};
|
|
13
|
-
this.log = (key, obj, ...objs) => {
|
|
14
|
-
if (this.environment === 'production')
|
|
15
|
-
return;
|
|
16
|
-
if (this.applyStyles) {
|
|
17
|
-
console.log(`[${new Date().toISOString()}] [${this.namespace}] %c[${key}] ${obj}`, this.styles[key], ...objs);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
console.log(`[${new Date().toISOString()}] [${this.namespace}] [${key}] ${obj}`, ...objs);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
this.debug = (obj, ...objs) => this.log(DEBUG, obj, ...objs);
|
|
24
|
-
this.info = (obj, ...objs) => this.log(INFO, obj, ...objs);
|
|
25
|
-
this.warn = (obj, ...objs) => this.log(WARN, obj, ...objs);
|
|
26
|
-
this.error = (obj, ...objs) => this.log(ERROR, obj, ...objs);
|
|
27
|
-
this.namespace = (options === null || options === void 0 ? void 0 : options.namespace) || 'Default';
|
|
28
|
-
this.applyStyles = (options === null || options === void 0 ? void 0 : options.applyStyles) || false;
|
|
29
|
-
this.environment = process.env.NODE_ENV || 'development';
|
|
30
|
-
if ((options === null || options === void 0 ? void 0 : options.styles) && this.applyStyles) {
|
|
31
|
-
for (let key in options.styles) {
|
|
32
|
-
if (this.styles[key])
|
|
33
|
-
this.styles[key] = options.styles[key];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export default Logging;
|
|
39
|
-
//# sourceMappingURL=Logging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../src/library/Logging.ts"],"names":[],"mappings":"AAAA,MAA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