uapp-communication-sdk 1.0.0-dev.87 → 1.0.0-dev.89

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.
@@ -14111,8 +14111,9 @@ var cO = class {
14111
14111
  allDay;
14112
14112
  notes;
14113
14113
  recurrence;
14114
+ sourceMeetingId;
14114
14115
  constructor(e) {
14115
- this.id = e.id, this.userId = e.userId, this.title = e.title, this.status = e.status, this.start = e.start, this.end = e.end, this.allDay = e.allDay, this.notes = e.notes, this.recurrence = e.recurrence;
14116
+ this.id = e.id, this.userId = e.userId, this.title = e.title, this.status = e.status, this.start = e.start, this.end = e.end, this.allDay = e.allDay, this.notes = e.notes, this.recurrence = e.recurrence, this.sourceMeetingId = e.sourceMeetingId ?? null;
14116
14117
  }
14117
14118
  get durationMinutes() {
14118
14119
  return OO(this.start, this.end);
@@ -17442,7 +17443,8 @@ var jj = G({
17442
17443
  end: H(),
17443
17444
  allDay: Cj(),
17444
17445
  notes: H(),
17445
- recurrence: jj.nullable().optional()
17446
+ recurrence: jj.nullable().optional(),
17447
+ sourceMeetingId: H().nullable().optional()
17446
17448
  }).passthrough(), Nj = W(Mj), Pj = G({
17447
17449
  from: H(),
17448
17450
  to: H()
@@ -17534,7 +17536,8 @@ var jj = G({
17534
17536
  end: Xj(e.end),
17535
17537
  allDay: e.allDay,
17536
17538
  notes: e.notes,
17537
- recurrence: e.recurrence !== null && e.recurrence !== void 0 ? Zj(e.recurrence) : null
17539
+ recurrence: e.recurrence !== null && e.recurrence !== void 0 ? Zj(e.recurrence) : null,
17540
+ sourceMeetingId: e.sourceMeetingId ?? null
17538
17541
  }), $j = (e) => ({
17539
17542
  active: e.active,
17540
17543
  slots: e.slots.map((e) => ({
@@ -39594,7 +39597,7 @@ var I0 = () => {
39594
39597
  }, r.id);
39595
39598
  })
39596
39599
  }), j6 = 1e4, M6 = () => {
39597
- let e = ct(), t = qQ(j6), n = ZQ(), r = QQ(), [i, a] = T("upcoming"), o = t.data ?? [], s = [...o].filter((e) => e.bucket === i).sort((e, t) => new Date(e.startUtc).getTime() - new Date(t.startUtc).getTime()), c = {
39600
+ let e = ct(), t = qQ(j6), n = ZQ(), r = QQ(), [i, a] = T("upcoming"), o = t.data ?? [], s = t.data === void 0, c = [...o].filter((e) => e.bucket === i).sort((e, t) => new Date(e.startUtc).getTime() - new Date(t.startUtc).getTime()), l = {
39598
39601
  upcoming: o.filter((e) => e.bucket === "upcoming").length,
39599
39602
  passed: o.filter((e) => e.bucket === "passed").length,
39600
39603
  canceled: o.filter((e) => e.bucket === "canceled").length
@@ -39604,16 +39607,21 @@ var I0 = () => {
39604
39607
  children: [
39605
39608
  /* @__PURE__ */ (0, A.jsx)(A6, {
39606
39609
  bucket: i,
39607
- counts: c,
39610
+ counts: l,
39608
39611
  onSelect: a
39609
39612
  }),
39610
39613
  t.isPending ? /* @__PURE__ */ (0, A.jsx)(E6, {}) : null,
39611
- t.isError && /* @__PURE__ */ (0, A.jsx)(Hi, {
39614
+ t.isError && s ? /* @__PURE__ */ (0, A.jsx)(Hi, {
39612
39615
  tone: "error",
39613
39616
  title: "Could not load meetings",
39614
39617
  children: t.error.message
39615
- }),
39616
- t.isSuccess && s.length === 0 ? /* @__PURE__ */ (0, A.jsxs)("div", {
39618
+ }) : null,
39619
+ t.isError && !s ? /* @__PURE__ */ (0, A.jsx)(Hi, {
39620
+ tone: "info",
39621
+ title: "Showing the last known meetings",
39622
+ children: "Could not refresh just now. This will update on its own."
39623
+ }) : null,
39624
+ !s && c.length === 0 ? /* @__PURE__ */ (0, A.jsxs)("div", {
39617
39625
  className: p6.empty,
39618
39626
  children: [
39619
39627
  /* @__PURE__ */ (0, A.jsx)("div", {
@@ -39634,14 +39642,14 @@ var I0 = () => {
39634
39642
  })
39635
39643
  ]
39636
39644
  }) : null,
39637
- t.isSuccess && s.length > 0 ? /* @__PURE__ */ (0, A.jsx)(h_, {
39645
+ !s && c.length > 0 ? /* @__PURE__ */ (0, A.jsx)(h_, {
39638
39646
  mode: "wait",
39639
39647
  children: /* @__PURE__ */ (0, A.jsx)(M.div, {
39640
39648
  className: p6.meetingList,
39641
39649
  variants: k6,
39642
39650
  initial: "hidden",
39643
39651
  animate: "visible",
39644
- children: s.map((t) => /* @__PURE__ */ (0, A.jsx)(w6, {
39652
+ children: c.map((t) => /* @__PURE__ */ (0, A.jsx)(w6, {
39645
39653
  meeting: t,
39646
39654
  onRespond: (e) => {
39647
39655
  n.mutate({
@@ -40978,9 +40986,11 @@ var I0 = () => {
40978
40986
  });
40979
40987
  },
40980
40988
  onDelete: () => {
40981
- e.mode === "edit" && o.mutate(e.block.id, {
40989
+ if (e.mode !== "edit") return;
40990
+ let t = e.block.sourceMeetingId !== null;
40991
+ o.mutate(e.block.id, {
40982
40992
  onSuccess: () => {
40983
- N.success("Event removed"), r();
40993
+ N.success(t ? "Meeting cancelled for everyone" : "Event removed"), r();
40984
40994
  },
40985
40995
  onError: (e) => {
40986
40996
  N.error(e.message);
@@ -40989,42 +40999,64 @@ var I0 = () => {
40989
40999
  }
40990
41000
  };
40991
41001
  }, b5 = ({ state: e, timezone: t, onClose: n }) => {
40992
- let [r, i] = T(() => b8(e)), { busy: a, onSave: o, onDelete: s } = y5(e, r, t, n), { data: c = [] } = iP(), l = p5(r, e, t), u = e.mode === "edit", d = f5(r, c, e, t), f = d.code === "title_too_long" ? null : d.error, p = d.error === null, m = (d.code === "overlap_availability" || d.code === "overlap_event") && !d.hasMeetingConflict;
41002
+ let [r, i] = T(() => b8(e)), { busy: a, onSave: o, onDelete: s } = y5(e, r, t, n), [c, l] = T(!1), u = e.mode === "edit" && e.block.sourceMeetingId !== null, { data: d = [] } = iP(), f = p5(r, e, t), p = e.mode === "edit", m = f5(r, d, e, t), h = m.code === "title_too_long" ? null : m.error, g = m.error === null, _ = (m.code === "overlap_availability" || m.code === "overlap_event") && !m.hasMeetingConflict;
40993
41003
  return /* @__PURE__ */ (0, A.jsxs)(yb, {
40994
41004
  open: !0,
40995
41005
  side: "right",
40996
- title: u ? "Edit Event" : "New Event",
41006
+ title: p ? "Edit Event" : "New Event",
40997
41007
  onOpenChange: (e) => {
40998
41008
  e || n();
40999
41009
  },
41000
41010
  footer: /* @__PURE__ */ (0, A.jsx)(v5, {
41001
- isEdit: u,
41011
+ isEdit: p,
41002
41012
  busy: a,
41003
- canSave: p,
41004
- validationError: f,
41005
- isConflict: m,
41013
+ canSave: g,
41014
+ validationError: h,
41015
+ isConflict: _,
41006
41016
  summary: _5(r),
41007
41017
  onSave: o,
41008
- onDelete: s,
41018
+ onDelete: () => {
41019
+ if (u) {
41020
+ l(!0);
41021
+ return;
41022
+ }
41023
+ s();
41024
+ },
41009
41025
  onCancel: n,
41010
41026
  onResolveConflicts: () => {
41011
- l.resolve(c, o);
41027
+ f.resolve(d, o);
41012
41028
  }
41013
41029
  }),
41014
- children: [/* @__PURE__ */ (0, A.jsxs)("header", {
41015
- className: Q.panelHead,
41016
- children: [/* @__PURE__ */ (0, A.jsx)("span", {
41017
- className: Q.panelTitle,
41018
- children: u ? "Edit Event" : "New Event"
41019
- }), /* @__PURE__ */ (0, A.jsx)(Ji, {
41020
- label: "Close",
41021
- onClick: n,
41022
- children: /* @__PURE__ */ (0, A.jsx)(Ai, { size: 18 })
41023
- })]
41024
- }), /* @__PURE__ */ (0, A.jsx)(Y8, {
41025
- draft: r,
41026
- onChange: i
41027
- })]
41030
+ children: [
41031
+ /* @__PURE__ */ (0, A.jsxs)("header", {
41032
+ className: Q.panelHead,
41033
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
41034
+ className: Q.panelTitle,
41035
+ children: p ? "Edit Event" : "New Event"
41036
+ }), /* @__PURE__ */ (0, A.jsx)(Ji, {
41037
+ label: "Close",
41038
+ onClick: n,
41039
+ children: /* @__PURE__ */ (0, A.jsx)(Ai, { size: 18 })
41040
+ })]
41041
+ }),
41042
+ /* @__PURE__ */ (0, A.jsx)(Y8, {
41043
+ draft: r,
41044
+ onChange: i
41045
+ }),
41046
+ /* @__PURE__ */ (0, A.jsx)(_b, {
41047
+ open: c,
41048
+ elevated: !0,
41049
+ title: "Cancel this meeting?",
41050
+ message: "This event came from a booking. Removing it cancels the meeting and frees the time on everyone's calendar, not just yours.",
41051
+ confirmLabel: "Cancel meeting",
41052
+ onConfirm: () => {
41053
+ l(!1), s();
41054
+ },
41055
+ onCancel: () => {
41056
+ l(!1);
41057
+ }
41058
+ })
41059
+ ]
41028
41060
  });
41029
41061
  }, x5 = () => {
41030
41062
  let e = Intl.supportedValuesOf;