From 5d9f62d178aaef75620ff44710284660a8cbffa9 Mon Sep 17 00:00:00 2001 From: Kristina Date: Fri, 29 Aug 2025 10:33:31 +0400 Subject: [PATCH] Init home page (#9735) Signed-off-by: Kristina Fefelova --- communication | 2 +- models/card/src/plugin.ts | 6 +- .../src/components/LiteMessageViewer.svelte | 5 +- .../components/markup/lite/LiteNode.svelte | 3 +- .../markup/lite/LiteNodeContent.svelte | 23 +- .../components/markup/lite/LiteNodes.svelte | 3 +- packages/theme/styles/_text-editor.scss | 8 +- packages/ui/lang/cs.json | 6 +- packages/ui/lang/de.json | 6 +- packages/ui/lang/en.json | 6 +- packages/ui/lang/es.json | 6 +- packages/ui/lang/fr.json | 6 +- packages/ui/lang/it.json | 6 +- packages/ui/lang/ja.json | 6 +- packages/ui/lang/pt.json | 6 +- packages/ui/lang/ru.json | 6 +- packages/ui/lang/zh.json | 6 +- .../ui/src/components/ModernEditbox.svelte | 39 ++- packages/ui/src/plugin.ts | 4 + plugins/card-assets/assets/icons.svg | 3 + plugins/card-assets/lang/cs.json | 8 +- plugins/card-assets/lang/de.json | 8 +- plugins/card-assets/lang/en.json | 8 +- plugins/card-assets/lang/es.json | 8 +- plugins/card-assets/lang/fr.json | 8 +- plugins/card-assets/lang/it.json | 8 +- plugins/card-assets/lang/ja.json | 8 +- plugins/card-assets/lang/pt.json | 8 +- plugins/card-assets/lang/ru.json | 8 +- plugins/card-assets/lang/zh.json | 8 +- plugins/card-assets/src/index.ts | 3 +- .../src/components/CardIcon.svelte | 8 +- .../src/components/CardTagsColored.svelte | 2 +- .../src/components/CreateCardPopup.svelte | 26 +- .../card-resources/src/components/Home.svelte | 220 ++++++++++++++ .../src/components/HomeCardPresenter.svelte | 284 ++++++++++++++++++ .../src/components/HomeSettings.svelte | 154 ++++++++++ .../navigator-next/Navigator.svelte | 21 +- plugins/card-resources/src/home.ts | 95 ++++++ plugins/card-resources/src/index.ts | 1 + plugins/card-resources/src/plugin.ts | 8 +- plugins/card-resources/src/types.ts | 1 + plugins/card/src/index.ts | 7 +- .../src/components/ChatApplication.svelte | 27 +- .../src/components/ChatNavigation.svelte | 16 +- plugins/chat-resources/src/location.ts | 14 + .../src/components}/AttachmentName.svelte | 0 .../src/components}/AttachmentsPreview.svelte | 0 .../src/components}/AttachmentsTooltip.svelte | 0 .../src/components/DirectIcon.svelte | 4 +- .../src/components/MessagePreview.svelte | 60 ++++ .../src/components/message/MessageBody.svelte | 20 +- .../components/message/MessageFooter.svelte | 3 +- .../message/MessagePresenter.svelte | 15 +- .../message/OneRowMessageBody.svelte | 3 +- .../ActivityUpdateCollaboratorsViewer.svelte | 9 +- plugins/communication-resources/src/index.ts | 2 + .../preview/NotificationPreview.svelte | 3 +- .../src/components/navigator/TreeItem.svelte | 8 +- 59 files changed, 1168 insertions(+), 82 deletions(-) create mode 100644 plugins/card-resources/src/components/Home.svelte create mode 100644 plugins/card-resources/src/components/HomeCardPresenter.svelte create mode 100644 plugins/card-resources/src/components/HomeSettings.svelte create mode 100644 plugins/card-resources/src/home.ts rename plugins/{inbox-resources/src/components/preview => communication-resources/src/components}/AttachmentName.svelte (100%) rename plugins/{inbox-resources/src/components/preview => communication-resources/src/components}/AttachmentsPreview.svelte (100%) rename plugins/{inbox-resources/src/components/preview => communication-resources/src/components}/AttachmentsTooltip.svelte (100%) create mode 100644 plugins/communication-resources/src/components/MessagePreview.svelte diff --git a/communication b/communication index ff4411ca57..a8d58f18bb 160000 --- a/communication +++ b/communication @@ -1 +1 @@ -Subproject commit ff4411ca5796b3f448d3767bf8119c355264781d +Subproject commit a8d58f18bb68e4cd4e3a97526af11eb800fb9fc3 diff --git a/models/card/src/plugin.ts b/models/card/src/plugin.ts index d56b266260..0e507b67d5 100644 --- a/models/card/src/plugin.ts +++ b/models/card/src/plugin.ts @@ -21,7 +21,7 @@ import { mergeIds, type Resource } from '@hcengineering/platform' import { type Location, type ResolvedLocation } from '@hcengineering/ui/src/types' import { type LocationData } from '@hcengineering/workbench' import { type ActionCategory, type Action, type ViewAction } from '@hcengineering/view' -import { type TagCategory, type TagElement } from '@hcengineering/tags' +import { type TagCategory } from '@hcengineering/tags' export default mergeIds(cardId, card, { app: { @@ -57,9 +57,5 @@ export default mergeIds(cardId, card, { CardCustomLinkMatch: '' as Resource<(doc: Doc) => boolean>, CardCustomLinkEncode: '' as Resource<(doc: Doc) => Location>, CheckRelationsSectionVisibility: '' as Resource<(doc: Card) => Promise> - }, - label: { - Subscribed: '' as Ref, - NewMessages: '' as Ref } }) diff --git a/packages/presentation/src/components/LiteMessageViewer.svelte b/packages/presentation/src/components/LiteMessageViewer.svelte index b9261abaa9..571c099c6c 100644 --- a/packages/presentation/src/components/LiteMessageViewer.svelte +++ b/packages/presentation/src/components/LiteMessageViewer.svelte @@ -18,10 +18,11 @@ import LiteNode from './markup/lite/LiteNode.svelte' export let message: Markup | MarkupNode + export let colorInherit: boolean = false $: node = typeof message === 'string' ? markupToJSON(message) : message -
- +
+
diff --git a/packages/presentation/src/components/markup/lite/LiteNode.svelte b/packages/presentation/src/components/markup/lite/LiteNode.svelte index adf6330238..c7c193015e 100644 --- a/packages/presentation/src/components/markup/lite/LiteNode.svelte +++ b/packages/presentation/src/components/markup/lite/LiteNode.svelte @@ -19,12 +19,13 @@ import NodeMarks from '../NodeMarks.svelte' export let node: MarkupNode + export let colorInherit: boolean = false {#if node} {@const marks = node.marks ?? []} - + {/if} diff --git a/packages/presentation/src/components/markup/lite/LiteNodeContent.svelte b/packages/presentation/src/components/markup/lite/LiteNodeContent.svelte index 7f2efc14d0..84d018f054 100644 --- a/packages/presentation/src/components/markup/lite/LiteNodeContent.svelte +++ b/packages/presentation/src/components/markup/lite/LiteNodeContent.svelte @@ -22,6 +22,7 @@ import { getBlobRef } from '../../../preview' export let node: MarkupNode + export let colorInherit: boolean = false function toRefBlob (blobId: AttrValue): Ref { return blobId as Ref @@ -48,15 +49,15 @@ {@const nodes = node.content ?? []} {#if node.type === MarkupNodeType.doc} - + {:else if node.type === MarkupNodeType.text} {node.text} {:else if node.type === MarkupNodeType.paragraph} -

- +

+

{:else if node.type === MarkupNodeType.blockquote} - + {:else if node.type === MarkupNodeType.horizontal_rule} {:else if node.type === MarkupNodeType.code_block} @@ -69,7 +70,7 @@ } ]} > - +

{:else if node.type === MarkupNodeType.reference} @@ -80,7 +81,7 @@ {#if objectClass !== undefined && objectId !== undefined} {:else} - + {/if} {:else if node.type === MarkupNodeType.emoji} @@ -100,9 +101,15 @@ {:else if node.type === MarkupNodeType.subLink} - + {:else} - + {/if} {/if} + + diff --git a/packages/presentation/src/components/markup/lite/LiteNodes.svelte b/packages/presentation/src/components/markup/lite/LiteNodes.svelte index d3ec913a84..ccee927897 100644 --- a/packages/presentation/src/components/markup/lite/LiteNodes.svelte +++ b/packages/presentation/src/components/markup/lite/LiteNodes.svelte @@ -18,10 +18,11 @@ import LiteNode from './LiteNode.svelte' export let nodes: MarkupNode[] + export let colorInherit: boolean = false {#if nodes} {#each nodes as node} - + {/each} {/if} diff --git a/packages/theme/styles/_text-editor.scss b/packages/theme/styles/_text-editor.scss index 35628ce74e..7fca2d4a57 100644 --- a/packages/theme/styles/_text-editor.scss +++ b/packages/theme/styles/_text-editor.scss @@ -13,6 +13,10 @@ color: var(--theme-text-primary-color); margin: 0.25rem 0; + &.colorInherit { + color: inherit; + } + .suggestion { padding-left: 0.25rem; color: var(--theme-link-color); @@ -544,7 +548,7 @@ } } - &.embed-youtube { + &.embed-youtube { iframe { margin: 0; padding: 0; @@ -585,4 +589,4 @@ .select-text .text-editor-image-container { user-select: all; -} \ No newline at end of file +} diff --git a/packages/ui/lang/cs.json b/packages/ui/lang/cs.json index b6cb0310c4..c79e6d4da8 100644 --- a/packages/ui/lang/cs.json +++ b/packages/ui/lang/cs.json @@ -99,6 +99,10 @@ "WeeksWOValue": "{weeks, plural, =1 {týden} other {týdny}}", "MonthsWOValue": "{months, plural, =1 {měsíc} other {měsíce}}", "Filter": "Filtr", - "Clear": "Vymazat" + "Clear": "Vymazat", + "Yesterday": "Včera", + "ThisWeek": "Tento týden", + "ThisMonth": "Tento měsíc", + "ThisYear": "Tento rok" } } diff --git a/packages/ui/lang/de.json b/packages/ui/lang/de.json index 63f39e69b4..a13bfe536f 100644 --- a/packages/ui/lang/de.json +++ b/packages/ui/lang/de.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {Woche} other {Wochen}}", "MonthsWOValue": "{months, plural, =1 {Monat} other {Monate}}", "Filter": "Filter", - "Clear": "Löschen" + "Clear": "Löschen", + "Yesterday": "Gestern", + "ThisWeek": "Diese Woche", + "ThisMonth": "Diesen Monat", + "ThisYear": "Dieses Jahr" } } diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index c9d2949dab..f14b341eca 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {week} other {weeks}}", "MonthsWOValue": "{months, plural, =1 {month} other {months}}", "Filter": "Filter", - "Clear": "Clear" + "Clear": "Clear", + "Yesterday": "Yesterday", + "ThisWeek": "This week", + "ThisMonth": "This month", + "ThisYear": "This year" } } diff --git a/packages/ui/lang/es.json b/packages/ui/lang/es.json index f1be25a142..ffab90004e 100644 --- a/packages/ui/lang/es.json +++ b/packages/ui/lang/es.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {semana} other {semanas}}", "MonthsWOValue": "{months, plural, =1 {mes} other {meses}}", "Filter": "Filtrar", - "Clear": "Limpiar" + "Clear": "Limpiar", + "Yesterday": "Ayer", + "ThisWeek": "Esta semana", + "ThisMonth": "Este mes", + "ThisYear": "Este año" } } diff --git a/packages/ui/lang/fr.json b/packages/ui/lang/fr.json index d42ad1feb3..5b6a329e12 100644 --- a/packages/ui/lang/fr.json +++ b/packages/ui/lang/fr.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {semaine} other {semaines}}", "MonthsWOValue": "{months, plural, =1 {mois} other {mois}}", "Filter": "Filtrer", - "Clear": "Effacer" + "Clear": "Effacer", + "Yesterday": "Hier", + "ThisWeek": "Cette semaine", + "ThisMonth": "Ce mois-ci", + "ThisYear": "Cette année" } } diff --git a/packages/ui/lang/it.json b/packages/ui/lang/it.json index ae426e12e8..7ea036dc09 100644 --- a/packages/ui/lang/it.json +++ b/packages/ui/lang/it.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {settimana} other {settimane}}", "MonthsWOValue": "{months, plural, =1 {mese} other {mesi}}", "Filter": "Filtra", - "Clear": "Cancella" + "Clear": "Cancella", + "Yesterday": "Ieri", + "ThisWeek": "Questa settimana", + "ThisMonth": "Questo mese", + "ThisYear": "Quest'anno" } } diff --git a/packages/ui/lang/ja.json b/packages/ui/lang/ja.json index 0f69bf5372..ad16111fd4 100644 --- a/packages/ui/lang/ja.json +++ b/packages/ui/lang/ja.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {週} other {週}}", "MonthsWOValue": "{months, plural, =1 {か月} other {か月}}", "Filter": "フィルター", - "Clear": "クリア" + "Clear": "クリア", + "Yesterday": "昨日", + "ThisWeek": "今週", + "ThisMonth": "今月", + "ThisYear": "今年" } } diff --git a/packages/ui/lang/pt.json b/packages/ui/lang/pt.json index b3fe1b0354..53a85bcda8 100644 --- a/packages/ui/lang/pt.json +++ b/packages/ui/lang/pt.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {semana} other {semanas}}", "MonthsWOValue": "{months, plural, =1 {mês} other {meses}}", "Filter": "Filtrar", - "Clear": "Limpar" + "Clear": "Limpar", + "Yesterday": "Ontem", + "ThisWeek": "Esta semana", + "ThisMonth": "Este mês", + "ThisYear": "Este ano" } } diff --git a/packages/ui/lang/ru.json b/packages/ui/lang/ru.json index 5c17874941..5b26730e3b 100644 --- a/packages/ui/lang/ru.json +++ b/packages/ui/lang/ru.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, one {неделя} few {недели} other {недель}}", "MonthsWOValue": "{months, plural, one {месяц} few {месяца} other {месяцев}}", "Filter": "Фильтр", - "Clear": "Очистить" + "Clear": "Очистить", + "Yesterday": "Вчера", + "ThisWeek": "Эта неделя", + "ThisMonth": "Этот месяц", + "ThisYear": "Этот год" } } diff --git a/packages/ui/lang/zh.json b/packages/ui/lang/zh.json index f5a33907db..194607157d 100644 --- a/packages/ui/lang/zh.json +++ b/packages/ui/lang/zh.json @@ -100,6 +100,10 @@ "WeeksWOValue": "{weeks, plural, =1 {周} other {周}}", "MonthsWOValue": "{months, plural, =1 {月} other {月}}", "Filter": "过滤", - "Clear": "清除" + "Clear": "清除", + "Yesterday": "昨天", + "ThisWeek": "本周", + "ThisMonth": "本月", + "ThisYear": "今年" } } diff --git a/packages/ui/src/components/ModernEditbox.svelte b/packages/ui/src/components/ModernEditbox.svelte index 0c5eed4e78..6f4ff21d3f 100644 --- a/packages/ui/src/components/ModernEditbox.svelte +++ b/packages/ui/src/components/ModernEditbox.svelte @@ -12,7 +12,7 @@ export let label: IntlString export let value: string | undefined = undefined - export let kind: 'default' | 'ghost' = 'default' + export let kind: 'default' | 'ghost' | 'secondary' = 'default' export let size: 'small' | 'medium' | 'large' = 'small' export let disabled: boolean = false export let error: boolean = false @@ -149,6 +149,25 @@ height: var(--global-extra-large-Size); } } + + &.secondary { + background-color: var(--input-BackgroundColor); + box-shadow: inset 0 0 0 1px var(--input-BorderColor); + + &.small { + padding: var(--spacing-1) var(--spacing-1_5); + height: var(--global-small-Size); + } + &.medium { + padding: var(--spacing-1_5) var(--spacing-2); + height: var(--global-medium-Size); + } + &.large { + position: relative; + padding: 0 var(--spacing-2); + height: var(--global-extra-large-Size); + } + } &.ghost { &.small, &.medium { @@ -187,9 +206,27 @@ background-color: var(--input-hover-BackgroundColor); } } + + &.secondary { + input::placeholder { + color: var(--input-PlaceholderColor); + } + &:active, + &:focus-within { + background-color: var(--input-BackgroundColor); + outline: 2px solid var(--global-focus-BorderColor); + outline-offset: 2px; + } + &:hover { + background-color: var(--input-hover-BackgroundColor); + } + } &.ghost input::placeholder { color: var(--input-PlaceholderColor); } + &.secondary input::placeholder { + color: var(--input-PlaceholderColor); + } &:hover input:not(:focus)::placeholder { color: var(--input-hover-PlaceholderColor); } diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index e6467131a6..9bc5951d57 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -58,6 +58,10 @@ export const uis = plugin(uiId, { None: '' as IntlString, NotSelected: '' as IntlString, Today: '' as IntlString, + Yesterday: '' as IntlString, + ThisWeek: '' as IntlString, + ThisMonth: '' as IntlString, + ThisYear: '' as IntlString, NoDate: '' as IntlString, StartDate: '' as IntlString, TargetDate: '' as IntlString, diff --git a/plugins/card-assets/assets/icons.svg b/plugins/card-assets/assets/icons.svg index 8ca2248461..3887ba472e 100644 --- a/plugins/card-assets/assets/icons.svg +++ b/plugins/card-assets/assets/icons.svg @@ -46,4 +46,7 @@ + + + diff --git a/plugins/card-assets/lang/cs.json b/plugins/card-assets/lang/cs.json index 860a67b973..89d97d5d2c 100644 --- a/plugins/card-assets/lang/cs.json +++ b/plugins/card-assets/lang/cs.json @@ -40,6 +40,12 @@ "Properties": "Vlastnosti", "NoChildren": "Žádné děti", "ConfigDescription": "Rozšíření pro správu znalostí ve stylu databáze.", - "AddCollaborators": "Přidat spolupracovníky" + "AddCollaborators": "Přidat spolupracovníky", + "Home": "Domů", + "WhatDoYouWantToShare": "Co chcete sdílet?", + "Share": "Sdílet", + "Compact": "Kompaktní", + "Comfortable": "Komfortní", + "Comfortable2": "Komfortní 2" } } diff --git a/plugins/card-assets/lang/de.json b/plugins/card-assets/lang/de.json index b90952828c..29475c14e0 100644 --- a/plugins/card-assets/lang/de.json +++ b/plugins/card-assets/lang/de.json @@ -40,6 +40,12 @@ "Properties": "Eigenschaften", "NoChildren": "Keine Kinder", "ConfigDescription": "Erweiterung für Datenbank-basiertes Wissensmanagement.", - "AddCollaborators": "Mitarbeiter hinzufügen" + "AddCollaborators": "Mitarbeiter hinzufügen", + "Home": "Startseite", + "WhatDoYouWantToShare": "Was möchten Sie teilen?", + "Share": "Teilen", + "Compact": "Kompakt", + "Comfortable": "Komfortabel", + "Comfortable2": "Komfortabel 2" } } diff --git a/plugins/card-assets/lang/en.json b/plugins/card-assets/lang/en.json index 466dc57be2..26db731321 100644 --- a/plugins/card-assets/lang/en.json +++ b/plugins/card-assets/lang/en.json @@ -40,6 +40,12 @@ "Properties": "Properties", "NoChildren": "No children", "ConfigDescription": "Extension for database-style knowledge management.", - "AddCollaborators": "Add collaborators" + "AddCollaborators": "Add collaborators", + "Home": "Home", + "WhatDoYouWantToShare": "What do you want to share?", + "Share": "Share", + "Compact": "Compact", + "Comfortable": "Comfortable", + "Comfortable2": "Comfortable 2" } } diff --git a/plugins/card-assets/lang/es.json b/plugins/card-assets/lang/es.json index 6fa79d1980..10c1f632f2 100644 --- a/plugins/card-assets/lang/es.json +++ b/plugins/card-assets/lang/es.json @@ -40,6 +40,12 @@ "Properties": "Propiedades", "NoChildren": "No hay hijos", "ConfigDescription": "Extensión para la gestión del conocimiento al estilo de una base de datos.", - "AddCollaborators": "Agregar colaboradores" + "AddCollaborators": "Agregar colaboradores", + "Home": "Inicio", + "WhatDoYouWantToShare": "¿Qué quieres compartir?", + "Share": "Compartir", + "Compact": "Compacto", + "Comfortable": "Confortable", + "Comfortable2": "Confortable 2" } } diff --git a/plugins/card-assets/lang/fr.json b/plugins/card-assets/lang/fr.json index 93ba3ae1e8..4d2edbf899 100644 --- a/plugins/card-assets/lang/fr.json +++ b/plugins/card-assets/lang/fr.json @@ -40,6 +40,12 @@ "Properties": "Propriétés", "NoChildren": "Pas d'enfants", "ConfigDescription": "Extension pour la gestion des connaissances de style base de données.", - "AddCollaborators": "Ajouter des collaborateurs" + "AddCollaborators": "Ajouter des collaborateurs", + "Home": "Accueil", + "WhatDoYouWantToShare": "Que voulez-vous partager ?", + "Share": "Partager", + "Compact": "Compact", + "Comfortable": "Confortable", + "Comfortable2": "Confortable 2" } } diff --git a/plugins/card-assets/lang/it.json b/plugins/card-assets/lang/it.json index f76cdfcfa0..7e5b73746a 100644 --- a/plugins/card-assets/lang/it.json +++ b/plugins/card-assets/lang/it.json @@ -40,6 +40,12 @@ "NoChildren": "Nessun figlio", "NumberTypes": "{count, plural, one {# tipo} other {# tipi}}", "ConfigDescription": "Estensione per la gestione della conoscenza in stile database.", - "AddCollaborators": "Aggiungi collaboratori" + "AddCollaborators": "Aggiungi collaboratori", + "Home": "Home", + "WhatDoYouWantToShare": "Cosa vuoi condividere?", + "Share": "Condividi", + "Compact": "Compatto", + "Comfortable": "Confortabile", + "Comfortable2": "Confortabile 2" } } diff --git a/plugins/card-assets/lang/ja.json b/plugins/card-assets/lang/ja.json index 5f7aae6e84..4f9c2830e7 100644 --- a/plugins/card-assets/lang/ja.json +++ b/plugins/card-assets/lang/ja.json @@ -40,6 +40,12 @@ "Properties": "プロパティ", "NoChildren": "子がありません", "ConfigDescription": "データベーススタイルのナレッジマネジメント用の拡張機能。", - "AddCollaborators": "コラボレーターを追加" + "AddCollaborators": "コラボレーターを追加", + "Home": "ホーム", + "WhatDoYouWantToShare": "どうしますかを共有しますか?", + "Share": "共有", + "Compact": "コンパクト", + "Comfortable": "コンファンティブ", + "Comfortable2": "コンファンティブ 2" } } diff --git a/plugins/card-assets/lang/pt.json b/plugins/card-assets/lang/pt.json index b3a249a991..fe3a639a41 100644 --- a/plugins/card-assets/lang/pt.json +++ b/plugins/card-assets/lang/pt.json @@ -40,6 +40,12 @@ "Properties": "Propriedades", "NoChildren": "Sem filhos", "ConfigDescription": "Extensão para gerenciamento de conhecimento no estilo de banco de dados.", - "AddCollaborators": "Adicionar colaboradores" + "AddCollaborators": "Adicionar colaboradores", + "Home": "Início", + "WhatDoYouWantToShare": "O que você deseja compartilhar?", + "Share": "Compartilhar", + "Compact": "Compacto", + "Comfortable": "Confortável", + "Comfortable2": "Confortável 2" } } diff --git a/plugins/card-assets/lang/ru.json b/plugins/card-assets/lang/ru.json index 038a7bf414..6faed68b8d 100644 --- a/plugins/card-assets/lang/ru.json +++ b/plugins/card-assets/lang/ru.json @@ -40,6 +40,12 @@ "Properties": "Свойства", "NoChildren": "Нет потомков", "ConfigDescription": "Расширение для управления знаниями в стиле базы данных.", - "AddCollaborators": "Добавить сотрудников" + "AddCollaborators": "Добавить сотрудников", + "Home": "Дом", + "WhatDoYouWantToShare": "Что вы хотите поделиться?", + "Share": "Поделиться", + "Compact": "Компактный", + "Comfortable": "Комфортный", + "Comfortable2": "Комфортный 2" } } diff --git a/plugins/card-assets/lang/zh.json b/plugins/card-assets/lang/zh.json index add5438230..a49e975da5 100644 --- a/plugins/card-assets/lang/zh.json +++ b/plugins/card-assets/lang/zh.json @@ -40,6 +40,12 @@ "Properties": "属性", "NoChildren": "没有子级", "ConfigDescription": "用于数据库风格知识管理的扩展。", - "AddCollaborators": "添加协作者" + "AddCollaborators": "添加协作者", + "Home": "主页", + "WhatDoYouWantToShare": "您想分享什么?", + "Share": "分享", + "Compact": "紧凑", + "Comfortable": "舒适", + "Comfortable2": "舒适 2" } } diff --git a/plugins/card-assets/src/index.ts b/plugins/card-assets/src/index.ts index 5bc6855c69..1976676eda 100644 --- a/plugins/card-assets/src/index.ts +++ b/plugins/card-assets/src/index.ts @@ -23,5 +23,6 @@ loadMetadata(card.icon, { Card: `${icons}#card`, File: `${icons}#file`, View: `${icons}#view`, - Document: `${icons}#document` + Document: `${icons}#document`, + Home: `${icons}#home` }) diff --git a/plugins/card-resources/src/components/CardIcon.svelte b/plugins/card-resources/src/components/CardIcon.svelte index 0852083ed4..5377588f83 100644 --- a/plugins/card-resources/src/components/CardIcon.svelte +++ b/plugins/card-resources/src/components/CardIcon.svelte @@ -23,7 +23,7 @@ import card from '../plugin' import { getCardIconInfo } from '../utils' - export let value: Card | undefined = undefined + export let value: Card | undefined | null = undefined export let _id: Ref | undefined = undefined export let size: IconSize = 'small' export let buttonSize: ButtonSize = 'medium' @@ -33,14 +33,14 @@ const hierarchy = client.getHierarchy() const query = createQuery() - let doc: Card | undefined = value + let doc: Card | undefined = value ?? undefined - $: if (_id !== undefined && doc === undefined) { + $: if (_id !== undefined && value == null) { query.query(card.class.Card, { _id }, (res) => { doc = res[0] }) } else { - doc = value + doc = value ?? undefined query.unsubscribe() } diff --git a/plugins/card-resources/src/components/CardTagsColored.svelte b/plugins/card-resources/src/components/CardTagsColored.svelte index b78c0f342a..7c962d5615 100644 --- a/plugins/card-resources/src/components/CardTagsColored.svelte +++ b/plugins/card-resources/src/components/CardTagsColored.svelte @@ -62,7 +62,7 @@ .divider { border: 1px solid var(--theme-content-color); width: 1px; - height: 100%; + height: 0.125rem; margin: 0 0.125rem; } diff --git a/plugins/card-resources/src/components/CreateCardPopup.svelte b/plugins/card-resources/src/components/CreateCardPopup.svelte index b52f4504ad..b39561fa08 100644 --- a/plugins/card-resources/src/components/CreateCardPopup.svelte +++ b/plugins/card-resources/src/components/CreateCardPopup.svelte @@ -26,9 +26,12 @@ import { createCard } from '../utils' import CardCollaborators from './CardCollaborators.svelte' + import { TypeSelector } from '../index' - export let type: Ref + export let title: string = '' + export let type: Ref = 'chat:masterTag:Thread' as Ref export let space: CardSpace | undefined = undefined + export let changeType: boolean = false const dispatch = createEventDispatcher() const client = getClient() @@ -37,12 +40,14 @@ const me = getCurrentEmployee() const _id = generateId() - const extension = client - .getModel() - .findAllSync(card.mixin.CreateCardExtension, {}) - .find((it) => hierarchy.isDerived(type, it._id)) + $: extension = type + ? client + .getModel() + .findAllSync(card.mixin.CreateCardExtension, {}) + .find((it) => hierarchy.isDerived(type, it._id)) + : undefined - let data: Partial> = {} + let data: Partial> = { title } let _space: Ref | undefined = space?._id let description: Markup = EmptyMarkup let collaborators: Ref[] = [me] @@ -50,6 +55,7 @@ let creating = false async function addCollaborators (): Promise { + if (type == null) return const accounts = collaborators .filter((it) => it !== me) .map((it) => $employeeByIdStore.get(it)?.personUuid) @@ -61,7 +67,7 @@ } async function okAction (): Promise { - if (_space === undefined) return + if (_space === undefined || type == null) return try { creating = true @@ -171,6 +177,12 @@
+ {#if changeType} +
+ + +
+ {/if} {#if space == null && !(extension?.hideSpace ?? false)}
diff --git a/plugins/card-resources/src/components/Home.svelte b/plugins/card-resources/src/components/Home.svelte new file mode 100644 index 0000000000..2f7abc3f22 --- /dev/null +++ b/plugins/card-resources/src/components/Home.svelte @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ + + + + +
+ +
+ {#each cards as card, index} + {@const previousCard = cards[index - 1]} + {@const currentDate = card.modifiedOn} + {@const previousDate = previousCard?.modifiedOn} + {@const currentDateId = getFormatDateId(currentDate)} + {@const previousDateId = previousDate != null ? getFormatDateId(previousDate) : undefined} + {#if currentDateId !== previousDateId} +
+ {#if currentDateId === 'today'} +
+ {/if} + + {/each} +
+
+
+ + diff --git a/plugins/card-resources/src/components/HomeCardPresenter.svelte b/plugins/card-resources/src/components/HomeCardPresenter.svelte new file mode 100644 index 0000000000..bb8c12a20e --- /dev/null +++ b/plugins/card-resources/src/components/HomeCardPresenter.svelte @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + +
openCardInSidebar(card._id, card)}> +
+ + + +
+ +
+
+ {#if hasNewMessages($labelsStore, card._id)} + + {/if} + + {card.title} + + {#if !isComfortable2} + + + + {/if} +
+
+ {#if message} + {#if isCompact} + + {:else} + + {/if} + {/if} +
+
+ {#if isComfortable2} + + + + {/if} + {#if card.parent != null && !isCompact} + {@const info = card.parentInfo?.find((it) => it._id === card.parent)} + {#if info} + openCardInSidebar(info._id)} + > + + + {info.title} + + + {/if} + {/if} +
+
+ + {#if card.parent && isCompact} + {@const info = card.parentInfo?.find((it) => it._id === card.parent)} + {#if info} +
+ openCardInSidebar(info._id)} + > + + + {info.title} + + +
+ {/if} + {/if} + + {#if !isCompact} +
+
+ {/if} +
+ + diff --git a/plugins/card-resources/src/components/HomeSettings.svelte b/plugins/card-resources/src/components/HomeSettings.svelte new file mode 100644 index 0000000000..9b9adcf698 --- /dev/null +++ b/plugins/card-resources/src/components/HomeSettings.svelte @@ -0,0 +1,154 @@ + + + + + + + +
{ + dispatch('changeContent') + }} + on:keydown={onKeydown} +> + {#if !($deviceInfo.isMobile && $deviceInfo.isPortrait && $deviceInfo.minWidth)} @@ -188,6 +205,10 @@ {#key selection.type} {/key} + {:else if selection?.type === 'home'} + {#key selection.type} + + {/key} {:else if selectedCard} {@const panelComponent = hierarchy.classHierarchyMixin(selectedCard._class, view.mixin.ObjectPanel)} {@const comp = panelComponent?.component ?? view.component.EditDoc} diff --git a/plugins/chat-resources/src/components/ChatNavigation.svelte b/plugins/chat-resources/src/components/ChatNavigation.svelte index 666e161383..4804c6b682 100644 --- a/plugins/chat-resources/src/components/ChatNavigation.svelte +++ b/plugins/chat-resources/src/components/ChatNavigation.svelte @@ -23,7 +23,17 @@ export let card: Card | undefined = undefined export let type: Ref | undefined = undefined - export let isFavorites: boolean = false + export let special: 'home' | 'favorites' | string | undefined = undefined + + function getSpecial (special: 'home' | 'favorites' | string | undefined): string | undefined { + if (special === 'favorites') { + return 'favorites' + } + if (special === 'home') { + return 'home' + } + return undefined + } diff --git a/plugins/chat-resources/src/location.ts b/plugins/chat-resources/src/location.ts index 6441ce02c5..df6e7ed8b7 100644 --- a/plugins/chat-resources/src/location.ts +++ b/plugins/chat-resources/src/location.ts @@ -26,6 +26,10 @@ export function isFavoritesLocation (loc: Location): boolean { return loc.path[2] === chatId && loc.path[3] === 'favorites' } +export function isHomeLocation (loc: Location): boolean { + return loc.path[2] === chatId && loc.path[3] === 'home' +} + export function getCardIdFromLocation (loc: Location): Ref | undefined { if (loc.path[2] !== chatId) { return undefined @@ -78,6 +82,16 @@ export function navigateToFavorites (): void { navigate(loc) } +export function navigateToHome (): void { + const loc = getCurrentResolvedLocation() + + loc.path[2] = chatId + loc.path[3] = 'home' + delete loc.query?.message + + navigate(loc) +} + export async function resolveLocation (loc: Location): Promise { if (loc.path[2] !== chatId) { return undefined diff --git a/plugins/inbox-resources/src/components/preview/AttachmentName.svelte b/plugins/communication-resources/src/components/AttachmentName.svelte similarity index 100% rename from plugins/inbox-resources/src/components/preview/AttachmentName.svelte rename to plugins/communication-resources/src/components/AttachmentName.svelte diff --git a/plugins/inbox-resources/src/components/preview/AttachmentsPreview.svelte b/plugins/communication-resources/src/components/AttachmentsPreview.svelte similarity index 100% rename from plugins/inbox-resources/src/components/preview/AttachmentsPreview.svelte rename to plugins/communication-resources/src/components/AttachmentsPreview.svelte diff --git a/plugins/inbox-resources/src/components/preview/AttachmentsTooltip.svelte b/plugins/communication-resources/src/components/AttachmentsTooltip.svelte similarity index 100% rename from plugins/inbox-resources/src/components/preview/AttachmentsTooltip.svelte rename to plugins/communication-resources/src/components/AttachmentsTooltip.svelte diff --git a/plugins/communication-resources/src/components/DirectIcon.svelte b/plugins/communication-resources/src/components/DirectIcon.svelte index 754ce21d74..cc699644fd 100644 --- a/plugins/communication-resources/src/components/DirectIcon.svelte +++ b/plugins/communication-resources/src/components/DirectIcon.svelte @@ -53,7 +53,9 @@ let avatarSize = size - $: if (size === 'small') { + $: if (size === 'x-small') { + avatarSize = 'tiny' + } else if (size === 'small') { avatarSize = 'x-small' } else if (size === 'medium') { avatarSize = 'small' diff --git a/plugins/communication-resources/src/components/MessagePreview.svelte b/plugins/communication-resources/src/components/MessagePreview.svelte new file mode 100644 index 0000000000..ea7c789934 --- /dev/null +++ b/plugins/communication-resources/src/components/MessagePreview.svelte @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + {#if isActivityMessage(message)} + + {:else} + + {/if} + + diff --git a/plugins/communication-resources/src/components/message/MessageBody.svelte b/plugins/communication-resources/src/components/message/MessageBody.svelte index 570e5d9ad5..ed2efde337 100644 --- a/plugins/communication-resources/src/components/message/MessageBody.svelte +++ b/plugins/communication-resources/src/components/message/MessageBody.svelte @@ -33,6 +33,8 @@ export let isEditing = false export let compact: boolean = false export let hideAvatar: boolean = false + export let hideHeader: boolean = false + export let thread: boolean = true function formatDate (date: Date): string { return date.toLocaleTimeString('default', { @@ -42,15 +44,17 @@ } -{#if compact} +{#if compact || hideHeader}
-
-
-
- {formatDate(message.created)} + {#if !hideHeader} +
+
+
+ {formatDate(message.created)} +
-
+ {/if}
{#if !isEditing && message.content !== ''} @@ -70,7 +74,7 @@ /> {/if} {#if !isEditing} - + {/if}
@@ -132,7 +136,7 @@ /> {/if} {#if !isEditing} - + {/if}
diff --git a/plugins/communication-resources/src/components/message/MessageFooter.svelte b/plugins/communication-resources/src/components/message/MessageFooter.svelte index d128e78424..6e2e78e198 100644 --- a/plugins/communication-resources/src/components/message/MessageFooter.svelte +++ b/plugins/communication-resources/src/components/message/MessageFooter.svelte @@ -29,6 +29,7 @@ import communication from '../../plugin' export let message: Message + export let thread: boolean = true const me = getCurrentAccount() const communicationClient = getCommunicationClient() @@ -130,7 +131,7 @@
{/if} -{#if message.thread && message.thread.threadId} +{#if thread && message.thread && message.thread.threadId}
diff --git a/plugins/communication-resources/src/components/message/MessagePresenter.svelte b/plugins/communication-resources/src/components/message/MessagePresenter.svelte index 7b996746d2..d9f2aac52a 100644 --- a/plugins/communication-resources/src/components/message/MessagePresenter.svelte +++ b/plugins/communication-resources/src/components/message/MessagePresenter.svelte @@ -41,7 +41,9 @@ export let padding: string | undefined = undefined export let compact: boolean = false export let hideAvatar: boolean = false + export let hideHeader: boolean = false export let readonly: boolean = false + export let thread: boolean = true let isEditing = false let isDeleted = false @@ -151,9 +153,18 @@ style:padding > {#if message.type === MessageType.Activity || (message.removed && message.thread?.threadId === undefined)} - + {:else} - + {/if} {#if showActions} diff --git a/plugins/communication-resources/src/components/message/OneRowMessageBody.svelte b/plugins/communication-resources/src/components/message/OneRowMessageBody.svelte index 6f35899316..709d839072 100644 --- a/plugins/communication-resources/src/components/message/OneRowMessageBody.svelte +++ b/plugins/communication-resources/src/components/message/OneRowMessageBody.svelte @@ -27,6 +27,7 @@ export let author: Person | undefined export let message: Message export let hideAvatar: boolean = false + export let hideHeader: boolean = false function formatDate (date: Date): string { return date.toLocaleTimeString('default', { @@ -51,7 +52,7 @@ {/if}
{/if} - {#if !isDeleted} + {#if !isDeleted && !hideHeader}
diff --git a/plugins/communication-resources/src/components/message/activity/ActivityUpdateCollaboratorsViewer.svelte b/plugins/communication-resources/src/components/message/activity/ActivityUpdateCollaboratorsViewer.svelte index ecd6f03e0f..6201645a32 100644 --- a/plugins/communication-resources/src/components/message/activity/ActivityUpdateCollaboratorsViewer.svelte +++ b/plugins/communication-resources/src/components/message/activity/ActivityUpdateCollaboratorsViewer.svelte @@ -85,7 +85,12 @@ } .icon { - color: var(--global-primary-TextColor); - fill: var(--global-primary-TextColor); + color: var(--global-secondary-TextColor); + fill: var(--global-secondary-TextColor); + + &:hover { + color: var(--global-secondary-TextColor); + fill: var(--global-secondary-TextColor); + } } diff --git a/plugins/communication-resources/src/index.ts b/plugins/communication-resources/src/index.ts index 7854b316cd..4c64968f73 100644 --- a/plugins/communication-resources/src/index.ts +++ b/plugins/communication-resources/src/index.ts @@ -48,6 +48,8 @@ export * from './stores' export { default as MessagePresenter } from './components/message/MessagePresenter.svelte' export { default as MessageInput } from './components/message/MessageInput.svelte' export { default as ActivityMessageViewer } from './components/message/ActivityMessageViewer.svelte' +export { default as AttachmentsPreview } from './components/AttachmentsPreview.svelte' +export { default as MessagePreview } from './components/MessagePreview.svelte' export default async (): Promise => ({ component: { diff --git a/plugins/inbox-resources/src/components/preview/NotificationPreview.svelte b/plugins/inbox-resources/src/components/preview/NotificationPreview.svelte index 89b8d72caf..973ecffbf7 100644 --- a/plugins/inbox-resources/src/components/preview/NotificationPreview.svelte +++ b/plugins/inbox-resources/src/components/preview/NotificationPreview.svelte @@ -21,9 +21,8 @@ import { employeeByPersonIdStore, getPersonByPersonId } from '@hcengineering/contact-resources' import { markdownToMarkup } from '@hcengineering/text-markdown' import { jsonToMarkup, markupToText } from '@hcengineering/text' - import { ActivityMessageViewer, isActivityMessage } from '@hcengineering/communication-resources' + import { ActivityMessageViewer, isActivityMessage, AttachmentsPreview } from '@hcengineering/communication-resources' - import AttachmentsPreview from './AttachmentsPreview.svelte' import PreviewTemplate from './PreviewTemplate.svelte' export let card: Card diff --git a/plugins/view-resources/src/components/navigator/TreeItem.svelte b/plugins/view-resources/src/components/navigator/TreeItem.svelte index bc7e1efd17..5f03a55c8b 100644 --- a/plugins/view-resources/src/components/navigator/TreeItem.svelte +++ b/plugins/view-resources/src/components/navigator/TreeItem.svelte @@ -14,17 +14,18 @@ -->