@glomex/integration-web-component 1.1557.0 → 1.1561.0
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/index.d.ts +6 -6
- package/dist/index.js +8 -8
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from '@turbo-player/integration-web-component';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HostContext } from '@turbo-player/integration-web-component';
|
|
3
3
|
import { ComponentName as BaseComponentName } from '@turbo-player/integration-web-component';
|
|
4
4
|
export declare const ComponentName: {
|
|
5
5
|
readonly INTEGRATION: "glomex-integration";
|
|
@@ -30,7 +30,7 @@ export declare function loadIntegrationComponent(): void;
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function loadIntegrationStyles(integrationId: string, doc?: Document | ShadowRoot): void;
|
|
32
32
|
/**
|
|
33
|
-
* Returns the {@link
|
|
33
|
+
* Returns the {@link HostContext} singleton from the loaded integration.
|
|
34
34
|
*
|
|
35
35
|
* Waits for the integration custom element to be defined, then
|
|
36
36
|
* reads the singleton from its static property — guaranteeing the same
|
|
@@ -38,10 +38,10 @@ export declare function loadIntegrationStyles(integrationId: string, doc?: Docum
|
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```ts
|
|
41
|
-
* import {
|
|
41
|
+
* import { getHostContext } from '@glomex/integration-web-component';
|
|
42
42
|
*
|
|
43
|
-
* const
|
|
44
|
-
*
|
|
43
|
+
* const hostContext = await getHostContext();
|
|
44
|
+
* hostContext.set({
|
|
45
45
|
* appVersion: '2.3.0',
|
|
46
46
|
* providers: {
|
|
47
47
|
* 'my-provider': async () => ({ token: await myAuth.getFreshToken() }),
|
|
@@ -49,4 +49,4 @@ export declare function loadIntegrationStyles(integrationId: string, doc?: Docum
|
|
|
49
49
|
* });
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
|
-
export declare function
|
|
52
|
+
export declare function getHostContext(): Promise<HostContext>;
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ export function loadIntegrationStyles(integrationId, doc) {
|
|
|
43
43
|
glomexClient.loadStyles(integrationId, doc);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Returns the {@link
|
|
46
|
+
* Returns the {@link HostContext} singleton from the loaded integration.
|
|
47
47
|
*
|
|
48
48
|
* Waits for the integration custom element to be defined, then
|
|
49
49
|
* reads the singleton from its static property — guaranteeing the same
|
|
@@ -51,10 +51,10 @@ export function loadIntegrationStyles(integrationId, doc) {
|
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* ```ts
|
|
54
|
-
* import {
|
|
54
|
+
* import { getHostContext } from '@glomex/integration-web-component';
|
|
55
55
|
*
|
|
56
|
-
* const
|
|
57
|
-
*
|
|
56
|
+
* const hostContext = await getHostContext();
|
|
57
|
+
* hostContext.set({
|
|
58
58
|
* appVersion: '2.3.0',
|
|
59
59
|
* providers: {
|
|
60
60
|
* 'my-provider': async () => ({ token: await myAuth.getFreshToken() }),
|
|
@@ -62,12 +62,12 @@ export function loadIntegrationStyles(integrationId, doc) {
|
|
|
62
62
|
* });
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
export async function
|
|
65
|
+
export async function getHostContext() {
|
|
66
66
|
const componentName = glomexClient.getComponentName();
|
|
67
67
|
await customElements.whenDefined(componentName);
|
|
68
68
|
const ctor = customElements.get(componentName);
|
|
69
|
-
if (!ctor?.
|
|
70
|
-
throw new Error(`
|
|
69
|
+
if (!ctor?.hostContext) {
|
|
70
|
+
throw new Error(`hostContext not available on ${componentName} element`);
|
|
71
71
|
}
|
|
72
|
-
return ctor.
|
|
72
|
+
return ctor.hostContext;
|
|
73
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glomex/integration-web-component",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1561.0",
|
|
4
4
|
"description": "Web component and types to integrate the glomex player",
|
|
5
5
|
"documentation": "https://docs.glomex.com",
|
|
6
6
|
"homepage": "https://glomex.com",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"watch": "tsc --build --watch"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@turbo-player/integration-web-component": "1.
|
|
32
|
+
"@turbo-player/integration-web-component": "1.1561.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@biomejs/biome": "catalog:",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "572ef823c2654993610ecaeea7806a8a812e300b"
|
|
43
43
|
}
|