@khanacademy/wonder-blocks-config 0.3.0 → 0.4.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 +8 -0
- package/dist/es/index.js +1 -1
- package/dist/es/strings.js +1 -1
- package/dist/index.js +1 -1
- package/dist/strings.d.ts +15 -0
- package/dist/strings.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-config
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9ec3189: Adds the `requiredFieldMessage` string to `WonderBlocksStrings`
|
|
8
|
+
- f070142: Adds the `iconAltErrorMessagePrefix` string to `WonderBlocksStrings`
|
|
9
|
+
- 355f6e1: Adds the `iconAltClearSearch` string to `WonderBlocksStrings`
|
|
10
|
+
|
|
3
11
|
## 0.3.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ 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)"},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};
|
|
5
|
+
const strings={iconAltClearSearch:{context:"Accessible name for an icon button that clears the text in a search field.",message:"Clear search"},iconAltErrorMessagePrefix:{context:"Accessible name for an error icon shown before the error message for a form field. Screen readers read it as a prefix to the error message (e.g. 'Error: This field is required.'), so use the punctuation that normally separates a label from the text that follows in this language.",message:"Error:"},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"},requiredFieldMessage:{context:"Error message shown when a required form field is left empty.",message:"This field is required."}};const defaultStringsEn={iconAltClearSearch:strings.iconAltClearSearch.message,iconAltErrorMessagePrefix:strings.iconAltErrorMessagePrefix.message,iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message,requiredFieldMessage:strings.requiredFieldMessage.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
|
|
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)"},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};
|
|
1
|
+
const strings={iconAltClearSearch:{context:"Accessible name for an icon button that clears the text in a search field.",message:"Clear search"},iconAltErrorMessagePrefix:{context:"Accessible name for an error icon shown before the error message for a form field. Screen readers read it as a prefix to the error message (e.g. 'Error: This field is required.'), so use the punctuation that normally separates a label from the text that follows in this language.",message:"Error:"},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"},requiredFieldMessage:{context:"Error message shown when a required form field is left empty.",message:"This field is required."}};const defaultStringsEn={iconAltClearSearch:strings.iconAltClearSearch.message,iconAltErrorMessagePrefix:strings.iconAltErrorMessagePrefix.message,iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message,requiredFieldMessage:strings.requiredFieldMessage.message};
|
|
2
2
|
|
|
3
3
|
export { defaultStringsEn, strings };
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ 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)"},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};
|
|
28
|
+
const strings={iconAltClearSearch:{context:"Accessible name for an icon button that clears the text in a search field.",message:"Clear search"},iconAltErrorMessagePrefix:{context:"Accessible name for an error icon shown before the error message for a form field. Screen readers read it as a prefix to the error message (e.g. 'Error: This field is required.'), so use the punctuation that normally separates a label from the text that follows in this language.",message:"Error:"},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"},requiredFieldMessage:{context:"Error message shown when a required form field is left empty.",message:"This field is required."}};const defaultStringsEn={iconAltClearSearch:strings.iconAltClearSearch.message,iconAltErrorMessagePrefix:strings.iconAltErrorMessagePrefix.message,iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message,requiredFieldMessage:strings.requiredFieldMessage.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
|
|
package/dist/strings.d.ts
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
* The translated strings that are used to render Wonder Blocks.
|
|
3
3
|
*/
|
|
4
4
|
export type WonderBlocksStrings = {
|
|
5
|
+
iconAltClearSearch: string;
|
|
6
|
+
iconAltErrorMessagePrefix: string;
|
|
5
7
|
iconAltOpensNewTab: string;
|
|
6
8
|
breadcrumbs: string;
|
|
7
9
|
tabs: string;
|
|
10
|
+
requiredFieldMessage: string;
|
|
8
11
|
};
|
|
9
12
|
/**
|
|
10
13
|
* Untranslated strings used in Wonder Blocks. To be used by an external
|
|
@@ -13,6 +16,14 @@ export type WonderBlocksStrings = {
|
|
|
13
16
|
* !! Note: Ensure that all escape sequences are double-escaped. (e.g. `\\text` -> `\\\\text`)
|
|
14
17
|
*/
|
|
15
18
|
export declare const strings: {
|
|
19
|
+
iconAltClearSearch: {
|
|
20
|
+
context: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
iconAltErrorMessagePrefix: {
|
|
24
|
+
context: string;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
16
27
|
iconAltOpensNewTab: {
|
|
17
28
|
context: string;
|
|
18
29
|
message: string;
|
|
@@ -25,6 +36,10 @@ export declare const strings: {
|
|
|
25
36
|
context: string;
|
|
26
37
|
message: string;
|
|
27
38
|
};
|
|
39
|
+
requiredFieldMessage: {
|
|
40
|
+
context: string;
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
28
43
|
};
|
|
29
44
|
/**
|
|
30
45
|
* 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)"},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};
|
|
5
|
+
const strings={iconAltClearSearch:{context:"Accessible name for an icon button that clears the text in a search field.",message:"Clear search"},iconAltErrorMessagePrefix:{context:"Accessible name for an error icon shown before the error message for a form field. Screen readers read it as a prefix to the error message (e.g. 'Error: This field is required.'), so use the punctuation that normally separates a label from the text that follows in this language.",message:"Error:"},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"},requiredFieldMessage:{context:"Error message shown when a required form field is left empty.",message:"This field is required."}};const defaultStringsEn={iconAltClearSearch:strings.iconAltClearSearch.message,iconAltErrorMessagePrefix:strings.iconAltErrorMessagePrefix.message,iconAltOpensNewTab:strings.iconAltOpensNewTab.message,breadcrumbs:strings.breadcrumbs.message,tabs:strings.tabs.message,requiredFieldMessage:strings.requiredFieldMessage.message};
|
|
6
6
|
|
|
7
7
|
exports.defaultStringsEn = defaultStringsEn;
|
|
8
8
|
exports.strings = strings;
|