piral-ng 0.14.0-beta.3157 → 0.14.0-beta.3187
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/README.md +163 -15
- package/common.d.ts +2 -0
- package/common.js +2 -0
- package/esm/NgExtension.d.ts +16 -0
- package/esm/NgExtension.js +60 -0
- package/esm/NgExtension.js.map +1 -0
- package/esm/ResourceUrlPipe.d.ts +3 -0
- package/esm/ResourceUrlPipe.js +27 -2
- package/esm/ResourceUrlPipe.js.map +1 -1
- package/esm/RoutingService.d.ts +2 -0
- package/esm/RoutingService.js +46 -5
- package/esm/RoutingService.js.map +1 -1
- package/esm/SharedModule.d.ts +15 -0
- package/esm/SharedModule.js +42 -6
- package/esm/SharedModule.js.map +1 -1
- package/esm/bootstrap.js +2 -1
- package/esm/bootstrap.js.map +1 -1
- package/esm/converter.js +1 -1
- package/esm/converter.js.map +1 -1
- package/esm/module.js +73 -12
- package/esm/module.js.map +1 -1
- package/esm/startup.js +4 -2
- package/esm/startup.js.map +1 -1
- package/esm/utils.d.ts +3 -2
- package/esm/utils.js +14 -13
- package/esm/utils.js.map +1 -1
- package/extend-webpack.js +67 -0
- package/lib/NgExtension.d.ts +16 -0
- package/lib/{extension.js → NgExtension.js} +32 -4
- package/lib/NgExtension.js.map +1 -0
- package/lib/ResourceUrlPipe.d.ts +3 -0
- package/lib/ResourceUrlPipe.js +27 -2
- package/lib/ResourceUrlPipe.js.map +1 -1
- package/lib/RoutingService.d.ts +2 -0
- package/lib/RoutingService.js +46 -5
- package/lib/RoutingService.js.map +1 -1
- package/lib/SharedModule.d.ts +15 -0
- package/lib/SharedModule.js +42 -6
- package/lib/SharedModule.js.map +1 -1
- package/lib/bootstrap.js +2 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/converter.js +2 -2
- package/lib/converter.js.map +1 -1
- package/lib/module.js +73 -12
- package/lib/module.js.map +1 -1
- package/lib/startup.js +3 -1
- package/lib/startup.js.map +1 -1
- package/lib/utils.d.ts +3 -2
- package/lib/utils.js +17 -15
- package/lib/utils.js.map +1 -1
- package/package.json +5 -4
- package/src/NgExtension.ts +61 -0
- package/src/ResourceUrlPipe.ts +34 -0
- package/src/RoutingService.ts +67 -17
- package/src/SharedModule.ts +52 -4
- package/src/bootstrap.ts +2 -1
- package/src/converter.ts +1 -1
- package/src/module.ts +92 -9
- package/src/startup.ts +4 -2
- package/src/utils.ts +19 -19
- package/esm/extension.d.ts +0 -10
- package/esm/extension.js +0 -32
- package/esm/extension.js.map +0 -1
- package/lib/extension.d.ts +0 -10
- package/lib/extension.js.map +0 -1
- package/src/extension.ts +0 -20
package/lib/SharedModule.js
CHANGED
|
@@ -1,21 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var SharedModule_1;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.SharedModule = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const ngCore = require("@angular/core");
|
|
5
7
|
const common_1 = require("@angular/common");
|
|
6
8
|
const core_1 = require("@angular/core");
|
|
7
|
-
const
|
|
9
|
+
const NgExtension_1 = require("./NgExtension");
|
|
8
10
|
const ResourceUrlPipe_1 = require("./ResourceUrlPipe");
|
|
9
|
-
|
|
11
|
+
const ngc = ngCore;
|
|
12
|
+
const declarationsDef = [NgExtension_1.NgExtension, ResourceUrlPipe_1.ResourceUrlPipe];
|
|
13
|
+
const exportsDef = [NgExtension_1.NgExtension, ResourceUrlPipe_1.ResourceUrlPipe];
|
|
14
|
+
const importsDef = [common_1.CommonModule];
|
|
15
|
+
let SharedModule = SharedModule_1 = class SharedModule {
|
|
10
16
|
};
|
|
11
17
|
SharedModule.props = {};
|
|
12
|
-
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
SharedModule.ɵfac = 'ɵɵinject' in ngc ? (t) => new (t || SharedModule_1)() : undefined;
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
SharedModule.ɵmod = 'ɵɵdefineNgModule' in ngc
|
|
22
|
+
? ngc.ɵɵdefineNgModule({
|
|
23
|
+
type: SharedModule_1,
|
|
24
|
+
})
|
|
25
|
+
: undefined;
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
SharedModule.ɵinj = 'ɵɵdefineInjector' in ngc
|
|
28
|
+
? ngc.ɵɵdefineInjector({
|
|
29
|
+
providers: [],
|
|
30
|
+
imports: [importsDef],
|
|
31
|
+
})
|
|
32
|
+
: undefined;
|
|
33
|
+
SharedModule = SharedModule_1 = (0, tslib_1.__decorate)([
|
|
13
34
|
(0, core_1.NgModule)({
|
|
14
|
-
declarations:
|
|
35
|
+
declarations: declarationsDef,
|
|
15
36
|
providers: [],
|
|
16
|
-
imports:
|
|
17
|
-
exports:
|
|
37
|
+
imports: importsDef,
|
|
38
|
+
exports: exportsDef,
|
|
18
39
|
})
|
|
19
40
|
], SharedModule);
|
|
20
41
|
exports.SharedModule = SharedModule;
|
|
42
|
+
if ('ɵsetClassMetadata' in ngc) {
|
|
43
|
+
ngc.ɵsetClassMetadata(SharedModule, [
|
|
44
|
+
{
|
|
45
|
+
type: core_1.NgModule,
|
|
46
|
+
args: [
|
|
47
|
+
{
|
|
48
|
+
declarations: declarationsDef,
|
|
49
|
+
providers: [],
|
|
50
|
+
imports: importsDef,
|
|
51
|
+
exports: exportsDef,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
21
57
|
//# sourceMappingURL=SharedModule.js.map
|
package/lib/SharedModule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedModule.js","sourceRoot":"","sources":["../src/SharedModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SharedModule.js","sourceRoot":"","sources":["../src/SharedModule.ts"],"names":[],"mappings":";;;;;AAAA,wCAAwC;AACxC,4CAA+C;AAC/C,wCAAyC;AACzC,+CAA4C;AAC5C,uDAAoD;AAEpD,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UAAU;iBACpB;aACF;SACF;KACF,CAAC,CAAC;CACJ"}
|
package/lib/bootstrap.js
CHANGED
|
@@ -16,7 +16,8 @@ function prepareBootstrap(moduleOrComponent) {
|
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
18
|
// usually contains things like selector, template or templateUrl, changeDetection, ...
|
|
19
|
-
|
|
19
|
+
const result = (0, module_1.getModuleInstance)(moduleOrComponent) || (0, module_1.createModuleInstance)(moduleOrComponent);
|
|
20
|
+
return [...result, moduleOrComponent];
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
exports.prepareBootstrap = prepareBootstrap;
|
package/lib/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;;AAEA,uCAAoC;AACpC,mCAAyC;AACzC,qCAAiF;AAEjF,SAAgB,gBAAgB,CAAC,iBAAsB;IACrD,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,sBAAc,EAAC,iBAAiB,CAAC,CAAC;IAEvD,IAAI,UAAU,IAAI,UAAU,CAAC,SAAS,EAAE;QACtC,mEAAmE;QACnE,MAAM,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC;QACzC,UAAU,CAAC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;QACjC,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,IAAA,0BAAiB,EAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;KACrD;SAAM;QACL,uFAAuF;QACvF,
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;;AAEA,uCAAoC;AACpC,mCAAyC;AACzC,qCAAiF;AAEjF,SAAgB,gBAAgB,CAAC,iBAAsB;IACrD,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,sBAAc,EAAC,iBAAiB,CAAC,CAAC;IAEvD,IAAI,UAAU,IAAI,UAAU,CAAC,SAAS,EAAE;QACtC,mEAAmE;QACnE,MAAM,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC;QACzC,UAAU,CAAC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;QACjC,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,IAAA,0BAAiB,EAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;KACrD;SAAM;QACL,uFAAuF;QACvF,MAAM,MAAM,GAAG,IAAA,0BAAiB,EAAC,iBAAiB,CAAC,IAAI,IAAA,6BAAoB,EAAC,iBAAiB,CAAC,CAAC;QAC/F,OAAO,CAAC,GAAG,MAAM,EAAE,iBAAiB,CAAC,CAAC;KACvC;AACH,CAAC;AAdD,4CAcC;AAED,SAAsB,SAAS,CAC7B,MAA8B,EAC9B,IAAiB,EACjB,KAAa,EACb,OAAyB;;QAEzB,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC;QACtD,MAAM,GAAG,GAAG,MAAM,IAAA,iBAAO,EAAC,cAAc,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9D,IAAI,GAAG,EAAE;YACP,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;SACnD;QAED,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;CAAA;AAfD,8BAeC"}
|
package/lib/converter.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createConverter = void 0;
|
|
4
|
+
const NgExtension_1 = require("./NgExtension");
|
|
4
5
|
const queue_1 = require("./queue");
|
|
5
6
|
const module_1 = require("./module");
|
|
6
|
-
const extension_1 = require("./extension");
|
|
7
7
|
const bootstrap_1 = require("./bootstrap");
|
|
8
8
|
function createConverter(_ = {}) {
|
|
9
9
|
const convert = (component) => {
|
|
@@ -22,7 +22,7 @@ function createConverter(_ = {}) {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
convert.defineModule = module_1.defineModule;
|
|
25
|
-
convert.Extension =
|
|
25
|
+
convert.Extension = NgExtension_1.NgExtension;
|
|
26
26
|
return convert;
|
|
27
27
|
}
|
|
28
28
|
exports.createConverter = createConverter;
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,mCAAkC;AAClC,qCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAC5C,mCAAkC;AAClC,qCAAwC;AACxC,2CAA0D;AAU1D,SAAgB,eAAe,CAAC,IAAwB,EAAE;IACxD,MAAM,OAAO,GAAG,CAAoC,SAAc,EAA4B,EAAE;QAC9F,MAAM,YAAY,GAAG,IAAA,4BAAgB,EAAC,SAAS,CAAC,CAAC;QACjD,IAAI,OAAO,GAA+B,OAAO,CAAC,OAAO,EAAE,CAAC;QAC5D,IAAI,MAAM,GAAG,IAAI,CAAC;QAElB,OAAO;YACL,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;gBAClB,MAAM,GAAG,IAAI,CAAC;gBACd,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,MAAM,IAAI,IAAA,qBAAS,EAAC,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;YACjG,CAAC;YACD,OAAO;gBACL,MAAM,GAAG,KAAK,CAAC;gBACf,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,OAAO,EAAE,CAAC,CAAC;YAC5D,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,CAAC,YAAY,GAAG,qBAAY,CAAC;IACpC,OAAO,CAAC,SAAS,GAAG,yBAAW,CAAC;IAChC,OAAO,OAAO,CAAC;AACjB,CAAC;AApBD,0CAoBC"}
|
package/lib/module.js
CHANGED
|
@@ -2,18 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineModule = exports.createModuleInstance = exports.getModuleInstance = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const ngCore = require("@angular/core");
|
|
5
6
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
6
7
|
const common_1 = require("@angular/common");
|
|
7
8
|
const core_1 = require("@angular/core");
|
|
8
9
|
const RoutingService_1 = require("./RoutingService");
|
|
9
10
|
const SharedModule_1 = require("./SharedModule");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
12
|
+
const ngc = ngCore;
|
|
11
13
|
const availableModules = [];
|
|
12
14
|
function instantiateModule(moduleDef) {
|
|
15
|
+
var BootstrapModule_1;
|
|
13
16
|
const { module, components } = moduleDef;
|
|
14
17
|
const imports = [platform_browser_1.BrowserModule, SharedModule_1.SharedModule, module];
|
|
15
18
|
const props = { current: undefined };
|
|
16
|
-
|
|
19
|
+
const providers = [
|
|
20
|
+
RoutingService_1.RoutingService,
|
|
21
|
+
{ provide: 'Props', useFactory: () => props.current, deps: [] },
|
|
22
|
+
{ provide: 'piral', useFactory: () => props.current.piral, deps: [] },
|
|
23
|
+
];
|
|
24
|
+
let BootstrapModule = BootstrapModule_1 = class BootstrapModule {
|
|
17
25
|
constructor(resolver, zone, routing) {
|
|
18
26
|
this.resolver = resolver;
|
|
19
27
|
this.zone = zone;
|
|
@@ -41,18 +49,42 @@ function instantiateModule(moduleDef) {
|
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
51
|
};
|
|
44
|
-
BootstrapModule =
|
|
52
|
+
BootstrapModule.ɵfac = 'ɵɵinject' in ngc
|
|
53
|
+
? (t) => new (t || BootstrapModule_1)(ngc.ɵɵinject(core_1.ComponentFactoryResolver), ngc.ɵɵinject(core_1.NgZone), ngc.ɵɵinject(RoutingService_1.RoutingService))
|
|
54
|
+
: undefined;
|
|
55
|
+
BootstrapModule.ɵmod = 'ɵɵdefineNgModule' in ngc
|
|
56
|
+
? ngc.ɵɵdefineNgModule({
|
|
57
|
+
type: BootstrapModule_1,
|
|
58
|
+
})
|
|
59
|
+
: undefined;
|
|
60
|
+
BootstrapModule.ɵinj = 'ɵɵdefineInjector' in ngc
|
|
61
|
+
? ngc.ɵɵdefineInjector({
|
|
62
|
+
providers,
|
|
63
|
+
imports: [imports],
|
|
64
|
+
})
|
|
65
|
+
: undefined;
|
|
66
|
+
BootstrapModule = BootstrapModule_1 = (0, tslib_1.__decorate)([
|
|
45
67
|
(0, core_1.NgModule)({
|
|
46
68
|
imports,
|
|
47
69
|
entryComponents: components,
|
|
48
|
-
providers
|
|
49
|
-
RoutingService_1.RoutingService,
|
|
50
|
-
{ provide: 'Props', useFactory: () => props.current, deps: [] },
|
|
51
|
-
{ provide: 'piral', useFactory: () => props.current.piral, deps: [] },
|
|
52
|
-
],
|
|
70
|
+
providers,
|
|
53
71
|
}),
|
|
54
72
|
(0, tslib_1.__metadata)("design:paramtypes", [core_1.ComponentFactoryResolver, core_1.NgZone, RoutingService_1.RoutingService])
|
|
55
73
|
], BootstrapModule);
|
|
74
|
+
if ('ɵsetClassMetadata' in ngc) {
|
|
75
|
+
ngc.ɵsetClassMetadata(BootstrapModule, [
|
|
76
|
+
{
|
|
77
|
+
type: core_1.NgModule,
|
|
78
|
+
args: [
|
|
79
|
+
{
|
|
80
|
+
entryComponents: components,
|
|
81
|
+
providers,
|
|
82
|
+
imports,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
], () => [{ type: core_1.ComponentFactoryResolver }, { type: core_1.NgZone }, { type: RoutingService_1.RoutingService }]);
|
|
87
|
+
}
|
|
56
88
|
return BootstrapModule;
|
|
57
89
|
}
|
|
58
90
|
function getModuleInstance(component) {
|
|
@@ -67,15 +99,44 @@ function getModuleInstance(component) {
|
|
|
67
99
|
}
|
|
68
100
|
exports.getModuleInstance = getModuleInstance;
|
|
69
101
|
function createModuleInstance(component) {
|
|
70
|
-
|
|
102
|
+
var Module_1;
|
|
103
|
+
const declarations = [component];
|
|
104
|
+
const importsDef = [common_1.CommonModule];
|
|
105
|
+
const exportsDef = [component];
|
|
106
|
+
let Module = Module_1 = class Module {
|
|
71
107
|
};
|
|
72
|
-
Module = (
|
|
108
|
+
Module.ɵfac = 'ɵɵinject' in ngc ? (t) => new (t || Module_1)() : undefined;
|
|
109
|
+
Module.ɵmod = 'ɵɵdefineNgModule' in ngc
|
|
110
|
+
? ngc.ɵɵdefineNgModule({
|
|
111
|
+
type: Module_1,
|
|
112
|
+
})
|
|
113
|
+
: undefined;
|
|
114
|
+
Module.ɵinj = 'ɵɵdefineInjector' in ngc
|
|
115
|
+
? ngc.ɵɵdefineInjector({
|
|
116
|
+
imports: [importsDef],
|
|
117
|
+
})
|
|
118
|
+
: undefined;
|
|
119
|
+
Module = Module_1 = (0, tslib_1.__decorate)([
|
|
73
120
|
(0, core_1.NgModule)({
|
|
74
|
-
declarations
|
|
75
|
-
imports:
|
|
76
|
-
exports:
|
|
121
|
+
declarations,
|
|
122
|
+
imports: importsDef,
|
|
123
|
+
exports: exportsDef,
|
|
77
124
|
})
|
|
78
125
|
], Module);
|
|
126
|
+
if ('ɵsetClassMetadata' in ngc) {
|
|
127
|
+
ngc.ɵsetClassMetadata(Module, [
|
|
128
|
+
{
|
|
129
|
+
type: core_1.NgModule,
|
|
130
|
+
args: [
|
|
131
|
+
{
|
|
132
|
+
declarations,
|
|
133
|
+
imports: importsDef,
|
|
134
|
+
exports: exportsDef,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
]);
|
|
139
|
+
}
|
|
79
140
|
defineModule(Module);
|
|
80
141
|
return getModuleInstance(component);
|
|
81
142
|
}
|
package/lib/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;AACA,gEAA0D;AAC1D,4CAA+C;AAC/C,wCAAyG;AACzG,qDAAkD;AAClD,iDAA8C;AAC9C,mCAAyD;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;AACA,wCAAwC;AACxC,gEAA0D;AAC1D,4CAA+C;AAC/C,wCAAyG;AACzG,qDAAkD;AAClD,iDAA8C;AAC9C,mCAAyD;AAEzD,MAAM,GAAG,GAAG,MAAa,CAAC;AAS1B,MAAM,gBAAgB,GAA4B,EAAE,CAAC;AAErD,SAAS,iBAAiB,CAAC,SAA2B;;IACpD,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IACzC,MAAM,OAAO,GAAG,CAAC,gCAAa,EAAE,2BAAY,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG;QAChB,+BAAc;QACd,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;QAC/D,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;KACtE,CAAC;IAOF,IAAM,eAAe,uBAArB,MAAM,eAAe;QAInB,YAAoB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AAI,EAAE,eAAQ;gBACd,IAAI,EAAE;oBACJ;wBACE,YAAY;wBACZ,OAAO,EAAE,UAAU;wBACnB,OAAO,EAAE,UAAU;qBACpB;iBACF;aACF;SACF,CAAC,CAAC;KACJ;IAED,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AA7CD,oDA6CC;AAED,SAAgB,YAAY,CAAC,MAAW,EAAE,OAAkB,SAAS;IACnE,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,sBAAc,EAAC,MAAM,CAAC,CAAC;IAC5C,gBAAgB,CAAC,IAAI,CAAC;QACpB,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,IAAA,sBAAc,EAAC,UAAU,CAAC,OAAO,CAAC;QAC9C,MAAM;QACN,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AARD,oCAQC"}
|
package/lib/startup.js
CHANGED
|
@@ -4,8 +4,10 @@ exports.startup = void 0;
|
|
|
4
4
|
const core_1 = require("@angular/core");
|
|
5
5
|
const common_1 = require("@angular/common");
|
|
6
6
|
const platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
7
8
|
function getVersionHandler(versions) {
|
|
8
|
-
const
|
|
9
|
+
const major = (0, utils_1.getNgVersion)();
|
|
10
|
+
const version = `v${major}`;
|
|
9
11
|
return versions[version];
|
|
10
12
|
}
|
|
11
13
|
const runningModules = [];
|
package/lib/startup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup.js","sourceRoot":"","sources":["../src/startup.ts"],"names":[],"mappings":";;;AAEA,wCAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"startup.js","sourceRoot":"","sources":["../src/startup.ts"],"names":[],"mappings":";;;AAEA,wCAAoE;AACpE,4CAAgD;AAChD,gFAA2E;AAC3E,mCAAuC;AAEvC,SAAS,iBAAiB,CAAC,QAAoC;IA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,QAAQ;QAC5B,EAAE,EAAE,eAAe,CAAC,QAAQ;QAC5B,EAAE,EAAE,eAAe,CAAC,OAAO;QAC3B,GAAG,EAAE,eAAe,CAAC,OAAO;QAC5B,GAAG,EAAE,eAAe,CAAC,OAAO;QAC5B,GAAG,EAAE,eAAe,CAAC,IAAI;KAC1B,CAAC;IAEF,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,eAAe,CAAC,OAAO,CAAC;IACvE,OAAO,EAAE,CAAC;CACX;AAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAA,qBAAc,GAAE,CAAC;CAClB"}
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { StaticProvider } from '@angular/core';
|
|
2
2
|
export interface NgAnnotation {
|
|
3
3
|
_initial?: Array<StaticProvider>;
|
|
4
4
|
providers: Array<StaticProvider>;
|
|
@@ -9,6 +9,7 @@ export interface NgAnnotation {
|
|
|
9
9
|
bootstrap: any;
|
|
10
10
|
selector: string;
|
|
11
11
|
}
|
|
12
|
+
export declare function getNgVersion(): string;
|
|
13
|
+
export declare function getMinVersion(): string;
|
|
12
14
|
export declare function getAnnotations(component: any): Array<NgAnnotation>;
|
|
13
15
|
export declare function findComponents(exports: Array<any>): Array<any>;
|
|
14
|
-
export declare function addImportRecursively(targetModule: any, importModule: any): void;
|
package/lib/utils.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findComponents = exports.getAnnotations = exports.getMinVersion = exports.getNgVersion = void 0;
|
|
4
|
+
const core_1 = require("@angular/core");
|
|
5
|
+
function getNgVersion() {
|
|
6
|
+
return core_1.VERSION.major || core_1.VERSION.full.split('.')[0];
|
|
7
|
+
}
|
|
8
|
+
exports.getNgVersion = getNgVersion;
|
|
9
|
+
function getMinVersion() {
|
|
10
|
+
const major = getNgVersion();
|
|
11
|
+
return `${major}.0.0`;
|
|
12
|
+
}
|
|
13
|
+
exports.getMinVersion = getMinVersion;
|
|
4
14
|
function getAnnotations(component) {
|
|
5
15
|
let annotations = component === null || component === void 0 ? void 0 : component.__annotations__;
|
|
6
16
|
if (!annotations && typeof Reflect !== 'undefined' && 'getOwnMetadata' in Reflect) {
|
|
7
17
|
annotations = Reflect.getOwnMetadata('annotations', component);
|
|
8
18
|
}
|
|
19
|
+
if (!annotations && typeof component.ɵcmp !== 'undefined') {
|
|
20
|
+
annotations = [{}];
|
|
21
|
+
}
|
|
22
|
+
if (!annotations && typeof component.ɵmod !== 'undefined') {
|
|
23
|
+
annotations = [component.ɵmod];
|
|
24
|
+
}
|
|
9
25
|
return annotations || [];
|
|
10
26
|
}
|
|
11
27
|
exports.getAnnotations = getAnnotations;
|
|
@@ -27,18 +43,4 @@ function findComponents(exports) {
|
|
|
27
43
|
return components;
|
|
28
44
|
}
|
|
29
45
|
exports.findComponents = findComponents;
|
|
30
|
-
function addImportRecursively(targetModule, importModule) {
|
|
31
|
-
const [annotation] = getAnnotations(targetModule);
|
|
32
|
-
if (annotation) {
|
|
33
|
-
const existingImports = annotation.imports || [];
|
|
34
|
-
annotation.imports = [...existingImports, importModule];
|
|
35
|
-
if ('ɵinj' in targetModule) {
|
|
36
|
-
targetModule.ɵinj.imports = annotation.imports;
|
|
37
|
-
}
|
|
38
|
-
for (const existingImport of existingImports) {
|
|
39
|
-
addImportRecursively(existingImport, importModule);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.addImportRecursively = addImportRecursively;
|
|
44
46
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.js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,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;iBACxD;qBAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;oBAC9B,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;iBACrB;aACF;SACF;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAlBD,wCAkBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-ng",
|
|
3
|
-
"version": "0.14.0-beta.
|
|
3
|
+
"version": "0.14.0-beta.3187",
|
|
4
4
|
"description": "Plugin for integrating Angular components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"common.d.ts",
|
|
28
28
|
"common.js",
|
|
29
29
|
"convert.d.ts",
|
|
30
|
-
"convert.js"
|
|
30
|
+
"convert.js",
|
|
31
|
+
"extend-webpack.js"
|
|
31
32
|
],
|
|
32
33
|
"repository": {
|
|
33
34
|
"type": "git",
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
"@angular/platform-browser": "^8.0.0",
|
|
52
53
|
"@angular/platform-browser-dynamic": "^8.0.0",
|
|
53
54
|
"@angular/router": "^8.0.0",
|
|
54
|
-
"piral-core": "
|
|
55
|
+
"piral-core": "0.14.0-beta.3187",
|
|
55
56
|
"rxjs": "^7.3.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"rxjs": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
66
67
|
"zone.js": "~0.9.0 || ~0.10.0 || ~0.11.0"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "8c7afcbb45ab9fcb2dde5d8377416ff3bc86d3c8"
|
|
69
70
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PiletApi } from 'piral-core';
|
|
2
|
+
import * as ngCore from '@angular/core';
|
|
3
|
+
import { Component, ElementRef, Input, Inject } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
const ngc = ngCore as any;
|
|
6
|
+
const selector = 'extension-component';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector,
|
|
10
|
+
template: '',
|
|
11
|
+
})
|
|
12
|
+
export class NgExtension {
|
|
13
|
+
@Input('name') public name: string | undefined;
|
|
14
|
+
@Input('params') public params: object | undefined;
|
|
15
|
+
|
|
16
|
+
constructor(private elRef: ElementRef<HTMLElement>, @Inject('piral') private piral: PiletApi) {}
|
|
17
|
+
|
|
18
|
+
ngAfterContentInit() {
|
|
19
|
+
this.piral.renderHtmlExtension(this.elRef.nativeElement, {
|
|
20
|
+
name: this.name,
|
|
21
|
+
params: this.params,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
static ɵfac: ngCore.ɵɵFactoryDeclaration<NgExtension, never> =
|
|
27
|
+
'ɵɵdirectiveInject' in ngc
|
|
28
|
+
? (t: any) => new (t || NgExtension)(ngc.ɵɵdirectiveInject(ElementRef), ngc.ɵɵdirectiveInject('piral'))
|
|
29
|
+
: undefined;
|
|
30
|
+
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
static ɵcmp: ngCore.ɵɵComponentDeclaration<
|
|
33
|
+
NgExtension,
|
|
34
|
+
'extension-component',
|
|
35
|
+
never,
|
|
36
|
+
{ name: 'name'; params: 'params' },
|
|
37
|
+
{},
|
|
38
|
+
never,
|
|
39
|
+
never
|
|
40
|
+
> =
|
|
41
|
+
'ɵɵdefineComponent' in ngc
|
|
42
|
+
? ngc.ɵɵdefineComponent({
|
|
43
|
+
type: NgExtension,
|
|
44
|
+
selectors: [selector],
|
|
45
|
+
inputs: { name: 'name', params: 'params' },
|
|
46
|
+
decls: 0,
|
|
47
|
+
vars: 0,
|
|
48
|
+
template: () => {},
|
|
49
|
+
encapsulation: 2,
|
|
50
|
+
})
|
|
51
|
+
: undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if ('ɵsetClassMetadata' in ngc) {
|
|
55
|
+
ngc.ɵsetClassMetadata(NgExtension, [
|
|
56
|
+
{
|
|
57
|
+
type: Component,
|
|
58
|
+
args: [{ selector, template: '' }],
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
61
|
+
}
|
package/src/ResourceUrlPipe.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { PiletApi } from 'piral-core';
|
|
2
|
+
import * as ngCore from '@angular/core';
|
|
2
3
|
import { Inject, Pipe, PipeTransform } from '@angular/core';
|
|
3
4
|
|
|
5
|
+
const ngc = ngCore as any;
|
|
6
|
+
|
|
4
7
|
@Pipe({ name: 'resourceUrl' })
|
|
5
8
|
export class ResourceUrlPipe implements PipeTransform {
|
|
6
9
|
constructor(@Inject('piral') private piral: PiletApi) {}
|
|
@@ -9,4 +12,35 @@ export class ResourceUrlPipe implements PipeTransform {
|
|
|
9
12
|
const { basePath = '/' } = this.piral.meta;
|
|
10
13
|
return basePath + value;
|
|
11
14
|
}
|
|
15
|
+
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
static ɵfac: ngCore.ɵɵFactoryDeclaration<ResourceUrlPipe, never> =
|
|
18
|
+
'ɵɵdirectiveInject' in ngc ? (t: any) => new (t || ResourceUrlPipe)(ngc.ɵɵdirectiveInject('piral', 16)) : undefined;
|
|
19
|
+
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
static ɵpipe: ngCore.ɵɵPipeDeclaration<ResourceUrlPipe, 'resourceUrl'> =
|
|
22
|
+
'ɵɵdefinePipe' in ngc ? ngc.ɵɵdefinePipe({ name: 'resourceUrl', type: ResourceUrlPipe, pure: true }) : undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if ('ɵsetClassMetadata' in ngc) {
|
|
26
|
+
ngc.ɵsetClassMetadata(
|
|
27
|
+
ResourceUrlPipe,
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
type: Pipe,
|
|
31
|
+
args: [{ name: 'resourceUrl' }],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
() => [
|
|
35
|
+
{
|
|
36
|
+
type: undefined,
|
|
37
|
+
decorators: [
|
|
38
|
+
{
|
|
39
|
+
type: Inject,
|
|
40
|
+
args: ['piral'],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
);
|
|
12
46
|
}
|
package/src/RoutingService.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { Subscription } from 'rxjs';
|
|
2
2
|
import type { ComponentContext, Disposable } from 'piral-core';
|
|
3
|
+
import * as ngCore from '@angular/core';
|
|
3
4
|
import { Inject, Injectable, NgZone, OnDestroy, Optional } from '@angular/core';
|
|
4
5
|
import { NavigationError, Router } from '@angular/router';
|
|
5
6
|
import { filter } from 'rxjs/operators';
|
|
6
7
|
|
|
8
|
+
const ngc = ngCore as any;
|
|
9
|
+
|
|
7
10
|
@Injectable()
|
|
8
11
|
export class RoutingService implements OnDestroy {
|
|
9
|
-
private dispose: Disposable;
|
|
10
|
-
private subscription: Subscription;
|
|
11
|
-
private invalidRoutes = [];
|
|
12
|
+
private dispose: Disposable | undefined;
|
|
13
|
+
private subscription: Subscription | undefined;
|
|
14
|
+
private invalidRoutes: Array<string> = [];
|
|
12
15
|
|
|
13
16
|
constructor(
|
|
14
17
|
@Inject('Context') public context: ComponentContext,
|
|
@@ -17,11 +20,11 @@ export class RoutingService implements OnDestroy {
|
|
|
17
20
|
) {
|
|
18
21
|
if (this.router) {
|
|
19
22
|
this.router.errorHandler = (error: Error) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (error.message.match('Cannot match any routes')) {
|
|
24
|
+
// ignore this special error
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
throw error;
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
this.dispose = this.context.router.history.listen((e) => {
|
|
@@ -32,17 +35,15 @@ export class RoutingService implements OnDestroy {
|
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
|
|
35
|
-
this.subscription = this.router.events
|
|
36
|
-
|
|
37
|
-
.subscribe((e: NavigationError) => {
|
|
38
|
-
const path = e.url;
|
|
38
|
+
this.subscription = this.router.events.pipe(filter((e) => e instanceof NavigationError)).subscribe((e) => {
|
|
39
|
+
const path = (e as NavigationError).url;
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if (!this.invalidRoutes.includes(path)) {
|
|
42
|
+
this.invalidRoutes.push(path);
|
|
43
|
+
}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
this.context.router.history.push(path);
|
|
46
|
+
});
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -50,4 +51,53 @@ export class RoutingService implements OnDestroy {
|
|
|
50
51
|
this.dispose?.();
|
|
51
52
|
this.subscription?.unsubscribe();
|
|
52
53
|
}
|
|
54
|
+
|
|
55
|
+
static ɵfac =
|
|
56
|
+
'ɵɵinject' in ngc
|
|
57
|
+
? (t: any) => new (t || RoutingService)(ngc.ɵɵinject('Context'), ngc.ɵɵinject(Router, 8), ngc.ɵɵinject(NgZone, 8))
|
|
58
|
+
: undefined;
|
|
59
|
+
|
|
60
|
+
static ɵprov =
|
|
61
|
+
'ɵɵngDeclareInjectable' in ngc
|
|
62
|
+
? ngc.ɵɵdefineInjectable({ token: RoutingService, factory: RoutingService.ɵfac })
|
|
63
|
+
: undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if ('ɵsetClassMetadata' in ngc) {
|
|
67
|
+
ngc.ɵsetClassMetadata(
|
|
68
|
+
RoutingService,
|
|
69
|
+
[
|
|
70
|
+
{
|
|
71
|
+
type: Injectable,
|
|
72
|
+
args: [{ name: 'resourceUrl' }],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
() => [
|
|
76
|
+
{
|
|
77
|
+
type: undefined,
|
|
78
|
+
decorators: [
|
|
79
|
+
{
|
|
80
|
+
type: Inject,
|
|
81
|
+
args: ['Context'],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: Router,
|
|
87
|
+
decorators: [
|
|
88
|
+
{
|
|
89
|
+
type: Optional,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: NgZone,
|
|
95
|
+
decorators: [
|
|
96
|
+
{
|
|
97
|
+
type: Optional,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
);
|
|
53
103
|
}
|