@rpg-engine/long-bow 0.8.11 → 0.8.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/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +1488 -103
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +1489 -105
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/utils/colorUtils.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/shared/SpriteFromAtlas.tsx +4 -1
- package/src/index.tsx +1 -0
- package/src/utils/colorUtils.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toUppercaseHexColor: (color: string | undefined) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { toUppercaseHexColor } from '../../utils/colorUtils';
|
|
4
5
|
|
|
5
6
|
interface IProps {
|
|
6
7
|
atlasJSON: any;
|
|
@@ -51,6 +52,8 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
|
51
52
|
return null;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
const normalizedTintColor = toUppercaseHexColor(tintColor);
|
|
56
|
+
|
|
54
57
|
return (
|
|
55
58
|
<Container
|
|
56
59
|
width={width}
|
|
@@ -69,7 +72,7 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
|
69
72
|
style={imgStyle}
|
|
70
73
|
centered={centered}
|
|
71
74
|
borderRadius={borderRadius}
|
|
72
|
-
tintColor={
|
|
75
|
+
tintColor={normalizedTintColor}
|
|
73
76
|
/>
|
|
74
77
|
</Container>
|
|
75
78
|
);
|
package/src/index.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export * from './components/Friends/FriendList';
|
|
|
18
18
|
export * from './components/HistoryDialog';
|
|
19
19
|
export * from './components/ImageCarousel/ImageCarousel';
|
|
20
20
|
export * from './components/ImageCarousel/SimpleImageCarousel';
|
|
21
|
+
export * from './components/InformationCenter/InformationCenter';
|
|
21
22
|
export * from './components/Input';
|
|
22
23
|
export * from './components/InternalTabs/InternalTabs';
|
|
23
24
|
export { ErrorBoundary } from './components/Item/Inventory/ErrorBoundary';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const toUppercaseHexColor = (
|
|
2
|
+
color: string | undefined
|
|
3
|
+
): string | undefined => {
|
|
4
|
+
if (!color) return undefined;
|
|
5
|
+
|
|
6
|
+
// Check if it's a valid hex color
|
|
7
|
+
const hexRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
8
|
+
if (!hexRegex.test(color)) return color;
|
|
9
|
+
|
|
10
|
+
return color.toUpperCase();
|
|
11
|
+
};
|