@hubspot/ui-extensions 0.7.1 → 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.
- package/README.md +12 -5
- package/dist/crm/components.d.ts +17 -2
- package/dist/crm/components.js +4 -1
- package/dist/crm/index.d.ts +2 -2
- package/dist/crm/index.js +2 -2
- package/dist/types.d.ts +87 -3
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ React components and utilities for extending HubSpot's UI.
|
|
|
23
23
|
- [Input](#input)
|
|
24
24
|
- [Link](#link)
|
|
25
25
|
- [LoadingSpinner](#loadingspinner)
|
|
26
|
-
- [
|
|
26
|
+
- [MultiSelect](#multiselect)
|
|
27
27
|
- [NumberInput](#numberInput)
|
|
28
28
|
- [ProgressBar](#progressbar)
|
|
29
29
|
- [Select](#select)
|
|
@@ -391,7 +391,15 @@ interface DateInputProps {
|
|
|
391
391
|
max?: { year: number; month: number; date: number };
|
|
392
392
|
minValidationMessage?: string;
|
|
393
393
|
maxValidationMessage?: string;
|
|
394
|
-
format?:
|
|
394
|
+
format?:
|
|
395
|
+
| 'YYYY-MM-DD'
|
|
396
|
+
| 'L'
|
|
397
|
+
| 'LL'
|
|
398
|
+
| 'll'
|
|
399
|
+
| 'short'
|
|
400
|
+
| 'long'
|
|
401
|
+
| 'medium'
|
|
402
|
+
| 'standard';
|
|
395
403
|
timezone?: 'userTz' | 'portalTz';
|
|
396
404
|
clearButtonLabel?: string;
|
|
397
405
|
todayButtonLabel?: string;
|
|
@@ -430,7 +438,6 @@ interface DateInputProps {
|
|
|
430
438
|
- standard: `1986-09-04`
|
|
431
439
|
- L: `09/04/1986`
|
|
432
440
|
- LL: `September 4, 1986`
|
|
433
|
-
- l: `9/4/1986`
|
|
434
441
|
- ll : `Sep 4, 1986`
|
|
435
442
|
- YYYY-MM-DD: `1986-09-04`
|
|
436
443
|
|
|
@@ -999,10 +1006,10 @@ const Extension = () => {
|
|
|
999
1006
|
return <LoadingSpinner label="Loading..." />;
|
|
1000
1007
|
};
|
|
1001
1008
|
```
|
|
1002
|
-
###
|
|
1009
|
+
### MultiSelect
|
|
1003
1010
|
|
|
1004
1011
|
```javascript
|
|
1005
|
-
import {
|
|
1012
|
+
import { MultiSelect } from '@hubspot/ui-extensions';
|
|
1006
1013
|
```
|
|
1007
1014
|
|
|
1008
1015
|
### Props
|
package/dist/crm/components.d.ts
CHANGED
|
@@ -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
|
-
|
|
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, };
|
package/dist/crm/components.js
CHANGED
|
@@ -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
|
-
|
|
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, };
|
package/dist/crm/index.d.ts
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/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
|
|
436
|
-
|
|
437
|
-
|
|
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.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"clean": "rm -rf dist/",
|
|
10
10
|
"build": "npm run clean && tsc",
|
|
11
11
|
"watch": "npm run clean && tsc --watch",
|
|
12
|
-
"prepare": "npm run build"
|
|
12
|
+
"prepare": "npm run build",
|
|
13
|
+
"lint": "echo 'No linter configured for @hubspot/ui-extensions'",
|
|
14
|
+
"test": "echo 'No tests configured for @hubspot/ui-extensions'"
|
|
13
15
|
},
|
|
14
16
|
"files": [
|
|
15
17
|
"dist/**/*"
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"devDependencies": {
|
|
49
51
|
"typescript": "5.0.4"
|
|
50
52
|
},
|
|
51
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "663cfa5f4b81bb923da5e8679e5be5437d1ddd00"
|
|
52
54
|
}
|