@botonic/plugin-flow-builder 0.21.0-alpha.4 → 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 -5
- package/lib/cjs/action.js +23 -16
- 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 +19 -14
- package/lib/cjs/index.js +40 -24
- 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 -5
- package/lib/esm/action.js +22 -15
- 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 +19 -14
- package/lib/esm/index.js +35 -21
- 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 +26 -20
- 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 +75 -50
- 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 -152
- 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 -152
- 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 -190
package/src/index.ts
CHANGED
|
@@ -3,49 +3,58 @@ import {
|
|
|
3
3
|
Plugin,
|
|
4
4
|
PluginPostRequest,
|
|
5
5
|
PluginPreRequest,
|
|
6
|
+
Session,
|
|
6
7
|
} from '@botonic/core'
|
|
7
8
|
import axios from 'axios'
|
|
8
9
|
|
|
9
|
-
import { FlowCarousel } from './content-fields/carousel'
|
|
10
|
-
import { FlowContent } from './content-fields/content-base'
|
|
11
|
-
import { FlowImage } from './content-fields/image'
|
|
12
|
-
import { FlowText } from './content-fields/text'
|
|
13
|
-
import { DEFAULT_FUNCTIONS } from './functions'
|
|
14
10
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 = {
|
|
26
29
|
flowUrl: string
|
|
27
|
-
flow
|
|
28
|
-
customFunctions
|
|
30
|
+
flow?: FlowBuilderData
|
|
31
|
+
customFunctions?: Record<any, any>
|
|
32
|
+
getLocale: (session: Session) => string
|
|
33
|
+
getAccessToken: () => string
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
export default class BotonicPluginFlowBuilder implements Plugin {
|
|
32
37
|
private flowUrl: string
|
|
33
|
-
private flow: Promise<
|
|
38
|
+
private flow: Promise<FlowBuilderData> | FlowBuilderData
|
|
34
39
|
private functions: Record<any, any>
|
|
35
40
|
private currentRequest: PluginPreRequest
|
|
41
|
+
private getAccessToken: () => string
|
|
42
|
+
public getLocale: (session: Session) => string
|
|
36
43
|
|
|
37
44
|
constructor(readonly options: BotonicPluginFlowBuilderOptions) {
|
|
45
|
+
this.getLocale = options.getLocale
|
|
46
|
+
this.getAccessToken = options.getAccessToken
|
|
38
47
|
this.flowUrl = options.flowUrl
|
|
39
48
|
this.flow = options.flow || this.readFlowContent()
|
|
40
49
|
const customFunctions = options.customFunctions || {}
|
|
41
50
|
this.functions = { ...DEFAULT_FUNCTIONS, ...customFunctions }
|
|
42
51
|
}
|
|
43
52
|
|
|
44
|
-
async readFlowContent() {
|
|
45
|
-
const response = await axios.get(this.flowUrl
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
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
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
async pre(request: PluginPreRequest): Promise<void> {
|
|
@@ -55,55 +64,62 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
55
64
|
|
|
56
65
|
async post(_request: PluginPostRequest): Promise<void> {}
|
|
57
66
|
|
|
58
|
-
async getContent(id: string): Promise<
|
|
67
|
+
async getContent(id: string): Promise<NodeComponent> {
|
|
59
68
|
const flow = await this.flow
|
|
60
|
-
const content = flow.nodes.find(
|
|
69
|
+
const content = flow.nodes.find(node => node.id === id)
|
|
61
70
|
if (!content) throw Error(`text with id: '${id}' not found`)
|
|
62
71
|
return content
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
async getHandoffContent(): Promise<
|
|
74
|
+
async getHandoffContent(): Promise<HandoffNode> {
|
|
66
75
|
const flow = await this.flow
|
|
67
76
|
const content = flow.nodes.find(
|
|
68
|
-
|
|
69
|
-
) as
|
|
77
|
+
node => node.type === NodeType.HANDOFF
|
|
78
|
+
) as HandoffNode
|
|
70
79
|
if (!content) throw Error(`Handoff node not found`)
|
|
71
80
|
return content
|
|
72
81
|
}
|
|
73
82
|
|
|
74
83
|
getFlowContent(
|
|
75
|
-
hubtypeContent:
|
|
84
|
+
hubtypeContent: NodeComponent,
|
|
76
85
|
locale: string
|
|
77
86
|
): FlowContent | undefined {
|
|
78
87
|
switch (hubtypeContent.type) {
|
|
79
|
-
case
|
|
88
|
+
case NodeType.TEXT:
|
|
80
89
|
return FlowText.fromHubtypeCMS(hubtypeContent, locale)
|
|
81
|
-
case
|
|
90
|
+
case NodeType.IMAGE:
|
|
82
91
|
return FlowImage.fromHubtypeCMS(hubtypeContent, locale)
|
|
83
|
-
case
|
|
92
|
+
case NodeType.CAROUSEL:
|
|
84
93
|
return FlowCarousel.fromHubtypeCMS(hubtypeContent, locale)
|
|
85
94
|
default:
|
|
86
95
|
return undefined
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
|
|
99
|
+
async getStartId(): Promise<string> {
|
|
100
|
+
const flow = await this.flow
|
|
101
|
+
const startNode = flow.nodes.find(node => node.type === NodeType.START_UP)
|
|
102
|
+
if (!startNode) {
|
|
103
|
+
throw new Error('start-up id must be defined')
|
|
104
|
+
}
|
|
105
|
+
return (startNode as StartNode).target.id
|
|
106
|
+
}
|
|
107
|
+
|
|
90
108
|
async getContents(
|
|
91
109
|
id: string,
|
|
92
110
|
locale: string,
|
|
93
111
|
prevContents?: FlowContent[]
|
|
94
112
|
): Promise<FlowContent[]> {
|
|
95
113
|
const contents = prevContents || []
|
|
96
|
-
const hubtypeContent = await this.getContent(id)
|
|
114
|
+
const hubtypeContent: any = await this.getContent(id)
|
|
97
115
|
const content = await this.getFlowContent(hubtypeContent, locale)
|
|
98
|
-
if (hubtypeContent.type ===
|
|
99
|
-
const targetId = await this.callFunction(
|
|
100
|
-
hubtypeContent as HtFunctionNode,
|
|
101
|
-
locale
|
|
102
|
-
)
|
|
116
|
+
if (hubtypeContent.type === NodeType.FUNCTION) {
|
|
117
|
+
const targetId = await this.callFunction(hubtypeContent, locale)
|
|
103
118
|
return this.getContents(targetId, locale, contents)
|
|
104
119
|
} else {
|
|
105
120
|
if (content) contents.push(content)
|
|
106
121
|
// TODO: prevent infinite recursive calls
|
|
122
|
+
|
|
107
123
|
if (hubtypeContent.follow_up)
|
|
108
124
|
return this.getContents(hubtypeContent.follow_up.id, locale, contents)
|
|
109
125
|
}
|
|
@@ -119,8 +135,8 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
119
135
|
try {
|
|
120
136
|
const flow = await this.flow
|
|
121
137
|
const intents = flow.nodes.filter(
|
|
122
|
-
node => node.type
|
|
123
|
-
) as
|
|
138
|
+
node => node.type === NodeType.INTENT
|
|
139
|
+
) as IntentNode[]
|
|
124
140
|
if (input.intent) {
|
|
125
141
|
const matchedIntents = intents.filter(node =>
|
|
126
142
|
//@ts-ignore
|
|
@@ -137,7 +153,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
137
153
|
return undefined
|
|
138
154
|
}
|
|
139
155
|
|
|
140
|
-
hasIntent(node:
|
|
156
|
+
hasIntent(node: IntentNode, intent: string, locale: string): boolean {
|
|
141
157
|
const result = node.content.intents.find(
|
|
142
158
|
i => i.locale === locale && i.values.includes(intent)
|
|
143
159
|
)
|
|
@@ -151,8 +167,8 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
151
167
|
try {
|
|
152
168
|
const flow = await this.flow
|
|
153
169
|
const keywordNodes = flow.nodes.filter(
|
|
154
|
-
node => node.type ==
|
|
155
|
-
) as
|
|
170
|
+
node => node.type == NodeType.KEYWORD
|
|
171
|
+
) as KeywordNode[]
|
|
156
172
|
const matchedKeywordNodes = keywordNodes.filter(node =>
|
|
157
173
|
//@ts-ignore
|
|
158
174
|
this.matchKeywords(node, input.data, locale)
|
|
@@ -167,14 +183,14 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
167
183
|
return undefined
|
|
168
184
|
}
|
|
169
185
|
|
|
170
|
-
matchKeywords(node:
|
|
186
|
+
matchKeywords(node: KeywordNode, input: string, locale: string): boolean {
|
|
171
187
|
const result = node.content.keywords.find(
|
|
172
188
|
i => i.locale === locale && this.containsAnyKeywords(input, i.values)
|
|
173
189
|
)
|
|
174
190
|
return Boolean(result)
|
|
175
191
|
}
|
|
176
192
|
|
|
177
|
-
containsAnyKeywords(input: string, keywords: string[]) {
|
|
193
|
+
containsAnyKeywords(input: string, keywords: string[]): boolean {
|
|
178
194
|
for (let i = 0; i < keywords.length; i++) {
|
|
179
195
|
if (input.includes(keywords[i])) {
|
|
180
196
|
return true
|
|
@@ -184,14 +200,16 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
184
200
|
}
|
|
185
201
|
|
|
186
202
|
async callFunction(
|
|
187
|
-
functionNode:
|
|
203
|
+
functionNode: FunctionNode,
|
|
188
204
|
locale: string
|
|
189
205
|
): Promise<string> {
|
|
190
|
-
|
|
191
|
-
// TODO: get arguments by locale
|
|
206
|
+
const functionNodeId = functionNode.id
|
|
192
207
|
const nameValues = functionNode.content.arguments
|
|
193
208
|
.find(arg => arg.locale === locale)
|
|
194
|
-
|
|
209
|
+
?.values.map(value => ({ [value.name]: value.value }))
|
|
210
|
+
if (!nameValues) {
|
|
211
|
+
throw new Error(`No arguments found for node with id ${functionNodeId}`)
|
|
212
|
+
}
|
|
195
213
|
const args = Object.assign(
|
|
196
214
|
{
|
|
197
215
|
session: this.currentRequest.session,
|
|
@@ -206,6 +224,13 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
206
224
|
const result = functionNode.content.result_mapping.find(
|
|
207
225
|
r => r.result === functionResult
|
|
208
226
|
)
|
|
227
|
+
if (!result) {
|
|
228
|
+
throw new Error(
|
|
229
|
+
`No result found for result_mapping for node with id: ${functionNodeId}`
|
|
230
|
+
)
|
|
231
|
+
}
|
|
209
232
|
return result.target.id
|
|
210
233
|
}
|
|
211
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"],"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TON = "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
|
-
STARTUP = "startUp"
|
|
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 HtBaseNode {
|
|
59
|
-
id: string;
|
|
60
|
-
code: string;
|
|
61
|
-
meta: {
|
|
62
|
-
x: number;
|
|
63
|
-
y: number;
|
|
64
|
-
};
|
|
65
|
-
follow_up?: HtNodeLink;
|
|
66
|
-
target?: HtNodeLink;
|
|
67
|
-
}
|
|
68
|
-
export interface HtTextLocale {
|
|
69
|
-
message: string;
|
|
70
|
-
locale: string;
|
|
71
|
-
}
|
|
72
|
-
export interface HtInputLocale {
|
|
73
|
-
values: string[];
|
|
74
|
-
locale: string;
|
|
75
|
-
}
|
|
76
|
-
export interface HtMediaFileLocale {
|
|
77
|
-
id: string;
|
|
78
|
-
file: string;
|
|
79
|
-
locale: string;
|
|
80
|
-
}
|
|
81
|
-
export interface HtTextNode extends HtBaseNode {
|
|
82
|
-
type: MessageContentType.TEXT;
|
|
83
|
-
content: {
|
|
84
|
-
text: HtTextLocale[];
|
|
85
|
-
buttons_style?: ButtonStyle;
|
|
86
|
-
buttons: HtButton[];
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export interface HtButton {
|
|
90
|
-
id: string;
|
|
91
|
-
text: HtTextLocale[];
|
|
92
|
-
target?: HtNodeLink;
|
|
93
|
-
hidden: string[];
|
|
94
|
-
}
|
|
95
|
-
export interface HtImageNode extends HtBaseNode {
|
|
96
|
-
type: MessageContentType.IMAGE;
|
|
97
|
-
content: {
|
|
98
|
-
image: HtMediaFileLocale[];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export interface HtCarouselNode extends HtBaseNode {
|
|
102
|
-
type: MessageContentType.CAROUSEL;
|
|
103
|
-
content: {
|
|
104
|
-
elements: HtElement[];
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export interface HtElement {
|
|
108
|
-
id: string;
|
|
109
|
-
title: HtTextLocale[];
|
|
110
|
-
subtitle: HtTextLocale[];
|
|
111
|
-
image: HtMediaFileLocale[];
|
|
112
|
-
button: HtButton;
|
|
113
|
-
hidden: string[];
|
|
114
|
-
}
|
|
115
|
-
export interface HtIntentNode extends HtBaseNode {
|
|
116
|
-
type: MessageContentType.INTENT;
|
|
117
|
-
content: {
|
|
118
|
-
title: HtTextLocale[];
|
|
119
|
-
intents: HtInputLocale[];
|
|
120
|
-
confidence: number;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
export interface HtKeywordNode extends HtBaseNode {
|
|
124
|
-
type: MessageContentType.KEYWORD;
|
|
125
|
-
content: {
|
|
126
|
-
title: HtTextLocale[];
|
|
127
|
-
keywords: HtInputLocale[];
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
export interface HtHandoffNode extends HtBaseNode {
|
|
131
|
-
type: MessageContentType.HANDOFF;
|
|
132
|
-
content: {
|
|
133
|
-
queue: HtQueueLocale[];
|
|
134
|
-
message: HtTextLocale[];
|
|
135
|
-
failMessage: HtTextLocale[];
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
export interface HtQueueLocale {
|
|
139
|
-
id: string;
|
|
140
|
-
name: string;
|
|
141
|
-
locale: string;
|
|
142
|
-
}
|
|
143
|
-
export interface HtFunctionNode extends HtBaseNode {
|
|
144
|
-
type: MessageContentType.FUNCTION;
|
|
145
|
-
content: {
|
|
146
|
-
subtype: string;
|
|
147
|
-
action: string;
|
|
148
|
-
arguments: Array<any>;
|
|
149
|
-
result_mapping: Array<any>;
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
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["STARTUP"] = "startUp";
|
|
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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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;A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|
|
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"}
|
|
@@ -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
|
-
}
|