@nebula.js/stardust 5.7.0 → 5.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebula.js/stardust",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "Product and framework agnostic integration API for Qlik's Associative Engine",
5
5
  "license": "MIT",
6
6
  "author": "QlikTech International AB",
@@ -41,18 +41,18 @@
41
41
  "version": "yarn run spec && yarn run ts && git add ./api-spec/spec.json ./api-spec/listbox-spec.json ./types/index.d.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@emotion/react": "^11.13.0",
44
+ "@emotion/react": "^11.13.3",
45
45
  "@emotion/styled": "^11.13.0",
46
- "@mui/icons-material": "^5.16.6",
47
- "@mui/material": "^5.16.6",
48
- "@nebula.js/conversion": "^5.7.0",
49
- "@nebula.js/enigma-mocker": "^5.7.0",
50
- "@nebula.js/locale": "^5.7.0",
51
- "@nebula.js/nucleus": "^5.7.0",
52
- "@nebula.js/supernova": "^5.7.0",
53
- "@nebula.js/theme": "^5.7.0",
54
- "@nebula.js/ui": "^5.7.0",
55
- "@qlik/api": "^1.14.0",
46
+ "@mui/icons-material": "^5.16.7",
47
+ "@mui/material": "^5.16.7",
48
+ "@nebula.js/conversion": "^5.8.0",
49
+ "@nebula.js/enigma-mocker": "^5.8.0",
50
+ "@nebula.js/locale": "^5.8.0",
51
+ "@nebula.js/nucleus": "^5.8.0",
52
+ "@nebula.js/supernova": "^5.8.0",
53
+ "@nebula.js/theme": "^5.8.0",
54
+ "@nebula.js/ui": "^5.8.0",
55
+ "@qlik/api": "^1.25.0",
56
56
  "@scriptappy/cli": "0.10.0",
57
57
  "@scriptappy/from-jsdoc": "0.19.0",
58
58
  "@scriptappy/to-dts": "1.0.0",
@@ -67,5 +67,5 @@
67
67
  "regenerator-runtime": "0.14.1",
68
68
  "semver": "7.6.3"
69
69
  },
70
- "gitHead": "65c649cbfd09488d59c835f78869672678b8266c"
70
+ "gitHead": "7bbcb057c2dadd606a2a5377a41ba5030381968c"
71
71
  }
package/types/index.d.ts CHANGED
@@ -41,6 +41,16 @@ export function useEffect(effect: stardust.EffectCallback, deps?: any[]): void;
41
41
  */
42
42
  export function useMemo<T>(factory: ()=>T, deps: any[]): T;
43
43
 
44
+ /**
45
+ * Creates a reference to a value not needed for rendering
46
+ *
47
+ * While Nebula does not have a virtual DOM, it is still useful
48
+ * to have a reference to an object that is retained across
49
+ * renders and in it self does not trigger a render.
50
+ * @param initialValue The initial value.
51
+ */
52
+ export function useRef<R>(initialValue: R): stardust.Ref<R>;
53
+
44
54
  /**
45
55
  * Runs a callback function when a dependent changes.
46
56
  *
@@ -464,14 +474,6 @@ declare namespace stardust {
464
474
 
465
475
  }
466
476
 
467
- interface Flags {
468
- /**
469
- * Checks whether the specified flag is enabled.
470
- * @param flag The value flag to check.
471
- */
472
- isEnabled(flag: string): boolean;
473
- }
474
-
475
477
  class AppSelections {
476
478
  constructor();
477
479
 
@@ -546,6 +548,14 @@ declare namespace stardust {
546
548
 
547
549
  }
548
550
 
551
+ interface Flags {
552
+ /**
553
+ * Checks whether the specified flag is enabled.
554
+ * @param flag The value flag to check.
555
+ */
556
+ isEnabled(flag: string): boolean;
557
+ }
558
+
549
559
  type Field = string | qix.NxDimension | qix.NxMeasure | stardust.LibraryField;
550
560
 
551
561
  /**
@@ -564,6 +574,15 @@ declare namespace stardust {
564
574
  interface RenderConfig {
565
575
  element: HTMLElement;
566
576
  options?: object;
577
+ /**
578
+ * Callback function called after rendering successfully
579
+ */
580
+ onRender?(): void;
581
+ /**
582
+ * Callback function called if an error occurs
583
+ * @param $
584
+ */
585
+ onError?($: stardust.RenderError): void;
567
586
  plugins?: stardust.Plugin[];
568
587
  id?: string;
569
588
  type?: string;
@@ -602,6 +621,13 @@ declare namespace stardust {
602
621
  meta?: object;
603
622
  }
604
623
 
624
+ class RenderError extends Error {
625
+ constructor(message: string, originalError: Error);
626
+
627
+ originalError: Error;
628
+
629
+ }
630
+
605
631
  class Navigation implements stardust.Emitter {
606
632
  constructor();
607
633
 
@@ -679,6 +705,13 @@ declare namespace stardust {
679
705
  */
680
706
  type EffectCallback = ()=>void | (()=>void);
681
707
 
708
+ /**
709
+ * Reference object returned from useRef
710
+ */
711
+ interface Ref<R> {
712
+ current: R;
713
+ }
714
+
682
715
  interface Rect {
683
716
  top: number;
684
717
  left: number;