@seamly/web-ui 19.1.4 → 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 +3 -3
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +35 -33
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +35 -33
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +33 -30
- package/package.json +1 -1
- package/src/javascripts/domains/store/index.js +10 -9
- package/src/javascripts/domains/translations/middleware.js +6 -5
- package/src/.DS_Store +0 -0
|
@@ -4722,45 +4722,48 @@ function hooks_useTranslationsContainer() {
|
|
|
4722
4722
|
|
|
4723
4723
|
|
|
4724
4724
|
|
|
4725
|
-
function translations_middleware_createMiddleware(
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4725
|
+
function translations_middleware_createMiddleware({
|
|
4726
|
+
dispatch,
|
|
4727
|
+
getState
|
|
4728
|
+
}) {
|
|
4729
|
+
return next => {
|
|
4730
|
+
return action => {
|
|
4731
|
+
var _action$history, _action$history$trans, _action$initialState, _action$initialState$, _action$event, _action$event$payload, _action$event$payload2;
|
|
4731
4732
|
|
|
4732
|
-
|
|
4733
|
+
const result = next(action);
|
|
4733
4734
|
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4735
|
+
switch (action.type) {
|
|
4736
|
+
case String(seamlyActions.SET_HISTORY):
|
|
4737
|
+
if ((_action$history = action.history) !== null && _action$history !== void 0 && (_action$history$trans = _action$history.translation) !== null && _action$history$trans !== void 0 && _action$history$trans.enabled) {
|
|
4738
|
+
dispatch(Actions.enable(action.history.translation.locale));
|
|
4739
|
+
dispatch(I18nActions.setLocale(action.history.translation.locale));
|
|
4740
|
+
}
|
|
4739
4741
|
|
|
4740
|
-
|
|
4742
|
+
break;
|
|
4741
4743
|
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4744
|
+
case String(seamlyActions.SET_INITIAL_STATE):
|
|
4745
|
+
if ((_action$initialState = action.initialState) !== null && _action$initialState !== void 0 && (_action$initialState$ = _action$initialState.translation) !== null && _action$initialState$ !== void 0 && _action$initialState$.enabled) {
|
|
4746
|
+
dispatch(Actions.enable(action.initialState.translation.locale));
|
|
4747
|
+
dispatch(I18nActions.setLocale(action.locale));
|
|
4748
|
+
}
|
|
4747
4749
|
|
|
4748
|
-
|
|
4750
|
+
break;
|
|
4749
4751
|
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4752
|
+
case String(seamlyActions.ADD_EVENT):
|
|
4753
|
+
if (action.event.type === 'info' && ((_action$event = action.event) === null || _action$event === void 0 ? void 0 : (_action$event$payload = _action$event.payload) === null || _action$event$payload === void 0 ? void 0 : (_action$event$payload2 = _action$event$payload.body) === null || _action$event$payload2 === void 0 ? void 0 : _action$event$payload2.subtype) === 'new_translation' && action.event.payload.body.translationEnabled) {
|
|
4754
|
+
dispatch(I18nActions.setLocale(action.event.payload.body.translationLocale));
|
|
4755
|
+
}
|
|
4754
4756
|
|
|
4755
|
-
|
|
4757
|
+
break;
|
|
4756
4758
|
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4759
|
+
case String(Actions.disable):
|
|
4760
|
+
const initialLocale = I18nSelectors.selectInitialLocale(getState());
|
|
4761
|
+
dispatch(I18nActions.setLocale(initialLocale));
|
|
4762
|
+
break;
|
|
4763
|
+
}
|
|
4762
4764
|
|
|
4763
|
-
|
|
4765
|
+
return result;
|
|
4766
|
+
};
|
|
4764
4767
|
};
|
|
4765
4768
|
}
|
|
4766
4769
|
;// CONCATENATED MODULE: ./src/javascripts/domains/translations/reducer.js
|
package/package.json
CHANGED
|
@@ -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
|
}
|
package/src/.DS_Store
DELETED
|
Binary file
|