@seamly/web-ui 19.1.3 → 19.1.4
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 +5 -5
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +19 -5
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +22 -8
- package/build/dist/lib/standalone.min.js +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/javascripts/lib/external-api/index.js +5 -0
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +8 -1
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +2 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -1
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -124,6 +124,10 @@ class ExternalApi {
|
|
|
124
124
|
if (typeof this.appConfig === 'function') {
|
|
125
125
|
return this.appConfig(userConfig)
|
|
126
126
|
}
|
|
127
|
+
const defaults = {
|
|
128
|
+
...this.appConfig.defaults,
|
|
129
|
+
...userConfig.defaults,
|
|
130
|
+
}
|
|
127
131
|
return {
|
|
128
132
|
...this.appConfig,
|
|
129
133
|
...userConfig,
|
|
@@ -131,6 +135,7 @@ class ExternalApi {
|
|
|
131
135
|
...this.appConfig.api,
|
|
132
136
|
...userConfig.api,
|
|
133
137
|
},
|
|
138
|
+
defaults: Object.keys(defaults).length ? defaults : undefined,
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
}
|
|
@@ -8,6 +8,9 @@ import CarouselMessageSlide from '../carousel-message/components/slide'
|
|
|
8
8
|
|
|
9
9
|
const defaultGetItemKey = (item, idx, prefix) => `${prefix}${idx}`
|
|
10
10
|
const defaultGetItemLabel = (item) => item.label
|
|
11
|
+
const preventScroll = ({ target }) => {
|
|
12
|
+
target.scrollLeft = 0
|
|
13
|
+
}
|
|
11
14
|
|
|
12
15
|
export default function CarouselComponent({
|
|
13
16
|
currentIndex: originalIndex,
|
|
@@ -51,7 +54,10 @@ export default function CarouselComponent({
|
|
|
51
54
|
role="group"
|
|
52
55
|
aria-roledescription="carousel"
|
|
53
56
|
>
|
|
54
|
-
<div
|
|
57
|
+
<div
|
|
58
|
+
className={className('carousel__slides-wrapper')}
|
|
59
|
+
onScroll={preventScroll}
|
|
60
|
+
>
|
|
55
61
|
<div
|
|
56
62
|
id={carouselItemsId}
|
|
57
63
|
className={className('carousel__slides')}
|
|
@@ -78,6 +84,7 @@ export default function CarouselComponent({
|
|
|
78
84
|
item={item}
|
|
79
85
|
items={items}
|
|
80
86
|
currentIndex={currentIndex}
|
|
87
|
+
index={idx}
|
|
81
88
|
isActive={isActive}
|
|
82
89
|
/>
|
|
83
90
|
</div>
|
package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js
CHANGED
|
@@ -5,18 +5,17 @@ import CardComponent from '../../card-component'
|
|
|
5
5
|
export default function CarouselMessageSlide({
|
|
6
6
|
item: slide,
|
|
7
7
|
items,
|
|
8
|
-
|
|
8
|
+
index,
|
|
9
9
|
isActive,
|
|
10
10
|
}) {
|
|
11
11
|
const { t } = useI18n()
|
|
12
|
-
|
|
13
12
|
return (
|
|
14
13
|
<div
|
|
15
14
|
className={className('carousel-item', `carousel-item--${slide.type}`)}
|
|
16
15
|
role="group"
|
|
17
16
|
aria-roledescription="slide"
|
|
18
17
|
aria-label={t('carousel.slide.label', {
|
|
19
|
-
index:
|
|
18
|
+
index: index + 1,
|
|
20
19
|
total: items.length,
|
|
21
20
|
})}
|
|
22
21
|
>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import MessageContainer from '../../message-container'
|
|
2
2
|
import CarouselComponent from '../carousel-component'
|
|
3
|
+
import { useTranslatedEventData } from '../../../../../domains/translations'
|
|
3
4
|
import CarouselMessageSlide from './components/slide'
|
|
4
5
|
|
|
5
6
|
const getItemKey = (item, idx, prefix = '') => `${prefix}${item.title}:${idx}`
|
|
6
7
|
const getItemLabel = (item) => item.title
|
|
7
8
|
const CarouselMessage = ({ event }) => {
|
|
8
|
-
const
|
|
9
|
+
const [body] = useTranslatedEventData(event)
|
|
10
|
+
const slides = body.cards
|
|
9
11
|
|
|
10
12
|
return (
|
|
11
13
|
<MessageContainer event={event} modifiers={'type-carousel'}>
|