@wireai/activation 0.14.3 → 0.15.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/AGENTS.md +1 -1
- package/CHANGELOG.md +73 -0
- package/README.md +11 -7
- package/dist/analytics/index.d.mts +5 -5
- package/dist/analytics/index.d.ts +5 -5
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.d.mts +1 -1
- package/dist/coachmarks/index.d.ts +1 -1
- package/dist/coachmarks/index.js +47 -2
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs +47 -2
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/{currentSession-CW_5Mq4O.d.ts → currentSession-CFSRZ2wg.d.ts} +10 -4
- package/dist/{currentSession-CUvTOchb.d.mts → currentSession-orZy5p1e.d.mts} +10 -4
- package/dist/{decision-Bgo17oH7.d.mts → decision-3vWLuBlO.d.ts} +11 -2
- package/dist/{decision-Bkh_LigV.d.ts → decision-yBj2AyPW.d.mts} +11 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.d.mts +3 -3
- package/dist/questionnaire/index.d.ts +3 -3
- package/dist/questionnaire/index.js +48 -3
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +48 -3
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.d.mts +10 -6
- package/dist/reviews/index.d.ts +10 -6
- package/dist/reviews/index.js +167 -18
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +167 -18
- package/dist/reviews/index.mjs.map +1 -1
- package/dist/showcase/index.d.mts +1 -1
- package/dist/showcase/index.d.ts +1 -1
- package/dist/showcase/index.js +47 -2
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/index.mjs +47 -2
- package/dist/showcase/index.mjs.map +1 -1
- package/dist/{transport-j5gFfJhK.d.mts → transport-s5QxA-ci.d.mts} +18 -13
- package/dist/{transport-B_0SgCBe.d.ts → transport-xqqSFqxs.d.ts} +18 -13
- package/dist/{types-Cju-1_jT.d.mts → types-Byx306Kv.d.mts} +25 -10
- package/dist/{types-BcmagF6K.d.mts → types-D_0B0yay.d.mts} +7 -2
- package/dist/{types-BcmagF6K.d.ts → types-D_0B0yay.d.ts} +7 -2
- package/dist/{types-h2BZvl1t.d.ts → types-tdATL5z0.d.ts} +25 -10
- package/package.json +1 -1
- package/src/WireOnboarding.tsx +4 -1
- package/src/coachmarks/runtime.ts +103 -2
- package/src/coachmarks/types.ts +7 -2
- package/src/context/deviceId.ts +32 -0
- package/src/reviews/ReviewGate.tsx +86 -37
- package/src/reviews/decision.ts +11 -1
- package/src/reviews/idempotency.ts +71 -0
- package/src/reviews/index.ts +4 -2
- package/src/reviews/runtime.ts +5 -3
- package/src/reviews/transport.ts +17 -12
- package/src/reviews/types.ts +7 -0
- package/src/types.ts +10 -4
- package/src/utils/submitResult.ts +17 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { ImageSourcePropType } from 'react-native';
|
|
3
|
-
import { G as GestureKind, C as CoachmarkStorage } from '../types-
|
|
3
|
+
import { G as GestureKind, C as CoachmarkStorage } from '../types-D_0B0yay.mjs';
|
|
4
4
|
import { O as OnboardingTheme } from '../types-BKfpdZzX.mjs';
|
|
5
5
|
import { a as WireFeatures, b as WireFeaturesConfig } from '../types-BpwiRpA8.mjs';
|
|
6
6
|
|
package/dist/showcase/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { ImageSourcePropType } from 'react-native';
|
|
3
|
-
import { G as GestureKind, C as CoachmarkStorage } from '../types-
|
|
3
|
+
import { G as GestureKind, C as CoachmarkStorage } from '../types-D_0B0yay.js';
|
|
4
4
|
import { O as OnboardingTheme } from '../types-BKfpdZzX.js';
|
|
5
5
|
import { a as WireFeatures, b as WireFeaturesConfig } from '../types-BpwiRpA8.js';
|
|
6
6
|
|
package/dist/showcase/index.js
CHANGED
|
@@ -389,9 +389,54 @@ var getCoachmarkStorage = () => coachmarkRuntime().storage;
|
|
|
389
389
|
var isCoachmarkTesting = () => coachmarkRuntime().testing;
|
|
390
390
|
var showcaseGateKey = (showcaseId) => `wire_showcase_${showcaseId}_seen`;
|
|
391
391
|
var SEEN_VALUE = "1";
|
|
392
|
+
var GATE_PROBE_KEY = "wire_gate_probe";
|
|
393
|
+
var ASYNC_GATE_STORAGE_WARNED_SLOT = /* @__PURE__ */ Symbol.for(
|
|
394
|
+
"@wireai/activation:asyncGateStorageWarned"
|
|
395
|
+
);
|
|
396
|
+
var asyncGateWarnGlobal = globalThis;
|
|
397
|
+
var closedGateStorage = Object.freeze({
|
|
398
|
+
getItem: () => SEEN_VALUE,
|
|
399
|
+
setItem: () => {
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
var syncGateAdapters = /* @__PURE__ */ new WeakSet();
|
|
403
|
+
var asyncGateAdapters = /* @__PURE__ */ new WeakSet();
|
|
404
|
+
var warnAsyncGateStorage = () => {
|
|
405
|
+
if (asyncGateWarnGlobal[ASYNC_GATE_STORAGE_WARNED_SLOT]) return;
|
|
406
|
+
if (typeof __DEV__ === "undefined" || !__DEV__) return;
|
|
407
|
+
if (typeof console === "undefined" || !console.warn) return;
|
|
408
|
+
asyncGateWarnGlobal[ASYNC_GATE_STORAGE_WARNED_SLOT] = true;
|
|
409
|
+
console.warn(
|
|
410
|
+
"[wireai] the gate storage's getItem returned a Promise \u2014 an async adapter (e.g. AsyncStorage) cannot drive the once-per-user gates, so coachmark tours, showcases and the review/questionnaire gates are all DISABLED (fail closed: nothing shows, nothing fires) until a synchronous adapter is provided. Pass a sync adapter (e.g. MMKV: `{ getItem: (k) => mmkv.getString(k) ?? null, setItem: (k, v) => mmkv.set(k, v) }`) to CoachmarkProvider or the gate's `storage` prop."
|
|
411
|
+
);
|
|
412
|
+
};
|
|
413
|
+
var validateGateStorage = (storage) => {
|
|
414
|
+
if (!storage) return null;
|
|
415
|
+
if (syncGateAdapters.has(storage)) return storage;
|
|
416
|
+
if (asyncGateAdapters.has(storage)) return closedGateStorage;
|
|
417
|
+
let probed;
|
|
418
|
+
try {
|
|
419
|
+
probed = storage.getItem(GATE_PROBE_KEY);
|
|
420
|
+
} catch {
|
|
421
|
+
syncGateAdapters.add(storage);
|
|
422
|
+
return storage;
|
|
423
|
+
}
|
|
424
|
+
if (probed != null && typeof probed.then === "function") {
|
|
425
|
+
asyncGateAdapters.add(storage);
|
|
426
|
+
try {
|
|
427
|
+
probed.then(void 0, () => {
|
|
428
|
+
});
|
|
429
|
+
} catch {
|
|
430
|
+
}
|
|
431
|
+
warnAsyncGateStorage();
|
|
432
|
+
return closedGateStorage;
|
|
433
|
+
}
|
|
434
|
+
syncGateAdapters.add(storage);
|
|
435
|
+
return storage;
|
|
436
|
+
};
|
|
392
437
|
var hasSeenGate = (key, storageOverride, testingOverride) => {
|
|
393
438
|
if (testingOverride != null ? testingOverride : isCoachmarkTesting()) return false;
|
|
394
|
-
const storage = storageOverride != null ? storageOverride : getCoachmarkStorage();
|
|
439
|
+
const storage = validateGateStorage(storageOverride != null ? storageOverride : getCoachmarkStorage());
|
|
395
440
|
if (!storage) return false;
|
|
396
441
|
try {
|
|
397
442
|
return storage.getItem(key) === SEEN_VALUE;
|
|
@@ -401,7 +446,7 @@ var hasSeenGate = (key, storageOverride, testingOverride) => {
|
|
|
401
446
|
};
|
|
402
447
|
var markSeenGate = (key, storageOverride, testingOverride) => {
|
|
403
448
|
if (testingOverride != null ? testingOverride : isCoachmarkTesting()) return;
|
|
404
|
-
const storage = storageOverride != null ? storageOverride : getCoachmarkStorage();
|
|
449
|
+
const storage = validateGateStorage(storageOverride != null ? storageOverride : getCoachmarkStorage());
|
|
405
450
|
if (!storage) return;
|
|
406
451
|
try {
|
|
407
452
|
storage.setItem(key, SEEN_VALUE);
|