@elenajs/components 0.7.3 → 0.8.1
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/dist/avatar.d.ts +2 -0
- package/dist/avatar.js +1 -1
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/button.d.ts +2 -0
- package/dist/button.js +1 -1
- package/dist/custom-elements.d.ts +8 -0
- package/dist/custom-elements.json +70 -0
- package/dist/elena-Bvw5aqmt.js +2 -0
- package/dist/elena-Bvw5aqmt.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/input.d.ts +2 -0
- package/dist/input.js +1 -1
- package/dist/stack.d.ts +2 -0
- package/dist/stack.js +1 -1
- package/package.json +4 -4
- package/dist/elena-DJVpfAwm.js +0 -2
- package/dist/elena-DJVpfAwm.js.map +0 -1
package/dist/avatar.d.ts
CHANGED
package/dist/avatar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,e as a,a as t}from"./elena-
|
|
1
|
+
import{o as e,e as a,a as t}from"./elena-Bvw5aqmt.js";const n={props:["icon","state"],tagName:"elena-avatar",element:".elena-avatar"};class s extends(e(HTMLElement,n)){constructor(){super(),this.state="initial"}renderImage(){return a`<img class="elena-image" src="..">`}renderFallback(){return a`
|
|
2
2
|
${this.icon?a`<elena-icon name="${this.icon}"></elena-icon>`:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 27"></svg>`}
|
|
3
3
|
`}render(){return a`<div class="elena-avatar">${"initial"!==this.state?this.renderImage():t} ${"loaded"!==this.state?this.renderFallback():t}</div>`}}s.define();export{s as default};
|
|
4
4
|
//# sourceMappingURL=avatar.js.map
|
package/dist/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn("░█ [ELENA]: Invalid JSON for prop, received: "+t),null}case"boolean":return t;case"number":return null!==t?+t:t;default:return t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>{const i=t[r];return e+n+(i&&i.__raw?String(i):s(String(i??"")))},"");return{__raw:!0,strings:e,values:t,toString:()=>n}}const i=new WeakMap;function l(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],l=i&&i.__raw,a=l?String(i):s(String(i??""));if(a!==e._tplValues[t])if(e._tplValues[t]=a,l)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??"")));let l=i.get(t);l||(l=Array.from(t,e=>e.replace(/\n\s*/g," ")),i.set(t,l));const a=l.reduce((e,t,n)=>e+t+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,a),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function a(s,r){const i=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class a extends s{element=null;
|
|
1
|
+
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn("░█ [ELENA]: Invalid JSON for prop, received: "+t),null}case"boolean":return t;case"number":return null!==t?+t:t;default:return t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>{const i=t[r];return e+n+(i&&i.__raw?String(i):s(String(i??"")))},"");return{__raw:!0,strings:e,values:t,toString:()=>n}}const i=new WeakMap;function l(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],l=i&&i.__raw,a=l?String(i):s(String(i??""));if(a!==e._tplValues[t])if(e._tplValues[t]=a,l)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??"")));let l=i.get(t);l||(l=Array.from(t,e=>e.replace(/\n\s*/g," ")),i.set(t,l));const a=l.reduce((e,t,n)=>e+t+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,a),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function a(s,r){const i=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class a extends s{element=null;attributeChangedCallback(t,n,s){"text"!==t?(function(t,n,s,r){if(s!==r){const s=typeof t[n];"undefined"===s&&console.warn(`░█ [ELENA]: Prop "${n}" has no default value. Set a default in the constructor so Elena can infer the correct type.`);const i=e(s,r,"toProp");t[n]=i}}(this,t,n,s),this._hydrated&&n!==s&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=s??""}static get observedAttributes(){return[...r&&r.props?r.props:[],"text"]}render(){}_applyRender(){const e=this.render();e&&e.strings&&l(this,e.strings,e.values)}connectedCallback(){this._captureText(),this._applyRender(),this._resolveInnerElement(),this._flushProps(),this._delegateEvents(),this.updated()}_captureText(){if(!this._hydrated&&!this._text){const e=this.textContent.trim();e?this.text=e:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}}_resolveInnerElement(){this.element||(this.element=i(this),this.element||(r&&r.element&&console.warn("░█ [ELENA]: No element found, using firstElementChild as fallback."),this.element=this.firstElementChild))}_flushProps(){if(this._props){const n=!(!r||!r.element);for(const[s,r]of this._props){const i=e(typeof r,r,"toAttribute");t(this,s,i),n&&t(this.element,s,i)}}}_delegateEvents(){!this._events&&r&&r.events&&(this.element?(this._events=!0,r.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})):console.warn("░█ [ELENA]: Cannot delegate events, no inner element found. Ensure the component renders an element or check your element selector."))}updated(){this._hydrated||(this._hydrated=!0,this.classList.add("elena-hydrated"))}disconnectedCallback(){this._events&&(this._events=!1,r.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){r.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new n(e.type,{cancelable:!0})))}get text(){return this._text??""}set text(e){const t=this._text;this._text=e,this._hydrated&&t!==e&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}}return r&&r.props?.length&&(r.props.includes("text")&&console.warn('░█ [ELENA]: "text" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),function(n,s,r=!0){for(const i of s)Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(i):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(i))return;if(this._props.set(i,n),!this.isConnected)return;const s=e(typeof n,n,"toAttribute");t(this,i,s),r&&this.element&&t(this.element,i,s)}})}(a.prototype,r.props,!(!r||!r.element))),r&&r.tagName&&(a._tagName=r.tagName),a.define=function(){this._tagName?function(e,t){"undefined"!=typeof window&&"customElements"in window&&(window.customElements.get(e)||window.customElements.define(e,t))}(this._tagName,this):console.warn("░█ [ELENA]: define() called without a tagName. Set tagName in your Elena options to register the element.")},a}const o={tagName:"elena-button",props:["label","variant","size","disabled","name","value","type"],events:["click","focus","blur"],element:".elena-button"};class c extends(a(HTMLElement,o)){constructor(){super(),this.variant="default",this.size="md",this.disabled=!1,this.name="",this.value="",this.type="button"}render(){return r`<button class="elena-button">${this.text}</button>`}}c.define();const u={tagName:"elena-input",props:["size","disabled","name","value","type","label","error","placeholder"],events:["click","focus","blur"],element:".elena-input"};class h extends(a(HTMLElement,u)){constructor(){super(),this.size="md",this.disabled=!1,this.name="",this.label="",this.value="",this.placeholder="",this.type="text",this.error=""}render(){return r`<label for="input">${this.label}</label><div class="elena-input-container"><span class="elena-input-start"></span> <input id="input" class="elena-input"> <span class="elena-input-end"></span></div>${this.error?r`<div class="elena-error" role="alert">${this.error}</div>`:""}`}}h.define();const p={tagName:"elena-stack",props:["direction"]};class d extends(a(HTMLElement,p)){constructor(){super(),this.direction="column"}}d.define();export{c as Button,h as Input,d as Stack};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|
package/dist/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js","../src/button/button.js","../src/input/input.js","../src/stack/stack.js"],"sourcesContent":["function e(e,t,r){if(t=\"boolean\"===e&&\"boolean\"!=typeof t?null!==t:t,!r)return t;if(\"toAttribute\"===r)switch(e){case\"object\":case\"array\":return null===t?null:JSON.stringify(t);case\"boolean\":return t?\"\":null;case\"number\":return null===t?null:t;default:return\"\"===t?null:t}else switch(e){case\"object\":case\"array\":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn(\"░█ [ELENA]: Invalid JSON for prop, received: \"+t),null}case\"boolean\":return t;case\"number\":return null!==t?+t:t;default:return t}}function t(e,t,r){e?null===r?e.removeAttribute(t):e.setAttribute(t,r):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function r(r,n,o=!0){for(const s of n)Object.defineProperty(r,s,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(s):void 0},set(r){if(this._props||(this._props=new Map),r===this._props.get(s))return;if(this._props.set(s,r),!this.isConnected)return;const n=e(typeof r,r,\"toAttribute\");t(this,s,n),o&&this.element&&t(this.element,s,n)}})}function n(t,r,n,o){if(n!==o){const n=e(typeof t[r],o,\"toProp\");t[r]=n}}export{e as getPropValue,n as getProps,r as setProps,t as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,r)=>{const i=e[r];return n+o+(i&&i.__raw?String(i):t(String(i??\"\")))},\"\");return{__raw:!0,strings:n,values:e,toString:()=>o}}const o={__raw:!0,toString:()=>\"\"};export{n as defineElement,t as escapeHtml,e as html,o as nothing};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";const e=new WeakMap;function n(n,l,o){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(n,l,o)||function(n,l,o){const a=o.map(e=>e&&e.__raw?String(e):t(String(e??\"\")));let c=e.get(l);c||(c=Array.from(l,t=>t.replace(/\\n\\s*/g,\" \")),e.set(l,c));const s=c.reduce((t,e,n)=>t+e+(a[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();r(n,s),n._tplStrings=l,n._tplValues=a,n._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(n,a)}(n,l,o)}function r(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{r as renderHtml,n as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as t,getProps as e,getPropValue as s,syncAttribute as i}from\"./props.js\";import{ElenaEvent as n}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html,nothing}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function o(o,a){const l=a&&a.element?/^[a-z][a-z0-9-]*$/i.test(a.element)?t=>t.getElementsByClassName(a.element)[0]:t=>t.querySelector(a.element):t=>t.firstElementChild;class d extends o{element=null;get text(){return this._text??\"\"}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}attributeChangedCallback(t,s,i){\"text\"!==t?(e(this,t,s,i),this._hydrated&&s!==i&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=i??\"\"}static get observedAttributes(){return[...a&&a.props?a.props:[],\"text\"]}render(){}_applyRender(){const t=this.render();t&&t.strings&&h(this,t.strings,t.values)}connectedCallback(){if(!this._hydrated&&!this._text){const t=this.textContent.trim();t?this.text=t:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}if(this._applyRender(),this.element||(this.element=l(this),this.element||(a&&a.element&&console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props){const t=!(!a||!a.element);for(const[e,n]of this._props){const r=s(typeof n,n,\"toAttribute\");i(this,e,r),t&&i(this.element,e,r)}}!this._events&&a&&a.events&&(this._events=!0,a.events?.forEach(t=>{this.element.addEventListener(t,this),this[t]=(...e)=>this.element[t](...e)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,a.events?.forEach(t=>{this.element?.removeEventListener(t,this)}))}handleEvent(t){a.events?.includes(t.type)&&(t.stopPropagation(),this.dispatchEvent(new n(t.type,{cancelable:!0})))}}return a&&a.props?.length&&(a.props.includes(\"text\")&&console.warn('░█ [ELENA]: \"text\" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),t(d.prototype,a.props,!(!a||!a.element))),a&&a.tagName&&(d._tagName=a.tagName),d.define=function(){this._tagName&&r(this._tagName,this)},d}export{o as Elena};\n//# sourceMappingURL=elena.js.map\n","import { Elena, html } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-button\",\n props: [\"label\", \"variant\", \"size\", \"disabled\", \"name\", \"value\", \"type\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-button\",\n};\n\n/**\n * Button component is used for interface actions.\n *\n * @displayName Button\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n *\n * @cssprop [--elena-button-color-text] - Controls the color of the text.\n * @cssprop [--elena-button-color-bg] - Controls the color of the background.\n * @cssprop [--elena-button-color-border] - Controls the color of the border.\n * @cssprop [--elena-button-radius] - Controls the radius of the component.\n */\nexport default class Button extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The style variant of the button.\n *\n * @attribute\n * @type {\"default\" | \"primary\" | \"danger\"}\n */\n this.variant = \"default\";\n\n /**\n * The size of the button.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The value used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The type of the button.\n *\n * @attribute\n * @type {\"submit\" | \"reset\" | \"button\"}\n */\n this.type = \"button\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n return html`<button class=\"elena-button\">${this.text}</button>`;\n }\n}\n\n/**\n * Register the web component\n */\nButton.define();\n","import { Elena, html } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-input\",\n props: [\"size\", \"disabled\", \"name\", \"value\", \"type\", \"label\", \"error\", \"placeholder\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-input\",\n};\n\n/**\n * The description of the component goes here.\n *\n * @displayName Input\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n *\n * @cssprop [--elena-input-color-text] - Controls the color of the text.\n * @cssprop [--elena-input-color-bg] - Controls the color of the background.\n * @cssprop [--elena-input-color-border] - Controls the color of the border.\n * @cssprop [--elena-input-radius] - Controls the radius of the component.\n */\nexport default class Input extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The size of the input.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The label for the input\n *\n * @attribute\n * @type {string}\n */\n this.label = \"\";\n\n /**\n * The value used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The placeholder text for the input.\n *\n * @attribute\n * @type {string}\n */\n this.placeholder = \"\";\n\n /**\n * The type of the input\n *\n * @attribute\n * @type {\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\"}\n */\n this.type = \"text\";\n\n /**\n * The error to display\n *\n * @attribute\n * @type {string}\n */\n this.error = \"\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n return html`\n <label for=\"input\">${this.label}</label>\n <div class=\"elena-input-container\">\n <span class=\"elena-input-start\"></span>\n <input\n id=\"input\"\n class=\"elena-input\"\n />\n <span class=\"elena-input-end\"></span>\n </div>\n ${this.error ? html`<div class=\"elena-error\" role=\"alert\">${this.error}</div>` : \"\"}\n `;\n }\n}\n\n/**\n * Register the web component\n */\nInput.define();\n","import { Elena } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-stack\",\n props: [\"direction\"],\n};\n\n/**\n * Stack component manages layout of immediate children\n * with optional spacing between each child.\n *\n * @displayName Stack\n * @slot - The stacked content\n * @status alpha\n */\nexport default class Stack extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The direction of the stack.\n *\n * @attribute\n * @type {\"column\" | \"row\"}\n */\n this.direction = \"column\";\n }\n}\n\n/**\n * Register the web component\n */\nStack.define();\n"],"names":["e","t","r","JSON","stringify","parse","console","warn","removeAttribute","setAttribute","e$2","Event","constructor","s","super","bubbles","composed","n","String","replace","o","reduce","i","__raw","strings","values","toString","WeakMap","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","get","Array","from","set","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","d","text","this","_text","_hydrated","_isRendering","_applyRender","attributeChangedCallback","observedAttributes","props","render","h","connectedCallback","queueMicrotask","_props","_events","events","forEach","addEventListener","updated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","Map","isConnected","prototype","tagName","_tagName","define","window","customElements","options","Button","Elena","HTMLElement","variant","size","disabled","name","value","html","Input","label","placeholder","error","Stack","direction"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAOD,EAAE,GAAG,gBAAgBC,EAAE,OAAOF,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAO,OAAOC,EAAE,KAAKE,KAAKC,UAAUH,GAAG,IAAI,UAAU,OAAOA,EAAE,GAAG,KAAK,IAAI,SAAS,OAAO,OAAOA,EAAE,KAAKA,EAAE,QAAQ,MAAM,KAAKA,EAAE,KAAKA,OAAO,OAAOD,GAAG,IAAI,SAAS,IAAI,QAAQ,IAAIC,EAAE,OAAOA,EAAE,IAAI,OAAOE,KAAKE,MAAMJ,EAAE,CAAC,MAAM,OAAOK,QAAQC,KAAK,gDAAgDN,GAAG,IAAI,CAAC,IAAI,UAAU,OAAOA,EAAE,IAAI,SAAS,OAAO,OAAOA,GAAGA,EAAEA,EAAE,QAAQ,OAAOA,EAAE,CAAC,SAASA,EAAED,EAAEC,EAAEC,GAAGF,EAAE,OAAOE,EAAEF,EAAEQ,gBAAgBP,GAAGD,EA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,EAQhB9C,KAAK+C,KAAO,GAQZ/C,KAAKmD,MAAQ,GAQbnD,KAAKgD,MAAQ,GAQbhD,KAAKoD,YAAc,GAQnBpD,KAAKwB,KAAO,OAQZxB,KAAKqD,MAAQ,EACf,CAOA,MAAA7C,GACE,OAAOyC,CAAI,sBACYjD,KAAKmD,6KASxBnD,KAAKqD,MAAQJ,CAAI,yCAAyCjD,KAAKqD,cAAgB,IAErF,EAMFH,EAAMb,SCnHN,MAAMG,EAAU,CACdL,QAAS,cACT5B,MAAO,CAAC,cAWK,MAAM+C,UAAcZ,EAAMC,YAAaH,IACpD,WAAAtF,GACEE,QAQA4C,KAAKuD,UAAY,QACnB,EAMFD,EAAMjB"}
|
|
1
|
+
{"version":3,"file":"bundle.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js","../src/button/button.js","../src/input/input.js","../src/stack/stack.js"],"sourcesContent":["function e(e,t,n){if(t=\"boolean\"===e&&\"boolean\"!=typeof t?null!==t:t,!n)return t;if(\"toAttribute\"===n)switch(e){case\"object\":case\"array\":return null===t?null:JSON.stringify(t);case\"boolean\":return t?\"\":null;case\"number\":return null===t?null:t;default:return\"\"===t?null:t}else switch(e){case\"object\":case\"array\":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn(\"░█ [ELENA]: Invalid JSON for prop, received: \"+t),null}case\"boolean\":return t;case\"number\":return null!==t?+t:t;default:return t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r,o=!0){for(const s of r)Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(s):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(s))return;if(this._props.set(s,n),!this.isConnected)return;const r=e(typeof n,n,\"toAttribute\");t(this,s,r),o&&this.element&&t(this.element,s,r)}})}function r(t,n,r,o){if(r!==o){const r=typeof t[n];\"undefined\"===r&&console.warn(`░█ [ELENA]: Prop \"${n}\" has no default value. Set a default in the constructor so Elena can infer the correct type.`);const s=e(r,o,\"toProp\");t[n]=s}}export{e as getPropValue,r as getProps,n as setProps,t as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,r)=>{const i=e[r];return n+o+(i&&i.__raw?String(i):t(String(i??\"\")))},\"\");return{__raw:!0,strings:n,values:e,toString:()=>o}}const o={__raw:!0,toString:()=>\"\"};export{n as defineElement,t as escapeHtml,e as html,o as nothing};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";const e=new WeakMap;function n(n,l,o){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(n,l,o)||function(n,l,o){const a=o.map(e=>e&&e.__raw?String(e):t(String(e??\"\")));let c=e.get(l);c||(c=Array.from(l,t=>t.replace(/\\n\\s*/g,\" \")),e.set(l,c));const s=c.reduce((t,e,n)=>t+e+(a[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();r(n,s),n._tplStrings=l,n._tplValues=a,n._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(n,a)}(n,l,o)}function r(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{r as renderHtml,n as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html,nothing}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function o(o,l){const a=l&&l.element?/^[a-z][a-z0-9-]*$/i.test(l.element)?e=>e.getElementsByClassName(l.element)[0]:e=>e.querySelector(l.element):e=>e.firstElementChild;class d extends o{element=null;attributeChangedCallback(e,s,n){\"text\"!==e?(t(this,e,s,n),this._hydrated&&s!==n&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=n??\"\"}static get observedAttributes(){return[...l&&l.props?l.props:[],\"text\"]}render(){}_applyRender(){const e=this.render();e&&e.strings&&h(this,e.strings,e.values)}connectedCallback(){this._captureText(),this._applyRender(),this._resolveInnerElement(),this._flushProps(),this._delegateEvents(),this.updated()}_captureText(){if(!this._hydrated&&!this._text){const e=this.textContent.trim();e?this.text=e:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}}_resolveInnerElement(){this.element||(this.element=a(this),this.element||(l&&l.element&&console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild))}_flushProps(){if(this._props){const e=!(!l||!l.element);for(const[t,i]of this._props){const r=s(typeof i,i,\"toAttribute\");n(this,t,r),e&&n(this.element,t,r)}}}_delegateEvents(){!this._events&&l&&l.events&&(this.element?(this._events=!0,l.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})):console.warn(\"░█ [ELENA]: Cannot delegate events, no inner element found. Ensure the component renders an element or check your element selector.\"))}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,l.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){l.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}get text(){return this._text??\"\"}set text(e){const t=this._text;this._text=e,this._hydrated&&t!==e&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}}return l&&l.props?.length&&(l.props.includes(\"text\")&&console.warn('░█ [ELENA]: \"text\" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),e(d.prototype,l.props,!(!l||!l.element))),l&&l.tagName&&(d._tagName=l.tagName),d.define=function(){this._tagName?r(this._tagName,this):console.warn(\"░█ [ELENA]: define() called without a tagName. Set tagName in your Elena options to register the element.\")},d}export{o as Elena};\n//# sourceMappingURL=elena.js.map\n","import { Elena, html } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-button\",\n props: [\"label\", \"variant\", \"size\", \"disabled\", \"name\", \"value\", \"type\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-button\",\n};\n\n/**\n * Button component is used for interface actions.\n *\n * @displayName Button\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n *\n * @cssprop [--elena-button-color-text] - Controls the color of the text.\n * @cssprop [--elena-button-color-bg] - Controls the color of the background.\n * @cssprop [--elena-button-color-border] - Controls the color of the border.\n * @cssprop [--elena-button-radius] - Controls the radius of the component.\n */\nexport default class Button extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The style variant of the button.\n *\n * @attribute\n * @type {\"default\" | \"primary\" | \"danger\"}\n */\n this.variant = \"default\";\n\n /**\n * The size of the button.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The value used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The type of the button.\n *\n * @attribute\n * @type {\"submit\" | \"reset\" | \"button\"}\n */\n this.type = \"button\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n return html`<button class=\"elena-button\">${this.text}</button>`;\n }\n}\n\n/**\n * Register the web component\n */\nButton.define();\n","import { Elena, html } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-input\",\n props: [\"size\", \"disabled\", \"name\", \"value\", \"type\", \"label\", \"error\", \"placeholder\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-input\",\n};\n\n/**\n * The description of the component goes here.\n *\n * @displayName Input\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n *\n * @cssprop [--elena-input-color-text] - Controls the color of the text.\n * @cssprop [--elena-input-color-bg] - Controls the color of the background.\n * @cssprop [--elena-input-color-border] - Controls the color of the border.\n * @cssprop [--elena-input-radius] - Controls the radius of the component.\n */\nexport default class Input extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The size of the input.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The label for the input\n *\n * @attribute\n * @type {string}\n */\n this.label = \"\";\n\n /**\n * The value used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The placeholder text for the input.\n *\n * @attribute\n * @type {string}\n */\n this.placeholder = \"\";\n\n /**\n * The type of the input\n *\n * @attribute\n * @type {\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\"}\n */\n this.type = \"text\";\n\n /**\n * The error to display\n *\n * @attribute\n * @type {string}\n */\n this.error = \"\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n return html`\n <label for=\"input\">${this.label}</label>\n <div class=\"elena-input-container\">\n <span class=\"elena-input-start\"></span>\n <input\n id=\"input\"\n class=\"elena-input\"\n />\n <span class=\"elena-input-end\"></span>\n </div>\n ${this.error ? html`<div class=\"elena-error\" role=\"alert\">${this.error}</div>` : \"\"}\n `;\n }\n}\n\n/**\n * Register the web component\n */\nInput.define();\n","import { Elena } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-stack\",\n props: [\"direction\"],\n};\n\n/**\n * Stack component manages layout of immediate children\n * with optional spacing between each child.\n *\n * @displayName Stack\n * @slot - The stacked content\n * @status alpha\n */\nexport default class Stack extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The direction of the stack.\n *\n * @attribute\n * @type {\"column\" | \"row\"}\n */\n this.direction = \"column\";\n }\n}\n\n/**\n * Register the web component\n */\nStack.define();\n"],"names":["e","t","n","JSON","stringify","parse","console","warn","removeAttribute","setAttribute","e$2","Event","constructor","s","super","bubbles","composed","String","replace","o","reduce","r","i","__raw","strings","values","toString","WeakMap","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","get","Array","from","set","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","d","attributeChangedCallback","this","_hydrated","_isRendering","_applyRender","text","observedAttributes","props","render","h","connectedCallback","_captureText","_resolveInnerElement","_flushProps","_delegateEvents","updated","_text","queueMicrotask","_props","_events","events","forEach","addEventListener","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","Map","isConnected","prototype","tagName","_tagName","define","window","customElements","options","Button","Elena","HTMLElement","variant","size","disabled","name","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ASxBvD,KAAKyD,MAAQJ,CAAI,yCAAyCrD,KAAKyD,cAAgB,IAErF,EAMFH,EAAMb,SCnHN,MAAMG,EAAU,CACdL,QAAS,cACTjC,MAAO,CAAC,cAWK,MAAMoD,UAAcZ,EAAMC,YAAaH,IACpD,WAAA1F,GACEE,QAQA4C,KAAK2D,UAAY,QACnB,EAMFD,EAAMjB"}
|
package/dist/button.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ declare class Button extends HTMLElement {
|
|
|
13
13
|
value?: string;
|
|
14
14
|
/** The type of the button. */
|
|
15
15
|
type?: "submit" | "reset" | "button";
|
|
16
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
17
|
+
text?: string;
|
|
16
18
|
/** Programmatically fire click on the component. */
|
|
17
19
|
onclick?: (e: CustomEvent<never>) => void;
|
|
18
20
|
/** Programmatically move focus to the component. */
|
package/dist/button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e,e as t}from"./elena-
|
|
1
|
+
import{o as e,e as t}from"./elena-Bvw5aqmt.js";const s={tagName:"elena-button",props:["label","variant","size","disabled","name","value","type"],events:["click","focus","blur"],element:".elena-button"};class n extends(e(HTMLElement,s)){constructor(){super(),this.variant="default",this.size="md",this.disabled=!1,this.name="",this.value="",this.type="button"}render(){return t`<button class="elena-button">${this.text}</button>`}}n.define();export{n as default};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -61,6 +61,8 @@ type BaseProps = {
|
|
|
61
61
|
type BaseEvents = {};
|
|
62
62
|
|
|
63
63
|
export type AvatarProps = {
|
|
64
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
65
|
+
text?: string;
|
|
64
66
|
/** */
|
|
65
67
|
state?: string;
|
|
66
68
|
};
|
|
@@ -78,6 +80,8 @@ export type ButtonProps = {
|
|
|
78
80
|
value?: string;
|
|
79
81
|
/** The type of the button. */
|
|
80
82
|
type?: "submit" | "reset" | "button";
|
|
83
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
84
|
+
text?: string;
|
|
81
85
|
|
|
82
86
|
/** Programmatically fire click on the component. */
|
|
83
87
|
onclick?: (e: CustomEvent<never>) => void;
|
|
@@ -104,6 +108,8 @@ export type InputProps = {
|
|
|
104
108
|
type?: "text" | "email" | "password" | "tel" | "url" | "search" | "number" | "unit" | "button";
|
|
105
109
|
/** The error to display */
|
|
106
110
|
error?: string;
|
|
111
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
112
|
+
text?: string;
|
|
107
113
|
|
|
108
114
|
/** Programmatically fire click on the component. */
|
|
109
115
|
onclick?: (e: CustomEvent<never>) => void;
|
|
@@ -116,6 +122,8 @@ export type InputProps = {
|
|
|
116
122
|
export type StackProps = {
|
|
117
123
|
/** The direction of the stack. */
|
|
118
124
|
direction?: "column" | "row";
|
|
125
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
126
|
+
text?: string;
|
|
119
127
|
};
|
|
120
128
|
|
|
121
129
|
export type CustomElements = {
|
|
@@ -61,6 +61,15 @@
|
|
|
61
61
|
"text": "string"
|
|
62
62
|
},
|
|
63
63
|
"default": "\"initial\""
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"kind": "field",
|
|
67
|
+
"name": "text",
|
|
68
|
+
"type": {
|
|
69
|
+
"text": "string"
|
|
70
|
+
},
|
|
71
|
+
"description": "The text content of the element, captured from light DOM before the first render.",
|
|
72
|
+
"attribute": "text"
|
|
64
73
|
}
|
|
65
74
|
],
|
|
66
75
|
"mixins": [
|
|
@@ -73,6 +82,16 @@
|
|
|
73
82
|
"name": "HTMLElement"
|
|
74
83
|
},
|
|
75
84
|
"tagName": "elena-avatar",
|
|
85
|
+
"attributes": [
|
|
86
|
+
{
|
|
87
|
+
"name": "text",
|
|
88
|
+
"fieldName": "text",
|
|
89
|
+
"type": {
|
|
90
|
+
"text": "string"
|
|
91
|
+
},
|
|
92
|
+
"description": "The text content of the element, captured from light DOM before the first render."
|
|
93
|
+
}
|
|
94
|
+
],
|
|
76
95
|
"customElement": true
|
|
77
96
|
}
|
|
78
97
|
],
|
|
@@ -181,6 +200,15 @@
|
|
|
181
200
|
"description": "The type of the button.",
|
|
182
201
|
"default": "\"button\"",
|
|
183
202
|
"attribute": "type"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"kind": "field",
|
|
206
|
+
"name": "text",
|
|
207
|
+
"type": {
|
|
208
|
+
"text": "string"
|
|
209
|
+
},
|
|
210
|
+
"description": "The text content of the element, captured from light DOM before the first render.",
|
|
211
|
+
"attribute": "text"
|
|
184
212
|
}
|
|
185
213
|
],
|
|
186
214
|
"events": [
|
|
@@ -251,6 +279,14 @@
|
|
|
251
279
|
"description": "The type of the button.",
|
|
252
280
|
"default": "\"button\"",
|
|
253
281
|
"fieldName": "type"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "text",
|
|
285
|
+
"fieldName": "text",
|
|
286
|
+
"type": {
|
|
287
|
+
"text": "string"
|
|
288
|
+
},
|
|
289
|
+
"description": "The text content of the element, captured from light DOM before the first render."
|
|
254
290
|
}
|
|
255
291
|
],
|
|
256
292
|
"mixins": [
|
|
@@ -393,6 +429,15 @@
|
|
|
393
429
|
"description": "The error to display",
|
|
394
430
|
"default": "\"\"",
|
|
395
431
|
"attribute": "error"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"kind": "field",
|
|
435
|
+
"name": "text",
|
|
436
|
+
"type": {
|
|
437
|
+
"text": "string"
|
|
438
|
+
},
|
|
439
|
+
"description": "The text content of the element, captured from light DOM before the first render.",
|
|
440
|
+
"attribute": "text"
|
|
396
441
|
}
|
|
397
442
|
],
|
|
398
443
|
"events": [
|
|
@@ -481,6 +526,14 @@
|
|
|
481
526
|
"description": "The error to display",
|
|
482
527
|
"default": "\"\"",
|
|
483
528
|
"fieldName": "error"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"name": "text",
|
|
532
|
+
"fieldName": "text",
|
|
533
|
+
"type": {
|
|
534
|
+
"text": "string"
|
|
535
|
+
},
|
|
536
|
+
"description": "The text content of the element, captured from light DOM before the first render."
|
|
484
537
|
}
|
|
485
538
|
],
|
|
486
539
|
"mixins": [
|
|
@@ -541,6 +594,15 @@
|
|
|
541
594
|
"description": "The direction of the stack.",
|
|
542
595
|
"default": "\"column\"",
|
|
543
596
|
"attribute": "direction"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"kind": "field",
|
|
600
|
+
"name": "text",
|
|
601
|
+
"type": {
|
|
602
|
+
"text": "string"
|
|
603
|
+
},
|
|
604
|
+
"description": "The text content of the element, captured from light DOM before the first render.",
|
|
605
|
+
"attribute": "text"
|
|
544
606
|
}
|
|
545
607
|
],
|
|
546
608
|
"attributes": [
|
|
@@ -552,6 +614,14 @@
|
|
|
552
614
|
"description": "The direction of the stack.",
|
|
553
615
|
"default": "\"column\"",
|
|
554
616
|
"fieldName": "direction"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"name": "text",
|
|
620
|
+
"fieldName": "text",
|
|
621
|
+
"type": {
|
|
622
|
+
"text": "string"
|
|
623
|
+
},
|
|
624
|
+
"description": "The text content of the element, captured from light DOM before the first render."
|
|
555
625
|
}
|
|
556
626
|
],
|
|
557
627
|
"mixins": [
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn("░█ [ELENA]: Invalid JSON for prop, received: "+t),null}case"boolean":return t;case"number":return null!==t?+t:t;default:return t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>{const i=t[r];return e+n+(i&&i.__raw?String(i):s(String(i??"")))},"");return{__raw:!0,strings:e,values:t,toString:()=>n}}const i={__raw:!0,toString:()=>""},o=new WeakMap;function l(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],o=i&&i.__raw,l=o?String(i):s(String(i??""));if(l!==e._tplValues[t])if(e._tplValues[t]=l,o)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??"")));let i=o.get(t);i||(i=Array.from(t,e=>e.replace(/\n\s*/g," ")),o.set(t,i));const l=i.reduce((e,t,n)=>e+t+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,l),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function a(s,r){const i=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class o extends s{element=null;attributeChangedCallback(t,n,s){"text"!==t?(function(t,n,s,r){if(s!==r){const s=typeof t[n];"undefined"===s&&console.warn(`░█ [ELENA]: Prop "${n}" has no default value. Set a default in the constructor so Elena can infer the correct type.`);const i=e(s,r,"toProp");t[n]=i}}(this,t,n,s),this._hydrated&&n!==s&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=s??""}static get observedAttributes(){return[...r&&r.props?r.props:[],"text"]}render(){}_applyRender(){const e=this.render();e&&e.strings&&l(this,e.strings,e.values)}connectedCallback(){this._captureText(),this._applyRender(),this._resolveInnerElement(),this._flushProps(),this._delegateEvents(),this.updated()}_captureText(){if(!this._hydrated&&!this._text){const e=this.textContent.trim();e?this.text=e:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}}_resolveInnerElement(){this.element||(this.element=i(this),this.element||(r&&r.element&&console.warn("░█ [ELENA]: No element found, using firstElementChild as fallback."),this.element=this.firstElementChild))}_flushProps(){if(this._props){const n=!(!r||!r.element);for(const[s,r]of this._props){const i=e(typeof r,r,"toAttribute");t(this,s,i),n&&t(this.element,s,i)}}}_delegateEvents(){!this._events&&r&&r.events&&(this.element?(this._events=!0,r.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})):console.warn("░█ [ELENA]: Cannot delegate events, no inner element found. Ensure the component renders an element or check your element selector."))}updated(){this._hydrated||(this._hydrated=!0,this.classList.add("elena-hydrated"))}disconnectedCallback(){this._events&&(this._events=!1,r.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){r.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new n(e.type,{cancelable:!0})))}get text(){return this._text??""}set text(e){const t=this._text;this._text=e,this._hydrated&&t!==e&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}}return r&&r.props?.length&&(r.props.includes("text")&&console.warn('░█ [ELENA]: "text" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),function(n,s,r=!0){for(const i of s)Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(i):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(i))return;if(this._props.set(i,n),!this.isConnected)return;const s=e(typeof n,n,"toAttribute");t(this,i,s),r&&this.element&&t(this.element,i,s)}})}(o.prototype,r.props,!(!r||!r.element))),r&&r.tagName&&(o._tagName=r.tagName),o.define=function(){this._tagName?function(e,t){"undefined"!=typeof window&&"customElements"in window&&(window.customElements.get(e)||window.customElements.define(e,t))}(this._tagName,this):console.warn("░█ [ELENA]: define() called without a tagName. Set tagName in your Elena options to register the element.")},o}export{i as a,r as e,a as o};
|
|
2
|
+
//# sourceMappingURL=elena-Bvw5aqmt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elena-Bvw5aqmt.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js"],"sourcesContent":["function e(e,t,n){if(t=\"boolean\"===e&&\"boolean\"!=typeof t?null!==t:t,!n)return t;if(\"toAttribute\"===n)switch(e){case\"object\":case\"array\":return null===t?null:JSON.stringify(t);case\"boolean\":return t?\"\":null;case\"number\":return null===t?null:t;default:return\"\"===t?null:t}else switch(e){case\"object\":case\"array\":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn(\"░█ [ELENA]: Invalid JSON for prop, received: \"+t),null}case\"boolean\":return t;case\"number\":return null!==t?+t:t;default:return t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r,o=!0){for(const s of r)Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(s):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(s))return;if(this._props.set(s,n),!this.isConnected)return;const r=e(typeof n,n,\"toAttribute\");t(this,s,r),o&&this.element&&t(this.element,s,r)}})}function r(t,n,r,o){if(r!==o){const r=typeof t[n];\"undefined\"===r&&console.warn(`░█ [ELENA]: Prop \"${n}\" has no default value. Set a default in the constructor so Elena can infer the correct type.`);const s=e(r,o,\"toProp\");t[n]=s}}export{e as getPropValue,r as getProps,n as setProps,t as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,r)=>{const i=e[r];return n+o+(i&&i.__raw?String(i):t(String(i??\"\")))},\"\");return{__raw:!0,strings:n,values:e,toString:()=>o}}const o={__raw:!0,toString:()=>\"\"};export{n as defineElement,t as escapeHtml,e as html,o as nothing};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";const e=new WeakMap;function n(n,l,o){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(n,l,o)||function(n,l,o){const a=o.map(e=>e&&e.__raw?String(e):t(String(e??\"\")));let c=e.get(l);c||(c=Array.from(l,t=>t.replace(/\\n\\s*/g,\" \")),e.set(l,c));const s=c.reduce((t,e,n)=>t+e+(a[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();r(n,s),n._tplStrings=l,n._tplValues=a,n._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(n,a)}(n,l,o)}function r(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{r as renderHtml,n as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html,nothing}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function o(o,l){const a=l&&l.element?/^[a-z][a-z0-9-]*$/i.test(l.element)?e=>e.getElementsByClassName(l.element)[0]:e=>e.querySelector(l.element):e=>e.firstElementChild;class d extends o{element=null;attributeChangedCallback(e,s,n){\"text\"!==e?(t(this,e,s,n),this._hydrated&&s!==n&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=n??\"\"}static get observedAttributes(){return[...l&&l.props?l.props:[],\"text\"]}render(){}_applyRender(){const e=this.render();e&&e.strings&&h(this,e.strings,e.values)}connectedCallback(){this._captureText(),this._applyRender(),this._resolveInnerElement(),this._flushProps(),this._delegateEvents(),this.updated()}_captureText(){if(!this._hydrated&&!this._text){const e=this.textContent.trim();e?this.text=e:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}}_resolveInnerElement(){this.element||(this.element=a(this),this.element||(l&&l.element&&console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild))}_flushProps(){if(this._props){const e=!(!l||!l.element);for(const[t,i]of this._props){const r=s(typeof i,i,\"toAttribute\");n(this,t,r),e&&n(this.element,t,r)}}}_delegateEvents(){!this._events&&l&&l.events&&(this.element?(this._events=!0,l.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})):console.warn(\"░█ [ELENA]: Cannot delegate events, no inner element found. Ensure the component renders an element or check your element selector.\"))}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,l.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){l.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}get text(){return this._text??\"\"}set text(e){const t=this._text;this._text=e,this._hydrated&&t!==e&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}}return l&&l.props?.length&&(l.props.includes(\"text\")&&console.warn('░█ [ELENA]: \"text\" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),e(d.prototype,l.props,!(!l||!l.element))),l&&l.tagName&&(d._tagName=l.tagName),d.define=function(){this._tagName?r(this._tagName,this):console.warn(\"░█ [ELENA]: define() called without a tagName. Set tagName in your Elena options to register the element.\")},d}export{o as Elena};\n//# sourceMappingURL=elena.js.map\n"],"names":["e","t","n","JSON","stringify","parse","console","warn","removeAttribute","setAttribute","e$2","Event","constructor","s","super","bubbles","composed","String","replace","o","reduce","r","i","__raw","strings","values","toString","WeakMap","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","get","Array","from","set","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","d","attributeChangedCallback","this","_hydrated","_isRendering","_applyRender","text","observedAttributes","props","render","h","connectedCallback","_captureText","_resolveInnerElement","_flushProps","_delegateEvents","updated","_text","queueMicrotask","_props","_events","events","forEach","addEventListener","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","Map","isConnected","prototype","tagName","_tagName","define","window","customElements"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAOD,EAAE,GAAG,gBAAgBC,EAAE,OAAOF,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAO,OAAOC,EAAE,KAAKE,KAAKC,UAAUH,GAAG,IAAI,UAAU,OAAOA,EAAE,GAAG,KAAK,IAAI,SAAS,OAAO,OAAOA,EAAE,KAAKA,EAAE,QAAQ,MAAM,KAAKA,EAAE,KAAKA,OAAO,OAAOD,GAAG,IAAI,S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
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as Button}from"./button.js";export{default as Input}from"./input.js";export{default as Stack}from"./stack.js";import"./elena-
|
|
1
|
+
export{default as Button}from"./button.js";export{default as Input}from"./input.js";export{default as Stack}from"./stack.js";import"./elena-Bvw5aqmt.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/input.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ declare class Input extends HTMLElement {
|
|
|
17
17
|
type?: "text" | "email" | "password" | "tel" | "url" | "search" | "number" | "unit" | "button";
|
|
18
18
|
/** The error to display */
|
|
19
19
|
error?: string;
|
|
20
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
21
|
+
text?: string;
|
|
20
22
|
/** Programmatically fire click on the component. */
|
|
21
23
|
onclick?: (e: CustomEvent<never>) => void;
|
|
22
24
|
/** Programmatically move focus to the component. */
|
package/dist/input.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e,e as s}from"./elena-
|
|
1
|
+
import{o as e,e as s}from"./elena-Bvw5aqmt.js";const t={tagName:"elena-input",props:["size","disabled","name","value","type","label","error","placeholder"],events:["click","focus","blur"],element:".elena-input"};class l extends(e(HTMLElement,t)){constructor(){super(),this.size="md",this.disabled=!1,this.name="",this.label="",this.value="",this.placeholder="",this.type="text",this.error=""}render(){return s`<label for="input">${this.label}</label><div class="elena-input-container"><span class="elena-input-start"></span> <input id="input" class="elena-input"> <span class="elena-input-end"></span></div>${this.error?s`<div class="elena-error" role="alert">${this.error}</div>`:""}`}}l.define();export{l as default};
|
|
2
2
|
//# sourceMappingURL=input.js.map
|
package/dist/stack.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type { StackProps } from './custom-elements.js';
|
|
|
3
3
|
declare class Stack extends HTMLElement {
|
|
4
4
|
/** The direction of the stack. */
|
|
5
5
|
direction?: "column" | "row";
|
|
6
|
+
/** The text content of the element, captured from light DOM before the first render. */
|
|
7
|
+
text?: string;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export default Stack;
|
package/dist/stack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./elena-
|
|
1
|
+
import{o as e}from"./elena-Bvw5aqmt.js";const t={tagName:"elena-stack",props:["direction"]};class s extends(e(HTMLElement,t)){constructor(){super(),this.direction="column"}}s.define();export{s as default};
|
|
2
2
|
//# sourceMappingURL=stack.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elenajs/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Elena component library demonstrating how to build progressive web components.",
|
|
5
5
|
"author": "Elena <hi@elenajs.com>",
|
|
6
6
|
"homepage": "https://elenajs.com/",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"clean": "rm -rf dist/"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elenajs/core": "^0.
|
|
36
|
+
"@elenajs/core": "^0.8.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@elenajs/bundler": "^0.0
|
|
39
|
+
"@elenajs/bundler": "^0.1.0",
|
|
40
40
|
"@web/dev-server": "0.4.6"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "056c6a4cf9c5c95b2fc99d99fb4c5d5fb49d9af2"
|
|
43
43
|
}
|
package/dist/elena-DJVpfAwm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(t,e,n){if(e="boolean"===t&&"boolean"!=typeof e?null!==e:e,!n)return e;if("toAttribute"===n)switch(t){case"object":case"array":return null===e?null:JSON.stringify(e);case"boolean":return e?"":null;case"number":return null===e?null:e;default:return""===e?null:e}else switch(t){case"object":case"array":if(!e)return e;try{return JSON.parse(e)}catch{return console.warn("░█ [ELENA]: Invalid JSON for prop, received: "+e),null}case"boolean":return e;case"number":return null!==e?+e:e;default:return e}}function e(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(t,e){super(t,{bubbles:!0,composed:!0,...e})}};function s(t){const e={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(t).replace(/[&<>"']/g,t=>e[t])}function r(t,...e){const n=t.reduce((t,n,r)=>{const i=e[r];return t+n+(i&&i.__raw?String(i):s(String(i??"")))},"");return{__raw:!0,strings:t,values:e,toString:()=>n}}const i={__raw:!0,toString:()=>""},o=new WeakMap;function l(t,e,n){(function(t,e,n){if(t._tplStrings!==e||!t._tplParts)return!1;let r=!1;for(let e=0;e<n.length;e++){const i=n[e],o=i&&i.__raw,l=o?String(i):s(String(i??""));if(l!==t._tplValues[e])if(t._tplValues[e]=l,o)r=!0;else{const n=t._tplParts[e];n?n.textContent=String(i??""):r=!0}}return!r})(t,e,n)||function(t,e,n){const r=n.map(t=>t&&t.__raw?String(t):s(String(t??"")));let i=o.get(e);i||(i=Array.from(e,t=>t.replace(/\n\s*/g," ")),o.set(e,i));const l=i.reduce((t,e,n)=>t+e+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(t,l),t._tplStrings=e,t._tplValues=r,t._tplParts=function(t,e){const n=new Array(e.length),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<e.length;)r.textContent===e[i]&&(n[i]=r,i++);return n}(t,r)}(t,e,n)}function a(s,r){const i=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?t=>t.getElementsByClassName(r.element)[0]:t=>t.querySelector(r.element):t=>t.firstElementChild;class o extends s{element=null;get text(){return this._text??""}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}attributeChangedCallback(e,n,s){"text"!==e?(function(e,n,s,r){if(s!==r){const s=t(typeof e[n],r,"toProp");e[n]=s}}(this,e,n,s),this._hydrated&&n!==s&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=s??""}static get observedAttributes(){return[...r&&r.props?r.props:[],"text"]}render(){}_applyRender(){const t=this.render();t&&t.strings&&l(this,t.strings,t.values)}connectedCallback(){if(!this._hydrated&&!this._text){const t=this.textContent.trim();t?this.text=t:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}if(this._applyRender(),this.element||(this.element=i(this),this.element||(r&&r.element&&console.warn("░█ [ELENA]: No element found, using firstElementChild as fallback."),this.element=this.firstElementChild)),this._props){const n=!(!r||!r.element);for(const[s,r]of this._props){const i=t(typeof r,r,"toAttribute");e(this,s,i),n&&e(this.element,s,i)}}!this._events&&r&&r.events&&(this._events=!0,r.events?.forEach(t=>{this.element.addEventListener(t,this),this[t]=(...e)=>this.element[t](...e)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add("elena-hydrated"))}disconnectedCallback(){this._events&&(this._events=!1,r.events?.forEach(t=>{this.element?.removeEventListener(t,this)}))}handleEvent(t){r.events?.includes(t.type)&&(t.stopPropagation(),this.dispatchEvent(new n(t.type,{cancelable:!0})))}}return r&&r.props?.length&&(r.props.includes("text")&&console.warn('░█ [ELENA]: "text" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),function(n,s,r=!0){for(const i of s)Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(i):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(i))return;if(this._props.set(i,n),!this.isConnected)return;const s=t(typeof n,n,"toAttribute");e(this,i,s),r&&this.element&&e(this.element,i,s)}})}(o.prototype,r.props,!(!r||!r.element))),r&&r.tagName&&(o._tagName=r.tagName),o.define=function(){this._tagName&&function(t,e){"undefined"!=typeof window&&"customElements"in window&&(window.customElements.get(t)||window.customElements.define(t,e))}(this._tagName,this)},o}export{i as a,r as e,a as o};
|
|
2
|
-
//# sourceMappingURL=elena-DJVpfAwm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elena-DJVpfAwm.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js"],"sourcesContent":["function e(e,t,r){if(t=\"boolean\"===e&&\"boolean\"!=typeof t?null!==t:t,!r)return t;if(\"toAttribute\"===r)switch(e){case\"object\":case\"array\":return null===t?null:JSON.stringify(t);case\"boolean\":return t?\"\":null;case\"number\":return null===t?null:t;default:return\"\"===t?null:t}else switch(e){case\"object\":case\"array\":if(!t)return t;try{return JSON.parse(t)}catch{return console.warn(\"░█ [ELENA]: Invalid JSON for prop, received: \"+t),null}case\"boolean\":return t;case\"number\":return null!==t?+t:t;default:return t}}function t(e,t,r){e?null===r?e.removeAttribute(t):e.setAttribute(t,r):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function r(r,n,o=!0){for(const s of n)Object.defineProperty(r,s,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(s):void 0},set(r){if(this._props||(this._props=new Map),r===this._props.get(s))return;if(this._props.set(s,r),!this.isConnected)return;const n=e(typeof r,r,\"toAttribute\");t(this,s,n),o&&this.element&&t(this.element,s,n)}})}function n(t,r,n,o){if(n!==o){const n=e(typeof t[r],o,\"toProp\");t[r]=n}}export{e as getPropValue,n as getProps,r as setProps,t as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,r)=>{const i=e[r];return n+o+(i&&i.__raw?String(i):t(String(i??\"\")))},\"\");return{__raw:!0,strings:n,values:e,toString:()=>o}}const o={__raw:!0,toString:()=>\"\"};export{n as defineElement,t as escapeHtml,e as html,o as nothing};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";const e=new WeakMap;function n(n,l,o){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(n,l,o)||function(n,l,o){const a=o.map(e=>e&&e.__raw?String(e):t(String(e??\"\")));let c=e.get(l);c||(c=Array.from(l,t=>t.replace(/\\n\\s*/g,\" \")),e.set(l,c));const s=c.reduce((t,e,n)=>t+e+(a[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();r(n,s),n._tplStrings=l,n._tplValues=a,n._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(n,a)}(n,l,o)}function r(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{r as renderHtml,n as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as t,getProps as e,getPropValue as s,syncAttribute as i}from\"./props.js\";import{ElenaEvent as n}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html,nothing}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function o(o,a){const l=a&&a.element?/^[a-z][a-z0-9-]*$/i.test(a.element)?t=>t.getElementsByClassName(a.element)[0]:t=>t.querySelector(a.element):t=>t.firstElementChild;class d extends o{element=null;get text(){return this._text??\"\"}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)}attributeChangedCallback(t,s,i){\"text\"!==t?(e(this,t,s,i),this._hydrated&&s!==i&&!this._isRendering&&(this._isRendering=!0,this._applyRender(),this._isRendering=!1)):this.text=i??\"\"}static get observedAttributes(){return[...a&&a.props?a.props:[],\"text\"]}render(){}_applyRender(){const t=this.render();t&&t.strings&&h(this,t.strings,t.values)}connectedCallback(){if(!this._hydrated&&!this._text){const t=this.textContent.trim();t?this.text=t:queueMicrotask(()=>{this._text||(this.text=this.textContent.trim())})}if(this._applyRender(),this.element||(this.element=l(this),this.element||(a&&a.element&&console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props){const t=!(!a||!a.element);for(const[e,n]of this._props){const r=s(typeof n,n,\"toAttribute\");i(this,e,r),t&&i(this.element,e,r)}}!this._events&&a&&a.events&&(this._events=!0,a.events?.forEach(t=>{this.element.addEventListener(t,this),this[t]=(...e)=>this.element[t](...e)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,a.events?.forEach(t=>{this.element?.removeEventListener(t,this)}))}handleEvent(t){a.events?.includes(t.type)&&(t.stopPropagation(),this.dispatchEvent(new n(t.type,{cancelable:!0})))}}return a&&a.props?.length&&(a.props.includes(\"text\")&&console.warn('░█ [ELENA]: \"text\" is a reserved property. Rename your prop to avoid overriding the built-in text content feature.'),t(d.prototype,a.props,!(!a||!a.element))),a&&a.tagName&&(d._tagName=a.tagName),d.define=function(){this._tagName&&r(this._tagName,this)},d}export{o as Elena};\n//# sourceMappingURL=elena.js.map\n"],"names":["e","t","r","JSON","stringify","parse","console","warn","removeAttribute","setAttribute","e$2","Event","constructor","s","super","bubbles","composed","n","String","replace","o","reduce","i","__raw","strings","values","toString","WeakMap","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","get","Array","from","set","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","d","text","this","_text","_hydrated","_isRendering","_applyRender","attributeChangedCallback","observedAttributes","props","render","h","connectedCallback","queueMicrotask","_props","_events","events","forEach","addEventListener","updated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","Map","isConnected","prototype","tagName","_tagName","define","window","customElements"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAOD,EAAE,GAAG,gBAAgBC,EAAE,OAAOF,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAO,OAAOC,EAAE,KAAKE,KAAKC,UAAUH,GAAG,IAAI,UAAU,OAAOA,EAAE,GAAG,KAAK,IAAI,SAAS,OAAO,OAAOA,EAAE,KAAKA,EAAE,QAAQ,MAAM,KAAKA,EAAE,KAAKA,OAAO,OAAOD,GAAG,IAAI,SAAS,IAAI,QAAQ,IAAIC,EAAE,OAAOA,EAAE,IAAI,OAAOE,KAAKE,MAAMJ,EAAE,CAAC,MAAM,OAAOK,QAAQC,KAAK,gDAAgDN,GAAG,IAAI,CAAC,IAAI,UAAU,OAAOA,EAAE,IAAI,SAAS,OAAO,OAAOA,GAAGA,EAAEA,EAAE,QAAQ,OAAOA,EAAE,CAAC,SAASA,EAAED,EAAEC,EAAEC,GAAGF,EAAE,OAAOE,EAAEF,EAAEQ,gBAAgBP,GAAGD,EAAES,aAAaR,EAAEC,GAAGI,QAAQC,KAAK,wDAAwD,CCAvoB,IAAAG,EAAA,cAAgBC,MAAM,WAAAC,CAAYZ,EAAEa,GAAGC,MAAMd,E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