@aquera/nile-elements 1.9.5 → 1.9.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/README.md +6 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +470 -298
- package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.css.esm.js +8 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-hero/nile-hero.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.esm.js +14 -14
- package/dist/nile-hero/nile-hero.esm.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.cjs.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.cjs.js.map +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.cjs.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.cjs.js.map +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.esm.js +11 -11
- package/dist/nile-hero-header/nile-hero-header.esm.js +3 -3
- package/dist/nile-rich-text-editor/index.cjs.js +1 -1
- package/dist/nile-rich-text-editor/index.esm.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +70 -0
- package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
- package/dist/nile-rich-text-editor/nile-rte-image.cjs.js +3 -0
- package/dist/nile-rich-text-editor/nile-rte-image.cjs.js.map +1 -0
- package/dist/nile-rich-text-editor/nile-rte-image.esm.js +96 -0
- package/dist/src/nile-chip/nile-chip.css.js +8 -1
- package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.js +3 -3
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.css.js +12 -12
- package/dist/src/nile-hero/nile-hero.css.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.js +1 -1
- package/dist/src/nile-hero/nile-hero.js.map +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.css.js +9 -9
- package/dist/src/nile-hero-header/nile-hero-header.css.js.map +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.js +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +70 -0
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +3 -0
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +81 -3
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rte-image.d.ts +87 -0
- package/dist/src/nile-rich-text-editor/nile-rte-image.js +1073 -0
- package/dist/src/nile-rich-text-editor/nile-rte-image.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-chip/nile-chip.css.ts +8 -1
- package/src/nile-code-editor/nile-code-editor.ts +3 -3
- package/src/nile-hero/nile-hero.css.ts +12 -12
- package/src/nile-hero/nile-hero.ts +1 -1
- package/src/nile-hero-header/nile-hero-header.css.ts +9 -9
- package/src/nile-hero-header/nile-hero-header.ts +1 -1
- package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +70 -0
- package/src/nile-rich-text-editor/nile-rich-text-editor.ts +89 -3
- package/src/nile-rich-text-editor/nile-rte-image.ts +1132 -0
- package/vscode-html-custom-data.json +41 -1
|
@@ -5,12 +5,12 @@ import{__decorate as O}from"tslib";import{html as e}from"lit";import{query as t,
|
|
|
5
5
|
>
|
|
6
6
|
${this.expandable&&!this.disabled?e`
|
|
7
7
|
<div @click="${O=>this.emit("nile-expand")}" class="expand__icon__container">
|
|
8
|
-
<nile-
|
|
8
|
+
<nile-glyph
|
|
9
9
|
name="${this.expandIcon}"
|
|
10
|
-
method="var(--nile-svg-method-fill, var(--ng-svg-method-
|
|
10
|
+
method="var(--nile-svg-method-fill, var(--ng-svg-method-fill))"
|
|
11
11
|
size="16"
|
|
12
12
|
color="black"
|
|
13
|
-
></nile-
|
|
13
|
+
></nile-glyph>
|
|
14
14
|
</div>`:""}
|
|
15
15
|
</div>
|
|
16
16
|
${O?e`
|
|
@@ -1,2 +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","lit","lit/decorators.js","./nile-hero.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var e,i,t,s,r,o,n,_templateObject,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileHeroCssCjsJs){r=_nileHeroCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",a=/*#__PURE__*/function(_o){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.icon="var(--nile-icon-action, var(--ng-icon-action))",_this.collapse=!1,_this.imgSrc="",_this.heroText="";return _this;}_inherits(a,_o);return _createClass(a,[{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t<div part=\"nile__hero__container\" class=",">\n\t\t\t<nile-hero-header part=\"nile__hero__header\" class='hero__header--collapsed' style=\"opacity:","\" hero-text=\"","\" icon=\"","\"></nile-hero-header>\n\t\t\t<div class=\"hero__slot__container\" style=\"opacity:","\">\n\t\t\t <div class=\"hero__slot\">\n\t\t\t \t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon size=\"16\" method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-
|
|
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","lit","lit/decorators.js","./nile-hero.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var e,i,t,s,r,o,n,_templateObject,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileHeroCssCjsJs){r=_nileHeroCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",a=/*#__PURE__*/function(_o){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.icon="var(--nile-icon-action, var(--ng-icon-action))",_this.collapse=!1,_this.imgSrc="",_this.heroText="";return _this;}_inherits(a,_o);return _createClass(a,[{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t<div part=\"nile__hero__container\" class=",">\n\t\t\t<nile-hero-header part=\"nile__hero__header\" class='hero__header--collapsed' style=\"opacity:","\" hero-text=\"","\" icon=\"","\"></nile-hero-header>\n\t\t\t<div class=\"hero__slot__container\" style=\"opacity:","\">\n\t\t\t <div class=\"hero__slot\">\n\t\t\t \t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon size=\"16\" method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-fill))\" name=\"","\"></nile-icon>\n\t\t\t\t</span>\n\t\t\t\t<slot></slot>\n\t\t\t </div>\n\t\t\t</div>\n\t\t\t<div class=\"hero__img__container\" style=\"opacity:","\" id=\"hero__img__container\">\n\t\t\t\t<img src=\"","\" class=\"hero__img\">\n\t\t\t</div>\n\t\t</div>\n\t\t"])),n({hero__container:!0,"hero__container--collapsed":this.collapse,"hero__container--expanded":!this.collapse}),this.collapse?1:0,this.heroText,this.icon,this.collapse?0:1,this.icon,this.collapse?0:1,this.imgSrc);}}],[{key:"styles",get:function get(){return[r];}}]);}(o));e([t({reflect:!0})],a.prototype,"icon",void 0),e([t({reflect:!0,type:Boolean})],a.prototype,"collapse",void 0),e([t({reflect:!0,attribute:"img-src"})],a.prototype,"imgSrc",void 0),e([t({reflect:!0,attribute:"hero-text"})],a.prototype,"heroText",void 0),_export("N",a=e([s("nile-hero")],a));}};});
|
|
2
2
|
//# sourceMappingURL=nile-hero.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-hero.cjs.js","sources":["../../../src/nile-hero/nile-hero.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, CSSResultArray, TemplateResult,nothing} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport {styles} from './nile-hero.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile hero component.\n *\n * @tag nile-hero\n *\n */\n@customElement('nile-hero')\nexport class NileHero extends NileElement {\n\t@property({ reflect: true }) icon: string = 'var(--nile-icon-action, var(--ng-icon-action))';\n\t@property({ reflect: true, type: Boolean }) collapse: boolean = false;\n\n\t@property({ reflect: true, attribute: 'img-src' }) imgSrc: string = '';\n\t@property({ reflect: true, attribute: 'hero-text' }) heroText: string = '';\n\n\t/**\n\t * The styles for nile-hero\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\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 part=\"nile__hero__container\" class=${classMap({\n\t\t\t\"hero__container\":true,\n\t\t\t\"hero__container--collapsed\":this.collapse,\n\t\t\t\"hero__container--expanded\":!this.collapse\n\t\t})}>\n\t\t\t<nile-hero-header part=\"nile__hero__header\" class='hero__header--collapsed' style=\"opacity:${this.collapse?1:0}\" hero-text=\"${this.heroText}\" icon=\"${this.icon}\"></nile-hero-header>\n\t\t\t<div class=\"hero__slot__container\" style=\"opacity:${this.collapse?0:1}\">\n\t\t\t <div class=\"hero__slot\">\n\t\t\t \t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon size=\"16\" method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-
|
|
1
|
+
{"version":3,"file":"nile-hero.cjs.js","sources":["../../../src/nile-hero/nile-hero.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, CSSResultArray, TemplateResult,nothing} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport {styles} from './nile-hero.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\n\n\n/**\n * Nile hero component.\n *\n * @tag nile-hero\n *\n */\n@customElement('nile-hero')\nexport class NileHero extends NileElement {\n\t@property({ reflect: true }) icon: string = 'var(--nile-icon-action, var(--ng-icon-action))';\n\t@property({ reflect: true, type: Boolean }) collapse: boolean = false;\n\n\t@property({ reflect: true, attribute: 'img-src' }) imgSrc: string = '';\n\t@property({ reflect: true, attribute: 'hero-text' }) heroText: string = '';\n\n\t/**\n\t * The styles for nile-hero\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\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 part=\"nile__hero__container\" class=${classMap({\n\t\t\t\"hero__container\":true,\n\t\t\t\"hero__container--collapsed\":this.collapse,\n\t\t\t\"hero__container--expanded\":!this.collapse\n\t\t})}>\n\t\t\t<nile-hero-header part=\"nile__hero__header\" class='hero__header--collapsed' style=\"opacity:${this.collapse?1:0}\" hero-text=\"${this.heroText}\" icon=\"${this.icon}\"></nile-hero-header>\n\t\t\t<div class=\"hero__slot__container\" style=\"opacity:${this.collapse?0:1}\">\n\t\t\t <div class=\"hero__slot\">\n\t\t\t \t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon size=\"16\" method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-fill))\" name=\"${this.icon}\"></nile-icon>\n\t\t\t\t</span>\n\t\t\t\t<slot></slot>\n\t\t\t </div>\n\t\t\t</div>\n\t\t\t<div class=\"hero__img__container\" style=\"opacity:${this.collapse?0:1}\" id=\"hero__img__container\">\n\t\t\t\t<img src=\"${this.imgSrc}\" class=\"hero__img\">\n\t\t\t</div>\n\t\t</div>\n\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileHero;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-hero': NileHero;\n }\n}"],"names":["NileHero","a","this","icon","collapse","imgSrc","heroText","_this","_inherits","_o","_createClass","key","value","render","html","_templateObject","_taggedTemplateLiteral","classMap","hero__container","__decorate","get","styles","NileElement","property","reflect","prototype","type","Boolean","attribute","_export","customElement"],"mappings":"ihHAqBaA,4BAAN,SAAAC,EAAA,uEACuBC,KAAAA,CAAIC,IAAAA,CAAW,iDACAD,KAAAA,CAAQE,QAAAA,CAAAA,CAAY,EAEbF,KAAAA,CAAMG,MAAAA,CAAW,GACfH,KAAAA,CAAQI,QAAAA,CAAW,EAyCxE,QAAAC,KAAA,EAnCOC,SAAA,CAAAP,CAAA,CAAAQ,EAAA,SAAAC,YAAA,CAAAT,CAAA,GAAAU,GAAA,UAAAC,KAAA,CAWA,SAAAC,MAAAA,CAAAA,CACN,CAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,8tBAC+BC,CAAAA,CAAS,CAClDC,eAAkB,CAAA,CAAA,CAAA,CAClB,6BAA6BhB,IAAKE,CAAAA,QAAAA,CAClC,6BAA6BF,IAAKE,CAAAA,QAAAA,CAAAA,CAAAA,CAE2DF,IAAAA,CAAKE,QAAS,CAAA,CAAA,CAAE,CAAiBF,CAAAA,IAAAA,CAAKI,SAAmBJ,IAAKC,CAAAA,IAAAA,CACvGD,IAAAA,CAAKE,SAAS,CAAE,CAAA,CAAA,CAG6BF,IAAKC,CAAAA,IAAAA,CAKlDD,IAAAA,CAAKE,SAAS,CAAE,CAAA,CAAA,CACvDF,IAAKG,CAAAA,MAAAA,EAInB,CA1C4Bc,KAAAA,GAAAA,UAAAA,GAAAA,CAUtB,SAAAC,IAAA,EACN,MAAO,CAACC,EACR,EASM,MAtBsBC,CAAAA,GACAH,CAAAA,CAAA,CAA5BI,CAAS,CAAA,CAAEC,SAAS,CAAwExB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyB,SAAA,CAAA,MAAA,CAAA,IAAA,EACjDN,CAAAA,CAAAA,CAAAA,CAAA,CAA3CI,CAAS,CAAA,CAAEC,OAAS,CAAA,CAAA,CAAA,CAAME,IAAMC,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAqC3B,EAAAyB,SAAA,CAAA,UAAA,CAAA,IAAA,EAEnBN,CAAAA,CAAAA,CAAAA,CAAA,CAAlDI,CAAAA,CAAS,CAAEC,OAAS,CAAA,CAAA,CAAA,CAAMI,SAAW,CAAA,SAAA,CAAA,CAAA,CAAA,CAAiC5B,CAAAyB,CAAAA,SAAAA,CAAA,aAAA,EAClBN,CAAAA,CAAAA,CAAAA,CAAA,CAApDI,CAAAA,CAAS,CAAEC,OAAAA,CAAAA,CAAS,EAAMI,SAAW,CAAA,WAAA,CAAA,CAAA,CAAA,CAAqC5B,CAAAyB,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAAAI,OAAA,KAL/D7B,EAAQmB,CAAA,CAAA,CADpBW,CAAc,CAAA,WAAA,CAAA,CAAA,CACF9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,r;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",r=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n\t:host {\n\t\tdisplay:block;\n\t\t--nile-hero-transition-time:2000ms;\n\t\t-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n\t}\n\n\t.hero__header--collapsed{\n\t\tposition:absolute;\n\t\ttop:0;\n\t\tleft:0;\n\t\ttransition:var(--nile-hero-transition-time);\n\t}\n\t\n\t.hero__container {\n\t\toverflow:hidden;\n\t\twidth:100%;\n\t\tposition:relative;\n\t\tdisplay:block;\n \t\ttransition: var(--nile-hero-transition-time);\n\t}\n\n\t.hero__container--collapsed{\n\t\theight: 67px;\n\t\tbackground-color: var(--nile-hero-collapsed-background, var(--ng-colors-bg-primary));\n\t}\n\n\t.hero__container--expanded{\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\tbackground:linear-gradient(180deg, var( --nile-hero-color-bg-from-gradient, var(--ng-color-bluelight-50)) 0%, var( --nile-hero-color-bg-to-gradient, var(--ng-componentcolors-utility-gray-200)) 100%);\n\t}\n\n\t.icon__container {\n\t\theight: 32px;\n\t\taspect-ratio: 1 / 1;\n\t\tplace-items: center;\n\t\tdisplay: grid;\n\t\tborder-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));\n\t\tborder: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n\t\tbackground: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient, var(--ng-colors-bg-primary)) 0%, var(--nile-hero-color-icon-bg-to-gradient, var(--ng-colors-bg-secondary)) 100%);\n\t}\n\n\t.hero__slot__container {\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\tpadding-left: var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap:var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tbottom:0;\n \t\ttransition: var(--nile-hero-transition-time);\n\t}\n\n\t.hero__slot {\n\t\tdisplay: flex;\n\t\tgap:var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));\n\t}\n\n\t.hero__img__container {\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\toverflow:hidden;\n\t\twidth:max-content;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tbottom:0;\n\t\ttransition:var(--nile-hero-transition-time);\n\t}\n\n\t.hero__img {\n\t\tobject-fit:cover;\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\twidth:auto;\n\t}\n"]))));}};});
|
|
2
2
|
//# sourceMappingURL=nile-hero.css.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-hero.css.cjs.js","sources":["../../../src/nile-hero/nile-hero.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';\n\n/**\n * Hero CSS\n */\nexport const styles = css`\n\n\t:host {\n\t\tdisplay:block;\n\t\t--nile-hero-transition-time:2000ms;\n\t\t-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n\t}\n\n\t.hero__header--collapsed{\n\t\tposition:absolute;\n\t\ttop:0;\n\t\tleft:0;\n\t\ttransition:var(--nile-hero-transition-time);\n\t}\n\t\n\t.hero__container {\n\t\toverflow:hidden;\n\t\twidth:100%;\n\t\tposition:relative;\n\t\tdisplay:block;\n \t\ttransition: var(--nile-hero-transition-time);\n\t}\n\n\t.hero__container--collapsed{\n\t\theight: 67px;\n\t\tbackground-color: var(--nile-hero-collapsed-background);\n\t}\n\n\t.hero__container--expanded{\n\t\theight:var(--nile-hero-height);\n\t\tbackground:linear-gradient(180deg, var( --nile-hero-color-bg-from-gradient) 0%, var( --nile-hero-color-bg-to-gradient) 100%);\n\t}\n\n\t.icon__container {\n\t\theight: 32px;\n\t\taspect-ratio: 1 / 1;\n\t\tplace-items: center;\n\t\tdisplay: grid;\n\t\tborder-radius: var(--nile-radius-radius-xl);\n\t\tborder: 1px solid var(--nile-colors-neutral-400);\n\t\tbackground: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient) 0%, var(--nile-hero-color-icon-bg-to-gradient) 100%);\n\t}\n\n\t.hero__slot__container {\n\t\theight:var(--nile-hero-height);\n\t\tpadding-left: var(--nile-spacing-5xl);\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap:var(--nile-spacing-spacing-xl);\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tbottom:0;\n \t\ttransition: var(--nile-hero-transition-time);\n\t}\n\n\t.hero__slot {\n\t\tdisplay: flex;\n\t\tgap:var(--nile-spacing-spacing-xl);\n\t}\n\n\t.hero__img__container {\n\t\theight:var(--nile-hero-height);\n\t\toverflow:hidden;\n\t\twidth:max-content;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tbottom:0;\n\t\ttransition:var(--nile-hero-transition-time);\n\t}\n\n\t.hero__img {\n\t\tobject-fit:cover;\n\t\theight:var(--nile-hero-height);\n\t\twidth:auto;\n\t}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
1
|
+
{"version":3,"file":"nile-hero.css.cjs.js","sources":["../../../src/nile-hero/nile-hero.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';\n\n/**\n * Hero CSS\n */\nexport const styles = css`\n\n\t:host {\n\t\tdisplay:block;\n\t\t--nile-hero-transition-time:2000ms;\n\t\t-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n\t}\n\n\t.hero__header--collapsed{\n\t\tposition:absolute;\n\t\ttop:0;\n\t\tleft:0;\n\t\ttransition:var(--nile-hero-transition-time);\n\t}\n\t\n\t.hero__container {\n\t\toverflow:hidden;\n\t\twidth:100%;\n\t\tposition:relative;\n\t\tdisplay:block;\n \t\ttransition: var(--nile-hero-transition-time);\n\t}\n\n\t.hero__container--collapsed{\n\t\theight: 67px;\n\t\tbackground-color: var(--nile-hero-collapsed-background, var(--ng-colors-bg-primary));\n\t}\n\n\t.hero__container--expanded{\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\tbackground:linear-gradient(180deg, var( --nile-hero-color-bg-from-gradient, var(--ng-color-bluelight-50)) 0%, var( --nile-hero-color-bg-to-gradient, var(--ng-componentcolors-utility-gray-200)) 100%);\n\t}\n\n\t.icon__container {\n\t\theight: 32px;\n\t\taspect-ratio: 1 / 1;\n\t\tplace-items: center;\n\t\tdisplay: grid;\n\t\tborder-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));\n\t\tborder: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n\t\tbackground: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient, var(--ng-colors-bg-primary)) 0%, var(--nile-hero-color-icon-bg-to-gradient, var(--ng-colors-bg-secondary)) 100%);\n\t}\n\n\t.hero__slot__container {\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\tpadding-left: var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap:var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tbottom:0;\n \t\ttransition: var(--nile-hero-transition-time);\n\t}\n\n\t.hero__slot {\n\t\tdisplay: flex;\n\t\tgap:var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));\n\t}\n\n\t.hero__img__container {\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\toverflow:hidden;\n\t\twidth:max-content;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\tbottom:0;\n\t\ttransition:var(--nile-hero-transition-time);\n\t}\n\n\t.hero__img {\n\t\tobject-fit:cover;\n\t\theight:var(--nile-hero-height, var(--ng-height-200px));\n\t\twidth:auto;\n\t}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as o}from"lit";const r=o`
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
4
|
display:block;
|
|
@@ -25,12 +25,12 @@ import{css as i}from"lit";const o=i`
|
|
|
25
25
|
|
|
26
26
|
.hero__container--collapsed{
|
|
27
27
|
height: 67px;
|
|
28
|
-
background-color: var(--nile-hero-collapsed-background);
|
|
28
|
+
background-color: var(--nile-hero-collapsed-background, var(--ng-colors-bg-primary));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.hero__container--expanded{
|
|
32
|
-
height:var(--nile-hero-height);
|
|
33
|
-
background:linear-gradient(180deg, var( --nile-hero-color-bg-from-gradient) 0%, var( --nile-hero-color-bg-to-gradient) 100%);
|
|
32
|
+
height:var(--nile-hero-height, var(--ng-height-200px));
|
|
33
|
+
background:linear-gradient(180deg, var( --nile-hero-color-bg-from-gradient, var(--ng-color-bluelight-50)) 0%, var( --nile-hero-color-bg-to-gradient, var(--ng-componentcolors-utility-gray-200)) 100%);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.icon__container {
|
|
@@ -38,17 +38,17 @@ import{css as i}from"lit";const o=i`
|
|
|
38
38
|
aspect-ratio: 1 / 1;
|
|
39
39
|
place-items: center;
|
|
40
40
|
display: grid;
|
|
41
|
-
border-radius: var(--nile-radius-radius-xl);
|
|
42
|
-
border: 1px solid var(--nile-colors-neutral-400);
|
|
43
|
-
background: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient) 0%, var(--nile-hero-color-icon-bg-to-gradient) 100%);
|
|
41
|
+
border-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));
|
|
42
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
43
|
+
background: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient, var(--ng-colors-bg-primary)) 0%, var(--nile-hero-color-icon-bg-to-gradient, var(--ng-colors-bg-secondary)) 100%);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.hero__slot__container {
|
|
47
|
-
height:var(--nile-hero-height);
|
|
48
|
-
padding-left: var(--nile-spacing-5xl);
|
|
47
|
+
height:var(--nile-hero-height, var(--ng-height-200px));
|
|
48
|
+
padding-left: var(--nile-spacing-5xl, var(--ng-spacing-5xl));
|
|
49
49
|
display: flex;
|
|
50
50
|
align-items: center;
|
|
51
|
-
gap:var(--nile-spacing-spacing-xl);
|
|
51
|
+
gap:var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));
|
|
52
52
|
position: absolute;
|
|
53
53
|
left: 0;
|
|
54
54
|
bottom:0;
|
|
@@ -57,11 +57,11 @@ import{css as i}from"lit";const o=i`
|
|
|
57
57
|
|
|
58
58
|
.hero__slot {
|
|
59
59
|
display: flex;
|
|
60
|
-
gap:var(--nile-spacing-spacing-xl);
|
|
60
|
+
gap:var(--nile-spacing-spacing-xl, var(--ng-spacing-xl));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.hero__img__container {
|
|
64
|
-
height:var(--nile-hero-height);
|
|
64
|
+
height:var(--nile-hero-height, var(--ng-height-200px));
|
|
65
65
|
overflow:hidden;
|
|
66
66
|
width:max-content;
|
|
67
67
|
position: absolute;
|
|
@@ -72,7 +72,7 @@ import{css as i}from"lit";const o=i`
|
|
|
72
72
|
|
|
73
73
|
.hero__img {
|
|
74
74
|
object-fit:cover;
|
|
75
|
-
height:var(--nile-hero-height);
|
|
75
|
+
height:var(--nile-hero-height, var(--ng-height-200px));
|
|
76
76
|
width:auto;
|
|
77
77
|
}
|
|
78
|
-
`;export{
|
|
78
|
+
`;export{r as s};
|
|
@@ -4,7 +4,7 @@ import{__decorate as e}from"tslib";import{html as i}from"lit";import{property as
|
|
|
4
4
|
<div class="hero__slot__container" style="opacity:${this.collapse?0:1}">
|
|
5
5
|
<div class="hero__slot">
|
|
6
6
|
<span class="icon__container">
|
|
7
|
-
<nile-icon size="16" method="var(--nile-svg-method-stroke, var(--ng-svg-method-
|
|
7
|
+
<nile-icon size="16" method="var(--nile-svg-method-stroke, var(--ng-svg-method-fill))" name="${this.icon}"></nile-icon>
|
|
8
8
|
</span>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</div>
|
|
@@ -1,2 +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","lit","lit/decorators.js","./nile-hero-header.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var e,t,s,
|
|
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","lit","lit/decorators.js","./nile-hero-header.css.cjs.js","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var e,t,i,s,r,n,_templateObject,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileHeroHeaderCssCjsJs){r=_nileHeroHeaderCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",o=/*#__PURE__*/function(_n){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.icon="var(--nile-icon-action, var(--ng-icon-action))",_this.heroText="Nile Hero";return _this;}_inherits(o,_n);return _createClass(o,[{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\t\t\t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-fill))\" size=\"16\" name=\"","\"></nile-icon>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"hero__text\">","</span>\n\t\t\t"])),this.icon,this.heroText);}}],[{key:"styles",get:function get(){return[r];}}]);}(n));e([i({reflect:!0})],o.prototype,"icon",void 0),e([i({reflect:!0,attribute:"hero-text"})],o.prototype,"heroText",void 0),_export("N",o=e([s("nile-hero-header")],o));}};});
|
|
2
2
|
//# sourceMappingURL=nile-hero-header.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-hero-header.cjs.js","sources":["../../../src/nile-hero-header/nile-hero-header.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, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport {styles} from './nile-hero-header.css';\nimport NileElement from '../internal/nile-element';\n\n\n/**\n * Nile hero-header component.\n *\n * @tag nile-hero-header\n *\n */\n@customElement('nile-hero-header')\nexport class NileHeroHeader extends NileElement {\n\t@property({ reflect: true }) icon: string = 'var(--nile-icon-action, var(--ng-icon-action))';\n\t@property({ reflect: true, attribute: 'hero-text' }) heroText: string = 'Nile Hero';\n\n\t/**\n\t * The styles for nile-hero-header\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\t\t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-
|
|
1
|
+
{"version":3,"file":"nile-hero-header.cjs.js","sources":["../../../src/nile-hero-header/nile-hero-header.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, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport {styles} from './nile-hero-header.css';\nimport NileElement from '../internal/nile-element';\n\n\n/**\n * Nile hero-header component.\n *\n * @tag nile-hero-header\n *\n */\n@customElement('nile-hero-header')\nexport class NileHeroHeader extends NileElement {\n\t@property({ reflect: true }) icon: string = 'var(--nile-icon-action, var(--ng-icon-action))';\n\t@property({ reflect: true, attribute: 'hero-text' }) heroText: string = 'Nile Hero';\n\n\t/**\n\t * The styles for nile-hero-header\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\t\t<span class=\"icon__container\">\n\t\t\t\t\t<nile-icon method=\"var(--nile-svg-method-stroke, var(--ng-svg-method-fill))\" size=\"16\" name=\"${this.icon}\"></nile-icon>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"hero__text\">${this.heroText}</span>\n\t\t\t`;\n\t}\n\n\t/* #endregion */\n}\n\nexport default NileHeroHeader;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-hero-header': NileHeroHeader;\n }\n}"],"names":["NileHeroHeader","o","this","icon","heroText","_this","_inherits","_n","_createClass","key","value","render","html","_templateObject","_taggedTemplateLiteral","__decorate","get","styles","NileElement","property","reflect","prototype","attribute","customElement"],"mappings":"27GAoBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEACuBC,KAAAA,CAAIC,IAAAA,CAAW,gDACSD,CAAAA,KAAAA,CAAQE,SAAW,WA4BxE,QAAAC,KAAA,EAtBOC,SAAA,CAAAL,CAAA,CAAAM,EAAA,SAAAC,YAAA,CAAAP,CAAA,GAAAQ,GAAA,UAAAC,KAAA,CAYA,SAAAC,MAAAA,CAAAA,CAAAA,CACN,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,0PAEuFZ,IAAKC,CAAAA,IAAAA,CAE1ED,IAAKE,CAAAA,QAAAA,EAElC,CA1B4BW,KAAAA,GAAAA,UAAAA,GAAAA,CAOtB,SAAAC,IAAA,CAAWC,CACjB,MAAO,CAACA,CAAAA,CACR,EAUM,MApB4BC,CAA7B,GACuBH,CAAAA,CAAA,CAA5BI,CAAAA,CAAS,CAAEC,OAAAA,CAAAA,CAAS,CAAwEpB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqB,SAAA,CAAA,MAAA,CAAA,IAAA,EACxCN,CAAAA,CAAAA,CAAAA,CAAA,CAApDI,CAAAA,CAAS,CAAEC,OAAAA,CAAAA,CAAS,CAAME,CAAAA,SAAAA,CAAW,WAA8CtB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqB,SAAA,CAAA,UAAA,CAAA,IAAA,EAFxErB,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAce,CAAA,CAAA,CAD1BQ,CAAc,CAAA,kBAAA,CAAA,CAAA,CACFvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",n=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t\n\t:host {\n\t\twidth:100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding:var(--nile-spacing-xl, var(--ng-spacing-xl)) var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n\t\tgap: var(--nile-spacing-xl, var(--ng-spacing-xl));\n\t\tborder-bottom: 1px solid rgb(234, 236, 240);\n\t\t-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n\t}\n\n\t.icon__container {\n\t\theight: 32px;\n\t\taspect-ratio: 1 / 1;\n\t\tplace-items: center;\n\t\tdisplay: grid;\n\t\tborder-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));\n\t\tborder: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n\t\tbackground: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient, var(--ng-colors-bg-primary)) 0%, var(--nile-hero-color-icon-bg-to-gradient, var(--ng-colors-bg-secondary)) 100%);\n\t}\n\n\t.hero__text {\n\t\tcolor: var(--nile-hero-text-color, var(--ng-colors-text-primary-900));\n\t\tfont-size: var(--nile-hero-text-font-size, var(--ng-font-size-text-md));\n\t\tline-height: var(--nile-hero-text-line-height, var(--ng-line-height-text-md));\n\t\tfont-style: normal;\n\t\tfont-weight: var(--nile-hero-text-font-weight, var(--ng-font-weight-bold));\n\t}\n"]))));}};});
|
|
2
2
|
//# sourceMappingURL=nile-hero-header.css.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-hero-header.css.cjs.js","sources":["../../../src/nile-hero-header/nile-hero-header.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';\n\n/**\n * HeroHeader CSS\n */\nexport const styles = css`\n\t\n\t:host {\n\t\twidth:100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding:var(--nile-spacing-xl) var(--nile-spacing-5xl);\n\t\tgap: var(--nile-spacing-xl);\n\t\tborder-bottom: 1px solid rgb(234, 236, 240);\n\t\t-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n\t}\n\n\t.icon__container {\n\t\theight: 32px;\n\t\taspect-ratio: 1 / 1;\n\t\tplace-items: center;\n\t\tdisplay: grid;\n\t\tborder-radius: var(--nile-radius-radius-xl);\n\t\tborder: 1px solid var(--nile-colors-neutral-400);\n\t\tbackground: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient) 0%, var(--nile-hero-color-icon-bg-to-gradient) 100%);\n\t}\n\n\t.hero__text {\n\t\tcolor: var(--nile-hero-text-color);\n\t\tfont-size: var(--nile-hero-text-font-size);\n\t\tline-height: var(--nile-hero-text-line-height);\n\t\tfont-style: normal;\n\t\tfont-weight: var(--nile-hero-text-font-weight);\n\t}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
1
|
+
{"version":3,"file":"nile-hero-header.css.cjs.js","sources":["../../../src/nile-hero-header/nile-hero-header.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';\n\n/**\n * HeroHeader CSS\n */\nexport const styles = css`\n\t\n\t:host {\n\t\twidth:100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding:var(--nile-spacing-xl, var(--ng-spacing-xl)) var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n\t\tgap: var(--nile-spacing-xl, var(--ng-spacing-xl));\n\t\tborder-bottom: 1px solid rgb(234, 236, 240);\n\t\t-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n\t}\n\n\t.icon__container {\n\t\theight: 32px;\n\t\taspect-ratio: 1 / 1;\n\t\tplace-items: center;\n\t\tdisplay: grid;\n\t\tborder-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));\n\t\tborder: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n\t\tbackground: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient, var(--ng-colors-bg-primary)) 0%, var(--nile-hero-color-icon-bg-to-gradient, var(--ng-colors-bg-secondary)) 100%);\n\t}\n\n\t.hero__text {\n\t\tcolor: var(--nile-hero-text-color, var(--ng-colors-text-primary-900));\n\t\tfont-size: var(--nile-hero-text-font-size, var(--ng-font-size-text-md));\n\t\tline-height: var(--nile-hero-text-line-height, var(--ng-line-height-text-md));\n\t\tfont-style: normal;\n\t\tfont-weight: var(--nile-hero-text-font-weight, var(--ng-font-weight-bold));\n\t}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as r}from"lit";const n=r`
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
4
|
width:100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
|
-
padding:var(--nile-spacing-xl) var(--nile-spacing-5xl);
|
|
8
|
-
gap: var(--nile-spacing-xl);
|
|
7
|
+
padding:var(--nile-spacing-xl, var(--ng-spacing-xl)) var(--nile-spacing-5xl, var(--ng-spacing-5xl));
|
|
8
|
+
gap: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
9
9
|
border-bottom: 1px solid rgb(234, 236, 240);
|
|
10
10
|
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
|
|
11
11
|
-moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));
|
|
@@ -17,16 +17,16 @@ import{css as e}from"lit";const o=e`
|
|
|
17
17
|
aspect-ratio: 1 / 1;
|
|
18
18
|
place-items: center;
|
|
19
19
|
display: grid;
|
|
20
|
-
border-radius: var(--nile-radius-radius-xl);
|
|
21
|
-
border: 1px solid var(--nile-colors-neutral-400);
|
|
22
|
-
background: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient) 0%, var(--nile-hero-color-icon-bg-to-gradient) 100%);
|
|
20
|
+
border-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));
|
|
21
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
22
|
+
background: linear-gradient(180deg, var(--nile-hero-color-icon-bg-from-gradient, var(--ng-colors-bg-primary)) 0%, var(--nile-hero-color-icon-bg-to-gradient, var(--ng-colors-bg-secondary)) 100%);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.hero__text {
|
|
26
|
-
color: var(--nile-hero-text-color);
|
|
27
|
-
font-size: var(--nile-hero-text-font-size);
|
|
28
|
-
line-height: var(--nile-hero-text-line-height);
|
|
26
|
+
color: var(--nile-hero-text-color, var(--ng-colors-text-primary-900));
|
|
27
|
+
font-size: var(--nile-hero-text-font-size, var(--ng-font-size-text-md));
|
|
28
|
+
line-height: var(--nile-hero-text-line-height, var(--ng-line-height-text-md));
|
|
29
29
|
font-style: normal;
|
|
30
|
-
font-weight: var(--nile-hero-text-font-weight);
|
|
30
|
+
font-weight: var(--nile-hero-text-font-weight, var(--ng-font-weight-bold));
|
|
31
31
|
}
|
|
32
|
-
`;export{
|
|
32
|
+
`;export{n as s};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as
|
|
1
|
+
import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as i,customElement as s}from"lit/decorators.js";import{s as r}from"./nile-hero-header.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";let o=class extends n{constructor(){super(...arguments),this.icon="var(--nile-icon-action, var(--ng-icon-action))",this.heroText="Nile Hero"}static get styles(){return[r]}render(){return t`
|
|
2
2
|
<span class="icon__container">
|
|
3
|
-
<nile-icon method="var(--nile-svg-method-stroke, var(--ng-svg-method-
|
|
3
|
+
<nile-icon method="var(--nile-svg-method-stroke, var(--ng-svg-method-fill))" size="16" name="${this.icon}"></nile-icon>
|
|
4
4
|
</span>
|
|
5
5
|
<span class="hero__text">${this.heroText}</span>
|
|
6
|
-
`}};e([
|
|
6
|
+
`}};e([i({reflect:!0})],o.prototype,"icon",void 0),e([i({reflect:!0,attribute:"hero-text"})],o.prototype,"heroText",void 0),o=e([s("nile-hero-header")],o);export{o as N};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./nile-rich-text-editor.cjs.js","tslib","lit","lit/decorators.js","./nile-rte-toolbar.cjs.js","./nile-rte-toolbar-item.cjs.js","./nile-rte-select.cjs.js","./nile-rte-color.cjs.js","./nile-rte-divider.cjs.js","./nile-rte-preview.cjs.js","./nile-rte-mentions.cjs.js","./nile-rte-link.cjs.js","./utils/block-utils.cjs.js","./utils/inline-utils.cjs.js","./utils/color-utils.cjs.js","./utils/list-utils.cjs.js","./nile-rich-text-editor.css.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileRichTextEditorCjsJs){_export("NileRichTextEditor",_nileRichTextEditorCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileRteToolbarCjsJs){},function(_nileRteToolbarItemCjsJs){},function(_nileRteSelectCjsJs){},function(_nileRteColorCjsJs){},function(_nileRteDividerCjsJs){},function(_nileRtePreviewCjsJs){},function(_nileRteMentionsCjsJs){},function(_nileRteLinkCjsJs){},function(_utilsBlockUtilsCjsJs){},function(_utilsInlineUtilsCjsJs){},function(_utilsColorUtilsCjsJs){},function(_utilsListUtilsCjsJs){},function(_nileRichTextEditorCssCjsJs){}],execute:function execute(){}};});
|
|
1
|
+
System.register(["./nile-rich-text-editor.cjs.js","tslib","lit","lit/decorators.js","./nile-rte-toolbar.cjs.js","./nile-rte-toolbar-item.cjs.js","./nile-rte-select.cjs.js","./nile-rte-color.cjs.js","./nile-rte-divider.cjs.js","./nile-rte-preview.cjs.js","./nile-rte-mentions.cjs.js","./nile-rte-link.cjs.js","./nile-rte-image.cjs.js","./utils/block-utils.cjs.js","./utils/inline-utils.cjs.js","./utils/color-utils.cjs.js","./utils/list-utils.cjs.js","./nile-rich-text-editor.css.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileRichTextEditorCjsJs){_export("NileRichTextEditor",_nileRichTextEditorCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileRteToolbarCjsJs){},function(_nileRteToolbarItemCjsJs){},function(_nileRteSelectCjsJs){},function(_nileRteColorCjsJs){},function(_nileRteDividerCjsJs){},function(_nileRtePreviewCjsJs){},function(_nileRteMentionsCjsJs){},function(_nileRteLinkCjsJs){},function(_nileRteImageCjsJs){},function(_utilsBlockUtilsCjsJs){},function(_utilsInlineUtilsCjsJs){},function(_utilsColorUtilsCjsJs){},function(_utilsListUtilsCjsJs){},function(_nileRichTextEditorCssCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{N as NileRichTextEditor}from"./nile-rich-text-editor.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-rte-toolbar.esm.js";import"./nile-rte-toolbar-item.esm.js";import"./nile-rte-select.esm.js";import"./nile-rte-color.esm.js";import"./nile-rte-divider.esm.js";import"./nile-rte-preview.esm.js";import"./nile-rte-mentions.esm.js";import"./nile-rte-link.esm.js";import"./utils/block-utils.esm.js";import"./utils/inline-utils.esm.js";import"./utils/color-utils.esm.js";import"./utils/list-utils.esm.js";import"./nile-rich-text-editor.css.esm.js";
|
|
1
|
+
export{N as NileRichTextEditor}from"./nile-rich-text-editor.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-rte-toolbar.esm.js";import"./nile-rte-toolbar-item.esm.js";import"./nile-rte-select.esm.js";import"./nile-rte-color.esm.js";import"./nile-rte-divider.esm.js";import"./nile-rte-preview.esm.js";import"./nile-rte-mentions.esm.js";import"./nile-rte-link.esm.js";import"./nile-rte-image.esm.js";import"./utils/block-utils.esm.js";import"./utils/inline-utils.esm.js";import"./utils/color-utils.esm.js";import"./utils/list-utils.esm.js";import"./nile-rich-text-editor.css.esm.js";
|
|
@@ -1,2 +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","lit","lit/decorators.js","./nile-rte-toolbar.cjs.js","./nile-rte-toolbar-item.cjs.js","./nile-rte-select.cjs.js","./nile-rte-color.cjs.js","./nile-rte-divider.cjs.js","./nile-rte-preview.cjs.js","./nile-rte-mentions.cjs.js","./nile-rte-link.cjs.js","./utils/block-utils.cjs.js","./utils/inline-utils.cjs.js","./utils/color-utils.cjs.js","./utils/list-utils.cjs.js","./nile-rich-text-editor.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,h,r,o,l,c,a,u,d,f,m,p,b,g,y;function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n4){function n(){return _n4.apply(this,arguments);}n.toString=function(){return _n4.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.LitElement;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;e=_litDecoratorsJs.state;n=_litDecoratorsJs.customElement;},function(_nileRteToolbarCjsJs){},function(_nileRteToolbarItemCjsJs){},function(_nileRteSelectCjsJs){},function(_nileRteColorCjsJs){},function(_nileRteDividerCjsJs){},function(_nileRtePreviewCjsJs){},function(_nileRteMentionsCjsJs){},function(_nileRteLinkCjsJs){},function(_utilsBlockUtilsCjsJs){h=_utilsBlockUtilsCjsJs.s;r=_utilsBlockUtilsCjsJs.a;o=_utilsBlockUtilsCjsJs.n;l=_utilsBlockUtilsCjsJs.c;},function(_utilsInlineUtilsCjsJs){c=_utilsInlineUtilsCjsJs.t;a=_utilsInlineUtilsCjsJs.s;u=_utilsInlineUtilsCjsJs.r;},function(_utilsColorUtilsCjsJs){d=_utilsColorUtilsCjsJs.s;f=_utilsColorUtilsCjsJs.a;},function(_utilsListUtilsCjsJs){m=_utilsListUtilsCjsJs.t;},function(_nileRichTextEditorCssCjsJs){p=_nileRichTextEditorCssCjsJs.s;}],execute:function execute(){b={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},g=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];_export("N",y=/*#__PURE__*/function(_i){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.value="",_this.noStyles=!1,_this.disabled=!1,_this.singleLineEditor=!1,_this.placeholder="",_this.mentions={},_this.whitelist=[],_this.content="",_this.previewEl=null,_this.toolbarEl=null,_this.lastRange=null,_this.buttonMap=new Map(),_this.headingSelect=null,_this.fontSelect=null,_this.colorInput=null,_this.bgColorInput=null,_this.colorSwatchEl=null,_this.bgSwatchEl=null,_this.containerEl=null,_this.linkEl=null,_this.mentionsEl=null,_this.onEditorClick=function(t){var _t$target$closest,_t$target;if(_this.disabled)return void t.preventDefault();var i=(_t$target$closest=(_t$target=t.target).closest)===null||_t$target$closest===void 0?void 0:_t$target$closest.call(_t$target,"a");i&&t.preventDefault();},_this.onEditorPaste=function(t){_this.disabled&&t.preventDefault();},_this.onEditorDrop=function(t){_this.disabled&&t.preventDefault();},_this.onEditorInput=function(){_this.disabled||(_this.ensureAtLeastOneParagraph(),_this.scrubBrokenMentions(),_this.updateContent(),_this.updateToolbarState());},_this.onEditorMouseup=function(){_this.saveSelection(),_this.updateToolbarState();},_this.onEditorKeyup=function(t){_this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)&&_this.updateToolbarState();},_this.onEditorKeydown=function(t){if(_this.disabled)return void t.preventDefault();if(_this.singleLineEditor&&"Enter"===t.key&&t.shiftKey)return void t.preventDefault();if(t.ctrlKey&&"i"===t.key.toLowerCase()&&(t.preventDefault(),c(_this.editorEl,"em"),_this.updateContent(),_this.updateToolbarState()),_this.singleLineEditor&&"Enter"===t.key)return void t.preventDefault();if("Tab"!==t.key)return;t.preventDefault(),_this.focusAndRestore();var i=window.getSelection();if(!i||0===i.rangeCount)return;var s=i.getRangeAt(0);if(t.shiftKey){if(s.collapsed&&s.startContainer.nodeType===Node.TEXT_NODE){var _t=s.startContainer,_e=s.startOffset,_n=_t.data.slice(0,_e),_h=_n.replace(/(\t|[ \u00a0]{2})$/,"");if(_h.length!==_n.length){_t.data=_h+_t.data.slice(_e);var _s=document.createRange();_s.setStart(_t,_h.length),_s.collapse(!0),i.removeAllRanges(),i.addRange(_s),_this.updateContent(),_this.updateToolbarState();}}return;}s.deleteContents();var e=document.createTextNode("\t");s.insertNode(e);var n=document.createRange();n.setStartAfter(e),n.collapse(!0),i.removeAllRanges(),i.addRange(n),_this.updateContent(),_this.updateToolbarState();},_this.onSelectionChange=function(){if(!_this.editorEl)return;var t=document.getSelection();if(!t||0===t.rangeCount)return;var i=t.getRangeAt(0);_this.editorEl.contains(i.commonAncestorContainer)&&(_this.lastRange=i.cloneRange(),_this.updateToolbarState());};return _this;}_inherits(y,_i);return _createClass(y,[{key:"createRenderRoot",value:function createRenderRoot(){return this;}},{key:"injectCss",value:function injectCss(t){if(this.querySelector("style[data-rte-style]"))return;var i=document.createElement("style");i.setAttribute("data-rte-style","true"),i.textContent=t,this.insertBefore(i,this.firstChild);}},{key:"connectedCallback",value:function connectedCallback(){var _this$mentionsEl$atta,_this$mentionsEl,_this$mentionsEl$setE,_this$mentionsEl2;_superPropGet(y,"connectedCallback",this,3)([]),this.injectCss(p.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&((_this$mentionsEl$atta=(_this$mentionsEl=this.mentionsEl).attach)!==null&&_this$mentionsEl$atta!==void 0&&_this$mentionsEl$atta.call(_this$mentionsEl,this.editorEl,this),(_this$mentionsEl$setE=(_this$mentionsEl2=this.mentionsEl).setExternalConfig)!==null&&_this$mentionsEl$setE!==void 0&&_this$mentionsEl$setE.call(_this$mentionsEl2,this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview();}},{key:"ensureStructure",value:function ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling));}},{key:"firstUpdated",value:function firstUpdated(t){if(_superPropGet(y,"firstUpdated",this,3)([t]),this.editorEl){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.editorEl.classList.add("safari");}}},{key:"updateContentWithMention",value:function updateContentWithMention(t){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:t},bubbles:!0,composed:!0}));}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.unwireEditor(),document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),_superPropGet(y,"disconnectedCallback",this,3)([]);}},{key:"updated",value:function updated(t){t.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),t.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor)),t.has("disabled")&&this.editorEl&&(this.editorEl.setAttribute("contenteditable",this.disabled?"false":"true"),this.editorEl.tabIndex=this.disabled?-1:0,this.linkEl&&(this.linkEl.disabled=this.disabled)),t.has("placeholder")&&this.editorEl&&(this.placeholder?this.editorEl.dataset.placeholder=this.placeholder:delete this.editorEl.dataset.placeholder);}},{key:"ensureEditor",value:function ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){var _t2=document.createElement("article");_t2.className="editor",_t2.setAttribute("contenteditable",this.disabled?"false":"true"),_t2.tabIndex=this.disabled?-1:0,this.editorEl=_t2;}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>");}},{key:"unwrapMention",value:function unwrapMention(t){var _t$textContent;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var s=t.parentNode;if(!s)return;var e=i?((_t$textContent=t.textContent)!==null&&_t$textContent!==void 0?_t$textContent:"").replace(/\u200B/g,""):"",n=document.createTextNode(e);s.insertBefore(n,t),s.removeChild(t);var h=document.createRange();h.setStartAfter(n),h.collapse(!0);var r=window.getSelection();r!==null&&r!==void 0&&r.removeAllRanges(),r===null||r===void 0?void 0:r.addRange(h);}},{key:"scrubBrokenMentions",value:function scrubBrokenMentions(){var _this2=this;if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach(function(t){var _i$textContent;var i=t,s=i.getAttribute("data-mention-key"),e=i.getAttribute("data-mention-label"),n=i.getAttribute("data-mention-trigger")||"",h=((_i$textContent=i.textContent)!==null&&_i$textContent!==void 0?_i$textContent:"").replace(/\u200B/g,"").trim(),r=!!s&&!!e&&h.length>0&&h.startsWith(n)&&h.includes(e);h&&r||_this2.unwrapMention(i,!0);});}},{key:"wireEditor",value:function wireEditor(){this.editorEl.addEventListener("click",this.onEditorClick),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.onEditorMouseup),this.editorEl.addEventListener("keyup",this.onEditorKeyup),this.editorEl.addEventListener("keydown",this.onEditorKeydown),this.editorEl.addEventListener("paste",this.onEditorPaste),this.editorEl.addEventListener("drop",this.onEditorDrop);}},{key:"unwireEditor",value:function unwireEditor(){this.editorEl&&(this.editorEl.removeEventListener("click",this.onEditorClick),this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.onEditorMouseup),this.editorEl.removeEventListener("keyup",this.onEditorKeyup),this.editorEl.removeEventListener("keydown",this.onEditorKeydown),this.editorEl.removeEventListener("paste",this.onEditorPaste),this.editorEl.removeEventListener("drop",this.onEditorDrop));}},{key:"wireAuthoredToolbar",value:function wireAuthoredToolbar(t){var _this3=this;this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(t.children).forEach(function(t){var i=t.tagName.toLowerCase();if("nile-rte-select"===i&&"align"===t.getAttribute("type"))return t.disabled=_this3.disabled,void t.addEventListener("change",function(t){_this3.focusAndRestore();var i=t.detail;h(_this3.editorEl,i),_this3.updateContent(),_this3.updateToolbarState();});if("nile-rte-link"===i)return t.editorEl=_this3.editorEl,t.disabled=_this3.disabled,_this3.linkEl=t,void t.addEventListener("nile-link-changed",function(){_this3.updateContent(),_this3.updateToolbarState();});if("nile-rte-toolbar-item"===i){var _this3$buttonMap$get;var _i2=t.querySelector(":scope > nile-button");var _s2=t.getAttribute("name")||"",_e2=t.getAttribute("label")||_s2,_n2=t.getAttribute("icon"),_h2=t.innerHTML.trim().length>0;if(_i2||(_i2=document.createElement("nile-button"),_i2.variant="tertiary",_i2.size="small"),_i2.disabled=_this3.disabled,_n2)_i2.innerHTML="<nile-icon name=\"".concat(_n2,"\" color=\"").concat(_this3.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))","\" ></nile-icon>"),t.innerHTML="";else if(_h2)_i2.innerHTML=t.innerHTML,t.innerHTML="";else{var _n3=b[_s2];_n3?_i2.innerHTML="<nile-icon name=\"".concat(_n3,"\" size=\"20\" color=\"").concat(_this3.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))","\" ></nile-icon>"):_i2.textContent=_e2||_s2,t.innerHTML="";}if(!_i2.isConnected)if(_this3.disabled)t.appendChild(_i2);else{var _s3=document.createElement("nile-lite-tooltip");_s3.setAttribute("content",_e2),_s3.appendChild(_i2),t.appendChild(_s3);}_i2.setAttribute("aria-label",_e2),_i2.addEventListener("mousedown",function(t){return t.preventDefault();}),_i2.addEventListener("click",function(){return _this3.onToolbarCommand(_s2);});var _r=(_this3$buttonMap$get=_this3.buttonMap.get(_s2))!==null&&_this3$buttonMap$get!==void 0?_this3$buttonMap$get:[];return _r.push(_i2),void _this3.buttonMap.set(_s2,_r);}if("nile-rte-select"!==i)"nile-rte-color"!==i||t.addEventListener("change",function(t){_this3.focusAndRestore();var _t$detail=t.detail,i=_t$detail.mode,s=_t$detail.value;"backColor"===i?d(_this3.editorEl,s):f(_this3.editorEl,s),_this3.updateContent(),_this3.updateToolbarState();});else{var _i3=t.getAttribute("type")||"";t.addEventListener("change",function(t){_this3.focusAndRestore();var s=t.detail;"heading"===_i3?r(_this3.editorEl,s):"font"===_i3&&a(_this3.editorEl,s),_this3.updateContent(),_this3.updateToolbarState();});}});}},{key:"saveSelection",value:function saveSelection(){var t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange());}},{key:"restoreSelection",value:function restoreSelection(){if(!this.lastRange)return;var t=document.getSelection();t&&(t.removeAllRanges(),t.addRange(this.lastRange));}},{key:"focusAndRestore",value:function focusAndRestore(){var _this$editorEl;(_this$editorEl=this.editorEl)!==null&&_this$editorEl!==void 0&&_this$editorEl.focus(),this.restoreSelection();}},{key:"getCleanContent",value:function getCleanContent(){var t=this.editorEl.cloneNode(!0);return t.querySelectorAll("*").forEach(function(t){t.removeAttribute("style");}),t.innerHTML;}},{key:"insertList",value:function insertList(t){if(this.restoreSelection(),!this.lastRange)return;var i=document.createElement(t),s=this.lastRange.extractContents(),e=document.createElement("div");e.appendChild(s),Array.from(e.childNodes).forEach(function(t){var _t$textContent2;if(t.nodeType===Node.TEXT_NODE&&!((_t$textContent2=t.textContent)!==null&&_t$textContent2!==void 0&&_t$textContent2.trim()))return;var s=document.createElement("li");s.appendChild(t),i.appendChild(s);}),this.lastRange.insertNode(i),this.afterListEdit(i);}},{key:"afterListEdit",value:function afterListEdit(t){var i=document.createRange();i.setStartAfter(t),i.collapse(!0);var s=window.getSelection();s!==null&&s!==void 0&&s.removeAllRanges(),s!==null&&s!==void 0&&s.addRange(i),this.saveSelection(),this.updateContent(),this.updateToolbarState();}},{key:"ensureAtLeastOneParagraph",value:function ensureAtLeastOneParagraph(){var _t$textContent3;var t=this.editorEl;if(!t)return;var i=""===((_t$textContent3=t.textContent)!==null&&_t$textContent3!==void 0?_t$textContent3:"").replace(/\u200B/g,"").trim();if(0===t.childNodes.length||i){t.innerHTML="<p><br></p>";var _i4=t.querySelector("p");if(_i4){var _t3=document.createRange();_t3.setStart(_i4,0),_t3.collapse(!0);var _s4=window.getSelection();_s4&&(_s4.removeAllRanges(),_s4.addRange(_t3));}return;}if(!t.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){var _i5=document.createElement("p");for(;t.firstChild;)_i5.appendChild(t.firstChild);return _i5.hasChildNodes()||_i5.appendChild(document.createElement("br")),void t.appendChild(_i5);}t.querySelectorAll("p").forEach(function(t){var _t$textContent4;""===((_t$textContent4=t.textContent)!==null&&_t$textContent4!==void 0?_t$textContent4:"").replace(/\u200B/g,"")&&(t.innerHTML.toLowerCase().includes("<br")||(t.innerHTML="<br>"));});}},{key:"onToolbarCommand",value:function onToolbarCommand(t){if(!this.disabled){switch(this.focusAndRestore(),t){case"bold":c(this.editorEl,"strong");break;case"italic":c(this.editorEl,"em");break;case"underline":c(this.editorEl,"u");break;case"left":h(this.editorEl,"left");break;case"center":h(this.editorEl,"center");break;case"right":h(this.editorEl,"right");break;case"justify":h(this.editorEl,"justify");break;case"ul":m(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":m(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":var _t4=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),_i6=[];for(;_t4.nextNode();){var _s5=_t4.currentNode;_s5.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(_s5.tagName)&&_i6.push(_s5);}for(var _i8=0,_i7=_i6;_i8<_i7.length;_i8++){var _t5=_i7[_i8];for(;_t5.firstChild;){var _t5$parentNode;(_t5$parentNode=_t5.parentNode)===null||_t5$parentNode===void 0||_t5$parentNode.insertBefore(_t5.firstChild,_t5);}_t5.remove();}this.ensureAtLeastOneParagraph();}this.updateContent(),this.updateToolbarState();}}},{key:"setBtnActive",value:function setBtnActive(t,i){var s=this.buttonMap.get(t);if(s){var _iterator=_createForOfIteratorHelper(s),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _t6=_step.value;_t6.toggleAttribute("data-active",!!i);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}}},{key:"updateToolbarState",value:function updateToolbarState(){var _this4=this,_s$closest;if(!this.editorEl)return;var t=document.getSelection();if(!t||0===t.rangeCount)return;var i=t.getRangeAt(0);if(!this.editorEl.contains(i.commonAncestorContainer))return;var s=o(i.startContainer)||this.editorEl,e=getComputedStyle(s),n=l(i.startContainer,this.editorEl)||this.editorEl,h=function(){var t=s;for(;t&&t!==_this4.editorEl;){if(t instanceof HTMLElement){var _i9=t.tagName.toLowerCase();if("strong"===_i9||"b"===_i9)return!0;var _s6=getComputedStyle(t).fontWeight;if(parseInt(_s6,10)>=600)return!0;}t=t.parentNode;}return!1;}(),r=function(){var t=s;for(;t&&t!==_this4.editorEl;){if(t instanceof HTMLElement){var _i10=t.tagName.toLowerCase();if("em"===_i10||"i"===_i10)return!0;if("italic"===getComputedStyle(t).fontStyle)return!0;}t=t.parentNode;}return!1;}(),c=function(){var t=s;for(;t&&t!==_this4.editorEl;){if(t instanceof HTMLElement){var _i11=getComputedStyle(t).textDecorationLine;if(_i11&&_i11.includes("underline"))return!0;if("u"===t.tagName.toLowerCase())return!0;}t=t.parentNode;}return!1;}(),a=!!s.closest("a"),d=n.style.textAlign||getComputedStyle(n).textAlign||"start",f="start"===d?"left":d,m=!!s.closest("li")&&((_s$closest=s.closest("ul,ol"))===null||_s$closest===void 0?void 0:_s$closest.tagName.toLowerCase())||"";if(this.setBtnActive("bold",h),this.setBtnActive("italic",r),this.setBtnActive("underline",c),this.setBtnActive("link",a),this.linkEl){var _t7=this.linkEl.querySelector("nile-button");_t7&&_t7.toggleAttribute("data-active",a);}if(this.setBtnActive("left","left"===f&&!["center","right","justify"].includes(f)),this.setBtnActive("center","center"===f),this.setBtnActive("right","right"===f),this.setBtnActive("justify","justify"===f),this.setBtnActive("ul","ul"===m),this.setBtnActive("ol","ol"===m),this.headingSelect){var _t8=n.tagName.toLowerCase(),_i12=["h1","h2","h3"].includes(_t8)?_t8:"p";this.headingSelect.value!==_i12&&(this.headingSelect.value=_i12);}if(this.fontSelect){var _t9=(e.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(_t9)for(var _i13=0,_Array$from=Array.from(this.fontSelect.options);_i13<_Array$from.length;_i13++){var _i14=_Array$from[_i13];if(_i14.value.toLowerCase()===_t9){this.fontSelect.value=_i14.value;break;}}}if(this.colorInput){var _t10=u(e.color);_t10&&this.colorInput.value.toLowerCase()!==_t10.toLowerCase()&&(this.colorInput.value=_t10),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value);}if(this.bgColorInput){var _t11=getComputedStyle(s).backgroundColor;if(_t11&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(_t11)){var _i15=u(_t11);_i15&&this.bgColorInput.value.toLowerCase()!==_i15.toLowerCase()&&(this.bgColorInput.value=_i15);}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value);}}},{key:"syncPreview",value:function syncPreview(){this.updateContent();}},{key:"getComputedImportantProps",value:function getComputedImportantProps(){var _this$whitelist;return Array.from(new Set([].concat(g,_toConsumableArray((_this$whitelist=this.whitelist)!==null&&_this$whitelist!==void 0?_this$whitelist:[]))));}},{key:"updateContent",value:function updateContent(){var _this$editorEl$textCo;if(!this.editorEl)return;this.ensureAtLeastOneParagraph();var t=""===((_this$editorEl$textCo=this.editorEl.textContent)!==null&&_this$editorEl$textCo!==void 0?_this$editorEl$textCo:"").trim();this.editorEl.classList.toggle("empty",t);var i=window.getSelection(),s=i&&i.rangeCount>0&&this.editorEl.contains(i.getRangeAt(0).startContainer)?i.getRangeAt(0).cloneRange():null,e=this.editorEl.cloneNode(!0);if(this.noStyles)e.querySelectorAll("[style]").forEach(function(t){return t.removeAttribute("style");});else{var _t12=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),_i16=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),_s7=this.getComputedImportantProps();var _loop=function _loop(){var e=_t12.currentNode,n=_i16.currentNode,h=window.getComputedStyle(e),r=_s7.map(function(t){return"".concat(t,":").concat(h.getPropertyValue(t));}).join(";");r.trim()&&n.setAttribute("style",r);};for(;_t12.nextNode()&&_i16.nextNode();){_loop();}}s&&i&&this.editorEl.contains(s.startContainer)&&(i.removeAllRanges(),i.addRange(s)),this.content=e.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}));}}]);}(i));t([s({type:String,attribute:!0,reflect:!0})],y.prototype,"value",void 0),t([s({type:Boolean,attribute:!0,reflect:!0})],y.prototype,"noStyles",void 0),t([s({type:Boolean,attribute:!0,reflect:!0})],y.prototype,"disabled",void 0),t([s({type:Boolean,attribute:"singlelineeditor",reflect:!0})],y.prototype,"singleLineEditor",void 0),t([s({type:String})],y.prototype,"placeholder",void 0),t([s({attribute:"mentions",reflect:!0,converter:{fromAttribute:function fromAttribute(t){try{var _i17=JSON.parse(t),_s8={};for(var _i18=0,_Object$keys=Object.keys(_i17);_i18<_Object$keys.length;_i18++){var _t13=_Object$keys[_i18];var _e3=_i17[_t13];Array.isArray(_e3)&&(_s8[_t13]=_e3.filter(function(t){return t&&"string"==typeof t.key&&"string"==typeof t.label;}).map(function(t){return{key:t.key,label:t.label};}));}return _s8;}catch(_unused){return{};}},toAttribute:function toAttribute(t){return JSON.stringify(t);}}})],y.prototype,"mentions",void 0),t([s({attribute:"whitelist",reflect:!1,converter:{fromAttribute:function fromAttribute(t){try{var _i19=JSON.parse(t);return Array.isArray(_i19)?_i19.filter(function(t){return"string"==typeof t;}):[];}catch(_unused2){return[];}}}})],y.prototype,"whitelist",void 0),t([e()],y.prototype,"content",void 0),_export("N",y=t([n("nile-rich-text-editor")],y));}};});
|
|
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","lit","lit/decorators.js","./nile-rte-toolbar.cjs.js","./nile-rte-toolbar-item.cjs.js","./nile-rte-select.cjs.js","./nile-rte-color.cjs.js","./nile-rte-divider.cjs.js","./nile-rte-preview.cjs.js","./nile-rte-mentions.cjs.js","./nile-rte-link.cjs.js","./nile-rte-image.cjs.js","./utils/block-utils.cjs.js","./utils/inline-utils.cjs.js","./utils/color-utils.cjs.js","./utils/list-utils.cjs.js","./nile-rich-text-editor.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,r,h,o,l,c,a,u,d,f,m,p,g,b,y;function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n6){function n(){return _n6.apply(this,arguments);}n.toString=function(){return _n6.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.LitElement;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;e=_litDecoratorsJs.state;n=_litDecoratorsJs.customElement;},function(_nileRteToolbarCjsJs){},function(_nileRteToolbarItemCjsJs){},function(_nileRteSelectCjsJs){},function(_nileRteColorCjsJs){},function(_nileRteDividerCjsJs){},function(_nileRtePreviewCjsJs){},function(_nileRteMentionsCjsJs){},function(_nileRteLinkCjsJs){},function(_nileRteImageCjsJs){},function(_utilsBlockUtilsCjsJs){r=_utilsBlockUtilsCjsJs.c;h=_utilsBlockUtilsCjsJs.s;o=_utilsBlockUtilsCjsJs.a;l=_utilsBlockUtilsCjsJs.n;},function(_utilsInlineUtilsCjsJs){c=_utilsInlineUtilsCjsJs.t;a=_utilsInlineUtilsCjsJs.s;u=_utilsInlineUtilsCjsJs.r;},function(_utilsColorUtilsCjsJs){d=_utilsColorUtilsCjsJs.s;f=_utilsColorUtilsCjsJs.a;},function(_utilsListUtilsCjsJs){m=_utilsListUtilsCjsJs.t;},function(_nileRichTextEditorCssCjsJs){p=_nileRichTextEditorCssCjsJs.s;}],execute:function execute(){g={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"},b=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];_export("N",y=/*#__PURE__*/function(_i){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.value="",_this.noStyles=!1,_this.disabled=!1,_this.singleLineEditor=!1,_this.placeholder="",_this.mentions={},_this.whitelist=[],_this.content="",_this.previewEl=null,_this.toolbarEl=null,_this.lastRange=null,_this.buttonMap=new Map(),_this.headingSelect=null,_this.fontSelect=null,_this.colorInput=null,_this.bgColorInput=null,_this.colorSwatchEl=null,_this.bgSwatchEl=null,_this.containerEl=null,_this.linkEl=null,_this.imageEl=null,_this.mentionsEl=null,_this.onEditorClick=function(t){var _t$target$closest,_t$target;if(_this.disabled)return void t.preventDefault();var i=(_t$target$closest=(_t$target=t.target).closest)===null||_t$target$closest===void 0?void 0:_t$target$closest.call(_t$target,"a");i&&t.preventDefault();},_this.onEditorPaste=function(t){_this.disabled&&t.preventDefault();},_this.onEditorDrop=function(t){_this.disabled&&t.preventDefault();},_this.onEditorInput=function(){_this.disabled||(_this.ensureAtLeastOneParagraph(),_this.scrubBrokenMentions(),_this.updateContent(),_this.updateToolbarState());},_this.onEditorMouseup=function(){_this.saveSelection(),_this.updateToolbarState();},_this.onEditorKeyup=function(t){_this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)&&_this.updateToolbarState();},_this.onEditorKeydown=function(t){if(_this.disabled)return void t.preventDefault();if(_this.singleLineEditor&&"Enter"===t.key&&t.shiftKey)return void t.preventDefault();if(t.ctrlKey&&"i"===t.key.toLowerCase()&&(t.preventDefault(),c(_this.editorEl,"em"),_this.updateContent(),_this.updateToolbarState()),("Backspace"===t.key||"Delete"===t.key)&&_this.handleFigureDeletion(t))return;if(_this.singleLineEditor&&"Enter"===t.key)return void t.preventDefault();if("Tab"!==t.key)return;t.preventDefault(),_this.focusAndRestore();var i=window.getSelection();if(!i||0===i.rangeCount)return;var s=i.getRangeAt(0);if(t.shiftKey){if(s.collapsed&&s.startContainer.nodeType===Node.TEXT_NODE){var _t=s.startContainer,_e=s.startOffset,_n=_t.data.slice(0,_e),_r=_n.replace(/(\t|[ \u00a0]{2})$/,"");if(_r.length!==_n.length){_t.data=_r+_t.data.slice(_e);var _s=document.createRange();_s.setStart(_t,_r.length),_s.collapse(!0),i.removeAllRanges(),i.addRange(_s),_this.updateContent(),_this.updateToolbarState();}}return;}s.deleteContents();var e=document.createTextNode("\t");s.insertNode(e);var n=document.createRange();n.setStartAfter(e),n.collapse(!0),i.removeAllRanges(),i.addRange(n),_this.updateContent(),_this.updateToolbarState();},_this.onSelectionChange=function(){if(!_this.editorEl)return;var t=document.getSelection();if(!t||0===t.rangeCount)return;var i=t.getRangeAt(0);_this.editorEl.contains(i.commonAncestorContainer)&&(_this.lastRange=i.cloneRange(),_this.updateToolbarState());};return _this;}_inherits(y,_i);return _createClass(y,[{key:"createRenderRoot",value:function createRenderRoot(){return this;}},{key:"injectCss",value:function injectCss(t){if(this.querySelector("style[data-rte-style]"))return;var i=document.createElement("style");i.setAttribute("data-rte-style","true"),i.textContent=t,this.insertBefore(i,this.firstChild);}},{key:"connectedCallback",value:function connectedCallback(){var _this$mentionsEl$atta,_this$mentionsEl,_this$mentionsEl$setE,_this$mentionsEl2;_superPropGet(y,"connectedCallback",this,3)([]),this.injectCss(p.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&((_this$mentionsEl$atta=(_this$mentionsEl=this.mentionsEl).attach)!==null&&_this$mentionsEl$atta!==void 0&&_this$mentionsEl$atta.call(_this$mentionsEl,this.editorEl,this),(_this$mentionsEl$setE=(_this$mentionsEl2=this.mentionsEl).setExternalConfig)!==null&&_this$mentionsEl$setE!==void 0&&_this$mentionsEl$setE.call(_this$mentionsEl2,this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview();}},{key:"ensureStructure",value:function ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling));}},{key:"firstUpdated",value:function firstUpdated(t){if(_superPropGet(y,"firstUpdated",this,3)([t]),this.editorEl){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.editorEl.classList.add("safari");}}},{key:"updateContentWithMention",value:function updateContentWithMention(t){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:t},bubbles:!0,composed:!0}));}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.unwireEditor(),document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),_superPropGet(y,"disconnectedCallback",this,3)([]);}},{key:"updated",value:function updated(t){t.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),t.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor)),t.has("disabled")&&this.editorEl&&(this.editorEl.setAttribute("contenteditable",this.disabled?"false":"true"),this.editorEl.tabIndex=this.disabled?-1:0,this.linkEl&&(this.linkEl.disabled=this.disabled),this.imageEl&&(this.imageEl.disabled=this.disabled)),t.has("placeholder")&&this.editorEl&&(this.placeholder?this.editorEl.dataset.placeholder=this.placeholder:delete this.editorEl.dataset.placeholder);}},{key:"ensureEditor",value:function ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){var _t2=document.createElement("article");_t2.className="editor",_t2.setAttribute("contenteditable",this.disabled?"false":"true"),_t2.tabIndex=this.disabled?-1:0,this.editorEl=_t2;}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>");}},{key:"unwrapMention",value:function unwrapMention(t){var _t$textContent;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var s=t.parentNode;if(!s)return;var e=i?((_t$textContent=t.textContent)!==null&&_t$textContent!==void 0?_t$textContent:"").replace(/\u200B/g,""):"",n=document.createTextNode(e);s.insertBefore(n,t),s.removeChild(t);var r=document.createRange();r.setStartAfter(n),r.collapse(!0);var h=window.getSelection();h!==null&&h!==void 0&&h.removeAllRanges(),h===null||h===void 0?void 0:h.addRange(r);}},{key:"scrubBrokenMentions",value:function scrubBrokenMentions(){var _this2=this;if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach(function(t){var _i$textContent;var i=t,s=i.getAttribute("data-mention-key"),e=i.getAttribute("data-mention-label"),n=i.getAttribute("data-mention-trigger")||"",r=((_i$textContent=i.textContent)!==null&&_i$textContent!==void 0?_i$textContent:"").replace(/\u200B/g,"").trim(),h=!!s&&!!e&&r.length>0&&r.startsWith(n)&&r.includes(e);r&&h||_this2.unwrapMention(i,!0);});}},{key:"wireEditor",value:function wireEditor(){this.editorEl.addEventListener("click",this.onEditorClick),this.editorEl.addEventListener("input",this.onEditorInput),this.editorEl.addEventListener("mouseup",this.onEditorMouseup),this.editorEl.addEventListener("keyup",this.onEditorKeyup),this.editorEl.addEventListener("keydown",this.onEditorKeydown),this.editorEl.addEventListener("paste",this.onEditorPaste),this.editorEl.addEventListener("drop",this.onEditorDrop);}},{key:"unwireEditor",value:function unwireEditor(){this.editorEl&&(this.editorEl.removeEventListener("click",this.onEditorClick),this.editorEl.removeEventListener("input",this.onEditorInput),this.editorEl.removeEventListener("mouseup",this.onEditorMouseup),this.editorEl.removeEventListener("keyup",this.onEditorKeyup),this.editorEl.removeEventListener("keydown",this.onEditorKeydown),this.editorEl.removeEventListener("paste",this.onEditorPaste),this.editorEl.removeEventListener("drop",this.onEditorDrop));}},{key:"handleFigureDeletion",value:function handleFigureDeletion(t){var i=window.getSelection();if(!i||0===i.rangeCount)return!1;var s=i.getRangeAt(0);if(!this.editorEl.contains(s.commonAncestorContainer))return!1;if(!s.collapsed){var _i2=Array.from(this.editorEl.querySelectorAll("figure.rte-image")).filter(function(t){return s.intersectsNode(t);});return!!_i2.length&&(t.preventDefault(),s.deleteContents(),_i2.forEach(function(t){return t.isConnected&&t.remove();}),this.ensureAtLeastOneParagraph(),this.updateContent(),this.updateToolbarState(),!0);}var e=r(s.startContainer,this.editorEl)||this.editorEl;if("Backspace"===t.key){var _r2$matches;var _i3=document.createRange();_i3.setStart(e,0),_i3.setEnd(s.startContainer,s.startOffset);var _n2=""===_i3.toString().replace(/\u200B/g,""),_r2=e.previousElementSibling;if(_n2&&_r2!==null&&_r2!==void 0&&(_r2$matches=_r2.matches)!==null&&_r2$matches!==void 0&&_r2$matches.call(_r2,"figure.rte-image"))return t.preventDefault(),_r2.remove(),this.updateContent(),this.updateToolbarState(),!0;}else{var _r3$matches;var _i4=document.createRange();_i4.setStart(s.endContainer,s.endOffset),_i4.setEnd(e,e.childNodes.length);var _n3=""===_i4.toString().replace(/\u200B/g,""),_r3=e.nextElementSibling;if(_n3&&_r3!==null&&_r3!==void 0&&(_r3$matches=_r3.matches)!==null&&_r3$matches!==void 0&&_r3$matches.call(_r3,"figure.rte-image"))return t.preventDefault(),_r3.remove(),this.updateContent(),this.updateToolbarState(),!0;}return!1;}},{key:"wireAuthoredToolbar",value:function wireAuthoredToolbar(t){var _this3=this;this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(t.children).forEach(function(t){var i=t.tagName.toLowerCase();if("nile-rte-select"===i&&"align"===t.getAttribute("type"))return t.disabled=_this3.disabled,void t.addEventListener("change",function(t){_this3.focusAndRestore();var i=t.detail;h(_this3.editorEl,i),_this3.updateContent(),_this3.updateToolbarState();});if("nile-rte-link"===i)return t.editorEl=_this3.editorEl,t.disabled=_this3.disabled,_this3.linkEl=t,void t.addEventListener("nile-link-changed",function(){_this3.updateContent(),_this3.updateToolbarState();});if("nile-rte-image"===i)return t.editorEl=_this3.editorEl,t.disabled=_this3.disabled,_this3.imageEl=t,void t.addEventListener("nile-image-changed",function(){_this3.updateContent(),_this3.updateToolbarState();});if("nile-rte-toolbar-item"===i){var _this3$buttonMap$get;var _i5=t.querySelector(":scope > nile-button");var _s2=t.getAttribute("name")||"",_e2=t.getAttribute("label")||_s2,_n4=t.getAttribute("icon"),_r4=t.innerHTML.trim().length>0;if(_i5||(_i5=document.createElement("nile-button"),_i5.variant="tertiary",_i5.size="small"),_i5.disabled=_this3.disabled,_n4)_i5.innerHTML="<nile-icon name=\"".concat(_n4,"\" color=\"").concat(_this3.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))","\" ></nile-icon>"),t.innerHTML="";else if(_r4)_i5.innerHTML=t.innerHTML,t.innerHTML="";else{var _n5=g[_s2];_n5?_i5.innerHTML="<nile-icon name=\"".concat(_n5,"\" size=\"20\" color=\"").concat(_this3.disabled?"var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))":"var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))","\" ></nile-icon>"):_i5.textContent=_e2||_s2,t.innerHTML="";}if(!_i5.isConnected)if(_this3.disabled)t.appendChild(_i5);else{var _s3=document.createElement("nile-lite-tooltip");_s3.setAttribute("content",_e2),_s3.appendChild(_i5),t.appendChild(_s3);}_i5.setAttribute("aria-label",_e2),_i5.addEventListener("mousedown",function(t){return t.preventDefault();}),_i5.addEventListener("click",function(){return _this3.onToolbarCommand(_s2);});var _h=(_this3$buttonMap$get=_this3.buttonMap.get(_s2))!==null&&_this3$buttonMap$get!==void 0?_this3$buttonMap$get:[];return _h.push(_i5),void _this3.buttonMap.set(_s2,_h);}if("nile-rte-select"!==i)"nile-rte-color"!==i||t.addEventListener("change",function(t){_this3.focusAndRestore();var _t$detail=t.detail,i=_t$detail.mode,s=_t$detail.value;"backColor"===i?d(_this3.editorEl,s):f(_this3.editorEl,s),_this3.updateContent(),_this3.updateToolbarState();});else{var _i6=t.getAttribute("type")||"";t.addEventListener("change",function(t){_this3.focusAndRestore();var s=t.detail;"heading"===_i6?o(_this3.editorEl,s):"font"===_i6&&a(_this3.editorEl,s),_this3.updateContent(),_this3.updateToolbarState();});}});}},{key:"saveSelection",value:function saveSelection(){var t=window.getSelection();t&&t.rangeCount&&(this.lastRange=t.getRangeAt(0).cloneRange());}},{key:"restoreSelection",value:function restoreSelection(){if(!this.lastRange)return;var t=document.getSelection();t&&(t.removeAllRanges(),t.addRange(this.lastRange));}},{key:"focusAndRestore",value:function focusAndRestore(){var _this$editorEl;(_this$editorEl=this.editorEl)!==null&&_this$editorEl!==void 0&&_this$editorEl.focus(),this.restoreSelection();}},{key:"getCleanContent",value:function getCleanContent(){var t=this.editorEl.cloneNode(!0);return t.querySelectorAll("*").forEach(function(t){t.removeAttribute("style");}),t.innerHTML;}},{key:"insertList",value:function insertList(t){if(this.restoreSelection(),!this.lastRange)return;var i=document.createElement(t),s=this.lastRange.extractContents(),e=document.createElement("div");e.appendChild(s),Array.from(e.childNodes).forEach(function(t){var _t$textContent2;if(t.nodeType===Node.TEXT_NODE&&!((_t$textContent2=t.textContent)!==null&&_t$textContent2!==void 0&&_t$textContent2.trim()))return;var s=document.createElement("li");s.appendChild(t),i.appendChild(s);}),this.lastRange.insertNode(i),this.afterListEdit(i);}},{key:"afterListEdit",value:function afterListEdit(t){var i=document.createRange();i.setStartAfter(t),i.collapse(!0);var s=window.getSelection();s!==null&&s!==void 0&&s.removeAllRanges(),s!==null&&s!==void 0&&s.addRange(i),this.saveSelection(),this.updateContent(),this.updateToolbarState();}},{key:"ensureAtLeastOneParagraph",value:function ensureAtLeastOneParagraph(){var _t$textContent3;var t=this.editorEl;if(!t)return;var i=""===((_t$textContent3=t.textContent)!==null&&_t$textContent3!==void 0?_t$textContent3:"").replace(/\u200B/g,"").trim()&&!t.querySelector("img");if(0===t.childNodes.length||i){t.innerHTML="<p><br></p>";var _i7=t.querySelector("p");if(_i7){var _t3=document.createRange();_t3.setStart(_i7,0),_t3.collapse(!0);var _s4=window.getSelection();_s4&&(_s4.removeAllRanges(),_s4.addRange(_t3));}return;}if(!t.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre,figure")){var _i8=document.createElement("p");for(;t.firstChild;)_i8.appendChild(t.firstChild);return _i8.hasChildNodes()||_i8.appendChild(document.createElement("br")),void t.appendChild(_i8);}t.querySelectorAll("p").forEach(function(t){var _t$textContent4;""===((_t$textContent4=t.textContent)!==null&&_t$textContent4!==void 0?_t$textContent4:"").replace(/\u200B/g,"")&&(t.innerHTML.toLowerCase().includes("<br")||(t.innerHTML="<br>"));});}},{key:"onToolbarCommand",value:function onToolbarCommand(t){if(!this.disabled){switch(this.focusAndRestore(),t){case"bold":c(this.editorEl,"strong");break;case"italic":c(this.editorEl,"em");break;case"underline":c(this.editorEl,"u");break;case"left":h(this.editorEl,"left");break;case"center":h(this.editorEl,"center");break;case"right":h(this.editorEl,"right");break;case"justify":h(this.editorEl,"justify");break;case"ul":m(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":m(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":var _t4=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),_i9=[];for(;_t4.nextNode();){var _s5=_t4.currentNode;_s5.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(_s5.tagName)&&_i9.push(_s5);}for(var _i11=0,_i10=_i9;_i11<_i10.length;_i11++){var _t5=_i10[_i11];for(;_t5.firstChild;){var _t5$parentNode;(_t5$parentNode=_t5.parentNode)===null||_t5$parentNode===void 0||_t5$parentNode.insertBefore(_t5.firstChild,_t5);}_t5.remove();}this.ensureAtLeastOneParagraph();}this.updateContent(),this.updateToolbarState();}}},{key:"setBtnActive",value:function setBtnActive(t,i){var s=this.buttonMap.get(t);if(s){var _iterator=_createForOfIteratorHelper(s),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _t6=_step.value;_t6.toggleAttribute("data-active",!!i);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}}},{key:"updateToolbarState",value:function updateToolbarState(){var _this4=this,_s$closest;if(!this.editorEl)return;var t=document.getSelection();if(!t||0===t.rangeCount)return;var i=t.getRangeAt(0);if(!this.editorEl.contains(i.commonAncestorContainer))return;var s=l(i.startContainer)||this.editorEl,e=getComputedStyle(s),n=r(i.startContainer,this.editorEl)||this.editorEl,h=function(){var t=s;for(;t&&t!==_this4.editorEl;){if(t instanceof HTMLElement){var _i12=t.tagName.toLowerCase();if("strong"===_i12||"b"===_i12)return!0;var _s6=getComputedStyle(t).fontWeight;if(parseInt(_s6,10)>=600)return!0;}t=t.parentNode;}return!1;}(),o=function(){var t=s;for(;t&&t!==_this4.editorEl;){if(t instanceof HTMLElement){var _i13=t.tagName.toLowerCase();if("em"===_i13||"i"===_i13)return!0;if("italic"===getComputedStyle(t).fontStyle)return!0;}t=t.parentNode;}return!1;}(),c=function(){var t=s;for(;t&&t!==_this4.editorEl;){if(t instanceof HTMLElement){var _i14=getComputedStyle(t).textDecorationLine;if(_i14&&_i14.includes("underline"))return!0;if("u"===t.tagName.toLowerCase())return!0;}t=t.parentNode;}return!1;}(),a=!!s.closest("a"),d=n.style.textAlign||getComputedStyle(n).textAlign||"start",f="start"===d?"left":d,m=!!s.closest("li")&&((_s$closest=s.closest("ul,ol"))===null||_s$closest===void 0?void 0:_s$closest.tagName.toLowerCase())||"";if(this.setBtnActive("bold",h),this.setBtnActive("italic",o),this.setBtnActive("underline",c),this.setBtnActive("link",a),this.linkEl){var _t7=this.linkEl.querySelector("nile-button");_t7&&_t7.toggleAttribute("data-active",a);}if(this.imageEl){var _t8=!!s.closest("figure.rte-image"),_i15=this.imageEl.querySelector("nile-button");_i15&&_i15.toggleAttribute("data-active",_t8);}if(this.setBtnActive("left","left"===f&&!["center","right","justify"].includes(f)),this.setBtnActive("center","center"===f),this.setBtnActive("right","right"===f),this.setBtnActive("justify","justify"===f),this.setBtnActive("ul","ul"===m),this.setBtnActive("ol","ol"===m),this.headingSelect){var _t9=n.tagName.toLowerCase(),_i16=["h1","h2","h3"].includes(_t9)?_t9:"p";this.headingSelect.value!==_i16&&(this.headingSelect.value=_i16);}if(this.fontSelect){var _t10=(e.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(_t10)for(var _i17=0,_Array$from=Array.from(this.fontSelect.options);_i17<_Array$from.length;_i17++){var _i18=_Array$from[_i17];if(_i18.value.toLowerCase()===_t10){this.fontSelect.value=_i18.value;break;}}}if(this.colorInput){var _t11=u(e.color);_t11&&this.colorInput.value.toLowerCase()!==_t11.toLowerCase()&&(this.colorInput.value=_t11),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value);}if(this.bgColorInput){var _t12=getComputedStyle(s).backgroundColor;if(_t12&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(_t12)){var _i19=u(_t12);_i19&&this.bgColorInput.value.toLowerCase()!==_i19.toLowerCase()&&(this.bgColorInput.value=_i19);}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value);}}},{key:"syncPreview",value:function syncPreview(){this.updateContent();}},{key:"getComputedImportantProps",value:function getComputedImportantProps(){var _this$whitelist;return Array.from(new Set([].concat(b,_toConsumableArray((_this$whitelist=this.whitelist)!==null&&_this$whitelist!==void 0?_this$whitelist:[]))));}},{key:"updateContent",value:function updateContent(){var _this$editorEl$textCo;if(!this.editorEl)return;this.ensureAtLeastOneParagraph();var t=""===((_this$editorEl$textCo=this.editorEl.textContent)!==null&&_this$editorEl$textCo!==void 0?_this$editorEl$textCo:"").trim()&&!this.editorEl.querySelector("img");this.editorEl.classList.toggle("empty",t);var i=window.getSelection(),s=i&&i.rangeCount>0&&this.editorEl.contains(i.getRangeAt(0).startContainer)?i.getRangeAt(0).cloneRange():null,e=this.editorEl.cloneNode(!0);if(this.noStyles)e.querySelectorAll("[style]").forEach(function(t){return t.removeAttribute("style");});else{var _t13=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),_i20=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),_s7=this.getComputedImportantProps();var _loop=function _loop(){var e=_t13.currentNode,n=_i20.currentNode,r=window.getComputedStyle(e),h=_s7.map(function(t){return"".concat(t,":").concat(r.getPropertyValue(t));}).join(";");h.trim()&&n.setAttribute("style",h);};for(;_t13.nextNode()&&_i20.nextNode();){_loop();}}s&&i&&this.editorEl.contains(s.startContainer)&&(i.removeAllRanges(),i.addRange(s)),this.content=e.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}));}}]);}(i));t([s({type:String,attribute:!0,reflect:!0})],y.prototype,"value",void 0),t([s({type:Boolean,attribute:!0,reflect:!0})],y.prototype,"noStyles",void 0),t([s({type:Boolean,attribute:!0,reflect:!0})],y.prototype,"disabled",void 0),t([s({type:Boolean,attribute:"singlelineeditor",reflect:!0})],y.prototype,"singleLineEditor",void 0),t([s({type:String})],y.prototype,"placeholder",void 0),t([s({attribute:"mentions",reflect:!0,converter:{fromAttribute:function fromAttribute(t){try{var _i21=JSON.parse(t),_s8={};for(var _i22=0,_Object$keys=Object.keys(_i21);_i22<_Object$keys.length;_i22++){var _t14=_Object$keys[_i22];var _e3=_i21[_t14];Array.isArray(_e3)&&(_s8[_t14]=_e3.filter(function(t){return t&&"string"==typeof t.key&&"string"==typeof t.label;}).map(function(t){return{key:t.key,label:t.label};}));}return _s8;}catch(_unused){return{};}},toAttribute:function toAttribute(t){return JSON.stringify(t);}}})],y.prototype,"mentions",void 0),t([s({attribute:"whitelist",reflect:!1,converter:{fromAttribute:function fromAttribute(t){try{var _i23=JSON.parse(t);return Array.isArray(_i23)?_i23.filter(function(t){return"string"==typeof t;}):[];}catch(_unused2){return[];}}}})],y.prototype,"whitelist",void 0),t([e()],y.prototype,"content",void 0),_export("N",y=t([n("nile-rich-text-editor")],y));}};});
|
|
2
2
|
//# sourceMappingURL=nile-rich-text-editor.cjs.js.map
|