@seamly/web-ui 19.1.2 → 19.1.5
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/CHANGELOG.md +627 -0
- package/build/dist/lib/index.debug.js +9 -9
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +72 -42
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +75 -45
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +42 -30
- package/build/dist/lib/style-guide.min.js +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/errors/seamly-base-error.js +7 -0
- package/src/javascripts/api/producer.js +5 -1
- package/src/javascripts/domains/errors/index.js +5 -4
- package/src/javascripts/domains/store/index.js +10 -9
- package/src/javascripts/domains/translations/middleware.js +6 -5
- 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/src/.DS_Store +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import thunkMiddleware from 'redux-thunk'
|
|
2
|
-
import { createReduxStore } from '../redux'
|
|
3
2
|
import { Reducer as appReducer } from '../app'
|
|
4
3
|
import {
|
|
5
4
|
createMiddleware as createConfigMiddleware,
|
|
6
5
|
Reducer as configReducer,
|
|
7
6
|
} from '../config'
|
|
7
|
+
import { createMiddleware as createErrorsMiddleware } from '../errors'
|
|
8
8
|
import { Reducer as formReducer } from '../forms'
|
|
9
|
-
import {
|
|
10
|
-
Reducer as translationsReducer,
|
|
11
|
-
createMiddleware as createI18nMiddleware,
|
|
12
|
-
} from '../translations'
|
|
13
9
|
import { Reducer as i18nReducer } from '../i18n'
|
|
14
|
-
import { Reducer as visibilityReducer } from '../visibility'
|
|
15
10
|
import {
|
|
16
|
-
Reducer as interruptReducer,
|
|
17
11
|
createMiddleware as createInterruptMiddleware,
|
|
12
|
+
Reducer as interruptReducer,
|
|
18
13
|
} from '../interrupt'
|
|
19
14
|
import { createMiddleware as createOptionsMiddleware } from '../options'
|
|
20
|
-
import {
|
|
15
|
+
import { createReduxStore } from '../redux'
|
|
16
|
+
import {
|
|
17
|
+
createMiddleware as createI18nMiddleware,
|
|
18
|
+
Reducer as translationsReducer,
|
|
19
|
+
} from '../translations'
|
|
20
|
+
import { Reducer as visibilityReducer } from '../visibility'
|
|
21
|
+
|
|
21
22
|
import stateReducer from './state-reducer'
|
|
22
23
|
|
|
23
24
|
export function createStore({ initialState, api, eventBus } = {}) {
|
|
@@ -42,7 +43,7 @@ export function createStore({ initialState, api, eventBus } = {}) {
|
|
|
42
43
|
createConfigMiddleware(),
|
|
43
44
|
createInterruptMiddleware({ api }),
|
|
44
45
|
createOptionsMiddleware({ api }),
|
|
45
|
-
createI18nMiddleware
|
|
46
|
+
createI18nMiddleware,
|
|
46
47
|
],
|
|
47
48
|
})
|
|
48
49
|
return store
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as Actions from './actions'
|
|
2
1
|
import { seamlyActions } from '../../ui/utils/seamly-utils'
|
|
3
2
|
import { Actions as I18nActions, Selectors as I18nSelectors } from '../i18n'
|
|
3
|
+
import * as Actions from './actions'
|
|
4
4
|
|
|
5
|
-
export default function createMiddleware() {
|
|
6
|
-
return (
|
|
7
|
-
(
|
|
8
|
-
(action) => {
|
|
5
|
+
export default function createMiddleware({ dispatch, getState }) {
|
|
6
|
+
return (next) => {
|
|
7
|
+
return (action) => {
|
|
9
8
|
const result = next(action)
|
|
10
9
|
|
|
11
10
|
switch (action.type) {
|
|
12
11
|
case String(seamlyActions.SET_HISTORY):
|
|
13
12
|
if (action.history?.translation?.enabled) {
|
|
14
13
|
dispatch(Actions.enable(action.history.translation.locale))
|
|
14
|
+
dispatch(I18nActions.setLocale(action.history.translation.locale))
|
|
15
15
|
}
|
|
16
16
|
break
|
|
17
17
|
case String(seamlyActions.SET_INITIAL_STATE):
|
|
@@ -40,4 +40,5 @@ export default function createMiddleware() {
|
|
|
40
40
|
}
|
|
41
41
|
return result
|
|
42
42
|
}
|
|
43
|
+
}
|
|
43
44
|
}
|
|
@@ -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'}>
|
package/src/.DS_Store
DELETED
|
Binary file
|