@elyra/canvas 13.0.0-alpha.1 → 13.0.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.
Files changed (72) hide show
  1. package/build.sh +6 -2
  2. package/dist/{canvas-controller-488d8e7b.js → canvas-controller-13afbf7b.js} +2 -2
  3. package/dist/{canvas-controller-866bf117.js.map → canvas-controller-13afbf7b.js.map} +1 -1
  4. package/dist/{canvas-controller-866bf117.js → canvas-controller-bf9c0dd2.js} +2 -2
  5. package/dist/{canvas-controller-488d8e7b.js.map → canvas-controller-bf9c0dd2.js.map} +1 -1
  6. package/dist/common-canvas-bbc57d20.js +2 -0
  7. package/dist/common-canvas-bbc57d20.js.map +1 -0
  8. package/dist/common-canvas-ef71be09.js +2 -0
  9. package/dist/common-canvas-ef71be09.js.map +1 -0
  10. package/dist/common-canvas.es.js +1 -1
  11. package/dist/common-canvas.js +1 -1
  12. package/dist/common-properties-ddfc6e24.js +2 -0
  13. package/dist/common-properties-ddfc6e24.js.map +1 -0
  14. package/dist/common-properties-e64e7304.js +2 -0
  15. package/dist/common-properties-e64e7304.js.map +1 -0
  16. package/dist/lib/canvas-controller.es.js +1 -1
  17. package/dist/lib/canvas-controller.js +1 -1
  18. package/dist/lib/canvas.es.js +1 -1
  19. package/dist/lib/canvas.js +1 -1
  20. package/dist/lib/command-stack.es.js +1 -1
  21. package/dist/lib/command-stack.es.js.map +1 -1
  22. package/dist/lib/command-stack.js +1 -1
  23. package/dist/lib/command-stack.js.map +1 -1
  24. package/dist/lib/properties.es.js +1 -1
  25. package/dist/lib/properties.js +1 -1
  26. package/dist/styles/common-canvas.min.css +1 -1
  27. package/dist/styles/common-canvas.min.css.map +1 -1
  28. package/dist/{toolbar-35db2f4c.js → toolbar-5417d781.js} +2 -2
  29. package/dist/{toolbar-35db2f4c.js.map → toolbar-5417d781.js.map} +1 -1
  30. package/dist/{toolbar-9b99500d.js → toolbar-bcb3055d.js} +2 -2
  31. package/dist/{toolbar-9b99500d.js.map → toolbar-bcb3055d.js.map} +1 -1
  32. package/package.json +1 -1
  33. package/src/command-stack/command-stack.js +4 -0
  34. package/src/common-canvas/canvas-controller.js +14 -6
  35. package/src/common-canvas/cc-context-toolbar.jsx +10 -3
  36. package/src/common-canvas/cc-toolbar.jsx +0 -3
  37. package/src/common-canvas/common-canvas.scss +0 -6
  38. package/src/common-canvas/svg-canvas-renderer.js +10 -2
  39. package/src/common-canvas/svg-canvas-utils-external.js +21 -10
  40. package/src/common-properties/components/editor-form/editor-form.jsx +33 -14
  41. package/src/common-properties/components/editor-form/editor-form.scss +42 -43
  42. package/src/common-properties/controls/control-factory.js +9 -2
  43. package/src/common-properties/controls/datefield/datefield.jsx +12 -14
  44. package/src/common-properties/controls/datepicker/datepicker.jsx +21 -23
  45. package/src/common-properties/controls/datepicker-range/datepicker-range.jsx +33 -35
  46. package/src/common-properties/controls/dropdown/dropdown.jsx +37 -43
  47. package/src/common-properties/controls/dropdown/dropdown.scss +1 -1
  48. package/src/common-properties/controls/multiselect/multiselect.jsx +23 -27
  49. package/src/common-properties/controls/numberfield/numberfield.jsx +16 -18
  50. package/src/common-properties/controls/passwordfield/passwordfield.jsx +15 -17
  51. package/src/common-properties/controls/radioset/radioset.jsx +11 -8
  52. package/src/common-properties/controls/radioset/radioset.scss +6 -14
  53. package/src/common-properties/controls/slider/slider.jsx +16 -18
  54. package/src/common-properties/controls/textarea/textarea.jsx +20 -24
  55. package/src/common-properties/controls/textfield/textfield.jsx +13 -15
  56. package/src/common-properties/controls/timefield/timefield.jsx +12 -14
  57. package/src/common-properties/form/ControlInfo.js +1 -1
  58. package/src/common-properties/panels/subtabs/subtabs.scss +4 -4
  59. package/src/toolbar/toolbar-action-item.jsx +38 -4
  60. package/src/toolbar/toolbar-button-item.jsx +38 -28
  61. package/src/toolbar/toolbar-overflow-item.jsx +27 -10
  62. package/src/toolbar/toolbar.jsx +22 -22
  63. package/src/toolbar/toolbar.scss +61 -11
  64. package/stats.html +1 -1
  65. package/dist/common-canvas-3ffaf6ca.js +0 -2
  66. package/dist/common-canvas-3ffaf6ca.js.map +0 -1
  67. package/dist/common-canvas-c1a57382.js +0 -2
  68. package/dist/common-canvas-c1a57382.js.map +0 -1
  69. package/dist/common-properties-3cce68e0.js +0 -2
  70. package/dist/common-properties-3cce68e0.js.map +0 -1
  71. package/dist/common-properties-5cac340d.js +0 -2
  72. package/dist/common-properties-5cac340d.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import"../createClass-02596015.js";import"../isArrayLikeObject-7a30aa4b.js";export{C as default}from"../canvas-controller-488d8e7b.js";import"./command-stack.es.js";import"../canvas-constants-3bbfc8b1.js";import"../canvas-logger-ab9d9048.js";import"../inherits-42ae8426.js";import"../datarecord-metadata-v3-schema-2311ecab.js";import"../defineProperty-ad55dbff.js";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";import"immutable";
1
+ import"../createClass-02596015.js";import"../isArrayLikeObject-7a30aa4b.js";export{C as default}from"../canvas-controller-13afbf7b.js";import"./command-stack.es.js";import"../canvas-constants-3bbfc8b1.js";import"../canvas-logger-ab9d9048.js";import"../inherits-42ae8426.js";import"../datarecord-metadata-v3-schema-2311ecab.js";import"../defineProperty-ad55dbff.js";import"uuid";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";import"immutable";
2
2
  //# sourceMappingURL=canvas-controller.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";require("../createClass-155bf7da.js"),require("../isArrayLikeObject-04f333a5.js");var e=require("../canvas-controller-866bf117.js");require("./command-stack.js"),require("../canvas-constants-8d240dc6.js"),require("../canvas-logger-6f4b2551.js"),require("../inherits-75817f22.js"),require("../datarecord-metadata-v3-schema-d279dbb0.js"),require("../defineProperty-bcc9968d.js"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),require("immutable"),module.exports=e.CanvasController;
1
+ "use strict";require("../createClass-155bf7da.js"),require("../isArrayLikeObject-04f333a5.js");var e=require("../canvas-controller-bf9c0dd2.js");require("./command-stack.js"),require("../canvas-constants-8d240dc6.js"),require("../canvas-logger-6f4b2551.js"),require("../inherits-75817f22.js"),require("../datarecord-metadata-v3-schema-d279dbb0.js"),require("../defineProperty-bcc9968d.js"),require("uuid"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),require("immutable"),module.exports=e.CanvasController;
2
2
  //# sourceMappingURL=canvas-controller.js.map
@@ -1,2 +1,2 @@
1
- export{c as CommonCanvas}from"../common-canvas-c1a57382.js";export{C as CanvasController}from"../canvas-controller-488d8e7b.js";import"../createClass-02596015.js";import"../inherits-42ae8426.js";import"react";import"react-redux";import"react-intl";import"../toolbar-35db2f4c.js";import"../isArrayLikeObject-7a30aa4b.js";import"../datarecord-metadata-v3-schema-2311ecab.js";import"../canvas-constants-3bbfc8b1.js";import"react-resize-detector";import"./tooltip.es.js";import"react-portal";import"@carbon/react";import"uuid";import"react-inlinesvg";import"../bucket-8-de8062b8.js";import"../iconPropTypes-4cbeb95d-a0eae58e.js";import"prop-types";import"../bucket-2-b54707f5.js";import"../icon-3dbe67bf.js";import"../canvas-logger-ab9d9048.js";import"../context-menu-wrapper-0eab6957.js";import"../defineProperty-ad55dbff.js";import"react-dom";import"./command-stack.es.js";import"immutable";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";
1
+ export{c as CommonCanvas}from"../common-canvas-ef71be09.js";export{C as CanvasController}from"../canvas-controller-13afbf7b.js";import"../createClass-02596015.js";import"../inherits-42ae8426.js";import"react";import"react-redux";import"react-intl";import"../toolbar-5417d781.js";import"../isArrayLikeObject-7a30aa4b.js";import"../datarecord-metadata-v3-schema-2311ecab.js";import"../canvas-constants-3bbfc8b1.js";import"react-resize-detector";import"./tooltip.es.js";import"react-portal";import"@carbon/react";import"uuid";import"react-inlinesvg";import"../bucket-8-de8062b8.js";import"../iconPropTypes-4cbeb95d-a0eae58e.js";import"prop-types";import"../bucket-2-b54707f5.js";import"../icon-3dbe67bf.js";import"../canvas-logger-ab9d9048.js";import"../context-menu-wrapper-0eab6957.js";import"../defineProperty-ad55dbff.js";import"react-dom";import"./command-stack.es.js";import"immutable";import"redux";import"jsonschema";import"@elyra/pipeline-schemas";
2
2
  //# sourceMappingURL=canvas.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-canvas-3ffaf6ca.js"),r=require("../canvas-controller-866bf117.js");require("../createClass-155bf7da.js"),require("../inherits-75817f22.js"),require("react"),require("react-redux"),require("react-intl"),require("../toolbar-9b99500d.js"),require("../isArrayLikeObject-04f333a5.js"),require("../datarecord-metadata-v3-schema-d279dbb0.js"),require("../canvas-constants-8d240dc6.js"),require("react-resize-detector"),require("./tooltip.js"),require("react-portal"),require("@carbon/react"),require("uuid"),require("react-inlinesvg"),require("../bucket-8-cc1980eb.js"),require("../iconPropTypes-4cbeb95d-2c6ff14c.js"),require("prop-types"),require("../bucket-2-ead0e85a.js"),require("../icon-03405585.js"),require("../canvas-logger-6f4b2551.js"),require("../context-menu-wrapper-3d3215a1.js"),require("../defineProperty-bcc9968d.js"),require("react-dom"),require("./command-stack.js"),require("immutable"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),exports.CommonCanvas=e.commonCanvas,exports.CanvasController=r.CanvasController;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-canvas-bbc57d20.js"),r=require("../canvas-controller-bf9c0dd2.js");require("../createClass-155bf7da.js"),require("../inherits-75817f22.js"),require("react"),require("react-redux"),require("react-intl"),require("../toolbar-bcb3055d.js"),require("../isArrayLikeObject-04f333a5.js"),require("../datarecord-metadata-v3-schema-d279dbb0.js"),require("../canvas-constants-8d240dc6.js"),require("react-resize-detector"),require("./tooltip.js"),require("react-portal"),require("@carbon/react"),require("uuid"),require("react-inlinesvg"),require("../bucket-8-cc1980eb.js"),require("../iconPropTypes-4cbeb95d-2c6ff14c.js"),require("prop-types"),require("../bucket-2-ead0e85a.js"),require("../icon-03405585.js"),require("../canvas-logger-6f4b2551.js"),require("../context-menu-wrapper-3d3215a1.js"),require("../defineProperty-bcc9968d.js"),require("react-dom"),require("./command-stack.js"),require("immutable"),require("redux"),require("jsonschema"),require("@elyra/pipeline-schemas"),exports.CommonCanvas=e.commonCanvas,exports.CanvasController=r.CanvasController;
2
2
  //# sourceMappingURL=canvas.js.map
@@ -1,2 +1,2 @@
1
- import{_ as n,a as e}from"../createClass-02596015.js";import{Stack as t,Record as o,List as s}from"immutable";var d=function(){return n((function n(){e(this,n);var d=new o({undoCmnds:new s,redoCmnds:new t});this.rec=d()}),[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new t}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),r=function(){return n((function n(){e(this,n),this.commands=new d}),[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new d}}])}();export{r as default};
1
+ import{_ as n,a as e}from"../createClass-02596015.js";import{Stack as o,Record as t,List as s}from"immutable";var d=function(){return n((function n(){e(this,n);var d=new t({undoCmnds:new s,redoCmnds:new o});this.rec=d()}),[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new o}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),r=function(){return n((function n(){e(this,n),this.commands=new d}),[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getAllRedoCommands",value:function(){return this.commands.getRedoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new d}}])}();export{r as default};
2
2
  //# sourceMappingURL=command-stack.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-stack.es.js","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","undos","redos","getRedoCommands"],"mappings":"8GAkBA,IAEqBA,aASnB,OAAAC,GAPD,SAAAD,IAAcE,OAAAF,GACb,IAAMG,EAAS,IAAIC,EAAO,CACzBC,UAAW,IAAIC,EACfC,UAAW,IAAIC,IAGhBC,KAAKC,IAAMP,QACXQ,SAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,IAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,UACAF,WAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,WAENZ,WAAAC,MAED,WACC,GAAIH,KAAKe,UAAW,CACnB,IAAMC,EAAOhB,KAAKiB,UAClBjB,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKU,GACnClB,UAAWE,KAAKC,IAAIH,UAAUe,QAE/BG,EAAKE,WAENhB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIL,UAAUuB,aAC3BjB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIH,UAAUqB,aAC3BjB,kBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,UAAUwB,UAC1BlB,cAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,UAAUuB,WAC1BnB,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,aAChBM,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,aAChB,ICtEmBwB,aAInB,OAAA9B,GAFD,SAAA8B,IAAc7B,OAAA6B,GACbtB,KAAKuB,SAAW,IAAIhC,MACpBW,SAAAC,MAED,SAAGqB,GACFxB,KAAKuB,YAAYC,MACjBtB,WAAAC,MAED,WACCH,KAAKuB,SAAST,UACdZ,WAAAC,MAED,WACCH,KAAKuB,SAASL,UACdhB,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASb,UACVV,KAAKuB,SAASX,cAEf,QACPV,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASR,UACVf,KAAKuB,SAASN,UAEf,QACPf,yBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASE,kBAAkBC,aAGxCxB,eAAAC,MACA,WACC,MAAO,CACNwB,MAAS3B,KAAKuB,SAASE,kBACvBG,MAAS5B,KAAKuB,SAASM,sBAExB3B,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASb,aACrBR,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASR,aACrBb,wBAAAC,MAED,WACCH,KAAKuB,SAAW,IAAIhC,KACpB"}
1
+ {"version":3,"file":"command-stack.es.js","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\tgetAllRedoCommands() {\n\t\treturn this.commands.getRedoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","getRedoCommands","undos","redos"],"mappings":"8GAkBA,IAEqBA,aASnB,OAAAC,GAPD,SAAAD,IAAcE,OAAAF,GACb,IAAMG,EAAS,IAAIC,EAAO,CACzBC,UAAW,IAAIC,EACfC,UAAW,IAAIC,IAGhBC,KAAKC,IAAMP,QACXQ,SAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,IAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,UACAF,WAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,WAENZ,WAAAC,MAED,WACC,GAAIH,KAAKe,UAAW,CACnB,IAAMC,EAAOhB,KAAKiB,UAClBjB,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKU,GACnClB,UAAWE,KAAKC,IAAIH,UAAUe,QAE/BG,EAAKE,WAENhB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIL,UAAUuB,aAC3BjB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIH,UAAUqB,aAC3BjB,kBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,UAAUwB,UAC1BlB,cAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,UAAUuB,WAC1BnB,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,aAChBM,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,aAChB,ICtEmBwB,aAInB,OAAA9B,GAFD,SAAA8B,IAAc7B,OAAA6B,GACbtB,KAAKuB,SAAW,IAAIhC,MACpBW,SAAAC,MAED,SAAGqB,GACFxB,KAAKuB,YAAYC,MACjBtB,WAAAC,MAED,WACCH,KAAKuB,SAAST,UACdZ,WAAAC,MAED,WACCH,KAAKuB,SAASL,UACdhB,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASb,UACVV,KAAKuB,SAASX,cAEf,QACPV,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASR,UACVf,KAAKuB,SAASN,UAEf,QACPf,yBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASE,kBAAkBC,aACvCxB,yBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASI,kBAAkBD,aAGxCxB,eAAAC,MACA,WACC,MAAO,CACNyB,MAAS5B,KAAKuB,SAASE,kBACvBI,MAAS7B,KAAKuB,SAASI,sBAExBzB,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASb,aACrBR,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASR,aACrBb,wBAAAC,MAED,WACCH,KAAKuB,SAAW,IAAIhC,KACpB"}
@@ -1,2 +1,2 @@
1
- "use strict";var n=require("../createClass-155bf7da.js"),e=require("immutable"),t=function(){return n._createClass((function t(){n._classCallCheck(this,t);var s=new e.Record({undoCmnds:new e.List,redoCmnds:new e.Stack});this.rec=s()}),[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new e.Stack}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),s=function(){return n._createClass((function e(){n._classCallCheck(this,e),this.commands=new t}),[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new t}}])}();module.exports=s;
1
+ "use strict";var n=require("../createClass-155bf7da.js"),e=require("immutable"),t=function(){return n._createClass((function t(){n._classCallCheck(this,t);var s=new e.Record({undoCmnds:new e.List,redoCmnds:new e.Stack});this.rec=s()}),[{key:"do",value:function(n){this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:new e.Stack}),this.rec.undoCmnds.size>100&&(this.rec=this.rec.set("undoCmnds",this.rec.undoCmnds.shift())),n.do()}},{key:"undo",value:function(){if(this.canUndo()){var n=this.getPrevious();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.pop(),redoCmnds:this.rec.redoCmnds.push(n)}),n.undo()}}},{key:"redo",value:function(){if(this.canRedo()){var n=this.getNext();this.rec=this.rec.merge({undoCmnds:this.rec.undoCmnds.push(n),redoCmnds:this.rec.redoCmnds.pop()}),n.redo()}}},{key:"canUndo",value:function(){return!this.rec.undoCmnds.isEmpty()}},{key:"canRedo",value:function(){return!this.rec.redoCmnds.isEmpty()}},{key:"getPrevious",value:function(){return this.rec.undoCmnds.last()}},{key:"getNext",value:function(){return this.rec.redoCmnds.first()}},{key:"getUndoCommands",value:function(){return this.rec.undoCmnds}},{key:"getRedoCommands",value:function(){return this.rec.redoCmnds}}])}(),s=function(){return n._createClass((function e(){n._classCallCheck(this,e),this.commands=new t}),[{key:"do",value:function(n){this.commands.do(n)}},{key:"undo",value:function(){this.commands.undo()}},{key:"redo",value:function(){this.commands.redo()}},{key:"getUndoCommand",value:function(){return this.commands.canUndo()?this.commands.getPrevious():null}},{key:"getRedoCommand",value:function(){return this.commands.canRedo()?this.commands.getNext():null}},{key:"getAllUndoCommands",value:function(){return this.commands.getUndoCommands().toArray()}},{key:"getAllRedoCommands",value:function(){return this.commands.getRedoCommands().toArray()}},{key:"getStack",value:function(){return{undos:this.commands.getUndoCommands(),redos:this.commands.getRedoCommands()}}},{key:"canUndo",value:function(){return this.commands.canUndo()}},{key:"canRedo",value:function(){return this.commands.canRedo()}},{key:"clearCommandStack",value:function(){this.commands=new t}}])}();module.exports=s;
2
2
  //# sourceMappingURL=command-stack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-stack.js","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","undos","redos","getRedoCommands"],"mappings":"gFAoBqBA,aASnB,OAAAC,gBAPD,SAAAD,IAAcE,uBAAAF,GACb,IAAMG,EAAS,IAAIC,SAAO,CACzBC,UAAW,IAAIC,OACfC,UAAW,IAAIC,UAGhBC,KAAKC,IAAMP,QACXQ,SAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,UAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,UACAF,WAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,WAENZ,WAAAC,MAED,WACC,GAAIH,KAAKe,UAAW,CACnB,IAAMC,EAAOhB,KAAKiB,UAClBjB,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKU,GACnClB,UAAWE,KAAKC,IAAIH,UAAUe,QAE/BG,EAAKE,WAENhB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIL,UAAUuB,aAC3BjB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIH,UAAUqB,aAC3BjB,kBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,UAAUwB,UAC1BlB,cAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,UAAUuB,WAC1BnB,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,aAChBM,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,aAChB,ICtEmBwB,aAInB,OAAA9B,gBAFD,SAAA8B,IAAc7B,uBAAA6B,GACbtB,KAAKuB,SAAW,IAAIhC,MACpBW,SAAAC,MAED,SAAGqB,GACFxB,KAAKuB,YAAYC,MACjBtB,WAAAC,MAED,WACCH,KAAKuB,SAAST,UACdZ,WAAAC,MAED,WACCH,KAAKuB,SAASL,UACdhB,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASb,UACVV,KAAKuB,SAASX,cAEf,QACPV,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASR,UACVf,KAAKuB,SAASN,UAEf,QACPf,yBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASE,kBAAkBC,aAGxCxB,eAAAC,MACA,WACC,MAAO,CACNwB,MAAS3B,KAAKuB,SAASE,kBACvBG,MAAS5B,KAAKuB,SAASM,sBAExB3B,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASb,aACrBR,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASR,aACrBb,wBAAAC,MAED,WACCH,KAAKuB,SAAW,IAAIhC,KACpB"}
1
+ {"version":3,"file":"command-stack.js","sources":["../../src/command-stack/internal-stack.js","../../src/command-stack/command-stack.js"],"sourcesContent":["/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { List, Record, Stack } from \"immutable\";\n\nconst MAX_UNDO_COMMANDS = 100;\n\nexport default class InternalStack {\n\n\tconstructor() {\n\t\tconst recFac = new Record({\n\t\t\tundoCmnds: new List(),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tthis.rec = recFac();\n\t}\n\n\tdo(command) {\n\t\tthis.rec = this.rec.merge({\n\t\t\tundoCmnds: this.rec.undoCmnds.push(command),\n\t\t\tredoCmnds: new Stack()\n\t\t});\n\n\t\tif (this.rec.undoCmnds.size > MAX_UNDO_COMMANDS) {\n\t\t\tthis.rec = this.rec.set(\"undoCmnds\", this.rec.undoCmnds.shift());\n\t\t}\n\t\tcommand.do();\n\t}\n\n\tundo() {\n\t\tif (this.canUndo()) {\n\t\t\tconst prev = this.getPrevious();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.pop(),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.push(prev)\n\t\t\t});\n\t\t\tprev.undo();\n\t\t}\n\t}\n\n\tredo() {\n\t\tif (this.canRedo()) {\n\t\t\tconst next = this.getNext();\n\t\t\tthis.rec = this.rec.merge({\n\t\t\t\tundoCmnds: this.rec.undoCmnds.push(next),\n\t\t\t\tredoCmnds: this.rec.redoCmnds.pop()\n\t\t\t});\n\t\t\tnext.redo();\n\t\t}\n\t}\n\n\tcanUndo() {\n\t\treturn !this.rec.undoCmnds.isEmpty();\n\t}\n\n\tcanRedo() {\n\t\treturn !this.rec.redoCmnds.isEmpty();\n\t}\n\n\tgetPrevious() {\n\t\treturn this.rec.undoCmnds.last();\n\t}\n\n\tgetNext() {\n\t\treturn this.rec.redoCmnds.first();\n\t}\n\n\tgetUndoCommands() {\n\t\treturn this.rec.undoCmnds;\n\t}\n\n\tgetRedoCommands() {\n\t\treturn this.rec.redoCmnds;\n\t}\n}\n","/*\n * Copyright 2017-2023 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport InternalStack from \"./internal-stack.js\";\n\nexport default class CommandStack {\n\n\tconstructor() {\n\t\tthis.commands = new InternalStack();\n\t}\n\n\tdo(action) {\n\t\tthis.commands.do(action);\n\t}\n\n\tundo() {\n\t\tthis.commands.undo();\n\t}\n\n\tredo() {\n\t\tthis.commands.redo();\n\t}\n\n\tgetUndoCommand() {\n\t\tif (this.commands.canUndo()) {\n\t\t\treturn this.commands.getPrevious();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetRedoCommand() {\n\t\tif (this.commands.canRedo()) {\n\t\t\treturn this.commands.getNext();\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAllUndoCommands() {\n\t\treturn this.commands.getUndoCommands().toArray();\n\t}\n\n\tgetAllRedoCommands() {\n\t\treturn this.commands.getRedoCommands().toArray();\n\t}\n\n\t// need this for validation on unit tests\n\tgetStack() {\n\t\treturn {\n\t\t\t\"undos\": this.commands.getUndoCommands(),\n\t\t\t\"redos\": this.commands.getRedoCommands()\n\t\t};\n\t}\n\n\tcanUndo() {\n\t\treturn this.commands.canUndo();\n\t}\n\n\tcanRedo() {\n\t\treturn this.commands.canRedo();\n\t}\n\n\tclearCommandStack() {\n\t\tthis.commands = new InternalStack();\n\t}\n}\n"],"names":["InternalStack","_createClass","_classCallCheck","recFac","Record","undoCmnds","List","redoCmnds","Stack","this","rec","key","value","command","merge","push","size","set","shift","canUndo","prev","getPrevious","pop","undo","canRedo","next","getNext","redo","isEmpty","last","first","CommandStack","commands","action","getUndoCommands","toArray","getRedoCommands","undos","redos"],"mappings":"gFAoBqBA,aASnB,OAAAC,gBAPD,SAAAD,IAAcE,uBAAAF,GACb,IAAMG,EAAS,IAAIC,SAAO,CACzBC,UAAW,IAAIC,OACfC,UAAW,IAAIC,UAGhBC,KAAKC,IAAMP,QACXQ,SAAAC,MAED,SAAGC,GACFJ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKF,GACnCN,UAAW,IAAIC,UAGZC,KAAKC,IAAIL,UAAUW,KAnBC,MAoBvBP,KAAKC,IAAMD,KAAKC,IAAIO,IAAI,YAAaR,KAAKC,IAAIL,UAAUa,UAEzDL,UACAF,WAAAC,MAED,WACC,GAAIH,KAAKU,UAAW,CACnB,IAAMC,EAAOX,KAAKY,cAClBZ,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUiB,MAC9Bf,UAAWE,KAAKC,IAAIH,UAAUQ,KAAKK,KAEpCA,EAAKG,WAENZ,WAAAC,MAED,WACC,GAAIH,KAAKe,UAAW,CACnB,IAAMC,EAAOhB,KAAKiB,UAClBjB,KAAKC,IAAMD,KAAKC,IAAII,MAAM,CACzBT,UAAWI,KAAKC,IAAIL,UAAUU,KAAKU,GACnClB,UAAWE,KAAKC,IAAIH,UAAUe,QAE/BG,EAAKE,WAENhB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIL,UAAUuB,aAC3BjB,cAAAC,MAED,WACC,OAAQH,KAAKC,IAAIH,UAAUqB,aAC3BjB,kBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,UAAUwB,UAC1BlB,cAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,UAAUuB,WAC1BnB,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIL,aAChBM,sBAAAC,MAED,WACC,OAAOH,KAAKC,IAAIH,aAChB,ICtEmBwB,aAInB,OAAA9B,gBAFD,SAAA8B,IAAc7B,uBAAA6B,GACbtB,KAAKuB,SAAW,IAAIhC,MACpBW,SAAAC,MAED,SAAGqB,GACFxB,KAAKuB,YAAYC,MACjBtB,WAAAC,MAED,WACCH,KAAKuB,SAAST,UACdZ,WAAAC,MAED,WACCH,KAAKuB,SAASL,UACdhB,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASb,UACVV,KAAKuB,SAASX,cAEf,QACPV,qBAAAC,MAED,WACC,OAAIH,KAAKuB,SAASR,UACVf,KAAKuB,SAASN,UAEf,QACPf,yBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASE,kBAAkBC,aACvCxB,yBAAAC,MAED,WACC,OAAOH,KAAKuB,SAASI,kBAAkBD,aAGxCxB,eAAAC,MACA,WACC,MAAO,CACNyB,MAAS5B,KAAKuB,SAASE,kBACvBI,MAAS7B,KAAKuB,SAASI,sBAExBzB,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASb,aACrBR,cAAAC,MAED,WACC,OAAOH,KAAKuB,SAASR,aACrBb,wBAAAC,MAED,WACCH,KAAKuB,SAAW,IAAIhC,KACpB"}
@@ -1,2 +1,2 @@
1
- export{c as CommonProperties,P as PropertiesController}from"../common-properties-3cce68e0.js";export{F as FlexibleTable}from"../flexible-table-9c20861b.js";export{F as FieldPicker}from"../index-14181476.js";export{clem}from"./properties/clem.es.js";export{getPythonHints}from"./properties/getPythonHints.es.js";import"../createClass-02596015.js";import"../inherits-42ae8426.js";import"react";import"../canvas-constants-3bbfc8b1.js";import"../isArrayLikeObject-7a30aa4b.js";import"../datarecord-metadata-v3-schema-2311ecab.js";import"../bucket-8-de8062b8.js";import"../iconPropTypes-4cbeb95d-a0eae58e.js";import"prop-types";import"@carbon/react";import"react-portal";import"react-intl";import"react-redux";import"react-dom";import"../icon-3dbe67bf.js";import"react-inlinesvg";import"../bucket-2-b54707f5.js";import"uuid";import"./tooltip.es.js";import"../defineProperty-ad55dbff.js";import"redux";import"seedrandom";import"./command-stack.es.js";import"immutable";import"date-fns";import"../toolbar-35db2f4c.js";import"react-resize-detector";import"@codemirror/view";import"@codemirror/commands";import"codemirror";import"@codemirror/state";import"@codemirror/language";import"@codemirror/lang-python";import"@codemirror/lang-sql";import"@codemirror/lang-javascript";import"@codemirror/autocomplete";import"jsonschema";import"react-virtualized";import"react-draggable";
1
+ export{c as CommonProperties,P as PropertiesController}from"../common-properties-e64e7304.js";export{F as FlexibleTable}from"../flexible-table-9c20861b.js";export{F as FieldPicker}from"../index-14181476.js";export{clem}from"./properties/clem.es.js";export{getPythonHints}from"./properties/getPythonHints.es.js";import"../createClass-02596015.js";import"../inherits-42ae8426.js";import"react";import"../canvas-constants-3bbfc8b1.js";import"../isArrayLikeObject-7a30aa4b.js";import"../datarecord-metadata-v3-schema-2311ecab.js";import"../bucket-8-de8062b8.js";import"../iconPropTypes-4cbeb95d-a0eae58e.js";import"prop-types";import"@carbon/react";import"react-portal";import"react-intl";import"react-redux";import"react-dom";import"../icon-3dbe67bf.js";import"react-inlinesvg";import"../bucket-2-b54707f5.js";import"uuid";import"./tooltip.es.js";import"../defineProperty-ad55dbff.js";import"redux";import"seedrandom";import"./command-stack.es.js";import"immutable";import"date-fns";import"../toolbar-5417d781.js";import"react-resize-detector";import"@codemirror/view";import"@codemirror/commands";import"codemirror";import"@codemirror/state";import"@codemirror/language";import"@codemirror/lang-python";import"@codemirror/lang-sql";import"@codemirror/lang-javascript";import"@codemirror/autocomplete";import"jsonschema";import"react-virtualized";import"react-draggable";
2
2
  //# sourceMappingURL=properties.es.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-properties-5cac340d.js"),r=require("../flexible-table-e7485a71.js"),i=require("../index-41ab5ae3.js"),o=require("./properties/clem.js"),t=require("./properties/getPythonHints.js");require("../createClass-155bf7da.js"),require("../inherits-75817f22.js"),require("react"),require("../canvas-constants-8d240dc6.js"),require("../isArrayLikeObject-04f333a5.js"),require("../datarecord-metadata-v3-schema-d279dbb0.js"),require("../bucket-8-cc1980eb.js"),require("../iconPropTypes-4cbeb95d-2c6ff14c.js"),require("prop-types"),require("@carbon/react"),require("react-portal"),require("react-intl"),require("react-redux"),require("react-dom"),require("../icon-03405585.js"),require("react-inlinesvg"),require("../bucket-2-ead0e85a.js"),require("uuid"),require("./tooltip.js"),require("../defineProperty-bcc9968d.js"),require("redux"),require("seedrandom"),require("./command-stack.js"),require("immutable"),require("date-fns"),require("../toolbar-9b99500d.js"),require("react-resize-detector"),require("@codemirror/view"),require("@codemirror/commands"),require("codemirror"),require("@codemirror/state"),require("@codemirror/language"),require("@codemirror/lang-python"),require("@codemirror/lang-sql"),require("@codemirror/lang-javascript"),require("@codemirror/autocomplete"),require("jsonschema"),require("react-virtualized"),require("react-draggable"),exports.CommonProperties=e.commonProperties,exports.PropertiesController=e.PropertiesController,exports.FlexibleTable=r.FlexibleTable,exports.FieldPicker=i.FieldPicker,exports.clem=o.clem,exports.getPythonHints=t.getPythonHints;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-properties-ddfc6e24.js"),r=require("../flexible-table-e7485a71.js"),i=require("../index-41ab5ae3.js"),o=require("./properties/clem.js"),t=require("./properties/getPythonHints.js");require("../createClass-155bf7da.js"),require("../inherits-75817f22.js"),require("react"),require("../canvas-constants-8d240dc6.js"),require("../isArrayLikeObject-04f333a5.js"),require("../datarecord-metadata-v3-schema-d279dbb0.js"),require("../bucket-8-cc1980eb.js"),require("../iconPropTypes-4cbeb95d-2c6ff14c.js"),require("prop-types"),require("@carbon/react"),require("react-portal"),require("react-intl"),require("react-redux"),require("react-dom"),require("../icon-03405585.js"),require("react-inlinesvg"),require("../bucket-2-ead0e85a.js"),require("uuid"),require("./tooltip.js"),require("../defineProperty-bcc9968d.js"),require("redux"),require("seedrandom"),require("./command-stack.js"),require("immutable"),require("date-fns"),require("../toolbar-bcb3055d.js"),require("react-resize-detector"),require("@codemirror/view"),require("@codemirror/commands"),require("codemirror"),require("@codemirror/state"),require("@codemirror/language"),require("@codemirror/lang-python"),require("@codemirror/lang-sql"),require("@codemirror/lang-javascript"),require("@codemirror/autocomplete"),require("jsonschema"),require("react-virtualized"),require("react-draggable"),exports.CommonProperties=e.commonProperties,exports.PropertiesController=e.PropertiesController,exports.FlexibleTable=r.FlexibleTable,exports.FieldPicker=i.FieldPicker,exports.clem=o.clem,exports.getPythonHints=t.getPythonHints;
2
2
  //# sourceMappingURL=properties.js.map