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.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.0.0-beta.19, Fri May 20 2022
11
+ * Version 4.0.0-beta.22, Mon Sep 05 2022
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -2004,10 +2004,17 @@ const b64decode = typeof Buffer !== "undefined"
2004
2004
  return bytes;
2005
2005
  };
2006
2006
  const b64encode = typeof Buffer !== "undefined"
2007
- ? (b) => ArrayBuffer.isView(b)
2008
- ? Buffer.from(b.buffer, b.byteOffset, b.byteLength).toString("base64")
2009
- : Buffer.from(b).toString("base64")
2010
- : (b) => btoa(String.fromCharCode.apply(null, b));
2007
+ ? (b) => {
2008
+ if (ArrayBuffer.isView(b)) {
2009
+ return Buffer.from(b.buffer, b.byteOffset, b.byteLength).toString("base64");
2010
+ }
2011
+ else {
2012
+ return Buffer.from(b).toString("base64");
2013
+ }
2014
+ }
2015
+ : (b) => {
2016
+ return btoa(String.fromCharCode.apply(null, ArrayBuffer.isView(b) ? b : new Uint8Array(b)));
2017
+ };
2011
2018
 
2012
2019
  function interactWithUser(userInteraction, req) {
2013
2020
  let done = false;
@@ -5371,8 +5378,8 @@ const Styles = {
5371
5378
  }
5372
5379
  };
5373
5380
 
5374
- function Dialog({ children }) {
5375
- return (a$1("div", null,
5381
+ function Dialog({ children, className }) {
5382
+ return (a$1("div", { className: className },
5376
5383
  a$1("div", { style: Styles.Darken }),
5377
5384
  a$1("div", { style: Styles.DialogOuter },
5378
5385
  a$1("div", { style: Styles.DialogInner }, children))));
@@ -5388,7 +5395,7 @@ function LoginDialog({ title, alerts, fields, onCancel, onSubmit, }) {
5388
5395
  const [params, setParams] = l({});
5389
5396
  const firstFieldRef = s();
5390
5397
  h(() => { var _a; return (_a = firstFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, []);
5391
- return (a$1(Dialog, null,
5398
+ return (a$1(Dialog, { className: "dxc-login-dlg" },
5392
5399
  a$1(y, null,
5393
5400
  a$1("h3", { style: Styles.WindowHeader }, title),
5394
5401
  alerts.map((alert) => (a$1("p", { style: Styles.Alert[alert.type] }, resolveText(alert)))),
@@ -5802,7 +5809,18 @@ const getInvitesObservable = associate((db) => {
5802
5809
  const reducer = (result, m) => (Object.assign(Object.assign({}, result), { [m.id]: Object.assign(Object.assign({}, m), { realm: realmLookup[m.realmId] }) }));
5803
5810
  const emailMembersById = membersByEmail.reduce(reducer, {});
5804
5811
  const membersById = accessControl.selfMembers.reduce(reducer, emailMembersById);
5805
- return Object.values(membersById).filter(m => !m.accepted);
5812
+ return Object.values(membersById)
5813
+ .filter((invite) => !invite.accepted && !invite.rejected)
5814
+ .map((invite) => (Object.assign(Object.assign({}, invite), { accept() {
5815
+ return __awaiter$1(this, void 0, void 0, function* () {
5816
+ yield db.members.update(invite.id, { accepted: new Date() });
5817
+ });
5818
+ },
5819
+ reject() {
5820
+ return __awaiter$1(this, void 0, void 0, function* () {
5821
+ yield db.members.update(invite.id, { rejected: new Date() });
5822
+ });
5823
+ } })));
5806
5824
  })), []);
5807
5825
  });
5808
5826
 
@@ -5850,10 +5868,9 @@ function dexieCloud(dexie) {
5850
5868
  currentUserEmitter.next(UNAUTHORIZED_USER);
5851
5869
  });
5852
5870
  dexie.cloud = {
5853
- version: '4.0.0-beta.19',
5871
+ version: '4.0.0-beta.22',
5854
5872
  options: Object.assign({}, DEFAULT_OPTIONS),
5855
5873
  schema: null,
5856
- serverState: null,
5857
5874
  get currentUserId() {
5858
5875
  return currentUserEmitter.value.userId || UNAUTHORIZED_USER.userId;
5859
5876
  },
@@ -6104,7 +6121,7 @@ function dexieCloud(dexie) {
6104
6121
  });
6105
6122
  }
6106
6123
  }
6107
- dexieCloud.version = '4.0.0-beta.19';
6124
+ dexieCloud.version = '4.0.0-beta.22';
6108
6125
  Dexie.Cloud = dexieCloud;
6109
6126
 
6110
6127
  export { dexieCloud as default, dexieCloud, getTiedObjectId, getTiedRealmId };