@hubspot/ui-extensions 0.8.52 → 0.8.53
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__/experimental/crm/fetchCrmProperties.spec.d.ts +1 -0
- package/dist/__tests__/experimental/crm/fetchCrmProperties.spec.js +58 -0
- package/dist/__tests__/experimental/hooks/useCrmProperties.spec.d.ts +1 -0
- package/dist/__tests__/experimental/hooks/useCrmProperties.spec.js +71 -0
- package/dist/experimental/crm/fetchCrmProperties.d.ts +4 -0
- package/dist/experimental/crm/fetchCrmProperties.js +32 -0
- package/dist/experimental/hooks/useCrmProperties.d.ts +6 -4
- package/dist/experimental/hooks/useCrmProperties.js +33 -9
- package/dist/experimental/index.d.ts +13 -1
- package/dist/experimental/index.js +9 -1
- package/dist/experimental/types.d.ts +11 -0
- package/dist/types.d.ts +1756 -1724
- package/dist/types.js +27 -24
- package/package.json +9 -3
- package/dist/experimental/crm/propertyManager.d.ts +0 -8
- package/dist/experimental/crm/propertyManager.js +0 -36
package/dist/types.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// From: shared.ts
|
|
3
|
+
// ============================================
|
|
1
4
|
export class ExtensionEvent {
|
|
2
5
|
type;
|
|
3
6
|
bubbles;
|
|
@@ -17,11 +20,6 @@ export class FormSubmitExtensionEvent extends ExtensionEvent {
|
|
|
17
20
|
this.targetValue = value;
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
|
-
export const chartFieldTypes = {
|
|
21
|
-
datetime: 'datetime',
|
|
22
|
-
linear: 'linear',
|
|
23
|
-
category: 'category',
|
|
24
|
-
};
|
|
25
23
|
export const iconNames = {
|
|
26
24
|
success: 'success',
|
|
27
25
|
remove: 'remove',
|
|
@@ -169,22 +167,6 @@ export const iconNames = {
|
|
|
169
167
|
faceNeutralFilled: 'emojiFillNeutral',
|
|
170
168
|
faceSadFilled: 'emojiFillSad',
|
|
171
169
|
};
|
|
172
|
-
/**
|
|
173
|
-
* @category Serverless
|
|
174
|
-
*/
|
|
175
|
-
export var ServerlessExecutionStatus;
|
|
176
|
-
(function (ServerlessExecutionStatus) {
|
|
177
|
-
ServerlessExecutionStatus["Success"] = "SUCCESS";
|
|
178
|
-
ServerlessExecutionStatus["Error"] = "ERROR";
|
|
179
|
-
})(ServerlessExecutionStatus || (ServerlessExecutionStatus = {}));
|
|
180
|
-
export const EXTENSION_POINT_LOCATIONS = [
|
|
181
|
-
'crm.preview',
|
|
182
|
-
'crm.record.sidebar',
|
|
183
|
-
'crm.record.tab',
|
|
184
|
-
'helpdesk.sidebar',
|
|
185
|
-
'uie.playground.middle',
|
|
186
|
-
'settings',
|
|
187
|
-
];
|
|
188
170
|
/** @deprecated use ExtensionEvent/FormSubmitExtensionEvent instead */
|
|
189
171
|
export class RemoteEvent {
|
|
190
172
|
type;
|
|
@@ -198,6 +180,11 @@ export class RemoteEvent {
|
|
|
198
180
|
this.targetValue = value;
|
|
199
181
|
}
|
|
200
182
|
}
|
|
183
|
+
export const chartFieldTypes = {
|
|
184
|
+
datetime: 'datetime',
|
|
185
|
+
linear: 'linear',
|
|
186
|
+
category: 'category',
|
|
187
|
+
};
|
|
201
188
|
export const illustrationNames = {
|
|
202
189
|
// Standard 1:1 mappings
|
|
203
190
|
lock: 'lock',
|
|
@@ -231,13 +218,29 @@ export const illustrationNames = {
|
|
|
231
218
|
customObjects: 'custom-objects',
|
|
232
219
|
paymentsButton: 'payments-button',
|
|
233
220
|
automatedTesting: 'automated-testing',
|
|
234
|
-
middlePaneCards: 'middle-pane-cards',
|
|
235
|
-
propertiesSidebar: 'properties-sidebar',
|
|
236
221
|
emptyStateCharts: 'empty-state-charts',
|
|
237
222
|
// Special mappings that are not 1:1
|
|
238
223
|
meetings: 'meetings-small',
|
|
239
224
|
tickets: 'ticket-small',
|
|
240
|
-
sidebar: 'settings-sidebar',
|
|
241
225
|
errorGeneral: 'errors/general',
|
|
242
226
|
errorHourglass: 'errors/hourglass',
|
|
227
|
+
middlePaneCards: 'settings-middle-pane-cards',
|
|
228
|
+
propertiesSidebar: 'settings-properties-sidebar',
|
|
229
|
+
sidebar: 'settings-sidebar',
|
|
243
230
|
};
|
|
231
|
+
export const EXTENSION_POINT_LOCATIONS = [
|
|
232
|
+
'crm.preview',
|
|
233
|
+
'crm.record.sidebar',
|
|
234
|
+
'crm.record.tab',
|
|
235
|
+
'helpdesk.sidebar',
|
|
236
|
+
'uie.playground.middle',
|
|
237
|
+
'settings',
|
|
238
|
+
];
|
|
239
|
+
/**
|
|
240
|
+
* @category Serverless
|
|
241
|
+
*/
|
|
242
|
+
export var ServerlessExecutionStatus;
|
|
243
|
+
(function (ServerlessExecutionStatus) {
|
|
244
|
+
ServerlessExecutionStatus["Success"] = "SUCCESS";
|
|
245
|
+
ServerlessExecutionStatus["Error"] = "ERROR";
|
|
246
|
+
})(ServerlessExecutionStatus || (ServerlessExecutionStatus = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.53",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"watch": "npm run clean && tsc --watch",
|
|
12
12
|
"prepare": "npm run build",
|
|
13
13
|
"lint": "echo 'No linter configured for @hubspot/ui-extensions'",
|
|
14
|
-
"test": "
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"jest": "jest --watch"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
18
|
"dist"
|
|
@@ -55,10 +56,15 @@
|
|
|
55
56
|
}
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
59
|
+
"@testing-library/dom": "^10.4.0",
|
|
60
|
+
"@testing-library/react": "^14.1.2",
|
|
58
61
|
"@types/jest": "^29.5.13",
|
|
59
62
|
"jest": "^29.7.0",
|
|
63
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
60
65
|
"react-reconciler": "^0.29.0",
|
|
66
|
+
"ts-jest": "^29.1.1",
|
|
61
67
|
"typescript": "5.0.4"
|
|
62
68
|
},
|
|
63
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "2bad593e0b073687424cd1d365f68849fb448940"
|
|
64
70
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CrmHostActions } from 'types';
|
|
2
|
-
/**
|
|
3
|
-
* Core logic for managing CRM property interactions.
|
|
4
|
-
*/
|
|
5
|
-
export declare function createPropertyManager(actions: CrmHostActions): {
|
|
6
|
-
initializePropertyMonitoring(properties: string[], onInitialFetch: (properties: Record<string, string>) => void, onUpdate: (properties: Record<string, string>) => void): () => void;
|
|
7
|
-
refreshProperties: import("types").refreshObjectPropertiesAction;
|
|
8
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { logger } from '../../logger';
|
|
2
|
-
/**
|
|
3
|
-
* Core logic for managing CRM property interactions.
|
|
4
|
-
*/
|
|
5
|
-
export function createPropertyManager(actions) {
|
|
6
|
-
const { fetchCrmObjectProperties, onCrmPropertiesUpdate, refreshObjectProperties, } = actions;
|
|
7
|
-
let cleanup;
|
|
8
|
-
return {
|
|
9
|
-
initializePropertyMonitoring(properties, onInitialFetch, onUpdate) {
|
|
10
|
-
// Clean up any existing listeners.
|
|
11
|
-
if (cleanup) {
|
|
12
|
-
cleanup();
|
|
13
|
-
}
|
|
14
|
-
// Set up property update listener.
|
|
15
|
-
let isSubscribed = true;
|
|
16
|
-
const updateCallback = (props) => {
|
|
17
|
-
if (isSubscribed) {
|
|
18
|
-
onUpdate(props);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
onCrmPropertiesUpdate(properties, updateCallback);
|
|
22
|
-
// Fetch initial properties
|
|
23
|
-
fetchCrmObjectProperties(properties)
|
|
24
|
-
.then(onInitialFetch)
|
|
25
|
-
.catch((error) => {
|
|
26
|
-
logger.error(`Error fetching CRM object properties: ${error}`);
|
|
27
|
-
});
|
|
28
|
-
// Return cleanup function
|
|
29
|
-
cleanup = () => {
|
|
30
|
-
isSubscribed = false;
|
|
31
|
-
};
|
|
32
|
-
return cleanup;
|
|
33
|
-
},
|
|
34
|
-
refreshProperties: refreshObjectProperties,
|
|
35
|
-
};
|
|
36
|
-
}
|