@hubspot/ui-extensions 0.8.4 → 0.8.5

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.
@@ -0,0 +1,7 @@
1
+ import type * as types from '../types';
2
+ /** @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. */
3
+ export declare const Panel: "Panel" & {
4
+ readonly type?: "Panel" | undefined;
5
+ readonly props?: types.PanelProps | undefined;
6
+ readonly children?: true | undefined;
7
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Panel", types.PanelProps, true>>;
@@ -0,0 +1,5 @@
1
+ import { createRemoteReactComponent } from '@remote-ui/react';
2
+ /** @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. */
3
+ export const Panel = createRemoteReactComponent('Panel', {
4
+ fragmentProps: ['footer'],
5
+ });
@@ -0,0 +1,2 @@
1
+ import { Panel } from './experimentalComponents';
2
+ export { Panel };
@@ -0,0 +1,2 @@
1
+ import { Panel } from './experimentalComponents';
2
+ export { Panel };
package/dist/hubspot.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { ReactElement } from 'react';
2
- import { ExtensionPoints, ExtensionPointApi } from './types';
2
+ import type { ExtensionPoints, ExtensionPointApi, ServerlessRunnerParams } from './types';
3
3
  export declare function extend_V2<ExtensionPointName extends keyof ExtensionPoints>(renderExtensionCallback: (api: ExtensionPointApi<ExtensionPointName>) => ReactElement<any>): any;
4
+ export declare function serverless<T = any>(name: ServerlessRunnerParams['name'], options?: Omit<ServerlessRunnerParams, 'name'>): Promise<T>;
4
5
  export declare const hubspot: {
5
6
  extend: typeof extend_V2;
7
+ serverless: typeof serverless;
6
8
  };
package/dist/hubspot.js CHANGED
@@ -1,6 +1,10 @@
1
1
  export function extend_V2(renderExtensionCallback) {
2
2
  return self.extend_V2(renderExtensionCallback);
3
3
  }
4
+ export function serverless(name, options) {
5
+ return self.serverless(name, options);
6
+ }
4
7
  export const hubspot = {
5
8
  extend: extend_V2,
9
+ serverless,
6
10
  };
package/dist/types.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare class FormSubmitExtensionEvent<V> extends ExtensionEvent {
10
10
  targetValue: V;
11
11
  constructor(value: V, event: Event);
12
12
  }
13
+ export type ReactionsHandler<T> = (event: T, reactions: Reactions) => void | Promise<void>;
13
14
  /**
14
15
  * The props type for {@link !components.Alert}.
15
16
  *
@@ -44,7 +45,7 @@ export interface ButtonProps {
44
45
  *
45
46
  * @event
46
47
  */
47
- onClick?: (event: ExtensionEvent, reactions: Reactions) => void;
48
+ onClick?: ReactionsHandler<ExtensionEvent>;
48
49
  /**
49
50
  * A URL that will be opened when the button is clicked. If the value is a URL external to `hubspot.com` it will be opened in a new tab.
50
51
  */
@@ -235,7 +236,7 @@ export interface FormProps {
235
236
  *
236
237
  * @event
237
238
  */
238
- onSubmit?: (event: FormSubmitExtensionEvent<FormInputValues>, reactions: Reactions) => void;
239
+ onSubmit?: ReactionsHandler<FormSubmitExtensionEvent<FormInputValues>>;
239
240
  /**
240
241
  * When set to `true`, `event.preventDefault()` will be invoked before the `onSubmit` function is called, preventing the default HTML form behavior.
241
242
  *
@@ -282,7 +283,7 @@ export interface ImageProps {
282
283
  *
283
284
  * @event
284
285
  */
285
- onClick?: (event: ExtensionEvent, reactions: Reactions) => void;
286
+ onClick?: ReactionsHandler<ExtensionEvent>;
286
287
  /**
287
288
  * The URL of the image to display.
288
289
  *
@@ -722,7 +723,7 @@ export interface TagProps {
722
723
  *
723
724
  * @event
724
725
  */
725
- onClick?: (event: ExtensionEvent, reactions: Reactions) => void;
726
+ onClick?: ReactionsHandler<ExtensionEvent>;
726
727
  }
727
728
  /**
728
729
  * @internal
@@ -793,7 +794,7 @@ export type TextProps = {
793
794
  *
794
795
  * - `false` => no truncation(default).
795
796
  * - `true` => truncates the string to a single line. Full-text will show inside the tooltip.
796
- * - { toolipText: 'some text' } => truncates the string and lets you control the contents of the tooltip.
797
+ * - { tooltipText: 'some text' } => truncates the string and lets you control the contents of the tooltip.
797
798
  * - { maxWidth: 150 } => sets the width(in pixel) of the line.
798
799
  *
799
800
  * @defaultValue `false`
@@ -802,7 +803,7 @@ export type TextProps = {
802
803
  };
803
804
  export interface TruncateOptions {
804
805
  maxWidth?: number;
805
- toolipText?: string;
806
+ tooltipText?: string;
806
807
  }
807
808
  /**
808
809
  * The props type for {@link !components.Tile}.
@@ -1128,11 +1129,11 @@ export interface StatisticsItemProps {
1128
1129
  /**
1129
1130
  * The string to be displayed as the item's primary number.
1130
1131
  */
1131
- number: string;
1132
+ number: string | number;
1132
1133
  /**
1133
1134
  * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.StatisticsTrend} or {@link !components.Text}.
1134
1135
  */
1135
- children: ReactNode;
1136
+ children?: ReactNode;
1136
1137
  }
1137
1138
  /**
1138
1139
  * The props type for {@link !components.Statistics}.
@@ -1723,7 +1724,7 @@ export interface LinkProps {
1723
1724
  *
1724
1725
  * @event
1725
1726
  */
1726
- onClick?: (event: ExtensionEvent, reactions: Reactions) => void;
1727
+ onClick?: ReactionsHandler<ExtensionEvent>;
1727
1728
  /**
1728
1729
  * When set to true, `event.preventDefault()` will be invoked before the `onClick` function is called, preventing automatic navigation to the href URL.
1729
1730
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/ui-extensions",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "exports": {
23
23
  ".": "./dist/index.js",
24
- "./crm": "./dist/crm/index.js"
24
+ "./crm": "./dist/crm/index.js",
25
+ "./experimental": "./dist/experimental/index.js"
25
26
  },
26
27
  "license": "MIT",
27
28
  "dependencies": {
@@ -50,5 +51,5 @@
50
51
  "devDependencies": {
51
52
  "typescript": "5.0.4"
52
53
  },
53
- "gitHead": "41e3484343d34136e81540d774a101ccf99642b3"
54
+ "gitHead": "c9d6a64b37208e4387fa09655c3ada9733dd8602"
54
55
  }