@ng-desktop/platform 0.7.0 → 0.7.1

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.
@@ -534,6 +534,15 @@ export class NativeRenderer2 extends Renderer2 {
534
534
  if (isInternalAngularAttr(name)) {
535
535
  return;
536
536
  }
537
+ if (name !== 'class' &&
538
+ name !== 'className' &&
539
+ name !== 'src' &&
540
+ name !== 'ngSrc' &&
541
+ name !== 'scroll-to' &&
542
+ name !== 'scroll-anchor' &&
543
+ el.attributes.get(name) === value) {
544
+ return;
545
+ }
537
546
  el.attributes.set(name, value);
538
547
  if (name === 'class' || name === 'className') {
539
548
  this.syncClassList(el, value);
@@ -552,14 +561,17 @@ export class NativeRenderer2 extends Renderer2 {
552
561
  this.handleImageSource(el, value);
553
562
  return;
554
563
  }
555
- if (name === 'title' &&
556
- (el.tag === 'ng-window' ||
557
- el.tag === 'adw-window' ||
558
- el.tag === 'ng-dialog' ||
559
- el.tag === 'gtk-dialog' ||
560
- el.tag === 'adw-dialog' ||
561
- el.tag === 'ng-header-bar' ||
562
- el.tag === 'adw-header-bar')) {
564
+ if (name === 'label' ||
565
+ (name === 'text' && TEXT_BEARING_TAGS.has(el.tag)) ||
566
+ (name === 'title' &&
567
+ (el.tag === 'ng-window' ||
568
+ el.tag === 'adw-window' ||
569
+ el.tag === 'ng-dialog' ||
570
+ el.tag === 'gtk-dialog' ||
571
+ el.tag === 'adw-dialog' ||
572
+ el.tag === 'ng-header-bar' ||
573
+ el.tag === 'adw-header-bar'))) {
574
+ el.textContent = value;
563
575
  this.bridge.setText(el.id, value);
564
576
  }
565
577
  else {
@@ -6,11 +6,13 @@ import { NgNativeBridge } from './bridge';
6
6
  * key shortcut plugin, and native error handler).
7
7
  */
8
8
  export declare function provideNativePlatform(): EnvironmentProviders;
9
- export interface NativeBootstrapContext {
9
+ export interface NativeBootstrapContext extends PromiseLike<ApplicationRef> {
10
10
  readonly rootComponent: Type<unknown>;
11
11
  readonly bridge: NgNativeBridge;
12
12
  readonly config: ApplicationConfig;
13
13
  readonly appRefPromise?: Promise<ApplicationRef>;
14
+ catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<ApplicationRef | TResult>;
15
+ finally(onfinally?: (() => void) | null): Promise<ApplicationRef>;
14
16
  }
15
17
  /**
16
18
  * Bootstraps an Angular root component against the Rust `RenderEngine` via `globalThis.__NG_NATIVE__`.
@@ -37,10 +37,20 @@ export function bootstrapNativeApplication(rootComponent, appConfig) {
37
37
  const appRefPromise = isIvyComponent
38
38
  ? bootstrapApplication(rootComponent, mergedConfig)
39
39
  : undefined;
40
+ const resolvedPromise = appRefPromise ?? Promise.resolve(undefined);
40
41
  return {
41
42
  rootComponent,
42
43
  bridge,
43
44
  config: mergedConfig,
44
45
  ...(appRefPromise ? { appRefPromise } : {}),
46
+ then(onfulfilled, onrejected) {
47
+ return resolvedPromise.then(onfulfilled, onrejected);
48
+ },
49
+ catch(onrejected) {
50
+ return resolvedPromise.catch(onrejected);
51
+ },
52
+ finally(onfinally) {
53
+ return resolvedPromise.finally(onfinally);
54
+ },
45
55
  };
46
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-desktop/platform",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "@ng-desktop/platform for Angular Desktop Engine",
5
5
  "license": "MIT",
6
6
  "keywords": [