@fluid-topics/ft-wc-utils 1.1.69 → 1.1.71
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
!function(){
|
|
2
|
-
|
|
1
|
+
"use strict";(()=>{if(!ShadowRoot.prototype.createElement){let m=window.HTMLElement,g=window.customElements.define,w=window.customElements.get,p=window.customElements,l=new WeakMap,h=new WeakMap,C=new WeakMap,k=new WeakMap;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(e,t){if(e=e.toLowerCase(),this._getDefinition(e)!==void 0)throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this._definitionsByClass.get(t)!==void 0)throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");let o=t.prototype.attributeChangedCallback,i=new Set(t.observedAttributes||[]);O(t,i,o);let r={elementClass:t,connectedCallback:t.prototype.connectedCallback,disconnectedCallback:t.prototype.disconnectedCallback,adoptedCallback:t.prototype.adoptedCallback,attributeChangedCallback:o,formAssociated:t.formAssociated,formAssociatedCallback:t.prototype.formAssociatedCallback,formDisabledCallback:t.prototype.formDisabledCallback,formResetCallback:t.prototype.formResetCallback,formStateRestoreCallback:t.prototype.formStateRestoreCallback,observedAttributes:i};this._definitionsByTag.set(e,r),this._definitionsByClass.set(t,r);let d=w.call(p,e);d||(d=L(e),g.call(p,e,d)),this===window.customElements&&(C.set(t,r),r.standInClass=d);let c=this._awaitingUpgrade.get(e);if(c){this._awaitingUpgrade.delete(e);for(let s of c)h.delete(s),R(s,r,!0)}let n=this._whenDefinedPromises.get(e);return n!==void 0&&(n.resolve(t),this._whenDefinedPromises.delete(e)),t}upgrade(){f.push(this),p.upgrade.apply(p,arguments),f.pop()}get(e){return this._definitionsByTag.get(e)?.elementClass}_getDefinition(e){return this._definitionsByTag.get(e)}whenDefined(e){let t=this._getDefinition(e);if(t!==void 0)return Promise.resolve(t.elementClass);let o=this._whenDefinedPromises.get(e);return o===void 0&&(o={},o.promise=new Promise(i=>o.resolve=i),this._whenDefinedPromises.set(e,o)),o.promise}_upgradeWhenDefined(e,t,o){let i=this._awaitingUpgrade.get(t);i||this._awaitingUpgrade.set(t,i=new Set),o?i.add(e):i.delete(e)}};let y;window.HTMLElement=function(){let t=y;if(t)return y=void 0,t;let o=C.get(this.constructor);if(!o)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return t=Reflect.construct(m,[],o.standInClass),Object.setPrototypeOf(t,this.constructor.prototype),l.set(t,o),t},window.HTMLElement.prototype=m.prototype;let A=e=>e===document||e instanceof ShadowRoot,T=e=>{let t=e.getRootNode();if(!A(t)){let o=f[f.length-1];if(o instanceof CustomElementRegistry)return o;t=o.getRootNode(),A(t)||(t=k.get(t)?.getRootNode()||document)}return t.customElements},L=e=>class{static get formAssociated(){return!0}constructor(){let o=Reflect.construct(m,[],this.constructor);Object.setPrototypeOf(o,HTMLElement.prototype);let i=T(o)||window.customElements,r=i._getDefinition(e);return r?R(o,r):h.set(o,i),o}connectedCallback(){let o=l.get(this);o?o.connectedCallback&&o.connectedCallback.apply(this,arguments):h.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){let o=l.get(this);o?o.disconnectedCallback&&o.disconnectedCallback.apply(this,arguments):h.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){l.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){let o=l.get(this);o&&o.formAssociated&&o?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){let o=l.get(this);o?.formAssociated&&o?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){let o=l.get(this);o?.formAssociated&&o?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){let o=l.get(this);o?.formAssociated&&o?.formStateRestoreCallback?.apply(this,arguments)}},O=(e,t,o)=>{if(t.size===0||o===void 0)return;let i=e.prototype.setAttribute;i&&(e.prototype.setAttribute=function(c,n){let s=c.toLowerCase();if(t.has(s)){let a=this.getAttribute(s);i.call(this,s,n),o.call(this,s,a,n)}else i.call(this,s,n)});let r=e.prototype.removeAttribute;r&&(e.prototype.removeAttribute=function(c){let n=c.toLowerCase();if(t.has(n)){let s=this.getAttribute(n);r.call(this,n),o.call(this,n,s,null)}else r.call(this,n)});let d=e.prototype.toggleAttribute;d&&(e.prototype.toggleAttribute=function(c,n){let s=c.toLowerCase();if(t.has(s)){let a=this.getAttribute(s);d.call(this,s,n);let u=this.getAttribute(s);o.call(this,s,a,u)}else d.call(this,s,n)})},M=e=>{let t=Object.getPrototypeOf(e);if(t!==window.HTMLElement)return t===m?Object.setPrototypeOf(e,window.HTMLElement):M(t)},R=(e,t,o=!1)=>{Object.setPrototypeOf(e,t.elementClass.prototype),l.set(e,t),y=e;try{new t.elementClass}catch{M(t.elementClass),new t.elementClass}t.attributeChangedCallback&&t.observedAttributes.forEach(i=>{e.hasAttribute(i)&&t.attributeChangedCallback.call(e,i,null,e.getAttribute(i))}),o&&t.connectedCallback&&e.isConnected&&t.connectedCallback.call(e)},S=Element.prototype.attachShadow;Element.prototype.attachShadow=function(e){let t=S.apply(this,arguments);return e.customElements&&(t.customElements=e.customElements),t};let f=[document],b=(e,t,o=void 0)=>{let i=(o?Object.getPrototypeOf(o):e.prototype)[t];e.prototype[t]=function(){f.push(this);let r=i.apply(o||this,arguments);return r!==void 0&&k.set(r,this),f.pop(),r}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");let _=(e,t)=>{let o=Object.getOwnPropertyDescriptor(e.prototype,t);Object.defineProperty(e.prototype,t,{...o,set(i){f.push(this),o.set.call(this,i),f.pop()}})};if(_(Element,"innerHTML"),_(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){let e=new WeakMap,t=HTMLElement.prototype.attachInternals,o=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...c){let n=t.call(this,...c);return e.set(n,this),n},o.forEach(c=>{let n=window.ElementInternals.prototype,s=n[c];n[c]=function(...a){let u=e.get(this);if(l.get(u).formAssociated===!0)return s?.call(this,...a);throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`)}});class i extends Array{constructor(n){super(...n),this._elements=n}get value(){return this._elements.find(n=>n.checked===!0)?.value||""}}class r{constructor(n){let s=new Map;n.forEach((a,u)=>{let E=a.getAttribute("name"),D=s.get(E)||[];this[+u]=a,D.push(a),s.set(E,D)}),this.length=n.length,s.forEach((a,u)=>{a&&(a.length===1?this[u]=a[0]:this[u]=new i(a))})}namedItem(n){return this[n]}}let d=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){let c=d.get.call(this,[]),n=[];for(let s of c){let a=l.get(s);(!a||a.formAssociated===!0)&&n.push(s)}return new r(n)}})}}try{window.customElements.define("custom-element",null)}catch{let g=window.customElements.define;window.customElements.define=(w,p,l)=>{if(p!==null)try{g.bind(window.customElements)(w,p,l)}catch(h){console.info(w,p,l,h)}}}})();
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@webcomponents/scoped-custom-element-registry/src/scoped-custom-element-registry.js:
|
|
5
|
+
(**
|
|
3
6
|
* @license
|
|
4
7
|
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
5
8
|
* This code may only be used under the BSD style license found at
|
|
@@ -11,5 +14,5 @@
|
|
|
11
14
|
* Code distributed by Google as part of the polymer project is also
|
|
12
15
|
* subject to an additional IP rights grant found at
|
|
13
16
|
* http://polymer.github.io/PATENTS.txt
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
*)
|
|
18
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-wc-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.71",
|
|
4
4
|
"description": "Internal web components tools",
|
|
5
5
|
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@floating-ui/dom": "1.5.3",
|
|
17
17
|
"@fluid-topics/design-system-variables": "0.0.22",
|
|
18
|
-
"@fluid-topics/public-api": "1.0.
|
|
18
|
+
"@fluid-topics/public-api": "1.0.68",
|
|
19
19
|
"@reduxjs/toolkit": "1.9.5",
|
|
20
20
|
"@types/mark.js": "8.11.12",
|
|
21
21
|
"@webcomponents/scoped-custom-element-registry": "0.0.9",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"lit": "3.1.0",
|
|
24
24
|
"mark.js": "8.11.1"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "5a82d22034c3b754567fe0c39a3e5414321aa58a"
|
|
27
27
|
}
|