kenobi-js 0.1.34 → 0.1.36
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 +56 -49
- package/browser/dist.js.map +2 -2
- package/browser/dist.min.js +13 -5
- package/package.json +1 -1
package/browser/dist.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Kenobi SDK v0.1.
|
|
2
|
+
* Kenobi SDK v0.1.35
|
|
3
3
|
* (c) 2025 Kenobi.ai
|
|
4
4
|
*/
|
|
5
5
|
"use strict";
|
|
@@ -1097,7 +1097,7 @@ var KenobiLib = (() => {
|
|
|
1097
1097
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1098
1098
|
children: [
|
|
1099
1099
|
/* @__PURE__ */ u3("circle", { cx: "446", cy: "450", r: "424", fill: "black" }),
|
|
1100
|
-
/* @__PURE__ */ u3("circle", { cx: "450", cy: "450", r: "357", fill: "
|
|
1100
|
+
/* @__PURE__ */ u3("circle", { cx: "450", cy: "450", r: "357", fill: "#E8E8E8" }),
|
|
1101
1101
|
/* @__PURE__ */ u3(
|
|
1102
1102
|
"ellipse",
|
|
1103
1103
|
{
|
|
@@ -1108,22 +1108,7 @@ var KenobiLib = (() => {
|
|
|
1108
1108
|
transform: "rotate(-46.2324 579.85 294.451)",
|
|
1109
1109
|
fill: "black"
|
|
1110
1110
|
}
|
|
1111
|
-
)
|
|
1112
|
-
/* @__PURE__ */ u3("defs", { children: /* @__PURE__ */ u3(
|
|
1113
|
-
"linearGradient",
|
|
1114
|
-
{
|
|
1115
|
-
id: "paint0_linear_1_41",
|
|
1116
|
-
x1: "807",
|
|
1117
|
-
y1: "93",
|
|
1118
|
-
x2: "93",
|
|
1119
|
-
y2: "807",
|
|
1120
|
-
gradientUnits: "userSpaceOnUse",
|
|
1121
|
-
children: [
|
|
1122
|
-
/* @__PURE__ */ u3("stop", { "stop-color": "#FAFAFA" }),
|
|
1123
|
-
/* @__PURE__ */ u3("stop", { offset: "1", "stop-color": "#CACACA" })
|
|
1124
|
-
]
|
|
1125
|
-
}
|
|
1126
|
-
) })
|
|
1111
|
+
)
|
|
1127
1112
|
]
|
|
1128
1113
|
}
|
|
1129
1114
|
), "LogoIcon");
|
|
@@ -1196,6 +1181,14 @@ var KenobiLib = (() => {
|
|
|
1196
1181
|
/* Launcher dismiss button */
|
|
1197
1182
|
.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
1183
|
.launcher:hover .btn-dismiss.launcher-dismiss { opacity: 1; }
|
|
1184
|
+
/* Launcher logo */
|
|
1185
|
+
.launcher-logo { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
|
|
1186
|
+
.launcher-logo svg { width: 20px; height: 20px; }
|
|
1187
|
+
/* Mobile: hide keyboard hints, show dismiss button */
|
|
1188
|
+
@media (max-width: 768px) {
|
|
1189
|
+
.launcher .kbd-hint { display: none; }
|
|
1190
|
+
.launcher .btn-dismiss.launcher-dismiss { opacity: 1; }
|
|
1191
|
+
}
|
|
1199
1192
|
`;
|
|
1200
1193
|
var useEnterExitAnimation = /* @__PURE__ */ __name((ref, isVisible, config) => {
|
|
1201
1194
|
const hasEnteredRef = A2(false);
|
|
@@ -1283,6 +1276,7 @@ var KenobiLib = (() => {
|
|
|
1283
1276
|
const firstInputRef = A2(null);
|
|
1284
1277
|
const formRef = A2(null);
|
|
1285
1278
|
const [mode, setMode] = d2("card");
|
|
1279
|
+
const [isDismissed, setIsDismissed] = d2(false);
|
|
1286
1280
|
const hasEnteredRef = A2(false);
|
|
1287
1281
|
const hasHadSuccessRef = A2(false);
|
|
1288
1282
|
const isShowingInitialSuccessRef = A2(false);
|
|
@@ -1307,6 +1301,7 @@ var KenobiLib = (() => {
|
|
|
1307
1301
|
if (config.isVisible) {
|
|
1308
1302
|
setMode("card");
|
|
1309
1303
|
hasEnteredRef.current = false;
|
|
1304
|
+
setIsDismissed(false);
|
|
1310
1305
|
}
|
|
1311
1306
|
}, [config.isVisible]);
|
|
1312
1307
|
if (mode === "card" && previousModeRef.current === "launcher") {
|
|
@@ -1390,22 +1385,26 @@ var KenobiLib = (() => {
|
|
|
1390
1385
|
}
|
|
1391
1386
|
}, [isOpen, mode]);
|
|
1392
1387
|
if (!isInline) {
|
|
1393
|
-
useEnterExitAnimation(
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
config.
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1388
|
+
useEnterExitAnimation(
|
|
1389
|
+
containerRef,
|
|
1390
|
+
!!config.isVisible && mode === "card" && !isDismissed,
|
|
1391
|
+
{
|
|
1392
|
+
direction: config.direction || "top-to-bottom",
|
|
1393
|
+
position: config.position || "top-center",
|
|
1394
|
+
entranceDelayMs: hasEnteredRef.current ? 0 : config.entranceDelayMs || 0,
|
|
1395
|
+
exitDelayMs: 75,
|
|
1396
|
+
onEntranceComplete: /* @__PURE__ */ __name(() => {
|
|
1397
|
+
config.onEntranceComplete?.();
|
|
1398
|
+
hasEnteredRef.current = true;
|
|
1399
|
+
}, "onEntranceComplete"),
|
|
1400
|
+
onExitComplete: /* @__PURE__ */ __name(() => {
|
|
1401
|
+
if (!config.isVisible || isDismissed) config.onExitComplete?.();
|
|
1402
|
+
}, "onExitComplete")
|
|
1403
|
+
}
|
|
1404
|
+
);
|
|
1406
1405
|
useEnterExitAnimation(
|
|
1407
1406
|
launcherRef,
|
|
1408
|
-
!!config.isVisible && mode === "launcher",
|
|
1407
|
+
!!config.isVisible && mode === "launcher" && !isDismissed,
|
|
1409
1408
|
{
|
|
1410
1409
|
direction: config.direction || "top-to-bottom",
|
|
1411
1410
|
position: config.position || "top-center",
|
|
@@ -1674,14 +1673,27 @@ var KenobiLib = (() => {
|
|
|
1674
1673
|
}, []);
|
|
1675
1674
|
const clampedProgress = Math.max(0, Math.min(100, config.progressPct ?? 0));
|
|
1676
1675
|
const displayedProgress = timerEnabled ? timerProgress : clampedProgress;
|
|
1676
|
+
const isContainerVisible = !!config.isVisible && mode === "card" && !isDismissed;
|
|
1677
|
+
const isLauncherVisible = !!config.isVisible && mode === "launcher" && !isDismissed;
|
|
1678
|
+
const isAnythingVisible = isContainerVisible || isLauncherVisible;
|
|
1677
1679
|
return /* @__PURE__ */ u3(k, { children: [
|
|
1678
|
-
/* @__PURE__ */ u3(
|
|
1680
|
+
/* @__PURE__ */ u3(
|
|
1681
|
+
"div",
|
|
1682
|
+
{
|
|
1683
|
+
ref: backdropRef,
|
|
1684
|
+
class: "backdrop",
|
|
1685
|
+
style: { display: isAnythingVisible ? "block" : "none" }
|
|
1686
|
+
}
|
|
1687
|
+
),
|
|
1679
1688
|
/* @__PURE__ */ u3(
|
|
1680
1689
|
"div",
|
|
1681
1690
|
{
|
|
1682
1691
|
ref: containerRef,
|
|
1683
1692
|
class: `container theme-${config.theme || "glass"} pos-${config.position || "top-center"}`,
|
|
1684
|
-
style:
|
|
1693
|
+
style: {
|
|
1694
|
+
...getThemeStyles(config.customTheme),
|
|
1695
|
+
pointerEvents: isContainerVisible ? "auto" : "none"
|
|
1696
|
+
},
|
|
1685
1697
|
onClick: () => !isOpen && !isPending && !isSuccess && setIsOpen(true),
|
|
1686
1698
|
onMouseEnter: () => setIsHovering(true),
|
|
1687
1699
|
onMouseLeave: () => setIsHovering(false),
|
|
@@ -1823,9 +1835,13 @@ var KenobiLib = (() => {
|
|
|
1823
1835
|
{
|
|
1824
1836
|
ref: launcherRef,
|
|
1825
1837
|
class: `launcher theme-${config.theme || "glass"} pos-${config.position || "top-center"}`,
|
|
1826
|
-
style:
|
|
1838
|
+
style: {
|
|
1839
|
+
...getThemeStyles(config.customTheme),
|
|
1840
|
+
pointerEvents: isLauncherVisible ? "auto" : "none"
|
|
1841
|
+
},
|
|
1827
1842
|
onClick: (e3) => {
|
|
1828
1843
|
e3.stopPropagation();
|
|
1844
|
+
setIsDismissed(false);
|
|
1829
1845
|
setMode("card");
|
|
1830
1846
|
setIsOpen(true);
|
|
1831
1847
|
},
|
|
@@ -1839,25 +1855,13 @@ var KenobiLib = (() => {
|
|
|
1839
1855
|
"aria-label": "Dismiss",
|
|
1840
1856
|
onClick: (e3) => {
|
|
1841
1857
|
e3.stopPropagation();
|
|
1858
|
+
setIsDismissed(true);
|
|
1842
1859
|
config.onDismiss?.();
|
|
1843
1860
|
},
|
|
1844
1861
|
children: /* @__PURE__ */ u3(XMarkIcon, {})
|
|
1845
1862
|
}
|
|
1846
1863
|
),
|
|
1847
|
-
/* @__PURE__ */ u3(
|
|
1848
|
-
"div",
|
|
1849
|
-
{
|
|
1850
|
-
style: {
|
|
1851
|
-
display: "flex",
|
|
1852
|
-
width: "20px",
|
|
1853
|
-
height: "20px",
|
|
1854
|
-
overflow: "hidden",
|
|
1855
|
-
alignItems: "center",
|
|
1856
|
-
justifyContent: "center"
|
|
1857
|
-
},
|
|
1858
|
-
children: /* @__PURE__ */ u3("div", { style: { transform: "scale(0.6)" }, children: /* @__PURE__ */ u3(LogoIcon, {}) })
|
|
1859
|
-
}
|
|
1860
|
-
),
|
|
1864
|
+
/* @__PURE__ */ u3("div", { class: "launcher-logo", children: /* @__PURE__ */ u3(LogoIcon, {}) }),
|
|
1861
1865
|
config.textOverrides?.launcherLabel || (hasHadSuccessRef.current ? "Personalize again" : "Personalize"),
|
|
1862
1866
|
config.showKeyboardHints && /* @__PURE__ */ u3("div", { class: "kbd-hint visible", children: /* @__PURE__ */ u3("div", { class: "kbd-group", children: shortcutDisplay.map((k3, i3) => /* @__PURE__ */ u3("div", { class: "kbd", children: k3 }, i3)) }) })
|
|
1863
1867
|
]
|
|
@@ -3062,6 +3066,9 @@ var KenobiLib = (() => {
|
|
|
3062
3066
|
showWatermark: false,
|
|
3063
3067
|
showKeyboardHints: true,
|
|
3064
3068
|
enableLauncher: true,
|
|
3069
|
+
onDismiss: /* @__PURE__ */ __name(() => {
|
|
3070
|
+
this.log("debug", "CueCard dismissed by user");
|
|
3071
|
+
}, "onDismiss"),
|
|
3065
3072
|
onSubmitPersonalization: /* @__PURE__ */ __name((values) => {
|
|
3066
3073
|
this.log("debug", "CueCard submitted:", values);
|
|
3067
3074
|
void this.personalize(values);
|