@weavy/uikit-react 26.0.1 → 26.0.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/weavy.mjs CHANGED
@@ -28617,7 +28617,7 @@ const Ry = (Mt = class {
28617
28617
  q(this, My, !0), console.info(this.weavyId, "was destroyed");
28618
28618
  }
28619
28619
  }, u(Mt, "Gt"), Mt);
28620
- og = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), Us = /* @__PURE__ */ new WeakMap(), My = /* @__PURE__ */ new WeakMap(), p(Ry, "WeavyClient"), Ry.version = "26.0.1", Ry.sourceName = "@weavy/uikit-web", Ry.defaults = {
28620
+ og = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), Us = /* @__PURE__ */ new WeakMap(), My = /* @__PURE__ */ new WeakMap(), p(Ry, "WeavyClient"), Ry.version = "26.0.3", Ry.sourceName = "@weavy/uikit-web", Ry.defaults = {
28621
28621
  cloudFilePickerUrl: "https://filebrowser.weavy.io/v14/",
28622
28622
  disableEnvironmentImports: !1,
28623
28623
  gcTime: 1e3 * 60 * 60 * 24,
@@ -42191,25 +42191,32 @@ let Br = (o0 = (Up = class extends Ce {
42191
42191
  /**
42192
42192
  * Checks if a conversation belongs to Messenger.
42193
42193
  *
42194
+ * @deprecated
42194
42195
  * @param conversation {AppRef | AppType | number} - The conversation or id to check if it belongs to Messenger.
42195
42196
  * @returns Promise<Boolean>
42196
42197
  */
42197
42198
  async conversationBelongsToMessenger(t) {
42198
- return this.weavy ? !!await nE(this.weavy, t, this.appTypes, this.bot) : !1;
42199
+ return console.warn("conversationBelongsToMessenger() is deprecated. Compare app to to .appTypes instead."), this.weavy ? !!await nE(this.weavy, t, this.appTypes, this.bot) : !1;
42200
+ }
42201
+ /**
42202
+ * Set the active conversation.
42203
+ *
42204
+ * @deprecated
42205
+ * @param id {number} - The id of the conversation to select.
42206
+ */
42207
+ async selectConversation(t) {
42208
+ return console.warn("selectConversation() is deprecated. Set .conversationId instead."), this.conversationId = t, !0;
42199
42209
  }
42200
42210
  /**
42201
42211
  * Deselects any active conversation.
42212
+ * @deprecated
42202
42213
  */
42203
42214
  clearConversation() {
42204
- this.conversationId = null;
42215
+ console.warn("clearConversation() is deprecated. Set .conversationId to null instead."), this.conversationId = null;
42205
42216
  }
42206
42217
  async willUpdate(t) {
42207
42218
  var i, n;
42208
- if (super.willUpdate(t), (t.has("weavy") || t.has("bot") || t.has("user")) && this.weavy && this.user && this.persistState.observe(["conversationId"], this.bot || "messenger", `u${(i = this.user) == null ? void 0 : i.id}`), t.has("link") && (n = this.link) != null && n.app)
42209
- if (await this.conversationBelongsToMessenger(this.link.app))
42210
- this.conversationId = this.link.app.id;
42211
- else
42212
- throw new Error("Not a conversation");
42219
+ super.willUpdate(t), (t.has("weavy") || t.has("bot") || t.has("user")) && this.weavy && this.user && this.persistState.observe(["conversationId"], this.bot || "messenger", `u${(i = this.user) == null ? void 0 : i.id}`), t.has("link") && (n = this.link) != null && n.app && (this.conversationId = this.link.app.id);
42213
42220
  }
42214
42221
  update(t) {
42215
42222
  super.update(t), (t.has("conversationId") || t.has("weavy")) && this.weavy && (this.conversationId ? this.conversationQuery.trackQuery(iE(this.weavy, this.conversationId, this.appTypes)) : this.conversationQuery.untrackQuery());
@@ -42268,7 +42275,7 @@ Rv([
42268
42275
  x({ type: String })
42269
42276
  ], Br.prototype, "bot", 1);
42270
42277
  Rv([
42271
- B()
42278
+ x({ type: Number })
42272
42279
  ], Br.prototype, "conversationId", 2);
42273
42280
  Br = Rv([
42274
42281
  F(Z_),
@@ -42290,9 +42297,6 @@ let jr = (l0 = (Np = class extends tt(G) {
42290
42297
  });
42291
42298
  return this.dispatchEvent(i);
42292
42299
  }
42293
- async dispatchLink(t) {
42294
- return await k5(this, this.weavy, this.notification);
42295
- }
42296
42300
  dispatchMark(t, i) {
42297
42301
  if (t.stopPropagation(), i === !!this.notification.is_unread) {
42298
42302
  const n = new CustomEvent("mark", {
@@ -42302,6 +42306,15 @@ let jr = (l0 = (Np = class extends tt(G) {
42302
42306
  }
42303
42307
  return !0;
42304
42308
  }
42309
+ dispatchHide() {
42310
+ if (this.standalone) {
42311
+ const t = new CustomEvent("hide", {
42312
+ bubbles: !0
42313
+ });
42314
+ return this.dispatchEvent(t);
42315
+ }
42316
+ return !0;
42317
+ }
42305
42318
  dispatchClose() {
42306
42319
  if (this.standalone) {
42307
42320
  const t = new CustomEvent("close", {
@@ -42311,6 +42324,9 @@ let jr = (l0 = (Np = class extends tt(G) {
42311
42324
  }
42312
42325
  return !0;
42313
42326
  }
42327
+ async handleClick(t) {
42328
+ this.dispatchSelect(t), this.dispatchMark(t, !0), this.dispatchHide(), await k5(this, this.weavy, this.notification), this.dispatchClose();
42329
+ }
42314
42330
  render() {
42315
42331
  var t, i;
42316
42332
  const n = this.notification.created_at ? new Intl.DateTimeFormat((t = this.weavy) == null ? void 0 : t.locale, { dateStyle: "full", timeStyle: "short" }).format(
@@ -42342,7 +42358,7 @@ let jr = (l0 = (Np = class extends tt(G) {
42342
42358
  "wy-active": !this.standalone && this.selected
42343
42359
  })}
42344
42360
  tabindex="0"
42345
- @click=${(f) => this.dispatchSelect(f) && this.dispatchMark(f, !0) && this.dispatchClose() && this.dispatchLink(f)}
42361
+ @click=${(f) => this.handleClick(f)}
42346
42362
  @keydown=${ei}
42347
42363
  @keyup=${_i}
42348
42364
  >
@@ -42644,6 +42660,9 @@ let Rs = (u0 = (Fp = class extends G {
42644
42660
  constructor() {
42645
42661
  super(...arguments), this.exportParts = new ae(this), this.toastRef = ke(), this.show = !1, this.duration = Rs.defaultDuration;
42646
42662
  }
42663
+ hide() {
42664
+ this.show = !1;
42665
+ }
42647
42666
  async close(t = !1) {
42648
42667
  this.show = !1, await new Promise((i) => requestAnimationFrame(i)), this.toastRef.value && await xg(this.toastRef.value, !1), this.dispatchEvent(new CustomEvent("closed", { detail: { silent: t } })), this.dispatchEvent(new CustomEvent("release-focus", { bubbles: !0, composed: !0 }));
42649
42668
  }
@@ -42655,6 +42674,9 @@ let Rs = (u0 = (Fp = class extends G {
42655
42674
  <div
42656
42675
  ${pe(this.toastRef)}
42657
42676
  class="wy-toast wy-fade ${this.show ? "wy-show" : ""}"
42677
+ @hide=${(t) => {
42678
+ t.stopPropagation(), this.hide();
42679
+ }}
42658
42680
  @close=${() => this.close()}
42659
42681
  @keyup=${pv}
42660
42682
  >
@@ -43919,7 +43941,7 @@ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
43919
43941
  return gn;
43920
43942
  }
43921
43943
  }, Symbol.toStringTag, { value: "Module" }));
43922
- rn.version = "26.0.1";
43944
+ rn.version = "26.0.3";
43923
43945
  rn.sourceName = "@weavy/uikit-react";
43924
43946
  const $F = $L(null);
43925
43947
  function UH(s, t = []) {