carbon-react 118.2.1 → 118.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/esm/components/button-minor/button-minor.component.d.ts +5 -1
- package/esm/components/button-minor/button-minor.component.js +4 -1
- package/esm/components/button-minor/button-minor.style.d.ts +2 -1
- package/esm/components/button-minor/button-minor.style.js +17 -0
- package/esm/components/button-minor/index.d.ts +1 -1
- package/esm/components/i18n-provider/i18n-provider.component.js +4 -0
- package/esm/components/password/index.d.ts +2 -0
- package/esm/components/password/index.js +1 -0
- package/esm/components/password/password.component.d.ts +9 -0
- package/esm/components/password/password.component.js +580 -0
- package/esm/components/password/password.style.d.ts +5 -0
- package/esm/components/password/password.style.js +8 -0
- package/esm/components/text-editor/__internal__/decorators/index.d.ts +2 -2
- package/esm/components/text-editor/__internal__/decorators/link-decorator.d.ts +7 -6
- package/esm/components/text-editor/__internal__/editor-counter/editor-counter.component.d.ts +15 -0
- package/esm/components/text-editor/__internal__/editor-counter/editor-counter.component.js +5 -15
- package/esm/components/text-editor/__internal__/editor-counter/editor-counter.style.d.ts +5 -0
- package/esm/components/text-editor/__internal__/editor-counter/index.d.ts +2 -2
- package/esm/components/text-editor/__internal__/editor-link/editor-link.component.d.ts +9 -0
- package/esm/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +3 -0
- package/esm/components/text-editor/__internal__/editor-link/index.d.ts +2 -2
- package/esm/components/text-editor/__internal__/label-wrapper/index.d.ts +2 -2
- package/esm/components/text-editor/__internal__/label-wrapper/label-wrapper.component.d.ts +12 -0
- package/esm/components/text-editor/__internal__/label-wrapper/label-wrapper.component.js +4 -3
- package/esm/components/text-editor/__internal__/toolbar/index.d.ts +2 -2
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/index.d.ts +2 -2
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.d.ts +25 -0
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +12 -23
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.d.ts +6 -0
- package/esm/components/text-editor/__internal__/toolbar/toolbar.component.d.ts +16 -0
- package/esm/components/text-editor/__internal__/toolbar/toolbar.component.js +40 -36
- package/esm/components/text-editor/__internal__/toolbar/toolbar.style.d.ts +4 -0
- package/esm/components/text-editor/__internal__/utils/index.d.ts +1 -1
- package/esm/components/text-editor/__internal__/utils/utils.d.ts +27 -26
- package/esm/components/text-editor/__internal__/utils/utils.js +9 -10
- package/esm/components/text-editor/index.d.ts +2 -2
- package/esm/components/text-editor/text-editor.component.d.ts +36 -7
- package/esm/components/text-editor/text-editor.component.js +230 -87
- package/esm/components/text-editor/text-editor.style.d.ts +11 -3
- package/esm/components/text-editor/text-editor.style.js +1 -2
- package/esm/components/text-editor/types.d.ts +6 -0
- package/esm/components/text-editor/types.js +4 -0
- package/esm/components/textbox/textbox.component.js +1 -1
- package/esm/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.js +1 -1
- package/esm/locales/en-gb.js +4 -0
- package/esm/locales/locale.d.ts +4 -0
- package/esm/locales/pl-pl.js +4 -0
- package/lib/components/button-minor/button-minor.component.d.ts +5 -1
- package/lib/components/button-minor/button-minor.component.js +4 -1
- package/lib/components/button-minor/button-minor.style.d.ts +2 -1
- package/lib/components/button-minor/button-minor.style.js +17 -0
- package/lib/components/button-minor/index.d.ts +1 -1
- package/lib/components/i18n-provider/i18n-provider.component.js +4 -0
- package/lib/components/password/index.d.ts +2 -0
- package/lib/components/password/index.js +15 -0
- package/lib/components/password/package.json +6 -0
- package/lib/components/password/password.component.d.ts +9 -0
- package/lib/components/password/password.component.js +600 -0
- package/lib/components/password/password.style.d.ts +5 -0
- package/lib/components/password/password.style.js +21 -0
- package/lib/components/text-editor/__internal__/decorators/index.d.ts +2 -2
- package/lib/components/text-editor/__internal__/decorators/link-decorator.d.ts +7 -6
- package/lib/components/text-editor/__internal__/editor-counter/editor-counter.component.d.ts +15 -0
- package/lib/components/text-editor/__internal__/editor-counter/editor-counter.component.js +5 -15
- package/lib/components/text-editor/__internal__/editor-counter/editor-counter.style.d.ts +5 -0
- package/lib/components/text-editor/__internal__/editor-counter/index.d.ts +2 -2
- package/lib/components/text-editor/__internal__/editor-link/editor-link.component.d.ts +9 -0
- package/lib/components/text-editor/__internal__/editor-link/editor-link.component.js +3 -4
- package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +3 -0
- package/lib/components/text-editor/__internal__/editor-link/index.d.ts +2 -2
- package/lib/components/text-editor/__internal__/label-wrapper/index.d.ts +2 -2
- package/lib/components/text-editor/__internal__/label-wrapper/label-wrapper.component.d.ts +12 -0
- package/lib/components/text-editor/__internal__/label-wrapper/label-wrapper.component.js +2 -8
- package/lib/components/text-editor/__internal__/toolbar/index.d.ts +2 -2
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/index.d.ts +2 -2
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.d.ts +25 -0
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +13 -24
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.d.ts +6 -0
- package/lib/components/text-editor/__internal__/toolbar/toolbar.component.d.ts +16 -0
- package/lib/components/text-editor/__internal__/toolbar/toolbar.component.js +50 -46
- package/lib/components/text-editor/__internal__/toolbar/toolbar.style.d.ts +4 -0
- package/lib/components/text-editor/__internal__/utils/index.d.ts +1 -1
- package/lib/components/text-editor/__internal__/utils/utils.d.ts +27 -26
- package/lib/components/text-editor/__internal__/utils/utils.js +10 -11
- package/lib/components/text-editor/index.d.ts +2 -2
- package/lib/components/text-editor/text-editor.component.d.ts +36 -7
- package/lib/components/text-editor/text-editor.component.js +231 -88
- package/lib/components/text-editor/text-editor.style.d.ts +11 -3
- package/lib/components/text-editor/text-editor.style.js +1 -2
- package/lib/components/text-editor/types.d.ts +6 -0
- package/lib/components/text-editor/types.js +14 -0
- package/lib/components/textbox/textbox.component.js +1 -1
- package/lib/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.js +1 -1
- package/lib/hooks/__internal__/useUniqueId/package.json +6 -0
- package/lib/locales/en-gb.js +4 -0
- package/lib/locales/locale.d.ts +4 -0
- package/lib/locales/pl-pl.js +4 -0
- package/package.json +4 -4
- package/esm/__internal__/DeprecationWarning.js +0 -20
- package/esm/__internal__/utils/storybook/partial-action.d.ts +0 -3
- package/esm/__internal__/utils/storybook/partial-action.js +0 -13
- package/esm/components/text-editor/__internal__/editor-counter/editor-counter.d.ts +0 -11
- package/esm/components/text-editor/__internal__/editor-link/editor-link.d.ts +0 -11
- package/esm/components/text-editor/__internal__/label-wrapper/label-wrapper.d.ts +0 -10
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.d.ts +0 -20
- package/esm/components/text-editor/__internal__/toolbar/toolbar.d.ts +0 -13
- package/esm/components/text-editor/text-editor.d.ts +0 -40
- package/lib/__internal__/DeprecationWarning.js +0 -31
- package/lib/__internal__/utils/helpers/useUniqueId/package.json +0 -6
- package/lib/__internal__/utils/storybook/partial-action.d.ts +0 -3
- package/lib/__internal__/utils/storybook/partial-action.js +0 -21
- package/lib/components/text-editor/__internal__/editor-counter/editor-counter.d.ts +0 -11
- package/lib/components/text-editor/__internal__/editor-link/editor-link.d.ts +0 -11
- package/lib/components/text-editor/__internal__/label-wrapper/label-wrapper.d.ts +0 -10
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.d.ts +0 -20
- package/lib/components/text-editor/__internal__/toolbar/toolbar.d.ts +0 -13
- package/lib/components/text-editor/text-editor.d.ts +0 -40
- /package/esm/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.d.ts +0 -0
- /package/lib/{__internal__/utils/helpers → hooks/__internal__}/useUniqueId/index.d.ts +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./text-editor";
|
|
2
|
-
export
|
|
1
|
+
export { default, TextEditorState as EditorState, TextEditorContentState as ContentState, } from "./text-editor.component";
|
|
2
|
+
export type { TextEditorProps } from "./text-editor.component";
|
|
@@ -1,8 +1,37 @@
|
|
|
1
|
-
export const EditorContext: React.Context<{}>;
|
|
2
|
-
export const TextEditorState: typeof EditorState;
|
|
3
|
-
export const TextEditorContentState: typeof ContentState;
|
|
4
|
-
export default TextEditor;
|
|
5
1
|
import React from "react";
|
|
6
|
-
import {
|
|
7
|
-
import { ContentState } from "draft-js";
|
|
8
|
-
declare const
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { ContentState, EditorState, Editor } from "draft-js";
|
|
4
|
+
export declare const EditorContext: React.Context<{
|
|
5
|
+
onLinkAdded?: ((url: string) => void) | undefined;
|
|
6
|
+
editMode?: boolean | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
export interface TextEditorProps extends MarginProps {
|
|
9
|
+
/** The maximum characters that the input will accept */
|
|
10
|
+
characterLimit?: number;
|
|
11
|
+
/** The text for the editor's label */
|
|
12
|
+
labelText: string;
|
|
13
|
+
/** onChange callback to control value updates */
|
|
14
|
+
onChange: (event: EditorState) => void;
|
|
15
|
+
/** Additional elements to be rendered in the Editor Toolbar, e.g. Save and Cancel Button */
|
|
16
|
+
toolbarElements?: React.ReactNode;
|
|
17
|
+
/** The value of the input, this is an EditorState immutable object */
|
|
18
|
+
value: EditorState;
|
|
19
|
+
/** Flag to configure component as mandatory */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Message to be displayed when there is an error */
|
|
22
|
+
error?: string;
|
|
23
|
+
/** Message to be displayed when there is a warning */
|
|
24
|
+
warning?: string;
|
|
25
|
+
/** Message to be displayed when there is an info */
|
|
26
|
+
info?: string;
|
|
27
|
+
/** Number greater than 2 multiplied by line-height (21px) to override the default min-height of the editor */
|
|
28
|
+
rows?: number;
|
|
29
|
+
/** The previews to display of any links added to the Editor */
|
|
30
|
+
previews?: React.ReactNode;
|
|
31
|
+
/** Callback to report a url when a link is added */
|
|
32
|
+
onLinkAdded?: (url: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const TextEditor: React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<Editor>>;
|
|
35
|
+
export declare const TextEditorState: typeof EditorState;
|
|
36
|
+
export declare const TextEditorContentState: typeof ContentState;
|
|
37
|
+
export default TextEditor;
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.TextEditorContentState = exports.TextEditorState = exports.EditorContext = void 0;
|
|
6
|
+
exports.default = exports.TextEditorContentState = exports.TextEditorState = exports.TextEditor = exports.EditorContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _propTypes2 = _interopRequireDefault(require("@styled-system/prop-types"));
|
|
13
|
-
|
|
14
12
|
var _draftJs = require("draft-js");
|
|
15
13
|
|
|
16
14
|
var _utils = require("./__internal__/utils");
|
|
@@ -29,7 +27,7 @@ var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/gui
|
|
|
29
27
|
|
|
30
28
|
var _labelWrapper = _interopRequireDefault(require("./__internal__/label-wrapper"));
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _types = require("./types");
|
|
33
31
|
|
|
34
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
33
|
|
|
@@ -37,10 +35,8 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
37
35
|
|
|
38
36
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
37
|
|
|
40
|
-
const marginPropTypes = (0, _utils2.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
41
38
|
const NUMBERS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
42
|
-
const INLINE_STYLES = [
|
|
43
|
-
const BLOCK_TYPES = ["unordered-list-item", "ordered-list-item"];
|
|
39
|
+
const INLINE_STYLES = [_types.BOLD, _types.ITALIC];
|
|
44
40
|
|
|
45
41
|
const EditorContext = /*#__PURE__*/_react.default.createContext({});
|
|
46
42
|
|
|
@@ -65,13 +61,18 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
65
61
|
const [inlines, setInlines] = (0, _react.useState)([]);
|
|
66
62
|
const [activeInlines, setActiveInlines] = (0, _react.useState)({});
|
|
67
63
|
const [focusToolbar, setFocusToolbar] = (0, _react.useState)(false);
|
|
68
|
-
const editorRef = (0, _react.useRef)();
|
|
64
|
+
const editorRef = (0, _react.useRef)(null);
|
|
69
65
|
const editor = ref || editorRef;
|
|
70
66
|
const contentLength = (0, _utils.getContent)(value).getPlainText("").length;
|
|
71
67
|
const moveCursor = (0, _react.useRef)(contentLength > 0);
|
|
72
68
|
const lastKeyPressed = (0, _react.useRef)();
|
|
73
69
|
const labelId = (0, _react.useRef)(`text-editor-label-${(0, _guid.default)()}`);
|
|
74
70
|
|
|
71
|
+
if (rows && (typeof rows !== "number" || rows < 2)) {
|
|
72
|
+
// eslint-disable-next-line no-console
|
|
73
|
+
console.warn(`Prop rows must be a number value that is 2 or greater to override the min-height of the \`${TextEditor.displayName}\``);
|
|
74
|
+
}
|
|
75
|
+
|
|
75
76
|
const keyBindingFn = ev => {
|
|
76
77
|
if (_events.default.isTabKey(ev) && !_events.default.isShiftKey(ev)) {
|
|
77
78
|
setFocusToolbar(true);
|
|
@@ -80,6 +81,8 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
80
81
|
return (0, _draftJs.getDefaultKeyBinding)(ev);
|
|
81
82
|
};
|
|
82
83
|
|
|
84
|
+
const BLOCK_TYPES = ["unordered-list-item", "ordered-list-item"];
|
|
85
|
+
|
|
83
86
|
const handleKeyCommand = command => {
|
|
84
87
|
// bail out if the enter is pressed and limit has been reached
|
|
85
88
|
if (command.includes("split-block") && contentLength === characterLimit) {
|
|
@@ -89,27 +92,32 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
89
92
|
|
|
90
93
|
if (command.includes("backspace") || command.includes("split-block")) {
|
|
91
94
|
const {
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
blockLength,
|
|
96
|
+
blockType
|
|
94
97
|
} = (0, _utils.getContentInfo)(value); // if a block control is active and there is no text, deactivate it and reset the block
|
|
95
98
|
|
|
96
99
|
if (BLOCK_TYPES.includes(blockType) && !blockLength) {
|
|
97
100
|
onChange((0, _utils.resetBlockType)(value, "unstyled"));
|
|
98
|
-
return
|
|
101
|
+
return "handled";
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
const style = command.toUpperCase(); // if formatting shortcut used eg. command is "bold" or "italic"
|
|
103
106
|
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
if (style === _types.BOLD || style === _types.ITALIC) {
|
|
108
|
+
const update = _draftJs.RichUtils.handleKeyCommand(value, command); // istanbul ignore else
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
if (update) {
|
|
112
|
+
onChange(update);
|
|
113
|
+
setActiveInlines({ ...activeInlines,
|
|
114
|
+
[style]: !(0, _utils.hasInlineStyle)(value, style)
|
|
115
|
+
});
|
|
116
|
+
return "handled";
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
|
|
112
|
-
return
|
|
120
|
+
return "not-handled";
|
|
113
121
|
};
|
|
114
122
|
|
|
115
123
|
const handleBeforeInput = (str, newState) => {
|
|
@@ -123,19 +131,19 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
123
131
|
|
|
124
132
|
if (lastKeyPressed.current === " " && !(0, _utils.isASCIIChar)(str)) {
|
|
125
133
|
lastKeyPressed.current = null;
|
|
126
|
-
onChange((0, _utils.replaceText)(newState, " ", newState.getCurrentInlineStyle()
|
|
134
|
+
onChange((0, _utils.replaceText)(newState, " ", newState.getCurrentInlineStyle()));
|
|
127
135
|
return "handled";
|
|
128
136
|
}
|
|
129
137
|
|
|
130
138
|
if (str === " ") {
|
|
131
139
|
lastKeyPressed.current = str;
|
|
132
|
-
return
|
|
140
|
+
return "not-handled";
|
|
133
141
|
}
|
|
134
142
|
|
|
135
143
|
lastKeyPressed.current = null; // short circuit if str does not match expected chars
|
|
136
144
|
|
|
137
145
|
if (![".", "*"].includes(str)) {
|
|
138
|
-
return
|
|
146
|
+
return "not-handled";
|
|
139
147
|
}
|
|
140
148
|
|
|
141
149
|
const {
|
|
@@ -146,21 +154,21 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
146
154
|
|
|
147
155
|
if (blockLength === 1 && NUMBERS.includes(blockText) && str === "." || blockLength === 0 && str === "*") {
|
|
148
156
|
const newBlockType = (0, _utils.computeBlockType)(str, blockType);
|
|
149
|
-
const hasNumberList = (0, _utils.hasBlockStyle)(value,
|
|
150
|
-
const hasBulletList = (0, _utils.hasBlockStyle)(value,
|
|
157
|
+
const hasNumberList = (0, _utils.hasBlockStyle)(value, _types.ORDERED_LIST);
|
|
158
|
+
const hasBulletList = (0, _utils.hasBlockStyle)(value, _types.UNORDERED_LIST);
|
|
151
159
|
|
|
152
160
|
if (BLOCK_TYPES.includes(newBlockType) && !hasNumberList && !hasBulletList) {
|
|
153
161
|
onChange((0, _utils.resetBlockType)(value, newBlockType));
|
|
154
162
|
setActiveInlines({
|
|
155
|
-
BOLD: (0, _utils.hasInlineStyle)(value,
|
|
156
|
-
ITALIC: (0, _utils.hasInlineStyle)(value,
|
|
163
|
+
BOLD: (0, _utils.hasInlineStyle)(value, _types.BOLD),
|
|
164
|
+
ITALIC: (0, _utils.hasInlineStyle)(value, _types.ITALIC)
|
|
157
165
|
});
|
|
158
|
-
return
|
|
166
|
+
return "handled";
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
|
|
162
170
|
onChange(value);
|
|
163
|
-
return
|
|
171
|
+
return "not-handled";
|
|
164
172
|
};
|
|
165
173
|
|
|
166
174
|
const handlePastedText = pastedText => {
|
|
@@ -193,17 +201,19 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
193
201
|
|
|
194
202
|
const editorState = getEditorState();
|
|
195
203
|
const activeControls = {
|
|
196
|
-
BOLD: activeInlines.BOLD !== undefined ? activeInlines.BOLD : (0, _utils.hasInlineStyle)(editorState,
|
|
197
|
-
ITALIC: activeInlines.ITALIC !== undefined ? activeInlines.ITALIC : (0, _utils.hasInlineStyle)(editorState,
|
|
198
|
-
"unordered-list-item": (0, _utils.hasBlockStyle)(editorState,
|
|
199
|
-
"ordered-list-item": (0, _utils.hasBlockStyle)(editorState,
|
|
204
|
+
BOLD: activeInlines.BOLD !== undefined ? activeInlines.BOLD : (0, _utils.hasInlineStyle)(editorState, _types.BOLD),
|
|
205
|
+
ITALIC: activeInlines.ITALIC !== undefined ? activeInlines.ITALIC : (0, _utils.hasInlineStyle)(editorState, _types.ITALIC),
|
|
206
|
+
"unordered-list-item": (0, _utils.hasBlockStyle)(editorState, _types.UNORDERED_LIST),
|
|
207
|
+
"ordered-list-item": (0, _utils.hasBlockStyle)(editorState, _types.ORDERED_LIST)
|
|
200
208
|
};
|
|
201
209
|
const handleEditorFocus = (0, _react.useCallback)(focusValue => {
|
|
202
210
|
moveCursor.current = true;
|
|
203
211
|
setIsFocused(focusValue);
|
|
204
212
|
|
|
205
|
-
if (!isFocused && focusValue && editor.current !== document.activeElement) {
|
|
206
|
-
|
|
213
|
+
if (!isFocused && focusValue && typeof editor === "object" && editor.current !== document.activeElement) {
|
|
214
|
+
var _editor$current;
|
|
215
|
+
|
|
216
|
+
(_editor$current = editor.current) === null || _editor$current === void 0 ? void 0 : _editor$current.focus();
|
|
207
217
|
setFocusToolbar(false);
|
|
208
218
|
}
|
|
209
219
|
}, [editor, isFocused]);
|
|
@@ -250,8 +260,14 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
250
260
|
}, [activeInlines, contentLength, editorState, inlines, isFocused, onChange, value]);
|
|
251
261
|
|
|
252
262
|
const handlePreviewClose = (onClose, url) => {
|
|
253
|
-
|
|
254
|
-
|
|
263
|
+
// istanbul ignore else
|
|
264
|
+
if (url) onClose(url); // istanbul ignore else
|
|
265
|
+
|
|
266
|
+
if (typeof editor === "object") {
|
|
267
|
+
var _editor$current2;
|
|
268
|
+
|
|
269
|
+
(_editor$current2 = editor.current) === null || _editor$current2 === void 0 ? void 0 : _editor$current2.focus();
|
|
270
|
+
}
|
|
255
271
|
};
|
|
256
272
|
|
|
257
273
|
return /*#__PURE__*/_react.default.createElement(EditorContext.Provider, {
|
|
@@ -269,7 +285,6 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
269
285
|
hasError: !!error
|
|
270
286
|
}, /*#__PURE__*/_react.default.createElement(_textEditor.StyledEditorContainer, {
|
|
271
287
|
"data-component": "text-editor-container",
|
|
272
|
-
ariaLabelledBy: labelId.current,
|
|
273
288
|
hasError: !!error,
|
|
274
289
|
rows: rows,
|
|
275
290
|
hasPreview: !!_react.default.Children.count(previews)
|
|
@@ -294,66 +309,194 @@ const TextEditor = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
294
309
|
keyBindingFn: keyBindingFn,
|
|
295
310
|
tabIndex: 0
|
|
296
311
|
}), _react.default.Children.map(previews, preview => {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
312
|
+
if ( /*#__PURE__*/_react.default.isValidElement(preview)) {
|
|
313
|
+
const {
|
|
314
|
+
onClose
|
|
315
|
+
} = preview === null || preview === void 0 ? void 0 : preview.props;
|
|
316
|
+
return /*#__PURE__*/_react.default.cloneElement(preview, {
|
|
317
|
+
as: "div",
|
|
318
|
+
onClose: onClose ? url => handlePreviewClose(onClose, url) : undefined
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return null;
|
|
304
323
|
}), /*#__PURE__*/_react.default.createElement(_toolbar.default, {
|
|
305
324
|
setBlockStyle: (ev, newBlockType) => handleBlockStyleChange(ev, newBlockType),
|
|
306
|
-
setInlineStyle: (ev, inlineStyle
|
|
307
|
-
editorState: editorState,
|
|
325
|
+
setInlineStyle: (ev, inlineStyle) => handleInlineStyleChange(ev, inlineStyle),
|
|
308
326
|
activeControls: activeControls,
|
|
309
327
|
canFocus: focusToolbar,
|
|
310
328
|
toolbarElements: toolbarElements
|
|
311
329
|
})))));
|
|
312
330
|
});
|
|
313
331
|
|
|
314
|
-
TextEditor
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
332
|
+
exports.TextEditor = TextEditor;
|
|
333
|
+
TextEditor.propTypes = {
|
|
334
|
+
"characterLimit": _propTypes.default.number,
|
|
335
|
+
"error": _propTypes.default.string,
|
|
336
|
+
"info": _propTypes.default.string,
|
|
337
|
+
"labelText": _propTypes.default.string.isRequired,
|
|
338
|
+
"m": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
339
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
340
|
+
"description": _propTypes.default.string,
|
|
341
|
+
"toString": _propTypes.default.func.isRequired,
|
|
342
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
343
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
344
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
345
|
+
"description": _propTypes.default.string,
|
|
346
|
+
"toString": _propTypes.default.func.isRequired,
|
|
347
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
348
|
+
}), _propTypes.default.string]),
|
|
349
|
+
"margin": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
350
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
351
|
+
"description": _propTypes.default.string,
|
|
352
|
+
"toString": _propTypes.default.func.isRequired,
|
|
353
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
354
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
355
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
356
|
+
"description": _propTypes.default.string,
|
|
357
|
+
"toString": _propTypes.default.func.isRequired,
|
|
358
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
359
|
+
}), _propTypes.default.string]),
|
|
360
|
+
"marginBottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
361
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
362
|
+
"description": _propTypes.default.string,
|
|
363
|
+
"toString": _propTypes.default.func.isRequired,
|
|
364
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
365
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
366
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
367
|
+
"description": _propTypes.default.string,
|
|
368
|
+
"toString": _propTypes.default.func.isRequired,
|
|
369
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
370
|
+
}), _propTypes.default.string]),
|
|
371
|
+
"marginLeft": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
372
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
373
|
+
"description": _propTypes.default.string,
|
|
374
|
+
"toString": _propTypes.default.func.isRequired,
|
|
375
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
376
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
377
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
378
|
+
"description": _propTypes.default.string,
|
|
379
|
+
"toString": _propTypes.default.func.isRequired,
|
|
380
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
381
|
+
}), _propTypes.default.string]),
|
|
382
|
+
"marginRight": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
383
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
384
|
+
"description": _propTypes.default.string,
|
|
385
|
+
"toString": _propTypes.default.func.isRequired,
|
|
386
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
387
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
388
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
389
|
+
"description": _propTypes.default.string,
|
|
390
|
+
"toString": _propTypes.default.func.isRequired,
|
|
391
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
392
|
+
}), _propTypes.default.string]),
|
|
393
|
+
"marginTop": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
394
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
395
|
+
"description": _propTypes.default.string,
|
|
396
|
+
"toString": _propTypes.default.func.isRequired,
|
|
397
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
398
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
399
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
400
|
+
"description": _propTypes.default.string,
|
|
401
|
+
"toString": _propTypes.default.func.isRequired,
|
|
402
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
403
|
+
}), _propTypes.default.string]),
|
|
404
|
+
"marginX": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
405
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
406
|
+
"description": _propTypes.default.string,
|
|
407
|
+
"toString": _propTypes.default.func.isRequired,
|
|
408
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
409
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
410
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
411
|
+
"description": _propTypes.default.string,
|
|
412
|
+
"toString": _propTypes.default.func.isRequired,
|
|
413
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
414
|
+
}), _propTypes.default.string]),
|
|
415
|
+
"marginY": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
416
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
417
|
+
"description": _propTypes.default.string,
|
|
418
|
+
"toString": _propTypes.default.func.isRequired,
|
|
419
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
420
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
421
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
422
|
+
"description": _propTypes.default.string,
|
|
423
|
+
"toString": _propTypes.default.func.isRequired,
|
|
424
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
425
|
+
}), _propTypes.default.string]),
|
|
426
|
+
"mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
427
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
428
|
+
"description": _propTypes.default.string,
|
|
429
|
+
"toString": _propTypes.default.func.isRequired,
|
|
430
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
431
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
432
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
433
|
+
"description": _propTypes.default.string,
|
|
434
|
+
"toString": _propTypes.default.func.isRequired,
|
|
435
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
436
|
+
}), _propTypes.default.string]),
|
|
437
|
+
"ml": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
438
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
439
|
+
"description": _propTypes.default.string,
|
|
440
|
+
"toString": _propTypes.default.func.isRequired,
|
|
441
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
442
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
443
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
444
|
+
"description": _propTypes.default.string,
|
|
445
|
+
"toString": _propTypes.default.func.isRequired,
|
|
446
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
447
|
+
}), _propTypes.default.string]),
|
|
448
|
+
"mr": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
449
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
450
|
+
"description": _propTypes.default.string,
|
|
451
|
+
"toString": _propTypes.default.func.isRequired,
|
|
452
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
453
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
454
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
455
|
+
"description": _propTypes.default.string,
|
|
456
|
+
"toString": _propTypes.default.func.isRequired,
|
|
457
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
458
|
+
}), _propTypes.default.string]),
|
|
459
|
+
"mt": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
460
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
461
|
+
"description": _propTypes.default.string,
|
|
462
|
+
"toString": _propTypes.default.func.isRequired,
|
|
463
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
464
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
465
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
466
|
+
"description": _propTypes.default.string,
|
|
467
|
+
"toString": _propTypes.default.func.isRequired,
|
|
468
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
469
|
+
}), _propTypes.default.string]),
|
|
470
|
+
"mx": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
471
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
472
|
+
"description": _propTypes.default.string,
|
|
473
|
+
"toString": _propTypes.default.func.isRequired,
|
|
474
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
475
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
476
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
477
|
+
"description": _propTypes.default.string,
|
|
478
|
+
"toString": _propTypes.default.func.isRequired,
|
|
479
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
480
|
+
}), _propTypes.default.string]),
|
|
481
|
+
"my": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
482
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
483
|
+
"description": _propTypes.default.string,
|
|
484
|
+
"toString": _propTypes.default.func.isRequired,
|
|
485
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
486
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
487
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
488
|
+
"description": _propTypes.default.string,
|
|
489
|
+
"toString": _propTypes.default.func.isRequired,
|
|
490
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
491
|
+
}), _propTypes.default.string]),
|
|
492
|
+
"onChange": _propTypes.default.func.isRequired,
|
|
493
|
+
"onLinkAdded": _propTypes.default.func,
|
|
494
|
+
"previews": _propTypes.default.node,
|
|
495
|
+
"required": _propTypes.default.bool,
|
|
496
|
+
"rows": _propTypes.default.number,
|
|
497
|
+
"toolbarElements": _propTypes.default.node,
|
|
498
|
+
"value": _propTypes.default.object.isRequired,
|
|
499
|
+
"warning": _propTypes.default.string
|
|
357
500
|
};
|
|
358
501
|
const TextEditorState = _draftJs.EditorState;
|
|
359
502
|
exports.TextEditorState = TextEditorState;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare const StyledEditorWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
declare const StyledEditorContainer: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
hasError?: boolean | undefined;
|
|
4
|
+
rows?: number | undefined;
|
|
5
|
+
hasPreview?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
declare const StyledEditorOutline: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
isFocused?: boolean | undefined;
|
|
9
|
+
hasError?: boolean | undefined;
|
|
10
|
+
}, never>;
|
|
11
|
+
export { StyledEditorWrapper, StyledEditorContainer, StyledEditorOutline };
|
|
@@ -28,13 +28,12 @@ StyledEditorWrapper.defaultProps = {
|
|
|
28
28
|
theme: _base.default
|
|
29
29
|
};
|
|
30
30
|
const StyledEditorContainer = _styledComponents.default.div`
|
|
31
|
-
border-radius: var(--borderRadius050);
|
|
32
|
-
|
|
33
31
|
${({
|
|
34
32
|
hasError,
|
|
35
33
|
rows,
|
|
36
34
|
hasPreview
|
|
37
35
|
}) => (0, _styledComponents.css)`
|
|
36
|
+
border-radius: var(--borderRadius050);
|
|
38
37
|
min-height: ${rows ? `${rows * lineHeight}` : `${hasPreview ? 125 : 220}`}px;
|
|
39
38
|
min-width: 320px;
|
|
40
39
|
position: relative;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const BOLD = "BOLD";
|
|
2
|
+
export declare const ITALIC = "ITALIC";
|
|
3
|
+
export declare const UNORDERED_LIST = "unordered-list-item";
|
|
4
|
+
export declare const ORDERED_LIST = "ordered-list-item";
|
|
5
|
+
export declare type InlineStyleType = typeof BOLD | typeof ITALIC;
|
|
6
|
+
export declare type BlockType = typeof UNORDERED_LIST | typeof ORDERED_LIST;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ORDERED_LIST = exports.UNORDERED_LIST = exports.ITALIC = exports.BOLD = void 0;
|
|
7
|
+
const BOLD = "BOLD";
|
|
8
|
+
exports.BOLD = BOLD;
|
|
9
|
+
const ITALIC = "ITALIC";
|
|
10
|
+
exports.ITALIC = ITALIC;
|
|
11
|
+
const UNORDERED_LIST = "unordered-list-item";
|
|
12
|
+
exports.UNORDERED_LIST = UNORDERED_LIST;
|
|
13
|
+
const ORDERED_LIST = "ordered-list-item";
|
|
14
|
+
exports.ORDERED_LIST = ORDERED_LIST;
|
|
@@ -17,7 +17,7 @@ var _inputIconToggle = _interopRequireDefault(require("../../__internal__/input-
|
|
|
17
17
|
|
|
18
18
|
var _formField = _interopRequireDefault(require("../../__internal__/form-field"));
|
|
19
19
|
|
|
20
|
-
var _useUniqueId = _interopRequireDefault(require("../../__internal__/
|
|
20
|
+
var _useUniqueId = _interopRequireDefault(require("../../hooks/__internal__/useUniqueId"));
|
|
21
21
|
|
|
22
22
|
var _inputBehaviour = require("../../__internal__/input-behaviour");
|
|
23
23
|
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
var _guid = _interopRequireDefault(require("
|
|
10
|
+
var _guid = _interopRequireDefault(require("../../../__internal__/utils/helpers/guid"));
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
package/lib/locales/en-gb.js
CHANGED
|
@@ -109,6 +109,10 @@ const enGB = {
|
|
|
109
109
|
pageX: () => "Page",
|
|
110
110
|
ofY: count => `of ${count}`
|
|
111
111
|
},
|
|
112
|
+
password: {
|
|
113
|
+
ariaLiveShownMessage: () => "Your password has been shown. Focus on the password input to have it read to you, if it is safe to do so.",
|
|
114
|
+
ariaLiveHiddenMessage: () => "Your Password is currently hidden."
|
|
115
|
+
},
|
|
112
116
|
progressTracker: {
|
|
113
117
|
of: () => "of"
|
|
114
118
|
},
|
package/lib/locales/locale.d.ts
CHANGED
package/lib/locales/pl-pl.js
CHANGED
|
@@ -161,6 +161,10 @@ const plPL = {
|
|
|
161
161
|
pageX: () => "Strona",
|
|
162
162
|
ofY: count => `z ${count}`
|
|
163
163
|
},
|
|
164
|
+
password: {
|
|
165
|
+
ariaLiveShownMessage: () => "Zostało wyświetlone Twoje hasło. Skup się na haśle, aby je odczytać, jeśli jest to bezpieczne.",
|
|
166
|
+
ariaLiveHiddenMessage: () => "Twoje hasło jest obecnie ukryte."
|
|
167
|
+
},
|
|
164
168
|
progressTracker: {
|
|
165
169
|
of: () => "z"
|
|
166
170
|
},
|