@aquera/nile-elements 0.0.88 → 0.0.90
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/README.md +11 -1
- package/demo/variables.css +6 -0
- package/demo/variables_v2.css +6 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +252 -221
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +5 -2
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js.map +1 -1
- package/dist/nile-code-editor/theme.esm.js +1 -1
- package/dist/nile-divider/nile-divider.css.cjs.js +1 -1
- package/dist/nile-divider/nile-divider.css.cjs.js.map +1 -1
- package/dist/nile-divider/nile-divider.css.esm.js +2 -2
- package/dist/nile-toolbar/index.cjs.js +1 -1
- package/dist/nile-toolbar/index.cjs.js.map +1 -1
- package/dist/nile-toolbar/index.esm.js +1 -3
- package/dist/nile-toolbar/nile-toolbar.cjs.js +2 -0
- package/dist/nile-toolbar/nile-toolbar.cjs.js.map +1 -0
- package/dist/nile-toolbar/nile-toolbar.css.cjs.js +1 -1
- package/dist/nile-toolbar/nile-toolbar.css.cjs.js.map +1 -1
- package/dist/nile-toolbar/nile-toolbar.css.esm.js +20 -4
- package/dist/nile-toolbar/nile-toolbar.esm.js +9 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.css.js +3 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +6 -7
- package/dist/src/nile-code-editor/nile-code-editor.js +13 -9
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +1 -2
- package/dist/src/nile-code-editor/theme.js +3 -2
- package/dist/src/nile-code-editor/theme.js.map +1 -1
- package/dist/src/nile-divider/nile-divider.css.js +2 -2
- package/dist/src/nile-divider/nile-divider.css.js.map +1 -1
- package/dist/src/nile-toolbar/index.d.ts +1 -31
- package/dist/src/nile-toolbar/index.js +1 -41
- package/dist/src/nile-toolbar/index.js.map +1 -1
- package/dist/src/nile-toolbar/nile-toolbar.css.d.ts +5 -5
- package/dist/src/nile-toolbar/nile-toolbar.css.js +23 -7
- package/dist/src/nile-toolbar/nile-toolbar.css.js.map +1 -1
- package/dist/src/nile-toolbar/nile-toolbar.d.ts +34 -0
- package/dist/src/nile-toolbar/nile-toolbar.js +61 -0
- package/dist/src/nile-toolbar/nile-toolbar.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -2
- package/src/index.ts +2 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +3 -0
- package/src/nile-code-editor/nile-code-editor.ts +41 -29
- package/src/nile-code-editor/theme.ts +3 -2
- package/src/nile-divider/nile-divider.css.ts +2 -2
- package/src/nile-toolbar/index.ts +1 -52
- package/src/nile-toolbar/nile-toolbar.css.ts +25 -9
- package/src/nile-toolbar/nile-toolbar.ts +63 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var
|
1
|
+
System.register([],function(_export,_context){"use strict";var t;return{setters:[],execute:function execute(){_export("T",t={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{scrollbarWidth:"thin"}});}};});
|
2
2
|
//# sourceMappingURL=theme.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"theme.cjs.js","sources":["../../../src/nile-code-editor/theme.ts"],"sourcesContent":["export const Theme = {\n '&': {\n
|
1
|
+
{"version":3,"file":"theme.cjs.js","sources":["../../../src/nile-code-editor/theme.ts"],"sourcesContent":["export const Theme = {\n '&': {\n fontSize: '14px',\n fontFamily: 'Colfax-regular',\n fontWeight: '400',\n },\n '.cm-content': {},\n \".cm-scroller\": {\n scrollbarWidth:'thin',\n },\n};"],"names":["Theme","fontSize","fontFamily","fontWeight","scrollbarWidth"],"mappings":"0HAAaA,EAAQ,CACnB,GAAA,CAAK,CACHC,QAAAA,CAAU,OACVC,UAAY,CAAA,gBAAA,CACZC,UAAY,CAAA,KAAA,CAAA,CAEd,cAAe,CAAE,CAAA,CACjB,cAAgB,CAAA,CACdC,eAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const t={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{scrollbarWidth:"thin"}};export{t as T};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../index-c7ad3b47.cjs.js"],function(_export,_context){"use strict";var i,_templateObject,
|
1
|
+
System.register(["../index-c7ad3b47.cjs.js"],function(_export,_context){"use strict";var i,_templateObject,o;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){i=_index001CjsJs.i;}],execute:function execute(){_export("s",o=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\tdisplay: block;\n\t\theight: 100%;\n\t}\n\n\t.divider {\n\t\tbackground-color: var(--nile-colors-gray-light-mode-200, #eaecf0);;\n\t}\n\t\n\t.horizontal {\n\t\theight: 2px;\n\t\t/* width: 100%; */\n\t\tmargin: 8px 0;\n\t}\n\n\t.vertical {\n\t\theight: 100%;\n\t\twidth: 2px;\n\t\tmargin: 0 8px;\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t}\n\n\t.inset.horizontal {\n\t\tmargin-left: 72px;\n\t}\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-divider.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-divider.css.cjs.js","sources":["../../../src/nile-divider/nile-divider.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * Divider CSS\n */\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t\theight: 100%;\n\t}\n\n\t.divider {\n\t\tbackground-color: var(--nile-colors-gray-light-mode-200, #eaecf0);;\n\t}\n\t\n\t.horizontal {\n\t\theight: 2px;\n\t\
|
1
|
+
{"version":3,"file":"nile-divider.css.cjs.js","sources":["../../../src/nile-divider/nile-divider.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * Divider CSS\n */\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t\theight: 100%;\n\t}\n\n\t.divider {\n\t\tbackground-color: var(--nile-colors-gray-light-mode-200, #eaecf0);;\n\t}\n\t\n\t.horizontal {\n\t\theight: 2px;\n\t\t/* width: 100%; */\n\t\tmargin: 8px 0;\n\t}\n\n\t.vertical {\n\t\theight: 100%;\n\t\twidth: 2px;\n\t\tmargin: 0 8px;\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t}\n\n\t.inset.horizontal {\n\t\tmargin-left: 72px;\n\t}\n`;\n\nexport default [styles];"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"wXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -10,7 +10,7 @@ import{i}from"../index-0a3007c5.esm.js";const e=i`
|
|
10
10
|
|
11
11
|
.horizontal {
|
12
12
|
height: 2px;
|
13
|
-
width: 100%;
|
13
|
+
/* width: 100%; */
|
14
14
|
margin: 8px 0;
|
15
15
|
}
|
16
16
|
|
@@ -22,7 +22,7 @@ import{i}from"../index-0a3007c5.esm.js";const e=i`
|
|
22
22
|
vertical-align: middle;
|
23
23
|
}
|
24
24
|
|
25
|
-
.inset {
|
25
|
+
.inset.horizontal {
|
26
26
|
margin-left: 72px;
|
27
27
|
}
|
28
28
|
`;export{e as s};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
System.register(["./nile-toolbar.cjs.js","tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-toolbar.css.cjs.js","../internal/nile-element.cjs.js","lit","../property-217fe924.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileToolbarCjsJs){_export("NileToolbar",_nileToolbarCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileToolbarCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function execute(){}};});
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1,3 +1 @@
|
|
1
|
-
|
2
|
-
<slot> </slot>
|
3
|
-
`}};l=s([o("nile-toolbar")],l);
|
1
|
+
export{N as NileToolbar}from"./nile-toolbar.esm.js";import"tslib";import"../index-0a3007c5.esm.js";import"lit/decorators.js";import"./nile-toolbar.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../property-09139d3c.esm.js";
|
@@ -0,0 +1,2 @@
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-toolbar.css.cjs.js","../internal/nile-element.cjs.js","../property-217fe924.cjs.js","lit"],function(_export,_context){"use strict";var t,o,r,s,e,l,_templateObject,i;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){o=_index001CjsJs.x;},function(_litDecoratorsJs){r=_litDecoratorsJs.customElement;},function(_nileToolbarCssCjsJs){s=_nileToolbarCssCjsJs.s;},function(_internalNileElementCjsJs){e=_internalNileElementCjsJs.N;},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){}],execute:function execute(){_export("N",i=/*#__PURE__*/function(_e){function i(){var _this;_classCallCheck(this,i);_this=_callSuper(this,i,arguments),_this.color="",_this.background="";return _this;}_inherits(i,_e);return _createClass(i,[{key:"render",value:function render(){return o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t<div class=\"toolbar\" part=\"nile-toolbar\" style=\""," ","\">\n\t\t <slot name=\"start\"></slot>\n\t\t <div class=\"toolbar-content\" part=\"toolbar-mid\">\n\t\t\t<slot></slot>\n\t\t </div>\n\t\t <slot name=\"end\"></slot>\n\t\t</div>\n\t "])),this.color?"color:"+this.color+";":"",this.background?"background:"+this.background+";":"");}}],[{key:"styles",get:function get(){return[s];}}]);}(e));t([l({reflect:!0})],i.prototype,"color",void 0),t([l({reflect:!0})],i.prototype,"background",void 0),_export("N",i=t([r("nile-toolbar")],i));}};});
|
2
|
+
//# sourceMappingURL=nile-toolbar.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nile-toolbar.cjs.js","sources":["../../../src/nile-toolbar/nile-toolbar.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html, property, CSSResultArray, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-toolbar.css';\nimport NileElement from '../internal/nile-element';\n\n\n/**\n * Nile toolbar component.\n *\n * @tag nile-toolbar\n *\n */\n@customElement('nile-toolbar')\nexport class NileToolbar extends NileElement {\n\n\t@property({ reflect: true }) color: string = ''\n\t@property({ reflect: true }) background: string = ''\n\n\t/**\n\t * The styles for nile-toolbar\n\t * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n\t */\n\tpublic static get styles(): CSSResultArray {\n\t\treturn [styles];\n\t}\n\n\t/* #endregion */\n\n\t/* #region Methods */\n\n\t/**\n\t * Render method\n\t * @slot This is a slot test\n\t */\n\tpublic render(): TemplateResult {\n\t\treturn html`\n\t\t<div class=\"toolbar\" part=\"nile-toolbar\" style=\"${this.color ? 'color:' + this.color + ';' : ''} ${this.background ? 'background:' + this.background + ';' : ''}\">\n\t\t <slot name=\"start\"></slot>\n\t\t <div class=\"toolbar-content\" part=\"toolbar-mid\">\n\t\t\t<slot></slot>\n\t\t </div>\n\t\t <slot name=\"end\"></slot>\n\t\t</div>\n\t `;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileToolbar;\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'nile-toolbar': NileToolbar;\n\t}\n}"],"names":["NileToolbar","_e","i","constructor","this","color","background","_this","_inherits","_createClass","key","value","render","html","_templateObject","_taggedTemplateLiteral","__decorate","get","styles","NileElement","property","reflect","prototype","customElement"],"mappings":"qsHAoBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAEuBC,KAAAA,CAAKC,KAAW,CAAA,EAAA,CAChBD,KAAAA,CAAUE,UAAAA,CAAW,EA+BlD,QAAAC,KAAA,EAzBOC,SAAA,CAAAN,CAAA,CAAAD,EAAA,SAAAQ,YAAA,CAAAP,CAAA,GAAAQ,GAAA,UAAAC,KAAA,CAYA,SAAAC,OAAA,CAAAA,CACN,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,oQACuCX,IAAKC,CAAAA,KAAAA,CAAQ,QAAWD,CAAAA,IAAAA,CAAKC,KAAQ,CAAA,GAAA,CAAM,EAAMD,CAAAA,IAAAA,CAAKE,UAAa,CAAA,aAAA,CAAgBF,IAAKE,CAAAA,UAAAA,CAAa,GAAM,CAAA,EAAA,EAQ7J,CA7B4BU,KAAAA,GAAAA,UAAAA,GAAAA,CAOtB,SAAAC,IAAA,CACN,CAAA,MAAO,CAACC,CACR,CAAA,EAUM,MArByBC,IAEHH,CAAAA,CAAA,CAA5BI,CAAAA,CAAS,CAAEC,OAAAA,CAAAA,CAAS,KAA0BrB,CAAAsB,CAAAA,SAAAA,CAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAClBN,CAAA,CAAA,CAA5BI,EAAS,CAAEC,OAAAA,CAAAA,CAAS,CAA+BrB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAsB,SAAA,CAAA,YAAA,CAAA,IAAA,EAHxCtB,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAWgB,CAAA,CAAA,CADvBO,CAAc,CAAA,cAAA,CAAA,CAAA,CACFvB"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../index-c7ad3b47.cjs.js"],function(_export,_context){"use strict";var
|
1
|
+
System.register(["../index-c7ad3b47.cjs.js"],function(_export,_context){"use strict";var o,_templateObject,i;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){o=_index001CjsJs.i;}],execute:function execute(){_export("s",i=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n width: 100%;\n }\n\n .toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n box-sizing: border-box;\n min-height: 64px;\n\tline-height: var(--nile-toolbar-line-height);\n\tfont-weight: var(--nile-toolbar-font-weight);\n font-family: var(--nile-font-family-sans-serif);\n\tfont-size: var(--nile-toolbar-font-size);\n background-color: var(--nile-toolbar-background-color, #f5f5f5);\n color: var(--nile-toolbar-text-color, rgba(0, 0, 0, 0.87));\n }\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-toolbar.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-toolbar.css.cjs.js","sources":["../../../src/nile-toolbar/nile-toolbar.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * Toolbar CSS\n */\nexport const styles = css`\n
|
1
|
+
{"version":3,"file":"nile-toolbar.css.cjs.js","sources":["../../../src/nile-toolbar/nile-toolbar.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * Toolbar CSS\n */\nexport const styles = css`\n :host {\n display: block;\n width: 100%;\n }\n\n .toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n box-sizing: border-box;\n min-height: 64px;\n\tline-height: var(--nile-toolbar-line-height);\n\tfont-weight: var(--nile-toolbar-font-weight);\n font-family: var(--nile-font-family-sans-serif);\n\tfont-size: var(--nile-toolbar-font-size);\n background-color: var(--nile-toolbar-background-color, #f5f5f5);\n color: var(--nile-toolbar-text-color, rgba(0, 0, 0, 0.87));\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"wXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -1,5 +1,21 @@
|
|
1
|
-
import{i as
|
2
|
-
|
1
|
+
import{i as o}from"../index-0a3007c5.esm.js";const e=o`
|
2
|
+
:host {
|
3
|
+
display: block;
|
4
|
+
width: 100%;
|
5
|
+
}
|
3
6
|
|
4
|
-
|
5
|
-
|
7
|
+
.toolbar {
|
8
|
+
display: flex;
|
9
|
+
align-items: center;
|
10
|
+
justify-content: space-between;
|
11
|
+
padding: 0 16px;
|
12
|
+
box-sizing: border-box;
|
13
|
+
min-height: 64px;
|
14
|
+
line-height: var(--nile-toolbar-line-height);
|
15
|
+
font-weight: var(--nile-toolbar-font-weight);
|
16
|
+
font-family: var(--nile-font-family-sans-serif);
|
17
|
+
font-size: var(--nile-toolbar-font-size);
|
18
|
+
background-color: var(--nile-toolbar-background-color, #f5f5f5);
|
19
|
+
color: var(--nile-toolbar-text-color, rgba(0, 0, 0, 0.87));
|
20
|
+
}
|
21
|
+
`;export{e as s};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import{__decorate as t}from"tslib";import{x as o}from"../index-0a3007c5.esm.js";import{customElement as r}from"lit/decorators.js";import{s}from"./nile-toolbar.css.esm.js";import{N as e}from"../internal/nile-element.esm.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";let i=class extends e{constructor(){super(...arguments),this.color="",this.background=""}static get styles(){return[s]}render(){return o`
|
2
|
+
<div class="toolbar" part="nile-toolbar" style="${this.color?"color:"+this.color+";":""} ${this.background?"background:"+this.background+";":""}">
|
3
|
+
<slot name="start"></slot>
|
4
|
+
<div class="toolbar-content" part="toolbar-mid">
|
5
|
+
<slot></slot>
|
6
|
+
</div>
|
7
|
+
<slot name="end"></slot>
|
8
|
+
</div>
|
9
|
+
`}};t([l({reflect:!0})],i.prototype,"color",void 0),t([l({reflect:!0})],i.prototype,"background",void 0),i=t([r("nile-toolbar")],i);export{i as N};
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAA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Y,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { NileButton } from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\nexport { NileLink } from './nile-link';\nexport { NileButtonToggleGroup } from './nile-button-toggle-group';\nexport { NileButtonToggle } from './nile-button-toggle';\nexport { NileSwitcher } from './nile-switcher';\nexport { NileContentEditor } from './nile-content-editor';\nexport { NileDialog } from './nile-dialog';\nexport { NileErrorNotification } from './nile-error-notification';\nexport { NileTabGroup } from './nile-tab-group';\nexport { NileTab } from './nile-tab';\nexport { NileTabPanel } from './nile-tab-panel';\nexport { NileCodeEditor } from './nile-code-editor';\nexport { NileToast } from './nile-toast';\nexport { NileBreadcrumb } from './nile-breadcrumb';\nexport { NileBreadcrumbItem } from './nile-breadcrumb-item';\nexport { NileFormGroup } from './nile-form-group';\nexport { NileCard } from './nile-card';\nexport { NilePopover } from './nile-popover';\nexport { NileButtonFilter } from './nile-button-filter';\nexport { NileCircularProgressbar } from './nile-circular-progressbar';\nexport { NileSidebarMenu } from './nile-sidebar-menu';\nexport { NileSidebarMenuItems } from './nile-sidebar-menu-items';\nexport { NileSidebarWrapper } from './nile-sidebar-wrapper';\nexport { NileTableCellItem } from './nile-table-cell-item';\nexport { NileTableRow } from './nile-table-row';\nexport { NileTableBody } from './nile-table-body';\nexport { NileTableHeaderItem } from './nile-table-header-item';\nexport { NileAvatar } from './nile-avatar';\nexport { NilePageHeader } from './nile-page-header';\nexport { NileEmptyState } from './nile-empty-state';\nexport { NileHero } from './nile-hero';\nexport { NileStepperItem } from './nile-stepper-item';\nexport { NileStepper } from './nile-stepper';\nexport { NileHeroHeader } from './nile-hero-header';\nexport { NileVerticalStepperItem } from './nile-vertical-stepper-item';\nexport { NileFormatDate } from './nile-format-date';\nexport { NileSplitPanel } from './nile-split-panel';\nexport { NileTree } from './nile-tree';\nexport { NileTreeItem } from './nile-tree-item';\nexport { NileListItem } from './nile-list-item';\nexport { NileList } from './nile-list';\nexport { NileDetail } from './nile-detail';\nexport { NileDivider } from './nile-divider';\nexport { NileTitle } from './nile-title';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,M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from './nile-button';\nexport { NileHeading } from './nile-heading';\nexport { NileIcon } from './nile-icon';\nexport { NileInput } from './nile-input';\nexport { NileSidebar } from './nile-sidebar';\nexport { NileMenu } from './nile-menu';\nexport { NileBadge } from './nile-badge';\nexport { NileDrawer } from './nile-drawer';\nexport { NileCheckbox } from './nile-checkbox';\nexport { NileRadio } from './nile-radio';\nexport { NileRadioGroup } from './nile-radio-group';\nexport { NilePopup } from './nile-popup';\nexport { NileTooltip } from './nile-tooltip';\nexport { NileSlideToggle } from './nile-slide-toggle';\nexport { NileLoader } from './nile-loader';\nexport { NileProgressBar } from './nile-progress-bar';\nexport { NileSpinner } from './nile-spinner';\nexport { NileSelect } from './nile-select';\nexport { NileOption } from './nile-option';\nexport { NileTag } from './nile-tag';\nexport { NileIconButton } from './nile-icon-button';\nexport { NileMenuItem } from './nile-menu-item';\nexport { NileDropdown } from './nile-dropdown';\nexport { NileAutoComplete } from './nile-auto-complete';\nexport { NileChip } from './nile-chip';\nexport { NileTextarea } from './nile-textarea';\nexport { NileDatePicker } from './nile-date-picker';\nexport { NileErrorMessage } from './nile-error-message';\nexport { NileFormErrorMessage } from './nile-form-error-message';\nexport { NileFormHelpText } from './nile-form-help-text';\nexport { NileCalendar } from './nile-calendar';\nexport { NileLink } from './nile-link';\nexport { NileButtonToggleGroup } from './nile-button-toggle-group';\nexport { NileButtonToggle } from './nile-button-toggle';\nexport { NileSwitcher } from './nile-switcher';\nexport { NileContentEditor } from './nile-content-editor';\nexport { NileDialog } from './nile-dialog';\nexport { NileErrorNotification } from './nile-error-notification';\nexport { NileTabGroup } from './nile-tab-group';\nexport { NileTab } from './nile-tab';\nexport { NileTabPanel } from './nile-tab-panel';\nexport { NileCodeEditor } from './nile-code-editor';\nexport { NileToast } from './nile-toast';\nexport { NileBreadcrumb } from './nile-breadcrumb';\nexport { NileBreadcrumbItem } from './nile-breadcrumb-item';\nexport { NileFormGroup } from './nile-form-group';\nexport { NileCard } from './nile-card';\nexport { NilePopover } from './nile-popover';\nexport { NileButtonFilter } from './nile-button-filter';\nexport { NileCircularProgressbar } from './nile-circular-progressbar';\nexport { NileSidebarMenu } from './nile-sidebar-menu';\nexport { NileSidebarMenuItems } from './nile-sidebar-menu-items';\nexport { NileSidebarWrapper } from './nile-sidebar-wrapper';\nexport { NileTableCellItem } from './nile-table-cell-item';\nexport { NileTableRow } from './nile-table-row';\nexport { NileTableBody } from './nile-table-body';\nexport { NileTableHeaderItem } from './nile-table-header-item';\nexport { NileAvatar } from './nile-avatar';\nexport { NilePageHeader } from './nile-page-header';\nexport { NileEmptyState } from './nile-empty-state';\nexport { NileHero } from './nile-hero';\nexport { NileStepperItem } from './nile-stepper-item';\nexport { NileStepper } from './nile-stepper';\nexport { NileHeroHeader } from './nile-hero-header';\nexport { NileVerticalStepperItem } from './nile-vertical-stepper-item';\nexport { NileFormatDate } from './nile-format-date';\nexport { NileSplitPanel } from './nile-split-panel';\nexport { NileTree } from './nile-tree';\nexport { NileTreeItem } from './nile-tree-item';\nexport { NileListItem } from './nile-list-item';\nexport { NileList } from './nile-list';\nexport { NileDetail } from './nile-detail';\nexport { NileDivider } from './nile-divider';\nexport { NileTitle } from './nile-title';\n\nexport { NileToolbar } from './nile-toolbar';"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-code-editor.css.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
1
|
+
{"version":3,"file":"nile-code-editor.css.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * CodeEditor CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .code-mirror {\n display: flex;\n justify-content: flex-end;\n flex-direction: row-reverse;\n padding: 5px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n .code-mirror__singleline .cm-scroller{\n scrollbar-width:none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .noborder {\n border: none;\n }\n .cm-editor {\n flex: 1;\n min-width: 0;\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .code-editor__icon__container {\n display: none;\n }\n .code-mirror:hover > .code-editor__icon__container {\n cursor: pointer;\n display: flex;\n align-self: start;\n padding: 5px 5px 0px 0px;\n }\n`;\n\nexport default [styles];\n"]}
|
@@ -6,7 +6,6 @@
|
|
6
6
|
*/
|
7
7
|
import { CSSResultArray, TemplateResult } from 'lit-element';
|
8
8
|
import { EditorView } from 'codemirror';
|
9
|
-
import { Compartment } from '@codemirror/state';
|
10
9
|
import NileElement from '../internal/nile-element';
|
11
10
|
import { PropertyValues } from 'lit';
|
12
11
|
/**
|
@@ -17,14 +16,14 @@ import { PropertyValues } from 'lit';
|
|
17
16
|
*/
|
18
17
|
export declare class NileCodeEditor extends NileElement {
|
19
18
|
codeEditor: HTMLInputElement;
|
20
|
-
multiline: boolean;
|
21
19
|
value: string;
|
22
20
|
customAutoCompletions: any;
|
23
|
-
|
21
|
+
language: 'javascript' | 'sql';
|
24
22
|
errorMessage: string;
|
25
23
|
error: boolean;
|
26
24
|
noborder: boolean;
|
27
|
-
|
25
|
+
multiline: boolean;
|
26
|
+
expandable: boolean;
|
28
27
|
readonly: boolean;
|
29
28
|
/**
|
30
29
|
* The styles for CodeEditor
|
@@ -35,9 +34,9 @@ export declare class NileCodeEditor extends NileElement {
|
|
35
34
|
disconnectedCallback(): void;
|
36
35
|
view: EditorView;
|
37
36
|
convertToSingleLine(code: any): any;
|
38
|
-
lineNumbersComp
|
39
|
-
restrictSingleLineComp
|
40
|
-
readOnlyComp
|
37
|
+
private lineNumbersComp;
|
38
|
+
private restrictSingleLineComp;
|
39
|
+
private readOnlyComp;
|
41
40
|
getLineNumbersExension(): import("@codemirror/state").Extension;
|
42
41
|
getReadOnlyExtension(): import("@codemirror/state").Extension;
|
43
42
|
getSingleLineExtension(): import("@codemirror/state").Extension;
|
@@ -12,6 +12,7 @@ import { EditorView } from 'codemirror';
|
|
12
12
|
import { EditorState, Compartment } from '@codemirror/state';
|
13
13
|
import { lineNumbers } from '@codemirror/view';
|
14
14
|
import { javascript, javascriptLanguage, scopeCompletionSource, } from '@codemirror/lang-javascript';
|
15
|
+
import { sql } from '@codemirror/lang-sql';
|
15
16
|
import { autocompletion } from '@codemirror/autocomplete';
|
16
17
|
import NileElement from '../internal/nile-element';
|
17
18
|
import { basicSetup } from './extensionSetup';
|
@@ -27,13 +28,13 @@ import { Theme } from './theme';
|
|
27
28
|
let NileCodeEditor = class NileCodeEditor extends NileElement {
|
28
29
|
constructor() {
|
29
30
|
super(...arguments);
|
30
|
-
this.multiline = false;
|
31
31
|
this.value = '';
|
32
32
|
this.customAutoCompletions = {};
|
33
|
-
this.
|
33
|
+
this.language = 'javascript';
|
34
34
|
this.errorMessage = '';
|
35
35
|
this.error = false;
|
36
36
|
this.noborder = false;
|
37
|
+
this.multiline = false;
|
37
38
|
this.expandable = false;
|
38
39
|
this.readonly = false;
|
39
40
|
this.lineNumbersComp = new Compartment();
|
@@ -58,6 +59,8 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
58
59
|
this.emit('nile-destroy');
|
59
60
|
}
|
60
61
|
convertToSingleLine(code) {
|
62
|
+
if (!code)
|
63
|
+
return '';
|
61
64
|
// Remove line breaks and unnecessary whitespace
|
62
65
|
return code.replace(/\s+/g, ' ').trim();
|
63
66
|
}
|
@@ -77,6 +80,7 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
77
80
|
const customAutoCompletions = javascriptLanguage.data.of({
|
78
81
|
autocomplete: scopeCompletionSource(this.customAutoCompletions),
|
79
82
|
});
|
83
|
+
const language = this.language == "sql" ? sql() : javascript();
|
80
84
|
let startState = EditorState.create({
|
81
85
|
doc: !this.multiline
|
82
86
|
? this.convertToSingleLine(this.value)
|
@@ -91,7 +95,7 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
91
95
|
restrictSingleLineExtension,
|
92
96
|
customAutoCompletions,
|
93
97
|
autocompletion(),
|
94
|
-
|
98
|
+
language,
|
95
99
|
EditorView.theme(Theme),
|
96
100
|
EditorView.updateListener.of((v) => {
|
97
101
|
if (v.docChanged) {
|
@@ -122,7 +126,7 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
122
126
|
}
|
123
127
|
updated(changedProperties) {
|
124
128
|
super.updated(changedProperties);
|
125
|
-
if (changedProperties.has('value')
|
129
|
+
if (changedProperties.has('value')) {
|
126
130
|
// Editor has already been initialized, update its state
|
127
131
|
this.singleLineMultiLineToggle();
|
128
132
|
}
|
@@ -178,9 +182,6 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
178
182
|
__decorate([
|
179
183
|
query('.code-mirror')
|
180
184
|
], NileCodeEditor.prototype, "codeEditor", void 0);
|
181
|
-
__decorate([
|
182
|
-
property({ type: Boolean, reflect: true })
|
183
|
-
], NileCodeEditor.prototype, "multiline", void 0);
|
184
185
|
__decorate([
|
185
186
|
property({ type: String })
|
186
187
|
], NileCodeEditor.prototype, "value", void 0);
|
@@ -188,8 +189,8 @@ __decorate([
|
|
188
189
|
property({ type: String })
|
189
190
|
], NileCodeEditor.prototype, "customAutoCompletions", void 0);
|
190
191
|
__decorate([
|
191
|
-
property({ type:
|
192
|
-
], NileCodeEditor.prototype, "
|
192
|
+
property({ type: String })
|
193
|
+
], NileCodeEditor.prototype, "language", void 0);
|
193
194
|
__decorate([
|
194
195
|
property({ attribute: 'error-message' })
|
195
196
|
], NileCodeEditor.prototype, "errorMessage", void 0);
|
@@ -199,6 +200,9 @@ __decorate([
|
|
199
200
|
__decorate([
|
200
201
|
property({ attribute: 'noborder', type: Boolean })
|
201
202
|
], NileCodeEditor.prototype, "noborder", void 0);
|
203
|
+
__decorate([
|
204
|
+
property({ type: Boolean, reflect: true })
|
205
|
+
], NileCodeEditor.prototype, "multiline", void 0);
|
202
206
|
__decorate([
|
203
207
|
property({ type: Boolean })
|
204
208
|
], NileCodeEditor.prototype, "expandable", void 0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-code-editor.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAIT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,qBAAqB,GAEtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CA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quera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n PropertyValueMap,\n} from 'lit-element';\nimport { customElement, query } from 'lit/decorators.js';\nimport { styles } from './nile-code-editor.css';\nimport { EditorView } from 'codemirror';\nimport { ViewUpdate } from '@codemirror/view';\nimport { EditorState, Compartment } from '@codemirror/state';\nimport {lineNumbers} from '@codemirror/view';\nimport {\n javascript,\n javascriptLanguage,\n scopeCompletionSource,\n completionPath,\n} from '@codemirror/lang-javascript';\nimport { autocompletion } from '@codemirror/autocomplete';\nimport { CompletionContext, Completion } from '@codemirror/autocomplete';\nimport NileElement from '../internal/nile-element';\nimport { basicSetup } from './extensionSetup';\nimport { watch } from '../internal/watch';\nimport { PropertyValues } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { Theme } from './theme';\n\n// Choose the appropriate mode for your use case\n\n/**\n * Nile icon component.\n *\n * @tag nile-code-editor\n *\n */\n@customElement('nile-code-editor')\nexport class NileCodeEditor extends NileElement {\n @query('.code-mirror') codeEditor: HTMLInputElement;\n @property({ type: Boolean, reflect: true }) multiline = false;\n @property({ type: String }) value = '';\n @property({ type: String }) customAutoCompletions: any = {};\n @property({ type: Boolean }) updateValue: any = false;\n @property({ attribute: 'error-message' }) errorMessage = '';\n @property({ attribute: 'error', type: Boolean }) error = false;\n @property({ attribute: 'noborder', type:Boolean }) noborder = false;\n\n @property({ type: Boolean }) expandable: any = false;\n @property({ type: Boolean, reflect:true }) readonly: boolean = false;\n\n /**\n * The styles for CodeEditor\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.view.destroy()\n this.emit('nile-destroy');\n }\n\n public view: EditorView;\n\n convertToSingleLine(code: any) {\n // Remove line breaks and unnecessary whitespace\n return code.replace(/\\s+/g, ' ').trim();\n }\n lineNumbersComp = new Compartment();\n restrictSingleLineComp = new Compartment();\n readOnlyComp = new Compartment();\n\n getLineNumbersExension() {\n return this.multiline ? lineNumbers() : [];\n }\n\n getReadOnlyExtension() {\n return EditorState.readOnly.of(this.readonly);\n }\n\n getSingleLineExtension(){\n return !this.multiline ? EditorState.transactionFilter.of(tr =>\n tr.newDoc.lines > 1 ? [] : tr\n ) : [];\n }\n\n firstUpdated() {\n const lineNumbersExtension = this.lineNumbersComp.of(this.getLineNumbersExension());\n const readOnlyExtension = this.readOnlyComp.of(this.getReadOnlyExtension());\n const restrictSingleLineExtension = this.restrictSingleLineComp.of(this.getSingleLineExtension())\n const customAutoCompletions = javascriptLanguage.data.of({\n autocomplete: scopeCompletionSource(this.customAutoCompletions),\n });\n let startState = EditorState.create({\n doc: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n extensions: [\n basicSetup({\n highlightActiveLine: false,\n foldGutter: !!this.multiline,\n }),\n lineNumbersExtension,\n readOnlyExtension,\n restrictSingleLineExtension,\n customAutoCompletions,\n autocompletion(),\n javascript(),\n EditorView.theme(Theme),\n EditorView.updateListener.of((v: ViewUpdate) => {\n if (v.docChanged) {\n this.emit('nile-change', { value: this.view.state.doc.toString() })\n }\n }),\n EditorView.domEventHandlers({\n focus: () => this.dispatchEvent(new Event('nile-focus')),\n blur: () => this.dispatchEvent(new Event('nile-blur')),\n }),\n ],\n });\n\n this.view = new EditorView({\n state: startState,\n parent: this.codeEditor,\n });\n }\n\n singleLineMultiLineToggle() {\n this.view.dispatch({\n changes: {\n from: 0,\n to: this.view.state.doc.length,\n insert: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n },\n });\n }\n \n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n if (changedProperties.has('value') && this.updateValue) {\n // Editor has already been initialized, update its state\n this.singleLineMultiLineToggle();\n }\n if (changedProperties.has('multiline')) {\n this.view.dispatch({\n effects: [this.lineNumbersComp.reconfigure(this.getLineNumbersExension()),\n this.restrictSingleLineComp.reconfigure(this.getSingleLineExtension())],\n })\n this.singleLineMultiLineToggle();\n }\n if (changedProperties.has('readonly')) {\n this.view.dispatch({ effects: this.readOnlyComp.reconfigure(this.getReadOnlyExtension()) }) \n }\n }\n\n expandCodeEditor() {\n this.emit('nile-expand', { expand: true });\n }\n\n restrictSingleLine() {\n return EditorState.transactionFilter.of(tr =>\n tr.newDoc.lines > 1 ? [] : tr\n );\n }\n public render(): TemplateResult {\n const hasErrorMessage = !!this.errorMessage;\n const hasError = !!this.error;\n const noborder = !!this.noborder;\n return html`<div\n part=\"code-editor-base\"\n class=${classMap({\n 'code-mirror': true,\n noborder: noborder,\n error: hasError || hasErrorMessage,\n 'code-mirror__singleline': !this.multiline,\n })}\n >\n ${this.expandable\n ? html` <nile-icon\n name=\"expand-2\"\n class=\"code-editor__icon__container\"\n size=\"16\"\n color=\"black\"\n @click=\"${(e: CustomEvent) => this.expandCodeEditor()}\"\n ></nile-icon>`\n : ''}\n </div>\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}`;\n }\n\n /* #endregion */\n}\n\nexport default NileCodeEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-code-editor': NileCodeEditor;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"nile-code-editor.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAIT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,W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SAAS,EAAE,eAAe,EAAE,CAAC;oDAA2B;AAEnB;IAAhD,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAwB;AAEpB;IAAnD,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAA2B;AAElC;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAA4B;AAE1C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAA6B;AAEb;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAA2B;AApB3D,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAoL1B;SApLY,cAAc;AAsL3B,eAAe,cAAc,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n PropertyValueMap,\n} from 'lit-element';\nimport { customElement, query } from 'lit/decorators.js';\nimport { styles } from './nile-code-editor.css';\nimport { EditorView } from 'codemirror';\nimport { ViewUpdate } from '@codemirror/view';\nimport { EditorState, Compartment } from '@codemirror/state';\nimport { lineNumbers } from '@codemirror/view';\nimport {\n javascript,\n javascriptLanguage,\n scopeCompletionSource,\n completionPath,\n} from '@codemirror/lang-javascript';\nimport { sql } from '@codemirror/lang-sql';\nimport { autocompletion } from '@codemirror/autocomplete';\nimport { CompletionContext, Completion } from '@codemirror/autocomplete';\nimport NileElement from '../internal/nile-element';\nimport { basicSetup } from './extensionSetup';\nimport { watch } from '../internal/watch';\nimport { PropertyValues } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { Theme } from './theme';\n\n// Choose the appropriate mode for your use case\n\n/**\n * Nile icon component.\n *\n * @tag nile-code-editor\n *\n */\n@customElement('nile-code-editor')\nexport class NileCodeEditor extends NileElement {\n \n @query('.code-mirror') codeEditor: HTMLInputElement;\n\n @property({ type: String }) value = '';\n\n @property({ type: String }) customAutoCompletions: any = {};\n\n @property({ type: String }) language: 'javascript' | 'sql' = 'javascript'\n\n @property({ attribute: 'error-message' }) errorMessage: string = '';\n\n @property({ attribute: 'error', type: Boolean }) error: boolean = false;\n\n @property({ attribute: 'noborder', type: Boolean }) noborder: boolean = false;\n\n @property({ type: Boolean, reflect: true }) multiline: boolean = false;\n\n @property({ type: Boolean }) expandable: boolean = false;\n\n @property({ type: Boolean, reflect: true }) readonly: boolean = false;\n\n /**\n * The styles for CodeEditor\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.view.destroy()\n this.emit('nile-destroy');\n }\n\n public view: EditorView;\n\n convertToSingleLine(code: any) {\n if (!code) return '';\n // Remove line breaks and unnecessary whitespace\n return code.replace(/\\s+/g, ' ').trim();\n }\n private lineNumbersComp = new Compartment();\n private restrictSingleLineComp = new Compartment();\n private readOnlyComp = new Compartment();\n\n getLineNumbersExension() {\n return this.multiline ? lineNumbers() : [];\n }\n\n getReadOnlyExtension() {\n return EditorState.readOnly.of(this.readonly);\n }\n\n getSingleLineExtension() {\n return !this.multiline ? EditorState.transactionFilter.of(tr =>\n tr.newDoc.lines > 1 ? [] : tr\n ) : [];\n }\n\n firstUpdated() {\n const lineNumbersExtension = this.lineNumbersComp.of(this.getLineNumbersExension());\n const readOnlyExtension = this.readOnlyComp.of(this.getReadOnlyExtension());\n const restrictSingleLineExtension = this.restrictSingleLineComp.of(this.getSingleLineExtension())\n const customAutoCompletions = javascriptLanguage.data.of({\n autocomplete: scopeCompletionSource(this.customAutoCompletions),\n });\n const language = this.language == \"sql\" ? sql() : javascript()\n let startState = EditorState.create({\n doc: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n extensions: [\n basicSetup({\n highlightActiveLine: false,\n foldGutter: !!this.multiline,\n }),\n lineNumbersExtension,\n readOnlyExtension,\n restrictSingleLineExtension,\n customAutoCompletions,\n autocompletion(),\n language,\n EditorView.theme(Theme),\n EditorView.updateListener.of((v: ViewUpdate) => {\n if (v.docChanged) {\n this.emit('nile-change', { value: this.view.state.doc.toString() })\n }\n }),\n EditorView.domEventHandlers({\n focus: () => this.dispatchEvent(new Event('nile-focus')),\n blur: () => this.dispatchEvent(new Event('nile-blur')),\n }),\n ],\n });\n\n this.view = new EditorView({\n state: startState,\n parent: this.codeEditor,\n });\n }\n\n singleLineMultiLineToggle() {\n this.view.dispatch({\n changes: {\n from: 0,\n to: this.view.state.doc.length,\n insert: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n },\n });\n }\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n if (changedProperties.has('value')) {\n // Editor has already been initialized, update its state\n this.singleLineMultiLineToggle();\n }\n if (changedProperties.has('multiline')) {\n this.view.dispatch({\n effects: [this.lineNumbersComp.reconfigure(this.getLineNumbersExension()),\n this.restrictSingleLineComp.reconfigure(this.getSingleLineExtension())],\n })\n this.singleLineMultiLineToggle();\n }\n if (changedProperties.has('readonly')) {\n this.view.dispatch({ effects: this.readOnlyComp.reconfigure(this.getReadOnlyExtension()) })\n }\n }\n\n expandCodeEditor() {\n this.emit('nile-expand', { expand: true });\n }\n\n restrictSingleLine() {\n return EditorState.transactionFilter.of(tr =>\n tr.newDoc.lines > 1 ? [] : tr\n );\n }\n public render(): TemplateResult {\n const hasErrorMessage = !!this.errorMessage;\n const hasError = !!this.error;\n const noborder = !!this.noborder;\n return html`<div\n part=\"code-editor-base\"\n class=${classMap({\n 'code-mirror': true,\n noborder: noborder,\n error: hasError || hasErrorMessage,\n 'code-mirror__singleline': !this.multiline,\n })}\n >\n ${this.expandable\n ? html` <nile-icon\n name=\"expand-2\"\n class=\"code-editor__icon__container\"\n size=\"16\"\n color=\"black\"\n @click=\"${(e: CustomEvent) => this.expandCodeEditor()}\"\n ></nile-icon>`\n : ''}\n </div>\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}`;\n }\n\n /* #endregion */\n}\n\nexport default NileCodeEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-code-editor': NileCodeEditor;\n }\n}\n"]}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
export const Theme = {
|
2
2
|
'&': {
|
3
|
-
width: "100%",
|
4
3
|
fontSize: '14px',
|
5
4
|
fontFamily: 'Colfax-regular',
|
6
5
|
fontWeight: '400',
|
7
6
|
},
|
8
7
|
'.cm-content': {},
|
9
|
-
".cm-scroller": {
|
8
|
+
".cm-scroller": {
|
9
|
+
scrollbarWidth: 'thin',
|
10
|
+
},
|
10
11
|
};
|
11
12
|
//# sourceMappingURL=theme.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/nile-code-editor/theme.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,GAAG,EAAE;QACH,
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../src/nile-code-editor/theme.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,GAAG,EAAE;QACH,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,KAAK;KAClB;IACD,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE;QACd,cAAc,EAAC,MAAM;KACtB;CACF,CAAC","sourcesContent":["export const Theme = {\n '&': {\n fontSize: '14px',\n fontFamily: 'Colfax-regular',\n fontWeight: '400',\n },\n '.cm-content': {},\n \".cm-scroller\": {\n scrollbarWidth:'thin',\n },\n};"]}
|
@@ -20,7 +20,7 @@ export const styles = css `
|
|
20
20
|
|
21
21
|
.horizontal {
|
22
22
|
height: 2px;
|
23
|
-
width: 100%;
|
23
|
+
/* width: 100%; */
|
24
24
|
margin: 8px 0;
|
25
25
|
}
|
26
26
|
|
@@ -32,7 +32,7 @@ export const styles = css `
|
|
32
32
|
vertical-align: middle;
|
33
33
|
}
|
34
34
|
|
35
|
-
.inset {
|
35
|
+
.inset.horizontal {
|
36
36
|
margin-left: 72px;
|
37
37
|
}
|
38
38
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-divider.css.js","sourceRoot":"","sources":["../../../src/nile-divider/nile-divider.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * Divider CSS\n */\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t\theight: 100%;\n\t}\n\n\t.divider {\n\t\tbackground-color: var(--nile-colors-gray-light-mode-200, #eaecf0);;\n\t}\n\t\n\t.horizontal {\n\t\theight: 2px;\n\t\
|
1
|
+
{"version":3,"file":"nile-divider.css.js","sourceRoot":"","sources":["../../../src/nile-divider/nile-divider.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * Divider CSS\n */\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t\theight: 100%;\n\t}\n\n\t.divider {\n\t\tbackground-color: var(--nile-colors-gray-light-mode-200, #eaecf0);;\n\t}\n\t\n\t.horizontal {\n\t\theight: 2px;\n\t\t/* width: 100%; */\n\t\tmargin: 8px 0;\n\t}\n\n\t.vertical {\n\t\theight: 100%;\n\t\twidth: 2px;\n\t\tmargin: 0 8px;\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t}\n\n\t.inset.horizontal {\n\t\tmargin-left: 72px;\n\t}\n`;\n\nexport default [styles];"]}
|
@@ -1,31 +1 @@
|
|
1
|
-
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { LitElement, CSSResultArray, TemplateResult } from 'lit-element';
|
8
|
-
/**
|
9
|
-
* Nile icon component.
|
10
|
-
*
|
11
|
-
* @tag nile-toolbar
|
12
|
-
*
|
13
|
-
*/
|
14
|
-
export declare class NileToolbar extends LitElement {
|
15
|
-
/**
|
16
|
-
* The styles for Toolbar
|
17
|
-
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
18
|
-
*/
|
19
|
-
static get styles(): CSSResultArray;
|
20
|
-
/**
|
21
|
-
* Render method
|
22
|
-
* @slot This is a slot test
|
23
|
-
*/
|
24
|
-
render(): TemplateResult;
|
25
|
-
}
|
26
|
-
export default NileToolbar;
|
27
|
-
declare global {
|
28
|
-
interface HTMLElementTagNameMap {
|
29
|
-
'nile-toolbar': NileToolbar;
|
30
|
-
}
|
31
|
-
}
|
1
|
+
export { NileToolbar } from './nile-toolbar';
|
@@ -1,42 +1,2 @@
|
|
1
|
-
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { __decorate } from "tslib";
|
8
|
-
import { LitElement, html } from 'lit-element';
|
9
|
-
import { customElement } from 'lit/decorators.js';
|
10
|
-
import { styles } from './nile-toolbar.css';
|
11
|
-
/**
|
12
|
-
* Nile icon component.
|
13
|
-
*
|
14
|
-
* @tag nile-toolbar
|
15
|
-
*
|
16
|
-
*/
|
17
|
-
let NileToolbar = class NileToolbar extends LitElement {
|
18
|
-
/**
|
19
|
-
* The styles for Toolbar
|
20
|
-
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
21
|
-
*/
|
22
|
-
static get styles() {
|
23
|
-
return [styles];
|
24
|
-
}
|
25
|
-
/* #endregion */
|
26
|
-
/* #region Methods */
|
27
|
-
/**
|
28
|
-
* Render method
|
29
|
-
* @slot This is a slot test
|
30
|
-
*/
|
31
|
-
render() {
|
32
|
-
return html `
|
33
|
-
<slot> </slot>
|
34
|
-
`;
|
35
|
-
}
|
36
|
-
};
|
37
|
-
NileToolbar = __decorate([
|
38
|
-
customElement('nile-toolbar')
|
39
|
-
], NileToolbar);
|
40
|
-
export { NileToolbar };
|
41
|
-
export default NileToolbar;
|
1
|
+
export { NileToolbar } from './nile-toolbar';
|
42
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-toolbar/index.ts"],"names":[],"mappings":"AAAA
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { NileToolbar } from './nile-toolbar';"]}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
7
|
/**
|
8
8
|
* Toolbar CSS
|
9
9
|
*/
|