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 +24 -14
- package/browser/dist.js.map +2 -2
- package/browser/dist.min.js +5 -5
- package/package.json +1 -1
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(
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
config.
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
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);
|