piral-blazor 1.0.0-pre.2296 → 1.0.1-beta.5640
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/LICENSE +1 -1
- package/README.md +51 -9
- package/convert.d.ts +13 -8
- package/convert.js +17 -12
- package/esm/converter.d.ts +10 -4
- package/esm/converter.js +164 -50
- package/esm/converter.js.map +1 -1
- package/esm/create.d.ts +21 -1
- package/esm/create.js +29 -15
- package/esm/create.js.map +1 -1
- package/esm/dependencies.d.ts +6 -3
- package/esm/dependencies.js +104 -14
- package/esm/dependencies.js.map +1 -1
- package/esm/events.d.ts +6 -0
- package/esm/events.js +145 -0
- package/esm/events.js.map +1 -0
- package/esm/interop.d.ts +29 -12
- package/esm/interop.js +181 -119
- package/esm/interop.js.map +1 -1
- package/esm/navigation.d.ts +2 -0
- package/esm/navigation.js +30 -0
- package/esm/navigation.js.map +1 -0
- package/esm/types.d.ts +97 -4
- package/infra.codegen +32 -23
- package/lib/converter.d.ts +10 -4
- package/lib/converter.js +164 -50
- package/lib/converter.js.map +1 -1
- package/lib/create.d.ts +21 -1
- package/lib/create.js +31 -17
- package/lib/create.js.map +1 -1
- package/lib/dependencies.d.ts +6 -3
- package/lib/dependencies.js +104 -14
- package/lib/dependencies.js.map +1 -1
- package/lib/events.d.ts +6 -0
- package/lib/events.js +154 -0
- package/lib/events.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/interop.d.ts +29 -12
- package/lib/interop.js +196 -124
- package/lib/interop.js.map +1 -1
- package/lib/navigation.d.ts +2 -0
- package/lib/navigation.js +35 -0
- package/lib/navigation.js.map +1 -0
- package/lib/types.d.ts +97 -4
- package/package.json +25 -9
- package/src/converter.ts +233 -63
- package/src/create.ts +53 -9
- package/src/dependencies.ts +122 -14
- package/src/events.ts +174 -0
- package/src/interop.ts +228 -117
- package/src/navigation.ts +36 -0
- package/src/types.ts +115 -4
- package/convert.ts +0 -17
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[](https://piral.io)
|
|
2
2
|
|
|
3
|
-
# [Piral Blazor](https://piral.io) · [](https://github.com/smapiot/piral/blob/
|
|
3
|
+
# [Piral Blazor](https://piral.io) · [](https://github.com/smapiot/piral/blob/main/LICENSE) [](https://www.npmjs.com/package/piral-blazor) [](https://jestjs.io) [](https://gitter.im/piral-io/community)
|
|
4
4
|
|
|
5
|
-
This is a plugin that has a peer dependency to `
|
|
5
|
+
This is a plugin that has a peer dependency to `blazor`. What `piral-blazor` 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 a Blazor (WASM) loader and converter for any component registration, as well as a `fromBlazor` shortcut together with some Blazor component coming in the `Piral.Blazor.Utils` NuGet package.
|
|
8
8
|
|
|
@@ -67,8 +67,8 @@ Blazor with Piral works from two sides. We have the app shell's side and the sid
|
|
|
67
67
|
The diagram has the following pieces:
|
|
68
68
|
|
|
69
69
|
1. Your app shell using `piral`, which needs to reference the `piral-blazor` plugin. Effectively, this will use the `blazor` package at build-time to include the Blazor libraries. Additionally, it uses `Piral.Blazor.Core` to be able to reference the defined Blazor components.
|
|
70
|
-
2. The TypeScript file in your Blazor pilets. That file will export the `setup` function to define which Blazor components to register
|
|
71
|
-
3. The Blazor code in your Blazor pilets using the shared library `Piral.Blazor.Utils` for some convenience functions. This code will define all the Blazor components that can be registered
|
|
70
|
+
2. The TypeScript file in your Blazor pilets. That file will export the `setup` function to define which Blazor components to register/use in your app shell.
|
|
71
|
+
3. The Blazor code in your Blazor pilets using the shared library `Piral.Blazor.Utils` for some convenience functions. This code will define all the Blazor components that can be registered/used in the pilet.
|
|
72
72
|
|
|
73
73
|
Naturally, you can add other dependencies to your Blazor pilet, too. These can be other npm packages for extending the JS part. Usually, however, you will add more NuGet packages to enhance your Blazor code.
|
|
74
74
|
|
|
@@ -82,7 +82,7 @@ The following functions are brought to the Pilet API.
|
|
|
82
82
|
|
|
83
83
|
Adds the URLs to additional DLLs that need to be referenced for obtaining the Blazor components. At best this uses `require.resolve` to get the URL from the bundler.
|
|
84
84
|
|
|
85
|
-
When you use the `blazorpilet` template you don't need to fill
|
|
85
|
+
When you use the `blazorpilet` template you don't need to fill/use this. It is automatically used and filled with generated code. Only touch this one if you know what you are doing.
|
|
86
86
|
|
|
87
87
|
### `fromBlazor()`
|
|
88
88
|
|
|
@@ -120,7 +120,7 @@ Alternatively, if `piral-blazor` has not been added to the Piral instance you ca
|
|
|
120
120
|
|
|
121
121
|
```ts
|
|
122
122
|
import { PiletApi } from '<name-of-piral-instance>';
|
|
123
|
-
import { defineBlazorReferences, fromBlazor } from 'piral-blazor';
|
|
123
|
+
import { defineBlazorReferences, fromBlazor } from 'piral-blazor/convert';
|
|
124
124
|
|
|
125
125
|
export function setup(piral: PiletApi) {
|
|
126
126
|
defineBlazorReferences([
|
|
@@ -133,7 +133,7 @@ export function setup(piral: PiletApi) {
|
|
|
133
133
|
|
|
134
134
|
In this case, you'll also have to install the `blazor` package. `piral-blazor` will use this under the hood to access the Blazor libraries.
|
|
135
135
|
|
|
136
|
-
To maximize compatibility, the major and minor version of the `blazor` package should correspond to the major and minor version of .NET Blazor you want to use (e.g
|
|
136
|
+
To maximize compatibility, the major and minor version of the `blazor` package should correspond to the major and minor version of .NET Blazor you want to use (e.g., `blazor@3.2.x` will resolve to the .NET Blazor `3.2` release train). It should be noted that the patch level is not aligned. If a specific patch level is desired, consult the `blazor` package documentation.
|
|
137
137
|
|
|
138
138
|
:::
|
|
139
139
|
|
|
@@ -156,10 +156,52 @@ const instance = createInstance({
|
|
|
156
156
|
```
|
|
157
157
|
`piral-blazor` will use `blazor` under the hood to access the Blazor libraries.
|
|
158
158
|
|
|
159
|
-
To maximize compatibility, the major and minor version of the `blazor` package should correspond to the major and minor version of .NET Blazor you want to use (e.g
|
|
159
|
+
To maximize compatibility, the major and minor version of the `blazor` package should correspond to the major and minor version of .NET Blazor you want to use (e.g., `blazor@3.2.x` will resolve to the .NET Blazor `3.2` release train). It should be noted that the patch level is not aligned. If a specific patch level is desired, consult the `blazor` package documentation.
|
|
160
|
+
|
|
161
|
+
For setting up localization you can supply options such as `initialLanguage` and `onLanguageChange` to the `createBlazorApi` call. While the former is used to set the initial language, the latter can be used to change the language later on. By default, `onLanguageChange` will be configured to listen to the `select-language` event emitted from Piral. This event is emitted (among others) by `piral-translate`, i.e., if you use this plugin it will just work.
|
|
162
|
+
|
|
163
|
+
Otherwise, you can either emit the event yourself (transporting an object with `currentLanguage` set to the desired language), or use `onLanguageChange` to wire it to whatever event source / emitter you'd like.
|
|
164
|
+
|
|
165
|
+
Ultimately, you can also call the `SetLanguage` in Piral.Blazor.Core from JavaScript like this:
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
window.DotNet.invokeMethodAsync('Piral.Blazor.Core', 'SetLanguage', language);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Furthermore, it is possible to configure the (initial) log level via the `logLevel` option:
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
const instance = createInstance({
|
|
175
|
+
// important part
|
|
176
|
+
plugins: [createBlazorApi({
|
|
177
|
+
logLevel: 1, // everything except trace
|
|
178
|
+
})],
|
|
179
|
+
// ...
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The levels range from 0 (incl. trace) to 6 (nothing will be logged).
|
|
160
184
|
|
|
161
185
|
:::
|
|
162
186
|
|
|
187
|
+
## Events
|
|
188
|
+
|
|
189
|
+
The `piral-blazor` integration emits some events at the global object (`window`):
|
|
190
|
+
|
|
191
|
+
- `loading-blazor-core` when the loading of (core) Blazor resources starts
|
|
192
|
+
- `loaded-blazor-core` when the loading of (core) Blazor resources ends
|
|
193
|
+
- `loading-blazor-pilet` when the loading of a Blazor pilet / its resources starts (`detail` contains the pilet's metadata)
|
|
194
|
+
- `loaded-blazor-pilet` when the loading of a Blazor pilet / its resources ends (`detail` contains the pilet's metadata)
|
|
195
|
+
|
|
196
|
+
You can receive these events using, e.g.:
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
window.addEventListener('loaded-blazor-pilet', (ev) => {
|
|
200
|
+
// your code here - could use:
|
|
201
|
+
// ev.detail.name --> name of the pilet
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
163
205
|
## License
|
|
164
206
|
|
|
165
207
|
Piral is released using the MIT license. For more information see the [license file](./LICENSE).
|
package/convert.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { BlazorOptions } from './esm/types';
|
|
2
|
+
export interface HtmlComponent<TProps> {
|
|
3
|
+
component: {
|
|
4
|
+
mount(element: HTMLElement, props: TProps, ctx: any, locals: any): void;
|
|
5
|
+
update?(element: HTMLElement, props: TProps, ctx: any, locals: any): void;
|
|
6
|
+
unmount?(element: HTMLElement, locals: any): void;
|
|
7
|
+
};
|
|
8
|
+
type: 'html';
|
|
9
|
+
}
|
|
6
10
|
export interface BlazorConverter {
|
|
7
|
-
(
|
|
11
|
+
(moduleName: string, args?: Record<string, any>): HtmlComponent<any>;
|
|
8
12
|
}
|
|
13
|
+
export declare function defineBlazorOptions(options: BlazorOptions): void;
|
|
9
14
|
export declare const fromBlazor: BlazorConverter;
|
|
10
|
-
export declare const defineBlazorReferences: (references:
|
|
11
|
-
export
|
|
15
|
+
export declare const defineBlazorReferences: (references: string[], meta?: PiletMetadata, satellites?: {}, prio?: number) => void;
|
|
16
|
+
export declare const releaseBlazorReferences: () => Promise<void>;
|
package/convert.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { createConverter } from './esm/converter';
|
|
2
|
+
import { createDependencyLoader } from './esm/dependencies';
|
|
3
|
+
var convert = createConverter(true);
|
|
4
|
+
var loader = createDependencyLoader(convert);
|
|
5
|
+
var blazorOptions = undefined;
|
|
6
|
+
export function defineBlazorOptions(options) {
|
|
7
|
+
blazorOptions = options;
|
|
8
|
+
}
|
|
9
|
+
export var fromBlazor = function (moduleName, args) {
|
|
10
|
+
if (args === void 0) { args = {}; }
|
|
11
|
+
return ({
|
|
12
|
+
type: 'html',
|
|
13
|
+
component: convert(moduleName, loader.getDependency(), args, blazorOptions),
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export var defineBlazorReferences = loader.defineBlazorReferences;
|
|
17
|
+
export var releaseBlazorReferences = loader.releaseBlazorReferences;
|
package/esm/converter.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { BaseComponentProps, ForeignComponent } from 'piral-core';
|
|
2
|
+
import { BlazorDependencyLoader, BlazorLogLevel, BlazorOptions, BlazorRootConfig, WebAssemblyStartOptions } from './types';
|
|
3
|
+
export interface LanguageOptions {
|
|
4
|
+
current: string | undefined;
|
|
5
|
+
onChange(inform: (language: string) => void): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createConverter(lazy: boolean, opts?: WebAssemblyStartOptions, language?: LanguageOptions, logLevel?: BlazorLogLevel): {
|
|
8
|
+
<TProps extends BaseComponentProps>(moduleName: string, dependency: BlazorDependencyLoader, args: Record<string, any>, options?: BlazorOptions): ForeignComponent<TProps>;
|
|
9
|
+
loader: Promise<BlazorRootConfig>;
|
|
10
|
+
lazy: boolean;
|
|
5
11
|
};
|
package/esm/converter.js
CHANGED
|
@@ -1,57 +1,171 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { addGlobalEventListeners, attachEvents, removeGlobalEventListeners } from './events';
|
|
3
|
+
import { activate, deactivate, createBootLoader, reactivate, callNotifyLocationChanged, setLanguage, createElement, destroyElement, updateElement, setLogLevel, processEvent, } from './interop';
|
|
4
|
+
import bootConfig from '../infra.codegen';
|
|
5
|
+
const noop = () => { };
|
|
6
|
+
const mediaRules = [
|
|
7
|
+
{ attribute: 'src', selector: 'img, embed, video > source, video > track, audio > source' },
|
|
8
|
+
{ attribute: 'srcset', selector: 'picture > source' },
|
|
9
|
+
];
|
|
10
|
+
function prefixMediaSources(component, prefix) {
|
|
11
|
+
const prefixAttributeValue = (el, attr) => el.setAttribute(attr, prefix + el.getAttribute(attr));
|
|
12
|
+
for (const { attribute, selector } of mediaRules) {
|
|
13
|
+
Array.from(component.querySelectorAll(selector))
|
|
14
|
+
.filter((el) => el.hasAttribute(attribute) && !el.getAttribute(attribute).match(/^https?:/))
|
|
15
|
+
.forEach((el) => prefixAttributeValue(el, attribute));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function project(component, destination, options) {
|
|
19
|
+
if ((options === null || options === void 0 ? void 0 : options.resourcePathRoot) && !bootConfig.noMutation) {
|
|
20
|
+
prefixMediaSources(component, options.resourcePathRoot);
|
|
21
|
+
}
|
|
22
|
+
destination.appendChild(component);
|
|
23
|
+
}
|
|
24
|
+
function makeUrl(href) {
|
|
25
|
+
const origin = document.location.origin;
|
|
26
|
+
if (!href.startsWith(origin)) {
|
|
27
|
+
return `${origin}${href}`;
|
|
28
|
+
}
|
|
29
|
+
return href;
|
|
30
|
+
}
|
|
31
|
+
export function createConverter(lazy, opts, language, logLevel) {
|
|
32
|
+
const bootLoader = createBootLoader(bootConfig.url, bootConfig.satellites);
|
|
33
|
+
const boot = (opts) => bootLoader(opts).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const [_, capabilities] = res;
|
|
35
|
+
if (capabilities.includes('logging')) {
|
|
36
|
+
if (typeof logLevel === 'number') {
|
|
37
|
+
yield setLogLevel(logLevel);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (language && capabilities.includes('language')) {
|
|
41
|
+
if (typeof language.current === 'string') {
|
|
42
|
+
yield setLanguage(language.current);
|
|
43
|
+
}
|
|
44
|
+
if (capabilities.includes('events')) {
|
|
45
|
+
const eventDispatcher = document.body.dispatchEvent;
|
|
46
|
+
// listen to all events for forwarding them
|
|
47
|
+
document.body.dispatchEvent = function (ev) {
|
|
48
|
+
if (ev.type.startsWith('piral-')) {
|
|
49
|
+
const type = ev.type.replace('piral-', '');
|
|
50
|
+
const args = ev.detail.arg;
|
|
51
|
+
processEvent(type, args);
|
|
52
|
+
}
|
|
53
|
+
return eventDispatcher.call(this, ev);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (typeof language.onChange === 'function') {
|
|
57
|
+
language.onChange(setLanguage);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
window.dispatchEvent(new CustomEvent('loaded-blazor-core'));
|
|
61
|
+
return res;
|
|
62
|
+
}));
|
|
63
|
+
let loader = !lazy && boot(opts);
|
|
64
|
+
let listener = undefined;
|
|
65
|
+
const enqueueChange = (locals, update) => {
|
|
66
|
+
if (typeof update !== 'function') {
|
|
67
|
+
// nothing to do in this case
|
|
68
|
+
}
|
|
69
|
+
else if (locals.state === 'mounted') {
|
|
70
|
+
loader.then(update);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
locals.next = update;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const convert = (moduleName, dependency, args, options) => ({
|
|
77
|
+
mount(el, data, ctx, locals) {
|
|
78
|
+
const props = Object.assign(Object.assign({}, args), data);
|
|
79
|
+
const { piral } = data;
|
|
80
|
+
const nav = ctx.navigation;
|
|
81
|
+
el.setAttribute('data-blazor-pilet-root', 'true');
|
|
82
|
+
addGlobalEventListeners(el);
|
|
83
|
+
if (listener === undefined) {
|
|
84
|
+
listener = nav.listen(({ location, action }) => {
|
|
85
|
+
// POP is already handled by .NET
|
|
86
|
+
if (action !== 'POP') {
|
|
87
|
+
const url = makeUrl(location.href);
|
|
88
|
+
callNotifyLocationChanged(url, action === 'REPLACE', location.state);
|
|
31
89
|
}
|
|
32
|
-
})
|
|
33
|
-
.catch(function (err) { return console.error(err); });
|
|
34
|
-
dispose = attachEvents(el, function (ev) { return data.piral.renderHtmlExtension(ev.detail.target, ev.detail.props); }, function (ev) {
|
|
35
|
-
return ev.detail.replace
|
|
36
|
-
? ctx.router.history.replace(ev.detail.to, ev.detail.store)
|
|
37
|
-
: ctx.router.history.push(ev.detail.to, ev.detail.state);
|
|
38
90
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
91
|
+
}
|
|
92
|
+
locals.state = 'fresh';
|
|
93
|
+
locals.next = noop;
|
|
94
|
+
locals.dispose = attachEvents(el, (ev) => {
|
|
95
|
+
ev.stopPropagation();
|
|
96
|
+
const { target, props } = ev.detail;
|
|
97
|
+
piral.renderHtmlExtension(target, props);
|
|
98
|
+
}, (ev) => {
|
|
99
|
+
ev.stopPropagation();
|
|
100
|
+
const { to, state, replace } = ev.detail;
|
|
101
|
+
replace ? nav.replace(to, state) : nav.push(to, state);
|
|
102
|
+
}, (ev) => {
|
|
103
|
+
ev.stopPropagation();
|
|
104
|
+
const { type, args } = ev.detail;
|
|
105
|
+
piral.emit(type, args);
|
|
106
|
+
});
|
|
107
|
+
function mountClassic(config) {
|
|
108
|
+
return activate(moduleName, props).then((refId) => {
|
|
109
|
+
const [root] = config;
|
|
110
|
+
const node = root.querySelector(`#${refId} > div`);
|
|
111
|
+
locals.unmount = () => {
|
|
112
|
+
var _a;
|
|
113
|
+
(_a = root.querySelector(`#${refId}`)) === null || _a === void 0 ? void 0 : _a.appendChild(node);
|
|
114
|
+
deactivate(moduleName, refId);
|
|
115
|
+
el.innerHTML = '';
|
|
116
|
+
};
|
|
117
|
+
locals.update = (props) => {
|
|
118
|
+
reactivate(moduleName, refId, props);
|
|
119
|
+
};
|
|
120
|
+
project(node, el, options);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function mountModern(_) {
|
|
124
|
+
return createElement(moduleName, props).then((refId) => {
|
|
125
|
+
const child = document.createElement('piral-blazor-component');
|
|
126
|
+
child.setAttribute('rid', refId);
|
|
127
|
+
el.appendChild(child);
|
|
128
|
+
locals.unmount = () => {
|
|
129
|
+
destroyElement(refId);
|
|
130
|
+
child.remove();
|
|
131
|
+
el.innerHTML = '';
|
|
132
|
+
};
|
|
133
|
+
locals.update = (props) => {
|
|
134
|
+
updateElement(refId, props);
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
(loader || (convert.loader = loader = boot(opts)))
|
|
139
|
+
.then((config) => dependency(config).then(() => {
|
|
140
|
+
if (locals.state === 'fresh') {
|
|
141
|
+
const [_, capabilities, applyChanges] = config;
|
|
142
|
+
const fn = capabilities.includes('custom-element') ? mountModern : mountClassic;
|
|
143
|
+
applyChanges(piral);
|
|
144
|
+
return fn(config).then(() => {
|
|
145
|
+
locals.state = 'mounted';
|
|
146
|
+
locals.next(config);
|
|
147
|
+
locals.next = noop;
|
|
148
|
+
});
|
|
48
149
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
150
|
+
}))
|
|
151
|
+
.catch((err) => console.error(err));
|
|
152
|
+
},
|
|
153
|
+
update(el, data, ctx, locals) {
|
|
154
|
+
enqueueChange(locals, () => {
|
|
155
|
+
var _a;
|
|
156
|
+
(_a = locals.update) === null || _a === void 0 ? void 0 : _a.call(locals, Object.assign(Object.assign({}, args), data));
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
unmount(el, locals) {
|
|
160
|
+
removeGlobalEventListeners(el);
|
|
161
|
+
el.removeAttribute('data-blazor-pilet-root');
|
|
162
|
+
locals.dispose();
|
|
163
|
+
enqueueChange(locals, locals.unmount);
|
|
164
|
+
locals.state = 'removed';
|
|
165
|
+
},
|
|
166
|
+
});
|
|
54
167
|
convert.loader = loader;
|
|
168
|
+
convert.lazy = lazy;
|
|
55
169
|
return convert;
|
|
56
170
|
}
|
|
57
171
|
//# sourceMappingURL=converter.js.map
|
package/esm/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EACL,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,yBAAyB,EACzB,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,WAAW,CAAC;AAQnB,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEtB,MAAM,UAAU,GAAG;IACjB,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,2DAA2D,EAAE;IAC3F,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE;CACtD,CAAC;AAEF,SAAS,kBAAkB,CAAC,SAAkB,EAAE,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CAAC,OAAO,CAAC,CAAC;YACtC,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;QAC3B,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/esm/create.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PiralPlugin } from 'piral-core';
|
|
2
|
-
import type { PiletBlazorApi } from './types';
|
|
2
|
+
import type { BlazorLogLevel, PiletBlazorApi, WebAssemblyStartOptions } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Available configuration options for the Blazor plugin.
|
|
5
5
|
*/
|
|
@@ -9,6 +9,26 @@ export interface BlazorConfig {
|
|
|
9
9
|
* @default true
|
|
10
10
|
*/
|
|
11
11
|
lazy?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Determines the used log level, if any. Otherwise, will use
|
|
14
|
+
* the default log level (info).
|
|
15
|
+
*/
|
|
16
|
+
logLevel?: BlazorLogLevel;
|
|
17
|
+
/**
|
|
18
|
+
* Determines the initial language to use, if any.
|
|
19
|
+
* Otherwise, falls back to Blazor's default language.
|
|
20
|
+
*/
|
|
21
|
+
initialLanguage?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Installs a function to handle language change. By default,
|
|
24
|
+
* this will hook on to the `select-language` event from Piral.
|
|
25
|
+
* @param inform The callback to use for passing in a new locale.
|
|
26
|
+
*/
|
|
27
|
+
onLanguageChange?: ((inform: (language: string) => void) => void) | false;
|
|
28
|
+
/**
|
|
29
|
+
* Determines the start options to use for booting Blazor.
|
|
30
|
+
*/
|
|
31
|
+
options?: WebAssemblyStartOptions;
|
|
12
32
|
}
|
|
13
33
|
/**
|
|
14
34
|
* Creates new Pilet API extensions for integration of Blazor.
|
package/esm/create.js
CHANGED
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
import { createConverter } from './converter';
|
|
2
2
|
import { createDependencyLoader } from './dependencies';
|
|
3
|
+
function createDefaultHandler(context) {
|
|
4
|
+
return (inform) => {
|
|
5
|
+
context.on('select-language', (ev) => {
|
|
6
|
+
inform(ev.currentLanguage);
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
}
|
|
3
10
|
/**
|
|
4
11
|
* Creates new Pilet API extensions for integration of Blazor.
|
|
5
12
|
*/
|
|
6
|
-
export function createBlazorApi(config) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export function createBlazorApi(config = {}) {
|
|
14
|
+
return (context) => {
|
|
15
|
+
const { lazy = true, initialLanguage, onLanguageChange = createDefaultHandler(context), logLevel } = config;
|
|
16
|
+
const convert = createConverter(lazy, config.options, {
|
|
17
|
+
current: initialLanguage,
|
|
18
|
+
onChange: onLanguageChange || (() => { }),
|
|
19
|
+
}, logLevel);
|
|
20
|
+
context.converters.blazor = ({ moduleName, args, dependency, options }) => convert(moduleName, dependency, args, options);
|
|
21
|
+
return (_, meta) => {
|
|
22
|
+
const loader = createDependencyLoader(convert);
|
|
23
|
+
let options;
|
|
17
24
|
return {
|
|
18
|
-
defineBlazorReferences
|
|
19
|
-
|
|
25
|
+
defineBlazorReferences(references, satellites, prio) {
|
|
26
|
+
return loader.defineBlazorReferences(references, meta, satellites, prio);
|
|
27
|
+
},
|
|
28
|
+
defineBlazorOptions(blazorOptions) {
|
|
29
|
+
options = blazorOptions;
|
|
30
|
+
},
|
|
31
|
+
releaseBlazorReferences: loader.releaseBlazorReferences,
|
|
32
|
+
fromBlazor(moduleName, args) {
|
|
20
33
|
return {
|
|
21
34
|
type: 'blazor',
|
|
22
35
|
dependency: loader.getDependency(),
|
|
23
|
-
moduleName
|
|
24
|
-
args
|
|
36
|
+
moduleName,
|
|
37
|
+
args,
|
|
38
|
+
options,
|
|
25
39
|
};
|
|
26
40
|
},
|
|
27
41
|
};
|
package/esm/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAkCxD,SAAS,oBAAoB,CAAC,OAAqB;IACjD,OAAO,CAAC,MAAkC,EAAE,EAAE;QAC5C,OAAO,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,EAAE,EAAE,EAAE;YACnC,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,SAAuB,EAAE;IACvD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,eAAe,EAAE,gBAAgB,GAAG,oBAAoB,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5G,MAAM,OAAO,GAAG,eAAe,CAC7B,IAAI,EACJ,MAAM,CAAC,OAAO,EACd;YACE,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,gBAAgB,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;SACzC,EACD,QAAQ,CACT,CAAC;QACF,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,CACxE,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEjD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;YACjB,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC/C,IAAI,OAAsB,CAAC;YAE3B,OAAO;gBACL,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI;oBACjD,OAAO,MAAM,CAAC,sBAAsB,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;gBAC3E,CAAC;gBACD,mBAAmB,CAAC,aAA4B;oBAC9C,OAAO,GAAG,aAAa,CAAC;gBAC1B,CAAC;gBACD,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;gBACvD,UAAU,CAAC,UAAU,EAAE,IAAI;oBACzB,OAAO;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE;wBAClC,UAAU;wBACV,IAAI;wBACJ,OAAO;qBACR,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/esm/dependencies.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { PiletMetadata } from 'piral-core';
|
|
1
2
|
import type { createConverter } from './converter';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { BlazorDependencyLoader } from './types';
|
|
4
|
+
export declare function createDependencyLoader(convert: ReturnType<typeof createConverter>): {
|
|
5
|
+
getDependency(): BlazorDependencyLoader;
|
|
6
|
+
defineBlazorReferences(references: Array<string>, meta?: Partial<PiletMetadata>, satellites?: {}, prio?: number): void;
|
|
7
|
+
releaseBlazorReferences(): Promise<void>;
|
|
5
8
|
};
|