@rankingcoach/vanguard 1.12.1 → 1.12.2-testare.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.
@@ -4,7 +4,7 @@ import { useState as z } from "react";
4
4
  import e from "./index-BenchmarkGauge.module.scss.js";
5
5
  import { BenchmarkGaugeMarker as F } from "./index-BenchmarkGaugeMarker.js";
6
6
  import { useBenchmarkGaugeRenderState as U } from "./index-use-benchmark-gauge-render-state.js";
7
- import { resolveMarkerColor as W } from "./index-utils2.js";
7
+ import { resolveMarkerColor as W } from "./index-utils3.js";
8
8
  import { Render as c } from "./index-Render.js";
9
9
  import { Text as x, TextTypes as y } from "./index-Text.js";
10
10
  const _ = (m) => {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
2
  import { classNames as m } from "./index-classNames.js";
3
3
  import "react";
4
- import { valueToPercent as y, markerPosition as d } from "./index-utils2.js";
4
+ import { valueToPercent as y, markerPosition as d } from "./index-utils3.js";
5
5
  import t from "./index-BenchmarkGaugeMarker.module.scss.js";
6
6
  import { BenchmarkGaugePin as A } from "./index-BenchmarkGaugePin.js";
7
7
  import { Render as M } from "./index-Render.js";
@@ -5,7 +5,7 @@ import { STATUS as t } from "./index-config.js";
5
5
  import J from "./index-cache.js";
6
6
  import { randomString as K, request as Q, canUseDOM as L, isSupportedEnvironment as W, omit as X } from "./index-helpers.js";
7
7
  import { usePrevious as V } from "./index-hooks.js";
8
- import { getNode as Z } from "./index-utils3.js";
8
+ import { getNode as Z } from "./index-utils2.js";
9
9
  let u;
10
10
  function _(s) {
11
11
  const {
@@ -1,5 +1,5 @@
1
1
  import { useMemo as n } from "react";
2
- import { valueToPercent as F, resolveLabels as H, fillClipInset as p } from "./index-utils2.js";
2
+ import { valueToPercent as F, resolveLabels as H, fillClipInset as p } from "./index-utils3.js";
3
3
  const j = (h) => {
4
4
  const {
5
5
  min: d,
@@ -1,50 +1,70 @@
1
- const d = (e, t, n) => n <= t ? 0 : Math.max(0, Math.min(100, (e - t) / (n - t) * 100)), l = (e) => `calc(var(--benchmark-gauge-marker-inset, 20px) + ${e / 100} * (100% - 2 * var(--benchmark-gauge-marker-inset, 20px)))`, g = (e) => e >= 100 ? "0px" : `calc(${1 - e / 100} * (100% - 2 * var(--benchmark-gauge-marker-inset, 20px)))`, m = (e) => new Intl.NumberFormat("en", {
2
- notation: "compact",
3
- maximumSignificantDigits: 3
4
- }).format(e), o = ["var(--e500)", "var(--a2900)", "var(--s400)"], h = ({
5
- markerColor: e,
6
- rankIndex: t,
7
- rankCount: n,
8
- colorByRank: c,
9
- rankColors: r
10
- }) => {
11
- const u = "var(--n400)";
12
- if (e) return e;
13
- if (c) {
14
- const a = r != null && r.length ? r : o;
15
- if (!a.length)
16
- return u;
17
- const i = Math.round(t / Math.max(n - 1, 1) * (a.length - 1));
18
- return a[Math.max(0, Math.min(i, a.length - 1))] ?? u;
1
+ import v from "./index-esm4.js";
2
+ function w(i) {
3
+ const {
4
+ baseURL: c,
5
+ content: a,
6
+ description: s,
7
+ handleError: f,
8
+ hash: d,
9
+ preProcessor: h,
10
+ title: u,
11
+ uniquifyIDs: n = !1
12
+ } = i;
13
+ try {
14
+ const o = b(a, h), l = v(o, {
15
+ nodeOnly: !0
16
+ });
17
+ if (!l || !(l instanceof SVGSVGElement))
18
+ throw new Error("Could not convert the src to a DOM Node");
19
+ const r = p(l, {
20
+ baseURL: c,
21
+ hash: d,
22
+ uniquifyIDs: n
23
+ });
24
+ if (s) {
25
+ const e = r.querySelector("desc");
26
+ e != null && e.parentNode && e.parentNode.removeChild(e);
27
+ const t = document.createElementNS("http://www.w3.org/2000/svg", "desc");
28
+ t.innerHTML = s, r.prepend(t);
29
+ }
30
+ if (typeof u < "u") {
31
+ const e = r.querySelector("title");
32
+ if (e != null && e.parentNode && e.parentNode.removeChild(e), u) {
33
+ const t = document.createElementNS("http://www.w3.org/2000/svg", "title");
34
+ t.innerHTML = u, r.prepend(t);
35
+ }
36
+ }
37
+ return r;
38
+ } catch (o) {
39
+ return f(o);
19
40
  }
20
- return u;
21
- }, v = ({
22
- showLabels: e,
23
- startLabel: t,
24
- endLabel: n,
25
- min: c,
26
- max: r,
27
- compactLabels: u = !1
28
- }) => {
29
- if (e === !1)
30
- return {
31
- startLabel: void 0,
32
- endLabel: void 0
33
- };
34
- const a = u ? m : String, i = (s, f) => {
35
- if (s !== null)
36
- return s !== void 0 ? s : e ? a(f) : void 0;
37
- };
38
- return {
39
- startLabel: i(t, c),
40
- endLabel: i(n, r)
41
- };
42
- };
41
+ }
42
+ function b(i, c) {
43
+ return c ? c(i) : i;
44
+ }
45
+ function p(i, c) {
46
+ const {
47
+ baseURL: a = "",
48
+ hash: s,
49
+ uniquifyIDs: f
50
+ } = c, d = ["id", "href", "xlink:href", "xlink:role", "xlink:arcrole"], h = ["href", "xlink:href"], u = (n, o) => h.includes(n) && (o ? !o.includes("#") : !1);
51
+ return f && [...i.children].forEach((n) => {
52
+ var o;
53
+ if ((o = n.attributes) != null && o.length) {
54
+ const l = Object.values(n.attributes).map((r) => {
55
+ const e = r, t = /url\((.*?)\)/.exec(r.value);
56
+ return t != null && t[1] && (e.value = r.value.replace(t[0], `url(${a}${t[1]}__${s})`)), e;
57
+ });
58
+ d.forEach((r) => {
59
+ const e = l.find((t) => t.name === r);
60
+ e && !u(r, e.value) && (e.value = `${e.value}__${s}`);
61
+ });
62
+ }
63
+ return n.children.length ? p(n, c) : n;
64
+ }), i;
65
+ }
43
66
  export {
44
- o as DEFAULT_RANK_COLORS,
45
- g as fillClipInset,
46
- l as markerPosition,
47
- v as resolveLabels,
48
- h as resolveMarkerColor,
49
- d as valueToPercent
67
+ w as getNode,
68
+ b as processSVG,
69
+ p as updateSVGAttributes
50
70
  };
@@ -1,70 +1,50 @@
1
- import v from "./index-esm4.js";
2
- function w(i) {
3
- const {
4
- baseURL: c,
5
- content: a,
6
- description: s,
7
- handleError: f,
8
- hash: d,
9
- preProcessor: h,
10
- title: u,
11
- uniquifyIDs: n = !1
12
- } = i;
13
- try {
14
- const o = b(a, h), l = v(o, {
15
- nodeOnly: !0
16
- });
17
- if (!l || !(l instanceof SVGSVGElement))
18
- throw new Error("Could not convert the src to a DOM Node");
19
- const r = p(l, {
20
- baseURL: c,
21
- hash: d,
22
- uniquifyIDs: n
23
- });
24
- if (s) {
25
- const e = r.querySelector("desc");
26
- e != null && e.parentNode && e.parentNode.removeChild(e);
27
- const t = document.createElementNS("http://www.w3.org/2000/svg", "desc");
28
- t.innerHTML = s, r.prepend(t);
29
- }
30
- if (typeof u < "u") {
31
- const e = r.querySelector("title");
32
- if (e != null && e.parentNode && e.parentNode.removeChild(e), u) {
33
- const t = document.createElementNS("http://www.w3.org/2000/svg", "title");
34
- t.innerHTML = u, r.prepend(t);
35
- }
36
- }
37
- return r;
38
- } catch (o) {
39
- return f(o);
1
+ const d = (e, t, n) => n <= t ? 0 : Math.max(0, Math.min(100, (e - t) / (n - t) * 100)), l = (e) => `calc(var(--benchmark-gauge-marker-inset, 20px) + ${e / 100} * (100% - 2 * var(--benchmark-gauge-marker-inset, 20px)))`, g = (e) => e >= 100 ? "0px" : `calc(${1 - e / 100} * (100% - 2 * var(--benchmark-gauge-marker-inset, 20px)))`, m = (e) => new Intl.NumberFormat("en", {
2
+ notation: "compact",
3
+ maximumSignificantDigits: 3
4
+ }).format(e), o = ["var(--e500)", "var(--a2900)", "var(--s400)"], h = ({
5
+ markerColor: e,
6
+ rankIndex: t,
7
+ rankCount: n,
8
+ colorByRank: c,
9
+ rankColors: r
10
+ }) => {
11
+ const u = "var(--n400)";
12
+ if (e) return e;
13
+ if (c) {
14
+ const a = r != null && r.length ? r : o;
15
+ if (!a.length)
16
+ return u;
17
+ const i = Math.round(t / Math.max(n - 1, 1) * (a.length - 1));
18
+ return a[Math.max(0, Math.min(i, a.length - 1))] ?? u;
40
19
  }
41
- }
42
- function b(i, c) {
43
- return c ? c(i) : i;
44
- }
45
- function p(i, c) {
46
- const {
47
- baseURL: a = "",
48
- hash: s,
49
- uniquifyIDs: f
50
- } = c, d = ["id", "href", "xlink:href", "xlink:role", "xlink:arcrole"], h = ["href", "xlink:href"], u = (n, o) => h.includes(n) && (o ? !o.includes("#") : !1);
51
- return f && [...i.children].forEach((n) => {
52
- var o;
53
- if ((o = n.attributes) != null && o.length) {
54
- const l = Object.values(n.attributes).map((r) => {
55
- const e = r, t = /url\((.*?)\)/.exec(r.value);
56
- return t != null && t[1] && (e.value = r.value.replace(t[0], `url(${a}${t[1]}__${s})`)), e;
57
- });
58
- d.forEach((r) => {
59
- const e = l.find((t) => t.name === r);
60
- e && !u(r, e.value) && (e.value = `${e.value}__${s}`);
61
- });
62
- }
63
- return n.children.length ? p(n, c) : n;
64
- }), i;
65
- }
20
+ return u;
21
+ }, v = ({
22
+ showLabels: e,
23
+ startLabel: t,
24
+ endLabel: n,
25
+ min: c,
26
+ max: r,
27
+ compactLabels: u = !1
28
+ }) => {
29
+ if (e === !1)
30
+ return {
31
+ startLabel: void 0,
32
+ endLabel: void 0
33
+ };
34
+ const a = u ? m : String, i = (s, f) => {
35
+ if (s !== null)
36
+ return s !== void 0 ? s : e ? a(f) : void 0;
37
+ };
38
+ return {
39
+ startLabel: i(t, c),
40
+ endLabel: i(n, r)
41
+ };
42
+ };
66
43
  export {
67
- w as getNode,
68
- b as processSVG,
69
- p as updateSVGAttributes
44
+ o as DEFAULT_RANK_COLORS,
45
+ g as fillClipInset,
46
+ l as markerPosition,
47
+ v as resolveLabels,
48
+ h as resolveMarkerColor,
49
+ d as valueToPercent
70
50
  };
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2026-06-03T08:53:40.164Z",
2
+ "timestamp": "2026-06-03T19:57:19.398Z",
3
3
  "mode": "full",
4
4
  "buildOptimization": {
5
5
  "enabled": false,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "rankingCoach",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
- "version": "1.12.1",
7
+ "version": "1.12.2-testare.0",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
10
10
  "types": "dist/types/index.d.ts",
@@ -239,13 +239,13 @@
239
239
  "husky": "husky install",
240
240
  "lint": "eslint src",
241
241
  "preview": "vite preview",
242
- "release": "standard-version",
243
- "release-dry-run": "standard-version --dry-run",
242
+ "release": "if [ \"$(git branch --show-current)\" = \"master\" ]; then standard-version; else standard-version --prerelease \"$(git branch --show-current)\"; fi",
243
+ "release-dry-run": "if [ \"$(git branch --show-current)\" = \"master\" ]; then standard-version --dry-run; else standard-version --prerelease \"$(git branch --show-current)\" --dry-run; fi",
244
244
  "release-beta": "standard-version --prerelease beta",
245
245
  "release-beta-dry-run": "standard-version --prerelease beta --dry-run",
246
246
  "publish-tags": "git push --follow-tags origin master",
247
247
  "publish-beta": "pnpm publish --tag beta",
248
- "deploy-master": "git push --follow-tags origin master && pnpm publish",
248
+ "deploy": "if [ \"$(git branch --show-current)\" = \"master\" ]; then git push --follow-tags origin master && pnpm publish; else git push --follow-tags origin HEAD && pnpm publish --tag \"$(git branch --show-current)\"; fi",
249
249
  "storybook": "storybook dev -p 6006",
250
250
  "build-storybook": "storybook build",
251
251
  "serve-storybook": "pnpm run build-storybook && cd storybook-static && python3 -m http.server 8080",