@nebula.js/stardust 5.8.0 → 5.8.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v5.8.0
2
+ * @nebula.js/stardust v5.8.1
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -15657,7 +15657,7 @@
15657
15657
  return cache[key];
15658
15658
  }
15659
15659
 
15660
- const NEBULA_VERSION_HASH = "18d6";
15660
+ const NEBULA_VERSION_HASH = "c2a3";
15661
15661
  ClassNameGenerator.configure(componentName => {
15662
15662
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
15663
15663
  });
@@ -15889,7 +15889,7 @@
15889
15889
  const appRef = React.createRef();
15890
15890
  const element = document.createElement('div');
15891
15891
  element.style.display = 'none';
15892
- element.setAttribute('data-nebulajs-version', "5.8.0");
15892
+ element.setAttribute('data-nebulajs-version', "5.8.1");
15893
15893
  element.setAttribute('data-app-id', app.id);
15894
15894
  document.body.appendChild(element);
15895
15895
  if (context) {
@@ -38119,6 +38119,42 @@
38119
38119
  return h.value[1];
38120
38120
  }
38121
38121
 
38122
+ /**
38123
+ * Reference object returned from useRef
38124
+ * @interface Ref
38125
+ * @template R
38126
+ * @property {R} current Current value
38127
+ */
38128
+
38129
+ /**
38130
+ * Creates a reference to a value not needed for rendering
38131
+ *
38132
+ * While Nebula does not have a virtual DOM, it is still useful
38133
+ * to have a reference to an object that is retained across
38134
+ * renders and in it self does not trigger a render.
38135
+ * @entry
38136
+ * @template R
38137
+ * @param {R} initialValue - The initial value.
38138
+ * @returns {Ref<R>} An object with the current value
38139
+ * @example
38140
+ * import { useRef } from '@nebula.js/stardust';
38141
+ * // ...
38142
+ * // initiate with simple value
38143
+ * const timesRendered = useRef(0);
38144
+ *
38145
+ * useEffect(() => {
38146
+ * render(layout);
38147
+ * // increments the render counter, a useState would trigger another render
38148
+ * timesRendered.current += 1;
38149
+ * },[layout]);
38150
+ *
38151
+ */
38152
+ function useRef(initialValue) {
38153
+ return useMemo(() => ({
38154
+ current: initialValue
38155
+ }), []);
38156
+ }
38157
+
38122
38158
  /**
38123
38159
  * Runs a callback function when a dependent changes.
38124
38160
  *
@@ -43276,6 +43312,7 @@
43276
43312
  exports.usePlugins = usePlugins;
43277
43313
  exports.usePromise = usePromise;
43278
43314
  exports.useRect = useRect;
43315
+ exports.useRef = useRef;
43279
43316
  exports.useRenderState = useRenderState;
43280
43317
  exports.useSelections = useSelections;
43281
43318
  exports.useStaleLayout = useStaleLayout;