@api-client/ui 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/elements/highlight/MarkdownStyles.d.ts.map +1 -1
- package/build/src/elements/highlight/MarkdownStyles.js +0 -13
- package/build/src/elements/highlight/MarkdownStyles.js.map +1 -1
- package/build/src/elements/http/BodyEditor.d.ts +0 -13
- package/build/src/elements/http/BodyEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyEditor.js +0 -13
- package/build/src/elements/http/BodyEditor.js.map +1 -1
- package/build/src/elements/http/BodyTextEditor.d.ts +0 -13
- package/build/src/elements/http/BodyTextEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyTextEditor.js +0 -13
- package/build/src/elements/http/BodyTextEditor.js.map +1 -1
- package/build/src/elements/http/BodyUrlEncodedEditor.d.ts +0 -13
- package/build/src/elements/http/BodyUrlEncodedEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyUrlEncodedEditor.js +0 -13
- package/build/src/elements/http/BodyUrlEncodedEditor.js.map +1 -1
- package/build/src/elements/http/UrlInput.d.ts +0 -13
- package/build/src/elements/http/UrlInput.d.ts.map +1 -1
- package/build/src/elements/http/UrlInput.js +0 -13
- package/build/src/elements/http/UrlInput.js.map +1 -1
- package/build/src/index.d.ts +2 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +2 -0
- package/build/src/index.js.map +1 -1
- package/build/src/md/button/internals/button.styles.js +1 -1
- package/build/src/md/button/internals/button.styles.js.map +1 -1
- package/build/src/md/date/internals/DateTime.d.ts +0 -13
- package/build/src/md/date/internals/DateTime.d.ts.map +1 -1
- package/build/src/md/date/internals/DateTime.js +0 -13
- package/build/src/md/date/internals/DateTime.js.map +1 -1
- package/build/src/md/date-picker/index.d.ts +13 -0
- package/build/src/md/date-picker/index.d.ts.map +1 -0
- package/build/src/md/date-picker/index.js +13 -0
- package/build/src/md/date-picker/index.js.map +1 -0
- package/build/src/md/date-picker/internals/DatePicker.styles.d.ts +4 -0
- package/build/src/md/date-picker/internals/DatePicker.styles.d.ts.map +1 -0
- package/build/src/md/date-picker/internals/DatePicker.styles.js +336 -0
- package/build/src/md/date-picker/internals/DatePicker.styles.js.map +1 -0
- package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts +159 -0
- package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts.map +1 -0
- package/build/src/md/date-picker/internals/DatePickerCalendar.js +770 -0
- package/build/src/md/date-picker/internals/DatePickerCalendar.js.map +1 -0
- package/build/src/md/date-picker/internals/DatePickerUtils.d.ts +93 -0
- package/build/src/md/date-picker/internals/DatePickerUtils.d.ts.map +1 -0
- package/build/src/md/date-picker/internals/DatePickerUtils.js +221 -0
- package/build/src/md/date-picker/internals/DatePickerUtils.js.map +1 -0
- package/build/src/md/date-picker/ui-date-picker-input.d.ts +108 -0
- package/build/src/md/date-picker/ui-date-picker-input.d.ts.map +1 -0
- package/build/src/md/date-picker/ui-date-picker-input.js +397 -0
- package/build/src/md/date-picker/ui-date-picker-input.js.map +1 -0
- package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts +119 -0
- package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts.map +1 -0
- package/build/src/md/date-picker/ui-date-picker-modal-input.js +473 -0
- package/build/src/md/date-picker/ui-date-picker-modal-input.js.map +1 -0
- package/build/src/md/date-picker/ui-date-picker-modal.d.ts +108 -0
- package/build/src/md/date-picker/ui-date-picker-modal.d.ts.map +1 -0
- package/build/src/md/date-picker/ui-date-picker-modal.js +344 -0
- package/build/src/md/date-picker/ui-date-picker-modal.js.map +1 -0
- package/build/src/md/dialog/internals/Dialog.styles.d.ts.map +1 -1
- package/build/src/md/dialog/internals/Dialog.styles.js +1 -0
- package/build/src/md/dialog/internals/Dialog.styles.js.map +1 -1
- package/demo/elements/har/har2.json +1 -1
- package/demo/md/date-picker/date-picker.ts +301 -0
- package/demo/md/date-picker/index.html +171 -0
- package/demo/md/index.html +2 -0
- package/package.json +1 -1
- package/src/elements/highlight/MarkdownStyles.ts +0 -13
- package/src/elements/http/BodyEditor.ts +0 -13
- package/src/elements/http/BodyTextEditor.ts +0 -13
- package/src/elements/http/BodyUrlEncodedEditor.ts +0 -13
- package/src/elements/http/UrlInput.ts +0 -13
- package/src/index.ts +17 -0
- package/src/md/button/internals/button.styles.ts +1 -1
- package/src/md/date/internals/DateTime.ts +0 -14
- package/src/md/date-picker/README.md +184 -0
- package/src/md/date-picker/index.ts +17 -0
- package/src/md/date-picker/internals/DatePicker.styles.ts +338 -0
- package/src/md/date-picker/internals/DatePickerCalendar.ts +697 -0
- package/src/md/date-picker/internals/DatePickerUtils.ts +288 -0
- package/src/md/date-picker/ui-date-picker-input.ts +272 -0
- package/src/md/date-picker/ui-date-picker-modal-input.ts +371 -0
- package/src/md/date-picker/ui-date-picker-modal.ts +263 -0
- package/src/md/dialog/internals/Dialog.styles.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownStyles.d.ts","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"MarkdownStyles.d.ts","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":";AAqCA,wBAqXC"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
@license
|
|
3
|
-
Copyright 2016 The Advanced REST client authors <arc@mulesoft.com>
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
5
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
6
|
-
the License at
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
-
License for the specific language governing permissions and limitations under
|
|
12
|
-
the License.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
2
|
## Styles for markdown viewer
|
|
16
3
|
|
|
17
4
|
It should be included where the `marked-highlight` is used.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownStyles.js","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqXjB,CAAA","sourcesContent":["/**\n@license\nCopyright 2016 The Advanced REST client authors <arc@mulesoft.com>\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n*/\n/**\n## Styles for markdown viewer\n\nIt should be included where the `marked-highlight` is used.\n\n## Usage example\n\n```javascript\nimport { LitElement, html, css } from 'lit';\nimport { MarkdownStyles } from '@api-client/ui';\n\nclass MarkdownImpl extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n ...\n }\n `,\n MarkdownStyles,\n ]\n }\n\n render() {\n return html`\n <marked-highlight markdown=\"....\">\n <div class=\"markdown-html\"></div>\n </marked-highlight>`;\n }\n}\n```\n\nNote use of the `markdown-html` CSS rules. It is required by markdown element also all css rules\ndefined here are scoped to a container with this class name.\n*/\nimport { css } from 'lit'\n\nexport default css`\n [slot='markdown-html'] {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n }\n\n [slot='markdown-html'] h1,\n [slot='markdown-html'] h2,\n [slot='markdown-html'] h3,\n [slot='markdown-html'] h4,\n [slot='markdown-html'] h5,\n [slot='markdown-html'] h6 {\n color: inherit;\n }\n\n [slot='markdown-html'] h1 tt,\n [slot='markdown-html'] h1 code,\n [slot='markdown-html'] h2 tt,\n [slot='markdown-html'] h2 code,\n [slot='markdown-html'] h3 tt,\n [slot='markdown-html'] h3 code,\n [slot='markdown-html'] h4 tt,\n [slot='markdown-html'] h4 code,\n [slot='markdown-html'] h5 tt,\n [slot='markdown-html'] h5 code,\n [slot='markdown-html'] h6 tt,\n [slot='markdown-html'] h6 code {\n font-size: inherit;\n }\n\n [slot='markdown-html'] h1 {\n font-family: var(--md-sys-typescale-headline-large-font);\n font-weight: var(--md-sys-typescale-headline-large-weight);\n font-size: var(--md-sys-typescale-headline-large-size);\n letter-spacing: var(--md-sys-typescale-headline-large-tracking);\n line-height: var(--md-sys-typescale-headline-large-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n padding-top: 1rem;\n padding-bottom: 0.5rem;\n }\n\n [slot='markdown-html'] h2 {\n font-family: var(--md-sys-typescale-headline-medium-font);\n font-weight: var(--md-sys-typescale-headline-medium-weight);\n font-size: var(--md-sys-typescale-headline-medium-size);\n letter-spacing: var(--md-sys-typescale-headline-medium-tracking);\n line-height: var(--md-sys-typescale-headline-medium-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n }\n\n [slot='markdown-html'] h3 {\n font-family: var(--md-sys-typescale-headline-small-font);\n font-weight: var(--md-sys-typescale-headline-small-weight);\n font-size: var(--md-sys-typescale-headline-small-size);\n letter-spacing: var(--md-sys-typescale-headline-small-tracking);\n line-height: var(--md-sys-typescale-headline-small-height);\n }\n\n [slot='markdown-html'] h4 {\n font-family: var(--md-sys-typescale-title-large-font);\n font-weight: var(--md-sys-typescale-title-large-weight);\n font-size: var(--md-sys-typescale-title-large-size);\n letter-spacing: var(--md-sys-typescale-title-large-tracking);\n line-height: var(--md-sys-typescale-title-large-height);\n }\n\n [slot='markdown-html'] h5 {\n font-family: var(--md-sys-typescale-title-medium-font);\n font-weight: var(--md-sys-typescale-title-medium-weight);\n font-size: var(--md-sys-typescale-title-medium-size);\n letter-spacing: var(--md-sys-typescale-title-medium-tracking);\n line-height: var(--md-sys-typescale-title-medium-height);\n }\n\n [slot='markdown-html'] h6 {\n font-family: var(--md-sys-typescale-title-small-font);\n font-weight: var(--md-sys-typescale-title-small-weight);\n font-size: var(--md-sys-typescale-title-small-size);\n letter-spacing: var(--md-sys-typescale-title-small-tracking);\n line-height: var(--md-sys-typescale-title-small-height);\n }\n\n [slot='markdown-html'] p,\n [slot='markdown-html'] blockquote,\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol,\n [slot='markdown-html'] dl,\n [slot='markdown-html'] table,\n [slot='markdown-html'] pre {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] a {\n color: var(--link-color);\n }\n\n [slot='markdown-html'] a:hover {\n color: var(--link-hover-color);\n }\n\n [slot='markdown-html'] > *:last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] hr {\n height: 4px;\n padding: 0;\n margin: 16px 0;\n background-color: var(--markdown-styles-hr-color, #e7e7e7);\n border: 0 none;\n }\n\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol {\n padding-left: 2em;\n }\n\n [slot='markdown-html'] ul.no-list,\n [slot='markdown-html'] ol.no-list {\n padding: 0;\n list-style-type: none;\n }\n\n [slot='markdown-html'] ul ul,\n [slot='markdown-html'] ul ol,\n [slot='markdown-html'] ol ol,\n [slot='markdown-html'] ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] li > p {\n margin-top: 16px;\n }\n\n [slot='markdown-html'] dl {\n padding: 0;\n }\n\n [slot='markdown-html'] dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n [slot='markdown-html'] dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] blockquote {\n padding: 0 15px;\n color: var(--markdown-styles-blockquote-color, #777);\n border-left: 4px solid var(--markdown-styles-blockquote-border-left-color, #ddd);\n }\n\n [slot='markdown-html'] blockquote > :first-child {\n margin-top: 0;\n }\n\n [slot='markdown-html'] blockquote > :last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] table {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n border-collapse: collapse;\n }\n\n [slot='markdown-html'] table th {\n font-weight: bold;\n }\n\n [slot='markdown-html'] table th,\n [slot='markdown-html'] table td {\n padding: 6px 13px;\n border: 1px solid var(--markdown-styles-table-header-border-color, #ddd);\n }\n\n [slot='markdown-html'] table tr {\n background-color: var(--markdown-styles-table-row-background-color, #fff);\n border-top: 1px solid #ccc;\n }\n\n [slot='markdown-html'] table tr:nth-child(2n) {\n background-color: var(--markdown-styles-table-even-row-background-color, #f8f8f8);\n }\n\n [slot='markdown-html'] img {\n max-width: 100%;\n box-sizing: content-box;\n background-color: var(--markdown-styles-image-background-color, #fff);\n }\n\n [slot='markdown-html'] img[align='right'] {\n padding-left: 20px;\n }\n\n [slot='markdown-html'] img[align='left'] {\n padding-right: 20px;\n }\n\n [slot='markdown-html'] code,\n [slot='markdown-html'] tt {\n font-family: var(--markdown-styles-code-font-family, Roboto Mono, Consolas, Menlo, monospace);\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n background-color: var(--markdown-styles-code-background-color, rgba(0, 0, 0, 0.04));\n border-radius: 2px;\n }\n\n [slot='markdown-html'] pre {\n word-wrap: normal;\n }\n\n /**\n * prism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n font-family: var(--markdown-styles-code-font-family, Roboto Mono, Consolas, Menlo, monospace);\n color: var(--code-color, black);\n background-color: var(--code-background-color);\n text-shadow: var(--markdown-styles-code-text-shadow, 0 1px white);\n text-align: left;\n word-break: break-all;\n white-space: pre-wrap;\n word-spacing: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n [slot='markdown-html'] pre::-moz-selection,\n [slot='markdown-html'] pre ::-moz-selection,\n [slot='markdown-html'] code::-moz-selection,\n [slot='markdown-html'] code ::-moz-selection,\n [slot='markdown-html'] pre::selection,\n [slot='markdown-html'] pre ::selection,\n [slot='markdown-html'] code::selection,\n [slot='markdown-html'] code ::selection {\n text-shadow: none;\n background: var(--markdown-styles-code-selection-background-color, #b3d4fc);\n }\n\n @media print {\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n text-shadow: none;\n }\n }\n\n /* Code blocks */\n [slot='markdown-html'] pre {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n }\n\n [slot='markdown-html'] :not(pre) > code,\n [slot='markdown-html'] pre,\n pre[slot='markdown-html'] {\n background: var(--code-background-color, #f5f2f0);\n border: var(--inline-code-border, inherit);\n }\n\n /* Inline code */\n [slot='markdown-html'] :not(pre) > code {\n padding: var(--inline-code-padding, 0.1em);\n border-radius: 0.3em;\n white-space: normal;\n }\n\n [slot='markdown-html'] .token.comment,\n [slot='markdown-html'] .token.prolog,\n [slot='markdown-html'] .token.doctype,\n [slot='markdown-html'] .token.cdata {\n color: var(--markdown-styles-code-cdata-color, slategray);\n }\n\n [slot='markdown-html'] .token.punctuation {\n color: var(--code-punctuation-value-color, #999);\n }\n\n [slot='markdown-html'] .namespace {\n opacity: 0.7;\n }\n\n [slot='markdown-html'] .token.property,\n [slot='markdown-html'] .token.tag,\n [slot='markdown-html'] .token.boolean,\n [slot='markdown-html'] .token.number,\n [slot='markdown-html'] .token.constant,\n [slot='markdown-html'] .token.symbol,\n [slot='markdown-html'] .token.deleted {\n color: var(--code-type-number-value-color, #905);\n }\n\n [slot='markdown-html'] .token.selector,\n [slot='markdown-html'] .token.attr-name,\n [slot='markdown-html'] .token.string,\n [slot='markdown-html'] .token.char,\n [slot='markdown-html'] .token.builtin,\n [slot='markdown-html'] .token.inserted {\n color: var(--code-type-text-value-color, #690);\n }\n\n [slot='markdown-html'] .token.operator,\n [slot='markdown-html'] .token.entity,\n [slot='markdown-html'] .token.url,\n [slot='markdown-html'] .language-css .token.string,\n [slot='markdown-html'] .style .token.string {\n color: var(--code-punctuation-value-color, #a67f59);\n background: hsla(0, 0%, 100%, 0.5);\n }\n\n [slot='markdown-html'] .token.atrule,\n [slot='markdown-html'] .token.attr-value,\n [slot='markdown-html'] .token.keyword {\n color: var(--markdown-styles-code-keyword-color, #07a);\n }\n\n [slot='markdown-html'] .token.function {\n color: var(--markdown-styles-code-function-color, #dd4a68);\n }\n\n [slot='markdown-html'] .token.regex,\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.variable {\n color: var(--markdown-styles-variable-color, #e90);\n }\n\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.bold {\n font-weight: bold;\n }\n [slot='markdown-html'] .token.italic {\n font-style: italic;\n }\n\n [slot='markdown-html'] .token.entity {\n cursor: help;\n }\n`\n"]}
|
|
1
|
+
{"version":3,"file":"MarkdownStyles.js","sourceRoot":"","sources":["../../../../src/elements/highlight/MarkdownStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqXjB,CAAA","sourcesContent":["/**\n## Styles for markdown viewer\n\nIt should be included where the `marked-highlight` is used.\n\n## Usage example\n\n```javascript\nimport { LitElement, html, css } from 'lit';\nimport { MarkdownStyles } from '@api-client/ui';\n\nclass MarkdownImpl extends LitElement {\n static get styles() {\n return [\n css`\n :host {\n ...\n }\n `,\n MarkdownStyles,\n ]\n }\n\n render() {\n return html`\n <marked-highlight markdown=\"....\">\n <div class=\"markdown-html\"></div>\n </marked-highlight>`;\n }\n}\n```\n\nNote use of the `markdown-html` CSS rules. It is required by markdown element also all css rules\ndefined here are scoped to a container with this class name.\n*/\nimport { css } from 'lit'\n\nexport default css`\n [slot='markdown-html'] {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n }\n\n [slot='markdown-html'] h1,\n [slot='markdown-html'] h2,\n [slot='markdown-html'] h3,\n [slot='markdown-html'] h4,\n [slot='markdown-html'] h5,\n [slot='markdown-html'] h6 {\n color: inherit;\n }\n\n [slot='markdown-html'] h1 tt,\n [slot='markdown-html'] h1 code,\n [slot='markdown-html'] h2 tt,\n [slot='markdown-html'] h2 code,\n [slot='markdown-html'] h3 tt,\n [slot='markdown-html'] h3 code,\n [slot='markdown-html'] h4 tt,\n [slot='markdown-html'] h4 code,\n [slot='markdown-html'] h5 tt,\n [slot='markdown-html'] h5 code,\n [slot='markdown-html'] h6 tt,\n [slot='markdown-html'] h6 code {\n font-size: inherit;\n }\n\n [slot='markdown-html'] h1 {\n font-family: var(--md-sys-typescale-headline-large-font);\n font-weight: var(--md-sys-typescale-headline-large-weight);\n font-size: var(--md-sys-typescale-headline-large-size);\n letter-spacing: var(--md-sys-typescale-headline-large-tracking);\n line-height: var(--md-sys-typescale-headline-large-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n padding-top: 1rem;\n padding-bottom: 0.5rem;\n }\n\n [slot='markdown-html'] h2 {\n font-family: var(--md-sys-typescale-headline-medium-font);\n font-weight: var(--md-sys-typescale-headline-medium-weight);\n font-size: var(--md-sys-typescale-headline-medium-size);\n letter-spacing: var(--md-sys-typescale-headline-medium-tracking);\n line-height: var(--md-sys-typescale-headline-medium-height);\n border-bottom: 1px solid var(--markdown-styles-title-border-bottom-color, #eee);\n }\n\n [slot='markdown-html'] h3 {\n font-family: var(--md-sys-typescale-headline-small-font);\n font-weight: var(--md-sys-typescale-headline-small-weight);\n font-size: var(--md-sys-typescale-headline-small-size);\n letter-spacing: var(--md-sys-typescale-headline-small-tracking);\n line-height: var(--md-sys-typescale-headline-small-height);\n }\n\n [slot='markdown-html'] h4 {\n font-family: var(--md-sys-typescale-title-large-font);\n font-weight: var(--md-sys-typescale-title-large-weight);\n font-size: var(--md-sys-typescale-title-large-size);\n letter-spacing: var(--md-sys-typescale-title-large-tracking);\n line-height: var(--md-sys-typescale-title-large-height);\n }\n\n [slot='markdown-html'] h5 {\n font-family: var(--md-sys-typescale-title-medium-font);\n font-weight: var(--md-sys-typescale-title-medium-weight);\n font-size: var(--md-sys-typescale-title-medium-size);\n letter-spacing: var(--md-sys-typescale-title-medium-tracking);\n line-height: var(--md-sys-typescale-title-medium-height);\n }\n\n [slot='markdown-html'] h6 {\n font-family: var(--md-sys-typescale-title-small-font);\n font-weight: var(--md-sys-typescale-title-small-weight);\n font-size: var(--md-sys-typescale-title-small-size);\n letter-spacing: var(--md-sys-typescale-title-small-tracking);\n line-height: var(--md-sys-typescale-title-small-height);\n }\n\n [slot='markdown-html'] p,\n [slot='markdown-html'] blockquote,\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol,\n [slot='markdown-html'] dl,\n [slot='markdown-html'] table,\n [slot='markdown-html'] pre {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] a {\n color: var(--link-color);\n }\n\n [slot='markdown-html'] a:hover {\n color: var(--link-hover-color);\n }\n\n [slot='markdown-html'] > *:last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] hr {\n height: 4px;\n padding: 0;\n margin: 16px 0;\n background-color: var(--markdown-styles-hr-color, #e7e7e7);\n border: 0 none;\n }\n\n [slot='markdown-html'] ul,\n [slot='markdown-html'] ol {\n padding-left: 2em;\n }\n\n [slot='markdown-html'] ul.no-list,\n [slot='markdown-html'] ol.no-list {\n padding: 0;\n list-style-type: none;\n }\n\n [slot='markdown-html'] ul ul,\n [slot='markdown-html'] ul ol,\n [slot='markdown-html'] ol ol,\n [slot='markdown-html'] ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] li > p {\n margin-top: 16px;\n }\n\n [slot='markdown-html'] dl {\n padding: 0;\n }\n\n [slot='markdown-html'] dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n [slot='markdown-html'] dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n [slot='markdown-html'] blockquote {\n padding: 0 15px;\n color: var(--markdown-styles-blockquote-color, #777);\n border-left: 4px solid var(--markdown-styles-blockquote-border-left-color, #ddd);\n }\n\n [slot='markdown-html'] blockquote > :first-child {\n margin-top: 0;\n }\n\n [slot='markdown-html'] blockquote > :last-child {\n margin-bottom: 0;\n }\n\n [slot='markdown-html'] table {\n font-family: var(--md-sys-typescale-body-large-font);\n font-weight: var(--md-sys-typescale-body-large-weight);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n border-collapse: collapse;\n }\n\n [slot='markdown-html'] table th {\n font-weight: bold;\n }\n\n [slot='markdown-html'] table th,\n [slot='markdown-html'] table td {\n padding: 6px 13px;\n border: 1px solid var(--markdown-styles-table-header-border-color, #ddd);\n }\n\n [slot='markdown-html'] table tr {\n background-color: var(--markdown-styles-table-row-background-color, #fff);\n border-top: 1px solid #ccc;\n }\n\n [slot='markdown-html'] table tr:nth-child(2n) {\n background-color: var(--markdown-styles-table-even-row-background-color, #f8f8f8);\n }\n\n [slot='markdown-html'] img {\n max-width: 100%;\n box-sizing: content-box;\n background-color: var(--markdown-styles-image-background-color, #fff);\n }\n\n [slot='markdown-html'] img[align='right'] {\n padding-left: 20px;\n }\n\n [slot='markdown-html'] img[align='left'] {\n padding-right: 20px;\n }\n\n [slot='markdown-html'] code,\n [slot='markdown-html'] tt {\n font-family: var(--markdown-styles-code-font-family, Roboto Mono, Consolas, Menlo, monospace);\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n background-color: var(--markdown-styles-code-background-color, rgba(0, 0, 0, 0.04));\n border-radius: 2px;\n }\n\n [slot='markdown-html'] pre {\n word-wrap: normal;\n }\n\n /**\n * prism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n font-family: var(--markdown-styles-code-font-family, Roboto Mono, Consolas, Menlo, monospace);\n color: var(--code-color, black);\n background-color: var(--code-background-color);\n text-shadow: var(--markdown-styles-code-text-shadow, 0 1px white);\n text-align: left;\n word-break: break-all;\n white-space: pre-wrap;\n word-spacing: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n\n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n [slot='markdown-html'] pre::-moz-selection,\n [slot='markdown-html'] pre ::-moz-selection,\n [slot='markdown-html'] code::-moz-selection,\n [slot='markdown-html'] code ::-moz-selection,\n [slot='markdown-html'] pre::selection,\n [slot='markdown-html'] pre ::selection,\n [slot='markdown-html'] code::selection,\n [slot='markdown-html'] code ::selection {\n text-shadow: none;\n background: var(--markdown-styles-code-selection-background-color, #b3d4fc);\n }\n\n @media print {\n [slot='markdown-html'] code,\n [slot='markdown-html'] pre {\n text-shadow: none;\n }\n }\n\n /* Code blocks */\n [slot='markdown-html'] pre {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n }\n\n [slot='markdown-html'] :not(pre) > code,\n [slot='markdown-html'] pre,\n pre[slot='markdown-html'] {\n background: var(--code-background-color, #f5f2f0);\n border: var(--inline-code-border, inherit);\n }\n\n /* Inline code */\n [slot='markdown-html'] :not(pre) > code {\n padding: var(--inline-code-padding, 0.1em);\n border-radius: 0.3em;\n white-space: normal;\n }\n\n [slot='markdown-html'] .token.comment,\n [slot='markdown-html'] .token.prolog,\n [slot='markdown-html'] .token.doctype,\n [slot='markdown-html'] .token.cdata {\n color: var(--markdown-styles-code-cdata-color, slategray);\n }\n\n [slot='markdown-html'] .token.punctuation {\n color: var(--code-punctuation-value-color, #999);\n }\n\n [slot='markdown-html'] .namespace {\n opacity: 0.7;\n }\n\n [slot='markdown-html'] .token.property,\n [slot='markdown-html'] .token.tag,\n [slot='markdown-html'] .token.boolean,\n [slot='markdown-html'] .token.number,\n [slot='markdown-html'] .token.constant,\n [slot='markdown-html'] .token.symbol,\n [slot='markdown-html'] .token.deleted {\n color: var(--code-type-number-value-color, #905);\n }\n\n [slot='markdown-html'] .token.selector,\n [slot='markdown-html'] .token.attr-name,\n [slot='markdown-html'] .token.string,\n [slot='markdown-html'] .token.char,\n [slot='markdown-html'] .token.builtin,\n [slot='markdown-html'] .token.inserted {\n color: var(--code-type-text-value-color, #690);\n }\n\n [slot='markdown-html'] .token.operator,\n [slot='markdown-html'] .token.entity,\n [slot='markdown-html'] .token.url,\n [slot='markdown-html'] .language-css .token.string,\n [slot='markdown-html'] .style .token.string {\n color: var(--code-punctuation-value-color, #a67f59);\n background: hsla(0, 0%, 100%, 0.5);\n }\n\n [slot='markdown-html'] .token.atrule,\n [slot='markdown-html'] .token.attr-value,\n [slot='markdown-html'] .token.keyword {\n color: var(--markdown-styles-code-keyword-color, #07a);\n }\n\n [slot='markdown-html'] .token.function {\n color: var(--markdown-styles-code-function-color, #dd4a68);\n }\n\n [slot='markdown-html'] .token.regex,\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.variable {\n color: var(--markdown-styles-variable-color, #e90);\n }\n\n [slot='markdown-html'] .token.important,\n [slot='markdown-html'] .token.bold {\n font-weight: bold;\n }\n [slot='markdown-html'] .token.italic {\n font-style: italic;\n }\n\n [slot='markdown-html'] .token.entity {\n cursor: help;\n }\n`\n"]}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@license
|
|
3
|
-
Copyright 2020 The Advanced REST client authors <arc@mulesoft.com>
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
5
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
6
|
-
the License at
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
-
License for the specific language governing permissions and limitations under
|
|
12
|
-
the License.
|
|
13
|
-
*/
|
|
14
1
|
import { TemplateResult, PropertyValues, nothing } from 'lit';
|
|
15
2
|
import type { IBodyMetaModel, IRawBody, IUrlEncodedBodyMeta } from '@api-client/core/models/RequestUiMeta.js';
|
|
16
3
|
import { type IMultipartBody, type ISafePayload } from '@api-client/core/lib/transformers/PayloadSerializer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyEditor.d.ts","sourceRoot":"","sources":["../../../../src/elements/http/BodyEditor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BodyEditor.d.ts","sourceRoot":"","sources":["../../../../src/elements/http/BodyEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAEnE,OAAO,KAAK,E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AAI,cAAc,GAAG,OAAO,OAAO;IAc9D,SAAS,CAAC,uBAAuB,IAAI,cAAc;IAsBnD,SAAS,CAAC,mBAAmB,IAAI,cAAc,EAAE;IASjD,SAAS,CAAC,4BAA4B,IAAI,cAAc;IAqCxD,SAAS,CAAC,sBAAsB,IAAI,cAAc;IAqBlD;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,cAAc;IAexC;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,cAAc;IAc3C;;;OAGG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc;IAUzD;;OAEG;IACH,SAAS,CAAC,qBAAqB,IAAI,cAAc;IAcjD;;OAEG;IACH,SAAS,CAAC,qBAAqB,IAAI,cAAc;IAWjD;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,cAAc;IAW5C,SAAS,CAAC,cAAc,IAAI,cAAc;IAM1C;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,cAAc;IAI1C;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,cAAc,GAAG,MAAM;IAyBrD,SAAS,CAAC,iBAAiB,IAAI,cAAc,GAAG,MAAM;IActD;;OAEG;IACH,SAAS,CAAC,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;CActE"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
/**
|
|
3
|
-
@license
|
|
4
|
-
Copyright 2020 The Advanced REST client authors <arc@mulesoft.com>
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
6
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
7
|
-
the License at
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
11
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
|
-
License for the specific language governing permissions and limitations under
|
|
13
|
-
the License.
|
|
14
|
-
*/
|
|
15
2
|
import { html, nothing } from 'lit';
|
|
16
3
|
import { property, query } from 'lit/decorators.js';
|
|
17
4
|
import { PayloadSerializer, } from '@api-client/core/lib/transformers/PayloadSerializer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyEditor.js","sourceRoot":"","sources":["../../../../src/elements/http/BodyEditor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;EAYE;AACF,OAAO,EAAE,IAAI,EAAkC,OAAO,EAAE,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAGL,iBAAiB,GAClB,MAAM,wDAAwD,CAAA;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAI5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AAEzC,OAAO,2BAA2B,CAAA;AAClC,OAAO,kDAAkD,CAAA;AACzD,OAAO,iDAAiD,CAAA;AACxD,OAAO,4CAA4C,CAAA;AACnD,OAAO,8BAA8B,CAAA;AACrC,OAAO,4CAA4C,CAAA;AACnD,OAAO,0BAA0B,CAAA;AACjC,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AACvC,OAAO,kCAAkC,CAAA;AAUzC,MAAM,CAAC,MAAM,WAAW,GAA0B,MAAM,CAAC,MAAM,CAAC;IAC9D;QACE,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,gDAAgD;KACxD;IACD;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,yDAAyD;KACjE;IACD;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,qBAAqB;QAC5B,KAAK,EAAE,iDAAiD;K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AAA;QACH,CAAC;QAED;;WAEG;QACO,wBAAwB,CAAC,SAAiB;YAClD,OAAO,IAAI,CAAA;;2EAE4D,SAAS;;;;;kBAKlE,IAAI,CAAC,WAAW;;;;KAI7B,CAAA;QACH,CAAC;;;AA/xBH;;GAEG;AACH,0BA6xBC","sourcesContent":["/**\n@license\nCopyright 2020 The Advanced REST client authors <arc@mulesoft.com>\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n*/\nimport { html, TemplateResult, PropertyValues, nothing } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport type { IBodyMetaModel, IRawBody, IUrlEncodedBodyMeta } from '@api-client/core/models/RequestUiMeta.js'\nimport {\n type IMultipartBody,\n type ISafePayload,\n PayloadSerializer,\n} from '@api-client/core/lib/transformers/PayloadSerializer.js'\nimport type { IProperty } from '@api-client/core/models/Property.js'\nimport { ifProperty } from '../../directives/if-property.js'\nimport BodyUrlEncodedEditor from './BodyUrlEncodedEditor.js'\nimport BodyTextEditor from './BodyTextEditor.js'\nimport BodyMultipartEditor from './BodyMultipartEditor.js'\nimport { Events } from '../../events/Events.js'\nimport ApiElement from '../ApiElement.js'\nimport CheckboxElement from '../../md/checkbox/internals/CheckboxElement.js'\nimport '../../md/icons/ui-icon.js'\nimport '../../define/http/http-body-urlencoded-editor.js'\nimport '../../define/http/http-body-multipart-editor.js'\nimport '../../define/http/http-body-text-editor.js'\nimport '../../md/button/ui-button.js'\nimport '../../md/dropdown-list/ui-dropdown-list.js'\nimport '../../md/list/ui-list.js'\nimport '../../md/list/ui-list-item.js'\nimport '../../md/divider/ui-divider.js'\nimport '../../md/checkbox/ui-checkbox.js'\n\nexport type AllowedEditor = 'raw' | 'urlEncode' | 'multipart' | 'file'\n\nexport interface EditorType {\n id: AllowedEditor\n label: string\n title: string\n}\n\nexport const editorTypes: readonly EditorType[] = Object.freeze([\n {\n id: 'raw',\n label: 'Text editor',\n title: 'Opens a source editor with syntax highlighting',\n },\n {\n id: 'urlEncode',\n label: 'Form URL encoded',\n title: 'Opens an editor specialized with URL encoded data types',\n },\n {\n id: 'multipart',\n label: 'Multipart form data',\n title: 'Opens an editor specialized with multipart data',\n },\n {\n id: 'file',\n label: 'A file',\n title: 'Allows to choose any binary data',\n },\n])\n\nconst monacoContentTypes: Record<string, string> = {\n 'application/json': 'JSON',\n 'application/xml': 'XML',\n 'text/html': 'HTML',\n 'text/css': 'CSS',\n '': 'Inherited from headers',\n}\n\n/**\n * @fires change When the value and the model change\n */\nexport default class BodyEditor extends ApiElement {\n /**\n * The currently rendered editor.\n * @attribute\n */\n @property({ type: String }) accessor selected: AllowedEditor = 'raw'\n\n protected valueInternal: unknown = ''\n\n /**\n * The HTTP body.\n *\n * Depending of current editor selection the type can vary.\n */\n get value(): unknown {\n return this.valueInternal\n }\n\n @property({ attribute: false })\n set value(value: unknown) {\n const old = this.valueInternal\n if (old === value) {\n return\n }\n // this is to be able to set a private filed value from\n // within the element\n this.valueInternal = value\n this.requestUpdate()\n }\n\n protected modelInternal: IBodyMetaModel[] | undefined\n\n /**\n * Previously generated by this editor metadata model.\n * Used internally to set the UI.\n */\n get model(): IBodyMetaModel[] | undefined {\n return this.modelInternal\n }\n\n @property({ type: Array })\n set model(value: IBodyMetaModel[] | undefined) {\n const old = this.modelInternal\n if (old === value) {\n return\n }\n // this is to be able to set a private filed value from\n // within the element\n this.modelInternal = value\n this.requestUpdate()\n this.modelChanged()\n }\n\n /**\n * When set the editor is in read only mode.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor readOnly = false\n\n /**\n * When set all controls are disabled in the form\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor disabled = false\n\n /**\n * When set it automatically encodes and decodes values.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor autoEncode = false\n\n /**\n * @returns True when the current value is a file (or blob).\n */\n get hasFile(): boolean {\n const { value } = this\n return value instanceof Blob\n }\n\n /**\n * The current request content type. It is passed to the `raw` editor\n * to detect current language.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor contentType: string | undefined\n\n protected invalidMimeMessage?: number\n\n protected invalidMimeValue?: boolean\n\n protected mimeValue?: string\n\n @query('http-body-urlencoded-editor') protected accessor urlEncodedEditor: BodyUrlEncodedEditor | null = null\n\n @query('http-body-multipart-editor') protected accessor multipartEditor: BodyMultipartEditor | null = null\n\n constructor() {\n super()\n this.addEventListener('drop', this.handlerDrop.bind(this))\n this.addEventListener('dragover', this.handleDragOver.bind(this))\n }\n\n protected override update(cp: PropertyValues<this>): void {\n if (cp.has('contentType') || cp.has('selected')) {\n this.analyzeContentType()\n }\n super.update(cp)\n }\n\n /**\n * This must be called only when the `model` property change from the\n * outside. It restores values depending on the selected editor.\n */\n protected modelChanged(): void {\n const { selected, model } = this\n if (!model) {\n return\n }\n if (selected === 'file') {\n this.restoreFileModel()\n }\n const info = this.readMetaModel('urlEncode') as IUrlEncodedBodyMeta[] | undefined\n if (Array.isArray(info) && info[0]) {\n if (typeof info[0].autoEncode === 'boolean') {\n this.autoEncode = info[0].autoEncode\n }\n }\n }\n\n /**\n * Restores file value from the model, if exists\n */\n protected restoreFileModel(): void {\n const fileModel = this.readMetaModel('file') as ISafePayload[] | undefined\n if (!Array.isArray(fileModel) || !fileModel.length) {\n this.valueInternal = ''\n return\n }\n const [item] = fileModel\n if (!item || !item.data) {\n this.valueInternal = ''\n return\n }\n const file = PayloadSerializer.deserializeFile(item)\n this.valueInternal = file\n }\n\n protected handleTypeChange(e: CustomEvent): void {\n const target = e.detail.item as HTMLElement | undefined\n if (!target) {\n return\n }\n const selected = target.dataset.type as AllowedEditor\n this.changeEditor(selected)\n }\n\n /**\n * A handler for the editor selection. It activates an editor, if necessary.\n */\n protected async changeEditor(id: AllowedEditor): Promise<void> {\n if (this.selected === id) {\n return\n }\n this.selected = id\n this.analyzeContentType()\n if (id === 'raw') {\n const model = this.readMetaModel('raw') as IRawBody[]\n let value = ''\n if (Array.isArray(model) && model.length) {\n value = model[0].value\n }\n this.value = value\n this.notifyChange()\n }\n this.requestUpdate()\n await this.updateComplete\n // this.notifyResize();\n if (id === 'file') {\n this.restoreFileModel()\n this.notifyChange()\n } else if (id === 'urlEncode') {\n const editor = (this.shadowRoot as ShadowRoot).querySelector('http-body-urlencoded-editor')\n if (!editor) {\n throw new Error(`Invalid state. The <http-body-urlencoded-editor> element was removed from the DOM.`)\n }\n this.value = editor.value\n this.notifyChange()\n } else if (id === 'multipart') {\n const editor = (this.shadowRoot as ShadowRoot).querySelector('http-body-multipart-editor')\n if (!editor) {\n throw new Error(`Invalid state. The <http-body-multipart-editor> element was removed from the DOM.`)\n }\n this.value = editor.value\n this.notifyChange()\n }\n this.dispatchEvent(new Event('select'))\n }\n\n /**\n * A handler for the file pick button click.\n * Activates the file input.\n */\n protected handlePickFile(): void {\n const input = (this.shadowRoot as ShadowRoot).querySelector('.binary-hidden') as HTMLInputElement\n input.click()\n }\n\n /**\n * A handler for the file file selection in the file input.\n * Sets the value to the file.\n */\n protected async handleFileChange(e: Event): Promise<void> {\n const input = e.target as HTMLInputElement\n const { files } = input\n if (!files) {\n return\n }\n const file = files[0]\n if (!file) {\n return\n }\n this.valueInternal = file\n const payload = await PayloadSerializer.stringifyFile(file)\n const model = [payload]\n this.setMetaModel('file', model)\n this.notifyChange()\n this.requestUpdate()\n }\n\n /**\n * Clears the current value\n */\n protected handleClearFile(): void {\n this.value = ''\n this.setMetaModel('file', [])\n this.notifyChange()\n }\n\n /**\n * Reads editor view model\n *\n * @param editor The editor id\n * @returns The view model\n */\n protected readMetaModel(\n editor: string\n ): (ISafePayload | IProperty | IMultipartBody | IRawBody | IUrlEncodedBodyMeta)[] | undefined {\n const meta = this.model\n if (!meta || !Array.isArray(meta)) {\n return undefined\n }\n const item = meta.find((model) => model.type === editor)\n if (!item) {\n return undefined\n }\n if (Array.isArray(item.viewModel)) {\n return item.viewModel\n }\n return undefined\n }\n\n /**\n * Sets editor view model on the local model\n * @param editor The editor id\n * @param model The view model\n */\n protected setMetaModel(\n editor: AllowedEditor,\n model: (ISafePayload | IProperty | IMultipartBody | IRawBody | IUrlEncodedBodyMeta)[]\n ): void {\n if (!Array.isArray(this.modelInternal)) {\n this.modelInternal = []\n }\n const meta = this.model as IBodyMetaModel[]\n const index = meta.findIndex((item) => item.type === editor)\n if (index === -1) {\n meta.push({ type: editor, viewModel: model })\n } else {\n meta[index].viewModel = model\n }\n }\n\n /**\n * A handler for the change event dispatched by the\n * `urlEncode` editor.\n * Updated the local value, model, and notifies the change.\n */\n protected handleUrlEncodeChange(e: Event): void {\n const editor = e.target as BodyUrlEncodedEditor\n this.updateUrlEncodedValue(editor)\n }\n\n protected updateUrlEncodedValue(editor: BodyUrlEncodedEditor): void {\n const { value, model } = editor\n this.valueInternal = value\n const info: IUrlEncodedBodyMeta = {\n model,\n autoEncode: this.autoEncode,\n }\n this.setMetaModel('urlEncode', [info])\n this.notifyChange()\n // do not request update here.\n }\n\n /**\n * A handler for the change event dispatched by the `raw` editor.\n * Updated the local value, model, and notifies the change.\n */\n protected handleRawChange(e: Event): void {\n const editor = e.target as BodyTextEditor\n const { value } = editor\n this.valueInternal = value\n const model: IRawBody[] = [{ value: value as string }]\n this.setMetaModel('raw', model)\n this.notifyChange()\n }\n\n /**\n * A handler for the change event dispatched by the\n * `multipart` editor.\n * Updated the local value, model, and notifies the change.\n */\n protected handleMultipartChange(e: Event): void {\n const editor = e.target as BodyMultipartEditor\n const { value, model } = editor\n this.valueInternal = value\n this.setMetaModel('multipart', model)\n this.notifyChange()\n }\n\n /**\n * Checks whether the current content type header value matches the selected editor.\n * If not it renders a warning message.\n */\n protected analyzeContentType(): void {\n const mime = this.contentType\n if (!mime || typeof mime !== 'string') {\n this.invalidMimeValue = false\n this.mimeValue = undefined\n return\n }\n let ct = mime\n const semicolon = ct.indexOf(';')\n if (semicolon !== -1) {\n ct = ct.substring(0, semicolon)\n }\n this.mimeValue = ct\n if (!ct) {\n this.invalidMimeValue = false\n return\n }\n const { selected } = this\n if (selected === 'multipart') {\n if (ct !== 'multipart/form-data') {\n this.invalidMimeValue = true\n this.invalidMimeMessage = 1\n } else {\n this.invalidMimeValue = false\n }\n } else if (selected === 'urlEncode') {\n if (ct !== 'application/x-www-form-urlencoded') {\n this.invalidMimeValue = true\n this.invalidMimeMessage = 2\n } else {\n this.invalidMimeValue = false\n }\n } else {\n this.invalidMimeValue = false\n }\n }\n\n /**\n * Automatically fixes content type problem.\n */\n protected autoFixMime(): void {\n const { selected } = this\n let updated = ''\n if (selected === 'urlEncode') {\n updated = 'application/x-www-form-urlencoded'\n } else if (selected === 'multipart') {\n updated = 'multipart/form-data'\n }\n Events.Http.Request.State.contentTypeChange(updated, this)\n }\n\n /**\n * A handler for the mime type selection.\n */\n protected handleMimeTypeSelect(e: CustomEvent): void {\n const target = e.detail.item as HTMLElement | undefined\n if (!target) {\n return\n }\n const { type = '' } = target.dataset\n if (this.mimeValue === type) {\n return\n }\n this.contentType = type\n Events.Http.Request.State.contentTypeChange(type, this)\n }\n\n async handlerDrop(e: DragEvent): Promise<void> {\n e.preventDefault()\n const { dataTransfer } = e\n if (!dataTransfer) {\n return\n }\n const { files } = dataTransfer\n if (!files.length) {\n return\n }\n const file = files[0]\n const { selected } = this\n if (selected === 'file') {\n this.value = file\n } else if (selected === 'multipart') {\n const editor = (this.shadowRoot as ShadowRoot).querySelector('http-body-multipart-editor')\n if (!editor) {\n throw new Error(`Invalid state. The <http-body-multipart-editor> element was removed from the DOM.`)\n }\n if (!e.ctrlKey && !e.metaKey) {\n editor.value = new FormData()\n }\n const ps = Array.from(files).map((item) => editor.addFile(item))\n await Promise.all(ps)\n } else {\n const payload = await PayloadSerializer.stringifyBlob(file)\n this.value = payload.data\n const { type } = file\n if (type) {\n Events.Http.Request.State.contentTypeChange(type, this)\n }\n }\n this.notifyChange()\n }\n\n protected handleDragOver(e: DragEvent): void {\n e.preventDefault()\n }\n\n protected handleAddUrlEncode(): void {\n const editor = this.urlEncodedEditor\n if (editor) {\n editor.addParameter()\n }\n }\n\n protected handleUrlEncode(): void {\n const editor = this.urlEncodedEditor\n if (editor) {\n editor.encodeParameters()\n }\n }\n\n protected handleUrlDecode(): void {\n const editor = this.urlEncodedEditor\n if (editor) {\n editor.decodeParameters()\n }\n }\n\n protected handleUrlEncodeAutoChange(e: Event): void {\n const input = e.target as CheckboxElement\n this.autoEncode = !!input.checked\n const editor = this.urlEncodedEditor\n if (editor) {\n this.updateUrlEncodedValue(editor)\n }\n }\n\n protected handleMultipartAddText(): void {\n const editor = this.multipartEditor\n if (editor) {\n editor.addEmptyText()\n }\n }\n\n protected handleMultipartAddFile(): void {\n const editor = this.multipartEditor\n if (editor) {\n editor.addEmptyFile()\n }\n }\n\n override render(): TemplateResult {\n return html`\n <div class=\"actions\">${this.renderBodySelector()} ${this.renderMainActions()}</div>\n ${this.renderInvalidMime()}\n <div class=\"container\">${this.renderEditor()}</div>\n `\n }\n\n /**\n * @returns The template for the dropdown menu for the editor type\n */\n protected renderBodySelector(): TemplateResult {\n const { selected } = this\n const selectedItem = editorTypes.find((i) => i.id === selected)\n const label = (selectedItem && selectedItem.label) || 'Select editor'\n return html`\n <ui-dropdown-list\n verticalAlign=\"top\"\n @select=\"${this.handleTypeChange}\"\n class=\"type-dropdown\"\n closeOnOutsideClick\n >\n <ui-button color=\"tonal\" title=\"Select editor type\" aria-label=\"Opens a menu to select editor type\">\n <ui-icon icon=\"arrowDropDown\" slot=\"icon\" role=\"presentation\"></ui-icon>\n ${label}\n </ui-button>\n <ui-list slot=\"dropdown\" role=\"menu\"> ${this.renderBodyTypeOptions()} </ui-list>\n </ui-dropdown-list>\n `\n }\n\n protected renderBodyTypeOptions(): TemplateResult {\n return html`\n ${editorTypes.map(\n (info) => html`\n <ui-list-item role=\"menuitem\" data-type=\"${info.id}\" title=\"${info.title}\"> ${info.label} </ui-list-item>\n `\n )}\n `\n }\n\n /**\n * @returns The template for the main editor actions.\n */\n protected renderMainActions(): TemplateResult | typeof nothing {\n const { selected } = this\n if (selected === 'raw') {\n return this.renderTextEditorActions()\n }\n if (selected === 'urlEncode') {\n return this.renderUrlEncodeEditorActions()\n }\n if (selected === 'multipart') {\n return this.renderMultipartActions()\n }\n return nothing\n }\n\n protected renderTextEditorActions(): TemplateResult {\n const label = monacoContentTypes[this.mimeValue || ''] || monacoContentTypes['']\n return html`\n <ui-dropdown-list\n verticalAlign=\"top\"\n @select=\"${this.handleMimeTypeSelect}\"\n class=\"mime-dropdown\"\n closeOnOutsideClick\n >\n <ui-button\n color=\"tonal\"\n title=\"Select media type. This overrides the content-type header\"\n aria-label=\"Editor media type\"\n >\n <ui-icon icon=\"arrowDropDown\" slot=\"icon\"></ui-icon>\n ${label}\n </ui-button>\n <ui-list slot=\"dropdown\" role=\"menu\"> ${this.renderMonacoOptions()} </ui-list>\n </ui-dropdown-list>\n `\n }\n\n protected renderMonacoOptions(): TemplateResult[] {\n return Object.keys(monacoContentTypes).map(\n (key) => html`\n ${key === '' ? html`<ui-divider></ui-divider>` : nothing}\n <ui-list-item role=\"menuitem\" data-type=\"${key}\"> ${monacoContentTypes[key]} </ui-list-item>\n `\n )\n }\n\n protected renderUrlEncodeEditorActions(): TemplateResult {\n const { autoEncode } = this\n return html`\n <ui-button\n color=\"tonal\"\n aria-label=\"Adds a new parameter\"\n title=\"Adds a new parameter\"\n @click=\"${this.handleAddUrlEncode}\"\n >\n <ui-icon slot=\"icon\" icon=\"add\" role=\"presentation\"></ui-icon>\n Add\n </ui-button>\n <ui-button\n color=\"outlined\"\n title=\"URL encodes parameters in the editor\"\n aria-label=\"URL encodes parameters in the editor\"\n @click=\"${this.handleUrlEncode}\"\n ?disabled=\"${autoEncode}\"\n >\n URL encode\n </ui-button>\n <ui-button\n color=\"outlined\"\n title=\"URL decodes parameters in the editor\"\n aria-label=\"URL decodes parameters in the editor\"\n @click=\"${this.handleUrlDecode}\"\n ?disabled=\"${autoEncode}\"\n >\n URL decode\n </ui-button>\n <label title=\"When set it automatically encodes the values before sending the request\" class=\"label-medium\">\n <ui-checkbox .checked=\"${autoEncode}\" @change=\"${this.handleUrlEncodeAutoChange}\"></ui-checkbox>\n Encode on send\n </label>\n `\n }\n\n protected renderMultipartActions(): TemplateResult {\n return html`\n <ui-button\n color=\"outlined\"\n title=\"Adds a new part with a file value\"\n aria-label=\"Adds a new part with a file value\"\n @click=\"${this.handleMultipartAddFile}\"\n >\n Add file part\n </ui-button>\n <ui-button\n color=\"outlined\"\n title=\"Adds a new part with a text value\"\n aria-label=\"Adds a new part with a text value\"\n @click=\"${this.handleMultipartAddText}\"\n >\n Add text part\n </ui-button>\n `\n }\n\n /**\n * @returns A template for currently rendered editor\n */\n protected renderEditor(): TemplateResult {\n switch (this.selected) {\n case 'raw':\n return this.renderRawEditor()\n case 'urlEncode':\n return this.renderUrlEncodeEditor()\n case 'multipart':\n return this.renderMultipartEditor()\n case 'file':\n return this.renderFileEditor()\n default:\n return this.renderNoEditor()\n }\n }\n\n /**\n * @returns The template for the raw editor\n */\n protected renderRawEditor(): TemplateResult {\n let { value } = this\n const model = this.readMetaModel('raw') as IRawBody[]\n const hasModel = Array.isArray(model) && model.length\n if (typeof value !== 'string') {\n value = ''\n }\n if (!value && hasModel) {\n const [item] = model\n value = item.value\n }\n return this.renderTextEditor(value as string)\n }\n\n /**\n * @param value The editor value\n * @returns The template for the Monaco editor\n */\n protected renderTextEditor(value: string): TemplateResult {\n const { contentType } = this\n return html` <http-body-text-editor\n .value=\"${value}\"\n .contentType=\"${contentType}\"\n @change=\"${this.handleRawChange}\"\n allowFormInfo\n ></http-body-text-editor>`\n }\n\n /**\n * @returns A template for the application/x-www-form-urlencoded editor\n */\n protected renderUrlEncodeEditor(): TemplateResult {\n const { autoEncode } = this\n const info = this.readMetaModel('urlEncode') as IUrlEncodedBodyMeta[] | undefined\n const model = Array.isArray(info) && info[0] && info[0].model\n return html`\n <http-body-urlencoded-editor\n ?autoEncode=\"${autoEncode}\"\n .model=\"${ifProperty(model)}\"\n @change=\"${this.handleUrlEncodeChange}\"\n allowFormInfo\n ></http-body-urlencoded-editor>\n `\n }\n\n /**\n * @returns A template for the multipart editor\n */\n protected renderMultipartEditor(): TemplateResult {\n const model = this.readMetaModel('multipart') as IMultipartBody[]\n return html`\n <http-body-multipart-editor\n .model=\"${ifProperty(model)}\"\n @change=\"${this.handleMultipartChange}\"\n allowFormInfo\n ></http-body-multipart-editor>\n `\n }\n\n /**\n * @returns A template for the file input editor\n */\n protected renderFileEditor(): TemplateResult {\n return html`\n <div class=\"file-picker\">\n <ui-button color=\"text\" @click=\"${this.handlePickFile}\">Choose a file</ui-button>\n ${this.renderFileDetail()}\n </div>\n <input type=\"file\" class=\"binary-hidden\" @change=\"${this.handleFileChange}\" />\n ${this.renderFormInfo()}\n `\n }\n\n protected renderFormInfo(): TemplateResult {\n return html`\n <p class=\"form-info body-small\">Note that the content-type header will be added when the request is sent.</p>\n `\n }\n\n /**\n * @returns A template for the missing selection\n */\n protected renderNoEditor(): TemplateResult {\n return html`<div class=\"empty-editor\">Invalid editor selected.</div>`\n }\n\n /**\n * @returns A template for the file details.\n */\n protected renderFileDetail(): TemplateResult | string {\n if (!this.hasFile) {\n this.restoreFileModel()\n }\n if (!this.hasFile) {\n return ''\n }\n const { value } = this\n const { size, name } = value as File\n return html`\n <div class=\"file-info label-medium\">\n <span class=\"file-name\">${name || 'unknown name'}</span>\n <span class=\"file-size\">${size} bytes</span>\n <ui-icon-button\n aria-label=\"Delete file\"\n title=\"Deletes the file\"\n @click=\"${this.handleClearFile}\"\n ?disabled=\"${this.readOnly}\"\n >\n <ui-icon icon=\"deleteOutline\" role=\"presentation\"></ui-icon>\n </ui-icon-button>\n </div>\n `\n }\n\n protected renderInvalidMime(): TemplateResult | string {\n if (!this.invalidMimeValue) {\n return ''\n }\n const id = this.invalidMimeMessage\n return html`\n <div class=\"invalid-mime body-medium\">\n <ui-icon icon=\"warning\" class=\"warning-icon\"></ui-icon>\n ${id === 1 ? this.renderFixableInvalidMime('multipart/form-data') : ''}\n ${id === 2 ? this.renderFixableInvalidMime('application/x-www-form-urlencoded') : ''}\n </div>\n `\n }\n\n /**\n * @returns A template for fixable mime type mismatch message.\n */\n protected renderFixableInvalidMime(suggested: string): TemplateResult {\n return html`\n <p class=\"message body-medium\">\n The <code>content-type</code> header has different value than <b>${suggested}</b>.\n </p>\n <ui-button\n class=\"fix\"\n title=\"Updates the content type header for the request\"\n @click=\"${this.autoFixMime}\"\n color=\"tonal\"\n >Fix</ui-button\n >\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BodyEditor.js","sourceRoot":"","sources":["../../../../src/elements/http/BodyEditor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkC,OAAO,EAAE,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EAGL,iBAAiB,GAClB,MAAM,wDAAwD,CAAA;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAI5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AAEzC,OAAO,2BAA2B,CAAA;AAClC,OAAO,kDAAkD,CAAA;AACzD,OAAO,iDAAiD,CAAA;AACxD,OAAO,4CAA4C,CAAA;AACnD,OAAO,8BAA8B,CAAA;AACrC,OAAO,4CAA4C,CAAA;AACnD,OAAO,0BAA0B,CAAA;AACjC,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AACvC,OAAO,kCAAkC,CAAA;AAUzC,MAAM,CAAC,MAAM,WAAW,GAA0B,MAAM,CAAC,MAAM,CAAC;IAC9D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C,OAAO,IAAI,CAAA;;;UAGL,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE;UACpE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,mCAAmC,CAAC,CAAC,CAAC,CAAC,EAAE;;KAEvF,CAAA;QACH,CAAC;QAED;;WAEG;QACO,wBAAwB,CAAC,SAAiB;YAClD,OAAO,IAAI,CAAA;;2EAE4D,SAAS;;;;;kBAKlE,IAAI,CAAC,WAAW;;;;KAI7B,CAAA;QACH,CAAC;;;AA/xBH;;GAEG;AACH,0BA6xBC","sourcesContent":["import { html, TemplateResult, PropertyValues, nothing } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport type { IBodyMetaModel, IRawBody, IUrlEncodedBodyMeta } from '@api-client/core/models/RequestUiMeta.js'\nimport {\n type IMultipartBody,\n type ISafePayload,\n PayloadSerializer,\n} from '@api-client/core/lib/transformers/PayloadSerializer.js'\nimport type { IProperty } from '@api-client/core/models/Property.js'\nimport { ifProperty } from '../../directives/if-property.js'\nimport BodyUrlEncodedEditor from './BodyUrlEncodedEditor.js'\nimport BodyTextEditor from './BodyTextEditor.js'\nimport BodyMultipartEditor from './BodyMultipartEditor.js'\nimport { Events } from '../../events/Events.js'\nimport ApiElement from '../ApiElement.js'\nimport CheckboxElement from '../../md/checkbox/internals/CheckboxElement.js'\nimport '../../md/icons/ui-icon.js'\nimport '../../define/http/http-body-urlencoded-editor.js'\nimport '../../define/http/http-body-multipart-editor.js'\nimport '../../define/http/http-body-text-editor.js'\nimport '../../md/button/ui-button.js'\nimport '../../md/dropdown-list/ui-dropdown-list.js'\nimport '../../md/list/ui-list.js'\nimport '../../md/list/ui-list-item.js'\nimport '../../md/divider/ui-divider.js'\nimport '../../md/checkbox/ui-checkbox.js'\n\nexport type AllowedEditor = 'raw' | 'urlEncode' | 'multipart' | 'file'\n\nexport interface EditorType {\n id: AllowedEditor\n label: string\n title: string\n}\n\nexport const editorTypes: readonly EditorType[] = Object.freeze([\n {\n id: 'raw',\n label: 'Text editor',\n title: 'Opens a source editor with syntax highlighting',\n },\n {\n id: 'urlEncode',\n label: 'Form URL encoded',\n title: 'Opens an editor specialized with URL encoded data types',\n },\n {\n id: 'multipart',\n label: 'Multipart form data',\n title: 'Opens an editor specialized with multipart data',\n },\n {\n id: 'file',\n label: 'A file',\n title: 'Allows to choose any binary data',\n },\n])\n\nconst monacoContentTypes: Record<string, string> = {\n 'application/json': 'JSON',\n 'application/xml': 'XML',\n 'text/html': 'HTML',\n 'text/css': 'CSS',\n '': 'Inherited from headers',\n}\n\n/**\n * @fires change When the value and the model change\n */\nexport default class BodyEditor extends ApiElement {\n /**\n * The currently rendered editor.\n * @attribute\n */\n @property({ type: String }) accessor selected: AllowedEditor = 'raw'\n\n protected valueInternal: unknown = ''\n\n /**\n * The HTTP body.\n *\n * Depending of current editor selection the type can vary.\n */\n get value(): unknown {\n return this.valueInternal\n }\n\n @property({ attribute: false })\n set value(value: unknown) {\n const old = this.valueInternal\n if (old === value) {\n return\n }\n // this is to be able to set a private filed value from\n // within the element\n this.valueInternal = value\n this.requestUpdate()\n }\n\n protected modelInternal: IBodyMetaModel[] | undefined\n\n /**\n * Previously generated by this editor metadata model.\n * Used internally to set the UI.\n */\n get model(): IBodyMetaModel[] | undefined {\n return this.modelInternal\n }\n\n @property({ type: Array })\n set model(value: IBodyMetaModel[] | undefined) {\n const old = this.modelInternal\n if (old === value) {\n return\n }\n // this is to be able to set a private filed value from\n // within the element\n this.modelInternal = value\n this.requestUpdate()\n this.modelChanged()\n }\n\n /**\n * When set the editor is in read only mode.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor readOnly = false\n\n /**\n * When set all controls are disabled in the form\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor disabled = false\n\n /**\n * When set it automatically encodes and decodes values.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor autoEncode = false\n\n /**\n * @returns True when the current value is a file (or blob).\n */\n get hasFile(): boolean {\n const { value } = this\n return value instanceof Blob\n }\n\n /**\n * The current request content type. It is passed to the `raw` editor\n * to detect current language.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor contentType: string | undefined\n\n protected invalidMimeMessage?: number\n\n protected invalidMimeValue?: boolean\n\n protected mimeValue?: string\n\n @query('http-body-urlencoded-editor') protected accessor urlEncodedEditor: BodyUrlEncodedEditor | null = null\n\n @query('http-body-multipart-editor') protected accessor multipartEditor: BodyMultipartEditor | null = null\n\n constructor() {\n super()\n this.addEventListener('drop', this.handlerDrop.bind(this))\n this.addEventListener('dragover', this.handleDragOver.bind(this))\n }\n\n protected override update(cp: PropertyValues<this>): void {\n if (cp.has('contentType') || cp.has('selected')) {\n this.analyzeContentType()\n }\n super.update(cp)\n }\n\n /**\n * This must be called only when the `model` property change from the\n * outside. It restores values depending on the selected editor.\n */\n protected modelChanged(): void {\n const { selected, model } = this\n if (!model) {\n return\n }\n if (selected === 'file') {\n this.restoreFileModel()\n }\n const info = this.readMetaModel('urlEncode') as IUrlEncodedBodyMeta[] | undefined\n if (Array.isArray(info) && info[0]) {\n if (typeof info[0].autoEncode === 'boolean') {\n this.autoEncode = info[0].autoEncode\n }\n }\n }\n\n /**\n * Restores file value from the model, if exists\n */\n protected restoreFileModel(): void {\n const fileModel = this.readMetaModel('file') as ISafePayload[] | undefined\n if (!Array.isArray(fileModel) || !fileModel.length) {\n this.valueInternal = ''\n return\n }\n const [item] = fileModel\n if (!item || !item.data) {\n this.valueInternal = ''\n return\n }\n const file = PayloadSerializer.deserializeFile(item)\n this.valueInternal = file\n }\n\n protected handleTypeChange(e: CustomEvent): void {\n const target = e.detail.item as HTMLElement | undefined\n if (!target) {\n return\n }\n const selected = target.dataset.type as AllowedEditor\n this.changeEditor(selected)\n }\n\n /**\n * A handler for the editor selection. It activates an editor, if necessary.\n */\n protected async changeEditor(id: AllowedEditor): Promise<void> {\n if (this.selected === id) {\n return\n }\n this.selected = id\n this.analyzeContentType()\n if (id === 'raw') {\n const model = this.readMetaModel('raw') as IRawBody[]\n let value = ''\n if (Array.isArray(model) && model.length) {\n value = model[0].value\n }\n this.value = value\n this.notifyChange()\n }\n this.requestUpdate()\n await this.updateComplete\n // this.notifyResize();\n if (id === 'file') {\n this.restoreFileModel()\n this.notifyChange()\n } else if (id === 'urlEncode') {\n const editor = (this.shadowRoot as ShadowRoot).querySelector('http-body-urlencoded-editor')\n if (!editor) {\n throw new Error(`Invalid state. The <http-body-urlencoded-editor> element was removed from the DOM.`)\n }\n this.value = editor.value\n this.notifyChange()\n } else if (id === 'multipart') {\n const editor = (this.shadowRoot as ShadowRoot).querySelector('http-body-multipart-editor')\n if (!editor) {\n throw new Error(`Invalid state. The <http-body-multipart-editor> element was removed from the DOM.`)\n }\n this.value = editor.value\n this.notifyChange()\n }\n this.dispatchEvent(new Event('select'))\n }\n\n /**\n * A handler for the file pick button click.\n * Activates the file input.\n */\n protected handlePickFile(): void {\n const input = (this.shadowRoot as ShadowRoot).querySelector('.binary-hidden') as HTMLInputElement\n input.click()\n }\n\n /**\n * A handler for the file file selection in the file input.\n * Sets the value to the file.\n */\n protected async handleFileChange(e: Event): Promise<void> {\n const input = e.target as HTMLInputElement\n const { files } = input\n if (!files) {\n return\n }\n const file = files[0]\n if (!file) {\n return\n }\n this.valueInternal = file\n const payload = await PayloadSerializer.stringifyFile(file)\n const model = [payload]\n this.setMetaModel('file', model)\n this.notifyChange()\n this.requestUpdate()\n }\n\n /**\n * Clears the current value\n */\n protected handleClearFile(): void {\n this.value = ''\n this.setMetaModel('file', [])\n this.notifyChange()\n }\n\n /**\n * Reads editor view model\n *\n * @param editor The editor id\n * @returns The view model\n */\n protected readMetaModel(\n editor: string\n ): (ISafePayload | IProperty | IMultipartBody | IRawBody | IUrlEncodedBodyMeta)[] | undefined {\n const meta = this.model\n if (!meta || !Array.isArray(meta)) {\n return undefined\n }\n const item = meta.find((model) => model.type === editor)\n if (!item) {\n return undefined\n }\n if (Array.isArray(item.viewModel)) {\n return item.viewModel\n }\n return undefined\n }\n\n /**\n * Sets editor view model on the local model\n * @param editor The editor id\n * @param model The view model\n */\n protected setMetaModel(\n editor: AllowedEditor,\n model: (ISafePayload | IProperty | IMultipartBody | IRawBody | IUrlEncodedBodyMeta)[]\n ): void {\n if (!Array.isArray(this.modelInternal)) {\n this.modelInternal = []\n }\n const meta = this.model as IBodyMetaModel[]\n const index = meta.findIndex((item) => item.type === editor)\n if (index === -1) {\n meta.push({ type: editor, viewModel: model })\n } else {\n meta[index].viewModel = model\n }\n }\n\n /**\n * A handler for the change event dispatched by the\n * `urlEncode` editor.\n * Updated the local value, model, and notifies the change.\n */\n protected handleUrlEncodeChange(e: Event): void {\n const editor = e.target as BodyUrlEncodedEditor\n this.updateUrlEncodedValue(editor)\n }\n\n protected updateUrlEncodedValue(editor: BodyUrlEncodedEditor): void {\n const { value, model } = editor\n this.valueInternal = value\n const info: IUrlEncodedBodyMeta = {\n model,\n autoEncode: this.autoEncode,\n }\n this.setMetaModel('urlEncode', [info])\n this.notifyChange()\n // do not request update here.\n }\n\n /**\n * A handler for the change event dispatched by the `raw` editor.\n * Updated the local value, model, and notifies the change.\n */\n protected handleRawChange(e: Event): void {\n const editor = e.target as BodyTextEditor\n const { value } = editor\n this.valueInternal = value\n const model: IRawBody[] = [{ value: value as string }]\n this.setMetaModel('raw', model)\n this.notifyChange()\n }\n\n /**\n * A handler for the change event dispatched by the\n * `multipart` editor.\n * Updated the local value, model, and notifies the change.\n */\n protected handleMultipartChange(e: Event): void {\n const editor = e.target as BodyMultipartEditor\n const { value, model } = editor\n this.valueInternal = value\n this.setMetaModel('multipart', model)\n this.notifyChange()\n }\n\n /**\n * Checks whether the current content type header value matches the selected editor.\n * If not it renders a warning message.\n */\n protected analyzeContentType(): void {\n const mime = this.contentType\n if (!mime || typeof mime !== 'string') {\n this.invalidMimeValue = false\n this.mimeValue = undefined\n return\n }\n let ct = mime\n const semicolon = ct.indexOf(';')\n if (semicolon !== -1) {\n ct = ct.substring(0, semicolon)\n }\n this.mimeValue = ct\n if (!ct) {\n this.invalidMimeValue = false\n return\n }\n const { selected } = this\n if (selected === 'multipart') {\n if (ct !== 'multipart/form-data') {\n this.invalidMimeValue = true\n this.invalidMimeMessage = 1\n } else {\n this.invalidMimeValue = false\n }\n } else if (selected === 'urlEncode') {\n if (ct !== 'application/x-www-form-urlencoded') {\n this.invalidMimeValue = true\n this.invalidMimeMessage = 2\n } else {\n this.invalidMimeValue = false\n }\n } else {\n this.invalidMimeValue = false\n }\n }\n\n /**\n * Automatically fixes content type problem.\n */\n protected autoFixMime(): void {\n const { selected } = this\n let updated = ''\n if (selected === 'urlEncode') {\n updated = 'application/x-www-form-urlencoded'\n } else if (selected === 'multipart') {\n updated = 'multipart/form-data'\n }\n Events.Http.Request.State.contentTypeChange(updated, this)\n }\n\n /**\n * A handler for the mime type selection.\n */\n protected handleMimeTypeSelect(e: CustomEvent): void {\n const target = e.detail.item as HTMLElement | undefined\n if (!target) {\n return\n }\n const { type = '' } = target.dataset\n if (this.mimeValue === type) {\n return\n }\n this.contentType = type\n Events.Http.Request.State.contentTypeChange(type, this)\n }\n\n async handlerDrop(e: DragEvent): Promise<void> {\n e.preventDefault()\n const { dataTransfer } = e\n if (!dataTransfer) {\n return\n }\n const { files } = dataTransfer\n if (!files.length) {\n return\n }\n const file = files[0]\n const { selected } = this\n if (selected === 'file') {\n this.value = file\n } else if (selected === 'multipart') {\n const editor = (this.shadowRoot as ShadowRoot).querySelector('http-body-multipart-editor')\n if (!editor) {\n throw new Error(`Invalid state. The <http-body-multipart-editor> element was removed from the DOM.`)\n }\n if (!e.ctrlKey && !e.metaKey) {\n editor.value = new FormData()\n }\n const ps = Array.from(files).map((item) => editor.addFile(item))\n await Promise.all(ps)\n } else {\n const payload = await PayloadSerializer.stringifyBlob(file)\n this.value = payload.data\n const { type } = file\n if (type) {\n Events.Http.Request.State.contentTypeChange(type, this)\n }\n }\n this.notifyChange()\n }\n\n protected handleDragOver(e: DragEvent): void {\n e.preventDefault()\n }\n\n protected handleAddUrlEncode(): void {\n const editor = this.urlEncodedEditor\n if (editor) {\n editor.addParameter()\n }\n }\n\n protected handleUrlEncode(): void {\n const editor = this.urlEncodedEditor\n if (editor) {\n editor.encodeParameters()\n }\n }\n\n protected handleUrlDecode(): void {\n const editor = this.urlEncodedEditor\n if (editor) {\n editor.decodeParameters()\n }\n }\n\n protected handleUrlEncodeAutoChange(e: Event): void {\n const input = e.target as CheckboxElement\n this.autoEncode = !!input.checked\n const editor = this.urlEncodedEditor\n if (editor) {\n this.updateUrlEncodedValue(editor)\n }\n }\n\n protected handleMultipartAddText(): void {\n const editor = this.multipartEditor\n if (editor) {\n editor.addEmptyText()\n }\n }\n\n protected handleMultipartAddFile(): void {\n const editor = this.multipartEditor\n if (editor) {\n editor.addEmptyFile()\n }\n }\n\n override render(): TemplateResult {\n return html`\n <div class=\"actions\">${this.renderBodySelector()} ${this.renderMainActions()}</div>\n ${this.renderInvalidMime()}\n <div class=\"container\">${this.renderEditor()}</div>\n `\n }\n\n /**\n * @returns The template for the dropdown menu for the editor type\n */\n protected renderBodySelector(): TemplateResult {\n const { selected } = this\n const selectedItem = editorTypes.find((i) => i.id === selected)\n const label = (selectedItem && selectedItem.label) || 'Select editor'\n return html`\n <ui-dropdown-list\n verticalAlign=\"top\"\n @select=\"${this.handleTypeChange}\"\n class=\"type-dropdown\"\n closeOnOutsideClick\n >\n <ui-button color=\"tonal\" title=\"Select editor type\" aria-label=\"Opens a menu to select editor type\">\n <ui-icon icon=\"arrowDropDown\" slot=\"icon\" role=\"presentation\"></ui-icon>\n ${label}\n </ui-button>\n <ui-list slot=\"dropdown\" role=\"menu\"> ${this.renderBodyTypeOptions()} </ui-list>\n </ui-dropdown-list>\n `\n }\n\n protected renderBodyTypeOptions(): TemplateResult {\n return html`\n ${editorTypes.map(\n (info) => html`\n <ui-list-item role=\"menuitem\" data-type=\"${info.id}\" title=\"${info.title}\"> ${info.label} </ui-list-item>\n `\n )}\n `\n }\n\n /**\n * @returns The template for the main editor actions.\n */\n protected renderMainActions(): TemplateResult | typeof nothing {\n const { selected } = this\n if (selected === 'raw') {\n return this.renderTextEditorActions()\n }\n if (selected === 'urlEncode') {\n return this.renderUrlEncodeEditorActions()\n }\n if (selected === 'multipart') {\n return this.renderMultipartActions()\n }\n return nothing\n }\n\n protected renderTextEditorActions(): TemplateResult {\n const label = monacoContentTypes[this.mimeValue || ''] || monacoContentTypes['']\n return html`\n <ui-dropdown-list\n verticalAlign=\"top\"\n @select=\"${this.handleMimeTypeSelect}\"\n class=\"mime-dropdown\"\n closeOnOutsideClick\n >\n <ui-button\n color=\"tonal\"\n title=\"Select media type. This overrides the content-type header\"\n aria-label=\"Editor media type\"\n >\n <ui-icon icon=\"arrowDropDown\" slot=\"icon\"></ui-icon>\n ${label}\n </ui-button>\n <ui-list slot=\"dropdown\" role=\"menu\"> ${this.renderMonacoOptions()} </ui-list>\n </ui-dropdown-list>\n `\n }\n\n protected renderMonacoOptions(): TemplateResult[] {\n return Object.keys(monacoContentTypes).map(\n (key) => html`\n ${key === '' ? html`<ui-divider></ui-divider>` : nothing}\n <ui-list-item role=\"menuitem\" data-type=\"${key}\"> ${monacoContentTypes[key]} </ui-list-item>\n `\n )\n }\n\n protected renderUrlEncodeEditorActions(): TemplateResult {\n const { autoEncode } = this\n return html`\n <ui-button\n color=\"tonal\"\n aria-label=\"Adds a new parameter\"\n title=\"Adds a new parameter\"\n @click=\"${this.handleAddUrlEncode}\"\n >\n <ui-icon slot=\"icon\" icon=\"add\" role=\"presentation\"></ui-icon>\n Add\n </ui-button>\n <ui-button\n color=\"outlined\"\n title=\"URL encodes parameters in the editor\"\n aria-label=\"URL encodes parameters in the editor\"\n @click=\"${this.handleUrlEncode}\"\n ?disabled=\"${autoEncode}\"\n >\n URL encode\n </ui-button>\n <ui-button\n color=\"outlined\"\n title=\"URL decodes parameters in the editor\"\n aria-label=\"URL decodes parameters in the editor\"\n @click=\"${this.handleUrlDecode}\"\n ?disabled=\"${autoEncode}\"\n >\n URL decode\n </ui-button>\n <label title=\"When set it automatically encodes the values before sending the request\" class=\"label-medium\">\n <ui-checkbox .checked=\"${autoEncode}\" @change=\"${this.handleUrlEncodeAutoChange}\"></ui-checkbox>\n Encode on send\n </label>\n `\n }\n\n protected renderMultipartActions(): TemplateResult {\n return html`\n <ui-button\n color=\"outlined\"\n title=\"Adds a new part with a file value\"\n aria-label=\"Adds a new part with a file value\"\n @click=\"${this.handleMultipartAddFile}\"\n >\n Add file part\n </ui-button>\n <ui-button\n color=\"outlined\"\n title=\"Adds a new part with a text value\"\n aria-label=\"Adds a new part with a text value\"\n @click=\"${this.handleMultipartAddText}\"\n >\n Add text part\n </ui-button>\n `\n }\n\n /**\n * @returns A template for currently rendered editor\n */\n protected renderEditor(): TemplateResult {\n switch (this.selected) {\n case 'raw':\n return this.renderRawEditor()\n case 'urlEncode':\n return this.renderUrlEncodeEditor()\n case 'multipart':\n return this.renderMultipartEditor()\n case 'file':\n return this.renderFileEditor()\n default:\n return this.renderNoEditor()\n }\n }\n\n /**\n * @returns The template for the raw editor\n */\n protected renderRawEditor(): TemplateResult {\n let { value } = this\n const model = this.readMetaModel('raw') as IRawBody[]\n const hasModel = Array.isArray(model) && model.length\n if (typeof value !== 'string') {\n value = ''\n }\n if (!value && hasModel) {\n const [item] = model\n value = item.value\n }\n return this.renderTextEditor(value as string)\n }\n\n /**\n * @param value The editor value\n * @returns The template for the Monaco editor\n */\n protected renderTextEditor(value: string): TemplateResult {\n const { contentType } = this\n return html` <http-body-text-editor\n .value=\"${value}\"\n .contentType=\"${contentType}\"\n @change=\"${this.handleRawChange}\"\n allowFormInfo\n ></http-body-text-editor>`\n }\n\n /**\n * @returns A template for the application/x-www-form-urlencoded editor\n */\n protected renderUrlEncodeEditor(): TemplateResult {\n const { autoEncode } = this\n const info = this.readMetaModel('urlEncode') as IUrlEncodedBodyMeta[] | undefined\n const model = Array.isArray(info) && info[0] && info[0].model\n return html`\n <http-body-urlencoded-editor\n ?autoEncode=\"${autoEncode}\"\n .model=\"${ifProperty(model)}\"\n @change=\"${this.handleUrlEncodeChange}\"\n allowFormInfo\n ></http-body-urlencoded-editor>\n `\n }\n\n /**\n * @returns A template for the multipart editor\n */\n protected renderMultipartEditor(): TemplateResult {\n const model = this.readMetaModel('multipart') as IMultipartBody[]\n return html`\n <http-body-multipart-editor\n .model=\"${ifProperty(model)}\"\n @change=\"${this.handleMultipartChange}\"\n allowFormInfo\n ></http-body-multipart-editor>\n `\n }\n\n /**\n * @returns A template for the file input editor\n */\n protected renderFileEditor(): TemplateResult {\n return html`\n <div class=\"file-picker\">\n <ui-button color=\"text\" @click=\"${this.handlePickFile}\">Choose a file</ui-button>\n ${this.renderFileDetail()}\n </div>\n <input type=\"file\" class=\"binary-hidden\" @change=\"${this.handleFileChange}\" />\n ${this.renderFormInfo()}\n `\n }\n\n protected renderFormInfo(): TemplateResult {\n return html`\n <p class=\"form-info body-small\">Note that the content-type header will be added when the request is sent.</p>\n `\n }\n\n /**\n * @returns A template for the missing selection\n */\n protected renderNoEditor(): TemplateResult {\n return html`<div class=\"empty-editor\">Invalid editor selected.</div>`\n }\n\n /**\n * @returns A template for the file details.\n */\n protected renderFileDetail(): TemplateResult | string {\n if (!this.hasFile) {\n this.restoreFileModel()\n }\n if (!this.hasFile) {\n return ''\n }\n const { value } = this\n const { size, name } = value as File\n return html`\n <div class=\"file-info label-medium\">\n <span class=\"file-name\">${name || 'unknown name'}</span>\n <span class=\"file-size\">${size} bytes</span>\n <ui-icon-button\n aria-label=\"Delete file\"\n title=\"Deletes the file\"\n @click=\"${this.handleClearFile}\"\n ?disabled=\"${this.readOnly}\"\n >\n <ui-icon icon=\"deleteOutline\" role=\"presentation\"></ui-icon>\n </ui-icon-button>\n </div>\n `\n }\n\n protected renderInvalidMime(): TemplateResult | string {\n if (!this.invalidMimeValue) {\n return ''\n }\n const id = this.invalidMimeMessage\n return html`\n <div class=\"invalid-mime body-medium\">\n <ui-icon icon=\"warning\" class=\"warning-icon\"></ui-icon>\n ${id === 1 ? this.renderFixableInvalidMime('multipart/form-data') : ''}\n ${id === 2 ? this.renderFixableInvalidMime('application/x-www-form-urlencoded') : ''}\n </div>\n `\n }\n\n /**\n * @returns A template for fixable mime type mismatch message.\n */\n protected renderFixableInvalidMime(suggested: string): TemplateResult {\n return html`\n <p class=\"message body-medium\">\n The <code>content-type</code> header has different value than <b>${suggested}</b>.\n </p>\n <ui-button\n class=\"fix\"\n title=\"Updates the content type header for the request\"\n @click=\"${this.autoFixMime}\"\n color=\"tonal\"\n >Fix</ui-button\n >\n `\n }\n}\n"]}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@license
|
|
3
|
-
Copyright 2018 The Advanced REST client authors <arc@mulesoft.com>
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
5
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
6
|
-
the License at
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
-
License for the specific language governing permissions and limitations under
|
|
12
|
-
the License.
|
|
13
|
-
*/
|
|
14
1
|
import { nothing, TemplateResult } from 'lit';
|
|
15
2
|
import { editor, Uri } from 'monaco-editor';
|
|
16
3
|
import { MonacoSchema } from '../../monaco/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/elements/http/BodyTextEditor.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"BodyTextEditor.d.ts","sourceRoot":"","sources":["../../../../src/elements/http/BodyTextEditor.ts"],"names":[],"mappings":"AACA,OAAO,EA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
@license
|
|
5
|
-
Copyright 2018 The Advanced REST client authors <arc@mulesoft.com>
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
7
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
8
|
-
the License at
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
12
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
13
|
-
License for the specific language governing permissions and limitations under
|
|
14
|
-
the License.
|
|
15
|
-
*/
|
|
16
3
|
import { html, nothing } from 'lit';
|
|
17
4
|
import { property, query } from 'lit/decorators.js';
|
|
18
5
|
import { assignTheme } from '../../monaco/theme.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyTextEditor.js","sourceRoot":"","sources":["../../../../src/elements/http/BodyTextEditor.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD;;;;;;;;;;;;EAYE;AACF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AAEzC,mBAAmB;AAEnB,IAAI,OAAO,GAAG,CAAC,CAAA;;sBAE6B,UAAU;;;;;;;;;;;iBAAjC,cAAe,SAAQ,WAAU;;;qCACnD,KAAK,CAAC,YAAY,CAAC;qCAcnB,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAkC1B,QAA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AC,CAAC,EAAE,CAAC;gBACP,OAAM;YACR,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAA;YACvB,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAA;YAC9B,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACtD,CAAC;QAEQ,MAAM;YACb,OAAO,IAAI,CAAA;;QAEP,IAAI,CAAC,cAAc,EAAE;KACxB,CAAA;QACH,CAAC;QAES,cAAc;YACtB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACxB,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,OAAO,IAAI,CAAA;;;;;KAKV,CAAA;QACH,CAAC;;;AA5VH,8BA6VC","sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/**\n@license\nCopyright 2018 The Advanced REST client authors <arc@mulesoft.com>\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n*/\nimport { html, nothing, TemplateResult } from 'lit'\nimport { property, query } from 'lit/decorators.js'\n// import * as monaco from 'monaco-editor'; // /esm/vs/editor/editor.main.js\nimport { editor, Uri } from 'monaco-editor'\nimport { assignTheme } from '../../monaco/theme.js'\nimport { detectLanguage } from '../../monaco/helper.js'\nimport { MonacoSchema } from '../../monaco/types.js'\nimport * as ScrollHelper from '../../lib/ScrollHelper.js'\nimport { Events } from '../../events/Events.js'\nimport ApiElement from '../ApiElement.js'\n\n/* global monaco */\n\nlet modelId = 0\n\nexport default class BodyTextEditor extends ApiElement {\n @query('#container') accessor container!: HTMLDivElement\n\n protected modelUri?: Uri\n\n protected valueInternal = ''\n\n /**\n * A HTTP body.\n * @attribute\n */\n get value(): string | undefined {\n return this.valueInternal\n }\n\n @property({ type: String })\n set value(value) {\n const old = this.valueInternal\n if (old === value) {\n return\n }\n this.valueInternal = value || ''\n const { editor: e } = this\n if (e) {\n e.setValue(value || '')\n }\n }\n\n protected contentTypeInternal?: string\n\n protected languageInternal?: string\n\n /**\n * The current language of the editor. It is set via the `contentType`.\n */\n get language(): string | undefined {\n return this.languageInternal\n }\n\n protected readOnlyValue = false\n\n /**\n * Uses the current content type to detect language support.\n * @attribute\n */\n get contentType(): string | undefined {\n return this.contentTypeInternal\n }\n\n @property({ type: String, reflect: true })\n set contentType(value: string | undefined) {\n const old = this.contentTypeInternal\n if (old === value) {\n return\n }\n this.contentTypeInternal = value\n const oldLang = this.languageInternal\n const lang = detectLanguage(value)\n if (oldLang === lang) {\n return\n }\n this.languageInternal = lang\n this.setLanguage(lang)\n }\n\n /**\n * When set the editor is in read only mode.\n * @attribute\n */\n get readOnly(): boolean {\n return this.readOnlyValue\n }\n\n @property({ type: Boolean, reflect: true })\n set readOnly(value: boolean) {\n const old = this.readOnlyValue\n if (old === value) {\n return\n }\n this.readOnlyValue = value\n this.setEditorConfigProperty('readOnly', value)\n }\n\n protected monacoInstance?: editor.IStandaloneCodeEditor\n\n get editor(): editor.IStandaloneCodeEditor | undefined {\n return this.monacoInstance\n }\n\n protected validationSchemas?: MonacoSchema[]\n\n get schemas(): MonacoSchema[] | undefined {\n return this.validationSchemas\n }\n\n set schemas(value: MonacoSchema[] | undefined) {\n const old = this.validationSchemas\n if (old === value) {\n return\n }\n this.validationSchemas = value\n this.updateEditorSchemas(value)\n }\n\n protected observer: ResizeObserver\n\n /**\n * @attribute\n */\n @property({ type: Boolean }) accessor allowFormInfo: boolean | undefined\n\n constructor() {\n super()\n this.valueChanged = this.valueChanged.bind(this)\n this.observer = new ResizeObserver(this.handleObservedResize.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n ScrollHelper.addListeners(this, this.resizeHandler.bind(this))\n const { container } = this\n if (container) {\n this.observer.observe(container)\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n ScrollHelper.removeListeners(this)\n this.editor?.dispose()\n const { container } = this\n if (container) {\n this.observer.unobserve(container)\n }\n }\n\n override firstUpdated(): void {\n const config = this.generateEditorConfig()\n const node = this.container\n // @ts-ignore\n const instance = monaco.editor.create(node, config) as editor.IStandaloneCodeEditor\n // instance.onDidChangeModelContent(this.valueChanged);\n // We use `onDidBlurEditorText` which is the closest we can get to an input's\n // `change` event. This will reduce the number of updates on the parent\n // editor.\n instance.onDidBlurEditorText(this.valueChanged)\n this.monacoInstance = instance\n this.setupActions(instance)\n this.observer.observe(node)\n }\n\n protected refreshDebouncer?: number\n\n /**\n * Handler for the `resize` event provided by the resizable mixin.\n */\n protected resizeHandler(): void {\n if (this.refreshDebouncer) {\n clearTimeout(this.refreshDebouncer)\n }\n this.refreshDebouncer = setTimeout(this.refreshEditor.bind(this)) as unknown as number\n }\n\n /**\n * A function that is called from the `[resizeHandler]` in a timeout to reduce the number\n * of computations during the application initialization, where it can receive hundreds of\n * the `resize` events.\n */\n protected refreshEditor(): void {\n this.refreshDebouncer = undefined\n if (!this.monacoInstance) {\n return\n }\n this.monacoInstance.layout()\n }\n\n /**\n * @param lang New language to set\n */\n protected setLanguage(lang?: string): void {\n const { editor: e } = this\n if (!e || !lang) {\n return\n }\n const model = e.getModel()\n if (model) {\n // @ts-ignore\n monaco.editor.setModelLanguage(model, lang)\n }\n }\n\n /**\n * Sets up editor actions\n */\n protected setupActions(inst: editor.IStandaloneCodeEditor): void {\n inst.addAction({\n id: 'send-http-request',\n label: 'Send request',\n keybindings: [\n // @ts-ignore\n monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter,\n ],\n precondition: undefined,\n keybindingContext: undefined,\n contextMenuGroupId: 'navigation',\n contextMenuOrder: 1.5,\n run: (): void => {\n Events.Http.Request.send(this)\n },\n })\n }\n\n protected changeTimeout?: number\n\n protected valueChanged(): void {\n const { editor: ed } = this\n if (!ed) {\n return\n }\n const editorValue = ed.getValue()\n if (editorValue === this.valueInternal) {\n return\n }\n this.valueInternal = editorValue\n if (this.changeTimeout) {\n // window.clearTimeout(this[changeTimeout]);\n window.cancelAnimationFrame(this.changeTimeout)\n }\n this.changeTimeout = window.requestAnimationFrame(() => {\n this.notifyChange()\n })\n }\n\n /**\n * Generates Monaco configuration\n */\n protected generateEditorConfig(): editor.IStandaloneEditorConstructionOptions {\n const { value = '', readOnly, languageInternal: language } = this\n // @ts-ignore\n this.modelUri = monaco.Uri.parse(`http://raw-editor/model${++modelId}.json`)\n // @ts-ignore\n const model = monaco.editor.createModel(value, language || 'json', this.modelUri)\n\n const schemas = this.getCurrentSchemas()\n this.updateEditorSchemas(schemas)\n\n let config: editor.IStandaloneEditorConstructionOptions = {\n minimap: {\n enabled: false,\n },\n readOnly,\n formatOnType: true,\n folding: true,\n tabSize: 2,\n detectIndentation: true,\n // value,\n // automaticLayout: true,\n model,\n padding: { top: 0, bottom: 0 },\n scrollBeyondLastLine: false,\n foldingHighlight: true,\n selectionHighlight: true,\n }\n // @ts-ignore\n config = assignTheme(monaco, config)\n if (language) {\n config.language = language\n }\n return config\n }\n\n protected getCurrentSchemas(): MonacoSchema[] {\n const { schemas } = this\n if (Array.isArray(schemas) && schemas.length) {\n schemas[0].fileMatch = [this.modelUri?.toString() || '']\n return schemas\n }\n return [this.createDefaultSchema()]\n }\n\n protected createDefaultSchema(): MonacoSchema {\n const schema: MonacoSchema = {\n uri: 'http://raw-editor/default-schema.json',\n fileMatch: [this.modelUri?.toString() || ''],\n schema: {},\n }\n return schema\n }\n\n protected updateEditorSchemas(schemas?: MonacoSchema[]): void {\n if (!this.modelUri || !schemas) {\n // the editor is not yet ready. This will be called again when it is ready.\n return\n }\n let value = schemas\n if (!Array.isArray(value) || !value.length) {\n value = [this.createDefaultSchema()]\n } else {\n value[0] = { ...value[0], fileMatch: [this.modelUri.toString()] }\n }\n // @ts-ignore\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n validate: true,\n schemas: value,\n })\n }\n\n /**\n * @param prop The property to set\n */\n protected setEditorConfigProperty(prop: keyof editor.IEditorOptions, value: unknown): void {\n const { editor: e } = this\n if (!e) {\n return\n }\n const opts = {\n [prop]: value,\n }\n e.updateOptions(opts)\n }\n\n protected handleObservedResize(entries: ResizeObserverEntry[]): void {\n const { editor: e } = this\n if (!e) {\n return\n }\n const [entry] = entries\n const rect = entry.contentRect\n e.layout({ height: rect.height, width: rect.width })\n }\n\n override render(): TemplateResult {\n return html`\n <div id=\"container\"></div>\n ${this.renderFormInfo()}\n `\n }\n\n protected renderFormInfo(): TemplateResult | typeof nothing {\n if (!this.allowFormInfo) {\n return nothing\n }\n return html`\n <p class=\"form-info\">\n Note that the content-type header will be added when the request is sent. We encourage you to use variables to\n insert sensitive data.\n </p>\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BodyTextEditor.js","sourceRoot":"","sources":["../../../../src/elements/http/BodyTextEditor.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AAEzC,mBAAmB;AAEnB,IAAI,OAAO,GAAG,CAAC,CAAA;;sBAE6B,UAAU;;;;;;;;;;;iBAAjC,cAAe,SAAQ,WAAU;;;qCACnD,KAAK,CAAC,YAAY,CAAC;q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MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAA;YAC1B,IAAI,CAAC,CAAC,EAAE,CAAC;gBACP,OAAM;YACR,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAA;YACvB,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAA;YAC9B,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACtD,CAAC;QAEQ,MAAM;YACb,OAAO,IAAI,CAAA;;QAEP,IAAI,CAAC,cAAc,EAAE;KACxB,CAAA;QACH,CAAC;QAES,cAAc;YACtB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACxB,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,OAAO,IAAI,CAAA;;;;;KAKV,CAAA;QACH,CAAC;;;AA5VH,8BA6VC","sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { html, nothing, TemplateResult } from 'lit'\nimport { property, query } from 'lit/decorators.js'\n// import * as monaco from 'monaco-editor'; // /esm/vs/editor/editor.main.js\nimport { editor, Uri } from 'monaco-editor'\nimport { assignTheme } from '../../monaco/theme.js'\nimport { detectLanguage } from '../../monaco/helper.js'\nimport { MonacoSchema } from '../../monaco/types.js'\nimport * as ScrollHelper from '../../lib/ScrollHelper.js'\nimport { Events } from '../../events/Events.js'\nimport ApiElement from '../ApiElement.js'\n\n/* global monaco */\n\nlet modelId = 0\n\nexport default class BodyTextEditor extends ApiElement {\n @query('#container') accessor container!: HTMLDivElement\n\n protected modelUri?: Uri\n\n protected valueInternal = ''\n\n /**\n * A HTTP body.\n * @attribute\n */\n get value(): string | undefined {\n return this.valueInternal\n }\n\n @property({ type: String })\n set value(value) {\n const old = this.valueInternal\n if (old === value) {\n return\n }\n this.valueInternal = value || ''\n const { editor: e } = this\n if (e) {\n e.setValue(value || '')\n }\n }\n\n protected contentTypeInternal?: string\n\n protected languageInternal?: string\n\n /**\n * The current language of the editor. It is set via the `contentType`.\n */\n get language(): string | undefined {\n return this.languageInternal\n }\n\n protected readOnlyValue = false\n\n /**\n * Uses the current content type to detect language support.\n * @attribute\n */\n get contentType(): string | undefined {\n return this.contentTypeInternal\n }\n\n @property({ type: String, reflect: true })\n set contentType(value: string | undefined) {\n const old = this.contentTypeInternal\n if (old === value) {\n return\n }\n this.contentTypeInternal = value\n const oldLang = this.languageInternal\n const lang = detectLanguage(value)\n if (oldLang === lang) {\n return\n }\n this.languageInternal = lang\n this.setLanguage(lang)\n }\n\n /**\n * When set the editor is in read only mode.\n * @attribute\n */\n get readOnly(): boolean {\n return this.readOnlyValue\n }\n\n @property({ type: Boolean, reflect: true })\n set readOnly(value: boolean) {\n const old = this.readOnlyValue\n if (old === value) {\n return\n }\n this.readOnlyValue = value\n this.setEditorConfigProperty('readOnly', value)\n }\n\n protected monacoInstance?: editor.IStandaloneCodeEditor\n\n get editor(): editor.IStandaloneCodeEditor | undefined {\n return this.monacoInstance\n }\n\n protected validationSchemas?: MonacoSchema[]\n\n get schemas(): MonacoSchema[] | undefined {\n return this.validationSchemas\n }\n\n set schemas(value: MonacoSchema[] | undefined) {\n const old = this.validationSchemas\n if (old === value) {\n return\n }\n this.validationSchemas = value\n this.updateEditorSchemas(value)\n }\n\n protected observer: ResizeObserver\n\n /**\n * @attribute\n */\n @property({ type: Boolean }) accessor allowFormInfo: boolean | undefined\n\n constructor() {\n super()\n this.valueChanged = this.valueChanged.bind(this)\n this.observer = new ResizeObserver(this.handleObservedResize.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n ScrollHelper.addListeners(this, this.resizeHandler.bind(this))\n const { container } = this\n if (container) {\n this.observer.observe(container)\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n ScrollHelper.removeListeners(this)\n this.editor?.dispose()\n const { container } = this\n if (container) {\n this.observer.unobserve(container)\n }\n }\n\n override firstUpdated(): void {\n const config = this.generateEditorConfig()\n const node = this.container\n // @ts-ignore\n const instance = monaco.editor.create(node, config) as editor.IStandaloneCodeEditor\n // instance.onDidChangeModelContent(this.valueChanged);\n // We use `onDidBlurEditorText` which is the closest we can get to an input's\n // `change` event. This will reduce the number of updates on the parent\n // editor.\n instance.onDidBlurEditorText(this.valueChanged)\n this.monacoInstance = instance\n this.setupActions(instance)\n this.observer.observe(node)\n }\n\n protected refreshDebouncer?: number\n\n /**\n * Handler for the `resize` event provided by the resizable mixin.\n */\n protected resizeHandler(): void {\n if (this.refreshDebouncer) {\n clearTimeout(this.refreshDebouncer)\n }\n this.refreshDebouncer = setTimeout(this.refreshEditor.bind(this)) as unknown as number\n }\n\n /**\n * A function that is called from the `[resizeHandler]` in a timeout to reduce the number\n * of computations during the application initialization, where it can receive hundreds of\n * the `resize` events.\n */\n protected refreshEditor(): void {\n this.refreshDebouncer = undefined\n if (!this.monacoInstance) {\n return\n }\n this.monacoInstance.layout()\n }\n\n /**\n * @param lang New language to set\n */\n protected setLanguage(lang?: string): void {\n const { editor: e } = this\n if (!e || !lang) {\n return\n }\n const model = e.getModel()\n if (model) {\n // @ts-ignore\n monaco.editor.setModelLanguage(model, lang)\n }\n }\n\n /**\n * Sets up editor actions\n */\n protected setupActions(inst: editor.IStandaloneCodeEditor): void {\n inst.addAction({\n id: 'send-http-request',\n label: 'Send request',\n keybindings: [\n // @ts-ignore\n monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter,\n ],\n precondition: undefined,\n keybindingContext: undefined,\n contextMenuGroupId: 'navigation',\n contextMenuOrder: 1.5,\n run: (): void => {\n Events.Http.Request.send(this)\n },\n })\n }\n\n protected changeTimeout?: number\n\n protected valueChanged(): void {\n const { editor: ed } = this\n if (!ed) {\n return\n }\n const editorValue = ed.getValue()\n if (editorValue === this.valueInternal) {\n return\n }\n this.valueInternal = editorValue\n if (this.changeTimeout) {\n // window.clearTimeout(this[changeTimeout]);\n window.cancelAnimationFrame(this.changeTimeout)\n }\n this.changeTimeout = window.requestAnimationFrame(() => {\n this.notifyChange()\n })\n }\n\n /**\n * Generates Monaco configuration\n */\n protected generateEditorConfig(): editor.IStandaloneEditorConstructionOptions {\n const { value = '', readOnly, languageInternal: language } = this\n // @ts-ignore\n this.modelUri = monaco.Uri.parse(`http://raw-editor/model${++modelId}.json`)\n // @ts-ignore\n const model = monaco.editor.createModel(value, language || 'json', this.modelUri)\n\n const schemas = this.getCurrentSchemas()\n this.updateEditorSchemas(schemas)\n\n let config: editor.IStandaloneEditorConstructionOptions = {\n minimap: {\n enabled: false,\n },\n readOnly,\n formatOnType: true,\n folding: true,\n tabSize: 2,\n detectIndentation: true,\n // value,\n // automaticLayout: true,\n model,\n padding: { top: 0, bottom: 0 },\n scrollBeyondLastLine: false,\n foldingHighlight: true,\n selectionHighlight: true,\n }\n // @ts-ignore\n config = assignTheme(monaco, config)\n if (language) {\n config.language = language\n }\n return config\n }\n\n protected getCurrentSchemas(): MonacoSchema[] {\n const { schemas } = this\n if (Array.isArray(schemas) && schemas.length) {\n schemas[0].fileMatch = [this.modelUri?.toString() || '']\n return schemas\n }\n return [this.createDefaultSchema()]\n }\n\n protected createDefaultSchema(): MonacoSchema {\n const schema: MonacoSchema = {\n uri: 'http://raw-editor/default-schema.json',\n fileMatch: [this.modelUri?.toString() || ''],\n schema: {},\n }\n return schema\n }\n\n protected updateEditorSchemas(schemas?: MonacoSchema[]): void {\n if (!this.modelUri || !schemas) {\n // the editor is not yet ready. This will be called again when it is ready.\n return\n }\n let value = schemas\n if (!Array.isArray(value) || !value.length) {\n value = [this.createDefaultSchema()]\n } else {\n value[0] = { ...value[0], fileMatch: [this.modelUri.toString()] }\n }\n // @ts-ignore\n monaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n validate: true,\n schemas: value,\n })\n }\n\n /**\n * @param prop The property to set\n */\n protected setEditorConfigProperty(prop: keyof editor.IEditorOptions, value: unknown): void {\n const { editor: e } = this\n if (!e) {\n return\n }\n const opts = {\n [prop]: value,\n }\n e.updateOptions(opts)\n }\n\n protected handleObservedResize(entries: ResizeObserverEntry[]): void {\n const { editor: e } = this\n if (!e) {\n return\n }\n const [entry] = entries\n const rect = entry.contentRect\n e.layout({ height: rect.height, width: rect.width })\n }\n\n override render(): TemplateResult {\n return html`\n <div id=\"container\"></div>\n ${this.renderFormInfo()}\n `\n }\n\n protected renderFormInfo(): TemplateResult | typeof nothing {\n if (!this.allowFormInfo) {\n return nothing\n }\n return html`\n <p class=\"form-info\">\n Note that the content-type header will be added when the request is sent. We encourage you to use variables to\n insert sensitive data.\n </p>\n `\n }\n}\n"]}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@license
|
|
3
|
-
Copyright 2020 The Advanced REST client authors <arc@mulesoft.com>
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
5
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
6
|
-
the License at
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
-
License for the specific language governing permissions and limitations under
|
|
12
|
-
the License.
|
|
13
|
-
*/
|
|
14
1
|
import { TemplateResult, PropertyValues, nothing } from 'lit';
|
|
15
2
|
import { type IProperty } from '@api-client/core/models/Property.js';
|
|
16
3
|
import ApiElement from '../ApiElement.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyUrlEncodedEditor.d.ts","sourceRoot":"","sources":["../../../../src/elements/http/BodyUrlEncodedEditor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BodyUrlEncodedEditor.d.ts","sourceRoot":"","sources":["../../../../src/elements/http/BodyUrlEncodedEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc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ate, __runInitializers } from "tslib";
|
|
2
|
-
/**
|
|
3
|
-
@license
|
|
4
|
-
Copyright 2020 The Advanced REST client authors <arc@mulesoft.com>
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
6
|
-
use this file except in compliance with the License. You may obtain a copy of
|
|
7
|
-
the License at
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
11
|
-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
|
-
License for the specific language governing permissions and limitations under
|
|
13
|
-
the License.
|
|
14
|
-
*/
|
|
15
2
|
import { html, nothing } from 'lit';
|
|
16
3
|
import { property } from 'lit/decorators.js';
|
|
17
4
|
import { live } from 'lit/directives/live.js';
|