@hubspot/ui-extensions 0.11.2 → 0.11.4

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 (215) hide show
  1. package/dist/__tests__/crm/hooks/useAssociations.spec.js +4 -4
  2. package/dist/__tests__/crm/hooks/useCrmProperties.spec.js +2 -2
  3. package/dist/__tests__/crm/utils/fetchAssociations.spec.js +5 -5
  4. package/dist/__tests__/crm/utils/fetchCrmProperties.spec.js +4 -4
  5. package/dist/clientTypes.d.ts +1 -0
  6. package/dist/clientTypes.js +1 -1
  7. package/dist/crm/hooks/useAssociations.d.ts +5 -3
  8. package/dist/crm/hooks/useAssociations.js +4 -2
  9. package/dist/crm/hooks/useCrmProperties.d.ts +4 -2
  10. package/dist/crm/hooks/useCrmProperties.js +4 -2
  11. package/dist/crm/index.d.ts +4 -4
  12. package/dist/crm/index.js +3 -3
  13. package/dist/crm/utils/fetchAssociations.d.ts +1 -1
  14. package/dist/experimental/index.d.ts +4 -4
  15. package/dist/experimental/index.js +3 -3
  16. package/dist/experimental/testing/__tests__/createRenderer.spec.js +23 -0
  17. package/dist/experimental/testing/__tests__/debug.spec.js +21 -7
  18. package/dist/experimental/testing/__tests__/find.spec.js +23 -8
  19. package/dist/experimental/testing/__tests__/findAll.spec.js +4 -3
  20. package/dist/experimental/testing/__tests__/findAllChildren.spec.js +14 -8
  21. package/dist/experimental/testing/__tests__/findByTestId.spec.js +126 -0
  22. package/dist/experimental/testing/__tests__/findChild.spec.js +11 -7
  23. package/dist/experimental/testing/__tests__/fragments.spec.js +17 -10
  24. package/dist/experimental/testing/__tests__/invalid-components.spec.js +16 -8
  25. package/dist/experimental/testing/__tests__/isMatch.spec.js +106 -53
  26. package/dist/experimental/testing/__tests__/logger.spec.js +10 -0
  27. package/dist/experimental/testing/__tests__/maybeFind.spec.js +20 -11
  28. package/dist/experimental/testing/__tests__/maybeFindByTestId.spec.js +65 -0
  29. package/dist/experimental/testing/__tests__/maybeFindChild.spec.js +22 -12
  30. package/dist/experimental/testing/__tests__/mocks.actions.spec.js +19 -0
  31. package/dist/experimental/testing/__tests__/mocks.context.spec.js +24 -0
  32. package/dist/experimental/testing/__tests__/mocks.runServerlessFunction.spec.js +35 -0
  33. package/dist/experimental/testing/__tests__/mocks.useAssociations.spec.js +47 -0
  34. package/dist/experimental/testing/__tests__/mocks.useCrmProperties.spec.js +58 -0
  35. package/dist/experimental/testing/__tests__/props.spec.js +13 -0
  36. package/dist/experimental/testing/__tests__/testId.spec.js +18 -0
  37. package/dist/experimental/testing/__tests__/trigger.spec.js +9 -6
  38. package/dist/experimental/testing/__tests__/type-utils.spec.js +12 -10
  39. package/dist/experimental/testing/__tests__/waitFor.spec.js +7 -5
  40. package/dist/experimental/testing/index.d.ts +4 -3
  41. package/dist/experimental/testing/index.js +4 -3
  42. package/dist/experimental/testing/internal/constants.d.ts +2 -2
  43. package/dist/experimental/testing/internal/constants.js +1 -1
  44. package/dist/experimental/testing/internal/convert.d.ts +2 -2
  45. package/dist/experimental/testing/internal/convert.js +42 -24
  46. package/dist/experimental/testing/internal/debug.d.ts +3 -3
  47. package/dist/experimental/testing/internal/debug.js +4 -5
  48. package/dist/experimental/testing/internal/document.d.ts +1 -1
  49. package/dist/experimental/testing/internal/document.js +4 -1
  50. package/dist/experimental/testing/internal/element.d.ts +4 -3
  51. package/dist/experimental/testing/internal/element.js +15 -10
  52. package/dist/experimental/testing/internal/errors.d.ts +45 -2
  53. package/dist/experimental/testing/internal/errors.js +44 -2
  54. package/dist/experimental/testing/internal/fragment.d.ts +3 -2
  55. package/dist/experimental/testing/internal/fragment.js +13 -9
  56. package/dist/experimental/testing/internal/match.d.ts +3 -12
  57. package/dist/experimental/testing/internal/match.js +0 -23
  58. package/dist/experimental/testing/internal/mocks/index.d.ts +17 -0
  59. package/dist/experimental/testing/internal/mocks/index.js +46 -0
  60. package/dist/experimental/testing/internal/mocks/mock-extension-point-api.d.ts +2 -0
  61. package/dist/experimental/testing/internal/mocks/mock-extension-point-api.js +166 -0
  62. package/dist/experimental/testing/internal/mocks/mock-hooks.d.ts +2 -0
  63. package/dist/experimental/testing/internal/mocks/mock-hooks.js +59 -0
  64. package/dist/experimental/testing/internal/print.d.ts +2 -2
  65. package/dist/experimental/testing/internal/print.js +17 -11
  66. package/dist/experimental/testing/internal/query.d.ts +19 -9
  67. package/dist/experimental/testing/internal/query.js +91 -28
  68. package/dist/experimental/testing/internal/root.d.ts +1 -1
  69. package/dist/experimental/testing/internal/root.js +12 -8
  70. package/dist/experimental/testing/internal/text.d.ts +3 -2
  71. package/dist/experimental/testing/internal/text.js +12 -3
  72. package/dist/experimental/testing/internal/type-utils-internal.d.ts +44 -0
  73. package/dist/experimental/testing/internal/type-utils-internal.js +54 -0
  74. package/dist/experimental/testing/internal/types-internal.d.ts +20 -2
  75. package/dist/experimental/testing/render.d.ts +32 -6
  76. package/dist/experimental/testing/render.js +96 -32
  77. package/dist/experimental/testing/type-utils.d.ts +2 -2
  78. package/dist/experimental/testing/type-utils.js +1 -1
  79. package/dist/experimental/testing/types.d.ts +127 -10
  80. package/dist/experimental/testing/utils.d.ts +11 -0
  81. package/dist/experimental/testing/utils.js +24 -0
  82. package/dist/hubspot.d.ts +2 -4
  83. package/dist/hubspot.js +3 -3
  84. package/dist/index.d.ts +5 -5
  85. package/dist/index.js +5 -5
  86. package/dist/internal/global-utils.d.ts +6 -0
  87. package/dist/internal/global-utils.js +37 -0
  88. package/dist/internal/hook-utils.d.ts +19 -0
  89. package/dist/internal/hook-utils.js +34 -0
  90. package/dist/logger.d.ts +1 -8
  91. package/dist/logger.js +3 -2
  92. package/dist/pages/home/index.d.ts +1 -1
  93. package/dist/pages/home/index.js +1 -1
  94. package/dist/{__synced__/remoteComponents.synced.d.ts → shared/remoteComponents.d.ts} +103 -103
  95. package/dist/{__synced__/remoteComponents.synced.js → shared/remoteComponents.js} +1 -1
  96. package/dist/{__synced__/types/components/accordion.synced.d.ts → shared/types/components/accordion.d.ts} +2 -2
  97. package/dist/{__synced__/types/components/alert.synced.d.ts → shared/types/components/alert.d.ts} +2 -1
  98. package/dist/{__synced__/types/components/app-home-header-actions.synced.d.ts → shared/types/components/app-home-header-actions.d.ts} +4 -4
  99. package/dist/{__synced__/types/components/button-row.synced.d.ts → shared/types/components/button-row.d.ts} +2 -2
  100. package/dist/{__synced__/types/components/button.synced.d.ts → shared/types/components/button.d.ts} +3 -3
  101. package/dist/{__synced__/types/components/card.synced.d.ts → shared/types/components/card.d.ts} +2 -1
  102. package/dist/{__synced__/types/components/chart.synced.d.ts → shared/types/components/chart.d.ts} +2 -1
  103. package/dist/{__synced__/types/components/description-list.synced.d.ts → shared/types/components/description-list.d.ts} +3 -2
  104. package/dist/{__synced__/types/components/divider.synced.d.ts → shared/types/components/divider.d.ts} +2 -2
  105. package/dist/{__synced__/types/components/dropdown.synced.d.ts → shared/types/components/dropdown.d.ts} +5 -5
  106. package/dist/{__synced__/types/components/empty-state.synced.d.ts → shared/types/components/empty-state.d.ts} +2 -1
  107. package/dist/{__synced__/types/components/error-state.synced.d.ts → shared/types/components/error-state.d.ts} +2 -1
  108. package/dist/{__synced__/types/components/form.synced.d.ts → shared/types/components/form.d.ts} +3 -3
  109. package/dist/{__synced__/types/components/heading.synced.d.ts → shared/types/components/heading.d.ts} +2 -1
  110. package/dist/{__synced__/types/components/icon.synced.d.ts → shared/types/components/icon.d.ts} +2 -2
  111. package/dist/{__synced__/types/components/iframe.synced.d.ts → shared/types/components/iframe.d.ts} +2 -2
  112. package/dist/{__synced__/types/components/illustration.synced.d.ts → shared/types/components/illustration.d.ts} +2 -1
  113. package/dist/{__synced__/types/components/image.synced.d.ts → shared/types/components/image.d.ts} +3 -3
  114. package/dist/shared/types/components/index.d.ts +38 -0
  115. package/dist/{__synced__/types/components/inputs.synced.d.ts → shared/types/components/inputs.d.ts} +2 -1
  116. package/dist/{__synced__/types/components/layouts.synced.d.ts → shared/types/components/layouts.d.ts} +6 -6
  117. package/dist/{__synced__/types/components/link.synced.d.ts → shared/types/components/link.d.ts} +3 -3
  118. package/dist/{__synced__/types/components/list.synced.d.ts → shared/types/components/list.d.ts} +2 -1
  119. package/dist/{__synced__/types/components/loading-spinner.synced.d.ts → shared/types/components/loading-spinner.d.ts} +2 -2
  120. package/dist/{__synced__/types/components/modal.synced.d.ts → shared/types/components/modal.d.ts} +4 -4
  121. package/dist/{__synced__/types/components/panel.synced.d.ts → shared/types/components/panel.d.ts} +5 -5
  122. package/dist/{__synced__/types/components/progress-bar.synced.d.ts → shared/types/components/progress-bar.d.ts} +2 -1
  123. package/dist/{__synced__/types/components/selects.synced.d.ts → shared/types/components/selects.d.ts} +2 -1
  124. package/dist/{__synced__/types/components/statistics.synced.d.ts → shared/types/components/statistics.d.ts} +4 -3
  125. package/dist/{__synced__/types/components/status-tag.synced.d.ts → shared/types/components/status-tag.d.ts} +2 -1
  126. package/dist/{__synced__/types/components/step-indicator.synced.d.ts → shared/types/components/step-indicator.d.ts} +2 -2
  127. package/dist/{__synced__/types/components/table.synced.d.ts → shared/types/components/table.d.ts} +5 -4
  128. package/dist/shared/types/components/table.js +1 -0
  129. package/dist/{__synced__/types/components/tabs.synced.d.ts → shared/types/components/tabs.d.ts} +3 -2
  130. package/dist/shared/types/components/tabs.js +1 -0
  131. package/dist/{__synced__/types/components/tag.synced.d.ts → shared/types/components/tag.d.ts} +3 -3
  132. package/dist/shared/types/components/tag.js +1 -0
  133. package/dist/{__synced__/types/components/text.synced.d.ts → shared/types/components/text.d.ts} +2 -1
  134. package/dist/shared/types/components/text.js +1 -0
  135. package/dist/{__synced__/types/components/tile.synced.d.ts → shared/types/components/tile.d.ts} +2 -1
  136. package/dist/shared/types/components/tile.js +1 -0
  137. package/dist/{__synced__/types/components/toggle.synced.d.ts → shared/types/components/toggle.d.ts} +2 -2
  138. package/dist/shared/types/components/toggle.js +1 -0
  139. package/dist/{__synced__/types/components/toggleInputs.synced.d.ts → shared/types/components/toggleInputs.d.ts} +4 -4
  140. package/dist/shared/types/components/toggleInputs.js +1 -0
  141. package/dist/{__synced__/types/components/tooltip.synced.d.ts → shared/types/components/tooltip.d.ts} +2 -1
  142. package/dist/shared/types/components/tooltip.js +1 -0
  143. package/dist/{__synced__/types/context.synced.d.ts → shared/types/context.d.ts} +1 -1
  144. package/dist/shared/types/context.js +1 -0
  145. package/dist/{__synced__/types/crm.synced.d.ts → shared/types/crm.d.ts} +13 -13
  146. package/dist/shared/types/crm.js +1 -0
  147. package/dist/{__synced__/experimental/types.synced.d.ts → shared/types/experimental.d.ts} +10 -14
  148. package/dist/shared/types/experimental.js +1 -0
  149. package/dist/shared/types/extend.d.ts +4 -0
  150. package/dist/shared/types/extend.js +1 -0
  151. package/dist/{__synced__/types/extension-points.synced.d.ts → shared/types/extension-points.d.ts} +18 -10
  152. package/dist/{__synced__/types/http-requests.synced.d.ts → shared/types/http-requests.d.ts} +1 -1
  153. package/dist/shared/types/index.d.ts +8 -0
  154. package/dist/shared/types/index.js +1 -0
  155. package/dist/shared/types/logger.d.ts +7 -0
  156. package/dist/shared/types/logger.js +1 -0
  157. package/dist/shared/types/reactions.js +1 -0
  158. package/dist/{__synced__/types/shared.synced.d.ts → shared/types/shared.d.ts} +3 -0
  159. package/dist/shared/types/worker-globals.d.ts +17 -0
  160. package/dist/shared/types/worker-globals.js +1 -0
  161. package/dist/{__synced__/utils/remote-component-registry.synced.d.ts → shared/utils/remote-component-registry.d.ts} +1 -1
  162. package/dist/{__synced__/utils/remote-component-registry.synced.js → shared/utils/remote-component-registry.js} +0 -1
  163. package/package.json +6 -4
  164. package/dist/__synced__/experimental/types.synced.js +0 -5
  165. package/dist/__synced__/types/components/index.synced.d.ts +0 -38
  166. package/dist/__synced__/types/index.synced.d.ts +0 -8
  167. package/dist/__synced__/types/index.synced.js +0 -1
  168. /package/dist/{__synced__/types/actions.synced.js → experimental/testing/__tests__/createRenderer.spec.d.ts} +0 -0
  169. /package/dist/{__synced__/types/components/accordion.synced.js → experimental/testing/__tests__/findByTestId.spec.d.ts} +0 -0
  170. /package/dist/{__synced__/types/components/alert.synced.js → experimental/testing/__tests__/logger.spec.d.ts} +0 -0
  171. /package/dist/{__synced__/types/components/app-home-header-actions.synced.js → experimental/testing/__tests__/maybeFindByTestId.spec.d.ts} +0 -0
  172. /package/dist/{__synced__/types/components/button-row.synced.js → experimental/testing/__tests__/mocks.actions.spec.d.ts} +0 -0
  173. /package/dist/{__synced__/types/components/button.synced.js → experimental/testing/__tests__/mocks.context.spec.d.ts} +0 -0
  174. /package/dist/{__synced__/types/components/card.synced.js → experimental/testing/__tests__/mocks.runServerlessFunction.spec.d.ts} +0 -0
  175. /package/dist/{__synced__/types/components/description-list.synced.js → experimental/testing/__tests__/mocks.useAssociations.spec.d.ts} +0 -0
  176. /package/dist/{__synced__/types/components/divider.synced.js → experimental/testing/__tests__/mocks.useCrmProperties.spec.d.ts} +0 -0
  177. /package/dist/{__synced__/types/components/dropdown.synced.js → experimental/testing/__tests__/props.spec.d.ts} +0 -0
  178. /package/dist/{__synced__/types/components/empty-state.synced.js → experimental/testing/__tests__/testId.spec.d.ts} +0 -0
  179. /package/dist/{__synced__/types/actions.synced.d.ts → shared/types/actions.d.ts} +0 -0
  180. /package/dist/{__synced__/types/components/error-state.synced.js → shared/types/actions.js} +0 -0
  181. /package/dist/{__synced__/types/components/form.synced.js → shared/types/components/accordion.js} +0 -0
  182. /package/dist/{__synced__/types/components/heading.synced.js → shared/types/components/alert.js} +0 -0
  183. /package/dist/{__synced__/types/components/icon.synced.js → shared/types/components/app-home-header-actions.js} +0 -0
  184. /package/dist/{__synced__/types/components/iframe.synced.js → shared/types/components/button-row.js} +0 -0
  185. /package/dist/{__synced__/types/components/image.synced.js → shared/types/components/button.js} +0 -0
  186. /package/dist/{__synced__/types/components/index.synced.js → shared/types/components/card.js} +0 -0
  187. /package/dist/{__synced__/types/components/chart.synced.js → shared/types/components/chart.js} +0 -0
  188. /package/dist/{__synced__/types/components/inputs.synced.js → shared/types/components/description-list.js} +0 -0
  189. /package/dist/{__synced__/types/components/layouts.synced.js → shared/types/components/divider.js} +0 -0
  190. /package/dist/{__synced__/types/components/link.synced.js → shared/types/components/dropdown.js} +0 -0
  191. /package/dist/{__synced__/types/components/list.synced.js → shared/types/components/empty-state.js} +0 -0
  192. /package/dist/{__synced__/types/components/loading-spinner.synced.js → shared/types/components/error-state.js} +0 -0
  193. /package/dist/{__synced__/types/components/modal.synced.js → shared/types/components/form.js} +0 -0
  194. /package/dist/{__synced__/types/components/panel.synced.js → shared/types/components/heading.js} +0 -0
  195. /package/dist/{__synced__/types/components/progress-bar.synced.js → shared/types/components/icon.js} +0 -0
  196. /package/dist/{__synced__/types/components/selects.synced.js → shared/types/components/iframe.js} +0 -0
  197. /package/dist/{__synced__/types/components/illustration.synced.js → shared/types/components/illustration.js} +0 -0
  198. /package/dist/{__synced__/types/components/statistics.synced.js → shared/types/components/image.js} +0 -0
  199. /package/dist/{__synced__/types/components/status-tag.synced.js → shared/types/components/index.js} +0 -0
  200. /package/dist/{__synced__/types/components/step-indicator.synced.js → shared/types/components/inputs.js} +0 -0
  201. /package/dist/{__synced__/types/components/table.synced.js → shared/types/components/layouts.js} +0 -0
  202. /package/dist/{__synced__/types/components/tabs.synced.js → shared/types/components/link.js} +0 -0
  203. /package/dist/{__synced__/types/components/tag.synced.js → shared/types/components/list.js} +0 -0
  204. /package/dist/{__synced__/types/components/text.synced.js → shared/types/components/loading-spinner.js} +0 -0
  205. /package/dist/{__synced__/types/components/tile.synced.js → shared/types/components/modal.js} +0 -0
  206. /package/dist/{__synced__/types/components/toggle.synced.js → shared/types/components/panel.js} +0 -0
  207. /package/dist/{__synced__/types/components/toggleInputs.synced.js → shared/types/components/progress-bar.js} +0 -0
  208. /package/dist/{__synced__/types/components/tooltip.synced.js → shared/types/components/selects.js} +0 -0
  209. /package/dist/{__synced__/types/context.synced.js → shared/types/components/statistics.js} +0 -0
  210. /package/dist/{__synced__/types/crm.synced.js → shared/types/components/status-tag.js} +0 -0
  211. /package/dist/{__synced__/types/reactions.synced.js → shared/types/components/step-indicator.js} +0 -0
  212. /package/dist/{__synced__/types/extension-points.synced.js → shared/types/extension-points.js} +0 -0
  213. /package/dist/{__synced__/types/http-requests.synced.js → shared/types/http-requests.js} +0 -0
  214. /package/dist/{__synced__/types/reactions.synced.d.ts → shared/types/reactions.d.ts} +0 -0
  215. /package/dist/{__synced__/types/shared.synced.js → shared/types/shared.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- export interface TabsProps {
2
+ import { BaseComponentProps } from '../shared.ts';
3
+ export interface TabsProps extends BaseComponentProps {
3
4
  /**
4
5
  * Sets the content that will render inside the component.
5
6
  */
@@ -26,7 +27,7 @@ export interface TabsProps {
26
27
  */
27
28
  fill?: boolean;
28
29
  }
29
- export interface TabProps {
30
+ export interface TabProps extends BaseComponentProps {
30
31
  /**
31
32
  * Whether the tab is disabled.
32
33
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,12 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- import { OverlayComponentProps, ExtensionEvent } from '../shared.synced';
3
- import { ReactionsHandler } from '../reactions.synced';
2
+ import { OverlayComponentProps, ExtensionEvent, BaseComponentProps } from '../shared.ts';
3
+ import { ReactionsHandler } from '../reactions.ts';
4
4
  /**
5
5
  * The props type for {@link !components.Tag}.
6
6
  *
7
7
  * @category Component Props
8
8
  */
9
- export interface TagProps extends OverlayComponentProps {
9
+ export interface TagProps extends OverlayComponentProps, BaseComponentProps {
10
10
  /**
11
11
  * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
12
12
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { BaseComponentProps } from '../shared.ts';
2
3
  /**
3
4
  * @internal
4
5
  * Format options for text component.
@@ -90,4 +91,4 @@ export type TextProps = {
90
91
  * @defaultValue `false`
91
92
  */
92
93
  truncate?: boolean | TruncateOptions;
93
- };
94
+ } & BaseComponentProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
+ import { BaseComponentProps } from '../shared.ts';
2
3
  /**
3
4
  * The props type for {@link !components.Tile}.
4
5
  *
5
6
  * @category Component Props
6
7
  */
7
- export interface TileProps {
8
+ export interface TileProps extends BaseComponentProps {
8
9
  /**
9
10
  * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
10
11
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,10 @@
1
- import { TShirtSizes } from '../shared.synced';
1
+ import { TShirtSizes, BaseComponentProps } from '../shared.ts';
2
2
  /**
3
3
  * The props type for {@link !components.Toggle}.
4
4
  *
5
5
  * @category Component Props
6
6
  */
7
- export interface ToggleProps {
7
+ export interface ToggleProps extends BaseComponentProps {
8
8
  /**
9
9
  * The current status of the input.
10
10
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
1
+ import { BaseComponentProps } from '../shared.ts';
2
2
  /**
3
3
  * The props type for {@link !components.Checkbox}.
4
4
  *
5
5
  * @category Component Props
6
6
  */
7
- export interface CheckboxProps {
7
+ export interface CheckboxProps extends BaseComponentProps {
8
8
  /**
9
9
  * A string representing the value of the input. This is not displayed on the client-side,
10
10
  * but on the server this is the value given to the data submitted with the checkbox's name.
@@ -74,7 +74,7 @@ export type ToggleGroupOption = {
74
74
  /** The string that displays below the toggle. */
75
75
  description?: string;
76
76
  };
77
- interface ToggleGroupListBaseProps {
77
+ interface ToggleGroupListBaseProps extends BaseComponentProps {
78
78
  name: ToggleGroupProps['name'];
79
79
  options: ToggleGroupProps['options'];
80
80
  variant: ToggleGroupProps['variant'];
@@ -89,7 +89,7 @@ export interface RadioButtonListProps extends ToggleGroupListBaseProps {
89
89
  onChange?: RadioButtonGroupProps['onChange'];
90
90
  }
91
91
  type ToggleType = 'checkboxList' | 'radioButtonList';
92
- export interface CommonGroupProps {
92
+ export interface CommonGroupProps extends BaseComponentProps {
93
93
  /**
94
94
  * Denotes the type of list to render.
95
95
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- export interface TooltipProps {
2
+ import { BaseComponentProps } from '../shared.ts';
3
+ export interface TooltipProps extends BaseComponentProps {
3
4
  /**
4
5
  * 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
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ExtensionPoints } from './extension-points.synced';
1
+ import type { ExtensionPoints } from './extension-points.ts';
2
2
  /** @ignore */
3
3
  interface Team {
4
4
  id: number;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,18 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
- import { TShirtSizes } from './shared.synced';
2
+ import { TShirtSizes, BaseComponentProps } from './shared.ts';
3
3
  /** @ignore */
4
- export interface CrmDataHighlightProps {
4
+ export interface CrmDataHighlightProps extends BaseComponentProps {
5
5
  properties: Array<string>;
6
6
  objectTypeId?: string;
7
7
  objectId?: number;
8
8
  }
9
9
  /** @ignore */
10
- export interface CrmReportProps {
10
+ export interface CrmReportProps extends BaseComponentProps {
11
11
  reportId: string;
12
12
  use?: 'associations' | 'subject' | 'unfiltered';
13
13
  }
14
14
  /** @ignore */
15
- export interface CrmPropertyListProps {
15
+ export interface CrmPropertyListProps extends BaseComponentProps {
16
16
  properties: Array<string>;
17
17
  direction?: string;
18
18
  objectTypeId?: string;
@@ -32,7 +32,7 @@ interface CrmSearchFilter {
32
32
  property: string;
33
33
  }
34
34
  /** @ignore */
35
- export interface CrmAssociationTableProps {
35
+ export interface CrmAssociationTableProps extends BaseComponentProps {
36
36
  objectTypeId: string;
37
37
  propertyColumns: Array<string>;
38
38
  quickFilterProperties?: Array<string>;
@@ -44,7 +44,7 @@ export interface CrmAssociationTableProps {
44
44
  sort?: Array<CrmSortDescriptor>;
45
45
  }
46
46
  /** @ignore */
47
- export interface CrmAssociationPivotProps {
47
+ export interface CrmAssociationPivotProps extends BaseComponentProps {
48
48
  objectTypeId: string;
49
49
  associationLabels?: Array<string>;
50
50
  maxAssociations?: number;
@@ -52,7 +52,7 @@ export interface CrmAssociationPivotProps {
52
52
  sort?: Array<CrmSortDescriptor>;
53
53
  }
54
54
  /** @ignore */
55
- export interface CrmAssociationStageTrackerProps {
55
+ export interface CrmAssociationStageTrackerProps extends BaseComponentProps {
56
56
  objectTypeId: string;
57
57
  properties: Array<string>;
58
58
  associationLabels?: Array<string>;
@@ -61,7 +61,7 @@ export interface CrmAssociationStageTrackerProps {
61
61
  sort?: Array<CrmSortDescriptor>;
62
62
  }
63
63
  /** @ignore */
64
- export interface CrmSimpleDeadlineProps {
64
+ export interface CrmSimpleDeadlineProps extends BaseComponentProps {
65
65
  endDatePropertyName: string;
66
66
  properties: Array<string>;
67
67
  progressTheme?: ProgressTheme;
@@ -100,7 +100,7 @@ interface PercentileMetricItem extends BaseCrmStatisticItem {
100
100
  /** @ignore */
101
101
  type CrmStatisticItem = BasicMetricItem | PercentileMetricItem;
102
102
  /** @ignore */
103
- export interface CrmStatisticsProps {
103
+ export interface CrmStatisticsProps extends BaseComponentProps {
104
104
  objectTypeId: string;
105
105
  statistics: Array<CrmStatisticItem>;
106
106
  }
@@ -116,14 +116,14 @@ interface Gradient {
116
116
  endColor: string;
117
117
  }
118
118
  /** @ignore */
119
- export interface CrmStageTrackerProps {
119
+ export interface CrmStageTrackerProps extends BaseComponentProps {
120
120
  objectId?: number;
121
121
  objectTypeId?: string;
122
122
  properties: Array<string>;
123
123
  showProperties?: boolean;
124
124
  }
125
125
  /** @ignore */
126
- export interface CrmAssociationPropertyListProps {
126
+ export interface CrmAssociationPropertyListProps extends BaseComponentProps {
127
127
  objectTypeId: string;
128
128
  properties: Array<string>;
129
129
  associationLabels?: Array<string>;
@@ -197,7 +197,7 @@ interface ActionArgs {
197
197
  export type ArgsFor<SpecificActionType extends ActionType> = ActionArgs[SpecificActionType];
198
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
199
  /** @ignore */
200
- interface BaseActionComponent {
200
+ interface BaseActionComponent extends BaseComponentProps {
201
201
  children: ReactNode;
202
202
  actionType: ActionType;
203
203
  actionContext: ArgsFor<ActionType>;
@@ -241,7 +241,7 @@ type ErrorHandler = (errors: string[]) => void;
241
241
  /** @ignore */
242
242
  type CardActionConfig = ActionLibraryButtonCardActionConfig | DropdownCardActionConfig;
243
243
  /** @ignore */
244
- export type CrmCardActionsProps = {
244
+ export type CrmCardActionsProps = BaseComponentProps & {
245
245
  actionConfigs: Array<CardActionConfig>;
246
246
  onError?: ErrorHandler;
247
247
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,11 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ReactionsHandler } from '../types/reactions.synced';
3
- import type { AllDistances, ExtensionEvent } from '../types/shared.synced';
2
+ import type { ReactionsHandler } from './reactions.ts';
3
+ import type { AllDistances, ExtensionEvent, BaseComponentProps } from './shared.ts';
4
4
  /**
5
5
  * @ignore
6
6
  * @experimental do not use in production
7
7
  */
8
- interface BaseLayout {
8
+ interface BaseLayout extends BaseComponentProps {
9
9
  fullWidth?: boolean;
10
10
  fullHeight?: boolean;
11
11
  }
@@ -41,21 +41,21 @@ export interface CenterProps extends BaseLayout {
41
41
  * @ignore
42
42
  * @experimental
43
43
  */
44
- export interface MediaObjectProps {
44
+ export interface MediaObjectProps extends BaseComponentProps {
45
45
  align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
46
46
  spacing?: 'none' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
47
47
  children?: ReactNode;
48
48
  itemLeft?: ReactNode;
49
49
  itemRight?: ReactNode;
50
50
  }
51
- export interface GridProps {
51
+ export interface GridProps extends BaseComponentProps {
52
52
  justify?: FlexJustify;
53
53
  align?: FlexAlign;
54
54
  gap?: AllDistances;
55
55
  size?: number;
56
56
  children?: ReactNode;
57
57
  }
58
- export interface GridItemProps {
58
+ export interface GridItemProps extends BaseComponentProps {
59
59
  size?: number;
60
60
  children?: ReactNode;
61
61
  offset?: number;
@@ -64,7 +64,7 @@ export interface GridItemProps {
64
64
  * @ignore
65
65
  * @experimental do not use in production
66
66
  */
67
- export interface SettingsViewProps {
67
+ export interface SettingsViewProps extends BaseComponentProps {
68
68
  /**
69
69
  * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
70
70
  */
@@ -96,7 +96,7 @@ export interface SettingsViewProps {
96
96
  * @ignore
97
97
  * @experimental do not use in production
98
98
  */
99
- export interface ExpandableTextProps {
99
+ export interface ExpandableTextProps extends BaseComponentProps {
100
100
  children: ReactNode;
101
101
  maxHeight?: number;
102
102
  expandButtonText?: string;
@@ -107,7 +107,7 @@ export interface ExpandableTextProps {
107
107
  * @ignore
108
108
  * @experimental do not use in production
109
109
  */
110
- export interface PopoverProps {
110
+ export interface PopoverProps extends BaseComponentProps {
111
111
  /**
112
112
  * A unique ID for the popover. Used to identify the popover in the overlay system.
113
113
  *
@@ -146,7 +146,7 @@ export interface PopoverProps {
146
146
  * @ignore
147
147
  * @experimental do not use in production
148
148
  */
149
- export interface FileInputProps {
149
+ export interface FileInputProps extends BaseComponentProps {
150
150
  value?: File | {
151
151
  name: string;
152
152
  };
@@ -234,7 +234,3 @@ export interface BaseInputProps<T = string, V = string> {
234
234
  onFocus?: (value: V) => void;
235
235
  }
236
236
  export {};
237
- /**
238
- * @ignore
239
- * @experimental do not use in production
240
- */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { ExtensionPointApi, ExtensionPoints } from './extension-points.ts';
3
+ export type RenderExtensionCallback<TExtensionPointName extends keyof ExtensionPoints> = (api: ExtensionPointApi<TExtensionPointName>) => ReactElement<any>;
4
+ export type HubspotExtendFunction = <TExtensionPointName extends keyof ExtensionPoints>(renderExtensionCallback: RenderExtensionCallback<TExtensionPointName>) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,10 @@
1
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';
2
+ import { TypesOfReadOnlyArray } from './shared.ts';
3
+ import type { AppHomeContext, BaseContext, CrmContext } from './context.ts';
4
+ import type { AppHomeActions, CrmHostActions, SettingsActions, UiePlatformActions } from './actions.ts';
5
+ import type { CrmPropertyListProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmReportProps, CrmAssociationPivotProps, CrmAssociationPropertyListProps, CrmAssociationStageTrackerProps, CrmSimpleDeadlineProps, CrmRelativeTimelineProps, CrmStageTrackerProps, CrmStatisticsProps, CrmActionButtonProps, CrmActionLinkProps, CrmCardActionsProps } from './crm.ts';
6
+ import type { SettingsContext, GenericContext } from './context.ts';
7
+ import type { ServerlessFuncRunner } from './http-requests.ts';
8
8
  /** @ignore */
9
9
  export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
10
10
  /** @ignore */
@@ -109,14 +109,22 @@ interface LocationToExtensionPoint {
109
109
  * the single source of truth for defining all locations.
110
110
  */
111
111
  type _ExtensionPoints = {
112
- [key in ExtensionPointLocation]: LocationToExtensionPoint[key];
112
+ [TExtensionPointLocation in ExtensionPointLocation]: LocationToExtensionPoint[TExtensionPointLocation];
113
113
  };
114
114
  export interface ExtensionPoints extends _ExtensionPoints {
115
115
  }
116
116
  /** @ignore */
117
- export interface ExtensionPointApi<ExtensionPointName extends keyof ExtensionPoints> {
117
+ export interface ExtensionPointApi<TExtensionPointLocation extends ExtensionPointLocation> {
118
118
  runServerlessFunction: ServerlessFuncRunner;
119
- actions: ExtensionPoints[ExtensionPointName]['actions'];
120
- context: ExtensionPoints[ExtensionPointName]['context'];
119
+ actions: ExtensionPoints[TExtensionPointLocation]['actions'];
120
+ context: ExtensionPoints[TExtensionPointLocation]['context'];
121
121
  }
122
+ /**
123
+ * The actions of the extension point API.
124
+ */
125
+ export type ExtensionPointApiActions<TExtensionPointLocation extends ExtensionPointLocation> = ExtensionPointApi<TExtensionPointLocation>['actions'];
126
+ /**
127
+ * The context of the extension point API.
128
+ */
129
+ export type ExtensionPointApiContext<TExtensionPointLocation extends ExtensionPointLocation> = ExtensionPointApi<TExtensionPointLocation>['context'];
122
130
  export {};
@@ -1,4 +1,4 @@
1
- import type { ExtensionPoints } from './extension-points.synced';
1
+ import type { ExtensionPoints } from './extension-points.ts';
2
2
  export interface HubSpotFetchOptions {
3
3
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
4
4
  timeout?: number;
@@ -0,0 +1,8 @@
1
+ export type * from './components/index.ts';
2
+ export type * from './actions.ts';
3
+ export type * from './context.ts';
4
+ export type * from './crm.ts';
5
+ export type * from './extension-points.ts';
6
+ export type * from './http-requests.ts';
7
+ export type * from './reactions.ts';
8
+ export * from './shared.ts';
@@ -0,0 +1 @@
1
+ export * from "./shared.js"; // NOTE: `shared.ts` has some exported classes so we can't use `export type` for now
@@ -0,0 +1,7 @@
1
+ export type LogData = string | number;
2
+ export interface Logger {
3
+ debug: (data: LogData) => void;
4
+ info: (data: LogData) => void;
5
+ warn: (data: LogData) => void;
6
+ error: (data: LogData) => void;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -194,3 +194,6 @@ export declare class RemoteEvent<V> {
194
194
  targetValue: V;
195
195
  constructor(value: V, event: Event);
196
196
  }
197
+ export interface BaseComponentProps {
198
+ testId?: string;
199
+ }
@@ -0,0 +1,17 @@
1
+ import { Logger } from './logger.ts';
2
+ import { HubspotExtendFunction } from './extend.ts';
3
+ export interface WorkerGlobalsInternal {
4
+ /**
5
+ * A marker that the current global is a HubSpot extension worker.
6
+ */
7
+ __HUBSPOT_EXTENSION_WORKER__?: boolean;
8
+ /**
9
+ * A logger for the current worker.
10
+ */
11
+ logger: Logger;
12
+ /**
13
+ * A global function in worker globals that is used to extend the current worker with a new extension point.
14
+ * NOTE: `extend_V2` is used internally by `hubspot.extend` (where `hubspot` is imported from `@hubspot/ui-extensions`).
15
+ */
16
+ extend_V2: HubspotExtendFunction;
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { HubSpotReactComponent, HubSpotReactFragmentProp, UnknownComponentProps } from '../types/shared.synced';
1
+ import { HubSpotReactComponent, HubSpotReactFragmentProp, UnknownComponentProps } from '../types/shared.ts';
2
2
  /**
3
3
  * Options for creating a remote React component.
4
4
  */
@@ -1,5 +1,4 @@
1
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
2
  import { createRemoteReactComponent } from '@remote-ui/react';
4
3
  export const createRemoteComponentRegistry = () => {
5
4
  const componentMetadataLookup = new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/ui-extensions",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,7 +34,9 @@
34
34
  "dependencies": {
35
35
  "@remote-ui/core": "2.2.7",
36
36
  "@remote-ui/react": "5.0.2",
37
- "react": "18.3.1"
37
+ "react": "18.3.1",
38
+ "react-reconciler": "0.29.2",
39
+ "tinyspy": "4.0.4"
38
40
  },
39
41
  "engines": {
40
42
  "node": ">=16"
@@ -66,11 +68,11 @@
66
68
  "react-dom": "18.3.1",
67
69
  "react-reconciler": "^0.29.0",
68
70
  "tsd": "^0.33.0",
69
- "typescript": "5.0.4",
71
+ "typescript": "5.9.3",
70
72
  "vitest": "2.1.9"
71
73
  },
72
74
  "tsd": {
73
75
  "directory": "src/__tests__/test-d"
74
76
  },
75
- "gitHead": "6545e14f68b8927c84d75ae45f287a43f19a0bb2"
77
+ "gitHead": "87edb81155e7376caa159611e6f2fd8e8c3dfdec"
76
78
  }
@@ -1,5 +0,0 @@
1
- export {};
2
- /**
3
- * @ignore
4
- * @experimental do not use in production
5
- */
@@ -1,38 +0,0 @@
1
- export type * from './accordion.synced';
2
- export type * from './alert.synced';
3
- export type * from './app-home-header-actions.synced';
4
- export type * from './button-row.synced';
5
- export type * from './button.synced';
6
- export type * from './card.synced';
7
- export type * from './chart.synced';
8
- export type * from './description-list.synced';
9
- export type * from './divider.synced';
10
- export type * from './dropdown.synced';
11
- export type * from './empty-state.synced';
12
- export type * from './error-state.synced';
13
- export type * from './form.synced';
14
- export type * from './heading.synced';
15
- export type * from './icon.synced';
16
- export type * from './iframe.synced';
17
- export type * from './illustration.synced';
18
- export type * from './image.synced';
19
- export type * from './inputs.synced';
20
- export type * from './layouts.synced';
21
- export type * from './link.synced';
22
- export type * from './list.synced';
23
- export type * from './loading-spinner.synced';
24
- export type * from './modal.synced';
25
- export type * from './panel.synced';
26
- export type * from './progress-bar.synced';
27
- export type * from './selects.synced';
28
- export type * from './statistics.synced';
29
- export type * from './status-tag.synced';
30
- export type * from './step-indicator.synced';
31
- export type * from './table.synced';
32
- export type * from './tabs.synced';
33
- export type * from './tag.synced';
34
- export type * from './text.synced';
35
- export type * from './tile.synced';
36
- export type * from './toggle.synced';
37
- export type * from './toggleInputs.synced';
38
- export type * from './tooltip.synced';
@@ -1,8 +0,0 @@
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';
@@ -1 +0,0 @@
1
- export * from './shared.synced'; // NOTE: `shared.ts` has some exported classes so we can't use `export type` for now