@guidekit/vanilla 0.1.0-beta.2 → 0.1.0-beta.3
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/dist/index.global.js +12 -12
- package/dist/index.global.js.map +1 -1
- package/package.json +2 -2
package/dist/index.global.js
CHANGED
|
@@ -2298,8 +2298,8 @@ var GuideKit = (() => {
|
|
|
2298
2298
|
const feeds = {
|
|
2299
2299
|
input: inputTensor,
|
|
2300
2300
|
sr: srTensor,
|
|
2301
|
-
|
|
2302
|
-
|
|
2301
|
+
h0: this._h,
|
|
2302
|
+
c0: this._c
|
|
2303
2303
|
};
|
|
2304
2304
|
const results = await this._session.run(feeds);
|
|
2305
2305
|
this._h = results["hn"];
|
|
@@ -3730,7 +3730,7 @@ var GuideKit = (() => {
|
|
|
3730
3730
|
const style = window.getComputedStyle(el);
|
|
3731
3731
|
const position = style.position;
|
|
3732
3732
|
const zIndex = parseInt(style.zIndex, 10) || 0;
|
|
3733
|
-
if ((position === "fixed" || position === "absolute") && !isNaN(zIndex) && zIndex >= 1e3) {
|
|
3733
|
+
if ((position === "fixed" || position === "absolute") && !Number.isNaN(zIndex) && zIndex >= 1e3) {
|
|
3734
3734
|
const visible = isElementVisible(el);
|
|
3735
3735
|
if (!visible) return;
|
|
3736
3736
|
const overlayType = this.classifyOverlay(el, style);
|
|
@@ -3758,10 +3758,10 @@ var GuideKit = (() => {
|
|
|
3758
3758
|
return "dropdown";
|
|
3759
3759
|
const width = parseFloat(style.width);
|
|
3760
3760
|
const height = parseFloat(style.height);
|
|
3761
|
-
if (typeof window !== "undefined" && !isNaN(width) && !isNaN(height) && width > window.innerWidth * 0.5 && height > window.innerHeight * 0.5) {
|
|
3761
|
+
if (typeof window !== "undefined" && !Number.isNaN(width) && !Number.isNaN(height) && width > window.innerWidth * 0.5 && height > window.innerHeight * 0.5) {
|
|
3762
3762
|
return "modal";
|
|
3763
3763
|
}
|
|
3764
|
-
if (!isNaN(width) && width < 400) return "popover";
|
|
3764
|
+
if (!Number.isNaN(width) && width < 400) return "popover";
|
|
3765
3765
|
return null;
|
|
3766
3766
|
}
|
|
3767
3767
|
// -------------------------------------------------------------------------
|
|
@@ -4464,7 +4464,7 @@ ${recapLines.join("\n")}`,
|
|
|
4464
4464
|
}
|
|
4465
4465
|
};
|
|
4466
4466
|
var DEFAULT_GEMINI_MODEL = "gemini-2.5-flash";
|
|
4467
|
-
var
|
|
4467
|
+
var DEFAULT_TIMEOUT_MS = 15e3;
|
|
4468
4468
|
var GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/models";
|
|
4469
4469
|
var DEFAULT_SAFETY_SETTINGS = [
|
|
4470
4470
|
{ category: "HARM_CATEGORY_HARASSMENT", threshold: "BLOCK_ONLY_HIGH" },
|
|
@@ -4472,7 +4472,7 @@ ${recapLines.join("\n")}`,
|
|
|
4472
4472
|
{ category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", threshold: "BLOCK_ONLY_HIGH" },
|
|
4473
4473
|
{ category: "HARM_CATEGORY_DANGEROUS_CONTENT", threshold: "BLOCK_ONLY_HIGH" }
|
|
4474
4474
|
];
|
|
4475
|
-
function
|
|
4475
|
+
function emptyUsage() {
|
|
4476
4476
|
return { prompt: 0, completion: 0, total: 0 };
|
|
4477
4477
|
}
|
|
4478
4478
|
var GeminiAdapter = class {
|
|
@@ -4483,7 +4483,7 @@ ${recapLines.join("\n")}`,
|
|
|
4483
4483
|
* Updated as each SSE chunk is parsed; the final value reflects the
|
|
4484
4484
|
* cumulative usage metadata sent by Gemini (typically in the last chunk).
|
|
4485
4485
|
*/
|
|
4486
|
-
_lastUsage =
|
|
4486
|
+
_lastUsage = emptyUsage();
|
|
4487
4487
|
constructor(config) {
|
|
4488
4488
|
this.apiKey = config.apiKey;
|
|
4489
4489
|
this.model = config.model ?? DEFAULT_GEMINI_MODEL;
|
|
@@ -4541,7 +4541,7 @@ ${recapLines.join("\n")}`,
|
|
|
4541
4541
|
const reader = stream.getReader();
|
|
4542
4542
|
const decoder = new TextDecoder();
|
|
4543
4543
|
let buffer = "";
|
|
4544
|
-
this._lastUsage =
|
|
4544
|
+
this._lastUsage = emptyUsage();
|
|
4545
4545
|
try {
|
|
4546
4546
|
while (true) {
|
|
4547
4547
|
const { done, value } = await reader.read();
|
|
@@ -4650,7 +4650,7 @@ ${recapLines.join("\n")}`,
|
|
|
4650
4650
|
if (params.tools) {
|
|
4651
4651
|
body.tools = params.tools;
|
|
4652
4652
|
}
|
|
4653
|
-
const timeoutMs = params.timeoutMs ??
|
|
4653
|
+
const timeoutMs = params.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
4654
4654
|
const controller = new AbortController();
|
|
4655
4655
|
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
4656
4656
|
if (params.signal) {
|
|
@@ -4925,7 +4925,7 @@ ${recapLines.join("\n")}`,
|
|
|
4925
4925
|
}
|
|
4926
4926
|
}
|
|
4927
4927
|
this.callbacks.onChunk?.({ text: "", done: true });
|
|
4928
|
-
let usage =
|
|
4928
|
+
let usage = emptyUsage();
|
|
4929
4929
|
if ("lastUsage" in adapter) {
|
|
4930
4930
|
usage = adapter.lastUsage;
|
|
4931
4931
|
}
|
|
@@ -4945,7 +4945,7 @@ ${recapLines.join("\n")}`,
|
|
|
4945
4945
|
*
|
|
4946
4946
|
* Custom adapters:
|
|
4947
4947
|
* - Pass `{ adapter: myAdapter }` to use any `LLMProviderAdapter`.
|
|
4948
|
-
* Example: `llm: { adapter:
|
|
4948
|
+
* Example: `llm: { adapter: myCustomAdapter }`
|
|
4949
4949
|
*/
|
|
4950
4950
|
createAdapter(config) {
|
|
4951
4951
|
if ("adapter" in config) {
|