@seamly/web-ui 21.0.2-beta.3 → 21.0.2-beta.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/components.js +109 -182
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/hooks.js +27 -27
- package/build/dist/lib/hooks.min.js +1 -1
- 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 +125 -186
- 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 +156 -216
- 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 +131 -198
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/utils.js +123 -186
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.LICENSE.txt +1 -1
- package/package.json +1 -1
- package/src/javascripts/index.ts +1 -0
- package/src/javascripts/lib/external-api/index.js +17 -4
- package/src/javascripts/style-guide/components/static-core.js +8 -11
package/package.json
CHANGED
package/src/javascripts/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { visibilityStates } from 'domains/visibility/constants'
|
|
|
20
20
|
export { useVisibility as useSeamlyVisibility } from 'domains/visibility/hooks'
|
|
21
21
|
export { calculateVisibility } from 'domains/visibility/utils'
|
|
22
22
|
// Used by: StyleGuide
|
|
23
|
+
export { Provider as SeamlyStoreProvider } from 'react-redux'
|
|
23
24
|
export { default as ComponentFilter } from 'ui/components/conversation/component-filter'
|
|
24
25
|
// Used by: Client
|
|
25
26
|
export { default as Conversation } from 'ui/components/conversation/conversation'
|
|
@@ -51,7 +51,20 @@ class ExternalApi {
|
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
instanceInitializing(namespace) {
|
|
55
|
+
const instances = Object.keys(this._instances)
|
|
56
|
+
|
|
57
|
+
return (!namespace && instances.length > 0) || instances.includes(namespace)
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
setContext(action, args) {
|
|
61
|
+
const { instance: namespace } = args
|
|
62
|
+
// Do not set this action in context if we are already initializing.
|
|
63
|
+
// If we do, it will not be sent to the server anymore (because it gets marked as 'handled').
|
|
64
|
+
if (this.instanceInitializing(namespace)) {
|
|
65
|
+
return false
|
|
66
|
+
}
|
|
67
|
+
|
|
55
68
|
switch (action) {
|
|
56
69
|
case 'setTopic':
|
|
57
70
|
const { name } = args
|
|
@@ -118,11 +131,11 @@ class ExternalApi {
|
|
|
118
131
|
|
|
119
132
|
// results will be an array containing the results of wether an instance has
|
|
120
133
|
// handled the action or not
|
|
121
|
-
const results = instances.map((instance) =>
|
|
122
|
-
|
|
134
|
+
const results = instances.map((instance) =>
|
|
135
|
+
!namespace || instance.namespace === namespace
|
|
123
136
|
? instance.execFunction(action, ...args)
|
|
124
|
-
: false
|
|
125
|
-
|
|
137
|
+
: false,
|
|
138
|
+
)
|
|
126
139
|
|
|
127
140
|
// test if any of the instances has handled the action
|
|
128
141
|
return results.some(Boolean)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { configureStore } from '@reduxjs/toolkit'
|
|
2
|
-
import { useMemo, useRef } from 'preact/hooks'
|
|
3
|
-
import { Provider } from 'react-redux'
|
|
4
|
-
import ComponentFilter from 'ui/components/conversation/component-filter'
|
|
5
2
|
import {
|
|
3
|
+
ComponentFilter,
|
|
6
4
|
SeamlyApiContext,
|
|
7
5
|
SeamlyEventBusContext,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
SeamlyLiveRegionContext,
|
|
7
|
+
SeamlyStoreProvider,
|
|
8
|
+
} from '@seamly/web-ui'
|
|
9
|
+
import { useMemo, useRef } from 'preact/hooks'
|
|
11
10
|
import appReducer from 'domains/app/slice'
|
|
12
11
|
import configReducer, {
|
|
13
12
|
setConfig,
|
|
@@ -120,17 +119,15 @@ const SeamlyStaticCore = ({
|
|
|
120
119
|
|
|
121
120
|
return (
|
|
122
121
|
state && (
|
|
123
|
-
<
|
|
122
|
+
<SeamlyStoreProvider store={store}>
|
|
124
123
|
<SeamlyEventBusContext.Provider value={eventBusRef.current}>
|
|
125
124
|
<SeamlyLiveRegionContext.Provider value={liveMsgRef.current}>
|
|
126
125
|
<SeamlyApiContext.Provider value={bareApi}>
|
|
127
|
-
<
|
|
128
|
-
<ComponentFilter>{children}</ComponentFilter>
|
|
129
|
-
</SeamlyChat>
|
|
126
|
+
<ComponentFilter>{children}</ComponentFilter>
|
|
130
127
|
</SeamlyApiContext.Provider>
|
|
131
128
|
</SeamlyLiveRegionContext.Provider>
|
|
132
129
|
</SeamlyEventBusContext.Provider>
|
|
133
|
-
</
|
|
130
|
+
</SeamlyStoreProvider>
|
|
134
131
|
)
|
|
135
132
|
)
|
|
136
133
|
}
|