mirror of
https://github.com/colanode/colanode.git
synced 2025-12-16 11:47:47 +01:00
Lint fixes
This commit is contained in:
@@ -16,7 +16,13 @@
|
|||||||
"es6": true
|
"es6": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-unused-vars": "error",
|
"no-unused-vars": "off",
|
||||||
|
"import/no-unresolved": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{ "vars": "all", "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }
|
||||||
|
],
|
||||||
"no-console": "off"
|
"no-console": "off"
|
||||||
}
|
},
|
||||||
|
"ignorePatterns": ["dist", "node_modules"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"package": "electron-forge package",
|
"package": "electron-forge package",
|
||||||
"make": "electron-forge make",
|
"make": "electron-forge make",
|
||||||
"publish": "electron-forge publish",
|
"publish": "electron-forge publish",
|
||||||
"lint": "eslint --ext .ts,.tsx .",
|
"lint": "eslint --ext .ts,.tsx src",
|
||||||
"postinstall": "electron-rebuild"
|
"postinstall": "electron-rebuild"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -4,14 +4,11 @@ import { eventBus } from '@/shared/lib/event-bus';
|
|||||||
import { avatarService } from '@/main/services/avatar-service';
|
import { avatarService } from '@/main/services/avatar-service';
|
||||||
import { fileService } from '@/main/services/file-service';
|
import { fileService } from '@/main/services/file-service';
|
||||||
import { assetService } from '@/main/services/asset-service';
|
import { assetService } from '@/main/services/asset-service';
|
||||||
import { MutationMap } from '@/shared/mutations';
|
import { MutationMap, MutationInput } from '@/shared/mutations';
|
||||||
import { MutationInput } from '@/shared/mutations';
|
import { QueryMap, QueryInput } from '@/shared/queries';
|
||||||
import { QueryMap } from '@/shared/queries';
|
|
||||||
import { mutationService } from '@/main/services/mutation-service';
|
import { mutationService } from '@/main/services/mutation-service';
|
||||||
import { queryService } from '@/main/services/query-service';
|
import { queryService } from '@/main/services/query-service';
|
||||||
import { QueryInput } from '@/shared/queries';
|
import { CommandMap, CommandInput } from '@/shared/commands';
|
||||||
import { CommandMap } from '@/shared/commands';
|
|
||||||
import { CommandInput } from '@/shared/commands';
|
|
||||||
import { commandService } from '@/main/services/command-service';
|
import { commandService } from '@/main/services/command-service';
|
||||||
import { bootstrapper } from '@/main/bootstrapper';
|
import { bootstrapper } from '@/main/bootstrapper';
|
||||||
import started from 'electron-squirrel-startup';
|
import started from 'electron-squirrel-startup';
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { InteractionAttribute, NodeType } from '@colanode/core';
|
||||||
InteractionAttribute,
|
|
||||||
InteractionAttributes,
|
|
||||||
NodeType,
|
|
||||||
} from '@colanode/core';
|
|
||||||
import { ColumnType, Insertable, Selectable, Updateable } from 'kysely';
|
import { ColumnType, Insertable, Selectable, Updateable } from 'kysely';
|
||||||
|
|
||||||
interface NodeTable {
|
interface NodeTable {
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
import { generateId, IdType } from '@colanode/core';
|
import { generateId, IdType, ChannelAttributes } from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
ChannelCreateMutationInput,
|
ChannelCreateMutationInput,
|
||||||
ChannelCreateMutationOutput,
|
ChannelCreateMutationOutput,
|
||||||
} from '@/shared/mutations/channel-create';
|
} from '@/shared/mutations/channel-create';
|
||||||
import { ChannelAttributes } from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
export class ChannelCreateMutationHandler
|
export class ChannelCreateMutationHandler
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
import { generateId, IdType, NodeTypes, NodeRoles } from '@colanode/core';
|
import { generateId, IdType, NodeTypes, ChatAttributes } from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
ChatCreateMutationInput,
|
ChatCreateMutationInput,
|
||||||
ChatCreateMutationOutput,
|
ChatCreateMutationOutput,
|
||||||
} from '@/shared/mutations/chat-create';
|
} from '@/shared/mutations/chat-create';
|
||||||
import { sql } from 'kysely';
|
import { sql } from 'kysely';
|
||||||
import { ChatAttributes } from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
interface ChatRow {
|
interface ChatRow {
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import { extractFileType, generateId, IdType } from '@colanode/core';
|
import {
|
||||||
|
extractFileType,
|
||||||
|
generateId,
|
||||||
|
IdType,
|
||||||
|
FileAttributes,
|
||||||
|
} from '@colanode/core';
|
||||||
import {
|
import {
|
||||||
FileCreateMutationInput,
|
FileCreateMutationInput,
|
||||||
FileCreateMutationOutput,
|
FileCreateMutationOutput,
|
||||||
} from '@/shared/mutations/file-create';
|
} from '@/shared/mutations/file-create';
|
||||||
import { fileService } from '@/main/services/file-service';
|
import { fileService } from '@/main/services/file-service';
|
||||||
import { FileAttributes } from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
export class FileCreateMutationHandler
|
export class FileCreateMutationHandler
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { generateId, IdType } from '@colanode/core';
|
import { generateId, IdType, FolderAttributes } from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
FolderCreateMutationInput,
|
FolderCreateMutationInput,
|
||||||
FolderCreateMutationOutput,
|
FolderCreateMutationOutput,
|
||||||
} from '@/shared/mutations/folder-create';
|
} from '@/shared/mutations/folder-create';
|
||||||
import { FolderAttributes } from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
export class FolderCreateMutationHandler
|
export class FolderCreateMutationHandler
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import {
|
|||||||
EditorNodeTypes,
|
EditorNodeTypes,
|
||||||
NodeTypes,
|
NodeTypes,
|
||||||
extractFileType,
|
extractFileType,
|
||||||
|
Block,
|
||||||
|
FileAttributes,
|
||||||
|
MessageAttributes,
|
||||||
} from '@colanode/core';
|
} from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
@@ -12,7 +15,6 @@ import {
|
|||||||
} from '@/shared/mutations/message-create';
|
} from '@/shared/mutations/message-create';
|
||||||
import { mapContentsToBlocks } from '@/shared/lib/editor';
|
import { mapContentsToBlocks } from '@/shared/lib/editor';
|
||||||
import { fileService } from '@/main/services/file-service';
|
import { fileService } from '@/main/services/file-service';
|
||||||
import { Block, FileAttributes, MessageAttributes } from '@colanode/core';
|
|
||||||
import { CreateNodeInput, nodeService } from '@/main/services/node-service';
|
import { CreateNodeInput, nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
export class MessageCreateMutationHandler
|
export class MessageCreateMutationHandler
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { generateId, IdType } from '@colanode/core';
|
import { generateId, IdType, PageAttributes } from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
PageCreateMutationInput,
|
PageCreateMutationInput,
|
||||||
PageCreateMutationOutput,
|
PageCreateMutationOutput,
|
||||||
} from '@/shared/mutations/page-create';
|
} from '@/shared/mutations/page-create';
|
||||||
import { PageAttributes } from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
export class PageCreateMutationHandler
|
export class PageCreateMutationHandler
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { generateId, IdType } from '@colanode/core';
|
import { generateId, IdType, RecordAttributes } from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
RecordCreateMutationInput,
|
RecordCreateMutationInput,
|
||||||
RecordCreateMutationOutput,
|
RecordCreateMutationOutput,
|
||||||
} from '@/shared/mutations/record-create';
|
} from '@/shared/mutations/record-create';
|
||||||
import { RecordAttributes } from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
|
|
||||||
export class RecordCreateMutationHandler
|
export class RecordCreateMutationHandler
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import { generateId, IdType, NodeRoles } from '@colanode/core';
|
import {
|
||||||
|
generateId,
|
||||||
|
IdType,
|
||||||
|
ChannelAttributes,
|
||||||
|
PageAttributes,
|
||||||
|
SpaceAttributes,
|
||||||
|
} from '@colanode/core';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import {
|
import {
|
||||||
SpaceCreateMutationInput,
|
SpaceCreateMutationInput,
|
||||||
SpaceCreateMutationOutput,
|
SpaceCreateMutationOutput,
|
||||||
} from '@/shared/mutations/space-create';
|
} from '@/shared/mutations/space-create';
|
||||||
import {
|
|
||||||
ChannelAttributes,
|
|
||||||
PageAttributes,
|
|
||||||
SpaceAttributes,
|
|
||||||
} from '@colanode/core';
|
|
||||||
import { nodeService } from '@/main/services/node-service';
|
import { nodeService } from '@/main/services/node-service';
|
||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export class WorkspaceUsersInviteMutationHandler
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data } = await httpClient.post<WorkspaceUsersInviteOutput>(
|
await httpClient.post<WorkspaceUsersInviteOutput>(
|
||||||
`/v1/workspaces/${workspace.workspace_id}/users`,
|
`/v1/workspaces/${workspace.workspace_id}/users`,
|
||||||
{
|
{
|
||||||
emails: input.emails,
|
emails: input.emails,
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ export class AccountGetQueryHandler
|
|||||||
|
|
||||||
public async checkForChanges(
|
public async checkForChanges(
|
||||||
event: Event,
|
event: Event,
|
||||||
input: AccountGetQueryInput,
|
input: AccountGetQueryInput
|
||||||
output: Account | null
|
|
||||||
): Promise<ChangeCheckResult<AccountGetQueryInput>> {
|
): Promise<ChangeCheckResult<AccountGetQueryInput>> {
|
||||||
if (
|
if (
|
||||||
event.type === 'account_created' &&
|
event.type === 'account_created' &&
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
import { mapNode } from '@/main/utils';
|
import { mapNode, fetchNodeAncestors } from '@/main/utils';
|
||||||
import { SelectNode } from '@/main/data/workspace/schema';
|
import { SelectNode } from '@/main/data/workspace/schema';
|
||||||
import { ChangeCheckResult, QueryHandler } from '@/main/types';
|
import { ChangeCheckResult, QueryHandler } from '@/main/types';
|
||||||
import { NodeTreeGetQueryInput } from '@/shared/queries/node-tree-get';
|
import { NodeTreeGetQueryInput } from '@/shared/queries/node-tree-get';
|
||||||
import { fetchNodeAncestors } from '@/main/utils';
|
|
||||||
import { Event } from '@/shared/types/events';
|
import { Event } from '@/shared/types/events';
|
||||||
import { Node } from '@colanode/core';
|
import { Node } from '@colanode/core';
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ import {
|
|||||||
DatabaseNode,
|
DatabaseNode,
|
||||||
RecordNode,
|
RecordNode,
|
||||||
isStringArray,
|
isStringArray,
|
||||||
|
NodeTypes,
|
||||||
} from '@colanode/core';
|
} from '@colanode/core';
|
||||||
import { mapNode } from '@/main/utils';
|
import { mapNode } from '@/main/utils';
|
||||||
import { NodeTypes } from '@colanode/core';
|
|
||||||
import { Event } from '@/shared/types/events';
|
import { Event } from '@/shared/types/events';
|
||||||
|
|
||||||
export class RecordListQueryHandler
|
export class RecordListQueryHandler
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import { UserSearchQueryInput } from '@/shared/queries/user-search';
|
|||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
import { sql } from 'kysely';
|
import { sql } from 'kysely';
|
||||||
import { SelectNode } from '@/main/data/workspace/schema';
|
import { SelectNode } from '@/main/data/workspace/schema';
|
||||||
import { NodeTypes } from '@colanode/core';
|
import { NodeTypes, UserNode } from '@colanode/core';
|
||||||
import { UserNode } from '@colanode/core';
|
|
||||||
import { ChangeCheckResult, QueryHandler } from '@/main/types';
|
import { ChangeCheckResult, QueryHandler } from '@/main/types';
|
||||||
import { mapNode } from '@/main/utils';
|
import { mapNode } from '@/main/utils';
|
||||||
import { Event } from '@/shared/types/events';
|
import { Event } from '@/shared/types/events';
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { WorkspaceUserListQueryInput } from '@/shared/queries/workspace-user-list';
|
import { WorkspaceUserListQueryInput } from '@/shared/queries/workspace-user-list';
|
||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
import { NodeTypes } from '@colanode/core';
|
import { NodeTypes, UserNode } from '@colanode/core';
|
||||||
import { mapNode } from '@/main/utils';
|
import { mapNode } from '@/main/utils';
|
||||||
import { SelectNode } from '@/main/data/workspace/schema';
|
import { SelectNode } from '@/main/data/workspace/schema';
|
||||||
import { UserNode } from '@colanode/core';
|
|
||||||
import { ChangeCheckResult, QueryHandler } from '@/main/types';
|
import { ChangeCheckResult, QueryHandler } from '@/main/types';
|
||||||
import { Event } from '@/shared/types/events';
|
import { Event } from '@/shared/types/events';
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
getWorkspaceDirectoryPath,
|
getWorkspaceDirectoryPath,
|
||||||
mapAccount,
|
mapAccount,
|
||||||
mapWorkspace,
|
mapWorkspace,
|
||||||
|
getAccountAvatarsDirectoryPath,
|
||||||
} from '@/main/utils';
|
} from '@/main/utils';
|
||||||
import { getAccountAvatarsDirectoryPath } from '@/main/utils';
|
|
||||||
import { eventBus } from '@/shared/lib/event-bus';
|
import { eventBus } from '@/shared/lib/event-bus';
|
||||||
import { serverService } from '@/main/services/server-service';
|
import { serverService } from '@/main/services/server-service';
|
||||||
import { createLogger } from '@/main/logger';
|
import { createLogger } from '@/main/logger';
|
||||||
@@ -282,7 +282,7 @@ class AccountService {
|
|||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
`Logged out account ${deletedToken.account_id} from server ${deletedToken.domain}`
|
`Logged out account ${deletedToken.account_id} from server ${deletedToken.domain}`
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch {
|
||||||
this.logger.warn(
|
this.logger.warn(
|
||||||
`Failed to logout account ${deletedToken.account_id} from server ${deletedToken.domain}`
|
`Failed to logout account ${deletedToken.account_id} from server ${deletedToken.domain}`
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,11 +42,14 @@ class AvatarService {
|
|||||||
return new Response(null, { status: 404 });
|
return new Response(null, { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await httpClient.get<any>(`/v1/avatars/${avatarId}`, {
|
const response = await httpClient.get<NodeJS.ReadableStream>(
|
||||||
domain: credentials.domain,
|
`/v1/avatars/${avatarId}`,
|
||||||
token: credentials.token,
|
{
|
||||||
responseType: 'stream',
|
domain: credentials.domain,
|
||||||
});
|
token: credentials.token,
|
||||||
|
responseType: 'stream',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (response.status !== 200 || !response.data) {
|
if (response.status !== 200 || !response.data) {
|
||||||
this.logger.warn(
|
this.logger.warn(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { CommandInput } from '@/shared/commands';
|
import { CommandInput, CommandMap } from '@/shared/commands';
|
||||||
import { createLogger } from '@/main/logger';
|
import { createLogger } from '@/main/logger';
|
||||||
import { CommandMap } from '@/shared/commands';
|
|
||||||
import { commandHandlerMap } from '@/main/commands';
|
import { commandHandlerMap } from '@/main/commands';
|
||||||
import { CommandHandler } from '@/main/types';
|
import { CommandHandler } from '@/main/types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { MutationInput } from '@/shared/mutations';
|
import { MutationInput, MutationMap } from '@/shared/mutations';
|
||||||
import { MutationMap } from '@/shared/mutations';
|
|
||||||
import { mutationHandlerMap } from '@/main/mutations';
|
import { mutationHandlerMap } from '@/main/mutations';
|
||||||
import { MutationHandler } from '@/main/types';
|
import { MutationHandler } from '@/main/types';
|
||||||
import { createLogger } from '@/main/logger';
|
import { createLogger } from '@/main/logger';
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import {
|
|||||||
ServerNodeDeleteTransaction,
|
ServerNodeDeleteTransaction,
|
||||||
ServerNodeTransaction,
|
ServerNodeTransaction,
|
||||||
ServerNodeUpdateTransaction,
|
ServerNodeUpdateTransaction,
|
||||||
|
generateId,
|
||||||
|
IdType,
|
||||||
} from '@colanode/core';
|
} from '@colanode/core';
|
||||||
import { decodeState, YDoc } from '@colanode/crdt';
|
import { decodeState, YDoc } from '@colanode/crdt';
|
||||||
import { generateId, IdType } from '@colanode/core';
|
|
||||||
import { databaseService } from '@/main/data/database-service';
|
import { databaseService } from '@/main/data/database-service';
|
||||||
import {
|
import {
|
||||||
fetchNodeAncestors,
|
fetchNodeAncestors,
|
||||||
@@ -274,7 +275,7 @@ class NodeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ancestors = ancestorRows.map(mapNode);
|
const ancestors = ancestorRows.map(mapNode);
|
||||||
let node = mapNode(nodeRow);
|
const node = mapNode(nodeRow);
|
||||||
|
|
||||||
if (!node) {
|
if (!node) {
|
||||||
throw new Error('Node not found');
|
throw new Error('Node not found');
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ class QueryService {
|
|||||||
typeof query.input
|
typeof query.input
|
||||||
>;
|
>;
|
||||||
|
|
||||||
let result: any = query.result;
|
type QueryOutput = QueryMap[(typeof query.input)['type']]['output'];
|
||||||
|
let result: QueryOutput = query.result;
|
||||||
let hasChanges = false;
|
let hasChanges = false;
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
const changeCheckResult = await handler.checkForChanges(
|
const changeCheckResult = await handler.checkForChanges(
|
||||||
@@ -95,7 +96,7 @@ class QueryService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (changeCheckResult.hasChanges) {
|
if (changeCheckResult.hasChanges) {
|
||||||
result = changeCheckResult.result;
|
result = changeCheckResult.result as QueryOutput;
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class ServerService {
|
|||||||
try {
|
try {
|
||||||
const { status, data } = await axios.get<ServerConfig>(configUrl);
|
const { status, data } = await axios.get<ServerConfig>(configUrl);
|
||||||
return status === 200 ? data : null;
|
return status === 200 ? data : null;
|
||||||
} catch (error) {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { CommandMap } from '@/shared/commands';
|
import { CommandMap, CommandInput } from '@/shared/commands';
|
||||||
import { CommandInput } from '@/shared/commands';
|
|
||||||
import { MutationInput, MutationMap } from '@/shared/mutations';
|
import { MutationInput, MutationMap } from '@/shared/mutations';
|
||||||
import { QueryInput, QueryMap } from '@/shared/queries';
|
import { QueryInput, QueryMap } from '@/shared/queries';
|
||||||
import { Event } from '@/shared/types/events';
|
import { Event } from '@/shared/types/events';
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
SelectUpload,
|
SelectUpload,
|
||||||
WorkspaceDatabaseSchema,
|
WorkspaceDatabaseSchema,
|
||||||
} from '@/main/data/workspace/schema';
|
} from '@/main/data/workspace/schema';
|
||||||
import { LocalNodeTransaction, Node, NodeTypes } from '@colanode/core';
|
import { LocalNodeTransaction, Node } from '@colanode/core';
|
||||||
import { Account } from '@/shared/types/accounts';
|
import { Account } from '@/shared/types/accounts';
|
||||||
import {
|
import {
|
||||||
SelectAccount,
|
SelectAccount,
|
||||||
@@ -102,7 +102,7 @@ export const fetchNodeAncestors = (
|
|||||||
export const mapNode = (row: SelectNode): Node => {
|
export const mapNode = (row: SelectNode): Node => {
|
||||||
return {
|
return {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
type: row.type as any,
|
type: row.type,
|
||||||
parentId: row.parent_id,
|
parentId: row.parent_id,
|
||||||
attributes: JSON.parse(row.attributes),
|
attributes: JSON.parse(row.attributes),
|
||||||
createdAt: row.created_at,
|
createdAt: row.created_at,
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
// See the Electron documentation for details on how to use preload scripts:
|
// See the Electron documentation for details on how to use preload scripts:
|
||||||
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
|
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
|
||||||
import { CommandMap } from '@/shared/commands';
|
import { CommandMap, CommandInput } from '@/shared/commands';
|
||||||
import { CommandInput } from '@/shared/commands';
|
import { MutationMap, MutationInput } from '@/shared/mutations';
|
||||||
import { MutationMap } from '@/shared/mutations';
|
|
||||||
import { MutationInput } from '@/shared/mutations';
|
|
||||||
import { QueryInput, QueryMap } from '@/shared/queries';
|
import { QueryInput, QueryMap } from '@/shared/queries';
|
||||||
import { contextBridge, ipcRenderer } from 'electron';
|
import { contextBridge, ipcRenderer } from 'electron';
|
||||||
import { eventBus } from '@/shared/lib/event-bus';
|
import { eventBus } from '@/shared/lib/event-bus';
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
import { AppContext } from '@/renderer/contexts/app';
|
|
||||||
import { RadarProvider } from '@/renderer/radar-provider';
|
import { RadarProvider } from '@/renderer/radar-provider';
|
||||||
|
|
||||||
export const App = () => {
|
export const App = () => {
|
||||||
return (
|
return (
|
||||||
<AppContext.Provider value={{}}>
|
<RadarProvider>
|
||||||
<RadarProvider>
|
<Outlet />
|
||||||
<Outlet />
|
</RadarProvider>
|
||||||
</RadarProvider>
|
|
||||||
</AppContext.Provider>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/renderer/components/ui/dialog';
|
} from '@/renderer/components/ui/dialog';
|
||||||
import { useMutation } from '@/renderer/hooks/use-mutation';
|
import { useMutation } from '@/renderer/hooks/use-mutation';
|
||||||
import { IdType } from '@colanode/core';
|
import { IdType, generateId } from '@colanode/core';
|
||||||
import { ChannelForm } from '@/renderer/components/channels/channel-form';
|
import { ChannelForm } from '@/renderer/components/channels/channel-form';
|
||||||
import { generateId } from '@colanode/core';
|
|
||||||
|
|
||||||
interface ChannelCreateDialogProps {
|
interface ChannelCreateDialogProps {
|
||||||
spaceId: string;
|
spaceId: string;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const BoardViewColumn = ({ field, option }: BoardViewColumnProps) => {
|
|||||||
const lightClass = getSelectOptionLightColorClass(option.color ?? 'gray');
|
const lightClass = getSelectOptionLightColorClass(option.color ?? 'gray');
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={dropRef as any}
|
ref={dropRef as React.LegacyRef<HTMLDivElement>}
|
||||||
className={cn('min-h-[400px] border-r p-1', isDragging && lightClass)}
|
className={cn('min-h-[400px] border-r p-1', isDragging && lightClass)}
|
||||||
style={{
|
style={{
|
||||||
minWidth: '250px',
|
minWidth: '250px',
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const BoardViewRecordCard = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={dragRef as any}
|
ref={dragRef as React.LegacyRef<HTMLDivElement>}
|
||||||
role="presentation"
|
role="presentation"
|
||||||
key={record.id}
|
key={record.id}
|
||||||
className="animate-fade-in flex cursor-pointer flex-col gap-1 rounded-md border p-2 text-left hover:bg-gray-50"
|
className="animate-fade-in flex cursor-pointer flex-col gap-1 rounded-md border p-2 text-left hover:bg-gray-50"
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/renderer/components/ui/dialog';
|
} from '@/renderer/components/ui/dialog';
|
||||||
import { useMutation } from '@/renderer/hooks/use-mutation';
|
import { useMutation } from '@/renderer/hooks/use-mutation';
|
||||||
import { IdType } from '@colanode/core';
|
import { IdType, generateId } from '@colanode/core';
|
||||||
import { generateId } from '@colanode/core';
|
|
||||||
import { DatabaseForm } from '@/renderer/components/databases/database-form';
|
import { DatabaseForm } from '@/renderer/components/databases/database-form';
|
||||||
|
|
||||||
interface DatabaseCreateDialogProps {
|
interface DatabaseCreateDialogProps {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
} from '@/renderer/components/ui/dialog';
|
} from '@/renderer/components/ui/dialog';
|
||||||
import { useMutation } from '@/renderer/hooks/use-mutation';
|
import { useMutation } from '@/renderer/hooks/use-mutation';
|
||||||
import { DatabaseNode, hasEditorAccess, NodeRole } from '@colanode/core';
|
import { DatabaseNode, hasEditorAccess, NodeRole } from '@colanode/core';
|
||||||
import { ChannelForm } from '@/renderer/components/channels/channel-form';
|
|
||||||
import { toast } from '@/renderer/hooks/use-toast';
|
import { toast } from '@/renderer/hooks/use-toast';
|
||||||
import { DatabaseForm } from './database-form';
|
import { DatabaseForm } from './database-form';
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export const TableViewFieldHeader = ({
|
|||||||
? 'border-r-2 border-blue-300'
|
? 'border-r-2 border-blue-300'
|
||||||
: 'border-r'
|
: 'border-r'
|
||||||
)}
|
)}
|
||||||
ref={dragDropRef as any}
|
ref={dragDropRef as React.LegacyRef<HTMLDivElement>}
|
||||||
>
|
>
|
||||||
<FieldIcon type={viewField.field.type} className="size-4" />
|
<FieldIcon type={viewField.field.type} className="size-4" />
|
||||||
<p>{viewField.field.name}</p>
|
<p>{viewField.field.name}</p>
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/renderer/components/ui/dialog';
|
} from '@/renderer/components/ui/dialog';
|
||||||
import { useMutation } from '@/renderer/hooks/use-mutation';
|
import { useMutation } from '@/renderer/hooks/use-mutation';
|
||||||
import { IdType } from '@colanode/core';
|
import { IdType, generateId } from '@colanode/core';
|
||||||
import { generateId } from '@colanode/core';
|
import { FolderForm } from '@/renderer/components/folders/folder-form';
|
||||||
import { FolderForm } from './folder-form';
|
|
||||||
|
|
||||||
interface FolderCreateDialogProps {
|
interface FolderCreateDialogProps {
|
||||||
spaceId: string;
|
spaceId: string;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { MessageNode, SpaceNode } from '@colanode/core';
|
import { MessageNode } from '@colanode/core';
|
||||||
import { Avatar } from '@/renderer/components/avatars/avatar';
|
|
||||||
import { MessageCircleMore } from 'lucide-react';
|
import { MessageCircleMore } from 'lucide-react';
|
||||||
|
|
||||||
interface MessageBreadcrumbItemProps {
|
interface MessageBreadcrumbItemProps {
|
||||||
@@ -8,7 +7,7 @@ interface MessageBreadcrumbItemProps {
|
|||||||
|
|
||||||
export const MessageBreadcrumbItem = ({ node }: MessageBreadcrumbItemProps) => {
|
export const MessageBreadcrumbItem = ({ node }: MessageBreadcrumbItemProps) => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center space-x-2">
|
<div key={node.id} className="flex items-center space-x-2">
|
||||||
<MessageCircleMore className="size-5" />
|
<MessageCircleMore className="size-5" />
|
||||||
<span>Message</span>
|
<span>Message</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/renderer/components/ui/dialog';
|
} from '@/renderer/components/ui/dialog';
|
||||||
import { useMutation } from '@/renderer/hooks/use-mutation';
|
import { useMutation } from '@/renderer/hooks/use-mutation';
|
||||||
import { IdType } from '@colanode/core';
|
import { IdType, generateId } from '@colanode/core';
|
||||||
import { PageForm } from '@/renderer/components/pages/page-form';
|
import { PageForm } from '@/renderer/components/pages/page-form';
|
||||||
import { generateId } from '@colanode/core';
|
|
||||||
|
|
||||||
interface PageCreateDialogProps {
|
interface PageCreateDialogProps {
|
||||||
spaceId: string;
|
spaceId: string;
|
||||||
|
|||||||
@@ -7,15 +7,9 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/renderer/components/ui/dialog';
|
} from '@/renderer/components/ui/dialog';
|
||||||
import { useMutation } from '@/renderer/hooks/use-mutation';
|
import { useMutation } from '@/renderer/hooks/use-mutation';
|
||||||
import {
|
import { hasEditorAccess, NodeRole, PageNode } from '@colanode/core';
|
||||||
ChannelNode,
|
|
||||||
hasEditorAccess,
|
|
||||||
NodeRole,
|
|
||||||
PageNode,
|
|
||||||
} from '@colanode/core';
|
|
||||||
import { ChannelForm } from '@/renderer/components/channels/channel-form';
|
|
||||||
import { toast } from '@/renderer/hooks/use-toast';
|
import { toast } from '@/renderer/hooks/use-toast';
|
||||||
import { PageForm } from './page-form';
|
import { PageForm } from '@/renderer/components/pages/page-form';
|
||||||
|
|
||||||
interface PageUpdateDialogProps {
|
interface PageUpdateDialogProps {
|
||||||
page: PageNode;
|
page: PageNode;
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ const Command = React.forwardRef<
|
|||||||
));
|
));
|
||||||
Command.displayName = CommandPrimitive.displayName;
|
Command.displayName = CommandPrimitive.displayName;
|
||||||
|
|
||||||
interface CommandDialogProps extends DialogProps {}
|
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
||||||
|
|
||||||
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
|
||||||
return (
|
return (
|
||||||
<Dialog {...props}>
|
<Dialog {...props}>
|
||||||
<DialogContent className="overflow-hidden p-0">
|
<DialogContent className="overflow-hidden p-0">
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const Dropzone = ({ text, children, onDrop }: DropzoneProps) => {
|
|||||||
|
|
||||||
const isActive = canDrop && isOver;
|
const isActive = canDrop && isOver;
|
||||||
return (
|
return (
|
||||||
<div ref={dropRef as any}>
|
<div ref={dropRef as React.LegacyRef<HTMLDivElement>}>
|
||||||
{isActive && (
|
{isActive && (
|
||||||
<div className="fixed bottom-0 left-0 right-0 top-0 z-50">
|
<div className="fixed bottom-0 left-0 right-0 top-0 z-50">
|
||||||
<div className="absolute inset-0 flex items-center justify-center bg-gray-500 opacity-50 transition-all duration-100 ease-in-out">
|
<div className="absolute inset-0 flex items-center justify-center bg-gray-500 opacity-50 transition-all duration-100 ease-in-out">
|
||||||
|
|||||||
@@ -2,24 +2,22 @@ import * as React from 'react';
|
|||||||
|
|
||||||
import { cn } from '@/shared/lib/utils';
|
import { cn } from '@/shared/lib/utils';
|
||||||
|
|
||||||
export interface InputProps
|
const Input = React.forwardRef<
|
||||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
HTMLInputElement,
|
||||||
|
React.InputHTMLAttributes<HTMLInputElement>
|
||||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
>(({ className, type, ...props }, ref) => {
|
||||||
({ className, type, ...props }, ref) => {
|
return (
|
||||||
return (
|
<input
|
||||||
<input
|
type={type}
|
||||||
type={type}
|
className={cn(
|
||||||
className={cn(
|
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
||||||
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
className
|
||||||
className
|
)}
|
||||||
)}
|
ref={ref}
|
||||||
ref={ref}
|
{...props}
|
||||||
{...props}
|
/>
|
||||||
/>
|
);
|
||||||
);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
Input.displayName = 'Input';
|
Input.displayName = 'Input';
|
||||||
|
|
||||||
export { Input };
|
export { Input };
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ const Sidebar = React.forwardRef<
|
|||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
const { state, open, setOpen, toggleSidebar } = useSidebar();
|
const { state } = useSidebar();
|
||||||
|
|
||||||
if (collapsible === 'none') {
|
if (collapsible === 'none') {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,23 +2,21 @@ import * as React from 'react';
|
|||||||
|
|
||||||
import { cn } from '@/shared/lib/utils';
|
import { cn } from '@/shared/lib/utils';
|
||||||
|
|
||||||
export interface TextareaProps
|
const Textarea = React.forwardRef<
|
||||||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
HTMLTextAreaElement,
|
||||||
|
React.TextareaHTMLAttributes<HTMLTextAreaElement>
|
||||||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
>(({ className, ...props }, ref) => {
|
||||||
({ className, ...props }, ref) => {
|
return (
|
||||||
return (
|
<textarea
|
||||||
<textarea
|
className={cn(
|
||||||
className={cn(
|
'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
||||||
'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
className
|
||||||
className
|
)}
|
||||||
)}
|
ref={ref}
|
||||||
ref={ref}
|
{...props}
|
||||||
{...props}
|
/>
|
||||||
/>
|
);
|
||||||
);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
Textarea.displayName = 'Textarea';
|
Textarea.displayName = 'Textarea';
|
||||||
|
|
||||||
export { Textarea };
|
export { Textarea };
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import { createContext, useContext } from 'react';
|
|
||||||
|
|
||||||
interface AppContext {}
|
|
||||||
|
|
||||||
export const AppContext = createContext<AppContext>({} as AppContext);
|
|
||||||
|
|
||||||
export const useApp = () => useContext(AppContext);
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { NodeRole } from '@colanode/core';
|
import { NodeRole, MessageNode } from '@colanode/core';
|
||||||
import { createContext, useContext } from 'react';
|
import { createContext, useContext } from 'react';
|
||||||
import { MessageNode } from '@colanode/core';
|
|
||||||
|
|
||||||
interface ConversationContext {
|
interface ConversationContext {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Blockquote from '@tiptap/extension-blockquote';
|
import { Blockquote } from '@tiptap/extension-blockquote';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import BulletList from '@tiptap/extension-bullet-list';
|
import { BulletList } from '@tiptap/extension-bullet-list';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight';
|
import { CodeBlockLowlight } from '@tiptap/extension-code-block-lowlight';
|
||||||
import { ReactNodeViewRenderer } from '@tiptap/react';
|
import { ReactNodeViewRenderer } from '@tiptap/react';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Code from '@tiptap/extension-code';
|
import { Code } from '@tiptap/extension-code';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import React from 'react';
|
|||||||
import type { Range } from '@tiptap/core';
|
import type { Range } from '@tiptap/core';
|
||||||
import { Editor, Extension } from '@tiptap/core';
|
import { Editor, Extension } from '@tiptap/core';
|
||||||
import { ReactRenderer } from '@tiptap/react';
|
import { ReactRenderer } from '@tiptap/react';
|
||||||
import Suggestion, {
|
import {
|
||||||
|
Suggestion,
|
||||||
type SuggestionKeyDownProps,
|
type SuggestionKeyDownProps,
|
||||||
type SuggestionProps,
|
type SuggestionProps,
|
||||||
} from '@tiptap/suggestion';
|
} from '@tiptap/suggestion';
|
||||||
@@ -43,8 +44,8 @@ const CommandList = ({
|
|||||||
range,
|
range,
|
||||||
}: {
|
}: {
|
||||||
items: EditorCommand[];
|
items: EditorCommand[];
|
||||||
command: any;
|
command: (item: EditorCommand, range: Range) => void;
|
||||||
range: any;
|
range: Range;
|
||||||
}) => {
|
}) => {
|
||||||
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
||||||
|
|
||||||
@@ -129,6 +130,8 @@ const CommandList = ({
|
|||||||
|
|
||||||
const renderItems = () => {
|
const renderItems = () => {
|
||||||
let component: ReactRenderer | null = null;
|
let component: ReactRenderer | null = null;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let popup: any | null = null;
|
let popup: any | null = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -138,7 +141,7 @@ const renderItems = () => {
|
|||||||
editor: props.editor,
|
editor: props.editor,
|
||||||
});
|
});
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error Tippy instance type is complex, ignoring for simplicity
|
||||||
popup = tippy('body', {
|
popup = tippy('body', {
|
||||||
getReferenceClientRect: props.clientRect,
|
getReferenceClientRect: props.clientRect,
|
||||||
appendTo: () => document.body,
|
appendTo: () => document.body,
|
||||||
@@ -152,10 +155,11 @@ const renderItems = () => {
|
|||||||
onUpdate: (props: SuggestionProps<EditorCommand>) => {
|
onUpdate: (props: SuggestionProps<EditorCommand>) => {
|
||||||
component?.updateProps(props);
|
component?.updateProps(props);
|
||||||
|
|
||||||
popup &&
|
if (popup) {
|
||||||
popup[0].setProps({
|
popup[0].setProps({
|
||||||
getReferenceClientRect: props.clientRect,
|
getReferenceClientRect: props.clientRect,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onKeyDown: (props: SuggestionKeyDownProps) => {
|
onKeyDown: (props: SuggestionKeyDownProps) => {
|
||||||
if (props.event.key === 'Escape') {
|
if (props.event.key === 'Escape') {
|
||||||
@@ -168,7 +172,7 @@ const renderItems = () => {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error Tippy instance type is complex, ignoring for simplicity
|
||||||
return component?.ref?.onKeyDown(props);
|
return component?.ref?.onKeyDown(props);
|
||||||
},
|
},
|
||||||
onExit: () => {
|
onExit: () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { InputRule } from '@tiptap/core';
|
import { InputRule } from '@tiptap/core';
|
||||||
import HorizontalRule from '@tiptap/extension-horizontal-rule';
|
import { HorizontalRule } from '@tiptap/extension-horizontal-rule';
|
||||||
|
|
||||||
export const DividerNode = HorizontalRule.extend({
|
export const DividerNode = HorizontalRule.extend({
|
||||||
addInputRules() {
|
addInputRules() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Dropcursor from '@tiptap/extension-dropcursor';
|
import { Dropcursor } from '@tiptap/extension-dropcursor';
|
||||||
|
|
||||||
export const DropcursorExtension = Dropcursor.configure({
|
export const DropcursorExtension = Dropcursor.configure({
|
||||||
width: 5,
|
width: 5,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core';
|
|||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
export interface Heading1Options {
|
export interface Heading1Options {
|
||||||
HTMLAttributes: Record<string, any>;
|
HTMLAttributes: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@tiptap/core' {
|
declare module '@tiptap/core' {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core';
|
|||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
export interface Heading2Options {
|
export interface Heading2Options {
|
||||||
HTMLAttributes: Record<string, any>;
|
HTMLAttributes: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@tiptap/core' {
|
declare module '@tiptap/core' {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core';
|
|||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
export interface Heading3Options {
|
export interface Heading3Options {
|
||||||
HTMLAttributes: Record<string, any>;
|
HTMLAttributes: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@tiptap/core' {
|
declare module '@tiptap/core' {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Link from '@tiptap/extension-link';
|
import { Link } from '@tiptap/extension-link';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import ListItem from '@tiptap/extension-list-item';
|
import { ListItem } from '@tiptap/extension-list-item';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import ListKeymap from '@tiptap/extension-list-keymap';
|
import { ListKeymap } from '@tiptap/extension-list-keymap';
|
||||||
|
|
||||||
export const ListKeymapExtension = ListKeymap.configure({
|
export const ListKeymapExtension = ListKeymap.configure({
|
||||||
listTypes: [
|
listTypes: [
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import OrderedList from '@tiptap/extension-ordered-list';
|
import { OrderedList } from '@tiptap/extension-ordered-list';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Paragraph from '@tiptap/extension-paragraph';
|
import { Paragraph } from '@tiptap/extension-paragraph';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Placeholder, { PlaceholderOptions } from '@tiptap/extension-placeholder';
|
import { Placeholder, PlaceholderOptions } from '@tiptap/extension-placeholder';
|
||||||
|
|
||||||
interface PlaceholderProps extends PlaceholderOptions {
|
interface PlaceholderProps extends PlaceholderOptions {
|
||||||
message: string;
|
message: string;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { Extension } from '@tiptap/core';
|
import { Extension } from '@tiptap/core';
|
||||||
|
|
||||||
interface TabKeymapExtensionOptions {}
|
export const TabKeymapExtension = Extension.create({
|
||||||
|
|
||||||
export const TabKeymapExtension = Extension.create<TabKeymapExtensionOptions>({
|
|
||||||
name: 'tabKeymap',
|
name: 'tabKeymap',
|
||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import TaskItem from '@tiptap/extension-task-item';
|
import { TaskItem } from '@tiptap/extension-task-item';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import TaskList from '@tiptap/extension-task-list';
|
import { TaskList } from '@tiptap/extension-task-list';
|
||||||
|
|
||||||
import { defaultClasses } from '@/renderer/editor/classes';
|
import { defaultClasses } from '@/renderer/editor/classes';
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import { Extension } from '@tiptap/core';
|
import { Extension } from '@tiptap/core';
|
||||||
import { NodeType } from '@tiptap/pm/model';
|
import { NodeType, Node } from '@tiptap/pm/model';
|
||||||
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
||||||
|
|
||||||
const nodeEqualsType = ({ types, node }: { types: NodeType[]; node: any }) => {
|
const nodeEqualsType = ({
|
||||||
return (
|
types,
|
||||||
(Array.isArray(types) && types.includes(node?.type)) || node?.type === types
|
node,
|
||||||
);
|
}: {
|
||||||
|
types: NodeType[];
|
||||||
|
node: Node | null;
|
||||||
|
}) => {
|
||||||
|
return Array.isArray(types) && node?.type && types.includes(node.type);
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface TrailingNodeOptions {
|
export interface TrailingNodeOptions {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const isValidUrl = (url: string) => {
|
|||||||
try {
|
try {
|
||||||
new URL(url);
|
new URL(url);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -24,7 +24,7 @@ const getUrlFromString = (str: string): string | null => {
|
|||||||
if (str.includes('.') && !str.includes(' ')) {
|
if (str.includes('.') && !str.includes(' ')) {
|
||||||
return new URL(`https://${str}`).toString();
|
return new URL(`https://${str}`).toString();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { JSONContent } from '@tiptap/core';
|
|||||||
|
|
||||||
interface MarkRendererProps {
|
interface MarkRendererProps {
|
||||||
node: JSONContent;
|
node: JSONContent;
|
||||||
children: any | any[];
|
children: React.ReactNode | React.ReactNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MarkRenderer = ({ node, children }: MarkRendererProps) => {
|
export const MarkRenderer = ({ node, children }: MarkRendererProps) => {
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ type ToasterToast = ToastProps & {
|
|||||||
action?: ToastActionElement;
|
action?: ToastActionElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
const actionTypes = {
|
|
||||||
ADD_TOAST: 'ADD_TOAST',
|
|
||||||
UPDATE_TOAST: 'UPDATE_TOAST',
|
|
||||||
DISMISS_TOAST: 'DISMISS_TOAST',
|
|
||||||
REMOVE_TOAST: 'REMOVE_TOAST',
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
function genId() {
|
function genId() {
|
||||||
@@ -30,7 +23,12 @@ function genId() {
|
|||||||
return count.toString();
|
return count.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionType = typeof actionTypes;
|
type ActionType = {
|
||||||
|
ADD_TOAST: 'ADD_TOAST';
|
||||||
|
UPDATE_TOAST: 'UPDATE_TOAST';
|
||||||
|
DISMISS_TOAST: 'DISMISS_TOAST';
|
||||||
|
REMOVE_TOAST: 'REMOVE_TOAST';
|
||||||
|
};
|
||||||
|
|
||||||
type Action =
|
type Action =
|
||||||
| {
|
| {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||||
export interface CommandMap {}
|
export interface CommandMap {}
|
||||||
|
|
||||||
export type CommandInput = CommandMap[keyof CommandMap]['input'];
|
export type CommandInput = CommandMap[keyof CommandMap]['input'];
|
||||||
|
|||||||
@@ -994,7 +994,7 @@ const recordMatchesUrlFilter = (
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isFilterableField = (field: FieldAttributes) => {
|
export const isFilterableField = (_: FieldAttributes) => {
|
||||||
// TODO: Implement this
|
// TODO: Implement this
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import {
|
|||||||
getIdTypeFromNode,
|
getIdTypeFromNode,
|
||||||
generateNodeIndex,
|
generateNodeIndex,
|
||||||
compareString,
|
compareString,
|
||||||
|
Block,
|
||||||
|
BlockLeaf,
|
||||||
} from '@colanode/core';
|
} from '@colanode/core';
|
||||||
import { JSONContent } from '@tiptap/core';
|
import { JSONContent } from '@tiptap/core';
|
||||||
import { Block, BlockLeaf } from '@colanode/core';
|
|
||||||
|
|
||||||
const leafBlockTypes = new Set([
|
const leafBlockTypes = new Set([
|
||||||
EditorNodeTypes.Paragraph,
|
EditorNodeTypes.Paragraph,
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import { serverService } from '@/main/services/server-service';
|
import { serverService } from '@/main/services/server-service';
|
||||||
import { BackoffCalculator } from '@/shared/lib/backoff-calculator';
|
import { BackoffCalculator } from '@/shared/lib/backoff-calculator';
|
||||||
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
import axios, {
|
||||||
|
isAxiosError,
|
||||||
|
AxiosInstance,
|
||||||
|
AxiosRequestConfig,
|
||||||
|
AxiosResponse,
|
||||||
|
AxiosError,
|
||||||
|
} from 'axios';
|
||||||
|
|
||||||
interface HttpClientRequestConfig extends AxiosRequestConfig {
|
interface HttpClientRequestConfig extends AxiosRequestConfig {
|
||||||
domain: string;
|
domain: string;
|
||||||
@@ -38,9 +44,9 @@ class HttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
} catch (error: any) {
|
} catch (error) {
|
||||||
// If error is related to server availability, increase backoff
|
// If error is related to server availability, increase backoff
|
||||||
if (this.isServerError(error)) {
|
if (isAxiosError(error) && this.isServerError(error)) {
|
||||||
if (!this.backoffs.has(config.domain)) {
|
if (!this.backoffs.has(config.domain)) {
|
||||||
this.backoffs.set(config.domain, new BackoffCalculator());
|
this.backoffs.set(config.domain, new BackoffCalculator());
|
||||||
}
|
}
|
||||||
@@ -53,11 +59,11 @@ class HttpClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private isServerError(error: any): boolean {
|
private isServerError(error: AxiosError): boolean {
|
||||||
if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {
|
if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const status = error.response?.status;
|
const status = error.response?.status ?? 0;
|
||||||
return (status >= 500 && status < 600) || status === 429;
|
return (status >= 500 && status < 600) || status === 429;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,15 +82,15 @@ class HttpClient {
|
|||||||
public async get<T>(
|
public async get<T>(
|
||||||
path: string,
|
path: string,
|
||||||
config: HttpClientRequestConfig
|
config: HttpClientRequestConfig
|
||||||
): Promise<AxiosResponse<T, any>> {
|
): Promise<AxiosResponse<T>> {
|
||||||
return this.request<T>('get', path, config);
|
return this.request<T>('get', path, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async post<T>(
|
public async post<T>(
|
||||||
path: string,
|
path: string,
|
||||||
data: any,
|
data: unknown,
|
||||||
config: HttpClientRequestConfig
|
config: HttpClientRequestConfig
|
||||||
): Promise<AxiosResponse<T, any>> {
|
): Promise<AxiosResponse<T>> {
|
||||||
return this.request<T>('post', path, {
|
return this.request<T>('post', path, {
|
||||||
...config,
|
...config,
|
||||||
data,
|
data,
|
||||||
@@ -93,9 +99,9 @@ class HttpClient {
|
|||||||
|
|
||||||
public async put<T>(
|
public async put<T>(
|
||||||
path: string,
|
path: string,
|
||||||
data: any,
|
data: unknown,
|
||||||
config: HttpClientRequestConfig
|
config: HttpClientRequestConfig
|
||||||
): Promise<AxiosResponse<T, any>> {
|
): Promise<AxiosResponse<T>> {
|
||||||
return this.request<T>('put', path, {
|
return this.request<T>('put', path, {
|
||||||
...config,
|
...config,
|
||||||
data,
|
data,
|
||||||
@@ -105,7 +111,7 @@ class HttpClient {
|
|||||||
public async delete<T>(
|
public async delete<T>(
|
||||||
path: string,
|
path: string,
|
||||||
config: HttpClientRequestConfig
|
config: HttpClientRequestConfig
|
||||||
): Promise<AxiosResponse<T, any>> {
|
): Promise<AxiosResponse<T>> {
|
||||||
return this.request<T>('delete', path, config);
|
return this.request<T>('delete', path, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ export const languages: CodeLanguage[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const parseNodes = (
|
const parseNodes = (
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
nodes: any[],
|
nodes: any[],
|
||||||
className: string[] = []
|
className: string[] = []
|
||||||
): CodeHighlightNode[] => {
|
): CodeHighlightNode[] => {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||||
export interface MutationMap {}
|
export interface MutationMap {}
|
||||||
|
|
||||||
export type MutationInput = MutationMap[keyof MutationMap]['input'];
|
export type MutationInput = MutationMap[keyof MutationMap]['input'];
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export type NodeAttributeSetMutationInput = {
|
|||||||
userId: string;
|
userId: string;
|
||||||
nodeId: string;
|
nodeId: string;
|
||||||
path: string;
|
path: string;
|
||||||
value: any;
|
value: unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NodeAttributeSetMutationOutput = {
|
export type NodeAttributeSetMutationOutput = {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||||
export interface QueryMap {}
|
export interface QueryMap {}
|
||||||
|
|
||||||
export type QueryInput = QueryMap[keyof QueryMap]['input'];
|
export type QueryInput = QueryMap[keyof QueryMap]['input'];
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export type UploadDeletedEvent = {
|
|||||||
export type QueryResultUpdatedEvent = {
|
export type QueryResultUpdatedEvent = {
|
||||||
type: 'query_result_updated';
|
type: 'query_result_updated';
|
||||||
id: string;
|
id: string;
|
||||||
result: any;
|
result: unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RadarDataUpdatedEvent = {
|
export type RadarDataUpdatedEvent = {
|
||||||
|
|||||||
6
apps/desktop/src/shared/types/window.d.ts
vendored
6
apps/desktop/src/shared/types/window.d.ts
vendored
@@ -1,8 +1,6 @@
|
|||||||
import { CommandMap } from '@/shared/commands';
|
import { CommandMap, CommandInput } from '@/shared/commands';
|
||||||
import { QueryInput } from '@/shared/queries';
|
import { QueryInput, QueryMap } from '@/shared/queries';
|
||||||
import { MutationInput, MutationMap } from '@/shared/mutations';
|
import { MutationInput, MutationMap } from '@/shared/mutations';
|
||||||
import { QueryMap } from '@/shared/queries';
|
|
||||||
import { CommandInput } from '@/shared/commands';
|
|
||||||
import { EventBus } from '@/shared/lib/event-bus';
|
import { EventBus } from '@/shared/lib/event-bus';
|
||||||
|
|
||||||
export interface ColanodeApi {
|
export interface ColanodeApi {
|
||||||
|
|||||||
1875
package-lock.json
generated
1875
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/colanode/colanode"
|
"url": "https://github.com/colanode/colanode"
|
||||||
},
|
},
|
||||||
|
"packageManager": "npm@10.9.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "turbo run compile",
|
"compile": "turbo run compile",
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
@@ -25,7 +26,9 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"eslint": "^9.16.0",
|
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
||||||
|
"eslint": "^8.57.1",
|
||||||
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"prettier": "^3.4.1",
|
"prettier": "^3.4.1",
|
||||||
"turbo": "^2.3.3",
|
"turbo": "^2.3.3",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.2",
|
||||||
|
|||||||
8
packages/core/.eslintrc.json
Normal file
8
packages/core/.eslintrc.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": ["../../.eslintrc.json"]
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "tsc --noEmit",
|
"compile": "tsc --noEmit",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
"lint": "eslint . --max-warnings 0",
|
"lint": "eslint src --ext .ts --max-warnings 0",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"coverage": "vitest run --coverage "
|
"coverage": "vitest run --coverage "
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export enum IdType {
|
|||||||
Record = 'rc',
|
Record = 'rc',
|
||||||
Folder = 'fl',
|
Folder = 'fl',
|
||||||
View = 'vw',
|
View = 'vw',
|
||||||
Field = 'fi',
|
Field = 'fd',
|
||||||
SelectOption = 'so',
|
SelectOption = 'so',
|
||||||
ViewFilter = 'vf',
|
ViewFilter = 'vf',
|
||||||
ViewSort = 'vs',
|
ViewSort = 'vs',
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const isValidUrl = (url: string) => {
|
|||||||
try {
|
try {
|
||||||
new URL(url);
|
new URL(url);
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NodeType } from '~/registry';
|
import { NodeType } from '../registry';
|
||||||
import {
|
import {
|
||||||
ServerInteraction,
|
ServerInteraction,
|
||||||
ServerCollaboration,
|
ServerCollaboration,
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ export type ServerConfig = {
|
|||||||
attributes: ServerAttributes;
|
attributes: ServerAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ServerAttributes = {};
|
export type ServerAttributes = Record<string, unknown>;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NodeRole } from '~/registry/core';
|
import { NodeRole } from '../registry/core';
|
||||||
import { InteractionAttributes } from './interactions';
|
import { InteractionAttributes } from './interactions';
|
||||||
import { NodeType } from '~/registry';
|
import { NodeType } from '../registry';
|
||||||
|
|
||||||
export type SyncNodeTransactionsInput = {
|
export type SyncNodeTransactionsInput = {
|
||||||
transactions: LocalNodeTransaction[];
|
transactions: LocalNodeTransaction[];
|
||||||
|
|||||||
8
packages/crdt/.eslintrc.json
Normal file
8
packages/crdt/.eslintrc.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": ["../../.eslintrc.json"]
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { z, ZodSchema } from 'zod';
|
import { z, ZodSchema } from 'zod';
|
||||||
import * as Y from 'yjs';
|
import * as Y from 'yjs';
|
||||||
import { ZodText } from '@colanode/core';
|
import { ZodText } from '@colanode/core';
|
||||||
@@ -170,7 +171,7 @@ export class YDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deletedKeys = Array.from(yMap.keys()).filter(
|
const deletedKeys = Array.from(yMap.keys()).filter(
|
||||||
(key) => !attributes.hasOwnProperty(key)
|
(key) => !Object.prototype.hasOwnProperty.call(attributes, key)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const key of deletedKeys) {
|
for (const key of deletedKeys) {
|
||||||
@@ -324,7 +325,7 @@ export class YDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deletedKeys = Array.from(yMap.keys()).filter(
|
const deletedKeys = Array.from(yMap.keys()).filter(
|
||||||
(key) => !record.hasOwnProperty(key)
|
(key) => !Object.prototype.hasOwnProperty.call(record, key)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const key of deletedKeys) {
|
for (const key of deletedKeys) {
|
||||||
|
|||||||
Reference in New Issue
Block a user