regression: downgrade to tiptap v2 (#7982)
* chore: downgrade to tiptap v2 * fix: revert back to hocuspocus * fix: collaboration events added * fix: lock unlock issues * fix: build errors * fix: type errors * fix: graceful shutdown --------- Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com>
This commit is contained in:
parent
59022b6beb
commit
64781be7d2
48 changed files with 2123 additions and 824 deletions
|
|
@ -25,12 +25,12 @@ export type TBasePage = TPage & {
|
|||
update: (pageData: Partial<TPage>) => Promise<Partial<TPage> | undefined>;
|
||||
updateTitle: (title: string) => void;
|
||||
updateDescription: (document: TDocumentPayload) => Promise<void>;
|
||||
makePublic: (shouldSync?: boolean) => Promise<void>;
|
||||
makePrivate: (shouldSync?: boolean) => Promise<void>;
|
||||
lock: (shouldSync?: boolean) => Promise<void>;
|
||||
unlock: (shouldSync?: boolean) => Promise<void>;
|
||||
archive: (shouldSync?: boolean) => Promise<void>;
|
||||
restore: (shouldSync?: boolean) => Promise<void>;
|
||||
makePublic: (params: { shouldSync?: boolean }) => Promise<void>;
|
||||
makePrivate: (params: { shouldSync?: boolean }) => Promise<void>;
|
||||
lock: (params: { shouldSync?: boolean; recursive?: boolean }) => Promise<void>;
|
||||
unlock: (params: { shouldSync?: boolean; recursive?: boolean }) => Promise<void>;
|
||||
archive: (params: { shouldSync?: boolean; archived_at?: string | null }) => Promise<void>;
|
||||
restore: (params: { shouldSync?: boolean }) => Promise<void>;
|
||||
updatePageLogo: (value: TChangeHandlerProps) => Promise<void>;
|
||||
addToFavorites: () => Promise<void>;
|
||||
removePageFromFavorites: () => Promise<void>;
|
||||
|
|
@ -315,7 +315,7 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
/**
|
||||
* @description make the page public
|
||||
*/
|
||||
makePublic = async (shouldSync: boolean = true) => {
|
||||
makePublic = async ({ shouldSync = true }) => {
|
||||
const pageAccess = this.access;
|
||||
runInAction(() => {
|
||||
this.access = EPageAccess.PUBLIC;
|
||||
|
|
@ -338,7 +338,7 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
/**
|
||||
* @description make the page private
|
||||
*/
|
||||
makePrivate = async (shouldSync: boolean = true) => {
|
||||
makePrivate = async ({ shouldSync = true }) => {
|
||||
const pageAccess = this.access;
|
||||
runInAction(() => {
|
||||
this.access = EPageAccess.PRIVATE;
|
||||
|
|
@ -361,7 +361,7 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
/**
|
||||
* @description lock the page
|
||||
*/
|
||||
lock = async (shouldSync: boolean = true) => {
|
||||
lock = async ({ shouldSync = true }) => {
|
||||
const pageIsLocked = this.is_locked;
|
||||
runInAction(() => (this.is_locked = true));
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
/**
|
||||
* @description unlock the page
|
||||
*/
|
||||
unlock = async (shouldSync: boolean = true) => {
|
||||
unlock = async ({ shouldSync = true }) => {
|
||||
const pageIsLocked = this.is_locked;
|
||||
runInAction(() => (this.is_locked = false));
|
||||
|
||||
|
|
@ -395,12 +395,12 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
/**
|
||||
* @description archive the page
|
||||
*/
|
||||
archive = async (shouldSync: boolean = true) => {
|
||||
archive = async ({ shouldSync = true, archived_at }: { shouldSync?: boolean; archived_at?: string | null }) => {
|
||||
if (!this.id) return undefined;
|
||||
|
||||
try {
|
||||
runInAction(() => {
|
||||
this.archived_at = new Date().toISOString();
|
||||
this.archived_at = archived_at ?? new Date().toISOString();
|
||||
});
|
||||
|
||||
if (this.rootStore.favorite.entityMap[this.id]) this.rootStore.favorite.removeFavoriteFromStore(this.id);
|
||||
|
|
@ -422,7 +422,7 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
/**
|
||||
* @description restore the page
|
||||
*/
|
||||
restore = async (shouldSync: boolean = true) => {
|
||||
restore = async ({ shouldSync = true }: { shouldSync?: boolean }) => {
|
||||
const archivedAtBeforeRestore = this.archived_at;
|
||||
|
||||
try {
|
||||
|
|
@ -438,6 +438,7 @@ export class BasePage extends ExtendedBasePage implements TBasePage {
|
|||
runInAction(() => {
|
||||
this.archived_at = archivedAtBeforeRestore;
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export interface IProjectPageStore {
|
|||
options?: { trackVisit?: boolean }
|
||||
) => Promise<TPage | undefined>;
|
||||
createPage: (pageData: Partial<TPage>) => Promise<TPage | undefined>;
|
||||
removePage: (pageId: string) => Promise<void>;
|
||||
removePage: (params: { pageId: string; shouldSync?: boolean }) => Promise<void>;
|
||||
movePage: (workspaceSlug: string, projectId: string, pageId: string, newProjectId: string) => Promise<void>;
|
||||
}
|
||||
|
||||
|
|
@ -321,7 +321,7 @@ export class ProjectPageStore implements IProjectPageStore {
|
|||
* @description delete a page
|
||||
* @param {string} pageId
|
||||
*/
|
||||
removePage = async (pageId: string) => {
|
||||
removePage = async ({ pageId, shouldSync = true }: { pageId: string; shouldSync?: boolean }) => {
|
||||
try {
|
||||
const { workspaceSlug, projectId } = this.store.router;
|
||||
if (!workspaceSlug || !projectId || !pageId) return undefined;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue