stentor-models 1.59.86 → 1.59.89
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/Display/MultistepForm.d.ts +20 -0
- package/lib/Display/MultistepForm.js +3 -0
- package/lib/Display/MultistepForm.js.map +1 -0
- package/lib/Display/Types.d.ts +2 -1
- package/lib/Display/index.d.ts +1 -0
- package/lib/Display/index.js +1 -0
- package/lib/Display/index.js.map +1 -1
- package/lib/Form/FormField.d.ts +158 -0
- package/lib/Form/FormField.js +4 -0
- package/lib/Form/FormField.js.map +1 -0
- package/lib/Form/FormStep.d.ts +18 -0
- package/lib/Form/FormStep.js +4 -0
- package/lib/Form/FormStep.js.map +1 -0
- package/lib/Form/index.d.ts +3 -0
- package/lib/Form/index.js +20 -0
- package/lib/Form/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
2
|
+
import { FormStep } from "../Form";
|
|
3
|
+
import { BaseDisplay } from "./Types";
|
|
4
|
+
/**
|
|
5
|
+
* This is for the top header. The "step" is the name of the step the click should take to.
|
|
6
|
+
*/
|
|
7
|
+
export interface FormHeaderItem {
|
|
8
|
+
label: string;
|
|
9
|
+
step: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* FORM Display type
|
|
13
|
+
*/
|
|
14
|
+
export interface MultistepForm extends BaseDisplay {
|
|
15
|
+
type: "FORM";
|
|
16
|
+
name: string;
|
|
17
|
+
header: FormHeaderItem[];
|
|
18
|
+
labelHeader: boolean;
|
|
19
|
+
steps: FormStep[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultistepForm.js","sourceRoot":"","sources":["../../src/Display/MultistepForm.ts"],"names":[],"mappings":""}
|
package/lib/Display/Types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
2
|
import { Card } from "./Card";
|
|
3
3
|
import { List } from "./List";
|
|
4
|
+
import { MultistepForm } from "./MultistepForm";
|
|
4
5
|
import { SimpleDisplay } from "./SimpleDisplay";
|
|
5
6
|
export interface BaseDisplay {
|
|
6
7
|
type: string;
|
|
7
8
|
token?: string;
|
|
8
9
|
title?: string;
|
|
9
10
|
}
|
|
10
|
-
export type Display = Card | List | SimpleDisplay | object;
|
|
11
|
+
export type Display = Card | List | SimpleDisplay | MultistepForm | object;
|
package/lib/Display/index.d.ts
CHANGED
package/lib/Display/index.js
CHANGED
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
__exportStar(require("./Card"), exports);
|
|
19
19
|
__exportStar(require("./Image"), exports);
|
|
20
20
|
__exportStar(require("./List"), exports);
|
|
21
|
+
__exportStar(require("./MultistepForm"), exports);
|
|
21
22
|
__exportStar(require("./SimpleDisplay"), exports);
|
|
22
23
|
__exportStar(require("./TextContent"), exports);
|
|
23
24
|
__exportStar(require("./Types"), exports);
|
package/lib/Display/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Display/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,yCAAuB;AACvB,0CAAwB;AACxB,yCAAuB;AACvB,kDAAgC;AAChC,gDAA8B;AAC9B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Display/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,yCAAuB;AACvB,0CAAwB;AACxB,yCAAuB;AACvB,kDAAgC;AAChC,kDAAgC;AAChC,gDAA8B;AAC9B,0CAAwB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
2
|
+
export interface AddressAutocompleteParameters {
|
|
3
|
+
/**
|
|
4
|
+
* This will look like components=country:us or components=country:us|country:ca
|
|
5
|
+
*
|
|
6
|
+
* @see https://developers.google.com/maps/documentation/places/web-service/autocomplete#components
|
|
7
|
+
*/
|
|
8
|
+
components?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The text string on which to search. The Places service will return candidate matches based on this string and order results based on their perceived relevance.
|
|
11
|
+
*/
|
|
12
|
+
language?: string;
|
|
13
|
+
/**
|
|
14
|
+
* A text that is the lat & long of the location to use as the center of the search.
|
|
15
|
+
*
|
|
16
|
+
* For example, location=37.76999,-122.44696
|
|
17
|
+
*/
|
|
18
|
+
location?: string;
|
|
19
|
+
locationbias?: string;
|
|
20
|
+
locationrestriction?: string;
|
|
21
|
+
/**
|
|
22
|
+
* When using location with a specific lat & long, this must be provided.
|
|
23
|
+
*
|
|
24
|
+
* This is in meters
|
|
25
|
+
*/
|
|
26
|
+
radius?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The API key, only required when using the official Google Maps API.
|
|
29
|
+
*/
|
|
30
|
+
key?: string;
|
|
31
|
+
}
|
|
32
|
+
export type FormField = FormCardInput | FormTextInput | FormDropdownInput | FormChipsInput | FormDateInput | FormDateRangeInput;
|
|
33
|
+
/**
|
|
34
|
+
* Form field base class
|
|
35
|
+
*/
|
|
36
|
+
export interface FormInput {
|
|
37
|
+
/**
|
|
38
|
+
* Name of the form input, this is not human readable and is used to identify the field.
|
|
39
|
+
*
|
|
40
|
+
* For example: "SERVICE" or "FULL_NAME"
|
|
41
|
+
*/
|
|
42
|
+
name: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional title used to display on the input
|
|
45
|
+
*/
|
|
46
|
+
title?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Type of the input
|
|
49
|
+
*/
|
|
50
|
+
type: "TEXT" | "DROPDOWN" | "CHECK" | "CHIPS" | "DATE" | "DATERANGE" | "CARD";
|
|
51
|
+
shape?: "ROUND" | "SQUARE";
|
|
52
|
+
condition?: string;
|
|
53
|
+
mandatory?: boolean;
|
|
54
|
+
mandatoryError?: string;
|
|
55
|
+
style?: object;
|
|
56
|
+
}
|
|
57
|
+
export interface FormFieldTextAddressInput extends FormTextInput {
|
|
58
|
+
format: "ADDRESS";
|
|
59
|
+
/**
|
|
60
|
+
* Base URL of an endpoint that adheres to the Google Maps Location Autocomplete API.
|
|
61
|
+
*/
|
|
62
|
+
mapsBaseUrl?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Optional query parameters to help limit the results returned by the Google Maps Autocomplete API.
|
|
65
|
+
*/
|
|
66
|
+
mapsUrlQueryParams?: AddressAutocompleteParameters;
|
|
67
|
+
/**
|
|
68
|
+
* Required when you are using the official Google Maps Autocomplete API.
|
|
69
|
+
*/
|
|
70
|
+
googleMapsApiKey?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Text input. Validate according to the format.
|
|
74
|
+
*/
|
|
75
|
+
export interface FormTextInput extends FormInput {
|
|
76
|
+
multiline?: boolean;
|
|
77
|
+
format?: "PHONE" | "EMAIL" | "ADDRESS";
|
|
78
|
+
placeholder?: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
rows?: number;
|
|
81
|
+
rowsMax?: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Dropdown
|
|
85
|
+
*/
|
|
86
|
+
export interface FormDropdownInput extends FormInput {
|
|
87
|
+
items: SelectableItem[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Close/Open style chips selection. Header plus open symbol reveals the chips.
|
|
91
|
+
*/
|
|
92
|
+
export interface FormChipsInput extends FormInput {
|
|
93
|
+
type: "CHIPS";
|
|
94
|
+
radio?: boolean;
|
|
95
|
+
defaultOpen?: boolean;
|
|
96
|
+
minRequired?: number;
|
|
97
|
+
maxAllowed?: number;
|
|
98
|
+
items: SelectableItem[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Like chips but with checkboxes
|
|
102
|
+
*/
|
|
103
|
+
export interface FormSelectInput extends FormInput {
|
|
104
|
+
radio?: boolean;
|
|
105
|
+
defaultOpen?: boolean;
|
|
106
|
+
items: SelectableItem[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Card (text/image)
|
|
110
|
+
*/
|
|
111
|
+
export interface FormCardInput extends FormInput {
|
|
112
|
+
header?: {
|
|
113
|
+
title: string;
|
|
114
|
+
subheader?: string;
|
|
115
|
+
};
|
|
116
|
+
media?: {
|
|
117
|
+
height?: number;
|
|
118
|
+
width?: number;
|
|
119
|
+
imageUrl: string;
|
|
120
|
+
alt?: string;
|
|
121
|
+
};
|
|
122
|
+
text?: string;
|
|
123
|
+
variant?: string;
|
|
124
|
+
color?: string;
|
|
125
|
+
align?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Single date
|
|
129
|
+
*/
|
|
130
|
+
export interface FormDateInput extends FormInput {
|
|
131
|
+
preselecteDate?: Date;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Date range
|
|
135
|
+
*/
|
|
136
|
+
export interface FormDateRangeInput extends FormInput {
|
|
137
|
+
preselecteDates?: {
|
|
138
|
+
from?: Date;
|
|
139
|
+
to?: Date;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Basically a name value pair for dropdowns or chips
|
|
144
|
+
*/
|
|
145
|
+
export interface SelectableItem {
|
|
146
|
+
/**
|
|
147
|
+
* Display label
|
|
148
|
+
*/
|
|
149
|
+
label: string;
|
|
150
|
+
/**
|
|
151
|
+
* ID of the item. This is what is sent to the server and should be a form of the label that is human readable.
|
|
152
|
+
*/
|
|
153
|
+
id: string;
|
|
154
|
+
/**
|
|
155
|
+
* Option to show the item as selected
|
|
156
|
+
*/
|
|
157
|
+
selected?: boolean;
|
|
158
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../src/Form/FormField.ts"],"names":[],"mappings":";AAAA,kCAAkC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
2
|
+
import { FormField } from "./FormField";
|
|
3
|
+
/**
|
|
4
|
+
* A step is partial form. Fields plus next/prev/submit buttons as needed.
|
|
5
|
+
* We are going through these "mini screens".
|
|
6
|
+
*/
|
|
7
|
+
export interface FormStep {
|
|
8
|
+
name: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
fields: FormField[];
|
|
11
|
+
condition?: string;
|
|
12
|
+
nextAction?: "next" | "submit" | "omit";
|
|
13
|
+
previousAction?: "previous" | "submit" | "omit";
|
|
14
|
+
nextLabel?: string;
|
|
15
|
+
previousLabel?: string;
|
|
16
|
+
final?: boolean;
|
|
17
|
+
crmSubmit?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormStep.js","sourceRoot":"","sources":["../../src/Form/FormStep.ts"],"names":[],"mappings":";AAAA,kCAAkC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Copyright (c) 2024, XAPP AI */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./FormField"), exports);
|
|
19
|
+
__exportStar(require("./FormStep"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Form/index.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;;;;;;;;;;;;;;AAElC,8CAA4B;AAC5B,6CAA2B"}
|
package/lib/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type * from "./Display";
|
|
|
14
14
|
export type * from "./Email";
|
|
15
15
|
export type * from "./Entity";
|
|
16
16
|
export type * from "./Events";
|
|
17
|
+
export type * from "./Form";
|
|
17
18
|
export type * from "./Handler";
|
|
18
19
|
export type * from "./History";
|
|
19
20
|
export type * from "./Intent";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wCAAsB;AAGtB,4CAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wCAAsB;AAGtB,4CAA0B;AA4B1B,6CAA2B;AAE3B,6CAA2B"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.59.
|
|
7
|
+
"version": "1.59.89",
|
|
8
8
|
"description": "Models for 📣 stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"typings": "lib/index",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@xapp/patterns": "2.0.2"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "3ac00dc6cb41671fea9f046e2a64cb0795dbf317"
|
|
37
37
|
}
|