@websolutespa/bom-mixer-hooks 1.9.3 → 1.9.4

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @websolutespa/bom-mixer-hooks
2
2
 
3
+ ## 1.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Added: IApp global
8
+ - Updated dependencies
9
+ - @websolutespa/bom-mixer-models@1.10.3
10
+ - @websolutespa/bom-mixer-store@1.10.1
11
+ - @websolutespa/bom-core@1.8.24
12
+
3
13
  ## 1.9.3
4
14
 
5
15
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import react__default, { RefObject, Dispatch, SetStateAction, CSSProperties, MutableRefObject, ComponentProps, useEffect } from 'react';
3
3
  import { ApiRequestOptions } from '@websolutespa/bom-mixer-store';
4
4
  import * as _websolutespa_bom_core from '@websolutespa/bom-core';
5
- import { QueryParams, IEquatable, IFeatureType, ILabel, ILocalizable, ILayout, ILocalized, IPage } from '@websolutespa/bom-core';
5
+ import { QueryParams, IEquatable, IFeatureType, ILabel, ILocalizable, ILayout, IAppExtended, ILocalized, IPage } from '@websolutespa/bom-core';
6
6
  import * as zustand from 'zustand';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
  import { ILazyModules, IMetaData, StructuredDataType, OpenGraphType, TwitterCardType } from '@websolutespa/bom-mixer-models';
@@ -392,11 +392,12 @@ declare function parseLabel(dictionary: Record<string, ILocalizable | undefined>
392
392
  declare function parseParams(label: string, params: Record<string, any>): string;
393
393
 
394
394
  type ILayoutContext = ILayout;
395
- declare const useLayout: () => ILayout;
396
395
  declare function LayoutProvider({ children, layout }: {
397
396
  children?: react__default.ReactNode;
398
397
  layout: ILayout;
399
398
  }): react_jsx_runtime.JSX.Element;
399
+ type UseLayout = <T extends IAppExtended = IAppExtended>() => ILayout<T>;
400
+ declare const useLayout: UseLayout;
400
401
 
401
402
  type ILazyModulesContext = ILazyModules;
402
403
  declare const useLazyModules: () => ILazyModules;
package/dist/index.js CHANGED
@@ -248,10 +248,11 @@ var createGenericContext = (defaultContext = null) => {
248
248
 
249
249
  // src/useLayout/useLayout.tsx
250
250
  var import_jsx_runtime = require("react/jsx-runtime");
251
- var [useLayout, LayoutContextProvider] = createGenericContext();
251
+ var [useLayout_, LayoutContextProvider] = createGenericContext();
252
252
  function LayoutProvider({ children, layout }) {
253
253
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LayoutContextProvider, { value: layout, children });
254
254
  }
255
+ var useLayout = useLayout_;
255
256
 
256
257
  // src/useApi/useApi.ts
257
258
  function useApiFetch(pathname, options = {}) {
package/dist/index.mjs CHANGED
@@ -93,10 +93,11 @@ var createGenericContext = (defaultContext = null) => {
93
93
 
94
94
  // src/useLayout/useLayout.tsx
95
95
  import { jsx } from "react/jsx-runtime";
96
- var [useLayout, LayoutContextProvider] = createGenericContext();
96
+ var [useLayout_, LayoutContextProvider] = createGenericContext();
97
97
  function LayoutProvider({ children, layout }) {
98
98
  return /* @__PURE__ */ jsx(LayoutContextProvider, { value: layout, children });
99
99
  }
100
+ var useLayout = useLayout_;
100
101
 
101
102
  // src/useApi/useApi.ts
102
103
  function useApiFetch(pathname, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-hooks",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Mixer Hooks module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -1,10 +1,10 @@
1
- import { ILayout } from '@websolutespa/bom-core';
1
+ import { IAppExtended, ILayout } from '@websolutespa/bom-core';
2
2
  import React from 'react';
3
3
  import { createGenericContext } from '../useGenericContext/useGenericContext';
4
4
 
5
5
  export type ILayoutContext = ILayout;
6
6
 
7
- const [useLayout, LayoutContextProvider] = createGenericContext<ILayoutContext>();
7
+ const [useLayout_, LayoutContextProvider] = createGenericContext<ILayoutContext>();
8
8
 
9
9
  function LayoutProvider({ children, layout }: { children?: React.ReactNode, layout: ILayout }) {
10
10
  // console.log('LayoutProvider.context', context);
@@ -15,5 +15,12 @@ function LayoutProvider({ children, layout }: { children?: React.ReactNode, layo
15
15
  );
16
16
  }
17
17
 
18
- export { LayoutProvider, useLayout };
18
+ type UseLayout = <T extends IAppExtended = IAppExtended>() => ILayout<T>;
19
+
20
+ const useLayout:UseLayout = useLayout_ as UseLayout;
21
+
22
+ export {
23
+ LayoutProvider,
24
+ useLayout
25
+ };
19
26