@wcstack/contacts 4.11.0 → 4.11.2
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/auto.min.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/auto.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t={tagNames:{contacts:"wcs-contacts"}};var e="@wcstack/contacts",i="4.11.0";class n{laneKey;policy;_ownerGeneration=0;_latestEpoch=0;_nextOperationId=1;_activeOperationId=void 0;_activeOperationIds=new Set;_queue=[];_inFlightCount=0;_terminal=new Map;_claimedOutcome=new Map;_controllers=new Map;_attempts=new Map;_withSignal;_trace;constructor(t,e,i={}){this.laneKey=t,this.policy=e,this._withSignal=i.withSignal??!1,this._trace=i.trace}get ownerGeneration(){return this._ownerGeneration}get inFlightCount(){return this._inFlightCount}get latestEpoch(){return this._latestEpoch}get activeOperationId(){return this._activeOperationId}begin(){let t;switch(this.policy){case"latest":t=++this._latestEpoch,void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);break;case"exhaust":if(void 0!==this._activeOperationId)return null}const e=this._nextOperationId++,i={operationId:e,ownerGeneration:this._ownerGeneration,laneKey:this.laneKey,policy:this.policy,supersedeEpoch:t};switch(this.policy){case"latest":case"exhaust":this._activeOperationId=e;break;case"queue":this._queue.push(i),void 0===this._activeOperationId&&(this._activeOperationId=e);break;case"overlap":this._activeOperationIds.add(e)}this._inFlightCount+=1,this._attempts.set(e,1);const n=this._makeAttempt(e,1);return void 0!==this._trace&&this._trace({type:"io:operation-started",operationId:e,laneKey:this.laneKey,policy:this.policy}),{ticket:i,attempt:n}}retry(t){if(t.ownerGeneration!==this._ownerGeneration)return null;if(this._terminal.has(t.operationId))return null;const e=this._attempts.get(t.operationId);if(void 0===e)return null;const i=e+1;this._attempts.set(t.operationId,i),this._releaseController(t.operationId);const n=this._makeAttempt(t.operationId,i);return void 0!==this._trace&&this._trace({type:"io:operation-retried",operationId:t.operationId,laneKey:this.laneKey,attempt:i}),n}canCommit(t){if(t.ownerGeneration!==this._ownerGeneration)return!1;const e=this._terminal.get(t.operationId);return(void 0===e||"committing"===e)&&this._isEligible(t)}claimTerminal(t,e){return t.ownerGeneration===this._ownerGeneration&&(!this._terminal.has(t.operationId)&&(!!this._isEligible(t)&&(this._terminal.set(t.operationId,"committing"),this._claimedOutcome.set(t.operationId,e),!0)))}claimedOutcome(t){return this._claimedOutcome.get(t.operationId)}finalize(t){const e=t.operationId,i=this._terminal.get(e);if(void 0!==i&&"committing"!==i)return;let n;n="committing"===i?this._claimedOutcome.get(e)??"stale":"stale",this._terminal.set(e,n),this._claimedOutcome.delete(e),this._releaseController(e),this._attempts.delete(e),this._inFlightCount>0&&(this._inFlightCount-=1),this._advanceBookkeeping(e),void 0!==this._trace&&("stale"===n?this._trace({type:"io:stale-dropped",operationId:e,laneKey:this.laneKey}):this._trace({type:"io:operation-settled",operationId:e,laneKey:this.laneKey,outcome:n}))}signalOf(t){return this._controllers.get(t.operationId)?.signal}abort(t){this._abortController(t.operationId)}abortActive(){void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);for(const t of this._activeOperationIds)this._abortController(t)}disposeOwner(){this._ownerGeneration+=1;for(const t of Array.from(this._controllers.keys()))this._abortController(t),this._releaseController(t);for(const t of Array.from(this._attempts.keys()))this._terminal.has(t)||this._terminal.set(t,"stale"),this._claimedOutcome.delete(t),this._attempts.delete(t),void 0!==this._trace&&this._trace({type:"io:stale-dropped",operationId:t,laneKey:this.laneKey});this._activeOperationId=void 0,this._activeOperationIds.clear(),this._queue.length=0,this._inFlightCount=0}_makeAttempt(t,e){let i;if(this._withSignal&&"function"==typeof AbortController){const e=new AbortController;this._controllers.set(t,e),i=e.signal}return{operationId:t,attempt:e,signal:i}}_isEligible(t){switch(this.policy){case"latest":return t.supersedeEpoch===this._latestEpoch;case"queue":case"exhaust":return this._activeOperationId===t.operationId;case"overlap":return this._activeOperationIds.has(t.operationId)}}_advanceBookkeeping(t){switch(this.policy){case"latest":case"exhaust":this._activeOperationId===t&&(this._activeOperationId=void 0);break;case"queue":{const e=this._queue.filter(e=>e.operationId!==t);this._queue.length=0,this._queue.push(...e),this._activeOperationId=this._queue.length>0?this._queue[0].operationId:void 0;break}case"overlap":this._activeOperationIds.delete(t)}}_abortController(t){const e=this._controllers.get(t);void 0===e||e.signal.aborted||e.abort()}_releaseController(t){this._controllers.delete(t)}}function s(t,e){const i=new Map,n=e=>{const i=t.get(e);return void 0===i?"unknown":i.probe()?"available":"missing"};let s=!0;for(const t of e.required){const e=n(t);i.set(t,e),"available"!==e&&(s=!1)}let o=!0;for(const t of e.optional??[]){const e=n(t);i.set(t,e),"available"!==e&&(o=!1)}const r=s?o?"ready":"degraded":"idle",a=[...e.required,...e.optional??[]],c=a.some(e=>!0===t.get(e)?.requiresSecureContext),l=a.some(e=>!0===t.get(e)?.requiresUserActivation),h=c?!0===globalThis.isSecureContext?"satisfied":"required":"not-applicable",d=l?"required":"not-applicable";return{availability:i,permission:e.permission??"not-applicable",readiness:r,activity:e.activity??"inactive",preconditions:{secureContext:h,userActivation:d},epoch:e.epoch??0,lastError:e.lastError}}function o(t,e){return e.every(e=>"available"===t.availability.get(e))}const r="capability-missing",a="select-failed",c=new Map([["web.contacts",{probe:()=>"function"==typeof globalThis.navigator?.contacts?.select,compatKey:"api.ContactsManager.select"}]]);class l extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"value",event:"wcs-contacts:complete",semantics:"state",getter:t=>t.detail.value},{name:"loading",event:"wcs-contacts:loading-changed",semantics:"state"},{name:"error",event:"wcs-contacts:error",semantics:"state"},{name:"cancelled",event:"wcs-contacts:cancelled-changed",semantics:"state"},{name:"errorInfo",event:"wcs-contacts:error-info-changed",semantics:"state"}],commands:[{name:"select",async:!0}]};static REQUIRED_CAPABILITIES=["web.contacts"];_target;_value=null;_loading=!1;_error=null;_cancelled=!1;_errorInfo=null;_lane=new n("contacts","exhaust",{withSignal:!1});_ready=Promise.resolve();constructor(t){super(),this._target=t??this}get ready(){return this._ready}get value(){return this._value}get loading(){return this._loading}get error(){return this._error}get cancelled(){return this._cancelled}get errorInfo(){return this._errorInfo}get supported(){return o(this.platformAssessment,l.REQUIRED_CAPABILITIES)}get platformAssessment(){return s(c,{required:l.REQUIRED_CAPABILITIES,activity:this._loading?"active":"inactive",lastError:this._errorInfo??void 0})}observe(){return this._ready}dispose(){this._lane.disposeOwner(),this._setLoading(!1)}_setLoading(t){this._loading!==t&&(this._loading=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:loading-changed",{detail:t,bubbles:!0})))}_setValue(t){this._value!==t&&(this._value=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:complete",{detail:{value:t},bubbles:!0})))}_setError(t){this._error!==t&&(this._error=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:error",{detail:t,bubbles:!0})))}_setCancelled(t){this._cancelled!==t&&(this._cancelled=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:cancelled-changed",{detail:t,bubbles:!0})))}_setErrorInfo(t,e,i,n,s){this._commitErrorInfo({code:t,phase:e,recoverable:i,message:n,...void 0===s?{}:{capabilityId:s}})}_commitErrorInfo(t){this._errorInfo!==t&&(this._errorInfo=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:error-info-changed",{detail:t,bubbles:!0})))}async select(t,e){const i=this.platformAssessment;if(!o(i,l.REQUIRED_CAPABILITIES)){const t=l.REQUIRED_CAPABILITIES.find(t=>"available"!==i.availability.get(t)),e="Contact Picker API is not supported in this browser.";return this._setErrorInfo(r,"start",!1,e,t),this._setError({message:e}),null}const n=this._lane.begin();if(null===n)return null;const{ticket:s}=n,c=globalThis.navigator,h=c.contacts.select.bind(c.contacts);this._setLoading(!0),this._commitErrorInfo(null),this._setError(null),this._setCancelled(!1);try{const i=await h(t,e);return this._lane.claimTerminal(s,"success")?(this._setValue(i),this._setLoading(!1),this._lane.finalize(s),i):null}catch(t){const e="AbortError"===t?.name;if(!this._lane.claimTerminal(s,e?"aborted":"error"))return null;if(e)this._setCancelled(!0);else{const e=String(t?.message??"Contact selection failed.");this._setErrorInfo(a,"execute",!0,e),this._setError(t??{message:e})}return this._setLoading(!1),this._lane.finalize(s),null}}}function h(t,e){let i=Object.getPrototypeOf(t);for(;null!==i;){const t=Object.getOwnPropertyDescriptor(i,e);if(void 0!==t)return"function"==typeof t.get||"function"==typeof t.set;i=Object.getPrototypeOf(i)}return!1}const d=new WeakSet;function u(t,e,i){if(d.has(t))return;d.add(t);const n=t.localName??"element";console.warn(`[wcs/input-as-attribute] <${n}> has the attribute ${e}="${i}": an object was written as an attribute, so the element did not receive it. A framework does that when the property is set before the element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, or assign the property through a ref (Vue: .prop). (Said once per element.)`,t)}class _ extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...l.wcBindable,inputs:[],commands:l.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new l(this),this._internals=this._initInternals(),this._wireStates({"wcs-contacts:loading-changed":t=>({loading:!0===t}),"wcs-contacts:cancelled-changed":t=>({cancelled:!0===t}),"wcs-contacts:error":t=>({error:null!=t})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const t=this.attachInternals();return t.states.add("wcs-probe"),t.states.delete("wcs-probe"),t}catch{return null}}_wireStates(t){if(null===this._internals)return;const e=this._internals.states;for(const[i,n]of Object.entries(t))this.addEventListener(i,t=>{const i=this.hasAttribute("debug-states");for(const[s,o]of Object.entries(n(t.detail))){try{o?e.add(s):e.delete(s)}catch{}i&&this.toggleAttribute(`data-wcs-state-${s}`,o)}})}get value(){return this._core.value}get loading(){return this._core.loading}get error(){return this._core.error}get cancelled(){return this._core.cancelled}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}select(t,e){return this._core.select(t,e)}connectedCallback(){!function(t){const e=t.constructor?.wcBindable,i=e?.inputs;if(void 0===i)return;const n=t.getAttribute;for(const e of i){const i=e.name,s="function"==typeof n?n.call(t,i.toLowerCase()):null;if(null!==s&&s.startsWith("[object ")&&u(t,i,s),!Object.prototype.hasOwnProperty.call(t,i))continue;if(!h(t,i))continue;const o=t,r=o[i];delete o[i],o[i]=r}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}const p=Symbol.for("wcstack.package"),g=new WeakSet;function m(t,e){Object.defineProperty(t,p,{value:e,configurable:!0})}function v(t,e,i,n,s){if(void 0!==n&&(i===n||i.prototype instanceof n))return;const o=i[p];if(o===s||g.has(t))return;g.add(t);const r=s.slice(0,s.lastIndexOf("@"));console.warn(`[${r}] [wcs/package-twice] <${e}> is already defined by ${o??`another copy of ${r} that does not name its version`}; this copy, ${s}, does nothing. Load each package once.`)}function f(n=customElements){!function(t,e,i){for(const[n,s]of i){const i=t.get(n);void 0===i?(m(s,e),t.define(n,s)):v(t,n,i,s,e)}}(n,`${e}@${i}`,[[t.tagNames.contacts,_]])}var b;f(b);
|
|
1
|
+
const t={tagNames:{contacts:"wcs-contacts"}};var e="@wcstack/contacts",i="4.11.2";class n{laneKey;policy;_ownerGeneration=0;_latestEpoch=0;_nextOperationId=1;_activeOperationId=void 0;_activeOperationIds=new Set;_queue=[];_inFlightCount=0;_terminal=new Map;_claimedOutcome=new Map;_controllers=new Map;_attempts=new Map;_withSignal;_trace;constructor(t,e,i={}){this.laneKey=t,this.policy=e,this._withSignal=i.withSignal??!1,this._trace=i.trace}get ownerGeneration(){return this._ownerGeneration}get inFlightCount(){return this._inFlightCount}get latestEpoch(){return this._latestEpoch}get activeOperationId(){return this._activeOperationId}begin(){let t;switch(this.policy){case"latest":t=++this._latestEpoch,void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);break;case"exhaust":if(void 0!==this._activeOperationId)return null}const e=this._nextOperationId++,i={operationId:e,ownerGeneration:this._ownerGeneration,laneKey:this.laneKey,policy:this.policy,supersedeEpoch:t};switch(this.policy){case"latest":case"exhaust":this._activeOperationId=e;break;case"queue":this._queue.push(i),void 0===this._activeOperationId&&(this._activeOperationId=e);break;case"overlap":this._activeOperationIds.add(e)}this._inFlightCount+=1,this._attempts.set(e,1);const n=this._makeAttempt(e,1);return void 0!==this._trace&&this._trace({type:"io:operation-started",operationId:e,laneKey:this.laneKey,policy:this.policy}),{ticket:i,attempt:n}}retry(t){if(t.ownerGeneration!==this._ownerGeneration)return null;if(this._terminal.has(t.operationId))return null;const e=this._attempts.get(t.operationId);if(void 0===e)return null;const i=e+1;this._attempts.set(t.operationId,i),this._releaseController(t.operationId);const n=this._makeAttempt(t.operationId,i);return void 0!==this._trace&&this._trace({type:"io:operation-retried",operationId:t.operationId,laneKey:this.laneKey,attempt:i}),n}canCommit(t){if(t.ownerGeneration!==this._ownerGeneration)return!1;const e=this._terminal.get(t.operationId);return(void 0===e||"committing"===e)&&this._isEligible(t)}claimTerminal(t,e){return t.ownerGeneration===this._ownerGeneration&&(!this._terminal.has(t.operationId)&&(!!this._isEligible(t)&&(this._terminal.set(t.operationId,"committing"),this._claimedOutcome.set(t.operationId,e),!0)))}claimedOutcome(t){return this._claimedOutcome.get(t.operationId)}finalize(t){const e=t.operationId,i=this._terminal.get(e);if(void 0!==i&&"committing"!==i)return;let n;n="committing"===i?this._claimedOutcome.get(e)??"stale":"stale",this._terminal.set(e,n),this._claimedOutcome.delete(e),this._releaseController(e),this._attempts.delete(e),this._inFlightCount>0&&(this._inFlightCount-=1),this._advanceBookkeeping(e),void 0!==this._trace&&("stale"===n?this._trace({type:"io:stale-dropped",operationId:e,laneKey:this.laneKey}):this._trace({type:"io:operation-settled",operationId:e,laneKey:this.laneKey,outcome:n}))}signalOf(t){return this._controllers.get(t.operationId)?.signal}abort(t){this._abortController(t.operationId)}abortActive(){void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);for(const t of this._activeOperationIds)this._abortController(t)}disposeOwner(){this._ownerGeneration+=1;for(const t of Array.from(this._controllers.keys()))this._abortController(t),this._releaseController(t);for(const t of Array.from(this._attempts.keys()))this._terminal.has(t)||this._terminal.set(t,"stale"),this._claimedOutcome.delete(t),this._attempts.delete(t),void 0!==this._trace&&this._trace({type:"io:stale-dropped",operationId:t,laneKey:this.laneKey});this._activeOperationId=void 0,this._activeOperationIds.clear(),this._queue.length=0,this._inFlightCount=0}_makeAttempt(t,e){let i;if(this._withSignal&&"function"==typeof AbortController){const e=new AbortController;this._controllers.set(t,e),i=e.signal}return{operationId:t,attempt:e,signal:i}}_isEligible(t){switch(this.policy){case"latest":return t.supersedeEpoch===this._latestEpoch;case"queue":case"exhaust":return this._activeOperationId===t.operationId;case"overlap":return this._activeOperationIds.has(t.operationId)}}_advanceBookkeeping(t){switch(this.policy){case"latest":case"exhaust":this._activeOperationId===t&&(this._activeOperationId=void 0);break;case"queue":{const e=this._queue.filter(e=>e.operationId!==t);this._queue.length=0,this._queue.push(...e),this._activeOperationId=this._queue.length>0?this._queue[0].operationId:void 0;break}case"overlap":this._activeOperationIds.delete(t)}}_abortController(t){const e=this._controllers.get(t);void 0===e||e.signal.aborted||e.abort()}_releaseController(t){this._controllers.delete(t)}}function s(t,e){const i=new Map,n=e=>{const i=t.get(e);return void 0===i?"unknown":i.probe()?"available":"missing"};let s=!0;for(const t of e.required){const e=n(t);i.set(t,e),"available"!==e&&(s=!1)}let o=!0;for(const t of e.optional??[]){const e=n(t);i.set(t,e),"available"!==e&&(o=!1)}const r=s?o?"ready":"degraded":"idle",a=[...e.required,...e.optional??[]],c=a.some(e=>!0===t.get(e)?.requiresSecureContext),l=a.some(e=>!0===t.get(e)?.requiresUserActivation),h=c?!0===globalThis.isSecureContext?"satisfied":"required":"not-applicable",d=l?"required":"not-applicable";return{availability:i,permission:e.permission??"not-applicable",readiness:r,activity:e.activity??"inactive",preconditions:{secureContext:h,userActivation:d},epoch:e.epoch??0,lastError:e.lastError}}function o(t,e){return e.every(e=>"available"===t.availability.get(e))}const r="capability-missing",a="select-failed",c=new Map([["web.contacts",{probe:()=>"function"==typeof globalThis.navigator?.contacts?.select,compatKey:"api.ContactsManager.select"}]]);class l extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"value",event:"wcs-contacts:complete",semantics:"state",getter:t=>t.detail.value},{name:"loading",event:"wcs-contacts:loading-changed",semantics:"state"},{name:"error",event:"wcs-contacts:error",semantics:"state"},{name:"cancelled",event:"wcs-contacts:cancelled-changed",semantics:"state"},{name:"errorInfo",event:"wcs-contacts:error-info-changed",semantics:"state"}],commands:[{name:"select",async:!0}]};static REQUIRED_CAPABILITIES=["web.contacts"];_target;_value=null;_loading=!1;_error=null;_cancelled=!1;_errorInfo=null;_lane=new n("contacts","exhaust",{withSignal:!1});_ready=Promise.resolve();constructor(t){super(),this._target=t??this}get ready(){return this._ready}get value(){return this._value}get loading(){return this._loading}get error(){return this._error}get cancelled(){return this._cancelled}get errorInfo(){return this._errorInfo}get supported(){return o(this.platformAssessment,l.REQUIRED_CAPABILITIES)}get platformAssessment(){return s(c,{required:l.REQUIRED_CAPABILITIES,activity:this._loading?"active":"inactive",lastError:this._errorInfo??void 0})}observe(){return this._ready}dispose(){this._lane.disposeOwner(),this._setLoading(!1)}_setLoading(t){this._loading!==t&&(this._loading=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:loading-changed",{detail:t,bubbles:!0})))}_setValue(t){this._value!==t&&(this._value=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:complete",{detail:{value:t},bubbles:!0})))}_setError(t){this._error!==t&&(this._error=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:error",{detail:t,bubbles:!0})))}_setCancelled(t){this._cancelled!==t&&(this._cancelled=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:cancelled-changed",{detail:t,bubbles:!0})))}_setErrorInfo(t,e,i,n,s){this._commitErrorInfo({code:t,phase:e,recoverable:i,message:n,...void 0===s?{}:{capabilityId:s}})}_commitErrorInfo(t){this._errorInfo!==t&&(this._errorInfo=t,this._target.dispatchEvent(new CustomEvent("wcs-contacts:error-info-changed",{detail:t,bubbles:!0})))}async select(t,e){const i=this.platformAssessment;if(!o(i,l.REQUIRED_CAPABILITIES)){const t=l.REQUIRED_CAPABILITIES.find(t=>"available"!==i.availability.get(t)),e="Contact Picker API is not supported in this browser.";return this._setErrorInfo(r,"start",!1,e,t),this._setError({message:e}),null}const n=this._lane.begin();if(null===n)return null;const{ticket:s}=n,c=globalThis.navigator,h=c.contacts.select.bind(c.contacts);this._setLoading(!0),this._commitErrorInfo(null),this._setError(null),this._setCancelled(!1);try{const i=await h(t,e);return this._lane.claimTerminal(s,"success")?(this._setValue(i),this._setLoading(!1),this._lane.finalize(s),i):null}catch(t){const e="AbortError"===t?.name;if(!this._lane.claimTerminal(s,e?"aborted":"error"))return null;if(e)this._setCancelled(!0);else{const e=String(t?.message??"Contact selection failed.");this._setErrorInfo(a,"execute",!0,e),this._setError(t??{message:e})}return this._setLoading(!1),this._lane.finalize(s),null}}}function h(t,e){let i=Object.getPrototypeOf(t);for(;null!==i;){const t=Object.getOwnPropertyDescriptor(i,e);if(void 0!==t)return"function"==typeof t.get||"function"==typeof t.set;i=Object.getPrototypeOf(i)}return!1}const d=new WeakSet;function u(t,e,i){if(d.has(t))return;d.add(t);const n=t.localName??"element";console.warn(`[wcs/input-as-attribute] <${n}> has the attribute ${e}="${i}": an object was written as an attribute, so the element did not receive it. A framework does that when the property is set before the element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, or assign the property through a ref (Vue: .prop). (Said once per element.)`,t)}class _ extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...l.wcBindable,inputs:[],commands:l.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new l(this),this._internals=this._initInternals(),this._wireStates({"wcs-contacts:loading-changed":t=>({loading:!0===t}),"wcs-contacts:cancelled-changed":t=>({cancelled:!0===t}),"wcs-contacts:error":t=>({error:null!=t})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const t=this.attachInternals();return t.states.add("wcs-probe"),t.states.delete("wcs-probe"),t}catch{return null}}_wireStates(t){if(null===this._internals)return;const e=this._internals.states;for(const[i,n]of Object.entries(t))this.addEventListener(i,t=>{const i=this.hasAttribute("debug-states");for(const[s,o]of Object.entries(n(t.detail))){try{o?e.add(s):e.delete(s)}catch{}i&&this.toggleAttribute(`data-wcs-state-${s}`,o)}})}get value(){return this._core.value}get loading(){return this._core.loading}get error(){return this._core.error}get cancelled(){return this._core.cancelled}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}select(t,e){return this._core.select(t,e)}connectedCallback(){!function(t){const e=t.constructor?.wcBindable,i=e?.inputs;if(void 0===i)return;const n=t.getAttribute;for(const e of i){const i=e.name,s="function"==typeof n?n.call(t,i.toLowerCase()):null;if(null!==s&&s.startsWith("[object ")&&u(t,i,s),!Object.prototype.hasOwnProperty.call(t,i))continue;if(!h(t,i))continue;const o=t,r=o[i];delete o[i],o[i]=r}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}const p=Symbol.for("wcstack.package"),g=new WeakSet;function m(t,e){Object.defineProperty(t,p,{value:e,configurable:!0})}function v(t,e,i,n,s){if(void 0!==n&&(i===n||i.prototype instanceof n))return;const o=i[p];if(o===s||g.has(t))return;g.add(t);const r=s.slice(0,s.lastIndexOf("@"));console.warn(`[${r}] [wcs/package-twice] <${e}> is already defined by ${o??`another copy of ${r} that does not name its version`}; this copy, ${s}, does nothing. Load each package once.`)}function f(n=customElements){!function(t,e,i){for(const[n,s]of i){const i=t.get(n);void 0===i?(m(s,e),t.define(n,s)):v(t,n,i,s,e)}}(n,`${e}@${i}`,[[t.tagNames.contacts,_]])}var b;f(b);
|
|
2
2
|
//# sourceMappingURL=auto.min.js.map
|
package/dist/index.esm.js
CHANGED
|
@@ -64,7 +64,7 @@ function setConfig(partialConfig) {
|
|
|
64
64
|
frozenConfig = null;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
var pkg = {"name":"@wcstack/contacts","version":"4.11.
|
|
67
|
+
var pkg = {"name":"@wcstack/contacts","version":"4.11.2"};
|
|
68
68
|
|
|
69
69
|
// ===========================================================================
|
|
70
70
|
// AUTO-GENERATED FILE - DO NOT EDIT.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wcstack/contacts",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.2",
|
|
4
4
|
"description": "Declarative Contact Picker component for Web Components. Framework-agnostic navigator.contacts.select() wrapper via wc-bindable-protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.esm.js",
|