scribe-widget 1.0.3 → 1.0.5

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.
@@ -31462,7 +31462,11 @@ function FloatingPanel({ children, position, onClose, onMinimize }) {
31462
31462
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "panel-content", children })
31463
31463
  ] });
31464
31464
  }
31465
- function ConfigState({ onSubmit, initialApiKey = "", initialBaseUrl = "" }) {
31465
+ function ConfigState({
31466
+ onSubmit,
31467
+ initialApiKey = "",
31468
+ initialBaseUrl = ""
31469
+ }) {
31466
31470
  const [apiKey, setApiKey] = reactExports.useState(initialApiKey);
31467
31471
  const [baseUrl, setBaseUrl] = reactExports.useState(initialBaseUrl);
31468
31472
  const [error2, setError] = reactExports.useState("");
@@ -31475,43 +31479,52 @@ function ConfigState({ onSubmit, initialApiKey = "", initialBaseUrl = "" }) {
31475
31479
  setError("");
31476
31480
  onSubmit(apiKey.trim(), baseUrl.trim());
31477
31481
  };
31478
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "config-state", children: [
31479
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "logo", children: [
31480
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "logo-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LogoIcon, {}) }),
31481
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "logo-text", children: "eka.scribe" })
31482
- ] }),
31483
- /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: "config-form", onSubmit: handleSubmit, children: [
31484
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "form-group", children: [
31485
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "eka-api-key", children: "API Key" }),
31486
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31487
- "input",
31488
- {
31489
- id: "eka-api-key",
31490
- type: "text",
31491
- value: apiKey,
31492
- onChange: (e) => setApiKey(e.target.value),
31493
- placeholder: "Enter your API key (optional)"
31494
- }
31495
- )
31496
- ] }),
31497
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "form-group", children: [
31498
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "eka-base-url", children: "Base URL" }),
31499
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31500
- "input",
31501
- {
31502
- id: "eka-base-url",
31503
- type: "text",
31504
- value: baseUrl,
31505
- onChange: (e) => setBaseUrl(e.target.value),
31506
- placeholder: "https://api.eka.care",
31507
- required: true
31508
- }
31509
- )
31510
- ] }),
31511
- error2 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "config-error", children: error2 }),
31512
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "submit", className: "config-submit-btn", children: "Continue" })
31513
- ] })
31514
- ] });
31482
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
31483
+ "div",
31484
+ {
31485
+ className: "config-state",
31486
+ style: {
31487
+ zIndex: 9999
31488
+ },
31489
+ children: [
31490
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "logo", children: [
31491
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "logo-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LogoIcon, {}) }),
31492
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "logo-text", children: "eka.scribe" })
31493
+ ] }),
31494
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: "config-form", onSubmit: handleSubmit, children: [
31495
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "form-group", children: [
31496
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "eka-api-key", children: "API Key" }),
31497
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31498
+ "input",
31499
+ {
31500
+ id: "eka-api-key",
31501
+ type: "text",
31502
+ value: apiKey,
31503
+ onChange: (e) => setApiKey(e.target.value),
31504
+ placeholder: "Enter your API key (optional)"
31505
+ }
31506
+ )
31507
+ ] }),
31508
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "form-group", children: [
31509
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "eka-base-url", children: "Base URL" }),
31510
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31511
+ "input",
31512
+ {
31513
+ id: "eka-base-url",
31514
+ type: "text",
31515
+ value: baseUrl,
31516
+ onChange: (e) => setBaseUrl(e.target.value),
31517
+ placeholder: "https://api.eka.care",
31518
+ required: true
31519
+ }
31520
+ )
31521
+ ] }),
31522
+ error2 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "config-error", children: error2 }),
31523
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "submit", className: "config-submit-btn", children: "Continue" })
31524
+ ] })
31525
+ ]
31526
+ }
31527
+ );
31515
31528
  }
31516
31529
  function IdleState({ onStartRecording }) {
31517
31530
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "idle-state", children: [
@@ -64446,15 +64459,7 @@ class ScribeWidget {
64446
64459
  }
64447
64460
  render() {
64448
64461
  if (!this.root || !this.visible) return;
64449
- this.root.render(
64450
- /* @__PURE__ */ jsxRuntimeExports.jsx(
64451
- App,
64452
- {
64453
- config: this.config,
64454
- onClose: () => this.hide()
64455
- }
64456
- )
64457
- );
64462
+ this.root.render(/* @__PURE__ */ jsxRuntimeExports.jsx(App, { config: this.config, onClose: () => this.hide() }));
64458
64463
  }
64459
64464
  mount(target) {
64460
64465
  const targetEl = typeof target === "string" ? document.querySelector(target) : target || document.body;
@@ -64488,6 +64493,7 @@ function init(config = {}) {
64488
64493
  if (widgetInstance) {
64489
64494
  widgetInstance.unmount();
64490
64495
  }
64496
+ console.log(config, "config - WIDGET");
64491
64497
  widgetInstance = new ScribeWidget(config);
64492
64498
  widgetInstance.mount();
64493
64499
  return widgetInstance;
@@ -64506,13 +64512,15 @@ if (typeof window !== "undefined" && typeof document !== "undefined") {
64506
64512
  if (scriptTag == null ? void 0 : scriptTag.hasAttribute("data-no-auto-init")) {
64507
64513
  return;
64508
64514
  }
64515
+ console.log(widgetInstance, "widget instance");
64509
64516
  if (!widgetInstance) {
64510
64517
  init({});
64511
64518
  }
64512
64519
  };
64513
64520
  if (document.readyState === "loading") {
64514
- document.addEventListener("DOMContentLoaded", autoInit);
64521
+ document.addEventListener("DOMContentLoaded - WIDGET", autoInit);
64515
64522
  } else {
64523
+ console.log("load document - WIDGET");
64516
64524
  autoInit();
64517
64525
  }
64518
64526
  }