@sensiblestats/widget-react 0.157.0 → 0.158.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.158.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Every gateway call sends the visitor's IANA zone as `X-SS-Time-Zone` (the host's `timeZone` when set, else the browser's), so times and "today" the server writes follow the visitor instead of the operator's configured zone.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.115.0
13
+
3
14
  ## 0.157.0
4
15
 
5
16
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1422,7 +1422,7 @@ function parseCustomTotal(text2, format2) {
1422
1422
  }
1423
1423
 
1424
1424
  // src/version.generated.ts
1425
- var WIDGET_REACT_VERSION = "0.157.0";
1425
+ var WIDGET_REACT_VERSION = "0.158.0";
1426
1426
 
1427
1427
  // src/config.ts
1428
1428
  var COLOR_KEYS = ["accent", "cta", "surface", "ink"];
@@ -1832,6 +1832,8 @@ function toClientOptions(cfg) {
1832
1832
  const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, client: `${cfg.transport?.client ?? "widget-react"}/${WIDGET_REACT_VERSION}` };
1833
1833
  if (cfg.baseUrl !== void 0) opts.baseUrl = cfg.baseUrl;
1834
1834
  if (cfg.transport?.fetch !== void 0) opts.fetch = cfg.transport.fetch;
1835
+ const timeZone = validZone(cfg.timeZone);
1836
+ if (timeZone !== void 0) opts.timeZone = timeZone;
1835
1837
  return opts;
1836
1838
  }
1837
1839
  function toUserContext(cfg) {
@@ -22473,7 +22475,7 @@ function StatsWidget(props) {
22473
22475
  onUnavailableRef.current?.(reason);
22474
22476
  } catch {
22475
22477
  }
22476
- }), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl, cfg?.userContext?.operatorUserId, cfg?.userContext?.anonymousUserId]);
22478
+ }), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl, cfg?.userContext?.operatorUserId, cfg?.userContext?.anonymousUserId, cfg?.timeZone]);
22477
22479
  const trackingRef = (0, import_react124.useRef)({ envelope: { operatorId: "", widgetVersion: WIDGET_REACT_VERSION } });
22478
22480
  const track = (0, import_react124.useMemo)(() => createTracker(() => trackingRef.current), []);
22479
22481
  const eventTextRef = (0, import_react124.useRef)(false);