kenobi-js 0.1.34 → 0.1.35

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/browser/dist.js CHANGED
@@ -1283,6 +1283,7 @@ var KenobiLib = (() => {
1283
1283
  const firstInputRef = A2(null);
1284
1284
  const formRef = A2(null);
1285
1285
  const [mode, setMode] = d2("card");
1286
+ const [isDismissed, setIsDismissed] = d2(false);
1286
1287
  const hasEnteredRef = A2(false);
1287
1288
  const hasHadSuccessRef = A2(false);
1288
1289
  const isShowingInitialSuccessRef = A2(false);
@@ -1307,6 +1308,7 @@ var KenobiLib = (() => {
1307
1308
  if (config.isVisible) {
1308
1309
  setMode("card");
1309
1310
  hasEnteredRef.current = false;
1311
+ setIsDismissed(false);
1310
1312
  }
1311
1313
  }, [config.isVisible]);
1312
1314
  if (mode === "card" && previousModeRef.current === "launcher") {
@@ -1390,22 +1392,26 @@ var KenobiLib = (() => {
1390
1392
  }
1391
1393
  }, [isOpen, mode]);
1392
1394
  if (!isInline) {
1393
- useEnterExitAnimation(containerRef, !!config.isVisible && mode === "card", {
1394
- direction: config.direction || "top-to-bottom",
1395
- position: config.position || "top-center",
1396
- entranceDelayMs: hasEnteredRef.current ? 0 : config.entranceDelayMs || 0,
1397
- exitDelayMs: 75,
1398
- onEntranceComplete: /* @__PURE__ */ __name(() => {
1399
- config.onEntranceComplete?.();
1400
- hasEnteredRef.current = true;
1401
- }, "onEntranceComplete"),
1402
- onExitComplete: /* @__PURE__ */ __name(() => {
1403
- if (!config.isVisible) config.onExitComplete?.();
1404
- }, "onExitComplete")
1405
- });
1395
+ useEnterExitAnimation(
1396
+ containerRef,
1397
+ !!config.isVisible && mode === "card" && !isDismissed,
1398
+ {
1399
+ direction: config.direction || "top-to-bottom",
1400
+ position: config.position || "top-center",
1401
+ entranceDelayMs: hasEnteredRef.current ? 0 : config.entranceDelayMs || 0,
1402
+ exitDelayMs: 75,
1403
+ onEntranceComplete: /* @__PURE__ */ __name(() => {
1404
+ config.onEntranceComplete?.();
1405
+ hasEnteredRef.current = true;
1406
+ }, "onEntranceComplete"),
1407
+ onExitComplete: /* @__PURE__ */ __name(() => {
1408
+ if (!config.isVisible || isDismissed) config.onExitComplete?.();
1409
+ }, "onExitComplete")
1410
+ }
1411
+ );
1406
1412
  useEnterExitAnimation(
1407
1413
  launcherRef,
1408
- !!config.isVisible && mode === "launcher",
1414
+ !!config.isVisible && mode === "launcher" && !isDismissed,
1409
1415
  {
1410
1416
  direction: config.direction || "top-to-bottom",
1411
1417
  position: config.position || "top-center",
@@ -1839,6 +1845,7 @@ var KenobiLib = (() => {
1839
1845
  "aria-label": "Dismiss",
1840
1846
  onClick: (e3) => {
1841
1847
  e3.stopPropagation();
1848
+ setIsDismissed(true);
1842
1849
  config.onDismiss?.();
1843
1850
  },
1844
1851
  children: /* @__PURE__ */ u3(XMarkIcon, {})
@@ -3062,6 +3069,9 @@ var KenobiLib = (() => {
3062
3069
  showWatermark: false,
3063
3070
  showKeyboardHints: true,
3064
3071
  enableLauncher: true,
3072
+ onDismiss: /* @__PURE__ */ __name(() => {
3073
+ this.log("debug", "CueCard dismissed by user");
3074
+ }, "onDismiss"),
3065
3075
  onSubmitPersonalization: /* @__PURE__ */ __name((values) => {
3066
3076
  this.log("debug", "CueCard submitted:", values);
3067
3077
  void this.personalize(values);