ds-one 0.1.11-alpha.2 → 0.1.11-alpha.3

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.
@@ -60,7 +60,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
60
60
  .loading {
61
61
  opacity: 0.7;
62
62
  }
63
- `;customElements.define("ds-button",ne);var ke=class extends l{static get properties(){return{key:{type:String,reflect:!0},defaultValue:{type:String,reflect:!0,attribute:"default-value"},fallback:{type:String,reflect:!0},_text:{type:String,state:!0}}}constructor(){super(),this.key="",this.defaultValue="",this.fallback="",this._text="",this.boundHandlers={languageChanged:(()=>{console.log("Language changed event received in text-v1"),this._loadText()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundHandlers.languageChanged)}updated(e){super.updated(e),(e.has("key")||e.has("defaultValue"))&&this._loadText()}_loadText(){if(!this.key){this._text=this.defaultValue||this.fallback||"";return}try{let e=x(this.key);this._text=e||this.defaultValue||this.fallback||this.key}catch(e){console.error("Error loading text for key:",this.key,e),this._text=this.defaultValue||this.fallback||this.key}this.requestUpdate()}render(){return o`<span>${this._text||this.defaultValue||this.key}</span>`}};ke.styles=c`
63
+ `;customElements.define("ds-button",ne);var ke=class extends l{static get properties(){return{key:{type:String,reflect:!0},defaultValue:{type:String,reflect:!0,attribute:"default-value"},fallback:{type:String,reflect:!0},_text:{type:String,state:!0}}}constructor(){super(),this.key="",this.defaultValue="",this.fallback="",this._text="",this.boundHandlers={languageChanged:(()=>{console.log("Language changed event received in ds-text"),this._loadText()})}}connectedCallback(){super.connectedCallback(),this._loadText(),window.addEventListener("language-changed",this.boundHandlers.languageChanged),window.addEventListener("translations-loaded",this.boundHandlers.languageChanged)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("language-changed",this.boundHandlers.languageChanged),window.removeEventListener("translations-loaded",this.boundHandlers.languageChanged)}updated(e){super.updated(e),(e.has("key")||e.has("defaultValue"))&&this._loadText()}_loadText(){if(!this.key){this._text=this.defaultValue||this.fallback||"";return}try{let e=x(this.key);this._text=e||this.defaultValue||this.fallback||this.key}catch(e){console.error("Error loading text for key:",this.key,e),this._text=this.defaultValue||this.fallback||this.key}this.requestUpdate()}render(){return o`<span>${this._text||this.defaultValue||this.key}</span>`}};ke.styles=c`
64
64
  :host {
65
65
  display: inline;
66
66
  }
@@ -68,7 +68,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
68
68
  .loading {
69
69
  opacity: 0.6;
70
70
  }
71
- `;customElements.define("text-v1",ke);var Ee={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=t=>(...e)=>({_$litDirective$:t,values:e}),W=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var se=class extends W{constructor(e){if(super(e),this.it=w,e.type!==Ee.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===M)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};se.directiveName="unsafeHTML",se.resultType=1;var nr=ie(se);var B=class t extends l{get type(){return this._type}set type(e){let r=this._type;this._type=e,this.requestUpdate("type",r)}constructor(){super(),this._type="",this.size="1em",this.color="currentColor",this.background="transparent",console.log("Icon constructor",this._type)}connectedCallback(){super.connectedCallback(),console.log("Icon connected",this._type)}renderIcon(){if(console.log("renderIcon called with type:",this._type),!this._type||this._type==="")return console.log("No type specified, rendering default slot"),o`<div class="icon-container"><slot></slot></div>`;let e=t.iconNameToSvgMap[this._type.toLowerCase()];if(e)return o`<div class="icon-container">${nr(e)}</div>`;switch(this._type.toLowerCase()){case"close":return console.log("Rendering close icon"),o`
71
+ `;customElements.define("ds-text",ke);var Ee={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=t=>(...e)=>({_$litDirective$:t,values:e}),W=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var se=class extends W{constructor(e){if(super(e),this.it=w,e.type!==Ee.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===M)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};se.directiveName="unsafeHTML",se.resultType=1;var nr=ie(se);var B=class t extends l{get type(){return this._type}set type(e){let r=this._type;this._type=e,this.requestUpdate("type",r)}constructor(){super(),this._type="",this.size="1em",this.color="currentColor",this.background="transparent",console.log("Icon constructor",this._type)}connectedCallback(){super.connectedCallback(),console.log("Icon connected",this._type)}renderIcon(){if(console.log("renderIcon called with type:",this._type),!this._type||this._type==="")return console.log("No type specified, rendering default slot"),o`<div class="icon-container"><slot></slot></div>`;let e=t.iconNameToSvgMap[this._type.toLowerCase()];if(e)return o`<div class="icon-container">${nr(e)}</div>`;switch(this._type.toLowerCase()){case"close":return console.log("Rendering close icon"),o`
72
72
  <div class="icon-container">
73
73
  <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
74
74
  <path
@@ -571,7 +571,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
571
571
  @click="${this._navigateHome}"
572
572
  @keydown="${this._onKeyDown}"
573
573
  >
574
- <text-v1 key="home"></text-v1>
574
+ <ds-text key="home"></ds-text>
575
575
  </div>
576
576
  `}};de.properties={state:{type:String,reflect:!0}};de.styles=c`
577
577
  :host {
@@ -609,7 +609,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
609
609
  }
610
610
 
611
611
  /* Inner text spacing without affecting the 80px outer width */
612
- .home > text-v1 {
612
+ .home > ds-text {
613
613
  padding: 0 calc(var(--1) * 0.15 * var(--scaling-factor));
614
614
  box-sizing: border-box;
615
615
  height: 100%;
@@ -975,7 +975,7 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
975
975
  }
976
976
  `;customElements.define("row-v1",ue);var Je=class extends l{static get properties(){return{type:{type:String,reflect:!0},to:{type:String,reflect:!0}}}constructor(){super(),this.type="work"}render(){let e=this.getNavConfig(),r=this.to||e.href;return o`
977
977
  <a href="${r}">
978
- <text-v1 key="${e.key}"></text-v1>
978
+ <ds-text key="${e.key}"></ds-text>
979
979
  <icon-v1 type="right"></icon-v1>
980
980
  </a>
981
981
  `}getNavConfig(){switch(this.type){case"projects":return{href:"/projects",key:"projects"};case"work":return{href:"/",key:"workExperience"}}}};Je.styles=c`
@@ -998,12 +998,12 @@ var Ct=!1,Er=["./keys.json","./tekst.json","./tekster.json","./language.json",".
998
998
  ${this.previous?o`
999
999
  <a href="${this.previous}" class="nav-previous">
1000
1000
  <icon-v1 type="left"></icon-v1>
1001
- <text-v1>${this.previousText||"Previous"}</text-v1>
1001
+ <ds-text>${this.previousText||"Previous"}</ds-text>
1002
1002
  </a>
1003
1003
  `:o`<div></div>`}
1004
1004
  ${this.next?o`
1005
1005
  <a href="${this.next}" class="nav-next">
1006
- <text-v1>${this.nextText||"Next"}</text-v1>
1006
+ <ds-text>${this.nextText||"Next"}</ds-text>
1007
1007
  <icon-v1 type="right"></icon-v1>
1008
1008
  </a>
1009
1009
  `:o`<div></div>`}