@guidelytech/sdk-core 0.11.0 → 0.13.0

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.cjs CHANGED
@@ -424,7 +424,9 @@ var KEYS = {
424
424
  /** Messenger conversations this browser can read: [{ id, token }]. */
425
425
  conversations: (key) => `guidely:conversations:${key}`,
426
426
  /** Announcement ids opened in the messenger's News tab. */
427
- newsSeen: (key) => `guidely:news:${key}`
427
+ newsSeen: (key) => `guidely:news:${key}`,
428
+ /** Where the visitor dragged the messenger launcher ({ side, y }). */
429
+ launcher: (key) => `guidely:launcher:${key}`
428
430
  };
429
431
 
430
432
  // src/outbox.ts
@@ -2116,7 +2118,7 @@ var loadRecorder = async () => (await import("./recorder.cjs")).recorder;
2116
2118
 
2117
2119
  // src/client.ts
2118
2120
  var SDK_NAME = "@guidelytech/sdk-core";
2119
- var SDK_VERSION = "0.11.0";
2121
+ var SDK_VERSION = "0.13.0";
2120
2122
  var DEFAULT_API_URL = "https://api.guidely.app";
2121
2123
  var PAGE_SCOPED = /* @__PURE__ */ new Set(["page_load", "url_match", "element_click", "element_visible", "delay"]);
2122
2124
  var DAY_MS = 24 * 60 * 60 * 1e3;
@@ -3504,7 +3506,7 @@ var GuidelyClient = class _GuidelyClient {
3504
3506
  loadMessenger() {
3505
3507
  if (this.messenger) return Promise.resolve(this.messenger);
3506
3508
  if (this.messengerLoading) return this.messengerLoading;
3507
- this.messengerLoading = import("@guidelytech/guide-runtime/messenger").then(({ renderMessenger }) => {
3509
+ this.messengerLoading = import("@guidelytech/guide-runtime/messenger").then(({ renderMessenger, parseLauncherSpot }) => {
3508
3510
  const cfg = this.config?.messenger;
3509
3511
  if (this.destroyed || !this.config || !cfg?.enabled || this.messenger) return this.messenger;
3510
3512
  const scope = (0, import_guide_runtime6.createScope)(this.theme());
@@ -3522,6 +3524,8 @@ var GuidelyClient = class _GuidelyClient {
3522
3524
  locale: () => this.rcLocale()
3523
3525
  }),
3524
3526
  visitor: () => this.messengerVisitor(),
3527
+ launcherSpot: parseLauncherSpot(this.store.get(KEYS.launcher(this.options.projectId))),
3528
+ onLauncherMove: (spot) => writeJson(this.store, KEYS.launcher(this.options.projectId), spot),
3525
3529
  brand: { logoUrl: this.theme().logoUrl ?? null, name: this.theme().brandName ?? null },
3526
3530
  onResumeGuide: (guideId, stepId) => this.startGuide(guideId, { stepId }),
3527
3531
  onNewsSeen: (ids) => {