q2-tecton-platform 1.62.4 → 1.62.6
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/bundle-report.json +1 -1
- package/dist/esm/actions/actionRequiredSetup.js +2 -7
- package/dist/esm/actions/authorizeTransactionWithMfaSetup.js +1 -4
- package/dist/esm/actions/clearCacheSetup.js +4 -7
- package/dist/esm/actions/clearParamsSetup.js +1 -4
- package/dist/esm/actions/closeOverpanelSetup.js +3 -6
- package/dist/esm/actions/index.js +48 -51
- package/dist/esm/actions/keepAliveSetup.js +1 -4
- package/dist/esm/actions/loadingModalSetup.js +1 -4
- package/dist/esm/actions/logToServerSetup.js +3 -6
- package/dist/esm/actions/manageChangesSetup.js +1 -4
- package/dist/esm/actions/navigateToSetup.js +5 -8
- package/dist/esm/actions/openURLSetup.js +1 -4
- package/dist/esm/actions/printWindowSetup.js +1 -4
- package/dist/esm/actions/refetchAccountsSetup.js +1 -4
- package/dist/esm/actions/scrollToSetup.js +4 -7
- package/dist/esm/actions/scrollToTopSetup.js +1 -4
- package/dist/esm/actions/sendAlertSetup.js +1 -4
- package/dist/esm/actions/setParamsSetup.js +3 -6
- package/dist/esm/actions/setTitleSetup.js +3 -6
- package/dist/esm/actions/showActionSheetSetup.js +1 -4
- package/dist/esm/actions/showModalSetup.js +1 -4
- package/dist/esm/actions/showOverpanelSetup.js +7 -10
- package/dist/esm/actions/t.js +6 -9
- package/dist/esm/actions/verifyMFASetup.js +1 -4
- package/dist/esm/index.js +1 -5
- package/dist/esm/outlets/index.js +6 -9
- package/dist/esm/outlets/platform-outlet.js +35 -42
- package/dist/esm/private-helpers/assetPathResolvers.js +6 -11
- package/dist/esm/private-helpers/cdnOverrideSetup.js +1 -4
- package/dist/esm/private-helpers/contextResolver.js +2 -7
- package/dist/esm/private-helpers/getApplicationModules.js +1 -5
- package/dist/esm/private-helpers/getAuthPayload.js +1 -4
- package/dist/esm/private-helpers/getModuleParams.js +1 -4
- package/dist/esm/private-helpers/index.js +19 -22
- package/dist/esm/private-helpers/mobileSDKCapabilities.js +1 -4
- package/dist/esm/private-helpers/platformCapabilities.js +1 -4
- package/dist/esm/private-helpers/resolveFeature.js +28 -39
- package/dist/esm/private-helpers/resolveMenu.js +18 -23
- package/dist/esm/private-helpers/resolveTabs.js +16 -21
- package/dist/esm/private-helpers/setupRegisterOutlet.js +3 -7
- package/dist/esm/setup/application-modules.js +5 -11
- package/dist/esm/setup/default-capabilities.js +1 -4
- package/dist/esm/setup/dynamic-capabilities.js +1 -4
- package/dist/esm/setup/index.js +25 -29
- package/dist/esm/setup/styles.js +9 -12
- package/dist/esm/sources/cacheClearedSetup.js +4 -7
- package/dist/esm/sources/canUserSetup.js +1 -4
- package/dist/esm/sources/getAuthTokenSetup.js +1 -4
- package/dist/esm/sources/getFeatureConfigSetup.js +3 -6
- package/dist/esm/sources/getGlobalScriptsSetup.js +1 -4
- package/dist/esm/sources/getPendoInfoSetup.js +1 -4
- package/dist/esm/sources/getPlatformDimensionsSetup.js +6 -9
- package/dist/esm/sources/getPlatformInfoSetup.js +1 -4
- package/dist/esm/sources/getVersionInfoSetup.js +1 -4
- package/dist/esm/sources/index.js +41 -44
- package/dist/esm/sources/isNavigableSetup.js +3 -6
- package/dist/esm/sources/platformCssPropertiesChangedSetup.js +10 -13
- package/dist/esm/sources/platformEventNotificationSetup.js +4 -7
- package/dist/esm/sources/platformScrollChangedSetup.js +7 -10
- package/dist/esm/sources/promptForMFASetup.js +3 -6
- package/dist/esm/sources/refetchRequiredSetup.js +4 -7
- package/dist/esm/sources/requestExtensionDataSetup.js +3 -6
- package/dist/esm/sources/requestPlatformDataSetup.js +8 -15
- package/dist/esm/sources/setupModuleParams.js +7 -10
- package/dist/esm/sources/takePictureSetup.js +1 -4
- package/dist/esm/sources/tectonCacheSetup.js +1 -4
- package/dist/esm/types/alerts.js +2 -5
- package/dist/esm/types/config.js +1 -2
- package/dist/esm/types/index.js +1 -2
- package/dist/esm/types/pendo.js +1 -2
- package/dist/esm/types/utility.js +1 -2
- package/dist/esm/utility/dimensions-helpers.js +2 -7
- package/dist/esm/utility/filterPublicOverpanels.js +1 -4
- package/dist/esm/utility/getNavigationData.js +3 -6
- package/dist/esm/utility/message-bus.js +5 -10
- package/dist/esm/utility/showActionSheet.js +2 -4
- package/dist/esm/utility/validateActionParameters.js +1 -4
- package/dist/esm/utility/windowHelpers.js +2 -7
- package/dist/umd/q2-tecton-platform.js +1 -1
- package/package.json +4 -4
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const resolveFeature_1 = require("./resolveFeature");
|
|
5
|
-
const maybe_not_1 = require("maybe-not");
|
|
6
|
-
function setupResolveTabs(legacyControlBus, messageBus, tectonConfig$, params$, teardowns, contextHierarchy) {
|
|
1
|
+
import { getPathResolutionInfo, resolveTectonPath, resolveFeature, } from './resolveFeature.js';
|
|
2
|
+
import { Maybe } from 'maybe-not';
|
|
3
|
+
export default function setupResolveTabs(legacyControlBus, messageBus, tectonConfig$, params$, teardowns, contextHierarchy) {
|
|
7
4
|
const subscription = messageBus.sendResponse('resolveTabs', async (messageBody) => {
|
|
8
|
-
const resolvedInfo = (await
|
|
9
|
-
const platformConfig =
|
|
5
|
+
const resolvedInfo = (await getPathResolutionInfo(messageBody.outletPath.split('.'), legacyControlBus.dynamicConfigFetch));
|
|
6
|
+
const platformConfig = resolveTectonPath(resolvedInfo.configPath, resolvedInfo.treeFromRoot);
|
|
10
7
|
const configPromise = legacyControlBus.dynamicConfigFetch(resolvedInfo.featureName);
|
|
11
8
|
const featureManifest = await configPromise;
|
|
12
9
|
const moduleFeatureManifest = await configPromise.then(x => x.modules[resolvedInfo.moduleName]);
|
|
13
10
|
const outletType = moduleFeatureManifest.meta.outlets[resolvedInfo.outletName];
|
|
14
|
-
const baseContextM = outletType.context === 'None' ?
|
|
11
|
+
const baseContextM = outletType.context === 'None' ? Maybe.nothing() : Maybe.just(outletType.context);
|
|
15
12
|
const contextValueIdM = messageBody.contextValue
|
|
16
|
-
?
|
|
17
|
-
:
|
|
13
|
+
? Maybe.just(messageBody.contextValue)
|
|
14
|
+
: Maybe.nothing();
|
|
18
15
|
const providedTypeM = messageBody.resolvedType
|
|
19
|
-
?
|
|
20
|
-
:
|
|
16
|
+
? Maybe.just(messageBody.resolvedType)
|
|
17
|
+
: Maybe.nothing();
|
|
21
18
|
const additionalContextM = messageBody.additionalContext
|
|
22
|
-
?
|
|
23
|
-
:
|
|
19
|
+
? Maybe.just(messageBody.additionalContext)
|
|
20
|
+
: Maybe.nothing();
|
|
24
21
|
const tabLookups = platformConfig.configuredOutlets[resolvedInfo.outletName];
|
|
25
22
|
const tectonConfig = tectonConfig$.getValue();
|
|
26
23
|
return resolveTabs(legacyControlBus, params$, messageBody.outletPath, baseContextM, contextValueIdM, providedTypeM, additionalContextM, tabLookups, tectonConfig, resolvedInfo.featureName, resolvedInfo.moduleName, contextHierarchy, featureManifest.additionalDomains, featureManifest.allowDirectives).then(tabs => {
|
|
@@ -29,17 +26,16 @@ function setupResolveTabs(legacyControlBus, messageBus, tectonConfig$, params$,
|
|
|
29
26
|
});
|
|
30
27
|
teardowns.push(() => subscription.unsubscribe());
|
|
31
28
|
}
|
|
32
|
-
|
|
33
|
-
function resolveTabs(legacyControlBus, params$, outletPath, baseContextM, contextValueIdM, providedTypeM, additionalContextM, tabLookups, tectonConfig, hostFeatureName, hostModuleName, contextHierarchy, additionalDomains, allowDirectives) {
|
|
29
|
+
export function resolveTabs(legacyControlBus, params$, outletPath, baseContextM, contextValueIdM, providedTypeM, additionalContextM, tabLookups, tectonConfig, hostFeatureName, hostModuleName, contextHierarchy, additionalDomains, allowDirectives) {
|
|
34
30
|
return Promise.all(tabLookups.map(tabLookup => {
|
|
35
|
-
return
|
|
31
|
+
return resolveFeature(legacyControlBus, params$, outletPath, baseContextM, contextValueIdM, tabLookup.modules || [], providedTypeM, additionalContextM, tectonConfig, hostFeatureName, hostModuleName, contextHierarchy)
|
|
36
32
|
.then(tabM => {
|
|
37
33
|
return tabM.map(tab => ({ tabLabel: tabLookup.tabLabel, tab }));
|
|
38
34
|
})
|
|
39
|
-
.catch(() =>
|
|
35
|
+
.catch(() => Maybe.nothing());
|
|
40
36
|
}))
|
|
41
37
|
.then(tabsMs => {
|
|
42
|
-
return
|
|
38
|
+
return Maybe.filterSomethings(tabsMs);
|
|
43
39
|
})
|
|
44
40
|
.then(tabs => {
|
|
45
41
|
return tabs.map(tabInfo => {
|
|
@@ -60,4 +56,3 @@ function resolveTabs(legacyControlBus, params$, outletPath, baseContextM, contex
|
|
|
60
56
|
});
|
|
61
57
|
});
|
|
62
58
|
}
|
|
63
|
-
exports.resolveTabs = resolveTabs;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.setupRegisterOutlet = void 0;
|
|
4
|
-
const getModuleParams_1 = require("./getModuleParams");
|
|
5
|
-
function setupRegisterOutlet(messageBus, params$, teardowns) {
|
|
1
|
+
import getModuleParams from './getModuleParams.js';
|
|
2
|
+
export function setupRegisterOutlet(messageBus, params$, teardowns) {
|
|
6
3
|
const subscription = messageBus.sendResponse('getInitialParams', (messageBody) => {
|
|
7
4
|
return Promise.resolve({
|
|
8
|
-
params: (
|
|
5
|
+
params: getModuleParams(messageBody.moduleId, params$.getValue().currentParams),
|
|
9
6
|
});
|
|
10
7
|
});
|
|
11
8
|
teardowns.push(() => subscription.unsubscribe());
|
|
12
9
|
}
|
|
13
|
-
exports.setupRegisterOutlet = setupRegisterOutlet;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.teardownApplicationModules = exports.appendApplicationModule = void 0;
|
|
4
|
-
const getApplicationModules_1 = require("../private-helpers/getApplicationModules");
|
|
1
|
+
import { getApplicationModules } from '../private-helpers/getApplicationModules.js';
|
|
5
2
|
const authStatus = 'Authenticated';
|
|
6
3
|
const unauthStatus = 'Unauthenticated';
|
|
7
|
-
function setupApplicationModules(tectonConfig, isAuthenticated = false) {
|
|
8
|
-
const applicationModules =
|
|
4
|
+
export default function setupApplicationModules(tectonConfig, isAuthenticated = false) {
|
|
5
|
+
const applicationModules = getApplicationModules(tectonConfig);
|
|
9
6
|
const authContext = isAuthenticated ? authStatus : unauthStatus;
|
|
10
7
|
const authContextModules = applicationModules[authContext.toLowerCase()];
|
|
11
8
|
authContextModules === null || authContextModules === void 0 ? void 0 : authContextModules.forEach(module => {
|
|
@@ -20,8 +17,7 @@ function setupApplicationModules(tectonConfig, isAuthenticated = false) {
|
|
|
20
17
|
teardownApplicationModules(authStatus);
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
function appendApplicationModule({ authContext, outletId, modulePath, featureName, moduleName, }) {
|
|
20
|
+
export function appendApplicationModule({ authContext, outletId, modulePath, featureName, moduleName, }) {
|
|
25
21
|
const outlet = (window.isTestingTecton
|
|
26
22
|
? document.createElement('object')
|
|
27
23
|
: document.createElement('tecton-platform-outlet'));
|
|
@@ -33,12 +29,10 @@ function appendApplicationModule({ authContext, outletId, modulePath, featureNam
|
|
|
33
29
|
outlet.setAttribute('style', 'width:0; height:0; visibility: hidden; overflow: hidden;');
|
|
34
30
|
document.body.appendChild(outlet);
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
function teardownApplicationModules(authContext) {
|
|
32
|
+
export function teardownApplicationModules(authContext) {
|
|
38
33
|
const applicationOutletsToRemove = document.getElementsByName(`Tecton${authContext}ApplicationModule`);
|
|
39
34
|
applicationOutletsToRemove === null || applicationOutletsToRemove === void 0 ? void 0 : applicationOutletsToRemove.forEach(function (node) {
|
|
40
35
|
var _a;
|
|
41
36
|
(_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(node);
|
|
42
37
|
});
|
|
43
38
|
}
|
|
44
|
-
exports.teardownApplicationModules = teardownApplicationModules;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function setupDefaultCapabilities(capabilities) {
|
|
1
|
+
export default function setupDefaultCapabilities(capabilities) {
|
|
4
2
|
capabilities.add('resizeIframe');
|
|
5
3
|
capabilities.add('requestOutletInfo');
|
|
6
4
|
}
|
|
7
|
-
exports.default = setupDefaultCapabilities;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function setupDynamicCapabilities(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function setupDynamicCapabilities(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.setupDynamicPlatformAPI) {
|
|
5
3
|
const dynamicCapabilities = legacyControlBus.setupDynamicPlatformAPI();
|
|
6
4
|
dynamicCapabilities.forEach(capability => capabilities.add(capability));
|
|
@@ -10,4 +8,3 @@ function setupDynamicCapabilities(messageBus, legacyControlBus, capabilities, te
|
|
|
10
8
|
teardowns.push(() => subscription.unsubscribe());
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
|
-
exports.default = setupDynamicCapabilities;
|
package/dist/esm/setup/index.js
CHANGED
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const dynamic_capabilities_1 = require("./dynamic-capabilities");
|
|
14
|
-
const application_modules_1 = require("./application-modules");
|
|
15
|
-
function init(tectonConfig, legacyControlBus, contextHierarchy = {}, testOptions) {
|
|
1
|
+
import merge from 'q2-tecton-common/lib/utility/merge';
|
|
2
|
+
import PlatformMessageBus from '../utility/message-bus.js';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import setupActions from '../actions/index.js';
|
|
5
|
+
import setupSources from '../sources/index.js';
|
|
6
|
+
import setupOutlets from '../outlets/index.js';
|
|
7
|
+
import setupPrivateHelpers from '../private-helpers/index.js';
|
|
8
|
+
import setupTectonStyles from './styles.js';
|
|
9
|
+
import setupDefaultCapabilities from './default-capabilities.js';
|
|
10
|
+
import setupDynamicCapabilities from './dynamic-capabilities.js';
|
|
11
|
+
import setupApplicationModules from './application-modules.js';
|
|
12
|
+
export function init(tectonConfig, legacyControlBus, contextHierarchy = {}, testOptions) {
|
|
16
13
|
window.isTectonPlatform = true;
|
|
17
|
-
const params$ = new
|
|
14
|
+
const params$ = new BehaviorSubject({
|
|
18
15
|
changedParams: {},
|
|
19
16
|
currentParams: {},
|
|
20
17
|
});
|
|
21
18
|
adaptConfig(tectonConfig);
|
|
22
19
|
let tectonConfig$;
|
|
23
20
|
if (window.isTestingTecton || (testOptions === null || testOptions === void 0 ? void 0 : testOptions.testing)) {
|
|
24
|
-
tectonConfig$ = window.tectonConfig$ || new
|
|
21
|
+
tectonConfig$ = window.tectonConfig$ || new BehaviorSubject(null);
|
|
25
22
|
tectonConfig$.next(tectonConfig);
|
|
26
23
|
window.tectonConfig$ = tectonConfig$;
|
|
27
24
|
}
|
|
28
25
|
else {
|
|
29
|
-
tectonConfig$ = new
|
|
26
|
+
tectonConfig$ = new BehaviorSubject(tectonConfig);
|
|
30
27
|
}
|
|
31
|
-
const messageBus = new
|
|
28
|
+
const messageBus = new PlatformMessageBus(tectonConfig$, window.isTestingTecton);
|
|
32
29
|
const capabilities = new Set();
|
|
33
30
|
const teardowns = [messageBus.teardown.bind(messageBus)];
|
|
34
|
-
(
|
|
35
|
-
(
|
|
36
|
-
(
|
|
37
|
-
(
|
|
38
|
-
(
|
|
39
|
-
(
|
|
40
|
-
(
|
|
31
|
+
setupDefaultCapabilities(capabilities);
|
|
32
|
+
setupDynamicCapabilities(messageBus, legacyControlBus, capabilities, teardowns);
|
|
33
|
+
setupActions(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns);
|
|
34
|
+
setupSources(messageBus, legacyControlBus, params$, tectonConfig$, capabilities, teardowns);
|
|
35
|
+
setupTectonStyles(messageBus, legacyControlBus, capabilities, teardowns);
|
|
36
|
+
setupPrivateHelpers(messageBus, legacyControlBus, params$, tectonConfig$, capabilities, teardowns, contextHierarchy);
|
|
37
|
+
setupOutlets(messageBus, tectonConfig$, params$, legacyControlBus, contextHierarchy);
|
|
41
38
|
function configLookup(featureName, moduleName) {
|
|
42
39
|
const tectonConfig = tectonConfig$.getValue();
|
|
43
40
|
if (!moduleName) {
|
|
@@ -75,7 +72,7 @@ function init(tectonConfig, legacyControlBus, contextHierarchy = {}, testOptions
|
|
|
75
72
|
},
|
|
76
73
|
updateConfig(configDiff) {
|
|
77
74
|
const configValue = tectonConfig$.getValue();
|
|
78
|
-
(
|
|
75
|
+
merge(configValue, configDiff);
|
|
79
76
|
adaptConfig(configValue);
|
|
80
77
|
tectonConfig$.next(configValue);
|
|
81
78
|
},
|
|
@@ -175,7 +172,7 @@ function init(tectonConfig, legacyControlBus, contextHierarchy = {}, testOptions
|
|
|
175
172
|
});
|
|
176
173
|
},
|
|
177
174
|
updateApplicationModules(isAuthenticated) {
|
|
178
|
-
(
|
|
175
|
+
setupApplicationModules(tectonConfig, isAuthenticated);
|
|
179
176
|
},
|
|
180
177
|
teardown() {
|
|
181
178
|
teardowns.forEach(fn => fn());
|
|
@@ -185,7 +182,6 @@ function init(tectonConfig, legacyControlBus, contextHierarchy = {}, testOptions
|
|
|
185
182
|
},
|
|
186
183
|
};
|
|
187
184
|
}
|
|
188
|
-
exports.init = init;
|
|
189
185
|
function adaptConfig(tectonConfig) {
|
|
190
186
|
Object.keys(tectonConfig.features).forEach(function (featureName) {
|
|
191
187
|
const featureObj = tectonConfig.features[featureName];
|
package/dist/esm/setup/styles.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const assetPathResolvers_1 = require("../private-helpers/assetPathResolvers");
|
|
7
|
-
function setupTectonStyles(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
import { sendBroadcast } from '../utility/message-bus.js';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { Maybe } from 'maybe-not';
|
|
4
|
+
import { ifRelativePrependOrigin } from '../private-helpers/assetPathResolvers.js';
|
|
5
|
+
export default function setupTectonStyles(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
8
6
|
if (!legacyControlBus.getCurrentTheme) {
|
|
9
7
|
capabilities.add('ThemesNotSupported');
|
|
10
8
|
return;
|
|
11
9
|
}
|
|
12
10
|
capabilities.add('getCurrentTheme');
|
|
13
|
-
const currentTheme$ = new
|
|
14
|
-
path:
|
|
11
|
+
const currentTheme$ = new BehaviorSubject({
|
|
12
|
+
path: ifRelativePrependOrigin(legacyControlBus.getCustomerSpecificAssetPath(`${legacyControlBus.getCurrentTheme()}-props.css`)),
|
|
15
13
|
});
|
|
16
14
|
let active = true; // Flag to prevent callback from executing after teardown
|
|
17
15
|
const onThemeChange = (themeName) => {
|
|
18
16
|
if (active) {
|
|
19
17
|
currentTheme$.next({
|
|
20
|
-
path:
|
|
18
|
+
path: ifRelativePrependOrigin(legacyControlBus.getCustomerSpecificAssetPath(`${themeName}-props.css`)),
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
};
|
|
@@ -26,7 +24,7 @@ function setupTectonStyles(messageBus, legacyControlBus, capabilities, teardowns
|
|
|
26
24
|
legacyControlBus.themeChanged(onThemeChange);
|
|
27
25
|
}
|
|
28
26
|
const tectonThemeSubscription = currentTheme$.subscribe(themePath => {
|
|
29
|
-
|
|
27
|
+
sendBroadcast('themeChanged', Maybe.maybe(themePath).map(JSON.stringify));
|
|
30
28
|
});
|
|
31
29
|
const tectonCurrentThemeServiceSubscription = messageBus.sendResponse('getCurrentTheme', () => {
|
|
32
30
|
return Promise.resolve(currentTheme$.getValue());
|
|
@@ -41,4 +39,3 @@ function setupTectonStyles(messageBus, legacyControlBus, capabilities, teardowns
|
|
|
41
39
|
currentTheme$.complete();
|
|
42
40
|
});
|
|
43
41
|
}
|
|
44
|
-
exports.default = setupTectonStyles;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const message_bus_1 = require("../utility/message-bus");
|
|
5
|
-
function cacheClearedSetup(messageBus, legacyControlBus, capabilities) {
|
|
1
|
+
import { Maybe } from 'maybe-not';
|
|
2
|
+
import { sendBroadcast } from '../utility/message-bus.js';
|
|
3
|
+
export default function cacheClearedSetup(messageBus, legacyControlBus, capabilities) {
|
|
6
4
|
if (legacyControlBus.refetchRequired) {
|
|
7
5
|
capabilities.add('cacheCleared');
|
|
8
6
|
legacyControlBus.refetchRequired((type) => {
|
|
9
|
-
|
|
7
|
+
sendBroadcast('cacheCleared', Maybe.just(JSON.stringify({ cleared: type })));
|
|
10
8
|
});
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
|
-
exports.default = cacheClearedSetup;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function canUserSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function canUserSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.getCapabilities) {
|
|
5
3
|
capabilities.add('canUser');
|
|
6
4
|
const subscription = messageBus.sendResponse('canUser', ({ capabilities }) => {
|
|
@@ -11,4 +9,3 @@ function canUserSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
|
11
9
|
teardowns.push(() => subscription.unsubscribe());
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = canUserSetup;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getAuthTokenSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function getAuthTokenSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.getAuthToken) {
|
|
5
3
|
capabilities.add('authToken');
|
|
6
4
|
const subscription = messageBus.sendResponse('authToken', () => legacyControlBus.getAuthToken());
|
|
7
5
|
teardowns.push(() => subscription.unsubscribe());
|
|
8
6
|
}
|
|
9
7
|
}
|
|
10
|
-
exports.default = getAuthTokenSetup;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const resolveFeature_1 = require("../private-helpers/resolveFeature");
|
|
4
|
-
function getFeatureConfigSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
import { getPathResolutionInfo } from '../private-helpers/resolveFeature.js';
|
|
2
|
+
export default function getFeatureConfigSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns) {
|
|
5
3
|
if (legacyControlBus.getFeatureConfig) {
|
|
6
4
|
capabilities.add('getFeatureConfig');
|
|
7
5
|
const subscription = messageBus.sendResponse('getFeatureConfig', async ({ moduleId }) => {
|
|
8
|
-
const resolvedInfo = await
|
|
6
|
+
const resolvedInfo = await getPathResolutionInfo(moduleId.split('.'), legacyControlBus.dynamicConfigFetch);
|
|
9
7
|
const declaredConfigVariables = await legacyControlBus
|
|
10
8
|
.dynamicConfigFetch(resolvedInfo.featureName)
|
|
11
9
|
.then(x => x.configuredSystemVariables || []);
|
|
@@ -19,4 +17,3 @@ function getFeatureConfigSetup(messageBus, tectonConfig$, legacyControlBus, capa
|
|
|
19
17
|
teardowns.push(() => subscription.unsubscribe());
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
exports.default = getFeatureConfigSetup;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getGlobalScripts(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function getGlobalScripts(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.getGlobalScripts) {
|
|
5
3
|
capabilities.add('getGlobalScripts');
|
|
6
4
|
const subscription = messageBus.sendResponse('getGlobalScripts', () => legacyControlBus.getGlobalScripts());
|
|
7
5
|
teardowns.push(() => subscription.unsubscribe());
|
|
8
6
|
}
|
|
9
7
|
}
|
|
10
|
-
exports.default = getGlobalScripts;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getPendoInfoSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function getPendoInfoSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.getPendoInfo) {
|
|
5
3
|
capabilities.add('getPendoInfo');
|
|
6
4
|
const subscription = messageBus.sendResponse('getPendoInfo', () => {
|
|
@@ -9,4 +7,3 @@ function getPendoInfoSetup(messageBus, legacyControlBus, capabilities, teardowns
|
|
|
9
7
|
teardowns.push(() => subscription.unsubscribe());
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
|
-
exports.default = getPendoInfoSetup;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const dimensions_helpers_1 = require("../utility/dimensions-helpers");
|
|
6
|
-
function getPlatformDimensionsSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
import { sendBroadcast } from '../utility/message-bus.js';
|
|
2
|
+
import { Maybe } from 'maybe-not';
|
|
3
|
+
import { getDimensions } from '../utility/dimensions-helpers.js';
|
|
4
|
+
export default function getPlatformDimensionsSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
7
5
|
capabilities.add('getPlatformDimensions');
|
|
8
6
|
const subscription = messageBus.sendResponse('getPlatformDimensions', (options) => {
|
|
9
7
|
var _a, _b, _c, _d, _e;
|
|
@@ -35,11 +33,10 @@ function getPlatformDimensionsSetup(messageBus, legacyControlBus, capabilities,
|
|
|
35
33
|
const platformRoot = platformRootSelector
|
|
36
34
|
? document.querySelector(platformRootSelector)
|
|
37
35
|
: window;
|
|
38
|
-
platformDimensions =
|
|
36
|
+
platformDimensions = getDimensions(legacyControlBus, platformRoot);
|
|
39
37
|
}
|
|
40
|
-
|
|
38
|
+
sendBroadcast('platformScrollChanged', Maybe.just(JSON.stringify(platformDimensions)));
|
|
41
39
|
return Promise.resolve(platformDimensions);
|
|
42
40
|
});
|
|
43
41
|
teardowns.push(() => subscription.unsubscribe());
|
|
44
42
|
}
|
|
45
|
-
exports.default = getPlatformDimensionsSetup;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getPlatformInfoSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function getPlatformInfoSetup(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.getPlatformInfo) {
|
|
5
3
|
capabilities.add('platformInfo');
|
|
6
4
|
const subscription = messageBus.sendResponse('platformInfo', requestedInfo => {
|
|
@@ -9,4 +7,3 @@ function getPlatformInfoSetup(messageBus, legacyControlBus, capabilities, teardo
|
|
|
9
7
|
teardowns.push(() => subscription.unsubscribe());
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
|
-
exports.default = getPlatformInfoSetup;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getVersionInfo(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
export default function getVersionInfo(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
4
2
|
if (legacyControlBus.getVersionInfo) {
|
|
5
3
|
capabilities.add('getPlatformInfo');
|
|
6
4
|
const subscription = messageBus.sendResponse('getPlatformInfo', () => {
|
|
@@ -12,4 +10,3 @@ function getVersionInfo(messageBus, legacyControlBus, capabilities, teardowns) {
|
|
|
12
10
|
});
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
exports.default = getVersionInfo;
|
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
(
|
|
25
|
-
(
|
|
26
|
-
(
|
|
27
|
-
(
|
|
28
|
-
(
|
|
29
|
-
(
|
|
30
|
-
(
|
|
31
|
-
(
|
|
32
|
-
(
|
|
33
|
-
(
|
|
34
|
-
(
|
|
35
|
-
(
|
|
36
|
-
(
|
|
37
|
-
(
|
|
38
|
-
(
|
|
39
|
-
(
|
|
40
|
-
(
|
|
41
|
-
(
|
|
42
|
-
(0, platformCssPropertiesChangedSetup_1.default)(legacyControlBus, capabilities, teardowns);
|
|
43
|
-
(0, platformEventNotificationSetup_1.default)(legacyControlBus, capabilities);
|
|
1
|
+
import cacheClearedSetup from './cacheClearedSetup.js';
|
|
2
|
+
import canUserSetup from './canUserSetup.js';
|
|
3
|
+
import getFeatureConfigSetup from './getFeatureConfigSetup.js';
|
|
4
|
+
import getPendoInfoSetup from './getPendoInfoSetup.js';
|
|
5
|
+
import getPlatformInfoSetup from './getPlatformInfoSetup.js';
|
|
6
|
+
import getPlatformDimensionsSetup from './getPlatformDimensionsSetup.js';
|
|
7
|
+
import getVersionInfoSetup from './getVersionInfoSetup.js';
|
|
8
|
+
import getAuthTokenSetup from './getAuthTokenSetup.js';
|
|
9
|
+
import getGlobalScriptsSetup from './getGlobalScriptsSetup.js';
|
|
10
|
+
import isNavigableSetup from './isNavigableSetup.js';
|
|
11
|
+
import platformScrollChanged from './platformScrollChangedSetup.js';
|
|
12
|
+
import promptForMFA from './promptForMFASetup.js';
|
|
13
|
+
import refetchRequiredSetup from './refetchRequiredSetup.js';
|
|
14
|
+
import requestExtensionDataSetup from './requestExtensionDataSetup.js';
|
|
15
|
+
import requestPlatformDataSetup from './requestPlatformDataSetup.js';
|
|
16
|
+
import setupModuleParams from './setupModuleParams.js';
|
|
17
|
+
import takePictureSetup from './takePictureSetup.js';
|
|
18
|
+
import tectonCacheSetup from './tectonCacheSetup.js';
|
|
19
|
+
import platformCssPropertiesChangedSetup from './platformCssPropertiesChangedSetup.js';
|
|
20
|
+
import platformEventNotificationSetup from './platformEventNotificationSetup.js';
|
|
21
|
+
export default function setupSources(messageBus, legacyControlBus, moduleParams$, tectonConfig$, capabilities, teardowns) {
|
|
22
|
+
cacheClearedSetup(messageBus, legacyControlBus, capabilities);
|
|
23
|
+
canUserSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
24
|
+
getFeatureConfigSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns);
|
|
25
|
+
getPendoInfoSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
26
|
+
getPlatformInfoSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
27
|
+
getPlatformDimensionsSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
28
|
+
getVersionInfoSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
29
|
+
getAuthTokenSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
30
|
+
getGlobalScriptsSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
31
|
+
isNavigableSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns);
|
|
32
|
+
platformScrollChanged(messageBus, legacyControlBus, capabilities, teardowns);
|
|
33
|
+
promptForMFA(messageBus, legacyControlBus, capabilities, teardowns);
|
|
34
|
+
refetchRequiredSetup(messageBus, legacyControlBus, capabilities);
|
|
35
|
+
requestExtensionDataSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns);
|
|
36
|
+
requestPlatformDataSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
37
|
+
setupModuleParams(moduleParams$, teardowns);
|
|
38
|
+
takePictureSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
39
|
+
tectonCacheSetup(messageBus, legacyControlBus, capabilities, teardowns);
|
|
40
|
+
platformCssPropertiesChangedSetup(legacyControlBus, capabilities, teardowns);
|
|
41
|
+
platformEventNotificationSetup(legacyControlBus, capabilities);
|
|
44
42
|
}
|
|
45
|
-
exports.default = setupSources;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const getNavigationData_1 = require("../utility/getNavigationData");
|
|
4
|
-
function isNavigableSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
import getNavigationData from '../utility/getNavigationData.js';
|
|
2
|
+
export default function isNavigableSetup(messageBus, tectonConfig$, legacyControlBus, capabilities, teardowns) {
|
|
5
3
|
if (legacyControlBus.isUUXPath && legacyControlBus.navigateTo) {
|
|
6
4
|
capabilities.add('isNavigable');
|
|
7
5
|
const subscription = messageBus.sendResponse('isNavigable', ({ featureName, moduleName }) => {
|
|
8
|
-
const navigable = (
|
|
6
|
+
const navigable = getNavigationData(tectonConfig$, featureName, moduleName)
|
|
9
7
|
.map(navData => {
|
|
10
8
|
return navData.navigable;
|
|
11
9
|
})
|
|
@@ -17,4 +15,3 @@ function isNavigableSetup(messageBus, tectonConfig$, legacyControlBus, capabilit
|
|
|
17
15
|
teardowns.push(() => subscription.unsubscribe());
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
exports.default = isNavigableSetup;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const rxjs_1 = require("rxjs");
|
|
8
|
-
function platformCssPropertiesChangedSetup(legacyControlBus, capabilities, teardowns) {
|
|
1
|
+
import { sendBroadcast } from '../utility/message-bus.js';
|
|
2
|
+
import { Maybe } from 'maybe-not';
|
|
3
|
+
import CapabilityNames from 'q2-tecton-common/lib/constants/capabilityNames';
|
|
4
|
+
import streamNames from 'q2-tecton-common/lib/constants/streamNames';
|
|
5
|
+
import { BehaviorSubject, skip } from 'rxjs';
|
|
6
|
+
export default function platformCssPropertiesChangedSetup(legacyControlBus, capabilities, teardowns) {
|
|
9
7
|
if (!legacyControlBus.cssPropertiesChanged) {
|
|
10
8
|
return;
|
|
11
9
|
}
|
|
12
|
-
capabilities.add(
|
|
13
|
-
const currentProperties$ = new
|
|
10
|
+
capabilities.add(CapabilityNames.PlatformCssPropertiesChanged);
|
|
11
|
+
const currentProperties$ = new BehaviorSubject([]);
|
|
14
12
|
let active = true; // Flag to prevent callback from executing after teardown
|
|
15
13
|
const onCssPropertiesChanged = (cssProperties) => {
|
|
16
14
|
if (active) {
|
|
17
15
|
currentProperties$.next(cssProperties);
|
|
18
16
|
}
|
|
19
17
|
};
|
|
20
|
-
const propertiesSubscription = currentProperties$.pipe(
|
|
21
|
-
|
|
18
|
+
const propertiesSubscription = currentProperties$.pipe(skip(1)).subscribe(cssProperties => {
|
|
19
|
+
sendBroadcast(streamNames.streamCssProperties, Maybe.just(JSON.stringify(cssProperties)));
|
|
22
20
|
});
|
|
23
21
|
legacyControlBus.cssPropertiesChanged(onCssPropertiesChanged);
|
|
24
22
|
teardowns.push(() => {
|
|
@@ -30,4 +28,3 @@ function platformCssPropertiesChangedSetup(legacyControlBus, capabilities, teard
|
|
|
30
28
|
currentProperties$.complete();
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
|
-
exports.default = platformCssPropertiesChangedSetup;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const message_bus_1 = require("../utility/message-bus");
|
|
5
|
-
function platformEventNotificationSetup(legacyControlBus, capabilities) {
|
|
1
|
+
import { Maybe } from 'maybe-not';
|
|
2
|
+
import { sendBroadcast } from '../utility/message-bus.js';
|
|
3
|
+
export default function platformEventNotificationSetup(legacyControlBus, capabilities) {
|
|
6
4
|
if (legacyControlBus.platformEventNotification) {
|
|
7
5
|
capabilities.add('platformEventNotification');
|
|
8
6
|
legacyControlBus.platformEventNotification((event) => {
|
|
9
|
-
|
|
7
|
+
sendBroadcast(`platformEventNotification::${event.name}`, Maybe.maybe(event.data).map(JSON.stringify));
|
|
10
8
|
});
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
|
-
exports.default = platformEventNotificationSetup;
|