@hubspot/ui-extensions 0.10.1 → 0.11.1

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.
Files changed (149) hide show
  1. package/dist/{pages/home/components.d.ts → __synced__/appHomeRemoteComponents.synced.d.ts} +7 -7
  2. package/dist/{pages/home/components.js → __synced__/appHomeRemoteComponents.synced.js} +1 -0
  3. package/dist/{crm/components.d.ts → __synced__/crmRemoteComponents.synced.d.ts} +40 -41
  4. package/dist/__synced__/crmRemoteComponents.synced.js +15 -0
  5. package/dist/{experimental/types.d.ts → __synced__/experimental/types.synced.d.ts} +6 -1
  6. package/dist/__synced__/experimentalRemoteComponents.synced.d.ts +94 -0
  7. package/dist/__synced__/experimentalRemoteComponents.synced.js +56 -0
  8. package/dist/__synced__/remoteComponents.synced.d.ts +579 -0
  9. package/dist/{coreComponents.js → __synced__/remoteComponents.synced.js} +89 -69
  10. package/dist/__synced__/types/actions.synced.d.ts +57 -0
  11. package/dist/__synced__/types/actions.synced.js +1 -0
  12. package/dist/__synced__/types/components/accordion.synced.d.ts +48 -0
  13. package/dist/__synced__/types/components/accordion.synced.js +1 -0
  14. package/dist/__synced__/types/components/alert.synced.d.ts +24 -0
  15. package/dist/__synced__/types/components/alert.synced.js +1 -0
  16. package/dist/__synced__/types/components/app-home-header-actions.synced.d.ts +39 -0
  17. package/dist/__synced__/types/components/app-home-header-actions.synced.js +1 -0
  18. package/dist/__synced__/types/components/button-row.synced.d.ts +44 -0
  19. package/dist/__synced__/types/components/button-row.synced.js +1 -0
  20. package/dist/__synced__/types/components/button.synced.d.ts +89 -0
  21. package/dist/__synced__/types/components/button.synced.js +1 -0
  22. package/dist/__synced__/types/components/card.synced.d.ts +12 -0
  23. package/dist/__synced__/types/components/card.synced.js +1 -0
  24. package/dist/__synced__/types/components/chart.synced.d.ts +137 -0
  25. package/dist/__synced__/types/components/chart.synced.js +5 -0
  26. package/dist/__synced__/types/components/description-list.synced.d.ts +36 -0
  27. package/dist/__synced__/types/components/description-list.synced.js +1 -0
  28. package/dist/__synced__/types/components/divider.synced.d.ts +14 -0
  29. package/dist/__synced__/types/components/divider.synced.js +1 -0
  30. package/dist/__synced__/types/components/dropdown.synced.d.ts +84 -0
  31. package/dist/__synced__/types/components/dropdown.synced.js +1 -0
  32. package/dist/__synced__/types/components/empty-state.synced.d.ts +51 -0
  33. package/dist/__synced__/types/components/empty-state.synced.js +1 -0
  34. package/dist/__synced__/types/components/error-state.synced.d.ts +24 -0
  35. package/dist/__synced__/types/components/error-state.synced.js +1 -0
  36. package/dist/__synced__/types/components/form.synced.d.ts +29 -0
  37. package/dist/__synced__/types/components/form.synced.js +1 -0
  38. package/dist/__synced__/types/components/heading.synced.d.ts +19 -0
  39. package/dist/__synced__/types/components/heading.synced.js +1 -0
  40. package/dist/__synced__/types/components/icon.synced.d.ts +29 -0
  41. package/dist/__synced__/types/components/icon.synced.js +1 -0
  42. package/dist/__synced__/types/components/iframe.synced.d.ts +20 -0
  43. package/dist/__synced__/types/components/iframe.synced.js +1 -0
  44. package/dist/__synced__/types/components/illustration.synced.d.ts +53 -0
  45. package/dist/__synced__/types/components/illustration.synced.js +43 -0
  46. package/dist/__synced__/types/components/image.synced.d.ts +40 -0
  47. package/dist/__synced__/types/components/image.synced.js +1 -0
  48. package/dist/__synced__/types/components/index.synced.d.ts +38 -0
  49. package/dist/__synced__/types/components/index.synced.js +1 -0
  50. package/dist/__synced__/types/components/inputs.synced.d.ts +350 -0
  51. package/dist/__synced__/types/components/inputs.synced.js +1 -0
  52. package/dist/__synced__/types/components/layouts.synced.d.ts +172 -0
  53. package/dist/__synced__/types/components/layouts.synced.js +1 -0
  54. package/dist/__synced__/types/components/link.synced.d.ts +38 -0
  55. package/dist/__synced__/types/components/link.synced.js +1 -0
  56. package/dist/__synced__/types/components/list.synced.d.ts +18 -0
  57. package/dist/__synced__/types/components/list.synced.js +1 -0
  58. package/dist/__synced__/types/components/loading-spinner.synced.d.ts +31 -0
  59. package/dist/__synced__/types/components/loading-spinner.synced.js +1 -0
  60. package/dist/__synced__/types/components/modal.synced.d.ts +60 -0
  61. package/dist/__synced__/types/components/modal.synced.js +1 -0
  62. package/dist/__synced__/types/components/panel.synced.d.ts +73 -0
  63. package/dist/__synced__/types/components/panel.synced.js +1 -0
  64. package/dist/__synced__/types/components/progress-bar.synced.d.ts +48 -0
  65. package/dist/__synced__/types/components/progress-bar.synced.js +1 -0
  66. package/dist/__synced__/types/components/selects.synced.d.ts +130 -0
  67. package/dist/__synced__/types/components/selects.synced.js +1 -0
  68. package/dist/__synced__/types/components/statistics.synced.d.ts +56 -0
  69. package/dist/__synced__/types/components/statistics.synced.js +1 -0
  70. package/dist/__synced__/types/components/status-tag.synced.d.ts +42 -0
  71. package/dist/__synced__/types/components/status-tag.synced.js +1 -0
  72. package/dist/__synced__/types/components/step-indicator.synced.d.ts +44 -0
  73. package/dist/__synced__/types/components/step-indicator.synced.js +1 -0
  74. package/dist/__synced__/types/components/table.synced.d.ts +138 -0
  75. package/dist/__synced__/types/components/table.synced.js +1 -0
  76. package/dist/__synced__/types/components/tabs.synced.d.ts +55 -0
  77. package/dist/__synced__/types/components/tabs.synced.js +1 -0
  78. package/dist/__synced__/types/components/tag.synced.d.ts +32 -0
  79. package/dist/__synced__/types/components/tag.synced.js +1 -0
  80. package/dist/__synced__/types/components/text.synced.d.ts +93 -0
  81. package/dist/__synced__/types/components/text.synced.js +1 -0
  82. package/dist/__synced__/types/components/tile.synced.d.ts +24 -0
  83. package/dist/__synced__/types/components/tile.synced.js +1 -0
  84. package/dist/__synced__/types/components/toggle.synced.d.ts +60 -0
  85. package/dist/__synced__/types/components/toggle.synced.js +1 -0
  86. package/dist/__synced__/types/components/toggleInputs.synced.d.ts +191 -0
  87. package/dist/__synced__/types/components/toggleInputs.synced.js +1 -0
  88. package/dist/__synced__/types/components/tooltip.synced.d.ts +12 -0
  89. package/dist/__synced__/types/components/tooltip.synced.js +1 -0
  90. package/dist/__synced__/types/context.synced.d.ts +82 -0
  91. package/dist/__synced__/types/context.synced.js +1 -0
  92. package/dist/__synced__/types/crm.synced.d.ts +248 -0
  93. package/dist/__synced__/types/crm.synced.js +1 -0
  94. package/dist/__synced__/types/extension-points.synced.d.ts +122 -0
  95. package/dist/__synced__/types/extension-points.synced.js +9 -0
  96. package/dist/__synced__/types/http-requests.synced.d.ts +106 -0
  97. package/dist/__synced__/types/http-requests.synced.js +8 -0
  98. package/dist/__synced__/types/index.synced.d.ts +8 -0
  99. package/dist/__synced__/types/index.synced.js +1 -0
  100. package/dist/__synced__/types/reactions.synced.d.ts +12 -0
  101. package/dist/__synced__/types/reactions.synced.js +1 -0
  102. package/dist/__synced__/types/shared.synced.d.ts +196 -0
  103. package/dist/{types.js → __synced__/types/shared.synced.js} +0 -68
  104. package/dist/__synced__/utils/remote-component-registry.synced.d.ts +80 -0
  105. package/dist/__synced__/utils/remote-component-registry.synced.js +64 -0
  106. package/dist/crm/index.d.ts +2 -2
  107. package/dist/crm/index.js +1 -2
  108. package/dist/experimental/index.d.ts +2 -73
  109. package/dist/experimental/index.js +1 -34
  110. package/dist/experimental/testing/internal/constants.d.ts +2 -0
  111. package/dist/experimental/testing/internal/constants.js +1 -0
  112. package/dist/experimental/testing/internal/debug.d.ts +8 -0
  113. package/dist/experimental/testing/internal/debug.js +10 -0
  114. package/dist/experimental/testing/internal/element.d.ts +11 -0
  115. package/dist/experimental/testing/internal/element.js +67 -0
  116. package/dist/experimental/testing/internal/errors.d.ts +44 -0
  117. package/dist/experimental/testing/internal/errors.js +52 -0
  118. package/dist/experimental/testing/internal/fragment.d.ts +8 -0
  119. package/dist/experimental/testing/internal/fragment.js +44 -0
  120. package/dist/experimental/testing/internal/print.d.ts +6 -0
  121. package/dist/experimental/testing/internal/print.js +114 -0
  122. package/dist/experimental/testing/internal/query.d.ts +57 -0
  123. package/dist/experimental/testing/internal/query.js +231 -0
  124. package/dist/experimental/testing/internal/root.d.ts +8 -0
  125. package/dist/experimental/testing/internal/root.js +44 -0
  126. package/dist/experimental/testing/internal/text.d.ts +9 -0
  127. package/dist/experimental/testing/internal/text.js +16 -0
  128. package/dist/experimental/testing/internal/types-internal.d.ts +47 -0
  129. package/dist/experimental/testing/internal/types-internal.js +1 -0
  130. package/dist/experimental/testing/type-utils.d.ts +29 -0
  131. package/dist/experimental/testing/type-utils.js +37 -0
  132. package/dist/experimental/testing/types.d.ts +240 -0
  133. package/dist/experimental/testing/types.js +10 -0
  134. package/dist/hubspot.d.ts +1 -1
  135. package/dist/index.d.ts +2 -2
  136. package/dist/index.js +2 -2
  137. package/dist/pages/home/index.d.ts +1 -0
  138. package/dist/pages/home/index.js +1 -0
  139. package/package.json +12 -10
  140. package/dist/coreComponents.d.ts +0 -844
  141. package/dist/crm/components.js +0 -15
  142. package/dist/experimental/testing/index.d.ts +0 -14
  143. package/dist/experimental/testing/index.js +0 -33
  144. package/dist/experimental/testing/jest/matchers/index.d.ts +0 -6
  145. package/dist/experimental/testing/jest/matchers/index.js +0 -6
  146. package/dist/types.d.ts +0 -3167
  147. package/dist/utils/createExtensionComponent.d.ts +0 -3
  148. package/dist/utils/createExtensionComponent.js +0 -4
  149. /package/dist/{experimental/types.js → __synced__/experimental/types.synced.js} +0 -0
@@ -0,0 +1,106 @@
1
+ import type { ExtensionPoints } from './extension-points.synced';
2
+ export interface HubSpotFetchOptions {
3
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
4
+ timeout?: number;
5
+ body?: {
6
+ [key: string]: unknown;
7
+ };
8
+ headers?: Headers | Record<string, string>;
9
+ }
10
+ export type HubSpotFetchRequestURI = string | URL;
11
+ export type ProxyMetadata = {
12
+ userEmail?: string;
13
+ userId?: number;
14
+ portalId?: number;
15
+ };
16
+ /**
17
+ * @category Serverless
18
+ */
19
+ export interface ServerlessRunnerParams {
20
+ /**
21
+ * Name of the serverless function
22
+ */
23
+ name: string;
24
+ /**
25
+ * Names of CRM object properties to be retrieved and supplied to the function as `context.propertiesToSend`
26
+ */
27
+ propertiesToSend?: string[];
28
+ /**
29
+ * Additional parameters to be supplied to the function as `context.parameters`
30
+ */
31
+ parameters?: JsonValue;
32
+ /**
33
+ * @deprecated Optional payload supplied to the function as `context.event.payload`.
34
+ * Support for this param may be removed in the future. Use `parameters` instead.
35
+ */
36
+ payload?: JsonValue;
37
+ }
38
+ /**
39
+ * @category Serverless
40
+ */
41
+ export declare enum ServerlessExecutionStatus {
42
+ Success = "SUCCESS",
43
+ Error = "ERROR"
44
+ }
45
+ /**
46
+ * @category Serverless
47
+ */
48
+ export type ServerlessExecutionResult = {
49
+ status: ServerlessExecutionStatus.Success;
50
+ response: JsonValue;
51
+ } | {
52
+ status: ServerlessExecutionStatus.Error;
53
+ message: string;
54
+ };
55
+ /**
56
+ * @category Serverless
57
+ */
58
+ export type ServerlessFuncRunner = (params: ServerlessRunnerParams) => Promise<ServerlessExecutionResult>;
59
+ /**
60
+ * @ignore
61
+ * @category Serverless
62
+ */
63
+ export interface ServerlessExecutionRequest {
64
+ appId: number;
65
+ extensibleCardId: number;
66
+ serverlessFunction: string;
67
+ location: keyof ExtensionPoints;
68
+ objectQuery?: {
69
+ objectId: number;
70
+ objectTypeId: string;
71
+ objectPropertyNames: string[];
72
+ };
73
+ parameters?: JsonValue;
74
+ event?: {
75
+ type: 'SERVERLESS_ACTION_HOOK';
76
+ payload: JsonValue;
77
+ };
78
+ objectId?: number;
79
+ objectTypeId?: string;
80
+ }
81
+ /**
82
+ * @category Serverless
83
+ */
84
+ export interface ServerlessExecutionResponse {
85
+ logId: string;
86
+ response?: JsonValue;
87
+ }
88
+ /**
89
+ * @category Serverless
90
+ */
91
+ export interface ServerlessErrorResponse {
92
+ responseJSON?: {
93
+ message: string;
94
+ correlationId: string;
95
+ category: string;
96
+ subCategory?: string;
97
+ errors?: {
98
+ message: string;
99
+ subCategory: string;
100
+ }[];
101
+ };
102
+ status: number;
103
+ }
104
+ export type JsonValue = string | number | boolean | null | JsonValue[] | {
105
+ [key: string]: JsonValue;
106
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @category Serverless
3
+ */
4
+ export var ServerlessExecutionStatus;
5
+ (function (ServerlessExecutionStatus) {
6
+ ServerlessExecutionStatus["Success"] = "SUCCESS";
7
+ ServerlessExecutionStatus["Error"] = "ERROR";
8
+ })(ServerlessExecutionStatus || (ServerlessExecutionStatus = {}));
@@ -0,0 +1,8 @@
1
+ export type * from './components/index.synced';
2
+ export type * from './actions.synced';
3
+ export type * from './context.synced';
4
+ export type * from './crm.synced';
5
+ export type * from './extension-points.synced';
6
+ export type * from './http-requests.synced';
7
+ export type * from './reactions.synced';
8
+ export * from './shared.synced';
@@ -0,0 +1 @@
1
+ export * from './shared.synced'; // NOTE: `shared.ts` has some exported classes so we can't use `export type` for now
@@ -0,0 +1,12 @@
1
+ /** @ignore */
2
+ export type PanelAction = (panelId: string) => void;
3
+ /** @ignore */
4
+ export type ModalAction = (modalId: string) => void;
5
+ /** @ignore */
6
+ export interface Reactions {
7
+ openPanel: PanelAction;
8
+ closePanel: PanelAction;
9
+ openModal: ModalAction;
10
+ closeModal: ModalAction;
11
+ }
12
+ export type ReactionsHandler<T> = (event: T, reactions: Reactions) => void | Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,196 @@
1
+ import type { ReactElement, ComponentType, ReactNode } from 'react';
2
+ export type UnknownComponentProps = Record<string, any>;
3
+ /**
4
+ * Represents a HubSpot-provided React component.
5
+ */
6
+ export type HubSpotReactComponent<TProps extends UnknownComponentProps = UnknownComponentProps> = ComponentType<TProps>;
7
+ /**
8
+ * Represents a fragment property for a HubSpot-provided React component that accepts a React.ReactElement, string, or null.
9
+ * NOTE: UI extension components do _not_ support arrays as a fragment property values.
10
+ */
11
+ export type HubSpotReactFragmentProp = ReactElement | string | null;
12
+ export declare class ExtensionEvent {
13
+ type: string;
14
+ bubbles: boolean;
15
+ timeStamp: number;
16
+ id: string;
17
+ constructor(event: Event);
18
+ }
19
+ export declare class FormSubmitExtensionEvent<V> extends ExtensionEvent {
20
+ targetValue: V;
21
+ constructor(value: V, event: Event);
22
+ }
23
+ export type OverlayComponentProps = {
24
+ overlay?: ReactNode;
25
+ };
26
+ export type HrefOptions = {
27
+ url: string;
28
+ external?: boolean;
29
+ };
30
+ export type HrefProp = string | HrefOptions;
31
+ export interface TShirtSizes {
32
+ xs: 'extra-small' | 'xs';
33
+ sm: 'small' | 'sm';
34
+ md: 'medium' | 'md';
35
+ lg: 'large' | 'lg';
36
+ xl: 'extra-large' | 'xl';
37
+ }
38
+ export type AllSizes = TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'] | TShirtSizes['xl'];
39
+ export type AllDistances = 'flush' | AllSizes;
40
+ export declare const iconNames: {
41
+ readonly success: "success";
42
+ readonly remove: "remove";
43
+ readonly add: "add";
44
+ readonly attach: "attach";
45
+ readonly date: "date";
46
+ readonly copy: "duplicate";
47
+ readonly delete: "delete";
48
+ readonly edit: "edit";
49
+ readonly email: "email";
50
+ readonly exclamation: "exclamation";
51
+ readonly question: "question";
52
+ readonly home: "home";
53
+ readonly location: "location";
54
+ readonly upCarat: "upCarat";
55
+ readonly downCarat: "downCarat";
56
+ readonly warning: "warning";
57
+ readonly shoppingCart: "cart";
58
+ readonly clock: "time";
59
+ readonly comment: "comments";
60
+ readonly contact: "contacts";
61
+ readonly star: "favorite";
62
+ readonly file: "file";
63
+ readonly reports: "reports";
64
+ readonly video: "video";
65
+ readonly robot: "simpleBot";
66
+ readonly refresh: "refresh";
67
+ readonly faceHappy: "emoji";
68
+ readonly faceNeutral: "emojiLineNeutral";
69
+ readonly faceSad: "emojiLineSad";
70
+ readonly upload: "upload";
71
+ readonly download: "download";
72
+ readonly left: "left";
73
+ readonly right: "right";
74
+ readonly dataSync: "dataSync";
75
+ readonly imageGallery: "imageGallery";
76
+ readonly search: "search";
77
+ readonly save: "saveEditableView";
78
+ readonly notification: "notification";
79
+ readonly bulb: "bulb";
80
+ readonly settings: "settings";
81
+ readonly filter: "filter";
82
+ readonly gauge: "gauge";
83
+ readonly enroll: "enroll";
84
+ readonly generateChart: "generateChart";
85
+ readonly gift: "gift";
86
+ readonly flame: "highlyEngagedLead";
87
+ readonly inbox: "inbox";
88
+ readonly image: "insertImage";
89
+ readonly quote: "insertQuote";
90
+ readonly insertVideo: "insertVideo";
91
+ readonly invoice: "invoice";
92
+ readonly key: "key";
93
+ readonly book: "knowledgeBase";
94
+ readonly globe: "language";
95
+ readonly lesson: "lesson";
96
+ readonly link: "link";
97
+ readonly listView: "listView";
98
+ readonly locked: "locked";
99
+ readonly mention: "mention";
100
+ readonly messages: "messages";
101
+ readonly mobile: "mobile";
102
+ readonly notificationOff: "notificationOff";
103
+ readonly hash: "numericDataType";
104
+ readonly objectAssociations: "objectAssociations";
105
+ readonly objectAssociationsManyToMany: "objectAssociationsManyToMany";
106
+ readonly objectAssociationsManyToOne: "objectAssociationsManyToOne";
107
+ readonly office365: "office365";
108
+ readonly order: "order";
109
+ readonly paymentSubscriptions: "paymentSubscriptions";
110
+ readonly product: "product";
111
+ readonly powerPointFile: "powerPointFile";
112
+ readonly presentation: "presentation";
113
+ readonly publish: "publish";
114
+ readonly questionAnswer: "questionAnswer";
115
+ readonly quickbooks: "quickbooks";
116
+ readonly readMore: "readMore";
117
+ readonly realEstateListing: "realEstateListing";
118
+ readonly readOnlyView: "readOnlyView";
119
+ readonly recentlySelected: "recentlySelected";
120
+ readonly record: "record";
121
+ readonly redo: "redo";
122
+ readonly undo: "undo";
123
+ readonly registration: "registration";
124
+ readonly replace: "replace";
125
+ readonly rotate: "rotate";
126
+ readonly salesQuote: "salesQuote";
127
+ readonly salesTemplates: "salesTemplates";
128
+ readonly sequences: "sequences";
129
+ readonly spellCheck: "spellCheck";
130
+ readonly strike: "strike";
131
+ readonly tablet: "tablet";
132
+ readonly tag: "tag";
133
+ readonly tasks: "tasks";
134
+ readonly test: "test";
135
+ readonly ticket: "ticket";
136
+ readonly thumbsUp: "thumbsUp";
137
+ readonly thumbsDown: "thumbsDown";
138
+ readonly translate: "translate";
139
+ readonly trophy: "trophy";
140
+ readonly videoFile: "videoFile";
141
+ readonly videoPlayerSubtitles: "videoPlayerSubtitles";
142
+ readonly view: "view";
143
+ readonly viewDetails: "viewDetails";
144
+ readonly website: "website";
145
+ readonly workflows: "workflows";
146
+ readonly zoomIn: "zoomIn";
147
+ readonly zoomOut: "zoomOut";
148
+ readonly goal: "goal";
149
+ readonly campaigns: "campaigns";
150
+ readonly cap: "cap";
151
+ readonly block: "block";
152
+ readonly bank: "bank";
153
+ readonly approvals: "approvals";
154
+ readonly appointment: "appointment";
155
+ readonly facebook: "socialBlockFacebook";
156
+ readonly googlePlus: "socialBlockGoogleplus";
157
+ readonly instagram: "socialBlockInstagram";
158
+ readonly linkedin: "socialBlockLinkedin";
159
+ readonly pinterest: "socialBlockPinterest";
160
+ readonly rss: "socialBlockRss";
161
+ readonly twitter: "socialBlockTwitter";
162
+ readonly x: "socialBlockX";
163
+ readonly xing: "socialBlockXing";
164
+ readonly youtube: "socialBlockYoutube";
165
+ readonly youtubePlay: "socialBlockYoutubeplay";
166
+ readonly sortAlpAsc: "sortAlpAsc";
167
+ readonly sortAlpDesc: "sortAlpDesc";
168
+ readonly sortAmtAsc: "sortAmtAsc";
169
+ readonly sortAmtDesc: "sortAmtDesc";
170
+ readonly sortNumAsc: "sortNumAsc";
171
+ readonly sortNumDesc: "sortNumDesc";
172
+ readonly sortTableAsc: "sortTableAsc";
173
+ readonly sortTableDesc: "sortTableDesc";
174
+ readonly text: "text";
175
+ readonly textColor: "textColor";
176
+ readonly textDataType: "textDataType";
177
+ readonly textSnippet: "textSnippet";
178
+ readonly calling: "calling";
179
+ readonly callingHangup: "callingHangup";
180
+ readonly callingMade: "callingMade";
181
+ readonly callingMissed: "callingMissed";
182
+ readonly callingVoicemail: "callingVoicemail";
183
+ readonly faceHappyFilled: "emojiFillHappy";
184
+ readonly faceNeutralFilled: "emojiFillNeutral";
185
+ readonly faceSadFilled: "emojiFillSad";
186
+ };
187
+ export type IconNames = keyof typeof iconNames;
188
+ export type TypesOfReadOnlyArray<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType> ? ElementType : never;
189
+ /** @deprecated use ExtensionEvent/FormSubmitExtensionEvent instead */
190
+ export declare class RemoteEvent<V> {
191
+ type: string;
192
+ bubbles: boolean;
193
+ timeStamp: number;
194
+ targetValue: V;
195
+ constructor(value: V, event: Event);
196
+ }
@@ -1,6 +1,3 @@
1
- // ============================================
2
- // From: shared.ts
3
- // ============================================
4
1
  export class ExtensionEvent {
5
2
  type;
6
3
  bubbles;
@@ -180,68 +177,3 @@ export class RemoteEvent {
180
177
  this.targetValue = value;
181
178
  }
182
179
  }
183
- export const chartFieldTypes = {
184
- datetime: 'datetime',
185
- linear: 'linear',
186
- category: 'category',
187
- };
188
- export const illustrationNames = {
189
- // Standard 1:1 mappings
190
- lock: 'lock',
191
- unlock: 'unlock',
192
- electronicSignature: 'electronic-signature',
193
- electronicSignatureEmptyState: 'electronic-signature-empty-state',
194
- callingSetUp: 'calling-set-up',
195
- companies: 'companies',
196
- contacts: 'contacts',
197
- multipleObjects: 'multiple-objects',
198
- object: 'object',
199
- task: 'task',
200
- deals: 'deals',
201
- registration: 'registration',
202
- developerSecurityUpdate: 'developer-security-update',
203
- social: 'social',
204
- leads: 'leads',
205
- target: 'target',
206
- emailConfirmation: 'email-confirmation',
207
- successfullyConnectedEmail: 'successfully-connected-email',
208
- contentStrategy: 'content-strategy',
209
- addOnReporting: 'add-on-reporting',
210
- productsShoppingCart: 'products-shopping-cart',
211
- store: 'store',
212
- storeDisabled: 'store-disabled',
213
- customerSupport: 'customer-support',
214
- customerExperience: 'customer-experience',
215
- api: 'api',
216
- integrations: 'integrations',
217
- sandboxAddOn: 'sandbox-add-on',
218
- customObjects: 'custom-objects',
219
- paymentsButton: 'payments-button',
220
- automatedTesting: 'automated-testing',
221
- emptyStateCharts: 'empty-state-charts',
222
- // Special mappings that are not 1:1
223
- meetings: 'meetings-small',
224
- tickets: 'ticket-small',
225
- errorGeneral: 'errors/general',
226
- errorHourglass: 'errors/hourglass',
227
- middlePaneCards: 'settings-middle-pane-cards',
228
- propertiesSidebar: 'settings-properties-sidebar',
229
- sidebar: 'settings-sidebar',
230
- };
231
- export const EXTENSION_POINT_LOCATIONS = [
232
- 'crm.preview',
233
- 'crm.record.sidebar',
234
- 'crm.record.tab',
235
- 'helpdesk.sidebar',
236
- 'uie.playground.middle',
237
- 'settings',
238
- 'home',
239
- ];
240
- /**
241
- * @category Serverless
242
- */
243
- export var ServerlessExecutionStatus;
244
- (function (ServerlessExecutionStatus) {
245
- ServerlessExecutionStatus["Success"] = "SUCCESS";
246
- ServerlessExecutionStatus["Error"] = "ERROR";
247
- })(ServerlessExecutionStatus || (ServerlessExecutionStatus = {}));
@@ -0,0 +1,80 @@
1
+ import { HubSpotReactComponent, HubSpotReactFragmentProp, UnknownComponentProps } from '../types/shared.synced';
2
+ /**
3
+ * Options for creating a remote React component.
4
+ */
5
+ interface CreateRemoteComponentOptions<TProps extends UnknownComponentProps = UnknownComponentProps> {
6
+ /**
7
+ * An array of prop names that are allowed to be used as fragment props.
8
+ */
9
+ fragmentProps?: ComponentFragmentPropName<TProps>[];
10
+ }
11
+ /**
12
+ * Options for creating a remote React component.
13
+ */
14
+ interface CreateRemoteCompoundComponentOptions<TProps extends UnknownComponentProps, TCompoundComponentProps> {
15
+ /**
16
+ * An array of prop names that are allowed to be used as fragment props.
17
+ */
18
+ fragmentProps?: ComponentFragmentPropName<TProps>[];
19
+ compoundComponentProperties: TCompoundComponentProps;
20
+ }
21
+ /**
22
+ * Utility type for filtering out all of the prop names where the value is a ReactNode (excluding primitives).
23
+ * We use this to know which props are allowed to be used as fragment props.
24
+ */
25
+ type ComponentFragmentPropName<TProps extends UnknownComponentProps> = {
26
+ [K in keyof TProps]: HubSpotReactFragmentProp extends Required<TProps>[K] ? K : never;
27
+ }[keyof TProps & string];
28
+ /**
29
+ * Represents a registry of HubSpot-provided React components that is used internally by the UI extensions SDK.
30
+ */
31
+ export interface RemoteComponentRegistry {
32
+ /**
33
+ * Creates a new remote React component and registers it with the registry.
34
+ *
35
+ * @param componentName The name of the component to create and register.
36
+ * @param options The options for the remote React component.
37
+ * @returns The remote React component that can be used as a React component.
38
+ */
39
+ createAndRegisterRemoteReactComponent: <TProps extends UnknownComponentProps>(componentName: string, options?: CreateRemoteComponentOptions<TProps>) => HubSpotReactComponent<TProps>;
40
+ /**
41
+ * Creates a new remote compound React component and registers it with the registry. A compound component is a component that is
42
+ * composed of multiple components attached to a single component function.
43
+ *
44
+ * @param componentName The name of the component to create and register.
45
+ * @param options The options for the remote compound React component.
46
+ * @returns The remote compound React component that can be used as a React component.
47
+ */
48
+ createAndRegisterRemoteCompoundReactComponent: <TProps extends UnknownComponentProps, TCompoundComponentProps>(componentName: string, options: CreateRemoteCompoundComponentOptions<TProps, TCompoundComponentProps>) => HubSpotReactComponent<TProps> & TCompoundComponentProps;
49
+ /**
50
+ * Returns the name of a HubSpot-provided React component.
51
+ *
52
+ * @param component The React component to get the name of.
53
+ * @returns The name of the HubSpot-provided React component.
54
+ */
55
+ getComponentName: (component: HubSpotReactComponent<any>) => string | null;
56
+ /**
57
+ * Returns true if the given component name is allowed to be used in HubSpot.
58
+ *
59
+ * @param name The name of the component to check if it is allowed to be used in HubSpot.
60
+ * @returns `true` if the given component name is allowed to be used in HubSpot.
61
+ */
62
+ isAllowedComponentName: (name: string) => boolean;
63
+ /**
64
+ * Returns true if the given prop name is a fragment prop for the given component name.
65
+ *
66
+ * @param componentName The name of the component to check if the prop is a fragment prop for.
67
+ * @param propName The name of the prop to check if it is a fragment prop.
68
+ * @returns `true` if the prop name is a fragment prop for the given component name.
69
+ */
70
+ isComponentFragmentProp: (componentName: string, propName: string) => boolean;
71
+ /**
72
+ * Returns the names of the fragment props for a given component name.
73
+ *
74
+ * @param componentName The name of the component to get the fragment props for.
75
+ * @returns The names of the fragment props for the given component name.
76
+ */
77
+ getComponentFragmentPropNames: (componentName: string) => string[];
78
+ }
79
+ export declare const createRemoteComponentRegistry: () => RemoteComponentRegistry;
80
+ export {};
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Do not manually update this file, changes will be autogenerated by our scripts based on: ui-extensions-remote-renderer/static/js/utils/remote-component-registry.tsx
3
+ import { createRemoteReactComponent } from '@remote-ui/react';
4
+ export const createRemoteComponentRegistry = () => {
5
+ const componentMetadataLookup = new Map();
6
+ const componentNameByComponentMap = new Map();
7
+ const registerComponent = (component, componentName, fragmentProps) => {
8
+ componentNameByComponentMap.set(component, componentName);
9
+ componentMetadataLookup.set(componentName, {
10
+ fragmentPropsSet: new Set(fragmentProps),
11
+ fragmentPropsArray: fragmentProps,
12
+ });
13
+ return component;
14
+ };
15
+ return {
16
+ getComponentName: (component) => {
17
+ const componentName = componentNameByComponentMap.get(component);
18
+ if (!componentName) {
19
+ return null;
20
+ }
21
+ return componentName;
22
+ },
23
+ isAllowedComponentName: (componentName) => {
24
+ return componentMetadataLookup.has(componentName);
25
+ },
26
+ isComponentFragmentProp: (componentName, propName) => {
27
+ const componentMetadata = componentMetadataLookup.get(componentName);
28
+ if (!componentMetadata) {
29
+ return false;
30
+ }
31
+ return componentMetadata.fragmentPropsSet.has(propName);
32
+ },
33
+ getComponentFragmentPropNames: (componentName) => {
34
+ const componentMetadata = componentMetadataLookup.get(componentName);
35
+ if (!componentMetadata) {
36
+ return [];
37
+ }
38
+ const { fragmentPropsArray } = componentMetadata;
39
+ return fragmentPropsArray;
40
+ },
41
+ createAndRegisterRemoteReactComponent: (componentName, options = {}) => {
42
+ const { fragmentProps = [] } = options;
43
+ const remoteReactComponent = createRemoteReactComponent(componentName, {
44
+ fragmentProps: fragmentProps,
45
+ });
46
+ return registerComponent(remoteReactComponent, componentName, fragmentProps);
47
+ },
48
+ createAndRegisterRemoteCompoundReactComponent: (componentName, options) => {
49
+ const { fragmentProps = [] } = options;
50
+ const RemoteComponentType = createRemoteReactComponent(componentName, {
51
+ fragmentProps,
52
+ });
53
+ // We can only attach properties to a function component type, so we need to check if the remote component type is a function.
54
+ // If the remote component type is not a function, we need to wrap it in a function component.
55
+ const CompoundFunctionComponentType = typeof RemoteComponentType === 'function'
56
+ ? RemoteComponentType
57
+ : (props) => (_jsx(RemoteComponentType, { ...props }));
58
+ // Attach the compound component properties to the function component that we will be returning.
59
+ Object.assign(CompoundFunctionComponentType, options.compoundComponentProperties);
60
+ // Register the compound function component with the registry and return it.
61
+ return registerComponent(CompoundFunctionComponentType, componentName, fragmentProps);
62
+ },
63
+ };
64
+ };
@@ -1,4 +1,4 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, };
1
+ export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, } from '../__synced__/crmRemoteComponents.synced';
3
2
  export { useCrmProperties } from './hooks/useCrmProperties';
4
3
  export { useAssociations } from './hooks/useAssociations';
4
+ export type * from '../__synced__/types/crm.synced';
package/dist/crm/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, };
1
+ export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmAssociationStageTracker, CrmSimpleDeadline, CrmStageTracker, CrmStatistics, CrmActionButton, CrmActionLink, CrmCardActions, } from '../__synced__/crmRemoteComponents.synced';
3
2
  export { useCrmProperties } from './hooks/useCrmProperties';
4
3
  export { useAssociations } from './hooks/useAssociations';
@@ -1,75 +1,4 @@
1
- import type * as types from '../types';
2
- import type * as experimentalTypes from './types';
3
1
  export { useCrmProperties } from '../crm/hooks/useCrmProperties';
4
2
  export { useAssociations } from '../crm/hooks/useAssociations';
5
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
6
- declare const Iframe: "Iframe" & {
7
- readonly type?: "Iframe" | undefined;
8
- readonly props?: types.IframeProps | undefined;
9
- readonly children?: true | undefined;
10
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Iframe", types.IframeProps, true>>;
11
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
12
- declare const MediaObject: "MediaObject" & {
13
- readonly type?: "MediaObject" | undefined;
14
- readonly props?: experimentalTypes.MediaObjectProps | undefined;
15
- readonly children?: true | undefined;
16
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"MediaObject", experimentalTypes.MediaObjectProps, true>>;
17
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
18
- declare const Stack2: "Stack2" & {
19
- readonly type?: "Stack2" | undefined;
20
- readonly props?: experimentalTypes.Stack2Props | undefined;
21
- readonly children?: true | undefined;
22
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Stack2", experimentalTypes.Stack2Props, true>>;
23
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
24
- declare const Center: "Center" & {
25
- readonly type?: "Center" | undefined;
26
- readonly props?: experimentalTypes.CenterProps | undefined;
27
- readonly children?: true | undefined;
28
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Center", experimentalTypes.CenterProps, true>>;
29
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
30
- declare const Grid: "Grid" & {
31
- readonly type?: "Grid" | undefined;
32
- readonly props?: experimentalTypes.GridProps | undefined;
33
- readonly children?: true | undefined;
34
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Grid", experimentalTypes.GridProps, true>>;
35
- /** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
36
- declare const GridItem: "GridItem" & {
37
- readonly type?: "GridItem" | undefined;
38
- readonly props?: experimentalTypes.GridItemProps | undefined;
39
- readonly children?: true | undefined;
40
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"GridItem", experimentalTypes.GridItemProps, true>>;
41
- declare const SettingsView: "SettingsView" & {
42
- readonly type?: "SettingsView" | undefined;
43
- readonly props?: experimentalTypes.SettingsViewProps | undefined;
44
- readonly children?: true | undefined;
45
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"SettingsView", experimentalTypes.SettingsViewProps, true>>;
46
- /**
47
- * The `ExpandableText` component renders a text that can be expanded or collapsed based on a maximum height.
48
- *
49
- * **Links:**
50
- *
51
- * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/expandable-text ExpandableText Docs}
52
- */
53
- declare const ExpandableText: "ExpandableText" & {
54
- readonly type?: "ExpandableText" | undefined;
55
- readonly props?: experimentalTypes.ExpandableTextProps | undefined;
56
- readonly children?: true | undefined;
57
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"ExpandableText", experimentalTypes.ExpandableTextProps, true>>;
58
- /**
59
- * The `Popover` component renders a popover overlay that can contain other components.
60
- *
61
- * **Links:**
62
- *
63
- * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/popover Popover Docs}
64
- */
65
- declare const Popover: "Popover" & {
66
- readonly type?: "Popover" | undefined;
67
- readonly props?: experimentalTypes.PopoverProps | undefined;
68
- readonly children?: true | undefined;
69
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Popover", experimentalTypes.PopoverProps, true>>;
70
- declare const FileInput: "FileInput" & {
71
- readonly type?: "FileInput" | undefined;
72
- readonly props?: experimentalTypes.FileInputProps | undefined;
73
- readonly children?: true | undefined;
74
- } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"FileInput", experimentalTypes.FileInputProps, true>>;
75
- export { Iframe, MediaObject, Stack2, Center, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, };
3
+ export { Iframe, MediaObject, Stack2, Center, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, } from '../__synced__/experimentalRemoteComponents.synced';
4
+ export type * from '../__synced__/experimental/types.synced';