@galaxy-ds/core 2.1.7 → 2.1.9
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/dist/Input/Input.stories.d.ts +8 -1
- package/dist/TextEditor/TextEditor.types.d.ts +1 -0
- package/dist/TextEditor/extensions/TabIndent/TabIndent.d.ts +3 -0
- package/dist/TextEditor/extensions/TabIndent/index.d.ts +1 -0
- package/dist/TextEditor/extensions/index.d.ts +1 -0
- package/dist/index.esm.js +59 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +59 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18749,12 +18749,13 @@ var StyledFormHelperText = styles$1.styled(FormHelperText)(function (_a) {
|
|
|
18749
18749
|
});
|
|
18750
18750
|
|
|
18751
18751
|
var Input = React.forwardRef(function Input(props, ref) {
|
|
18752
|
-
var _a = props.error, error = _a === void 0 ? false : _a, helperText = props.helperText, _b = props.textAlignRight, textAlignRight = _b === void 0 ? false : _b, label = props.label, _c = props.size, size = _c === void 0 ? 'medium' : _c, _d = props.background, background = _d === void 0 ? 'default' : _d, className = props.className, inputPropStyles = props.inputPropStyles, rest = __rest(props, ["error", "helperText", "textAlignRight", "label", "size", "background", "className", "inputPropStyles"]);
|
|
18752
|
+
var _a = props.error, error = _a === void 0 ? false : _a, helperText = props.helperText, _b = props.textAlignRight, textAlignRight = _b === void 0 ? false : _b, label = props.label, _c = props.size, size = _c === void 0 ? 'medium' : _c, _d = props.background, background = _d === void 0 ? 'default' : _d, className = props.className, inputPropStyles = props.inputPropStyles, minRows = props.minRows, maxRows = props.maxRows, rows = props.rows, rest = __rest(props, ["error", "helperText", "textAlignRight", "label", "size", "background", "className", "inputPropStyles", "minRows", "maxRows", "rows"]);
|
|
18753
18753
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && jsxRuntime.jsx(FormLabelBlock, { children: label }), jsxRuntime.jsx(StyledInputBase, __assign({ ref: ref, error: error, textAlignRight: textAlignRight, className: clsx(size === 'large' && 'customLargeSize', background === 'light' && 'customLightColor', className), inputProps: {
|
|
18754
18754
|
style: __assign({
|
|
18755
|
-
// EDGECASE: When we use multiline and set minRows, maxRows, rows we need to define the width of the input.
|
|
18756
|
-
|
|
18757
|
-
|
|
18755
|
+
// EDGECASE: When we use multiline and set minRows, maxRows, rows we need to define the width of the input. 100% here will inherit parent container.
|
|
18756
|
+
// If there's no container we need to define the width. Otherwise the input will fluctate in size on keydown when rows param exist.
|
|
18757
|
+
width: inputPropStyles ? inputPropStyles.width : '100%' }, inputPropStyles),
|
|
18758
|
+
}, rows: rows, minRows: minRows, maxRows: maxRows }, rest)), helperText && (jsxRuntime.jsx(StyledFormHelperText, { error: error, children: helperText }))] }));
|
|
18758
18759
|
});
|
|
18759
18760
|
|
|
18760
18761
|
var ListItemAvatar = function (props) {
|
|
@@ -40879,10 +40880,61 @@ var ExtensionPlaceholders = Node.create({
|
|
|
40879
40880
|
},
|
|
40880
40881
|
});
|
|
40881
40882
|
|
|
40883
|
+
var TAB_CHAR = '\u0009';
|
|
40884
|
+
var TabIndent = Extension.create({
|
|
40885
|
+
name: 'tabIndent',
|
|
40886
|
+
addKeyboardShortcuts: function () {
|
|
40887
|
+
return {
|
|
40888
|
+
Tab: function (_a) {
|
|
40889
|
+
var editor = _a.editor;
|
|
40890
|
+
var selection = editor.state.selection;
|
|
40891
|
+
var $from = selection.$from;
|
|
40892
|
+
if (editor.isActive('listItem') && $from.parentOffset === 0) {
|
|
40893
|
+
var sinkResult = editor.chain().sinkListItem('listItem').run();
|
|
40894
|
+
if (sinkResult) {
|
|
40895
|
+
return true;
|
|
40896
|
+
}
|
|
40897
|
+
}
|
|
40898
|
+
editor
|
|
40899
|
+
.chain()
|
|
40900
|
+
.command(function (_a) {
|
|
40901
|
+
var tr = _a.tr;
|
|
40902
|
+
tr.insertText(TAB_CHAR);
|
|
40903
|
+
return true;
|
|
40904
|
+
})
|
|
40905
|
+
.run();
|
|
40906
|
+
return true;
|
|
40907
|
+
},
|
|
40908
|
+
'Shift-Tab': function (_a) {
|
|
40909
|
+
var editor = _a.editor;
|
|
40910
|
+
var _b = editor.state, selection = _b.selection, doc = _b.doc;
|
|
40911
|
+
var $from = selection.$from;
|
|
40912
|
+
var pos = $from.pos;
|
|
40913
|
+
if (editor.isActive('listItem') && $from.parentOffset === 0) {
|
|
40914
|
+
return editor.chain().liftListItem('listItem').run();
|
|
40915
|
+
}
|
|
40916
|
+
if (doc.textBetween(pos - 1, pos) === TAB_CHAR) {
|
|
40917
|
+
editor
|
|
40918
|
+
.chain()
|
|
40919
|
+
.command(function (_a) {
|
|
40920
|
+
var tr = _a.tr;
|
|
40921
|
+
tr.delete(pos - 1, pos);
|
|
40922
|
+
return true;
|
|
40923
|
+
})
|
|
40924
|
+
.run();
|
|
40925
|
+
return true;
|
|
40926
|
+
}
|
|
40927
|
+
return true;
|
|
40928
|
+
},
|
|
40929
|
+
};
|
|
40930
|
+
},
|
|
40931
|
+
});
|
|
40932
|
+
|
|
40882
40933
|
var index = /*#__PURE__*/Object.freeze({
|
|
40883
40934
|
__proto__: null,
|
|
40884
40935
|
ExtensionPlaceholders: ExtensionPlaceholders,
|
|
40885
|
-
Placeholder: Placeholder
|
|
40936
|
+
Placeholder: Placeholder,
|
|
40937
|
+
TabIndent: TabIndent
|
|
40886
40938
|
});
|
|
40887
40939
|
|
|
40888
40940
|
var useEditor = function () {
|
|
@@ -45419,9 +45471,9 @@ var TextEditorContainer = material.styled('div')(function (_a) {
|
|
|
45419
45471
|
|
|
45420
45472
|
var TextEditor = function (props) {
|
|
45421
45473
|
var _a, _b, _c, _d;
|
|
45422
|
-
var extensions = __spreadArray([
|
|
45474
|
+
var extensions = __spreadArray(__spreadArray([
|
|
45423
45475
|
StarterKit.configure(__assign({ blockquote: false, bold: false, bulletList: false, code: false, codeBlock: false, dropcursor: {}, hardBreak: false, heading: false, horizontalRule: false, italic: false, listItem: false, orderedList: false, strike: false }, ((_a = props.formatting) !== null && _a !== void 0 ? _a : {})))
|
|
45424
|
-
], ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
|
|
45476
|
+
], (props.disableTabIndent ? [] : [TabIndent]), true), ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
|
|
45425
45477
|
var editor = useEditor$1({
|
|
45426
45478
|
extensions: extensions,
|
|
45427
45479
|
content: props.initialContent,
|