Merge branch 'staging' into develop

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2025-02-11 08:47:49 +07:00
commit 66a05f7126
No known key found for this signature in database
GPG Key ID: BD80F68D68D8F7F2
15 changed files with 98 additions and 89 deletions

View File

@ -51,10 +51,10 @@ importers:
version: 5.0.0
'@livekit/krisp-noise-filter':
specifier: ^0.2.16
version: 0.2.16(livekit-client@2.8.1)
version: 0.2.16(livekit-client@2.9.0)
'@livekit/track-processors':
specifier: ^0.3.3
version: 0.3.3(livekit-client@2.8.1)
version: 0.3.3(livekit-client@2.9.0)
'@octokit/types':
specifier: ^12.0.0
version: 12.6.0
@ -1739,8 +1739,8 @@ importers:
specifier: ^1.9.46
version: 1.10.56
livekit-client:
specifier: ^2.8.1
version: 2.8.1
specifier: ^2.9.0
version: 2.9.0
livekit-server-sdk:
specifier: ^2.0.10
version: 2.6.0
@ -3279,8 +3279,8 @@ packages:
'@livekit/protocol@1.19.1':
resolution: {integrity: sha512-PQYIuqRv++fRik9tKulJ0C0tT5O4cNviBA7OxwLTCBFDxJpve8ua8/JZ+nK+7r4j2KbLfVjsJYop9wcTCgRn7Q==}
'@livekit/protocol@1.30.0':
resolution: {integrity: sha512-SDI9ShVKj8N3oOSinr8inaxD3FXgmgoJlqN35uU/Yx1sdoDeQbzAuBFox7bYjM+VhnZ1V22ivIDjAsKr00H+XQ==}
'@livekit/protocol@1.33.0':
resolution: {integrity: sha512-361mBlFgI3nvn8oSQIL38gDUBGbOSwsEOqPgX0c1Jwz75/sD/TTvPeAM4zAz6OrV5Q4vI4Ruswecnyv5SG4oig==}
'@livekit/track-processors@0.3.3':
resolution: {integrity: sha512-C5mBWe34ie0pfhCf9zAD65D26ZytzW/xGrj8Zc1BGh5kLISFDVQlefO78LZWw9K5saTamk60O4fzSCKqWMPMLA==}
@ -4019,7 +4019,7 @@ packages:
version: 0.0.0
'@rush-temp/desktop@file:projects/desktop.tgz':
resolution: {integrity: sha512-VwFxHKKqrH1hk0cB0uv02hYLr4JVbOXHSD6EZlU5As2Xu2FhCHbzj/1t8u5rFCumYM/q77ZDWSVfowoWcPdvJA==, tarball: file:projects/desktop.tgz}
resolution: {integrity: sha512-8we0EU2OgAaGXO+0DTj+BXro2vDokwXNGpKcVrzj9BbIvn6+3+BoRJJ1QcWwFa36XKnGuIKkkWMgMRdB6Quv9A==, tarball: file:projects/desktop.tgz}
version: 0.0.0
'@rush-temp/devmodel-resources@file:projects/devmodel-resources.tgz':
@ -4191,7 +4191,7 @@ packages:
version: 0.0.0
'@rush-temp/love-resources@file:projects/love-resources.tgz':
resolution: {integrity: sha512-ctWHaA5PFXbMrLSakcpvUMDSk+62l7i+y19Cf6+Qg8jUfjo6fxRY+Onjz+Ml0vRiLMSuZq2WLu9MR4S6sTyJkw==, tarball: file:projects/love-resources.tgz}
resolution: {integrity: sha512-mNrDaH4UuKvs9Qk030LXdpFGVk6u9PQaXSwnbMT7JihP2pdoMwG116biNgqzvr0jXQ9f12Gp4Q6Y7wj5oM9jvg==, tarball: file:projects/love-resources.tgz}
version: 0.0.0
'@rush-temp/love@file:projects/love.tgz':
@ -4875,7 +4875,7 @@ packages:
version: 0.0.0
'@rush-temp/server-github-model@file:projects/server-github-model.tgz':
resolution: {integrity: sha512-1qQ8IXhyHSiV5P+M7sGq0QHkkAG2n2DK3knDQJv/xzOQamJ6kcr2nlaqtAD48LfO1wVTtUkjwYwE9RbAEgpl5w==, tarball: file:projects/server-github-model.tgz}
resolution: {integrity: sha512-U7kynRwConx+S1nLfFluVkWJtFKCEMJRIHx/oN1OFy2zmIGSw1o7z1NIgEYAiYogj8zP1SPYoVKPQTSkSosKqw==, tarball: file:projects/server-github-model.tgz}
version: 0.0.0
'@rush-temp/server-github-resources@file:projects/server-github-resources.tgz':
@ -10177,8 +10177,8 @@ packages:
linkifyjs@4.2.0:
resolution: {integrity: sha512-pCj3PrQyATaoTYKHrgWRF3SJwsm61udVh+vuls/Rl6SptiDhgE7ziUIudAedRY9QEfynmM7/RmLEfPUyw1HPCw==}
livekit-client@2.8.1:
resolution: {integrity: sha512-HPv9iHNrnBANI9ucK7CKZspx0sBZK3hjR2EbwaV08+J3RM9+tNGL2ob2n76nxJLEZG7LzdWlLZdbr4fQBP6Hkg==}
livekit-client@2.9.0:
resolution: {integrity: sha512-7YwDXKb1aA/W1fedghc6Vn/ykHdoVHFr5ujOIja+YR4dsqjpWHNjQzZNbrMFu37R5cBiJ/7zK/Zs7r/amHjBMA==}
livekit-server-sdk@2.6.0:
resolution: {integrity: sha512-lt9VZN8vTPG/P5tj4ofwLj/HTbt343AThbAWFk70OYbQucAOdv+8w00Wv9RjMndSkHaXheXOQHg8fhGOlYXmug==}
@ -15138,9 +15138,9 @@ snapshots:
'@lifeomic/attempt@3.0.3': {}
'@livekit/krisp-noise-filter@0.2.16(livekit-client@2.8.1)':
'@livekit/krisp-noise-filter@0.2.16(livekit-client@2.9.0)':
dependencies:
livekit-client: 2.8.1
livekit-client: 2.9.0
'@livekit/mutex@1.1.1': {}
@ -15148,15 +15148,15 @@ snapshots:
dependencies:
'@bufbuild/protobuf': 1.10.0
'@livekit/protocol@1.30.0':
'@livekit/protocol@1.33.0':
dependencies:
'@bufbuild/protobuf': 1.10.0
'@livekit/track-processors@0.3.3(livekit-client@2.8.1)':
'@livekit/track-processors@0.3.3(livekit-client@2.9.0)':
dependencies:
'@mediapipe/holistic': 0.5.1675471629
'@mediapipe/tasks-vision': 0.10.9
livekit-client: 2.8.1
livekit-client: 2.9.0
'@malept/cross-spawn-promise@2.0.0':
dependencies:
@ -17446,7 +17446,7 @@ snapshots:
file-loader: 6.2.0(webpack@5.97.1)
fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.97.1)
html-webpack-plugin: 5.6.0(webpack@5.97.1)
livekit-client: 2.8.1
livekit-client: 2.9.0
mini-css-extract-plugin: 2.8.0(webpack@5.97.1)
node-loader: 2.0.0(webpack@5.97.1)
postcss: 8.4.35
@ -18813,8 +18813,8 @@ snapshots:
'@rush-temp/love-resources@file:projects/love-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))':
dependencies:
'@livekit/krisp-noise-filter': 0.2.16(livekit-client@2.8.1)
'@livekit/track-processors': 0.3.3(livekit-client@2.8.1)
'@livekit/krisp-noise-filter': 0.2.16(livekit-client@2.9.0)
'@livekit/track-processors': 0.3.3(livekit-client@2.9.0)
'@types/jest': 29.5.12
'@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3)
'@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3)
@ -18825,7 +18825,7 @@ snapshots:
eslint-plugin-promise: 6.1.1(eslint@8.56.0)
eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))
jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))
livekit-client: 2.8.1
livekit-client: 2.9.0
prettier: 3.2.5
prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.19)
sass: 1.71.1
@ -32240,10 +32240,10 @@ snapshots:
linkifyjs@4.2.0: {}
livekit-client@2.8.1:
livekit-client@2.9.0:
dependencies:
'@livekit/mutex': 1.1.1
'@livekit/protocol': 1.30.0
'@livekit/protocol': 1.33.0
events: 3.3.0
loglevel: 1.9.1
sdp-transform: 2.14.2

View File

@ -1 +1 @@
"0.6.435"
"0.6.436"

View File

@ -224,7 +224,7 @@
"electron-store": "^8.2.0",
"electron-log": "^5.1.7",
"electron-updater": "^6.3.4",
"livekit-client": "^2.8.1",
"livekit-client": "^2.9.0",
"@hcengineering/server-backup": "^0.6.0",
"ws": "^8.18.0"
},

View File

@ -1,6 +1,6 @@
//
import { AvatarType, type SocialIdentity, type Contact } from '@hcengineering/contact'
import { AvatarType, type Contact, type SocialIdentity } from '@hcengineering/contact'
import {
type AccountRole,
buildSocialIdString,

View File

@ -13,7 +13,7 @@
// limitations under the License.
//
import core, { SortingOrder, type PluginConfiguration, type TxUpdateDoc } from '@hcengineering/core'
import core, { SortingOrder, type PluginConfiguration, type Tx, type TxUpdateDoc } from '@hcengineering/core'
import { getResourcePlugin, type Plugin, type Resource } from '@hcengineering/platform'
import { writable } from 'svelte/store'
import { addTxListener, createQuery } from '.'
@ -46,13 +46,15 @@ export const configurationStore = writable<ConfigurationManager>(configuration)
const configQuery = createQuery(true)
addTxListener((tx) => {
if (tx._class === core.class.TxUpdateDoc) {
const cud = tx as TxUpdateDoc<PluginConfiguration>
if (cud.objectClass === core.class.PluginConfiguration) {
if (cud.operations.enabled !== undefined) {
// Plugin enabled/disabled we need to refresh
location.reload()
addTxListener((txes: Tx[]) => {
for (const tx of txes) {
if (tx._class === core.class.TxUpdateDoc) {
const cud = tx as TxUpdateDoc<PluginConfiguration>
if (cud.objectClass === core.class.PluginConfiguration) {
if (cud.operations.enabled !== undefined) {
// Plugin enabled/disabled we need to refresh
location.reload()
}
}
}
}

View File

@ -68,12 +68,13 @@ let rawLiveQuery: LQ
let client: TxOperations & Client
let pipeline: PresentationPipeline
const txListeners: Array<(...tx: Tx[]) => void> = []
export type TxListener = (tx: Tx[]) => void
const txListeners: TxListener[] = []
/**
* @public
*/
export function addTxListener (l: (tx: Tx) => void): void {
export function addTxListener (l: TxListener): void {
txListeners.push(l)
}
@ -84,7 +85,7 @@ export function getRawLiveQuery (): LQ {
/**
* @public
*/
export function removeTxListener (l: (tx: Tx) => void): void {
export function removeTxListener (l: TxListener): void {
const pos = txListeners.findIndex((it) => it === l)
if (pos !== -1) {
txListeners.splice(pos, 1)
@ -142,7 +143,7 @@ class UIClient extends TxOperations implements Client {
await rawLiveQuery.tx(...tx)
txListeners.forEach((it) => {
it(...tx)
it(tx)
})
} catch (err: any) {
Analytics.handleError(err)

View File

@ -13,25 +13,25 @@
// limitations under the License.
-->
<script lang="ts">
import core, { Doc, generateId, getCurrentAccount, Ref, Space, Timestamp, Tx, TxCUD } from '@hcengineering/core'
import activity, { ActivityMessage } from '@hcengineering/activity'
import { ModernButton, Scroller } from '@hcengineering/ui'
import { addTxListener, getClient, removeTxListener } from '@hcengineering/presentation'
import { ActivityMessagePresenter, canGroupMessages, messageInFocus } from '@hcengineering/activity-resources'
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
import { afterUpdate, onDestroy, onMount, tick } from 'svelte'
import core, { Doc, generateId, getCurrentAccount, Ref, Space, Timestamp, Tx, TxCUD } from '@hcengineering/core'
import { DocNotifyContext } from '@hcengineering/notification'
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
import { addTxListener, getClient, removeTxListener } from '@hcengineering/presentation'
import { ModernButton, Scroller } from '@hcengineering/ui'
import { afterUpdate, onDestroy, onMount, tick } from 'svelte'
import HistoryLoading from './LoadingHistory.svelte'
import { chatReadMessagesStore, recheckNotifications } from '../utils'
import { getScrollToDateOffset, getSelectedDate, jumpToDate, readViewportMessages } from '../scroll'
import { ChannelDataProvider, MessageMetadata } from '../channelDataProvider'
import chunter from '../plugin'
import { getScrollToDateOffset, getSelectedDate, jumpToDate, readViewportMessages } from '../scroll'
import { chatReadMessagesStore, recheckNotifications } from '../utils'
import BaseChatScroller from './BaseChatScroller.svelte'
import BlankView from './BlankView.svelte'
import ChannelInput from './ChannelInput.svelte'
import ActivityMessagesSeparator from './ChannelMessagesSeparator.svelte'
import JumpToDateSelector from './JumpToDateSelector.svelte'
import BaseChatScroller from './BaseChatScroller.svelte'
import { ChannelDataProvider, MessageMetadata } from '../channelDataProvider'
import ChannelInput from './ChannelInput.svelte'
import HistoryLoading from './LoadingHistory.svelte'
export let provider: ChannelDataProvider
export let object: Doc
@ -537,11 +537,12 @@
loadMore()
}
const newMessageTxListener = (tx: Tx): void => {
const ctx = tx as TxCUD<ActivityMessage>
if (ctx.attachedTo !== doc._id) return
if (ctx._class !== core.class.TxCreateDoc) return
if (shouldScrollToNew) {
const newMessageTxListener = (txes: Tx[]): void => {
const ctx = txes
.map((it) => it as TxCUD<ActivityMessage>)
.filter((it) => it.attachedTo === doc._id && it._class === core.class.TxCreateDoc)
if (ctx.length > 0 && shouldScrollToNew) {
void wait().then(scrollToNewMessages)
}
}

View File

@ -54,7 +54,7 @@ export class PresentationClientHook implements ClientHook {
constructor () {
this.notifyEnabled = (localStorage.getItem('#platform.notification.logging') ?? 'true') === 'true'
addTxListener((...tx) => {
addTxListener((tx) => {
if (this.notifyEnabled) {
const rtx = tx.filter((tx) => (tx as any).objectClass !== core.class.BenchmarkDoc)
if (rtx.length > 0) {

View File

@ -61,7 +61,7 @@
"@hcengineering/workbench-resources": "^0.6.1",
"@livekit/krisp-noise-filter": "^0.2.16",
"@livekit/track-processors": "^0.3.3",
"livekit-client": "^2.8.1",
"livekit-client": "^2.9.0",
"svelte": "^4.2.19"
}
}

View File

@ -6,7 +6,6 @@
<div class="antiPopup p-4 grid">
<Label label={love.string.WithAudio} />
{$isShareWithSound}
<Toggle
showTooltip={{ label: love.string.ShareWithAudioTooltip }}
on={$isShareWithSound}

View File

@ -13,17 +13,23 @@
// limitations under the License.
-->
<script lang="ts">
import { PluginConfiguration } from '@hcengineering/core'
import { configurationStore, getClient } from '@hcengineering/presentation'
import { Button, Icon, IconInfo, Label, Header, Breadcrumb, Scroller } from '@hcengineering/ui'
import core, { PluginConfiguration } from '@hcengineering/core'
import { configurationStore, getClient, isAdminUser } from '@hcengineering/presentation'
import { Breadcrumb, Button, Header, Icon, IconInfo, Label, Scroller } from '@hcengineering/ui'
import setting from '../plugin'
const client = getClient()
async function change (config: PluginConfiguration, value: boolean): Promise<void> {
await client.update(config, {
enabled: value
})
await client.update(
config,
{
enabled: value
},
false,
Date.now(),
isAdminUser() ? core.account.ConfigUser : undefined
)
}
</script>

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { Analytics } from '@hcengineering/analytics'
import core, { Doc, Hierarchy, Ref, Space, TxRemoveDoc } from '@hcengineering/core'
import core, { Doc, Hierarchy, Ref, Space, TxRemoveDoc, type Tx } from '@hcengineering/core'
import { getResource } from '@hcengineering/platform'
import { addTxListener, contextStore, getClient, reduceCalls } from '@hcengineering/presentation'
import { AnyComponent, Component } from '@hcengineering/ui'
@ -28,8 +28,8 @@
const client = getClient()
addTxListener((tx) => {
if (tx._class === core.class.TxRemoveDoc) {
addTxListener((txes: Tx[]) => {
for (const tx of txes.filter((it) => it._class === core.class.TxRemoveDoc)) {
const docId = (tx as TxRemoveDoc<Doc>).objectId
const provider = ListSelectionProvider.Find(docId)
if (provider !== undefined) {

View File

@ -262,12 +262,14 @@
$: void updateItems(search, filteredActions)
function txListener (tx: Tx): void {
if (tx._class === core.class.TxWorkspaceEvent) {
const evt = tx as TxWorkspaceEvent
if (evt.event === WorkspaceEvent.IndexingUpdate) {
void updateItems(search, filteredActions)
}
function txListener (txes: Tx[]): void {
if (
txes.some(
(it) =>
it._class === core.class.TxWorkspaceEvent && (it as TxWorkspaceEvent).event === WorkspaceEvent.IndexingUpdate
)
) {
void updateItems(search, filteredActions)
}
}

View File

@ -92,8 +92,6 @@
{#if viewlet?.$lookup?.descriptor?.component}
{#if loading}
{configurationsLoading}
{preferencesLoading}
<Loading />
{:else}
<Component

View File

@ -13,16 +13,16 @@
// limitations under the License.
-->
<script lang="ts">
import { addTxListener, createQuery, getClient, removeTxListener } from '@hcengineering/presentation'
import { WidgetPreference, SidebarEvent, TxSidebarEvent, OpenSidebarWidgetParams } from '@hcengineering/workbench'
import { Tx } from '@hcengineering/core'
import { addTxListener, createQuery, getClient, removeTxListener } from '@hcengineering/presentation'
import { panelstore } from '@hcengineering/ui'
import { OpenSidebarWidgetParams, SidebarEvent, TxSidebarEvent, WidgetPreference } from '@hcengineering/workbench'
import { onMount } from 'svelte'
import { panelstore, deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
import workbench from '../../plugin'
import { createWidgetTab, openWidget, sidebarStore, SidebarVariant } from '../../sidebar'
import SidebarMini from './SidebarMini.svelte'
import SidebarExpanded from './SidebarExpanded.svelte'
import SidebarMini from './SidebarMini.svelte'
const client = getClient()
@ -37,18 +37,18 @@
$: mini = $sidebarStore.variant === SidebarVariant.MINI
$: if ((!mini || mini) && $panelstore.panel?.refit !== undefined) $panelstore.panel.refit()
function txListener (tx: Tx): void {
if (tx._class === workbench.class.TxSidebarEvent) {
const evt = tx as TxSidebarEvent
if (evt.event === SidebarEvent.OpenWidget) {
const params = evt.params as OpenSidebarWidgetParams
const widget = client.getModel().findAllSync(workbench.class.Widget, { _id: params.widget })[0]
if (widget === undefined) return
if (params.tab !== undefined) {
createWidgetTab(widget, params.tab)
} else {
openWidget(widget)
}
function txListener (txes: Tx[]): void {
const evt = txes.findLast(
(it) => it._class === workbench.class.TxSidebarEvent && evt.event === SidebarEvent.OpenWidget
) as TxSidebarEvent
if (evt !== undefined) {
const params = evt.params as OpenSidebarWidgetParams
const widget = client.getModel().findAllSync(workbench.class.Widget, { _id: params.widget })[0]
if (widget === undefined) return
if (params.tab !== undefined) {
createWidgetTab(widget, params.tab)
} else {
openWidget(widget)
}
}
}