@budibase/frontend-core 2.6.19-alpha.52 → 2.6.19-alpha.54
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/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "2.6.19-alpha.
|
|
3
|
+
"version": "2.6.19-alpha.54",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
7
7
|
"svelte": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@budibase/bbui": "2.6.19-alpha.
|
|
10
|
-
"@budibase/shared-core": "2.6.19-alpha.
|
|
9
|
+
"@budibase/bbui": "2.6.19-alpha.54",
|
|
10
|
+
"@budibase/shared-core": "2.6.19-alpha.54",
|
|
11
11
|
"dayjs": "^1.11.7",
|
|
12
12
|
"lodash": "^4.17.21",
|
|
13
13
|
"socket.io-client": "^4.6.1",
|
|
14
14
|
"svelte": "^3.46.2"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "289e75e4a571a8276dcb2776ea66dcef76184785"
|
|
17
17
|
}
|
|
@@ -11,10 +11,13 @@ export const createGridWebsocket = context => {
|
|
|
11
11
|
return
|
|
12
12
|
}
|
|
13
13
|
// Identify which table we are editing
|
|
14
|
-
socket.emit(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
socket.emit(
|
|
15
|
+
GridSocketEvent.SelectTable,
|
|
16
|
+
{ tableId },
|
|
17
|
+
({ users: gridUsers }) => {
|
|
18
|
+
users.set(gridUsers)
|
|
19
|
+
}
|
|
20
|
+
)
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
// Built-in events
|
|
@@ -26,29 +29,29 @@ export const createGridWebsocket = context => {
|
|
|
26
29
|
})
|
|
27
30
|
|
|
28
31
|
// User events
|
|
29
|
-
socket.onOther(SocketEvent.UserUpdate, user => {
|
|
32
|
+
socket.onOther(SocketEvent.UserUpdate, ({ user }) => {
|
|
30
33
|
users.actions.updateUser(user)
|
|
31
34
|
})
|
|
32
|
-
socket.onOther(SocketEvent.UserDisconnect,
|
|
33
|
-
users.actions.removeUser(
|
|
35
|
+
socket.onOther(SocketEvent.UserDisconnect, ({ sessionId }) => {
|
|
36
|
+
users.actions.removeUser(sessionId)
|
|
34
37
|
})
|
|
35
38
|
|
|
36
39
|
// Row events
|
|
37
|
-
socket.onOther(GridSocketEvent.RowChange, async
|
|
38
|
-
if (
|
|
39
|
-
rows.actions.replaceRow(
|
|
40
|
-
} else if (
|
|
40
|
+
socket.onOther(GridSocketEvent.RowChange, async ({ id, row }) => {
|
|
41
|
+
if (id) {
|
|
42
|
+
rows.actions.replaceRow(id, row)
|
|
43
|
+
} else if (row.id) {
|
|
41
44
|
// Handle users table edge cased
|
|
42
|
-
await rows.actions.refreshRow(
|
|
45
|
+
await rows.actions.refreshRow(row.id)
|
|
43
46
|
}
|
|
44
47
|
})
|
|
45
48
|
|
|
46
49
|
// Table events
|
|
47
|
-
socket.onOther(GridSocketEvent.TableChange,
|
|
50
|
+
socket.onOther(GridSocketEvent.TableChange, ({ table: newTable }) => {
|
|
48
51
|
// Only update table if one exists. If the table was deleted then we don't
|
|
49
52
|
// want to know - let the builder navigate away
|
|
50
|
-
if (
|
|
51
|
-
table.set(
|
|
53
|
+
if (newTable) {
|
|
54
|
+
table.set(newTable)
|
|
52
55
|
}
|
|
53
56
|
})
|
|
54
57
|
|
|
@@ -57,7 +60,7 @@ export const createGridWebsocket = context => {
|
|
|
57
60
|
|
|
58
61
|
// Notify selected cell changes
|
|
59
62
|
focusedCellId.subscribe($focusedCellId => {
|
|
60
|
-
socket.emit(GridSocketEvent.SelectCell, $focusedCellId)
|
|
63
|
+
socket.emit(GridSocketEvent.SelectCell, { cellId: $focusedCellId })
|
|
61
64
|
})
|
|
62
65
|
|
|
63
66
|
return () => socket?.disconnect()
|