@blueprint-chart/lib 2.17.0 → 2.18.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/dist/embed.js +1 -1
- package/dist/index.js +229 -229
- package/dist/lib/lib.iife.js +307 -29
- package/dist/{render-bpc-CPj5h-p4.js → render-bpc-jhkrsEsh.js} +3002 -3903
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/player-css.d.ts +1 -0
- package/dist/runtime/player.d.ts +15 -0
- package/dist/runtime-BTUG9Tha.js +1072 -0
- package/dist/runtime.js +120 -4
- package/package.json +3 -1
- package/src/runtime/player.css +278 -0
- package/dist/runtime-CT02Shsd.js +0 -118
package/dist/runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./render-bpc-
|
|
2
|
-
import { n as t } from "./runtime-
|
|
1
|
+
import { t as e } from "./render-bpc-jhkrsEsh.js";
|
|
2
|
+
import { n as t } from "./runtime-BTUG9Tha.js";
|
|
3
3
|
//#region src/runtime/scenes.ts
|
|
4
4
|
function n(e, t, n) {
|
|
5
5
|
let r = 0, i = !1, a = document.createElement("nav");
|
|
@@ -41,9 +41,125 @@ function n(e, t, n) {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
var r = n;
|
|
44
|
+
var r = n, i = 3e3, a = ".bc-scene-player__dots__dot, .bc-scene-player__segments__segment", o = "<svg width=\"8\" height=\"12\" viewBox=\"0 0 8 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5.5 1.5L1.5 6l4 4.5\" /></svg>", s = "<svg width=\"8\" height=\"12\" viewBox=\"0 0 8 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.5 1.5L6.5 6l-4 4.5\" /></svg>", c = "<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6.5 2L3.5 5l3 3\" /></svg>", l = "<svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3.5 2L6.5 5l-3 3\" /></svg>";
|
|
45
|
+
function u(e, t) {
|
|
46
|
+
return `<svg width="${e}" height="${e}" viewBox="0 0 12 12" fill="currentColor">${t ? "<rect x=\"1.5\" y=\"1\" width=\"3\" height=\"10\" rx=\"0.8\" /><rect x=\"7.5\" y=\"1\" width=\"3\" height=\"10\" rx=\"0.8\" />" : "<path d=\"M2.5 1v10l8-5z\" />"}</svg>`;
|
|
47
|
+
}
|
|
48
|
+
function d(e) {
|
|
49
|
+
return e ? " disabled" : "";
|
|
50
|
+
}
|
|
51
|
+
function f(e, t) {
|
|
52
|
+
return `<button type="button" class="bc-scene-player__play-btn" aria-label="${t ? "Pause" : "Play"}">${u(e, t)}</button>`;
|
|
53
|
+
}
|
|
54
|
+
function p(e, t, n, r) {
|
|
55
|
+
return `<button type="button" class="bc-scene-player__nav-btn"${d(r)} aria-label="${t}" data-action="${e}">${n}</button>`;
|
|
56
|
+
}
|
|
57
|
+
function m(e, { current: t, total: n }) {
|
|
58
|
+
let r = [];
|
|
59
|
+
for (let i = 1; i <= n; i++) {
|
|
60
|
+
let a = i === t ? ` ${e}--active` : "", o = i < t ? ` ${e}--completed` : "", s = i === t ? " aria-current=\"step\"" : "";
|
|
61
|
+
r.push(`<button type="button" class="${e}${a}${o}" aria-label="Scene ${i} of ${n}"${s}></button>`);
|
|
62
|
+
}
|
|
63
|
+
return r.join("");
|
|
64
|
+
}
|
|
65
|
+
function h(e) {
|
|
66
|
+
let t = e.current <= 1, n = e.current >= e.total, r = t ? " bc-scene-player__btn-group__btn--disabled" : "", i = n ? " bc-scene-player__btn-group__btn--disabled" : "";
|
|
67
|
+
return `<div class="bc-scene-player bc-scene-player--buttons bc-scene-player--${e.position}" data-scene-player><div class="bc-scene-player__btn-group"><button type="button" class="bc-scene-player__btn-group__btn${r}"${d(t)} aria-label="Previous scene" data-action="previous">${o} Back</button><button type="button" class="bc-scene-player__btn-group__btn bc-scene-player__btn-group__btn--next${i}"${d(n)} aria-label="Next scene" data-action="next">Next ${s}</button></div><span class="bc-scene-player__counter">${e.current} / ${e.total}</span></div>`;
|
|
68
|
+
}
|
|
69
|
+
function g(e) {
|
|
70
|
+
return `<div class="bc-scene-player bc-scene-player--dot-stepper bc-scene-player--${e.position}" data-scene-player>` + p("previous", "Previous scene", c, e.current <= 1) + f(11, e.playing) + `<div class="bc-scene-player__dots">${m("bc-scene-player__dots__dot", e)}</div>` + p("next", "Next scene", l, e.current >= e.total) + "</div>";
|
|
71
|
+
}
|
|
72
|
+
function _(e) {
|
|
73
|
+
return `<div class="bc-scene-player bc-scene-player--minimal-arrows bc-scene-player--${e.position}" data-scene-player><span class="bc-scene-player__counter">${e.current}/${e.total}</span>` + p("previous", "Previous scene", c, e.current <= 1) + f(9, e.playing) + p("next", "Next scene", l, e.current >= e.total) + "</div>";
|
|
74
|
+
}
|
|
75
|
+
function v(e) {
|
|
76
|
+
return "<div class=\"bc-scene-player bc-scene-player--progress-bar\" data-scene-player>" + f(10, e.playing) + `<div class="bc-scene-player__segments">${m("bc-scene-player__segments__segment", e)}</div><span class="bc-scene-player__counter">${e.current}/${e.total}</span></div>`;
|
|
77
|
+
}
|
|
78
|
+
var y = {
|
|
79
|
+
buttons: h,
|
|
80
|
+
"dot-stepper": g,
|
|
81
|
+
"minimal-arrows": _,
|
|
82
|
+
"progress-bar": v
|
|
83
|
+
};
|
|
84
|
+
function b(e, t) {
|
|
85
|
+
return y[e](t);
|
|
86
|
+
}
|
|
87
|
+
function x(e) {
|
|
88
|
+
let t = document.createElement("template");
|
|
89
|
+
return t.innerHTML = e, t.content.firstElementChild;
|
|
90
|
+
}
|
|
91
|
+
function S(e, t) {
|
|
92
|
+
for (let { name: n } of Array.from(e.attributes)) t.hasAttribute(n) || e.removeAttribute(n);
|
|
93
|
+
for (let { name: n, value: r } of Array.from(t.attributes)) e.getAttribute(n) !== r && e.setAttribute(n, r);
|
|
94
|
+
}
|
|
95
|
+
function C(e, t) {
|
|
96
|
+
let n = e.childNodes, r = t.childNodes;
|
|
97
|
+
return n.length === r.length && Array.from(n).every((e, t) => e.nodeName === r[t].nodeName);
|
|
98
|
+
}
|
|
99
|
+
function w(e, t) {
|
|
100
|
+
if (S(e, t), !C(e, t)) {
|
|
101
|
+
e.replaceChildren(...Array.from(t.childNodes));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
e.childNodes.forEach((e, n) => {
|
|
105
|
+
let r = t.childNodes[n];
|
|
106
|
+
e instanceof Element ? w(e, r) : e.nodeValue !== r.nodeValue && (e.nodeValue = r.nodeValue);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function T(e, t, n) {
|
|
110
|
+
let r = {
|
|
111
|
+
current: 1,
|
|
112
|
+
total: t.total,
|
|
113
|
+
playing: !1,
|
|
114
|
+
position: t.position
|
|
115
|
+
}, o = x(b(t.type, r)), s;
|
|
116
|
+
function c() {
|
|
117
|
+
let e = x(b(t.type, r));
|
|
118
|
+
w(o, e);
|
|
119
|
+
}
|
|
120
|
+
function l(e) {
|
|
121
|
+
if (e < 1 || e > r.total || e === r.current) return;
|
|
122
|
+
let t = d();
|
|
123
|
+
r.current = e, n(e), v(), c(), u(t);
|
|
124
|
+
}
|
|
125
|
+
function u(e) {
|
|
126
|
+
if (!e) return;
|
|
127
|
+
let t = o.querySelector("button:not(:disabled)");
|
|
128
|
+
(e.matches(":disabled") ? t : e)?.focus();
|
|
129
|
+
}
|
|
130
|
+
function d() {
|
|
131
|
+
let e = document.activeElement;
|
|
132
|
+
return e instanceof HTMLElement && o.contains(e) ? e : null;
|
|
133
|
+
}
|
|
134
|
+
function f() {
|
|
135
|
+
r.playing ? h() : p();
|
|
136
|
+
}
|
|
137
|
+
function p() {
|
|
138
|
+
r.playing || (r.playing = !0, c(), l(1), s = setInterval(m, i));
|
|
139
|
+
}
|
|
140
|
+
function m() {
|
|
141
|
+
r.current < r.total ? l(r.current + 1) : h();
|
|
142
|
+
}
|
|
143
|
+
function h() {
|
|
144
|
+
r.playing = !1, clearInterval(s), c();
|
|
145
|
+
}
|
|
146
|
+
function g(e) {
|
|
147
|
+
return Array.from(e.parentElement?.children ?? []).indexOf(e) + 1;
|
|
148
|
+
}
|
|
149
|
+
function _(e) {
|
|
150
|
+
let t = e.target.closest("button");
|
|
151
|
+
if (!t) return;
|
|
152
|
+
let n = t.dataset.action;
|
|
153
|
+
t.classList.contains("bc-scene-player__play-btn") ? f() : n === "previous" ? l(r.current - 1) : n === "next" ? l(r.current + 1) : t.matches(a) && l(g(t));
|
|
154
|
+
}
|
|
155
|
+
function v() {
|
|
156
|
+
let t = e.querySelector(".bc-frame-footer");
|
|
157
|
+
t && o.parentElement !== t && t.appendChild(o);
|
|
158
|
+
}
|
|
159
|
+
o.addEventListener("click", _), v(), new MutationObserver(v).observe(e, { childList: !0 });
|
|
160
|
+
}
|
|
45
161
|
//#endregion
|
|
46
162
|
//#region src/runtime/index.ts
|
|
47
163
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", t) : t();
|
|
48
164
|
//#endregion
|
|
49
|
-
export { n as createSceneController, r as createStepController, t as initBlueprint, e as renderBpc };
|
|
165
|
+
export { n as createSceneController, r as createStepController, t as initBlueprint, T as mountScenePlayer, e as renderBpc };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprint-chart/lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "DSL-driven charting library built on D3. Define charts as text, render them anywhere.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chart",
|
|
@@ -48,12 +48,14 @@
|
|
|
48
48
|
"default": "./dist/runtime.js"
|
|
49
49
|
},
|
|
50
50
|
"./charts.scss": "./src/charts/chart.scss",
|
|
51
|
+
"./player.css": "./src/runtime/player.css",
|
|
51
52
|
"./src/charts/chart.scss": "./src/charts/chart.scss",
|
|
52
53
|
"./embed-runtime.js": "./dist/lib/lib.iife.js"
|
|
53
54
|
},
|
|
54
55
|
"files": [
|
|
55
56
|
"dist",
|
|
56
57
|
"src/charts/chart.scss",
|
|
58
|
+
"src/runtime/player.css",
|
|
57
59
|
"README.md",
|
|
58
60
|
"LICENSE"
|
|
59
61
|
],
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/* Blueprint Chart — Scene player styles, shared by the editor and the embed.
|
|
2
|
+
Light colors live in var() fallbacks; only dark mode defines the tokens. */
|
|
3
|
+
|
|
4
|
+
[data-bs-theme="dark"] .bc-frame:not([data-bs-theme="dark"] [data-bs-theme="light"] *),
|
|
5
|
+
.bc-frame.bc-theme-dark {
|
|
6
|
+
--bc-scene-player-text: #e6e6e6;
|
|
7
|
+
--bc-scene-player-muted: #a8a5a0;
|
|
8
|
+
--bc-scene-player-border: #6b6966;
|
|
9
|
+
--bc-scene-player-border-hover: #a8a5a0;
|
|
10
|
+
--bc-scene-player-background-hover: rgba(255, 255, 255, 0.06);
|
|
11
|
+
--bc-scene-player-track: #6b6966;
|
|
12
|
+
--bc-scene-player-accent: #4a7fd0;
|
|
13
|
+
--bc-scene-player-accent-hover: #5b8fdc;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.bc-scene-player--buttons {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
padding: 0.25rem 0 0;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bc-scene-player--buttons.bc-scene-player--left {
|
|
26
|
+
justify-content: flex-start;
|
|
27
|
+
gap: 16px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bc-scene-player--buttons.bc-scene-player--left .bc-scene-player__counter {
|
|
31
|
+
margin-left: auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.bc-scene-player--buttons.bc-scene-player--center {
|
|
35
|
+
justify-content: center;
|
|
36
|
+
gap: 16px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.bc-scene-player--buttons.bc-scene-player--right {
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
gap: 16px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.bc-scene-player--dot-stepper,
|
|
45
|
+
.bc-scene-player--minimal-arrows {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: 0.25rem 0 0;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.bc-scene-player--dot-stepper {
|
|
53
|
+
gap: 0.375rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.bc-scene-player--minimal-arrows {
|
|
57
|
+
gap: 4px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.bc-scene-player--dot-stepper.bc-scene-player--left,
|
|
61
|
+
.bc-scene-player--minimal-arrows.bc-scene-player--left {
|
|
62
|
+
justify-content: flex-start;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.bc-scene-player--dot-stepper.bc-scene-player--center,
|
|
66
|
+
.bc-scene-player--minimal-arrows.bc-scene-player--center {
|
|
67
|
+
justify-content: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bc-scene-player--dot-stepper.bc-scene-player--right,
|
|
71
|
+
.bc-scene-player--minimal-arrows.bc-scene-player--right {
|
|
72
|
+
justify-content: flex-end;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.bc-scene-player--progress-bar {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 0.5rem;
|
|
79
|
+
padding: 0.25rem 0 0;
|
|
80
|
+
width: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.bc-scene-player__btn-group {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: 6px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bc-scene-player__btn-group__btn {
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: 4px;
|
|
92
|
+
padding: 6px 14px;
|
|
93
|
+
border-radius: 6px;
|
|
94
|
+
border: 1px solid var(--bc-scene-player-border, currentColor);
|
|
95
|
+
background: none;
|
|
96
|
+
color: var(--bc-scene-player-muted);
|
|
97
|
+
font-size: var(--bs-font-size-sm, 0.875rem);
|
|
98
|
+
font-weight: 500;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
transition: border-color var(--bc-duration-base, 150ms), color var(--bc-duration-base, 150ms);
|
|
101
|
+
line-height: 1.4;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bc-scene-player__btn-group__btn:hover:not(:disabled) {
|
|
105
|
+
border-color: var(--bc-scene-player-border-hover);
|
|
106
|
+
background: var(--bc-scene-player-background-hover, rgba(0, 0, 0, 0.04));
|
|
107
|
+
color: var(--bc-scene-player-text);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.bc-scene-player__btn-group__btn--next {
|
|
111
|
+
color: var(--bc-scene-player-text);
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bc-scene-player__btn-group__btn--disabled {
|
|
116
|
+
opacity: 0.35;
|
|
117
|
+
cursor: default;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.bc-scene-player__nav-btn {
|
|
121
|
+
width: 24px;
|
|
122
|
+
height: 24px;
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
background: none;
|
|
128
|
+
border: 1px solid var(--bc-scene-player-border, #e2e0db);
|
|
129
|
+
color: var(--bc-scene-player-muted, #9b9893);
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
flex-shrink: 0;
|
|
132
|
+
padding: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.bc-scene-player__nav-btn:hover:not(:disabled) {
|
|
136
|
+
border-color: var(--bc-scene-player-border-hover, #6b6966);
|
|
137
|
+
color: var(--bc-scene-player-text, #1a1a1a);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.bc-scene-player__nav-btn:disabled {
|
|
141
|
+
opacity: 0.3;
|
|
142
|
+
cursor: default;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.bc-scene-player__play-btn {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
background: var(--bc-scene-player-accent, #2c5aa0);
|
|
150
|
+
border: none;
|
|
151
|
+
color: #fff;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
transition: background var(--bc-duration-base, 150ms) ease;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.bc-scene-player__play-btn:hover {
|
|
159
|
+
background: var(--bc-scene-player-accent-hover, #1e4888);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.bc-scene-player--dot-stepper .bc-scene-player__play-btn {
|
|
163
|
+
width: 30px;
|
|
164
|
+
height: 30px;
|
|
165
|
+
border-radius: 50%;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.bc-scene-player--minimal-arrows .bc-scene-player__play-btn {
|
|
169
|
+
width: 26px;
|
|
170
|
+
height: 26px;
|
|
171
|
+
border-radius: 7px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.bc-scene-player--progress-bar .bc-scene-player__play-btn {
|
|
175
|
+
width: 28px;
|
|
176
|
+
height: 28px;
|
|
177
|
+
border-radius: 50%;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.bc-scene-player__dots {
|
|
181
|
+
display: flex;
|
|
182
|
+
gap: 6px;
|
|
183
|
+
align-items: center;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.bc-scene-player__dots__dot {
|
|
187
|
+
width: 8px;
|
|
188
|
+
height: 8px;
|
|
189
|
+
border-radius: 4px;
|
|
190
|
+
border: none;
|
|
191
|
+
padding: 0;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
background: var(--bc-scene-player-track, #e2e0db);
|
|
194
|
+
opacity: 0.4;
|
|
195
|
+
transition: width var(--bc-duration-slow, 250ms) ease, background var(--bc-duration-slow, 250ms) ease, opacity var(--bc-duration-slow, 250ms) ease;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.bc-scene-player__dots__dot--completed {
|
|
199
|
+
background: var(--bc-scene-player-accent, #2c5aa0);
|
|
200
|
+
opacity: 1;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.bc-scene-player__dots__dot--active {
|
|
204
|
+
width: 20px;
|
|
205
|
+
background: var(--bc-scene-player-accent, #2c5aa0);
|
|
206
|
+
opacity: 1;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.bc-scene-player__dots__dot:hover {
|
|
210
|
+
opacity: 0.8;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.bc-scene-player__segments {
|
|
214
|
+
flex: 1;
|
|
215
|
+
display: flex;
|
|
216
|
+
gap: 3px;
|
|
217
|
+
align-items: center;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.bc-scene-player__segments__segment {
|
|
221
|
+
flex: 1;
|
|
222
|
+
height: 4px;
|
|
223
|
+
border-radius: 2px;
|
|
224
|
+
border: none;
|
|
225
|
+
padding: 0;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
background: var(--bc-scene-player-track, #e2e0db);
|
|
228
|
+
opacity: 0.45;
|
|
229
|
+
transition: height var(--bc-duration-slow, 250ms) ease, background var(--bc-duration-slow, 250ms) ease, opacity var(--bc-duration-slow, 250ms) ease;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.bc-scene-player__segments__segment--completed {
|
|
233
|
+
background: var(--bc-scene-player-accent, #2c5aa0);
|
|
234
|
+
opacity: 1;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.bc-scene-player__segments__segment--active {
|
|
238
|
+
height: 6px;
|
|
239
|
+
background: var(--bc-scene-player-accent, #2c5aa0);
|
|
240
|
+
opacity: 1;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.bc-scene-player__segments__segment:hover {
|
|
244
|
+
opacity: 0.8;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.bc-scene-player__counter {
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
color: var(--bc-scene-player-muted, #9b9893);
|
|
250
|
+
white-space: nowrap;
|
|
251
|
+
font-variant-numeric: tabular-nums;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.bc-scene-player--buttons .bc-scene-player__counter {
|
|
255
|
+
font-size: var(--bs-font-size-sm, 0.875rem);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.bc-scene-player--minimal-arrows .bc-scene-player__counter {
|
|
259
|
+
font-size: var(--bs-font-size-xs, 0.75rem);
|
|
260
|
+
margin-right: 4px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.bc-scene-player--minimal-arrows .bc-scene-player__counter--end {
|
|
264
|
+
margin-right: 0;
|
|
265
|
+
margin-left: 4px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.bc-scene-player--progress-bar .bc-scene-player__counter {
|
|
269
|
+
font-size: var(--bs-font-size-xs, 0.75rem);
|
|
270
|
+
flex-shrink: 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@media (prefers-reduced-motion: reduce) {
|
|
274
|
+
.bc-scene-player,
|
|
275
|
+
.bc-scene-player * {
|
|
276
|
+
transition: none;
|
|
277
|
+
}
|
|
278
|
+
}
|
package/dist/runtime-CT02Shsd.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
//#region src/charts/themes/index.ts
|
|
2
|
-
var e = [
|
|
3
|
-
{
|
|
4
|
-
name: "blueprint",
|
|
5
|
-
label: "Blueprint",
|
|
6
|
-
description: "The default Blueprint Chart theme"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: "blueprint-framed",
|
|
10
|
-
label: "Blueprint Framed",
|
|
11
|
-
description: "Adds borders and a tinted footer"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: "blueprint-bold",
|
|
15
|
-
label: "Blueprint Bold",
|
|
16
|
-
description: "Charts on the blueprint canvas with the full brand palette"
|
|
17
|
-
}
|
|
18
|
-
];
|
|
19
|
-
function t() {
|
|
20
|
-
return e;
|
|
21
|
-
}
|
|
22
|
-
function n() {
|
|
23
|
-
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia("(prefers-color-scheme: dark)");
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/runtime/chart-css.ts
|
|
27
|
-
var r = "\n/* Blueprint Chart — Runtime Embed Styles\n CSS custom properties with baked-in defaults for standalone iframe usage. */\n\n.bc-frame {\n --bc-frame-font-family: system-ui, -apple-system, sans-serif;\n --bc-frame-padding: 0;\n /* Per-side properties so a multi-value `padding` shorthand never lands in a\n single-value shorthand slot, which would invalidate the whole declaration. */\n --bc-frame-padding-top: var(--bc-frame-padding);\n --bc-frame-padding-right: var(--bc-frame-padding);\n --bc-frame-padding-bottom: var(--bc-frame-padding);\n --bc-frame-padding-left: var(--bc-frame-padding);\n --bc-frame-bg: #fff;\n --bc-text-color: #333;\n font-family: var(--bc-frame-font-family);\n background: var(--bc-frame-bg);\n /* currentColor marks (e.g. above-bar value labels) follow the theme text\n colour, not the ambient document colour. */\n color: var(--bc-text-color, #333);\n}\n\n/* Keeps the SVG's baked-in background rect (applyCanvasBackground) in sync\n with the frame background; transparentBackground sets the var to\n transparent at runtime. */\n.bc-frame .bc-canvas-bg {\n fill: var(--bc-frame-bg, #fff);\n}\n\n/* `theme = \"dark\"` emits this class on the frame, so it carries the same\n surface the document-level dark mode does, without depending on an ambient\n data-bs-theme. Keep in sync with DARK_THEME in render/frame-svg.ts. */\n.bc-frame.bc-theme-dark {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n\n.bc-frame-header {\n padding: var(--bc-frame-padding-top) var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n background: var(--bc-frame-header-bg, transparent);\n border-bottom: var(--bc-frame-header-border-bottom, none);\n margin-bottom: var(--bc-frame-header-margin-bottom, 0);\n}\n\n.bc-frame-body {\n padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n}\n\n/* Constrained-height mode (`heightMode` fixed or aspect-ratio). post-render.ts\n adds .bc-frame--constrained and layout-constraints.ts pins the container\n height with overflow: hidden; without these rules the frame renders at its\n natural height and is guillotined. Mirrors chart.scss — keep the two in\n sync. */\n/* An axis label moved inside the plot sits directly on the marks; painting the\n stroke first keeps it readable over a filled band. */\n.bc-axis-label-inside {\n paint-order: stroke;\n stroke: var(--bc-frame-bg, #fff);\n stroke-width: 3px;\n stroke-linejoin: round;\n}\n\n.bc-frame--constrained {\n flex: 1;\n position: relative;\n min-height: 0;\n overflow: hidden;\n}\n\n.bc-frame--constrained .bc-frame-header {\n position: relative;\n z-index: 1;\n background: var(--bc-frame-header-bg, var(--bc-frame-bg, #fff));\n}\n\n.bc-frame--constrained .bc-frame-body {\n position: absolute;\n inset: 0;\n z-index: 0;\n overflow: hidden;\n}\n\n.bc-frame--constrained .bc-frame-note {\n position: absolute;\n bottom: var(--bc-footer-h, 0);\n left: 0;\n right: 0;\n z-index: 1;\n}\n\n.bc-frame--constrained .bc-frame-footer {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1;\n}\n\n.bc-frame-title {\n --bc-frame-title-color: var(--bc-text-color, #333);\n --bc-frame-title-font-size: 1.25rem;\n color: var(--bc-frame-title-color);\n font-size: var(--bc-frame-title-font-size);\n font-weight: bold;\n margin: 0;\n white-space: pre-line;\n}\n\n.bc-frame-description {\n --bc-frame-description-color: var(--bc-text-color, #555);\n --bc-frame-description-font-size: 0.875rem;\n color: var(--bc-frame-description-color);\n font-size: var(--bc-frame-description-font-size);\n margin: 0.25rem 0 0;\n white-space: pre-line;\n}\n\n.bc-frame-footer {\n margin-top: 0.5rem;\n gap: 0.25rem 1rem;\n padding: var(--bc-frame-footer-padding-top, 0) var(--bc-frame-padding-right) var(--bc-frame-padding-bottom) var(--bc-frame-padding-left);\n background: var(--bc-frame-footer-bg, transparent);\n border-top: var(--bc-frame-footer-border-top, none);\n}\n\n.bc-frame-footer-left {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 0.25rem 0.75rem;\n}\n\n.bc-frame-footer-left > :not(:first-child)::before {\n content: \"\\00B7\";\n margin-right: 0.5rem;\n color: var(--bc-text-color, #888);\n}\n\n.bc-frame-footer-right {\n display: flex;\n align-items: center;\n}\n\n.bc-frame-note {\n --bc-frame-note-color: var(--bc-text-color, #888);\n --bc-frame-note-font-size: 0.75rem;\n font-style: italic;\n color: var(--bc-frame-note-color);\n font-size: var(--bc-frame-note-font-size);\n margin: 0;\n padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n}\n\n.bc-frame-byline,\n.bc-frame-source,\n.bc-frame-get-the-data {\n --bc-frame-meta-color: var(--bc-text-color, #888);\n --bc-frame-meta-font-size: 0.75rem;\n color: var(--bc-frame-meta-color);\n font-size: var(--bc-frame-meta-font-size);\n}\n\n.bc-frame-byline {\n white-space: pre-line;\n}\n\n.bc-frame-credit {\n --bc-frame-credit-color: var(--bc-text-color, #666);\n --bc-frame-credit-font-size: 0.75rem;\n color: var(--bc-frame-credit-color);\n font-size: var(--bc-frame-credit-font-size);\n font-weight: 600;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n}\n\n.bc-frame-source-link {\n color: inherit;\n text-decoration: underline;\n}\n\n.bc-axis .domain {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-axis .tick text {\n fill: var(--bc-axis-color, #333);\n font-size: 10px;\n}\n\n.bc-axis .tick line {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-grid-line {\n stroke: var(--bc-grid-color, #e0e0e0);\n stroke-width: 1;\n}\n\n.bc-zero-baseline {\n stroke: #666;\n stroke-width: 1;\n}\n\n.bc-bar {\n /* fill is set via D3 .attr() from data-bound colors — do not override */\n}\n\n.bc-line {\n fill: none;\n stroke-width: 2;\n}\n\n.bc-value-label {\n font-size: 11px;\n /* fill is set via D3 .attr() — do not override */\n}\n\n.bc-direct-label {\n font-size: 12px;\n font-weight: 600;\n}\n\n.bc-tooltip {\n position: absolute;\n pointer-events: none;\n background: var(--bc-tooltip-bg, #fff);\n color: var(--bc-tooltip-color, #212529);\n border: 1px solid var(--bc-tooltip-border-color, #dee2e6);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.12);\n max-width: var(--bc-tooltip-max-width, 240px);\n overflow-wrap: break-word;\n z-index: 9999;\n display: none;\n}\n\n.bc-crosshair {\n stroke: #999;\n stroke-width: 1;\n pointer-events: none;\n}\n\n.bc-arc-label-line {\n fill: none;\n stroke: #999;\n stroke-width: 1;\n}\n\n.bc-theme-blueprint-framed {\n --bc-frame-header-border-bottom: 1px solid #e0e0e0;\n --bc-frame-header-margin-bottom: 0.5rem;\n --bc-frame-footer-bg: #f8f8f8;\n --bc-frame-footer-border-top: 1px solid #e0e0e0;\n --bc-frame-footer-padding-top: 0.625rem;\n}\n\n[data-bs-theme=\"dark\"] .bc-frame.bc-theme-blueprint-bold:not([data-bs-theme=\"dark\"] [data-bs-theme=\"light\"] *) {\n --bc-frame-bg: #000000;\n --bc-text-color: rgba(255, 255, 255, 0.95);\n --bc-axis-color: rgba(255, 255, 255, 0.7);\n --bc-grid-color: rgba(255, 255, 255, 0.12);\n}\n\n.blueprint-chart-error {\n color: red;\n padding: 1em;\n border: 1px solid red;\n}\n\nbody {\n margin: 0;\n overflow: hidden;\n}\n\n/* Dark theme: activated by data-bs-theme=\"dark\" on the document (matching the\n editor's convention). The chart owns these colors; the dark frame background\n also drives the renderer's resolveBackgroundColor, so data-mark colors and\n contrast labels adapt at render time. Scoped to .bc-frame so these override\n the frame's own light --bc-frame-bg / --bc-text-color declarations (which are\n set on .bc-frame and would otherwise shadow a document-level override). */\n[data-bs-theme=\"dark\"] body {\n /* color themes above-bar value labels (fill: currentColor). */\n background: #1c1c1c;\n color: rgba(255, 255, 255, 0.9);\n}\n\n[data-bs-theme=\"dark\"] .bc-frame {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n", i = "blueprint-chart-resize", a = "blueprint-chart-error";
|
|
28
|
-
function o(e) {
|
|
29
|
-
return typeof e == "object" && e && e.type === "blueprint-chart-resize" && typeof e.height == "number" ? e.height : null;
|
|
30
|
-
}
|
|
31
|
-
function s(e) {
|
|
32
|
-
return typeof e == "object" && !!e && e.type === "blueprint-chart-error";
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/runtime/runtime.ts
|
|
36
|
-
var c = l();
|
|
37
|
-
function l() {
|
|
38
|
-
try {
|
|
39
|
-
if (typeof globalThis < "u") {
|
|
40
|
-
let e = globalThis.BLUEPRINT_CHART_RUNTIME_URL;
|
|
41
|
-
if (typeof e == "string" && e) return e;
|
|
42
|
-
}
|
|
43
|
-
return typeof document > "u" ? "" : document.currentScript?.src ?? "";
|
|
44
|
-
} catch {
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
var u = /* @__PURE__ */ new Map(), d = null, f = [];
|
|
49
|
-
function p() {
|
|
50
|
-
d || (d = (e) => {
|
|
51
|
-
for (let [t, n] of u) if (e.source === t.contentWindow) {
|
|
52
|
-
n(e);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
}, window.addEventListener("message", d));
|
|
56
|
-
}
|
|
57
|
-
function m() {
|
|
58
|
-
p(), document.querySelectorAll("script[type=\"application/blueprint-chart\"]").forEach(h);
|
|
59
|
-
}
|
|
60
|
-
function h(e) {
|
|
61
|
-
let t = e.textContent?.trim();
|
|
62
|
-
if (!t) return;
|
|
63
|
-
let r = document.createElement("iframe");
|
|
64
|
-
r.className = "blueprint-chart-iframe", r.style.cssText = "border: none; width: 100%; display: block;", r.setAttribute("sandbox", "allow-scripts"), r.setAttribute("title", "Blueprint Chart"), e.parentNode?.insertBefore(r, e);
|
|
65
|
-
let i = e.closest("[data-bs-theme]")?.getAttribute("data-bs-theme");
|
|
66
|
-
if (i === "light" || i === "dark") r.srcdoc = g(t, c, i);
|
|
67
|
-
else {
|
|
68
|
-
let e = n(), i = () => {
|
|
69
|
-
r.srcdoc = g(t, c, e?.matches ? "dark" : "light");
|
|
70
|
-
};
|
|
71
|
-
i(), e && (e.addEventListener("change", i), f.push(() => e.removeEventListener("change", i)));
|
|
72
|
-
}
|
|
73
|
-
u.set(r, (e) => {
|
|
74
|
-
let t = o(e.data);
|
|
75
|
-
if (t !== null) {
|
|
76
|
-
r.style.height = `${t}px`;
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
s(e.data) && console.warn("Blueprint Chart: could not render embed.", e.data.message);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function g(e, t, n) {
|
|
83
|
-
let o = t ? `<script src="${v(t)}"><\/script>` : "", s = n === "dark" ? "<html data-bs-theme=\"dark\">" : "<html>", c = t ? [
|
|
84
|
-
"try {",
|
|
85
|
-
" window.BlueprintChart.renderBpc(document.getElementById(\"chart\"), __BPC_SRC__);",
|
|
86
|
-
"}",
|
|
87
|
-
"catch (e) {",
|
|
88
|
-
` parent.postMessage({ type: "${a}", message: String(e) }, "*");`,
|
|
89
|
-
"}"
|
|
90
|
-
] : [`parent.postMessage({ type: "${a}", message: "Blueprint Chart runtime URL unavailable" }, "*");`];
|
|
91
|
-
return [
|
|
92
|
-
"<!DOCTYPE html>",
|
|
93
|
-
`${s}<head>`,
|
|
94
|
-
`<style>${r}</style>`,
|
|
95
|
-
"</head><body>",
|
|
96
|
-
"<div id=\"chart\" class=\"blueprint-chart-container\"></div>",
|
|
97
|
-
o,
|
|
98
|
-
"<script>",
|
|
99
|
-
`var __BPC_SRC__ = ${_(e)};`,
|
|
100
|
-
"function notifySize() {",
|
|
101
|
-
" var h = document.documentElement.scrollHeight;",
|
|
102
|
-
` parent.postMessage({ type: "${i}", height: h }, "*");`,
|
|
103
|
-
"}",
|
|
104
|
-
...c,
|
|
105
|
-
"notifySize();",
|
|
106
|
-
"new ResizeObserver(notifySize).observe(document.body);",
|
|
107
|
-
"<\/script>",
|
|
108
|
-
"</body></html>"
|
|
109
|
-
].filter(Boolean).join("\n");
|
|
110
|
-
}
|
|
111
|
-
function _(e) {
|
|
112
|
-
return JSON.stringify(e).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
113
|
-
}
|
|
114
|
-
function v(e) {
|
|
115
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
116
|
-
}
|
|
117
|
-
//#endregion
|
|
118
|
-
export { s as a, t as c, i, m as n, o, a as r, n as s, g as t };
|