piral-ember 1.6.0-beta.7216 → 1.6.0-beta.7243
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/convert.d.ts +1 -1
- package/convert.js +1 -1
- package/lib/converter.js +3 -7
- package/lib/converter.js.map +1 -1
- package/lib/create.js +5 -9
- package/lib/create.js.map +1 -1
- package/lib/extension.js +1 -5
- package/lib/extension.js.map +1 -1
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/load.js +1 -5
- package/lib/load.js.map +1 -1
- package/lib/types.js +1 -2
- package/package.json +9 -25
- package/esm/converter.d.ts +0 -13
- package/esm/converter.js +0 -29
- package/esm/converter.js.map +0 -1
- package/esm/create.d.ts +0 -12
- package/esm/create.js +0 -23
- package/esm/create.js.map +0 -1
- package/esm/extension.d.ts +0 -1
- package/esm/extension.js +0 -11
- package/esm/extension.js.map +0 -1
- package/esm/index.d.ts +0 -2
- package/esm/index.js +0 -3
- package/esm/index.js.map +0 -1
- package/esm/load.d.ts +0 -1
- package/esm/load.js +0 -26
- package/esm/load.js.map +0 -1
- package/esm/types.d.ts +0 -57
- package/esm/types.js +0 -2
- package/esm/types.js.map +0 -1
package/convert.d.ts
CHANGED
package/convert.js
CHANGED
package/lib/converter.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createConverter = void 0;
|
|
4
|
-
const extension_1 = require("./extension");
|
|
5
|
-
function createConverter(config = {}) {
|
|
1
|
+
import { createExtension } from './extension';
|
|
2
|
+
export function createConverter(config = {}) {
|
|
6
3
|
const { selector = 'ember-extension' } = config;
|
|
7
|
-
const Extension =
|
|
4
|
+
const Extension = createExtension(selector);
|
|
8
5
|
const convert = (App, opts) => ({
|
|
9
6
|
mount(rootElement, props, ctx, locals) {
|
|
10
7
|
locals.app = App.create({
|
|
@@ -29,5 +26,4 @@ function createConverter(config = {}) {
|
|
|
29
26
|
convert.Extension = Extension;
|
|
30
27
|
return convert;
|
|
31
28
|
}
|
|
32
|
-
exports.createConverter = createConverter;
|
|
33
29
|
//# sourceMappingURL=converter.js.map
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAe9C,MAAM,UAAU,eAAe,CAAC,SAAgC,EAAE;IAChE,MAAM,EAAE,QAAQ,GAAG,iBAAiB,EAAE,GAAG,MAAM,CAAC;IAEhD,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,CACd,GAAwB,EACxB,IAAS,EACiB,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YACvD,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;gBACtB,GAAG,IAAI;gBACP,WAAW;gBACX,KAAK;gBACL,GAAG;aACJ,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YACxD,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;gBACvB,KAAK;gBACL,GAAG;aACJ,CAAC,CAAC;QACL,CAAC;QACD,OAAO,CAAC,WAAW,EAAE,MAA0B;YAC7C,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC;YACvB,WAAW,CAAC,SAAS,GAAG,EAAE,CAAC;QAC7B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/lib/create.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createEmberApi = void 0;
|
|
4
|
-
const load_1 = require("./load");
|
|
5
|
-
const converter_1 = require("./converter");
|
|
1
|
+
import { loadEmberApp } from './load';
|
|
2
|
+
import { createConverter } from './converter';
|
|
6
3
|
/**
|
|
7
4
|
* Creates Pilet API extensions for integrating Ember.js.
|
|
8
5
|
*/
|
|
9
|
-
function createEmberApi(config = {}) {
|
|
6
|
+
export function createEmberApi(config = {}) {
|
|
10
7
|
return (context) => {
|
|
11
|
-
const convert =
|
|
8
|
+
const convert = createConverter(config);
|
|
12
9
|
context.converters.ember = ({ App, opts }) => convert(App, opts);
|
|
13
10
|
return {
|
|
14
11
|
fromEmber(App, opts) {
|
|
@@ -18,10 +15,9 @@ function createEmberApi(config = {}) {
|
|
|
18
15
|
opts,
|
|
19
16
|
};
|
|
20
17
|
},
|
|
21
|
-
loadEmberApp
|
|
18
|
+
loadEmberApp,
|
|
22
19
|
EmberExtension: convert.Extension,
|
|
23
20
|
};
|
|
24
21
|
};
|
|
25
22
|
}
|
|
26
|
-
exports.createEmberApi = createEmberApi;
|
|
27
23
|
//# sourceMappingURL=create.js.map
|
package/lib/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAyB,MAAM,aAAa,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAsB,EAAE;IACrD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEjE,OAAO;YACL,SAAS,CAAC,GAAG,EAAE,IAAI;gBACjB,OAAO;oBACL,IAAI,EAAE,OAAO;oBACb,GAAG;oBACH,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,YAAY;YACZ,cAAc,EAAE,OAAO,CAAC,SAAS;SAClC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/extension.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createExtension = void 0;
|
|
4
|
-
function createExtension(selector) {
|
|
1
|
+
export function createExtension(selector) {
|
|
5
2
|
const defaultExtensionSelector = 'piral-extension';
|
|
6
3
|
if ('customElements' in window && selector && selector !== defaultExtensionSelector) {
|
|
7
4
|
const ExtensionBase = customElements.get(defaultExtensionSelector);
|
|
@@ -11,5 +8,4 @@ function createExtension(selector) {
|
|
|
11
8
|
}
|
|
12
9
|
return selector || defaultExtensionSelector;
|
|
13
10
|
}
|
|
14
|
-
exports.createExtension = createExtension;
|
|
15
11
|
//# sourceMappingURL=extension.js.map
|
package/lib/extension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IAEnD,IAAI,gBAAgB,IAAI,MAAM,IAAI,QAAQ,IAAI,QAAQ,KAAK,wBAAwB,EAAE;QACnF,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnE,MAAM,cAAe,SAAQ,aAAa;SAAG;QAC7C,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KACjD;IAED,OAAO,QAAQ,IAAI,wBAAwB,CAAC;AAC9C,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./create"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
1
|
+
export * from './create';
|
|
2
|
+
export * from './types';
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/lib/load.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadEmberApp = void 0;
|
|
4
|
-
function loadEmberApp(appName, appUrl, vendorUrl) {
|
|
1
|
+
export function loadEmberApp(appName, appUrl, vendorUrl) {
|
|
5
2
|
return new Promise((resolve, reject) => {
|
|
6
3
|
if (vendorUrl) {
|
|
7
4
|
const scriptVendor = document.createElement('script');
|
|
@@ -26,5 +23,4 @@ function loadEmberApp(appName, appUrl, vendorUrl) {
|
|
|
26
23
|
}
|
|
27
24
|
});
|
|
28
25
|
}
|
|
29
|
-
exports.loadEmberApp = loadEmberApp;
|
|
30
26
|
//# sourceMappingURL=load.js.map
|
package/lib/load.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,MAAc,EAAE,SAAkB;IAC9E,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,IAAI,SAAS,EAAE;YACb,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACtD,YAAY,CAAC,GAAG,GAAG,SAAS,CAAC;YAC7B,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;YAC1B,YAAY,CAAC,MAAM,GAAG,OAAO,CAAC;YAC9B,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;SACzC;aAAM;YACL,OAAO,EAAE,CAAC;SACX;QAED,SAAS,OAAO;YACd,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAClD,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC;YACtB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;YACtB,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE;gBACrB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;YAC5C,CAAC,CAAC;YACF,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/lib/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-ember",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.7243",
|
|
4
4
|
"description": "Plugin for integrating Ember.js components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -16,32 +16,17 @@
|
|
|
16
16
|
"author": "smapiot",
|
|
17
17
|
"homepage": "https://piral.io",
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"module": "
|
|
19
|
+
"module": "lib/index.js",
|
|
20
20
|
"main": "lib/index.js",
|
|
21
21
|
"typings": "lib/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
"./convert": {
|
|
28
|
-
"import": "./convert.js"
|
|
29
|
-
},
|
|
30
|
-
"./esm/*": {
|
|
31
|
-
"import": "./esm/*"
|
|
32
|
-
},
|
|
33
|
-
"./lib/*": {
|
|
34
|
-
"require": "./lib/*"
|
|
35
|
-
},
|
|
36
|
-
"./_/*": {
|
|
37
|
-
"import": "./esm/*.js",
|
|
38
|
-
"require": "./lib/*.js"
|
|
39
|
-
},
|
|
23
|
+
".": "./lib/index.js",
|
|
24
|
+
"./convert": "./convert.js",
|
|
25
|
+
"./lib/*": "./lib/*",
|
|
40
26
|
"./package.json": "./package.json"
|
|
41
27
|
},
|
|
42
28
|
"sideEffects": false,
|
|
43
29
|
"files": [
|
|
44
|
-
"esm",
|
|
45
30
|
"lib",
|
|
46
31
|
"src",
|
|
47
32
|
"convert.d.ts",
|
|
@@ -56,17 +41,16 @@
|
|
|
56
41
|
},
|
|
57
42
|
"scripts": {
|
|
58
43
|
"cleanup": "rimraf esm lib convert.d.ts convert.js",
|
|
59
|
-
"build": "yarn build:
|
|
44
|
+
"build": "yarn build:esnext && yarn build:convert",
|
|
60
45
|
"build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
|
|
61
|
-
"build:
|
|
62
|
-
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
|
|
46
|
+
"build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
|
|
63
47
|
"typedoc": "typedoc --json ../../../docs/types/piral-ember.json src --exclude \"src/**/*.test.*\"",
|
|
64
48
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
65
49
|
},
|
|
66
50
|
"devDependencies": {
|
|
67
51
|
"@types/ember": "^3.1.1",
|
|
68
52
|
"ember-source": "^3.15.0",
|
|
69
|
-
"piral-core": "1.6.0-beta.
|
|
53
|
+
"piral-core": "1.6.0-beta.7243"
|
|
70
54
|
},
|
|
71
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
|
|
72
56
|
}
|
package/esm/converter.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ForeignComponent, BaseComponentProps } from 'piral-core';
|
|
2
|
-
import type { EmberModule } from './types';
|
|
3
|
-
export interface EmberConverterOptions {
|
|
4
|
-
/**
|
|
5
|
-
* Defines the name of the extension component.
|
|
6
|
-
* @default ember-extension
|
|
7
|
-
*/
|
|
8
|
-
selector?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function createConverter(config?: EmberConverterOptions): {
|
|
11
|
-
<TProps extends BaseComponentProps>(App: EmberModule<TProps>, opts: any): ForeignComponent<TProps>;
|
|
12
|
-
Extension: string;
|
|
13
|
-
};
|
package/esm/converter.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createExtension } from './extension';
|
|
2
|
-
export function createConverter(config = {}) {
|
|
3
|
-
const { selector = 'ember-extension' } = config;
|
|
4
|
-
const Extension = createExtension(selector);
|
|
5
|
-
const convert = (App, opts) => ({
|
|
6
|
-
mount(rootElement, props, ctx, locals) {
|
|
7
|
-
locals.app = App.create({
|
|
8
|
-
...opts,
|
|
9
|
-
rootElement,
|
|
10
|
-
props,
|
|
11
|
-
ctx,
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
update(rootElement, props, ctx, locals) {
|
|
15
|
-
locals.app.setProperties({
|
|
16
|
-
props,
|
|
17
|
-
ctx,
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
unmount(rootElement, locals) {
|
|
21
|
-
locals.app.destroy();
|
|
22
|
-
locals.app = undefined;
|
|
23
|
-
rootElement.innerHTML = '';
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
convert.Extension = Extension;
|
|
27
|
-
return convert;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=converter.js.map
|
package/esm/converter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAe9C,MAAM,UAAU,eAAe,CAAC,SAAgC,EAAE;IAChE,MAAM,EAAE,QAAQ,GAAG,iBAAiB,EAAE,GAAG,MAAM,CAAC;IAEhD,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,CACd,GAAwB,EACxB,IAAS,EACiB,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YACvD,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;gBACtB,GAAG,IAAI;gBACP,WAAW;gBACX,KAAK;gBACL,GAAG;aACJ,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YACxD,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;gBACvB,KAAK;gBACL,GAAG;aACJ,CAAC,CAAC;QACL,CAAC;QACD,OAAO,CAAC,WAAW,EAAE,MAA0B;YAC7C,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC;YACvB,WAAW,CAAC,SAAS,GAAG,EAAE,CAAC;QAC7B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/esm/create.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PiralPlugin } from 'piral-core';
|
|
2
|
-
import { EmberConverterOptions } from './converter';
|
|
3
|
-
import type { PiletEmberApi } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Available configuration options for the Ember.js plugin.
|
|
6
|
-
*/
|
|
7
|
-
export interface EmberConfig extends EmberConverterOptions {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Creates Pilet API extensions for integrating Ember.js.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createEmberApi(config?: EmberConfig): PiralPlugin<PiletEmberApi>;
|
package/esm/create.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { loadEmberApp } from './load';
|
|
2
|
-
import { createConverter } from './converter';
|
|
3
|
-
/**
|
|
4
|
-
* Creates Pilet API extensions for integrating Ember.js.
|
|
5
|
-
*/
|
|
6
|
-
export function createEmberApi(config = {}) {
|
|
7
|
-
return (context) => {
|
|
8
|
-
const convert = createConverter(config);
|
|
9
|
-
context.converters.ember = ({ App, opts }) => convert(App, opts);
|
|
10
|
-
return {
|
|
11
|
-
fromEmber(App, opts) {
|
|
12
|
-
return {
|
|
13
|
-
type: 'ember',
|
|
14
|
-
App,
|
|
15
|
-
opts,
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
loadEmberApp,
|
|
19
|
-
EmberExtension: convert.Extension,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=create.js.map
|
package/esm/create.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAyB,MAAM,aAAa,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAsB,EAAE;IACrD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEjE,OAAO;YACL,SAAS,CAAC,GAAG,EAAE,IAAI;gBACjB,OAAO;oBACL,IAAI,EAAE,OAAO;oBACb,GAAG;oBACH,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,YAAY;YACZ,cAAc,EAAE,OAAO,CAAC,SAAS;SAClC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/esm/extension.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createExtension(selector: string): string;
|
package/esm/extension.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function createExtension(selector) {
|
|
2
|
-
const defaultExtensionSelector = 'piral-extension';
|
|
3
|
-
if ('customElements' in window && selector && selector !== defaultExtensionSelector) {
|
|
4
|
-
const ExtensionBase = customElements.get(defaultExtensionSelector);
|
|
5
|
-
class AliasExtension extends ExtensionBase {
|
|
6
|
-
}
|
|
7
|
-
customElements.define(selector, AliasExtension);
|
|
8
|
-
}
|
|
9
|
-
return selector || defaultExtensionSelector;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=extension.js.map
|
package/esm/extension.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IAEnD,IAAI,gBAAgB,IAAI,MAAM,IAAI,QAAQ,IAAI,QAAQ,KAAK,wBAAwB,EAAE;QACnF,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnE,MAAM,cAAe,SAAQ,aAAa;SAAG;QAC7C,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KACjD;IAED,OAAO,QAAQ,IAAI,wBAAwB,CAAC;AAC9C,CAAC"}
|
package/esm/index.d.ts
DELETED
package/esm/index.js
DELETED
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/esm/load.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadEmberApp(appName: string, appUrl: string, vendorUrl?: string): Promise<any>;
|
package/esm/load.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export function loadEmberApp(appName, appUrl, vendorUrl) {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
if (vendorUrl) {
|
|
4
|
-
const scriptVendor = document.createElement('script');
|
|
5
|
-
scriptVendor.src = vendorUrl;
|
|
6
|
-
scriptVendor.async = true;
|
|
7
|
-
scriptVendor.onload = loadApp;
|
|
8
|
-
scriptVendor.onerror = reject;
|
|
9
|
-
document.head.appendChild(scriptVendor);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
loadApp();
|
|
13
|
-
}
|
|
14
|
-
function loadApp() {
|
|
15
|
-
const scriptEl = document.createElement('script');
|
|
16
|
-
scriptEl.src = appUrl;
|
|
17
|
-
scriptEl.async = true;
|
|
18
|
-
scriptEl.onload = () => {
|
|
19
|
-
resolve(window.require(appName + '/app'));
|
|
20
|
-
};
|
|
21
|
-
scriptEl.onerror = reject;
|
|
22
|
-
document.head.appendChild(scriptEl);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=load.js.map
|
package/esm/load.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,MAAc,EAAE,SAAkB;IAC9E,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,IAAI,SAAS,EAAE;YACb,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACtD,YAAY,CAAC,GAAG,GAAG,SAAS,CAAC;YAC7B,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;YAC1B,YAAY,CAAC,MAAM,GAAG,OAAO,CAAC;YAC9B,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;SACzC;aAAM;YACL,OAAO,EAAE,CAAC;SACX;QAED,SAAS,OAAO;YACd,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAClD,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC;YACtB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;YACtB,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE;gBACrB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;YAC5C,CAAC,CAAC;YACF,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/esm/types.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { ForeignComponent } from 'piral-core';
|
|
2
|
-
declare module 'piral-core/lib/types/custom' {
|
|
3
|
-
interface PiletCustomApi extends PiletEmberApi {
|
|
4
|
-
}
|
|
5
|
-
interface PiralCustomComponentConverters<TProps> {
|
|
6
|
-
ember(component: PiralEmberComponent<TProps>): ForeignComponent<TProps>;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export interface EmberOptions<TProps> {
|
|
10
|
-
props: TProps;
|
|
11
|
-
ctx: any;
|
|
12
|
-
}
|
|
13
|
-
export interface EmberInstance<TProps> {
|
|
14
|
-
setProperties(opts: EmberOptions<TProps>): void;
|
|
15
|
-
destroy(): void;
|
|
16
|
-
}
|
|
17
|
-
export interface EmberModule<TProps> {
|
|
18
|
-
create(opts: EmberOptions<TProps>): EmberInstance<TProps>;
|
|
19
|
-
}
|
|
20
|
-
export interface PiralEmberComponent<TProps> {
|
|
21
|
-
/**
|
|
22
|
-
* The Ember.js component App.
|
|
23
|
-
*/
|
|
24
|
-
App: EmberModule<TProps>;
|
|
25
|
-
/**
|
|
26
|
-
* The Ember.js component options.
|
|
27
|
-
*/
|
|
28
|
-
opts: any;
|
|
29
|
-
/**
|
|
30
|
-
* The type of the Ember.js component.
|
|
31
|
-
*/
|
|
32
|
-
type: 'ember';
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Defines the provided set of Pilet API extensions from the Ember.js plugin.
|
|
36
|
-
*/
|
|
37
|
-
export interface PiletEmberApi {
|
|
38
|
-
/**
|
|
39
|
-
* Loads an ember application via it's URLs.
|
|
40
|
-
* @param appName The name of the ember application.
|
|
41
|
-
* @param appUrl The URL of the main ember application.
|
|
42
|
-
* @param vendorUrl The optional URL of the (shared) ember vendor bundle.
|
|
43
|
-
* @returns The promise resolving to the loaded ember application.
|
|
44
|
-
*/
|
|
45
|
-
loadEmberApp<T = any>(appName: string, appUrl: string, vendorUrl?: string): Promise<T>;
|
|
46
|
-
/**
|
|
47
|
-
* Wraps an Emberjs component for use in Piral.
|
|
48
|
-
* @param App The component root.
|
|
49
|
-
* @param opts The component options.
|
|
50
|
-
* @returns The Piral Ember.js component.
|
|
51
|
-
*/
|
|
52
|
-
fromEmber<TProps>(App: EmberModule<TProps>, opts: any): PiralEmberComponent<TProps>;
|
|
53
|
-
/**
|
|
54
|
-
* Gets the name of the Ember.js extension.
|
|
55
|
-
*/
|
|
56
|
-
EmberExtension: string;
|
|
57
|
-
}
|
package/esm/types.js
DELETED
package/esm/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|