kenobi-js 0.1.33 → 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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Kenobi SDK v0.1.32
2
+ * Kenobi SDK v0.1.33
3
3
  * (c) 2025 Kenobi.ai
4
4
  */
5
5
  "use strict";
@@ -1193,6 +1193,9 @@ var KenobiLib = (() => {
1193
1193
  .launcher .kbd-hint { position: static; transform: none; opacity: 0.6; transition: opacity 0.2s; }
1194
1194
  .launcher:hover .kbd-hint { opacity: 1; }
1195
1195
  .pos-top-right.launcher .kbd-hint { left: auto; right: auto; }
1196
+ /* Launcher dismiss button */
1197
+ .launcher .btn-dismiss.launcher-dismiss { top: -0.375rem; left: -0.375rem; width: 1.25rem; height: 1.25rem; opacity: 0; transition: opacity 0.2s ease-out, background-color 0.3s ease-out, color 0.3s ease-out; }
1198
+ .launcher:hover .btn-dismiss.launcher-dismiss { opacity: 1; }
1196
1199
  `;
1197
1200
  var useEnterExitAnimation = /* @__PURE__ */ __name((ref, isVisible, config) => {
1198
1201
  const hasEnteredRef = A2(false);
@@ -1280,6 +1283,7 @@ var KenobiLib = (() => {
1280
1283
  const firstInputRef = A2(null);
1281
1284
  const formRef = A2(null);
1282
1285
  const [mode, setMode] = d2("card");
1286
+ const [isDismissed, setIsDismissed] = d2(false);
1283
1287
  const hasEnteredRef = A2(false);
1284
1288
  const hasHadSuccessRef = A2(false);
1285
1289
  const isShowingInitialSuccessRef = A2(false);
@@ -1304,6 +1308,7 @@ var KenobiLib = (() => {
1304
1308
  if (config.isVisible) {
1305
1309
  setMode("card");
1306
1310
  hasEnteredRef.current = false;
1311
+ setIsDismissed(false);
1307
1312
  }
1308
1313
  }, [config.isVisible]);
1309
1314
  if (mode === "card" && previousModeRef.current === "launcher") {
@@ -1387,22 +1392,26 @@ var KenobiLib = (() => {
1387
1392
  }
1388
1393
  }, [isOpen, mode]);
1389
1394
  if (!isInline) {
1390
- useEnterExitAnimation(containerRef, !!config.isVisible && mode === "card", {
1391
- direction: config.direction || "top-to-bottom",
1392
- position: config.position || "top-center",
1393
- entranceDelayMs: hasEnteredRef.current ? 0 : config.entranceDelayMs || 0,
1394
- exitDelayMs: 75,
1395
- onEntranceComplete: /* @__PURE__ */ __name(() => {
1396
- config.onEntranceComplete?.();
1397
- hasEnteredRef.current = true;
1398
- }, "onEntranceComplete"),
1399
- onExitComplete: /* @__PURE__ */ __name(() => {
1400
- if (!config.isVisible) config.onExitComplete?.();
1401
- }, "onExitComplete")
1402
- });
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
+ );
1403
1412
  useEnterExitAnimation(
1404
1413
  launcherRef,
1405
- !!config.isVisible && mode === "launcher",
1414
+ !!config.isVisible && mode === "launcher" && !isDismissed,
1406
1415
  {
1407
1416
  direction: config.direction || "top-to-bottom",
1408
1417
  position: config.position || "top-center",
@@ -1816,7 +1825,7 @@ var KenobiLib = (() => {
1816
1825
  }
1817
1826
  ),
1818
1827
  /* @__PURE__ */ u3(
1819
- "button",
1828
+ "div",
1820
1829
  {
1821
1830
  ref: launcherRef,
1822
1831
  class: `launcher theme-${config.theme || "glass"} pos-${config.position || "top-center"}`,
@@ -1826,7 +1835,22 @@ var KenobiLib = (() => {
1826
1835
  setMode("card");
1827
1836
  setIsOpen(true);
1828
1837
  },
1838
+ role: "button",
1839
+ tabIndex: 0,
1829
1840
  children: [
1841
+ /* @__PURE__ */ u3(
1842
+ "button",
1843
+ {
1844
+ class: "btn-dismiss launcher-dismiss",
1845
+ "aria-label": "Dismiss",
1846
+ onClick: (e3) => {
1847
+ e3.stopPropagation();
1848
+ setIsDismissed(true);
1849
+ config.onDismiss?.();
1850
+ },
1851
+ children: /* @__PURE__ */ u3(XMarkIcon, {})
1852
+ }
1853
+ ),
1830
1854
  /* @__PURE__ */ u3(
1831
1855
  "div",
1832
1856
  {
@@ -3040,13 +3064,14 @@ var KenobiLib = (() => {
3040
3064
  errorMessage: "Company name or domain is required"
3041
3065
  }
3042
3066
  ],
3043
- hasPersonalization: true,
3044
3067
  isVisible: true,
3045
- enableFocusMode: true,
3068
+ enableFocusMode: false,
3069
+ showWatermark: false,
3046
3070
  showKeyboardHints: true,
3047
- focusBlurIntensity: "8px",
3048
- focusDelayMs: 2e3,
3049
3071
  enableLauncher: true,
3072
+ onDismiss: /* @__PURE__ */ __name(() => {
3073
+ this.log("debug", "CueCard dismissed by user");
3074
+ }, "onDismiss"),
3050
3075
  onSubmitPersonalization: /* @__PURE__ */ __name((values) => {
3051
3076
  this.log("debug", "CueCard submitted:", values);
3052
3077
  void this.personalize(values);