@bicharts/chart-host 0.6.96 → 0.6.97

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/README.md CHANGED
@@ -279,6 +279,9 @@ dim), never read as a percentage, and anything else is ignored. The host writes
279
279
  `--lch-dim-opacity` on its own container and, when the option goes away or the host is destroyed,
280
280
  puts back the value your page had set inline there, so with the option absent nothing is written
281
281
  and the CSS above decides: the stylesheet's `0.25`, or whatever your page sets on the variable.
282
+ A value your page sets inline while the host holds the variable is the one that comes back (or,
283
+ set since the host's last write, is left where it is); the same number with the same priority as
284
+ the host's own write cannot be told apart from it.
282
285
 
283
286
  ```js
284
287
  createChartHost(el, { code, data, options: { dimOpacity: 0.15 } });
package/dist/card.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /*! @bicharts/chart-host — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; Natural Earth and US Census/TIGER (public domain). Full text: NOTICE in this package. */
2
2
  import {
3
3
  computeSelectionCard
4
- } from "./chunk-CJ4IG6G5.mjs";
5
- import "./chunk-NQFJHNMC.mjs";
4
+ } from "./chunk-P6VCB6SF.mjs";
5
+ import "./chunk-KFU44UEN.mjs";
6
6
  import "./chunk-GHODWOAL.mjs";
7
7
 
8
8
  // src/selectionCardChrome.ts
@@ -231,6 +231,31 @@ function readStored(options, container) {
231
231
  const bag = container.__lchKnobs;
232
232
  return isObject(bag) ? bag[LASSO_KNOB_KEY] : void 0;
233
233
  }
234
+ var LASSO_PARKED_FOR = "__lchLassoFor";
235
+ function claimParkedLasso(container, chartKey, sessionState) {
236
+ const holder = container;
237
+ if (!holder) return false;
238
+ let dropped = false;
239
+ try {
240
+ if (holder[LASSO_PARKED_FOR] !== chartKey) {
241
+ const bag = holder.__lchKnobs;
242
+ if (isObject(bag) && bag[LASSO_KNOB_KEY] !== void 0) {
243
+ delete bag[LASSO_KNOB_KEY];
244
+ dropped = true;
245
+ }
246
+ const knobs = isObject(sessionState) ? sessionState.knobs : void 0;
247
+ if (isObject(knobs) && knobs[LASSO_KNOB_KEY] !== void 0) {
248
+ const rest = { ...knobs };
249
+ delete rest[LASSO_KNOB_KEY];
250
+ sessionState.knobs = rest;
251
+ dropped = true;
252
+ }
253
+ }
254
+ holder[LASSO_PARKED_FOR] = chartKey;
255
+ } catch {
256
+ }
257
+ return dropped;
258
+ }
234
259
  function writeStored(container, options, value) {
235
260
  const holder = container;
236
261
  if (!isObject(holder.__lchKnobs)) holder.__lchKnobs = {};
@@ -666,6 +691,7 @@ export {
666
691
  lassoVerdict,
667
692
  pointInShape,
668
693
  registerLassoAction,
694
+ claimParkedLasso,
669
695
  installLasso,
670
696
  clearLasso
671
697
  };