@khanacademy/wonder-blocks-config 0.1.0 → 0.3.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/CHANGELOG.md +12 -0
- package/dist/es/index.js +2 -2
- package/dist/es/strings.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/strings.d.ts +10 -0
- package/dist/strings.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-config
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f7eef63: Adds the `breadcrumbs` and `tabs` strings to `WonderBlocksStrings`
|
|
8
|
+
|
|
9
|
+
## 0.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 2e7983b: Export `defaultStringsEn` from the package entry point
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useContext, useMemo } from 'react';
|
|
4
4
|
|
|
5
|
-
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message};
|
|
5
|
+
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"},breadcrumbs:{context:"Accessible name for the navigation landmark containing breadcrumb links.",message:"Breadcrumbs"},tabs:{context:"Label for the menu of tabs when no tab is selected, shown when the tabs are collapsed into a dropdown.",message:"Tabs"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message};
|
|
6
6
|
|
|
7
7
|
const WonderBlocksI18nContext=React.createContext({strings:defaultStringsEn,locale:"en"});WonderBlocksI18nContext.displayName="WonderBlocksI18nContext";function WonderBlocksI18nContextProvider({children,strings,locale}){const value=useMemo(()=>({strings,locale}),[strings,locale]);return jsx(WonderBlocksI18nContext.Provider,{value:value,children:children})}const useWonderBlocksI18n=()=>useContext(WonderBlocksI18nContext);
|
|
8
8
|
|
|
9
9
|
function WonderBlocksConfigProvider({children,i18n}){const{strings,locale}=i18n;return jsx(WonderBlocksI18nContextProvider,{strings:strings,locale:locale,children:children})}
|
|
10
10
|
|
|
11
|
-
export { WonderBlocksConfigProvider, useWonderBlocksI18n };
|
|
11
|
+
export { WonderBlocksConfigProvider, defaultStringsEn, useWonderBlocksI18n };
|
package/dist/es/strings.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message};
|
|
1
|
+
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"},breadcrumbs:{context:"Accessible name for the navigation landmark containing breadcrumb links.",message:"Breadcrumbs"},tabs:{context:"Label for the menu of tabs when no tab is selected, shown when the tabs are collapsed into a dropdown.",message:"Tabs"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message};
|
|
2
2
|
|
|
3
3
|
export { defaultStringsEn, strings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { WonderBlocksConfigProvider } from "./components/wonder-blocks-config-provider";
|
|
2
2
|
export { useWonderBlocksI18n } from "./context/i18n-context";
|
|
3
3
|
export type { I18nConfig } from "./context/i18n-context";
|
|
4
|
+
export { defaultStringsEn } from "./strings";
|
|
4
5
|
export type { WonderBlocksStrings } from "./strings";
|
package/dist/index.js
CHANGED
|
@@ -25,11 +25,12 @@ function _interopNamespace(e) {
|
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
27
|
|
|
28
|
-
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message};
|
|
28
|
+
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"},breadcrumbs:{context:"Accessible name for the navigation landmark containing breadcrumb links.",message:"Breadcrumbs"},tabs:{context:"Label for the menu of tabs when no tab is selected, shown when the tabs are collapsed into a dropdown.",message:"Tabs"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message};
|
|
29
29
|
|
|
30
30
|
const WonderBlocksI18nContext=React__namespace.createContext({strings:defaultStringsEn,locale:"en"});WonderBlocksI18nContext.displayName="WonderBlocksI18nContext";function WonderBlocksI18nContextProvider({children,strings,locale}){const value=React.useMemo(()=>({strings,locale}),[strings,locale]);return jsxRuntime.jsx(WonderBlocksI18nContext.Provider,{value:value,children:children})}const useWonderBlocksI18n=()=>React.useContext(WonderBlocksI18nContext);
|
|
31
31
|
|
|
32
32
|
function WonderBlocksConfigProvider({children,i18n}){const{strings,locale}=i18n;return jsxRuntime.jsx(WonderBlocksI18nContextProvider,{strings:strings,locale:locale,children:children})}
|
|
33
33
|
|
|
34
34
|
exports.WonderBlocksConfigProvider = WonderBlocksConfigProvider;
|
|
35
|
+
exports.defaultStringsEn = defaultStringsEn;
|
|
35
36
|
exports.useWonderBlocksI18n = useWonderBlocksI18n;
|
package/dist/strings.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type WonderBlocksStrings = {
|
|
5
5
|
iconAltOpensNewTab: string;
|
|
6
|
+
breadcrumbs: string;
|
|
7
|
+
tabs: string;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* Untranslated strings used in Wonder Blocks. To be used by an external
|
|
@@ -15,6 +17,14 @@ export declare const strings: {
|
|
|
15
17
|
context: string;
|
|
16
18
|
message: string;
|
|
17
19
|
};
|
|
20
|
+
breadcrumbs: {
|
|
21
|
+
context: string;
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
tabs: {
|
|
25
|
+
context: string;
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
18
28
|
};
|
|
19
29
|
/**
|
|
20
30
|
* Default 'en' strings to use.
|
package/dist/strings.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message};
|
|
5
|
+
const strings={iconAltOpensNewTab:{context:"Accessible name for an icon marking a link that opens in a new tab.",message:"(opens in a new tab)"},breadcrumbs:{context:"Accessible name for the navigation landmark containing breadcrumb links.",message:"Breadcrumbs"},tabs:{context:"Label for the menu of tabs when no tab is selected, shown when the tabs are collapsed into a dropdown.",message:"Tabs"}};const defaultStringsEn={iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message};
|
|
6
6
|
|
|
7
7
|
exports.defaultStringsEn = defaultStringsEn;
|
|
8
8
|
exports.strings = strings;
|