feat: Unified icon picker (#7038)

This commit is contained in:
Hemachandar
2024-06-23 19:01:18 +05:30
committed by GitHub
parent 56d90e6bc3
commit 6fd3a0fa8a
83 changed files with 2302 additions and 852 deletions

View File

@@ -43,7 +43,7 @@ export default class DocumentImportTask extends BaseTask<Props> {
transaction,
});
const { text, state, title, emoji } = await documentImporter({
const { text, state, title, icon } = await documentImporter({
user,
fileName: sourceMetadata.fileName,
mimeType: sourceMetadata.mimeType,
@@ -55,7 +55,7 @@ export default class DocumentImportTask extends BaseTask<Props> {
return documentCreator({
sourceMetadata,
title,
emoji,
icon,
text,
state,
publish,

View File

@@ -124,7 +124,8 @@ export default class ExportJSONTask extends ExportTask {
id: document.id,
urlId: document.urlId,
title: document.title,
emoji: document.emoji,
icon: document.icon,
color: document.color,
data: DocumentHelper.toProsemirror(document),
createdById: document.createdById,
createdByName: document.createdBy.name,

View File

@@ -79,9 +79,9 @@ export default class ImportJSONTask extends ImportTask {
// TODO: This is kind of temporary, we can import the document
// structure directly in the future.
text: serializer.serialize(Node.fromJSON(schema, node.data)),
emoji: node.emoji,
icon: node.emoji,
color: null,
emoji: node.icon ?? node.emoji,
icon: node.icon ?? node.emoji,
color: node.color,
createdAt: node.createdAt ? new Date(node.createdAt) : undefined,
updatedAt: node.updatedAt ? new Date(node.updatedAt) : undefined,
publishedAt: node.publishedAt ? new Date(node.publishedAt) : null,

View File

@@ -79,7 +79,7 @@ export default class ImportMarkdownZipTask extends ImportTask {
return;
}
const { title, emoji, text } = await documentImporter({
const { title, icon, text } = await documentImporter({
mimeType: "text/markdown",
fileName: child.name,
content:
@@ -115,8 +115,8 @@ export default class ImportMarkdownZipTask extends ImportTask {
output.documents.push({
id,
title,
emoji,
icon: emoji,
emoji: icon,
icon,
text,
collectionId,
parentDocumentId,

View File

@@ -96,7 +96,7 @@ export default class ImportNotionTask extends ImportTask {
Logger.debug("task", `Processing ${name} as ${mimeType}`);
const { title, emoji, text } = await documentImporter({
const { title, icon, text } = await documentImporter({
mimeType: mimeType || "text/markdown",
fileName: name,
content:
@@ -130,8 +130,8 @@ export default class ImportNotionTask extends ImportTask {
output.documents.push({
id,
title,
emoji,
icon: emoji,
emoji: icon,
icon,
text,
collectionId,
parentDocumentId,

View File

@@ -38,7 +38,7 @@ export type StructuredImportData = {
collections: {
id: string;
urlId?: string;
color?: string;
color?: string | null;
icon?: string | null;
sort?: CollectionSort;
permission?: CollectionPermission | null;