diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8cce4786a..8aa098d587 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,8 +97,8 @@ jobs: node common/scripts/install-run-rush.js install fi - - name: Checking model version is updated... - run: node common/scripts/check_model_version.js + # - name: Checking model version is updated... + # run: node common/scripts/check_model_version.js - name: Checking for mis-matching dependencies... run: node common/scripts/install-run-rush.js check diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5f1981eebd..448b34b8f0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -34283,6 +34283,9 @@ importers: '@hcengineering/server-process': specifier: workspace:^0.7.0 version: link:../process + '@hcengineering/text-core': + specifier: workspace:^0.7.19 + version: link:../../foundations/core/packages/text-core '@hcengineering/time': specifier: workspace:^0.7.0 version: link:../../plugins/time @@ -61584,7 +61587,7 @@ snapshots: node-loader@2.0.0(webpack@5.102.1): dependencies: loader-utils: 2.0.4 - webpack: 5.102.1(esbuild@0.25.12)(webpack-cli@5.1.4) + webpack: 5.102.1 node-localstorage@2.2.1: dependencies: diff --git a/foundations/core/packages/text-core/src/markup/model.ts b/foundations/core/packages/text-core/src/markup/model.ts index f061ca84cd..9b275c14f0 100644 --- a/foundations/core/packages/text-core/src/markup/model.ts +++ b/foundations/core/packages/text-core/src/markup/model.ts @@ -54,7 +54,8 @@ export enum MarkupMarkType { strike = 'strike', underline = 'underline', textColor = 'textColor', - textStyle = 'textStyle' + textStyle = 'textStyle', + highlight = 'highlight' } /** @public */ diff --git a/models/card/src/index.ts b/models/card/src/index.ts index 2e91f419b5..96607841dc 100644 --- a/models/card/src/index.ts +++ b/models/card/src/index.ts @@ -1124,6 +1124,18 @@ function defineTabs (builder: Builder): void { card.section.Properties ) + builder.createDoc( + card.class.CardSection, + core.space.Model, + { + label: card.string.RichtextProperties, + component: card.sectionComponent.MarkupPropertiesSection, + order: 150, + navigation: [] + }, + card.section.MarkupProperties + ) + builder.createDoc( card.class.CardSection, core.space.Model, diff --git a/models/process/src/functions.ts b/models/process/src/functions.ts index 4196eba261..f01223ee7b 100644 --- a/models/process/src/functions.ts +++ b/models/process/src/functions.ts @@ -626,6 +626,32 @@ export function defineFunctions (builder: Builder): void { process.function.StringFromBoolean ) + builder.createDoc( + process.class.ProcessFunction, + core.space.Model, + { + of: core.class.TypeMarkup, + to: core.class.TypeString, + category: 'attribute', + label: process.string.TextFromMarkup, + type: 'convert' + }, + process.function.StringFromMarkup + ) + + builder.createDoc( + process.class.ProcessFunction, + core.space.Model, + { + of: core.class.TypeString, + to: core.class.TypeMarkup, + category: 'attribute', + label: process.string.MarkupFromText, + type: 'convert' + }, + process.function.MarkupFromString + ) + builder.createDoc( process.class.ProcessFunction, core.space.Model, diff --git a/models/server-process/src/index.ts b/models/server-process/src/index.ts index 5e0d2ec03d..ad4b12c79d 100644 --- a/models/server-process/src/index.ts +++ b/models/server-process/src/index.ts @@ -179,10 +179,18 @@ export function createModel (builder: Builder): void { func: serverProcess.transform.StringFromDate }) + builder.mixin(process.function.StringFromMarkup, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { + func: serverProcess.transform.StringFromMarkup + }) + builder.mixin(process.function.StringFromBoolean, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { func: serverProcess.transform.StringFromBoolean }) + builder.mixin(process.function.MarkupFromString, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { + func: serverProcess.transform.MarkupFromString + }) + builder.mixin(process.function.NumberFromDate, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, { func: serverProcess.transform.NumberFromDate }) diff --git a/models/setting/src/index.ts b/models/setting/src/index.ts index 66ec8a9be9..c063d87aa4 100644 --- a/models/setting/src/index.ts +++ b/models/setting/src/index.ts @@ -530,6 +530,10 @@ export function createModel (builder: Builder): void { editor: setting.component.EmployeeRefEditor }) + builder.mixin(core.class.TypeMarkup, core.class.Class, view.mixin.ObjectEditor, { + editor: setting.component.MarkupTypeEditor + }) + builder.mixin(core.class.TypeNumber, core.class.Class, view.mixin.ObjectEditor, { editor: setting.component.NumberTypeEditor }) diff --git a/models/setting/src/plugin.ts b/models/setting/src/plugin.ts index f778e0fb91..7ff3d6e652 100644 --- a/models/setting/src/plugin.ts +++ b/models/setting/src/plugin.ts @@ -40,6 +40,7 @@ export default mergeIds(settingId, setting, { IdentifierTypeEditor: '' as AnyComponent, EmployeeRefEditor: '' as AnyComponent, DateTypeEditor: '' as AnyComponent, + MarkupTypeEditor: '' as AnyComponent, RefEditor: '' as AnyComponent, AssociationEditor: '' as AnyComponent, EnumTypeEditor: '' as AnyComponent, diff --git a/packages/presentation/src/components/AttributeBarEditor.svelte b/packages/presentation/src/components/AttributeBarEditor.svelte index c1ddd6381a..68d0dec7ba 100644 --- a/packages/presentation/src/components/AttributeBarEditor.svelte +++ b/packages/presentation/src/components/AttributeBarEditor.svelte @@ -14,13 +14,13 @@ // limitations under the License. --> + +{#each keys as key} +
+ + + { + onChange(value, key) + }} + {readonly} + /> +
+{/each} diff --git a/plugins/card-resources/src/components/sections/MarkupPropertiesSection.svelte b/plugins/card-resources/src/components/sections/MarkupPropertiesSection.svelte new file mode 100644 index 0000000000..404938e4dd --- /dev/null +++ b/plugins/card-resources/src/components/sections/MarkupPropertiesSection.svelte @@ -0,0 +1,43 @@ + + + + +{#if !hidden} +
+ + {#each mixins as mixin} + + {/each} +
+{/if} diff --git a/plugins/card-resources/src/index.ts b/plugins/card-resources/src/index.ts index 141e5b8caf..4e5409b18c 100644 --- a/plugins/card-resources/src/index.ts +++ b/plugins/card-resources/src/index.ts @@ -77,6 +77,7 @@ import PropertiesCardSection from './components/sections/PropertiesSection.svelt import RelationsCardSection from './components/sections/RelationsSection.svelte' import CardCommunicatiomMessages from './components/sections/CardCommunicatiomMessages.svelte' import OldMessagesCardSection from './components/sections/OldMessagesCardSection.svelte' +import MarkupPropertiesCardSection from './components/sections/MarkupPropertiesSection.svelte' import FavoriteCardPresenter from './components/FavoriteCardPresenter.svelte' import CardTagsColored from './components/CardTagsColored.svelte' @@ -149,7 +150,8 @@ export default async (): Promise => ({ PropertiesSection: PropertiesCardSection, RelationsSection: RelationsCardSection, OldMessagesSection: OldMessagesCardSection, - CommunicationMessagesSection: CardCommunicatiomMessages + CommunicationMessagesSection: CardCommunicatiomMessages, + MarkupPropertiesSection: MarkupPropertiesCardSection }, completion: { CardQuery: queryCard diff --git a/plugins/card-resources/src/plugin.ts b/plugins/card-resources/src/plugin.ts index 13d6373dba..e3aed7e056 100644 --- a/plugins/card-resources/src/plugin.ts +++ b/plugins/card-resources/src/plugin.ts @@ -83,6 +83,7 @@ export default mergeIds(cardId, card, { ChildrenSection: '' as AnyComponent, ContentSection: '' as AnyComponent, PropertiesSection: '' as AnyComponent, + MarkupPropertiesSection: '' as AnyComponent, RelationsSection: '' as AnyComponent, CommunicationMessagesSection: '' as AnyComponent, OldMessagesSection: '' as AnyComponent @@ -132,6 +133,7 @@ export default mergeIds(cardId, card, { CreateSpace: '' as IntlString, NumberTypes: '' as IntlString, Properties: '' as IntlString, + RichtextProperties: '' as IntlString, NoChildren: '' as IntlString, AddCollaborators: '' as IntlString, CardTitle: '' as IntlString, diff --git a/plugins/card/src/index.ts b/plugins/card/src/index.ts index 933902a222..21b1fa87fb 100644 --- a/plugins/card/src/index.ts +++ b/plugins/card/src/index.ts @@ -221,6 +221,7 @@ const cardPlugin = plugin(cardId, { Children: '' as Ref, Content: '' as Ref, Properties: '' as Ref, + MarkupProperties: '' as Ref, Relations: '' as Ref, OldMessages: '' as Ref, CommunicationMessages: '' as Ref diff --git a/plugins/process-assets/lang/cs.json b/plugins/process-assets/lang/cs.json index 193665fa64..a8baf9cd3e 100644 --- a/plugins/process-assets/lang/cs.json +++ b/plugins/process-assets/lang/cs.json @@ -166,7 +166,9 @@ "DateDifference": "Rozdíl dat", "EmptyValue": "Prázdná hodnota", "Min": "Min", - "Max": "Max" + "Max": "Max", + "MarkupFromText": "MarkUp z textu", + "TextFromMarkup": "Text z MarkUp" }, "error": { "MethodNotFound": "Metoda nenalezena: {methodId}", diff --git a/plugins/process-assets/lang/de.json b/plugins/process-assets/lang/de.json index 9548786291..0206cb16a9 100644 --- a/plugins/process-assets/lang/de.json +++ b/plugins/process-assets/lang/de.json @@ -166,7 +166,9 @@ "DateDifference": "Datumsdifferenz", "EmptyValue": "Leerer Wert", "Min": "Min", - "Max": "Max" + "Max": "Max", + "TextFromMarkup": "Text aus Markup", + "MarkupFromText": "Markup aus Text" }, "error": { "MethodNotFound": "Methode nicht gefunden: {methodId}", diff --git a/plugins/process-assets/lang/en.json b/plugins/process-assets/lang/en.json index 3d33ecf83a..f23853530f 100644 --- a/plugins/process-assets/lang/en.json +++ b/plugins/process-assets/lang/en.json @@ -171,7 +171,9 @@ "MonthFromDate": "Month from date", "DayFromDate": "Day from date", "DateDifference": "Date difference", - "EmptyValue": "Empty value" + "EmptyValue": "Empty value", + "TextFromMarkup": "Text from markup", + "MarkupFromText": "Markup from text" }, "error": { "MethodNotFound": "Method not found: {methodId}", diff --git a/plugins/process-assets/lang/es.json b/plugins/process-assets/lang/es.json index 417e0dd152..df88749535 100644 --- a/plugins/process-assets/lang/es.json +++ b/plugins/process-assets/lang/es.json @@ -171,7 +171,9 @@ "MonthFromDate": "Mes desde fecha", "DayFromDate": "Día desde fecha", "DateDifference": "Diferencia de fechas", - "EmptyValue": "Valor vacío" + "EmptyValue": "Valor vacío", + "TextFromMarkup": "Texto desde markup", + "MarkupFromText": "Markup desde texto" }, "error": { "MethodNotFound": "Método no encontrado: {methodId}", diff --git a/plugins/process-assets/lang/fr.json b/plugins/process-assets/lang/fr.json index 8e8f17a1c7..ad9b563040 100644 --- a/plugins/process-assets/lang/fr.json +++ b/plugins/process-assets/lang/fr.json @@ -171,7 +171,9 @@ "MonthFromDate": "Mois depuis date", "DayFromDate": "Jour depuis date", "DateDifference": "Différence de dates", - "EmptyValue": "Valeur vide" + "EmptyValue": "Valeur vide", + "TextFromMarkup": "Texte depuis markup", + "MarkupFromText": "Markup depuis texte" }, "error": { "MethodNotFound": "Méthode introuvable : {methodId}", diff --git a/plugins/process-assets/lang/it.json b/plugins/process-assets/lang/it.json index fbae9302f4..6dfe7e902e 100644 --- a/plugins/process-assets/lang/it.json +++ b/plugins/process-assets/lang/it.json @@ -171,7 +171,9 @@ "MonthFromDate": "Mese da data", "DayFromDate": "Giorno da data", "DateDifference": "Differenza di date", - "EmptyValue": "Valore vuoto" + "EmptyValue": "Valore vuoto", + "TextFromMarkup": "Testo da markup", + "MarkupFromText": "Markup da testo" }, "error": { "MethodNotFound": "Metodo non trovato: {methodId}", diff --git a/plugins/process-assets/lang/ja.json b/plugins/process-assets/lang/ja.json index d75c26daa2..987f3a6c50 100644 --- a/plugins/process-assets/lang/ja.json +++ b/plugins/process-assets/lang/ja.json @@ -170,7 +170,9 @@ "MonthFromDate": "日付から月", "DayFromDate": "日付から日", "DateDifference": "日付の差", - "EmptyValue": "空の値" + "EmptyValue": "空の値", + "TextFromMarkup": "テキストからマークアップ", + "MarkupFromText": "マークアップからテキスト" }, "error": { "MethodNotFound": "メソッドが見つかりません: {methodId}", diff --git a/plugins/process-assets/lang/pt-br.json b/plugins/process-assets/lang/pt-br.json index cbefb83131..354bc9bf97 100644 --- a/plugins/process-assets/lang/pt-br.json +++ b/plugins/process-assets/lang/pt-br.json @@ -159,7 +159,9 @@ "MonthFromDate": "Mês de data", "DayFromDate": "Dia de data", "DateDifference": "Diferença de datas", - "EmptyValue": "Valor vazio" + "EmptyValue": "Valor vazio", + "TextFromMarkup": "Texto de marcação", + "MarkupFromText": "Marcação de texto" }, "error": { "MethodNotFound": "Método não encontrado: {methodId}", diff --git a/plugins/process-assets/lang/pt.json b/plugins/process-assets/lang/pt.json index 44a37297be..222160cd62 100644 --- a/plugins/process-assets/lang/pt.json +++ b/plugins/process-assets/lang/pt.json @@ -171,7 +171,9 @@ "MonthFromDate": "Mês de data", "DayFromDate": "Dia de data", "DateDifference": "Diferença de datas", - "EmptyValue": "Valor vazio" + "EmptyValue": "Valor vazio", + "TextFromMarkup": "Texto de marcação", + "MarkupFromText": "Marcação de texto" }, "error": { "MethodNotFound": "Método não encontrado: {methodId}", diff --git a/plugins/process-assets/lang/ru.json b/plugins/process-assets/lang/ru.json index 03e5454a2c..5d340cff1b 100644 --- a/plugins/process-assets/lang/ru.json +++ b/plugins/process-assets/lang/ru.json @@ -171,7 +171,9 @@ "MonthFromDate": "Месяц из даты", "DayFromDate": "День из даты", "DateDifference": "Разница дат", - "EmptyValue": "Пустое значение" + "EmptyValue": "Пустое значение", + "MarkupFromText": "Текст из разметки", + "TextFromMarkup": "Разметка из текста" }, "error": { "MethodNotFound": "Метод не найден: {methodId}", diff --git a/plugins/process-assets/lang/tr.json b/plugins/process-assets/lang/tr.json index 4e8003c0c3..997ed40e54 100644 --- a/plugins/process-assets/lang/tr.json +++ b/plugins/process-assets/lang/tr.json @@ -166,7 +166,9 @@ "MonthFromDate": "Tarihten ay", "DayFromDate": "Tarihten gün", "DateDifference": "Tarih farkı", - "EmptyValue": "Boş değer" + "EmptyValue": "Boş değer", + "TextFromMarkup": "Metinden işaretleme", + "MarkupFromText": "İşaretlemeden metin" }, "error": { "MethodNotFound": "Metod bulunamadı: {methodId}", diff --git a/plugins/process-assets/lang/zh.json b/plugins/process-assets/lang/zh.json index 6429a89315..63ae4e3adb 100644 --- a/plugins/process-assets/lang/zh.json +++ b/plugins/process-assets/lang/zh.json @@ -171,7 +171,9 @@ "MonthFromDate": "日期到月份", "DayFromDate": "日期到天", "DateDifference": "日期差异", - "EmptyValue": "空值" + "EmptyValue": "空值", + "TextFromMarkup": "标记到文本", + "MarkupFromText": "文本到标记" }, "error": { "MethodNotFound": "找不到方法:{methodId}", diff --git a/plugins/process-resources/src/components/ProcessAttribute.svelte b/plugins/process-resources/src/components/ProcessAttribute.svelte index 7ea3acdbbf..7438a9166c 100644 --- a/plugins/process-resources/src/components/ProcessAttribute.svelte +++ b/plugins/process-resources/src/components/ProcessAttribute.svelte @@ -108,7 +108,7 @@ this={editor} label={attribute?.label} placeholder={attribute?.label} - kind={'ghost'} + kind={'link'} size={'large'} width={'100%'} justify={'left'} diff --git a/plugins/process-resources/src/plugin.ts b/plugins/process-resources/src/plugin.ts index 925982fa84..6c6568e0c5 100644 --- a/plugins/process-resources/src/plugin.ts +++ b/plugins/process-resources/src/plugin.ts @@ -270,6 +270,8 @@ export default mergeIds(processId, process, { TextFromNumber: '' as IntlString, TextFromDate: '' as IntlString, TextFromCheckbox: '' as IntlString, + TextFromMarkup: '' as IntlString, + MarkupFromText: '' as IntlString, NumberFromDate: '' as IntlString, DateFromNumber: '' as IntlString, NumberFromText: '' as IntlString, diff --git a/plugins/process/src/index.ts b/plugins/process/src/index.ts index 236e9d64ad..70468f93c8 100644 --- a/plugins/process/src/index.ts +++ b/plugins/process/src/index.ts @@ -380,6 +380,8 @@ export default plugin(processId, { CurrentDate: '' as Ref, StringFromNumber: '' as Ref, StringFromDate: '' as Ref, + StringFromMarkup: '' as Ref, + MarkupFromString: '' as Ref, StringFromBoolean: '' as Ref, NumberFromDate: '' as Ref, DateFromNumber: '' as Ref, diff --git a/plugins/setting-resources/src/components/typeEditors/MarkupTypeEditor.svelte b/plugins/setting-resources/src/components/typeEditors/MarkupTypeEditor.svelte new file mode 100644 index 0000000000..df1300b466 --- /dev/null +++ b/plugins/setting-resources/src/components/typeEditors/MarkupTypeEditor.svelte @@ -0,0 +1,24 @@ + + diff --git a/plugins/setting-resources/src/index.ts b/plugins/setting-resources/src/index.ts index d11948b02c..1e3571d89a 100644 --- a/plugins/setting-resources/src/index.ts +++ b/plugins/setting-resources/src/index.ts @@ -62,6 +62,7 @@ import RefEditor from './components/typeEditors/RefEditor.svelte' import IdentifierTypeEditor from './components/typeEditors/IdentifierTypeEditor.svelte' import RelationSetting from './components/RelationSetting.svelte' import RoleAssignmentEditor from './components/typeEditors/RoleAssignmentEditor.svelte' +import MarkupTypeEditor from './components/typeEditors/MarkupTypeEditor.svelte' import StringTypeEditor from './components/typeEditors/StringTypeEditor.svelte' import WorkspaceSettings from './components/WorkspaceSettings.svelte' import SettingsWidget from './components/SettingsWidget.svelte' @@ -156,6 +157,7 @@ export default async (): Promise => ({ ClassPermissionPresenter, SpaceTypeDescriptorPresenter, SpaceTypeGeneralSectionEditor, + MarkupTypeEditor, SpaceTypePropertiesSectionEditor, SpaceTypeRolesSectionEditor, RoleEditor, diff --git a/plugins/view-resources/src/components/MarkupEditor.svelte b/plugins/view-resources/src/components/MarkupEditor.svelte index facd03bf3d..48737e1645 100644 --- a/plugins/view-resources/src/components/MarkupEditor.svelte +++ b/plugins/view-resources/src/components/MarkupEditor.svelte @@ -18,9 +18,11 @@ import { MessageViewer } from '@hcengineering/presentation' import { Button, eventToHTMLElement, Label, showPopup } from '@hcengineering/ui' import MarkupEditorPopup from './MarkupEditorPopup.svelte' + import { StyledTextBox } from '@hcengineering/text-editor-resources' + import textEditorPlugin from '@hcengineering/text-editor' // export let label: IntlString - export let placeholder: IntlString + export let placeholder: IntlString = textEditorPlugin.string.EditorPlaceholder export let value: string // export let focus: boolean = false export let onChange: (value: string) => void @@ -62,10 +64,14 @@ -{:else if readonly} - {#if value} - {value} - {:else} - - {/if} +{:else} + { + onChange(e.detail) + }} + /> {/if} diff --git a/server-plugins/process-resources/package.json b/server-plugins/process-resources/package.json index 3b602dba61..6de34aa051 100644 --- a/server-plugins/process-resources/package.json +++ b/server-plugins/process-resources/package.json @@ -42,6 +42,7 @@ "@hcengineering/contact": "workspace:^0.7.0", "@hcengineering/card": "workspace:^0.7.0", "@hcengineering/server-process": "workspace:^0.7.0", + "@hcengineering/text-core": "workspace:^0.7.19", "@hcengineering/server-core": "workspace:^0.7.19", "@hcengineering/platform": "workspace:^0.7.20", "@hcengineering/process": "workspace:^0.7.0" diff --git a/server-plugins/process-resources/src/index.ts b/server-plugins/process-resources/src/index.ts index 116affd409..cfd3de8c21 100644 --- a/server-plugins/process-resources/src/index.ts +++ b/server-plugins/process-resources/src/index.ts @@ -106,6 +106,7 @@ import { Insert, LastValue, LowerCase, + MarkupFromString, Max, Min, Modulo, @@ -128,6 +129,7 @@ import { Sqrt, StringFromBoolean, StringFromDate, + StringFromMarkup, StringFromNumber, Subtract, Trim, @@ -793,7 +795,9 @@ export default async () => ({ DayFromDate, DateDifference, Min, - Max + Max, + StringFromMarkup, + MarkupFromString }, rollbacks: { ToDoCloseRollback, diff --git a/server-plugins/process-resources/src/transform.ts b/server-plugins/process-resources/src/transform.ts index 8ebf5bd5f1..72cd866829 100644 --- a/server-plugins/process-resources/src/transform.ts +++ b/server-plugins/process-resources/src/transform.ts @@ -13,12 +13,13 @@ // limitations under the License. // +import cardPlugin from '@hcengineering/card' import contact, { Employee, Person } from '@hcengineering/contact' import core, { Doc, matchQuery, Ref, Timestamp } from '@hcengineering/core' import { Execution, parseContext } from '@hcengineering/process' import { ProcessControl } from '@hcengineering/server-process' +import { markupToText } from '@hcengineering/text-core' import { getContextValue } from './utils' -import cardPlugin from '@hcengineering/card' // #region ArrayReduce @@ -573,4 +574,12 @@ export function DayFromDate (value: Date): number { return new Date(value).getDate() } +export function StringFromMarkup (value: string): string { + return markupToText(value) +} + +export function MarkupFromString (value: string): string { + return value +} + // #endregion diff --git a/server-plugins/process/src/index.ts b/server-plugins/process/src/index.ts index d3c67b63cd..18cc298676 100644 --- a/server-plugins/process/src/index.ts +++ b/server-plugins/process/src/index.ts @@ -119,11 +119,13 @@ export default plugin(serverProcessId, { ExecutionStarted: '' as Resource, StringFromNumber: '' as Resource, StringFromDate: '' as Resource, + StringFromMarkup: '' as Resource, StringFromBoolean: '' as Resource, NumberFromDate: '' as Resource, DateFromNumber: '' as Resource, NumberFromString: '' as Resource, DateFromString: '' as Resource, + MarkupFromString: '' as Resource, YearFromDate: '' as Resource, MonthFromDate: '' as Resource, DayFromDate: '' as Resource,