@open-pioneer/runtime 4.0.0-dev.20250512105016 → 4.0.0-dev.20250527091545
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/CHANGELOG.md +44 -4
- package/CustomElement.d.ts +39 -7
- package/CustomElement.js +12 -329
- package/CustomElement.js.map +1 -1
- package/api.d.ts +28 -2
- package/app/AppInstance.d.ts +53 -0
- package/app/AppInstance.js +270 -0
- package/app/AppInstance.js.map +1 -0
- package/app/gatherConfig.d.ts +7 -0
- package/app/gatherConfig.js +49 -0
- package/app/gatherConfig.js.map +1 -0
- package/app/index.d.ts +1 -0
- package/app/logErrors.d.ts +1 -0
- package/app/logErrors.js +21 -0
- package/app/logErrors.js.map +1 -0
- package/builtin-services/ApplicationContextImpl.d.ts +5 -3
- package/builtin-services/ApplicationContextImpl.js +9 -4
- package/builtin-services/ApplicationContextImpl.js.map +1 -1
- package/dom/index.d.ts +19 -0
- package/dom/index.js +24 -0
- package/dom/index.js.map +1 -0
- package/index.d.ts +1 -1
- package/package.json +5 -5
- package/react-integration/ChakraProvider.d.ts +8 -1
- package/react-integration/ChakraProvider.js +39 -27
- package/react-integration/ChakraProvider.js.map +1 -1
- package/{ErrorScreen.d.ts → react-integration/ErrorScreen.d.ts} +1 -1
- package/react-integration/ErrorScreen.js.map +1 -0
- package/react-integration/ReactIntegration.d.ts +5 -1
- package/react-integration/ReactIntegration.js +7 -1
- package/react-integration/ReactIntegration.js.map +1 -1
- package/ErrorScreen.js.map +0 -1
- /package/{ErrorScreen.js → react-integration/ErrorScreen.js} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ApiMethods } from "../api";
|
|
2
|
+
import { CustomElementOptions } from "../CustomElement";
|
|
3
|
+
import { RootNode } from "../dom";
|
|
4
|
+
export interface AppOptions {
|
|
5
|
+
/** The root node that contains the application. */
|
|
6
|
+
rootNode: RootNode;
|
|
7
|
+
/** The HTML element that embeds the application. */
|
|
8
|
+
hostElement: HTMLElement;
|
|
9
|
+
/** Trails options for the application. */
|
|
10
|
+
elementOptions: CustomElementOptions;
|
|
11
|
+
/** These have higher priority than the options in `elementOptions`. */
|
|
12
|
+
overrides: AppOverrides | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A callback to restart the application with new options.
|
|
15
|
+
* Currently only used for reloading with a certain locale.
|
|
16
|
+
*/
|
|
17
|
+
restart: (overrides?: AppOverrides) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface AppOverrides {
|
|
20
|
+
locale?: string;
|
|
21
|
+
}
|
|
22
|
+
export type AppState = "not-started" | "starting" | "started" | "destroyed" | "error";
|
|
23
|
+
export declare class AppInstance {
|
|
24
|
+
private options;
|
|
25
|
+
private apiPromise;
|
|
26
|
+
private api;
|
|
27
|
+
private state;
|
|
28
|
+
private rootNode;
|
|
29
|
+
private container;
|
|
30
|
+
private appRoot;
|
|
31
|
+
private config;
|
|
32
|
+
private serviceLayer;
|
|
33
|
+
private lifecycleEvents;
|
|
34
|
+
private reactIntegration;
|
|
35
|
+
private stylesWatch;
|
|
36
|
+
constructor(options: AppOptions);
|
|
37
|
+
start(): void;
|
|
38
|
+
destroy(): void;
|
|
39
|
+
private reset;
|
|
40
|
+
whenAPI(): Promise<ApiMethods>;
|
|
41
|
+
private startImpl;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a signal that contains the application's styles.
|
|
44
|
+
* During development, the signal is updated when the user edits .css files.
|
|
45
|
+
* In production, the signal is static.
|
|
46
|
+
*/
|
|
47
|
+
private initStylesSignal;
|
|
48
|
+
private initServiceLayer;
|
|
49
|
+
private initAPI;
|
|
50
|
+
private triggerApplicationLifecycleEvent;
|
|
51
|
+
private checkAbort;
|
|
52
|
+
private showErrorScreen;
|
|
53
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { reactive } from '@conterra/reactivity-core';
|
|
2
|
+
import { createLogger, Error, createAbortError, destroyResource, createManualPromise, throwAbortError } from '@open-pioneer/core';
|
|
3
|
+
import { createElement } from 'react';
|
|
4
|
+
import { createBuiltinPackage, RUNTIME_API_SERVICE, RUNTIME_APPLICATION_LIFECYCLE_EVENT_SERVICE, RUNTIME_AUTO_START } from '../builtin-services/index.js';
|
|
5
|
+
import { isShadowRoot, createAppRoot } from '../dom/index.js';
|
|
6
|
+
import { ErrorId } from '../errors.js';
|
|
7
|
+
import { initI18n } from '../i18n/AppIntl.js';
|
|
8
|
+
import { createPackageIntl } from '../i18n/PackageIntl.js';
|
|
9
|
+
import { getBrowserLocales, I18nConfig } from '../i18n/pick.js';
|
|
10
|
+
import { MESSAGES_BY_LOCALE, ErrorScreen } from '../react-integration/ErrorScreen.js';
|
|
11
|
+
import { ReactIntegration, EmptyComponent } from '../react-integration/ReactIntegration.js';
|
|
12
|
+
import { createPackages } from '../service-layer/PackageRepr.js';
|
|
13
|
+
import { ServiceLayer } from '../service-layer/ServiceLayer.js';
|
|
14
|
+
import { gatherConfig } from './gatherConfig.js';
|
|
15
|
+
import { logError } from './logErrors.js';
|
|
16
|
+
|
|
17
|
+
const LOG = createLogger("runtime:AppInstance");
|
|
18
|
+
class AppInstance {
|
|
19
|
+
options;
|
|
20
|
+
// Public API
|
|
21
|
+
apiPromise;
|
|
22
|
+
// Present when callers are waiting for the API
|
|
23
|
+
api;
|
|
24
|
+
// Present once started
|
|
25
|
+
state = "not-started";
|
|
26
|
+
rootNode;
|
|
27
|
+
container;
|
|
28
|
+
// parent of .pioneer-root
|
|
29
|
+
appRoot;
|
|
30
|
+
// .pioneer-root
|
|
31
|
+
config;
|
|
32
|
+
serviceLayer;
|
|
33
|
+
lifecycleEvents;
|
|
34
|
+
reactIntegration;
|
|
35
|
+
stylesWatch;
|
|
36
|
+
constructor(options) {
|
|
37
|
+
this.options = options;
|
|
38
|
+
this.container = isShadowRoot(options.rootNode) ? options.rootNode : options.hostElement;
|
|
39
|
+
this.rootNode = options.rootNode;
|
|
40
|
+
}
|
|
41
|
+
start() {
|
|
42
|
+
if (this.state !== "not-started") {
|
|
43
|
+
throw new Error(ErrorId.INTERNAL, `Cannot start element in state '${this.state}'`);
|
|
44
|
+
}
|
|
45
|
+
this.state = "starting";
|
|
46
|
+
this.startImpl().catch((e) => {
|
|
47
|
+
if (this.state === "destroyed") return;
|
|
48
|
+
logError(e);
|
|
49
|
+
this.reset();
|
|
50
|
+
this.state = "error";
|
|
51
|
+
this.showErrorScreen(e);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
destroy() {
|
|
55
|
+
if (this.state === "destroyed") {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (this.state === "started") {
|
|
59
|
+
try {
|
|
60
|
+
this.triggerApplicationLifecycleEvent("before-stop");
|
|
61
|
+
} catch (e) {
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
this.state = "destroyed";
|
|
65
|
+
this.reset();
|
|
66
|
+
}
|
|
67
|
+
reset() {
|
|
68
|
+
this.apiPromise?.reject(createAbortError());
|
|
69
|
+
this.reactIntegration = destroyResource(this.reactIntegration);
|
|
70
|
+
this.container.replaceChildren();
|
|
71
|
+
this.appRoot = void 0;
|
|
72
|
+
this.lifecycleEvents = void 0;
|
|
73
|
+
this.serviceLayer = destroyResource(this.serviceLayer);
|
|
74
|
+
this.stylesWatch = destroyResource(this.stylesWatch);
|
|
75
|
+
}
|
|
76
|
+
whenAPI() {
|
|
77
|
+
if (this.api) {
|
|
78
|
+
return Promise.resolve(this.api);
|
|
79
|
+
}
|
|
80
|
+
const apiPromise = this.apiPromise ??= createManualPromise();
|
|
81
|
+
return apiPromise.promise;
|
|
82
|
+
}
|
|
83
|
+
async startImpl() {
|
|
84
|
+
const { hostElement, elementOptions, overrides } = this.options;
|
|
85
|
+
const root = this.rootNode;
|
|
86
|
+
const config = this.config = await gatherConfig(hostElement, elementOptions, overrides);
|
|
87
|
+
this.checkAbort();
|
|
88
|
+
LOG.debug("Application config is", config);
|
|
89
|
+
const i18n = await initI18n(elementOptions.appMetadata, config.locale);
|
|
90
|
+
this.checkAbort();
|
|
91
|
+
const appRoot = this.appRoot = createAppRoot(i18n.locale);
|
|
92
|
+
this.container.appendChild(appRoot);
|
|
93
|
+
const styles = this.initStylesSignal();
|
|
94
|
+
const { serviceLayer, packages } = this.initServiceLayer({
|
|
95
|
+
container: appRoot,
|
|
96
|
+
properties: config.properties,
|
|
97
|
+
i18n
|
|
98
|
+
});
|
|
99
|
+
this.lifecycleEvents = getInternalService(
|
|
100
|
+
serviceLayer,
|
|
101
|
+
RUNTIME_APPLICATION_LIFECYCLE_EVENT_SERVICE
|
|
102
|
+
);
|
|
103
|
+
await this.initAPI(serviceLayer);
|
|
104
|
+
this.checkAbort();
|
|
105
|
+
this.reactIntegration = ReactIntegration.createForApp({
|
|
106
|
+
rootNode: root,
|
|
107
|
+
hostNode: hostElement,
|
|
108
|
+
appRoot,
|
|
109
|
+
serviceLayer,
|
|
110
|
+
packages,
|
|
111
|
+
locale: i18n.locale,
|
|
112
|
+
config: elementOptions.chakraSystemConfig,
|
|
113
|
+
styles
|
|
114
|
+
});
|
|
115
|
+
const component = this.options.elementOptions.component ?? EmptyComponent;
|
|
116
|
+
this.reactIntegration.render(createElement(component));
|
|
117
|
+
this.state = "started";
|
|
118
|
+
this.triggerApplicationLifecycleEvent("after-start");
|
|
119
|
+
LOG.debug("Application started");
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Returns a signal that contains the application's styles.
|
|
123
|
+
* During development, the signal is updated when the user edits .css files.
|
|
124
|
+
* In production, the signal is static.
|
|
125
|
+
*/
|
|
126
|
+
initStylesSignal() {
|
|
127
|
+
const stylesBox = this.options.elementOptions.appMetadata?.styles;
|
|
128
|
+
if (!stylesBox) {
|
|
129
|
+
return reactive("");
|
|
130
|
+
}
|
|
131
|
+
const signal = reactive(stylesBox.value);
|
|
132
|
+
if (import.meta.hot) {
|
|
133
|
+
this.stylesWatch = stylesBox.on?.("changed", () => {
|
|
134
|
+
LOG.debug("Application styles changed");
|
|
135
|
+
signal.value = stylesBox.value;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return signal;
|
|
139
|
+
}
|
|
140
|
+
initServiceLayer(config) {
|
|
141
|
+
const { hostElement, rootNode: shadowRoot, elementOptions, restart } = this.options;
|
|
142
|
+
const { container, properties, i18n } = config;
|
|
143
|
+
const packageMetadata = elementOptions.appMetadata?.packages ?? {};
|
|
144
|
+
const builtinPackage = createBuiltinPackage({
|
|
145
|
+
host: hostElement,
|
|
146
|
+
rootNode: shadowRoot,
|
|
147
|
+
container,
|
|
148
|
+
locale: i18n.locale,
|
|
149
|
+
supportedLocales: i18n.supportedMessageLocales,
|
|
150
|
+
changeLocale(locale) {
|
|
151
|
+
const supported = i18n.supportedMessageLocales;
|
|
152
|
+
if (locale != null && !i18n.supportsLocale(locale)) {
|
|
153
|
+
throw new Error(
|
|
154
|
+
ErrorId.UNSUPPORTED_LOCALE,
|
|
155
|
+
`Unsupported locale '${locale}' (supported locales: ${supported.join(
|
|
156
|
+
", "
|
|
157
|
+
)}).`
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
restart({ locale });
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const { serviceLayer, packages } = createServiceLayer({
|
|
164
|
+
packageMetadata,
|
|
165
|
+
builtinPackage,
|
|
166
|
+
properties,
|
|
167
|
+
i18n
|
|
168
|
+
});
|
|
169
|
+
this.serviceLayer = serviceLayer;
|
|
170
|
+
if (LOG.isDebug()) {
|
|
171
|
+
LOG.debug("Launching service layer with packages", Object.fromEntries(packages));
|
|
172
|
+
}
|
|
173
|
+
serviceLayer.start();
|
|
174
|
+
return { serviceLayer, packages };
|
|
175
|
+
}
|
|
176
|
+
async initAPI(serviceLayer) {
|
|
177
|
+
const apiService = getInternalService(serviceLayer, RUNTIME_API_SERVICE);
|
|
178
|
+
try {
|
|
179
|
+
const api = this.api = await apiService.getApi();
|
|
180
|
+
LOG.debug("Application API initialized to", api);
|
|
181
|
+
this.apiPromise?.resolve(api);
|
|
182
|
+
} catch (e) {
|
|
183
|
+
throw new Error(ErrorId.INTERNAL, "Failed to gather the application's API methods.", {
|
|
184
|
+
cause: e
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
triggerApplicationLifecycleEvent(event) {
|
|
189
|
+
this.lifecycleEvents?.emitLifecycleEvent(event);
|
|
190
|
+
}
|
|
191
|
+
checkAbort() {
|
|
192
|
+
if (this.state === "destroyed") {
|
|
193
|
+
throwAbortError();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
showErrorScreen(error) {
|
|
197
|
+
const userLocales = getBrowserLocales();
|
|
198
|
+
const i18nConfig = new I18nConfig(Object.keys(MESSAGES_BY_LOCALE));
|
|
199
|
+
const { locale, messageLocale } = i18nConfig.pickSupportedLocale(void 0, userLocales);
|
|
200
|
+
const messages = MESSAGES_BY_LOCALE[messageLocale] ?? MESSAGES_BY_LOCALE["en"];
|
|
201
|
+
const intl = createPackageIntl(locale, messages);
|
|
202
|
+
const appRoot = this.appRoot = createAppRoot(locale);
|
|
203
|
+
appRoot.classList.add("pioneer-root-error-screen");
|
|
204
|
+
this.container.appendChild(appRoot);
|
|
205
|
+
const styles = this.initStylesSignal();
|
|
206
|
+
this.reactIntegration = ReactIntegration.createForErrorScreen({
|
|
207
|
+
rootNode: this.rootNode,
|
|
208
|
+
hostNode: this.options.hostElement,
|
|
209
|
+
appRoot,
|
|
210
|
+
locale,
|
|
211
|
+
config: this.options.elementOptions.chakraSystemConfig,
|
|
212
|
+
styles
|
|
213
|
+
});
|
|
214
|
+
this.reactIntegration.render(createElement(ErrorScreen, { intl, error }));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function createServiceLayer(config) {
|
|
218
|
+
const { packageMetadata, properties, builtinPackage, i18n } = config;
|
|
219
|
+
let packages;
|
|
220
|
+
try {
|
|
221
|
+
packages = createPackages(packageMetadata ?? {}, i18n, properties);
|
|
222
|
+
} catch (e) {
|
|
223
|
+
throw new Error(ErrorId.INVALID_METADATA, "Failed to parse package metadata.", {
|
|
224
|
+
cause: e
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
{
|
|
228
|
+
const index = packages.findIndex((pkg) => pkg.name === builtinPackage.name);
|
|
229
|
+
if (index >= 0) {
|
|
230
|
+
packages.splice(index, 1);
|
|
231
|
+
}
|
|
232
|
+
packages.push(builtinPackage);
|
|
233
|
+
}
|
|
234
|
+
const forcedReferences = [
|
|
235
|
+
{
|
|
236
|
+
interfaceName: RUNTIME_API_SERVICE
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
interfaceName: RUNTIME_APPLICATION_LIFECYCLE_EVENT_SERVICE
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
interfaceName: RUNTIME_AUTO_START,
|
|
243
|
+
all: true
|
|
244
|
+
}
|
|
245
|
+
];
|
|
246
|
+
const serviceLayer = new ServiceLayer(packages, forcedReferences);
|
|
247
|
+
return {
|
|
248
|
+
packages: new Map(packages.map((pkg) => [pkg.name, pkg])),
|
|
249
|
+
serviceLayer
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function getInternalService(serviceLayer, interfaceName) {
|
|
253
|
+
const result = serviceLayer.getService(
|
|
254
|
+
"@open-pioneer/runtime",
|
|
255
|
+
{
|
|
256
|
+
interfaceName
|
|
257
|
+
},
|
|
258
|
+
{ ignoreDeclarationCheck: true }
|
|
259
|
+
);
|
|
260
|
+
if (result.type !== "found") {
|
|
261
|
+
throw new Error(
|
|
262
|
+
ErrorId.INTERNAL,
|
|
263
|
+
`Failed to find instance of '${interfaceName}' (result type '${result.type}'). This is a builtin service that must be present exactly once.`
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
return result.value.getInstanceOrThrow();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export { AppInstance };
|
|
270
|
+
//# sourceMappingURL=AppInstance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppInstance.js","sources":["AppInstance.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { reactive, ReadonlyReactive } from \"@conterra/reactivity-core\";\nimport {\n createAbortError,\n createLogger,\n createManualPromise,\n destroyResource,\n Error,\n ManualPromise,\n Resource,\n throwAbortError\n} from \"@open-pioneer/core\";\nimport { createElement } from \"react\";\nimport { ApiMethods, ApiService } from \"../api\";\nimport {\n createBuiltinPackage,\n RUNTIME_API_SERVICE,\n RUNTIME_APPLICATION_LIFECYCLE_EVENT_SERVICE,\n RUNTIME_AUTO_START\n} from \"../builtin-services\";\nimport { ApplicationLifecycleEventService } from \"../builtin-services/ApplicationLifecycleEventService\";\nimport { ApplicationConfig, ApplicationProperties, CustomElementOptions } from \"../CustomElement\";\nimport { createAppRoot, isShadowRoot, RootNode } from \"../dom\";\nimport { ErrorId } from \"../errors\";\nimport { AppIntl, createPackageIntl, getBrowserLocales, I18nConfig, initI18n } from \"../i18n\";\nimport { PackageMetadata } from \"../metadata\";\nimport { ErrorScreen, MESSAGES_BY_LOCALE } from \"../react-integration/ErrorScreen\";\nimport { EmptyComponent, ReactIntegration } from \"../react-integration/ReactIntegration\";\nimport { ReferenceSpec } from \"../service-layer/InterfaceSpec\";\nimport { createPackages, PackageRepr } from \"../service-layer/PackageRepr\";\nimport { ServiceLayer } from \"../service-layer/ServiceLayer\";\nimport { gatherConfig } from \"./gatherConfig\";\nimport { logError } from \"./logErrors\";\n\nconst LOG = createLogger(\"runtime:AppInstance\");\n\nexport interface AppOptions {\n /** The root node that contains the application. */\n rootNode: RootNode;\n\n /** The HTML element that embeds the application. */\n hostElement: HTMLElement;\n\n /** Trails options for the application. */\n elementOptions: CustomElementOptions;\n\n /** These have higher priority than the options in `elementOptions`. */\n overrides: AppOverrides | undefined;\n\n /**\n * A callback to restart the application with new options.\n * Currently only used for reloading with a certain locale.\n */\n restart: (overrides?: AppOverrides) => void;\n}\n\nexport interface AppOverrides {\n locale?: string;\n}\n\nexport type AppState = \"not-started\" | \"starting\" | \"started\" | \"destroyed\" | \"error\";\n\nexport class AppInstance {\n private options: AppOptions;\n\n // Public API\n private apiPromise: ManualPromise<ApiMethods> | undefined; // Present when callers are waiting for the API\n private api: ApiMethods | undefined; // Present once started\n\n private state: AppState = \"not-started\";\n private rootNode: RootNode;\n private container: HTMLElement | ShadowRoot; // parent of .pioneer-root\n private appRoot: HTMLDivElement | undefined; // .pioneer-root\n private config: ApplicationConfig | undefined;\n private serviceLayer: ServiceLayer | undefined;\n private lifecycleEvents: ApplicationLifecycleEventService | undefined;\n private reactIntegration: ReactIntegration | undefined;\n\n private stylesWatch: Resource | undefined;\n\n constructor(options: AppOptions) {\n this.options = options;\n this.container = isShadowRoot(options.rootNode) ? options.rootNode : options.hostElement;\n this.rootNode = options.rootNode;\n }\n\n start() {\n if (this.state !== \"not-started\") {\n throw new Error(ErrorId.INTERNAL, `Cannot start element in state '${this.state}'`);\n }\n\n this.state = \"starting\";\n this.startImpl().catch((e) => {\n if (this.state === \"destroyed\") return;\n\n logError(e);\n this.reset();\n this.state = \"error\";\n this.showErrorScreen(e);\n });\n }\n\n destroy() {\n if (this.state === \"destroyed\") {\n return;\n }\n\n // Only call event listener when 'started' was also signalled.\n if (this.state === \"started\") {\n try {\n this.triggerApplicationLifecycleEvent(\"before-stop\");\n } catch (e) {\n void e; // Ignored\n }\n }\n this.state = \"destroyed\";\n this.reset();\n }\n\n private reset() {\n this.apiPromise?.reject(createAbortError());\n this.reactIntegration = destroyResource(this.reactIntegration);\n this.container.replaceChildren();\n this.appRoot = undefined;\n this.lifecycleEvents = undefined;\n this.serviceLayer = destroyResource(this.serviceLayer);\n this.stylesWatch = destroyResource(this.stylesWatch);\n }\n\n whenAPI(): Promise<ApiMethods> {\n if (this.api) {\n return Promise.resolve(this.api);\n }\n\n const apiPromise = (this.apiPromise ??= createManualPromise());\n return apiPromise.promise;\n }\n\n private async startImpl() {\n const { hostElement, elementOptions, overrides } = this.options;\n const root = this.rootNode;\n\n // Resolve custom application config\n const config = (this.config = await gatherConfig(hostElement, elementOptions, overrides));\n this.checkAbort();\n LOG.debug(\"Application config is\", config);\n\n // Decide on locale and load i18n messages (if any).\n const i18n = await initI18n(elementOptions.appMetadata, config.locale);\n this.checkAbort();\n\n // Setup application root node in the shadow dom\n const appRoot = (this.appRoot = createAppRoot(i18n.locale));\n this.container.appendChild(appRoot);\n\n const styles = this.initStylesSignal();\n\n // Launch the service layer\n const { serviceLayer, packages } = this.initServiceLayer({\n container: appRoot,\n properties: config.properties,\n i18n\n });\n this.lifecycleEvents = getInternalService<ApplicationLifecycleEventService>(\n serviceLayer,\n RUNTIME_APPLICATION_LIFECYCLE_EVENT_SERVICE\n );\n\n await this.initAPI(serviceLayer);\n this.checkAbort();\n\n // Launch react\n this.reactIntegration = ReactIntegration.createForApp({\n rootNode: root,\n hostNode: hostElement,\n appRoot: appRoot,\n serviceLayer,\n packages,\n locale: i18n.locale,\n config: elementOptions.chakraSystemConfig,\n styles\n });\n const component = this.options.elementOptions.component ?? EmptyComponent;\n this.reactIntegration.render(createElement(component));\n this.state = \"started\";\n\n this.triggerApplicationLifecycleEvent(\"after-start\");\n LOG.debug(\"Application started\");\n }\n\n /**\n * Returns a signal that contains the application's styles.\n * During development, the signal is updated when the user edits .css files.\n * In production, the signal is static.\n */\n private initStylesSignal(): ReadonlyReactive<string> {\n const stylesBox = this.options.elementOptions.appMetadata?.styles;\n if (!stylesBox) {\n return reactive(\"\");\n }\n\n const signal = reactive(stylesBox.value);\n if (import.meta.hot) {\n this.stylesWatch = stylesBox.on?.(\"changed\", () => {\n LOG.debug(\"Application styles changed\");\n signal.value = stylesBox.value;\n });\n }\n return signal;\n }\n\n private initServiceLayer(config: {\n container: HTMLDivElement;\n properties: ApplicationProperties;\n i18n: AppIntl;\n }) {\n const { hostElement, rootNode: shadowRoot, elementOptions, restart } = this.options;\n const { container, properties, i18n } = config;\n const packageMetadata = elementOptions.appMetadata?.packages ?? {};\n const builtinPackage = createBuiltinPackage({\n host: hostElement,\n rootNode: shadowRoot,\n container: container,\n locale: i18n.locale,\n supportedLocales: i18n.supportedMessageLocales,\n changeLocale(locale) {\n const supported = i18n.supportedMessageLocales;\n if (locale != null && !i18n.supportsLocale(locale)) {\n throw new Error(\n ErrorId.UNSUPPORTED_LOCALE,\n `Unsupported locale '${locale}' (supported locales: ${supported.join(\n \", \"\n )}).`\n );\n }\n restart({ locale });\n }\n });\n const { serviceLayer, packages } = createServiceLayer({\n packageMetadata,\n builtinPackage,\n properties,\n i18n\n });\n this.serviceLayer = serviceLayer;\n\n if (LOG.isDebug()) {\n LOG.debug(\"Launching service layer with packages\", Object.fromEntries(packages));\n }\n serviceLayer.start();\n return { serviceLayer, packages };\n }\n\n private async initAPI(serviceLayer: ServiceLayer) {\n const apiService = getInternalService<ApiService>(serviceLayer, RUNTIME_API_SERVICE);\n try {\n const api = (this.api = await apiService.getApi());\n LOG.debug(\"Application API initialized to\", api);\n this.apiPromise?.resolve(api);\n } catch (e) {\n throw new Error(ErrorId.INTERNAL, \"Failed to gather the application's API methods.\", {\n cause: e\n });\n }\n }\n\n private triggerApplicationLifecycleEvent(event: \"after-start\" | \"before-stop\") {\n this.lifecycleEvents?.emitLifecycleEvent(event);\n }\n\n private checkAbort() {\n if (this.state === \"destroyed\") {\n throwAbortError();\n }\n }\n\n private showErrorScreen(error: globalThis.Error) {\n const userLocales = getBrowserLocales();\n const i18nConfig = new I18nConfig(Object.keys(MESSAGES_BY_LOCALE));\n const { locale, messageLocale } = i18nConfig.pickSupportedLocale(undefined, userLocales);\n const messages =\n MESSAGES_BY_LOCALE[messageLocale as keyof typeof MESSAGES_BY_LOCALE] ??\n MESSAGES_BY_LOCALE[\"en\"];\n const intl = createPackageIntl(locale, messages);\n\n const appRoot = (this.appRoot = createAppRoot(locale));\n appRoot.classList.add(\"pioneer-root-error-screen\");\n this.container.appendChild(appRoot);\n\n const styles = this.initStylesSignal();\n\n this.reactIntegration = ReactIntegration.createForErrorScreen({\n rootNode: this.rootNode,\n hostNode: this.options.hostElement,\n appRoot: appRoot,\n locale: locale,\n config: this.options.elementOptions.chakraSystemConfig,\n styles\n });\n this.reactIntegration.render(createElement(ErrorScreen, { intl, error }));\n }\n}\n\nfunction createServiceLayer(config: {\n packageMetadata: Record<string, PackageMetadata> | undefined;\n properties: ApplicationProperties;\n builtinPackage: PackageRepr;\n i18n: AppIntl;\n}) {\n const { packageMetadata, properties, builtinPackage, i18n } = config;\n\n let packages: PackageRepr[];\n try {\n packages = createPackages(packageMetadata ?? {}, i18n, properties);\n } catch (e) {\n throw new Error(ErrorId.INVALID_METADATA, \"Failed to parse package metadata.\", {\n cause: e\n });\n }\n\n // Add builtin services defined within this package.\n {\n const index = packages.findIndex((pkg) => pkg.name === builtinPackage.name);\n if (index >= 0) {\n packages.splice(index, 1);\n }\n packages.push(builtinPackage);\n }\n\n // Automatically required references (-> forces services to start)\n const forcedReferences: ReferenceSpec[] = [\n {\n interfaceName: RUNTIME_API_SERVICE\n },\n {\n interfaceName: RUNTIME_APPLICATION_LIFECYCLE_EVENT_SERVICE\n },\n {\n interfaceName: RUNTIME_AUTO_START,\n all: true\n }\n ];\n const serviceLayer = new ServiceLayer(packages, forcedReferences);\n return {\n packages: new Map(packages.map((pkg) => [pkg.name, pkg])),\n serviceLayer: serviceLayer\n };\n}\n\nfunction getInternalService<T = unknown>(serviceLayer: ServiceLayer, interfaceName: string) {\n const result = serviceLayer.getService(\n \"@open-pioneer/runtime\",\n {\n interfaceName\n },\n { ignoreDeclarationCheck: true }\n );\n if (result.type !== \"found\") {\n throw new Error(\n ErrorId.INTERNAL,\n `Failed to find instance of '${interfaceName}' (result type '${result.type}').` +\n ` This is a builtin service that must be present exactly once.`\n );\n }\n\n return result.value.getInstanceOrThrow() as T;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAM,GAAA,GAAM,aAAa,qBAAqB,CAAA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AI,KAAA;AAAA,MACN,OAAQ,CAAA,QAAA;AAAA,MACR,CAA+B,4BAAA,EAAA,aAAa,CAAmB,gBAAA,EAAA,MAAA,CAAO,IAAI,CAAA,gEAAA;AAAA,KAE9E;AAAA;AAGJ,EAAO,OAAA,MAAA,CAAO,MAAM,kBAAmB,EAAA;AAC3C;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApplicationConfig, CustomElementOptions } from "../CustomElement";
|
|
2
|
+
import { AppOverrides } from "./AppInstance";
|
|
3
|
+
/**
|
|
4
|
+
* Gathers application properties by reading them from the options object
|
|
5
|
+
* and by (optionally) invoking the `resolveProperties` hook.
|
|
6
|
+
*/
|
|
7
|
+
export declare function gatherConfig(hostElement: HTMLElement, options: CustomElementOptions, overrides?: AppOverrides): Promise<Required<ApplicationConfig>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Error } from '@open-pioneer/core';
|
|
2
|
+
import { ErrorId } from '../errors.js';
|
|
3
|
+
|
|
4
|
+
async function gatherConfig(hostElement, options, overrides) {
|
|
5
|
+
let configs;
|
|
6
|
+
try {
|
|
7
|
+
const staticConfig = options.config ?? {};
|
|
8
|
+
const dynamicConfig = await options.resolveConfig?.({
|
|
9
|
+
hostElement,
|
|
10
|
+
getAttribute(name) {
|
|
11
|
+
return hostElement.getAttribute(name) ?? void 0;
|
|
12
|
+
}
|
|
13
|
+
}) ?? {};
|
|
14
|
+
configs = [staticConfig, dynamicConfig];
|
|
15
|
+
} catch (e) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
ErrorId.CONFIG_RESOLUTION_FAILED,
|
|
18
|
+
"Failed to resolve application properties.",
|
|
19
|
+
{
|
|
20
|
+
cause: e
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const merged = mergeConfigs(configs);
|
|
25
|
+
if (overrides?.locale) {
|
|
26
|
+
merged.locale = overrides.locale;
|
|
27
|
+
}
|
|
28
|
+
return merged;
|
|
29
|
+
}
|
|
30
|
+
function mergeConfigs(configs) {
|
|
31
|
+
const mergedConfig = Object.assign(
|
|
32
|
+
{
|
|
33
|
+
locale: void 0,
|
|
34
|
+
properties: {}
|
|
35
|
+
},
|
|
36
|
+
...configs
|
|
37
|
+
);
|
|
38
|
+
const mergedProperties = mergedConfig.properties = {};
|
|
39
|
+
for (const config of configs) {
|
|
40
|
+
for (const [packageName, packageProperties] of Object.entries(config.properties ?? {})) {
|
|
41
|
+
const mergedPackageProps = mergedProperties[packageName] ??= {};
|
|
42
|
+
Object.assign(mergedPackageProps, packageProperties);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return mergedConfig;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { gatherConfig };
|
|
49
|
+
//# sourceMappingURL=gatherConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gatherConfig.js","sources":["gatherConfig.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Error } from \"@open-pioneer/core\";\nimport { ApplicationConfig, ApplicationProperties, CustomElementOptions } from \"../CustomElement\";\nimport { ErrorId } from \"../errors\";\nimport { AppOverrides } from \"./AppInstance\";\n\n/**\n * Gathers application properties by reading them from the options object\n * and by (optionally) invoking the `resolveProperties` hook.\n */\nexport async function gatherConfig(\n hostElement: HTMLElement,\n options: CustomElementOptions,\n overrides?: AppOverrides\n) {\n let configs: ApplicationConfig[];\n try {\n const staticConfig = options.config ?? {};\n const dynamicConfig =\n (await options.resolveConfig?.({\n hostElement,\n getAttribute(name) {\n return hostElement.getAttribute(name) ?? undefined;\n }\n })) ?? {};\n\n configs = [staticConfig, dynamicConfig];\n } catch (e) {\n throw new Error(\n ErrorId.CONFIG_RESOLUTION_FAILED,\n \"Failed to resolve application properties.\",\n {\n cause: e\n }\n );\n }\n\n const merged = mergeConfigs(configs);\n if (overrides?.locale) {\n merged.locale = overrides.locale;\n }\n return merged;\n}\n\n/**\n * Merges application configurations into a single object.\n * Properties / config parameters at a later position overwrite properties from earlier ones.\n */\nfunction mergeConfigs(configs: ApplicationConfig[]): Required<ApplicationConfig> {\n // Merge simple values by assigning them in order\n const mergedConfig: Required<ApplicationConfig> = Object.assign(\n {\n locale: undefined,\n properties: {}\n } satisfies ApplicationConfig,\n ...configs\n );\n\n // Deep merge for application properties\n const mergedProperties: ApplicationProperties = (mergedConfig.properties = {});\n for (const config of configs) {\n for (const [packageName, packageProperties] of Object.entries(config.properties ?? {})) {\n const mergedPackageProps = (mergedProperties[packageName] ??= {});\n Object.assign(mergedPackageProps, packageProperties);\n }\n }\n\n return mergedConfig;\n}\n"],"names":[],"mappings":";;;AAWsB,eAAA,YAAA,CAClB,WACA,EAAA,OAAA,EACA,SACF,EAAA;AACE,EAAI,IAAA,OAAA;AACJ,EAAI,IAAA;AACA,IAAM,MAAA,YAAA,GAAe,OAAQ,CAAA,MAAA,IAAU,EAAC;AACxC,IAAM,MAAA,aAAA,GACD,MAAM,OAAA,CAAQ,aAAgB,GAAA;AAAA,MAC3B,WAAA;AAAA,MACA,aAAa,IAAM,EAAA;AACf,QAAO,OAAA,WAAA,CAAY,YAAa,CAAA,IAAI,CAAK,IAAA,KAAA,CAAA;AAAA;AAC7C,KACH,KAAM,EAAC;AAEZ,IAAU,OAAA,GAAA,CAAC,cAAc,aAAa,CAAA;AAAA,WACjC,CAAG,EAAA;AACR,IAAA,MAAM,IAAI,KAAA;AAAA,MACN,OAAQ,CAAA,wBAAA;AAAA,MACR,2CAAA;AAAA,MACA;AAAA,QACI,KAAO,EAAA;AAAA;AACX,KACJ;AAAA;AAGJ,EAAM,MAAA,MAAA,GAAS,aAAa,OAAO,CAAA;AACnC,EAAA,IAAI,WAAW,MAAQ,EAAA;AACnB,IAAA,MAAA,CAAO,SAAS,SAAU,CAAA,MAAA;AAAA;AAE9B,EAAO,OAAA,MAAA;AACX;AAMA,SAAS,aAAa,OAA2D,EAAA;AAE7E,EAAA,MAAM,eAA4C,MAAO,CAAA,MAAA;AAAA,IACrD;AAAA,MACI,MAAQ,EAAA,MAAA;AAAA,MACR,YAAY;AAAC,KACjB;AAAA,IACA,GAAG;AAAA,GACP;AAGA,EAAM,MAAA,gBAAA,GAA2C,YAAa,CAAA,UAAA,GAAa,EAAC;AAC5E,EAAA,KAAA,MAAW,UAAU,OAAS,EAAA;AAC1B,IAAW,KAAA,MAAA,CAAC,WAAa,EAAA,iBAAiB,CAAK,IAAA,MAAA,CAAO,QAAQ,MAAO,CAAA,UAAA,IAAc,EAAE,CAAG,EAAA;AACpF,MAAA,MAAM,kBAAsB,GAAA,gBAAA,CAAiB,WAAW,CAAA,KAAM,EAAC;AAC/D,MAAO,MAAA,CAAA,MAAA,CAAO,oBAAoB,iBAAiB,CAAA;AAAA;AACvD;AAGJ,EAAO,OAAA,YAAA;AACX;;;;"}
|
package/app/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppInstance, type AppOptions, type AppOverrides, type AppState } from "./AppInstance";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logError(e: unknown): void;
|
package/app/logErrors.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getErrorChain } from '@open-pioneer/core';
|
|
2
|
+
|
|
3
|
+
function logError(e) {
|
|
4
|
+
if (e instanceof Error) {
|
|
5
|
+
const chain = getErrorChain(e).reverse();
|
|
6
|
+
if (chain.length === 1) {
|
|
7
|
+
console.error(e);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
let n = 1;
|
|
11
|
+
for (const error of chain) {
|
|
12
|
+
console.error(`#${n}`, error);
|
|
13
|
+
++n;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
console.error("Unexpected error", e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { logError };
|
|
21
|
+
//# sourceMappingURL=logErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logErrors.js","sources":["logErrors.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { getErrorChain } from \"@open-pioneer/core\";\n\nexport function logError(e: unknown) {\n if (e instanceof Error) {\n const chain = getErrorChain(e).reverse();\n if (chain.length === 1) {\n console.error(e);\n return;\n }\n\n let n = 1;\n for (const error of chain) {\n console.error(`#${n}`, error);\n ++n;\n }\n } else {\n console.error(\"Unexpected error\", e);\n }\n}\n"],"names":[],"mappings":";;AAIO,SAAS,SAAS,CAAY,EAAA;AACjC,EAAA,IAAI,aAAa,KAAO,EAAA;AACpB,IAAA,MAAM,KAAQ,GAAA,aAAA,CAAc,CAAC,CAAA,CAAE,OAAQ,EAAA;AACvC,IAAI,IAAA,KAAA,CAAM,WAAW,CAAG,EAAA;AACpB,MAAA,OAAA,CAAQ,MAAM,CAAC,CAAA;AACf,MAAA;AAAA;AAGJ,IAAA,IAAI,CAAI,GAAA,CAAA;AACR,IAAA,KAAA,MAAW,SAAS,KAAO,EAAA;AACvB,MAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,CAAA,EAAI,CAAC,CAAA,CAAA,EAAI,KAAK,CAAA;AAC5B,MAAE,EAAA,CAAA;AAAA;AACN,GACG,MAAA;AACH,IAAQ,OAAA,CAAA,KAAA,CAAM,oBAAoB,CAAC,CAAA;AAAA;AAE3C;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ApplicationContext } from "../api";
|
|
2
|
+
import { RootNode } from "../dom";
|
|
2
3
|
import { ServiceOptions } from "../Service";
|
|
3
4
|
export interface ApplicationContextProperties {
|
|
4
5
|
host: HTMLElement;
|
|
5
|
-
|
|
6
|
+
rootNode: RootNode;
|
|
6
7
|
container: HTMLElement;
|
|
7
8
|
locale: string;
|
|
8
9
|
supportedLocales: string[];
|
|
@@ -11,9 +12,10 @@ export interface ApplicationContextProperties {
|
|
|
11
12
|
}
|
|
12
13
|
export declare class ApplicationContextImpl implements ApplicationContext {
|
|
13
14
|
#private;
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(_options: ServiceOptions, properties: ApplicationContextProperties);
|
|
15
16
|
getHostElement(): HTMLElement;
|
|
16
|
-
|
|
17
|
+
getRoot(): RootNode;
|
|
18
|
+
getShadowRoot(): ShadowRoot | undefined;
|
|
17
19
|
getApplicationContainer(): HTMLElement;
|
|
18
20
|
getLocale(): string;
|
|
19
21
|
setLocale(locale: string): void;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { isShadowRoot } from '../dom/index.js';
|
|
2
|
+
|
|
1
3
|
class ApplicationContextImpl {
|
|
2
4
|
#host;
|
|
3
|
-
#
|
|
5
|
+
#rootNode;
|
|
4
6
|
#container;
|
|
5
7
|
#locale;
|
|
6
8
|
#supportedLocales;
|
|
7
9
|
#changeLocale;
|
|
8
|
-
constructor(
|
|
10
|
+
constructor(_options, properties) {
|
|
9
11
|
this.#host = properties.host;
|
|
10
|
-
this.#
|
|
12
|
+
this.#rootNode = properties.rootNode;
|
|
11
13
|
this.#container = properties.container;
|
|
12
14
|
this.#locale = properties.locale;
|
|
13
15
|
this.#supportedLocales = Object.freeze(Array.from(properties.supportedLocales));
|
|
@@ -16,8 +18,11 @@ class ApplicationContextImpl {
|
|
|
16
18
|
getHostElement() {
|
|
17
19
|
return this.#host;
|
|
18
20
|
}
|
|
21
|
+
getRoot() {
|
|
22
|
+
return this.#rootNode;
|
|
23
|
+
}
|
|
19
24
|
getShadowRoot() {
|
|
20
|
-
return this.#
|
|
25
|
+
return isShadowRoot(this.#rootNode) ? this.#rootNode : void 0;
|
|
21
26
|
}
|
|
22
27
|
getApplicationContainer() {
|
|
23
28
|
return this.#container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationContextImpl.js","sources":["ApplicationContextImpl.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ApplicationContext } from \"../api\";\nimport { ServiceOptions } from \"../Service\";\n\nexport interface ApplicationContextProperties {\n host: HTMLElement;\n
|
|
1
|
+
{"version":3,"file":"ApplicationContextImpl.js","sources":["ApplicationContextImpl.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ApplicationContext } from \"../api\";\nimport { isShadowRoot, RootNode } from \"../dom\";\nimport { ServiceOptions } from \"../Service\";\n\nexport interface ApplicationContextProperties {\n host: HTMLElement;\n rootNode: RootNode;\n container: HTMLElement;\n locale: string;\n supportedLocales: string[];\n\n /** A callback to change the application's locale is injected by the runtime. */\n changeLocale(locale: string): void;\n}\n\nexport class ApplicationContextImpl implements ApplicationContext {\n #host: HTMLElement;\n #rootNode: RootNode;\n #container: HTMLElement;\n #locale: string;\n #supportedLocales: readonly string[];\n #changeLocale: (locale: string) => void;\n\n constructor(_options: ServiceOptions, properties: ApplicationContextProperties) {\n this.#host = properties.host;\n this.#rootNode = properties.rootNode;\n this.#container = properties.container;\n this.#locale = properties.locale;\n this.#supportedLocales = Object.freeze(Array.from(properties.supportedLocales));\n this.#changeLocale = properties.changeLocale;\n }\n\n getHostElement(): HTMLElement {\n return this.#host;\n }\n\n getRoot(): RootNode {\n return this.#rootNode;\n }\n\n getShadowRoot(): ShadowRoot | undefined {\n return isShadowRoot(this.#rootNode) ? this.#rootNode : undefined;\n }\n\n getApplicationContainer(): HTMLElement {\n return this.#container;\n }\n\n getLocale(): string {\n return this.#locale;\n }\n\n setLocale(locale: string): void {\n // This restarts the application at the moment, so this.locale will _not_ be updated.\n // Instead, we get a new application with a new application context.\n this.#changeLocale(locale);\n }\n\n getSupportedLocales(): readonly string[] {\n return this.#supportedLocales;\n }\n}\n"],"names":[],"mappings":";;AAiBO,MAAM,sBAAqD,CAAA;AAAA,EAC9D,KAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA,EAEA,WAAA,CAAY,UAA0B,UAA0C,EAAA;AAC5E,IAAA,IAAA,CAAK,QAAQ,UAAW,CAAA,IAAA;AACxB,IAAA,IAAA,CAAK,YAAY,UAAW,CAAA,QAAA;AAC5B,IAAA,IAAA,CAAK,aAAa,UAAW,CAAA,SAAA;AAC7B,IAAA,IAAA,CAAK,UAAU,UAAW,CAAA,MAAA;AAC1B,IAAA,IAAA,CAAK,oBAAoB,MAAO,CAAA,MAAA,CAAO,MAAM,IAAK,CAAA,UAAA,CAAW,gBAAgB,CAAC,CAAA;AAC9E,IAAA,IAAA,CAAK,gBAAgB,UAAW,CAAA,YAAA;AAAA;AACpC,EAEA,cAA8B,GAAA;AAC1B,IAAA,OAAO,IAAK,CAAA,KAAA;AAAA;AAChB,EAEA,OAAoB,GAAA;AAChB,IAAA,OAAO,IAAK,CAAA,SAAA;AAAA;AAChB,EAEA,aAAwC,GAAA;AACpC,IAAA,OAAO,YAAa,CAAA,IAAA,CAAK,SAAS,CAAA,GAAI,KAAK,SAAY,GAAA,MAAA;AAAA;AAC3D,EAEA,uBAAuC,GAAA;AACnC,IAAA,OAAO,IAAK,CAAA,UAAA;AAAA;AAChB,EAEA,SAAoB,GAAA;AAChB,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA;AAChB,EAEA,UAAU,MAAsB,EAAA;AAG5B,IAAA,IAAA,CAAK,cAAc,MAAM,CAAA;AAAA;AAC7B,EAEA,mBAAyC,GAAA;AACrC,IAAA,OAAO,IAAK,CAAA,iBAAA;AAAA;AAEpB;;;;"}
|
package/dom/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type RootNode = Document | ShadowRoot;
|
|
2
|
+
/**
|
|
3
|
+
* Class of the <div> that contains the entire application.
|
|
4
|
+
*/
|
|
5
|
+
export declare const APP_ROOT_CLASS = "pioneer-root";
|
|
6
|
+
export declare function isShadowRoot(node: RootNode): node is ShadowRoot;
|
|
7
|
+
export declare function isDocument(node: RootNode): node is Document;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the parent node for <style> elements.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getStylesRoot(node: RootNode): ShadowRoot | HTMLHeadElement;
|
|
12
|
+
/**
|
|
13
|
+
* Creates the node that contains all other application content.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createAppRoot(locale: string): HTMLDivElement;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the styles for host element (the web component node).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getBuiltinStyles(rootNode: RootNode, hostElement: HTMLElement | undefined): string;
|
package/dom/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const APP_ROOT_CLASS = "pioneer-root";
|
|
2
|
+
function isShadowRoot(node) {
|
|
3
|
+
return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in node;
|
|
4
|
+
}
|
|
5
|
+
function getStylesRoot(node) {
|
|
6
|
+
return isShadowRoot(node) ? node : node.head;
|
|
7
|
+
}
|
|
8
|
+
function createAppRoot(locale) {
|
|
9
|
+
const container = document.createElement("div");
|
|
10
|
+
container.classList.add("pioneer-root");
|
|
11
|
+
container.style.minHeight = "100%";
|
|
12
|
+
container.style.height = "100%";
|
|
13
|
+
if (locale) {
|
|
14
|
+
container.lang = locale;
|
|
15
|
+
}
|
|
16
|
+
return container;
|
|
17
|
+
}
|
|
18
|
+
function getBuiltinStyles(rootNode, hostElement) {
|
|
19
|
+
const selector = isShadowRoot(rootNode) || !hostElement ? ":host" : hostElement.tagName.toLowerCase();
|
|
20
|
+
return `@layer base { ${selector} { all: initial; display: block; } }`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { APP_ROOT_CLASS, createAppRoot, getBuiltinStyles, getStylesRoot, isShadowRoot };
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
package/dom/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nexport type RootNode = Document | ShadowRoot;\n\n/**\n * Class of the <div> that contains the entire application.\n */\nexport const APP_ROOT_CLASS = \"pioneer-root\";\n\nexport function isShadowRoot(node: RootNode): node is ShadowRoot {\n return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && \"host\" in node;\n}\n\nexport function isDocument(node: RootNode): node is Document {\n return !isShadowRoot(node);\n}\n\n/**\n * Returns the parent node for <style> elements.\n */\nexport function getStylesRoot(node: RootNode): ShadowRoot | HTMLHeadElement {\n return isShadowRoot(node) ? node : node.head;\n}\n\n/**\n * Creates the node that contains all other application content.\n */\nexport function createAppRoot(locale: string): HTMLDivElement {\n // Setup application root node in the shadow dom\n const container = document.createElement(\"div\");\n container.classList.add(\"pioneer-root\");\n container.style.minHeight = \"100%\";\n container.style.height = \"100%\";\n if (locale) {\n container.lang = locale;\n }\n return container;\n}\n\n/**\n * Returns the styles for host element (the web component node).\n */\nexport function getBuiltinStyles(rootNode: RootNode, hostElement: HTMLElement | undefined) {\n // Prevent inheritance of certain css values and normalize to display: block by default.\n // See https://open-wc.org/guides/knowledge/styling/styles-piercing-shadow-dom/\n // NOTE: layer base comes from chakra (used for css resets etc).\n const selector =\n isShadowRoot(rootNode) || !hostElement ? \":host\" : hostElement.tagName.toLowerCase();\n return `@layer base { ${selector} { all: initial; display: block; } }`;\n}\n"],"names":[],"mappings":"AAOO,MAAM,cAAiB,GAAA;AAEvB,SAAS,aAAa,IAAoC,EAAA;AAC7D,EAAA,OAAO,IAAK,CAAA,QAAA,KAAa,IAAK,CAAA,sBAAA,IAA0B,MAAU,IAAA,IAAA;AACtE;AASO,SAAS,cAAc,IAA8C,EAAA;AACxE,EAAA,OAAO,YAAa,CAAA,IAAI,CAAI,GAAA,IAAA,GAAO,IAAK,CAAA,IAAA;AAC5C;AAKO,SAAS,cAAc,MAAgC,EAAA;AAE1D,EAAM,MAAA,SAAA,GAAY,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA;AAC9C,EAAU,SAAA,CAAA,SAAA,CAAU,IAAI,cAAc,CAAA;AACtC,EAAA,SAAA,CAAU,MAAM,SAAY,GAAA,MAAA;AAC5B,EAAA,SAAA,CAAU,MAAM,MAAS,GAAA,MAAA;AACzB,EAAA,IAAI,MAAQ,EAAA;AACR,IAAA,SAAA,CAAU,IAAO,GAAA,MAAA;AAAA;AAErB,EAAO,OAAA,SAAA;AACX;AAKgB,SAAA,gBAAA,CAAiB,UAAoB,WAAsC,EAAA;AAIvF,EAAM,MAAA,QAAA,GACF,aAAa,QAAQ,CAAA,IAAK,CAAC,WAAc,GAAA,OAAA,GAAU,WAAY,CAAA,OAAA,CAAQ,WAAY,EAAA;AACvF,EAAA,OAAO,iBAAiB,QAAQ,CAAA,oCAAA,CAAA;AACpC;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./api";
|
|
2
2
|
export { type PackageIntl, type PackageIntlExtensions, type RichTextValue } from "./i18n";
|
|
3
|
-
export { type
|
|
3
|
+
export { type AdvancedCustomElementOptions, type ApplicationConfig, type ApplicationElement, type ApplicationElementConstructor, type ApplicationProperties, type ConfigContext, type CustomElementOptions, createCustomElement } from "./CustomElement";
|
|
4
4
|
export * from "./Service";
|
|
5
5
|
export { type DeclaredService, type AssociatedInterfaceName, type InterfaceNameForServiceType, DECLARE_SERVICE_INTERFACE } from "./DeclaredService";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/runtime",
|
|
4
|
-
"version": "4.0.0-dev.
|
|
4
|
+
"version": "4.0.0-dev.20250527091545",
|
|
5
5
|
"description": "Implements the runtime environment for Open Pioneer Trails apps.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@conterra/reactivity-core": "^0.6.0",
|
|
18
18
|
"@formatjs/intl": "^3.1.6",
|
|
19
|
-
"@chakra-ui/react": "^3.
|
|
19
|
+
"@chakra-ui/react": "^3.19.1",
|
|
20
20
|
"@emotion/cache": "^11.14.0",
|
|
21
21
|
"@emotion/react": "^11.14.0",
|
|
22
22
|
"react": "^19.1.0",
|
|
23
23
|
"react-dom": "^19.1.0",
|
|
24
|
-
"@open-pioneer/
|
|
25
|
-
"@open-pioneer/base-theme": "4.0.0-dev.
|
|
26
|
-
"@open-pioneer/
|
|
24
|
+
"@open-pioneer/core": "4.0.0-dev.20250527091545",
|
|
25
|
+
"@open-pioneer/base-theme": "4.0.0-dev.20250527091545",
|
|
26
|
+
"@open-pioneer/reactivity": "4.0.0-dev.20250527091545"
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
"./package.json": "./package.json",
|