@hubspot/ui-extensions 0.12.2 → 0.12.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.
- package/dist/__tests__/crm/utils/fetchAssociations.spec.js +2 -1
- package/dist/__tests__/crm/utils/fetchCrmProperties.spec.js +1 -1
- package/dist/crm/hooks/useAssociations.d.ts +3 -11
- package/dist/crm/hooks/useAssociations.js +3 -2
- package/dist/crm/hooks/useCrmProperties.d.ts +1 -1
- package/dist/crm/hooks/useCrmProperties.js +2 -2
- package/dist/crm/utils/fetchAssociations.d.ts +1 -9
- package/dist/crm/utils/fetchAssociations.js +0 -11
- package/dist/crm/utils/fetchCrmProperties.js +0 -1
- package/dist/experimental/pages/components/index.d.ts +1 -0
- package/dist/experimental/pages/components/index.js +1 -0
- package/dist/experimental/pages/components/page-routes.d.ts +83 -0
- package/dist/experimental/pages/components/page-routes.js +66 -0
- package/dist/experimental/pages/create-page-router.d.ts +35 -0
- package/dist/experimental/pages/create-page-router.js +123 -0
- package/dist/experimental/pages/create-page-router.test.d.ts +1 -0
- package/dist/experimental/pages/create-page-router.test.js +296 -0
- package/dist/experimental/pages/hooks.d.ts +8 -0
- package/dist/experimental/pages/hooks.js +15 -0
- package/dist/experimental/pages/index.d.ts +6 -0
- package/dist/experimental/pages/index.js +4 -0
- package/dist/experimental/pages/internal/app-page-route-context.d.ts +16 -0
- package/dist/experimental/pages/internal/app-page-route-context.js +12 -0
- package/dist/experimental/pages/internal/convert-page-routes-react-elements.d.ts +9 -0
- package/dist/experimental/pages/internal/convert-page-routes-react-elements.js +138 -0
- package/dist/experimental/pages/internal/page-router-internal-types.d.ts +40 -0
- package/dist/experimental/pages/internal/page-router-internal-types.js +5 -0
- package/dist/experimental/pages/internal/trie-router.d.ts +31 -0
- package/dist/experimental/pages/internal/trie-router.js +141 -0
- package/dist/experimental/pages/internal/trie-router.test.d.ts +1 -0
- package/dist/experimental/pages/internal/trie-router.test.js +263 -0
- package/dist/experimental/pages/internal/useAppPageLocation.d.ts +1 -0
- package/dist/experimental/pages/internal/useAppPageLocation.js +13 -0
- package/dist/experimental/pages/types.d.ts +29 -0
- package/dist/experimental/pages/types.js +1 -0
- package/dist/hs-internal/__tests__/createRemoteComponentInternal.spec.js +4 -4
- package/dist/hubspot.js +0 -1
- package/dist/internal/global-utils.d.ts +1 -1
- package/dist/internal/hook-utils.d.ts +7 -6
- package/dist/internal/hook-utils.js +8 -9
- package/dist/pages/index.d.ts +1 -0
- package/dist/pages/index.js +1 -0
- package/dist/shared/remoteComponents.d.ts +28 -2
- package/dist/shared/remoteComponents.js +32 -0
- package/dist/shared/types/components/accordion.d.ts +2 -2
- package/dist/shared/types/components/alert.d.ts +2 -2
- package/dist/shared/types/components/app-home-header-actions.d.ts +3 -3
- package/dist/shared/types/components/button-row.d.ts +2 -2
- package/dist/shared/types/components/button.d.ts +5 -5
- package/dist/shared/types/components/card.d.ts +2 -2
- package/dist/shared/types/components/chart.d.ts +1 -1
- package/dist/shared/types/components/description-list.d.ts +2 -2
- package/dist/shared/types/components/divider.d.ts +1 -1
- package/dist/shared/types/components/dropdown.d.ts +2 -3
- package/dist/shared/types/components/empty-state.d.ts +2 -2
- package/dist/shared/types/components/error-state.d.ts +2 -2
- package/dist/shared/types/components/form.d.ts +3 -3
- package/dist/shared/types/components/heading.d.ts +2 -2
- package/dist/shared/types/components/icon.d.ts +3 -3
- package/dist/shared/types/components/iframe.d.ts +1 -1
- package/dist/shared/types/components/illustration.d.ts +1 -1
- package/dist/shared/types/components/image.d.ts +4 -4
- package/dist/shared/types/components/inputs.d.ts +8 -2
- package/dist/shared/types/components/layouts.d.ts +2 -2
- package/dist/shared/types/components/link.d.ts +5 -5
- package/dist/shared/types/components/list.d.ts +2 -2
- package/dist/shared/types/components/loading-spinner.d.ts +1 -1
- package/dist/shared/types/components/modal.d.ts +2 -2
- package/dist/shared/types/components/panel.d.ts +2 -2
- package/dist/shared/types/components/progress-bar.d.ts +1 -1
- package/dist/shared/types/components/score.d.ts +2 -2
- package/dist/shared/types/components/selects.d.ts +1 -1
- package/dist/shared/types/components/spacer.d.ts +1 -1
- package/dist/shared/types/components/statistics.d.ts +2 -2
- package/dist/shared/types/components/status-tag.d.ts +2 -2
- package/dist/shared/types/components/step-indicator.d.ts +1 -1
- package/dist/shared/types/components/table.d.ts +2 -2
- package/dist/shared/types/components/tabs.d.ts +2 -2
- package/dist/shared/types/components/tag.d.ts +3 -3
- package/dist/shared/types/components/text.d.ts +2 -2
- package/dist/shared/types/components/tile.d.ts +2 -2
- package/dist/shared/types/components/toggle.d.ts +1 -1
- package/dist/shared/types/components/toggleInputs.d.ts +1 -1
- package/dist/shared/types/components/tooltip.d.ts +2 -2
- package/dist/shared/types/crm.d.ts +2 -2
- package/dist/shared/types/experimental.d.ts +1 -1
- package/dist/shared/types/extend.d.ts +2 -2
- package/dist/shared/types/extension-points.d.ts +4 -5
- package/dist/shared/types/pages/app-pages-types.d.ts +75 -0
- package/dist/shared/types/pages/app-pages-types.js +1 -0
- package/dist/shared/types/pages/components/index.d.ts +4 -0
- package/dist/shared/types/pages/components/index.js +1 -0
- package/dist/shared/types/pages/components/page-breadcrumbs.d.ts +34 -0
- package/dist/shared/types/pages/components/page-breadcrumbs.js +1 -0
- package/dist/shared/types/pages/components/page-header.d.ts +82 -0
- package/dist/shared/types/pages/components/page-header.js +1 -0
- package/dist/shared/types/pages/components/page-link.d.ts +25 -0
- package/dist/shared/types/pages/components/page-link.js +1 -0
- package/dist/shared/types/pages/components/page-routes.d.ts +115 -0
- package/dist/shared/types/pages/components/page-routes.js +1 -0
- package/dist/shared/types/pages/components/page-title.d.ts +12 -0
- package/dist/shared/types/pages/components/page-title.js +1 -0
- package/dist/shared/types/pages/index.d.ts +1 -0
- package/dist/shared/types/pages/index.js +1 -0
- package/dist/shared/types/pages.d.ts +1 -0
- package/dist/shared/types/pages.js +1 -0
- package/dist/shared/types/shared.d.ts +15 -1
- package/dist/shared/types/worker-globals.d.ts +8 -3
- package/dist/shared/utils/remote-component-registry.d.ts +1 -1
- package/dist/testing/__tests__/isMatch.spec.js +1 -1
- package/dist/testing/__tests__/mocks.runServerlessFunction.spec.js +1 -1
- package/dist/testing/__tests__/mocks.useAssociations.spec.js +2 -2
- package/dist/testing/__tests__/mocks.useCrmProperties.spec.js +2 -2
- package/dist/testing/__tests__/mocks.useExtensionActions.spec.js +1 -1
- package/dist/testing/__tests__/mocks.useExtensionApi.spec.js +1 -1
- package/dist/testing/__tests__/mocks.useExtensionContext.spec.js +1 -1
- package/dist/testing/internal/convert.d.ts +1 -1
- package/dist/testing/internal/convert.js +4 -5
- package/dist/testing/internal/debug.d.ts +1 -1
- package/dist/testing/internal/element.d.ts +1 -1
- package/dist/testing/internal/errors.d.ts +2 -2
- package/dist/testing/internal/fragment.d.ts +1 -1
- package/dist/testing/internal/match.d.ts +2 -2
- package/dist/testing/internal/mocks/index.d.ts +15 -7
- package/dist/testing/internal/mocks/index.js +20 -6
- package/dist/testing/internal/mocks/mock-app-page-location.d.ts +7 -0
- package/dist/testing/internal/mocks/mock-app-page-location.js +35 -0
- package/dist/testing/internal/mocks/mock-extension-point-api.d.ts +2 -1
- package/dist/testing/internal/mocks/mock-extension-point-api.js +1 -1
- package/dist/testing/internal/mocks/mock-hooks.d.ts +1 -1
- package/dist/testing/internal/mocks/mock-hooks.js +12 -7
- package/dist/testing/internal/text.d.ts +2 -2
- package/dist/testing/internal/type-utils-internal.d.ts +2 -2
- package/dist/testing/internal/types-internal.d.ts +6 -6
- package/dist/testing/render.d.ts +2 -2
- package/dist/testing/render.js +12 -12
- package/dist/testing/type-utils.d.ts +1 -1
- package/dist/testing/type-utils.js +1 -1
- package/dist/testing/types.d.ts +27 -11
- package/dist/testing/utils.d.ts +1 -1
- package/dist/testing/utils.js +1 -1
- package/dist/utils/pagination.d.ts +17 -0
- package/dist/utils/pagination.js +10 -0
- package/package.json +31 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps, TShirtSizes } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Accordion](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/accordion).
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Alert](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/alert).
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ReactionsHandler } from '../reactions.ts';
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
3
|
+
import type { BaseComponentProps, ExtensionEvent, HrefProp, OverlayComponentProps } from '../shared.ts';
|
|
4
4
|
/**
|
|
5
5
|
* The props type for [HeaderActions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/create-an-app-home-page#headeractions).
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps, TShirtSizes } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [ButtonRow](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/button-row).
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
3
|
+
import type { BaseComponentProps, ExtensionEvent, HrefProp, IconNames, OverlayComponentProps, TShirtSizes } from '../shared.ts';
|
|
4
4
|
export interface BaseButtonProps extends BaseComponentProps {
|
|
5
5
|
/**
|
|
6
6
|
* A function that will be invoked when the button is clicked. It receives an event object and a reactions object
|
|
@@ -10,9 +10,9 @@ export interface BaseButtonProps extends BaseComponentProps {
|
|
|
10
10
|
*/
|
|
11
11
|
onClick?: ReactionsHandler<ExtensionEvent>;
|
|
12
12
|
/**
|
|
13
|
-
* Include this prop to open a URL on click.
|
|
13
|
+
* Include this prop to open a URL on click. Can be set to a URL string or an object with the following fields:
|
|
14
14
|
* - `url` (string): the URL that will open on click.
|
|
15
|
-
* - `external` (boolean): set to `true` to open the URL in a new tab and display an external link icon. By default:
|
|
15
|
+
* - `external` (boolean, optional): set to `true` to open the URL in a new tab and display an external link icon. By default:
|
|
16
16
|
* - Links to HubSpot app pages will open in the same tab and will not include an icon.
|
|
17
17
|
* - Links to non-HubSpot app pages will open in a new tab and include the icon.
|
|
18
18
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [DescriptionListItem](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/description-list).
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllDistances, BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { AllDistances, BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [Divider](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/divider).
|
|
4
4
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ExtensionEvent, OverlayComponentProps } from '../shared.ts';
|
|
4
|
-
import { ReactionsHandler } from '../reactions.ts';
|
|
2
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
3
|
+
import type { BaseComponentProps, ExtensionEvent, OverlayComponentProps, TShirtSizes } from '../shared.ts';
|
|
5
4
|
/**
|
|
6
5
|
* @deprecated This type is deprecated and will be removed in a future release. Please use the `DropdownButtonItem` component instead.
|
|
7
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export type EmptyStateImageName = 'addOnReporting' | 'announcement' | 'api' | 'automatedTesting' | 'beta' | 'building' | 'callingSetUp' | 'companies' | 'components' | 'cone' | 'contacts' | 'contentStrategy' | 'customObjects' | 'customerExperience' | 'customerSupport' | 'deals' | 'developerSecurityUpdate' | 'electronicSignature' | 'electronicSignatureEmptyState' | 'emailConfirmation' | 'emptyStateCharts' | 'idea' | 'integrations' | 'leads' | 'lock' | 'meetings' | 'missedGoal' | 'multipleObjects' | 'object' | 'productsShoppingCart' | 'registration' | 'sandboxAddOn' | 'social' | 'store' | 'storeDisabled' | 'successfullyConnectedEmail' | 'target' | 'task' | 'tickets' | 'voteAndSearch';
|
|
4
4
|
/**
|
|
5
5
|
* The props type for [EmptyState](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/empty-state).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [ErrorState](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/error-state).
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
3
|
+
import type { BaseComponentProps, FormSubmitExtensionEvent } from '../shared.ts';
|
|
4
4
|
export type FormInputValues = Record<string, string | number>;
|
|
5
5
|
/**
|
|
6
6
|
* The props type for [Form](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/form).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Heading](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/heading).
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseComponentProps, IconNames, TShirtSizes } from '../shared.ts';
|
|
2
2
|
export type IconColor = 'alert' | 'warning' | 'success' | 'inherit';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Icon](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/icon).
|
|
@@ -7,13 +7,13 @@ export type IconColor = 'alert' | 'warning' | 'success' | 'inherit';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface IconProps extends BaseComponentProps {
|
|
9
9
|
/**
|
|
10
|
-
* The color of the icon.
|
|
10
|
+
* The color of the icon. See the [colors section](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/icon#colors) for details.
|
|
11
11
|
*
|
|
12
12
|
* @defaultValue `"inherit"`
|
|
13
13
|
*/
|
|
14
14
|
color?: IconColor;
|
|
15
15
|
/**
|
|
16
|
-
* Sets the icon to display.
|
|
16
|
+
* Sets the icon to display. See [all available icons](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/icon#available-icons).
|
|
17
17
|
*/
|
|
18
18
|
name: IconNames;
|
|
19
19
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [Illustration](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/illustration).
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
2
|
+
import type { BaseComponentProps, ExtensionEvent, HrefProp, OverlayComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Image](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/image).
|
|
5
5
|
*
|
|
@@ -12,9 +12,9 @@ export interface ImageProps extends OverlayComponentProps, BaseComponentProps {
|
|
|
12
12
|
*/
|
|
13
13
|
alt?: string;
|
|
14
14
|
/**
|
|
15
|
-
* When provided, sets the URL that will open when the image is clicked.
|
|
15
|
+
* When provided, sets the URL that will open when the image is clicked. Can be set to a URL string or an object with the following fields:
|
|
16
16
|
* - `url` (string): the URL that will open on click.
|
|
17
|
-
* - `external` (boolean): set to `true` to open the URL in a new tab. By default:
|
|
17
|
+
* - `external` (boolean, optional): set to `true` to open the URL in a new tab. By default:
|
|
18
18
|
* - Links to HubSpot app pages will open in the same tab.
|
|
19
19
|
* - Links to non-HubSpot app pages will open in a new tab.
|
|
20
20
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Generic collection of props for all inputs
|
|
4
4
|
* @internal
|
|
@@ -155,6 +155,12 @@ export interface NumberInputProps extends BaseInputForNumber {
|
|
|
155
155
|
formatStyle?: 'decimal' | 'percentage';
|
|
156
156
|
/** @deprecated use onChange instead. It doesn't guarantee valid format */
|
|
157
157
|
onInput?: (value: number) => void;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the horizontal alignment of the text in the input.
|
|
160
|
+
*
|
|
161
|
+
* @defaultValue `"left"`
|
|
162
|
+
*/
|
|
163
|
+
textAlign?: 'left' | 'right';
|
|
158
164
|
}
|
|
159
165
|
/**
|
|
160
166
|
* The props type for [CurrencyInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/currency-input).
|
|
@@ -185,7 +191,7 @@ export interface CurrencyInputProps extends BaseInputForNumber {
|
|
|
185
191
|
*
|
|
186
192
|
* @category Component Props
|
|
187
193
|
*/
|
|
188
|
-
export interface StepperInputProps extends Omit<NumberInputProps, 'onInput'> {
|
|
194
|
+
export interface StepperInputProps extends Omit<NumberInputProps, 'onInput' | 'textAlign'> {
|
|
189
195
|
/** The amount that the current value will increase or decrease by. Default is `1`.
|
|
190
196
|
* @defaultValue `1`
|
|
191
197
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AllDistances, BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AllDistances, BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Stack](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/flex).
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
3
|
+
import type { BaseComponentProps, ExtensionEvent, HrefProp, OverlayComponentProps } from '../shared.ts';
|
|
4
4
|
/**
|
|
5
5
|
* The props type for [Link](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/link).
|
|
6
6
|
*
|
|
@@ -13,9 +13,9 @@ export interface LinkProps extends OverlayComponentProps, BaseComponentProps {
|
|
|
13
13
|
*/
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
/**
|
|
16
|
-
* Sets the link's URL and open behavior.
|
|
16
|
+
* Sets the link's URL and open behavior. Can be set to a URL string or an object with the following fields:
|
|
17
17
|
* - `url` (string): the URL that will open on click.
|
|
18
|
-
* - `external` (boolean): set to `true` to open the URL in a new tab and display an external link icon. By default:
|
|
18
|
+
* - `external` (boolean, optional): set to `true` to open the URL in a new tab and display an external link icon. By default:
|
|
19
19
|
* - Links to HubSpot app pages will open in the same tab and will not include an icon.
|
|
20
20
|
* - Links to non-HubSpot app pages will open in a new tab and include the icon.
|
|
21
21
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [List](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/list).
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseComponentProps, TShirtSizes } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [LoadingSpinner](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/loading-spinner).
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps, TShirtSizes } from '../shared.ts';
|
|
3
3
|
export interface ModalProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
5
|
* The modal's accessibility label.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps, TShirtSizes } from '../shared.ts';
|
|
3
3
|
export interface PanelProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
5
|
* The panel's accessibility label.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [ProgressBar](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/progress-bar).
|
|
4
4
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
|
-
* The props type for
|
|
3
|
+
* The props type for [ScoreCircle](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/scorecircle)
|
|
4
4
|
*
|
|
5
5
|
* @category Component Props
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllSizesUnaliased, BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { AllSizesUnaliased, BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [Spacer](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/spacer)
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [StatisticsTrend](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/statistics).
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [StatusTag](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/status-tag).
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllSizes, BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { AllSizes, BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [StepIndicator](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/step-indicator).
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export interface AlignmentProps {
|
|
4
4
|
/**
|
|
5
5
|
* Sets the alignment of the table element.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export interface TabsProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
5
|
* Sets the content that will render inside the component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactionsHandler } from '../reactions.ts';
|
|
3
|
+
import type { BaseComponentProps, ExtensionEvent, OverlayComponentProps } from '../shared.ts';
|
|
4
4
|
/**
|
|
5
5
|
* The props type for [Tag](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/tag).
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The props type for [Tile](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/tile).
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseComponentProps, TShirtSizes } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [Toggle](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/toggle).
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The props type for [Checkbox](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/checkbox).
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseComponentProps } from '../shared.ts';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export interface TooltipProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
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.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps, TShirtSizes } from './shared.ts';
|
|
3
3
|
export interface CrmDataHighlightProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
5
|
* 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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ReactionsHandler } from './reactions.ts';
|
|
3
|
-
import type { AllDistances,
|
|
3
|
+
import type { AllDistances, BaseComponentProps, ExtensionEvent } from './shared.ts';
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
6
6
|
* @experimental do not use in production
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ExtensionPointApi, ExtensionPoints } from './extension-points.ts';
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ExtensionPointApi, ExtensionPoints } from './extension-points.ts';
|
|
3
3
|
export type RenderExtensionCallback<TExtensionPointName extends keyof ExtensionPoints> = (api: ExtensionPointApi<TExtensionPointName>) => ReactElement<any>;
|
|
4
4
|
export type HubspotExtendFunction = <TExtensionPointName extends keyof ExtensionPoints>(renderExtensionCallback: RenderExtensionCallback<TExtensionPointName>) => void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { TypesOfReadOnlyArray } from './shared.ts';
|
|
3
|
-
import type { AppHomeContext, BaseContext, CrmContext } from './context.ts';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
4
2
|
import type { AppHomeActions, CrmHostActions, SettingsActions, UiePlatformActions } from './actions.ts';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
3
|
+
import type { AppHomeContext, BaseContext, CrmContext, GenericContext, SettingsContext } from './context.ts';
|
|
4
|
+
import type { CrmActionButtonProps, CrmActionLinkProps, CrmAssociationPivotProps, CrmAssociationPropertyListProps, CrmAssociationStageTrackerProps, CrmAssociationTableProps, CrmCardActionsProps, CrmDataHighlightProps, CrmPropertyListProps, CrmRelativeTimelineProps, CrmReportProps, CrmSimpleDeadlineProps, CrmStageTrackerProps, CrmStatisticsProps } from './crm.ts';
|
|
7
5
|
import type { ServerlessFuncRunner } from './http-requests.ts';
|
|
6
|
+
import type { TypesOfReadOnlyArray } from './shared.ts';
|
|
8
7
|
/** @ignore */
|
|
9
8
|
export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
|
|
10
9
|
/** @ignore */
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ComponentType, ReactElement } from 'react';
|
|
2
|
+
import type { EmptyProps, ReactFragmentProps } from '../shared.ts';
|
|
3
|
+
import type { PageRoutesProps } from './components/page-routes.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The props type for a PageRouter component.
|
|
6
|
+
*/
|
|
7
|
+
export type PageRouterProps = EmptyProps;
|
|
8
|
+
/**
|
|
9
|
+
* Represents the current page route that has been matched by the page router.
|
|
10
|
+
*/
|
|
11
|
+
export interface MatchedPageRoute {
|
|
12
|
+
/**
|
|
13
|
+
* The id of the route that has been matched.
|
|
14
|
+
*/
|
|
15
|
+
routeId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The path of the route that has been matched.
|
|
18
|
+
*/
|
|
19
|
+
path: string;
|
|
20
|
+
/**
|
|
21
|
+
* The parameters of the route that has been matched.
|
|
22
|
+
*/
|
|
23
|
+
params: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The component type for the page router that handles rendering matched routes.
|
|
27
|
+
*
|
|
28
|
+
* @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.
|
|
29
|
+
*/
|
|
30
|
+
export type PageRouterComponent = ComponentType<PageRouterProps>;
|
|
31
|
+
/**
|
|
32
|
+
* The function type for [createPageRouter](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/app-pages/reference#createpagerouter).
|
|
33
|
+
*
|
|
34
|
+
* Example usage:
|
|
35
|
+
*
|
|
36
|
+
* ```tsx
|
|
37
|
+
* const PageRouter = createPageRouter(
|
|
38
|
+
* <PageRoutes layoutComponent={AppLayout}>
|
|
39
|
+
* <PageRoutes.IndexRoute component={HomePage} id="home" />
|
|
40
|
+
* <PageRoutes.Route path="/docs" component={DocsPage} />
|
|
41
|
+
* <PageRoutes path="/customers" layoutComponent={CustomersLayout}>
|
|
42
|
+
* <PageRoutes.IndexRoute component={ListCustomersPage} />
|
|
43
|
+
* <PageRoutes.Route path="/:customerId" component={ViewCustomerPage} />
|
|
44
|
+
* </PageRoutes>
|
|
45
|
+
* <PageRoutes.AnyRoute component={NotFoundPage} />
|
|
46
|
+
* </PageRoutes>
|
|
47
|
+
* );
|
|
48
|
+
*
|
|
49
|
+
* function AppPages() {
|
|
50
|
+
* return <PageRouter />;
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* hubspot.extend<"pages">(() => <AppPages />);
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param routes The routes to render.
|
|
57
|
+
* @returns The page router component.
|
|
58
|
+
*
|
|
59
|
+
* @experimental This function is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates.
|
|
60
|
+
*/
|
|
61
|
+
export type CreatePageRouterFunction = (reactPageRoutesElement: ReactElement<PageRoutesProps> | ReactElement<ReactFragmentProps>) => PageRouterComponent;
|
|
62
|
+
/**
|
|
63
|
+
* The function type for [usePageRoute](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/app-pages/reference#usepageroute).
|
|
64
|
+
*
|
|
65
|
+
* Example usage:
|
|
66
|
+
*
|
|
67
|
+
* ```tsx
|
|
68
|
+
* const pageRoute = usePageRoute();
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @returns The current page route.
|
|
72
|
+
*
|
|
73
|
+
* @experimental This hook is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates.
|
|
74
|
+
*/
|
|
75
|
+
export type UsePageRouteHook = () => MatchedPageRoute;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseComponentProps } from '../../shared.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The props type for [PageBreadcrumbs](https://developers.hubspot.com/docs/reference/ui-components/app-page-components/page-breadcrumbs)
|
|
5
|
+
*/
|
|
6
|
+
export interface PageBreadcrumbsProps extends BaseComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* The links and text to render as breadcrumbs.
|
|
9
|
+
* Use `PageBreadcrumbs.PageLink` for navigable crumbs and `PageBreadcrumbs.Current` for the current page.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface PageBreadcrumbsPageLinkProps extends BaseComponentProps {
|
|
14
|
+
/**
|
|
15
|
+
* The path to navigate to when the link is clicked. Supports path parameters (e.g. `/view-contact/:contactId`).
|
|
16
|
+
*/
|
|
17
|
+
to: string;
|
|
18
|
+
/**
|
|
19
|
+
* Values for path parameters and query string entries.
|
|
20
|
+
* Parameters matching `:paramName` tokens in `to` are substituted into the path.
|
|
21
|
+
* Any remaining parameters are appended as query string entries.
|
|
22
|
+
*/
|
|
23
|
+
params?: Record<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* The visible text of the breadcrumb link.
|
|
26
|
+
*/
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export interface PageBreadcrumbsCurrentProps extends BaseComponentProps {
|
|
30
|
+
/**
|
|
31
|
+
* Label for the current location.
|
|
32
|
+
*/
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|