@lmvz-ds/components 0.12.2-alpha.0 → 0.12.3-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.
- package/dist/cjs/{icons-DbL3LSmP.js → icons-CvFeZlNJ.js} +3 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lmvz-icon.cjs.entry.js +1 -1
- package/dist/collection/components/lmvz-icon/icons.js +3 -2
- package/dist/collection/utils/url.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/{p-DDmjv-N_.js → p-4GImsUGe.js} +1 -1
- package/dist/esm/{icons-B71gAZmE.js → icons-AUbenGXq.js} +3 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/lmvz-icon.entry.js +1 -1
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-CMnnKjsp.js +1 -0
- package/dist/lmvz-components/{p-87b01940.entry.js → p-b7f0a6fd.entry.js} +1 -1
- package/dist/manifest.json +1 -1
- package/dist/types/utils/url.d.ts +1 -1
- package/package.json +4 -4
- package/dist/lmvz-components/p-DlIX18fw.js +0 -1
|
@@ -593,7 +593,7 @@ const responseAsText = (res) => Effect.tryPromise({
|
|
|
593
593
|
|
|
594
594
|
class URLCreationError extends TaggedError('URLCreationError') {
|
|
595
595
|
}
|
|
596
|
-
const
|
|
596
|
+
const createAssetUrlSafely = (file) => Effect.try_(() => index.getAssetPath([file].join('/').replace('//', '/'))).pipe(Effect.tapError(() => Effect.logWarning(`Failed to create URL for icon "${file}".
|
|
597
597
|
Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!
|
|
598
598
|
Falling back to /assets/`)), Effect.orElseSucceed(() => window.location.origin + '/assets/' + file));
|
|
599
599
|
|
|
@@ -627,7 +627,8 @@ const createIconCache = () => make({
|
|
|
627
627
|
timeToLive: Effect.infinity,
|
|
628
628
|
lookup: (key) => Effect.gen(function* () {
|
|
629
629
|
const name = key;
|
|
630
|
-
const
|
|
630
|
+
const icon = `../assets/icons/${name}.svg`;
|
|
631
|
+
const assetPath = yield* createAssetUrlSafely(icon);
|
|
631
632
|
const res = yield* httpClient(assetPath);
|
|
632
633
|
const responseString = yield* responseAsText(res);
|
|
633
634
|
return yield* createValidSVGString(responseString);
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var index = require('./index-9ZJx0550.js');
|
|
4
4
|
var Effect = require('./Effect-BIlTHtLK.js');
|
|
5
5
|
var ariaValidationController = require('./aria-validation-controller-B7unOPxT.js');
|
|
6
|
-
var icons = require('./icons-
|
|
6
|
+
var icons = require('./icons-CvFeZlNJ.js');
|
|
7
7
|
|
|
8
8
|
const lmvzIconCss = () => `.sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}`;
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cache, Duration, Effect } from "effect";
|
|
2
2
|
import { httpClient, responseAsText } from "../../utils/http";
|
|
3
|
-
import {
|
|
3
|
+
import { createAssetUrlSafely } from "../../utils/url";
|
|
4
4
|
import { createValidSVGString, SVGString } from "../../utils/validation/svg";
|
|
5
5
|
export const emptyDefaultSvg = () => SVGString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>`);
|
|
6
6
|
const createIconCache = () => Cache.make({
|
|
@@ -8,7 +8,8 @@ const createIconCache = () => Cache.make({
|
|
|
8
8
|
timeToLive: Duration.infinity,
|
|
9
9
|
lookup: (key) => Effect.gen(function* () {
|
|
10
10
|
const name = key;
|
|
11
|
-
const
|
|
11
|
+
const icon = `../assets/icons/${name}.svg`;
|
|
12
|
+
const assetPath = yield* createAssetUrlSafely(icon);
|
|
12
13
|
const res = yield* httpClient(assetPath);
|
|
13
14
|
const responseString = yield* responseAsText(res);
|
|
14
15
|
return yield* createValidSVGString(responseString);
|
|
@@ -2,6 +2,6 @@ import { getAssetPath } from "@stencil/core";
|
|
|
2
2
|
import { Data, Effect } from "effect";
|
|
3
3
|
export class URLCreationError extends Data.TaggedError('URLCreationError') {
|
|
4
4
|
}
|
|
5
|
-
export const
|
|
5
|
+
export const createAssetUrlSafely = (file) => Effect.try(() => getAssetPath([file].join('/').replace('//', '/'))).pipe(Effect.tapError(() => Effect.logWarning(`Failed to create URL for icon "${file}".
|
|
6
6
|
Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!
|
|
7
7
|
Falling back to /assets/`)), Effect.orElseSucceed(() => window.location.origin + '/assets/' + file));
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BaPwpeMs.js";export{c as clearIconCache}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BaPwpeMs.js";export{c as clearIconCache}from"./p-4GImsUGe.js";import{r as e}from"./p-BFwzIh71.js";export{LmvzAction,defineCustomElement as defineCustomElementLmvzAction}from"./lmvz-action.js";export{LmvzButton,defineCustomElement as defineCustomElementLmvzButton}from"./lmvz-button.js";export{LmvzCard,defineCustomElement as defineCustomElementLmvzCard}from"./lmvz-card.js";export{LmvzChip,defineCustomElement as defineCustomElementLmvzChip}from"./lmvz-chip.js";export{LmvzHeader,defineCustomElement as defineCustomElementLmvzHeader}from"./lmvz-header.js";export{LmvzIcon,defineCustomElement as defineCustomElementLmvzIcon}from"./lmvz-icon.js";export{LmvzInput,defineCustomElement as defineCustomElementLmvzInput}from"./lmvz-input.js";export{LmvzMenuitem,defineCustomElement as defineCustomElementLmvzMenuitem}from"./lmvz-menuitem.js";const t=["primary","secondary","tertiary"],o=["small","default","large"],m=["xs","sm","md","lg"],n=[...m,"xl"],l=["text","email","password","tel","url","search","number"],i=[...m,"inherit"],d=["thin","medium","bold","filled"],u=["Logo","actions","adduser","alert","apple","arrow-down","arrow-left","arrow-right","arrow-up","book","bookmark","checkmark","chevron-down","chevron-left","chevron-right","chevron-up","close-l","close-sm","cog","computer","dashboard","delete","download","edit","external","facebook","favorite","filter","group","hide","home","info","instagram","letter","linkedin","logout","map","minus","navigation","plus","qr-scan","question","reader","reset","school","search","send","settings","share","shopping-cart","show","snapchat","sort","speech-bubble","star","student","upload","user","warn-circle","warn-triangle","whatsapp","world","x","youtube"];function p(t){return e(t).catch((e=>{console.error("Unhandled error in Effect:",e)}))}export{u as iconNames,i as iconSizes,d as iconWeights,l as inputTypes,p as run,o as scaleValues,m as sizes,n as textSizes,t as variants}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,h as a,d as t,t as r}from"./p-BaPwpeMs.js";import{g as n,c as s}from"./p-B3JVFwO1.js";import{R as i,A as l}from"./p-BFwzIh71.js";import{d as o}from"./p-
|
|
1
|
+
import{p as e,h as a,d as t,t as r}from"./p-BaPwpeMs.js";import{g as n,c as s}from"./p-B3JVFwO1.js";import{R as i,A as l}from"./p-BFwzIh71.js";import{d as o}from"./p-4GImsUGe.js";class c{host;elements=[];constructor(e){this.host=e}hostDidRender(){this.host.el.addEventListener("keydown",this.handleKeydown)}updateElements(e){this.elements=e}handleKeydown=e=>{const{key:a}=e;if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(a))return;const t=n(document),r=this.getNextFocusableElement(t,["ArrowDown","ArrowRight"].includes(a)?"down":"up");r&&(e.preventDefault(),r.focus?.())};getNextFocusableElement(e,a){const{elements:t}=this,r=t.indexOf(e);if(-1===r)return null;let n=null;if("down"===a?n=(r+1)%t.length:"up"===a&&(n=(r-1+t.length)%t.length),null==n)return null;const i=t[n];return s(i)?i:this.getNextFocusableElement(i,a)}}const d=e(class extends i{get el(){return this}primarySlot;secondarySlot;secondaryNav;keyboardNavigationController=new c(this);get primaryMenuitems(){return this.primarySlot.assignedElements({flatten:!1})}get secondaryMenuitems(){return this.secondarySlot.assignedElements({flatten:!0})}get role(){return"banner"}lmvzActiveNav;get secondarySlotName(){return"connect-nav-"+this.lmvzActiveNav}constructor(e){super(!1),!1!==e&&this.__registerHost(),this.__attachShadow(),this.addController(new l(this,{reValidateOnPropChanges:!0})),this.addController(this.keyboardNavigationController)}handleActiveNavChange(){this.updateElementsActive()}componentDidLoad(){this.primarySlot.addEventListener("slotchange",this.handlePrimaryNavChange.bind(this)),this.handlePrimaryNavChange(),this.secondarySlot.addEventListener("slotchange",this.handleSecondaryNavChange.bind(this))}handlePrimaryNavChange(){const e=this.primaryMenuitems;e.length?(e.forEach((e=>{e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls","nav-secondary")})),this.updateElementsActive()):console.warn("Primary slot has no assigned elements. Please add navigation items to the primary slot.")}handleSecondaryNavChange(){this.secondaryMenuitems.length&&this.keyboardNavigationController.updateElements([...this.primaryMenuitems,...this.secondaryMenuitems])}updateElementsActive(){let e;this.primaryMenuitems.forEach((a=>{const t=a.id===this.lmvzActiveNav;t&&(e=a.textContent||a.id),a.setAttribute("aria-expanded",t?"true":"false")})),this.secondaryNav.setAttribute("aria-label","Untermenü für "+e)}delegateFocus(){const e=this.primaryMenuitems[0];e&&e.focus()}render(){return a(t,{key:"58934683ff442801eb34f025ac809631f93a27e8",onFocus:this.delegateFocus.bind(this)},a("div",{key:"35d3eadfabb70f83b313f946c8d31f9c223e8344",class:"brand"},a("slot",{key:"5ce98314d980d63e1c87f508d96119aca2e702a9",name:"brand"},a("lmvz-icon",{key:"b24e61a9071d81948d506a8c545e012d3f0e5dd2",id:"fallback-logo-lmvz",icon:"Logo",size:"inherit","aria-label":"Lehrmittelverlag Zürich"}))),a("nav",{key:"1d5cc9010ef90e6cebc8a7b054db595f35f9e040","aria-label":"Hauptnavigation"},a("div",{key:"488a1b1544242562b57d76169f1988d84c611de4",role:"menubar",class:"primary-menubar"},a("slot",{key:"59c6dd1442290931ed9a55f7bacc65ea4bb9ff6d",name:"nav-primary",ref:e=>this.primarySlot=e}),a("separator",{key:"2729f0e8b115614c50c4a16b6684a3bdb21856b8"}),a("div",{key:"6b5bed5951bad9173fefdc78039e71c4ccc120b2",role:"menu",id:"nav-secondary",class:"secondary-menubar",hidden:!this.lmvzActiveNav,ref:e=>this.secondaryNav=e},a("slot",{key:"02f5a13e8851372c1698e3f786a8757a0a09c32f",name:this.secondarySlotName,ref:e=>this.secondarySlot=e})))),a("div",{key:"53aafe8139bcea27d3039f64a48974cdb5aac5f9",class:"actions"},a("slot",{key:"f12ee19831073253e6ba8e251ba31ec403c21035",name:"actions"})))}static get watchers(){return{lmvzActiveNav:[{handleActiveNavChange:0}]}}static get style(){return":host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}"}},[769,"lmvz-header",{role:[2561],lmvzActiveNav:[1,"lmvz-active-nav"]},void 0,{lmvzActiveNav:[{handleActiveNavChange:0}]}]),m=d,h=function(){"undefined"!=typeof customElements&&["lmvz-header","lmvz-icon"].forEach((e=>{switch(e){case"lmvz-header":customElements.get(r(e))||customElements.define(r(e),d);break;case"lmvz-icon":customElements.get(r(e))||o()}}))};export{m as LmvzHeader,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as
|
|
1
|
+
import{L as s,d as o}from"./p-4GImsUGe.js";const m=s,p=o;export{m as LmvzIcon,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t,p as s,h as e,d as i,t as n}from"./p-BaPwpeMs.js";import{g as r,a,l as o,i as c,b as h,c as l,m,d as u,e as d,f as v,h as p,j as g,k as f,s as w,n as z,o as y,p as b,q as k,t as x,u as S,v as E,w as C,x as L,y as P,z as O,B as _,C as M,D as R,E as B,F as D,G as V,H as F,I,J as N,K as T,L as $,M as j,N as A,O as U,P as H,Q as K,S as G,T as J,U as W,V as q,W as Q,_ as X,X as Y,Y as Z,Z as tt,$ as st,a0 as et,a1 as it,a2 as nt,a3 as rt,a4 as at,a5 as ot,a6 as ct,a7 as ht,a8 as lt,a9 as mt,aa as ut,ab as dt,ac as vt,R as pt,A as gt,r as ft,ad as wt,ae as zt,af as yt}from"./p-BFwzIh71.js";const bt=Symbol.for("effect/Brand/Refined"),kt=(t,s,e,i)=>_({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),xt=(t,s)=>_({_tag:"Pending",key:t,deferred:s}),St=Symbol.for("effect/Cache/MapKey");class Et{current;[St]=St;previous=void 0;next=void 0;constructor(t){this.current=t}[A](){return U(G(this.current),K(G(this.previous)),K(G(this.next)),H(this))}[J](t){return this===t||Lt(t)&&q(this.current,t.current)&&q(this.previous,t.previous)&&q(this.next,t.next)}}const Ct=t=>new Et(t),Lt=t=>W(t,St);class Pt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const Ot=Symbol.for("effect/Cache"),_t={_Key:t=>t,_Error:t=>t,_Value:t=>t},Mt=Symbol.for("effect/ConsumerCache"),Rt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Bt=t=>({loadedMillis:t});class Dt{capacity;context;fiberId;lookup;timeToLive;[Ot]=_t;[Mt]=Rt;cacheState;constructor(t,s,e,i,n){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=n,this.cacheState={map:B(),keys:new Pt,accesses:j(),updating:$(!1),hits:0,misses:0}}get(t){return d(this.getEither(t),f)}get cacheStats(){return w((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:z(this.cacheState.map)})))}getOption(t){return y((()=>m(b(this.cacheState.map,t),{onNone:()=>{const s=Ct(t);return this.trackAccess(s),this.trackMiss(),k(x())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return y((()=>m(b(this.cacheState.map,t),{onNone:()=>{const s=Ct(t);return this.trackAccess(s),this.trackMiss(),k(x())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return w((()=>S(this.cacheState.map,t)))}entryStats(t){return w((()=>{const s=b(this.cacheState.map,t);if(E(s))switch(s.value._tag){case"Complete":return C(Bt(s.value.entryStats.loadedMillis));case"Pending":return x();case"Refreshing":return C(Bt(s.value.complete.entryStats.loadedMillis))}return x()}))}getEither(t){return y((()=>{const s=t;let e,i,n=L(b(this.cacheState.map,s));return void 0===n&&(i=P(this.fiberId),e=Ct(s),S(this.cacheState.map,s)?n=L(b(this.cacheState.map,s)):O(this.cacheState.map,s,xt(e,i))),void 0===n?(this.trackAccess(e),this.trackMiss(),d(this.lookupValueOf(t,i),a)):M(this.resolveMapValue(n),m({onNone:()=>this.getEither(t),onSome:t=>k(o(t))}))}))}invalidate(t){return w((()=>{R(this.cacheState.map,t)}))}invalidateWhen(t,s){return w((()=>{const e=b(this.cacheState.map,t);E(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&R(this.cacheState.map,t)}))}get invalidateAll(){return w((()=>{this.cacheState.map=B()}))}refresh(t){return D((s=>y((()=>{const e=t,i=P(this.fiberId);let n=L(b(this.cacheState.map,e));if(void 0===n&&(S(this.cacheState.map,e)?n=L(b(this.cacheState.map,e)):O(this.cacheState.map,e,xt(Ct(e),i))),void 0===n)return Q(this.lookupValueOf(t,i));switch(n._tag){case"Complete":if(this.hasExpired(s,n.timeToLiveMillis)){const s=L(b(this.cacheState.map,e));return q(s,n)&&R(this.cacheState.map,e),Q(this.get(t))}return U(this.lookupValueOf(t,i),Y((()=>{const t=L(b(this.cacheState.map,e));if(q(t,n)){const t=((t,s)=>_({_tag:"Refreshing",deferred:t,complete:s}))(i,n);return O(this.cacheState.map,e,t),!0}return!1})),Q);case"Pending":case"Refreshing":return X(n.deferred)}}))))}set(t,s){return D((e=>w((()=>{const i=e.unsafeCurrentTimeMillis(),n=t,r=Z(s),a=kt(Ct(n),r,Bt(i),i+tt(u(this.timeToLive(r))));O(this.cacheState.map,n,a)}))))}get size(){return w((()=>z(this.cacheState.map)))}get values(){return w((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return w((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return w((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return D((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(R(this.cacheState.map,t.key.current),k(x())):(this.trackHit(),d(t.exit,C));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?k(x()):d(X(t.deferred),C);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?k(x()):d(X(t.deferred),C):d(t.complete.exit,C)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(V(this.cacheState.accesses,t),F(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=I(this.cacheState.accesses,N);s===N?t=!1:this.cacheState.keys.add(s)}let s=z(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?S(this.cacheState.map,e.current)&&(R(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}T(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return D((e=>y((()=>{const i=t;return U(this.lookup(t),at(this.context),rt,M((t=>{const n=e.unsafeCurrentTimeMillis(),r=Bt(n),a=kt(Ct(i),t,r,n+tt(u(this.timeToLive(t))));return O(this.cacheState.map,i,a),et(nt(s,t),t)})),st((()=>et(it(s),w((()=>{R(this.cacheState.map,i)}))))))}))))}}const Vt=t=>{const s=u(t.timeToLive);return(t=>d(v([p(),g]),(([s,e])=>new Dt(t.capacity,s,e,t.lookup,(s=>u(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})},Ft=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends ot{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),It=t=>{const s={BaseEffectError:class extends Ft{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};class Nt extends(It("FetchError")){}class Tt extends(It("NotFoundError")){}class $t extends(It("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}It("URLCreationError");const jt=function(...t){const s=2===t.length?s=>t[0](s)?a(s):o(t[1](s)):s=>m(t[0](s),{onNone:()=>a(s),onSome:o});return Object.assign((t=>r(s(t),c)),{[bt]:bt,option:t=>l(s(t)),either:s,is:t=>h(s(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class At extends(It("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}let Ut=null;function Ht(){return ct((function*(){Ut?yield*Ut.invalidateAll:ut("Attempted to clear icon cache before it was initialized")}))}const Kt=s(class extends pt{intersectionObserver;get el(){return this}icon;weight="medium";size="md";iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(t){super(!1),!1!==t&&this.__registerHost(),this.addController(new gt(this))}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()}))}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}async loadIconPathData(){const{icon:s,visible:e}=this;s&&e&&(this.iconData=await ft(function(s){const e=s;return ct((function*(){return Ut||(Ut=yield*Vt({capacity:200,timeToLive:vt,lookup:s=>ct((function*(){const e=s,i=yield*(n=`./icons/${e}.svg`,lt((()=>t(["/assets",n].filter(Boolean).join("/").replace("//","/")))).pipe(mt((()=>ut(`Failed to create URL for icon "${n}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!\n Falling back to /assets/`))),dt((()=>window.location.origin+"/assets/"+n))));var n;const r=yield*(a=i,ct((function*(){const t=yield*ht({try:()=>fetch(a,void 0),catch:t=>new Nt({cause:t})});return 404===t.status?yield*new Tt({url:t.url}):t})));var a;const o=yield*(t=>ht({try:()=>t.text(),catch:t=>new $t(t)}))(r);return yield*(c=o,lt({try:()=>jt(c),catch:t=>new At(t,"SVGString")}));var c}))})),yield*Ut.get(e)}))}(this.icon).pipe(mt((t=>wt(`Error loading icon "${s}":`,t.message,t.cause,t.stack))),zt((()=>yt(jt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>')))))))}render(){return e(i,{key:"50d0f96ec5085a47ca7783e5232dfb503fa32d29",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(t,s=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((s=>{s.some((s=>!!s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t(),!0)))}),{rootMargin:`${s}px`}),this.intersectionObserver.observe(this.el)):t()}static get assetsDirs(){return["../../assets/icons"]}static get watchers(){return{icon:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}]}]);function Gt(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((t=>{"lmvz-icon"===t&&(customElements.get(n(t))||customElements.define(n(t),Kt))}))}export{Kt as L,Ht as c,Gt as d}
|
|
1
|
+
import{g as t,p as s,h as e,d as i,t as r}from"./p-BaPwpeMs.js";import{g as n,a,l as o,i as c,b as h,c as l,m,d as u,e as d,f as v,h as p,j as g,k as f,s as w,n as z,o as y,p as b,q as k,t as x,u as S,v as E,w as C,x as L,y as P,z as O,B as _,C as M,D as R,E as D,F as V,G as B,H as F,I,J as N,K as T,L as $,M as j,N as A,O as U,P as H,Q as K,S as G,T as J,U as W,V as q,W as Q,_ as X,X as Y,Y as Z,Z as tt,$ as st,a0 as et,a1 as it,a2 as rt,a3 as nt,a4 as at,a5 as ot,a6 as ct,a7 as ht,a8 as lt,a9 as mt,aa as ut,ab as dt,ac as vt,R as pt,A as gt,r as ft,ad as wt,ae as zt,af as yt}from"./p-BFwzIh71.js";const bt=Symbol.for("effect/Brand/Refined"),kt=(t,s,e,i)=>_({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),xt=(t,s)=>_({_tag:"Pending",key:t,deferred:s}),St=Symbol.for("effect/Cache/MapKey");class Et{current;[St]=St;previous=void 0;next=void 0;constructor(t){this.current=t}[A](){return U(G(this.current),K(G(this.previous)),K(G(this.next)),H(this))}[J](t){return this===t||Lt(t)&&q(this.current,t.current)&&q(this.previous,t.previous)&&q(this.next,t.next)}}const Ct=t=>new Et(t),Lt=t=>W(t,St);class Pt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const Ot=Symbol.for("effect/Cache"),_t={_Key:t=>t,_Error:t=>t,_Value:t=>t},Mt=Symbol.for("effect/ConsumerCache"),Rt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Dt=t=>({loadedMillis:t});class Vt{capacity;context;fiberId;lookup;timeToLive;[Ot]=_t;[Mt]=Rt;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:D(),keys:new Pt,accesses:j(),updating:$(!1),hits:0,misses:0}}get(t){return d(this.getEither(t),f)}get cacheStats(){return w((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:z(this.cacheState.map)})))}getOption(t){return y((()=>m(b(this.cacheState.map,t),{onNone:()=>{const s=Ct(t);return this.trackAccess(s),this.trackMiss(),k(x())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return y((()=>m(b(this.cacheState.map,t),{onNone:()=>{const s=Ct(t);return this.trackAccess(s),this.trackMiss(),k(x())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return w((()=>S(this.cacheState.map,t)))}entryStats(t){return w((()=>{const s=b(this.cacheState.map,t);if(E(s))switch(s.value._tag){case"Complete":return C(Dt(s.value.entryStats.loadedMillis));case"Pending":return x();case"Refreshing":return C(Dt(s.value.complete.entryStats.loadedMillis))}return x()}))}getEither(t){return y((()=>{const s=t;let e,i,r=L(b(this.cacheState.map,s));return void 0===r&&(i=P(this.fiberId),e=Ct(s),S(this.cacheState.map,s)?r=L(b(this.cacheState.map,s)):O(this.cacheState.map,s,xt(e,i))),void 0===r?(this.trackAccess(e),this.trackMiss(),d(this.lookupValueOf(t,i),a)):M(this.resolveMapValue(r),m({onNone:()=>this.getEither(t),onSome:t=>k(o(t))}))}))}invalidate(t){return w((()=>{R(this.cacheState.map,t)}))}invalidateWhen(t,s){return w((()=>{const e=b(this.cacheState.map,t);E(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&R(this.cacheState.map,t)}))}get invalidateAll(){return w((()=>{this.cacheState.map=D()}))}refresh(t){return V((s=>y((()=>{const e=t,i=P(this.fiberId);let r=L(b(this.cacheState.map,e));if(void 0===r&&(S(this.cacheState.map,e)?r=L(b(this.cacheState.map,e)):O(this.cacheState.map,e,xt(Ct(e),i))),void 0===r)return Q(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=L(b(this.cacheState.map,e));return q(s,r)&&R(this.cacheState.map,e),Q(this.get(t))}return U(this.lookupValueOf(t,i),Y((()=>{const t=L(b(this.cacheState.map,e));if(q(t,r)){const t=((t,s)=>_({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return O(this.cacheState.map,e,t),!0}return!1})),Q);case"Pending":case"Refreshing":return X(r.deferred)}}))))}set(t,s){return V((e=>w((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=Z(s),a=kt(Ct(r),n,Dt(i),i+tt(u(this.timeToLive(n))));O(this.cacheState.map,r,a)}))))}get size(){return w((()=>z(this.cacheState.map)))}get values(){return w((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return w((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return w((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return V((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(R(this.cacheState.map,t.key.current),k(x())):(this.trackHit(),d(t.exit,C));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?k(x()):d(X(t.deferred),C);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?k(x()):d(X(t.deferred),C):d(t.complete.exit,C)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(B(this.cacheState.accesses,t),F(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=I(this.cacheState.accesses,N);s===N?t=!1:this.cacheState.keys.add(s)}let s=z(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?S(this.cacheState.map,e.current)&&(R(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}T(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return V((e=>y((()=>{const i=t;return U(this.lookup(t),at(this.context),nt,M((t=>{const r=e.unsafeCurrentTimeMillis(),n=Dt(r),a=kt(Ct(i),t,n,r+tt(u(this.timeToLive(t))));return O(this.cacheState.map,i,a),et(rt(s,t),t)})),st((()=>et(it(s),w((()=>{R(this.cacheState.map,i)}))))))}))))}}const Bt=t=>{const s=u(t.timeToLive);return(t=>d(v([p(),g]),(([s,e])=>new Vt(t.capacity,s,e,t.lookup,(s=>u(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})},Ft=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends ot{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),It=t=>{const s={BaseEffectError:class extends Ft{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};class Nt extends(It("FetchError")){}class Tt extends(It("NotFoundError")){}class $t extends(It("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}It("URLCreationError");const jt=function(...t){const s=2===t.length?s=>t[0](s)?a(s):o(t[1](s)):s=>m(t[0](s),{onNone:()=>a(s),onSome:o});return Object.assign((t=>n(s(t),c)),{[bt]:bt,option:t=>l(s(t)),either:s,is:t=>h(s(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class At extends(It("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}let Ut=null;function Ht(){return ct((function*(){Ut?yield*Ut.invalidateAll:ut("Attempted to clear icon cache before it was initialized")}))}const Kt=s(class extends pt{intersectionObserver;get el(){return this}icon;weight="medium";size="md";iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(t){super(!1),!1!==t&&this.__registerHost(),this.addController(new gt(this))}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()}))}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}async loadIconPathData(){const{icon:s,visible:e}=this;s&&e&&(this.iconData=await ft(function(s){const e=s;return ct((function*(){return Ut||(Ut=yield*Bt({capacity:200,timeToLive:vt,lookup:s=>ct((function*(){const e=`../assets/icons/${s}.svg`,i=yield*(r=e,lt((()=>t([r].join("/").replace("//","/")))).pipe(mt((()=>ut(`Failed to create URL for icon "${r}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!\n Falling back to /assets/`))),dt((()=>window.location.origin+"/assets/"+r))));var r;const n=yield*(a=i,ct((function*(){const t=yield*ht({try:()=>fetch(a,void 0),catch:t=>new Nt({cause:t})});return 404===t.status?yield*new Tt({url:t.url}):t})));var a;const o=yield*(t=>ht({try:()=>t.text(),catch:t=>new $t(t)}))(n);return yield*(c=o,lt({try:()=>jt(c),catch:t=>new At(t,"SVGString")}));var c}))})),yield*Ut.get(e)}))}(this.icon).pipe(mt((t=>wt(`Error loading icon "${s}":`,t.message,t.cause,t.stack))),zt((()=>yt(jt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>')))))))}render(){return e(i,{key:"50d0f96ec5085a47ca7783e5232dfb503fa32d29",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(t,s=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((s=>{s.some((s=>!!s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t(),!0)))}),{rootMargin:`${s}px`}),this.intersectionObserver.observe(this.el)):t()}static get assetsDirs(){return["../../assets/icons"]}static get watchers(){return{icon:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}]}]);function Gt(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((t=>{"lmvz-icon"===t&&(customElements.get(r(t))||customElements.define(r(t),Kt))}))}export{Kt as L,Ht as c,Gt as d}
|
|
@@ -591,7 +591,7 @@ const responseAsText = (res) => tryPromise({
|
|
|
591
591
|
|
|
592
592
|
class URLCreationError extends TaggedError('URLCreationError') {
|
|
593
593
|
}
|
|
594
|
-
const
|
|
594
|
+
const createAssetUrlSafely = (file) => try_(() => getAssetPath([file].join('/').replace('//', '/'))).pipe(tapError(() => logWarning(`Failed to create URL for icon "${file}".
|
|
595
595
|
Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!
|
|
596
596
|
Falling back to /assets/`)), orElseSucceed(() => window.location.origin + '/assets/' + file));
|
|
597
597
|
|
|
@@ -625,7 +625,8 @@ const createIconCache = () => make({
|
|
|
625
625
|
timeToLive: infinity,
|
|
626
626
|
lookup: (key) => gen(function* () {
|
|
627
627
|
const name = key;
|
|
628
|
-
const
|
|
628
|
+
const icon = `../assets/icons/${name}.svg`;
|
|
629
|
+
const assetPath = yield* createAssetUrlSafely(icon);
|
|
629
630
|
const res = yield* httpClient(assetPath);
|
|
630
631
|
const responseString = yield* responseAsText(res);
|
|
631
632
|
return yield* createValidSVGString(responseString);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { g as getElement, r as registerInstance, h, H as Host } from './index-smGPjoDX.js';
|
|
2
2
|
import { r as runPromise, t as tapError, l as logError, c as catchAll, s as succeed } from './Effect-D9S7OTyY.js';
|
|
3
3
|
import { R as ReactiveControllerHost, A as AriaValidationController } from './aria-validation-controller-C7nQzCCq.js';
|
|
4
|
-
import { f as fetchIconSvg, e as emptyDefaultSvg } from './icons-
|
|
4
|
+
import { f as fetchIconSvg, e as emptyDefaultSvg } from './icons-AUbenGXq.js';
|
|
5
5
|
|
|
6
6
|
const lmvzIconCss = () => `.sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}`;
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as clearIconCache}from"./p-
|
|
1
|
+
export{c as clearIconCache}from"./p-CMnnKjsp.js";import{r as e}from"./p-D9S7OTyY.js";import"./p-smGPjoDX.js";const r=["primary","secondary","tertiary"],o=["small","default","large"],a=["xs","sm","md","lg"],t=[...a,"xl"],s=["text","email","password","tel","url","search","number"],n=[...a,"inherit"],l=["thin","medium","bold","filled"],i=["Logo","actions","adduser","alert","apple","arrow-down","arrow-left","arrow-right","arrow-up","book","bookmark","checkmark","chevron-down","chevron-left","chevron-right","chevron-up","close-l","close-sm","cog","computer","dashboard","delete","download","edit","external","facebook","favorite","filter","group","hide","home","info","instagram","letter","linkedin","logout","map","minus","navigation","plus","qr-scan","question","reader","reset","school","search","send","settings","share","shopping-cart","show","snapchat","sort","speech-bubble","star","student","upload","user","warn-circle","warn-triangle","whatsapp","world","x","youtube"];function d(r){return e(r).catch((e=>{console.error("Unhandled error in Effect:",e)}))}export{i as iconNames,n as iconSizes,l as iconWeights,s as inputTypes,d as run,o as scaleValues,a as sizes,t as textSizes,r as variants}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-smGPjoDX.js";export{s as setNonce}from"./p-smGPjoDX.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await t(),a([["p-f956a5e7",[[769,"lmvz-header",{role:[2561],lmvzActiveNav:[1,"lmvz-active-nav"]},null,{lmvzActiveNav:[{handleActiveNavChange:0}]}]]],["p-9faac8f3",[[257,"lmvz-action"]]],["p-a8c88454",[[785,"lmvz-button",{ti:[2562,"tabindex"],scale:[513],variant:[513],disabled:[516],type:[1],form:[1]}]]],["p-a4615e4b",[[774,"lmvz-card",{cardTitle:[1,"card-title"],imageUrl:[1,"image-url"],description:[1],primaryActionLabel:[1,"primary-action-label"]}]]],["p-d4b68381",[[513,"lmvz-chip",{text:[1]}]]],["p-e63e239a",[[838,"lmvz-input",{value:[1025],label:[1],helperText:[1,"helper-text"],placeholder:[1],disabled:[516],readonly:[516],required:[516],name:[1],type:[1],errorMessage:[1,"error-message"],autocomplete:[1],inputmode:[1],autocorrect:[1],autocapitalize:[1],spellcheck:[4],autofocus:[4],minlength:[2],maxlength:[2],pattern:[1],min:[8],max:[8],step:[8],form:[1],error:[6660],nativeError:[32],setValue:[64],focusInput:[64],blurInput:[64],select:[64],checkValidity:[64],reportValidity:[64],getInputElement:[64]},null,{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}]]],["p-fefd2fe4",[[774,"lmvz-menuitem",{role:[2561],ti:[2562,"tabindex"]}]]],["p-
|
|
1
|
+
import{p as e,b as a}from"./p-smGPjoDX.js";export{s as setNonce}from"./p-smGPjoDX.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await t(),a([["p-f956a5e7",[[769,"lmvz-header",{role:[2561],lmvzActiveNav:[1,"lmvz-active-nav"]},null,{lmvzActiveNav:[{handleActiveNavChange:0}]}]]],["p-9faac8f3",[[257,"lmvz-action"]]],["p-a8c88454",[[785,"lmvz-button",{ti:[2562,"tabindex"],scale:[513],variant:[513],disabled:[516],type:[1],form:[1]}]]],["p-a4615e4b",[[774,"lmvz-card",{cardTitle:[1,"card-title"],imageUrl:[1,"image-url"],description:[1],primaryActionLabel:[1,"primary-action-label"]}]]],["p-d4b68381",[[513,"lmvz-chip",{text:[1]}]]],["p-e63e239a",[[838,"lmvz-input",{value:[1025],label:[1],helperText:[1,"helper-text"],placeholder:[1],disabled:[516],readonly:[516],required:[516],name:[1],type:[1],errorMessage:[1,"error-message"],autocomplete:[1],inputmode:[1],autocorrect:[1],autocapitalize:[1],spellcheck:[4],autofocus:[4],minlength:[2],maxlength:[2],pattern:[1],min:[8],max:[8],step:[8],form:[1],error:[6660],nativeError:[32],setValue:[64],focusInput:[64],blurInput:[64],select:[64],checkValidity:[64],reportValidity:[64],getInputElement:[64]},null,{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}]]],["p-fefd2fe4",[[774,"lmvz-menuitem",{role:[2561],ti:[2562,"tabindex"]}]]],["p-b7f0a6fd",[[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},null,{icon:[{loadIconPathData:0}]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,a as s,b as e,i,d as r,e as n,m as a,f as o,h as c,j as h,k as u,n as l,o as d,p as f,q as v,u as p,v as m,w as g,x as y,y as w,z as S,A as x,B as b,C,D as E,E as k,F as _,G as O,H as R,I as P,J as L,K as V,L as j,M,N,O as T,P as A,Q as B,R as F,S as D,T as z,U as G,V as K,W as U,X as $,Y as H,_ as I,Z as J,$ as W,a0 as X,a1 as Y,a2 as q,a3 as Q,a4 as Z,a5 as tt,a6 as st,a7 as et,a8 as it,a9 as rt,aa as nt,t as at,ab as ot,ac as ct,ad as ht}from"./p-D9S7OTyY.js";import{a as ut}from"./p-smGPjoDX.js";const lt=Symbol.for("effect/Brand/Refined"),dt=(t,s,e,i)=>k({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),ft=(t,s)=>k({_tag:"Pending",key:t,deferred:s}),vt=Symbol.for("effect/Cache/MapKey");class pt{current;[vt]=vt;previous=void 0;next=void 0;constructor(t){this.current=t}[B](){return F(G(this.current),z(G(this.previous)),z(G(this.next)),D(this))}[K](t){return this===t||gt(t)&&$(this.current,t.current)&&$(this.previous,t.previous)&&$(this.next,t.next)}}const mt=t=>new pt(t),gt=t=>U(t,vt);class yt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const wt=Symbol.for("effect/Cache"),St={_Key:t=>t,_Error:t=>t,_Value:t=>t},xt=Symbol.for("effect/ConsumerCache"),bt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Ct=t=>({loadedMillis:t});class Et{capacity;context;fiberId;lookup;timeToLive;[wt]=St;[xt]=bt;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:R(),keys:new yt,accesses:A(),updating:T(!1),hits:0,misses:0}}get(t){return c(this.getEither(t),d)}get cacheStats(){return f((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:v(this.cacheState.map)})))}getOption(t){return p((()=>a(m(this.cacheState.map,t),{onNone:()=>{const s=mt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return p((()=>a(m(this.cacheState.map,t),{onNone:()=>{const s=mt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return f((()=>w(this.cacheState.map,t)))}entryStats(t){return f((()=>{const s=m(this.cacheState.map,t);if(S(s))switch(s.value._tag){case"Complete":return x(Ct(s.value.entryStats.loadedMillis));case"Pending":return y();case"Refreshing":return x(Ct(s.value.complete.entryStats.loadedMillis))}return y()}))}getEither(t){return p((()=>{const i=t;let r,n,o=b(m(this.cacheState.map,i));return void 0===o&&(n=C(this.fiberId),r=mt(i),w(this.cacheState.map,i)?o=b(m(this.cacheState.map,i)):E(this.cacheState.map,i,ft(r,n))),void 0===o?(this.trackAccess(r),this.trackMiss(),c(this.lookupValueOf(t,n),s)):_(this.resolveMapValue(o),a({onNone:()=>this.getEither(t),onSome:t=>g(e(t))}))}))}invalidate(t){return f((()=>{O(this.cacheState.map,t)}))}invalidateWhen(t,s){return f((()=>{const e=m(this.cacheState.map,t);S(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&O(this.cacheState.map,t)}))}get invalidateAll(){return f((()=>{this.cacheState.map=R()}))}refresh(t){return P((s=>p((()=>{const e=t,i=C(this.fiberId);let r=b(m(this.cacheState.map,e));if(void 0===r&&(w(this.cacheState.map,e)?r=b(m(this.cacheState.map,e)):E(this.cacheState.map,e,ft(mt(e),i))),void 0===r)return H(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=b(m(this.cacheState.map,e));return $(s,r)&&O(this.cacheState.map,e),H(this.get(t))}return F(this.lookupValueOf(t,i),J((()=>{const t=b(m(this.cacheState.map,e));if($(t,r)){const t=((t,s)=>k({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return E(this.cacheState.map,e,t),!0}return!1})),H);case"Pending":case"Refreshing":return I(r.deferred)}}))))}set(t,s){return P((e=>f((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=W(s),a=dt(mt(r),n,Ct(i),i+X(o(this.timeToLive(n))));E(this.cacheState.map,r,a)}))))}get size(){return f((()=>v(this.cacheState.map)))}get values(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return P((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(O(this.cacheState.map,t.key.current),g(y())):(this.trackHit(),c(t.exit,x));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?g(y()):c(I(t.deferred),x);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?g(y()):c(I(t.deferred),x):c(t.complete.exit,x)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(L(this.cacheState.accesses,t),V(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=j(this.cacheState.accesses,M);s===M?t=!1:this.cacheState.keys.add(s)}let s=v(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?w(this.cacheState.map,e.current)&&(O(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}N(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return P((e=>p((()=>{const i=t;return F(this.lookup(t),st(this.context),tt,_((t=>{const r=e.unsafeCurrentTimeMillis(),n=Ct(r),a=dt(mt(i),t,n,r+X(o(this.timeToLive(t))));return E(this.cacheState.map,i,a),q(Z(s,t),t)})),Y((()=>q(Q(s),f((()=>{O(this.cacheState.map,i)}))))))}))))}}const kt=t=>{const s=o(t.timeToLive);return(t=>c(h([u(),l]),(([s,e])=>new Et(t.capacity,s,e,t.lookup,(s=>o(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})},_t=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends et{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),Ot=t=>{const s={BaseEffectError:class extends _t{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};class Rt extends(Ot("FetchError")){}class Pt extends(Ot("NotFoundError")){}class Lt extends(Ot("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}Ot("URLCreationError");const Vt=function(...o){const c=2===o.length?t=>o[0](t)?s(t):e(o[1](t)):t=>a(o[0](t),{onNone:()=>s(t),onSome:e});return Object.assign((s=>t(c(s),i)),{[lt]:lt,option:t=>n(c(t)),either:c,is:t=>r(c(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class jt extends(Ot("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}const Mt=()=>Vt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>');let Nt=null;function Tt(t){const s=t;return it((function*(){return Nt||(Nt=yield*kt({capacity:200,timeToLive:ht,lookup:t=>it((function*(){const s=`../assets/icons/${t}.svg`,e=yield*(i=s,nt((()=>ut([i].join("/").replace("//","/")))).pipe(at((()=>ot(`Failed to create URL for icon "${i}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!\n Falling back to /assets/`))),ct((()=>window.location.origin+"/assets/"+i))));var i;const r=yield*(n=e,it((function*(){const t=yield*rt({try:()=>fetch(n,void 0),catch:t=>new Rt({cause:t})});return 404===t.status?yield*new Pt({url:t.url}):t})));var n;const a=yield*(t=>rt({try:()=>t.text(),catch:t=>new Lt(t)}))(r);return yield*(o=a,nt({try:()=>Vt(o),catch:t=>new jt(t,"SVGString")}));var o}))})),yield*Nt.get(s)}))}function At(){return it((function*(){Nt?yield*Nt.invalidateAll:ot("Attempted to clear icon cache before it was initialized")}))}export{At as c,Mt as e,Tt as f}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as i,r as e,h as s,H as t}from"./p-smGPjoDX.js";import{r,t as o,l as n,c as m,s as c}from"./p-D9S7OTyY.js";import{R as a,A as l}from"./p-DlrjrWsu.js";import{f as h,e as v}from"./p-
|
|
1
|
+
import{g as i,r as e,h as s,H as t}from"./p-smGPjoDX.js";import{r,t as o,l as n,c as m,s as c}from"./p-D9S7OTyY.js";import{R as a,A as l}from"./p-DlrjrWsu.js";import{f as h,e as v}from"./p-CMnnKjsp.js";const p=class extends a{intersectionObserver;get el(){return i(this)}icon;weight="medium";size="md";iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(i){super(),e(this,i),this.addController(new l(this))}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()}))}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}async loadIconPathData(){const{icon:i,visible:e}=this;i&&e&&(this.iconData=await r(h(this.icon).pipe(o((e=>n(`Error loading icon "${i}":`,e.message,e.cause,e.stack))),m((()=>c(v()))))))}render(){return s(t,{key:"50d0f96ec5085a47ca7783e5232dfb503fa32d29",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(i,e=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((e=>{e.some((e=>!!e.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,i(),!0)))}),{rootMargin:`${e}px`}),this.intersectionObserver.observe(this.el)):i()}static get assetsDirs(){return["../../assets/icons"]}static get watchers(){return{icon:[{loadIconPathData:0}]}}};p.style=".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}";export{p as lmvz_icon}
|
package/dist/manifest.json
CHANGED
|
@@ -4,5 +4,5 @@ declare const URLCreationError_base: new <A extends Record<string, any> = {}>(ar
|
|
|
4
4
|
} & Readonly<A>;
|
|
5
5
|
export declare class URLCreationError extends URLCreationError_base<Error> {
|
|
6
6
|
}
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const createAssetUrlSafely: (file: string) => Effect.Effect<string, never, never>;
|
|
8
8
|
export {};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@lmvz-ds/components",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.12.
|
|
5
|
+
"version": "0.12.3-alpha.3+fbf08b5",
|
|
6
6
|
"description": "The components of the design system",
|
|
7
7
|
"author": "Patrick Nemenz <patrick.nemenz@adesso.at>",
|
|
8
8
|
"volta": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"types": "./dist/components/lmvz-menuitem.d.ts"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"main": "dist/
|
|
100
|
+
"main": "dist/index.cjs.js",
|
|
101
101
|
"module": "dist/components/index.js",
|
|
102
102
|
"unpkg": "dist/my-design-system/my-design-system.esm.js",
|
|
103
103
|
"types": "dist/components/index.d.ts",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"effect": "3.19.14"
|
|
188
188
|
},
|
|
189
189
|
"devDependencies": {
|
|
190
|
-
"@lmvz-ds/design-tokens": "^0.12.
|
|
190
|
+
"@lmvz-ds/design-tokens": "^0.12.3-alpha.3+fbf08b5",
|
|
191
191
|
"@playwright/test": "^1.55.0",
|
|
192
192
|
"@stencil-community/postcss": "^2.2.0",
|
|
193
193
|
"@stencil/angular-output-target": "1.3.0",
|
|
@@ -212,5 +212,5 @@
|
|
|
212
212
|
"tsx": "^4.21.0",
|
|
213
213
|
"vite": "^7.3.1"
|
|
214
214
|
},
|
|
215
|
-
"gitHead": "
|
|
215
|
+
"gitHead": "fbf08b52251c378e00c54ee2dfae0034fb5ec050"
|
|
216
216
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,a as s,b as e,i,d as r,e as n,m as a,f as o,h as c,j as h,k as u,n as l,o as d,p as f,q as v,u as p,v as m,w as g,x as y,y as w,z as S,A as x,B as b,C,D as E,E as k,F as _,G as O,H as R,I as P,J as L,K as V,L as j,M as B,N as M,O as N,P as T,Q as A,R as F,S as D,T as z,U as G,V as K,W as U,X as $,Y as H,_ as I,Z as J,$ as W,a0 as X,a1 as Y,a2 as q,a3 as Q,a4 as Z,a5 as tt,a6 as st,a7 as et,a8 as it,a9 as rt,aa as nt,t as at,ab as ot,ac as ct,ad as ht}from"./p-D9S7OTyY.js";import{a as ut}from"./p-smGPjoDX.js";const lt=Symbol.for("effect/Brand/Refined"),dt=(t,s,e,i)=>k({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),ft=(t,s)=>k({_tag:"Pending",key:t,deferred:s}),vt=Symbol.for("effect/Cache/MapKey");class pt{current;[vt]=vt;previous=void 0;next=void 0;constructor(t){this.current=t}[A](){return F(G(this.current),z(G(this.previous)),z(G(this.next)),D(this))}[K](t){return this===t||gt(t)&&$(this.current,t.current)&&$(this.previous,t.previous)&&$(this.next,t.next)}}const mt=t=>new pt(t),gt=t=>U(t,vt);class yt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const wt=Symbol.for("effect/Cache"),St={_Key:t=>t,_Error:t=>t,_Value:t=>t},xt=Symbol.for("effect/ConsumerCache"),bt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Ct=t=>({loadedMillis:t});class Et{capacity;context;fiberId;lookup;timeToLive;[wt]=St;[xt]=bt;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:R(),keys:new yt,accesses:T(),updating:N(!1),hits:0,misses:0}}get(t){return c(this.getEither(t),d)}get cacheStats(){return f((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:v(this.cacheState.map)})))}getOption(t){return p((()=>a(m(this.cacheState.map,t),{onNone:()=>{const s=mt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return p((()=>a(m(this.cacheState.map,t),{onNone:()=>{const s=mt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return f((()=>w(this.cacheState.map,t)))}entryStats(t){return f((()=>{const s=m(this.cacheState.map,t);if(S(s))switch(s.value._tag){case"Complete":return x(Ct(s.value.entryStats.loadedMillis));case"Pending":return y();case"Refreshing":return x(Ct(s.value.complete.entryStats.loadedMillis))}return y()}))}getEither(t){return p((()=>{const i=t;let r,n,o=b(m(this.cacheState.map,i));return void 0===o&&(n=C(this.fiberId),r=mt(i),w(this.cacheState.map,i)?o=b(m(this.cacheState.map,i)):E(this.cacheState.map,i,ft(r,n))),void 0===o?(this.trackAccess(r),this.trackMiss(),c(this.lookupValueOf(t,n),s)):_(this.resolveMapValue(o),a({onNone:()=>this.getEither(t),onSome:t=>g(e(t))}))}))}invalidate(t){return f((()=>{O(this.cacheState.map,t)}))}invalidateWhen(t,s){return f((()=>{const e=m(this.cacheState.map,t);S(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&O(this.cacheState.map,t)}))}get invalidateAll(){return f((()=>{this.cacheState.map=R()}))}refresh(t){return P((s=>p((()=>{const e=t,i=C(this.fiberId);let r=b(m(this.cacheState.map,e));if(void 0===r&&(w(this.cacheState.map,e)?r=b(m(this.cacheState.map,e)):E(this.cacheState.map,e,ft(mt(e),i))),void 0===r)return H(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=b(m(this.cacheState.map,e));return $(s,r)&&O(this.cacheState.map,e),H(this.get(t))}return F(this.lookupValueOf(t,i),J((()=>{const t=b(m(this.cacheState.map,e));if($(t,r)){const t=((t,s)=>k({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return E(this.cacheState.map,e,t),!0}return!1})),H);case"Pending":case"Refreshing":return I(r.deferred)}}))))}set(t,s){return P((e=>f((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=W(s),a=dt(mt(r),n,Ct(i),i+X(o(this.timeToLive(n))));E(this.cacheState.map,r,a)}))))}get size(){return f((()=>v(this.cacheState.map)))}get values(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return P((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(O(this.cacheState.map,t.key.current),g(y())):(this.trackHit(),c(t.exit,x));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?g(y()):c(I(t.deferred),x);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?g(y()):c(I(t.deferred),x):c(t.complete.exit,x)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(L(this.cacheState.accesses,t),V(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=j(this.cacheState.accesses,B);s===B?t=!1:this.cacheState.keys.add(s)}let s=v(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?w(this.cacheState.map,e.current)&&(O(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}M(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return P((e=>p((()=>{const i=t;return F(this.lookup(t),st(this.context),tt,_((t=>{const r=e.unsafeCurrentTimeMillis(),n=Ct(r),a=dt(mt(i),t,n,r+X(o(this.timeToLive(t))));return E(this.cacheState.map,i,a),q(Z(s,t),t)})),Y((()=>q(Q(s),f((()=>{O(this.cacheState.map,i)}))))))}))))}}const kt=t=>{const s=o(t.timeToLive);return(t=>c(h([u(),l]),(([s,e])=>new Et(t.capacity,s,e,t.lookup,(s=>o(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})},_t=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends et{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),Ot=t=>{const s={BaseEffectError:class extends _t{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};class Rt extends(Ot("FetchError")){}class Pt extends(Ot("NotFoundError")){}class Lt extends(Ot("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}Ot("URLCreationError");const Vt=function(...o){const c=2===o.length?t=>o[0](t)?s(t):e(o[1](t)):t=>a(o[0](t),{onNone:()=>s(t),onSome:e});return Object.assign((s=>t(c(s),i)),{[lt]:lt,option:t=>n(c(t)),either:c,is:t=>r(c(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class jt extends(Ot("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}const Bt=()=>Vt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>');let Mt=null;function Nt(t){const s=t;return it((function*(){return Mt||(Mt=yield*kt({capacity:200,timeToLive:ht,lookup:t=>it((function*(){const s=t,e=yield*(i=`./icons/${s}.svg`,nt((()=>ut(["/assets",i].filter(Boolean).join("/").replace("//","/")))).pipe(at((()=>ot(`Failed to create URL for icon "${i}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration!\n Falling back to /assets/`))),ct((()=>window.location.origin+"/assets/"+i))));var i;const r=yield*(n=e,it((function*(){const t=yield*rt({try:()=>fetch(n,void 0),catch:t=>new Rt({cause:t})});return 404===t.status?yield*new Pt({url:t.url}):t})));var n;const a=yield*(t=>rt({try:()=>t.text(),catch:t=>new Lt(t)}))(r);return yield*(o=a,nt({try:()=>Vt(o),catch:t=>new jt(t,"SVGString")}));var o}))})),yield*Mt.get(s)}))}function Tt(){return it((function*(){Mt?yield*Mt.invalidateAll:ot("Attempted to clear icon cache before it was initialized")}))}export{Tt as c,Bt as e,Nt as f}
|