@seamly/web-ui 18.3.0-beta.1 → 19.0.0-beta.2
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 +348 -73
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +108 -8
- package/build/dist/lib/index.js +5247 -5187
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/standalone.js +2334 -2225
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/style-guide.js +1480 -796
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +27 -28
- package/src/javascripts/api/index.js +25 -40
- package/src/javascripts/api/producer.js +3 -6
- package/src/javascripts/config.js +3 -3
- package/src/javascripts/domains/app/actions.js +24 -6
- package/src/javascripts/domains/app/hooks.js +6 -0
- package/src/javascripts/domains/app/index.js +3 -0
- package/src/javascripts/domains/app/reducer.js +16 -0
- package/src/javascripts/domains/app/selectors.js +8 -0
- package/src/javascripts/domains/app/utils.js +4 -0
- package/src/javascripts/domains/config/actions.js +1 -3
- package/src/javascripts/domains/config/middleware.js +0 -4
- package/src/javascripts/domains/config/reducer.js +2 -13
- package/src/javascripts/domains/config/selectors.js +3 -3
- package/src/javascripts/domains/config/utils.js +4 -0
- package/src/javascripts/domains/forms/actions.js +1 -3
- package/src/javascripts/domains/forms/reducer.js +1 -2
- package/src/javascripts/domains/forms/selectors.js +2 -2
- package/src/javascripts/domains/forms/utils.js +5 -0
- package/src/javascripts/domains/i18n/actions.js +35 -0
- package/src/javascripts/domains/i18n/hooks.js +38 -0
- package/src/javascripts/domains/i18n/index.js +5 -84
- package/src/javascripts/domains/i18n/reducer.js +58 -0
- package/src/javascripts/domains/i18n/selectors.js +15 -0
- package/src/javascripts/domains/i18n/utils.js +9 -0
- package/src/javascripts/domains/interrupt/actions.js +1 -3
- package/src/javascripts/domains/interrupt/reducer.js +1 -2
- package/src/javascripts/domains/interrupt/selectors.js +3 -2
- package/src/javascripts/domains/interrupt/utils.js +4 -0
- package/src/javascripts/domains/redux/hooks.js +1 -0
- package/src/javascripts/domains/store/index.js +7 -1
- package/src/javascripts/domains/translations/actions.js +1 -3
- package/src/javascripts/domains/translations/components/chat-status.js +1 -1
- package/src/javascripts/domains/translations/components/options-dialog/form.js +11 -6
- package/src/javascripts/domains/translations/index.js +1 -0
- package/src/javascripts/domains/translations/middleware.js +43 -0
- package/src/javascripts/domains/translations/reducer.js +2 -9
- package/src/javascripts/domains/translations/selectors.js +2 -2
- package/src/javascripts/domains/translations/utils.js +4 -0
- package/src/javascripts/index.js +3 -0
- package/src/javascripts/lib/engine/index.js +1 -0
- package/src/javascripts/lib/mutex.js +30 -0
- package/src/javascripts/lib/redux-helpers/index.js +11 -8
- package/src/javascripts/style-guide/components/app.js +7 -2
- package/src/javascripts/style-guide/components/static-core.js +9 -3
- package/src/javascripts/style-guide/states.js +8 -8
- package/src/javascripts/style-guide/style-guide-engine.js +14 -11
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +1 -1
- package/src/javascripts/ui/components/conversation/event/upload.js +2 -2
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +2 -0
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +2 -0
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +1 -7
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -6
- package/src/javascripts/ui/components/core/seamly-read-state.js +6 -4
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -4
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +10 -3
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +6 -3
- package/src/javascripts/ui/components/entry/upload/index.js +8 -3
- package/src/javascripts/ui/components/faq/faq.js +2 -2
- package/src/javascripts/ui/components/layout/app-frame.js +11 -8
- package/src/javascripts/ui/components/layout/interrupt.js +6 -2
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
- package/src/javascripts/ui/components/widgets/upload-progress.js +1 -1
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +0 -6
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +17 -21
- package/src/javascripts/ui/hooks/seamly-hooks.js +0 -1
- package/src/javascripts/ui/hooks/use-seamly-commands.js +5 -6
- package/src/javascripts/ui/hooks/use-seamly-visibility.js +3 -5
- package/src/javascripts/ui/hooks/use-single-file-upload.js +4 -1
- package/src/javascripts/ui/utils/general-utils.js +6 -13
- package/src/stylesheets/1-settings/_config.scss +2 -1
- package/src/stylesheets/3-app/_app.scss +3 -4
- package/src/stylesheets/5-components/_faq.scss +3 -8
- package/src/stylesheets/5-components/_modal.scss +3 -3
- package/webpack/config.package.js +0 -18
- package/webpack/config.site.js +6 -0
- package/webpack/defaults.js +0 -3
- package/CHANGELOG.md +0 -572
- package/build/dist/translations/de-informal.js +0 -274
- package/build/dist/translations/de-informal.min.js +0 -1
- package/build/dist/translations/en.js +0 -274
- package/build/dist/translations/en.min.js +0 -1
- package/build/dist/translations/es-informal.js +0 -280
- package/build/dist/translations/es-informal.min.js +0 -1
- package/build/dist/translations/nl-formal.js +0 -274
- package/build/dist/translations/nl-formal.min.js +0 -1
- package/build/dist/translations/nl-informal.js +0 -274
- package/build/dist/translations/nl-informal.min.js +0 -1
- package/src/javascripts/lib/i18n.js +0 -46
- package/translations/de-informal.js +0 -235
- package/translations/en.js +0 -232
- package/translations/es-informal.js +0 -241
- package/translations/nl-formal.js +0 -228
- package/translations/nl-informal.js +0 -228
|
@@ -2,7 +2,6 @@ import { useCallback, useContext } from 'preact/hooks'
|
|
|
2
2
|
import {
|
|
3
3
|
useSeamlyApiContext,
|
|
4
4
|
useSeamlyHasConversation,
|
|
5
|
-
useSeamlyHasUserResponded,
|
|
6
5
|
} from './seamly-api-hooks'
|
|
7
6
|
import {
|
|
8
7
|
useSeamlyStateContext,
|
|
@@ -17,6 +16,7 @@ import { actionTypes, seamlyActions } from '../utils/seamly-utils'
|
|
|
17
16
|
import { useStableCallback } from './utility-hooks'
|
|
18
17
|
import { Actions as InterruptActions } from '../../domains/interrupt'
|
|
19
18
|
import { useConfig } from '../../domains/config'
|
|
19
|
+
import { useUserHasResponded } from '../../domains/app'
|
|
20
20
|
|
|
21
21
|
const {
|
|
22
22
|
ADD_EVENT,
|
|
@@ -37,7 +37,7 @@ const useSeamlyCommands = () => {
|
|
|
37
37
|
const dispatch = useSeamlyDispatchContext()
|
|
38
38
|
const eventBus = useContext(SeamlyEventBusContext)
|
|
39
39
|
|
|
40
|
-
const hasResponded =
|
|
40
|
+
const hasResponded = useUserHasResponded()
|
|
41
41
|
const hasConversation = useSeamlyHasConversation()
|
|
42
42
|
const { visible: visibility } = useSeamlyStateContext()
|
|
43
43
|
const unreadMessageCount = useSeamlyUnreadCount()
|
|
@@ -75,8 +75,8 @@ const useSeamlyCommands = () => {
|
|
|
75
75
|
])
|
|
76
76
|
|
|
77
77
|
const reset = useCallback(async () => {
|
|
78
|
-
dispatch({ type: CLEAR_EVENTS })
|
|
79
78
|
dispatch(InterruptActions.clear())
|
|
79
|
+
dispatch({ type: CLEAR_EVENTS })
|
|
80
80
|
dispatch({
|
|
81
81
|
type: SET_IS_LOADING,
|
|
82
82
|
isLoading: true,
|
|
@@ -96,11 +96,10 @@ const useSeamlyCommands = () => {
|
|
|
96
96
|
})
|
|
97
97
|
|
|
98
98
|
try {
|
|
99
|
-
const {
|
|
100
|
-
const { features } = accountConfig || {}
|
|
99
|
+
const { features } = await api.reset()
|
|
101
100
|
|
|
102
101
|
dispatch({ type: SET_FEATURES, features })
|
|
103
|
-
dispatch({ type: SET_INITIAL_STATE, initialState })
|
|
102
|
+
dispatch({ type: SET_INITIAL_STATE, initialState: {} })
|
|
104
103
|
} catch (error) {
|
|
105
104
|
dispatch(InterruptActions.set(error))
|
|
106
105
|
}
|
|
@@ -5,10 +5,7 @@ import {
|
|
|
5
5
|
} from './seamly-state-hooks'
|
|
6
6
|
import useSeamlyCommands from './use-seamly-commands'
|
|
7
7
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
8
|
-
import {
|
|
9
|
-
useSeamlyHasConversation,
|
|
10
|
-
useSeamlyHasUserResponded,
|
|
11
|
-
} from './seamly-api-hooks'
|
|
8
|
+
import { useSeamlyHasConversation } from './seamly-api-hooks'
|
|
12
9
|
import useSeamlyStoredVisibility from './use-seamly-stored-visibility'
|
|
13
10
|
import {
|
|
14
11
|
calculateVisibility,
|
|
@@ -16,6 +13,7 @@ import {
|
|
|
16
13
|
visibilityStates,
|
|
17
14
|
} from '../utils/seamly-utils'
|
|
18
15
|
import { useConfig } from '../../domains/config'
|
|
16
|
+
import { useUserHasResponded } from '../../domains/app'
|
|
19
17
|
|
|
20
18
|
const { SET_VISIBILITY } = seamlyActions
|
|
21
19
|
|
|
@@ -26,7 +24,7 @@ const useSeamlyVisibility = () => {
|
|
|
26
24
|
const { emitEvent } = useSeamlyCommands()
|
|
27
25
|
const dispatch = useSeamlyDispatchContext()
|
|
28
26
|
const [storedVisibility, setStoredVisibility] = useSeamlyStoredVisibility()
|
|
29
|
-
const hasResponded =
|
|
27
|
+
const hasResponded = useUserHasResponded()
|
|
30
28
|
const hasConversation = useSeamlyHasConversation()
|
|
31
29
|
const unreadMessageCount = useSeamlyUnreadCount()
|
|
32
30
|
const isVisible = visible ? visible !== visibilityStates.hidden : false
|
|
@@ -13,6 +13,8 @@ const useSingleFileUpload = (formId, name) => {
|
|
|
13
13
|
// This hook HAS to be used inside the FormBoundary of the file upload.
|
|
14
14
|
const { currentUploads } = useFileUploads()
|
|
15
15
|
|
|
16
|
+
const hasFile = fileList && fileList.length > 0
|
|
17
|
+
|
|
16
18
|
let uploadHandle = null
|
|
17
19
|
let hasServerError = false
|
|
18
20
|
let progress = 0
|
|
@@ -24,7 +26,8 @@ const useSingleFileUpload = (formId, name) => {
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
return {
|
|
27
|
-
|
|
29
|
+
hasFile,
|
|
30
|
+
selectedFileName: hasFile ? fileList[0].name : '',
|
|
28
31
|
uploadHandle,
|
|
29
32
|
hasServerError,
|
|
30
33
|
progress,
|
|
@@ -195,21 +195,14 @@ export const getRelativeDate = (date, currentDate) => {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
export const flattenObject = (obj, prefix = '') =>
|
|
199
|
-
Object.keys(obj).reduce((acc, k) => {
|
|
200
|
-
const pre = prefix.length ? `${prefix}.` : ''
|
|
201
|
-
if (
|
|
202
|
-
typeof obj[k] === 'object' &&
|
|
203
|
-
obj[k] !== null &&
|
|
204
|
-
Object.keys(obj[k]).length > 0
|
|
205
|
-
)
|
|
206
|
-
Object.assign(acc, flattenObject(obj[k], pre + k))
|
|
207
|
-
else acc[pre + k] = obj[k]
|
|
208
|
-
return acc
|
|
209
|
-
}, {})
|
|
210
|
-
|
|
211
198
|
export const pick = (obj, keys) =>
|
|
212
199
|
keys.reduce((accum, key) => {
|
|
213
200
|
if (key in obj) accum[key] = obj[key]
|
|
214
201
|
return accum
|
|
215
202
|
}, {})
|
|
203
|
+
|
|
204
|
+
export const omit = (obj, keys) =>
|
|
205
|
+
Object.keys(obj).reduce((accum, key) => {
|
|
206
|
+
if (!keys.includes(key)) accum[key] = obj[key]
|
|
207
|
+
return accum
|
|
208
|
+
}, {})
|
|
@@ -81,7 +81,8 @@ $app-started-width: 375px !default;
|
|
|
81
81
|
$app-full-height: 720px !default;
|
|
82
82
|
$app-collapsed-height: 54px !default;
|
|
83
83
|
|
|
84
|
-
$app-inline-height: 480px !default;
|
|
84
|
+
$app-inline-min-height: 480px !default;
|
|
85
|
+
$app-inline-max-height: 720px !default;
|
|
85
86
|
|
|
86
87
|
$post-full-height: 170px !default;
|
|
87
88
|
$post-collapsed-height: 65px !default;
|
|
@@ -31,16 +31,15 @@ $app-header-bgcolor: $brand3;
|
|
|
31
31
|
right: auto;
|
|
32
32
|
bottom: auto;
|
|
33
33
|
width: auto;
|
|
34
|
-
height:
|
|
35
|
-
min-height: $
|
|
36
|
-
max-height: $
|
|
34
|
+
height: 90vh;
|
|
35
|
+
min-height: $app-inline-min-height;
|
|
36
|
+
max-height: $app-inline-max-height;
|
|
37
37
|
transition: height $transition, width $transition;
|
|
38
38
|
background-color: initial;
|
|
39
39
|
box-shadow: none;
|
|
40
40
|
|
|
41
41
|
@include media('>phablet-l') {
|
|
42
42
|
display: block;
|
|
43
|
-
height: $app-inline-height;
|
|
44
43
|
border: 0 none;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
&.#{$n}-app--layout-window .#{$n}-faqs {
|
|
11
11
|
overscroll-behavior: contain;
|
|
12
|
-
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
13
|
-
-ms-scroll-chaining: none;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
&.#{$n}-app--layout-inline .#{$n}-faqs {
|
|
@@ -20,9 +18,9 @@
|
|
|
20
18
|
left: 50%;
|
|
21
19
|
flex-direction: column;
|
|
22
20
|
width: 50%;
|
|
23
|
-
height:
|
|
24
|
-
min-height:
|
|
25
|
-
|
|
21
|
+
height: 100%;
|
|
22
|
+
min-height: 100%;
|
|
23
|
+
overflow: hidden;
|
|
26
24
|
transform: translateX(-100%);
|
|
27
25
|
border: $thin-border solid set-border-color($app-bg);
|
|
28
26
|
border-left: 0;
|
|
@@ -59,9 +57,6 @@
|
|
|
59
57
|
|
|
60
58
|
&.#{$n}-app--layout-inline .#{$n}-faqs.#{$n}-transition--in {
|
|
61
59
|
@include media('>phablet-l') {
|
|
62
|
-
height: $app-inline-height;
|
|
63
|
-
min-height: $spacer * 24;
|
|
64
|
-
max-height: 100%;
|
|
65
60
|
overflow-y: initial;
|
|
66
61
|
transform: translateX(0%);
|
|
67
62
|
}
|
|
@@ -16,7 +16,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
|
|
|
16
16
|
const {
|
|
17
17
|
BUILD_ROOT,
|
|
18
18
|
SRC_ROOT,
|
|
19
|
-
TRANSLATIONS_ROOT,
|
|
20
19
|
|
|
21
20
|
ROOT,
|
|
22
21
|
|
|
@@ -43,7 +42,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
|
|
|
43
42
|
...Object.keys(pkg.peerDependencies || {}).map(
|
|
44
43
|
(key) => new RegExp(`^${key}(\\/.*)`, 'i'),
|
|
45
44
|
),
|
|
46
|
-
/^@seamly\/web-ui\/translations(\/.*)?/i,
|
|
47
45
|
],
|
|
48
46
|
module: {
|
|
49
47
|
rules: [
|
|
@@ -101,21 +99,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
|
|
|
101
99
|
externals: [/^@seamly\/web-ui(\/.*)?/i],
|
|
102
100
|
})
|
|
103
101
|
|
|
104
|
-
const translationFiles = glob.sync(path.join(TRANSLATIONS_ROOT, '*.js'))
|
|
105
|
-
const translationEntries = translationFiles.reduce((entries, file) => {
|
|
106
|
-
const fileName = path.parse(file).name
|
|
107
|
-
return {
|
|
108
|
-
...entries,
|
|
109
|
-
[fileName]: file,
|
|
110
|
-
}
|
|
111
|
-
}, {})
|
|
112
|
-
const translationsConfig = webpackMerge(baseConfig, {
|
|
113
|
-
entry: translationEntries,
|
|
114
|
-
output: {
|
|
115
|
-
path: path.join(BUILD_ROOT, '/dist/translations'),
|
|
116
|
-
},
|
|
117
|
-
})
|
|
118
|
-
|
|
119
102
|
const standalonePackageConfig = {
|
|
120
103
|
...packageConfig,
|
|
121
104
|
output: {
|
|
@@ -193,7 +176,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
|
|
|
193
176
|
standalonePackageConfig,
|
|
194
177
|
styleguideConfig,
|
|
195
178
|
externalsConfig,
|
|
196
|
-
translationsConfig,
|
|
197
179
|
]
|
|
198
180
|
|
|
199
181
|
const configsMinimized = configs.map((config) =>
|
package/webpack/config.site.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
const path = require('path')
|
|
3
3
|
const site = require('@seamly/doc-site/lib/config/site')
|
|
4
|
+
const CopyPlugin = require('copy-webpack-plugin')
|
|
4
5
|
const webpackMerge = require('webpack-merge').merge
|
|
5
6
|
const defaultConfig = require('./defaults')
|
|
6
7
|
const generateCommonConfig = require('./config.common')
|
|
@@ -24,6 +25,11 @@ module.exports = (env = {}, argv = {}, configOverrides = {}, options = {}) => {
|
|
|
24
25
|
implConfig
|
|
25
26
|
|
|
26
27
|
let config = {
|
|
28
|
+
plugins: [
|
|
29
|
+
new CopyPlugin({
|
|
30
|
+
patterns: [{ from: 'public/static', to: 'static' }],
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
27
33
|
entry: {
|
|
28
34
|
// Changelog
|
|
29
35
|
changelog: path.join(ROOT, 'CHANGELOG.md'),
|
package/webpack/defaults.js
CHANGED
|
@@ -6,7 +6,6 @@ const BROWSERS = 'last 1 version, > 1%, not dead, not ie 11, not ie_mob 11'
|
|
|
6
6
|
const ROOT = path.resolve(__dirname, '..')
|
|
7
7
|
const BUILD_ROOT = path.join(ROOT, 'build')
|
|
8
8
|
const SRC_ROOT = path.join(ROOT, 'src')
|
|
9
|
-
const TRANSLATIONS_ROOT = path.join(ROOT, 'translations')
|
|
10
9
|
const PUBLIC_ROOT = path.join(ROOT, 'public')
|
|
11
10
|
const PUBLIC_TEST_ROOT = path.join(PUBLIC_ROOT, 'test')
|
|
12
11
|
const PUBLIC_STYLEGUIDE_ROOT = path.join(PUBLIC_ROOT, 'style-guide')
|
|
@@ -43,7 +42,6 @@ const ALIASSES = {
|
|
|
43
42
|
SRC_ROOT,
|
|
44
43
|
'javascripts/style-guide.js',
|
|
45
44
|
),
|
|
46
|
-
'@seamly/web-ui/translations': TRANSLATIONS_ROOT,
|
|
47
45
|
'@seamly/web-ui/src/stylesheets/styles.scss': path.resolve(
|
|
48
46
|
SRC_ROOT,
|
|
49
47
|
'stylesheets',
|
|
@@ -64,7 +62,6 @@ module.exports = {
|
|
|
64
62
|
ROOT,
|
|
65
63
|
BUILD_ROOT,
|
|
66
64
|
SRC_ROOT,
|
|
67
|
-
TRANSLATIONS_ROOT,
|
|
68
65
|
PUBLIC_ROOT,
|
|
69
66
|
|
|
70
67
|
PUBLIC_TEST_ROOT,
|