mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 12:55:59 +00:00
Removed, replaced bind:clientWidth and bind:clientHeight (#5741)
This commit is contained in:
parent
b0657cff63
commit
e673345a4b
@ -16,7 +16,7 @@
|
|||||||
import { Markup } from '@hcengineering/core'
|
import { Markup } from '@hcengineering/core'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import { EmptyMarkup } from '@hcengineering/text'
|
import { EmptyMarkup } from '@hcengineering/text'
|
||||||
import { Button, ButtonSize, Scroller } from '@hcengineering/ui'
|
import { Button, type ButtonSize, Scroller } from '@hcengineering/ui'
|
||||||
import { AnyExtension, mergeAttributes } from '@tiptap/core'
|
import { AnyExtension, mergeAttributes } from '@tiptap/core'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import textEditorPlugin from '../plugin'
|
import textEditorPlugin from '../plugin'
|
||||||
@ -51,8 +51,6 @@
|
|||||||
|
|
||||||
let textEditor: TextEditor | undefined = undefined
|
let textEditor: TextEditor | undefined = undefined
|
||||||
|
|
||||||
let contentHeight: number
|
|
||||||
|
|
||||||
export function submit (): void {
|
export function submit (): void {
|
||||||
textEditor?.submit()
|
textEditor?.submit()
|
||||||
}
|
}
|
||||||
@ -162,13 +160,7 @@
|
|||||||
on:click|preventDefault|stopPropagation={() => (needFocus = true)}
|
on:click|preventDefault|stopPropagation={() => (needFocus = true)}
|
||||||
>
|
>
|
||||||
<div class="textInput">
|
<div class="textInput">
|
||||||
<div
|
<div class="inputMsg" class:scrollable={isScrollable} style:--texteditor-maxheight={varsStyle}>
|
||||||
bind:clientHeight={contentHeight}
|
|
||||||
class="inputMsg"
|
|
||||||
class:showScroll={contentHeight > 32}
|
|
||||||
class:scrollable={isScrollable}
|
|
||||||
style="--texteditor-maxheight: {varsStyle};"
|
|
||||||
>
|
|
||||||
{#if isScrollable}
|
{#if isScrollable}
|
||||||
<Scroller>
|
<Scroller>
|
||||||
<TextEditor
|
<TextEditor
|
||||||
@ -257,10 +249,6 @@
|
|||||||
|
|
||||||
&.scrollable {
|
&.scrollable {
|
||||||
max-height: var(--texteditor-maxheight);
|
max-height: var(--texteditor-maxheight);
|
||||||
|
|
||||||
&.showScroll {
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
&:not(.showScroll) {
|
&:not(.showScroll) {
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
|
@ -132,6 +132,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Room
|
||||||
|
@media only screen and (max-width: 1024px) {
|
||||||
|
.room-container + .bar > .bar__left-panel button span { display: none; }
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 700px) {
|
||||||
|
.room-container + .bar > .bar__left-panel { position: initial; }
|
||||||
|
}
|
||||||
|
|
||||||
// RoomPopup
|
// RoomPopup
|
||||||
.room-popup {
|
.room-popup {
|
||||||
.room-btns {
|
.room-btns {
|
||||||
|
@ -47,9 +47,6 @@
|
|||||||
const allowShare: boolean = true
|
const allowShare: boolean = true
|
||||||
let allowLeave: boolean = false
|
let allowLeave: boolean = false
|
||||||
|
|
||||||
let barWidth: number
|
|
||||||
$: noLabel = barWidth < 900
|
|
||||||
|
|
||||||
$: allowCam = $currentRoom?.type === RoomType.Video
|
$: allowCam = $currentRoom?.type === RoomType.Video
|
||||||
$: allowLeave = $myInfo?.room !== ($myOffice?._id ?? love.ids.Reception)
|
$: allowLeave = $myInfo?.room !== ($myOffice?._id ?? love.ids.Reception)
|
||||||
|
|
||||||
@ -104,7 +101,7 @@
|
|||||||
const micKeys = client.getModel().findAllSync(view.class.Action, { _id: love.action.ToggleMic })?.[0]?.keyBinding
|
const micKeys = client.getModel().findAllSync(view.class.Action, { _id: love.action.ToggleMic })?.[0]?.keyBinding
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div bind:clientWidth={barWidth} class="bar w-full flex-center flex-gap-2 flex-no-shrink">
|
<div class="bar w-full flex-center flex-gap-2 flex-no-shrink">
|
||||||
{#if room._id !== love.ids.Reception}
|
{#if room._id !== love.ids.Reception}
|
||||||
<ModernButton
|
<ModernButton
|
||||||
icon={roomAccessIcon[room.access]}
|
icon={roomAccessIcon[room.access]}
|
||||||
@ -162,7 +159,7 @@
|
|||||||
{#if hasAccountRole(getCurrentAccount(), AccountRole.User)}
|
{#if hasAccountRole(getCurrentAccount(), AccountRole.User)}
|
||||||
<ModernButton
|
<ModernButton
|
||||||
icon={view.icon.Copy}
|
icon={view.icon.Copy}
|
||||||
tooltip={{ label: !linkCopied ? love.string.CopyGuestLink : view.string.Copied }}
|
tooltip={{ label: !linkCopied ? love.string.CopyGuestLink : view.string.Copied, direction: 'top' }}
|
||||||
kind={'secondary'}
|
kind={'secondary'}
|
||||||
size={'large'}
|
size={'large'}
|
||||||
on:click={copyGuestLink}
|
on:click={copyGuestLink}
|
||||||
@ -171,8 +168,8 @@
|
|||||||
{#if allowLeave}
|
{#if allowLeave}
|
||||||
<ModernButton
|
<ModernButton
|
||||||
icon={love.icon.LeaveRoom}
|
icon={love.icon.LeaveRoom}
|
||||||
label={noLabel ? undefined : love.string.LeaveRoom}
|
label={love.string.LeaveRoom}
|
||||||
tooltip={{ label: love.string.LeaveRoom }}
|
tooltip={{ label: love.string.LeaveRoom, direction: 'top' }}
|
||||||
kind={'negative'}
|
kind={'negative'}
|
||||||
size={'large'}
|
size={'large'}
|
||||||
on:click={leave}
|
on:click={leave}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
import { Person, formatName } from '@hcengineering/contact'
|
import { Person, formatName } from '@hcengineering/contact'
|
||||||
import { Avatar, personByIdStore } from '@hcengineering/contact-resources'
|
import { Avatar, personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import { Ref } from '@hcengineering/core'
|
import { Ref } from '@hcengineering/core'
|
||||||
import { Icon, Loading } from '@hcengineering/ui'
|
import { Icon, Loading, resizeObserver } from '@hcengineering/ui'
|
||||||
import love from '../plugin'
|
import love from '../plugin'
|
||||||
|
|
||||||
export let _id: string
|
export let _id: string
|
||||||
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
let parent: HTMLDivElement
|
let parent: HTMLDivElement
|
||||||
let activeTrack: boolean = false
|
let activeTrack: boolean = false
|
||||||
|
let filled: boolean = false
|
||||||
|
|
||||||
export function appendChild (track: HTMLMediaElement): void {
|
export function appendChild (track: HTMLMediaElement): void {
|
||||||
const video = parent.querySelector('.video')
|
const video = parent.querySelector('.video')
|
||||||
@ -58,8 +59,21 @@
|
|||||||
$: user = $personByIdStore.get(_id as Ref<Person>)
|
$: user = $personByIdStore.get(_id as Ref<Person>)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id={_id} class="parent" class:small bind:clientWidth={parentWidth}>
|
<div
|
||||||
<div class="label" class:filled bind:clientWidth={labelWidth}>
|
id={_id}
|
||||||
|
class="parent"
|
||||||
|
class:small
|
||||||
|
use:resizeObserver={(element) => {
|
||||||
|
parentWidth = element.clientWidth
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="label"
|
||||||
|
class:filled
|
||||||
|
use:resizeObserver={(element) => {
|
||||||
|
labelWidth = element.clientWidth
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span class="overflow-label">{formatName(name)}</span>
|
<span class="overflow-label">{formatName(name)}</span>
|
||||||
{#if connecting}
|
{#if connecting}
|
||||||
<div class="loading">
|
<div class="loading">
|
||||||
@ -70,9 +84,9 @@
|
|||||||
<Icon size="small" icon={love.icon.MicDisabled} />
|
<Icon size="small" icon={love.icon.MicDisabled} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div bind:this={parent} class="cover" class:mirror={mirror && activeTrack}>
|
<div bind:this={parent} class="cover" class:active={activeTrack} class:mirror={mirror && activeTrack}>
|
||||||
<div class="ava" class:hidden={activeTrack}>
|
<div class="ava">
|
||||||
<Avatar size={'full'} {name} person={user} />
|
<Avatar size={'full'} {name} person={user} showStatus={false} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -102,10 +116,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ava {
|
.ava {
|
||||||
height: 25%;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 20%;
|
position: absolute;
|
||||||
|
height: 25%;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
|
border-radius: 20%;
|
||||||
|
}
|
||||||
|
&.active > .ava {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
&:not(.active) {
|
||||||
|
background-color: black;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.parent {
|
.parent {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import { personByIdStore } from '@hcengineering/contact-resources'
|
import { personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import { Room as TypeRoom } from '@hcengineering/love'
|
import { Room as TypeRoom } from '@hcengineering/love'
|
||||||
import { getMetadata } from '@hcengineering/platform'
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
import { Label, Loading, deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
|
import { Label, Loading, deviceOptionsStore as deviceInfo, resizeObserver } from '@hcengineering/ui'
|
||||||
import {
|
import {
|
||||||
LocalParticipant,
|
LocalParticipant,
|
||||||
LocalTrackPublication,
|
LocalTrackPublication,
|
||||||
@ -317,8 +317,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if withVideo}
|
{#if withVideo}
|
||||||
<div
|
<div
|
||||||
bind:clientWidth={roomWidth}
|
use:resizeObserver={(element) => {
|
||||||
bind:clientHeight={roomHeight}
|
roomWidth = element.clientWidth
|
||||||
|
roomHeight = element.clientHeight
|
||||||
|
}}
|
||||||
class="videoGrid"
|
class="videoGrid"
|
||||||
style={$screenSharing ? '' : gridStyle}
|
style={$screenSharing ? '' : gridStyle}
|
||||||
class:scroll-m-0={$screenSharing}
|
class:scroll-m-0={$screenSharing}
|
||||||
|
Loading…
Reference in New Issue
Block a user