@galaxy-ds/core 2.1.8 → 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 +54 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +54 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4838,7 +4838,8 @@ export declare const LargeSizeToolbarSize: {
|
|
|
4838
4838
|
* It grows automatically to fit the contents.
|
|
4839
4839
|
* Specify `rows` to set its height, the height is fixed in this case.
|
|
4840
4840
|
*
|
|
4841
|
-
* Use `inputPropStyles` to override default inputProps width
|
|
4841
|
+
* Use `inputPropStyles` to override default inputProps width.
|
|
4842
|
+
*
|
|
4842
4843
|
*/
|
|
4843
4844
|
export declare const TextArea: {
|
|
4844
4845
|
args: {
|
|
@@ -5177,6 +5178,12 @@ export declare const TextArea: {
|
|
|
5177
5178
|
key?: import("react").Key | null | undefined;
|
|
5178
5179
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5179
5180
|
};
|
|
5181
|
+
/**
|
|
5182
|
+
*
|
|
5183
|
+
* Use `inputPropStyles` to override default inputProps width.
|
|
5184
|
+
*
|
|
5185
|
+
* **NOTE**: If there's no container we need to define the width. Otherwise the input will fluctate in size on keydown when `rows`, `minRows` or `maxRows` is provided.
|
|
5186
|
+
*/
|
|
5180
5187
|
export declare const TextAreaMinRows: {
|
|
5181
5188
|
args: {
|
|
5182
5189
|
multiline: true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TabIndent } from './TabIndent';
|
package/dist/index.esm.js
CHANGED
|
@@ -40878,10 +40878,61 @@ var ExtensionPlaceholders = Node.create({
|
|
|
40878
40878
|
},
|
|
40879
40879
|
});
|
|
40880
40880
|
|
|
40881
|
+
var TAB_CHAR = '\u0009';
|
|
40882
|
+
var TabIndent = Extension.create({
|
|
40883
|
+
name: 'tabIndent',
|
|
40884
|
+
addKeyboardShortcuts: function () {
|
|
40885
|
+
return {
|
|
40886
|
+
Tab: function (_a) {
|
|
40887
|
+
var editor = _a.editor;
|
|
40888
|
+
var selection = editor.state.selection;
|
|
40889
|
+
var $from = selection.$from;
|
|
40890
|
+
if (editor.isActive('listItem') && $from.parentOffset === 0) {
|
|
40891
|
+
var sinkResult = editor.chain().sinkListItem('listItem').run();
|
|
40892
|
+
if (sinkResult) {
|
|
40893
|
+
return true;
|
|
40894
|
+
}
|
|
40895
|
+
}
|
|
40896
|
+
editor
|
|
40897
|
+
.chain()
|
|
40898
|
+
.command(function (_a) {
|
|
40899
|
+
var tr = _a.tr;
|
|
40900
|
+
tr.insertText(TAB_CHAR);
|
|
40901
|
+
return true;
|
|
40902
|
+
})
|
|
40903
|
+
.run();
|
|
40904
|
+
return true;
|
|
40905
|
+
},
|
|
40906
|
+
'Shift-Tab': function (_a) {
|
|
40907
|
+
var editor = _a.editor;
|
|
40908
|
+
var _b = editor.state, selection = _b.selection, doc = _b.doc;
|
|
40909
|
+
var $from = selection.$from;
|
|
40910
|
+
var pos = $from.pos;
|
|
40911
|
+
if (editor.isActive('listItem') && $from.parentOffset === 0) {
|
|
40912
|
+
return editor.chain().liftListItem('listItem').run();
|
|
40913
|
+
}
|
|
40914
|
+
if (doc.textBetween(pos - 1, pos) === TAB_CHAR) {
|
|
40915
|
+
editor
|
|
40916
|
+
.chain()
|
|
40917
|
+
.command(function (_a) {
|
|
40918
|
+
var tr = _a.tr;
|
|
40919
|
+
tr.delete(pos - 1, pos);
|
|
40920
|
+
return true;
|
|
40921
|
+
})
|
|
40922
|
+
.run();
|
|
40923
|
+
return true;
|
|
40924
|
+
}
|
|
40925
|
+
return true;
|
|
40926
|
+
},
|
|
40927
|
+
};
|
|
40928
|
+
},
|
|
40929
|
+
});
|
|
40930
|
+
|
|
40881
40931
|
var index = /*#__PURE__*/Object.freeze({
|
|
40882
40932
|
__proto__: null,
|
|
40883
40933
|
ExtensionPlaceholders: ExtensionPlaceholders,
|
|
40884
|
-
Placeholder: Placeholder
|
|
40934
|
+
Placeholder: Placeholder,
|
|
40935
|
+
TabIndent: TabIndent
|
|
40885
40936
|
});
|
|
40886
40937
|
|
|
40887
40938
|
var useEditor = function () {
|
|
@@ -45418,9 +45469,9 @@ var TextEditorContainer = styled$1('div')(function (_a) {
|
|
|
45418
45469
|
|
|
45419
45470
|
var TextEditor = function (props) {
|
|
45420
45471
|
var _a, _b, _c, _d;
|
|
45421
|
-
var extensions = __spreadArray([
|
|
45472
|
+
var extensions = __spreadArray(__spreadArray([
|
|
45422
45473
|
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 : {})))
|
|
45423
|
-
], ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
|
|
45474
|
+
], (props.disableTabIndent ? [] : [TabIndent]), true), ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
|
|
45424
45475
|
var editor = useEditor$1({
|
|
45425
45476
|
extensions: extensions,
|
|
45426
45477
|
content: props.initialContent,
|