@hubspot/ui-extensions 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/__tests__/crm/hooks/useAssociations.spec.js +96 -0
  2. package/dist/__tests__/crm/hooks/useCrmProperties.spec.js +170 -1
  3. package/dist/crm/hooks/useAssociations.d.ts +2 -0
  4. package/dist/crm/hooks/useAssociations.js +87 -0
  5. package/dist/crm/hooks/useCrmProperties.d.ts +5 -1
  6. package/dist/crm/hooks/useCrmProperties.js +81 -2
  7. package/dist/hooks/useExtensionActions.d.ts +4 -0
  8. package/dist/hooks/useExtensionActions.js +6 -0
  9. package/dist/hooks/useExtensionContext.d.ts +4 -0
  10. package/dist/hooks/useExtensionContext.js +6 -0
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.js +2 -0
  13. package/dist/internal/global-utils.js +4 -0
  14. package/dist/internal/hook-utils.d.ts +10 -3
  15. package/dist/internal/hook-utils.js +10 -1
  16. package/dist/shared/types/components/accordion.d.ts +5 -5
  17. package/dist/shared/types/components/alert.d.ts +2 -2
  18. package/dist/shared/types/components/button-row.d.ts +5 -2
  19. package/dist/shared/types/components/button.d.ts +16 -10
  20. package/dist/shared/types/components/chart.d.ts +3 -3
  21. package/dist/shared/types/components/description-list.d.ts +2 -2
  22. package/dist/shared/types/components/dropdown.d.ts +8 -8
  23. package/dist/shared/types/components/empty-state.d.ts +5 -7
  24. package/dist/shared/types/components/error-state.d.ts +2 -2
  25. package/dist/shared/types/components/form.d.ts +2 -2
  26. package/dist/shared/types/components/heading.d.ts +1 -1
  27. package/dist/shared/types/components/icon.d.ts +4 -5
  28. package/dist/shared/types/components/illustration.d.ts +12 -0
  29. package/dist/shared/types/components/image.d.ts +9 -4
  30. package/dist/shared/types/components/inputs.d.ts +51 -64
  31. package/dist/shared/types/components/layouts.d.ts +17 -24
  32. package/dist/shared/types/components/link.d.ts +8 -5
  33. package/dist/shared/types/components/loading-spinner.d.ts +3 -3
  34. package/dist/shared/types/components/modal.d.ts +5 -5
  35. package/dist/shared/types/components/panel.d.ts +7 -7
  36. package/dist/shared/types/components/progress-bar.d.ts +4 -4
  37. package/dist/shared/types/components/selects.d.ts +11 -20
  38. package/dist/shared/types/components/statistics.d.ts +2 -2
  39. package/dist/shared/types/components/status-tag.d.ts +5 -5
  40. package/dist/shared/types/components/step-indicator.d.ts +5 -7
  41. package/dist/shared/types/components/table.d.ts +22 -12
  42. package/dist/shared/types/components/tabs.d.ts +10 -10
  43. package/dist/shared/types/components/tag.d.ts +2 -2
  44. package/dist/shared/types/components/text.d.ts +15 -21
  45. package/dist/shared/types/components/tile.d.ts +2 -2
  46. package/dist/shared/types/components/toggle.d.ts +12 -14
  47. package/dist/shared/types/components/toggleInputs.d.ts +26 -19
  48. package/dist/shared/types/components/tooltip.d.ts +1 -1
  49. package/dist/shared/types/crm.d.ts +52 -0
  50. package/dist/shared/types/http-requests.d.ts +2 -2
  51. package/dist/shared/types/shared.d.ts +123 -78
  52. package/dist/shared/types/shared.js +123 -78
  53. package/dist/shared/types/worker-globals.d.ts +15 -0
  54. package/dist/{experimental/testing → testing}/__tests__/debug.spec.js +1 -1
  55. package/dist/{experimental/testing → testing}/__tests__/find.spec.js +1 -1
  56. package/dist/{experimental/testing → testing}/__tests__/findAll.spec.js +1 -1
  57. package/dist/{experimental/testing → testing}/__tests__/findAllChildren.spec.js +1 -1
  58. package/dist/{experimental/testing → testing}/__tests__/findByTestId.spec.js +1 -1
  59. package/dist/{experimental/testing → testing}/__tests__/findChild.spec.js +1 -1
  60. package/dist/{experimental/testing → testing}/__tests__/fragments.spec.js +1 -1
  61. package/dist/{experimental/testing → testing}/__tests__/invalid-components.spec.js +1 -1
  62. package/dist/{experimental/testing → testing}/__tests__/isMatch.spec.js +1 -1
  63. package/dist/{experimental/testing → testing}/__tests__/logger.spec.js +1 -1
  64. package/dist/{experimental/testing → testing}/__tests__/maybeFind.spec.js +1 -1
  65. package/dist/{experimental/testing → testing}/__tests__/maybeFindByTestId.spec.js +1 -1
  66. package/dist/{experimental/testing → testing}/__tests__/maybeFindChild.spec.js +1 -1
  67. package/dist/{experimental/testing → testing}/__tests__/mocks.runServerlessFunction.spec.js +1 -1
  68. package/dist/testing/__tests__/mocks.useAssociations.spec.js +135 -0
  69. package/dist/testing/__tests__/mocks.useCrmProperties.spec.js +106 -0
  70. package/dist/testing/__tests__/mocks.useExtensionActions.spec.js +32 -0
  71. package/dist/testing/__tests__/mocks.useExtensionContext.spec.js +46 -0
  72. package/dist/{experimental/testing → testing}/__tests__/props.spec.js +1 -1
  73. package/dist/{experimental/testing → testing}/__tests__/testId.spec.js +1 -1
  74. package/dist/{experimental/testing → testing}/__tests__/trigger.spec.js +1 -1
  75. package/dist/{experimental/testing → testing}/__tests__/type-utils.spec.js +1 -1
  76. package/dist/testing/__tests__/waitFor.spec.d.ts +1 -0
  77. package/dist/{experimental/testing → testing}/__tests__/waitFor.spec.js +1 -1
  78. package/dist/{experimental/testing → testing}/internal/convert.js +1 -1
  79. package/dist/{experimental/testing → testing}/internal/element.d.ts +1 -1
  80. package/dist/{experimental/testing → testing}/internal/errors.js +1 -1
  81. package/dist/{experimental/testing → testing}/internal/match.d.ts +1 -1
  82. package/dist/{experimental/testing → testing}/internal/mocks/index.d.ts +1 -1
  83. package/dist/{experimental/testing → testing}/internal/mocks/mock-extension-point-api.d.ts +1 -1
  84. package/dist/{experimental/testing → testing}/internal/mocks/mock-extension-point-api.js +1 -1
  85. package/dist/testing/internal/mocks/mock-hooks.d.ts +3 -0
  86. package/dist/{experimental/testing → testing}/internal/mocks/mock-hooks.js +14 -0
  87. package/dist/{experimental/testing → testing}/internal/print.js +1 -1
  88. package/dist/{experimental/testing → testing}/internal/query.d.ts +1 -1
  89. package/dist/{experimental/testing → testing}/internal/query.js +1 -1
  90. package/dist/{experimental/testing → testing}/internal/types-internal.d.ts +7 -3
  91. package/dist/testing/internal/types-internal.js +1 -0
  92. package/dist/{experimental/testing → testing}/render.d.ts +1 -1
  93. package/dist/{experimental/testing → testing}/render.js +7 -7
  94. package/dist/{experimental/testing → testing}/types.d.ts +25 -5
  95. package/dist/{experimental/testing → testing}/utils.d.ts +1 -1
  96. package/dist/{experimental/testing → testing}/utils.js +1 -1
  97. package/package.json +3 -3
  98. package/dist/experimental/testing/__tests__/mocks.useAssociations.spec.js +0 -47
  99. package/dist/experimental/testing/__tests__/mocks.useCrmProperties.spec.js +0 -58
  100. package/dist/experimental/testing/internal/mocks/mock-hooks.d.ts +0 -2
  101. /package/dist/{experimental/testing → testing}/__tests__/createRenderer.spec.d.ts +0 -0
  102. /package/dist/{experimental/testing → testing}/__tests__/createRenderer.spec.js +0 -0
  103. /package/dist/{experimental/testing → testing}/__tests__/debug.spec.d.ts +0 -0
  104. /package/dist/{experimental/testing → testing}/__tests__/find.spec.d.ts +0 -0
  105. /package/dist/{experimental/testing → testing}/__tests__/findAll.spec.d.ts +0 -0
  106. /package/dist/{experimental/testing → testing}/__tests__/findAllChildren.spec.d.ts +0 -0
  107. /package/dist/{experimental/testing → testing}/__tests__/findByTestId.spec.d.ts +0 -0
  108. /package/dist/{experimental/testing → testing}/__tests__/findChild.spec.d.ts +0 -0
  109. /package/dist/{experimental/testing → testing}/__tests__/fragments.spec.d.ts +0 -0
  110. /package/dist/{experimental/testing → testing}/__tests__/invalid-components.spec.d.ts +0 -0
  111. /package/dist/{experimental/testing → testing}/__tests__/isMatch.spec.d.ts +0 -0
  112. /package/dist/{experimental/testing → testing}/__tests__/logger.spec.d.ts +0 -0
  113. /package/dist/{experimental/testing → testing}/__tests__/maybeFind.spec.d.ts +0 -0
  114. /package/dist/{experimental/testing → testing}/__tests__/maybeFindByTestId.spec.d.ts +0 -0
  115. /package/dist/{experimental/testing → testing}/__tests__/maybeFindChild.spec.d.ts +0 -0
  116. /package/dist/{experimental/testing → testing}/__tests__/mocks.actions.spec.d.ts +0 -0
  117. /package/dist/{experimental/testing → testing}/__tests__/mocks.actions.spec.js +0 -0
  118. /package/dist/{experimental/testing → testing}/__tests__/mocks.context.spec.d.ts +0 -0
  119. /package/dist/{experimental/testing → testing}/__tests__/mocks.context.spec.js +0 -0
  120. /package/dist/{experimental/testing → testing}/__tests__/mocks.runServerlessFunction.spec.d.ts +0 -0
  121. /package/dist/{experimental/testing → testing}/__tests__/mocks.useAssociations.spec.d.ts +0 -0
  122. /package/dist/{experimental/testing → testing}/__tests__/mocks.useCrmProperties.spec.d.ts +0 -0
  123. /package/dist/{experimental/testing/__tests__/props.spec.d.ts → testing/__tests__/mocks.useExtensionActions.spec.d.ts} +0 -0
  124. /package/dist/{experimental/testing/__tests__/testId.spec.d.ts → testing/__tests__/mocks.useExtensionContext.spec.d.ts} +0 -0
  125. /package/dist/{experimental/testing/__tests__/trigger.spec.d.ts → testing/__tests__/props.spec.d.ts} +0 -0
  126. /package/dist/{experimental/testing/__tests__/type-utils.spec.d.ts → testing/__tests__/testId.spec.d.ts} +0 -0
  127. /package/dist/{experimental/testing/__tests__/waitFor.spec.d.ts → testing/__tests__/trigger.spec.d.ts} +0 -0
  128. /package/dist/{experimental/testing/internal/types-internal.js → testing/__tests__/type-utils.spec.d.ts} +0 -0
  129. /package/dist/{experimental/testing → testing}/index.d.ts +0 -0
  130. /package/dist/{experimental/testing → testing}/index.js +0 -0
  131. /package/dist/{experimental/testing → testing}/internal/constants.d.ts +0 -0
  132. /package/dist/{experimental/testing → testing}/internal/constants.js +0 -0
  133. /package/dist/{experimental/testing → testing}/internal/convert.d.ts +0 -0
  134. /package/dist/{experimental/testing → testing}/internal/debug.d.ts +0 -0
  135. /package/dist/{experimental/testing → testing}/internal/debug.js +0 -0
  136. /package/dist/{experimental/testing → testing}/internal/document.d.ts +0 -0
  137. /package/dist/{experimental/testing → testing}/internal/document.js +0 -0
  138. /package/dist/{experimental/testing → testing}/internal/element.js +0 -0
  139. /package/dist/{experimental/testing → testing}/internal/errors.d.ts +0 -0
  140. /package/dist/{experimental/testing → testing}/internal/fragment.d.ts +0 -0
  141. /package/dist/{experimental/testing → testing}/internal/fragment.js +0 -0
  142. /package/dist/{experimental/testing → testing}/internal/match.js +0 -0
  143. /package/dist/{experimental/testing → testing}/internal/mocks/index.js +0 -0
  144. /package/dist/{experimental/testing → testing}/internal/print.d.ts +0 -0
  145. /package/dist/{experimental/testing → testing}/internal/root.d.ts +0 -0
  146. /package/dist/{experimental/testing → testing}/internal/root.js +0 -0
  147. /package/dist/{experimental/testing → testing}/internal/text.d.ts +0 -0
  148. /package/dist/{experimental/testing → testing}/internal/text.js +0 -0
  149. /package/dist/{experimental/testing → testing}/internal/type-utils-internal.d.ts +0 -0
  150. /package/dist/{experimental/testing → testing}/internal/type-utils-internal.js +0 -0
  151. /package/dist/{experimental/testing → testing}/internal/utils/promise-utils.d.ts +0 -0
  152. /package/dist/{experimental/testing → testing}/internal/utils/promise-utils.js +0 -0
  153. /package/dist/{experimental/testing → testing}/type-utils.d.ts +0 -0
  154. /package/dist/{experimental/testing → testing}/type-utils.js +0 -0
  155. /package/dist/{experimental/testing → testing}/types.js +0 -0
@@ -2,20 +2,54 @@ import { ReactNode } from 'react';
2
2
  import { TShirtSizes, BaseComponentProps } from './shared.ts';
3
3
  /** @ignore */
4
4
  export interface CrmDataHighlightProps extends BaseComponentProps {
5
+ /**
6
+ * The properties to display, up to four. By default, will display property data from the currently displaying record. To pull data from a specific record, include the `objectTypeId` and `objectId` props.
7
+ */
5
8
  properties: Array<string>;
9
+ /**
10
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts).
11
+ */
6
12
  objectTypeId?: string;
13
+ /**
14
+ * The ID of the CRM record to display property data from.
15
+ */
7
16
  objectId?: number;
8
17
  }
9
18
  /** @ignore */
10
19
  export interface CrmReportProps extends BaseComponentProps {
20
+ /**
21
+ * The numeric ID of the single object report, which can be found in the URL when viewing the report in HubSpot.
22
+ */
11
23
  reportId: string;
24
+ /**
25
+ * Specifies how the report should be filtered based on its relationship to the currently displaying CRM record:
26
+ * - `associations`: report will only include data from records associated with the currently displaying record.
27
+ * - `subject`: report will only include data from the currently displaying record. Will not include data from associated records.
28
+ * - `unfiltered`: report will display all data regardless of the currently displaying record and its associations.
29
+ *
30
+ * @defaultValue `"associations"`
31
+ */
12
32
  use?: 'associations' | 'subject' | 'unfiltered';
13
33
  }
14
34
  /** @ignore */
15
35
  export interface CrmPropertyListProps extends BaseComponentProps {
36
+ /**
37
+ * The properties to display, up to 24. By default, will display property data from the currently displaying record. To pull data from a specific record, include the `objectTypeId` and `objectId` props.
38
+ */
16
39
  properties: Array<string>;
40
+ /**
41
+ * The layout direction of the table.
42
+ *
43
+ * @defaultValue `"column"`
44
+ */
17
45
  direction?: string;
46
+ /**
47
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts).
48
+ */
18
49
  objectTypeId?: string;
50
+ /**
51
+ * The ID of the CRM record to display property data from.
52
+ */
19
53
  objectId?: number;
20
54
  }
21
55
  /** @ignore */
@@ -101,7 +135,13 @@ interface PercentileMetricItem extends BaseCrmStatisticItem {
101
135
  type CrmStatisticItem = BasicMetricItem | PercentileMetricItem;
102
136
  /** @ignore */
103
137
  export interface CrmStatisticsProps extends BaseComponentProps {
138
+ /**
139
+ * The numeric ID of the type of object to fetch statistics about (e.g., `0-1` for contacts).
140
+ */
104
141
  objectTypeId: string;
142
+ /**
143
+ * An array of objects that define each statistic to fetch.
144
+ */
105
145
  statistics: Array<CrmStatisticItem>;
106
146
  }
107
147
  /** @ignore */
@@ -117,9 +157,21 @@ interface Gradient {
117
157
  }
118
158
  /** @ignore */
119
159
  export interface CrmStageTrackerProps extends BaseComponentProps {
160
+ /**
161
+ * The ID of the CRM record to display property data from.
162
+ */
120
163
  objectId?: number;
164
+ /**
165
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts).
166
+ */
121
167
  objectTypeId?: string;
168
+ /**
169
+ * The properties to display, up to four. By default, will display property data from the currently displaying record.
170
+ */
122
171
  properties: Array<string>;
172
+ /**
173
+ * Whether to display the properties below the progress indicator.
174
+ */
123
175
  showProperties?: boolean;
124
176
  }
125
177
  /** @ignore */
@@ -66,8 +66,8 @@ export interface ServerlessExecutionRequest {
66
66
  serverlessFunction: string;
67
67
  location: keyof ExtensionPoints;
68
68
  objectQuery?: {
69
- objectId: number;
70
- objectTypeId: string;
69
+ objectId?: number;
70
+ objectTypeId?: string;
71
71
  objectPropertyNames: string[];
72
72
  };
73
73
  parameters?: JsonValue;
@@ -38,151 +38,196 @@ export interface TShirtSizes {
38
38
  export type AllSizes = TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'] | TShirtSizes['xl'];
39
39
  export type AllDistances = 'flush' | AllSizes;
40
40
  export declare const iconNames: {
41
- readonly success: "success";
42
- readonly remove: "remove";
43
41
  readonly add: "add";
42
+ readonly appointment: "appointment";
43
+ readonly approvals: "approvals";
44
+ readonly artificialIntelligence: "artificialIntelligence";
45
+ readonly artificialIntelligenceEnhanced: "artificialIntelligenceEnhanced";
44
46
  readonly attach: "attach";
45
- readonly date: "date";
47
+ readonly bank: "bank";
48
+ readonly block: "block";
49
+ readonly book: "knowledgeBase";
50
+ readonly bulb: "bulb";
51
+ readonly callTranscript: "callTranscript";
52
+ readonly calling: "calling";
53
+ readonly callingHangup: "callingHangup";
54
+ readonly callingMade: "callingMade";
55
+ readonly callingMissed: "callingMissed";
56
+ readonly callingVoicemail: "callingVoicemail";
57
+ readonly campaigns: "campaigns";
58
+ readonly cap: "cap";
59
+ readonly checkCircle: "checkCircle";
60
+ readonly circleFilled: "circleFilled";
61
+ readonly circleHollow: "circleHollow";
62
+ readonly clock: "time";
63
+ readonly comment: "comments";
64
+ readonly contact: "contacts";
46
65
  readonly copy: "duplicate";
66
+ readonly crm: "crm";
67
+ readonly dataSync: "dataSync";
68
+ readonly date: "date";
69
+ readonly delay: "delay";
47
70
  readonly delete: "delete";
71
+ readonly description: "description";
72
+ readonly developerProjects: "developerProjects";
73
+ readonly documents: "documents";
74
+ readonly downCarat: "downCarat";
75
+ readonly download: "download";
48
76
  readonly edit: "edit";
77
+ readonly ellipses: "ellipses";
49
78
  readonly email: "email";
79
+ readonly emailOpen: "emailOpen";
80
+ readonly emailThreadedReplies: "emailThreadedReplies";
81
+ readonly enrichment: "enrichment";
82
+ readonly enroll: "enroll";
50
83
  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";
84
+ readonly exclamationCircle: "exclamationCircle";
67
85
  readonly faceHappy: "emoji";
86
+ readonly faceHappyFilled: "emojiFillHappy";
68
87
  readonly faceNeutral: "emojiLineNeutral";
88
+ readonly faceNeutralFilled: "emojiFillNeutral";
69
89
  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";
90
+ readonly faceSadFilled: "emojiFillSad";
91
+ readonly facebook: "socialBlockFacebook";
92
+ readonly favoriteHollow: "favoriteHollow";
93
+ readonly file: "file";
94
+ readonly filledXCircleIcon: "filledXCircleIcon";
81
95
  readonly filter: "filter";
96
+ readonly flame: "highlyEngagedLead";
97
+ readonly folder: "folder";
98
+ readonly folderOpen: "folderOpen";
99
+ readonly forward: "forward";
82
100
  readonly gauge: "gauge";
83
- readonly enroll: "enroll";
84
101
  readonly generateChart: "generateChart";
85
102
  readonly gift: "gift";
86
- readonly flame: "highlyEngagedLead";
87
- readonly inbox: "inbox";
103
+ readonly globe: "language";
104
+ readonly globeLine: "globe";
105
+ readonly goal: "goal";
106
+ readonly googlePlus: "socialBlockGoogleplus";
107
+ readonly guidedActions: "guidedActions";
108
+ readonly hash: "numericDataType";
109
+ readonly hide: "hide";
110
+ readonly home: "home";
111
+ readonly hubDB: "hubDB";
88
112
  readonly image: "insertImage";
89
- readonly quote: "insertQuote";
113
+ readonly imageGallery: "imageGallery";
114
+ readonly inbox: "inbox";
115
+ readonly info: "info";
116
+ readonly infoNoCircle: "infoNoCircle";
90
117
  readonly insertVideo: "insertVideo";
118
+ readonly instagram: "socialBlockInstagram";
119
+ readonly integrations: "integrations";
91
120
  readonly invoice: "invoice";
92
121
  readonly key: "key";
93
- readonly book: "knowledgeBase";
94
- readonly globe: "language";
122
+ readonly language: "language";
123
+ readonly left: "left";
124
+ readonly lessCircle: "lessCircle";
95
125
  readonly lesson: "lesson";
126
+ readonly light: "light";
96
127
  readonly link: "link";
128
+ readonly linkedin: "socialBlockLinkedin";
97
129
  readonly listView: "listView";
130
+ readonly location: "location";
98
131
  readonly locked: "locked";
99
132
  readonly mention: "mention";
100
133
  readonly messages: "messages";
101
134
  readonly mobile: "mobile";
135
+ readonly moreCircle: "moreCircle";
136
+ readonly notEditable: "notEditable";
137
+ readonly notification: "notification";
102
138
  readonly notificationOff: "notificationOff";
103
- readonly hash: "numericDataType";
104
139
  readonly objectAssociations: "objectAssociations";
105
140
  readonly objectAssociationsManyToMany: "objectAssociationsManyToMany";
106
141
  readonly objectAssociationsManyToOne: "objectAssociationsManyToOne";
107
142
  readonly office365: "office365";
108
143
  readonly order: "order";
109
144
  readonly paymentSubscriptions: "paymentSubscriptions";
110
- readonly product: "product";
145
+ readonly pin: "pin";
146
+ readonly pinterest: "socialBlockPinterest";
111
147
  readonly powerPointFile: "powerPointFile";
112
148
  readonly presentation: "presentation";
149
+ readonly product: "product";
113
150
  readonly publish: "publish";
151
+ readonly question: "question";
114
152
  readonly questionAnswer: "questionAnswer";
153
+ readonly questionCircle: "questionCircle";
115
154
  readonly quickbooks: "quickbooks";
155
+ readonly quote: "insertQuote";
116
156
  readonly readMore: "readMore";
117
- readonly realEstateListing: "realEstateListing";
118
157
  readonly readOnlyView: "readOnlyView";
158
+ readonly realEstateListing: "realEstateListing";
119
159
  readonly recentlySelected: "recentlySelected";
120
160
  readonly record: "record";
121
161
  readonly redo: "redo";
122
- readonly undo: "undo";
162
+ readonly refresh: "refresh";
123
163
  readonly registration: "registration";
164
+ readonly remove: "remove";
124
165
  readonly replace: "replace";
166
+ readonly reports: "reports";
167
+ readonly right: "right";
168
+ readonly robot: "simpleBot";
125
169
  readonly rotate: "rotate";
170
+ readonly rss: "socialBlockRss";
126
171
  readonly salesQuote: "salesQuote";
127
172
  readonly salesTemplates: "salesTemplates";
173
+ readonly save: "saveEditableView";
174
+ readonly search: "search";
175
+ readonly send: "send";
128
176
  readonly sequences: "sequences";
177
+ readonly settings: "settings";
178
+ readonly shoppingCart: "cart";
179
+ readonly signal: "signal";
180
+ readonly signalPoor: "signalPoor";
181
+ readonly signature: "signature";
182
+ readonly snooze: "snooze";
183
+ readonly sortAlpAsc: "sortAlpAsc";
184
+ readonly sortAlpDesc: "sortAlpDesc";
185
+ readonly sortAmtAsc: "sortAmtAsc";
186
+ readonly sortAmtDesc: "sortAmtDesc";
187
+ readonly sortNumAsc: "sortNumAsc";
188
+ readonly sortNumDesc: "sortNumDesc";
189
+ readonly sortTableAsc: "sortTableAsc";
190
+ readonly sortTableDesc: "sortTableDesc";
129
191
  readonly spellCheck: "spellCheck";
192
+ readonly sprocket: "sprocket";
193
+ readonly star: "favorite";
194
+ readonly stopRecord: "stopRecord";
130
195
  readonly strike: "strike";
196
+ readonly styles: "styles";
197
+ readonly success: "success";
131
198
  readonly tablet: "tablet";
132
199
  readonly tag: "tag";
133
200
  readonly tasks: "tasks";
134
201
  readonly test: "test";
135
- readonly ticket: "ticket";
136
- readonly thumbsUp: "thumbsUp";
202
+ readonly text: "text";
203
+ readonly textBodyExpanded: "textBodyExpanded";
204
+ readonly textColor: "textColor";
205
+ readonly textDataType: "textDataType";
206
+ readonly textSnippet: "textSnippet";
137
207
  readonly thumbsDown: "thumbsDown";
208
+ readonly thumbsUp: "thumbsUp";
209
+ readonly ticket: "ticket";
138
210
  readonly translate: "translate";
139
211
  readonly trophy: "trophy";
212
+ readonly twitter: "socialBlockTwitter";
213
+ readonly undo: "undo";
214
+ readonly upCarat: "upCarat";
215
+ readonly upload: "upload";
216
+ readonly video: "video";
140
217
  readonly videoFile: "videoFile";
141
218
  readonly videoPlayerSubtitles: "videoPlayerSubtitles";
142
219
  readonly view: "view";
143
220
  readonly viewDetails: "viewDetails";
221
+ readonly warning: "warning";
144
222
  readonly website: "website";
145
223
  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
224
  readonly x: "socialBlockX";
225
+ readonly xCircle: "xCircle";
163
226
  readonly xing: "socialBlockXing";
164
227
  readonly youtube: "socialBlockYoutube";
165
228
  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";
229
+ readonly zoomIn: "zoomIn";
230
+ readonly zoomOut: "zoomOut";
186
231
  };
187
232
  export type IconNames = keyof typeof iconNames;
188
233
  export type TypesOfReadOnlyArray<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType> ? ElementType : never;
@@ -18,151 +18,196 @@ export class FormSubmitExtensionEvent extends ExtensionEvent {
18
18
  }
19
19
  }
20
20
  export const iconNames = {
21
- success: 'success',
22
- remove: 'remove',
23
21
  add: 'add',
22
+ appointment: 'appointment',
23
+ approvals: 'approvals',
24
+ artificialIntelligence: 'artificialIntelligence',
25
+ artificialIntelligenceEnhanced: 'artificialIntelligenceEnhanced',
24
26
  attach: 'attach',
25
- date: 'date',
27
+ bank: 'bank',
28
+ block: 'block',
29
+ book: 'knowledgeBase',
30
+ bulb: 'bulb',
31
+ callTranscript: 'callTranscript',
32
+ calling: 'calling',
33
+ callingHangup: 'callingHangup',
34
+ callingMade: 'callingMade',
35
+ callingMissed: 'callingMissed',
36
+ callingVoicemail: 'callingVoicemail',
37
+ campaigns: 'campaigns',
38
+ cap: 'cap',
39
+ checkCircle: 'checkCircle',
40
+ circleFilled: 'circleFilled',
41
+ circleHollow: 'circleHollow',
42
+ clock: 'time',
43
+ comment: 'comments',
44
+ contact: 'contacts',
26
45
  copy: 'duplicate',
46
+ crm: 'crm',
47
+ dataSync: 'dataSync',
48
+ date: 'date',
49
+ delay: 'delay',
27
50
  delete: 'delete',
51
+ description: 'description',
52
+ developerProjects: 'developerProjects',
53
+ documents: 'documents',
54
+ downCarat: 'downCarat',
55
+ download: 'download',
28
56
  edit: 'edit',
57
+ ellipses: 'ellipses',
29
58
  email: 'email',
59
+ emailOpen: 'emailOpen',
60
+ emailThreadedReplies: 'emailThreadedReplies',
61
+ enrichment: 'enrichment',
62
+ enroll: 'enroll',
30
63
  exclamation: 'exclamation',
31
- question: 'question',
32
- home: 'home',
33
- location: 'location',
34
- upCarat: 'upCarat',
35
- downCarat: 'downCarat',
36
- warning: 'warning',
37
- shoppingCart: 'cart',
38
- clock: 'time',
39
- comment: 'comments',
40
- contact: 'contacts',
41
- star: 'favorite',
42
- file: 'file',
43
- reports: 'reports',
44
- video: 'video',
45
- robot: 'simpleBot',
46
- refresh: 'refresh',
64
+ exclamationCircle: 'exclamationCircle',
47
65
  faceHappy: 'emoji',
66
+ faceHappyFilled: 'emojiFillHappy',
48
67
  faceNeutral: 'emojiLineNeutral',
68
+ faceNeutralFilled: 'emojiFillNeutral',
49
69
  faceSad: 'emojiLineSad',
50
- upload: 'upload',
51
- download: 'download',
52
- left: 'left',
53
- right: 'right',
54
- dataSync: 'dataSync',
55
- imageGallery: 'imageGallery',
56
- search: 'search',
57
- save: 'saveEditableView',
58
- notification: 'notification',
59
- bulb: 'bulb',
60
- settings: 'settings',
70
+ faceSadFilled: 'emojiFillSad',
71
+ facebook: 'socialBlockFacebook',
72
+ favoriteHollow: 'favoriteHollow',
73
+ file: 'file',
74
+ filledXCircleIcon: 'filledXCircleIcon',
61
75
  filter: 'filter',
76
+ flame: 'highlyEngagedLead',
77
+ folder: 'folder',
78
+ folderOpen: 'folderOpen',
79
+ forward: 'forward',
62
80
  gauge: 'gauge',
63
- enroll: 'enroll',
64
81
  generateChart: 'generateChart',
65
82
  gift: 'gift',
66
- flame: 'highlyEngagedLead',
67
- inbox: 'inbox',
83
+ globe: 'language',
84
+ globeLine: 'globe',
85
+ goal: 'goal',
86
+ googlePlus: 'socialBlockGoogleplus',
87
+ guidedActions: 'guidedActions',
88
+ hash: 'numericDataType',
89
+ hide: 'hide',
90
+ home: 'home',
91
+ hubDB: 'hubDB',
68
92
  image: 'insertImage',
69
- quote: 'insertQuote',
93
+ imageGallery: 'imageGallery',
94
+ inbox: 'inbox',
95
+ info: 'info',
96
+ infoNoCircle: 'infoNoCircle',
70
97
  insertVideo: 'insertVideo',
98
+ instagram: 'socialBlockInstagram',
99
+ integrations: 'integrations',
71
100
  invoice: 'invoice',
72
101
  key: 'key',
73
- book: 'knowledgeBase',
74
- globe: 'language',
102
+ language: 'language',
103
+ left: 'left',
104
+ lessCircle: 'lessCircle',
75
105
  lesson: 'lesson',
106
+ light: 'light',
76
107
  link: 'link',
108
+ linkedin: 'socialBlockLinkedin',
77
109
  listView: 'listView',
110
+ location: 'location',
78
111
  locked: 'locked',
79
112
  mention: 'mention',
80
113
  messages: 'messages',
81
114
  mobile: 'mobile',
115
+ moreCircle: 'moreCircle',
116
+ notEditable: 'notEditable',
117
+ notification: 'notification',
82
118
  notificationOff: 'notificationOff',
83
- hash: 'numericDataType',
84
119
  objectAssociations: 'objectAssociations',
85
120
  objectAssociationsManyToMany: 'objectAssociationsManyToMany',
86
121
  objectAssociationsManyToOne: 'objectAssociationsManyToOne',
87
122
  office365: 'office365',
88
123
  order: 'order',
89
124
  paymentSubscriptions: 'paymentSubscriptions',
90
- product: 'product',
125
+ pin: 'pin',
126
+ pinterest: 'socialBlockPinterest',
91
127
  powerPointFile: 'powerPointFile',
92
128
  presentation: 'presentation',
129
+ product: 'product',
93
130
  publish: 'publish',
131
+ question: 'question',
94
132
  questionAnswer: 'questionAnswer',
133
+ questionCircle: 'questionCircle',
95
134
  quickbooks: 'quickbooks',
135
+ quote: 'insertQuote',
96
136
  readMore: 'readMore',
97
- realEstateListing: 'realEstateListing',
98
137
  readOnlyView: 'readOnlyView',
138
+ realEstateListing: 'realEstateListing',
99
139
  recentlySelected: 'recentlySelected',
100
140
  record: 'record',
101
141
  redo: 'redo',
102
- undo: 'undo',
142
+ refresh: 'refresh',
103
143
  registration: 'registration',
144
+ remove: 'remove',
104
145
  replace: 'replace',
146
+ reports: 'reports',
147
+ right: 'right',
148
+ robot: 'simpleBot',
105
149
  rotate: 'rotate',
150
+ rss: 'socialBlockRss',
106
151
  salesQuote: 'salesQuote',
107
152
  salesTemplates: 'salesTemplates',
153
+ save: 'saveEditableView',
154
+ search: 'search',
155
+ send: 'send',
108
156
  sequences: 'sequences',
157
+ settings: 'settings',
158
+ shoppingCart: 'cart',
159
+ signal: 'signal',
160
+ signalPoor: 'signalPoor',
161
+ signature: 'signature',
162
+ snooze: 'snooze',
163
+ sortAlpAsc: 'sortAlpAsc',
164
+ sortAlpDesc: 'sortAlpDesc',
165
+ sortAmtAsc: 'sortAmtAsc',
166
+ sortAmtDesc: 'sortAmtDesc',
167
+ sortNumAsc: 'sortNumAsc',
168
+ sortNumDesc: 'sortNumDesc',
169
+ sortTableAsc: 'sortTableAsc',
170
+ sortTableDesc: 'sortTableDesc',
109
171
  spellCheck: 'spellCheck',
172
+ sprocket: 'sprocket',
173
+ star: 'favorite',
174
+ stopRecord: 'stopRecord',
110
175
  strike: 'strike',
176
+ styles: 'styles',
177
+ success: 'success',
111
178
  tablet: 'tablet',
112
179
  tag: 'tag',
113
180
  tasks: 'tasks',
114
181
  test: 'test',
115
- ticket: 'ticket',
116
- thumbsUp: 'thumbsUp',
182
+ text: 'text',
183
+ textBodyExpanded: 'textBodyExpanded',
184
+ textColor: 'textColor',
185
+ textDataType: 'textDataType',
186
+ textSnippet: 'textSnippet',
117
187
  thumbsDown: 'thumbsDown',
188
+ thumbsUp: 'thumbsUp',
189
+ ticket: 'ticket',
118
190
  translate: 'translate',
119
191
  trophy: 'trophy',
192
+ twitter: 'socialBlockTwitter',
193
+ undo: 'undo',
194
+ upCarat: 'upCarat',
195
+ upload: 'upload',
196
+ video: 'video',
120
197
  videoFile: 'videoFile',
121
198
  videoPlayerSubtitles: 'videoPlayerSubtitles',
122
199
  view: 'view',
123
200
  viewDetails: 'viewDetails',
201
+ warning: 'warning',
124
202
  website: 'website',
125
203
  workflows: 'workflows',
126
- zoomIn: 'zoomIn',
127
- zoomOut: 'zoomOut',
128
- goal: 'goal',
129
- campaigns: 'campaigns',
130
- cap: 'cap',
131
- block: 'block',
132
- bank: 'bank',
133
- approvals: 'approvals',
134
- appointment: 'appointment',
135
- facebook: 'socialBlockFacebook',
136
- googlePlus: 'socialBlockGoogleplus',
137
- instagram: 'socialBlockInstagram',
138
- linkedin: 'socialBlockLinkedin',
139
- pinterest: 'socialBlockPinterest',
140
- rss: 'socialBlockRss',
141
- twitter: 'socialBlockTwitter',
142
204
  x: 'socialBlockX',
205
+ xCircle: 'xCircle',
143
206
  xing: 'socialBlockXing',
144
207
  youtube: 'socialBlockYoutube',
145
208
  youtubePlay: 'socialBlockYoutubeplay',
146
- sortAlpAsc: 'sortAlpAsc',
147
- sortAlpDesc: 'sortAlpDesc',
148
- sortAmtAsc: 'sortAmtAsc',
149
- sortAmtDesc: 'sortAmtDesc',
150
- sortNumAsc: 'sortNumAsc',
151
- sortNumDesc: 'sortNumDesc',
152
- sortTableAsc: 'sortTableAsc',
153
- sortTableDesc: 'sortTableDesc',
154
- text: 'text',
155
- textColor: 'textColor',
156
- textDataType: 'textDataType',
157
- textSnippet: 'textSnippet',
158
- calling: 'calling',
159
- callingHangup: 'callingHangup',
160
- callingMade: 'callingMade',
161
- callingMissed: 'callingMissed',
162
- callingVoicemail: 'callingVoicemail',
163
- faceHappyFilled: 'emojiFillHappy',
164
- faceNeutralFilled: 'emojiFillNeutral',
165
- faceSadFilled: 'emojiFillSad',
209
+ zoomIn: 'zoomIn',
210
+ zoomOut: 'zoomOut',
166
211
  };
167
212
  /** @deprecated use ExtensionEvent/FormSubmitExtensionEvent instead */
168
213
  export class RemoteEvent {
@@ -1,5 +1,6 @@
1
1
  import { Logger } from './logger.ts';
2
2
  import { HubspotExtendFunction } from './extend.ts';
3
+ import type { ExtensionPoints, ExtensionPointApiContext, ExtensionPointApiActions } from './extension-points.ts';
3
4
  export interface WorkerGlobalsInternal {
4
5
  /**
5
6
  * A marker that the current global is a HubSpot extension worker.
@@ -14,4 +15,18 @@ export interface WorkerGlobalsInternal {
14
15
  * NOTE: `extend_V2` is used internally by `hubspot.extend` (where `hubspot` is imported from `@hubspot/ui-extensions`).
15
16
  */
16
17
  extend_V2: HubspotExtendFunction;
18
+ /**
19
+ * Namespace where all HubSpot APIs that go on the worker should live.
20
+ * This avoids polluting the global and reduces the possibility of customer code having collisions with our code.
21
+ */
22
+ hsWorkerAPI: {
23
+ /**
24
+ * Hook added to worker globals so customer code can access extension context at runtime.
25
+ */
26
+ useExtensionContext: <ExtensionPoint extends keyof ExtensionPoints>() => ExtensionPointApiContext<ExtensionPoint>;
27
+ /**
28
+ * Hook added to worker globals so customer code can access extension actions at runtime.
29
+ */
30
+ useExtensionActions: <ExtensionPoint extends keyof ExtensionPoints>() => ExtensionPointApiActions<ExtensionPoint>;
31
+ };
17
32
  }