@openremote/or-app 1.34.0 → 1.34.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.
@@ -8,6 +8,10 @@ import type {
8
8
  getDefaultManagerConfig,
9
9
  OrApp,
10
10
  } from "./lib/index.d.ts";
11
+ import type {
12
+ translateWithFallback,
13
+ OrAppLoading,
14
+ } from "./lib/or-app-loading.d.ts";
11
15
  import type { Languages, OrHeader } from "./lib/or-header.d.ts";
12
16
  import type { pageOfflineProvider, PageOffline } from "./lib/page-offline.d.ts";
13
17
 
@@ -114,6 +118,21 @@ export type OrAppSolidJsProps = {
114
118
  textContent?: string | number;
115
119
  };
116
120
 
121
+ export type OrAppLoadingProps = {
122
+ /** Shows that the app could not be loaded instead of the spinner */
123
+ failed?: OrAppLoading["failed"];
124
+ };
125
+
126
+ export type OrAppLoadingSolidJsProps = {
127
+ /** Shows that the app could not be loaded instead of the spinner */
128
+ "prop:failed"?: OrAppLoading["failed"];
129
+
130
+ /** Set the innerHTML of the element */
131
+ innerHTML?: string;
132
+ /** Set the textContent of the element */
133
+ textContent?: string | number;
134
+ };
135
+
117
136
  export type OrHeaderProps = {
118
137
  /** */
119
138
  realms?: OrHeader["realms"];
@@ -193,6 +212,21 @@ export type CustomElements = {
193
212
  */
194
213
  "or-app": Partial<OrAppProps & BaseProps<OrApp> & BaseEvents>;
195
214
 
215
+ /**
216
+ * Shows a spinner while the app starts, or a message when it could not be loaded. The spinner only appears once the
217
+ * page has been loading for OrAppLoading.DELAY_MILLIS, counted from the start of the page load, so a fast start
218
+ * shows nothing and a later instance continues where an earlier one left off.
219
+ *
220
+ * ## Attributes & Properties
221
+ *
222
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
223
+ *
224
+ * - `failed`: Shows that the app could not be loaded instead of the spinner
225
+ */
226
+ "or-app-loading": Partial<
227
+ OrAppLoadingProps & BaseProps<OrAppLoading> & BaseEvents
228
+ >;
229
+
196
230
  /**
197
231
  *
198
232
  *
@@ -264,6 +298,24 @@ export type CustomElementsSolidJs = {
264
298
  OrAppProps & OrAppSolidJsProps & BaseProps<OrApp> & BaseEvents
265
299
  >;
266
300
 
301
+ /**
302
+ * Shows a spinner while the app starts, or a message when it could not be loaded. The spinner only appears once the
303
+ * page has been loading for OrAppLoading.DELAY_MILLIS, counted from the start of the page load, so a fast start
304
+ * shows nothing and a later instance continues where an earlier one left off.
305
+ *
306
+ * ## Attributes & Properties
307
+ *
308
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
309
+ *
310
+ * - `failed`: Shows that the app could not be loaded instead of the spinner
311
+ */
312
+ "or-app-loading": Partial<
313
+ OrAppLoadingProps &
314
+ OrAppLoadingSolidJsProps &
315
+ BaseProps<OrAppLoading> &
316
+ BaseEvents
317
+ >;
318
+
267
319
  /**
268
320
  *
269
321
  *
@@ -102,6 +102,15 @@
102
102
  "privacy": "protected",
103
103
  "default": "false"
104
104
  },
105
+ {
106
+ "kind": "field",
107
+ "name": "_startupFailure",
108
+ "type": {
109
+ "text": "\"loadFailed\" | \"error\" | undefined"
110
+ },
111
+ "privacy": "protected",
112
+ "description": "Why the app didn't start: it could not be loaded, or an error that a dialog shows"
113
+ },
105
114
  {
106
115
  "kind": "field",
107
116
  "name": "_page",
@@ -229,6 +238,31 @@
229
238
  }
230
239
  ]
231
240
  },
241
+ {
242
+ "kind": "method",
243
+ "name": "_showStartupError",
244
+ "privacy": "protected",
245
+ "parameters": [
246
+ {
247
+ "name": "host",
248
+ "type": {
249
+ "text": "Node"
250
+ }
251
+ },
252
+ {
253
+ "name": "key",
254
+ "type": {
255
+ "text": "string"
256
+ }
257
+ },
258
+ {
259
+ "name": "fallback",
260
+ "type": {
261
+ "text": "string"
262
+ }
263
+ }
264
+ ]
265
+ },
232
266
  {
233
267
  "kind": "method",
234
268
  "name": "stateChanged",
@@ -438,6 +472,14 @@
438
472
  "module": "src/or-header"
439
473
  }
440
474
  },
475
+ {
476
+ "kind": "js",
477
+ "name": "*",
478
+ "declaration": {
479
+ "name": "*",
480
+ "module": "src/or-app-loading"
481
+ }
482
+ },
441
483
  {
442
484
  "kind": "js",
443
485
  "name": "*",
@@ -488,6 +530,127 @@
488
530
  }
489
531
  ]
490
532
  },
533
+ {
534
+ "kind": "javascript-module",
535
+ "path": "src/or-app-loading.ts",
536
+ "declarations": [
537
+ {
538
+ "kind": "function",
539
+ "name": "translateWithFallback",
540
+ "return": {
541
+ "type": {
542
+ "text": "string"
543
+ }
544
+ },
545
+ "parameters": [
546
+ {
547
+ "name": "key",
548
+ "type": {
549
+ "text": "string"
550
+ }
551
+ },
552
+ {
553
+ "name": "fallback",
554
+ "type": {
555
+ "text": "string"
556
+ }
557
+ }
558
+ ],
559
+ "description": "Translates `key`, or returns the English `fallback` when the translations are missing. They are loaded from the\nmanager late in the startup, so they are missing when it fails before then or can't be reached."
560
+ },
561
+ {
562
+ "kind": "class",
563
+ "description": "Shows a spinner while the app starts, or a message when it could not be loaded. The spinner only appears once the\npage has been loading for OrAppLoading.DELAY_MILLIS, counted from the start of the page load, so a fast start\nshows nothing and a later instance continues where an earlier one left off.",
564
+ "name": "OrAppLoading",
565
+ "members": [
566
+ {
567
+ "kind": "field",
568
+ "name": "DELAY_MILLIS",
569
+ "type": {
570
+ "text": "number"
571
+ },
572
+ "privacy": "public",
573
+ "static": true,
574
+ "default": "2000"
575
+ },
576
+ {
577
+ "kind": "field",
578
+ "name": "failed",
579
+ "type": {
580
+ "text": "boolean"
581
+ },
582
+ "privacy": "public",
583
+ "default": "false",
584
+ "description": "Shows that the app could not be loaded instead of the spinner",
585
+ "attribute": "failed",
586
+ "reflects": true
587
+ },
588
+ {
589
+ "kind": "field",
590
+ "name": "_spinnerVisible",
591
+ "type": {
592
+ "text": "boolean"
593
+ },
594
+ "privacy": "protected",
595
+ "default": "false"
596
+ },
597
+ {
598
+ "kind": "field",
599
+ "name": "_spinnerTimer",
600
+ "type": {
601
+ "text": "number | undefined"
602
+ },
603
+ "privacy": "protected"
604
+ }
605
+ ],
606
+ "attributes": [
607
+ {
608
+ "name": "failed",
609
+ "type": {
610
+ "text": "boolean"
611
+ },
612
+ "default": "false",
613
+ "description": "Shows that the app could not be loaded instead of the spinner",
614
+ "fieldName": "failed"
615
+ }
616
+ ],
617
+ "superclass": {
618
+ "name": "OrElement",
619
+ "package": "@openremote/or-element"
620
+ },
621
+ "tagName": "or-app-loading",
622
+ "customElement": true,
623
+ "modulePath": "src/or-app-loading.ts",
624
+ "definitionPath": "src/or-app-loading.ts"
625
+ }
626
+ ],
627
+ "exports": [
628
+ {
629
+ "kind": "js",
630
+ "name": "translateWithFallback",
631
+ "declaration": {
632
+ "name": "translateWithFallback",
633
+ "module": "src/or-app-loading.ts"
634
+ }
635
+ },
636
+ {
637
+ "kind": "js",
638
+ "name": "OrAppLoading",
639
+ "declaration": {
640
+ "name": "OrAppLoading",
641
+ "module": "src/or-app-loading.ts"
642
+ }
643
+ },
644
+ {
645
+ "kind": "custom-element-definition",
646
+ "name": "or-app-loading",
647
+ "declaration": {
648
+ "name": "OrAppLoading",
649
+ "module": "src/or-app-loading.ts"
650
+ }
651
+ }
652
+ ]
653
+ },
491
654
  {
492
655
  "kind": "javascript-module",
493
656
  "path": "src/or-header.ts",