@allstak/react-native 0.4.0 → 0.4.1

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
@@ -5,6 +5,21 @@ All notable changes to `@allstak/react-native` are documented in this file.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.1] — 2026-05-18
9
+
10
+ ### Fixed
11
+
12
+ - Masking primitives (`AllStakMaskedView`, `AllStakPrivacyView`,
13
+ `AllStakTextInput`, `AllStakSensitiveText`) now resolve the
14
+ `react-native` module reference lazily at render time instead of
15
+ at module-load time. Caught during simulator cert: Metro bundles
16
+ `react-native` separately from the SDK, so a top-of-file
17
+ `require('react-native')` could resolve to a stale stub and cause
18
+ `View config getter callback for component TextInput must be a function`
19
+ red-screens in dev. Render-time resolution fixes this on every
20
+ Metro reload.
21
+ - Provider's root-view wrapper uses the same lazy resolution.
22
+
8
23
  ## [0.4.0] — 2026-05-18
9
24
 
10
25
  ### Added
package/dist/index.d.mts CHANGED
@@ -560,7 +560,7 @@ declare function pickScreenshotConfig(source: Record<string, unknown>): Partial<
560
560
 
561
561
  declare const INGEST_HOST = "https://api.allstak.sa";
562
562
  declare const SDK_NAME = "allstak-react-native";
563
- declare const SDK_VERSION = "0.4.0";
563
+ declare const SDK_VERSION = "0.4.1";
564
564
 
565
565
  interface AllStakConfig {
566
566
  /** Project API key (`ask_live_…`). Required. */
package/dist/index.d.ts CHANGED
@@ -560,7 +560,7 @@ declare function pickScreenshotConfig(source: Record<string, unknown>): Partial<
560
560
 
561
561
  declare const INGEST_HOST = "https://api.allstak.sa";
562
562
  declare const SDK_NAME = "allstak-react-native";
563
- declare const SDK_VERSION = "0.4.0";
563
+ declare const SDK_VERSION = "0.4.1";
564
564
 
565
565
  interface AllStakConfig {
566
566
  /** Project API key (`ask_live_…`). Required. */
package/dist/index.js CHANGED
@@ -1559,7 +1559,9 @@ function tryRequire(id2) {
1559
1559
 
1560
1560
  // src/privacy.tsx
1561
1561
  var React = __toESM(require("react"));
1562
- var RN = tryRequire("react-native");
1562
+ function getRN() {
1563
+ return tryRequire("react-native");
1564
+ }
1563
1565
  var state = {
1564
1566
  isCapturing: false,
1565
1567
  sensitiveRefs: /* @__PURE__ */ new Set()
@@ -1607,9 +1609,18 @@ function useAllStakPrivacy() {
1607
1609
  const isCapturing = useIsCapturing();
1608
1610
  return { isCapturing, registerSensitiveRef };
1609
1611
  }
1610
- var View = RN?.View ?? ((props) => React.createElement("View", props));
1611
- var Text = RN?.Text ?? ((props) => React.createElement("Text", props));
1612
- var TextInput = RN?.TextInput ?? ((props) => React.createElement("TextInput", props));
1612
+ function getView() {
1613
+ const RN = getRN();
1614
+ return RN?.View ?? ((props) => React.createElement(React.Fragment, null, props.children));
1615
+ }
1616
+ function getText() {
1617
+ const RN = getRN();
1618
+ return RN?.Text ?? ((props) => React.createElement(React.Fragment, null, props.children));
1619
+ }
1620
+ function getTextInput() {
1621
+ const RN = getRN();
1622
+ return RN?.TextInput ?? ((props) => React.createElement(React.Fragment, null, null));
1623
+ }
1613
1624
  var DEFAULT_MASK_COLOR = "#d8dde7";
1614
1625
  var DEFAULT_MASK_LABEL = "\u2022\u2022\u2022\u2022\u2022\u2022";
1615
1626
  function AllStakMaskedView({
@@ -1622,6 +1633,8 @@ function AllStakMaskedView({
1622
1633
  ...rest
1623
1634
  }) {
1624
1635
  const isCapturing = useIsCapturing();
1636
+ const View = getView();
1637
+ const Text = getText();
1625
1638
  if (!isCapturing || privacy === "show") {
1626
1639
  return React.createElement(View, { style, ...rest }, children);
1627
1640
  }
@@ -1644,6 +1657,8 @@ function AllStakTextInput({
1644
1657
  ...rest
1645
1658
  }) {
1646
1659
  const isCapturing = useIsCapturing();
1660
+ const View = getView();
1661
+ const TextInput = getTextInput();
1647
1662
  if (isCapturing && privacy !== "show") {
1648
1663
  return React.createElement(View, {
1649
1664
  style: [{ minHeight: 40, backgroundColor: maskColor, borderRadius: 4 }, style]
@@ -1659,6 +1674,7 @@ function AllStakSensitiveText({
1659
1674
  ...rest
1660
1675
  }) {
1661
1676
  const isCapturing = useIsCapturing();
1677
+ const Text = getText();
1662
1678
  if (isCapturing && privacy !== "show") {
1663
1679
  return React.createElement(Text, { style, ...rest }, maskLabel);
1664
1680
  }
@@ -1760,8 +1776,8 @@ function estimateBase64Size(base64) {
1760
1776
  }
1761
1777
  function readDimensions() {
1762
1778
  try {
1763
- const RN3 = tryRequire("react-native");
1764
- const dims = RN3?.Dimensions?.get?.("window");
1779
+ const RN = tryRequire("react-native");
1780
+ const dims = RN?.Dimensions?.get?.("window");
1765
1781
  if (dims && typeof dims.width === "number" && typeof dims.height === "number") {
1766
1782
  return { width: Math.round(dims.width), height: Math.round(dims.height) };
1767
1783
  }
@@ -1847,7 +1863,7 @@ function pickScreenshotConfig(source) {
1847
1863
  // src/client.ts
1848
1864
  var INGEST_HOST = "https://api.allstak.sa";
1849
1865
  var SDK_NAME = "allstak-react-native";
1850
- var SDK_VERSION = "0.4.0";
1866
+ var SDK_VERSION = "0.4.1";
1851
1867
  var ERRORS_PATH = "/ingest/v1/errors";
1852
1868
  var LOGS_PATH = "/ingest/v1/logs";
1853
1869
  var VALID_BREADCRUMB_TYPES = /* @__PURE__ */ new Set(["http", "log", "ui", "navigation", "query", "default"]);
@@ -3142,8 +3158,13 @@ function installReactNative(options = {}) {
3142
3158
  }
3143
3159
 
3144
3160
  // src/provider.tsx
3145
- var RN2 = tryRequire("react-native");
3146
- var RootView = RN2?.View ?? ((props) => React2.createElement("View", props));
3161
+ function getRN2() {
3162
+ return tryRequire("react-native");
3163
+ }
3164
+ function getRootView() {
3165
+ const RN = getRN2();
3166
+ return RN?.View;
3167
+ }
3147
3168
  var AllStakContext = React2.createContext(null);
3148
3169
  var __providerOwnedInstance = null;
3149
3170
  var AllStakErrorBoundary = class extends React2.Component {
@@ -3308,7 +3329,8 @@ function AllStakProvider({
3308
3329
  };
3309
3330
  }, [destroyOnUnmount, debug]);
3310
3331
  const boundary = /* @__PURE__ */ React2.createElement(AllStakErrorBoundary, { fallback, onError, debug }, children);
3311
- const wrapped = RN2 ? React2.createElement(
3332
+ const RootView = getRootView();
3333
+ const wrapped = RootView ? React2.createElement(
3312
3334
  RootView,
3313
3335
  { ref: rootRef, style: { flex: 1 }, collapsable: false },
3314
3336
  boundary