@focusbc/bbs-lib 0.0.9 → 0.0.11

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.
@@ -11,6 +11,14 @@ export type ShapeStyle = {
11
11
  textSize?: 'small' | 'medium' | 'large' | number;
12
12
  borderColorHex?: string;
13
13
  borderWidth?: number;
14
- textPosition?: 'center' | 'left' | 'right';
14
+ /**
15
+ Text position:
16
+ 'center' - text is centered on the shape
17
+ 'left' - text is aligned to the left of the shape
18
+ 'right' - text is aligned to the right of the shape
19
+ number - offset in meters from the center of the shape to the text (positive values move the text to the right, negative values move it to the left)
20
+ If not provided, text is centered on the shape
21
+ */
22
+ textPosition?: 'center' | 'left' | 'right' | number;
15
23
  };
16
24
  //# sourceMappingURL=shape-style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shape-style.d.ts","sourceRoot":"","sources":["../../src/types/shape-style.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAA;AAEpE,MAAM,MAAM,UAAU,GAAG;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IAChD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;CAC7C,CAAA"}
1
+ {"version":3,"file":"shape-style.d.ts","sourceRoot":"","sources":["../../src/types/shape-style.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAA;AAEpE,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IAChD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;SAOK;IACL,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;CACpD,CAAA"}
@@ -0,0 +1,10 @@
1
+ export declare class ColorUtils {
2
+ /**
3
+ * Converts a hex color string to an rgba color.
4
+ * @param hex - The hex color string to convert to rgba.
5
+ * @param opacity - The opacity of the color.
6
+ * @returns
7
+ */
8
+ static hexToRgba(hex: string | undefined, opacity?: number): [number, number, number, number];
9
+ }
10
+ //# sourceMappingURL=color.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.utils.d.ts","sourceRoot":"","sources":["../../src/utils/color.utils.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU;IACrB;;;;;OAKG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;CAgBrG"}
@@ -0,0 +1,23 @@
1
+ export class ColorUtils {
2
+ /**
3
+ * Converts a hex color string to an rgba color.
4
+ * @param hex - The hex color string to convert to rgba.
5
+ * @param opacity - The opacity of the color.
6
+ * @returns
7
+ */
8
+ static hexToRgba(hex, opacity) {
9
+ if (!hex) {
10
+ return [0, 0, 0, 0];
11
+ }
12
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{0,2})$/i.exec(hex);
13
+ if (!result?.length || result.length < 3) {
14
+ return [0, 0, 0, 0];
15
+ }
16
+ let alpha = result[4] ? parseInt(result[4], 16) : 255;
17
+ if (opacity !== null && opacity !== undefined) {
18
+ alpha = Math.round((opacity / 100) * 255);
19
+ }
20
+ return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16), alpha];
21
+ }
22
+ }
23
+ //# sourceMappingURL=color.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.utils.js","sourceRoot":"","sources":["../../src/utils/color.utils.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAU;IACrB;;;;;OAKG;IACI,MAAM,CAAC,SAAS,CAAC,GAAuB,EAAE,OAAgB;QAC/D,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,MAAM,GAAG,yDAAyD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEhF,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QACrB,CAAC;QAED,IAAI,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;QACrD,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9C,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;IAC3F,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@focusbc/bbs-lib",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "BBS map rendering library (deck.gl + @focusbc/map-rendering)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",