@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.
@@ -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 of `162px`
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;
@@ -24,4 +24,5 @@ export interface TextEditorProps {
24
24
  formatting?: Partial<Omit<StarterKitOptions, 'gapcursor' | 'dropcursor' | 'document' | 'text' | 'paragraph'>> & {
25
25
  paragraph?: Partial<ParagraphOptions>;
26
26
  };
27
+ disableTabIndent?: boolean;
27
28
  }
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/core';
2
+ declare const TabIndent: Extension<any, any>;
3
+ export default TabIndent;
@@ -0,0 +1 @@
1
+ export { default as TabIndent } from './TabIndent';
@@ -1 +1,2 @@
1
1
  export * from './Placeholders';
2
+ export * from './TabIndent';
package/dist/index.esm.js CHANGED
@@ -18747,12 +18747,13 @@ var StyledFormHelperText = styled(FormHelperText)(function (_a) {
18747
18747
  });
18748
18748
 
18749
18749
  var Input = React.forwardRef(function Input(props, ref) {
18750
- 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"]);
18750
+ 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"]);
18751
18751
  return (jsxs(Fragment$1, { children: [label && jsx(FormLabelBlock, { children: label }), jsx(StyledInputBase, __assign({ ref: ref, error: error, textAlignRight: textAlignRight, className: clsx(size === 'large' && 'customLargeSize', background === 'light' && 'customLightColor', className), inputProps: {
18752
18752
  style: __assign({
18753
- // EDGECASE: When we use multiline and set minRows, maxRows, rows we need to define the width of the input. By default we set this to 162.
18754
- width: inputPropStyles ? inputPropStyles.width : 162 }, inputPropStyles),
18755
- } }, rest)), helperText && (jsx(StyledFormHelperText, { error: error, children: helperText }))] }));
18753
+ // 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.
18754
+ // If there's no container we need to define the width. Otherwise the input will fluctate in size on keydown when rows param exist.
18755
+ width: inputPropStyles ? inputPropStyles.width : '100%' }, inputPropStyles),
18756
+ }, rows: rows, minRows: minRows, maxRows: maxRows }, rest)), helperText && (jsx(StyledFormHelperText, { error: error, children: helperText }))] }));
18756
18757
  });
18757
18758
 
18758
18759
  var ListItemAvatar = function (props) {
@@ -40877,10 +40878,61 @@ var ExtensionPlaceholders = Node.create({
40877
40878
  },
40878
40879
  });
40879
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
+
40880
40931
  var index = /*#__PURE__*/Object.freeze({
40881
40932
  __proto__: null,
40882
40933
  ExtensionPlaceholders: ExtensionPlaceholders,
40883
- Placeholder: Placeholder
40934
+ Placeholder: Placeholder,
40935
+ TabIndent: TabIndent
40884
40936
  });
40885
40937
 
40886
40938
  var useEditor = function () {
@@ -45417,9 +45469,9 @@ var TextEditorContainer = styled$1('div')(function (_a) {
45417
45469
 
45418
45470
  var TextEditor = function (props) {
45419
45471
  var _a, _b, _c, _d;
45420
- var extensions = __spreadArray([
45472
+ var extensions = __spreadArray(__spreadArray([
45421
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 : {})))
45422
- ], ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
45474
+ ], (props.disableTabIndent ? [] : [TabIndent]), true), ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
45423
45475
  var editor = useEditor$1({
45424
45476
  extensions: extensions,
45425
45477
  content: props.initialContent,