@seamly/web-ui 21.0.1 → 21.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/components.js +18 -19
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/index.debug.js +4 -4
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +19 -20
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +18 -20
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +19 -20
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/utils.js +19 -20
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +1 -1
- package/src/javascripts/ui/components/layout/chat-frame.js +2 -4
- package/src/javascripts/ui/components/layout/interrupt.js +2 -0
- package/src/javascripts/ui/components/view/window-view/collapse-button.js +8 -6
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import AppOptions from 'ui/components/app-options'
|
|
|
2
2
|
import ChatScrollProvider from 'ui/components/conversation/event/chat-scroll/chat-scroll-provider'
|
|
3
3
|
import EntryContainer from 'ui/components/entry/entry-container'
|
|
4
4
|
import CollapseButton from 'ui/components/view/window-view/collapse-button'
|
|
5
|
-
import { useSeamlyLayoutMode } from 'ui/hooks/seamly-state-hooks'
|
|
6
5
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
7
6
|
import TranslationStatus from 'domains/translations/components/translation-status'
|
|
8
7
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
@@ -10,8 +9,7 @@ import { className } from 'lib/css'
|
|
|
10
9
|
|
|
11
10
|
function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
12
11
|
const { hasInterrupt, meta } = useInterrupt()
|
|
13
|
-
const { isOpen
|
|
14
|
-
const { isWindow } = useSeamlyLayoutMode()
|
|
12
|
+
const { isOpen } = useVisibility()
|
|
15
13
|
|
|
16
14
|
if (hasInterrupt) {
|
|
17
15
|
if (isOpen) {
|
|
@@ -25,7 +23,7 @@ function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
|
25
23
|
<ChatScrollProvider>
|
|
26
24
|
<div className={className('chat__container__header')}>
|
|
27
25
|
<TranslationStatus />
|
|
28
|
-
|
|
26
|
+
<CollapseButton />
|
|
29
27
|
</div>
|
|
30
28
|
{children}
|
|
31
29
|
</ChatScrollProvider>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'preact/hooks'
|
|
2
|
+
import CollapseButton from 'ui/components/view/window-view/collapse-button'
|
|
2
3
|
import {
|
|
3
4
|
useGeneratedId,
|
|
4
5
|
useLiveRegion,
|
|
@@ -46,6 +47,7 @@ const Interrupt = ({
|
|
|
46
47
|
|
|
47
48
|
return !isExpiredError ? (
|
|
48
49
|
<section className={className('interrupt')} aria-labelledby={headingId}>
|
|
50
|
+
<CollapseButton />
|
|
49
51
|
<div className={className('interrupt__body')}>
|
|
50
52
|
<h2 id={headingId} className={className('interrupt__title')}>
|
|
51
53
|
{title}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { useCallback } from 'preact/hooks'
|
|
2
1
|
import Icon from 'ui/components/layout/icon'
|
|
2
|
+
import { useSeamlyLayoutMode } from 'ui/hooks/seamly-state-hooks'
|
|
3
3
|
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
4
5
|
import { className } from 'lib/css'
|
|
5
6
|
|
|
6
|
-
const CollapseButton = (
|
|
7
|
+
const CollapseButton = () => {
|
|
7
8
|
const { t } = useI18n()
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const { isOpen, closeChat } = useVisibility()
|
|
10
|
+
const { isWindow } = useSeamlyLayoutMode()
|
|
11
|
+
return isOpen && isWindow ? (
|
|
10
12
|
<button
|
|
11
13
|
type="button"
|
|
12
14
|
className={className('button', 'collapse-button')}
|
|
13
|
-
onClick={
|
|
15
|
+
onClick={closeChat}
|
|
14
16
|
>
|
|
15
17
|
<Icon name="chevronDown" size="32" alt={t('window.srCollapseButton')} />
|
|
16
18
|
</button>
|
|
17
|
-
)
|
|
19
|
+
) : null
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export default CollapseButton
|