@blueprint-chart/lib 2.1.0 → 2.2.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/charts/plugins/arc-labels.d.ts +1 -0
- package/dist/charts/scale-helpers.d.ts +1 -1
- package/dist/charts/value-label-fit.d.ts +5 -0
- package/dist/embed.js +1 -1
- package/dist/enums.d.ts +18 -0
- package/dist/index.js +2 -2
- package/dist/lib/lib.iife.js +65 -15
- package/dist/node-backend/index.js +1912 -1883
- package/dist/{render-bpc-BSt4wOjf.js → render-bpc-C4y50x4-.js} +2023 -1990
- package/dist/runtime/chart-css.d.ts +1 -1
- package/dist/runtime-gzeMNwqx.js +84 -0
- package/dist/runtime.js +2 -2
- package/dist/transforms/table.d.ts +0 -1
- package/package.json +1 -1
- package/src/charts/chart.scss +21 -0
- package/dist/runtime-DDhsXDn5.js +0 -84
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CHART_CSS = "\n/* Blueprint Chart \u2014 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.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-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 \u2014 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() \u2014 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 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 {\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";
|
|
1
|
+
export declare const CHART_CSS = "\n/* Blueprint Chart \u2014 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 \u2014 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-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 \u2014 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() \u2014 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 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 {\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";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region src/runtime/chart-css.ts
|
|
2
|
+
var e = "blueprint-chart-resize", t = "blueprint-chart-error";
|
|
3
|
+
function n(e) {
|
|
4
|
+
return typeof e == "object" && e && e.type === "blueprint-chart-resize" && typeof e.height == "number" ? e.height : null;
|
|
5
|
+
}
|
|
6
|
+
function r(e) {
|
|
7
|
+
return typeof e == "object" && !!e && e.type === "blueprint-chart-error";
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/runtime/runtime.ts
|
|
11
|
+
var i = a();
|
|
12
|
+
function a() {
|
|
13
|
+
try {
|
|
14
|
+
if (typeof globalThis < "u") {
|
|
15
|
+
let e = globalThis.BLUEPRINT_CHART_RUNTIME_URL;
|
|
16
|
+
if (typeof e == "string" && e) return e;
|
|
17
|
+
}
|
|
18
|
+
return typeof document > "u" ? "" : document.currentScript?.src ?? "";
|
|
19
|
+
} catch {
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var o = /* @__PURE__ */ new Map(), s = null;
|
|
24
|
+
function c() {
|
|
25
|
+
s || (s = (e) => {
|
|
26
|
+
for (let [t, n] of o) if (e.source === t.contentWindow) {
|
|
27
|
+
n(e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}, window.addEventListener("message", s));
|
|
31
|
+
}
|
|
32
|
+
function l() {
|
|
33
|
+
c(), document.querySelectorAll("script[type=\"application/blueprint-chart\"]").forEach(u);
|
|
34
|
+
}
|
|
35
|
+
function u(e) {
|
|
36
|
+
let t = e.textContent?.trim();
|
|
37
|
+
if (!t) return;
|
|
38
|
+
let a = document.createElement("iframe");
|
|
39
|
+
a.className = "blueprint-chart-iframe", a.style.cssText = "border: none; width: 100%; display: block;", a.setAttribute("sandbox", "allow-scripts"), a.setAttribute("title", "Blueprint Chart"), e.parentNode?.insertBefore(a, e), a.srcdoc = d(t, i), o.set(a, (e) => {
|
|
40
|
+
let t = n(e.data);
|
|
41
|
+
if (t !== null) {
|
|
42
|
+
a.style.height = `${t}px`;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
r(e.data) && console.warn("Blueprint Chart: could not render embed.", e.data.message);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function d(n, r, i) {
|
|
49
|
+
let a = r ? `<script src="${p(r)}"><\/script>` : "", o = i === "dark" ? "<html data-bs-theme=\"dark\">" : "<html>", s = r ? [
|
|
50
|
+
"try {",
|
|
51
|
+
" window.BlueprintChart.renderBpc(document.getElementById(\"chart\"), __BPC_SRC__);",
|
|
52
|
+
"}",
|
|
53
|
+
"catch (e) {",
|
|
54
|
+
` parent.postMessage({ type: "${t}", message: String(e) }, "*");`,
|
|
55
|
+
"}"
|
|
56
|
+
] : [`parent.postMessage({ type: "${t}", message: "Blueprint Chart runtime URL unavailable" }, "*");`];
|
|
57
|
+
return [
|
|
58
|
+
"<!DOCTYPE html>",
|
|
59
|
+
`${o}<head>`,
|
|
60
|
+
"<style>\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-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 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 {\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</style>",
|
|
61
|
+
"</head><body>",
|
|
62
|
+
"<div id=\"chart\" class=\"blueprint-chart-container\"></div>",
|
|
63
|
+
a,
|
|
64
|
+
"<script>",
|
|
65
|
+
`var __BPC_SRC__ = ${f(n)};`,
|
|
66
|
+
"function notifySize() {",
|
|
67
|
+
" var h = document.documentElement.scrollHeight;",
|
|
68
|
+
` parent.postMessage({ type: "${e}", height: h }, "*");`,
|
|
69
|
+
"}",
|
|
70
|
+
...s,
|
|
71
|
+
"notifySize();",
|
|
72
|
+
"new ResizeObserver(notifySize).observe(document.body);",
|
|
73
|
+
"<\/script>",
|
|
74
|
+
"</body></html>"
|
|
75
|
+
].filter(Boolean).join("\n");
|
|
76
|
+
}
|
|
77
|
+
function f(e) {
|
|
78
|
+
return JSON.stringify(e).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
79
|
+
}
|
|
80
|
+
function p(e) {
|
|
81
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { r as a, e as i, l as n, n as o, t as r, d as t };
|
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-C4y50x4-.js";
|
|
2
|
+
import { n as t } from "./runtime-gzeMNwqx.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");
|
|
@@ -12,7 +12,6 @@ export declare function isNumberValue(value: string): boolean;
|
|
|
12
12
|
export declare function detectColumnTypes(columns: string[], rows: string[][]): ColumnType[];
|
|
13
13
|
/** Read a `data { … }` body into the table the pipeline operates on. */
|
|
14
14
|
export declare function parseBpcData(raw: string): TransformResult;
|
|
15
|
-
/** Write a table back as a `data { … }` body. */
|
|
16
15
|
export declare function serializeTableData(cols: string[], rows: string[][]): string;
|
|
17
16
|
/**
|
|
18
17
|
* Rebuild a table from parsed chart data, for the steps that run on top of an
|
package/package.json
CHANGED
package/src/charts/chart.scss
CHANGED
|
@@ -428,6 +428,27 @@
|
|
|
428
428
|
// Do NOT set fill in CSS — it would break contrast-based readability.
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
// An axis label moved inside the plot sits directly on the marks. Painting the
|
|
432
|
+
// stroke first gives it a background the colour of the frame, so it stays
|
|
433
|
+
// readable over a filled band instead of running at about 2:1 contrast.
|
|
434
|
+
.bc-axis-label-inside {
|
|
435
|
+
paint-order: stroke;
|
|
436
|
+
stroke: var(--bc-frame-bg, #fff);
|
|
437
|
+
stroke-width: 3px;
|
|
438
|
+
stroke-linejoin: round;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// Text painted over a mark is decorative, and it sits exactly where a user
|
|
442
|
+
// aims to hover. Without this it swallows mouseenter and the mark below it
|
|
443
|
+
// gets no tooltip and no crosshair.
|
|
444
|
+
.bc-value-label,
|
|
445
|
+
.bc-direct-label,
|
|
446
|
+
.bc-arc-direct-label,
|
|
447
|
+
.bc-arc-inside-label,
|
|
448
|
+
.bc-arc-label-line {
|
|
449
|
+
pointer-events: none;
|
|
450
|
+
}
|
|
451
|
+
|
|
431
452
|
// ---------------------------------------------------------------------------
|
|
432
453
|
// Direct labels (line-multi, bar-multi)
|
|
433
454
|
// ---------------------------------------------------------------------------
|
package/dist/runtime-DDhsXDn5.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
//#region src/runtime/chart-css.ts
|
|
2
|
-
var e = "blueprint-chart-resize", t = "blueprint-chart-error";
|
|
3
|
-
function n(e) {
|
|
4
|
-
return typeof e == "object" && e && e.type === "blueprint-chart-resize" && typeof e.height == "number" ? e.height : null;
|
|
5
|
-
}
|
|
6
|
-
function r(e) {
|
|
7
|
-
return typeof e == "object" && !!e && e.type === "blueprint-chart-error";
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/runtime/runtime.ts
|
|
11
|
-
var i = a();
|
|
12
|
-
function a() {
|
|
13
|
-
try {
|
|
14
|
-
if (typeof globalThis < "u") {
|
|
15
|
-
let e = globalThis.BLUEPRINT_CHART_RUNTIME_URL;
|
|
16
|
-
if (typeof e == "string" && e) return e;
|
|
17
|
-
}
|
|
18
|
-
return typeof document > "u" ? "" : document.currentScript?.src ?? "";
|
|
19
|
-
} catch {
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
var o = /* @__PURE__ */ new Map(), s = null;
|
|
24
|
-
function c() {
|
|
25
|
-
s || (s = (e) => {
|
|
26
|
-
for (let [t, n] of o) if (e.source === t.contentWindow) {
|
|
27
|
-
n(e);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
}, window.addEventListener("message", s));
|
|
31
|
-
}
|
|
32
|
-
function l() {
|
|
33
|
-
c(), document.querySelectorAll("script[type=\"application/blueprint-chart\"]").forEach(u);
|
|
34
|
-
}
|
|
35
|
-
function u(e) {
|
|
36
|
-
let t = e.textContent?.trim();
|
|
37
|
-
if (!t) return;
|
|
38
|
-
let a = document.createElement("iframe");
|
|
39
|
-
a.className = "blueprint-chart-iframe", a.style.cssText = "border: none; width: 100%; display: block;", a.setAttribute("sandbox", "allow-scripts"), a.setAttribute("title", "Blueprint Chart"), e.parentNode?.insertBefore(a, e), a.srcdoc = d(t, i), o.set(a, (e) => {
|
|
40
|
-
let t = n(e.data);
|
|
41
|
-
if (t !== null) {
|
|
42
|
-
a.style.height = `${t}px`;
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
r(e.data) && console.warn("Blueprint Chart: could not render embed.", e.data.message);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function d(n, r, i) {
|
|
49
|
-
let a = r ? `<script src="${p(r)}"><\/script>` : "", o = i === "dark" ? "<html data-bs-theme=\"dark\">" : "<html>", s = r ? [
|
|
50
|
-
"try {",
|
|
51
|
-
" window.BlueprintChart.renderBpc(document.getElementById(\"chart\"), __BPC_SRC__);",
|
|
52
|
-
"}",
|
|
53
|
-
"catch (e) {",
|
|
54
|
-
` parent.postMessage({ type: "${t}", message: String(e) }, "*");`,
|
|
55
|
-
"}"
|
|
56
|
-
] : [`parent.postMessage({ type: "${t}", message: "Blueprint Chart runtime URL unavailable" }, "*");`];
|
|
57
|
-
return [
|
|
58
|
-
"<!DOCTYPE html>",
|
|
59
|
-
`${o}<head>`,
|
|
60
|
-
"<style>\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.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-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 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 {\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</style>",
|
|
61
|
-
"</head><body>",
|
|
62
|
-
"<div id=\"chart\" class=\"blueprint-chart-container\"></div>",
|
|
63
|
-
a,
|
|
64
|
-
"<script>",
|
|
65
|
-
`var __BPC_SRC__ = ${f(n)};`,
|
|
66
|
-
"function notifySize() {",
|
|
67
|
-
" var h = document.documentElement.scrollHeight;",
|
|
68
|
-
` parent.postMessage({ type: "${e}", height: h }, "*");`,
|
|
69
|
-
"}",
|
|
70
|
-
...s,
|
|
71
|
-
"notifySize();",
|
|
72
|
-
"new ResizeObserver(notifySize).observe(document.body);",
|
|
73
|
-
"<\/script>",
|
|
74
|
-
"</body></html>"
|
|
75
|
-
].filter(Boolean).join("\n");
|
|
76
|
-
}
|
|
77
|
-
function f(e) {
|
|
78
|
-
return JSON.stringify(e).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
79
|
-
}
|
|
80
|
-
function p(e) {
|
|
81
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
export { r as a, e as i, l as n, n as o, t as r, d as t };
|