@hubspot/ui-extensions 0.7.2 → 0.7.3

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.
@@ -1,4 +1,4 @@
1
- import { CrmAssociationPivotProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmObjectPropertyProps, CrmPropertyListProps, CrmReportProps, CrmAssociationPropertyListProps, CrmStageTrackerProps } from '../types';
1
+ import { CrmAssociationPivotProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmObjectPropertyProps, CrmPropertyListProps, CrmReportProps, CrmAssociationPropertyListProps, CrmStageTrackerProps, CrmActionButtonProps, CrmActionLinkProps, CrmCardActionsProps } from '../types';
2
2
  declare const CrmObjectProperty: "CrmObjectProperty" & {
3
3
  readonly type?: "CrmObjectProperty" | undefined;
4
4
  readonly props?: CrmObjectPropertyProps | undefined;
@@ -39,4 +39,19 @@ declare const CrmStageTracker: "CrmStageTracker" & {
39
39
  readonly props?: CrmStageTrackerProps | undefined;
40
40
  readonly children?: true | undefined;
41
41
  } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmStageTracker", CrmStageTrackerProps, true>>;
42
- export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmStageTracker, };
42
+ declare const CrmActionButton: "CrmActionButton" & {
43
+ readonly type?: "CrmActionButton" | undefined;
44
+ readonly props?: CrmActionButtonProps | undefined;
45
+ readonly children?: true | undefined;
46
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmActionButton", CrmActionButtonProps, true>>;
47
+ declare const CrmActionLink: "CrmActionLink" & {
48
+ readonly type?: "CrmActionLink" | undefined;
49
+ readonly props?: CrmActionLinkProps | undefined;
50
+ readonly children?: true | undefined;
51
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmActionLink", CrmActionLinkProps, true>>;
52
+ declare const CrmCardActions: "CrmCardActions" & {
53
+ readonly type?: "CrmCardActions" | undefined;
54
+ readonly props?: CrmCardActionsProps | undefined;
55
+ readonly children?: true | undefined;
56
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmCardActions", CrmCardActionsProps, true>>;
57
+ export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmStageTracker, CrmActionButton, CrmActionLink, CrmCardActions, };
@@ -7,4 +7,7 @@ const CrmReport = createExtensionComponent('CrmReport');
7
7
  const CrmAssociationPivot = createExtensionComponent('CrmAssociationPivot');
8
8
  const CrmAssociationPropertyList = createExtensionComponent('CrmAssociationPropertyList');
9
9
  const CrmStageTracker = createExtensionComponent('CrmStageTracker');
10
- export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmStageTracker, };
10
+ const CrmActionButton = createExtensionComponent('CrmActionButton');
11
+ const CrmActionLink = createExtensionComponent('CrmActionLink');
12
+ const CrmCardActions = createExtensionComponent('CrmCardActions');
13
+ export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, CrmStageTracker, CrmActionButton, CrmActionLink, CrmCardActions, };
@@ -1,2 +1,2 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, };
1
+ import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, CrmActionButton, CrmActionLink, CrmCardActions } from './components';
2
+ export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, CrmActionButton, CrmActionLink, CrmCardActions, };
package/dist/crm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, };
1
+ import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, CrmActionButton, CrmActionLink, CrmCardActions, } from './components';
2
+ export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, CrmStageTracker, CrmActionButton, CrmActionLink, CrmCardActions, };
package/dist/types.d.ts CHANGED
@@ -350,6 +350,16 @@ export type AddAlertAction = (args: {
350
350
  type?: AlertType;
351
351
  message: string;
352
352
  }) => void;
353
+ export type NotifyObjectUpdateAction = (args: {
354
+ objectTypeId: string;
355
+ objectId: string;
356
+ }) => void;
357
+ export type ListenForObjectUpdateAction = (args: {
358
+ callback: (args: {
359
+ objectTypeId: string;
360
+ objectId: string;
361
+ }) => void;
362
+ }) => void;
353
363
  export type ReloadPageAction = () => void;
354
364
  export type FetchCrmObjectPropertiesAction = (properties: string[]) => Promise<Record<string, string>>;
355
365
  export type OpenIframeModalAction = (action: OpenIframeActionPayload) => void;
@@ -359,6 +369,8 @@ export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
359
369
  reloadPage: ReloadPageAction;
360
370
  fetchCrmObjectProperties: FetchCrmObjectPropertiesAction;
361
371
  openIframeModal: OpenIframeModalAction;
372
+ notifyObjectUpdate?: NotifyObjectUpdateAction;
373
+ listenForObjectUpdate?: ListenForObjectUpdateAction;
362
374
  };
363
375
  customComponents: {
364
376
  CrmPropertyList: ComponentType<CrmPropertyListProps>;
@@ -369,6 +381,20 @@ export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
369
381
  CrmObjectProperty?: ComponentType<CrmObjectPropertyProps>;
370
382
  CrmAssociationPropertyList?: ComponentType<CrmAssociationPropertyListProps>;
371
383
  CrmStageTracker?: ComponentType<CrmStageTrackerProps>;
384
+ CrmActionButton?: ComponentType<CrmActionButtonProps>;
385
+ CrmActionLink?: ComponentType<CrmActionLinkProps>;
386
+ CrmCardActions?: ComponentType<CrmCardActionsProps>;
387
+ };
388
+ }
389
+ export interface CrmSidebarExtensionPoint extends ExtensionPointContract {
390
+ actions: {
391
+ addAlert: AddAlertAction;
392
+ reloadPage: ReloadPageAction;
393
+ fetchCrmObjectProperties: FetchCrmObjectPropertiesAction;
394
+ openIframeModal: OpenIframeModalAction;
395
+ };
396
+ customComponents: {
397
+ [k: string]: never;
372
398
  };
373
399
  }
374
400
  export interface CrmDataHighlightProps {
@@ -432,11 +458,69 @@ export interface CrmStageTrackerProps {
432
458
  properties: Array<string>;
433
459
  showProperties?: boolean;
434
460
  }
435
- interface CrmSidebarExtensionPoint extends ExtensionPointContract {
436
- actions: {
437
- reloadPage: ReloadPageAction;
461
+ interface ObjectCoordinates {
462
+ objectTypeId: string;
463
+ objectId: number;
464
+ }
465
+ interface OpenRecordAssociationFormArgs {
466
+ objectTypeId: string;
467
+ association: {
468
+ objectTypeId: string;
469
+ objectId: number;
438
470
  };
439
471
  }
472
+ interface ActivityCreatorActionArgs {
473
+ objectTypeId: string;
474
+ objectId: number;
475
+ windowVariant?: 'windowed' | 'fullscreen';
476
+ }
477
+ interface ActionArgs {
478
+ PREVIEW_OBJECT: ObjectCoordinates;
479
+ ADD_NOTE: ActivityCreatorActionArgs;
480
+ SEND_EMAIL: ActivityCreatorActionArgs;
481
+ SCHEDULE_MEETING: ActivityCreatorActionArgs;
482
+ OPEN_RECORD_ASSOCIATION_FORM: OpenRecordAssociationFormArgs;
483
+ }
484
+ export type ArgsFor<SpecificActionType extends ActionType> = ActionArgs[SpecificActionType];
485
+ export type ActionType = 'PREVIEW_OBJECT' | 'ADD_NOTE' | 'SEND_EMAIL' | 'SCHEDULE_MEETING' | 'OPEN_RECORD_ASSOCIATION_FORM';
486
+ interface BaseActionComponent {
487
+ children: ReactNode;
488
+ actionType: ActionType;
489
+ actionContext: ArgsFor<ActionType>;
490
+ onError?: (errors: string[]) => void;
491
+ }
492
+ export interface CrmActionButtonProps extends BaseActionComponent {
493
+ variant?: 'primary' | 'secondary' | 'destructive';
494
+ type?: 'button' | 'reset' | 'submit';
495
+ }
496
+ export interface CrmActionLinkProps extends BaseActionComponent {
497
+ variant?: 'primary' | 'light' | 'dark' | 'destructive';
498
+ }
499
+ export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends ActionType = ActionType> {
500
+ type: 'action-library-button';
501
+ actionType: SpecificActionType;
502
+ actionContext: ArgsFor<SpecificActionType>;
503
+ label?: string;
504
+ disabled?: boolean;
505
+ tooltipText?: string;
506
+ }
507
+ export type DropdownCardActionConfigOptions = [
508
+ ActionLibraryButtonCardActionConfig,
509
+ ...ActionLibraryButtonCardActionConfig[]
510
+ ];
511
+ export interface DropdownCardActionConfig {
512
+ type: 'dropdown';
513
+ options: DropdownCardActionConfigOptions;
514
+ label?: string;
515
+ disabled?: boolean;
516
+ tooltipText?: string;
517
+ }
518
+ type ErrorHandler = (errors: string[]) => void;
519
+ type CardActionConfig = ActionLibraryButtonCardActionConfig | DropdownCardActionConfig;
520
+ export type CrmCardActionsProps = {
521
+ actionConfigs: Array<CardActionConfig>;
522
+ onError?: ErrorHandler;
523
+ };
440
524
  interface RemotePlaygroundExtensionPoint extends ExtensionPointContract {
441
525
  actions: {
442
526
  warn: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/ui-extensions",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,6 +10,7 @@
10
10
  "build": "npm run clean && tsc",
11
11
  "watch": "npm run clean && tsc --watch",
12
12
  "prepare": "npm run build",
13
+ "lint": "echo 'No linter configured for @hubspot/ui-extensions'",
13
14
  "test": "echo 'No tests configured for @hubspot/ui-extensions'"
14
15
  },
15
16
  "files": [
@@ -49,5 +50,5 @@
49
50
  "devDependencies": {
50
51
  "typescript": "5.0.4"
51
52
  },
52
- "gitHead": "291eae6851c5dc9be36952059ab8a7506e08b93b"
53
+ "gitHead": "663cfa5f4b81bb923da5e8679e5be5437d1ddd00"
53
54
  }