@botonic/plugin-flow-builder 0.21.0-alpha.5 → 0.21.0-alpha.6
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/lib/cjs/action.d.ts +3 -4
- package/lib/cjs/action.js +15 -10
- package/lib/cjs/action.js.map +1 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +7 -0
- package/lib/cjs/content-fields/{content-base.js → content-fields-base.js} +7 -2
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
- package/lib/cjs/content-fields/{button.d.ts → flow-button.d.ts} +3 -3
- package/lib/cjs/content-fields/{button.js → flow-button.js} +5 -5
- package/lib/cjs/content-fields/flow-button.js.map +1 -0
- package/lib/cjs/content-fields/flow-carousel.d.ts +10 -0
- package/lib/cjs/content-fields/{carousel.js → flow-carousel.js} +10 -10
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
- package/lib/cjs/content-fields/flow-element.d.ts +11 -0
- package/lib/cjs/content-fields/{element.js → flow-element.js} +6 -7
- package/lib/cjs/content-fields/flow-element.js.map +1 -0
- package/lib/cjs/content-fields/flow-image.d.ts +9 -0
- package/lib/cjs/content-fields/{image.js → flow-image.js} +4 -5
- package/lib/cjs/content-fields/flow-image.js.map +1 -0
- package/lib/cjs/content-fields/flow-text.d.ts +12 -0
- package/lib/cjs/content-fields/{text.js → flow-text.js} +8 -8
- package/lib/cjs/content-fields/flow-text.js.map +1 -0
- package/lib/cjs/content-fields/index.d.ts +7 -0
- package/lib/cjs/content-fields/index.js +16 -0
- package/lib/cjs/content-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/types.d.ts +4 -0
- package/lib/cjs/content-fields/types.js +3 -0
- package/lib/cjs/content-fields/types.js.map +1 -0
- package/lib/cjs/flow-builder-models.d.ts +174 -0
- package/lib/cjs/flow-builder-models.js +22 -0
- package/lib/cjs/flow-builder-models.js.map +1 -0
- package/lib/cjs/functions/conditional-queue-status.d.ts +2 -2
- package/lib/cjs/functions/conditional-queue-status.js +15 -2
- package/lib/cjs/functions/conditional-queue-status.js.map +1 -1
- package/lib/cjs/functions/index.d.ts +1 -1
- package/lib/cjs/functions/index.js +3 -1
- package/lib/cjs/functions/index.js.map +1 -1
- package/lib/cjs/handoff.d.ts +1 -1
- package/lib/cjs/handoff.js +11 -15
- package/lib/cjs/handoff.js.map +1 -1
- package/lib/cjs/index.d.ts +15 -13
- package/lib/cjs/index.js +33 -26
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils.d.ts +1 -2
- package/lib/cjs/utils.js +6 -6
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/action.d.ts +3 -4
- package/lib/esm/action.js +14 -10
- package/lib/esm/action.js.map +1 -1
- package/lib/esm/content-fields/content-fields-base.d.ts +7 -0
- package/lib/esm/content-fields/content-fields-base.js +16 -0
- package/lib/esm/content-fields/content-fields-base.js.map +1 -0
- package/lib/esm/content-fields/{button.d.ts → flow-button.d.ts} +3 -3
- package/lib/esm/content-fields/{button.js → flow-button.js} +4 -4
- package/lib/esm/content-fields/flow-button.js.map +1 -0
- package/lib/esm/content-fields/flow-carousel.d.ts +10 -0
- package/lib/esm/content-fields/{carousel.js → flow-carousel.js} +9 -9
- package/lib/esm/content-fields/flow-carousel.js.map +1 -0
- package/lib/esm/content-fields/flow-element.d.ts +11 -0
- package/lib/esm/content-fields/{element.js → flow-element.js} +4 -5
- package/lib/esm/content-fields/flow-element.js.map +1 -0
- package/lib/esm/content-fields/flow-image.d.ts +9 -0
- package/lib/esm/content-fields/{image.js → flow-image.js} +3 -4
- package/lib/esm/content-fields/flow-image.js.map +1 -0
- package/lib/esm/content-fields/flow-text.d.ts +12 -0
- package/lib/esm/content-fields/{text.js → flow-text.js} +4 -4
- package/lib/esm/content-fields/flow-text.js.map +1 -0
- package/lib/esm/content-fields/index.d.ts +7 -0
- package/lib/esm/content-fields/index.js +7 -0
- package/lib/esm/content-fields/index.js.map +1 -0
- package/lib/esm/content-fields/types.d.ts +4 -0
- package/lib/esm/content-fields/types.js +2 -0
- package/lib/esm/content-fields/types.js.map +1 -0
- package/lib/esm/flow-builder-models.d.ts +174 -0
- package/lib/esm/flow-builder-models.js +19 -0
- package/lib/esm/flow-builder-models.js.map +1 -0
- package/lib/esm/functions/conditional-queue-status.d.ts +2 -2
- package/lib/esm/functions/conditional-queue-status.js +15 -2
- package/lib/esm/functions/conditional-queue-status.js.map +1 -1
- package/lib/esm/functions/index.d.ts +1 -1
- package/lib/esm/functions/index.js +3 -1
- package/lib/esm/functions/index.js.map +1 -1
- package/lib/esm/handoff.d.ts +1 -1
- package/lib/esm/handoff.js +12 -16
- package/lib/esm/handoff.js.map +1 -1
- package/lib/esm/index.d.ts +15 -13
- package/lib/esm/index.js +28 -23
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils.d.ts +1 -2
- package/lib/esm/utils.js +4 -4
- package/lib/esm/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/action.tsx +17 -16
- package/src/content-fields/content-fields-base.ts +15 -0
- package/src/content-fields/{button.tsx → flow-button.tsx} +5 -5
- package/src/content-fields/flow-carousel.tsx +39 -0
- package/src/content-fields/{element.tsx → flow-element.tsx} +8 -6
- package/src/content-fields/{image.tsx → flow-image.tsx} +5 -6
- package/src/content-fields/{text.tsx → flow-text.tsx} +5 -5
- package/src/content-fields/index.ts +7 -0
- package/src/content-fields/types.ts +5 -0
- package/src/flow-builder-models.ts +220 -0
- package/src/functions/conditional-queue-status.ts +24 -2
- package/src/functions/index.ts +3 -1
- package/src/handoff.ts +18 -17
- package/src/index.ts +65 -60
- package/src/utils.ts +10 -5
- package/lib/cjs/content-fields/button.js.map +0 -1
- package/lib/cjs/content-fields/carousel.d.ts +0 -10
- package/lib/cjs/content-fields/carousel.js.map +0 -1
- package/lib/cjs/content-fields/content-base.d.ts +0 -10
- package/lib/cjs/content-fields/content-base.js.map +0 -1
- package/lib/cjs/content-fields/element.d.ts +0 -11
- package/lib/cjs/content-fields/element.js.map +0 -1
- package/lib/cjs/content-fields/image.d.ts +0 -9
- package/lib/cjs/content-fields/image.js.map +0 -1
- package/lib/cjs/content-fields/text.d.ts +0 -12
- package/lib/cjs/content-fields/text.js.map +0 -1
- package/lib/cjs/hubtype-models.d.ts +0 -160
- package/lib/cjs/hubtype-models.js +0 -50
- package/lib/cjs/hubtype-models.js.map +0 -1
- package/lib/esm/content-fields/button.js.map +0 -1
- package/lib/esm/content-fields/carousel.d.ts +0 -10
- package/lib/esm/content-fields/carousel.js.map +0 -1
- package/lib/esm/content-fields/content-base.d.ts +0 -10
- package/lib/esm/content-fields/content-base.js +0 -11
- package/lib/esm/content-fields/content-base.js.map +0 -1
- package/lib/esm/content-fields/element.d.ts +0 -11
- package/lib/esm/content-fields/element.js.map +0 -1
- package/lib/esm/content-fields/image.d.ts +0 -9
- package/lib/esm/content-fields/image.js.map +0 -1
- package/lib/esm/content-fields/text.d.ts +0 -12
- package/lib/esm/content-fields/text.js.map +0 -1
- package/lib/esm/hubtype-models.d.ts +0 -160
- package/lib/esm/hubtype-models.js +0 -47
- package/lib/esm/hubtype-models.js.map +0 -1
- package/src/content-fields/carousel.tsx +0 -39
- package/src/content-fields/content-base.ts +0 -15
- package/src/hubtype-models.ts +0 -200
package/src/index.ts
CHANGED
|
@@ -7,52 +7,54 @@ import {
|
|
|
7
7
|
} from '@botonic/core'
|
|
8
8
|
import axios from 'axios'
|
|
9
9
|
|
|
10
|
-
import { FlowCarousel } from './content-fields/carousel'
|
|
11
|
-
import { FlowContent } from './content-fields/content-base'
|
|
12
|
-
import { FlowImage } from './content-fields/image'
|
|
13
|
-
import { FlowText } from './content-fields/text'
|
|
14
|
-
import { DEFAULT_FUNCTIONS } from './functions'
|
|
15
10
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
FlowCarousel,
|
|
12
|
+
FlowContent,
|
|
13
|
+
FlowImage,
|
|
14
|
+
FlowText,
|
|
15
|
+
} from './content-fields'
|
|
16
|
+
import {
|
|
17
|
+
FlowBuilderData,
|
|
18
|
+
FunctionNode,
|
|
19
|
+
HandoffNode,
|
|
20
|
+
IntentNode,
|
|
21
|
+
KeywordNode,
|
|
22
|
+
NodeComponent,
|
|
23
|
+
NodeType,
|
|
24
|
+
StartNode,
|
|
25
|
+
} from './flow-builder-models'
|
|
26
|
+
import { DEFAULT_FUNCTIONS } from './functions'
|
|
27
|
+
|
|
28
|
+
export type BotonicPluginFlowBuilderOptions = {
|
|
30
29
|
flowUrl: string
|
|
31
|
-
flow
|
|
32
|
-
customFunctions
|
|
30
|
+
flow?: FlowBuilderData
|
|
31
|
+
customFunctions?: Record<any, any>
|
|
33
32
|
getLocale: (session: Session) => string
|
|
33
|
+
getAccessToken: () => string
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export default class BotonicPluginFlowBuilder implements Plugin {
|
|
37
37
|
private flowUrl: string
|
|
38
|
-
private flow: Promise<
|
|
38
|
+
private flow: Promise<FlowBuilderData> | FlowBuilderData
|
|
39
39
|
private functions: Record<any, any>
|
|
40
40
|
private currentRequest: PluginPreRequest
|
|
41
|
+
private getAccessToken: () => string
|
|
41
42
|
public getLocale: (session: Session) => string
|
|
42
43
|
|
|
43
44
|
constructor(readonly options: BotonicPluginFlowBuilderOptions) {
|
|
45
|
+
this.getLocale = options.getLocale
|
|
46
|
+
this.getAccessToken = options.getAccessToken
|
|
44
47
|
this.flowUrl = options.flowUrl
|
|
45
48
|
this.flow = options.flow || this.readFlowContent()
|
|
46
49
|
const customFunctions = options.customFunctions || {}
|
|
47
50
|
this.functions = { ...DEFAULT_FUNCTIONS, ...customFunctions }
|
|
48
|
-
this.getLocale = options.getLocale
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
async readFlowContent() {
|
|
52
|
-
const response = await axios.get(this.flowUrl
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return
|
|
53
|
+
async readFlowContent(): Promise<FlowBuilderData> {
|
|
54
|
+
const response = await axios.get(this.flowUrl, {
|
|
55
|
+
headers: { Authorization: `Bearer ${this.getAccessToken()}` },
|
|
56
|
+
})
|
|
57
|
+
return response.data
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
async pre(request: PluginPreRequest): Promise<void> {
|
|
@@ -62,32 +64,32 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
62
64
|
|
|
63
65
|
async post(_request: PluginPostRequest): Promise<void> {}
|
|
64
66
|
|
|
65
|
-
async getContent(id: string): Promise<
|
|
67
|
+
async getContent(id: string): Promise<NodeComponent> {
|
|
66
68
|
const flow = await this.flow
|
|
67
|
-
const content = flow.nodes.find(
|
|
69
|
+
const content = flow.nodes.find(node => node.id === id)
|
|
68
70
|
if (!content) throw Error(`text with id: '${id}' not found`)
|
|
69
71
|
return content
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
async getHandoffContent(): Promise<
|
|
74
|
+
async getHandoffContent(): Promise<HandoffNode> {
|
|
73
75
|
const flow = await this.flow
|
|
74
76
|
const content = flow.nodes.find(
|
|
75
|
-
|
|
76
|
-
) as
|
|
77
|
+
node => node.type === NodeType.HANDOFF
|
|
78
|
+
) as HandoffNode
|
|
77
79
|
if (!content) throw Error(`Handoff node not found`)
|
|
78
80
|
return content
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
getFlowContent(
|
|
82
|
-
hubtypeContent:
|
|
84
|
+
hubtypeContent: NodeComponent,
|
|
83
85
|
locale: string
|
|
84
86
|
): FlowContent | undefined {
|
|
85
87
|
switch (hubtypeContent.type) {
|
|
86
|
-
case
|
|
88
|
+
case NodeType.TEXT:
|
|
87
89
|
return FlowText.fromHubtypeCMS(hubtypeContent, locale)
|
|
88
|
-
case
|
|
90
|
+
case NodeType.IMAGE:
|
|
89
91
|
return FlowImage.fromHubtypeCMS(hubtypeContent, locale)
|
|
90
|
-
case
|
|
92
|
+
case NodeType.CAROUSEL:
|
|
91
93
|
return FlowCarousel.fromHubtypeCMS(hubtypeContent, locale)
|
|
92
94
|
default:
|
|
93
95
|
return undefined
|
|
@@ -96,15 +98,11 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
96
98
|
|
|
97
99
|
async getStartId(): Promise<string> {
|
|
98
100
|
const flow = await this.flow
|
|
99
|
-
const startNode = flow.nodes.find(
|
|
100
|
-
(node: HtBase) => node?.type === StartFieldsType.START_UP
|
|
101
|
-
)
|
|
102
|
-
|
|
101
|
+
const startNode = flow.nodes.find(node => node.type === NodeType.START_UP)
|
|
103
102
|
if (!startNode) {
|
|
104
103
|
throw new Error('start-up id must be defined')
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
return (startNode as HtStartReference).target.id
|
|
105
|
+
return (startNode as StartNode).target.id
|
|
108
106
|
}
|
|
109
107
|
|
|
110
108
|
async getContents(
|
|
@@ -113,17 +111,15 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
113
111
|
prevContents?: FlowContent[]
|
|
114
112
|
): Promise<FlowContent[]> {
|
|
115
113
|
const contents = prevContents || []
|
|
116
|
-
const hubtypeContent = await this.getContent(id)
|
|
114
|
+
const hubtypeContent: any = await this.getContent(id)
|
|
117
115
|
const content = await this.getFlowContent(hubtypeContent, locale)
|
|
118
|
-
if (hubtypeContent.type ===
|
|
119
|
-
const targetId = await this.callFunction(
|
|
120
|
-
hubtypeContent as HtFunctionNode,
|
|
121
|
-
locale
|
|
122
|
-
)
|
|
116
|
+
if (hubtypeContent.type === NodeType.FUNCTION) {
|
|
117
|
+
const targetId = await this.callFunction(hubtypeContent, locale)
|
|
123
118
|
return this.getContents(targetId, locale, contents)
|
|
124
119
|
} else {
|
|
125
120
|
if (content) contents.push(content)
|
|
126
121
|
// TODO: prevent infinite recursive calls
|
|
122
|
+
|
|
127
123
|
if (hubtypeContent.follow_up)
|
|
128
124
|
return this.getContents(hubtypeContent.follow_up.id, locale, contents)
|
|
129
125
|
}
|
|
@@ -139,8 +135,8 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
139
135
|
try {
|
|
140
136
|
const flow = await this.flow
|
|
141
137
|
const intents = flow.nodes.filter(
|
|
142
|
-
node => node.type
|
|
143
|
-
) as
|
|
138
|
+
node => node.type === NodeType.INTENT
|
|
139
|
+
) as IntentNode[]
|
|
144
140
|
if (input.intent) {
|
|
145
141
|
const matchedIntents = intents.filter(node =>
|
|
146
142
|
//@ts-ignore
|
|
@@ -157,7 +153,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
157
153
|
return undefined
|
|
158
154
|
}
|
|
159
155
|
|
|
160
|
-
hasIntent(node:
|
|
156
|
+
hasIntent(node: IntentNode, intent: string, locale: string): boolean {
|
|
161
157
|
const result = node.content.intents.find(
|
|
162
158
|
i => i.locale === locale && i.values.includes(intent)
|
|
163
159
|
)
|
|
@@ -171,8 +167,8 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
171
167
|
try {
|
|
172
168
|
const flow = await this.flow
|
|
173
169
|
const keywordNodes = flow.nodes.filter(
|
|
174
|
-
node => node.type ==
|
|
175
|
-
) as
|
|
170
|
+
node => node.type == NodeType.KEYWORD
|
|
171
|
+
) as KeywordNode[]
|
|
176
172
|
const matchedKeywordNodes = keywordNodes.filter(node =>
|
|
177
173
|
//@ts-ignore
|
|
178
174
|
this.matchKeywords(node, input.data, locale)
|
|
@@ -187,14 +183,14 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
187
183
|
return undefined
|
|
188
184
|
}
|
|
189
185
|
|
|
190
|
-
matchKeywords(node:
|
|
186
|
+
matchKeywords(node: KeywordNode, input: string, locale: string): boolean {
|
|
191
187
|
const result = node.content.keywords.find(
|
|
192
188
|
i => i.locale === locale && this.containsAnyKeywords(input, i.values)
|
|
193
189
|
)
|
|
194
190
|
return Boolean(result)
|
|
195
191
|
}
|
|
196
192
|
|
|
197
|
-
containsAnyKeywords(input: string, keywords: string[]) {
|
|
193
|
+
containsAnyKeywords(input: string, keywords: string[]): boolean {
|
|
198
194
|
for (let i = 0; i < keywords.length; i++) {
|
|
199
195
|
if (input.includes(keywords[i])) {
|
|
200
196
|
return true
|
|
@@ -204,14 +200,16 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
204
200
|
}
|
|
205
201
|
|
|
206
202
|
async callFunction(
|
|
207
|
-
functionNode:
|
|
203
|
+
functionNode: FunctionNode,
|
|
208
204
|
locale: string
|
|
209
205
|
): Promise<string> {
|
|
210
|
-
|
|
211
|
-
// TODO: get arguments by locale
|
|
206
|
+
const functionNodeId = functionNode.id
|
|
212
207
|
const nameValues = functionNode.content.arguments
|
|
213
208
|
.find(arg => arg.locale === locale)
|
|
214
|
-
|
|
209
|
+
?.values.map(value => ({ [value.name]: value.value }))
|
|
210
|
+
if (!nameValues) {
|
|
211
|
+
throw new Error(`No arguments found for node with id ${functionNodeId}`)
|
|
212
|
+
}
|
|
215
213
|
const args = Object.assign(
|
|
216
214
|
{
|
|
217
215
|
session: this.currentRequest.session,
|
|
@@ -226,6 +224,13 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
226
224
|
const result = functionNode.content.result_mapping.find(
|
|
227
225
|
r => r.result === functionResult
|
|
228
226
|
)
|
|
227
|
+
if (!result) {
|
|
228
|
+
throw new Error(
|
|
229
|
+
`No result found for result_mapping for node with id: ${functionNodeId}`
|
|
230
|
+
)
|
|
231
|
+
}
|
|
229
232
|
return result.target.id
|
|
230
233
|
}
|
|
231
234
|
}
|
|
235
|
+
|
|
236
|
+
export { FlowBuilderAction } from './action'
|
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export function getWebpackEnvVar(
|
|
2
|
+
webpackEnvVar: string | false,
|
|
3
|
+
name: string,
|
|
4
|
+
defaultValue: string
|
|
5
|
+
): string {
|
|
6
|
+
return (
|
|
7
|
+
webpackEnvVar ||
|
|
8
|
+
(typeof process !== 'undefined' && process.env[name]) ||
|
|
9
|
+
defaultValue
|
|
10
|
+
)
|
|
6
11
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/content-fields/button.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8C;AAC9C,0DAAyB;AAEzB,sDAAyD;AACzD,iDAAkD;AAElD,MAAa,UAAW,SAAQ,gCAAiB;IAAjD;;QACS,SAAI,GAAG,EAAE,CAAA;IA0BlB,CAAC;IAtBC,MAAM,CAAC,cAAc,CAAC,SAAmB,EAAE,MAAc;;QACvD,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC9C,SAAS,CAAC,IAAI,GAAG,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QACnE,SAAS,CAAC,OAAO,GAAG,MAAA,SAAS,CAAC,MAAM,0CAAE,EAAE,CAAA;QACxC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,KAAa,EAAE,WAAwB;QAClD,IAAI,WAAW,IAAI,4BAAW,CAAC,WAAW,EAAE;YAC1C,OAAO,CACL,8BAAC,aAAK,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IACrC,IAAI,CAAC,IAAI,CACJ,CACT,CAAA;SACF;QACD,OAAO;QACL,aAAa;QACb,8BAAC,cAAM,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IACtC,IAAI,CAAC,IAAI,CACH,CACV,CAAA;IACH,CAAC;CACF;AA3BD,gCA2BC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { HtCarouselNode } from '../hubtype-models';
|
|
3
|
-
import { ContentFieldsBase } from './content-base';
|
|
4
|
-
import { FlowElement } from './element';
|
|
5
|
-
export declare class FlowCarousel extends ContentFieldsBase {
|
|
6
|
-
code: string;
|
|
7
|
-
elements: FlowElement[];
|
|
8
|
-
static fromHubtypeCMS(component: HtCarouselNode, locale: string): FlowCarousel;
|
|
9
|
-
toBotonic(index: number): JSX.Element;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/content-fields/carousel.tsx"],"names":[],"mappings":";;;;AAAA,0CAAgF;AAChF,0DAAyB;AAGzB,iDAAkD;AAClD,uCAAuC;AAEvC,MAAa,YAAa,SAAQ,gCAAiB;IAAnD;;QACS,SAAI,GAAG,EAAE,CAAA;QACT,aAAQ,GAAkB,EAAE,CAAA;IA6BrC,CAAC;IA3BC,MAAM,CAAC,cAAc,CACnB,SAAyB,EACzB,MAAc;QAEd,MAAM,WAAW,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAClD,WAAW,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QACjC,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAC1D,qBAAW,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CACxC,CAAA;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,SAAS,CAAC,KAAa;QACrB,OAAO,CACL,8BAAC,gBAAQ,IAAC,GAAG,EAAE,KAAK,IACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;;YAAC,OAAA,CAChC,8BAAC,eAAO,IAAC,GAAG,EAAE,MAAM;gBAClB,8BAAC,WAAG,IAAC,GAAG,EAAE,CAAC,CAAC,KAAK,GAAI;gBACrB,8BAAC,aAAK,IAAC,KAAK,EAAC,EAAE,IAAE,CAAC,CAAC,KAAK,CAAS;gBACjC,8BAAC,gBAAQ,IAAC,KAAK,EAAC,EAAE,IAAE,CAAC,CAAC,QAAQ,CAAY;gBAE1C,8BAAC,cAAM,IAAC,OAAO,EAAE,MAAA,CAAC,CAAC,OAAO,0CAAE,OAAO,IAAG,MAAA,CAAC,CAAC,OAAO,0CAAE,IAAI,CAAU;oBACvD,CACX,CAAA;SAAA,CAAC,CACO,CACZ,CAAA;IACH,CAAC;CACF;AA/BD,oCA+BC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HtTextLocale } from '../hubtype-models';
|
|
2
|
-
import { FlowCarousel } from './carousel';
|
|
3
|
-
import { FlowImage } from './image';
|
|
4
|
-
import { FlowText } from './text';
|
|
5
|
-
export declare abstract class ContentFieldsBase {
|
|
6
|
-
private readonly id;
|
|
7
|
-
constructor(id: string);
|
|
8
|
-
static getTextByLocale(locale: string, text: HtTextLocale[]): string;
|
|
9
|
-
}
|
|
10
|
-
export declare type FlowContent = FlowText | FlowImage | FlowCarousel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-base.js","sourceRoot":"","sources":["../../../src/content-fields/content-base.ts"],"names":[],"mappings":";;;AAKA,MAAsB,iBAAiB;IACrC,YAA6B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;IAE3C,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,IAAoB;;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAA;QACjD,OAAO,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAA;IAC9B,CAAC;CACF;AAPD,8CAOC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HtElement } from '../hubtype-models';
|
|
2
|
-
import { FlowButton } from './button';
|
|
3
|
-
import { ContentFieldsBase } from './content-base';
|
|
4
|
-
export declare class FlowElement extends ContentFieldsBase {
|
|
5
|
-
title: string;
|
|
6
|
-
subtitle: string;
|
|
7
|
-
buttons: FlowButton | undefined;
|
|
8
|
-
image: string;
|
|
9
|
-
hidden: boolean;
|
|
10
|
-
static fromHubtypeCMS(component: HtElement, locale: string): FlowElement;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/content-fields/element.tsx"],"names":[],"mappings":";;;AACA,oCAA2C;AAC3C,qCAAqC;AACrC,iDAAkD;AAElD,MAAa,WAAY,SAAQ,gCAAiB;IAAlD;;QACS,UAAK,GAAG,EAAE,CAAA;QACV,aAAQ,GAAG,EAAE,CAAA;QAEb,UAAK,GAAG,EAAE,CAAA;QACV,WAAM,GAAG,KAAK,CAAA;IAavB,CAAC;IAXC,MAAM,CAAC,cAAc,CAAC,SAAoB,EAAE,MAAc;QACxD,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAChD,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QACvE,UAAU,CAAC,QAAQ,GAAG,WAAW,CAAC,eAAe,CAC/C,MAAM,EACN,SAAS,CAAC,QAAQ,CACnB,CAAA;QACD,UAAU,CAAC,KAAK,GAAG,wBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QAC5D,UAAU,CAAC,OAAO,GAAG,mBAAU,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACxE,OAAO,UAAU,CAAA;IACnB,CAAC;CACF;AAlBD,kCAkBC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { HtImageNode } from '../hubtype-models';
|
|
3
|
-
import { ContentFieldsBase } from './content-base';
|
|
4
|
-
export declare class FlowImage extends ContentFieldsBase {
|
|
5
|
-
src: string;
|
|
6
|
-
code: string;
|
|
7
|
-
static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage;
|
|
8
|
-
toBotonic(index: number): JSX.Element;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/content-fields/image.tsx"],"names":[],"mappings":";;;;AAAA,0CAAsC;AACtC,0DAAyB;AAGzB,oCAA2C;AAC3C,iDAAkD;AAElD,MAAa,SAAU,SAAQ,gCAAiB;IAAhD;;QACS,QAAG,GAAG,EAAE,CAAA;QACR,SAAI,GAAG,EAAE,CAAA;IAYlB,CAAC;IAVC,MAAM,CAAC,cAAc,CAAC,SAAsB,EAAE,MAAc;QAC1D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC5C,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC9B,QAAQ,CAAC,GAAG,GAAG,wBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAChE,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,SAAS,CAAC,KAAa;QACrB,OAAO,8BAAC,aAAK,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,GAAI,CAAA;IAC7C,CAAC;CACF;AAdD,8BAcC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ButtonStyle, HtTextNode } from '../hubtype-models';
|
|
3
|
-
import { FlowButton } from './button';
|
|
4
|
-
import { ContentFieldsBase } from './content-base';
|
|
5
|
-
export declare class FlowText extends ContentFieldsBase {
|
|
6
|
-
text: string;
|
|
7
|
-
code: string;
|
|
8
|
-
buttons: FlowButton[];
|
|
9
|
-
buttonStyle: ButtonStyle;
|
|
10
|
-
static fromHubtypeCMS(component: HtTextNode, locale: string): FlowText;
|
|
11
|
-
toBotonic(index: number): JSX.Element;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/content-fields/text.tsx"],"names":[],"mappings":";;;;AAAA,0CAAqC;AACrC,0DAAyB;AAEzB,sDAA2D;AAC3D,qCAAqC;AACrC,iDAAkD;AAElD,MAAa,QAAS,SAAQ,gCAAiB;IAA/C;;QACS,SAAI,GAAG,EAAE,CAAA;QACT,SAAI,GAAG,EAAE,CAAA;QACT,YAAO,GAAiB,EAAE,CAAA;QAC1B,gBAAW,GAAG,4BAAW,CAAC,MAAM,CAAA;IAuBzC,CAAC;IArBC,MAAM,CAAC,cAAc,CAAC,SAAqB,EAAE,MAAc;QACzD,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC1C,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC7B,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,IAAI,4BAAW,CAAC,MAAM,CAAA;QAC3E,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACvE,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACvD,mBAAU,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAC1C,CAAA;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,SAAS,CAAC,KAAa;QACrB,OAAO,CACL,8BAAC,YAAI,IAAC,GAAG,EAAE,KAAK;YACb,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAClC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAC7C,CACI,CACR,CAAA;IACH,CAAC;CACF;AA3BD,4BA2BC"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
export declare enum ButtonStyle {
|
|
2
|
-
BUTTON = "button",
|
|
3
|
-
QUICK_REPLY = "quick-reply"
|
|
4
|
-
}
|
|
5
|
-
export declare enum MessageContentType {
|
|
6
|
-
CAROUSEL = "carousel",
|
|
7
|
-
IMAGE = "image",
|
|
8
|
-
TEXT = "text",
|
|
9
|
-
KEYWORD = "keyword",
|
|
10
|
-
HANDOFF = "handoff",
|
|
11
|
-
FUNCTION = "function",
|
|
12
|
-
INTENT = "intent"
|
|
13
|
-
}
|
|
14
|
-
export declare enum NonMessageContentType {
|
|
15
|
-
INTENT = "intent",
|
|
16
|
-
PAYLOAD = "payload",
|
|
17
|
-
QUEUE = "queue",
|
|
18
|
-
URL = "url"
|
|
19
|
-
}
|
|
20
|
-
export declare enum SubContentType {
|
|
21
|
-
BUTTON = "button",
|
|
22
|
-
ELEMENT = "element"
|
|
23
|
-
}
|
|
24
|
-
export declare enum MediaContentType {
|
|
25
|
-
ASSET = "asset"
|
|
26
|
-
}
|
|
27
|
-
export declare enum StartFieldsType {
|
|
28
|
-
START_UP = "start-up"
|
|
29
|
-
}
|
|
30
|
-
export declare enum InputContentType {
|
|
31
|
-
INPUT = "user-input"
|
|
32
|
-
}
|
|
33
|
-
export declare enum InputType {
|
|
34
|
-
INTENTS = "intents",
|
|
35
|
-
KEYWORDS = "keywords"
|
|
36
|
-
}
|
|
37
|
-
export declare const NodeContentType: {
|
|
38
|
-
INPUT: InputContentType.INPUT;
|
|
39
|
-
CAROUSEL: MessageContentType.CAROUSEL;
|
|
40
|
-
IMAGE: MessageContentType.IMAGE;
|
|
41
|
-
TEXT: MessageContentType.TEXT;
|
|
42
|
-
KEYWORD: MessageContentType.KEYWORD;
|
|
43
|
-
HANDOFF: MessageContentType.HANDOFF;
|
|
44
|
-
FUNCTION: MessageContentType.FUNCTION;
|
|
45
|
-
INTENT: MessageContentType.INTENT;
|
|
46
|
-
};
|
|
47
|
-
export declare type NodeContentType = MessageContentType | InputContentType;
|
|
48
|
-
export interface HtFlowBuilderData {
|
|
49
|
-
version: string;
|
|
50
|
-
name: string;
|
|
51
|
-
locales: string[];
|
|
52
|
-
nodes: HtNodeComponent[];
|
|
53
|
-
}
|
|
54
|
-
export interface HtNodeLink {
|
|
55
|
-
id: string;
|
|
56
|
-
type: NodeContentType;
|
|
57
|
-
}
|
|
58
|
-
export interface HtStartReference {
|
|
59
|
-
id: string;
|
|
60
|
-
type: NodeContentType;
|
|
61
|
-
target: HtNodeLink;
|
|
62
|
-
}
|
|
63
|
-
export interface HtBase {
|
|
64
|
-
id: string;
|
|
65
|
-
type: NodeContentType | StartFieldsType;
|
|
66
|
-
}
|
|
67
|
-
export interface HtBaseNode extends HtBase {
|
|
68
|
-
code: string;
|
|
69
|
-
meta: {
|
|
70
|
-
x: number;
|
|
71
|
-
y: number;
|
|
72
|
-
};
|
|
73
|
-
follow_up?: HtNodeLink;
|
|
74
|
-
target?: HtNodeLink;
|
|
75
|
-
}
|
|
76
|
-
export interface HtTextLocale {
|
|
77
|
-
message: string;
|
|
78
|
-
locale: string;
|
|
79
|
-
}
|
|
80
|
-
export interface HtInputLocale {
|
|
81
|
-
values: string[];
|
|
82
|
-
locale: string;
|
|
83
|
-
}
|
|
84
|
-
export interface HtMediaFileLocale {
|
|
85
|
-
id: string;
|
|
86
|
-
file: string;
|
|
87
|
-
locale: string;
|
|
88
|
-
}
|
|
89
|
-
export interface HtTextNode extends HtBaseNode {
|
|
90
|
-
type: MessageContentType.TEXT;
|
|
91
|
-
content: {
|
|
92
|
-
text: HtTextLocale[];
|
|
93
|
-
buttons_style?: ButtonStyle;
|
|
94
|
-
buttons: HtButton[];
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export interface HtButton {
|
|
98
|
-
id: string;
|
|
99
|
-
text: HtTextLocale[];
|
|
100
|
-
target?: HtNodeLink;
|
|
101
|
-
hidden: string[];
|
|
102
|
-
}
|
|
103
|
-
export interface HtImageNode extends HtBaseNode {
|
|
104
|
-
type: MessageContentType.IMAGE;
|
|
105
|
-
content: {
|
|
106
|
-
image: HtMediaFileLocale[];
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export interface HtCarouselNode extends HtBaseNode {
|
|
110
|
-
type: MessageContentType.CAROUSEL;
|
|
111
|
-
content: {
|
|
112
|
-
elements: HtElement[];
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
export interface HtElement {
|
|
116
|
-
id: string;
|
|
117
|
-
title: HtTextLocale[];
|
|
118
|
-
subtitle: HtTextLocale[];
|
|
119
|
-
image: HtMediaFileLocale[];
|
|
120
|
-
button: HtButton;
|
|
121
|
-
hidden: string[];
|
|
122
|
-
}
|
|
123
|
-
export interface HtIntentNode extends HtBaseNode {
|
|
124
|
-
type: MessageContentType.INTENT;
|
|
125
|
-
content: {
|
|
126
|
-
title: HtTextLocale[];
|
|
127
|
-
intents: HtInputLocale[];
|
|
128
|
-
confidence: number;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
export interface HtKeywordNode extends HtBaseNode {
|
|
132
|
-
type: MessageContentType.KEYWORD;
|
|
133
|
-
content: {
|
|
134
|
-
title: HtTextLocale[];
|
|
135
|
-
keywords: HtInputLocale[];
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
export interface HtHandoffNode extends HtBaseNode {
|
|
139
|
-
type: MessageContentType.HANDOFF;
|
|
140
|
-
content: {
|
|
141
|
-
queue: HtQueueLocale[];
|
|
142
|
-
message: HtTextLocale[];
|
|
143
|
-
failMessage: HtTextLocale[];
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
export interface HtQueueLocale {
|
|
147
|
-
id: string;
|
|
148
|
-
name: string;
|
|
149
|
-
locale: string;
|
|
150
|
-
}
|
|
151
|
-
export interface HtFunctionNode extends HtBaseNode {
|
|
152
|
-
type: MessageContentType.FUNCTION;
|
|
153
|
-
content: {
|
|
154
|
-
subtype: string;
|
|
155
|
-
action: string;
|
|
156
|
-
arguments: Array<any>;
|
|
157
|
-
result_mapping: Array<any>;
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
export declare type HtNodeComponent = HtTextNode | HtImageNode | HtCarouselNode | HtIntentNode | HtKeywordNode | HtHandoffNode | HtFunctionNode;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeContentType = exports.InputType = exports.InputContentType = exports.StartFieldsType = exports.MediaContentType = exports.SubContentType = exports.NonMessageContentType = exports.MessageContentType = exports.ButtonStyle = void 0;
|
|
4
|
-
var ButtonStyle;
|
|
5
|
-
(function (ButtonStyle) {
|
|
6
|
-
ButtonStyle["BUTTON"] = "button";
|
|
7
|
-
ButtonStyle["QUICK_REPLY"] = "quick-reply";
|
|
8
|
-
})(ButtonStyle = exports.ButtonStyle || (exports.ButtonStyle = {}));
|
|
9
|
-
var MessageContentType;
|
|
10
|
-
(function (MessageContentType) {
|
|
11
|
-
MessageContentType["CAROUSEL"] = "carousel";
|
|
12
|
-
MessageContentType["IMAGE"] = "image";
|
|
13
|
-
MessageContentType["TEXT"] = "text";
|
|
14
|
-
MessageContentType["KEYWORD"] = "keyword";
|
|
15
|
-
MessageContentType["HANDOFF"] = "handoff";
|
|
16
|
-
MessageContentType["FUNCTION"] = "function";
|
|
17
|
-
MessageContentType["INTENT"] = "intent";
|
|
18
|
-
})(MessageContentType = exports.MessageContentType || (exports.MessageContentType = {}));
|
|
19
|
-
// TODO: refactor types correctly
|
|
20
|
-
var NonMessageContentType;
|
|
21
|
-
(function (NonMessageContentType) {
|
|
22
|
-
NonMessageContentType["INTENT"] = "intent";
|
|
23
|
-
NonMessageContentType["PAYLOAD"] = "payload";
|
|
24
|
-
NonMessageContentType["QUEUE"] = "queue";
|
|
25
|
-
NonMessageContentType["URL"] = "url";
|
|
26
|
-
})(NonMessageContentType = exports.NonMessageContentType || (exports.NonMessageContentType = {}));
|
|
27
|
-
var SubContentType;
|
|
28
|
-
(function (SubContentType) {
|
|
29
|
-
SubContentType["BUTTON"] = "button";
|
|
30
|
-
SubContentType["ELEMENT"] = "element";
|
|
31
|
-
})(SubContentType = exports.SubContentType || (exports.SubContentType = {}));
|
|
32
|
-
var MediaContentType;
|
|
33
|
-
(function (MediaContentType) {
|
|
34
|
-
MediaContentType["ASSET"] = "asset";
|
|
35
|
-
})(MediaContentType = exports.MediaContentType || (exports.MediaContentType = {}));
|
|
36
|
-
var StartFieldsType;
|
|
37
|
-
(function (StartFieldsType) {
|
|
38
|
-
StartFieldsType["START_UP"] = "start-up";
|
|
39
|
-
})(StartFieldsType = exports.StartFieldsType || (exports.StartFieldsType = {}));
|
|
40
|
-
var InputContentType;
|
|
41
|
-
(function (InputContentType) {
|
|
42
|
-
InputContentType["INPUT"] = "user-input";
|
|
43
|
-
})(InputContentType = exports.InputContentType || (exports.InputContentType = {}));
|
|
44
|
-
var InputType;
|
|
45
|
-
(function (InputType) {
|
|
46
|
-
InputType["INTENTS"] = "intents";
|
|
47
|
-
InputType["KEYWORDS"] = "keywords";
|
|
48
|
-
})(InputType = exports.InputType || (exports.InputType = {}));
|
|
49
|
-
exports.NodeContentType = Object.assign(Object.assign({}, MessageContentType), InputContentType);
|
|
50
|
-
//# sourceMappingURL=hubtype-models.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hubtype-models.js","sourceRoot":"","sources":["../../src/hubtype-models.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,0CAA2B,CAAA;AAC7B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED,IAAY,kBAQX;AARD,WAAY,kBAAkB;IAC5B,2CAAqB,CAAA;IACrB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;IACrB,uCAAiB,CAAA;AACnB,CAAC,EARW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAQ7B;AAED,iCAAiC;AACjC,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,oCAAW,CAAA;AACb,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAED,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;AACjB,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B;AAED,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,wCAAqB,CAAA;AACvB,CAAC,EAFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAE1B;AAED,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,wCAAoB,CAAA;AACtB,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AAEY,QAAA,eAAe,mCACvB,kBAAkB,GAClB,gBAAgB,EACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/content-fields/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,WAAW,EAAY,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAAjD;;QACS,SAAI,GAAG,EAAE,CAAA;IA0BlB,CAAC;IAtBC,MAAM,CAAC,cAAc,CAAC,SAAmB,EAAE,MAAc;;QACvD,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC9C,SAAS,CAAC,IAAI,GAAG,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QACnE,SAAS,CAAC,OAAO,GAAG,MAAA,SAAS,CAAC,MAAM,0CAAE,EAAE,CAAA;QACxC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,KAAa,EAAE,WAAwB;QAClD,IAAI,WAAW,IAAI,WAAW,CAAC,WAAW,EAAE;YAC1C,OAAO,CACL,oBAAC,KAAK,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IACrC,IAAI,CAAC,IAAI,CACJ,CACT,CAAA;SACF;QACD,OAAO;QACL,aAAa;QACb,oBAAC,MAAM,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IACtC,IAAI,CAAC,IAAI,CACH,CACV,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { HtCarouselNode } from '../hubtype-models';
|
|
3
|
-
import { ContentFieldsBase } from './content-base';
|
|
4
|
-
import { FlowElement } from './element';
|
|
5
|
-
export declare class FlowCarousel extends ContentFieldsBase {
|
|
6
|
-
code: string;
|
|
7
|
-
elements: FlowElement[];
|
|
8
|
-
static fromHubtypeCMS(component: HtCarouselNode, locale: string): FlowCarousel;
|
|
9
|
-
toBotonic(index: number): JSX.Element;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/content-fields/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChF,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAAnD;;QACS,SAAI,GAAG,EAAE,CAAA;QACT,aAAQ,GAAkB,EAAE,CAAA;IA6BrC,CAAC;IA3BC,MAAM,CAAC,cAAc,CACnB,SAAyB,EACzB,MAAc;QAEd,MAAM,WAAW,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAClD,WAAW,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QACjC,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAC1D,WAAW,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CACxC,CAAA;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,SAAS,CAAC,KAAa;QACrB,OAAO,CACL,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,IACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;;YAAC,OAAA,CAChC,oBAAC,OAAO,IAAC,GAAG,EAAE,MAAM;gBAClB,oBAAC,GAAG,IAAC,GAAG,EAAE,CAAC,CAAC,KAAK,GAAI;gBACrB,oBAAC,KAAK,IAAC,KAAK,EAAC,EAAE,IAAE,CAAC,CAAC,KAAK,CAAS;gBACjC,oBAAC,QAAQ,IAAC,KAAK,EAAC,EAAE,IAAE,CAAC,CAAC,QAAQ,CAAY;gBAE1C,oBAAC,MAAM,IAAC,OAAO,EAAE,MAAA,CAAC,CAAC,OAAO,0CAAE,OAAO,IAAG,MAAA,CAAC,CAAC,OAAO,0CAAE,IAAI,CAAU;oBACvD,CACX,CAAA;SAAA,CAAC,CACO,CACZ,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HtTextLocale } from '../hubtype-models';
|
|
2
|
-
import { FlowCarousel } from './carousel';
|
|
3
|
-
import { FlowImage } from './image';
|
|
4
|
-
import { FlowText } from './text';
|
|
5
|
-
export declare abstract class ContentFieldsBase {
|
|
6
|
-
private readonly id;
|
|
7
|
-
constructor(id: string);
|
|
8
|
-
static getTextByLocale(locale: string, text: HtTextLocale[]): string;
|
|
9
|
-
}
|
|
10
|
-
export declare type FlowContent = FlowText | FlowImage | FlowCarousel;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class ContentFieldsBase {
|
|
2
|
-
constructor(id) {
|
|
3
|
-
this.id = id;
|
|
4
|
-
}
|
|
5
|
-
static getTextByLocale(locale, text) {
|
|
6
|
-
var _a;
|
|
7
|
-
const result = text.find(t => t.locale == locale);
|
|
8
|
-
return (_a = result === null || result === void 0 ? void 0 : result.message) !== null && _a !== void 0 ? _a : '';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=content-base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-base.js","sourceRoot":"","sources":["../../../src/content-fields/content-base.ts"],"names":[],"mappings":"AAKA,MAAM,OAAgB,iBAAiB;IACrC,YAA6B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;IAE3C,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,IAAoB;;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAA;QACjD,OAAO,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAA;IAC9B,CAAC;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HtElement } from '../hubtype-models';
|
|
2
|
-
import { FlowButton } from './button';
|
|
3
|
-
import { ContentFieldsBase } from './content-base';
|
|
4
|
-
export declare class FlowElement extends ContentFieldsBase {
|
|
5
|
-
title: string;
|
|
6
|
-
subtitle: string;
|
|
7
|
-
buttons: FlowButton | undefined;
|
|
8
|
-
image: string;
|
|
9
|
-
hidden: boolean;
|
|
10
|
-
static fromHubtypeCMS(component: HtElement, locale: string): FlowElement;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/content-fields/element.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAAlD;;QACS,UAAK,GAAG,EAAE,CAAA;QACV,aAAQ,GAAG,EAAE,CAAA;QAEb,UAAK,GAAG,EAAE,CAAA;QACV,WAAM,GAAG,KAAK,CAAA;IAavB,CAAC;IAXC,MAAM,CAAC,cAAc,CAAC,SAAoB,EAAE,MAAc;QACxD,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAChD,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QACvE,UAAU,CAAC,QAAQ,GAAG,WAAW,CAAC,eAAe,CAC/C,MAAM,EACN,SAAS,CAAC,QAAQ,CACnB,CAAA;QACD,UAAU,CAAC,KAAK,GAAG,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QAC5D,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACxE,OAAO,UAAU,CAAA;IACnB,CAAC;CACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { HtImageNode } from '../hubtype-models';
|
|
3
|
-
import { ContentFieldsBase } from './content-base';
|
|
4
|
-
export declare class FlowImage extends ContentFieldsBase {
|
|
5
|
-
src: string;
|
|
6
|
-
code: string;
|
|
7
|
-
static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage;
|
|
8
|
-
toBotonic(index: number): JSX.Element;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/content-fields/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAAhD;;QACS,QAAG,GAAG,EAAE,CAAA;QACR,SAAI,GAAG,EAAE,CAAA;IAYlB,CAAC;IAVC,MAAM,CAAC,cAAc,CAAC,SAAsB,EAAE,MAAc;QAC1D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC5C,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC9B,QAAQ,CAAC,GAAG,GAAG,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAChE,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,SAAS,CAAC,KAAa;QACrB,OAAO,oBAAC,KAAK,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,GAAI,CAAA;IAC7C,CAAC;CACF"}
|