@bicharts/chart-host 0.6.52 → 0.6.56
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.
|
@@ -1617,7 +1617,7 @@ function Fn(n, s2) {
|
|
|
1617
1617
|
return { iso: o4, unmatched: I2, matchedRows: N, totalRows: n.length };
|
|
1618
1618
|
}
|
|
1619
1619
|
|
|
1620
|
-
// ../shape-core/dist/chunk-
|
|
1620
|
+
// ../shape-core/dist/chunk-TBB6BEZ7.mjs
|
|
1621
1621
|
var import_papaparse = __toESM(require_papaparse_min(), 1);
|
|
1622
1622
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
1623
1623
|
var ze = { "north-america": "AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI", "south-america": "AR BO BR CL CO EC FK GF GY PE PY SR UY VE", europe: "AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA", africa: "AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW", asia: "AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE", oceania: "AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS", antarctica: "AQ BV GS HM TF" };
|
package/dist/index.mjs
CHANGED
|
@@ -165,7 +165,7 @@ import {
|
|
|
165
165
|
unpinScrolledAxis,
|
|
166
166
|
valuePlacementFlag,
|
|
167
167
|
withoutViewOnlyKeys
|
|
168
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-CMHGGW3Y.mjs";
|
|
169
169
|
import "./chunk-A2GMXZP7.mjs";
|
|
170
170
|
import "./chunk-GHODWOAL.mjs";
|
|
171
171
|
|
|
@@ -941,9 +941,10 @@ function buildProductFeedbackPayload(input) {
|
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
var DEFAULT_TEXT2 = {
|
|
944
|
-
label: "
|
|
945
|
-
placeholder: "
|
|
946
|
-
hint: "
|
|
944
|
+
label: "Ideas to improve this product",
|
|
945
|
+
placeholder: "A feature you'd like, or something that got in your way",
|
|
946
|
+
hint: "This sends a note to our team. It won't draw a chart.",
|
|
947
|
+
open: "Suggest an improvement",
|
|
947
948
|
send: "Send",
|
|
948
949
|
sending: "Sending...",
|
|
949
950
|
sent: "Thank you - your suggestion was sent.",
|
|
@@ -982,7 +983,26 @@ function mountProductFeedbackBox(container, opts) {
|
|
|
982
983
|
status.setAttribute("role", "status");
|
|
983
984
|
status.setAttribute("aria-live", "polite");
|
|
984
985
|
row.append(button, status);
|
|
985
|
-
|
|
986
|
+
const opener = doc.createElement("button");
|
|
987
|
+
opener.type = "button";
|
|
988
|
+
opener.className = "bic-product-feedback-open";
|
|
989
|
+
opener.textContent = text.open;
|
|
990
|
+
const panel = doc.createElement("div");
|
|
991
|
+
panel.className = "bic-product-feedback-panel";
|
|
992
|
+
panel.append(label, hint, input, row);
|
|
993
|
+
const setOpen = (open) => {
|
|
994
|
+
opener.hidden = open;
|
|
995
|
+
panel.hidden = !open;
|
|
996
|
+
wrap.setAttribute("data-open", String(open));
|
|
997
|
+
};
|
|
998
|
+
setOpen(opts.collapsed === false);
|
|
999
|
+
const onOpen = () => {
|
|
1000
|
+
if (!panel.hidden) return;
|
|
1001
|
+
setOpen(true);
|
|
1002
|
+
input.focus();
|
|
1003
|
+
safely(() => opts.onOpened?.());
|
|
1004
|
+
};
|
|
1005
|
+
wrap.append(opener, panel);
|
|
986
1006
|
container.appendChild(wrap);
|
|
987
1007
|
let sending = false;
|
|
988
1008
|
const sync = () => {
|
|
@@ -1028,6 +1048,7 @@ function mountProductFeedbackBox(container, opts) {
|
|
|
1028
1048
|
};
|
|
1029
1049
|
input.addEventListener("input", onInput);
|
|
1030
1050
|
button.addEventListener("click", onClick);
|
|
1051
|
+
opener.addEventListener("click", onOpen);
|
|
1031
1052
|
sync();
|
|
1032
1053
|
safely(() => opts.onShown?.());
|
|
1033
1054
|
return {
|
|
@@ -1035,6 +1056,7 @@ function mountProductFeedbackBox(container, opts) {
|
|
|
1035
1056
|
destroy() {
|
|
1036
1057
|
input.removeEventListener("input", onInput);
|
|
1037
1058
|
button.removeEventListener("click", onClick);
|
|
1059
|
+
opener.removeEventListener("click", onOpen);
|
|
1038
1060
|
wrap.remove();
|
|
1039
1061
|
}
|
|
1040
1062
|
};
|
package/dist/react.mjs
CHANGED
|
@@ -60,6 +60,8 @@ export interface ProductFeedbackText {
|
|
|
60
60
|
sending?: string;
|
|
61
61
|
sent?: string;
|
|
62
62
|
failed?: string;
|
|
63
|
+
/** The link the closed box shows. */
|
|
64
|
+
open?: string;
|
|
63
65
|
}
|
|
64
66
|
export interface ProductFeedbackBoxOptions {
|
|
65
67
|
/** Delivers the cleaned text. Resolve { ok: false } (or throw) on failure; the box keeps the text either way. */
|
|
@@ -68,8 +70,13 @@ export interface ProductFeedbackBoxOptions {
|
|
|
68
70
|
/** Added to the wrapper so the host can skin it; the structure stays the same. */
|
|
69
71
|
className?: string;
|
|
70
72
|
maxChars?: number;
|
|
73
|
+
/** Start as a link that opens the box (the default). A closed affordance cannot be mistaken for a chart prompt;
|
|
74
|
+
* pass false only where the box is the page's only purpose. Once opened it stays open, so a draft is never hidden. */
|
|
75
|
+
collapsed?: boolean;
|
|
71
76
|
/** Called once, when the box is mounted - the host's "shown" counter. */
|
|
72
77
|
onShown?: () => void;
|
|
78
|
+
/** Called once, when the reader opens a closed box. */
|
|
79
|
+
onOpened?: () => void;
|
|
73
80
|
/** Called after a successful send - the host's "sent" counter. */
|
|
74
81
|
onSent?: () => void;
|
|
75
82
|
/** Called after a failed send, with what failed, so the host can log it. */
|
|
@@ -82,7 +89,9 @@ export interface ProductFeedbackBox {
|
|
|
82
89
|
}
|
|
83
90
|
/**
|
|
84
91
|
* Build the box inside `container`. The wrapper carries `bic-product-feedback` (plus the host's
|
|
85
|
-
* class)
|
|
86
|
-
*
|
|
92
|
+
* class) and `data-open`; the opening link is `bic-product-feedback-open`, and everything it
|
|
93
|
+
* reveals sits in `bic-product-feedback-panel`; the textarea, button and status line carry
|
|
94
|
+
* `bic-product-feedback-input`, `-send` and `-status`, so hosts and tests can find them without
|
|
95
|
+
* depending on the order of elements.
|
|
87
96
|
*/
|
|
88
97
|
export declare function mountProductFeedbackBox(container: HTMLElement, opts: ProductFeedbackBoxOptions): ProductFeedbackBox;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.56",
|
|
4
4
|
"description": "Run a BIC-generated D3 chart in any web host: compiles the generated render() function, applies the shared option defaults, resolves mark clicks (through tooltip overlays), owns the selection affordance, and translates row indices between cross-filtered charts. The same contract the BIC Power BI visual implements, minus Power BI. React bindings at @bicharts/chart-host/react.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|