@jetshop/core 5.14.1 → 5.15.0-alpha.705c3635

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.
@@ -10,7 +10,7 @@ export interface ChannelContextValues {
10
10
  updateChannel(newChannel: SelectedChannel): void;
11
11
  restoreCultureForPreview: () => void;
12
12
  setCultureForPreview: (culture: string) => void;
13
- selectedChannel?: SelectedChannel;
13
+ selectedChannel: SelectedChannel;
14
14
  basename?: string;
15
15
  channelsById?: {
16
16
  [key: string]: Channel;
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelContext.js","sourceRoot":"","sources":["ChannelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAoBtC,MAAM,cAAc,GAAG,aAAa,CAClC,SAAS,CACV,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ChannelContext.js","sourceRoot":"","sources":["ChannelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAqBtC,MAAM,cAAc,GAAG,aAAa,CAClC,SAAS,CACV,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function useChannels(): import("../components/ChannelContext/ChannelContext").ChannelContextValues;
@@ -0,0 +1,10 @@
1
+ import { useContext } from 'react';
2
+ import ChannelContext from '../components/ChannelContext';
3
+ export function useChannels() {
4
+ const context = useContext(ChannelContext);
5
+ if (context === undefined) {
6
+ throw new Error('useChannels must be used within a ChannelProvider');
7
+ }
8
+ return context;
9
+ }
10
+ //# sourceMappingURL=useChannels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChannels.js","sourceRoot":"","sources":["useChannels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,MAAM,UAAU,WAAW;IACzB,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetshop/core",
3
- "version": "5.14.1",
3
+ "version": "5.15.0-alpha.705c3635",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -13,6 +13,7 @@
13
13
  "scripts"
14
14
  ],
15
15
  "main": "index.js",
16
+ "type": "module",
16
17
  "scripts": {
17
18
  "build": "yarn gen-types && tsc --noEmit false",
18
19
  "build-dev": "rm -rf build && tsc --noEmit false --outDir build --module commonjs --target es2017",