@hubspot/ui-extensions 0.8.52 → 0.8.54

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/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.52",
3
+ "version": "0.8.54",
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": "echo 'No tests configured for @hubspot/ui-extensions'"
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": "49d7e6ce23cf06a54cbe038f11bb1b5e57358254"
69
+ "gitHead": "d9ff369b4ca03d353dfea5ef566a8d88bdcbeadb"
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
- }