@elliemae/ds-codeeditor 3.0.0-next.68 → 3.0.0-next.70

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.
@@ -119,6 +119,7 @@ const codeEditorProps = {
119
119
  showSyntaxChecks: import_react_desc.PropTypes.bool.description("show syntax warnings and checks").defaultValue(true)
120
120
  };
121
121
  DSCodeEditor.propTypes = codeEditorProps;
122
+ DSCodeEditor.displayName = "DSCodeEditor";
122
123
  const CodeEditorWithSchema = (0, import_react_desc.describe)(DSCodeEditor);
123
124
  CodeEditorWithSchema.propTypes = codeEditorProps;
124
125
  var DSCodeEditor_default = DSCodeEditor;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSCodeEditor.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport DSModal, { modalTypes } from '@elliemae/ds-modal';\nimport AceEditor from 'react-ace';\nimport DSCodeEditorForm from './components/DSCodeEditorForm';\nimport 'brace/mode/javascript.js';\nimport 'brace/theme/tomorrow.js';\n\nconst DSCodeEditor = ({\n containerProps = {},\n value: defaultValue = '',\n onSave = () => null,\n onClose = () => null,\n onReject = () => null,\n onChange = () => null,\n isOpen = false,\n fileName = '',\n confirmLabel = 'Save',\n maxLines = 20,\n minLines = 20,\n modalTitle = 'Javascript Editor',\n modalType = 'confirm',\n rejectLabel = 'Close',\n size = 'large',\n style = {},\n useModal = true,\n showHeader = true,\n showSyntaxChecks = true,\n}) => {\n const [{ value, errors }, setState] = useState({\n value: defaultValue,\n errors: [],\n });\n const reactAceComponent = useRef();\n\n const editor = (\n <>\n {showHeader && (\n <DSCodeEditorForm\n fileName={fileName}\n reactAceComponent={reactAceComponent}\n />\n )}\n <AceEditor\n ref={reactAceComponent}\n editorProps={{ $blockScrolling: true }}\n maxLines={maxLines}\n minLines={minLines}\n mode=\"javascript\"\n name=\"ace-code-edior\"\n onChange={(val) => {\n setState({ errors, value: val });\n onChange(val, errors);\n }}\n onValidate={(annotations) => setState({ value, errors: annotations })}\n theme=\"tomorrow\"\n setOptions={{\n useWorker: showSyntaxChecks,\n }}\n value={value}\n />\n </>\n );\n if (!useModal) return editor;\n return (\n <DSModal\n centered={false}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n isOpen={isOpen}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={() => onClose(value, fileName, errors)}\n onConfirm={() => onSave(value, fileName, errors)}\n onReject={() => onReject(value, fileName, errors)}\n rejectLabel={rejectLabel}\n size={size}\n style={style}\n >\n {editor}\n </DSModal>\n );\n};\n\nconst codeEditorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n value: PropTypes.string.description('editors content').isRequired,\n onSave: PropTypes.func.description(\n 'function called when the user press save',\n ),\n onClose: PropTypes.func.description(\n 'function called when the user closes the modal',\n ),\n onReject: PropTypes.func.description('function called when is rejected'),\n onChange: PropTypes.func.description(\n 'function executed when code editor value changes',\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the modal is opened or not')\n .defaultValue(false),\n fileName: PropTypes.string.description('File name to open in the editor'),\n maxLines: PropTypes.number\n .description('Max lines in the editor content')\n .defaultValue(20),\n minLines: PropTypes.number\n .description('Min lines in the editor content')\n .defaultValue(20),\n modalTitle: PropTypes.string\n .description('Modal title')\n .defaultValue('Javascript Editor'),\n confirmLabel: PropTypes.string\n .description('Customize modal confirm label')\n .defaultValue('Save'),\n rejectLabel: PropTypes.string\n .description('Customize modal rejection label')\n .defaultValue('Close'),\n modalType: PropTypes.oneOf(modalTypes)\n .description('Modal type')\n .defaultValue('confirm'),\n size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge'])\n .description('modal size')\n .defaultValue('large'),\n style: PropTypes.object.description('css inline style'),\n useModal: PropTypes.bool\n .description('whether to use code editor inside modal or not')\n .defaultValue(true),\n showHeader: PropTypes.bool\n .description('show editors header')\n .defaultValue(true),\n showSyntaxChecks: PropTypes.bool\n .description('show syntax warnings and checks')\n .defaultValue(true),\n};\n\nDSCodeEditor.propTypes = codeEditorProps;\n\nconst CodeEditorWithSchema = describe(DSCodeEditor);\nCodeEditorWithSchema.propTypes = codeEditorProps;\n\nexport { CodeEditorWithSchema, DSCodeEditor };\nexport default DSCodeEditor;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwC;AACxC,wBAAoC;AACpC,sBAAoC;AACpC,uBAAsB;AACtB,8BAA6B;AAC7B,wBAAO;AACP,sBAAO;AAEP,MAAM,eAAe,CAAC;AAAA,EACpB,iBAAiB,CAAC;AAAA,EAClB,OAAO,eAAe;AAAA,EACtB,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,WAAW,MAAM;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,OAAO;AAAA,EACP,QAAQ,CAAC;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,mBAAmB;AAAA,MACf;AACJ,QAAM,CAAC,EAAE,OAAO,UAAU,YAAY,2BAAS;AAAA,IAC7C,OAAO;AAAA,IACP,QAAQ,CAAC;AAAA,EACX,CAAC;AACD,QAAM,oBAAoB,yBAAO;AAEjC,QAAM,SACJ,wFACG,cACC,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,GACF,GAEF,mDAAC;AAAA,IACC,KAAK;AAAA,IACL,aAAa,EAAE,iBAAiB,KAAK;AAAA,IACrC;AAAA,IACA;AAAA,IACA,MAAK;AAAA,IACL,MAAK;AAAA,IACL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3C,aAAa,MAAM;AAAA,EACtB,aAAa,4BAAU,OACpB,YAAY,iCAAiC,EAC7C,aAAa,OAAO;AAAA,EACvB,WAAW,4BAAU,MAAM,0BAAU,EAClC,YAAY,YAAY,EACxB,aAAa,SAAS;AAAA,EACzB,MAAM,4BAAU,MAAM,CAAC,UAAU,SAAS,UAAU,SAAS,QAAQ,CAAC,EACnE,YAAY,YAAY,EACxB,aAAa,OAAO;AAAA,EACvB,OAAO,4BAAU,OAAO,YAAY,kBAAkB;AAAA,EACtD,UAAU,4BAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,IAAI;AAAA,EACpB,YAAY,4BAAU,KACnB,YAAY,qBAAqB,EACjC,aAAa,IAAI;AAAA,EACpB,kBAAkB,4BAAU,KACzB,YAAY,iCAAiC,EAC7C,aAAa,IAAI;AACtB;AAEA,aAAa,YAAY;AAEzB,MAAM,uBAAuB,gCAAS,YAAY;AAClD,qBAAqB,YAAY;AAGjC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport DSModal, { modalTypes } from '@elliemae/ds-modal';\nimport AceEditor from 'react-ace';\nimport DSCodeEditorForm from './components/DSCodeEditorForm';\nimport 'brace/mode/javascript.js';\nimport 'brace/theme/tomorrow.js';\n\nconst DSCodeEditor = ({\n containerProps = {},\n value: defaultValue = '',\n onSave = () => null,\n onClose = () => null,\n onReject = () => null,\n onChange = () => null,\n isOpen = false,\n fileName = '',\n confirmLabel = 'Save',\n maxLines = 20,\n minLines = 20,\n modalTitle = 'Javascript Editor',\n modalType = 'confirm',\n rejectLabel = 'Close',\n size = 'large',\n style = {},\n useModal = true,\n showHeader = true,\n showSyntaxChecks = true,\n}) => {\n const [{ value, errors }, setState] = useState({\n value: defaultValue,\n errors: [],\n });\n const reactAceComponent = useRef();\n\n const editor = (\n <>\n {showHeader && (\n <DSCodeEditorForm\n fileName={fileName}\n reactAceComponent={reactAceComponent}\n />\n )}\n <AceEditor\n ref={reactAceComponent}\n editorProps={{ $blockScrolling: true }}\n maxLines={maxLines}\n minLines={minLines}\n mode=\"javascript\"\n name=\"ace-code-edior\"\n onChange={(val) => {\n setState({ errors, value: val });\n onChange(val, errors);\n }}\n onValidate={(annotations) => setState({ value, errors: annotations })}\n theme=\"tomorrow\"\n setOptions={{\n useWorker: showSyntaxChecks,\n }}\n value={value}\n />\n </>\n );\n if (!useModal) return editor;\n return (\n <DSModal\n centered={false}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n isOpen={isOpen}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={() => onClose(value, fileName, errors)}\n onConfirm={() => onSave(value, fileName, errors)}\n onReject={() => onReject(value, fileName, errors)}\n rejectLabel={rejectLabel}\n size={size}\n style={style}\n >\n {editor}\n </DSModal>\n );\n};\n\nconst codeEditorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n value: PropTypes.string.description('editors content').isRequired,\n onSave: PropTypes.func.description(\n 'function called when the user press save',\n ),\n onClose: PropTypes.func.description(\n 'function called when the user closes the modal',\n ),\n onReject: PropTypes.func.description('function called when is rejected'),\n onChange: PropTypes.func.description(\n 'function executed when code editor value changes',\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the modal is opened or not')\n .defaultValue(false),\n fileName: PropTypes.string.description('File name to open in the editor'),\n maxLines: PropTypes.number\n .description('Max lines in the editor content')\n .defaultValue(20),\n minLines: PropTypes.number\n .description('Min lines in the editor content')\n .defaultValue(20),\n modalTitle: PropTypes.string\n .description('Modal title')\n .defaultValue('Javascript Editor'),\n confirmLabel: PropTypes.string\n .description('Customize modal confirm label')\n .defaultValue('Save'),\n rejectLabel: PropTypes.string\n .description('Customize modal rejection label')\n .defaultValue('Close'),\n modalType: PropTypes.oneOf(modalTypes)\n .description('Modal type')\n .defaultValue('confirm'),\n size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge'])\n .description('modal size')\n .defaultValue('large'),\n style: PropTypes.object.description('css inline style'),\n useModal: PropTypes.bool\n .description('whether to use code editor inside modal or not')\n .defaultValue(true),\n showHeader: PropTypes.bool\n .description('show editors header')\n .defaultValue(true),\n showSyntaxChecks: PropTypes.bool\n .description('show syntax warnings and checks')\n .defaultValue(true),\n};\n\nDSCodeEditor.propTypes = codeEditorProps;\nDSCodeEditor.displayName = 'DSCodeEditor';\nconst CodeEditorWithSchema = describe(DSCodeEditor);\nCodeEditorWithSchema.propTypes = codeEditorProps;\n\nexport { CodeEditorWithSchema, DSCodeEditor };\nexport default DSCodeEditor;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwC;AACxC,wBAAoC;AACpC,sBAAoC;AACpC,uBAAsB;AACtB,8BAA6B;AAC7B,wBAAO;AACP,sBAAO;AAEP,MAAM,eAAe,CAAC;AAAA,EACpB,iBAAiB,CAAC;AAAA,EAClB,OAAO,eAAe;AAAA,EACtB,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,WAAW,MAAM;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,OAAO;AAAA,EACP,QAAQ,CAAC;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,mBAAmB;AAAA,MACf;AACJ,QAAM,CAAC,EAAE,OAAO,UAAU,YAAY,2BAAS;AAAA,IAC7C,OAAO;AAAA,IACP,QAAQ,CAAC;AAAA,EACX,CAAC;AACD,QAAM,oBAAoB,yBAAO;AAEjC,QAAM,SACJ,wFACG,cACC,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,GACF,GAEF,mDAAC;AA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AAE;AAAA,EAClB,YAAY,4BAAU,OACnB,YAAY,aAAa,EACzB,aAAa,mBAAmB;AAAA,EACnC,cAAc,4BAAU,OACrB,YAAY,+BAA+B,EAC3C,aAAa,MAAM;AAAA,EACtB,aAAa,4BAAU,OACpB,YAAY,iCAAiC,EAC7C,aAAa,OAAO;AAAA,EACvB,WAAW,4BAAU,MAAM,0BAAU,EAClC,YAAY,YAAY,EACxB,aAAa,SAAS;AAAA,EACzB,MAAM,4BAAU,MAAM,CAAC,UAAU,SAAS,UAAU,SAAS,QAAQ,CAAC,EACnE,YAAY,YAAY,EACxB,aAAa,OAAO;AAAA,EACvB,OAAO,4BAAU,OAAO,YAAY,kBAAkB;AAAA,EACtD,UAAU,4BAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,IAAI;AAAA,EACpB,YAAY,4BAAU,KACnB,YAAY,qBAAqB,EACjC,aAAa,IAAI;AAAA,EACpB,kBAAkB,4BAAU,KACzB,YAAY,iCAAiC,EAC7C,aAAa,IAAI;AACtB;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,uBAAuB,gCAAS,YAAY;AAClD,qBAAqB,YAAY;AAGjC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -92,6 +92,7 @@ const codeEditorProps = {
92
92
  showSyntaxChecks: PropTypes.bool.description("show syntax warnings and checks").defaultValue(true)
93
93
  };
94
94
  DSCodeEditor.propTypes = codeEditorProps;
95
+ DSCodeEditor.displayName = "DSCodeEditor";
95
96
  const CodeEditorWithSchema = describe(DSCodeEditor);
96
97
  CodeEditorWithSchema.propTypes = codeEditorProps;
97
98
  var DSCodeEditor_default = DSCodeEditor;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSCodeEditor.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport DSModal, { modalTypes } from '@elliemae/ds-modal';\nimport AceEditor from 'react-ace';\nimport DSCodeEditorForm from './components/DSCodeEditorForm';\nimport 'brace/mode/javascript.js';\nimport 'brace/theme/tomorrow.js';\n\nconst DSCodeEditor = ({\n containerProps = {},\n value: defaultValue = '',\n onSave = () => null,\n onClose = () => null,\n onReject = () => null,\n onChange = () => null,\n isOpen = false,\n fileName = '',\n confirmLabel = 'Save',\n maxLines = 20,\n minLines = 20,\n modalTitle = 'Javascript Editor',\n modalType = 'confirm',\n rejectLabel = 'Close',\n size = 'large',\n style = {},\n useModal = true,\n showHeader = true,\n showSyntaxChecks = true,\n}) => {\n const [{ value, errors }, setState] = useState({\n value: defaultValue,\n errors: [],\n });\n const reactAceComponent = useRef();\n\n const editor = (\n <>\n {showHeader && (\n <DSCodeEditorForm\n fileName={fileName}\n reactAceComponent={reactAceComponent}\n />\n )}\n <AceEditor\n ref={reactAceComponent}\n editorProps={{ $blockScrolling: true }}\n maxLines={maxLines}\n minLines={minLines}\n mode=\"javascript\"\n name=\"ace-code-edior\"\n onChange={(val) => {\n setState({ errors, value: val });\n onChange(val, errors);\n }}\n onValidate={(annotations) => setState({ value, errors: annotations })}\n theme=\"tomorrow\"\n setOptions={{\n useWorker: showSyntaxChecks,\n }}\n value={value}\n />\n </>\n );\n if (!useModal) return editor;\n return (\n <DSModal\n centered={false}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n isOpen={isOpen}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={() => onClose(value, fileName, errors)}\n onConfirm={() => onSave(value, fileName, errors)}\n onReject={() => onReject(value, fileName, errors)}\n rejectLabel={rejectLabel}\n size={size}\n style={style}\n >\n {editor}\n </DSModal>\n );\n};\n\nconst codeEditorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n value: PropTypes.string.description('editors content').isRequired,\n onSave: PropTypes.func.description(\n 'function called when the user press save',\n ),\n onClose: PropTypes.func.description(\n 'function called when the user closes the modal',\n ),\n onReject: PropTypes.func.description('function called when is rejected'),\n onChange: PropTypes.func.description(\n 'function executed when code editor value changes',\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the modal is opened or not')\n .defaultValue(false),\n fileName: PropTypes.string.description('File name to open in the editor'),\n maxLines: PropTypes.number\n .description('Max lines in the editor content')\n .defaultValue(20),\n minLines: PropTypes.number\n .description('Min lines in the editor content')\n .defaultValue(20),\n modalTitle: PropTypes.string\n .description('Modal title')\n .defaultValue('Javascript Editor'),\n confirmLabel: PropTypes.string\n .description('Customize modal confirm label')\n .defaultValue('Save'),\n rejectLabel: PropTypes.string\n .description('Customize modal rejection label')\n .defaultValue('Close'),\n modalType: PropTypes.oneOf(modalTypes)\n .description('Modal type')\n .defaultValue('confirm'),\n size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge'])\n .description('modal size')\n .defaultValue('large'),\n style: PropTypes.object.description('css inline style'),\n useModal: PropTypes.bool\n .description('whether to use code editor inside modal or not')\n .defaultValue(true),\n showHeader: PropTypes.bool\n .description('show editors header')\n .defaultValue(true),\n showSyntaxChecks: PropTypes.bool\n .description('show syntax warnings and checks')\n .defaultValue(true),\n};\n\nDSCodeEditor.propTypes = codeEditorProps;\n\nconst CodeEditorWithSchema = describe(DSCodeEditor);\nCodeEditorWithSchema.propTypes = codeEditorProps;\n\nexport { CodeEditorWithSchema, DSCodeEditor };\nexport default DSCodeEditor;\n"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB,iBAAiB,CAAC;AAAA,EAClB,OAAO,eAAe;AAAA,EACtB,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,WAAW,MAAM;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa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AS,UAAU,KAAK,YACtB,gDACF;AAAA,EACA,UAAU,UAAU,KAAK,YAAY,kCAAkC;AAAA,EACvE,UAAU,UAAU,KAAK,YACvB,kDACF,EAAE;AAAA,EACF,QAAQ,UAAU,KACf,YAAY,oCAAoC,EAChD,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,OAAO,YAAY,iCAAiC;AAAA,EACxE,UAAU,UAAU,OACjB,YAAY,iCAAiC,EAC7C,aAAa,EAAE;AAAA,EAClB,UAAU,UAAU,OACjB,YAAY,iCAAiC,EAC7C,aAAa,EAAE;AAAA,EAClB,YAAY,UAAU,OACnB,YAAY,aAAa,EACzB,aAAa,mBAAmB;AAAA,EACnC,cAAc,UAAU,OACrB,YAAY,+BAA+B,EAC3C,aAAa,MAAM;AAAA,EACtB,aAAa,UAAU,OACpB,YAAY,iCAAiC,EAC7C,aAAa,OAAO;AAAA,EACvB,WAAW,UAAU,MAAM,UAAU,EAClC,YAAY,YAAY,EACxB,aAAa,SAAS;AAAA,EACzB,MAAM,UAAU,MAAM,CAAC,UAAU,SAAS,UAAU,SAAS,QAAQ,CAAC,EACnE,YAAY,YAAY,EACxB,aAAa,OAAO;AAAA,EACvB,OAAO,UAAU,OAAO,YAAY,kBAAkB;AAAA,EACtD,UAAU,UAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,IAAI;AAAA,EACpB,YAAY,UAAU,KACnB,YAAY,qBAAqB,EACjC,aAAa,IAAI;AAAA,EACpB,kBAAkB,UAAU,KACzB,YAAY,iCAAiC,EAC7C,aAAa,IAAI;AACtB;AAEA,aAAa,YAAY;AAEzB,MAAM,uBAAuB,SAAS,YAAY;AAClD,qBAAqB,YAAY;AAGjC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport DSModal, { modalTypes } from '@elliemae/ds-modal';\nimport AceEditor from 'react-ace';\nimport DSCodeEditorForm from './components/DSCodeEditorForm';\nimport 'brace/mode/javascript.js';\nimport 'brace/theme/tomorrow.js';\n\nconst DSCodeEditor = ({\n containerProps = {},\n value: defaultValue = '',\n onSave = () => null,\n onClose = () => null,\n onReject = () => null,\n onChange = () => null,\n isOpen = false,\n fileName = '',\n confirmLabel = 'Save',\n maxLines = 20,\n minLines = 20,\n modalTitle = 'Javascript Editor',\n modalType = 'confirm',\n rejectLabel = 'Close',\n size = 'large',\n style = {},\n useModal = true,\n showHeader = true,\n showSyntaxChecks = true,\n}) => {\n const [{ value, errors }, setState] = useState({\n value: defaultValue,\n errors: [],\n });\n const reactAceComponent = useRef();\n\n const editor = (\n <>\n {showHeader && (\n <DSCodeEditorForm\n fileName={fileName}\n reactAceComponent={reactAceComponent}\n />\n )}\n <AceEditor\n ref={reactAceComponent}\n editorProps={{ $blockScrolling: true }}\n maxLines={maxLines}\n minLines={minLines}\n mode=\"javascript\"\n name=\"ace-code-edior\"\n onChange={(val) => {\n setState({ errors, value: val });\n onChange(val, errors);\n }}\n onValidate={(annotations) => setState({ value, errors: annotations })}\n theme=\"tomorrow\"\n setOptions={{\n useWorker: showSyntaxChecks,\n }}\n value={value}\n />\n </>\n );\n if (!useModal) return editor;\n return (\n <DSModal\n centered={false}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n isOpen={isOpen}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={() => onClose(value, fileName, errors)}\n onConfirm={() => onSave(value, fileName, errors)}\n onReject={() => onReject(value, fileName, errors)}\n rejectLabel={rejectLabel}\n size={size}\n style={style}\n >\n {editor}\n </DSModal>\n );\n};\n\nconst codeEditorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n value: PropTypes.string.description('editors content').isRequired,\n onSave: PropTypes.func.description(\n 'function called when the user press save',\n ),\n onClose: PropTypes.func.description(\n 'function called when the user closes the modal',\n ),\n onReject: PropTypes.func.description('function called when is rejected'),\n onChange: PropTypes.func.description(\n 'function executed when code editor value changes',\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the modal is opened or not')\n .defaultValue(false),\n fileName: PropTypes.string.description('File name to open in the editor'),\n maxLines: PropTypes.number\n .description('Max lines in the editor content')\n .defaultValue(20),\n minLines: PropTypes.number\n .description('Min lines in the editor content')\n .defaultValue(20),\n modalTitle: PropTypes.string\n .description('Modal title')\n .defaultValue('Javascript Editor'),\n confirmLabel: PropTypes.string\n .description('Customize modal confirm label')\n .defaultValue('Save'),\n rejectLabel: PropTypes.string\n .description('Customize modal rejection label')\n .defaultValue('Close'),\n modalType: PropTypes.oneOf(modalTypes)\n .description('Modal type')\n .defaultValue('confirm'),\n size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge'])\n .description('modal size')\n .defaultValue('large'),\n style: PropTypes.object.description('css inline style'),\n useModal: PropTypes.bool\n .description('whether to use code editor inside modal or not')\n .defaultValue(true),\n showHeader: PropTypes.bool\n .description('show editors header')\n .defaultValue(true),\n showSyntaxChecks: PropTypes.bool\n .description('show syntax warnings and checks')\n .defaultValue(true),\n};\n\nDSCodeEditor.propTypes = codeEditorProps;\nDSCodeEditor.displayName = 'DSCodeEditor';\nconst CodeEditorWithSchema = describe(DSCodeEditor);\nCodeEditorWithSchema.propTypes = codeEditorProps;\n\nexport { CodeEditorWithSchema, DSCodeEditor };\nexport default DSCodeEditor;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB,iBAAiB,CAAC;AAAA,EAClB,OAAO,eAAe;AAAA,EACtB,SAAS,MAAM;AAAA,EACf,UAAU,MAAM;AAAA,EAChB,WAAW,MAAM;AAAA,EACjB,WAAW,MAAM;AAAA,EACjB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,O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U,KAAK,YAAY,kCAAkC;AAAA,EACvE,UAAU,UAAU,KAAK,YACvB,kDACF,EAAE;AAAA,EACF,QAAQ,UAAU,KACf,YAAY,oCAAoC,EAChD,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,OAAO,YAAY,iCAAiC;AAAA,EACxE,UAAU,UAAU,OACjB,YAAY,iCAAiC,EAC7C,aAAa,EAAE;AAAA,EAClB,UAAU,UAAU,OACjB,YAAY,iCAAiC,EAC7C,aAAa,EAAE;AAAA,EAClB,YAAY,UAAU,OACnB,YAAY,aAAa,EACzB,aAAa,mBAAmB;AAAA,EACnC,cAAc,UAAU,OACrB,YAAY,+BAA+B,EAC3C,aAAa,MAAM;AAAA,EACtB,aAAa,UAAU,OACpB,YAAY,iCAAiC,EAC7C,aAAa,OAAO;AAAA,EACvB,WAAW,UAAU,MAAM,UAAU,EAClC,YAAY,YAAY,EACxB,aAAa,SAAS;AAAA,EACzB,MAAM,UAAU,MAAM,CAAC,UAAU,SAAS,UAAU,SAAS,QAAQ,CAAC,EACnE,YAAY,YAAY,EACxB,aAAa,OAAO;AAAA,EACvB,OAAO,UAAU,OAAO,YAAY,kBAAkB;AAAA,EACtD,UAAU,UAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,IAAI;AAAA,EACpB,YAAY,UAAU,KACnB,YAAY,qBAAqB,EACjC,aAAa,IAAI;AAAA,EACpB,kBAAkB,UAAU,KACzB,YAAY,iCAAiC,EAC7C,aAAa,IAAI;AACtB;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,uBAAuB,SAAS,YAAY;AAClD,qBAAqB,YAAY;AAGjC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-codeeditor",
3
- "version": "3.0.0-next.68",
3
+ "version": "3.0.0-next.70",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Code Editor",
6
6
  "files": [