@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/index.js CHANGED
@@ -40880,10 +40880,61 @@ var ExtensionPlaceholders = Node.create({
40880
40880
  },
40881
40881
  });
40882
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
+
40883
40933
  var index = /*#__PURE__*/Object.freeze({
40884
40934
  __proto__: null,
40885
40935
  ExtensionPlaceholders: ExtensionPlaceholders,
40886
- Placeholder: Placeholder
40936
+ Placeholder: Placeholder,
40937
+ TabIndent: TabIndent
40887
40938
  });
40888
40939
 
40889
40940
  var useEditor = function () {
@@ -45420,9 +45471,9 @@ var TextEditorContainer = material.styled('div')(function (_a) {
45420
45471
 
45421
45472
  var TextEditor = function (props) {
45422
45473
  var _a, _b, _c, _d;
45423
- var extensions = __spreadArray([
45474
+ var extensions = __spreadArray(__spreadArray([
45424
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 : {})))
45425
- ], ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
45476
+ ], (props.disableTabIndent ? [] : [TabIndent]), true), ((_b = props.extensions) !== null && _b !== void 0 ? _b : []), true);
45426
45477
  var editor = useEditor$1({
45427
45478
  extensions: extensions,
45428
45479
  content: props.initialContent,