@hubspot/ui-extensions-dev-server 0.9.5 → 0.9.8
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.
|
@@ -20,6 +20,14 @@ const constants_1 = require("./constants");
|
|
|
20
20
|
const types_1 = require("./types");
|
|
21
21
|
const DevModeParentInterface_1 = require("./DevModeParentInterface");
|
|
22
22
|
const utils_1 = require("./utils");
|
|
23
|
+
function getComponentName(componentType) {
|
|
24
|
+
if (componentType === types_1.UnifiedComponentTypes.SETTINGS) {
|
|
25
|
+
return 'Settings';
|
|
26
|
+
}
|
|
27
|
+
if (componentType === types_1.UnifiedComponentTypes.PAGE) {
|
|
28
|
+
return 'App Home';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
23
31
|
class DevModeUnifiedInterface extends DevModeParentInterface_1.DevModeParentInterface {
|
|
24
32
|
_generateAppExtensionMappings(components) {
|
|
25
33
|
var _a, _b, _c, _d;
|
|
@@ -62,12 +70,14 @@ class DevModeUnifiedInterface extends DevModeParentInterface_1.DevModeParentInte
|
|
|
62
70
|
});
|
|
63
71
|
// Build the extension mapping data
|
|
64
72
|
extensionUids.forEach((extensionUid) => {
|
|
73
|
+
var _a;
|
|
65
74
|
const extension = components[extensionUid];
|
|
66
75
|
// Update the extension entrypoint to be "relative" to the extension directory (eg from /app/card/card.jsx to ./card.jsx)
|
|
67
76
|
extension.config.entrypoint = `./${path_1.default.basename(extension.config.entrypoint)}`;
|
|
68
77
|
// Hardcode the extension name if this is a settings extension (the user does not provide a name for their settings card).
|
|
69
|
-
if (extension.componentType === types_1.UnifiedComponentTypes.SETTINGS
|
|
70
|
-
extension.
|
|
78
|
+
if (extension.componentType === types_1.UnifiedComponentTypes.SETTINGS ||
|
|
79
|
+
extension.componentType === types_1.UnifiedComponentTypes.PAGE) {
|
|
80
|
+
extension.config.name = (_a = getComponentName(extension.componentType)) !== null && _a !== void 0 ? _a : '';
|
|
71
81
|
}
|
|
72
82
|
// Add them to the app config
|
|
73
83
|
switch (extension.componentType) {
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -29,5 +29,6 @@ export declare const PUBLIC_APP = "public-app";
|
|
|
29
29
|
export declare const PRIVATE_APP = "private-app";
|
|
30
30
|
export declare const CARD_EXTENSION = "CARD";
|
|
31
31
|
export declare const SETTINGS_EXTENSION = "SETTINGS";
|
|
32
|
+
export declare const PAGE_EXTENSION = "PAGE";
|
|
32
33
|
export declare const SUPPORTED_APP_TYPES: string[];
|
|
33
34
|
export declare const SUPPORTED_EXTENSION_TYPES: string[];
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SUPPORTED_EXTENSION_TYPES = exports.SUPPORTED_APP_TYPES = exports.SETTINGS_EXTENSION = exports.CARD_EXTENSION = exports.PRIVATE_APP = exports.PUBLIC_APP = exports.PLATFORM_VERSION = exports.SERVER_CAPABILITIES = exports.PROXY_CAPABILITY = exports.WEBSOCKET_MESSAGE_VERSION = exports.EXTENSIONS_MESSAGE_VERSION = exports.ROLLUP_OPTIONS = exports.WEBSOCKET_DEFAULT_PORT = exports.EXPRESS_DEFAULT_PORT = exports.VITE_DEV_SERVER_ID = exports.EXPRESS_SERVER_ID = exports.MANIFEST_FILE = exports.OUTPUT_DIR = void 0;
|
|
3
|
+
exports.SUPPORTED_EXTENSION_TYPES = exports.SUPPORTED_APP_TYPES = exports.PAGE_EXTENSION = exports.SETTINGS_EXTENSION = exports.CARD_EXTENSION = exports.PRIVATE_APP = exports.PUBLIC_APP = exports.PLATFORM_VERSION = exports.SERVER_CAPABILITIES = exports.PROXY_CAPABILITY = exports.WEBSOCKET_MESSAGE_VERSION = exports.EXTENSIONS_MESSAGE_VERSION = exports.ROLLUP_OPTIONS = exports.WEBSOCKET_DEFAULT_PORT = exports.EXPRESS_DEFAULT_PORT = exports.VITE_DEV_SERVER_ID = exports.EXPRESS_SERVER_ID = exports.MANIFEST_FILE = exports.OUTPUT_DIR = void 0;
|
|
4
4
|
exports.OUTPUT_DIR = 'dist';
|
|
5
5
|
exports.MANIFEST_FILE = 'manifest.json';
|
|
6
6
|
exports.EXPRESS_SERVER_ID = 'ui-extensions-dev-server';
|
|
@@ -41,5 +41,10 @@ exports.PUBLIC_APP = 'public-app';
|
|
|
41
41
|
exports.PRIVATE_APP = 'private-app';
|
|
42
42
|
exports.CARD_EXTENSION = 'CARD';
|
|
43
43
|
exports.SETTINGS_EXTENSION = 'SETTINGS';
|
|
44
|
+
exports.PAGE_EXTENSION = 'PAGE';
|
|
44
45
|
exports.SUPPORTED_APP_TYPES = [exports.PUBLIC_APP, exports.PRIVATE_APP];
|
|
45
|
-
exports.SUPPORTED_EXTENSION_TYPES = [
|
|
46
|
+
exports.SUPPORTED_EXTENSION_TYPES = [
|
|
47
|
+
exports.CARD_EXTENSION,
|
|
48
|
+
exports.SETTINGS_EXTENSION,
|
|
49
|
+
exports.PAGE_EXTENSION,
|
|
50
|
+
];
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -130,10 +130,11 @@ export type UnifiedCardConfig = {
|
|
|
130
130
|
export declare enum UnifiedComponentTypes {
|
|
131
131
|
CARD = "CARD",
|
|
132
132
|
APPLICATION = "APPLICATION",
|
|
133
|
-
SETTINGS = "SETTINGS"
|
|
133
|
+
SETTINGS = "SETTINGS",
|
|
134
|
+
PAGE = "PAGE"
|
|
134
135
|
}
|
|
135
136
|
export type UnifiedExtensionComponent = Omit<UnifiedCardConfig, 'type'> & {
|
|
136
|
-
componentType: UnifiedComponentTypes.CARD | UnifiedComponentTypes.SETTINGS;
|
|
137
|
+
componentType: UnifiedComponentTypes.CARD | UnifiedComponentTypes.SETTINGS | UnifiedComponentTypes.PAGE;
|
|
137
138
|
componentDeps: {
|
|
138
139
|
app: string;
|
|
139
140
|
};
|
package/dist/lib/types.js
CHANGED
|
@@ -11,4 +11,5 @@ var UnifiedComponentTypes;
|
|
|
11
11
|
UnifiedComponentTypes["CARD"] = "CARD";
|
|
12
12
|
UnifiedComponentTypes["APPLICATION"] = "APPLICATION";
|
|
13
13
|
UnifiedComponentTypes["SETTINGS"] = "SETTINGS";
|
|
14
|
+
UnifiedComponentTypes["PAGE"] = "PAGE";
|
|
14
15
|
})(UnifiedComponentTypes || (exports.UnifiedComponentTypes = UnifiedComponentTypes = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions-dev-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"uie": "./dist/lib/bin/cli.js"
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"optional": true
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "68d176099343d6d202421ec241c131f1d07562a8"
|
|
74
74
|
}
|