dexie-cloud-addon 4.0.0-beta.19 → 4.0.0-beta.22

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.
@@ -101,7 +101,7 @@ function __spreadArray$1(to, from, pack) {
101
101
  *
102
102
  * ==========================================================================
103
103
  *
104
- * Version 4.0.0-beta.19, Fri May 20 2022
104
+ * Version 4.0.0-beta.22, Mon Sep 05 2022
105
105
  *
106
106
  * https://dexie.org
107
107
  *
@@ -2141,10 +2141,17 @@ var b64decode = typeof Buffer !== "undefined"
2141
2141
  return bytes;
2142
2142
  };
2143
2143
  var b64encode = typeof Buffer !== "undefined"
2144
- ? function (b) { return ArrayBuffer.isView(b)
2145
- ? Buffer.from(b.buffer, b.byteOffset, b.byteLength).toString("base64")
2146
- : Buffer.from(b).toString("base64"); }
2147
- : function (b) { return btoa(String.fromCharCode.apply(null, b)); };
2144
+ ? function (b) {
2145
+ if (ArrayBuffer.isView(b)) {
2146
+ return Buffer.from(b.buffer, b.byteOffset, b.byteLength).toString("base64");
2147
+ }
2148
+ else {
2149
+ return Buffer.from(b).toString("base64");
2150
+ }
2151
+ }
2152
+ : function (b) {
2153
+ return btoa(String.fromCharCode.apply(null, ArrayBuffer.isView(b) ? b : new Uint8Array(b)));
2154
+ };
2148
2155
  function interactWithUser(userInteraction, req) {
2149
2156
  return new Promise(function (resolve, reject) {
2150
2157
  var interactionProps = Object.assign(Object.assign({}, req), { onSubmit: function (res) {
@@ -6306,8 +6313,8 @@ var Styles = {
6306
6313
  }
6307
6314
  };
6308
6315
  function Dialog(_k) {
6309
- var children = _k.children;
6310
- return (a$1("div", null, a$1("div", { style: Styles.Darken }), a$1("div", { style: Styles.DialogOuter }, a$1("div", { style: Styles.DialogInner }, children))));
6316
+ var children = _k.children, className = _k.className;
6317
+ return (a$1("div", { className: className }, a$1("div", { style: Styles.Darken }), a$1("div", { style: Styles.DialogOuter }, a$1("div", { style: Styles.DialogInner }, children))));
6311
6318
  }
6312
6319
  var t, u, r, o = 0, i = [], c = n.__b, f = n.__r, e = n.diffed, a = n.__c, v = n.unmount;
6313
6320
  function m(t, r) { n.__h && n.__h(u, t, o || r), o = 0; var i = u.__H || (u.__H = { __: [], __h: [] }); return t >= i.__.length && i.__.push({}), i.__[t]; }
@@ -6349,7 +6356,7 @@ function LoginDialog(_k) {
6349
6356
  var _l = l({}), params = _l[0], setParams = _l[1];
6350
6357
  var firstFieldRef = s();
6351
6358
  h(function () { var _a; return (_a = firstFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, []);
6352
- return (a$1(Dialog, null, a$1(y, null, a$1("h3", { style: Styles.WindowHeader }, title), alerts.map(function (alert) { return (a$1("p", { style: Styles.Alert[alert.type] }, resolveText(alert))); }), a$1("form", { onSubmit: function (ev) {
6359
+ return (a$1(Dialog, { className: "dxc-login-dlg" }, a$1(y, null, a$1("h3", { style: Styles.WindowHeader }, title), alerts.map(function (alert) { return (a$1("p", { style: Styles.Alert[alert.type] }, resolveText(alert))); }), a$1("form", { onSubmit: function (ev) {
6353
6360
  ev.preventDefault();
6354
6361
  onSubmit(params);
6355
6362
  } }, Object.entries(fields).map(function (_k, idx) {
@@ -6781,7 +6788,31 @@ var getInvitesObservable = associate(function (db) {
6781
6788
  };
6782
6789
  var emailMembersById = membersByEmail.reduce(reducer, {});
6783
6790
  var membersById = accessControl.selfMembers.reduce(reducer, emailMembersById);
6784
- return Object.values(membersById).filter(function (m) { return !m.accepted; });
6791
+ return Object.values(membersById)
6792
+ .filter(function (invite) { return !invite.accepted && !invite.rejected; })
6793
+ .map(function (invite) { return (Object.assign(Object.assign({}, invite), { accept: function () {
6794
+ return __awaiter$1(this, void 0, void 0, function () {
6795
+ return __generator$1(this, function (_k) {
6796
+ switch (_k.label) {
6797
+ case 0: return [4 /*yield*/, db.members.update(invite.id, { accepted: new Date() })];
6798
+ case 1:
6799
+ _k.sent();
6800
+ return [2 /*return*/];
6801
+ }
6802
+ });
6803
+ });
6804
+ }, reject: function () {
6805
+ return __awaiter$1(this, void 0, void 0, function () {
6806
+ return __generator$1(this, function (_k) {
6807
+ switch (_k.label) {
6808
+ case 0: return [4 /*yield*/, db.members.update(invite.id, { rejected: new Date() })];
6809
+ case 1:
6810
+ _k.sent();
6811
+ return [2 /*return*/];
6812
+ }
6813
+ });
6814
+ });
6815
+ } })); });
6785
6816
  })), []);
6786
6817
  });
6787
6818
  function getTiedRealmId(objectId) {
@@ -6837,10 +6868,9 @@ function dexieCloud(dexie) {
6837
6868
  currentUserEmitter.next(UNAUTHORIZED_USER);
6838
6869
  });
6839
6870
  dexie.cloud = {
6840
- version: '4.0.0-beta.19',
6871
+ version: '4.0.0-beta.22',
6841
6872
  options: Object.assign({}, DEFAULT_OPTIONS),
6842
6873
  schema: null,
6843
- serverState: null,
6844
6874
  get currentUserId() {
6845
6875
  return currentUserEmitter.value.userId || UNAUTHORIZED_USER.userId;
6846
6876
  },
@@ -7169,7 +7199,7 @@ function dexieCloud(dexie) {
7169
7199
  });
7170
7200
  }
7171
7201
  }
7172
- dexieCloud.version = '4.0.0-beta.19';
7202
+ dexieCloud.version = '4.0.0-beta.22';
7173
7203
  Dexie.Cloud = dexieCloud;
7174
7204
 
7175
7205
  export { dexieCloud as default, dexieCloud, getTiedObjectId, getTiedRealmId };