-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[PE-31] feat: Add lock unlock archive restore realtime sync #5629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
448a615
fix: add lock unlock archive restore realtime sync
Palanikannan1437 cd29430
fix: show only after editor loads
Palanikannan1437 8ce39f5
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 c94fff9
fix: added strong types
Palanikannan1437 2c2dd62
fix: live events fixed
Palanikannan1437 c322122
fix: remove unused vars and logs
Palanikannan1437 e3d3ab5
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 83933ec
fix: converted objects to enum
Palanikannan1437 6f13c19
fix: error handling and removing the events in read only mode
Palanikannan1437 5a835e4
fix: added check to only update if the image aspect ratio is not pres…
Palanikannan1437 1732587
fix: imports
Palanikannan1437 20861a6
fix: props order
Palanikannan1437 ed751e3
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 2384f0b
revert: no need of these changes anymore
Palanikannan1437 bbe7e62
fix: updated type names
Palanikannan1437 b0bf242
fix: order of things
Palanikannan1437 b8c76eb
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 b42f552
fix: fixed types and renamed variables
Palanikannan1437 702236e
fix: better typing for the real time updates
Palanikannan1437 ee9e7f5
fix: trying multiplexing our socket connection
Palanikannan1437 b45761e
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 2a22f01
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 9f0ca0d
fix: multiplexing socket connection in read only editor as well
Palanikannan1437 fa53baf
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 05474e9
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 e846f6f
fix: remove single socket logic
Palanikannan1437 bb45ad2
fix: fixing the cleanup deps for the provider and localprovider
Palanikannan1437 a4e1b67
fix: add a better data structure for managing events
Palanikannan1437 d16aff9
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 842564a
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 bb715d2
chore: refactored realtime events into hooks
Palanikannan1437 5362a2c
feat: fetch page meta while focusing tabs
Palanikannan1437 37197c1
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 e8d4500
fix: cycling through items on slash command item in down arrow
Palanikannan1437 7bc9ff2
fix: better naming convention for realtime events
Palanikannan1437 0626f16
fix: simplified localprovider initialization and cleaning
Palanikannan1437 2d648c7
fix: types from ui
Palanikannan1437 6c9bcf1
fix: abstracted away from exposing the provider directly
Palanikannan1437 173e93f
fix: coderabbit suggestions
Palanikannan1437 58178cf
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 1a66f3c
regression: pass user in dependency array
Palanikannan1437 429bbc4
fix: removed page action api calls by the other users the document is…
Palanikannan1437 bc9a09d
Merge branch 'preview' into fix/lock-unlock-realtime
Palanikannan1437 cd26592
chore: removed unused imports
Palanikannan1437 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/editor/src/core/constants/document-collaborative-events.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const DocumentCollaborativeEvents = { | ||
lock: { client: "locked", server: "lock" }, | ||
unlock: { client: "unlocked", server: "unlock" }, | ||
archive: { client: "archived", server: "archive" }, | ||
unarchive: { client: "unarchived", server: "unarchive" }, | ||
} as const; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/editor/src/core/helpers/get-document-server-event.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DocumentCollaborativeEvents } from "@/constants/document-collaborative-events"; | ||
import { TDocumentEventKey, TDocumentEventsClient, TDocumentEventsServer } from "@/types/document-collaborative-events"; | ||
|
||
export const getServerEventName = (clientEvent: TDocumentEventsClient): TDocumentEventsServer | undefined => { | ||
for (const key in DocumentCollaborativeEvents) { | ||
if (DocumentCollaborativeEvents[key as TDocumentEventKey].client === clientEvent) { | ||
return DocumentCollaborativeEvents[key as TDocumentEventKey].server; | ||
} | ||
} | ||
return undefined; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/editor/src/core/types/document-collaborative-events.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { DocumentCollaborativeEvents } from "@/constants/document-collaborative-events"; | ||
|
||
export type TDocumentEventKey = keyof typeof DocumentCollaborativeEvents; | ||
export type TDocumentEventsClient = (typeof DocumentCollaborativeEvents)[TDocumentEventKey]["client"]; | ||
export type TDocumentEventsServer = (typeof DocumentCollaborativeEvents)[TDocumentEventKey]["server"]; | ||
|
||
export type TDocumentEventEmitter = { | ||
on: (event: string, callback: (message: { payload: TDocumentEventsClient }) => void) => void; | ||
off: (event: string, callback: (message: { payload: TDocumentEventsClient }) => void) => void; | ||
}; | ||
Palanikannan1437 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export * from "@/extensions/core-without-props"; | ||
export * from "@/constants/document-collaborative-events"; | ||
export * from "@/helpers/get-document-server-event"; | ||
export * from "@/types/document-collaborative-events"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.