@cocreate/organizations 1.10.9 → 1.11.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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [1.11.0](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.10.10...v1.11.0) (2023-04-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * added pwa manifest ([711f7a2](https://github.com/CoCreate-app/CoCreate-organizations/commit/711f7a22c2f3f224f956c93a3a4019a383226c37))
7
+
8
+ ## [1.10.10](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.10.9...v1.10.10) (2023-04-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * broadcast user doc ([20175d4](https://github.com/CoCreate-app/CoCreate-organizations/commit/20175d4d1e7c624e0ca4334ef0e7c89b1c9c027b))
14
+ * commented code that was related to creating new db ([147b1dd](https://github.com/CoCreate-app/CoCreate-organizations/commit/147b1dd54cdbf0a41fe724b5d138d3b3a449047d))
15
+
1
16
  ## [1.10.9](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.10.8...v1.10.9) (2023-04-12)
2
17
 
3
18
 
@@ -5,6 +5,7 @@
5
5
 
6
6
  <!-- CoCreate Favicon -->
7
7
  <link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
8
+ <link rel="manifest" href="/manifest.json">
8
9
  </head>
9
10
  <body class="padding:20px">
10
11
 
package/demo/index.html CHANGED
@@ -21,7 +21,8 @@
21
21
  margin-top: -23px;
22
22
  }
23
23
  </style>
24
- </head>
24
+ <link rel="manifest" href="/manifest.json" />
25
+ </head>
25
26
  <body>
26
27
 
27
28
  <div class="main-container justify-content:center align-items:center overflow:auto display:flex flex-wrap:wrap position:absolute width:100% height:100%">
@@ -5,6 +5,7 @@
5
5
 
6
6
  <!-- CoCreate Favicon -->
7
7
  <link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
8
+ <link rel="manifest" href="/manifest.json">
8
9
  </head>
9
10
  <body>
10
11
 
@@ -5,6 +5,7 @@
5
5
 
6
6
  <!-- CoCreate Favicon -->
7
7
  <link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
8
+ <link rel="manifest" href="/manifest.json">
8
9
  </head>
9
10
  <body class="width:fit-content overflow:auto">
10
11
 
@@ -5,6 +5,7 @@
5
5
 
6
6
  <!-- CoCreate Favicon -->
7
7
  <link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
8
+ <link rel="manifest" href="/manifest.json">
8
9
  </head>
9
10
  <body class="width:fit-content overflow:auto">
10
11
 
package/docs/index.html CHANGED
@@ -14,7 +14,8 @@
14
14
  <!-- CoCreate CSS CDN -->
15
15
  <link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css"/>
16
16
  <link rel="stylesheet" href="https://ws.cocreate.app/docs.css" collection="apples" document_id="6069ff5042ef8ff5175a5c8d" name="css" type="text/css" />
17
- </head>
17
+ <link rel="manifest" href="/manifest.json" />
18
+ </head>
18
19
  <body>
19
20
 
20
21
  <nav class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px" content_id="content" scroll="sticky-nav,hide-nav" scroll-up="10" scroll-down="10" collection="files" document_id="60395ef42b3ac232657040fd" name="src">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/organizations",
3
- "version": "1.10.9",
3
+ "version": "1.11.0",
4
4
  "description": "A simple organizations component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "organizations",
package/src/client.js CHANGED
@@ -22,42 +22,38 @@ const CoCreateOrganization = {
22
22
  let elements = form.querySelectorAll("[collection='organizations'][name]");
23
23
 
24
24
  let data = {document: {}};
25
- //. get form data
26
25
  elements.forEach(el => {
27
26
  let name = el.getAttribute('name');
28
27
  let value = el.getValue();
29
28
  if (!name || !value) return;
30
- if (el.getAttribute('data-type') == 'array') {
31
- value = [value];
32
- }
33
29
  data.document[name] = value;
34
30
  });
35
31
 
36
- const socket = crud.socket.getSockets()
37
- if (!socket[0] || !socket[0].connected || window && !window.navigator.onLine) {
32
+ // const socket = crud.socket.getSockets()
33
+ // if (!socket[0] || !socket[0].connected || window && !window.navigator.onLine) {
38
34
  data.collection = 'organizations'
39
- data.document['_id'] = crud.ObjectId()
40
- data.document['name'] = 'untitled'
41
- localStorage.setItem('apiKey', uuid.generate(32));
42
- localStorage.setItem('organization_id', data['_id']);
35
+ // data.document['_id'] = crud.ObjectId()
36
+ // data.document['name'] = 'untitled'
37
+ // localStorage.setItem('apiKey', uuid.generate(32));
38
+ // localStorage.setItem('organization_id', data['_id']);
43
39
  crud.createDocument(data).then((response) => {
44
- data.database = data.document[0]['_id']
45
- data.organization_id = data.document[0]['_id']
46
- crud.createDocument(data).then((response) => {
40
+ // data.database = data.document[0]['_id']
41
+ // data.organization_id = data.document[0]['_id']
42
+ // crud.createDocument(data).then((response) => {
47
43
 
48
- document.dispatchEvent(new CustomEvent('createOrg', {
44
+ document.dispatchEvent(new CustomEvent('createdOrg', {
49
45
  detail: response
50
46
  }));
51
47
 
52
- })
48
+ // })
53
49
  })
54
- } else {
55
- crud.socket.send('createOrg', {
56
- collection: 'organizations',
57
- ...data,
58
- broadcastBrowser: false
59
- });
60
- }
50
+ // } else {
51
+ // crud.socket.send('createOrg', {
52
+ // collection: 'organizations',
53
+ // ...data,
54
+ // broadcastBrowser: false
55
+ // });
56
+ // }
61
57
  },
62
58
 
63
59
  setDocumentId: function(collection, id) {
package/src/server.js CHANGED
@@ -29,6 +29,8 @@ class CoCreateOrganization {
29
29
  // self.wsManager.send(socket, 'createOrg', data);
30
30
  // self.wsManager.broadcast(socket, 'createDocument', data);
31
31
  // })
32
+
33
+ self.wsManager.broadcast(socket, 'updateDocument', data);
32
34
  self.wsManager.send(socket, 'createOrg', data);
33
35
 
34
36
  // add new org to platformDB