@seamly/web-ui 25.0.0 → 25.1.0-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/index.debug.js +75 -47
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +38 -15
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +11 -11
- package/src/javascripts/core/domains/store/slice.ts +1 -0
- package/src/javascripts/core/domains/store/store.types.ts +1 -0
- package/src/javascripts/core/ui/components/conversation/conversation.tsx +9 -11
- package/src/javascripts/core/ui/components/conversation/event/choice-prompt.tsx +1 -1
- package/src/javascripts/core/ui/components/entry/upload-toggle.tsx +1 -0
- package/src/javascripts/core/ui/components/layout/chat.tsx +6 -4
- package/src/javascripts/core/ui/components/view/window-view/collapse-button.tsx +10 -1
- package/src/javascripts/core/ui/components/view/window-view/window-open-button.tsx +7 -1
- package/src/javascripts/core/ui/hooks/focus-helper-hooks.ts +5 -0
package/build/dist/lib/index.js
CHANGED
|
@@ -5837,7 +5837,7 @@ class API {
|
|
|
5837
5837
|
return {
|
|
5838
5838
|
clientName: "@seamly/web-ui",
|
|
5839
5839
|
clientVariant: this.#layoutMode,
|
|
5840
|
-
clientVersion: "25.0.
|
|
5840
|
+
clientVersion: "25.1.0-beta.1",
|
|
5841
5841
|
currentUrl: window.location.toString(),
|
|
5842
5842
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
5843
5843
|
timezone: getTimeZone(),
|
|
@@ -12557,6 +12557,7 @@ const initialStoreState = {
|
|
|
12557
12557
|
skiplinkTargetId: randomId(),
|
|
12558
12558
|
optionsButtonId: randomId(),
|
|
12559
12559
|
headerCollapseButtonId: randomId(),
|
|
12560
|
+
windowOpenButtonId: randomId(),
|
|
12560
12561
|
serviceData: {},
|
|
12561
12562
|
options: {
|
|
12562
12563
|
features: {
|
|
@@ -14583,6 +14584,12 @@ const useSkiplinkTargetFocusing = () => {
|
|
|
14583
14584
|
const skiplinkTargetId = useSkiplink();
|
|
14584
14585
|
return useElementFocusingById(skiplinkTargetId);
|
|
14585
14586
|
};
|
|
14587
|
+
const useWindowOpenButtonFocusing = () => {
|
|
14588
|
+
const {
|
|
14589
|
+
windowOpenButtonId
|
|
14590
|
+
} = useSeamlyStateContext();
|
|
14591
|
+
return useElementFocusingById(windowOpenButtonId);
|
|
14592
|
+
};
|
|
14586
14593
|
const useFocusIfSeamlyContainedFocus = () => {
|
|
14587
14594
|
const containerElementRef = useRef(null);
|
|
14588
14595
|
const [seamlyContainerElement] = useSeamlyContainerElement();
|
|
@@ -15976,7 +15983,7 @@ const ChoicePrompt = ({
|
|
|
15976
15983
|
child.props = {
|
|
15977
15984
|
...child.props,
|
|
15978
15985
|
event: subEvent,
|
|
15979
|
-
descriptorId,
|
|
15986
|
+
id: descriptorId,
|
|
15980
15987
|
showTranslationToggle: false
|
|
15981
15988
|
};
|
|
15982
15989
|
return child;
|
|
@@ -20104,13 +20111,15 @@ const Conversation = () => {
|
|
|
20104
20111
|
className: css_className('chat__body'),
|
|
20105
20112
|
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
20106
20113
|
className: css_className('conversation__container'),
|
|
20107
|
-
children: [/*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(privacy_disclaimer, {}), /*#__PURE__*/(0,jsx_runtime_namespaceObject.
|
|
20108
|
-
className: css_className('conversation'),
|
|
20114
|
+
children: [/*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(privacy_disclaimer, {}), /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
20109
20115
|
role: "log",
|
|
20110
20116
|
"aria-label": t('chat.srLabel'),
|
|
20111
|
-
children:
|
|
20112
|
-
|
|
20113
|
-
|
|
20117
|
+
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("ol", {
|
|
20118
|
+
className: css_className('conversation'),
|
|
20119
|
+
children: [/*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(component_filter, {
|
|
20120
|
+
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(Events, {})
|
|
20121
|
+
}), debouncedIsLoading ? /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(loader, {}) : null, /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(AbortTransactionButton, {})]
|
|
20122
|
+
})
|
|
20114
20123
|
})]
|
|
20115
20124
|
})
|
|
20116
20125
|
})]
|
|
@@ -20438,10 +20447,11 @@ const Chat = (0,compat_namespaceObject.forwardRef)(({
|
|
|
20438
20447
|
className: givenClassName = ''
|
|
20439
20448
|
}, forwardedRef) => {
|
|
20440
20449
|
const {
|
|
20450
|
+
closeChat,
|
|
20441
20451
|
isOpen,
|
|
20442
|
-
isVisible
|
|
20443
|
-
setVisibility
|
|
20452
|
+
isVisible
|
|
20444
20453
|
} = useVisibility();
|
|
20454
|
+
const focusWindowOpenButton = useWindowOpenButtonFocusing();
|
|
20445
20455
|
const {
|
|
20446
20456
|
namespace,
|
|
20447
20457
|
layoutMode
|
|
@@ -20468,9 +20478,8 @@ const Chat = (0,compat_namespaceObject.forwardRef)(({
|
|
|
20468
20478
|
}
|
|
20469
20479
|
const onKeyDownHandler = e => {
|
|
20470
20480
|
if (e.code && e.code === 'Escape' || e.keyCode === 27) if (!isInline && isOpen) {
|
|
20471
|
-
|
|
20472
|
-
|
|
20473
|
-
});
|
|
20481
|
+
closeChat();
|
|
20482
|
+
focusWindowOpenButton();
|
|
20474
20483
|
}
|
|
20475
20484
|
};
|
|
20476
20485
|
return isVisible && /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("section", {
|
|
@@ -20483,7 +20492,7 @@ const Chat = (0,compat_namespaceObject.forwardRef)(({
|
|
|
20483
20492
|
children: [/*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("h2", {
|
|
20484
20493
|
className: css_className('chat__title', 'visually-hidden'),
|
|
20485
20494
|
id: headingId,
|
|
20486
|
-
children: t('
|
|
20495
|
+
children: t('window.srModalLayoutLabel')
|
|
20487
20496
|
}), /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
20488
20497
|
className: css_className('chat-wrapper'),
|
|
20489
20498
|
children: children
|
|
@@ -22696,6 +22705,7 @@ const UploadToggle = () => {
|
|
|
22696
22705
|
"aria-disabled": !showUploadButton,
|
|
22697
22706
|
type: "button",
|
|
22698
22707
|
onClick: showUploadButton ? onClickHandler : undefined,
|
|
22708
|
+
tabIndex: !showUploadButton ? -1 : undefined,
|
|
22699
22709
|
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
22700
22710
|
name: "file",
|
|
22701
22711
|
size: "32",
|
|
@@ -22812,6 +22822,8 @@ const EntryContainer = () => {
|
|
|
22812
22822
|
|
|
22813
22823
|
|
|
22814
22824
|
|
|
22825
|
+
|
|
22826
|
+
|
|
22815
22827
|
const CollapseButton = () => {
|
|
22816
22828
|
const {
|
|
22817
22829
|
t
|
|
@@ -22823,10 +22835,15 @@ const CollapseButton = () => {
|
|
|
22823
22835
|
const {
|
|
22824
22836
|
isWindow
|
|
22825
22837
|
} = useSeamlyLayoutMode();
|
|
22838
|
+
const focusWindowOpenButton = useWindowOpenButtonFocusing();
|
|
22839
|
+
const handleClick = (0,hooks_.useCallback)(() => {
|
|
22840
|
+
closeChat();
|
|
22841
|
+
focusWindowOpenButton();
|
|
22842
|
+
}, [closeChat, focusWindowOpenButton]);
|
|
22826
22843
|
return isOpen && isWindow ? /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("button", {
|
|
22827
22844
|
type: "button",
|
|
22828
22845
|
className: css_className('button', 'collapse-button'),
|
|
22829
|
-
onClick:
|
|
22846
|
+
onClick: handleClick,
|
|
22830
22847
|
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(layout_icon, {
|
|
22831
22848
|
name: "chevronDown",
|
|
22832
22849
|
size: "32",
|
|
@@ -23071,6 +23088,7 @@ function ContinueChatMessages() {
|
|
|
23071
23088
|
|
|
23072
23089
|
|
|
23073
23090
|
|
|
23091
|
+
|
|
23074
23092
|
const ButtonIcon = () => {
|
|
23075
23093
|
const startChatIcon = useStartChatIcon();
|
|
23076
23094
|
const currentAgent = useSeamlyCurrentAgent();
|
|
@@ -23099,6 +23117,9 @@ const WindowOpenButton = ({
|
|
|
23099
23117
|
const {
|
|
23100
23118
|
isOpen
|
|
23101
23119
|
} = useVisibility();
|
|
23120
|
+
const {
|
|
23121
|
+
windowOpenButtonId
|
|
23122
|
+
} = useSeamlyStateContext();
|
|
23102
23123
|
const count = useSeamlyUnreadCount();
|
|
23103
23124
|
const handleClick = (0,hooks_.useCallback)(() => {
|
|
23104
23125
|
onClick();
|
|
@@ -23108,10 +23129,12 @@ const WindowOpenButton = ({
|
|
|
23108
23129
|
isActive: !isOpen,
|
|
23109
23130
|
transitionStartState: transitionStartStates.rendered,
|
|
23110
23131
|
children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("button", {
|
|
23132
|
+
type: "button",
|
|
23111
23133
|
className: css_className('window-open-button'),
|
|
23112
23134
|
"aria-label": ariaLabel,
|
|
23113
|
-
"aria-hidden": isOpen,
|
|
23114
23135
|
onClick: handleClick,
|
|
23136
|
+
inert: isOpen || undefined,
|
|
23137
|
+
id: windowOpenButtonId,
|
|
23115
23138
|
children: [/*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(in_out_transition, {
|
|
23116
23139
|
isActive: !!count,
|
|
23117
23140
|
transitionStartState: transitionStartStates.notRendered,
|