@wavemaker/app-ng-runtime 12.0.0-next.1417180 → 12.0.0-next.1417190
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.
- app-ng-runtime/components/base/bundles/index.umd.js +8 -5
- app-ng-runtime/components/base/esm2022/utils/widget-utils.mjs +9 -6
- app-ng-runtime/components/base/esm2022/widgets/framework/property-change-handler.mjs +3 -3
- app-ng-runtime/components/base/fesm2022/index.mjs +9 -6
- app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +16 -4
- app-ng-runtime/runtime/base/esm2022/runtime-base.module.mjs +4 -1
- app-ng-runtime/runtime/base/esm2022/services/http-interceptor.services.mjs +7 -1
- app-ng-runtime/runtime/base/esm2022/services/i18n.service.mjs +4 -3
- app-ng-runtime/runtime/base/esm2022/services/prefab-manager.service.mjs +2 -2
- app-ng-runtime/runtime/base/esm2022/util/utils.mjs +6 -2
- app-ng-runtime/runtime/base/fesm2022/index.mjs +17 -5
- app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/variables/bundles/index.umd.js +3 -1
- app-ng-runtime/variables/esm2022/service/metadata-service/metadata.service.mjs +5 -3
- app-ng-runtime/variables/fesm2022/index.mjs +4 -2
- app-ng-runtime/variables/fesm2022/index.mjs.map +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { _WM_APP_PROJECT } from "@wm/core";
|
|
1
2
|
export const isPrefabInPreview = (prefabName) => prefabName === '__self__';
|
|
2
|
-
export const getPrefabBaseUrl = (prefabName) =>
|
|
3
|
+
export const getPrefabBaseUrl = (prefabName) => {
|
|
4
|
+
const basePath = _WM_APP_PROJECT.isPreview ? 'app/prefabs' : _WM_APP_PROJECT.cdnUrl + 'resources';
|
|
5
|
+
return isPrefabInPreview(prefabName) ? '.' : basePath + `/${prefabName}`;
|
|
6
|
+
};
|
|
3
7
|
export const getPrefabConfigUrl = (prefabName) => `${getPrefabBaseUrl(prefabName)}/config.json`;
|
|
4
8
|
export const getPrefabMinJsonUrl = (prefabName) => `${getPrefabBaseUrl(prefabName)}/pages/Main/page.min.json`;
|
|
5
9
|
export const getPrefabPartialJsonUrl = (prefabName, partialName) => `${getPrefabBaseUrl(prefabName)}/pages/${partialName}/page.min.json`;
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9ydW50aW1lLWJhc2Uvc3JjL3V0aWwvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLFVBQVUsQ0FBQztBQUV6QyxNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBRyxDQUFDLFVBQWtCLEVBQUUsRUFBRSxDQUFDLFVBQVUsS0FBSyxVQUFVLENBQUM7QUFFbkYsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsQ0FBQyxVQUFrQixFQUFFLEVBQUU7SUFDbkQsTUFBTSxRQUFRLEdBQUcsZUFBZSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxlQUFlLENBQUMsTUFBTSxHQUFHLFdBQVcsQ0FBQztJQUNuRyxPQUFPLGlCQUFpQixDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFFLFFBQVEsR0FBRyxJQUFJLFVBQVUsRUFBRSxDQUFBO0FBQzVFLENBQUMsQ0FBQztBQUVGLE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLENBQUMsVUFBa0IsRUFBRSxFQUFFLENBQUMsR0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gKHByZWZhYk5hbWU6IHN0cmluZykgPT4gYCR7Z2V0UHJlZmFiQmFzZVVybChwcmVmYWJOYW1lKX0vcGFnZXMvTWFpbi9wYWdlLm1pbi5qc29uYDtcblxuZXhwb3J0IGNvbnN0IGdldFByZWZhYlBhcnRpYWxKc29uVXJsID0gKHByZWZhYk5hbWU6IHN0cmluZywgcGFydGlhbE5hbWU6IHN0cmluZykgPT4gYCR7Z2V0UHJlZmFiQmFzZVVybChwcmVmYWJOYW1lKX0vcGFnZXMvJHtwYXJ0aWFsTmFtZX0vcGFnZS5taW4uanNvbmA7XG4iXX0=
|
|
@@ -5,7 +5,7 @@ import { ActivatedRoute, Router, RouterOutlet, NavigationStart, NavigationEnd, N
|
|
|
5
5
|
import * as i1$2 from '@angular/common';
|
|
6
6
|
import { AsyncPipe, SlicePipe, PercentPipe, I18nPluralPipe, NgLocalization, I18nSelectPipe, KeyValuePipe, UpperCasePipe, LowerCasePipe, JsonPipe, DecimalPipe, TitleCasePipe, CurrencyPipe, DatePipe, DOCUMENT, ɵgetDOM as _getDOM, CommonModule } from '@angular/common';
|
|
7
7
|
import * as i1 from '@wm/core';
|
|
8
|
-
import { $appDigest, isDefined, triggerFn, fetchContent, stringStartsWith, loadStyleSheets, loadScripts, noop as noop$1, App, AbstractI18nService, ScriptLoaderService, Viewport, UtilsService, $invokeWatchers, registerFnByExpr, LRUCache, muteWatchers, AbstractNavigationService, getWmProjectProperties, isMobileApp, isIos, isAndroid, unMuteWatchers, $watch, isIE, CustomPipeManager, getSessionStorageItem, AbstractDialogService, StatePersistence, AbstractSpinnerService, AbstractToasterService, ConstantService, FieldTypeService, FieldWidgetService, DynamicComponentRefProvider, EventNotifier, setCSS,
|
|
8
|
+
import { $appDigest, isDefined, triggerFn, fetchContent, _WM_APP_PROJECT, stringStartsWith, loadStyleSheets, loadScripts, noop as noop$1, App, AbstractI18nService, ScriptLoaderService, Viewport, UtilsService, $invokeWatchers, registerFnByExpr, LRUCache, muteWatchers, AbstractNavigationService, getWmProjectProperties, isMobileApp, isIos, isAndroid, unMuteWatchers, $watch, isIE, CustomPipeManager, getSessionStorageItem, AbstractDialogService, StatePersistence, AbstractSpinnerService, AbstractToasterService, ConstantService, FieldTypeService, FieldWidgetService, DynamicComponentRefProvider, EventNotifier, setCSS, isMobile, setSessionStorageItem, replace, setPipeProvider, setNgZone, setAppRef, addClass, removeClass, hasCordova, extendProto, $parseExpr, AppDefaults, isObject as isObject$1, isIphone, isIpod, isIpad, CoreModule } from '@wm/core';
|
|
9
9
|
import * as i2 from '@wm/security';
|
|
10
10
|
import { SecurityModule } from '@wm/security';
|
|
11
11
|
import * as i4 from '@wm/variables';
|
|
@@ -591,7 +591,10 @@ class AppManagerService {
|
|
|
591
591
|
}], () => [{ type: i1.AbstractHttpService }, { type: i2.SecurityService }, { type: i1.AbstractDialogService }, { type: i1$1.Router }, { type: i1.App }, { type: i4.VariablesService }, { type: i4.MetadataService }, { type: i1.AbstractSpinnerService }, { type: i1.AbstractI18nService }, { type: i1$2.DatePipe }], null); })();
|
|
592
592
|
|
|
593
593
|
const isPrefabInPreview = (prefabName) => prefabName === '__self__';
|
|
594
|
-
const getPrefabBaseUrl = (prefabName) =>
|
|
594
|
+
const getPrefabBaseUrl = (prefabName) => {
|
|
595
|
+
const basePath = _WM_APP_PROJECT.isPreview ? 'app/prefabs' : _WM_APP_PROJECT.cdnUrl + 'resources';
|
|
596
|
+
return isPrefabInPreview(prefabName) ? '.' : basePath + `/${prefabName}`;
|
|
597
|
+
};
|
|
595
598
|
const getPrefabConfigUrl = (prefabName) => `${getPrefabBaseUrl(prefabName)}/config.json`;
|
|
596
599
|
const getPrefabMinJsonUrl = (prefabName) => `${getPrefabBaseUrl(prefabName)}/pages/Main/page.min.json`;
|
|
597
600
|
const getPrefabPartialJsonUrl = (prefabName, partialName) => `${getPrefabBaseUrl(prefabName)}/pages/${partialName}/page.min.json`;
|
|
@@ -602,7 +605,7 @@ const resolvedPrefabs = new Set();
|
|
|
602
605
|
const getPrefabResourceUrl = (resourcePath, resourceBasePath) => {
|
|
603
606
|
let _url = resourcePath;
|
|
604
607
|
if (!stringStartsWith(resourcePath, 'http://|https://|//')) {
|
|
605
|
-
_url = (resourceBasePath + _url)
|
|
608
|
+
_url = (resourceBasePath + _url);
|
|
606
609
|
}
|
|
607
610
|
return _url;
|
|
608
611
|
};
|
|
@@ -2761,7 +2764,7 @@ class ToasterServiceImpl extends AbstractToasterService {
|
|
|
2761
2764
|
type: Injectable
|
|
2762
2765
|
}], () => [{ type: i1$3.ToastrService }], null); })();
|
|
2763
2766
|
|
|
2764
|
-
const APP_LOCALE_ROOT_PATH = '
|
|
2767
|
+
const APP_LOCALE_ROOT_PATH = 'resources/i18n';
|
|
2765
2768
|
const RTL_LANGUAGE_CODES = ['ar', 'ar-001', 'ar-ae', 'ar-bh', 'ar-dz', 'ar-eg', 'ar-iq', 'ar-jo', 'ar-kw', 'ar-lb', 'ar-ly',
|
|
2766
2769
|
'ar-ma', 'ar-om', 'ar-qa', 'ar-sa', 'ar-sd', 'ar-sy', 'ar-tn', 'ar-ye', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk',
|
|
2767
2770
|
'he', 'ku', 'mzn', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi'];
|
|
@@ -2832,7 +2835,8 @@ class I18nServiceImpl extends AbstractI18nService {
|
|
|
2832
2835
|
});
|
|
2833
2836
|
}
|
|
2834
2837
|
loadAppLocaleBundle() {
|
|
2835
|
-
|
|
2838
|
+
const basePath = _WM_APP_PROJECT.isPreview ? '' : _WM_APP_PROJECT.cdnUrl;
|
|
2839
|
+
this.loadResource(basePath + `${APP_LOCALE_ROOT_PATH}/${this.selectedLocale}.json`)
|
|
2836
2840
|
.then(bundle => {
|
|
2837
2841
|
this.extendMessages(bundle.messages);
|
|
2838
2842
|
this.extendPrefabMessages(bundle);
|
|
@@ -3936,6 +3940,11 @@ class HttpCallInterceptor {
|
|
|
3936
3940
|
intercept(request, next) {
|
|
3937
3941
|
let modifiedReq;
|
|
3938
3942
|
let modifiedResp;
|
|
3943
|
+
let isServicesUrl = request.url.indexOf("services/") !== -1;
|
|
3944
|
+
if (isServicesUrl) {
|
|
3945
|
+
let apiUrl = _WM_APP_PROJECT.apiUrl + request.url;
|
|
3946
|
+
request = request.clone({ url: apiUrl });
|
|
3947
|
+
}
|
|
3939
3948
|
if (appManager && appManager.appOnBeforeServiceCall) {
|
|
3940
3949
|
// Convert the angular HttpRequest to wm HttpRequest
|
|
3941
3950
|
const req = this.wmHttpRequest.angularToWmRequest(request);
|
|
@@ -4635,12 +4644,15 @@ ShadowDomRenderer = __decorate([
|
|
|
4635
4644
|
|
|
4636
4645
|
const initializeProjectDetails = () => {
|
|
4637
4646
|
let cdnUrl = document.querySelector('[name="deployUrl"]') && document.querySelector('[name="deployUrl"]').getAttribute('content');
|
|
4647
|
+
_WM_APP_PROJECT.isPreview = cdnUrl ? false : true;
|
|
4648
|
+
let apiUrl = document.querySelector('[name="apiUrl"]') && document.querySelector('[name="apiUrl"]').getAttribute('content');
|
|
4638
4649
|
//for preview
|
|
4639
4650
|
if (!cdnUrl) {
|
|
4640
4651
|
cdnUrl = document.querySelector('[name="cdnUrl"]') && document.querySelector('[name="cdnUrl"]').getAttribute('content');
|
|
4641
4652
|
}
|
|
4642
4653
|
_WM_APP_PROJECT.id = hasCordova() ? _WM_APP_PROPERTIES.displayName : location.href.split('/')[3];
|
|
4643
4654
|
// Integration with third party apps like in SSPA/WebComponents, this meta tag with cdnUrl will not be there then default it to ng-bundle/
|
|
4655
|
+
_WM_APP_PROJECT.apiUrl = apiUrl || './';
|
|
4644
4656
|
_WM_APP_PROJECT.cdnUrl = cdnUrl || 'ng-bundle/';
|
|
4645
4657
|
_WM_APP_PROJECT.ngDest = 'ng-bundle/';
|
|
4646
4658
|
try {
|