@elliemae/ds-codeeditor 3.1.0-next.2 → 3.1.0-next.5

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.
@@ -27,7 +27,7 @@ __export(DSCodeEditor_exports, {
27
27
  module.exports = __toCommonJS(DSCodeEditor_exports);
28
28
  var React = __toESM(require("react"));
29
29
  var import_react = __toESM(require("react"));
30
- var import_react_desc = require("react-desc");
30
+ var import_ds_utilities = require("@elliemae/ds-utilities");
31
31
  var import_ds_modal = __toESM(require("@elliemae/ds-modal"));
32
32
  var import_react_ace = __toESM(require("react-ace"));
33
33
  var import_DSCodeEditorForm = __toESM(require("./components/DSCodeEditorForm"));
@@ -98,29 +98,29 @@ const DSCodeEditor = ({
98
98
  }, editor);
99
99
  };
100
100
  const codeEditorProps = {
101
- containerProps: import_react_desc.PropTypes.object.description("Set of Properties attached to the main container"),
102
- value: import_react_desc.PropTypes.string.description("editors content").isRequired,
103
- onSave: import_react_desc.PropTypes.func.description("function called when the user press save"),
104
- onClose: import_react_desc.PropTypes.func.description("function called when the user closes the modal"),
105
- onReject: import_react_desc.PropTypes.func.description("function called when is rejected"),
106
- onChange: import_react_desc.PropTypes.func.description("function executed when code editor value changes").isRequired,
107
- isOpen: import_react_desc.PropTypes.bool.description("Whether the modal is opened or not").defaultValue(false),
108
- fileName: import_react_desc.PropTypes.string.description("File name to open in the editor"),
109
- maxLines: import_react_desc.PropTypes.number.description("Max lines in the editor content").defaultValue(20),
110
- minLines: import_react_desc.PropTypes.number.description("Min lines in the editor content").defaultValue(20),
111
- modalTitle: import_react_desc.PropTypes.string.description("Modal title").defaultValue("Javascript Editor"),
112
- confirmLabel: import_react_desc.PropTypes.string.description("Customize modal confirm label").defaultValue("Save"),
113
- rejectLabel: import_react_desc.PropTypes.string.description("Customize modal rejection label").defaultValue("Close"),
114
- modalType: import_react_desc.PropTypes.oneOf(import_ds_modal.modalTypes).description("Modal type").defaultValue("confirm"),
115
- size: import_react_desc.PropTypes.oneOf(["xsmall", "small", "medium", "large", "xlarge"]).description("modal size").defaultValue("large"),
116
- style: import_react_desc.PropTypes.object.description("css inline style"),
117
- useModal: import_react_desc.PropTypes.bool.description("whether to use code editor inside modal or not").defaultValue(true),
118
- showHeader: import_react_desc.PropTypes.bool.description("show editors header").defaultValue(true),
119
- showSyntaxChecks: import_react_desc.PropTypes.bool.description("show syntax warnings and checks").defaultValue(true)
101
+ containerProps: import_ds_utilities.PropTypes.object.description("Set of Properties attached to the main container"),
102
+ value: import_ds_utilities.PropTypes.string.description("editors content").isRequired,
103
+ onSave: import_ds_utilities.PropTypes.func.description("function called when the user press save"),
104
+ onClose: import_ds_utilities.PropTypes.func.description("function called when the user closes the modal"),
105
+ onReject: import_ds_utilities.PropTypes.func.description("function called when is rejected"),
106
+ onChange: import_ds_utilities.PropTypes.func.description("function executed when code editor value changes").isRequired,
107
+ isOpen: import_ds_utilities.PropTypes.bool.description("Whether the modal is opened or not").defaultValue(false),
108
+ fileName: import_ds_utilities.PropTypes.string.description("File name to open in the editor"),
109
+ maxLines: import_ds_utilities.PropTypes.number.description("Max lines in the editor content").defaultValue(20),
110
+ minLines: import_ds_utilities.PropTypes.number.description("Min lines in the editor content").defaultValue(20),
111
+ modalTitle: import_ds_utilities.PropTypes.string.description("Modal title").defaultValue("Javascript Editor"),
112
+ confirmLabel: import_ds_utilities.PropTypes.string.description("Customize modal confirm label").defaultValue("Save"),
113
+ rejectLabel: import_ds_utilities.PropTypes.string.description("Customize modal rejection label").defaultValue("Close"),
114
+ modalType: import_ds_utilities.PropTypes.oneOf(import_ds_modal.modalTypes).description("Modal type").defaultValue("confirm"),
115
+ size: import_ds_utilities.PropTypes.oneOf(["xsmall", "small", "medium", "large", "xlarge"]).description("modal size").defaultValue("large"),
116
+ style: import_ds_utilities.PropTypes.object.description("css inline style"),
117
+ useModal: import_ds_utilities.PropTypes.bool.description("whether to use code editor inside modal or not").defaultValue(true),
118
+ showHeader: import_ds_utilities.PropTypes.bool.description("show editors header").defaultValue(true),
119
+ showSyntaxChecks: import_ds_utilities.PropTypes.bool.description("show syntax warnings and checks").defaultValue(true)
120
120
  };
121
121
  DSCodeEditor.propTypes = codeEditorProps;
122
122
  DSCodeEditor.displayName = "DSCodeEditor";
123
- const CodeEditorWithSchema = (0, import_react_desc.describe)(DSCodeEditor);
123
+ const CodeEditorWithSchema = (0, import_ds_utilities.describe)(DSCodeEditor);
124
124
  CodeEditorWithSchema.propTypes = codeEditorProps;
125
125
  var DSCodeEditor_default = DSCodeEditor;
126
126
  //# sourceMappingURL=DSCodeEditor.js.map
@@ -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;\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;AAAA,IACC,KAAK;AAAA,IACL,aAAa,EAAE,iBAAiB,KAAK;AAAA,IACrC;AAAA,IACA;AAAA,IACA,MAAK;AAAA,IACL,MAAK;AAAA,IACL,UAAU,CAAC,QAAQ;A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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;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useRef } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\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,0BAAoC;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,mDAA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Aa,EAAE;AAAA,EAClB,YAAY,8BAAU,OACnB,YAAY,aAAa,EACzB,aAAa,mBAAmB;AAAA,EACnC,cAAc,8BAAU,OACrB,YAAY,+BAA+B,EAC3C,aAAa,MAAM;AAAA,EACtB,aAAa,8BAAU,OACpB,YAAY,iCAAiC,EAC7C,aAAa,OAAO;AAAA,EACvB,WAAW,8BAAU,MAAM,0BAAU,EAClC,YAAY,YAAY,EACxB,aAAa,SAAS;AAAA,EACzB,MAAM,8BAAU,MAAM,CAAC,UAAU,SAAS,UAAU,SAAS,QAAQ,CAAC,EACnE,YAAY,YAAY,EACxB,aAAa,OAAO;AAAA,EACvB,OAAO,8BAAU,OAAO,YAAY,kBAAkB;AAAA,EACtD,UAAU,8BAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,IAAI;AAAA,EACpB,YAAY,8BAAU,KACnB,YAAY,qBAAqB,EACjC,aAAa,IAAI;AAAA,EACpB,kBAAkB,8BAAU,KACzB,YAAY,iCAAiC,EAC7C,aAAa,IAAI;AACtB;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,uBAAuB,kCAAS,YAAY;AAClD,qBAAqB,YAAY;AAGjC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React2, { useState, useRef } from "react";
3
- import { describe, PropTypes } from "react-desc";
3
+ import { describe, PropTypes } from "@elliemae/ds-utilities";
4
4
  import DSModal, { modalTypes } from "@elliemae/ds-modal";
5
5
  import AceEditor from "react-ace";
6
6
  import DSCodeEditorForm from "./components/DSCodeEditorForm";
@@ -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;\nDSCodeEditor.displayName = 'DSCodeEditor';\nconst CodeEditorWithSchema = describe(DSCodeEditor);\nCodeEditorWithSchema.propTypes = codeEditorProps;\n\nexport { CodeEditorWithSchema, DSCodeEditor };\nexport default DSCodeEditor;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useRef } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\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
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,OAAO;AAAA,EACP,QAAQ,CAAC;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,mBAAmB;AAAA,MACf;AACJ,QAAM,CAAC,EAAE,OAAO,UAAU,YAAY,SAAS;AAAA,IAC7C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AU,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.1.0-next.2",
3
+ "version": "3.1.0-next.5",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Code Editor",
6
6
  "files": [
@@ -46,22 +46,15 @@
46
46
  "reportFile": "tests.xml",
47
47
  "indent": 4
48
48
  },
49
- "scripts": {
50
- "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
51
- "test": "node ../../scripts/testing/test.mjs",
52
- "lint": "node ../../scripts/lint.mjs",
53
- "dts": "node ../../scripts/dts.mjs",
54
- "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
55
- },
56
49
  "dependencies": {
57
- "@elliemae/ds-button": "3.1.0-next.2",
58
- "@elliemae/ds-classnames": "3.1.0-next.2",
59
- "@elliemae/ds-form": "3.1.0-next.2",
60
- "@elliemae/ds-icons": "3.1.0-next.2",
61
- "@elliemae/ds-modal": "3.1.0-next.2",
50
+ "@elliemae/ds-button": "3.1.0-next.5",
51
+ "@elliemae/ds-classnames": "3.1.0-next.5",
52
+ "@elliemae/ds-form": "3.1.0-next.5",
53
+ "@elliemae/ds-icons": "3.1.0-next.5",
54
+ "@elliemae/ds-modal": "3.1.0-next.5",
55
+ "@elliemae/ds-utilities": "3.1.0-next.5",
62
56
  "brace": "~0.11.1",
63
- "react-ace": "~6.6.0",
64
- "react-desc": "~4.1.3"
57
+ "react-ace": "~6.6.0"
65
58
  },
66
59
  "peerDependencies": {
67
60
  "lodash": "^4.17.21",
@@ -71,5 +64,13 @@
71
64
  "publishConfig": {
72
65
  "access": "public",
73
66
  "typeSafety": false
67
+ },
68
+ "scripts": {
69
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
70
+ "test": "node ../../scripts/testing/test.mjs",
71
+ "lint": "node ../../scripts/lint.mjs",
72
+ "dts": "node ../../scripts/dts.mjs",
73
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
74
+ "checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
74
75
  }
75
- }
76
+ }