@voiceflow/utils-designer 1.22.12 → 1.23.0
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.
@@ -1,3 +1,4 @@
|
|
1
|
+
import { BaseText } from '@voiceflow/base-types';
|
1
2
|
import type { Entity, Markup, MarkupSpan, Variable } from '@voiceflow/dtos';
|
2
3
|
import type { MultiAdapter } from 'bidirectional-adapter';
|
3
4
|
export type MarkupItem = Markup[number];
|
@@ -51,5 +52,10 @@ export declare const replaceMarkupEntity: (markup: Markup, { oldEntityID, newEnt
|
|
51
52
|
}) => Markup;
|
52
53
|
export declare const fillMarkupWithVariablesValues: (promptText: string, variables: Record<string, string>) => string;
|
53
54
|
export declare const markupToString: MultiAdapter<Markup, string, [MarkupToStringFromOptions], [MarkupToStringToOptions]>;
|
55
|
+
export declare const markupToSlate: MultiAdapter<Markup, BaseText.SlateTextValue, [{
|
56
|
+
iteration?: number | undefined;
|
57
|
+
entitiesMapByID: Partial<Record<string, Entity>>;
|
58
|
+
variablesMapByID: Partial<Record<string, Variable>>;
|
59
|
+
}], []>;
|
54
60
|
export {};
|
55
61
|
//# sourceMappingURL=markup.util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"markup.util.d.ts","sourceRoot":"","sources":["../../src/markup.util.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"markup.util.d.ts","sourceRoot":"","sources":["../../src/markup.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAExC,eAAO,MAAM,8BAA8B,QAAa,CAAC;AAEzD,MA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,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;CACvD;AAiBD,eAAO,MAAM,kBAAkB,8BAAwE,CAAC;AAiBxG,eAAO,MAAM,oBAAoB,8BAA0E,CAAC;AAE5G,eAAO,MAAM,mBAAmB;iBAEe,MAAM;iBAAe,MAAM;YAWzE,CAAC;AAEF,eAAO,MAAM,6BAA6B,eAAgB,MAAM,aAAa,OAAO,MAAM,EAAE,MAAM,CAAC,WAOlG,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,yBAAyB,CAAC,EAAE,CAAC,uBAAuB,CAAC,CA8E7G,CAAC;AAOJ,eAAO,MAAM,aAAa;;qBAMH,QAAQ,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;sBAC9B,QAAQ,OAAO,MAAM,EAAE,QAAQ,CAAC,CAAC;OA2HxD,CAAC"}
|
package/build/cjs/markup.util.js
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.markupToString = exports.fillMarkupWithVariablesValues = exports.replaceMarkupEntity = exports.getMarkupVariableIDs = exports.getMarkupEntityIDs = exports.isMarkupWithEntities = exports.isMarkupEmpty = exports.isMarkupVariable = exports.isMarkupString = exports.isMarkupEntity = exports.isMarkupSpanLink = exports.isMarkupSpanText = exports.isMarkupSpan = exports.markupFactory = exports.isMarkupEntityReference = exports.isMarkupVariableReference = exports.ENTITY_OR_VARIABLE_TEXT_REGEXP = void 0;
|
3
|
+
exports.markupToSlate = exports.markupToString = exports.fillMarkupWithVariablesValues = exports.replaceMarkupEntity = exports.getMarkupVariableIDs = exports.getMarkupEntityIDs = exports.isMarkupWithEntities = exports.isMarkupEmpty = exports.isMarkupVariable = exports.isMarkupString = exports.isMarkupEntity = exports.isMarkupSpanLink = exports.isMarkupSpanText = exports.isMarkupSpan = exports.markupFactory = exports.isMarkupEntityReference = exports.isMarkupVariableReference = exports.ENTITY_OR_VARIABLE_TEXT_REGEXP = void 0;
|
4
|
+
const base_types_1 = require("@voiceflow/base-types");
|
4
5
|
const common_1 = require("@voiceflow/common");
|
5
6
|
const bidirectional_adapter_1 = require("bidirectional-adapter");
|
7
|
+
const slate_1 = require("slate");
|
6
8
|
const ts_pattern_1 = require("ts-pattern");
|
7
9
|
exports.ENTITY_OR_VARIABLE_TEXT_REGEXP = /{(\w*)}/g;
|
8
10
|
const isMarkupVariableReference = (markupItem) => {
|
@@ -148,3 +150,80 @@ exports.markupToString = (0, bidirectional_adapter_1.createMultiAdapter)((markup
|
|
148
150
|
}
|
149
151
|
return [span];
|
150
152
|
});
|
153
|
+
const isEmptyState = (nodes) => nodes.every((element) => slate_1.Text.isText(element) ? !element.text.trim() : element.type !== 'variable' && isEmptyState(element.children));
|
154
|
+
exports.markupToSlate = (0, bidirectional_adapter_1.createMultiAdapter)((markup, { iteration = 0, entitiesMapByID, variablesMapByID }) => {
|
155
|
+
if (!markup?.length)
|
156
|
+
return iteration === 0 ? [{ children: [{ text: '' }] }] : [{ text: '' }];
|
157
|
+
if (markup.length === 1 && typeof markup[0] === 'string')
|
158
|
+
return iteration === 0 ? [{ children: [{ text: markup[0] }] }] : [{ text: markup[0] }];
|
159
|
+
return markup.reduce((acc, item) => [
|
160
|
+
...acc,
|
161
|
+
(0, ts_pattern_1.match)(item)
|
162
|
+
.when(exports.isMarkupString, (item) => ({ text: item }))
|
163
|
+
.when(exports.isMarkupEntity, ({ entityID }) => ({
|
164
|
+
id: entityID,
|
165
|
+
type: base_types_1.BaseText.ElementType.VARIABLE,
|
166
|
+
name: entitiesMapByID[entityID]?.name ?? 'unknown',
|
167
|
+
isSlot: true,
|
168
|
+
children: [{ text: '' }],
|
169
|
+
}))
|
170
|
+
.when(exports.isMarkupVariable, ({ variableID }) => ({
|
171
|
+
id: variableID,
|
172
|
+
type: base_types_1.BaseText.ElementType.VARIABLE,
|
173
|
+
name: variablesMapByID[variableID]?.name ?? 'unknown',
|
174
|
+
isSlot: false,
|
175
|
+
children: [{ text: '' }],
|
176
|
+
}))
|
177
|
+
.when(exports.isMarkupSpan, (span) => (0, ts_pattern_1.match)(span)
|
178
|
+
.when(exports.isMarkupSpanText, ({ text: [text], attributes: { __type, ...attrs } }) => ({ ...attrs, text }))
|
179
|
+
.when(exports.isMarkupSpanLink, ({ text, attributes: { url } }) => ({
|
180
|
+
url,
|
181
|
+
type: base_types_1.BaseText.ElementType.LINK,
|
182
|
+
children: exports.markupToSlate.fromDB(text, { iteration: iteration + 1, entitiesMapByID, variablesMapByID }),
|
183
|
+
}))
|
184
|
+
.otherwise(({ text, attributes: { __type, ...attrs } = {} }) => ({
|
185
|
+
...attrs,
|
186
|
+
children: exports.markupToSlate.fromDB(text, { iteration: iteration + 1, entitiesMapByID, variablesMapByID }),
|
187
|
+
})))
|
188
|
+
.exhaustive(),
|
189
|
+
], []);
|
190
|
+
}, (slate) => {
|
191
|
+
if (isEmptyState(slate))
|
192
|
+
return (0, exports.markupFactory)();
|
193
|
+
return slate.reduce((acc, item) => [
|
194
|
+
...acc,
|
195
|
+
(0, ts_pattern_1.match)(item)
|
196
|
+
.when((value) => !slate_1.Text.isText(value) && value.type === base_types_1.BaseText.ElementType.LINK, (item) => {
|
197
|
+
const { url = '', children } = item;
|
198
|
+
return { text: exports.markupToSlate.toDB(children), attributes: { __type: 'link', url } };
|
199
|
+
})
|
200
|
+
.when((value) => !slate_1.Text.isText(value) && value.type === base_types_1.BaseText.ElementType.VARIABLE, (item) => {
|
201
|
+
const { id, name } = item;
|
202
|
+
const isSlot = item.isSlot ?? id !== name;
|
203
|
+
return isSlot ? { entityID: id } : { variableID: id };
|
204
|
+
})
|
205
|
+
.when((value) => slate_1.Text.isText(value), (item) => {
|
206
|
+
const { text, color, italic, underline, fontWeight, fontFamily, strikeThrough, backgroundColor } = item;
|
207
|
+
if (!color && !italic && !underline && !fontWeight && !fontFamily && !strikeThrough && !backgroundColor) {
|
208
|
+
return text;
|
209
|
+
}
|
210
|
+
return {
|
211
|
+
text: [text],
|
212
|
+
attributes: {
|
213
|
+
__type: 'text',
|
214
|
+
...(color && { color }),
|
215
|
+
...(italic && { italic }),
|
216
|
+
...(underline && { underline }),
|
217
|
+
...(fontWeight && { fontWeight }),
|
218
|
+
...(fontFamily && { fontFamily }),
|
219
|
+
...(strikeThrough && { strikeThrough }),
|
220
|
+
...(backgroundColor && { backgroundColor }),
|
221
|
+
},
|
222
|
+
};
|
223
|
+
})
|
224
|
+
.otherwise(({ type: _, children, textAlign }) => ({
|
225
|
+
text: exports.markupToSlate.toDB(children),
|
226
|
+
...(textAlign && { attributes: { textAlign } }),
|
227
|
+
})),
|
228
|
+
], []);
|
229
|
+
});
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { BaseText } from '@voiceflow/base-types';
|
1
2
|
import type { Entity, Markup, MarkupSpan, Variable } from '@voiceflow/dtos';
|
2
3
|
import type { MultiAdapter } from 'bidirectional-adapter';
|
3
4
|
export type MarkupItem = Markup[number];
|
@@ -51,5 +52,10 @@ export declare const replaceMarkupEntity: (markup: Markup, { oldEntityID, newEnt
|
|
51
52
|
}) => Markup;
|
52
53
|
export declare const fillMarkupWithVariablesValues: (promptText: string, variables: Record<string, string>) => string;
|
53
54
|
export declare const markupToString: MultiAdapter<Markup, string, [MarkupToStringFromOptions], [MarkupToStringToOptions]>;
|
55
|
+
export declare const markupToSlate: MultiAdapter<Markup, BaseText.SlateTextValue, [{
|
56
|
+
iteration?: number | undefined;
|
57
|
+
entitiesMapByID: Partial<Record<string, Entity>>;
|
58
|
+
variablesMapByID: Partial<Record<string, Variable>>;
|
59
|
+
}], []>;
|
54
60
|
export {};
|
55
61
|
//# sourceMappingURL=markup.util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"markup.util.d.ts","sourceRoot":"","sources":["../../src/markup.util.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"markup.util.d.ts","sourceRoot":"","sources":["../../src/markup.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAExC,eAAO,MAAM,8BAA8B,QAAa,CAAC;AAEzD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IAC9D,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;IACf,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,eAAgB,MAAM,CAAC,MAAM,CAAC;gBAA+B,MAAM;CAExG,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAgB,MAAM,CAAC,MAAM,CAAC;cAA6B,MAAM;CAEpG,CAAC;AAEF,eAAO,MAAM,aAAa,2BAA4C,CAAC;AAEvE,eAAO,MAAM,YAAY,UAAW,UAAU,wBAC2B,CAAC;AAE1E,eAAO,MAAM,gBAAgB,UAAW,UAAU,4BAIf,CAAC;AAEpC,eAAO,MAAM,gBAAgB,UAAW,UAAU,4BACa,CAAC;AAEhE,eAAO,MAAM,cAAc,UAAW,UAAU;cAAwB,MAAM;CACD,CAAC;AAE9E,eAAO,MAAM,cAAc,UAAW,UAAU,oBAA+C,CAAC;AAEhG,eAAO,MAAM,gBA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{ createMultiAdapter } from 'bidirectional-adapter';
|
4
|
+
import { Text } from 'slate';
|
3
5
|
import { match } from 'ts-pattern';
|
4
6
|
export const ENTITY_OR_VARIABLE_TEXT_REGEXP = /{(\w*)}/g;
|
5
7
|
export const isMarkupVariableReference = (markupItem) => {
|
@@ -130,3 +132,80 @@ export const markupToString = createMultiAdapter((markup, { entitiesMapByID, var
|
|
130
132
|
}
|
131
133
|
return [span];
|
132
134
|
});
|
135
|
+
const isEmptyState = (nodes) => nodes.every((element) => Text.isText(element) ? !element.text.trim() : element.type !== 'variable' && isEmptyState(element.children));
|
136
|
+
export const markupToSlate = createMultiAdapter((markup, { iteration = 0, entitiesMapByID, variablesMapByID }) => {
|
137
|
+
if (!markup?.length)
|
138
|
+
return iteration === 0 ? [{ children: [{ text: '' }] }] : [{ text: '' }];
|
139
|
+
if (markup.length === 1 && typeof markup[0] === 'string')
|
140
|
+
return iteration === 0 ? [{ children: [{ text: markup[0] }] }] : [{ text: markup[0] }];
|
141
|
+
return markup.reduce((acc, item) => [
|
142
|
+
...acc,
|
143
|
+
match(item)
|
144
|
+
.when(isMarkupString, (item) => ({ text: item }))
|
145
|
+
.when(isMarkupEntity, ({ entityID }) => ({
|
146
|
+
id: entityID,
|
147
|
+
type: BaseText.ElementType.VARIABLE,
|
148
|
+
name: entitiesMapByID[entityID]?.name ?? 'unknown',
|
149
|
+
isSlot: true,
|
150
|
+
children: [{ text: '' }],
|
151
|
+
}))
|
152
|
+
.when(isMarkupVariable, ({ variableID }) => ({
|
153
|
+
id: variableID,
|
154
|
+
type: BaseText.ElementType.VARIABLE,
|
155
|
+
name: variablesMapByID[variableID]?.name ?? 'unknown',
|
156
|
+
isSlot: false,
|
157
|
+
children: [{ text: '' }],
|
158
|
+
}))
|
159
|
+
.when(isMarkupSpan, (span) => match(span)
|
160
|
+
.when(isMarkupSpanText, ({ text: [text], attributes: { __type, ...attrs } }) => ({ ...attrs, text }))
|
161
|
+
.when(isMarkupSpanLink, ({ text, attributes: { url } }) => ({
|
162
|
+
url,
|
163
|
+
type: BaseText.ElementType.LINK,
|
164
|
+
children: markupToSlate.fromDB(text, { iteration: iteration + 1, entitiesMapByID, variablesMapByID }),
|
165
|
+
}))
|
166
|
+
.otherwise(({ text, attributes: { __type, ...attrs } = {} }) => ({
|
167
|
+
...attrs,
|
168
|
+
children: markupToSlate.fromDB(text, { iteration: iteration + 1, entitiesMapByID, variablesMapByID }),
|
169
|
+
})))
|
170
|
+
.exhaustive(),
|
171
|
+
], []);
|
172
|
+
}, (slate) => {
|
173
|
+
if (isEmptyState(slate))
|
174
|
+
return markupFactory();
|
175
|
+
return slate.reduce((acc, item) => [
|
176
|
+
...acc,
|
177
|
+
match(item)
|
178
|
+
.when((value) => !Text.isText(value) && value.type === BaseText.ElementType.LINK, (item) => {
|
179
|
+
const { url = '', children } = item;
|
180
|
+
return { text: markupToSlate.toDB(children), attributes: { __type: 'link', url } };
|
181
|
+
})
|
182
|
+
.when((value) => !Text.isText(value) && value.type === BaseText.ElementType.VARIABLE, (item) => {
|
183
|
+
const { id, name } = item;
|
184
|
+
const isSlot = item.isSlot ?? id !== name;
|
185
|
+
return isSlot ? { entityID: id } : { variableID: id };
|
186
|
+
})
|
187
|
+
.when((value) => Text.isText(value), (item) => {
|
188
|
+
const { text, color, italic, underline, fontWeight, fontFamily, strikeThrough, backgroundColor } = item;
|
189
|
+
if (!color && !italic && !underline && !fontWeight && !fontFamily && !strikeThrough && !backgroundColor) {
|
190
|
+
return text;
|
191
|
+
}
|
192
|
+
return {
|
193
|
+
text: [text],
|
194
|
+
attributes: {
|
195
|
+
__type: 'text',
|
196
|
+
...(color && { color }),
|
197
|
+
...(italic && { italic }),
|
198
|
+
...(underline && { underline }),
|
199
|
+
...(fontWeight && { fontWeight }),
|
200
|
+
...(fontFamily && { fontFamily }),
|
201
|
+
...(strikeThrough && { strikeThrough }),
|
202
|
+
...(backgroundColor && { backgroundColor }),
|
203
|
+
},
|
204
|
+
};
|
205
|
+
})
|
206
|
+
.otherwise(({ type: _, children, textAlign }) => ({
|
207
|
+
text: markupToSlate.toDB(children),
|
208
|
+
...(textAlign && { attributes: { textAlign } }),
|
209
|
+
})),
|
210
|
+
], []);
|
211
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@voiceflow/utils-designer",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.23.0",
|
4
4
|
"exports": {
|
5
5
|
".": {
|
6
6
|
"types": "./build/cjs/main.d.ts",
|
@@ -31,8 +31,9 @@
|
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
33
|
"@voiceflow/common": "8.3.0",
|
34
|
-
"@voiceflow/dtos": "1.102.
|
34
|
+
"@voiceflow/dtos": "1.102.1",
|
35
35
|
"bidirectional-adapter": "1.2.1",
|
36
|
+
"slate": "^0.103.0",
|
36
37
|
"ts-pattern": "5.0.5",
|
37
38
|
"zod": "3.22.4"
|
38
39
|
},
|
@@ -42,5 +43,5 @@
|
|
42
43
|
"volta": {
|
43
44
|
"extends": "../../package.json"
|
44
45
|
},
|
45
|
-
"gitHead": "
|
46
|
+
"gitHead": "9cae5961279d6f4b8b9fab21084a7a0ea43f0a4f"
|
46
47
|
}
|