@hubspot/ui-extensions 0.10.1 → 0.11.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.
- package/dist/{pages/home/components.d.ts → __synced__/appHomeRemoteComponents.synced.d.ts} +7 -7
- package/dist/{pages/home/components.js → __synced__/appHomeRemoteComponents.synced.js} +1 -0
- package/dist/{crm/components.d.ts → __synced__/crmRemoteComponents.synced.d.ts} +40 -41
- package/dist/__synced__/crmRemoteComponents.synced.js +15 -0
- package/dist/__synced__/experimental/types.synced.d.ts +241 -0
- package/dist/__synced__/experimental/types.synced.js +5 -0
- package/dist/__synced__/experimentalRemoteComponents.synced.d.ts +94 -0
- package/dist/__synced__/experimentalRemoteComponents.synced.js +56 -0
- package/dist/__synced__/remoteComponents.synced.d.ts +848 -0
- package/dist/__synced__/remoteComponents.synced.js +583 -0
- package/dist/__synced__/types/actions.synced.d.ts +57 -0
- package/dist/__synced__/types/actions.synced.js +1 -0
- package/dist/__synced__/types/components/accordion.synced.d.ts +48 -0
- package/dist/__synced__/types/components/accordion.synced.js +1 -0
- package/dist/__synced__/types/components/alert.synced.d.ts +24 -0
- package/dist/__synced__/types/components/alert.synced.js +1 -0
- package/dist/__synced__/types/components/app-home-header-actions.synced.d.ts +39 -0
- package/dist/__synced__/types/components/app-home-header-actions.synced.js +1 -0
- package/dist/__synced__/types/components/button-row.synced.d.ts +44 -0
- package/dist/__synced__/types/components/button-row.synced.js +1 -0
- package/dist/__synced__/types/components/button.synced.d.ts +89 -0
- package/dist/__synced__/types/components/button.synced.js +1 -0
- package/dist/__synced__/types/components/card.synced.d.ts +12 -0
- package/dist/__synced__/types/components/card.synced.js +1 -0
- package/dist/__synced__/types/components/chart.synced.d.ts +137 -0
- package/dist/__synced__/types/components/chart.synced.js +5 -0
- package/dist/__synced__/types/components/description-list.synced.d.ts +36 -0
- package/dist/__synced__/types/components/description-list.synced.js +1 -0
- package/dist/__synced__/types/components/divider.synced.d.ts +14 -0
- package/dist/__synced__/types/components/divider.synced.js +1 -0
- package/dist/__synced__/types/components/dropdown.synced.d.ts +84 -0
- package/dist/__synced__/types/components/dropdown.synced.js +1 -0
- package/dist/__synced__/types/components/empty-state.synced.d.ts +51 -0
- package/dist/__synced__/types/components/empty-state.synced.js +1 -0
- package/dist/__synced__/types/components/error-state.synced.d.ts +24 -0
- package/dist/__synced__/types/components/error-state.synced.js +1 -0
- package/dist/__synced__/types/components/form.synced.d.ts +29 -0
- package/dist/__synced__/types/components/form.synced.js +1 -0
- package/dist/__synced__/types/components/heading.synced.d.ts +19 -0
- package/dist/__synced__/types/components/heading.synced.js +1 -0
- package/dist/__synced__/types/components/icon.synced.d.ts +29 -0
- package/dist/__synced__/types/components/icon.synced.js +1 -0
- package/dist/__synced__/types/components/iframe.synced.d.ts +20 -0
- package/dist/__synced__/types/components/iframe.synced.js +1 -0
- package/dist/__synced__/types/components/illustration.synced.d.ts +53 -0
- package/dist/__synced__/types/components/illustration.synced.js +43 -0
- package/dist/__synced__/types/components/image.synced.d.ts +40 -0
- package/dist/__synced__/types/components/image.synced.js +1 -0
- package/dist/__synced__/types/components/index.synced.d.ts +38 -0
- package/dist/__synced__/types/components/index.synced.js +1 -0
- package/dist/__synced__/types/components/inputs.synced.d.ts +350 -0
- package/dist/__synced__/types/components/inputs.synced.js +1 -0
- package/dist/__synced__/types/components/layouts.synced.d.ts +172 -0
- package/dist/__synced__/types/components/layouts.synced.js +1 -0
- package/dist/__synced__/types/components/link.synced.d.ts +38 -0
- package/dist/__synced__/types/components/link.synced.js +1 -0
- package/dist/__synced__/types/components/list.synced.d.ts +18 -0
- package/dist/__synced__/types/components/list.synced.js +1 -0
- package/dist/__synced__/types/components/loading-spinner.synced.d.ts +31 -0
- package/dist/__synced__/types/components/loading-spinner.synced.js +1 -0
- package/dist/__synced__/types/components/modal.synced.d.ts +60 -0
- package/dist/__synced__/types/components/modal.synced.js +1 -0
- package/dist/__synced__/types/components/panel.synced.d.ts +73 -0
- package/dist/__synced__/types/components/panel.synced.js +1 -0
- package/dist/__synced__/types/components/progress-bar.synced.d.ts +48 -0
- package/dist/__synced__/types/components/progress-bar.synced.js +1 -0
- package/dist/__synced__/types/components/selects.synced.d.ts +130 -0
- package/dist/__synced__/types/components/selects.synced.js +1 -0
- package/dist/__synced__/types/components/statistics.synced.d.ts +56 -0
- package/dist/__synced__/types/components/statistics.synced.js +1 -0
- package/dist/__synced__/types/components/status-tag.synced.d.ts +42 -0
- package/dist/__synced__/types/components/status-tag.synced.js +1 -0
- package/dist/__synced__/types/components/step-indicator.synced.d.ts +44 -0
- package/dist/__synced__/types/components/step-indicator.synced.js +1 -0
- package/dist/__synced__/types/components/table.synced.d.ts +138 -0
- package/dist/__synced__/types/components/table.synced.js +1 -0
- package/dist/__synced__/types/components/tabs.synced.d.ts +55 -0
- package/dist/__synced__/types/components/tabs.synced.js +1 -0
- package/dist/__synced__/types/components/tag.synced.d.ts +32 -0
- package/dist/__synced__/types/components/tag.synced.js +1 -0
- package/dist/__synced__/types/components/text.synced.d.ts +93 -0
- package/dist/__synced__/types/components/text.synced.js +1 -0
- package/dist/__synced__/types/components/tile.synced.d.ts +24 -0
- package/dist/__synced__/types/components/tile.synced.js +1 -0
- package/dist/__synced__/types/components/toggle.synced.d.ts +60 -0
- package/dist/__synced__/types/components/toggle.synced.js +1 -0
- package/dist/__synced__/types/components/toggleInputs.synced.d.ts +191 -0
- package/dist/__synced__/types/components/toggleInputs.synced.js +1 -0
- package/dist/__synced__/types/components/tooltip.synced.d.ts +12 -0
- package/dist/__synced__/types/components/tooltip.synced.js +1 -0
- package/dist/__synced__/types/context.synced.d.ts +82 -0
- package/dist/__synced__/types/context.synced.js +1 -0
- package/dist/__synced__/types/crm.synced.d.ts +248 -0
- package/dist/__synced__/types/crm.synced.js +1 -0
- package/dist/__synced__/types/extension-points.synced.d.ts +122 -0
- package/dist/__synced__/types/extension-points.synced.js +9 -0
- package/dist/__synced__/types/http-requests.synced.d.ts +106 -0
- package/dist/__synced__/types/http-requests.synced.js +8 -0
- package/dist/__synced__/types/index.synced.d.ts +8 -0
- package/dist/__synced__/types/index.synced.js +9 -0
- package/dist/__synced__/types/reactions.synced.d.ts +12 -0
- package/dist/__synced__/types/reactions.synced.js +1 -0
- package/dist/__synced__/types/shared.synced.d.ts +197 -0
- package/dist/__synced__/types/shared.synced.js +179 -0
- package/dist/coreComponents.d.ts +9 -5
- package/dist/coreComponents.js +15 -1
- package/dist/crm/index.d.ts +2 -2
- package/dist/crm/index.js +1 -2
- package/dist/experimental/index.d.ts +2 -73
- package/dist/experimental/index.js +1 -34
- package/dist/experimental/testing/internal/types-internal.d.ts +47 -0
- package/dist/experimental/testing/internal/types-internal.js +1 -0
- package/dist/experimental/testing/type-utils.d.ts +29 -0
- package/dist/experimental/testing/type-utils.js +37 -0
- package/dist/experimental/testing/types.d.ts +240 -0
- package/dist/experimental/testing/types.js +10 -0
- package/dist/experimental/types.d.ts +4 -0
- package/dist/pages/home/index.d.ts +1 -0
- package/dist/pages/home/index.js +1 -0
- package/dist/types.d.ts +51 -4
- package/dist/types.js +0 -3
- package/package.json +4 -7
- package/dist/crm/components.js +0 -15
- package/dist/experimental/testing/index.d.ts +0 -14
- package/dist/experimental/testing/index.js +0 -33
- package/dist/experimental/testing/jest/matchers/index.d.ts +0 -6
- package/dist/experimental/testing/jest/matchers/index.js +0 -6
- package/dist/utils/createExtensionComponent.d.ts +0 -3
- package/dist/utils/createExtensionComponent.js +0 -4
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* The props type for {@link !components.Checkbox}.
|
|
4
|
+
*
|
|
5
|
+
* @category Component Props
|
|
6
|
+
*/
|
|
7
|
+
export interface CheckboxProps {
|
|
8
|
+
/**
|
|
9
|
+
* A string representing the value of the input. This is not displayed on the client-side,
|
|
10
|
+
* but on the server this is the value given to the data submitted with the checkbox's name.
|
|
11
|
+
*/
|
|
12
|
+
value?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The current status of the input.
|
|
15
|
+
*/
|
|
16
|
+
checked?: boolean;
|
|
17
|
+
/** @deprecated use readOnly instead */
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When set to `true`, the option cannot be selected.
|
|
21
|
+
*/
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The string that displays below the toggle.
|
|
25
|
+
*/
|
|
26
|
+
description?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The unique identifier for the checkbox element.
|
|
29
|
+
*/
|
|
30
|
+
name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The size variation of the checkbox.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue `"default"`
|
|
35
|
+
*/
|
|
36
|
+
variant?: 'default' | 'small';
|
|
37
|
+
/**
|
|
38
|
+
* A function that is called when the `checked` input status changes.
|
|
39
|
+
*
|
|
40
|
+
* @event
|
|
41
|
+
*/
|
|
42
|
+
onChange?: (checked: boolean, value: string) => void;
|
|
43
|
+
/** The text that displays in the dropdown menu. */
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Use the inline prop to arrange checkboxes side-by-side.
|
|
47
|
+
*/
|
|
48
|
+
inline?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* When set to `true`, the option will be selected by default. Use it to
|
|
51
|
+
* set the default `checked` state when the component is **uncontrolled**.
|
|
52
|
+
*/
|
|
53
|
+
initialIsChecked?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Accessibility label. It should be present when the checkbox has no label(children).
|
|
56
|
+
*/
|
|
57
|
+
'aria-label'?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The props type for {@link !components.RadioButton}.
|
|
61
|
+
* @category Component Props
|
|
62
|
+
* @interface
|
|
63
|
+
*/
|
|
64
|
+
export type RadioButtonProps = Omit<CheckboxProps, 'aria-label'>;
|
|
65
|
+
export type ToggleGroupOption = {
|
|
66
|
+
/** The text that displays in the dropdown menu. */
|
|
67
|
+
label: string;
|
|
68
|
+
/** The unique value that is submitted with the form. */
|
|
69
|
+
value: string;
|
|
70
|
+
/** When set to `true`, the option will be selected by default. */
|
|
71
|
+
initialIsChecked?: boolean;
|
|
72
|
+
/** When set to `true`, the option cannot be selected. */
|
|
73
|
+
readonly?: boolean;
|
|
74
|
+
/** The string that displays below the toggle. */
|
|
75
|
+
description?: string;
|
|
76
|
+
};
|
|
77
|
+
interface ToggleGroupListBaseProps {
|
|
78
|
+
name: ToggleGroupProps['name'];
|
|
79
|
+
options: ToggleGroupProps['options'];
|
|
80
|
+
variant: ToggleGroupProps['variant'];
|
|
81
|
+
inline?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface CheckboxListProps extends ToggleGroupListBaseProps {
|
|
84
|
+
value?: CheckboxGroupProps['value'];
|
|
85
|
+
onChange?: CheckboxGroupProps['onChange'];
|
|
86
|
+
}
|
|
87
|
+
export interface RadioButtonListProps extends ToggleGroupListBaseProps {
|
|
88
|
+
value?: RadioButtonGroupProps['value'];
|
|
89
|
+
onChange?: RadioButtonGroupProps['onChange'];
|
|
90
|
+
}
|
|
91
|
+
type ToggleType = 'checkboxList' | 'radioButtonList';
|
|
92
|
+
export interface CommonGroupProps {
|
|
93
|
+
/**
|
|
94
|
+
* Denotes the type of list to render.
|
|
95
|
+
*/
|
|
96
|
+
toggleType?: ToggleType;
|
|
97
|
+
/**
|
|
98
|
+
* The unique identifier for the toggle group element.
|
|
99
|
+
*/
|
|
100
|
+
name: string;
|
|
101
|
+
/**
|
|
102
|
+
* The label that displays above the toggle group.
|
|
103
|
+
*/
|
|
104
|
+
label: string;
|
|
105
|
+
/**
|
|
106
|
+
* The text to display if the input has an error.
|
|
107
|
+
*/
|
|
108
|
+
validationMessage?: string;
|
|
109
|
+
/**
|
|
110
|
+
* When set to `true`, displays a required indicator next to the toggle group.
|
|
111
|
+
*
|
|
112
|
+
* @defaultValue `false`
|
|
113
|
+
*/
|
|
114
|
+
required?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Text that will appear in a tooltip next to the toggle group label.
|
|
117
|
+
*/
|
|
118
|
+
tooltip?: string;
|
|
119
|
+
/**
|
|
120
|
+
* When set to `true`, `validationMessage` is displayed as an error message if provided. The input will also render its error state to let the user know there is an error. If left false, `validationMessage` is displayed as a success message.
|
|
121
|
+
*
|
|
122
|
+
* @defaultValue `false`
|
|
123
|
+
*/
|
|
124
|
+
error?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* An array of options to display in the dropdown menu.
|
|
127
|
+
*
|
|
128
|
+
* @defaultValue `[]`
|
|
129
|
+
*/
|
|
130
|
+
options: Array<ToggleGroupOption>;
|
|
131
|
+
/**
|
|
132
|
+
* When set to `true`, stacks the options horizontally.
|
|
133
|
+
*
|
|
134
|
+
* @defaultValue `false`
|
|
135
|
+
*/
|
|
136
|
+
inline?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* The size variation of the individual options.
|
|
139
|
+
*
|
|
140
|
+
* @defaultValue `"default"`
|
|
141
|
+
*/
|
|
142
|
+
variant?: 'default' | 'small';
|
|
143
|
+
value?: string[] | string;
|
|
144
|
+
}
|
|
145
|
+
type CheckboxGroupProps = {
|
|
146
|
+
/**
|
|
147
|
+
* Denotes the type of list to render.
|
|
148
|
+
*
|
|
149
|
+
* @defaultValue `"checkboxList"`
|
|
150
|
+
*/
|
|
151
|
+
toggleType: 'checkboxList';
|
|
152
|
+
/**
|
|
153
|
+
* A function that is called with the new value or values when the list is updated.
|
|
154
|
+
*
|
|
155
|
+
* @event
|
|
156
|
+
*/
|
|
157
|
+
onChange?: (value: string[]) => void;
|
|
158
|
+
/**
|
|
159
|
+
* The value of the toggle group.
|
|
160
|
+
*/
|
|
161
|
+
value?: string[];
|
|
162
|
+
} & CommonGroupProps;
|
|
163
|
+
type RadioButtonGroupProps = {
|
|
164
|
+
/**
|
|
165
|
+
* Denotes the type of list to render.
|
|
166
|
+
*
|
|
167
|
+
* @defaultValue `"checkboxList"`
|
|
168
|
+
*/
|
|
169
|
+
toggleType: 'radioButtonList';
|
|
170
|
+
/**
|
|
171
|
+
* A function that is called with the new value or values when the list is updated.
|
|
172
|
+
*
|
|
173
|
+
* @event
|
|
174
|
+
*/
|
|
175
|
+
onChange?: (value: string) => void;
|
|
176
|
+
/**
|
|
177
|
+
* The value of the toggle group.
|
|
178
|
+
*/
|
|
179
|
+
value?: string;
|
|
180
|
+
} & CommonGroupProps;
|
|
181
|
+
type DefaultToggleTypeProps = {
|
|
182
|
+
toggleType?: never;
|
|
183
|
+
} & CheckboxGroupProps;
|
|
184
|
+
/**
|
|
185
|
+
* The props type for {@link !components.ToggleGroup}.
|
|
186
|
+
*
|
|
187
|
+
* @interface
|
|
188
|
+
* @category Component Props
|
|
189
|
+
*/
|
|
190
|
+
export type ToggleGroupProps = CheckboxGroupProps | RadioButtonGroupProps | DefaultToggleTypeProps;
|
|
191
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
/**
|
|
4
|
+
* Sets the content to render on the screen, and serves as the trigger for the tooltip. This prop is passed implicitly by providing sub-components.
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Sets the position of the tooltip relative to its trigger element.
|
|
9
|
+
* @default 'top'
|
|
10
|
+
*/
|
|
11
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ExtensionPoints } from './extension-points.synced';
|
|
2
|
+
/** @ignore */
|
|
3
|
+
interface Team {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
teammates: number[];
|
|
7
|
+
}
|
|
8
|
+
/** @ignore */
|
|
9
|
+
export type Permission = 'integrations-management-write';
|
|
10
|
+
/** @ignore */
|
|
11
|
+
export interface UserContext {
|
|
12
|
+
id: number;
|
|
13
|
+
emails: string[];
|
|
14
|
+
email: string;
|
|
15
|
+
firstName: string;
|
|
16
|
+
lastName: string;
|
|
17
|
+
/** @deprecated Roles will always be empty. Please use teams instead */
|
|
18
|
+
roles: string[];
|
|
19
|
+
teams: Team[];
|
|
20
|
+
locale?: string;
|
|
21
|
+
permissions: Permission[];
|
|
22
|
+
}
|
|
23
|
+
/** @ignore */
|
|
24
|
+
export interface PortalContext {
|
|
25
|
+
id: number;
|
|
26
|
+
timezone: string;
|
|
27
|
+
}
|
|
28
|
+
/** @ignore */
|
|
29
|
+
export interface CrmRecordContext {
|
|
30
|
+
objectId: number;
|
|
31
|
+
objectTypeId: string;
|
|
32
|
+
}
|
|
33
|
+
/** @ignore */
|
|
34
|
+
export interface AppContext {
|
|
35
|
+
appId: number | string;
|
|
36
|
+
appName?: string;
|
|
37
|
+
cardTitle?: string;
|
|
38
|
+
}
|
|
39
|
+
type ProfileVariableValue = string | number | bigint | boolean;
|
|
40
|
+
/** @ignore */
|
|
41
|
+
export interface BaseContext {
|
|
42
|
+
user: UserContext;
|
|
43
|
+
portal: PortalContext;
|
|
44
|
+
variables?: Record<string, ProfileVariableValue>;
|
|
45
|
+
}
|
|
46
|
+
/** @ignore */
|
|
47
|
+
export interface CrmContext extends BaseContext {
|
|
48
|
+
location: 'crm.record.tab' | 'crm.record.sidebar' | 'crm.preview' | 'helpdesk.sidebar';
|
|
49
|
+
crm: CrmRecordContext;
|
|
50
|
+
extension?: AppContext;
|
|
51
|
+
}
|
|
52
|
+
/** @ignore */
|
|
53
|
+
export interface SettingsContext extends BaseContext {
|
|
54
|
+
location: 'settings';
|
|
55
|
+
}
|
|
56
|
+
/** @ignore */
|
|
57
|
+
export interface AppHomeContext extends BaseContext {
|
|
58
|
+
location: 'home';
|
|
59
|
+
}
|
|
60
|
+
/** @ignore */
|
|
61
|
+
export interface GenericContext extends BaseContext {
|
|
62
|
+
location: 'uie.playground.middle';
|
|
63
|
+
}
|
|
64
|
+
/** @ignore */
|
|
65
|
+
export interface BaseExtensionContextData {
|
|
66
|
+
appId: number | string;
|
|
67
|
+
appName?: string;
|
|
68
|
+
cardId: string;
|
|
69
|
+
cardTitle?: string;
|
|
70
|
+
location: keyof ExtensionPoints;
|
|
71
|
+
sourceId?: string | null;
|
|
72
|
+
appAccessLevel: 'PUBLIC' | 'PRIVATE';
|
|
73
|
+
additionalProperties?: {
|
|
74
|
+
[key: string]: string;
|
|
75
|
+
} | null;
|
|
76
|
+
}
|
|
77
|
+
/** @ignore */
|
|
78
|
+
export interface CrmExtensionContextData extends BaseExtensionContextData {
|
|
79
|
+
objectId: number | string;
|
|
80
|
+
objectTypeId: string;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TShirtSizes } from './shared.synced';
|
|
3
|
+
/** @ignore */
|
|
4
|
+
export interface CrmDataHighlightProps {
|
|
5
|
+
properties: Array<string>;
|
|
6
|
+
objectTypeId?: string;
|
|
7
|
+
objectId?: number;
|
|
8
|
+
}
|
|
9
|
+
/** @ignore */
|
|
10
|
+
export interface CrmReportProps {
|
|
11
|
+
reportId: string;
|
|
12
|
+
use?: 'associations' | 'subject' | 'unfiltered';
|
|
13
|
+
}
|
|
14
|
+
/** @ignore */
|
|
15
|
+
export interface CrmPropertyListProps {
|
|
16
|
+
properties: Array<string>;
|
|
17
|
+
direction?: string;
|
|
18
|
+
objectTypeId?: string;
|
|
19
|
+
objectId?: number;
|
|
20
|
+
}
|
|
21
|
+
/** @ignore */
|
|
22
|
+
type CrmSortDescriptor = {
|
|
23
|
+
columnName: string;
|
|
24
|
+
direction: 1 | -1;
|
|
25
|
+
};
|
|
26
|
+
/** @ignore */
|
|
27
|
+
interface CrmSearchFilter {
|
|
28
|
+
operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY';
|
|
29
|
+
value?: string | number;
|
|
30
|
+
values?: string | number;
|
|
31
|
+
highValue?: string | number;
|
|
32
|
+
property: string;
|
|
33
|
+
}
|
|
34
|
+
/** @ignore */
|
|
35
|
+
export interface CrmAssociationTableProps {
|
|
36
|
+
objectTypeId: string;
|
|
37
|
+
propertyColumns: Array<string>;
|
|
38
|
+
quickFilterProperties?: Array<string>;
|
|
39
|
+
searchable?: boolean;
|
|
40
|
+
pagination?: boolean;
|
|
41
|
+
associationLabelFilter?: boolean;
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
preFilters?: Array<CrmSearchFilter>;
|
|
44
|
+
sort?: Array<CrmSortDescriptor>;
|
|
45
|
+
}
|
|
46
|
+
/** @ignore */
|
|
47
|
+
export interface CrmAssociationPivotProps {
|
|
48
|
+
objectTypeId: string;
|
|
49
|
+
associationLabels?: Array<string>;
|
|
50
|
+
maxAssociations?: number;
|
|
51
|
+
preFilters?: Array<CrmSearchFilter>;
|
|
52
|
+
sort?: Array<CrmSortDescriptor>;
|
|
53
|
+
}
|
|
54
|
+
/** @ignore */
|
|
55
|
+
export interface CrmAssociationStageTrackerProps {
|
|
56
|
+
objectTypeId: string;
|
|
57
|
+
properties: Array<string>;
|
|
58
|
+
associationLabels?: Array<string>;
|
|
59
|
+
filters?: Array<CrmSearchFilter>;
|
|
60
|
+
showProperties?: boolean;
|
|
61
|
+
sort?: Array<CrmSortDescriptor>;
|
|
62
|
+
}
|
|
63
|
+
/** @ignore */
|
|
64
|
+
export interface CrmSimpleDeadlineProps {
|
|
65
|
+
endDatePropertyName: string;
|
|
66
|
+
properties: Array<string>;
|
|
67
|
+
progressTheme?: ProgressTheme;
|
|
68
|
+
showProperties?: boolean;
|
|
69
|
+
startDatePropertyName: string;
|
|
70
|
+
}
|
|
71
|
+
/** @ignore */
|
|
72
|
+
export interface CrmRelativeTimelineProps {
|
|
73
|
+
properties: Array<string>;
|
|
74
|
+
}
|
|
75
|
+
/** @ignore */
|
|
76
|
+
interface BaseCrmStatisticItem {
|
|
77
|
+
label: string;
|
|
78
|
+
}
|
|
79
|
+
/** @ignore */
|
|
80
|
+
interface FilterGroup {
|
|
81
|
+
filters: Array<CrmSearchFilter>;
|
|
82
|
+
}
|
|
83
|
+
/** @ignore */
|
|
84
|
+
interface ProgressTheme {
|
|
85
|
+
backgroundColor?: string;
|
|
86
|
+
completedColor?: string;
|
|
87
|
+
upcomingColor?: string;
|
|
88
|
+
borderRadius?: string | number;
|
|
89
|
+
height?: string | number;
|
|
90
|
+
completedGradient?: Gradient;
|
|
91
|
+
upcomingGradient?: Gradient;
|
|
92
|
+
}
|
|
93
|
+
/** @ignore */
|
|
94
|
+
interface PercentileMetricItem extends BaseCrmStatisticItem {
|
|
95
|
+
statisticType: 'PERCENTILES';
|
|
96
|
+
propertyName: string;
|
|
97
|
+
percentile: number;
|
|
98
|
+
filterGroups?: Array<FilterGroup>;
|
|
99
|
+
}
|
|
100
|
+
/** @ignore */
|
|
101
|
+
type CrmStatisticItem = BasicMetricItem | PercentileMetricItem;
|
|
102
|
+
/** @ignore */
|
|
103
|
+
export interface CrmStatisticsProps {
|
|
104
|
+
objectTypeId: string;
|
|
105
|
+
statistics: Array<CrmStatisticItem>;
|
|
106
|
+
}
|
|
107
|
+
/** @ignore */
|
|
108
|
+
interface BasicMetricItem extends BaseCrmStatisticItem {
|
|
109
|
+
statisticType: 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'DISTINCT_APPROX' | 'COUNT';
|
|
110
|
+
propertyName: string;
|
|
111
|
+
filterGroups?: Array<FilterGroup>;
|
|
112
|
+
}
|
|
113
|
+
/** @ignore */
|
|
114
|
+
interface Gradient {
|
|
115
|
+
startColor: string;
|
|
116
|
+
endColor: string;
|
|
117
|
+
}
|
|
118
|
+
/** @ignore */
|
|
119
|
+
export interface CrmStageTrackerProps {
|
|
120
|
+
objectId?: number;
|
|
121
|
+
objectTypeId?: string;
|
|
122
|
+
properties: Array<string>;
|
|
123
|
+
showProperties?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/** @ignore */
|
|
126
|
+
export interface CrmAssociationPropertyListProps {
|
|
127
|
+
objectTypeId: string;
|
|
128
|
+
properties: Array<string>;
|
|
129
|
+
associationLabels?: Array<string>;
|
|
130
|
+
filters?: Array<CrmSearchFilter>;
|
|
131
|
+
sort?: Array<CrmSortDescriptor>;
|
|
132
|
+
}
|
|
133
|
+
/** @ignore */
|
|
134
|
+
interface ObjectCoordinates {
|
|
135
|
+
objectTypeId: string;
|
|
136
|
+
objectId: number;
|
|
137
|
+
}
|
|
138
|
+
/** @ignore */
|
|
139
|
+
interface OpenRecordAssociationFormArgs {
|
|
140
|
+
objectTypeId: string;
|
|
141
|
+
association: {
|
|
142
|
+
objectTypeId: string;
|
|
143
|
+
objectId: number;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/** @ignore */
|
|
147
|
+
interface ActivityCreatorActionArgs {
|
|
148
|
+
objectTypeId: string;
|
|
149
|
+
objectId: number;
|
|
150
|
+
windowVariant?: 'windowed' | 'fullscreen';
|
|
151
|
+
initialEmailBody?: string;
|
|
152
|
+
initialEmailSubject?: string;
|
|
153
|
+
}
|
|
154
|
+
/** @ignore */
|
|
155
|
+
interface EngagementAppLinkArgs {
|
|
156
|
+
objectId: number | string;
|
|
157
|
+
objectTypeId: string;
|
|
158
|
+
engagementId: number | string;
|
|
159
|
+
external?: boolean;
|
|
160
|
+
}
|
|
161
|
+
/** @ignore */
|
|
162
|
+
interface RecordAppLinkArgs {
|
|
163
|
+
includeEschref?: boolean;
|
|
164
|
+
objectId: number;
|
|
165
|
+
objectTypeId: string;
|
|
166
|
+
external?: boolean;
|
|
167
|
+
}
|
|
168
|
+
/** @ignore */
|
|
169
|
+
interface PageAppLinkArgs {
|
|
170
|
+
path: string;
|
|
171
|
+
external?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/** @ignore */
|
|
174
|
+
interface ExternalUrlArgs {
|
|
175
|
+
href: string;
|
|
176
|
+
}
|
|
177
|
+
/** @ignore */
|
|
178
|
+
interface OpenRecordCreatorFormArgs {
|
|
179
|
+
objectTypeId: string;
|
|
180
|
+
}
|
|
181
|
+
/** @ignore */
|
|
182
|
+
interface ActionArgs {
|
|
183
|
+
PREVIEW_OBJECT: ObjectCoordinates;
|
|
184
|
+
ADD_NOTE: ActivityCreatorActionArgs;
|
|
185
|
+
ADD_TASK: ActivityCreatorActionArgs;
|
|
186
|
+
SEND_EMAIL: ActivityCreatorActionArgs;
|
|
187
|
+
SCHEDULE_MEETING: ActivityCreatorActionArgs;
|
|
188
|
+
OPEN_RECORD_CREATOR_FORM: OpenRecordCreatorFormArgs;
|
|
189
|
+
OPEN_RECORD_ASSOCIATION_FORM: OpenRecordAssociationFormArgs;
|
|
190
|
+
ENGAGEMENT_APP_LINK: EngagementAppLinkArgs;
|
|
191
|
+
RECORD_APP_LINK: RecordAppLinkArgs;
|
|
192
|
+
PAGE_APP_LINK: PageAppLinkArgs;
|
|
193
|
+
EXTERNAL_URL: ExternalUrlArgs;
|
|
194
|
+
OPEN_WORKFLOW_ENROLLMENT_MODAL: ObjectCoordinates;
|
|
195
|
+
}
|
|
196
|
+
/** @ignore */
|
|
197
|
+
export type ArgsFor<SpecificActionType extends ActionType> = ActionArgs[SpecificActionType];
|
|
198
|
+
export type ActionType = 'PREVIEW_OBJECT' | 'ADD_NOTE' | 'ADD_TASK' | 'SEND_EMAIL' | 'SCHEDULE_MEETING' | 'OPEN_RECORD_CREATOR_FORM' | 'OPEN_RECORD_ASSOCIATION_FORM' | 'ENGAGEMENT_APP_LINK' | 'RECORD_APP_LINK' | 'PAGE_APP_LINK' | 'EXTERNAL_URL' | 'OPEN_WORKFLOW_ENROLLMENT_MODAL';
|
|
199
|
+
/** @ignore */
|
|
200
|
+
interface BaseActionComponent {
|
|
201
|
+
children: ReactNode;
|
|
202
|
+
actionType: ActionType;
|
|
203
|
+
actionContext: ArgsFor<ActionType>;
|
|
204
|
+
onError?: (errors: string[]) => void;
|
|
205
|
+
}
|
|
206
|
+
/** @ignore */
|
|
207
|
+
export interface CrmActionButtonProps extends BaseActionComponent {
|
|
208
|
+
variant?: 'primary' | 'secondary' | 'destructive';
|
|
209
|
+
type?: 'button' | 'reset' | 'submit';
|
|
210
|
+
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
211
|
+
onClick?: () => void;
|
|
212
|
+
}
|
|
213
|
+
/** @ignore */
|
|
214
|
+
export interface CrmActionLinkProps extends BaseActionComponent {
|
|
215
|
+
variant?: 'primary' | 'light' | 'dark' | 'destructive';
|
|
216
|
+
}
|
|
217
|
+
/** @ignore */
|
|
218
|
+
export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends ActionType = ActionType> {
|
|
219
|
+
type: 'action-library-button';
|
|
220
|
+
actionType: SpecificActionType;
|
|
221
|
+
actionContext: ArgsFor<SpecificActionType>;
|
|
222
|
+
label?: string;
|
|
223
|
+
disabled?: boolean;
|
|
224
|
+
tooltipText?: string;
|
|
225
|
+
}
|
|
226
|
+
/** @ignore */
|
|
227
|
+
export type DropdownCardActionConfigOptions = [
|
|
228
|
+
ActionLibraryButtonCardActionConfig,
|
|
229
|
+
...ActionLibraryButtonCardActionConfig[]
|
|
230
|
+
];
|
|
231
|
+
/** @ignore */
|
|
232
|
+
export interface DropdownCardActionConfig {
|
|
233
|
+
type: 'dropdown';
|
|
234
|
+
options: DropdownCardActionConfigOptions;
|
|
235
|
+
label?: string;
|
|
236
|
+
disabled?: boolean;
|
|
237
|
+
tooltipText?: string;
|
|
238
|
+
}
|
|
239
|
+
/** @ignore */
|
|
240
|
+
type ErrorHandler = (errors: string[]) => void;
|
|
241
|
+
/** @ignore */
|
|
242
|
+
type CardActionConfig = ActionLibraryButtonCardActionConfig | DropdownCardActionConfig;
|
|
243
|
+
/** @ignore */
|
|
244
|
+
export type CrmCardActionsProps = {
|
|
245
|
+
actionConfigs: Array<CardActionConfig>;
|
|
246
|
+
onError?: ErrorHandler;
|
|
247
|
+
};
|
|
248
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { TypesOfReadOnlyArray } from './shared.synced';
|
|
3
|
+
import type { AppHomeContext, BaseContext, CrmContext } from './context.synced';
|
|
4
|
+
import type { AppHomeActions, CrmHostActions, SettingsActions, UiePlatformActions } from './actions.synced';
|
|
5
|
+
import type { CrmPropertyListProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmReportProps, CrmAssociationPivotProps, CrmAssociationPropertyListProps, CrmAssociationStageTrackerProps, CrmSimpleDeadlineProps, CrmRelativeTimelineProps, CrmStageTrackerProps, CrmStatisticsProps, CrmActionButtonProps, CrmActionLinkProps, CrmCardActionsProps } from './crm.synced';
|
|
6
|
+
import type { SettingsContext, GenericContext } from './context.synced';
|
|
7
|
+
import type { ServerlessFuncRunner } from './http-requests.synced';
|
|
8
|
+
/** @ignore */
|
|
9
|
+
export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
|
|
10
|
+
/** @ignore */
|
|
11
|
+
export interface ExtensionPointContract {
|
|
12
|
+
actions?: {
|
|
13
|
+
[k: string]: ExtensionPointAction;
|
|
14
|
+
} | {};
|
|
15
|
+
context: BaseContext;
|
|
16
|
+
customComponents: Record<string, ComponentType<any>>;
|
|
17
|
+
}
|
|
18
|
+
/** @ignore */
|
|
19
|
+
export interface StandardCrmExtensionPoint extends ExtensionPointContract {
|
|
20
|
+
actions: CrmHostActions & UiePlatformActions;
|
|
21
|
+
context: CrmContext;
|
|
22
|
+
customComponents: {
|
|
23
|
+
CrmPropertyList: ComponentType<CrmPropertyListProps>;
|
|
24
|
+
CrmAssociationTable: ComponentType<CrmAssociationTableProps>;
|
|
25
|
+
CrmDataHighlight: ComponentType<CrmDataHighlightProps>;
|
|
26
|
+
CrmReport: ComponentType<CrmReportProps>;
|
|
27
|
+
CrmAssociationPivot: ComponentType<CrmAssociationPivotProps>;
|
|
28
|
+
CrmAssociationPropertyList: ComponentType<CrmAssociationPropertyListProps>;
|
|
29
|
+
CrmAssociationStageTracker?: ComponentType<CrmAssociationStageTrackerProps>;
|
|
30
|
+
CrmSimpleDeadline?: ComponentType<CrmSimpleDeadlineProps>;
|
|
31
|
+
CrmRelativeTimeline?: ComponentType<CrmRelativeTimelineProps>;
|
|
32
|
+
CrmStageTracker: ComponentType<CrmStageTrackerProps>;
|
|
33
|
+
CrmStatistics?: ComponentType<CrmStatisticsProps>;
|
|
34
|
+
CrmActionButton?: ComponentType<CrmActionButtonProps>;
|
|
35
|
+
CrmActionLink?: ComponentType<CrmActionLinkProps>;
|
|
36
|
+
CrmCardActions?: ComponentType<CrmCardActionsProps>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** @deprecated this interface has been replaced by StandardCrmExtensionPoint */
|
|
40
|
+
export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
|
|
41
|
+
actions: CrmHostActions;
|
|
42
|
+
context: CrmContext;
|
|
43
|
+
customComponents: {
|
|
44
|
+
CrmPropertyList: ComponentType<CrmPropertyListProps>;
|
|
45
|
+
CrmAssociationTable: ComponentType<CrmAssociationTableProps>;
|
|
46
|
+
CrmDataHighlight: ComponentType<CrmDataHighlightProps>;
|
|
47
|
+
CrmReport: ComponentType<CrmReportProps>;
|
|
48
|
+
CrmAssociationPivot: ComponentType<CrmAssociationPivotProps>;
|
|
49
|
+
CrmAssociationPropertyList: ComponentType<CrmAssociationPropertyListProps>;
|
|
50
|
+
CrmAssociationStageTracker?: ComponentType<CrmAssociationStageTrackerProps>;
|
|
51
|
+
CrmSimpleDeadline?: ComponentType<CrmSimpleDeadlineProps>;
|
|
52
|
+
CrmRelativeTimeline?: ComponentType<CrmRelativeTimelineProps>;
|
|
53
|
+
CrmStageTracker: ComponentType<CrmStageTrackerProps>;
|
|
54
|
+
CrmStatistics?: ComponentType<CrmStatisticsProps>;
|
|
55
|
+
CrmActionButton?: ComponentType<CrmActionButtonProps>;
|
|
56
|
+
CrmActionLink?: ComponentType<CrmActionLinkProps>;
|
|
57
|
+
CrmCardActions?: ComponentType<CrmCardActionsProps>;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** @ignore */
|
|
61
|
+
export interface CrmSidebarExtensionPoint extends ExtensionPointContract {
|
|
62
|
+
actions: CrmHostActions & UiePlatformActions;
|
|
63
|
+
context: CrmContext;
|
|
64
|
+
customComponents: {
|
|
65
|
+
CrmActionButton?: ComponentType<CrmActionButtonProps>;
|
|
66
|
+
CrmActionLink?: ComponentType<CrmActionLinkProps>;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** @ignore */
|
|
70
|
+
export interface SettingsExtensionPoint extends ExtensionPointContract {
|
|
71
|
+
actions: SettingsActions & UiePlatformActions;
|
|
72
|
+
context: SettingsContext;
|
|
73
|
+
}
|
|
74
|
+
/** @ignore */
|
|
75
|
+
export interface AppHomeExtensionPoint extends ExtensionPointContract {
|
|
76
|
+
actions: AppHomeActions & UiePlatformActions;
|
|
77
|
+
context: AppHomeContext;
|
|
78
|
+
}
|
|
79
|
+
export interface ExampleCrmComponentProps {
|
|
80
|
+
name: string;
|
|
81
|
+
size: 'sm' | 'md' | 'lg';
|
|
82
|
+
count: number;
|
|
83
|
+
}
|
|
84
|
+
/** @ignore */
|
|
85
|
+
interface RemotePlaygroundExtensionPoint extends ExtensionPointContract {
|
|
86
|
+
actions: {
|
|
87
|
+
warn: () => void;
|
|
88
|
+
};
|
|
89
|
+
context: GenericContext;
|
|
90
|
+
customComponents: {
|
|
91
|
+
ExampleCrmComponent: ComponentType<ExampleCrmComponentProps>;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export declare const EXTENSION_POINT_LOCATIONS: readonly ["crm.preview", "crm.record.sidebar", "crm.record.tab", "helpdesk.sidebar", "uie.playground.middle", "settings", "home"];
|
|
95
|
+
export type ExtensionPointLocation = TypesOfReadOnlyArray<typeof EXTENSION_POINT_LOCATIONS>;
|
|
96
|
+
/** @ignore */
|
|
97
|
+
interface LocationToExtensionPoint {
|
|
98
|
+
'uie.playground.middle': RemotePlaygroundExtensionPoint;
|
|
99
|
+
'crm.record.tab': StandardCrmExtensionPoint;
|
|
100
|
+
'crm.preview': StandardCrmExtensionPoint;
|
|
101
|
+
'crm.record.sidebar': CrmSidebarExtensionPoint;
|
|
102
|
+
'helpdesk.sidebar': StandardCrmExtensionPoint;
|
|
103
|
+
settings: SettingsExtensionPoint;
|
|
104
|
+
home: AppHomeExtensionPoint;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* While this resolves to the same result as LocationToExtensionPoint, it ensures that every location
|
|
108
|
+
* from ExtensionPointLocation is explicitly included. This way, EXTENSION_POINT_LOCATIONS becomes
|
|
109
|
+
* the single source of truth for defining all locations.
|
|
110
|
+
*/
|
|
111
|
+
type _ExtensionPoints = {
|
|
112
|
+
[key in ExtensionPointLocation]: LocationToExtensionPoint[key];
|
|
113
|
+
};
|
|
114
|
+
export interface ExtensionPoints extends _ExtensionPoints {
|
|
115
|
+
}
|
|
116
|
+
/** @ignore */
|
|
117
|
+
export interface ExtensionPointApi<ExtensionPointName extends keyof ExtensionPoints> {
|
|
118
|
+
runServerlessFunction: ServerlessFuncRunner;
|
|
119
|
+
actions: ExtensionPoints[ExtensionPointName]['actions'];
|
|
120
|
+
context: ExtensionPoints[ExtensionPointName]['context'];
|
|
121
|
+
}
|
|
122
|
+
export {};
|