piral-aurelia 0.15.0-alpha.3809 → 0.15.0-alpha.3933
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 +1 -1
- package/esm/converter.js +18 -25
- package/esm/converter.js.map +1 -1
- package/esm/extension.js.map +1 -1
- package/esm/types.d.ts +1 -1
- package/lib/converter.js +18 -25
- package/lib/converter.js.map +1 -1
- package/lib/extension.js.map +1 -1
- package/lib/types.d.ts +1 -1
- package/package.json +4 -5
- package/src/converter.ts +25 -29
- package/src/extension.ts +2 -2
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# [Piral Aurelia](https://piral.io) · [](https://github.com/smapiot/piral/blob/main/LICENSE) [](https://www.npmjs.com/package/piral-aurelia) [](https://jestjs.io) [](https://gitter.im/piral-io/community)
|
|
4
4
|
|
|
5
|
-
This is a plugin that only has a peer dependency to `
|
|
5
|
+
This is a plugin that only has a peer dependency to `aurelia-framework` and related packages. What `piral-aurelia` brings to the table is a set of Pilet API extensions that can be used with `piral` or `piral-core`.
|
|
6
6
|
|
|
7
7
|
The set includes an Aurelia converter for any component registration, as well as a `fromAurelia` shortcut and a `AureliaExtension` component.
|
|
8
8
|
|
package/esm/converter.js
CHANGED
|
@@ -6,31 +6,24 @@ export function createConverter(config = {}) {
|
|
|
6
6
|
const { rootName = 'span' } = config;
|
|
7
7
|
initialize();
|
|
8
8
|
const Extension = createExtension(rootName);
|
|
9
|
-
const convert = (root) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
aurelia.container.registerInstance('ctx', ctx);
|
|
28
|
-
},
|
|
29
|
-
unmount() {
|
|
30
|
-
aurelia = undefined;
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
};
|
|
9
|
+
const convert = (root) => ({
|
|
10
|
+
mount(el, props, ctx, locals) {
|
|
11
|
+
const aurelia = new Aurelia(new DefaultLoader());
|
|
12
|
+
aurelia.use.eventAggregator().history().defaultBindingLanguage().globalResources([Extension]).defaultResources();
|
|
13
|
+
aurelia.container.registerInstance('props', props);
|
|
14
|
+
aurelia.container.registerInstance('ctx', ctx);
|
|
15
|
+
aurelia.container.registerInstance('piral', props.piral);
|
|
16
|
+
aurelia.start().then(() => aurelia.setRoot(root, el));
|
|
17
|
+
locals.aurelia = aurelia;
|
|
18
|
+
},
|
|
19
|
+
update(el, props, ctx, locals) {
|
|
20
|
+
locals.aurelia.container.registerInstance('props', props);
|
|
21
|
+
locals.aurelia.container.registerInstance('ctx', ctx);
|
|
22
|
+
},
|
|
23
|
+
unmount(el, locals) {
|
|
24
|
+
locals.aurelia = undefined;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
34
27
|
convert.Extension = Extension;
|
|
35
28
|
return convert;
|
|
36
29
|
}
|
package/esm/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAi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AAG,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,MAAqB;YAC/B,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;QAC7B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/esm/extension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhF,MAAM,UAAU,eAAe,CAAC,QAAgB;IAO9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;QAOpB,YAAoB,
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhF,MAAM,UAAU,eAAe,CAAC,QAAgB;IAO9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;QAOpB,YAAoB,KAAe;YAAf,UAAK,GAAL,KAAK,CAAU;QAAG,CAAC;QAEvC,QAAQ;YACN,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE;gBACxC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC;KACF,CAAA;IAfa;QAAX,QAAQ,EAAE;;kDAAsB;IACrB;QAAX,QAAQ,EAAE;;oDAAqB;IACpB;QAAX,QAAQ,EAAE;;mDAAoB;IACnB;QAAX,QAAQ,EAAE;;oDAAqB;IAL5B,gBAAgB;QANrB,MAAM,CAAC,OAAO,CAAC;QACf,aAAa,CAAC,qBAAqB,CAAC;QACpC,UAAU,CAAC;;SAEL,QAAQ,iBAAiB,QAAQ;eAC3B,CAAC;;OACR,gBAAgB,CAiBrB;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/esm/types.d.ts
CHANGED
package/lib/converter.js
CHANGED
|
@@ -9,31 +9,24 @@ function createConverter(config = {}) {
|
|
|
9
9
|
const { rootName = 'span' } = config;
|
|
10
10
|
(0, aurelia_pal_browser_1.initialize)();
|
|
11
11
|
const Extension = (0, extension_1.createExtension)(rootName);
|
|
12
|
-
const convert = (root) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
aurelia.container.registerInstance('ctx', ctx);
|
|
31
|
-
},
|
|
32
|
-
unmount() {
|
|
33
|
-
aurelia = undefined;
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
};
|
|
12
|
+
const convert = (root) => ({
|
|
13
|
+
mount(el, props, ctx, locals) {
|
|
14
|
+
const aurelia = new aurelia_framework_1.Aurelia(new DefaultLoader_1.DefaultLoader());
|
|
15
|
+
aurelia.use.eventAggregator().history().defaultBindingLanguage().globalResources([Extension]).defaultResources();
|
|
16
|
+
aurelia.container.registerInstance('props', props);
|
|
17
|
+
aurelia.container.registerInstance('ctx', ctx);
|
|
18
|
+
aurelia.container.registerInstance('piral', props.piral);
|
|
19
|
+
aurelia.start().then(() => aurelia.setRoot(root, el));
|
|
20
|
+
locals.aurelia = aurelia;
|
|
21
|
+
},
|
|
22
|
+
update(el, props, ctx, locals) {
|
|
23
|
+
locals.aurelia.container.registerInstance('props', props);
|
|
24
|
+
locals.aurelia.container.registerInstance('ctx', ctx);
|
|
25
|
+
},
|
|
26
|
+
unmount(el, locals) {
|
|
27
|
+
locals.aurelia = undefined;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
37
30
|
convert.Extension = Extension;
|
|
38
31
|
return convert;
|
|
39
32
|
}
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AACA,yDAA4C;AAC5C,6DAAiD;AACjD,mDAAgD;AAChD,2CAA8C;
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AACA,yDAA4C;AAC5C,6DAAiD;AACjD,mDAAgD;AAChD,2CAA8C;AAe9C,SAAgB,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IAErC,IAAA,gCAAU,GAAE,CAAC;IAEb,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,CAAoC,IAA2B,EAA4B,EAAE,CAAC,CAAC;QAC7G,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAqB;YACzC,MAAM,OAAO,GAAG,IAAI,2BAAO,CAAC,IAAI,6BAAa,EAAE,CAAC,CAAC;YAEjD,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC,sBAAsB,EAAE,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAEjH,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YACnD,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC/C,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YAEzD,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;YACtD,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;QACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAqB;YAC1C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC1D,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,MAAqB;YAC/B,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;QAC7B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC;AA9BD,0CA8BC"}
|
package/lib/extension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;AAAA,yDAAgF;AAIhF,SAAgB,eAAe,CAAC,QAAgB;IAO9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;QAOpB,YAAoB,
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;AAAA,yDAAgF;AAIhF,SAAgB,eAAe,CAAC,QAAgB;IAO9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;QAOpB,YAAoB,KAAe;YAAf,UAAK,GAAL,KAAK,CAAU;QAAG,CAAC;QAEvC,QAAQ;YACN,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE;gBACxC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC;KACF,CAAA;IAfa;QAAX,IAAA,4BAAQ,GAAE;;kDAAsB;IACrB;QAAX,IAAA,4BAAQ,GAAE;;oDAAqB;IACpB;QAAX,IAAA,4BAAQ,GAAE;;mDAAoB;IACnB;QAAX,IAAA,4BAAQ,GAAE;;oDAAqB;IAL5B,gBAAgB;QANrB,IAAA,0BAAM,EAAC,OAAO,CAAC;QACf,IAAA,iCAAa,EAAC,qBAAqB,CAAC;QACpC,IAAA,8BAAU,EAAC;;SAEL,QAAQ,iBAAiB,QAAQ;eAC3B,CAAC;;OACR,gBAAgB,CAiBrB;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AA3BD,0CA2BC"}
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-aurelia",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.3933",
|
|
4
4
|
"description": "Plugin for integrating Aurelia components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"aurelia-pal-browser": "1.8.1",
|
|
51
51
|
"aurelia-templating-binding": "1.5.3",
|
|
52
52
|
"aurelia-templating-resources": "1.13.1",
|
|
53
|
-
"piral-core": "0.15.0-alpha.
|
|
53
|
+
"piral-core": "0.15.0-alpha.3933"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"aurelia-event-aggregator": "^1.0.0",
|
|
@@ -58,8 +58,7 @@
|
|
|
58
58
|
"aurelia-history-browser": "^1.0.0",
|
|
59
59
|
"aurelia-pal-browser": "^1.0.0",
|
|
60
60
|
"aurelia-templating-binding": "^1.0.0",
|
|
61
|
-
"aurelia-templating-resources": "^1.0.0"
|
|
62
|
-
"piral-core": "0.14.x"
|
|
61
|
+
"aurelia-templating-resources": "^1.0.0"
|
|
63
62
|
},
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "520a272d09f02543153f1d8b2ae23a3ae10acd6f"
|
|
65
64
|
}
|
package/src/converter.ts
CHANGED
|
@@ -13,6 +13,10 @@ export interface AureliaConverterOptions {
|
|
|
13
13
|
rootName?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
interface AureliaLocals {
|
|
17
|
+
aurelia: Aurelia;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
export function createConverter(config: AureliaConverterOptions = {}) {
|
|
17
21
|
const { rootName = 'span' } = config;
|
|
18
22
|
|
|
@@ -20,35 +24,27 @@ export function createConverter(config: AureliaConverterOptions = {}) {
|
|
|
20
24
|
|
|
21
25
|
const Extension = createExtension(rootName);
|
|
22
26
|
|
|
23
|
-
const convert = <TProps extends BaseComponentProps>(root: AureliaModule<TProps>): ForeignComponent<TProps> => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
aurelia.container.registerInstance('props', props);
|
|
45
|
-
aurelia.container.registerInstance('ctx', ctx);
|
|
46
|
-
},
|
|
47
|
-
unmount() {
|
|
48
|
-
aurelia = undefined;
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
};
|
|
27
|
+
const convert = <TProps extends BaseComponentProps>(root: AureliaModule<TProps>): ForeignComponent<TProps> => ({
|
|
28
|
+
mount(el, props, ctx, locals: AureliaLocals) {
|
|
29
|
+
const aurelia = new Aurelia(new DefaultLoader());
|
|
30
|
+
|
|
31
|
+
aurelia.use.eventAggregator().history().defaultBindingLanguage().globalResources([Extension]).defaultResources();
|
|
32
|
+
|
|
33
|
+
aurelia.container.registerInstance('props', props);
|
|
34
|
+
aurelia.container.registerInstance('ctx', ctx);
|
|
35
|
+
aurelia.container.registerInstance('piral', props.piral);
|
|
36
|
+
|
|
37
|
+
aurelia.start().then(() => aurelia.setRoot(root, el));
|
|
38
|
+
locals.aurelia = aurelia;
|
|
39
|
+
},
|
|
40
|
+
update(el, props, ctx, locals: AureliaLocals) {
|
|
41
|
+
locals.aurelia.container.registerInstance('props', props);
|
|
42
|
+
locals.aurelia.container.registerInstance('ctx', ctx);
|
|
43
|
+
},
|
|
44
|
+
unmount(el, locals: AureliaLocals) {
|
|
45
|
+
locals.aurelia = undefined;
|
|
46
|
+
},
|
|
47
|
+
});
|
|
52
48
|
convert.Extension = Extension;
|
|
53
49
|
return convert;
|
|
54
50
|
}
|
package/src/extension.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inlineView, customElement, bindable, inject } from 'aurelia-framework';
|
|
2
|
-
import type { ExtensionSlotProps } from 'piral-core';
|
|
2
|
+
import type { ExtensionSlotProps, PiletApi } from 'piral-core';
|
|
3
3
|
import type { AureliaModule } from './types';
|
|
4
4
|
|
|
5
5
|
export function createExtension(rootName: string): AureliaModule<ExtensionSlotProps> {
|
|
@@ -16,7 +16,7 @@ export function createExtension(rootName: string): AureliaModule<ExtensionSlotPr
|
|
|
16
16
|
@bindable() private empty: any;
|
|
17
17
|
@bindable() private params: any;
|
|
18
18
|
|
|
19
|
-
constructor(private piral:
|
|
19
|
+
constructor(private piral: PiletApi) {}
|
|
20
20
|
|
|
21
21
|
attached() {
|
|
22
22
|
this.piral.renderHtmlExtension(this.host, {
|
package/src/types.ts
CHANGED